From 24952d557fd9417458391aea79c38df9a1dc258e Mon Sep 17 00:00:00 2001 From: Grigory Ivanov Date: Mon, 11 Mar 2024 11:37:53 +0300 Subject: [PATCH] Rebuild --- docs/asset-manifest.json | 6 +++--- docs/index.html | 2 +- docs/static/js/{main.65f2832f.js => main.28ff7e83.js} | 6 +++--- ...65f2832f.js.LICENSE.txt => main.28ff7e83.js.LICENSE.txt} | 0 .../js/{main.65f2832f.js.map => main.28ff7e83.js.map} | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) rename docs/static/js/{main.65f2832f.js => main.28ff7e83.js} (99%) rename docs/static/js/{main.65f2832f.js.LICENSE.txt => main.28ff7e83.js.LICENSE.txt} (100%) rename docs/static/js/{main.65f2832f.js.map => main.28ff7e83.js.map} (98%) diff --git a/docs/asset-manifest.json b/docs/asset-manifest.json index cef554c..6ac1812 100644 --- a/docs/asset-manifest.json +++ b/docs/asset-manifest.json @@ -1,13 +1,13 @@ { "files": { "main.css": "./static/css/main.35b6dbc2.css", - "main.js": "./static/js/main.65f2832f.js", + "main.js": "./static/js/main.28ff7e83.js", "index.html": "./index.html", "main.35b6dbc2.css.map": "./static/css/main.35b6dbc2.css.map", - "main.65f2832f.js.map": "./static/js/main.65f2832f.js.map" + "main.28ff7e83.js.map": "./static/js/main.28ff7e83.js.map" }, "entrypoints": [ "static/css/main.35b6dbc2.css", - "static/js/main.65f2832f.js" + "static/js/main.28ff7e83.js" ] } \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index e5390e3..81e53b2 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1 +1 @@ -Simple AMM LP
\ No newline at end of file +Simple AMM LP
\ No newline at end of file diff --git a/docs/static/js/main.65f2832f.js b/docs/static/js/main.28ff7e83.js similarity index 99% rename from docs/static/js/main.65f2832f.js rename to docs/static/js/main.28ff7e83.js index 5259153..99e9cdb 100644 --- a/docs/static/js/main.65f2832f.js +++ b/docs/static/js/main.28ff7e83.js @@ -1,3 +1,3 @@ -/*! For license information please see main.65f2832f.js.LICENSE.txt */ -(()=>{var __webpack_modules__={4762:e=>{"use strict";e.exports=function(e,t){var r=new Array(arguments.length-1),n=0,i=2,a=!0;for(;i{"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),a=0;a<64;)i[n[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++;r.encode=function(e,t,r){for(var i,a=null,o=[],s=0,u=0;t>2],i=(3&l)<<4,u=1;break;case 1:o[s++]=n[i|l>>4],i=(15&l)<<2,u=2;break;case 2:o[s++]=n[i|l>>6],o[s++]=n[63&l],u=0}s>8191&&((a||(a=[])).push(String.fromCharCode.apply(String,o)),s=0)}return u&&(o[s++]=n[i],o[s++]=61,1===u&&(o[s++]=61)),a?(s&&a.push(String.fromCharCode.apply(String,o.slice(0,s))),a.join("")):String.fromCharCode.apply(String,o.slice(0,s))};var o="invalid encoding";r.decode=function(e,t,r){for(var n,a=r,s=0,u=0;u1)break;if(void 0===(l=i[l]))throw Error(o);switch(s){case 0:n=l,s=1;break;case 1:t[r++]=n<<2|(48&l)>>4,n=l,s=2;break;case 2:t[r++]=(15&n)<<4|(60&l)>>2,n=l,s=3;break;case 3:t[r++]=(3&n)<<6|l,s=0}}if(1===s)throw Error(o);return r-a},r.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},7351: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{"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 a(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 o(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:a,e.writeFloatBE=n?a:i,e.readFloatLE=n?o:s,e.readFloatBE=n?s:o}():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 a=Math.floor(Math.log(t)/Math.LN2);e((i<<31|a+127<<23|8388607&Math.round(t*Math.pow(2,-a)*8388608))>>>0,r,n)}}function o(e,t,r){var n=e(t,r),i=2*(n>>31)+1,a=n>>>23&255,o=8388607&n;return 255===a?o?NaN:i*(1/0):0===a?1401298464324817e-60*i*o:i*Math.pow(2,a-150)*(o+8388608)}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,n),e.readFloatLE=o.bind(null,i),e.readFloatBE=o.bind(null,a)}(),"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 a(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 o(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:a,e.writeDoubleBE=n?a:i,e.readDoubleLE=n?o:s,e.readDoubleBE=n?s:o}():function(){function t(e,t,r,n,i,a){var o=n<0?1:0;if(o&&(n=-n),0===n)e(0,i,a+t),e(1/n>0?0:2147483648,i,a+r);else if(isNaN(n))e(0,i,a+t),e(2146959360,i,a+r);else if(n>17976931348623157e292)e(0,i,a+t),e((o<<31|2146435072)>>>0,i,a+r);else{var s;if(n<22250738585072014e-324)e((s=n/5e-324)>>>0,i,a+t),e((o<<31|s/4294967296)>>>0,i,a+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,a+t),e((o<<31|u+1023<<20|1048576*s&1048575)>>>0,i,a+r)}}}function o(e,t,r,n,i){var a=e(n,i+t),o=e(n,i+r),s=2*(o>>31)+1,u=o>>>20&2047,l=4294967296*(1048575&o)+a;return 2047===u?l?NaN:s*(1/0):0===u?5e-324*s*l:s*Math.pow(2,u-1075)*(l+4503599627370496)}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,n,4,0),e.readDoubleLE=o.bind(null,i,0,4),e.readDoubleBE=o.bind(null,a,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 a(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},4882: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},6931:e=>{"use strict";e.exports=function(e,t,r){var n=r||8192,i=n>>>1,a=null,o=n;return function(r){if(r<1||r>i)return e(r);o+r>n&&(a=e(n),o=0);var s=t.call(a,o,o+=r);return 7&o&&(o=1+(7|o)),s}}},8626:(e,t)=>{"use strict";var r=t;r.length=function(e){for(var t=0,r=0,n=0;n191&&n<224?a[o++]=(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,a[o++]=55296+(n>>10),a[o++]=56320+(1023&n)):a[o++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],o>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),o=0);return i?(o&&i.push(String.fromCharCode.apply(String,a.slice(0,o))),i.join("")):String.fromCharCode.apply(String,a.slice(0,o))},r.write=function(e,t,r){for(var n,i,a=r,o=0;o>6|192,t[r++]=63&n|128):55296===(64512&n)&&56320===(64512&(i=e.charCodeAt(o+1)))?(n=65536+((1023&n)<<10)+(1023&i),++o,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-a}},3878:function(e){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){"use strict";r.r(t);var n=["info","log","warn","error"],i={keepMessageCount:100,keepMessageTypes:["error"],logMessageTypes:["error"],namespace:void 0},a=function(e){return e.reduce((function(e,t){return e[t]=!0,e}),Object.create(null))},o=function(){function e(e){this._messages=[],this._maxLength=e}return e.prototype.push=function(e){this._messages.push(e),this._messages.length>this._maxLength&&this._messages.splice(0,this._messages.length-this._maxLength)},e.prototype.getMessages=function(e){var t,r,i=a(null!=(r=null===(t=e)||void 0===t?void 0:t.messageTypes)?r:n);return this._messages.filter((function(e){return i[e.type]}))},e}();function s(e){return e}r.d(t,"makeConsole",(function(){return c})),r.d(t,"version",(function(){return f})),r.d(t,"makeOptions",(function(){return h}));var u=function(){return(u=Object.assign||function(e){for(var t,r=1,n=arguments.length;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2038),i=r(3780),a=r(2009),o=r(4702);t.json=o;const s=r(1438);t.serializePrimitives=s;const u=r(5471);t.parsePrimitives=u;const l=r(2038);t.schemas=l;const c={serializerFromSchema:i.serializerFromSchema,serializeTx:i.serializeTx,serializeOrder:i.serializeOrder,parserFromSchema:a.parserFromSchema,parseTx:a.parseTx,parseOrder:a.parseOrder};function f(e,t,r,n){const o=i.serializerFromSchema(t,n),s=a.parserFromSchema(t,r)(o(e)).value;return Object.assign({},e,s)}t.binary=c,t.convertLongFields=f,t.convertTxLongFields=function(e,t,r){const{type:i,version:a}=e;return f(e,n.getTransactionSchema(i,a),t,r)}},4702:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1698),{parse:i,stringify:a}=n(),o=r(2038),s=r(1438),u=r(6106);function l(e,t){return 0===e.length?t:"object"===typeof t?l(e.slice(1),t[e[0]]):void 0}const c=(e,t,r)=>function t(n,i){if(null==i)return!1;if(0===n.length&&("primitive"===i.type||void 0===i.type))return i.toBytes===s.LONG;if("object"===i.type){const e=i.schema.find((e=>{let[t,r]=e;return t===n[0]}));return t(n.slice(1),e&&e[1])}if("array"===i.type)return t(n.slice(1),i.items);if("dataTxField"===i.type){if("value"!==n[0])return!1;const a=l(e.slice(0,e.length-1),r),o=i.items.get(a.type);return t(n.slice(1),o)}if("anyOf"===i.type){const a=l(e.slice(0,e.length-1),r)[i.discriminatorField],o=i.itemByKey(a);return!!o&&(null!=i.valueField&&e[e.length-1]===i.valueField?t(n.slice(1),o.schema):t(n,o.schema))}return!1}(e,t);function f(e,t){const r=[],n=[];function i(o){return"string"===typeof o&&c(r,t,e)?o:"boolean"===typeof o||o instanceof Boolean||null===o||"number"===typeof o||o instanceof Number||"string"===typeof o||o instanceof String||o instanceof Date?JSON.stringify(o):Array.isArray(o)?function(e){let t="[";const a=n.length;n[a]=e;for(let n=0;n{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.Utf8ArrayToStr=function(){var e=new Array(128),t=String.fromCodePoint||String.fromCharCode,r=[];return function(n){var i,a,o=n.length;r.length=0;for(var s=0;s{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",n=r.split("").reduce(((e,t,r)=>(e[t]=r,e)),{});t.default={encode(e){if(!e.length)return"";const t=[0];for(let r=0;r>8,t[e]&=255;for(;a;)t.push(255&a),a>>=8}for(let r=0;"1"===e[r]&&r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concat=function(){for(var e=arguments.length,t=new Array(e),r=0;rUint8Array.from([...e,...t])),new Uint8Array(0))},t.range=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Array.from({length:t-e}).map(((t,n)=>n*r+e))}},2009:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5471),i=r(9202),a=r(2038);t.parserFromSchema=(e,r)=>function(a){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,s=o;if("array"===e.type){const u=[],{value:l,shift:c}=(e.fromBytes||n.P_SHORT)(a,o);return s+=c,i.range(0,l).forEach((n=>{const i=t.parserFromSchema(e.items,r),{value:o,shift:l}=i(a,s);u.push(o),s+=l})),{value:u,shift:s-o}}if("object"===e.type){if(e.optional){const e=1===a[s];if(s+=1,!e)return{value:void 0,shift:1}}if(e.withLength){const t=e.withLength.fromBytes(a,s);s+=t.shift}const n={};return e.schema.forEach((e=>{const[i,o]=e,u=t.parserFromSchema(o,r),{value:l,shift:c}=u(a,s);s+=c,void 0!==l&&(Array.isArray(i)?Object.assign(n,l):n[i]=l)})),{value:n,shift:s-o}}if("anyOf"===e.type){const i=(e.fromBytes||n.P_BYTE)(a,s+e.discriminatorBytePos);e.valueField&&0===e.discriminatorBytePos&&(s+=i.shift);const u=e.itemByByteKey(i.value);if(null==u)throw new Error("Failed to get schema for item with bytecode: ".concat(i.value));const l=t.parserFromSchema(u.schema,r),{value:c,shift:f}=l(a,s);return s+=f,{value:e.valueField?{[e.discriminatorField]:u.strKey,[e.valueField]:c}:c,shift:s-o}}if("dataTxField"===e.type){const i=n.byteToStringWithLength(a,s);s+=i.shift;let o=n.P_BYTE(a,s);s+=o.shift;const u=[...e.items].find(((e,t)=>t===o.value));if(!u)throw new Error("Parser Error: Unknown dataTxField type: ".concat(o.value));const l=t.parserFromSchema(u[1],r)(a,s);return{value:{value:l.value,key:i.value,type:u[0]},shift:l.shift+i.shift+o.shift}}if("primitive"===e.type||void 0===e.type){const t=e.fromBytes;let{value:i,shift:s}=t(a,o);return t===n.P_LONG&&r&&(i=r(i)),{value:i,shift:s}}throw new Error("Parser Error: Unknown schema type: ".concat(e.type))},t.parseHeader=e=>{let t=0,r=n.P_BYTE(e,t);t+=r.shift,0===r.value&&(r=n.P_BYTE(e,t),t+=r.shift);let i=n.P_BYTE(e,t);return{type:r.value,version:i.value}},t.parseTx=function(e,r){const{type:n,version:i}=t.parseHeader(e),o=a.getTransactionSchema(n,i);return t.parserFromSchema(o,r)(e).value},t.parseOrder=function(e,r){return t.parserFromSchema(a.orderSchemaV2,r)(e).value}},5471:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(7353),i=r(1339),a=r(3515),o=r(4445);t.ALIAS_VERSION=2;t.P_OPTION=e=>function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0===t[r])return{value:null,shift:1};const n=e(t,r+1);return{value:n.value,shift:n.shift+1}},t.P_BYTE=function(e){return{value:e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0],shift:1}},t.P_SHORT=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{value:256*e[t]+e[t+1],shift:2}},t.P_INT=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{value:Math.pow(2,24)*e[t]+Math.pow(2,16)*e[t+1]+Math.pow(2,8)*e[t+2]+e[t+3],shift:4}},t.P_LONG=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{value:n.fromBytesBE(Array.from(e.slice(t,t+8))).toString(),shift:8}},t.P_BOOLEAN=function(e){return{value:!!e[arguments.length>1&&void 0!==arguments[1]?arguments[1]:0],shift:1}},t.P_STRING_FIXED=e=>function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=i.Utf8ArrayToStr(t.slice(r,r+e));return{shift:e,value:n}},t.P_STRING_VAR=e=>function(r){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const i=e(r,n),{value:a}=t.P_STRING_FIXED(i.value)(r,n+i.shift);return{shift:i.value+i.shift,value:a}},t.P_BASE58_FIXED=e=>function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{value:a.default.encode(t.slice(r,r+e)),shift:e}},t.P_BASE58_VAR=e=>function(r){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const i=e(r,n),{value:a}=t.P_BASE58_FIXED(i.value)(r,n+2);return{shift:i.value+2,value:a}},t.P_BASE64=e=>function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=e(t,r),i="base64:".concat(o.fromByteArray(t.slice(r+n.shift,r+n.shift+n.value)));return{shift:n.value+n.shift,value:i}};t.byteToStringWithLength=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=t.P_SHORT(e,r),{value:a}=(o=n.value,(e,t)=>{const r=i.Utf8ArrayToStr(e.slice(t,t+o));return{shift:o,value:r}})(e,r+2);var o;return{shift:n.value+2,value:a}},t.byteToBase58=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=(arguments.length>2?arguments[2]:void 0)||32;return{value:a.default.encode(e.slice(t,t+r)),shift:r}},t.byteToBase58WithLength=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=t.P_SHORT(e,r);return{value:a.default.encode(e.slice(r+n.shift,r+n.shift+n.value)),shift:n.shift+n.value}},t.byteToAddressOrAlias=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e[r]===t.ALIAS_VERSION){const n=t.byteToStringWithLength(e,r+2);return{shift:n.shift+2,value:"alias:".concat(String.fromCharCode(e[r+1]),":").concat(n.value)}}return t.byteToBase58(e,r,26)},t.byteNewAliasToString=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=t.P_SHORT(e,r).value+2,{value:i}=t.byteToStringWithLength(e,r);return{shift:n,value:i}},t.byteToScript=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(0===e[r])return{shift:1,value:null};const n=t.P_SHORT(e,r+1),i=r+1+n.shift,a=r+1+n.shift+n.value;return{value:"base64:".concat(o.fromByteArray(e.slice(i,a))),shift:a-r}}},2254:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){e.INTEGER="integer",e.BOOLEAN="boolean",e.STRING="string",e.BINARY="binary"}(t.DATA_FIELD_TYPE||(t.DATA_FIELD_TYPE={})),t.anyOf=function(e,t){return new r(e,t)};class r{constructor(e,t){this._items=e,this.type="anyOf",this.discriminatorField="type",this.discriminatorBytePos=0,Object.assign(this,t)}itemByKey(e){const t=this._items.find((t=>{let[r,n,i]=t;return i===e||r==e}));return t&&{schema:t[1],key:t[0],strKey:t[2]}}itemByByteKey(e){const t=this._items.find((t=>{let[r,n]=t;return r===e}));return t&&{schema:t[1],key:t[0],strKey:t[2]||t[0].toString(10)}}}},2038:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1438),i=r(5471),a=r(2254),o=r(3780);var s;!function(e){e[e.GENESIS=1]="GENESIS",e[e.PAYMENT=2]="PAYMENT",e[e.ISSUE=3]="ISSUE",e[e.TRANSFER=4]="TRANSFER",e[e.REISSUE=5]="REISSUE",e[e.BURN=6]="BURN",e[e.EXCHANGE=7]="EXCHANGE",e[e.LEASE=8]="LEASE",e[e.CANCEL_LEASE=9]="CANCEL_LEASE",e[e.ALIAS=10]="ALIAS",e[e.MASS_TRANSFER=11]="MASS_TRANSFER",e[e.DATA=12]="DATA",e[e.SET_SCRIPT=13]="SET_SCRIPT",e[e.SPONSORSHIP=14]="SPONSORSHIP",e[e.SET_ASSET_SCRIPT=15]="SET_ASSET_SCRIPT",e[e.INVOKE_SCRIPT=16]="INVOKE_SCRIPT"}(s=t.TRANSACTION_TYPE||(t.TRANSACTION_TYPE={}));const u={toBytes:n.SHORT,fromBytes:i.P_SHORT},l={toBytes:n.INT,fromBytes:i.P_INT};var c;!function(e){e.longField=e=>[e,{toBytes:n.LONG,fromBytes:i.P_LONG}],e.byteField=e=>[e,{toBytes:n.BYTE,fromBytes:i.P_BYTE}],e.booleanField=e=>[e,{toBytes:n.BOOL,fromBytes:i.P_BOOLEAN}],e.stringField=e=>[e,{toBytes:n.LEN(n.SHORT)(n.STRING),fromBytes:i.P_STRING_VAR(i.P_SHORT)}],e.base58field32=e=>[e,{toBytes:n.BASE58_STRING,fromBytes:i.P_BASE58_FIXED(32)}],e.base58Option32=e=>[e,{toBytes:e=>"WAVES"===e?n.OPTION(n.BASE58_STRING)(null):n.OPTION(n.BASE58_STRING)(e),fromBytes:i.P_OPTION(i.P_BASE58_FIXED(32))}],e.base64field=e=>[e,{toBytes:n.LEN(n.SHORT)(n.BASE64_STRING),fromBytes:i.P_BASE64(i.P_SHORT)}],e.byteConstant=e=>["noname",{toBytes:()=>Uint8Array.from([e]),fromBytes:()=>({value:void 0,shift:1})}],e.alias=["alias",{toBytes:n.LEN(n.SHORT)(n.STRING),fromBytes:i.byteNewAliasToString}],e.amount=e.longField("amount"),e.assetDescription=e.stringField("description"),e.assetId=e.base58field32("assetId"),e.assetName=e.stringField("name"),e.attachment=["attachment",{toBytes:n.LEN(n.SHORT)(n.BASE58_STRING),fromBytes:i.P_BASE58_VAR(i.P_SHORT)}],e.chainId=e.byteField("chainId"),e.decimals=e.byteField("decimals"),e.fee=e.longField("fee"),e.leaseAssetId=e.base58Option32("leaseAssetId"),e.leaseId=e.base58field32("leaseId"),e.optionalAssetId=e.base58Option32("assetId"),e.quantity=e.longField("quantity"),e.reissuable=e.booleanField("reissuable"),e.recipient=["recipient",{toBytes:n.ADDRESS_OR_ALIAS,fromBytes:i.byteToAddressOrAlias}],e.script=["script",{toBytes:n.SCRIPT,fromBytes:i.byteToScript}],e.senderPublicKey=e.base58field32("senderPublicKey"),e.signature=["signature",{toBytes:n.BASE58_STRING,fromBytes:i.P_BASE58_FIXED(64)}],e.timestamp=e.longField("timestamp"),e.type=e.byteField("type"),e.version=e.byteField("version"),e.proofs=["proofs",{type:"array",items:{toBytes:n.LEN(n.SHORT)(n.BASE58_STRING),fromBytes:i.P_BASE58_VAR(i.P_SHORT)}}];const t={type:"object",schema:[e.recipient,e.amount]};e.transfers=["transfers",{type:"array",items:t}];const r={type:"dataTxField",items:new Map([[a.DATA_FIELD_TYPE.INTEGER,{toBytes:n.LONG,fromBytes:i.P_LONG}],[a.DATA_FIELD_TYPE.BOOLEAN,{toBytes:n.BOOL,fromBytes:i.P_BOOLEAN}],[a.DATA_FIELD_TYPE.BINARY,{toBytes:n.LEN(n.SHORT)(n.BASE64_STRING),fromBytes:i.P_BASE64(i.P_SHORT)}],[a.DATA_FIELD_TYPE.STRING,{toBytes:n.LEN(n.SHORT)(n.STRING),fromBytes:i.P_STRING_VAR(i.P_SHORT)}]])};e.data=["data",{type:"array",items:r}];const o=[[0,{toBytes:n.LONG,fromBytes:i.P_LONG},"integer"],[1,{toBytes:n.LEN(n.INT)(n.BASE64_STRING),fromBytes:i.P_BASE64(i.P_INT)},"binary"],[2,{toBytes:n.LEN(n.INT)(n.STRING),fromBytes:i.P_STRING_VAR(i.P_INT)},"string"],[6,{toBytes:()=>Uint8Array.from([]),fromBytes:()=>({value:!0,shift:0})},"boolean"],[7,{toBytes:()=>Uint8Array.from([]),fromBytes:()=>({value:!1,shift:0})},"boolean"]],s=a.anyOf([...o,[11,{type:"array",toBytes:n.INT,fromBytes:i.P_INT,items:a.anyOf(o,{valueField:"value"})},"list"]],{valueField:"value"});e.functionCall=["call",{type:"object",optional:!0,schema:[e.byteConstant(9),e.byteConstant(1),["function",{toBytes:n.LEN(n.INT)(n.STRING),fromBytes:i.P_STRING_VAR(i.P_INT)}],["args",{type:"array",toBytes:n.INT,fromBytes:i.P_INT,items:s}]]}],e.payment={type:"object",withLength:u,schema:[e.amount,e.optionalAssetId]},e.payments=["payment",{type:"array",items:e.payment}]}(c=t.txFields||(t.txFields={})),t.orderSchemaV1={type:"object",schema:[c.senderPublicKey,c.base58field32("matcherPublicKey"),["assetPair",{type:"object",schema:[c.base58Option32("amountAsset"),c.base58Option32("priceAsset")]}],["orderType",{toBytes:e=>n.BYTE("sell"===e?1:0),fromBytes:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return 1===i.P_BYTE(e,t).value?{value:"sell",shift:1}:{value:"buy",shift:1}}}],c.longField("price"),c.longField("amount"),c.timestamp,c.longField("expiration"),c.longField("matcherFee")]},t.orderSchemaV2={type:"object",schema:[c.version,...t.orderSchemaV1.schema]},t.orderSchemaV3={type:"object",schema:[...t.orderSchemaV2.schema,["matcherFeeAssetId",c.optionalAssetId[1]]]},t.aliasSchemaV2={type:"object",schema:[c.type,c.version,c.senderPublicKey,[["alias","chainId"],{type:"object",withLength:u,schema:[c.byteConstant(2),c.chainId,c.alias]}],c.fee,c.timestamp]},t.burnSchemaV2={type:"object",schema:[c.type,c.version,c.chainId,c.senderPublicKey,c.assetId,c.amount,c.fee,c.timestamp]},t.cancelLeaseSchemaV2={type:"object",schema:[c.type,c.version,c.chainId,c.senderPublicKey,c.fee,c.timestamp,c.leaseId]},t.invokeScriptSchemaV1={type:"object",schema:[c.type,c.version,c.chainId,c.senderPublicKey,["dApp",c.recipient[1]],c.functionCall,c.payments,c.fee,["feeAssetId",c.optionalAssetId[1]],c.timestamp]},t.dataSchemaV1={type:"object",schema:[c.type,c.version,c.senderPublicKey,c.data,c.timestamp,c.fee]},t.proofsSchemaV0={type:"object",schema:[["signature",{toBytes:n.BASE58_STRING,fromBytes:i.P_BASE58_FIXED(64)}]]},t.proofsSchemaV1={type:"object",schema:[c.byteConstant(1),c.proofs]};const f={type:"object",schema:[...t.orderSchemaV1.schema,c.signature]};t.exchangeSchemaV1={type:"object",schema:[c.type,["order1",{fromBytes:()=>({value:void 0,shift:4}),toBytes:e=>n.INT(o.serializerFromSchema(f)(e).length)}],["order2",{fromBytes:()=>({value:void 0,shift:4}),toBytes:e=>n.INT(o.serializerFromSchema(f)(e).length)}],["order1",f],["order2",f],c.longField("price"),c.longField("amount"),c.longField("buyMatcherFee"),c.longField("sellMatcherFee"),c.longField("fee"),c.longField("timestamp")]};const h=a.anyOf([[1,{type:"object",withLength:{toBytes:e=>n.INT(e-1),fromBytes:e=>{const{value:t,shift:r}=i.P_INT(e);return{value:t+1,shift:r}}},schema:[c.byteConstant(1),...t.orderSchemaV1.schema,...t.proofsSchemaV0.schema]}],[2,{type:"object",withLength:l,schema:[...t.orderSchemaV2.schema,...t.proofsSchemaV1.schema]}],[3,{type:"object",withLength:l,schema:[...t.orderSchemaV3.schema,...t.proofsSchemaV1.schema]}]],{discriminatorField:"version",discriminatorBytePos:4});t.exchangeSchemaV2={type:"object",schema:[c.byteConstant(0),c.type,c.version,["order1",h],["order2",h],c.longField("price"),c.longField("amount"),c.longField("buyMatcherFee"),c.longField("sellMatcherFee"),c.longField("fee"),c.longField("timestamp")]},t.issueSchemaV2={type:"object",schema:[c.type,c.version,c.chainId,c.senderPublicKey,c.assetName,c.assetDescription,c.quantity,c.decimals,c.reissuable,c.fee,c.timestamp,c.script]},t.leaseSchemaV2={type:"object",schema:[c.type,c.version,c.leaseAssetId,c.senderPublicKey,c.recipient,c.amount,c.fee,c.timestamp]},t.massTransferSchemaV1={type:"object",schema:[c.type,c.version,c.senderPublicKey,c.optionalAssetId,c.transfers,c.timestamp,c.fee,c.attachment]},t.reissueSchemaV2={type:"object",schema:[c.type,c.version,c.chainId,c.senderPublicKey,c.assetId,c.quantity,c.reissuable,c.fee,c.timestamp]},t.setAssetScriptSchemaV1={type:"object",schema:[c.type,c.version,c.chainId,c.senderPublicKey,c.assetId,c.fee,c.timestamp,c.script]},t.setScriptSchemaV1={type:"object",schema:[c.type,c.version,c.chainId,c.senderPublicKey,c.script,c.fee,c.timestamp]},t.sponsorshipSchemaV1={type:"object",schema:[c.type,c.version,c.senderPublicKey,c.assetId,c.longField("minSponsoredAssetFee"),c.fee,c.timestamp]},t.transferSchemaV2={type:"object",schema:[c.type,c.version,c.senderPublicKey,c.optionalAssetId,["feeAssetId",c.optionalAssetId[1]],c.timestamp,c.amount,c.fee,c.recipient,c.attachment]},t.schemasByTypeMap={[s.GENESIS]:{},[s.PAYMENT]:{},[s.ISSUE]:{2:t.issueSchemaV2},[s.TRANSFER]:{2:t.transferSchemaV2},[s.REISSUE]:{2:t.reissueSchemaV2},[s.BURN]:{2:t.burnSchemaV2},[s.EXCHANGE]:{1:t.exchangeSchemaV1,2:t.exchangeSchemaV2},[s.LEASE]:{2:t.leaseSchemaV2},[s.CANCEL_LEASE]:{2:t.cancelLeaseSchemaV2},[s.ALIAS]:{2:t.aliasSchemaV2},[s.MASS_TRANSFER]:{1:t.massTransferSchemaV1},[s.DATA]:{1:t.dataSchemaV1},[s.SET_SCRIPT]:{1:t.setScriptSchemaV1},[s.SPONSORSHIP]:{1:t.sponsorshipSchemaV1},[s.SET_ASSET_SCRIPT]:{1:t.setAssetScriptSchemaV1},[s.INVOKE_SCRIPT]:{1:t.invokeScriptSchemaV1}},t.orderVersionMap={1:t.orderSchemaV1,2:t.orderSchemaV2,3:t.orderSchemaV3},t.getTransactionSchema=function(e,r){const n=t.schemasByTypeMap[e];if("object"!==typeof n)throw new Error("Incorrect tx type: ".concat(e));const i=n[r||1];if("object"!==typeof i)throw new Error("Incorrect tx version: ".concat(r));return i}},3780:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(1438),i=r(9202),a=r(2038);t.serializerFromSchema=(e,r)=>a=>{let o,s;if("array"===e.type)return o=t.serializerFromSchema(e.items,r),s=i.concat(...a.map((e=>o(e)))),i.concat((e.toBytes||n.SHORT)(a.length),s);if("object"===e.type){let n=Uint8Array.from([]);if(e.optional&&null==a)return Uint8Array.from([0]);if(e.schema.forEach((e=>{const[u,l]=e;let c;c=Array.isArray(u)?u.reduce(((e,t)=>Object.assign({},e,{[t]:a[t]})),{}):a[u],o=t.serializerFromSchema(l,r),s=o(c),n=i.concat(n,s)})),e.withLength){const t=e.withLength.toBytes(n.length);n=i.concat(t,n)}return e.optional&&(n=i.concat([1],n)),n}if("anyOf"===e.type){const u=a[e.discriminatorField],l=e.itemByKey(u);if(null==l)throw new Error("Serializer Error: Unknown anyOf type: ".concat(u));return"boolean"===l.strKey&&6===l.key&&!1===a.value&&(l.key=7),o=t.serializerFromSchema(l.schema,r),null==e.valueField?o(a):(s=o(a[e.valueField]),i.concat((e.toBytes||n.BYTE)(l.key),s))}if("primitive"===e.type||void 0===e.type)return e.toBytes(a);if("dataTxField"===e.type){const u=n.LEN(n.SHORT)(n.STRING)(a.key),l=a.type,c=e.items.get(l);if(null==c)throw new Error("Serializer Error: Unknown dataTxField type: ".concat(l));const f=[...e.items.values()].findIndex((e=>e===c));return o=t.serializerFromSchema(c,r),s=o(a.value),i.concat(u,n.BYTE(f),s)}throw new Error("Serializer Error: Unknown schema type: ".concat(e.type))},t.serializeTx=function(e,r){const{type:n,version:i}=e,o=a.getTransactionSchema(n,i);return t.serializerFromSchema(o,r)(e)},t.serializeOrder=function(e,r){const n=e.version||1,i=a.orderVersionMap[n];if(null==i)throw new Error("Unknown order version: ".concat(n));return t.serializerFromSchema(i,r)(e)}},1438:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(3515),i=r(4445),a=r(9202),o=r(7353);t.empty=Uint8Array.from([]),t.zero=Uint8Array.from([0]),t.one=Uint8Array.from([1]),t.BASE58_STRING=e=>n.default.decode(e),t.BASE64_STRING=e=>i.toByteArray(e.replace("base64:","")),t.STRING=e=>{return e?(r=e,Uint8Array.from([...unescape(encodeURIComponent(r))].map((e=>e.charCodeAt(0))))):t.empty;var r},t.BYTE=e=>Uint8Array.from([e]),t.BOOL=e=>t.BYTE(1==e?1:0),t.BYTES=e=>Uint8Array.from(e),t.SHORT=e=>{const t=o.fromNumber(e,!0);return Uint8Array.from(t.toBytesBE().slice(6))},t.INT=e=>{const t=o.fromNumber(e,!0);return Uint8Array.from(t.toBytesBE().slice(4))},t.OPTION=e=>r=>null==r||"string"==typeof r&&0==r.length?t.zero:a.concat(t.one,e(r)),t.LEN=e=>t=>r=>{const n=t(r),i=e(n.length);return a.concat(i,n)},t.COUNT=e=>t=>r=>{const n=a.concat(...r.map((e=>t(e)))),i=e(r.length);return a.concat(i,n)},t.LONG=e=>{let t;if("number"===typeof e){if(e>Math.pow(2,53)-1)throw new Error("".concat(e," is too big to be precisely represented as js number. Use string instead"));t=o.fromNumber(e)}else t=o.fromString(e.toString());return Uint8Array.from(t.toBytesBE())},t.SCRIPT=e=>t.OPTION(t.LEN(t.SHORT)(t.BASE64_STRING))(e?e.slice(7):null),t.ALIAS=e=>{const[r,n,i]=e.split(":");if(!n||1!==n.length)throw new Error("Invalid network byte in alias");if(!i||0===i.length)throw new Error("Invalid alias body");return a.concat([2],[n.charCodeAt(0)],t.LEN(t.SHORT)(t.STRING)(i))},t.ADDRESS_OR_ALIAS=e=>e.startsWith("alias")?t.ALIAS(e):t.BASE58_STRING(e)},2812:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]0)&&!(n=a.next()).done;)o.push(n.value)}catch(s){i={error:s}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.broadcast=t.fetchStatus=t.fetchMultipleInfo=t.fetchInfo=t.fetchUnconfirmedInfo=t.fetchTransactions=t.fetchUnconfirmed=t.fetchCalculateFee=t.fetchUnconfirmedSize=void 0;var o=r(5894),s=r(3338),u=a(r(6406)),l=a(r(1047)),c=r(7610),f=a(r(1830));function h(e,t,r){return void 0===r&&(r=Object.create(null)),u.default({base:e,url:"/transactions/unconfirmed/info/"+t,options:r})}function d(e,t,r){return void 0===r&&(r=Object.create(null)),u.default({base:e,url:"/transactions/info/"+t,options:r})}t.fetchUnconfirmedSize=function(e){return u.default({base:e,url:"/transactions/unconfirmed/size"})},t.fetchCalculateFee=function(e,t,r){return void 0===r&&(r=Object.create(null)),u.default({base:e,url:"/transactions/calculateFee",options:c.deepAssign(n({},r),{method:"POST",body:f.default(t),headers:{"Content-Type":"application/json"}})})},t.fetchUnconfirmed=function(e,t){return void 0===t&&(t=Object.create(null)),u.default({base:e,url:"/transactions/unconfirmed",options:t})},t.fetchTransactions=function(e,t,r,n,a,o){return void 0===o&&(o=Object.create(null)),u.default({base:e,url:"/transactions/address/"+t+"/limit/"+r+l.default({after:n}),options:o}).then((function(e){return i(e,1)[0]}))},t.fetchUnconfirmedInfo=h,t.fetchInfo=d,t.fetchMultipleInfo=function(e,t,r){return void 0===r&&(r=Object.create(null)),u.default({base:e,url:"/transactions/info"+l.default({id:t}),options:r})},t.fetchStatus=function(e,t){var r={id:"",confirmations:-1,height:-1,inUTX:!1,status:o.TRANSACTION_STATUSES.NOT_FOUND},a=t.map((function(t){return h(e,t).then((function(){return n(n({},r),{id:t,status:o.TRANSACTION_STATUSES.UNCONFIRMED,inUTX:!0})})).catch((function(){return d(e,t).then((function(e){return n(n({},r),{id:t,status:o.TRANSACTION_STATUSES.IN_BLOCKCHAIN,height:e.height,applicationStatus:e.applicationStatus})}))})).catch((function(){return n(n({},r),{id:t})}))}));return Promise.all([s.fetchHeight(e),Promise.all(a)]).then((function(e){var t=i(e,2),r=t[0].height,a=t[1];return{height:r,statuses:a.map((function(e){return n(n({},e),{confirmations:e.status===o.TRANSACTION_STATUSES.IN_BLOCKCHAIN?r-e.height:e.confirmations})}))}}))},t.broadcast=function(e,t,r){return void 0===r&&(r=Object.create(null)),u.default({base:e,url:"/transactions/broadcast",options:c.deepAssign(n({},r),{method:"POST",body:f.default(t),headers:{"Content-Type":"application/json"}})})}},5894:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TRANSACTION_STATUSES=t.NAME_MAP=t.TYPE_MAP=void 0,t.TYPE_MAP={3:"issue",4:"transfer",5:"reissue",6:"burn",7:"exchange",8:"lease",9:"cancelLease",10:"alias",11:"massTransfer",12:"data",13:"setScript",14:"sponsorship",15:"setAssetScript",16:"invoke",17:"updateAsset"},t.NAME_MAP={issue:3,transfer:4,reissue:5,burn:6,exchange:7,lease:8,cancelLease:9,alias:10,massTransfer:11,data:12,setScript:13,sponsorship:14,setAssetScript:15,invoke:16,updateAsset:17},t.TRANSACTION_STATUSES={IN_BLOCKCHAIN:"in_blockchain",UNCONFIRMED:"unconfirmed",NOT_FOUND:"not_found"}},8488:(e,t,r)=>{"use strict";var n=r(3338);t.A=function(e){return n.fetchHeadersLast(e).then((function(e){return function(e){var t,r,n,i,o;if(0===e.length)return new Uint8Array(0);o=void 0,i=void 0,t=[0],o=0;for(;o>8,t[i]&=255,++i;for(;n;)t.push(255&n),n>>=8;o++}o=0;for(;"1"===e[o]&&o{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=new RegExp('((?!\\\\)"\\w+"):\\s*(-?[\\d|\\.]{14,})',"g");t.default=function(e){return JSON.parse(e.replace(r,'$1:"$2"'))}},1047:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"===typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(s){i={error:s}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o};Object.defineProperty(t,"__esModule",{value:!0});var i=r(7610);t.default=function(e,t){void 0===t&&(t=Object.create(null));var r=Object.keys(e).map((function(t){return[t,e[t]]})).map((function(e){var r=n(e,2),i=r[0],a=r[1];return[i,Object.prototype.hasOwnProperty.call(t,i)?t[i](a):a]})).filter((function(e){var t=n(e,2);t[0];return null!=t[1]})).map((function(e){var t=n(e,2),r=t[0],a=t[1];return i.toArray(a).map((function(e){return r+"="+e})).join("&")})).join("&");return r.length?"?"+r:""}},6406:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return new URL(e,t).toString()}},1830:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=["amount","matcherFee","price","minSponsoredAssetFee","fee","quantity","sellMatcherFee","buyMatcherFee"];t.default=function(e){return JSON.stringify(e,(function(e,t){return r.includes(e)&&t||"value"===e&&"integer"===this.type?"!"+t+"!":"minSponsoredAssetFee"===e&&null==t?null:t}),0).replace(/"\!(-?\d+)\!"/g,"$1")}},7690:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0?1:0;return(i.chain?function(e,t,r){return new Promise((function(n,i){var o=t.slice().reverse(),u=[],l=function(){if(!o.length)return n(u),null;var t=o.pop();a.broadcast(e,t).then((function(t){return s.default(e,t,r)})).then((function(e){u.push(e),l()}),i)};l()}))}(e,o.toArray(t),n(n({},i),{confirmations:c})):function(e,t){return Promise.all(t.map((function(t){return a.broadcast(e,t)})))}(e,o.toArray(t))).then((function(t){return i.confirmations<=0?t:s.default(e,t,i)})).then((function(e){return l?o.head(e):e}))}},9336:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7610),i=r(9265),a=r(5894);t.default=function(e,t,r){var o=!Array.isArray(t),s=Date.now(),u=[],l=r&&r.confirmations||0,c=r&&r.maxWaitTime||0,f=r&&r.requestInterval||250,h=function(t){return i.fetchStatus(e,t.map(n.prop("id"))).then((function(e){var r=n.indexBy(n.prop("id"),e.statuses),i=t.some((function(e){return r[e.id].status===a.TRANSACTION_STATUSES.NOT_FOUND}));if(i)throw new Error("One transaction is not in blockchain!");var o=t.filter((function(e){return!(r[e.id].confirmations>=l)||(u.push(e),!1)}));if(o.length)return c&&Date.now()-s>c?Promise.reject("Timeout error!"):n.wait(f).then((function(){return h(o)}))}))};return h(n.toArray(t)).then((function(){return o?n.head(u):u}))}},7610:function(e,t){"use strict";var r=this&&this.__read||function(e,t){var r="function"===typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(s){i={error:s}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o};function n(e){if("object"===typeof e&&null!==e){if("function"===typeof Object.getPrototypeOf){var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}return"[object Object]"===Object.prototype.toString.call(e)}return!1}Object.defineProperty(t,"__esModule",{value:!0}),t.pipe=t.switchTransactionByType=t.uniq=t.indexBy=t.filter=t.map=t.deepAssign=t.assign=t.values=t.entries=t.keys=t.prop=t.wait=t.head=t.toArray=t.isObject=void 0,t.isObject=n,t.toArray=function(e){return Array.isArray(e)?e:[e]},t.head=function(e){return e[0]},t.wait=function(e){return new Promise((function(t){setTimeout(t,e)}))},t.prop=function(e){return function(t){return t[e]}},t.keys=function(e){return Object.keys(e)},t.entries=function(e){return t.keys(e).map((function(t){return[t,e[t]]}))},t.values=function(e){return t.keys(e).map((function(t){return e[t]}))},t.assign=function(e,n){return t.entries(n).reduce((function(t,n){var i=r(n,2),a=i[0],o=i[1];return e[a]=o,e}),e)},t.deepAssign=function(){for(var e=[],r=0;r{"use strict";e.exports=function(e){var t={strict:!1};void 0!==e&&null!==e&&!0===e.strict&&(t.strict=!0);var r,n,i,a,o={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},s=function(e){throw{name:"SyntaxError",message:e,at:r,text:i}},u=function(e){return e&&e!==n&&s("Expected '"+e+"' instead of '"+n+"'"),n=i.charAt(r),r+=1,n},l=function(){var t,r="";for("-"===n&&(r="-",u("-"));n>="0"&&n<="9";)r+=n,u();if("."===n)for(r+=".";u()&&n>="0"&&n<="9";)r+=n;if("e"===n||"E"===n)for(r+=n,u(),"-"!==n&&"+"!==n||(r+=n,u());n>="0"&&n<="9";)r+=n,u();return t=+r,e&&e.parse?e.parse(r):isFinite(t)?r.length>15?r:t:void s("Bad number")},c=function(){var e,t,r,i="";if('"'===n)for(;u();){if('"'===n)return u(),i;if("\\"===n)if(u(),"u"===n){for(r=0,t=0;t<4&&(e=parseInt(u(),16),isFinite(e));t+=1)r=16*r+e;i+=String.fromCharCode(r)}else{if("string"!==typeof o[n])break;i+=o[n]}else i+=n}s("Bad string")},f=function(){for(;n&&n<=" ";)u()};a=function(){switch(f(),n){case"{":return function(){var e,r={};if("{"===n){if(u("{"),f(),"}"===n)return u("}"),r;for(;n;){if(e=c(),f(),u(":"),!0===t.strict&&Object.hasOwnProperty.call(r,e)&&s('Duplicate key "'+e+'"'),r[e]=a(),f(),"}"===n)return u("}"),r;u(","),f()}}s("Bad object")}();case"[":return function(){var e=[];if("["===n){if(u("["),f(),"]"===n)return u("]"),e;for(;n;){if(e.push(a()),f(),"]"===n)return u("]"),e;u(","),f()}}s("Bad array")}();case'"':return c();case"-":return l();default:return n>="0"&&n<="9"?l():function(){switch(n){case"t":return u("t"),u("r"),u("u"),u("e"),!0;case"f":return u("f"),u("a"),u("l"),u("s"),u("e"),!1;case"n":return u("n"),u("u"),u("l"),u("l"),null}s("Unexpected '"+n+"'")}()}};var h,d,p,g=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,y={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function m(e){return g.lastIndex=0,g.test(e)?'"'+e.replace(g,(function(e){var t=y[e];return"string"===typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)}))+'"':'"'+e+'"'}function v(t,r){var n,i,a,o,s,u=h,l=r[t],c=e&&e.isInstance&&e.isInstance(l);switch(c&&!l.isFinite()&&(l=null),c?l=e.stringify(l):l&&"object"===typeof l&&"function"===typeof l.toJSON&&(l=l.toJSON(t)),"function"===typeof p&&(l=p.call(r,t,l)),typeof l){case"string":return c?l:m(l);case"number":return isFinite(l)?String(l):"null";case"boolean":return String(l);case"object":if(!l)return"null";if(h+=d,s=[],"[object Array]"===Object.prototype.toString.apply(l)){for(o=l.length,n=0;n=a;)r+=a,c();if("."===a)for(r+=".";c()&&"0"<=a&&"9">=a;)r+=a;if("e"===a||"E"===a)for(r+=a,c(),("-"===a||"+"===a)&&(r+=a,c());"0"<=a&&"9">=a;)r+=a,c();return t=+r,e&&e.parse?e.parse(r):isFinite(t)?15t&&(e=parseInt(c(),16),isFinite(e));t+=1)r=16*r+e;n+=String.fromCharCode(r)}else{if("string"!=typeof u[a])break;n+=u[a]}}l("Bad string")},d=function(){for(;a&&" ">=a;)c()},p=function(){switch(a){case"t":return c("t"),c("r"),c("u"),c("e"),!0;case"f":return c("f"),c("a"),c("l"),c("s"),c("e"),!1;case"n":return c("n"),c("u"),c("l"),c("l"),null}l("Unexpected '"+a+"'")},g=function(){var e=[];if("["===a){if(c("["),d(),"]"===a)return c("]"),e;for(;a;){if(e.push(s()),d(),"]"===a)return c("]"),e;c(","),d()}}l("Bad array")},y=function(){var e,t={};if("{"===a){if(c("{"),d(),"}"===a)return c("}"),t;for(;a;){if(e=h(),d(),c(":"),!0===n.strict&&Object.hasOwnProperty.call(t,e)&&l('Duplicate key "'+e+'"'),t[e]=s(),d(),"}"===a)return c("}"),t;c(","),d()}}l("Bad object")};s=function(){return d(),"{"===a?y():"["===a?g():'"'===a?h():"-"===a||"0"<=a&&"9">=a?f():p()};var m,v,b,S=/[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,w={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},E=function(e,t,n){var i;if(m="",v="","number"==typeof n)for(i=0;i{"use strict";var n=r(1099),i=n.Reader,a=n.Writer,o=n.util,s=n.roots.default||(n.roots.default={});s.waves=function(){var e={};return e.Amount=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.assetId=e.bytes();break;case 2:n.amount=e.int64();break;default:e.skipType(7&a)}}return n},e}(),e.Block=function(){function e(e){if(this.transactions=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.header=s.waves.Block.Header.decode(e,e.uint32());break;case 2:n.signature=e.bytes();break;case 3:n.transactions&&n.transactions.length||(n.transactions=[]),n.transactions.push(s.waves.SignedTransaction.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return n},e.Header=function(){function e(e){if(this.featureVotes=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.chainId=e.int32();break;case 2:n.reference=e.bytes();break;case 3:n.baseTarget=e.int64();break;case 4:n.generationSignature=e.bytes();break;case 5:if(n.featureVotes&&n.featureVotes.length||(n.featureVotes=[]),2===(7&a))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:n.baseTarget=e.int64();break;case 2:n.generationSignature=e.bytes();break;case 3:if(n.featureVotes&&n.featureVotes.length||(n.featureVotes=[]),2===(7&a))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:n.version=e.int32();break;case 2:n.reference=e.bytes();break;case 3:n.updatedBlockSignature=e.bytes();break;case 4:n.senderPublicKey=e.bytes();break;case 5:n.transactions&&n.transactions.length||(n.transactions=[]),n.transactions.push(s.waves.SignedTransaction.decode(e,e.uint32()));break;case 6:n.stateHash=e.bytes();break;default:e.skipType(7&a)}}return n},e}(),e.SignedMicroBlock=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.microBlock=s.waves.MicroBlock.decode(e,e.uint32());break;case 2:n.signature=e.bytes();break;case 3:n.totalBlockId=e.bytes();break;default:e.skipType(7&a)}}return n},e}(),e.events=function(){var e={};return e.BlockchainUpdated=function(){function e(e){if(this.referencedAssets=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.id=e.bytes();break;case 2:n.height=e.int32();break;case 11:n.append=s.waves.events.BlockchainUpdated.Append.decode(e,e.uint32());break;case 12:n.rollback=s.waves.events.BlockchainUpdated.Rollback.decode(e,e.uint32());break;case 21:n.referencedAssets&&n.referencedAssets.length||(n.referencedAssets=[]),n.referencedAssets.push(s.waves.events.StateUpdate.AssetInfo.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return n},e.Append=function(){function e(e){if(this.transactionIds=[],this.transactionsMetadata=[],this.transactionStateUpdates=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.block=s.waves.events.BlockchainUpdated.Append.BlockAppend.decode(e,e.uint32());break;case 2:n.microBlock=s.waves.events.BlockchainUpdated.Append.MicroBlockAppend.decode(e,e.uint32());break;case 3:n.transactionIds&&n.transactionIds.length||(n.transactionIds=[]),n.transactionIds.push(e.bytes());break;case 4:n.transactionsMetadata&&n.transactionsMetadata.length||(n.transactionsMetadata=[]),n.transactionsMetadata.push(s.waves.events.TransactionMetadata.decode(e,e.uint32()));break;case 11:n.stateUpdate=s.waves.events.StateUpdate.decode(e,e.uint32());break;case 12:n.transactionStateUpdates&&n.transactionStateUpdates.length||(n.transactionStateUpdates=[]),n.transactionStateUpdates.push(s.waves.events.StateUpdate.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return n},e.BlockAppend=function(){function e(e){if(this.activatedFeatures=[],this.rewardShares=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.block=s.waves.Block.decode(e,e.uint32());break;case 2:n.updatedWavesAmount=e.int64();break;case 3:if(n.activatedFeatures&&n.activatedFeatures.length||(n.activatedFeatures=[]),2===(7&a))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:n.microBlock=s.waves.SignedMicroBlock.decode(e,e.uint32());break;case 2:n.updatedTransactionsRoot=e.bytes();break;default:e.skipType(7&a)}}return n},e}(),e}(),e.Rollback=function(){function e(e){if(this.removedTransactionIds=[],this.removedBlocks=[],this.deactivatedFeatures=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.type=e.int32();break;case 2:n.removedTransactionIds&&n.removedTransactionIds.length||(n.removedTransactionIds=[]),n.removedTransactionIds.push(e.bytes());break;case 3:n.removedBlocks&&n.removedBlocks.length||(n.removedBlocks=[]),n.removedBlocks.push(s.waves.Block.decode(e,e.uint32()));break;case 4:n.rollbackStateUpdate=s.waves.events.StateUpdate.decode(e,e.uint32());break;case 5:if(n.deactivatedFeatures&&n.deactivatedFeatures.length||(n.deactivatedFeatures=[]),2===(7&a))for(var o=e.uint32()+e.pos;e.pos>>3){case 1:n.balances&&n.balances.length||(n.balances=[]),n.balances.push(s.waves.events.StateUpdate.BalanceUpdate.decode(e,e.uint32()));break;case 2:n.leasingForAddress&&n.leasingForAddress.length||(n.leasingForAddress=[]),n.leasingForAddress.push(s.waves.events.StateUpdate.LeasingUpdate.decode(e,e.uint32()));break;case 3:n.dataEntries&&n.dataEntries.length||(n.dataEntries=[]),n.dataEntries.push(s.waves.events.StateUpdate.DataEntryUpdate.decode(e,e.uint32()));break;case 4:n.assets&&n.assets.length||(n.assets=[]),n.assets.push(s.waves.events.StateUpdate.AssetStateUpdate.decode(e,e.uint32()));break;case 5:n.individualLeases&&n.individualLeases.length||(n.individualLeases=[]),n.individualLeases.push(s.waves.events.StateUpdate.LeaseUpdate.decode(e,e.uint32()));break;case 6:n.scripts&&n.scripts.length||(n.scripts=[]),n.scripts.push(s.waves.events.StateUpdate.ScriptUpdate.decode(e,e.uint32()));break;case 7:n.deletedAliases&&n.deletedAliases.length||(n.deletedAliases=[]),n.deletedAliases.push(e.string());break;default:e.skipType(7&a)}}return n},e.BalanceUpdate=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.address=e.bytes();break;case 2:n.amountAfter=s.waves.Amount.decode(e,e.uint32());break;case 3:n.amountBefore=e.int64();break;default:e.skipType(7&a)}}return n},e}(),e.LeasingUpdate=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.address=e.bytes();break;case 2:n.inAfter=e.int64();break;case 3:n.outAfter=e.int64();break;case 4:n.inBefore=e.int64();break;case 5:n.outBefore=e.int64();break;default:e.skipType(7&a)}}return n},e}(),e.LeaseUpdate=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.leaseId=e.bytes();break;case 2:n.statusAfter=e.int32();break;case 10:n.amount=e.int64();break;case 11:n.sender=e.bytes();break;case 12:n.recipient=e.bytes();break;case 13:n.originTransactionId=e.bytes();break;default:e.skipType(7&a)}}return n},e.LeaseStatus=function(){var e={},t=Object.create(e);return t[e[0]="INACTIVE"]=0,t[e[1]="ACTIVE"]=1,t}(),e}(),e.DataEntryUpdate=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.address=e.bytes();break;case 2:n.dataEntry=s.waves.DataEntry.decode(e,e.uint32());break;case 10:n.dataEntryBefore=s.waves.DataEntry.decode(e,e.uint32());break;default:e.skipType(7&a)}}return n},e}(),e.AssetStateUpdate=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.before=s.waves.events.StateUpdate.AssetDetails.decode(e,e.uint32());break;case 2:n.after=s.waves.events.StateUpdate.AssetDetails.decode(e,e.uint32());break;default:e.skipType(7&a)}}return n},e}(),e.AssetDetails=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.assetId=e.bytes();break;case 2:n.issuer=e.bytes();break;case 3:n.decimals=e.int32();break;case 4:n.name=e.string();break;case 5:n.description=e.string();break;case 6:n.reissuable=e.bool();break;case 7:n.volume=e.int64();break;case 8:n.scriptInfo=s.waves.events.StateUpdate.AssetDetails.AssetScriptInfo.decode(e,e.uint32());break;case 9:n.sponsorship=e.int64();break;case 10:n.nft=e.bool();break;case 11:n.lastUpdated=e.int32();break;case 12:n.sequenceInBlock=e.int32();break;case 13:n.issueHeight=e.int32();break;case 20:n.safeVolume=e.bytes();break;default:e.skipType(7&a)}}return n},e.AssetScriptInfo=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.script=e.bytes();break;case 2:n.complexity=e.int64();break;default:e.skipType(7&a)}}return n},e}(),e}(),e.AssetInfo=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.id=e.bytes();break;case 2:n.decimals=e.int32();break;case 3:n.name=e.string();break;default:e.skipType(7&a)}}return n},e}(),e.ScriptUpdate=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.address=e.bytes();break;case 2:n.before=e.bytes();break;case 3:n.after=e.bytes();break;default:e.skipType(7&a)}}return n},e}(),e}(),e.TransactionMetadata=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.senderAddress=e.bytes();break;case 104:n.transfer=s.waves.events.TransactionMetadata.TransferMetadata.decode(e,e.uint32());break;case 107:n.exchange=s.waves.events.TransactionMetadata.ExchangeMetadata.decode(e,e.uint32());break;case 111:n.massTransfer=s.waves.events.TransactionMetadata.MassTransferMetadata.decode(e,e.uint32());break;case 116:n.invokeScript=s.waves.events.TransactionMetadata.InvokeScriptMetadata.decode(e,e.uint32());break;case 117:n.lease=s.waves.events.TransactionMetadata.LeaseMetadata.decode(e,e.uint32());break;case 301:n.ethereum=s.waves.events.TransactionMetadata.EthereumMetadata.decode(e,e.uint32());break;default:e.skipType(7&a)}}return n},e.TransferMetadata=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3===1)n.recipientAddress=e.bytes();else e.skipType(7&a)}return n},e}(),e.MassTransferMetadata=function(){function e(e){if(this.recipientsAddresses=[],e)for(var t=Object.keys(e),r=0;r>>3===1)n.recipientsAddresses&&n.recipientsAddresses.length||(n.recipientsAddresses=[]),n.recipientsAddresses.push(e.bytes());else e.skipType(7&a)}return n},e}(),e.ExchangeMetadata=function(){function e(e){if(this.orderIds=[],this.orderSenderAddresses=[],this.orderSenderPublicKeys=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.orderIds&&n.orderIds.length||(n.orderIds=[]),n.orderIds.push(e.bytes());break;case 2:n.orderSenderAddresses&&n.orderSenderAddresses.length||(n.orderSenderAddresses=[]),n.orderSenderAddresses.push(e.bytes());break;case 3:n.orderSenderPublicKeys&&n.orderSenderPublicKeys.length||(n.orderSenderPublicKeys=[]),n.orderSenderPublicKeys.push(e.bytes());break;default:e.skipType(7&a)}}return n},e}(),e.InvokeScriptMetadata=function(){function e(e){if(this.arguments=[],this.payments=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.dAppAddress=e.bytes();break;case 2:n.functionName=e.string();break;case 3:n.arguments&&n.arguments.length||(n.arguments=[]),n.arguments.push(s.waves.InvokeScriptResult.Call.Argument.decode(e,e.uint32()));break;case 4:n.payments&&n.payments.length||(n.payments=[]),n.payments.push(s.waves.Amount.decode(e,e.uint32()));break;case 5:n.result=s.waves.InvokeScriptResult.decode(e,e.uint32());break;default:e.skipType(7&a)}}return n},e.Argument=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.integerValue=e.int64();break;case 2:n.binaryValue=e.bytes();break;case 3:n.stringValue=e.string();break;case 4:n.booleanValue=e.bool();break;case 10:n.list=s.waves.events.TransactionMetadata.InvokeScriptMetadata.Argument.List.decode(e,e.uint32());break;default:e.skipType(7&a)}}return n},e.List=function(){function e(e){if(this.items=[],e)for(var t=Object.keys(e),r=0;r>>3===1)n.items&&n.items.length||(n.items=[]),n.items.push(s.waves.events.TransactionMetadata.InvokeScriptMetadata.Argument.decode(e,e.uint32()));else e.skipType(7&a)}return n},e}(),e}(),e}(),e.LeaseMetadata=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3===1)n.recipientAddress=e.bytes();else e.skipType(7&a)}return n},e}(),e.EthereumTransferMetadata=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.recipientAddress=e.bytes();break;case 2:n.amount=s.waves.Amount.decode(e,e.uint32());break;default:e.skipType(7&a)}}return n},e}(),e.EthereumMetadata=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 2:n.timestamp=e.int64();break;case 3:n.fee=e.int64();break;case 4:n.senderPublicKey=e.bytes();break;case 10:n.transfer=s.waves.events.TransactionMetadata.EthereumTransferMetadata.decode(e,e.uint32());break;case 11:n.invoke=s.waves.events.TransactionMetadata.InvokeScriptMetadata.decode(e,e.uint32());break;default:e.skipType(7&a)}}return n},e}(),e}(),e.grpc=function(){var e={};return e.BlockchainUpdatesApi=function(){function e(e,t,r){n.rpc.Service.call(this,e,t,r)}return(e.prototype=Object.create(n.rpc.Service.prototype)).constructor=e,Object.defineProperty(e.prototype.getBlockUpdate=function e(t,r){return this.rpcCall(e,s.waves.events.grpc.GetBlockUpdateRequest,s.waves.events.grpc.GetBlockUpdateResponse,t,r)},"name",{value:"GetBlockUpdate"}),Object.defineProperty(e.prototype.getBlockUpdatesRange=function e(t,r){return this.rpcCall(e,s.waves.events.grpc.GetBlockUpdatesRangeRequest,s.waves.events.grpc.GetBlockUpdatesRangeResponse,t,r)},"name",{value:"GetBlockUpdatesRange"}),Object.defineProperty(e.prototype.subscribe=function e(t,r){return this.rpcCall(e,s.waves.events.grpc.SubscribeRequest,s.waves.events.grpc.SubscribeEvent,t,r)},"name",{value:"Subscribe"}),e}(),e.GetBlockUpdateRequest=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3===1)n.height=e.int32();else e.skipType(7&a)}return n},e}(),e.GetBlockUpdateResponse=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3===1)n.update=s.waves.events.BlockchainUpdated.decode(e,e.uint32());else e.skipType(7&a)}return n},e}(),e.GetBlockUpdatesRangeRequest=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.fromHeight=e.int32();break;case 2:n.toHeight=e.int32();break;default:e.skipType(7&a)}}return n},e}(),e.GetBlockUpdatesRangeResponse=function(){function e(e){if(this.updates=[],e)for(var t=Object.keys(e),r=0;r>>3===1)n.updates&&n.updates.length||(n.updates=[]),n.updates.push(s.waves.events.BlockchainUpdated.decode(e,e.uint32()));else e.skipType(7&a)}return n},e}(),e.SubscribeRequest=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.fromHeight=e.int32();break;case 2:n.toHeight=e.int32();break;default:e.skipType(7&a)}}return n},e}(),e.SubscribeEvent=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3===1)n.update=s.waves.events.BlockchainUpdated.decode(e,e.uint32());else e.skipType(7&a)}return n},e}(),e}(),e}(),e.InvokeScriptResult=function(){function e(e){if(this.data=[],this.transfers=[],this.issues=[],this.reissues=[],this.burns=[],this.sponsorFees=[],this.leases=[],this.leaseCancels=[],this.invokes=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.data&&n.data.length||(n.data=[]),n.data.push(s.waves.DataEntry.decode(e,e.uint32()));break;case 2:n.transfers&&n.transfers.length||(n.transfers=[]),n.transfers.push(s.waves.InvokeScriptResult.Payment.decode(e,e.uint32()));break;case 3:n.issues&&n.issues.length||(n.issues=[]),n.issues.push(s.waves.InvokeScriptResult.Issue.decode(e,e.uint32()));break;case 4:n.reissues&&n.reissues.length||(n.reissues=[]),n.reissues.push(s.waves.InvokeScriptResult.Reissue.decode(e,e.uint32()));break;case 5:n.burns&&n.burns.length||(n.burns=[]),n.burns.push(s.waves.InvokeScriptResult.Burn.decode(e,e.uint32()));break;case 6:n.errorMessage=s.waves.InvokeScriptResult.ErrorMessage.decode(e,e.uint32());break;case 7:n.sponsorFees&&n.sponsorFees.length||(n.sponsorFees=[]),n.sponsorFees.push(s.waves.InvokeScriptResult.SponsorFee.decode(e,e.uint32()));break;case 8:n.leases&&n.leases.length||(n.leases=[]),n.leases.push(s.waves.InvokeScriptResult.Lease.decode(e,e.uint32()));break;case 9:n.leaseCancels&&n.leaseCancels.length||(n.leaseCancels=[]),n.leaseCancels.push(s.waves.InvokeScriptResult.LeaseCancel.decode(e,e.uint32()));break;case 10:n.invokes&&n.invokes.length||(n.invokes=[]),n.invokes.push(s.waves.InvokeScriptResult.Invocation.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return n},e.Payment=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.address=e.bytes();break;case 2:n.amount=s.waves.Amount.decode(e,e.uint32());break;default:e.skipType(7&a)}}return n},e}(),e.Issue=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.assetId=e.bytes();break;case 2:n.name=e.string();break;case 3:n.description=e.string();break;case 4:n.amount=e.int64();break;case 5:n.decimals=e.int32();break;case 6:n.reissuable=e.bool();break;case 7:n.script=e.bytes();break;case 8:n.nonce=e.int64();break;default:e.skipType(7&a)}}return n},e}(),e.Reissue=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.assetId=e.bytes();break;case 2:n.amount=e.int64();break;case 3:n.isReissuable=e.bool();break;default:e.skipType(7&a)}}return n},e}(),e.Burn=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.assetId=e.bytes();break;case 2:n.amount=e.int64();break;default:e.skipType(7&a)}}return n},e}(),e.SponsorFee=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3===1)n.minFee=s.waves.Amount.decode(e,e.uint32());else e.skipType(7&a)}return n},e}(),e.Lease=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.recipient=s.waves.Recipient.decode(e,e.uint32());break;case 2:n.amount=e.int64();break;case 3:n.nonce=e.int64();break;case 4:n.leaseId=e.bytes();break;default:e.skipType(7&a)}}return n},e}(),e.LeaseCancel=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3===1)n.leaseId=e.bytes();else e.skipType(7&a)}return n},e}(),e.ErrorMessage=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.code=e.int32();break;case 2:n.text=e.string();break;default:e.skipType(7&a)}}return n},e}(),e.Call=function(){function e(e){if(this.argsBytes=[],this.args=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.function=e.string();break;case 2:n.argsBytes&&n.argsBytes.length||(n.argsBytes=[]),n.argsBytes.push(e.bytes());break;case 3:n.args&&n.args.length||(n.args=[]),n.args.push(s.waves.InvokeScriptResult.Call.Argument.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return n},e.Argument=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.integerValue=e.int64();break;case 2:n.binaryValue=e.bytes();break;case 3:n.stringValue=e.string();break;case 4:n.booleanValue=e.bool();break;case 5:n.caseObj=e.bytes();break;case 10:n.list=s.waves.InvokeScriptResult.Call.Argument.List.decode(e,e.uint32());break;default:e.skipType(7&a)}}return n},e.List=function(){function e(e){if(this.items=[],e)for(var t=Object.keys(e),r=0;r>>3===1)n.items&&n.items.length||(n.items=[]),n.items.push(s.waves.InvokeScriptResult.Call.Argument.decode(e,e.uint32()));else e.skipType(7&a)}return n},e}(),e}(),e}(),e.Invocation=function(){function e(e){if(this.payments=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.dApp=e.bytes();break;case 2:n.call=s.waves.InvokeScriptResult.Call.decode(e,e.uint32());break;case 3:n.payments&&n.payments.length||(n.payments=[]),n.payments.push(s.waves.Amount.decode(e,e.uint32()));break;case 4:n.stateChanges=s.waves.InvokeScriptResult.decode(e,e.uint32());break;default:e.skipType(7&a)}}return n},e}(),e}(),e.DAppMeta=function(){function e(e){if(this.funcs=[],this.compactNameAndOriginalNamePairList=[],this.originalNames=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.version=e.int32();break;case 2:n.funcs&&n.funcs.length||(n.funcs=[]),n.funcs.push(s.waves.DAppMeta.CallableFuncSignature.decode(e,e.uint32()));break;case 3:n.compactNameAndOriginalNamePairList&&n.compactNameAndOriginalNamePairList.length||(n.compactNameAndOriginalNamePairList=[]),n.compactNameAndOriginalNamePairList.push(s.waves.DAppMeta.CompactNameAndOriginalNamePair.decode(e,e.uint32()));break;case 4:n.originalNames&&n.originalNames.length||(n.originalNames=[]),n.originalNames.push(e.string());break;default:e.skipType(7&a)}}return n},e.CallableFuncSignature=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3===1)n.types=e.bytes();else e.skipType(7&a)}return n},e}(),e.CompactNameAndOriginalNamePair=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.compactName=e.string();break;case 2:n.originalName=e.string();break;default:e.skipType(7&a)}}return n},e}(),e}(),e.node=function(){var e={};return e.grpc=function(){var e={};return e.AccountsApi=function(){function e(e,t,r){n.rpc.Service.call(this,e,t,r)}return(e.prototype=Object.create(n.rpc.Service.prototype)).constructor=e,Object.defineProperty(e.prototype.getBalances=function e(t,r){return this.rpcCall(e,s.waves.node.grpc.BalancesRequest,s.waves.node.grpc.BalanceResponse,t,r)},"name",{value:"GetBalances"}),Object.defineProperty(e.prototype.getScript=function e(t,r){return this.rpcCall(e,s.waves.node.grpc.AccountRequest,s.waves.node.grpc.ScriptResponse,t,r)},"name",{value:"GetScript"}),Object.defineProperty(e.prototype.getActiveLeases=function e(t,r){return this.rpcCall(e,s.waves.node.grpc.AccountRequest,s.waves.node.grpc.LeaseResponse,t,r)},"name",{value:"GetActiveLeases"}),Object.defineProperty(e.prototype.getDataEntries=function e(t,r){return this.rpcCall(e,s.waves.node.grpc.DataRequest,s.waves.node.grpc.DataEntryResponse,t,r)},"name",{value:"GetDataEntries"}),Object.defineProperty(e.prototype.resolveAlias=function e(t,r){return this.rpcCall(e,s.google.protobuf.StringValue,s.google.protobuf.BytesValue,t,r)},"name",{value:"ResolveAlias"}),e}(),e.AccountRequest=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3===1)n.address=e.bytes();else e.skipType(7&a)}return n},e}(),e.DataRequest=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.address=e.bytes();break;case 2:n.key=e.string();break;default:e.skipType(7&a)}}return n},e}(),e.BalancesRequest=function(){function e(e){if(this.assets=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.address=e.bytes();break;case 4:n.assets&&n.assets.length||(n.assets=[]),n.assets.push(e.bytes());break;default:e.skipType(7&a)}}return n},e}(),e.BalanceResponse=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.waves=s.waves.node.grpc.BalanceResponse.WavesBalances.decode(e,e.uint32());break;case 2:n.asset=s.waves.Amount.decode(e,e.uint32());break;default:e.skipType(7&a)}}return n},e.WavesBalances=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.regular=e.int64();break;case 2:n.generating=e.int64();break;case 3:n.available=e.int64();break;case 4:n.effective=e.int64();break;case 5:n.leaseIn=e.int64();break;case 6:n.leaseOut=e.int64();break;default:e.skipType(7&a)}}return n},e}(),e}(),e.DataEntryResponse=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.address=e.bytes();break;case 2:n.entry=s.waves.DataEntry.decode(e,e.uint32());break;default:e.skipType(7&a)}}return n},e}(),e.ScriptData=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.scriptBytes=e.bytes();break;case 2:n.scriptText=e.string();break;case 3:n.complexity=e.int64();break;default:e.skipType(7&a)}}return n},e}(),e.ScriptResponse=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.scriptBytes=e.bytes();break;case 2:n.scriptText=e.string();break;case 3:n.complexity=e.int64();break;case 4:n.publicKey=e.bytes();break;default:e.skipType(7&a)}}return n},e}(),e.LeaseResponse=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.leaseId=e.bytes();break;case 2:n.originTransactionId=e.bytes();break;case 3:n.sender=e.bytes();break;case 4:n.recipient=s.waves.Recipient.decode(e,e.uint32());break;case 5:n.amount=e.int64();break;case 6:n.height=e.int64();break;default:e.skipType(7&a)}}return n},e}(),e.AssetsApi=function(){function e(e,t,r){n.rpc.Service.call(this,e,t,r)}return(e.prototype=Object.create(n.rpc.Service.prototype)).constructor=e,Object.defineProperty(e.prototype.getInfo=function e(t,r){return this.rpcCall(e,s.waves.node.grpc.AssetRequest,s.waves.node.grpc.AssetInfoResponse,t,r)},"name",{value:"GetInfo"}),Object.defineProperty(e.prototype.getNFTList=function e(t,r){return this.rpcCall(e,s.waves.node.grpc.NFTRequest,s.waves.node.grpc.NFTResponse,t,r)},"name",{value:"GetNFTList"}),e}(),e.AssetRequest=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3===1)n.assetId=e.bytes();else e.skipType(7&a)}return n},e}(),e.NFTRequest=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.address=e.bytes();break;case 2:n.limit=e.int32();break;case 3:n.afterAssetId=e.bytes();break;default:e.skipType(7&a)}}return n},e}(),e.NFTResponse=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.assetId=e.bytes();break;case 2:n.assetInfo=s.waves.node.grpc.AssetInfoResponse.decode(e,e.uint32());break;default:e.skipType(7&a)}}return n},e}(),e.AssetInfoResponse=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.issuer=e.bytes();break;case 2:n.name=e.string();break;case 3:n.description=e.string();break;case 4:n.decimals=e.int32();break;case 5:n.reissuable=e.bool();break;case 6:n.totalVolume=e.int64();break;case 7:n.script=s.waves.node.grpc.ScriptData.decode(e,e.uint32());break;case 8:n.sponsorship=e.int64();break;case 11:n.issueTransaction=s.waves.SignedTransaction.decode(e,e.uint32());break;case 10:n.sponsorBalance=e.int64();break;case 12:n.sequenceInBlock=e.int32();break;case 13:n.issueHeight=e.int32();break;default:e.skipType(7&a)}}return n},e}(),e.BlockchainApi=function(){function e(e,t,r){n.rpc.Service.call(this,e,t,r)}return(e.prototype=Object.create(n.rpc.Service.prototype)).constructor=e,Object.defineProperty(e.prototype.getActivationStatus=function e(t,r){return this.rpcCall(e,s.waves.node.grpc.ActivationStatusRequest,s.waves.node.grpc.ActivationStatusResponse,t,r)},"name",{value:"GetActivationStatus"}),Object.defineProperty(e.prototype.getBaseTarget=function e(t,r){return this.rpcCall(e,s.google.protobuf.Empty,s.waves.node.grpc.BaseTargetResponse,t,r)},"name",{value:"GetBaseTarget"}),Object.defineProperty(e.prototype.getCumulativeScore=function e(t,r){return this.rpcCall(e,s.google.protobuf.Empty,s.waves.node.grpc.ScoreResponse,t,r)},"name",{value:"GetCumulativeScore"}),e}(),e.ActivationStatusRequest=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3===1)n.height=e.int32();else e.skipType(7&a)}return n},e}(),e.ActivationStatusResponse=function(){function e(e){if(this.features=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.height=e.int32();break;case 2:n.votingInterval=e.int32();break;case 3:n.votingThreshold=e.int32();break;case 4:n.nextCheck=e.int32();break;case 5:n.features&&n.features.length||(n.features=[]),n.features.push(s.waves.node.grpc.FeatureActivationStatus.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return n},e}(),e.FeatureActivationStatus=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.id=e.int32();break;case 2:n.description=e.string();break;case 3:n.blockchainStatus=e.int32();break;case 4:n.nodeStatus=e.int32();break;case 5:n.activationHeight=e.int32();break;case 6:n.supportingBlocks=e.int32();break;default:e.skipType(7&a)}}return n},e.BlockchainFeatureStatus=function(){var e={},t=Object.create(e);return t[e[0]="UNDEFINED"]=0,t[e[1]="APPROVED"]=1,t[e[2]="ACTIVATED"]=2,t}(),e.NodeFeatureStatus=function(){var e={},t=Object.create(e);return t[e[0]="NOT_IMPLEMENTED"]=0,t[e[1]="IMPLEMENTED"]=1,t[e[2]="VOTED"]=2,t}(),e}(),e.BaseTargetResponse=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3===1)n.baseTarget=e.int64();else e.skipType(7&a)}return n},e}(),e.ScoreResponse=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3===1)n.score=e.bytes();else e.skipType(7&a)}return n},e}(),e.BlocksApi=function(){function e(e,t,r){n.rpc.Service.call(this,e,t,r)}return(e.prototype=Object.create(n.rpc.Service.prototype)).constructor=e,Object.defineProperty(e.prototype.getBlock=function e(t,r){return this.rpcCall(e,s.waves.node.grpc.BlockRequest,s.waves.node.grpc.BlockWithHeight,t,r)},"name",{value:"GetBlock"}),Object.defineProperty(e.prototype.getBlockRange=function e(t,r){return this.rpcCall(e,s.waves.node.grpc.BlockRangeRequest,s.waves.node.grpc.BlockWithHeight,t,r)},"name",{value:"GetBlockRange"}),Object.defineProperty(e.prototype.getCurrentHeight=function e(t,r){return this.rpcCall(e,s.google.protobuf.Empty,s.google.protobuf.UInt32Value,t,r)},"name",{value:"GetCurrentHeight"}),e}(),e.BlockRequest=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.blockId=e.bytes();break;case 2:n.height=e.int32();break;case 100:n.includeTransactions=e.bool();break;default:e.skipType(7&a)}}return n},e}(),e.BlockRangeRequest=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.fromHeight=e.uint32();break;case 2:n.toHeight=e.uint32();break;case 3:n.generatorPublicKey=e.bytes();break;case 4:n.generatorAddress=e.bytes();break;case 100:n.includeTransactions=e.bool();break;default:e.skipType(7&a)}}return n},e}(),e.BlockWithHeight=function(){function e(e){if(this.rewardShares=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.block=s.waves.Block.decode(e,e.uint32());break;case 2:n.height=e.uint32();break;case 3:n.vrf=e.bytes();break;case 4:n.rewardShares&&n.rewardShares.length||(n.rewardShares=[]),n.rewardShares.push(s.waves.RewardShare.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return n},e}(),e.TransactionsApi=function(){function e(e,t,r){n.rpc.Service.call(this,e,t,r)}return(e.prototype=Object.create(n.rpc.Service.prototype)).constructor=e,Object.defineProperty(e.prototype.getTransactions=function e(t,r){return this.rpcCall(e,s.waves.node.grpc.TransactionsRequest,s.waves.node.grpc.TransactionResponse,t,r)},"name",{value:"GetTransactions"}),Object.defineProperty(e.prototype.getTransactionSnapshots=function e(t,r){return this.rpcCall(e,s.waves.node.grpc.TransactionSnapshotsRequest,s.waves.node.grpc.TransactionSnapshotResponse,t,r)},"name",{value:"GetTransactionSnapshots"}),Object.defineProperty(e.prototype.getStateChanges=function e(t,r){return this.rpcCall(e,s.waves.node.grpc.TransactionsRequest,s.waves.node.grpc.InvokeScriptResultResponse,t,r)},"name",{value:"GetStateChanges"}),Object.defineProperty(e.prototype.getStatuses=function e(t,r){return this.rpcCall(e,s.waves.node.grpc.TransactionsByIdRequest,s.waves.node.grpc.TransactionStatus,t,r)},"name",{value:"GetStatuses"}),Object.defineProperty(e.prototype.getUnconfirmed=function e(t,r){return this.rpcCall(e,s.waves.node.grpc.TransactionsRequest,s.waves.node.grpc.TransactionResponse,t,r)},"name",{value:"GetUnconfirmed"}),Object.defineProperty(e.prototype.sign=function e(t,r){return this.rpcCall(e,s.waves.node.grpc.SignRequest,s.waves.SignedTransaction,t,r)},"name",{value:"Sign"}),Object.defineProperty(e.prototype.broadcast=function e(t,r){return this.rpcCall(e,s.waves.SignedTransaction,s.waves.SignedTransaction,t,r)},"name",{value:"Broadcast"}),e}(),e.ApplicationStatus=function(){var e={},t=Object.create(e);return t[e[0]="UNKNOWN"]=0,t[e[1]="SUCCEEDED"]=1,t[e[2]="SCRIPT_EXECUTION_FAILED"]=2,t[e[3]="ELIDED"]=3,t}(),e.TransactionStatus=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.id=e.bytes();break;case 2:n.status=e.int32();break;case 3:n.height=e.int64();break;case 4:n.applicationStatus=e.int32();break;default:e.skipType(7&a)}}return n},e.Status=function(){var e={},t=Object.create(e);return t[e[0]="NOT_EXISTS"]=0,t[e[1]="UNCONFIRMED"]=1,t[e[2]="CONFIRMED"]=2,t}(),e}(),e.TransactionResponse=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.id=e.bytes();break;case 2:n.height=e.int64();break;case 3:n.transaction=s.waves.SignedTransaction.decode(e,e.uint32());break;case 4:n.applicationStatus=e.int32();break;case 5:n.invokeScriptResult=s.waves.InvokeScriptResult.decode(e,e.uint32());break;default:e.skipType(7&a)}}return n},e}(),e.TransactionsRequest=function(){function e(e){if(this.transactionIds=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.sender=e.bytes();break;case 2:n.recipient=s.waves.Recipient.decode(e,e.uint32());break;case 3:n.transactionIds&&n.transactionIds.length||(n.transactionIds=[]),n.transactionIds.push(e.bytes());break;default:e.skipType(7&a)}}return n},e}(),e.TransactionSnapshotResponse=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.id=e.bytes();break;case 2:n.snapshot=s.waves.TransactionStateSnapshot.decode(e,e.uint32());break;default:e.skipType(7&a)}}return n},e}(),e.TransactionSnapshotsRequest=function(){function e(e){if(this.transactionIds=[],e)for(var t=Object.keys(e),r=0;r>>3===1)n.transactionIds&&n.transactionIds.length||(n.transactionIds=[]),n.transactionIds.push(e.bytes());else e.skipType(7&a)}return n},e}(),e.TransactionsByIdRequest=function(){function e(e){if(this.transactionIds=[],e)for(var t=Object.keys(e),r=0;r>>3===3)n.transactionIds&&n.transactionIds.length||(n.transactionIds=[]),n.transactionIds.push(e.bytes());else e.skipType(7&a)}return n},e}(),e.CalculateFeeResponse=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.assetId=e.bytes();break;case 2:n.amount=e.uint64();break;default:e.skipType(7&a)}}return n},e}(),e.SignRequest=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.transaction=s.waves.Transaction.decode(e,e.uint32());break;case 2:n.signerPublicKey=e.bytes();break;default:e.skipType(7&a)}}return n},e}(),e.InvokeScriptResultResponse=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.transaction=s.waves.SignedTransaction.decode(e,e.uint32());break;case 2:n.result=s.waves.InvokeScriptResult.decode(e,e.uint32());break;default:e.skipType(7&a)}}return n},e}(),e}(),e}(),e.AssetPair=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.amountAssetId=e.bytes();break;case 2:n.priceAssetId=e.bytes();break;default:e.skipType(7&a)}}return n},e}(),e.Order=function(){function e(e){if(this.proofs=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.chainId=e.int32();break;case 3:n.matcherPublicKey=e.bytes();break;case 4:n.assetPair=s.waves.AssetPair.decode(e,e.uint32());break;case 5:n.orderSide=e.int32();break;case 6:n.amount=e.int64();break;case 7:n.price=e.int64();break;case 8:n.timestamp=e.int64();break;case 9:n.expiration=e.int64();break;case 10:n.matcherFee=s.waves.Amount.decode(e,e.uint32());break;case 11:n.version=e.int32();break;case 12:n.proofs&&n.proofs.length||(n.proofs=[]),n.proofs.push(e.bytes());break;case 14:n.priceMode=e.int32();break;case 15:n.attachment=e.bytes();break;case 2:n.senderPublicKey=e.bytes();break;case 13:n.eip712Signature=e.bytes();break;default:e.skipType(7&a)}}return n},e.Side=function(){var e={},t=Object.create(e);return t[e[0]="BUY"]=0,t[e[1]="SELL"]=1,t}(),e.PriceMode=function(){var e={},t=Object.create(e);return t[e[0]="DEFAULT"]=0,t[e[1]="FIXED_DECIMALS"]=1,t[e[2]="ASSET_DECIMALS"]=2,t}(),e}(),e.Recipient=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.publicKeyHash=e.bytes();break;case 2:n.alias=e.string();break;default:e.skipType(7&a)}}return n},e}(),e.RewardShare=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.address=e.bytes();break;case 2:n.reward=e.int64();break;default:e.skipType(7&a)}}return n},e}(),e.BlockSnapshot=function(){function e(e){if(this.snapshots=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.blockId=e.bytes();break;case 2:n.snapshots&&n.snapshots.length||(n.snapshots=[]),n.snapshots.push(s.waves.TransactionStateSnapshot.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return n},e}(),e.MicroBlockSnapshot=function(){function e(e){if(this.snapshots=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.totalBlockId=e.bytes();break;case 2:n.snapshots&&n.snapshots.length||(n.snapshots=[]),n.snapshots.push(s.waves.TransactionStateSnapshot.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return n},e}(),e.TransactionStateSnapshot=function(){function e(e){if(this.balances=[],this.leaseBalances=[],this.newLeases=[],this.cancelledLeases=[],this.assetStatics=[],this.assetVolumes=[],this.assetNamesAndDescriptions=[],this.orderFills=[],this.accountData=[],this.sponsorships=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.balances&&n.balances.length||(n.balances=[]),n.balances.push(s.waves.TransactionStateSnapshot.Balance.decode(e,e.uint32()));break;case 2:n.leaseBalances&&n.leaseBalances.length||(n.leaseBalances=[]),n.leaseBalances.push(s.waves.TransactionStateSnapshot.LeaseBalance.decode(e,e.uint32()));break;case 3:n.newLeases&&n.newLeases.length||(n.newLeases=[]),n.newLeases.push(s.waves.TransactionStateSnapshot.NewLease.decode(e,e.uint32()));break;case 4:n.cancelledLeases&&n.cancelledLeases.length||(n.cancelledLeases=[]),n.cancelledLeases.push(s.waves.TransactionStateSnapshot.CancelledLease.decode(e,e.uint32()));break;case 5:n.assetStatics&&n.assetStatics.length||(n.assetStatics=[]),n.assetStatics.push(s.waves.TransactionStateSnapshot.NewAsset.decode(e,e.uint32()));break;case 6:n.assetVolumes&&n.assetVolumes.length||(n.assetVolumes=[]),n.assetVolumes.push(s.waves.TransactionStateSnapshot.AssetVolume.decode(e,e.uint32()));break;case 7:n.assetNamesAndDescriptions&&n.assetNamesAndDescriptions.length||(n.assetNamesAndDescriptions=[]),n.assetNamesAndDescriptions.push(s.waves.TransactionStateSnapshot.AssetNameAndDescription.decode(e,e.uint32()));break;case 8:n.assetScripts=s.waves.TransactionStateSnapshot.AssetScript.decode(e,e.uint32());break;case 9:n.aliases=s.waves.TransactionStateSnapshot.Alias.decode(e,e.uint32());break;case 10:n.orderFills&&n.orderFills.length||(n.orderFills=[]),n.orderFills.push(s.waves.TransactionStateSnapshot.OrderFill.decode(e,e.uint32()));break;case 11:n.accountScripts=s.waves.TransactionStateSnapshot.AccountScript.decode(e,e.uint32());break;case 12:n.accountData&&n.accountData.length||(n.accountData=[]),n.accountData.push(s.waves.TransactionStateSnapshot.AccountData.decode(e,e.uint32()));break;case 13:n.sponsorships&&n.sponsorships.length||(n.sponsorships=[]),n.sponsorships.push(s.waves.TransactionStateSnapshot.Sponsorship.decode(e,e.uint32()));break;case 14:n.transactionStatus=e.int32();break;default:e.skipType(7&a)}}return n},e.Balance=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.address=e.bytes();break;case 2:n.amount=s.waves.Amount.decode(e,e.uint32());break;default:e.skipType(7&a)}}return n},e}(),e.LeaseBalance=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.address=e.bytes();break;case 2:n.in=e.int64();break;case 3:n.out=e.int64();break;default:e.skipType(7&a)}}return n},e}(),e.NewLease=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.leaseId=e.bytes();break;case 2:n.senderPublicKey=e.bytes();break;case 3:n.recipientAddress=e.bytes();break;case 4:n.amount=e.int64();break;default:e.skipType(7&a)}}return n},e}(),e.CancelledLease=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3===1)n.leaseId=e.bytes();else e.skipType(7&a)}return n},e}(),e.NewAsset=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.assetId=e.bytes();break;case 2:n.issuerPublicKey=e.bytes();break;case 3:n.decimals=e.int32();break;case 4:n.nft=e.bool();break;default:e.skipType(7&a)}}return n},e}(),e.AssetVolume=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.assetId=e.bytes();break;case 2:n.reissuable=e.bool();break;case 3:n.volume=e.bytes();break;default:e.skipType(7&a)}}return n},e}(),e.AssetNameAndDescription=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.assetId=e.bytes();break;case 2:n.name=e.string();break;case 3:n.description=e.string();break;default:e.skipType(7&a)}}return n},e}(),e.AssetScript=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.assetId=e.bytes();break;case 2:n.script=e.bytes();break;default:e.skipType(7&a)}}return n},e}(),e.Alias=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.address=e.bytes();break;case 2:n.alias=e.string();break;default:e.skipType(7&a)}}return n},e}(),e.OrderFill=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.orderId=e.bytes();break;case 2:n.volume=e.int64();break;case 3:n.fee=e.int64();break;default:e.skipType(7&a)}}return n},e}(),e.AccountScript=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.senderPublicKey=e.bytes();break;case 2:n.script=e.bytes();break;case 3:n.verifierComplexity=e.int64();break;default:e.skipType(7&a)}}return n},e}(),e.AccountData=function(){function e(e){if(this.entries=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.address=e.bytes();break;case 2:n.entries&&n.entries.length||(n.entries=[]),n.entries.push(s.waves.DataEntry.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return n},e}(),e.Sponsorship=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.assetId=e.bytes();break;case 2:n.minFee=e.int64();break;default:e.skipType(7&a)}}return n},e}(),e}(),e.TransactionStatus=function(){var e={},t=Object.create(e);return t[e[0]="SUCCEEDED"]=0,t[e[1]="FAILED"]=1,t[e[2]="ELIDED"]=2,t}(),e.SignedTransaction=function(){function e(e){if(this.proofs=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.wavesTransaction=s.waves.Transaction.decode(e,e.uint32());break;case 3:n.ethereumTransaction=e.bytes();break;case 2:n.proofs&&n.proofs.length||(n.proofs=[]),n.proofs.push(e.bytes());break;default:e.skipType(7&a)}}return n},e}(),e.Transaction=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.chainId=e.int32();break;case 2:n.senderPublicKey=e.bytes();break;case 3:n.fee=s.waves.Amount.decode(e,e.uint32());break;case 4:n.timestamp=e.int64();break;case 5:n.version=e.int32();break;case 101:n.genesis=s.waves.GenesisTransactionData.decode(e,e.uint32());break;case 102:n.payment=s.waves.PaymentTransactionData.decode(e,e.uint32());break;case 103:n.issue=s.waves.IssueTransactionData.decode(e,e.uint32());break;case 104:n.transfer=s.waves.TransferTransactionData.decode(e,e.uint32());break;case 105:n.reissue=s.waves.ReissueTransactionData.decode(e,e.uint32());break;case 106:n.burn=s.waves.BurnTransactionData.decode(e,e.uint32());break;case 107:n.exchange=s.waves.ExchangeTransactionData.decode(e,e.uint32());break;case 108:n.lease=s.waves.LeaseTransactionData.decode(e,e.uint32());break;case 109:n.leaseCancel=s.waves.LeaseCancelTransactionData.decode(e,e.uint32());break;case 110:n.createAlias=s.waves.CreateAliasTransactionData.decode(e,e.uint32());break;case 111:n.massTransfer=s.waves.MassTransferTransactionData.decode(e,e.uint32());break;case 112:n.dataTransaction=s.waves.DataTransactionData.decode(e,e.uint32());break;case 113:n.setScript=s.waves.SetScriptTransactionData.decode(e,e.uint32());break;case 114:n.sponsorFee=s.waves.SponsorFeeTransactionData.decode(e,e.uint32());break;case 115:n.setAssetScript=s.waves.SetAssetScriptTransactionData.decode(e,e.uint32());break;case 116:n.invokeScript=s.waves.InvokeScriptTransactionData.decode(e,e.uint32());break;case 117:n.updateAssetInfo=s.waves.UpdateAssetInfoTransactionData.decode(e,e.uint32());break;case 119:n.invokeExpression=s.waves.InvokeExpressionTransactionData.decode(e,e.uint32());break;default:e.skipType(7&a)}}return n},e}(),e.GenesisTransactionData=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.recipientAddress=e.bytes();break;case 2:n.amount=e.int64();break;default:e.skipType(7&a)}}return n},e}(),e.PaymentTransactionData=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.recipientAddress=e.bytes();break;case 2:n.amount=e.int64();break;default:e.skipType(7&a)}}return n},e}(),e.TransferTransactionData=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.recipient=s.waves.Recipient.decode(e,e.uint32());break;case 2:n.amount=s.waves.Amount.decode(e,e.uint32());break;case 3:n.attachment=e.bytes();break;default:e.skipType(7&a)}}return n},e}(),e.CreateAliasTransactionData=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3===1)n.alias=e.string();else e.skipType(7&a)}return n},e}(),e.DataEntry=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.key=e.string();break;case 10:n.intValue=e.int64();break;case 11:n.boolValue=e.bool();break;case 12:n.binaryValue=e.bytes();break;case 13:n.stringValue=e.string();break;default:e.skipType(7&a)}}return n},e}(),e.DataTransactionData=function(){function e(e){if(this.data=[],e)for(var t=Object.keys(e),r=0;r>>3===1)n.data&&n.data.length||(n.data=[]),n.data.push(s.waves.DataEntry.decode(e,e.uint32()));else e.skipType(7&a)}return n},e}(),e.MassTransferTransactionData=function(){function e(e){if(this.transfers=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.assetId=e.bytes();break;case 2:n.transfers&&n.transfers.length||(n.transfers=[]),n.transfers.push(s.waves.MassTransferTransactionData.Transfer.decode(e,e.uint32()));break;case 3:n.attachment=e.bytes();break;default:e.skipType(7&a)}}return n},e.Transfer=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.recipient=s.waves.Recipient.decode(e,e.uint32());break;case 2:n.amount=e.int64();break;default:e.skipType(7&a)}}return n},e}(),e}(),e.LeaseTransactionData=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.recipient=s.waves.Recipient.decode(e,e.uint32());break;case 2:n.amount=e.int64();break;default:e.skipType(7&a)}}return n},e}(),e.LeaseCancelTransactionData=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3===1)n.leaseId=e.bytes();else e.skipType(7&a)}return n},e}(),e.BurnTransactionData=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3===1)n.assetAmount=s.waves.Amount.decode(e,e.uint32());else e.skipType(7&a)}return n},e}(),e.IssueTransactionData=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.name=e.string();break;case 2:n.description=e.string();break;case 3:n.amount=e.int64();break;case 4:n.decimals=e.int32();break;case 5:n.reissuable=e.bool();break;case 6:n.script=e.bytes();break;default:e.skipType(7&a)}}return n},e}(),e.ReissueTransactionData=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.assetAmount=s.waves.Amount.decode(e,e.uint32());break;case 2:n.reissuable=e.bool();break;default:e.skipType(7&a)}}return n},e}(),e.SetAssetScriptTransactionData=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.assetId=e.bytes();break;case 2:n.script=e.bytes();break;default:e.skipType(7&a)}}return n},e}(),e.SetScriptTransactionData=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3===1)n.script=e.bytes();else e.skipType(7&a)}return n},e}(),e.ExchangeTransactionData=function(){function e(e){if(this.orders=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.amount=e.int64();break;case 2:n.price=e.int64();break;case 3:n.buyMatcherFee=e.int64();break;case 4:n.sellMatcherFee=e.int64();break;case 5:n.orders&&n.orders.length||(n.orders=[]),n.orders.push(s.waves.Order.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return n},e}(),e.SponsorFeeTransactionData=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3===1)n.minFee=s.waves.Amount.decode(e,e.uint32());else e.skipType(7&a)}return n},e}(),e.InvokeScriptTransactionData=function(){function e(e){if(this.payments=[],e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.dApp=s.waves.Recipient.decode(e,e.uint32());break;case 2:n.functionCall=e.bytes();break;case 3:n.payments&&n.payments.length||(n.payments=[]),n.payments.push(s.waves.Amount.decode(e,e.uint32()));break;default:e.skipType(7&a)}}return n},e}(),e.UpdateAssetInfoTransactionData=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3){case 1:n.assetId=e.bytes();break;case 2:n.name=e.string();break;case 3:n.description=e.string();break;default:e.skipType(7&a)}}return n},e}(),e.InvokeExpressionTransactionData=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3===1)n.expression=e.bytes();else e.skipType(7&a)}return n},e}(),e}(),s.google=function(){var e={};return e.protobuf=function(){var e={};return e.DoubleValue=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3===1)n.value=e.double();else e.skipType(7&a)}return n},e}(),e.FloatValue=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3===1)n.value=e.float();else e.skipType(7&a)}return n},e}(),e.Int64Value=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3===1)n.value=e.int64();else e.skipType(7&a)}return n},e}(),e.UInt64Value=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3===1)n.value=e.uint64();else e.skipType(7&a)}return n},e}(),e.Int32Value=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3===1)n.value=e.int32();else e.skipType(7&a)}return n},e}(),e.UInt32Value=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3===1)n.value=e.uint32();else e.skipType(7&a)}return n},e}(),e.BoolValue=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3===1)n.value=e.bool();else e.skipType(7&a)}return n},e}(),e.StringValue=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3===1)n.value=e.string();else e.skipType(7&a)}return n},e}(),e.BytesValue=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r>>3===1)n.value=e.bytes();else e.skipType(7&a)}return n},e}(),e.Empty=function(){function e(e){if(e)for(var t=Object.keys(e),r=0;r=256||r%1)return!1}return!0}function u(e,t){if(t||(t={}),"number"==typeof e){n.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),a(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),i(e)&&(e=e.toHexString()),h(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0x0"+r.substring(2):"right"===t.hexPad?r+="0":n.throwArgumentError("hex data is odd-length","value",e));const i=[];for(let e=0;eu(e))),r=t.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(r);return t.reduce(((e,t)=>(n.set(t,e),e+t.length)),0),a(n)}function c(e){let t=u(e);if(0===t.length)return t;let r=0;for(;rt&&n.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),a(r)}function h(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}function d(e,t){if(t||(t={}),"number"==typeof e){n.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t="0123456789abcdef"[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"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),i(e))return e.toHexString();if(h(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":n.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(s(e)){let t="0x";for(let r=0;r>4]+"0123456789abcdef"[15&n]}return t}return n.throwArgumentError("invalid hexlify value","value",e)}function p(e){if("string"!=typeof e)e=d(e);else if(!h(e)||e.length%2)return null;return(e.length-2)/2}function g(e,t,r){return"string"!=typeof e?e=d(e):(!h(e)||e.length%2)&&n.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function y(e){let t="0x";return e.forEach((e=>{t+=d(e).substring(2)})),t}function m(e){const t=v(d(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function v(e){"string"!=typeof e&&(e=d(e)),h(e)||n.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t2*t+2&&n.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function S(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0};if(o(e)){const r=u(e);65!==r.length&&n.throwArgumentError("invalid signature string; must be 65 bytes","signature",e),t.r=d(r.slice(0,32)),t.s=d(r.slice(32,64)),t.v=r[64],t.v<27&&(0===t.v||1===t.v?t.v+=27:n.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=d(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){const r=f(u(t._vs),32);t._vs=d(r);const i=r[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=i:t.recoveryParam!==i&&n.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),r[0]&=127;const a=d(r);null==t.s?t.s=a:t.s!==a&&n.throwArgumentError("signature v mismatch _vs","signature",e)}null==t.recoveryParam?null==t.v?n.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2:null==t.v?t.v=27+t.recoveryParam:t.recoveryParam!==1-t.v%2&&n.throwArgumentError("signature recoveryParam mismatch v","signature",e),null!=t.r&&h(t.r)?t.r=b(t.r,32):n.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&h(t.s)?t.s=b(t.s,32):n.throwArgumentError("signature missing or invalid s","signature",e);const r=u(t.s);r[0]>=128&&n.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);const i=d(r);t._vs&&(h(t._vs)||n.throwArgumentError("signature invalid _vs","signature",e),t._vs=b(t._vs,32)),null==t._vs?t._vs=i:t._vs!==i&&n.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t}function w(e){return d(l([(e=S(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}},function(e,t,r){"use strict";r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return h}));let n=!1,i=!1;const a={debug:1,default:2,info:2,warning:3,error:4,off:5};let o=a.default,s=null;const u=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((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(e){return e.message}return null}();var l,c;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(l||(l={})),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"}(c||(c={}));const f="0123456789abcdef";class h{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const r=e.toLowerCase();null==a[r]&&this.throwArgumentError("invalid log level name","logLevel",e),o>a[r]||console.log.apply(console,t)}debug(){for(var e=arguments.length,t=new Array(e),r=0;r{const t=r[e];try{if(t instanceof Uint8Array){let r="";for(let e=0;e>4],r+=f[15&t[e]];n.push(e+"=Uint8Array(0x"+r+")")}else n.push(e+"="+JSON.stringify(t))}catch(t){n.push(e+"="+JSON.stringify(r[e].toString()))}})),n.push("code="+t),n.push("version="+this.version);const a=e;n.length&&(e+=" ("+n.join(", ")+")");const o=new Error(e);return o.reason=a,o.code=t,Object.keys(r).forEach((function(e){o[e]=r[e]})),o}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,h.errors.INVALID_ARGUMENT,{argument:t,value:r})}assert(e,t,r,n){e||this.throwError(t,r,n)}assertArgument(e,t,r,n){e||this.throwArgumentError(t,r,n)}checkNormalize(e){null==e&&(e="platform missing String.prototype.normalize"),u&&this.throwError("platform missing String.prototype.normalize",h.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:u})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,h.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,h.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",et&&this.throwError("too many arguments"+r,h.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",h.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",h.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",h.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return s||(s=new h("logger/5.4.1")),s}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",h.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),n){if(!e)return;this.globalLogger().throwError("error censorship permanent",h.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}i=!!e,n=!!t}static setLogLevel(e){const t=a[e.toLowerCase()];null!=t?o=t:h.globalLogger().warn("invalid log level - "+e)}static from(e){return new h(e)}}h.errors=c,h.levels=l},function(e,t,r){(function(e){!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 a(e,t,r){if(a.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 o;"object"==typeof e?e.exports=a:t.BN=a,a.BN=a,a.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(136).Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function l(e,t,r,n){for(var i=0,a=Math.min(e.length,r),o=t;o=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(e){return e instanceof a||null!==e&&"object"==typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.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=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.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=t;n-=2)i=u(e,t,n)<=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this.strip()},a.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 a=e.length-r,o=a%n,s=Math.min(a,a-o)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var c=["","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"],f=[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],h=[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];function d(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],a=0|t.words[0],o=i*a,s=67108863&o,u=o/67108864|0;r.words[0]=s;for(var l=1;l>>26,f=67108863&u,h=Math.min(l,t.length-1),d=Math.max(0,l-e.length+1);d<=h;d++){var p=l-d|0;c+=(o=(i=0|e.words[p])*(a=0|t.words[d])+f)/67108864|0,f=67108863&o}r.words[l]=0|f,u=0|c}return 0!==u?r.words[l]=0|u:r.length--,r.strip()}a.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,a=0,o=0;o>>24-i&16777215)||o!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(r=a.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 l=f[e],d=h[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(d).toString(e);r=(p=p.idivn(d)).isZero()?g+r:c[l-g.length]+g+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")},a.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},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return n(void 0!==o),this.toArrayLike(o,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,u="le"===t,l=new e(a),c=this.clone();if(u){for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),l[s]=o;for(;s=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},a.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},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.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;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.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<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},a.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 a=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,d=0|o[1],p=8191&d,g=d>>>13,y=0|o[2],m=8191&y,v=y>>>13,b=0|o[3],S=8191&b,w=b>>>13,E=0|o[4],A=8191&E,T=E>>>13,C=0|o[5],I=8191&C,k=C>>>13,B=0|o[6],_=8191&B,P=B>>>13,O=0|o[7],N=8191&O,R=O>>>13,M=0|o[8],L=8191&M,D=M>>>13,F=0|o[9],x=8191&F,U=F>>>13,j=0|s[0],V=8191&j,K=j>>>13,J=0|s[1],H=8191&J,G=J>>>13,z=0|s[2],X=8191&z,q=z>>>13,Y=0|s[3],Q=8191&Y,Z=Y>>>13,W=0|s[4],$=8191&W,ee=W>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],ue=8191&se,le=se>>>13,ce=0|s[8],fe=8191&ce,he=ce>>>13,de=0|s[9],pe=8191&de,ge=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ye=(l+(n=Math.imul(f,V))|0)+((8191&(i=(i=Math.imul(f,K))+Math.imul(h,V)|0))<<13)|0;l=((a=Math.imul(h,K))+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(p,V),i=(i=Math.imul(p,K))+Math.imul(g,V)|0,a=Math.imul(g,K);var me=(l+(n=n+Math.imul(f,H)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(h,H)|0))<<13)|0;l=((a=a+Math.imul(h,G)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,V),i=(i=Math.imul(m,K))+Math.imul(v,V)|0,a=Math.imul(v,K),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(g,H)|0,a=a+Math.imul(g,G)|0;var ve=(l+(n=n+Math.imul(f,X)|0)|0)+((8191&(i=(i=i+Math.imul(f,q)|0)+Math.imul(h,X)|0))<<13)|0;l=((a=a+Math.imul(h,q)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(S,V),i=(i=Math.imul(S,K))+Math.imul(w,V)|0,a=Math.imul(w,K),n=n+Math.imul(m,H)|0,i=(i=i+Math.imul(m,G)|0)+Math.imul(v,H)|0,a=a+Math.imul(v,G)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(g,X)|0,a=a+Math.imul(g,q)|0;var be=(l+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,Z)|0)+Math.imul(h,Q)|0))<<13)|0;l=((a=a+Math.imul(h,Z)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(A,V),i=(i=Math.imul(A,K))+Math.imul(T,V)|0,a=Math.imul(T,K),n=n+Math.imul(S,H)|0,i=(i=i+Math.imul(S,G)|0)+Math.imul(w,H)|0,a=a+Math.imul(w,G)|0,n=n+Math.imul(m,X)|0,i=(i=i+Math.imul(m,q)|0)+Math.imul(v,X)|0,a=a+Math.imul(v,q)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(g,Q)|0,a=a+Math.imul(g,Z)|0;var Se=(l+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(h,$)|0))<<13)|0;l=((a=a+Math.imul(h,ee)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(I,V),i=(i=Math.imul(I,K))+Math.imul(k,V)|0,a=Math.imul(k,K),n=n+Math.imul(A,H)|0,i=(i=i+Math.imul(A,G)|0)+Math.imul(T,H)|0,a=a+Math.imul(T,G)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,q)|0)+Math.imul(w,X)|0,a=a+Math.imul(w,q)|0,n=n+Math.imul(m,Q)|0,i=(i=i+Math.imul(m,Z)|0)+Math.imul(v,Q)|0,a=a+Math.imul(v,Z)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(g,$)|0,a=a+Math.imul(g,ee)|0;var we=(l+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(h,re)|0))<<13)|0;l=((a=a+Math.imul(h,ne)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(_,V),i=(i=Math.imul(_,K))+Math.imul(P,V)|0,a=Math.imul(P,K),n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(k,H)|0,a=a+Math.imul(k,G)|0,n=n+Math.imul(A,X)|0,i=(i=i+Math.imul(A,q)|0)+Math.imul(T,X)|0,a=a+Math.imul(T,q)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(w,Q)|0,a=a+Math.imul(w,Z)|0,n=n+Math.imul(m,$)|0,i=(i=i+Math.imul(m,ee)|0)+Math.imul(v,$)|0,a=a+Math.imul(v,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(g,re)|0,a=a+Math.imul(g,ne)|0;var Ee=(l+(n=n+Math.imul(f,ae)|0)|0)+((8191&(i=(i=i+Math.imul(f,oe)|0)+Math.imul(h,ae)|0))<<13)|0;l=((a=a+Math.imul(h,oe)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(N,V),i=(i=Math.imul(N,K))+Math.imul(R,V)|0,a=Math.imul(R,K),n=n+Math.imul(_,H)|0,i=(i=i+Math.imul(_,G)|0)+Math.imul(P,H)|0,a=a+Math.imul(P,G)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(k,X)|0,a=a+Math.imul(k,q)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,Z)|0)+Math.imul(T,Q)|0,a=a+Math.imul(T,Z)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(w,$)|0,a=a+Math.imul(w,ee)|0,n=n+Math.imul(m,re)|0,i=(i=i+Math.imul(m,ne)|0)+Math.imul(v,re)|0,a=a+Math.imul(v,ne)|0,n=n+Math.imul(p,ae)|0,i=(i=i+Math.imul(p,oe)|0)+Math.imul(g,ae)|0,a=a+Math.imul(g,oe)|0;var Ae=(l+(n=n+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,le)|0)+Math.imul(h,ue)|0))<<13)|0;l=((a=a+Math.imul(h,le)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(L,V),i=(i=Math.imul(L,K))+Math.imul(D,V)|0,a=Math.imul(D,K),n=n+Math.imul(N,H)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(R,H)|0,a=a+Math.imul(R,G)|0,n=n+Math.imul(_,X)|0,i=(i=i+Math.imul(_,q)|0)+Math.imul(P,X)|0,a=a+Math.imul(P,q)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(k,Q)|0,a=a+Math.imul(k,Z)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(T,$)|0,a=a+Math.imul(T,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(w,re)|0,a=a+Math.imul(w,ne)|0,n=n+Math.imul(m,ae)|0,i=(i=i+Math.imul(m,oe)|0)+Math.imul(v,ae)|0,a=a+Math.imul(v,oe)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(g,ue)|0,a=a+Math.imul(g,le)|0;var Te=(l+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,he)|0)+Math.imul(h,fe)|0))<<13)|0;l=((a=a+Math.imul(h,he)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(x,V),i=(i=Math.imul(x,K))+Math.imul(U,V)|0,a=Math.imul(U,K),n=n+Math.imul(L,H)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(D,H)|0,a=a+Math.imul(D,G)|0,n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,q)|0)+Math.imul(R,X)|0,a=a+Math.imul(R,q)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,Z)|0)+Math.imul(P,Q)|0,a=a+Math.imul(P,Z)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(k,$)|0,a=a+Math.imul(k,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(T,re)|0,a=a+Math.imul(T,ne)|0,n=n+Math.imul(S,ae)|0,i=(i=i+Math.imul(S,oe)|0)+Math.imul(w,ae)|0,a=a+Math.imul(w,oe)|0,n=n+Math.imul(m,ue)|0,i=(i=i+Math.imul(m,le)|0)+Math.imul(v,ue)|0,a=a+Math.imul(v,le)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(g,fe)|0,a=a+Math.imul(g,he)|0;var Ce=(l+(n=n+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ge)|0)+Math.imul(h,pe)|0))<<13)|0;l=((a=a+Math.imul(h,ge)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(x,H),i=(i=Math.imul(x,G))+Math.imul(U,H)|0,a=Math.imul(U,G),n=n+Math.imul(L,X)|0,i=(i=i+Math.imul(L,q)|0)+Math.imul(D,X)|0,a=a+Math.imul(D,q)|0,n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(R,Q)|0,a=a+Math.imul(R,Z)|0,n=n+Math.imul(_,$)|0,i=(i=i+Math.imul(_,ee)|0)+Math.imul(P,$)|0,a=a+Math.imul(P,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(k,re)|0,a=a+Math.imul(k,ne)|0,n=n+Math.imul(A,ae)|0,i=(i=i+Math.imul(A,oe)|0)+Math.imul(T,ae)|0,a=a+Math.imul(T,oe)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,le)|0)+Math.imul(w,ue)|0,a=a+Math.imul(w,le)|0,n=n+Math.imul(m,fe)|0,i=(i=i+Math.imul(m,he)|0)+Math.imul(v,fe)|0,a=a+Math.imul(v,he)|0;var Ie=(l+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ge)|0)+Math.imul(g,pe)|0))<<13)|0;l=((a=a+Math.imul(g,ge)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(x,X),i=(i=Math.imul(x,q))+Math.imul(U,X)|0,a=Math.imul(U,q),n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,Z)|0)+Math.imul(D,Q)|0,a=a+Math.imul(D,Z)|0,n=n+Math.imul(N,$)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(R,$)|0,a=a+Math.imul(R,ee)|0,n=n+Math.imul(_,re)|0,i=(i=i+Math.imul(_,ne)|0)+Math.imul(P,re)|0,a=a+Math.imul(P,ne)|0,n=n+Math.imul(I,ae)|0,i=(i=i+Math.imul(I,oe)|0)+Math.imul(k,ae)|0,a=a+Math.imul(k,oe)|0,n=n+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,le)|0)+Math.imul(T,ue)|0,a=a+Math.imul(T,le)|0,n=n+Math.imul(S,fe)|0,i=(i=i+Math.imul(S,he)|0)+Math.imul(w,fe)|0,a=a+Math.imul(w,he)|0;var ke=(l+(n=n+Math.imul(m,pe)|0)|0)+((8191&(i=(i=i+Math.imul(m,ge)|0)+Math.imul(v,pe)|0))<<13)|0;l=((a=a+Math.imul(v,ge)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(x,Q),i=(i=Math.imul(x,Z))+Math.imul(U,Q)|0,a=Math.imul(U,Z),n=n+Math.imul(L,$)|0,i=(i=i+Math.imul(L,ee)|0)+Math.imul(D,$)|0,a=a+Math.imul(D,ee)|0,n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(R,re)|0,a=a+Math.imul(R,ne)|0,n=n+Math.imul(_,ae)|0,i=(i=i+Math.imul(_,oe)|0)+Math.imul(P,ae)|0,a=a+Math.imul(P,oe)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,le)|0)+Math.imul(k,ue)|0,a=a+Math.imul(k,le)|0,n=n+Math.imul(A,fe)|0,i=(i=i+Math.imul(A,he)|0)+Math.imul(T,fe)|0,a=a+Math.imul(T,he)|0;var Be=(l+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,ge)|0)+Math.imul(w,pe)|0))<<13)|0;l=((a=a+Math.imul(w,ge)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(x,$),i=(i=Math.imul(x,ee))+Math.imul(U,$)|0,a=Math.imul(U,ee),n=n+Math.imul(L,re)|0,i=(i=i+Math.imul(L,ne)|0)+Math.imul(D,re)|0,a=a+Math.imul(D,ne)|0,n=n+Math.imul(N,ae)|0,i=(i=i+Math.imul(N,oe)|0)+Math.imul(R,ae)|0,a=a+Math.imul(R,oe)|0,n=n+Math.imul(_,ue)|0,i=(i=i+Math.imul(_,le)|0)+Math.imul(P,ue)|0,a=a+Math.imul(P,le)|0,n=n+Math.imul(I,fe)|0,i=(i=i+Math.imul(I,he)|0)+Math.imul(k,fe)|0,a=a+Math.imul(k,he)|0;var _e=(l+(n=n+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,ge)|0)+Math.imul(T,pe)|0))<<13)|0;l=((a=a+Math.imul(T,ge)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(x,re),i=(i=Math.imul(x,ne))+Math.imul(U,re)|0,a=Math.imul(U,ne),n=n+Math.imul(L,ae)|0,i=(i=i+Math.imul(L,oe)|0)+Math.imul(D,ae)|0,a=a+Math.imul(D,oe)|0,n=n+Math.imul(N,ue)|0,i=(i=i+Math.imul(N,le)|0)+Math.imul(R,ue)|0,a=a+Math.imul(R,le)|0,n=n+Math.imul(_,fe)|0,i=(i=i+Math.imul(_,he)|0)+Math.imul(P,fe)|0,a=a+Math.imul(P,he)|0;var Pe=(l+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ge)|0)+Math.imul(k,pe)|0))<<13)|0;l=((a=a+Math.imul(k,ge)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(x,ae),i=(i=Math.imul(x,oe))+Math.imul(U,ae)|0,a=Math.imul(U,oe),n=n+Math.imul(L,ue)|0,i=(i=i+Math.imul(L,le)|0)+Math.imul(D,ue)|0,a=a+Math.imul(D,le)|0,n=n+Math.imul(N,fe)|0,i=(i=i+Math.imul(N,he)|0)+Math.imul(R,fe)|0,a=a+Math.imul(R,he)|0;var Oe=(l+(n=n+Math.imul(_,pe)|0)|0)+((8191&(i=(i=i+Math.imul(_,ge)|0)+Math.imul(P,pe)|0))<<13)|0;l=((a=a+Math.imul(P,ge)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(x,ue),i=(i=Math.imul(x,le))+Math.imul(U,ue)|0,a=Math.imul(U,le),n=n+Math.imul(L,fe)|0,i=(i=i+Math.imul(L,he)|0)+Math.imul(D,fe)|0,a=a+Math.imul(D,he)|0;var Ne=(l+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,ge)|0)+Math.imul(R,pe)|0))<<13)|0;l=((a=a+Math.imul(R,ge)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(x,fe),i=(i=Math.imul(x,he))+Math.imul(U,fe)|0,a=Math.imul(U,he);var Re=(l+(n=n+Math.imul(L,pe)|0)|0)+((8191&(i=(i=i+Math.imul(L,ge)|0)+Math.imul(D,pe)|0))<<13)|0;l=((a=a+Math.imul(D,ge)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Me=(l+(n=Math.imul(x,pe))|0)+((8191&(i=(i=Math.imul(x,ge))+Math.imul(U,pe)|0))<<13)|0;return l=((a=Math.imul(U,ge))+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,u[0]=ye,u[1]=me,u[2]=ve,u[3]=be,u[4]=Se,u[5]=we,u[6]=Ee,u[7]=Ae,u[8]=Te,u[9]=Ce,u[10]=Ie,u[11]=ke,u[12]=Be,u[13]=_e,u[14]=Pe,u[15]=Oe,u[16]=Ne,u[17]=Re,u[18]=Me,0!==l&&(u[19]=l,r.length++),r};function g(e,t,r){return(new y).mulp(e,t,r)}function y(e,t){this.x=e,this.y=t}Math.imul||(p=d),a.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?p(this,e,t):r<63?d(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,e,t):g(this,e,t)},y.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n>=1;return n},y.prototype.permute=function(e,t,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*t;o>=26,t+=i/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new a(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,l=0;l=0&&(0!==c||l>=i);l--){var f=0|this.words[l];this.words[l]=c<<26-a|f>>>a,c=f&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=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<=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},a.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>26)-(u/67108864|0),this.words[i+r]=67108863&a}for(;i>26,this.words[i+r]=67108863&a;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==t){(s=new a(null)).length=u+1,s.words=new Array(s.length);for(var l=0;l=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(h=Math.min(h/o|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}},a.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:i,mod:o}):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&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,o,s},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.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),a=r.cmp(n);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},a.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.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 a(1),o=new a(0),s=new a(0),u=new a(1),l=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++l;for(var c=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()||o.isOdd())&&(i.iadd(c),o.isub(f)),i.iushrn(1),o.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(c),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),o.isub(u)):(r.isub(t),s.isub(i),u.isub(o))}return{a:s,b:u,gcd:r.iushln(l)}},a.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,o=new a(1),s=new a(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,c=1;0==(t.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(t.iushrn(l);l-- >0;)o.isOdd()&&o.iadd(u),o.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),o.isub(s)):(r.isub(t),s.isub(o))}return(i=0===t.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(e),i},a.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 a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.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:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new A(e)},a.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)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"==typeof e){var t=a._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 T(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.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=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},i(b,v),b.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=a}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new S;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return m[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):e.umod(this.m)._forceRed(this)},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 a(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),u=s.redNeg(),l=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new a(2*c*c).toRed(this);0!==this.pow(c,l).cmp(u);)c.redIAdd(u);for(var f=this.pow(c,i),h=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=o;0!==d.cmp(s);){for(var g=d,y=0;0!==g.cmp(s);y++)g=g.redSqr();n(y=0;n--){for(var l=t.words[n],c=u-1;c>=0;c--){var f=l>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[o]),s=0,o=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},a.mont=function(e){return new T(e)},i(T,A),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.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),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)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(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),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)},T.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(75)(e))},function(e,t){e.exports={options:{usePureJavaScript:!1}}},function(e,t,r){(function(t,n,i,a){var o=r(3),s=r(92),u=e.exports=o.util=o.util||{};function l(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function c(e){if(this.data="",this.read=0,"string"==typeof e)this.data=e;else if(u.isArrayBuffer(e)||u.isArrayBufferView(e))if(void 0!==a&&e instanceof a)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch(e){for(var r=0;r15?(i=Date.now(),s(e)):(r.push(e),1===r.length&&o.setAttribute("a",a=!a))}}u.nextTick=u.setImmediate}(),u.isNodejs=void 0!==t&&t.versions&&t.versions.node,u.globalScope=u.isNodejs?i:"undefined"==typeof self?window:self,u.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},u.isArrayBuffer=function(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer},u.isArrayBufferView=function(e){return e&&u.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},u.ByteBuffer=c,u.ByteStringBuffer=c,u.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},u.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},u.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},u.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},u.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},u.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},u.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(u.encodeUtf8(e))},u.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},u.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},u.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))},u.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},u.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},u.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))},u.ByteStringBuffer.prototype.putInt=function(e,t){l(t);var r="";do{t-=8,r+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(r)},u.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<0);return t},u.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<=r&&(t-=r<<1),t},u.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},u.ByteStringBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},u.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},u.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},u.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},u.ByteStringBuffer.prototype.copy=function(){var e=u.createBuffer(this.data);return e.read=this.read,e},u.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},u.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},u.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},u.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t=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},u.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},u.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},u.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},u.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},u.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},u.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},u.DataBuffer.prototype.putInt=function(e,t){l(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},u.DataBuffer.prototype.putSignedInt=function(e,t){return l(t),this.accommodate(t/8),e<0&&(e+=2<0);return t},u.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<=r&&(t-=r<<1),t},u.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},u.DataBuffer.prototype.bytes=function(e){return void 0===e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},u.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},u.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},u.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},u.DataBuffer.prototype.copy=function(){return new u.DataBuffer(this)},u.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},u.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},u.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},u.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},u.xorBytes=function(e,t,r){for(var n="",i="",a="",o=0,s=0;r>0;--r,++o)i=e.charCodeAt(o)^t.charCodeAt(o),s>=10&&(n+=a,a="",s=0),a+=String.fromCharCode(i),++s;return n+a},u.hexToBytes=function(e){var t="",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",h=[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],d="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";u.encode64=function(e,t){for(var r,n,i,a="",o="",s=0;s>2),a+=f.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=f.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":f.charAt(63&i)),t&&a.length>t&&(o+=a.substr(0,t)+"\r\n",a=a.substr(t));return o+a},u.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,r,n,i,a="",o=0;o>4),64!==n&&(a+=String.fromCharCode((15&r)<<4|n>>2),64!==i&&(a+=String.fromCharCode((3&n)<<6|i)));return a},u.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},u.decodeUtf8=function(e){return decodeURIComponent(escape(e))},u.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:s.encode,decode:s.decode}},u.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},u.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,a=0;a>2),a+=f.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=f.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":f.charAt(63&i)),t&&a.length>t&&(o+=a.substr(0,t)+"\r\n",a=a.substr(t));return o+a},u.binary.base64.decode=function(e,t,r){var n,i,a,o,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>4,64!==a&&(s[l++]=(15&i)<<4|a>>2,64!==o&&(s[l++]=(3&a)<<6|o));return t?l-r:s.subarray(0,l)},u.binary.base58.encode=function(e,t){return u.binary.baseN.encode(e,d,t)},u.binary.base58.decode=function(e,t){return u.binary.baseN.decode(e,d,t)},u.text={utf8:{},utf16:{}},u.text.utf8.encode=function(e,t,r){e=u.encodeUtf8(e);var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,a=0;a0?(i=r[n].substring(0,o),a=r[n].substring(o+1)):(i=r[n],a=null),i in t||(t[i]=[]),i in Object.prototype||null===a||t[i].push(unescape(a))}return t};return void 0===e?(null===w&&(w="undefined"!=typeof window&&window.location&&window.location.search?r(window.location.search.substring(1)):{}),t=w):t=r(e),t},u.parseFragment=function(e){var t=e,r="",n=e.indexOf("?");n>0&&(t=e.substring(0,n),r=e.substring(n+1));var i=t.split("/");return i.length>0&&""===i[0]&&i.shift(),{pathString:t,queryString:r,path:i,query:""===r?{}:u.getQueryVariables(r)}},u.makeRequest=function(e){var t=u.parseFragment(e),r={path:t.pathString,query:t.queryString,getPath:function(e){return void 0===e?t.path:t.path[e]},getQuery:function(e,r){var n;return void 0===e?n=t.query:(n=t.query[e])&&void 0!==r&&(n=n[r]),n},getQueryLast:function(e,t){var n=r.getQuery(e);return n?n[n.length-1]:t}};return r},u.makeLink=function(e,t,r){e=jQuery.isArray(e)?e.join("/"):e;var n=jQuery.param(t||{});return r=r||"",e+(n.length>0?"?"+n:"")+(r.length>0?"#"+r:"")},u.setPath=function(e,t,r){if("object"==typeof e&&null!==e)for(var n=0,i=t.length;n0&&a.push(r),o=n.lastIndex;var s=t[0][1];switch(s){case"s":case"o":i");break;case"%":a.push("%");break;default:a.push("<%"+s+"?>")}}return a.push(e.substring(o)),a.join("")},u.formatNumber=function(e,t,r,n){var i=e,a=isNaN(t=Math.abs(t))?2:t,o=void 0===r?",":r,s=void 0===n?".":n,u=i<0?"-":"",l=parseInt(i=Math.abs(+i||0).toFixed(a),10)+"",c=l.length>3?l.length%3:0;return u+(c?l.substr(0,c)+s:"")+l.substr(c).replace(/(\d{3})(?=\d)/g,"$1"+s)+(a?o+Math.abs(i-l).toFixed(a).slice(2):"")},u.formatSize=function(e){return e>=1073741824?u.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?u.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?u.formatNumber(e/1024,0)+" KiB":u.formatNumber(e,0)+" bytes"},u.bytesFromIP=function(e){return-1!==e.indexOf(".")?u.bytesFromIPv4(e):-1!==e.indexOf(":")?u.bytesFromIPv6(e):null},u.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var t=u.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1)):r.push({start:s,end:s})}t.push(a)}if(r.length>0){var l=r[n];l.end-l.start>0&&(t.splice(l.start,l.end-l.start+1,""),0===l.start&&t.unshift(""),7===l.end&&t.push(""))}return t.join(":")},u.estimateCores=function(e,t){if("function"==typeof e&&(t=e,e={}),e=e||{},"cores"in u&&!e.update)return t(null,u.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return u.cores=navigator.hardwareConcurrency,t(null,u.cores);if("undefined"==typeof Worker)return u.cores=1,t(null,u.cores);if("undefined"==typeof Blob)return u.cores=2,t(null,u.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",(function(e){for(var t=Date.now(),r=t+4;Date.now()s.st&&i.sti.st&&s.st255)return!1;return!0}function i(e,t){if(e.buffer&&ArrayBuffer.isView(e)&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!n(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(r(e.length)&&n(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function a(e){return new Uint8Array(e)}function o(e,t,r,n,i){null==n&&null==i||(e=e.slice?e.slice(n,i):Array.prototype.slice.call(e,n,i)),t.set(e,r)}var s,u={toBytes:function(e){var t=[],r=0;for(e=encodeURI(e);r191&&n<224?(t.push(String.fromCharCode((31&n)<<6|63&e[r+1])),r+=2):(t.push(String.fromCharCode((15&n)<<12|(63&e[r+1])<<6|63&e[r+2])),r+=3)}return t.join("")}},l=(s="0123456789abcdef",{toBytes:function(e){for(var t=[],r=0;r>4]+s[15&n])}return t.join("")}}),c={16:10,24:12,32:14},f=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],h=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],d=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],p=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],g=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],y=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],m=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],v=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],b=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],S=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],w=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],E=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],A=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],T=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],C=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function I(e){for(var t=[],r=0;r>2,this._Ke[r][t%4]=a[t],this._Kd[e-r][t%4]=a[t];for(var o,s=0,u=i;u>16&255]<<24^h[o>>8&255]<<16^h[255&o]<<8^h[o>>24&255]^f[s]<<24,s+=1,8!=i)for(t=1;t>8&255]<<8^h[o>>16&255]<<16^h[o>>24&255]<<24,t=i/2+1;t>2,d=u%4,this._Ke[l][d]=a[t],this._Kd[e-l][d]=a[t++],u++}for(var l=1;l>24&255]^A[o>>16&255]^T[o>>8&255]^C[255&o]},k.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,r=[0,0,0,0],n=I(e),i=0;i<4;i++)n[i]^=this._Ke[0][i];for(var o=1;o>24&255]^g[n[(i+1)%4]>>16&255]^y[n[(i+2)%4]>>8&255]^m[255&n[(i+3)%4]]^this._Ke[o][i];n=r.slice()}var s,u=a(16);for(i=0;i<4;i++)s=this._Ke[t][i],u[4*i]=255&(h[n[i]>>24&255]^s>>24),u[4*i+1]=255&(h[n[(i+1)%4]>>16&255]^s>>16),u[4*i+2]=255&(h[n[(i+2)%4]>>8&255]^s>>8),u[4*i+3]=255&(h[255&n[(i+3)%4]]^s);return u},k.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,r=[0,0,0,0],n=I(e),i=0;i<4;i++)n[i]^=this._Kd[0][i];for(var o=1;o>24&255]^b[n[(i+3)%4]>>16&255]^S[n[(i+2)%4]>>8&255]^w[255&n[(i+1)%4]]^this._Kd[o][i];n=r.slice()}var s,u=a(16);for(i=0;i<4;i++)s=this._Kd[t][i],u[4*i]=255&(d[n[i]>>24&255]^s>>24),u[4*i+1]=255&(d[n[(i+3)%4]>>16&255]^s>>16),u[4*i+2]=255&(d[n[(i+2)%4]>>8&255]^s>>8),u[4*i+3]=255&(d[255&n[(i+1)%4]]^s);return u};var B=function(e){if(!(this instanceof B))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new k(e)};B.prototype.encrypt=function(e){if((e=i(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=a(e.length),r=a(16),n=0;n=0;--t)this._counter[t]=e%256,e>>=8},N.prototype.setBytes=function(e){if(16!=(e=i(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},N.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var R=function(e,t){if(!(this instanceof R))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",t instanceof N||(t=new N(t)),this._counter=t,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new k(e)};R.prototype.encrypt=function(e){for(var t=i(e,!0),r=0;r16)throw new Error("PKCS#7 padding byte out of range");for(var r=e.length-t,n=0;n0)&&!(n=a.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o};function i(e){if("object"==typeof e&&null!==e){if("function"==typeof Object.getPrototypeOf){var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}return"[object Object]"===Object.prototype.toString.call(e)}return!1}Object.defineProperty(t,"__esModule",{value:!0}),t.pipe=t.switchTransactionByType=t.uniq=t.indexBy=t.filter=t.map=t.deepAssign=t.assign=t.values=t.entries=t.keys=t.prop=t.wait=t.head=t.toArray=t.isObject=void 0,t.isObject=i,t.toArray=function(e){return Array.isArray(e)?e:[e]},t.head=function(e){return e[0]},t.wait=function(e){return new Promise((function(t){setTimeout(t,e)}))},t.prop=function(e){return function(t){return t[e]}},t.keys=function(e){return Object.keys(e)},t.entries=function(e){return t.keys(e).map((function(t){return[t,e[t]]}))},t.values=function(e){return t.keys(e).map((function(t){return e[t]}))},t.assign=function(e,r){return t.entries(r).reduce((function(t,r){var i=n(r,2),a=i[0],o=i[1];return e[a]=o,e}),e)},t.deepAssign=function(){for(var e=[],r=0;r=e.length)&&56320==(64512&e.charCodeAt(t+1))}function o(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>6|192,r[n++]=63&o|128):a(e,i)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++i)),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=63&o|128)}else for(i=0;i>>0}return o},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n>>24,r[i+1]=a>>>16&255,r[i+2]=a>>>8&255,r[i+3]=255&a):(r[i+3]=a>>>24,r[i+2]=a>>>16&255,r[i+1]=a>>>8&255,r[i]=255&a)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return 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],a=n+e[t+1]>>>0,o=(a>>0,e[t+1]=a},t.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,a,o,s){var u=0,l=t;return u+=(l=l+n>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,r,n,i,a,o,s){return t+n+a+s>>>0},t.sum64_5_hi=function(e,t,r,n,i,a,o,s,u,l){var c=0,f=t;return c+=(f=f+n>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,n,i,a,o,s,u,l){return t+n+a+s+l>>>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}},function(e,t,r){var n=r(3);e.exports=n.md=n.md||{},n.md.algorithms=n.md.algorithms||{}},function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o},i=this&&this.__spread||function(){for(var e=[],t=0;tt){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,a,o){if(n.util.isArray(a)){for(var s=[],u=0;ur){if(o.strict){var p=new Error("Too few bytes to read ASN.1 value.");throw p.available=t.length(),p.remaining=r,p.requested=d,p}d=r}var g=32==(32&u);if(g)if(f=[],void 0===d)for(;;){if(a(t,r,2),t.bytes(2)===String.fromCharCode(0,0)){t.getBytes(2),r-=2;break}s=t.length(),f.push(e(t,r,n+1,o)),r-=s-t.length()}else for(;d>0;)s=t.length(),f.push(e(t,d,n+1,o)),r-=s-t.length(),d-=s-t.length();if(void 0===f&&l===i.Class.UNIVERSAL&&c===i.Type.BITSTRING&&(h=t.bytes(d)),void 0===f&&o.decodeBitStrings&&l===i.Class.UNIVERSAL&&c===i.Type.BITSTRING&&d>1){var y=t.read,m=r,v=0;if(c===i.Type.BITSTRING&&(a(t,r,1),v=t.getByte(),r--),0===v)try{s=t.length();var b=e(t,r,n+1,{verbose:o.verbose,strict:!0,decodeBitStrings:!0}),S=s-t.length();r-=S,c==i.Type.BITSTRING&&S++;var w=b.tagClass;S!==d||w!==i.Class.UNIVERSAL&&w!==i.Class.CONTEXT_SPECIFIC||(f=[b])}catch(e){}void 0===f&&(t.read=y,r=m)}if(void 0===f){if(void 0===d){if(o.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");d=r}if(c===i.Type.BMPSTRING)for(f="";d>0;d-=2)a(t,r,2),f+=String.fromCharCode(t.getInt16()),r-=2;else f=t.getBytes(d)}var E=void 0===h?null:{bitStringContents:h};return i.create(l,c,g,f,E)}(e,e.length(),0,t)},i.toDer=function(e){var t=n.util.createBuffer(),r=e.tagClass|e.type,a=n.util.createBuffer(),o=!1;if("bitStringContents"in e&&(o=!0,e.original&&(o=i.equals(e,e.original))),o)a.putBytes(e.bitStringContents);else if(e.composed){e.constructed?r|=32:a.putByte(0);for(var s=0;s1&&(0===e.value.charCodeAt(0)&&0==(128&e.value.charCodeAt(1))||255===e.value.charCodeAt(0)&&128==(128&e.value.charCodeAt(1)))?a.putBytes(e.value.substr(1)):a.putBytes(e.value);if(t.putByte(r),a.length()<=127)t.putByte(127&a.length());else{var u=a.length(),l="";do{l+=String.fromCharCode(255&u),u>>>=8}while(u>0);for(t.putByte(128|l.length),s=l.length-1;s>=0;--s)t.putByte(l.charCodeAt(s))}return t.putBuffer(a),t},i.oidToDer=function(e){var t,r,i,a,o=e.split("."),s=n.util.createBuffer();s.putByte(40*parseInt(o[0],10)+parseInt(o[1],10));for(var u=2;u>>=7,t||(a|=128),r.push(a),t=!1}while(i>0);for(var l=r.length-1;l>=0;--l)s.putByte(r[l])}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),a=parseInt(e.substr(6,2),10),o=parseInt(e.substr(8,2),10),s=0;if(e.length>11){var u=e.charAt(10),l=10;"+"!==u&&"-"!==u&&(s=parseInt(e.substr(10,2),10),l+=2)}if(t.setUTCFullYear(r,n,i),t.setUTCHours(a,o,s,0),l&&("+"===(u=e.charAt(l))||"-"===u)){var c=60*parseInt(e.substr(l+1,2),10)+parseInt(e.substr(l+4,2),10);c*=6e4,"+"===u?t.setTime(+t-c):t.setTime(+t+c)}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),a=parseInt(e.substr(8,2),10),o=parseInt(e.substr(10,2),10),s=parseInt(e.substr(12,2),10),u=0,l=0,c=!1;"Z"===e.charAt(e.length-1)&&(c=!0);var f=e.length-5,h=e.charAt(f);return"+"!==h&&"-"!==h||(l=60*parseInt(e.substr(f+1,2),10)+parseInt(e.substr(f+4,2),10),l*=6e4,"+"===h&&(l*=-1),c=!0),"."===e.charAt(14)&&(u=1e3*parseFloat(e.substr(14),10)),c?(t.setUTCFullYear(r,n,i),t.setUTCHours(a,o,s,u),t.setTime(+t+l)):(t.setFullYear(r,n,i),t.setHours(a,o,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=-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,a){var o=!1;if(e.tagClass!==t.tagClass&&void 0!==t.tagClass||e.type!==t.type&&void 0!==t.type)a&&(e.tagClass!==t.tagClass&&a.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&a.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));else if(e.constructed===t.constructed||void 0===t.constructed){if(o=!0,t.value&&n.util.isArray(t.value))for(var s=0,u=0;o&&u0&&(a+="\n");for(var s="",u=0;u1?a+="0x"+n.util.bytesToHex(e.value.slice(1)):a+="(none)",e.value.length>0){var h=e.value.charCodeAt(0);1==h?a+=" (1 unused bit shown)":h>1&&(a+=" ("+h+" unused bits shown)")}}else e.type===i.Type.OCTETSTRING?(o.test(e.value)||(a+="("+e.value+") "),a+="0x"+n.util.bytesToHex(e.value)):e.type===i.Type.UTF8?a+=n.util.decodeUtf8(e.value):e.type===i.Type.PRINTABLESTRING||e.type===i.Type.IA5String?a+=e.value:o.test(e.value)?a+="0x"+n.util.bytesToHex(e.value):0===e.value.length?a+="[null]":a+=e.value}return a}},function(e,t,r){var n=r(3);n.pki=n.pki||{};var i=e.exports=n.pki.oids=n.oids=n.oids||{};function a(e,t){i[e]=t,i[t]=e}function o(e,t){i[e]=t}a("1.2.840.113549.1.1.1","rsaEncryption"),a("1.2.840.113549.1.1.4","md5WithRSAEncryption"),a("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),a("1.2.840.113549.1.1.7","RSAES-OAEP"),a("1.2.840.113549.1.1.8","mgf1"),a("1.2.840.113549.1.1.9","pSpecified"),a("1.2.840.113549.1.1.10","RSASSA-PSS"),a("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),a("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),a("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),a("1.2.840.10040.4.3","dsa-with-sha1"),a("1.3.14.3.2.7","desCBC"),a("1.3.14.3.2.26","sha1"),a("2.16.840.1.101.3.4.2.1","sha256"),a("2.16.840.1.101.3.4.2.2","sha384"),a("2.16.840.1.101.3.4.2.3","sha512"),a("1.2.840.113549.2.5","md5"),a("1.2.840.113549.1.7.1","data"),a("1.2.840.113549.1.7.2","signedData"),a("1.2.840.113549.1.7.3","envelopedData"),a("1.2.840.113549.1.7.4","signedAndEnvelopedData"),a("1.2.840.113549.1.7.5","digestedData"),a("1.2.840.113549.1.7.6","encryptedData"),a("1.2.840.113549.1.9.1","emailAddress"),a("1.2.840.113549.1.9.2","unstructuredName"),a("1.2.840.113549.1.9.3","contentType"),a("1.2.840.113549.1.9.4","messageDigest"),a("1.2.840.113549.1.9.5","signingTime"),a("1.2.840.113549.1.9.6","counterSignature"),a("1.2.840.113549.1.9.7","challengePassword"),a("1.2.840.113549.1.9.8","unstructuredAddress"),a("1.2.840.113549.1.9.14","extensionRequest"),a("1.2.840.113549.1.9.20","friendlyName"),a("1.2.840.113549.1.9.21","localKeyId"),a("1.2.840.113549.1.9.22.1","x509Certificate"),a("1.2.840.113549.1.12.10.1.1","keyBag"),a("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),a("1.2.840.113549.1.12.10.1.3","certBag"),a("1.2.840.113549.1.12.10.1.4","crlBag"),a("1.2.840.113549.1.12.10.1.5","secretBag"),a("1.2.840.113549.1.12.10.1.6","safeContentsBag"),a("1.2.840.113549.1.5.13","pkcs5PBES2"),a("1.2.840.113549.1.5.12","pkcs5PBKDF2"),a("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),a("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),a("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),a("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),a("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),a("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),a("1.2.840.113549.2.7","hmacWithSHA1"),a("1.2.840.113549.2.8","hmacWithSHA224"),a("1.2.840.113549.2.9","hmacWithSHA256"),a("1.2.840.113549.2.10","hmacWithSHA384"),a("1.2.840.113549.2.11","hmacWithSHA512"),a("1.2.840.113549.3.7","des-EDE3-CBC"),a("2.16.840.1.101.3.4.1.2","aes128-CBC"),a("2.16.840.1.101.3.4.1.22","aes192-CBC"),a("2.16.840.1.101.3.4.1.42","aes256-CBC"),a("2.5.4.3","commonName"),a("2.5.4.5","serialName"),a("2.5.4.6","countryName"),a("2.5.4.7","localityName"),a("2.5.4.8","stateOrProvinceName"),a("2.5.4.10","organizationName"),a("2.5.4.11","organizationalUnitName"),a("2.5.4.13","description"),a("2.16.840.1.113730.1.1","nsCertType"),a("2.16.840.1.113730.1.13","nsComment"),o("2.5.29.1","authorityKeyIdentifier"),o("2.5.29.2","keyAttributes"),o("2.5.29.3","certificatePolicies"),o("2.5.29.4","keyUsageRestriction"),o("2.5.29.5","policyMapping"),o("2.5.29.6","subtreesConstraint"),o("2.5.29.7","subjectAltName"),o("2.5.29.8","issuerAltName"),o("2.5.29.9","subjectDirectoryAttributes"),o("2.5.29.10","basicConstraints"),o("2.5.29.11","nameConstraints"),o("2.5.29.12","policyConstraints"),o("2.5.29.13","basicConstraints"),a("2.5.29.14","subjectKeyIdentifier"),a("2.5.29.15","keyUsage"),o("2.5.29.16","privateKeyUsagePeriod"),a("2.5.29.17","subjectAltName"),a("2.5.29.18","issuerAltName"),a("2.5.29.19","basicConstraints"),o("2.5.29.20","cRLNumber"),o("2.5.29.21","cRLReason"),o("2.5.29.22","expirationDate"),o("2.5.29.23","instructionCode"),o("2.5.29.24","invalidityDate"),o("2.5.29.25","cRLDistributionPoints"),o("2.5.29.26","issuingDistributionPoint"),o("2.5.29.27","deltaCRLIndicator"),o("2.5.29.28","issuingDistributionPoint"),o("2.5.29.29","certificateIssuer"),o("2.5.29.30","nameConstraints"),a("2.5.29.31","cRLDistributionPoints"),a("2.5.29.32","certificatePolicies"),o("2.5.29.33","policyMappings"),o("2.5.29.34","policyConstraints"),a("2.5.29.35","authorityKeyIdentifier"),o("2.5.29.36","policyConstraints"),a("2.5.29.37","extKeyUsage"),o("2.5.29.46","freshestCRL"),o("2.5.29.54","inhibitAnyPolicy"),a("1.3.6.1.4.1.11129.2.4.2","timestampList"),a("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),a("1.3.6.1.5.5.7.3.1","serverAuth"),a("1.3.6.1.5.5.7.3.2","clientAuth"),a("1.3.6.1.5.5.7.3.3","codeSigning"),a("1.3.6.1.5.5.7.3.4","emailProtection"),a("1.3.6.1.5.5.7.3.8","timeStamping")},,,function(e,t,r){"use strict";(function(e){var n=r(88),i=r(89),a=r(90);function o(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return j(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(e).length;default:if(n)return j(e).length;t=(""+t).toLowerCase(),n=!0}}function g(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return _(this,t,r);case"utf8":case"utf-8":return I(this,t,r);case"ascii":return k(this,t,r);case"latin1":case"binary":return B(this,t,r);case"base64":return C(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:v(e,t,r,n,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):v(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,r,n,i){var a,o=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,u/=2,r/=2}function l(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var c=-1;for(a=r;as&&(r=s-u),a=r;a>=0;a--){for(var f=!0,h=0;hi&&(n=i):n=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function C(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function I(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:l>223?3:l>191?2:1;if(i+f<=r)switch(f){case 1:l<128&&(c=l);break;case 2:128==(192&(a=e[i+1]))&&(u=(31&l)<<6|63&a)>127&&(c=u);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(u=(15&l)<<12|(63&a)<<6|63&o)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(u=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,f=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var r="",n=0;nn)&&(r=n);for(var i="",a=t;ar)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,r,n,i,a){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function R(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function M(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function L(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(e,t,r,n,a){return a||L(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function F(e,t,r,n,a){return a||L(e,0,r,8),i.write(e,t,r,n,52,8),r+8}t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=o(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,r){return l(null,e,t,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,r){return function(e,t,r,n){return c(t),t<=0?s(e,t):void 0!==r?"string"==typeof n?s(e,t).fill(r,n):s(e,t).fill(r):s(e,t)}(null,e,t,r)},u.allocUnsafe=function(e){return f(null,e)},u.allocUnsafeSlow=function(e){return f(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),""},u.prototype.compare=function(e,t,r,n,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),l=this.slice(n,i),c=e.slice(t,r),f=0;fi)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return S(this,e,t,r);case"ascii":return w(this,e,t,r);case"latin1":case"binary":return E(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},u.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUInt8=function(e,t){return t||O(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||O(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||O(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||O(e,t,this.length);for(var n=this[e],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||O(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},u.prototype.readInt8=function(e,t){return t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||O(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){t||O(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||O(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||O(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||O(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||O(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t|=0,r|=0,n||N(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a=0&&(a*=256);)this[t+i]=e/a&255;return t+r},u.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):M(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);N(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);N(this,e,t,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):R(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):R(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):M(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):M(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,r){return D(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return D(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return F(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return F(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(a<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function V(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(x,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function K(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}}).call(this,r(17))},function(e,t){var r,n,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(e){r=a}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var u,l=[],c=!1,f=-1;function h(){c&&u&&(c=!1,u.length?l=u.concat(l):f=-1,l.length&&d())}function d(){if(!c){var e=s(h);c=!0;for(var t=l.length;t;){for(u=l,l=[];++f1)for(var r=1;r0)&&!(n=a.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o},i=this&&this.__spread||function(){for(var e=[],t=0;t0)&&!(n=a.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o};Object.defineProperty(t,"__esModule",{value:!0});var i=r(10);t.default=function(e,t){void 0===t&&(t=Object.create(null));var r=Object.keys(e).map((function(t){return[t,e[t]]})).map((function(e){var r=n(e,2),i=r[0],a=r[1];return[i,Object.prototype.hasOwnProperty.call(t,i)?t[i](a):a]})).filter((function(e){var t=n(e,2);return t[0],null!=t[1]})).map((function(e){var t=n(e,2),r=t[0],a=t[1];return i.toArray(a).map((function(e){return r+"="+e})).join("&")})).join("&");return r.length?"?"+r:""}},function(e,t,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0)&&!(n=a.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.broadcast=t.fetchStatus=t.fetchInfo=t.fetchUnconfirmedInfo=t.fetchTransactions=t.fetchUnconfirmed=t.fetchCalculateFee=t.fetchUnconfirmedSize=void 0;var o=r(47),s=r(46),u=a(r(8)),l=a(r(28)),c=r(10),f=a(r(69)),h=r(119);function d(e,t,r){return void 0===r&&(r=Object.create(null)),u.default({base:e,url:"/transactions/unconfirmed/info/"+t,options:r})}function p(e,t,r){return void 0===r&&(r=Object.create(null)),u.default({base:e,url:"/transactions/info/"+t,options:r}).then((function(e){return h.addStateUpdateField(e)}))}t.fetchUnconfirmedSize=function(e){return u.default({base:e,url:"/transactions/unconfirmed/size"})},t.fetchCalculateFee=function(e,t,r){return void 0===r&&(r=Object.create(null)),u.default({base:e,url:"/transactions/calculateFee",options:c.deepAssign(n({},r),{method:"POST",body:f.default(t),headers:{"Content-Type":"application/json"}})})},t.fetchUnconfirmed=function(e,t){return void 0===t&&(t=Object.create(null)),u.default({base:e,url:"/transactions/unconfirmed",options:t})},t.fetchTransactions=function(e,t,r,n,a,o){return void 0===o&&(o=Object.create(null)),u.default({base:e,url:"/transactions/address/"+t+"/limit/"+r+l.default({after:n}),options:o}).then((function(e){var t=i(e,1)[0];return t.forEach((function(e){return h.addStateUpdateField(e)})),t}))},t.fetchUnconfirmedInfo=d,t.fetchInfo=p,t.fetchStatus=function(e,t){var r={id:"",confirmations:-1,height:-1,inUTX:!1,status:o.TRANSACTION_STATUSES.NOT_FOUND},a=t.map((function(t){return d(e,t).then((function(){return n(n({},r),{id:t,status:o.TRANSACTION_STATUSES.UNCONFIRMED,inUTX:!0})})).catch((function(){return p(e,t).then((function(e){return n(n({},r),{id:t,status:o.TRANSACTION_STATUSES.IN_BLOCKCHAIN,height:e.height,applicationStatus:e.applicationStatus})}))})).catch((function(){return n(n({},r),{id:t})}))}));return Promise.all([s.fetchHeight(e),Promise.all(a)]).then((function(e){var t=i(e,2),r=t[0].height,a=t[1];return{height:r,statuses:a.map((function(e){return n(n({},e),{confirmations:e.status===o.TRANSACTION_STATUSES.IN_BLOCKCHAIN?r-e.height:e.confirmations})}))}}))},t.broadcast=function(e,t,r){return void 0===r&&(r=Object.create(null)),u.default({base:e,url:"/transactions/broadcast",options:c.deepAssign(n({},r),{method:"POST",body:f.default(t),headers:{"Content-Type":"application/json"}})})}},function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=r,r.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},function(e,t,r){"use strict";var n=r(11),i=r(30);function a(){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=a,a.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>>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,a=8;a>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=n>>24&255,e[t+5]=n>>16&255,e[t+6]=n>>8&255,e[t+7]=255&n}function g(e,t,r,n){return function(e,t,r,n,i){var a,o=0;for(a=0;a>>8)-1}(e,t,r,n,32)}function y(e,t){for(var r=0;r<16;r++)e[r]=0|t[r]}function m(e){var t,r,n=1;for(t=0;t<16;t++)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function v(e,t,r){for(var n,i=~(r-1),a=0;a<16;a++)n=i&(e[a]^t[a]),e[a]^=n,t[a]^=n}function b(e,t){var r,n,a,o=i(),s=i();for(r=0;r<16;r++)s[r]=t[r];for(m(s),m(s),m(s),n=0;n<2;n++){for(o[0]=s[0]-65517,r=1;r<15;r++)o[r]=s[r]-65535-(o[r-1]>>16&1),o[r-1]&=65535;o[15]=s[15]-32767-(o[14]>>16&1),a=o[15]>>16&1,o[14]&=65535,v(s,o,1-a)}for(r=0;r<16;r++)e[2*r]=255&s[r],e[2*r+1]=s[r]>>8}function S(e,t){var r=new Uint8Array(32),n=new Uint8Array(32);return b(r,e),b(n,t),g(r,0,n,0)}function w(e){var t=new Uint8Array(32);return b(t,e),1&t[0]}function E(e,t){for(var r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function A(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]+r[n]}function T(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]-r[n]}function C(e,t,r){var n,i,a=0,o=0,s=0,u=0,l=0,c=0,f=0,h=0,d=0,p=0,g=0,y=0,m=0,v=0,b=0,S=0,w=0,E=0,A=0,T=0,C=0,I=0,k=0,B=0,_=0,P=0,O=0,N=0,R=0,M=0,L=0,D=r[0],F=r[1],x=r[2],U=r[3],j=r[4],V=r[5],K=r[6],J=r[7],H=r[8],G=r[9],z=r[10],X=r[11],q=r[12],Y=r[13],Q=r[14],Z=r[15];a+=(n=t[0])*D,o+=n*F,s+=n*x,u+=n*U,l+=n*j,c+=n*V,f+=n*K,h+=n*J,d+=n*H,p+=n*G,g+=n*z,y+=n*X,m+=n*q,v+=n*Y,b+=n*Q,S+=n*Z,o+=(n=t[1])*D,s+=n*F,u+=n*x,l+=n*U,c+=n*j,f+=n*V,h+=n*K,d+=n*J,p+=n*H,g+=n*G,y+=n*z,m+=n*X,v+=n*q,b+=n*Y,S+=n*Q,w+=n*Z,s+=(n=t[2])*D,u+=n*F,l+=n*x,c+=n*U,f+=n*j,h+=n*V,d+=n*K,p+=n*J,g+=n*H,y+=n*G,m+=n*z,v+=n*X,b+=n*q,S+=n*Y,w+=n*Q,E+=n*Z,u+=(n=t[3])*D,l+=n*F,c+=n*x,f+=n*U,h+=n*j,d+=n*V,p+=n*K,g+=n*J,y+=n*H,m+=n*G,v+=n*z,b+=n*X,S+=n*q,w+=n*Y,E+=n*Q,A+=n*Z,l+=(n=t[4])*D,c+=n*F,f+=n*x,h+=n*U,d+=n*j,p+=n*V,g+=n*K,y+=n*J,m+=n*H,v+=n*G,b+=n*z,S+=n*X,w+=n*q,E+=n*Y,A+=n*Q,T+=n*Z,c+=(n=t[5])*D,f+=n*F,h+=n*x,d+=n*U,p+=n*j,g+=n*V,y+=n*K,m+=n*J,v+=n*H,b+=n*G,S+=n*z,w+=n*X,E+=n*q,A+=n*Y,T+=n*Q,C+=n*Z,f+=(n=t[6])*D,h+=n*F,d+=n*x,p+=n*U,g+=n*j,y+=n*V,m+=n*K,v+=n*J,b+=n*H,S+=n*G,w+=n*z,E+=n*X,A+=n*q,T+=n*Y,C+=n*Q,I+=n*Z,h+=(n=t[7])*D,d+=n*F,p+=n*x,g+=n*U,y+=n*j,m+=n*V,v+=n*K,b+=n*J,S+=n*H,w+=n*G,E+=n*z,A+=n*X,T+=n*q,C+=n*Y,I+=n*Q,k+=n*Z,d+=(n=t[8])*D,p+=n*F,g+=n*x,y+=n*U,m+=n*j,v+=n*V,b+=n*K,S+=n*J,w+=n*H,E+=n*G,A+=n*z,T+=n*X,C+=n*q,I+=n*Y,k+=n*Q,B+=n*Z,p+=(n=t[9])*D,g+=n*F,y+=n*x,m+=n*U,v+=n*j,b+=n*V,S+=n*K,w+=n*J,E+=n*H,A+=n*G,T+=n*z,C+=n*X,I+=n*q,k+=n*Y,B+=n*Q,_+=n*Z,g+=(n=t[10])*D,y+=n*F,m+=n*x,v+=n*U,b+=n*j,S+=n*V,w+=n*K,E+=n*J,A+=n*H,T+=n*G,C+=n*z,I+=n*X,k+=n*q,B+=n*Y,_+=n*Q,P+=n*Z,y+=(n=t[11])*D,m+=n*F,v+=n*x,b+=n*U,S+=n*j,w+=n*V,E+=n*K,A+=n*J,T+=n*H,C+=n*G,I+=n*z,k+=n*X,B+=n*q,_+=n*Y,P+=n*Q,O+=n*Z,m+=(n=t[12])*D,v+=n*F,b+=n*x,S+=n*U,w+=n*j,E+=n*V,A+=n*K,T+=n*J,C+=n*H,I+=n*G,k+=n*z,B+=n*X,_+=n*q,P+=n*Y,O+=n*Q,N+=n*Z,v+=(n=t[13])*D,b+=n*F,S+=n*x,w+=n*U,E+=n*j,A+=n*V,T+=n*K,C+=n*J,I+=n*H,k+=n*G,B+=n*z,_+=n*X,P+=n*q,O+=n*Y,N+=n*Q,R+=n*Z,b+=(n=t[14])*D,S+=n*F,w+=n*x,E+=n*U,A+=n*j,T+=n*V,C+=n*K,I+=n*J,k+=n*H,B+=n*G,_+=n*z,P+=n*X,O+=n*q,N+=n*Y,R+=n*Q,M+=n*Z,S+=(n=t[15])*D,o+=38*(E+=n*x),s+=38*(A+=n*U),u+=38*(T+=n*j),l+=38*(C+=n*V),c+=38*(I+=n*K),f+=38*(k+=n*J),h+=38*(B+=n*H),d+=38*(_+=n*G),p+=38*(P+=n*z),g+=38*(O+=n*X),y+=38*(N+=n*q),m+=38*(R+=n*Y),v+=38*(M+=n*Q),b+=38*(L+=n*Z),a=(n=(a+=38*(w+=n*F))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),S=(n=S+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=(a+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),S=(n=S+i+65535)-65536*(i=Math.floor(n/65536)),a+=i-1+37*(i-1),e[0]=a,e[1]=o,e[2]=s,e[3]=u,e[4]=l,e[5]=c,e[6]=f,e[7]=h,e[8]=d,e[9]=p,e[10]=g,e[11]=y,e[12]=m,e[13]=v,e[14]=b,e[15]=S}function I(e,t){C(e,t,t)}function k(e,t){var r,n=i();for(r=0;r<16;r++)n[r]=t[r];for(r=253;r>=0;r--)I(n,n),2!==r&&4!==r&&C(n,n,t);for(r=0;r<16;r++)e[r]=n[r]}function B(e,t,r){var n,a,o=new Uint8Array(32),s=new Float64Array(80),l=i(),c=i(),f=i(),h=i(),d=i(),p=i();for(a=0;a<31;a++)o[a]=t[a];for(o[31]=127&t[31]|64,o[0]&=248,E(s,r),a=0;a<16;a++)c[a]=s[a],h[a]=l[a]=f[a]=0;for(l[0]=h[0]=1,a=254;a>=0;--a)v(l,c,n=o[a>>>3]>>>(7&a)&1),v(f,h,n),A(d,l,f),T(l,l,f),A(f,c,h),T(c,c,h),I(h,d),I(p,l),C(l,f,l),C(f,c,d),A(d,l,f),T(l,l,f),I(c,l),T(f,h,p),C(l,f,u),A(l,l,h),C(f,f,l),C(l,h,p),C(h,c,s),I(c,d),v(l,c,n),v(f,h,n);for(a=0;a<16;a++)s[a+16]=l[a],s[a+32]=f[a],s[a+48]=c[a],s[a+64]=h[a];var g=s.subarray(32),y=s.subarray(16);return k(g,g),C(y,y,g),b(e,y),0}var _=[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 P(e,t,r,n){for(var i,a,o,s,u,l,c,f,h,d,p,g,y,m,v,b,S,w,E,A,T,C,I,k,B,P,O=new Int32Array(16),N=new Int32Array(16),R=e[0],M=e[1],L=e[2],D=e[3],F=e[4],x=e[5],U=e[6],j=e[7],V=t[0],K=t[1],J=t[2],H=t[3],G=t[4],z=t[5],X=t[6],q=t[7],Y=0;n>=128;){for(E=0;E<16;E++)A=8*E+Y,O[E]=r[A+0]<<24|r[A+1]<<16|r[A+2]<<8|r[A+3],N[E]=r[A+4]<<24|r[A+5]<<16|r[A+6]<<8|r[A+7];for(E=0;E<80;E++)if(i=R,a=M,o=L,s=D,u=F,l=x,c=U,h=V,d=K,p=J,g=H,y=G,m=z,v=X,I=65535&(C=q),k=C>>>16,B=65535&(T=j),P=T>>>16,I+=65535&(C=(G>>>14|F<<18)^(G>>>18|F<<14)^(F>>>9|G<<23)),k+=C>>>16,B+=65535&(T=(F>>>14|G<<18)^(F>>>18|G<<14)^(G>>>9|F<<23)),P+=T>>>16,I+=65535&(C=G&z^~G&X),k+=C>>>16,B+=65535&(T=F&x^~F&U),P+=T>>>16,I+=65535&(C=_[2*E+1]),k+=C>>>16,B+=65535&(T=_[2*E]),P+=T>>>16,T=O[E%16],k+=(C=N[E%16])>>>16,B+=65535&T,P+=T>>>16,B+=(k+=(I+=65535&C)>>>16)>>>16,I=65535&(C=w=65535&I|k<<16),k=C>>>16,B=65535&(T=S=65535&B|(P+=B>>>16)<<16),P=T>>>16,I+=65535&(C=(V>>>28|R<<4)^(R>>>2|V<<30)^(R>>>7|V<<25)),k+=C>>>16,B+=65535&(T=(R>>>28|V<<4)^(V>>>2|R<<30)^(V>>>7|R<<25)),P+=T>>>16,k+=(C=V&K^V&J^K&J)>>>16,B+=65535&(T=R&M^R&L^M&L),P+=T>>>16,f=65535&(B+=(k+=(I+=65535&C)>>>16)>>>16)|(P+=B>>>16)<<16,b=65535&I|k<<16,I=65535&(C=g),k=C>>>16,B=65535&(T=s),P=T>>>16,k+=(C=w)>>>16,B+=65535&(T=S),P+=T>>>16,M=i,L=a,D=o,F=s=65535&(B+=(k+=(I+=65535&C)>>>16)>>>16)|(P+=B>>>16)<<16,x=u,U=l,j=c,R=f,K=h,J=d,H=p,G=g=65535&I|k<<16,z=y,X=m,q=v,V=b,E%16==15)for(A=0;A<16;A++)T=O[A],I=65535&(C=N[A]),k=C>>>16,B=65535&T,P=T>>>16,T=O[(A+9)%16],I+=65535&(C=N[(A+9)%16]),k+=C>>>16,B+=65535&T,P+=T>>>16,S=O[(A+1)%16],I+=65535&(C=((w=N[(A+1)%16])>>>1|S<<31)^(w>>>8|S<<24)^(w>>>7|S<<25)),k+=C>>>16,B+=65535&(T=(S>>>1|w<<31)^(S>>>8|w<<24)^S>>>7),P+=T>>>16,S=O[(A+14)%16],k+=(C=((w=N[(A+14)%16])>>>19|S<<13)^(S>>>29|w<<3)^(w>>>6|S<<26))>>>16,B+=65535&(T=(S>>>19|w<<13)^(w>>>29|S<<3)^S>>>6),P+=T>>>16,P+=(B+=(k+=(I+=65535&C)>>>16)>>>16)>>>16,O[A]=65535&B|P<<16,N[A]=65535&I|k<<16;I=65535&(C=V),k=C>>>16,B=65535&(T=R),P=T>>>16,T=e[0],k+=(C=t[0])>>>16,B+=65535&T,P+=T>>>16,P+=(B+=(k+=(I+=65535&C)>>>16)>>>16)>>>16,e[0]=R=65535&B|P<<16,t[0]=V=65535&I|k<<16,I=65535&(C=K),k=C>>>16,B=65535&(T=M),P=T>>>16,T=e[1],k+=(C=t[1])>>>16,B+=65535&T,P+=T>>>16,P+=(B+=(k+=(I+=65535&C)>>>16)>>>16)>>>16,e[1]=M=65535&B|P<<16,t[1]=K=65535&I|k<<16,I=65535&(C=J),k=C>>>16,B=65535&(T=L),P=T>>>16,T=e[2],k+=(C=t[2])>>>16,B+=65535&T,P+=T>>>16,P+=(B+=(k+=(I+=65535&C)>>>16)>>>16)>>>16,e[2]=L=65535&B|P<<16,t[2]=J=65535&I|k<<16,I=65535&(C=H),k=C>>>16,B=65535&(T=D),P=T>>>16,T=e[3],k+=(C=t[3])>>>16,B+=65535&T,P+=T>>>16,P+=(B+=(k+=(I+=65535&C)>>>16)>>>16)>>>16,e[3]=D=65535&B|P<<16,t[3]=H=65535&I|k<<16,I=65535&(C=G),k=C>>>16,B=65535&(T=F),P=T>>>16,T=e[4],k+=(C=t[4])>>>16,B+=65535&T,P+=T>>>16,P+=(B+=(k+=(I+=65535&C)>>>16)>>>16)>>>16,e[4]=F=65535&B|P<<16,t[4]=G=65535&I|k<<16,I=65535&(C=z),k=C>>>16,B=65535&(T=x),P=T>>>16,T=e[5],k+=(C=t[5])>>>16,B+=65535&T,P+=T>>>16,P+=(B+=(k+=(I+=65535&C)>>>16)>>>16)>>>16,e[5]=x=65535&B|P<<16,t[5]=z=65535&I|k<<16,I=65535&(C=X),k=C>>>16,B=65535&(T=U),P=T>>>16,T=e[6],k+=(C=t[6])>>>16,B+=65535&T,P+=T>>>16,P+=(B+=(k+=(I+=65535&C)>>>16)>>>16)>>>16,e[6]=U=65535&B|P<<16,t[6]=X=65535&I|k<<16,I=65535&(C=q),k=C>>>16,B=65535&(T=j),P=T>>>16,T=e[7],k+=(C=t[7])>>>16,B+=65535&T,P+=T>>>16,P+=(B+=(k+=(I+=65535&C)>>>16)>>>16)>>>16,e[7]=j=65535&B|P<<16,t[7]=q=65535&I|k<<16,Y+=128,n-=128}return n}function O(e,t,r){var n,i=new Int32Array(8),a=new Int32Array(8),o=new Uint8Array(256),s=r;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,a[0]=4089235720,a[1]=2227873595,a[2]=4271175723,a[3]=1595750129,a[4]=2917565137,a[5]=725511199,a[6]=4215389547,a[7]=327033209,P(i,a,t,r),r%=128,n=0;n=0;--i)R(e,t,n=r[i/8|0]>>(7&i)&1),N(t,e),N(e,e),R(e,t,n)}function D(e,t){var r=[i(),i(),i(),i()];y(r[0],f),y(r[1],h),y(r[2],s),C(r[3],f,h),L(e,r,t)}var F=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function x(e,t){var r,n,i,a;for(n=63;n>=32;--n){for(r=0,i=n-32,a=n-12;i>8,t[i]-=256*r;t[i]+=r,t[n]=0}for(r=0,i=0;i<32;i++)t[i]+=r-(t[31]>>4)*F[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=r*F[i];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function U(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;x(e,r)}function j(e,t,r,n,a){for(var o=new Uint8Array(64),s=[i(),i(),i(),i()],u=0;u<32;u++)o[u]=n[u];o[0]&=248,o[31]&=127,o[31]|=64,D(s,o),M(o.subarray(32),s);var l,c=128&o[63];return l=a?function(e,t,r,n,a){new Uint8Array(64);var o,s,u=new Uint8Array(64),l=new Uint8Array(64),c=new Float64Array(64),f=[i(),i(),i(),i()];for(e[0]=254,o=1;o<32;o++)e[o]=255;for(o=0;o<32;o++)e[32+o]=n[o];for(o=0;o=0;r--)I(n,n),1!==r&&C(n,n,t);for(r=0;r<16;r++)e[r]=n[r]}(r,r),C(r,r,a),C(r,r,u),C(r,r,u),C(e[0],r,u),I(n,e[0]),C(n,n,u),S(n,a)&&C(e[0],e[0],d),I(n,e[0]),C(n,n,u),S(n,a)?-1:(w(e[0])===t[31]>>7&&T(e[0],o,e[0]),C(e[3],e[0],e[1]),0)}function K(e,t,r,n){var a=function(e){var t=new Uint8Array(32),r=i(),n=i(),a=i();return E(r,e),A(n,r,s),T(a,r,s),k(n,n),C(n,n,a),b(t,n),t}(n);return a[31]|=128&t[63],t[63]&=127,function(e,t,r,n){var a,o=new Uint8Array(32),s=new Uint8Array(64),u=[i(),i(),i(),i()],l=[i(),i(),i(),i()];if(r<64)return-1;if(V(l,n))return-1;for(a=0;a=0},n.generateKeyPair=function(e){if(J(e),32!==e.length)throw new Error("wrong seed length");for(var t=new Uint8Array(32),r=new Uint8Array(32),n=0;n<32;n++)t[n]=e[n];return B(r,t,a),t[0]&=248,t[31]&=127,t[31]|=64,r[31]&=127,{public:r,private:t}},t.default=n},function(e,t,r){var n=r(3);if(r(20),r(62),r(21),r(103),r(104),r(18),r(4),void 0===i)var i=n.jsbn.BigInteger;var a=n.util.isNodejs?r(41):null,o=n.asn1,s=n.util;n.pki=n.pki||{},e.exports=n.pki.rsa=n.rsa=n.rsa||{};var u=n.pki,l=[6,4,2,4,2,4,6,2],c={name:"PrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",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:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},f={name:"RSAPrivateKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},h={name:"RSAPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},d=n.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",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:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},p=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=o.oidToDer(t).getBytes(),i=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]),a=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]);a.value.push(o.create(o.Class.UNIVERSAL,o.Type.OID,!1,n)),a.value.push(o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,""));var s=o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(a),i.value.push(s),o.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 a;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{a=new i(n.util.bytesToHex(n.random.getBytes(t.n.bitLength()/8)),16)}while(a.compareTo(t.n)>=0||!a.gcd(t.n).equals(i.ONE));for(var o=(e=e.multiply(a.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);o.compareTo(s)<0;)o=o.add(t.p);var u=o.subtract(s).multiply(t.qInv).mod(t.p).multiply(t.q).add(s);return u.multiply(a.modInverse(t.n)).mod(t.n)};function y(e,t,r){var i=n.util.createBuffer(),a=Math.ceil(t.n.bitLength()/8);if(e.length>a-11){var o=new Error("Message is too long for PKCS#1 v1.5 padding.");throw o.length=e.length,o.max=a-11,o}i.putByte(0),i.putByte(r);var s,u=a-3-e.length;if(0===r||1===r){s=0===r?0:255;for(var l=0;l0;){var c=0,f=n.random.getBytes(u);for(l=0;l1;){if(255!==o.getByte()){--o.read;break}++l}else if(2===u)for(l=0;o.length()>1;){if(0===o.getByte()){--o.read;break}++l}if(0!==o.getByte()||l!==a-3-o.length())throw new Error("Encryption block is invalid.");return o.getBytes()}function v(e,t,r){"function"==typeof t&&(r=t,t={});var a={algorithm:{name:(t=t||{}).algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};function o(){s(e.pBits,(function(t,n){return t?r(t):(e.p=n,null!==e.q?l(t,e.q):void s(e.qBits,l))}))}function s(e,t){n.prime.generateProbablePrime(e,a,t)}function l(t,n){if(t)return r(t);if(e.q=n,e.p.compareTo(e.q)<0){var a=e.p;e.p=e.q,e.q=a}if(0!==e.p.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.p=null,void o();if(0!==e.q.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.q=null,void s(e.qBits,l);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 o();if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits)return e.q=null,void s(e.qBits,l);var c=e.e.modInverse(e.phi);e.keys={privateKey:u.rsa.setPrivateKey(e.n,e.e,c,e.p,e.q,c.mod(e.p1),c.mod(e.q1),e.q.modInverse(e.p)),publicKey:u.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}"prng"in t&&(a.prng=t.prng),o()}function b(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 S(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 w(e){return n.util.isNodejs&&"function"==typeof a[e]}function E(e){return void 0!==s.globalScope&&"object"==typeof s.globalScope.crypto&&"object"==typeof s.globalScope.crypto.subtle&&"function"==typeof s.globalScope.crypto.subtle[e]}function A(e){return void 0!==s.globalScope&&"object"==typeof s.globalScope.msCrypto&&"object"==typeof s.globalScope.msCrypto.subtle&&"function"==typeof s.globalScope.msCrypto.subtle[e]}function T(e){for(var t=n.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),i=0;i0;)c.putByte(0),--f;return c.putBytes(n.util.hexToBytes(l)),c.getBytes()},u.rsa.decrypt=function(e,t,r,a){var o=Math.ceil(t.n.bitLength()/8);if(e.length!==o){var s=new Error("Encrypted message length is invalid.");throw s.length=e.length,s.expected=o,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 l=g(u,t,r).toString(16),c=n.util.createBuffer(),f=o-Math.ceil(l.length/2);f>0;)c.putByte(0),--f;return c.putBytes(n.util.hexToBytes(l)),!1!==a?m(c.getBytes(),t,r):c.getBytes()},u.rsa.createKeyPairGenerationState=function(e,t,r){"string"==typeof e&&(e=parseInt(e,10)),e=e||2048;var a,o=(r=r||{}).prng||n.random,s={nextBytes:function(e){for(var t=o.getBytesSync(e.length),r=0;r>1,pBits:e-(e>>1),pqState:0,num:null,keys:null}).e.fromInt(a.eInt),a},u.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new i(null);r.fromInt(30);for(var n,a=0,o=function(e,t){return e|t},s=+new Date,c=0;null===e.keys&&(t<=0||cf?e.pqState=0:e.num.isProbablePrime(S(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(l[a++%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)}}c+=(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(w("generateKeyPair"))return a.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(E("generateKey")&&E("exportKey"))return s.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:T(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(o.fromDer(n.util.createBuffer(e)));i(null,{privateKey:t,publicKey:u.setRsaPublicKey(t.n,t.e)})}}));if(A("generateKey")&&A("exportKey")){var l=s.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:T(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);return l.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(o.fromDer(n.util.createBuffer(t)));i(null,{privateKey:r,publicKey:u.setRsaPublicKey(r.n,r.e)})},r.onerror=function(e){i(e)}},void(l.onerror=function(e){i(e)})}}else if(w("generateKeyPairSync")){var c=a.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:u.privateKeyFromPem(c.privateKey),publicKey:u.publicKeyFromPem(c.publicKey)}}var f=u.rsa.createKeyPairGenerationState(e,t,r);if(!i)return u.rsa.stepKeyPairGenerationState(f,0),f.keys;v(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 a=t.encode(e,r,!0);return u.rsa.encrypt(a,r,!0)},verify:function(e,t,n){"string"==typeof n?n=n.toUpperCase():void 0===n&&(n="RSASSA-PKCS1-V1_5"),"RSASSA-PKCS1-V1_5"===n?n={verify:function(e,t){return t=m(t,r,!0),e===o.fromDer(t).value[1].value}}:"NONE"!==n&&"NULL"!==n&&null!==n||(n={verify:function(e,t){return e===m(t,r,!0)}});var i=u.rsa.decrypt(t,r,!0,!1);return n.verify(e,i,r.n.bitLength())}};return r},u.setRsaPrivateKey=u.rsa.setPrivateKey=function(e,t,r,i,a,o,s,l){var c={n:e,e:t,d:r,p:i,q:a,dP:o,dQ:s,qInv:l,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,c,!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,c,!1)},sign:function(e,t){var r=!1;"string"==typeof t&&(t=t.toUpperCase()),void 0===t||"RSASSA-PKCS1-V1_5"===t?(t={encode:p},r=1):"NONE"!==t&&"NULL"!==t&&null!==t||(t={encode:function(){return e}},r=1);var n=t.encode(e,c.n.bitLength());return u.rsa.encrypt(n,c,r)}};return c},u.wrapRsaPrivateKey=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(0).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(u.oids.rsaEncryption).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]),o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,o.toDer(e).getBytes())])},u.privateKeyFromAsn1=function(e){var t,r,a,s,l,h,d,p,g={},y=[];if(o.validate(e,c,g,y)&&(e=o.fromDer(n.util.createBuffer(g.privateKey))),g={},y=[],!o.validate(e,f,g,y)){var m=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw m.errors=y,m}return t=n.util.createBuffer(g.privateKeyModulus).toHex(),r=n.util.createBuffer(g.privateKeyPublicExponent).toHex(),a=n.util.createBuffer(g.privateKeyPrivateExponent).toHex(),s=n.util.createBuffer(g.privateKeyPrime1).toHex(),l=n.util.createBuffer(g.privateKeyPrime2).toHex(),h=n.util.createBuffer(g.privateKeyExponent1).toHex(),d=n.util.createBuffer(g.privateKeyExponent2).toHex(),p=n.util.createBuffer(g.privateKeyCoefficient).toHex(),u.setRsaPrivateKey(new i(t,16),new i(r,16),new i(a,16),new i(s,16),new i(l,16),new i(h,16),new i(d,16),new i(p,16))},u.privateKeyToAsn1=u.privateKeyToRSAPrivateKey=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(0).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.n)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.e)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.d)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.p)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.q)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.dP)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.dQ)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.qInv))])},u.publicKeyFromAsn1=function(e){var t={},r=[];if(o.validate(e,d,t,r)){var a,s=o.derToOid(t.publicKeyOid);if(s!==u.oids.rsaEncryption)throw(a=new Error("Cannot read public key. Unknown OID.")).oid=s,a;e=t.rsaPublicKey}if(r=[],!o.validate(e,h,t,r))throw(a=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,a;var l=n.util.createBuffer(t.publicKeyModulus).toHex(),c=n.util.createBuffer(t.publicKeyExponent).toHex();return u.setRsaPublicKey(new i(l,16),new i(c,16))},u.publicKeyToAsn1=u.publicKeyToSubjectPublicKeyInfo=function(e){return 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(u.oids.rsaEncryption).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]),o.create(o.Class.UNIVERSAL,o.Type.BITSTRING,!1,[u.publicKeyToRSAPublicKey(e)])])},u.publicKeyToRSAPublicKey=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.n)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,b(e.e))])}},function(e,t,r){"use strict";(function(t){!function(r){function n(e){const t=new Uint32Array([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]);let r=1779033703,n=3144134277,i=1013904242,a=2773480762,o=1359893119,s=2600822924,u=528734635,l=1541459225;const c=new Uint32Array(64);function f(e){let f=0,h=e.length;for(;h>=64;){let d,p,g,y,m,v=r,b=n,S=i,w=a,E=o,A=s,T=u,C=l;for(p=0;p<16;p++)g=f+4*p,c[p]=(255&e[g])<<24|(255&e[g+1])<<16|(255&e[g+2])<<8|255&e[g+3];for(p=16;p<64;p++)d=c[p-2],y=(d>>>17|d<<15)^(d>>>19|d<<13)^d>>>10,d=c[p-15],m=(d>>>7|d<<25)^(d>>>18|d<<14)^d>>>3,c[p]=(y+c[p-7]|0)+(m+c[p-16]|0)|0;for(p=0;p<64;p++)y=(((E>>>6|E<<26)^(E>>>11|E<<21)^(E>>>25|E<<7))+(E&A^~E&T)|0)+(C+(t[p]+c[p]|0)|0)|0,m=((v>>>2|v<<30)^(v>>>13|v<<19)^(v>>>22|v<<10))+(v&b^v&S^b&S)|0,C=T,T=A,A=E,E=w+y|0,w=S,S=b,b=v,v=y+m|0;r=r+v|0,n=n+b|0,i=i+S|0,a=a+w|0,o=o+E|0,s=s+A|0,u=u+T|0,l=l+C|0,f+=64,h-=64}}f(e);let h,d=e.length%64,p=e.length/536870912|0,g=e.length<<3,y=d<56?56:120,m=e.slice(e.length-d,e.length);for(m.push(128),h=d+1;h>>24&255),m.push(p>>>16&255),m.push(p>>>8&255),m.push(p>>>0&255),m.push(g>>>24&255),m.push(g>>>16&255),m.push(g>>>8&255),m.push(g>>>0&255),f(m),[r>>>24&255,r>>>16&255,r>>>8&255,r>>>0&255,n>>>24&255,n>>>16&255,n>>>8&255,n>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,a>>>24&255,a>>>16&255,a>>>8&255,a>>>0&255,o>>>24&255,o>>>16&255,o>>>8&255,o>>>0&255,s>>>24&255,s>>>16&255,s>>>8&255,s>>>0&255,u>>>24&255,u>>>16&255,u>>>8&255,u>>>0&255,l>>>24&255,l>>>16&255,l>>>8&255,l>>>0&255]}function i(e,t,r){e=e.length<=64?e:n(e);const i=64+t.length+4,a=new Array(i),o=new Array(64);let s,u=[];for(s=0;s<64;s++)a[s]=54;for(s=0;s=i-4;e--){if(a[e]++,a[e]<=255)return;a[e]=0}}for(;r>=32;)l(),u=u.concat(n(o.concat(n(a)))),r-=32;return r>0&&(l(),u=u.concat(n(o.concat(n(a))).slice(0,r))),u}function a(e,t,r,n,i){let a;for(l(e,16*(2*r-1),i,0,16),a=0;a<2*r;a++)u(e,16*a,i,16),s(i,n),l(i,0,e,t+16*a,16);for(a=0;a>>32-t}function s(e,t){l(e,0,t,0,16);for(let r=8;r>0;r-=2)t[4]^=o(t[0]+t[12],7),t[8]^=o(t[4]+t[0],9),t[12]^=o(t[8]+t[4],13),t[0]^=o(t[12]+t[8],18),t[9]^=o(t[5]+t[1],7),t[13]^=o(t[9]+t[5],9),t[1]^=o(t[13]+t[9],13),t[5]^=o(t[1]+t[13],18),t[14]^=o(t[10]+t[6],7),t[2]^=o(t[14]+t[10],9),t[6]^=o(t[2]+t[14],13),t[10]^=o(t[6]+t[2],18),t[3]^=o(t[15]+t[11],7),t[7]^=o(t[3]+t[15],9),t[11]^=o(t[7]+t[3],13),t[15]^=o(t[11]+t[7],18),t[1]^=o(t[0]+t[3],7),t[2]^=o(t[1]+t[0],9),t[3]^=o(t[2]+t[1],13),t[0]^=o(t[3]+t[2],18),t[6]^=o(t[5]+t[4],7),t[7]^=o(t[6]+t[5],9),t[4]^=o(t[7]+t[6],13),t[5]^=o(t[4]+t[7],18),t[11]^=o(t[10]+t[9],7),t[8]^=o(t[11]+t[10],9),t[9]^=o(t[8]+t[11],13),t[10]^=o(t[9]+t[8],18),t[12]^=o(t[15]+t[14],7),t[13]^=o(t[12]+t[15],9),t[14]^=o(t[13]+t[12],13),t[15]^=o(t[14]+t[13],18);for(let r=0;r<16;++r)e[r]+=t[r]}function u(e,t,r,n){for(let i=0;i=256)return!1}return!0}function f(e,t){if("number"!=typeof e||e%1)throw new Error("invalid "+t);return e}function h(e,r,n,o,s,h,d){if(n=f(n,"N"),o=f(o,"r"),s=f(s,"p"),h=f(h,"dkLen"),0===n||0!=(n&n-1))throw new Error("N must be power of 2");if(n>2147483647/128/o)throw new Error("N too large");if(o>2147483647/128/s)throw new Error("r too large");if(!c(e))throw new Error("password must be an array or buffer");if(e=Array.prototype.slice.call(e),!c(r))throw new Error("salt must be an array or buffer");r=Array.prototype.slice.call(r);let p=i(e,r,128*s*o);const g=new Uint32Array(32*s*o);for(let t=0;t_&&(t=_);for(let e=0;e_&&(t=_);for(let e=0;e>0&255),p.push(g[e]>>8&255),p.push(g[e]>>16&255),p.push(g[e]>>24&255);const r=i(e,p,h);return d&&d(null,1,r),r}d&&P(O)};if(!d)for(;;){const e=O();if(null!=e)return e}O()}const d={scrypt:function(e,t,r,n,i,a,o){return new Promise((function(s,u){let l=0;o&&o(0),h(e,t,r,n,i,a,(function(e,t,r){if(e)u(e);else if(r)o&&1!==l&&o(1),s(new Uint8Array(r));else if(o&&t!==l)return l=t,o(t)}))}))},syncScrypt:function(e,t,r,n,i,a){return new Uint8Array(h(e,t,r,n,i,a))}};e.exports=d}()}).call(this,r(52).setImmediate)},,function(e,t,r){var n=r(3);function i(e,t){n.cipher.registerAlgorithm(e,(function(){return new n.aes.Algorithm(e,t)}))}r(40),r(53),r(4),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){c||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>>=2,i=0;i>8^255&f^99,a[g]=f,o[f]=g,d=(h=e[f])<<24^f<<16^f<<8^f^h,p=((r=e[g])^(n=e[r])^(i=e[n]))<<24^(g^i)<<16^(g^n^i)<<8^g^r^i;for(var m=0;m<4;++m)u[m][g]=d,l[m][f]=p,d=d<<24|d>>>8,p=p<<24|p>>>8;0===g?g=y=1:(g=r^e[e[e[r^i]]],y^=e[e[y]])}}function h(e,t){for(var r,n=e.slice(0),i=1,o=n.length,u=4*(o+6+1),c=o;c>>16&255]<<24^a[r>>>8&255]<<16^a[255&r]<<8^a[r>>>24]^s[i]<<24,i++):o>6&&c%o==4&&(r=a[r>>>24]<<24^a[r>>>16&255]<<16^a[r>>>8&255]<<8^a[255&r]),n[c]=n[c-o]^r;if(t){for(var f,h=l[0],d=l[1],p=l[2],g=l[3],y=n.slice(0),m=(c=0,(u=n.length)-4);c>>24]]^d[a[f>>>16&255]]^p[a[f>>>8&255]]^g[a[255&f]];n=y}return n}function d(e,t,r,n){var i,s,c,f,h,d,p,g,y,m,v,b,S=e.length/4-1;n?(i=l[0],s=l[1],c=l[2],f=l[3],h=o):(i=u[0],s=u[1],c=u[2],f=u[3],h=a),d=t[0]^e[0],p=t[n?3:1]^e[1],g=t[2]^e[2],y=t[n?1:3]^e[3];for(var w=3,E=1;E>>24]^s[p>>>16&255]^c[g>>>8&255]^f[255&y]^e[++w],v=i[p>>>24]^s[g>>>16&255]^c[y>>>8&255]^f[255&d]^e[++w],b=i[g>>>24]^s[y>>>16&255]^c[d>>>8&255]^f[255&p]^e[++w],y=i[y>>>24]^s[d>>>16&255]^c[p>>>8&255]^f[255&g]^e[++w],d=m,p=v,g=b;r[0]=h[d>>>24]<<24^h[p>>>16&255]<<16^h[g>>>8&255]<<8^h[255&y]^e[++w],r[n?3:1]=h[p>>>24]<<24^h[g>>>16&255]<<16^h[y>>>8&255]<<8^h[255&d]^e[++w],r[2]=h[g>>>24]<<24^h[y>>>16&255]<<16^h[d>>>8&255]<<8^h[255&p]^e[++w],r[n?1:3]=h[y>>>24]<<24^h[d>>>16&255]<<16^h[p>>>8&255]<<8^h[255&g]^e[++w]}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 a=null;r instanceof n.util.ByteBuffer&&(a=r,r={}),(r=r||{}).output=a,r.iv=e,i.call(t,r)},t}},function(e,t,r){var n=r(3);r(4),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)))}},function(e,t){},function(e,t,r){var n=r(3);r(12),r(4),(e.exports=n.hmac=n.hmac||{}).create=function(){var e=null,t=null,r=null,i=null,a={start:function(a,o){if(null!==a)if("string"==typeof a){if(!((a=a.toLowerCase())in n.md.algorithms))throw new Error('Unknown hash algorithm "'+a+'"');t=n.md.algorithms[a].create()}else t=a;if(null===o)o=e;else{if("string"==typeof o)o=n.util.createBuffer(o);else if(n.util.isArray(o)){var s=o;o=n.util.createBuffer();for(var u=0;ut.blockLength&&(t.start(),t.update(o.bytes()),o=t.digest()),r=n.util.createBuffer(),i=n.util.createBuffer(),l=o.length(),u=0;u0)for(var n=t,i=3;i>=0;i--)r[3-i]=Math.floor(n/Math.pow(2,8*i)),n%=Math.pow(2,8*i);var a=u.concat(r,e),s=o._hashChain(a);return o.sha256(s)}(t.seed,t.nonce),n=c.default.generateKeyPair(r);return{privateKey:n.private,publicKey:n.public}},t.address=function(e,r){return void 0===r&&(r=i.MAIN_NET_CHAIN_ID),l.isPublicKey(e)?t.buildAddress(s._fromIn(e.publicKey),r):t.address(t.keyPair(e),r)},t.publicKey=function(e){return l.isPrivateKey(e)?c.default.generateKeyPair(s._fromIn(e.privateKey)).public:t.keyPair(e).publicKey},t.privateKey=function(e){return t.keyPair(e).privateKey}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPublicKey=function(e){return void 0!==e.publicKey},t.isPrivateKey=function(e){return void 0!==e.privateKey}},function(e,t,r){var n=r(3);r(4);var i=e.exports=n.pem=n.pem||{};function a(e){for(var t=e.name+": ",r=[],n=function(e,t){return" "+t},i=0;i65&&-1!==o){var s=t[o];","===s?(++o,t=t.substr(0,o)+"\r\n "+t.substr(o)):t=t.substr(0,o)+"\r\n"+s+t.substr(o+1),a=i-o-1,o=-1,++i}else" "!==t[i]&&"\t"!==t[i]&&","!==t[i]||(o=i);return t}function o(e){return e.replace(/^\s+/,"")}i.encode=function(e,t){t=t||{};var r,i="-----BEGIN "+e.type+"-----\r\n";if(e.procType&&(i+=a(r={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]})),e.contentDomain&&(i+=a(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+=a(r)),e.headers)for(var o=0;o0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]>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 u(e){for(var t=1,r=0;r126)return"Invalid prefix ("+e+")";t=s(t)^n>>5}for(t=s(t),r=0;rt)return"Exceeds length limit";var r=e.toLowerCase(),n=e.toUpperCase();if(e!==r&&e!==n)return"Mixed-case string "+e;var a=(e=r).lastIndexOf("1");if(-1===a)return"No separator character for "+e;if(0===a)return"Missing prefix for "+e;var o=e.slice(0,a),l=e.slice(a+1);if(l.length<6)return"Data too short";var c=u(o);if("string"==typeof c)return c;for(var f=[],h=0;h=l.length||f.push(p)}return 1!==c?"Invalid checksum for "+e:{prefix:o,words:f}}function c(e,t,r,n){for(var i=0,a=0,o=(1<=r;)a-=r,s.push(i>>a&o);if(n)a>0&&s.push(i<=t)return"Excess padding";if(i<r)throw new TypeError("Exceeds length limit");var i=u(e=e.toLowerCase());if("string"==typeof i)throw new Error(i);for(var a=e+"1",o=0;o>5!=0)throw new Error("Non 5-bit word");i=s(i)^l,a+=n.charAt(l)}for(o=0;o<6;++o)i=s(i);for(i^=1,o=0;o<6;++o)a+=n.charAt(i>>5*(5-o)&31);return a},toWordsUnsafe:function(e){var t=c(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=c(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=c(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=c(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}}},,function(e,t,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0)&&!(n=a.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o},a=this&&this.__spread||function(){for(var e=[],t=0;t=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(91),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(17))},function(e,t,r){var n=r(3);r(4),n.cipher=n.cipher||{};var i=e.exports=n.cipher.modes=n.cipher.modes||{};function a(e){if("string"==typeof e&&(e=n.util.createBuffer(e)),n.util.isArray(e)&&e.length>4){var t=e;e=n.util.createBuffer();for(var r=0;r0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)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=a(e.iv),this._prev=this._iv.slice(0)}},i.cbc.prototype.encrypt=function(e,t,r){if(e.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)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=a(e.iv),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;i0&&(a=this.blockSize-a),this._partialOutput.clear(),i=0;i0)e.read-=this.blockSize;else for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!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;i0&&(a=this.blockSize-a),this._partialOutput.clear(),i=0;i0)e.read-=this.blockSize;else for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!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=a(e.iv),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;i0&&(a=this.blockSize-a),this._partialOutput.clear(),i=0;i0)e.read-=this.blockSize;else for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!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=a(e.iv),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;i0&&(a=this.blockSize-a),this._partialOutput.clear(),i=0;i0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}o(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),o(this._inBlock),this._partialBytes=0,t=n.util.createBuffer(t),this._aDataLength=s(8*t.length());var a=t.length()%this.blockSize;for(a&&t.fillWithByte(0,this.blockSize-a),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;i0&&(a=this.blockSize-a),this._partialOutput.clear(),i=0;i0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),o(this._inBlock)},i.gcm.prototype.decrypt=function(e,t,r){var n=e.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),o(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;i0;--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,a=new Array(i),o=0;o>>1,i=new Array(r);i[n]=e.slice(0);for(var a=n>>>1;a>0;)this.pow(i[2*a],i[a]=[]),a>>=1;for(a=2;a>>0,s>>>0];for(var l=i.fullMessageLength.length-1;l>=0;--l)i.fullMessageLength[l]+=s[1],s[1]=s[0]+(i.fullMessageLength[l]/4294967296>>>0),i.fullMessageLength[l]=i.fullMessageLength[l]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(a),u(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var o=n.util.createBuffer();o.putBytes(t.bytes());var s,l=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;o.putBytes(a.substr(0,i.blockLength-l));for(var c=8*i.fullMessageLength[0],f=0;f>>0,o.putInt32(c>>>0),c=s>>>0;o.putInt32(c);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,o);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 a=null,o=!1,s=null;function u(e,t,r){for(var n,i,a,o,u,l,c,f,h,d,p,g,y,m=r.length();m>=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(l=e.h0,c=e.h1,f=e.h2,h=e.h3,d=e.h4,p=e.h5,g=e.h6,y=e.h7,u=0;u<64;++u)a=(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),o=l&c|f&(l^c),n=y+((d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(g^d&(p^g))+s[u]+t[u],y=g,g=p,p=d,d=h+n>>>0,h=f,f=c,c=l,l=n+(i=a+o)>>>0;e.h0=e.h0+l|0,e.h1=e.h1+c|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+g|0,e.h7=e.h7+y|0,m-=64}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.seedWordsList=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"]},function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(r(40)),s=i(r(4)),u=r(33),l=r(14),c=r(19),f=r(26),h=a(r(35)),d=r(13);t.aesEncrypt=function(e,t,r,n){void 0===r&&(r="CBC");var i=o.createCipher("AES-"+r,d.bytesToString(l._fromIn(t),"raw"));return i.start({iv:n&&s.createBuffer(d.bytesToString(l._fromIn(n),"raw"))}),i.update(s.createBuffer(d.bytesToString(e,"raw"))),i.finish(),d.stringToBytes(i.output.getBytes(),"raw")},t.aesDecrypt=function(e,t,r,n){void 0===r&&(r="CBC");var i=o.createDecipher("AES-"+r,d.bytesToString(l._fromIn(t),"raw"));i.start({iv:n&&s.createBuffer(d.bytesToString(l._fromIn(n),"raw"))});var a=s.createBuffer(d.bytesToString(l._fromIn(e),"raw"));if(i.update(a),!i.finish())throw new Error("Failed to decrypt data with provided key");return d.stringToBytes(i.output.getBytes(),"raw")},t.messageEncrypt=function(e,r){var n=Uint8Array.from([1]),i=u.randomBytes(32),a=u.randomBytes(16),o=d.stringToBytes(r),s=t.aesEncrypt(o,i,"CTR",a),l=t.aesEncrypt(i,e,"ECB"),h=c.hmacSHA256(o,i),p=c.hmacSHA256(f.concat(i,a),e);return f.concat(n,l,p,h,a,s)},t.messageDecrypt=function(e,r){var i=n(f.split(r,1,48,32,32,16),6),a=(i[0],i[1]),o=i[2],s=i[3],u=i[4],h=i[5],p=t.aesDecrypt(a,e,"ECB");if(!l._fromIn(c.hmacSHA256(f.concat(p,u),l._fromIn(e))).every((function(e,t){return e===o[t]})))throw new Error("Invalid key");var g=t.aesDecrypt(h,p,"CTR",u);if(!l._fromIn(c.hmacSHA256(g,p)).every((function(e,t){return e===s[t]})))throw new Error("Invalid message");return d.bytesToString(g)},t.sharedKey=function(e,t,r){var n=h.default.sharedKey(l._fromIn(e),l._fromIn(t)),i=c.sha256(l._fromRawIn(r));return c.hmacSHA256(n,i)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(14),i=r(13);t.Seed={isSeedWithNonce:function(e){return void 0!==e.nonce},toBinary:function(e){return t.Seed.isSeedWithNonce(e)?{seed:t.Seed.toBinary(e.seed).seed,nonce:e.nonce}:{seed:n._fromRawIn(e),nonce:void 0}},toString:function(e){return i.bytesToString(t.Seed.toBinary(e).seed)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(27),i=r(27);t.ChaidId={toNumber:function(e){return"string"==typeof e?e.charCodeAt(0):e},isMainnet:function(e){return t.ChaidId.toNumber(e)===n.MAIN_NET_CHAIN_ID},isTestnet:function(e){return t.ChaidId.toNumber(e)===i.TEST_NET_CHAIN_ID}}},function(e,t,r){var n=r(3);if(r(39),r(20),r(60),r(12),r(21),r(61),r(45),r(18),r(102),r(36),r(4),void 0===i)var i=n.jsbn.BigInteger;var a=n.asn1,o=n.pki=n.pki||{};e.exports=o.pbe=n.pbe=n.pbe||{};var s=o.oids,u={name:"EncryptedPrivateKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",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:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},l={name:"PBES2Algorithms",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},c={name:"pkcs-12PbeParams",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:a.Class.UNIVERSAL,type:a.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=o.oids[a.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()}o.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,l,c=n.random.getBytesSync(r.saltSize),f=r.count,h=a.integerToDer(f);if(0===r.algorithm.indexOf("aes")||"des"===r.algorithm){var p,g,y;switch(r.algorithm){case"aes128":i=16,p=16,g=s["aes128-CBC"],y=n.aes.createEncryptionCipher;break;case"aes192":i=24,p=16,g=s["aes192-CBC"],y=n.aes.createEncryptionCipher;break;case"aes256":i=32,p=16,g=s["aes256-CBC"],y=n.aes.createEncryptionCipher;break;case"des":i=8,p=8,g=s.desCBC,y=n.des.createEncryptionCipher;break;default:throw(E=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,E}var m="hmacWith"+r.prfAlgorithm.toUpperCase(),v=d(m),b=n.pkcs5.pbkdf2(t,c,f,i,v),S=n.random.getBytesSync(p);(A=y(b)).start(S),A.update(a.toDer(e)),A.finish(),l=A.output.getBytes();var w=function(e,t,r,i){var s=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,e),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,t.getBytes())]);return"hmacWithSHA1"!==i&&s.value.push(a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,n.util.hexToBytes(r.toString(16))),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(o.oids[i]).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")])),s}(c,h,i,m);u=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(s.pkcs5PBES2).getBytes()),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(s.pkcs5PBKDF2).getBytes()),w]),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(g).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,S)])])])}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 A,T=new n.util.ByteBuffer(c);b=o.pbe.generatePkcs12Key(t,T,1,f,i),S=o.pbe.generatePkcs12Key(t,T,2,f,i),(A=n.des.createEncryptionCipher(b)).start(S),A.update(a.toDer(e)),A.finish(),l=A.output.getBytes(),u=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(s["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,c),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,h.getBytes())])])}return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[u,a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,l)])},o.decryptPrivateKeyInfo=function(e,t){var r=null,i={},s=[];if(!a.validate(e,u,i,s)){var l=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw l.errors=s,l}var c=a.derToOid(i.encryptionOid),f=o.pbe.getCipher(c,i.encryptionParams,t),h=n.util.createBuffer(i.encryptedData);return f.update(h),f.finish()&&(r=a.fromDer(f.output)),r},o.encryptedPrivateKeyToPem=function(e,t){var r={type:"ENCRYPTED PRIVATE KEY",body:a.toDer(e).getBytes()};return n.pem.encode(r,{maxline:t})},o.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 a.fromDer(t.body)},o.encryptRsaPrivateKey=function(e,t,r){if(!(r=r||{}).legacy){var i=o.wrapRsaPrivateKey(o.privateKeyToAsn1(e));return i=o.encryptPrivateKeyInfo(i,t,r),o.encryptedPrivateKeyToPem(i)}var s,u,l,c;switch(r.algorithm){case"aes128":s="AES-128-CBC",l=16,u=n.random.getBytesSync(16),c=n.aes.createEncryptionCipher;break;case"aes192":s="AES-192-CBC",l=24,u=n.random.getBytesSync(16),c=n.aes.createEncryptionCipher;break;case"aes256":s="AES-256-CBC",l=32,u=n.random.getBytesSync(16),c=n.aes.createEncryptionCipher;break;case"3des":s="DES-EDE3-CBC",l=24,u=n.random.getBytesSync(8),c=n.des.createEncryptionCipher;break;case"des":s="DES-CBC",l=8,u=n.random.getBytesSync(8),c=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=c(n.pbe.opensslDeriveBytes(t,u.substr(0,8),l));h.start(u),h.update(a.toDer(o.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)},o.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(l=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".')).headerType=l,l;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 l;throw(l=new Error('Could not decrypt private key; unsupported encryption algorithm "'+i.dekInfo.algorithm+'".')).algorithm=i.dekInfo.algorithm,l}var c=n.util.hexToBytes(i.dekInfo.parameters),f=u(n.pbe.opensslDeriveBytes(t,c.substr(0,8),s));if(f.start(c),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?o.decryptPrivateKeyInfo(a.fromDer(r),t):a.fromDer(r))&&(r=o.privateKeyFromAsn1(r)),r},o.pbe.generatePkcs12Key=function(e,t,r,i,a,o){var s,u;if(null==o){if(!("sha1"in n.md))throw new Error('"sha1" hash algorithm unavailable.');o=n.md.sha1.create()}var l=o.digestLength,c=o.blockLength,f=new n.util.ByteBuffer,h=new n.util.ByteBuffer;if(null!=e){for(u=0;u=0;u--)_>>=8,_+=C.at(u)+B.at(u),B.setAt(u,255&_);k.putBuffer(B)}S=k,f.putBuffer(A)}return f.truncate(f.length()-a),f},o.pbe.getCipher=function(e,t,r){switch(e){case o.oids.pkcs5PBES2:return o.pbe.getCipherForPBES2(e,t,r);case o.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case o.oids["pbewithSHAAnd40BitRC2-CBC"]:return o.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}},o.pbe.getCipherForPBES2=function(e,t,r){var i,s={},u=[];if(!a.validate(t,l,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=a.derToOid(s.kdfOid))!==o.oids.pkcs5PBKDF2)throw(i=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=e,i.supportedOids=["pkcs5PBKDF2"],i;if((e=a.derToOid(s.encOid))!==o.oids["aes128-CBC"]&&e!==o.oids["aes192-CBC"]&&e!==o.oids["aes256-CBC"]&&e!==o.oids["des-EDE3-CBC"]&&e!==o.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 c,f,d=s.kdfSalt,p=n.util.createBuffer(s.kdfIterationCount);switch(p=p.getInt(p.length()<<3),o.oids[e]){case"aes128-CBC":c=16,f=n.aes.createDecryptionCipher;break;case"aes192-CBC":c=24,f=n.aes.createDecryptionCipher;break;case"aes256-CBC":c=32,f=n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":c=24,f=n.des.createDecryptionCipher;break;case"desCBC":c=8,f=n.des.createDecryptionCipher}var g=h(s.prfOid),y=n.pkcs5.pbkdf2(r,d,p,c,g),m=s.encIv,v=f(y);return v.start(m),v},o.pbe.getCipherForPKCS12PBE=function(e,t,r){var i={},s=[];if(!a.validate(t,c,i,s))throw(g=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=s,g;var u,l,f,d=n.util.createBuffer(i.salt),p=n.util.createBuffer(i.iterations);switch(p=p.getInt(p.length()<<3),e){case o.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,l=8,f=n.des.startDecrypting;break;case o.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,l=8,f=function(e,t){var r=n.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var g;throw(g=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=e,g}var y=h(i.prfOid),m=o.pbe.generatePkcs12Key(r,d,1,p,u,y);return y.start(),f(m,o.pbe.generatePkcs12Key(r,d,2,p,l,y))},o.pbe.opensslDeriveBytes=function(e,t,r,i){if(null==i){if(!("md5"in n.md))throw new Error('"md5" hash algorithm unavailable.');i=n.md.md5.create()}null===t&&(t="");for(var a=[f(i,e+t)],o=16,s=1;o8?3:1,m=[],v=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],b=0,S=0;S>>4^E))<<4,w^=t=65535&((E^=t)>>>-16^w),w^=(t=858993459&(w>>>2^(E^=t<<-16)))<<2,w^=t=65535&((E^=t)>>>-16^w),w^=(t=1431655765&(w>>>1^(E^=t<<-16)))<<1,w^=t=16711935&((E^=t)>>>8^w),t=(w^=(t=1431655765&(w>>>1^(E^=t<<8)))<<1)<<8|(E^=t)>>>20&240,w=E<<24|E<<8&16711680|E>>>8&65280|E>>>24&240,E=t;for(var A=0;A>>26,E=E<<2|E>>>26):(w=w<<1|w>>>27,E=E<<1|E>>>27);var T=r[(w&=-15)>>>28]|n[w>>>24&15]|i[w>>>20&15]|a[w>>>16&15]|o[w>>>12&15]|s[w>>>8&15]|u[w>>>4&15],C=l[(E&=-15)>>>28]|c[E>>>24&15]|f[E>>>20&15]|h[E>>>16&15]|d[E>>>12&15]|p[E>>>8&15]|g[E>>>4&15];t=65535&(C>>>16^T),m[b++]=T^t,m[b++]=C^t<<16}}return m}(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 a=[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],o=[-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],l=[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],c=[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 g=t[0],y=t[1];g^=(d=252645135&(g>>>4^y))<<4,g^=(d=65535&(g>>>16^(y^=d)))<<16,g^=d=858993459&((y^=d)>>>2^g),g^=d=16711935&((y^=d<<2)>>>8^g),g=(g^=(d=1431655765&(g>>>1^(y^=d<<8)))<<1)<<1|g>>>31,y=(y^=d)<<1|y>>>31;for(var m=0;m>>4|y<<28)^e[S+1];d=g,g=y,y=d^(o[w>>>24&63]|u[w>>>16&63]|c[w>>>8&63]|h[63&w]|a[E>>>24&63]|s[E>>>16&63]|l[E>>>8&63]|f[63&E])}d=g,g=y,y=d}y=y>>>1|y<<31,y^=d=1431655765&((g=g>>>1|g<<31)>>>1^y),y^=(d=16711935&(y>>>8^(g^=d<<1)))<<8,y^=(d=858993459&(y>>>2^(g^=d)))<<2,y^=d=65535&((g^=d)>>>16^y),y^=d=252645135&((g^=d<<16)>>>4^y),g^=d<<4,r[0]=g,r[1]=y}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 a=null;r instanceof n.util.ByteBuffer&&(a=r,r={}),(r=r||{}).output=a,r.iv=e,i.call(t,r)},t}},function(e,t,r){(function(t){var n=r(3);r(42),r(12),r(4);var i,a=n.pkcs5=n.pkcs5||{};n.util.isNodejs&&!n.options.usePureJavaScript&&(i=r(41)),e.exports=n.pbkdf2=a.pbkdf2=function(e,r,a,o,s,u){if("function"==typeof s&&(u=s,s=null),n.util.isNodejs&&!n.options.usePureJavaScript&&i.pbkdf2&&(null===s||"object"!=typeof s)&&(i.pbkdf2Sync.length>4||!s||"sha1"===s))return"string"!=typeof s&&(s="sha1"),e=t.from(e,"binary"),r=t.from(r,"binary"),u?4===i.pbkdf2Sync.length?i.pbkdf2(e,r,a,o,(function(e,t){if(e)return u(e);u(null,t.toString("binary"))})):i.pbkdf2(e,r,a,o,s,(function(e,t){if(e)return u(e);u(null,t.toString("binary"))})):4===i.pbkdf2Sync.length?i.pbkdf2Sync(e,r,a,o).toString("binary"):i.pbkdf2Sync(e,r,a,o,s).toString("binary");if(null==s&&(s="sha1"),"string"==typeof s){if(!(s in n.md.algorithms))throw new Error("Unknown hash algorithm: "+s);s=n.md[s].create()}var l=s.digestLength;if(o>4294967295*l){var c=new Error("Derived key is too long.");if(u)return u(c);throw c}var f=Math.ceil(o/l),h=o-(f-1)*l,d=n.hmac.create();d.start(s,e);var p,g,y,m="";if(!u){for(var v=1;v<=f;++v){d.start(null,null),d.update(r),d.update(n.util.int32ToBytes(v)),p=y=d.digest().getBytes();for(var b=2;b<=a;++b)d.start(null,null),d.update(y),g=d.digest().getBytes(),p=n.util.xorBytes(p,g,l),y=g;m+=vf)return u(null,m);d.start(null,null),d.update(r),d.update(n.util.int32ToBytes(v)),p=y=d.digest().getBytes(),b=2,w()}function w(){if(b<=a)return d.start(null,null),d.update(y),g=d.digest().getBytes(),p=n.util.xorBytes(p,g,l),y=g,++b,n.util.setImmediate(w);m+=v>14;--a>=0;){var u=16383&this.data[e],l=this.data[e++]>>14,c=s*u+l*o;i=((u=o*u+((16383&c)<<14)+r.data[n]+i)>>28)+(c>>14)+s*l,r.data[n++]=268435455&u}return i}e.exports=i.jsbn=i.jsbn||{},i.jsbn.BigInteger=a,"undefined"==typeof navigator?(a.prototype.am=s,n=28):"Microsoft Internet Explorer"==navigator.appName?(a.prototype.am=function(e,t,r,n,i,a){for(var o=32767&t,s=t>>15;--a>=0;){var u=32767&this.data[e],l=this.data[e++]>>15,c=s*u+l*o;i=((u=o*u+((32767&c)<<15)+r.data[n]+(1073741823&i))>>>30)+(c>>>15)+s*l+(i>>>30),r.data[n++]=1073741823&u}return i},n=30):"Netscape"!=navigator.appName?(a.prototype.am=function(e,t,r,n,i,a){for(;--a>=0;){var o=t*this.data[e++]+r.data[n]+i;i=Math.floor(o/67108864),r.data[n++]=67108863&o}return i},n=26):(a.prototype.am=s,n=28),a.prototype.DB=n,a.prototype.DM=(1<>>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 g(e){this.m=e}function y(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=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 A(){}function T(e){return e}function C(e){this.r2=o(),this.q3=o(),a.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}g.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},g.prototype.revert=function(e){return e},g.prototype.reduce=function(e){e.divRemTo(this.m,null,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)},y.prototype.convert=function(e){var t=o();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(a.ZERO)>0&&this.m.subTo(t,t),t},y.prototype.revert=function(e){var t=o();return e.copyTo(t),this.reduce(t),t},y.prototype.reduce=function(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;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)},y.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},y.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},a.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},a.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},a.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,o=0;--n>=0;){var s=8==r?255&e[n]:h(e,n);s<0?"-"==e.charAt(n)&&(i=!0):(i=!1,0==o?this.data[this.t++]=s:o+r>this.DB?(this.data[this.t-1]|=(s&(1<>this.DB-o):this.data[this.t-1]|=s<=this.DB&&(o-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,o>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==e;)--this.t},a.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},a.prototype.drShiftTo=function(e,t){for(var r=e;r=0;--r)t.data[r+o+1]=this.data[r]>>i|s,s=(this.data[r]&a)<=0;--r)t.data[r]=0;t.data[o]=s,t.t=this.t+o+1,t.s=this.s,t.clamp()},a.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,a=(1<>n;for(var o=r+1;o>n;n>0&&(t.data[this.t-r-1]|=(this.s&a)<>=this.DB;if(e.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=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()},a.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=0;)e.data[r]=0;for(r=0;r=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()},a.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t0?(n.lShiftTo(c,s),i.lShiftTo(c,r)):(n.copyTo(s),i.copyTo(r));var f=s.t,h=s.data[f-1];if(0!=h){var d=h*(1<1?s.data[f-2]>>this.F2:0),g=this.FV/d,y=(1<=0&&(r.data[r.t++]=1,r.subTo(S,r)),a.ONE.dlShiftTo(f,S),S.subTo(s,s);s.t=0;){var w=r.data[--v]==h?this.DM:Math.floor(r.data[v]*g+(r.data[v-1]+m)*y);if((r.data[v]+=s.am(0,w,r,b,0,f))0&&r.rShiftTo(c,r),u<0&&a.ZERO.subTo(r,r)}}},a.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},a.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},a.prototype.exp=function(e,t){if(e>4294967295||e<1)return a.ONE;var r=o(),n=o(),i=t.convert(this),s=p(e)-1;for(i.copyTo(r);--s>=0;)if(t.sqrTo(r,n),(e&1<0)t.mulTo(n,i,r);else{var u=r;r=n,n=u}return t.revert(r)},a.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<0)for(s>s)>0&&(i=!0,a=f(r));o>=0;)s>(s+=this.DB-t)):(r=this.data[o]>>(s-=t)&n,s<=0&&(s+=this.DB,--o)),r>0&&(i=!0),i&&(a+=f(r));return i?a:"0"},a.prototype.negate=function(){var e=o();return a.ZERO.subTo(this,e),e},a.prototype.abs=function(){return this.s<0?this.negate():this},a.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},a.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+p(this.data[this.t-1]^this.s&this.DM)},a.prototype.mod=function(e){var t=o();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(a.ZERO)>0&&e.subTo(t,t),t},a.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new g(t):new y(t),this.exp(e,r)},a.ZERO=d(0),a.ONE=d(1),A.prototype.convert=T,A.prototype.revert=T,A.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},A.prototype.sqrTo=function(e,t){e.squareTo(t)},C.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=o();return e.copyTo(t),this.reduce(t),t},C.prototype.revert=function(e){return e},C.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)},C.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},C.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var I=[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],k=(1<<26)/I[I.length-1];a.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},a.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=o(),a=o(),s="";for(this.divRemTo(n,i,a);i.signum()>0;)s=(r+a.intValue()).toString(e).substr(1)+s,i.divRemTo(n,i,a);return a.intValue().toString(e)+s},a.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,o=0,s=0,u=0;u=r&&(this.dMultiply(n),this.dAddOffset(s,0),o=0,s=0))}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(s,0)),i&&a.ZERO.subTo(this,this)},a.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(a.ONE.shiftLeft(e-1),v,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(a.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<>=this.DB;if(e.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=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()},a.prototype.dMultiply=function(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},a.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]}},a.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=0;)r.data[n]=0;for(n=Math.max(t-this.t,0);n0)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},a.prototype.millerRabin=function(e){var t=this.subtract(a.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var n,i=t.shiftRight(r),o={nextBytes:function(e){for(var t=0;t=0);var u=n.modPow(i,this);if(0!=u.compareTo(a.ONE)&&0!=u.compareTo(t)){for(var l=1;l++>24},a.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},a.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},a.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>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<=0;)n<8?(r=(this.data[e]&(1<>(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},a.prototype.equals=function(e){return 0==this.compareTo(e)},a.prototype.min=function(e){return this.compareTo(e)<0?this:e},a.prototype.max=function(e){return this.compareTo(e)>0?this:e},a.prototype.and=function(e){var t=o();return this.bitwiseTo(e,m,t),t},a.prototype.or=function(e){var t=o();return this.bitwiseTo(e,v,t),t},a.prototype.xor=function(e){var t=o();return this.bitwiseTo(e,b,t),t},a.prototype.andNot=function(e){var t=o();return this.bitwiseTo(e,S,t),t},a.prototype.not=function(){for(var e=o(),t=0;t=this.t?0!=this.s:0!=(this.data[t]&1<1){var f=o();for(n.sqrTo(s[1],f);u<=c;)s[u]=o(),n.mulTo(f,s[u-2],s[u]),u+=2}var h,m,v=e.t-1,b=!0,S=o();for(i=p(e.data[v])-1;v>=0;){for(i>=l?h=e.data[v]>>i-l&c:(h=(e.data[v]&(1<0&&(h|=e.data[v-1]>>this.DB+i-l)),u=r;0==(1&h);)h>>=1,--u;if((i-=u)<0&&(i+=this.DB,--v),b)s[h].copyTo(a),b=!1;else{for(;u>1;)n.sqrTo(a,S),n.sqrTo(S,a),u-=2;u>0?n.sqrTo(a,S):(m=a,a=S,S=m),n.mulTo(S,s[h],a)}for(;v>=0&&0==(e.data[v]&1<=0?(r.subTo(n,r),t&&i.subTo(s,i),o.subTo(u,o)):(n.subTo(r,n),t&&s.subTo(i,s),u.subTo(o,u))}return 0!=n.compareTo(a.ONE)?a.ZERO:u.compareTo(e)>=0?u.subtract(e):u.signum()<0?(u.addTo(e,u),u.signum()<0?u.add(e):u):u},a.prototype.pow=function(e){return this.exp(e,new A)},a.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(),a=r.getLowestSetBit();if(a<0)return t;for(i0&&(t.rShiftTo(a,t),r.rShiftTo(a,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 a>0&&r.lShiftTo(a,r),r},a.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=I[I.length-1]){for(t=0;t>>0,u>>>0];for(var l=i.fullMessageLength.length-1;l>=0;--l)i.fullMessageLength[l]+=u[1],u[1]=u[0]+(i.fullMessageLength[l]/4294967296>>>0),i.fullMessageLength[l]=i.fullMessageLength[l]>>>0,u[0]=u[1]/4294967296>>>0;return t.putBytes(a),s(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var o=n.util.createBuffer();o.putBytes(t.bytes());var u,l=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;o.putBytes(a.substr(0,i.blockLength-l));for(var c=8*i.fullMessageLength[0],f=0;f>>0,o.putInt32(c>>>0),c=u>>>0;o.putInt32(c);var h={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};s(h,r,o);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 a=null,o=!1;function s(e,t,r){for(var n,i,a,o,s,u,l,c=r.length();c>=64;){for(i=e.h0,a=e.h1,o=e.h2,s=e.h3,u=e.h4,l=0;l<16;++l)n=r.getInt32(),t[l]=n,n=(i<<5|i>>>27)+(s^a&(o^s))+u+1518500249+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;l<20;++l)n=(n=t[l-3]^t[l-8]^t[l-14]^t[l-16])<<1|n>>>31,t[l]=n,n=(i<<5|i>>>27)+(s^a&(o^s))+u+1518500249+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;l<32;++l)n=(n=t[l-3]^t[l-8]^t[l-14]^t[l-16])<<1|n>>>31,t[l]=n,n=(i<<5|i>>>27)+(a^o^s)+u+1859775393+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;l<40;++l)n=(n=t[l-6]^t[l-16]^t[l-28]^t[l-32])<<2|n>>>30,t[l]=n,n=(i<<5|i>>>27)+(a^o^s)+u+1859775393+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;l<60;++l)n=(n=t[l-6]^t[l-16]^t[l-28]^t[l-32])<<2|n>>>30,t[l]=n,n=(i<<5|i>>>27)+(a&o|s&(a^o))+u+2400959708+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;l<80;++l)n=(n=t[l-6]^t[l-16]^t[l-28]^t[l-32])<<2|n>>>30,t[l]=n,n=(i<<5|i>>>27)+(a^o^s)+u+3395469782+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;e.h0=e.h0+i|0,e.h1=e.h1+a|0,e.h2=e.h2+o|0,e.h3=e.h3+s|0,e.h4=e.h4+u|0,c-=64}}},function(e,t,r){var n=r(3);r(39),r(20),r(60),r(12),r(107),r(21),r(45),r(65),r(36),r(4);var i=n.asn1,a=e.exports=n.pki=n.pki||{},o=a.oids,s={};s.CN=o.commonName,s.commonName="CN",s.C=o.countryName,s.countryName="C",s.L=o.localityName,s.localityName="L",s.ST=o.stateOrProvinceName,s.stateOrProvinceName="ST",s.O=o.organizationName,s.organizationName="O",s.OU=o.organizationalUnitName,s.organizationalUnitName="OU",s.E=o.emailAddress,s.emailAddress="E";var u=n.pki.rsa.publicKeyValidator,l={name:"Certificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},u,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},c={name:"rsapss",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},f={name:"CertificationRequestInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},u,{name:"CertificationRequestInfo.attributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0}]}]}]},h={name:"CertificationRequest",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[f,{name:"CertificationRequest.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};function d(e,t){"string"==typeof t&&(t={shortName:t});for(var r,n=null,i=0;null===n&&i128)throw new Error('Invalid "nsComment" content.');e.value=i.create(i.Class.UNIVERSAL,i.Type.IA5STRING,!1,e.comment)}else if("subjectKeyIdentifier"===e.name&&t.cert){var d=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=d.toHex(),e.value=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,d.getBytes())}else if("authorityKeyIdentifier"===e.name&&t.cert){if(e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),c=e.value.value,e.keyIdentifier){var p=!0===e.keyIdentifier?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;c.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!1,p))}if(e.authorityCertIssuer){var y=[i.create(i.Class.CONTEXT_SPECIFIC,4,!0,[g(!0===e.authorityCertIssuer?t.cert.issuer:e.authorityCertIssuer)])];c.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,y))}if(e.serialNumber){var m=n.util.hexToBytes(!0===e.serialNumber?t.cert.serialNumber:e.serialNumber);c.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!1,m))}}else if("cRLDistributionPoints"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),c=e.value.value;var v,b=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),S=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);for(h=0;h2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(f.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(u.validity.notBefore=f[0],u.validity.notAfter=f[1],u.tbsCertificate=r.tbsCertificate,t){var h;if(u.md=null,u.signatureOid in o)switch(o[u.signatureOid]){case"sha1WithRSAEncryption":u.md=n.md.sha1.create();break;case"md5WithRSAEncryption":u.md=n.md.md5.create();break;case"sha256WithRSAEncryption":case"RSASSA-PSS":u.md=n.md.sha256.create();break;case"sha384WithRSAEncryption":u.md=n.md.sha384.create();break;case"sha512WithRSAEncryption":u.md=n.md.sha512.create()}if(null===u.md)throw(h=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=u.signatureOid,h;var g=i.toDer(u.tbsCertificate);u.md.update(g.getBytes())}var m=n.md.sha1.create();u.issuer.getField=function(e){return d(u.issuer,e)},u.issuer.addField=function(e){y([e]),u.issuer.attributes.push(e)},u.issuer.attributes=a.RDNAttributesAsArray(r.certIssuer,m),r.certIssuerUniqueId&&(u.issuer.uniqueId=r.certIssuerUniqueId),u.issuer.hash=m.digest().toHex();var v=n.md.sha1.create();return u.subject.getField=function(e){return d(u.subject,e)},u.subject.addField=function(e){y([e]),u.subject.attributes.push(e)},u.subject.attributes=a.RDNAttributesAsArray(r.certSubject,v),r.certSubjectUniqueId&&(u.subject.uniqueId=r.certSubjectUniqueId),u.subject.hash=v.digest().toHex(),r.certExtensions?u.extensions=a.certificateExtensionsFromAsn1(r.certExtensions):u.extensions=[],u.publicKey=a.publicKeyFromAsn1(r.subjectPublicKeyInfo),u},a.certificateExtensionsFromAsn1=function(e){for(var t=[],r=0;r1&&(r=u.value.charCodeAt(1),a=u.value.length>2?u.value.charCodeAt(2):0),t.digitalSignature=128==(128&r),t.nonRepudiation=64==(64&r),t.keyEncipherment=32==(32&r),t.dataEncipherment=16==(16&r),t.keyAgreement=8==(8&r),t.keyCertSign=4==(4&r),t.cRLSign=2==(2&r),t.encipherOnly=1==(1&r),t.decipherOnly=128==(128&a)}else if("basicConstraints"===t.name){(u=i.fromDer(t.value)).value.length>0&&u.value[0].type===i.Type.BOOLEAN?t.cA=0!==u.value[0].value.charCodeAt(0):t.cA=!1;var s=null;u.value.length>0&&u.value[0].type===i.Type.INTEGER?s=u.value[0].value:u.value.length>1&&(s=u.value[1].value),null!==s&&(t.pathLenConstraint=i.derToInteger(s))}else if("extKeyUsage"===t.name)for(var u=i.fromDer(t.value),l=0;l1&&(r=u.value.charCodeAt(1)),t.client=128==(128&r),t.server=64==(64&r),t.email=32==(32&r),t.objsign=16==(16&r),t.reserved=8==(8&r),t.sslCA=4==(4&r),t.emailCA=2==(2&r),t.objCA=1==(1&r);else if("subjectAltName"===t.name||"issuerAltName"===t.name){var f;t.altNames=[],u=i.fromDer(t.value);for(var h=0;h=S&&e0&&o.value.push(a.certificateExtensionsToAsn1(e.extensions)),o},a.getCertificationRequestInfo=function(e){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),g(e.subject),a.publicKeyToAsn1(e.publicKey),b(e)])},a.distinguishedNameToAsn1=function(e){return g(e)},a.certificateToAsn1=function(e){var t=e.tbsCertificate||a.getTBSCertificate(e);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureOid).getBytes()),v(e.signatureOid,e.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},a.certificateExtensionsToAsn1=function(e){var t=i.create(i.Class.CONTEXT_SPECIFIC,3,!0,[]),r=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);t.value.push(r);for(var n=0;nc.validity.notAfter)&&(u={message:"Certificate is not valid yet or has expired.",error:a.certificateError.certificate_expired,notBefore:c.validity.notBefore,notAfter:c.validity.notAfter,now:o}),null===u){if(null===(f=t[0]||e.getIssuer(c))&&c.isIssuer(c)&&(h=!0,f=c),f){var d=f;n.util.isArray(d)||(d=[d]);for(var p=!1;!p&&d.length>0;){f=d.shift();try{p=f.verify(c)}catch(e){}}p||(u={message:"Certificate signature is invalid.",error:a.certificateError.bad_certificate})}null!==u||f&&!h||e.hasCertificate(c)||(u={message:"Certificate is not trusted.",error:a.certificateError.unknown_ca})}if(null===u&&f&&!c.isIssuer(f)&&(u={message:"Certificate issuer is invalid.",error:a.certificateError.bad_certificate}),null===u)for(var g={keyUsage:!0,basicConstraints:!0},y=0;null===u&&yv.pathLenConstraint&&(u={message:"Certificate basicConstraints pathLenConstraint violated.",error:a.certificateError.bad_certificate})}var S=null===u||u.error,w=r.verify?r.verify(S,l,i):S;if(!0!==w)throw!0===S&&(u={message:"The application rejected the certificate.",error:a.certificateError.bad_certificate}),(w||0===w)&&("object"!=typeof w||n.util.isArray(w)?"string"==typeof w&&(u.error=w):(w.message&&(u.message=w.message),w.error&&(u.error=w.error))),u;u=null,s=!1,++l}while(t.length>0);return!0}},function(e,t,r){var n=r(3);r(18),r(4),(e.exports=n.pss=n.pss||{}).create=function(e){3===arguments.length&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t,r=e.md,i=e.mgf,a=r.digestLength,o=e.salt||null;if("string"==typeof o&&(o=n.util.createBuffer(o)),"saltLength"in e)t=e.saltLength;else{if(null===o)throw new Error("Salt length not specified or specific salt not given.");t=o.length()}if(null!==o&&o.length()!==t)throw new Error("Given salt length does not match length of given salt.");var s=e.prng||n.random,u={encode:function(e,u){var l,c,f=u-1,h=Math.ceil(f/8),d=e.digest().getBytes();if(h>8*h-f&255;return(S=String.fromCharCode(S.charCodeAt(0)&~w)+S.substr(1))+g+String.fromCharCode(188)},verify:function(e,o,s){var u,l=s-1,c=Math.ceil(l/8);if(o=o.substr(-c),c>8*c-l&255;if(0!=(h.charCodeAt(0)&p))throw new Error("Bits beyond keysize not zero as expected.");var g=i.generate(d,f),y="";for(u=0;u>>0,s>>>0];for(var u=i.fullMessageLength.length-1;u>=0;--u)i.fullMessageLength[u]+=s[1],s[1]=s[0]+(i.fullMessageLength[u]/4294967296>>>0),i.fullMessageLength[u]=i.fullMessageLength[u]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(a),c(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var o=n.util.createBuffer();o.putBytes(t.bytes());var s=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;o.putBytes(a.substr(0,i.blockLength-s));for(var u,l=0,f=i.fullMessageLength.length-1;f>=0;--f)l=(u=8*i.fullMessageLength[f]+l)/4294967296>>>0,o.putInt32Le(u>>>0);var h={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3};c(h,r,o);var d=n.util.createBuffer();return d.putInt32Le(h.h0),d.putInt32Le(h.h1),d.putInt32Le(h.h2),d.putInt32Le(h.h3),d},i};var a=null,o=null,s=null,u=null,l=!1;function c(e,t,r){for(var n,i,a,l,c,f,h,d=r.length();d>=64;){for(i=e.h0,a=e.h1,l=e.h2,c=e.h3,h=0;h<16;++h)t[h]=r.getInt32Le(),n=i+(c^a&(l^c))+u[h]+t[h],i=c,c=l,l=a,a+=n<<(f=s[h])|n>>>32-f;for(;h<32;++h)n=i+(l^c&(a^l))+u[h]+t[o[h]],i=c,c=l,l=a,a+=n<<(f=s[h])|n>>>32-f;for(;h<48;++h)n=i+(a^l^c)+u[h]+t[o[h]],i=c,c=l,l=a,a+=n<<(f=s[h])|n>>>32-f;for(;h<64;++h)n=i+(l^(a|~c))+u[h]+t[o[h]],i=c,c=l,l=a,a+=n<<(f=s[h])|n>>>32-f;e.h0=e.h0+i|0,e.h1=e.h1+a|0,e.h2=e.h2+l|0,e.h3=e.h3+c|0,d-=64}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){return new URL(e,t).toString()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=new RegExp('((?!\\\\)"\\w+"):\\s*(-?[\\d|\\.]{14,})',"g");t.default=function(e){return JSON.parse(e.replace(n,'$1:"$2"'))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=["amount","matcherFee","price","fee","minSponsoredAssetFee","quantity","sellMatcherFee","buyMatcherFee"];t.default=function(e){return JSON.stringify(e,(function(e,t){return n.includes(e)||"value"===e&&"integer"===this.type?"!"+t+"!":t}),0).replace(/"\!(-?\d+)\!"/g,"$1")}},function(e,t,r){!function(e){"use strict";var t=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,r=Math.ceil,n=Math.floor,i="[BigNumber Error] ",a=i+"Number primitive has more than 15 significant digits: ",o=1e14,s=14,u=9007199254740991,l=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],c=1e7,f=1e9;function h(e){var t=0|e;return e>0||e===t?t:t-1}function d(e){for(var t,r,n=1,i=e.length,a=e[0]+"";nl^r?1:-1;for(s=(u=i.length)<(l=a.length)?u:l,o=0;oa[o]^r?1:-1;return u==l?0:u>l^r?1:-1}function g(e,t,r,a){if(er||e!==n(e))throw Error(i+(a||"Argument")+("number"==typeof e?er?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function y(e){var t=e.c.length-1;return h(e.e/s)==t&&e.c[t]%2!=0}function m(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function v(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else tD?y.c=y.e=null:e.e=10;f/=10,c++);return void(c>D?y.c=y.e=null:(y.e=c,y.c=[e]))}p=String(e)}else{if(!t.test(p=String(e)))return E(y,p,h);y.s=45==p.charCodeAt(0)?(p=p.slice(1),-1):1}(c=p.indexOf("."))>-1&&(p=p.replace(".","")),(f=p.search(/e/i))>0?(c<0&&(c=f),c+=+p.slice(f+1),p=p.substring(0,f)):c<0&&(c=p.length)}else{if(g(r,2,V.length,"Base"),10==r)return z(y=new K(e),O+y.e+1,N);if(p=String(e),h="number"==typeof e){if(0*e!=0)return E(y,p,h,r);if(y.s=1/e<0?(p=p.slice(1),-1):1,K.DEBUG&&p.replace(/^0\.0*|\./,"").length>15)throw Error(a+e)}else y.s=45===p.charCodeAt(0)?(p=p.slice(1),-1):1;for(i=V.slice(0,r),c=f=0,d=p.length;fc){c=d;continue}}else if(!l&&(p==p.toUpperCase()&&(p=p.toLowerCase())||p==p.toLowerCase()&&(p=p.toUpperCase()))){l=!0,f=-1,c=0;continue}return E(y,String(e),h,r)}h=!1,(c=(p=w(p,r,10,y.s)).indexOf("."))>-1?p=p.replace(".",""):c=p.length}for(f=0;48===p.charCodeAt(f);f++);for(d=p.length;48===p.charCodeAt(--d););if(p=p.slice(f,++d)){if(d-=f,h&&K.DEBUG&&d>15&&(e>u||e!==n(e)))throw Error(a+y.s*e);if((c=c-f-1)>D)y.c=y.e=null;else if(c=M)?m(u,o):v(u,o,"0");else if(a=(e=z(new K(e),t,r)).e,s=(u=d(e.c)).length,1==n||2==n&&(t<=a||a<=R)){for(;ss){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=a-s)>0)for(a+1==s&&(u+=".");t--;u+="0");return e.s<0&&i?"-"+u:u}function H(e,t){for(var r,n=1,i=new K(e[0]);n=10;i/=10,n++);return(r=n+r*s-1)>D?e.c=e.e=null:r=10;h/=10,u++);if((c=t-u)<0)c+=s,f=t,g=(d=y[p=0])/m[u-f-1]%10|0;else if((p=r((c+1)/s))>=y.length){if(!a)break e;for(;y.length<=p;y.push(0));d=g=0,u=1,f=(c%=s)-s+1}else{for(d=h=y[p],u=1;h>=10;h/=10,u++);g=(f=(c%=s)-s+u)<0?0:d/m[u-f-1]%10|0}if(a=a||t<0||null!=y[p+1]||(f<0?d:d%m[u-f-1]),a=i<4?(g||a)&&(0==i||i==(e.s<0?3:2)):g>5||5==g&&(4==i||a||6==i&&(c>0?f>0?d/m[u-f]:0:y[p-1])%10&1||i==(e.s<0?8:7)),t<1||!y[0])return y.length=0,a?(t-=e.e+1,y[0]=m[(s-t%s)%s],e.e=-t||0):y[0]=e.e=0,e;if(0==c?(y.length=p,h=1,p--):(y.length=p+1,h=m[s-c],y[p]=f>0?n(d/m[u-f]%m[f])*h:0),a)for(;;){if(0==p){for(c=1,f=y[0];f>=10;f/=10,c++);for(f=y[0]+=h,h=1;f>=10;f/=10,h++);c!=h&&(e.e++,y[0]==o&&(y[0]=1));break}if(y[p]+=h,y[p]!=o)break;y[p--]=0,h=1}for(c=y.length;0===y[--c];y.pop());}e.e>D?e.c=e.e=null:e.e=M?m(t,r):v(t,r,"0"),e.s<0?"-"+t:t)}return K.clone=e,K.ROUND_UP=0,K.ROUND_DOWN=1,K.ROUND_CEIL=2,K.ROUND_FLOOR=3,K.ROUND_HALF_UP=4,K.ROUND_HALF_DOWN=5,K.ROUND_HALF_EVEN=6,K.ROUND_HALF_CEIL=7,K.ROUND_HALF_FLOOR=8,K.EUCLID=9,K.config=K.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(i+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(g(r=e[t],0,f,t),O=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(g(r=e[t],0,8,t),N=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(g(r[0],-f,0,t),g(r[1],0,f,t),R=r[0],M=r[1]):(g(r,-f,f,t),R=-(M=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)g(r[0],-f,-1,t),g(r[1],1,f,t),L=r[0],D=r[1];else{if(g(r,-f,f,t),!r)throw Error(i+t+" cannot be zero: "+r);L=-(D=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(i+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw F=!r,Error(i+"crypto unavailable");F=r}else F=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(g(r=e[t],0,9,t),x=r),e.hasOwnProperty(t="POW_PRECISION")&&(g(r=e[t],0,f,t),U=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(i+t+" not an object: "+r);j=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.$|[+-.\s]|(.).*\1/.test(r))throw Error(i+t+" invalid: "+r);V=r}}return{DECIMAL_PLACES:O,ROUNDING_MODE:N,EXPONENTIAL_AT:[R,M],RANGE:[L,D],CRYPTO:F,MODULO_MODE:x,POW_PRECISION:U,FORMAT:j,ALPHABET:V}},K.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!K.DEBUG)return!0;var t,r,a=e.c,u=e.e,l=e.s;e:if("[object Array]"=={}.toString.call(a)){if((1===l||-1===l)&&u>=-f&&u<=f&&u===n(u)){if(0===a[0]){if(0===u&&1===a.length)return!0;break e}if((t=(u+1)%s)<1&&(t+=s),String(a[0]).length==t){for(t=0;t=o||r!==n(r))break e;if(0!==r)return!0}}}else if(null===a&&null===u&&(null===l||1===l||-1===l))return!0;throw Error(i+"Invalid BigNumber: "+e)},K.maximum=K.max=function(){return H(arguments,_.lt)},K.minimum=K.min=function(){return H(arguments,_.gt)},K.random=(A=9007199254740992*Math.random()&2097151?function(){return n(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,a,o,u,c,h=0,d=[],p=new K(P);if(null==e?e=O:g(e,0,f),u=r(e/s),F)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(u*=2));h>>11))>=9e15?(a=crypto.getRandomValues(new Uint32Array(2)),t[h]=a[0],t[h+1]=a[1]):(d.push(c%1e14),h+=2);h=u/2}else{if(!crypto.randomBytes)throw F=!1,Error(i+"crypto unavailable");for(t=crypto.randomBytes(u*=7);h=9e15?crypto.randomBytes(7).copy(t,h):(d.push(c%1e14),h+=7);h=u/7}if(!F)for(;h=10;c/=10,h++);hr-1&&(null==o[i+1]&&(o[i+1]=0),o[i+1]+=o[i]/r|0,o[i]%=r)}return o.reverse()}return function(t,r,n,i,a){var o,s,u,l,c,f,h,p,g=t.indexOf("."),y=O,m=N;for(g>=0&&(l=U,U=0,t=t.replace(".",""),f=(p=new K(r)).pow(t.length-g),U=l,p.c=e(v(d(f.c),f.e,"0"),10,n,"0123456789"),p.e=p.c.length),u=l=(h=e(t,r,n,a?(o=V,"0123456789"):(o="0123456789",V))).length;0==h[--l];h.pop());if(!h[0])return o.charAt(0);if(g<0?--u:(f.c=h,f.e=u,f.s=i,h=(f=S(f,p,y,m,n)).c,c=f.r,u=f.e),g=h[s=u+y+1],l=n/2,c=c||s<0||null!=h[s+1],c=m<4?(null!=g||c)&&(0==m||m==(f.s<0?3:2)):g>l||g==l&&(4==m||c||6==m&&1&h[s-1]||m==(f.s<0?8:7)),s<1||!h[0])t=c?v(o.charAt(1),-y,o.charAt(0)):o.charAt(0);else{if(h.length=s,c)for(--n;++h[--s]>n;)h[s]=0,s||(++u,h=[1].concat(h));for(l=h.length;!h[--l];);for(g=0,t="";g<=l;t+=o.charAt(h[g++]));t=v(t,u,o.charAt(0))}return t}}(),S=function(){function e(e,t,r){var n,i,a,o,s=0,u=e.length,l=t%c,f=t/c|0;for(e=e.slice();u--;)s=((i=l*(a=e[u]%c)+(n=f*a+(o=e[u]/c|0)*l)%c*c+s)/r|0)+(n/c|0)+f*o,e[u]=i%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var i,a;if(r!=n)a=r>n?1:-1;else for(i=a=0;it[i]?1:-1;break}return a}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]1;e.splice(0,1));}return function(i,a,u,l,c){var f,d,p,g,y,m,v,b,S,w,E,A,T,C,I,k,B,_=i.s==a.s?1:-1,P=i.c,O=a.c;if(!(P&&P[0]&&O&&O[0]))return new K(i.s&&a.s&&(P?!O||P[0]!=O[0]:O)?P&&0==P[0]||!O?0*_:_/0:NaN);for(S=(b=new K(_)).c=[],_=u+(d=i.e-a.e)+1,c||(c=o,d=h(i.e/s)-h(a.e/s),_=_/s|0),p=0;O[p]==(P[p]||0);p++);if(O[p]>(P[p]||0)&&d--,_<0)S.push(1),g=!0;else{for(C=P.length,k=O.length,p=0,_+=2,(y=n(c/(O[0]+1)))>1&&(O=e(O,y,c),P=e(P,y,c),k=O.length,C=P.length),T=k,E=(w=P.slice(0,k)).length;E=c/2&&I++;do{if(y=0,(f=t(O,w,k,E))<0){if(A=w[0],k!=E&&(A=A*c+(w[1]||0)),(y=n(A/I))>1)for(y>=c&&(y=c-1),v=(m=e(O,y,c)).length,E=w.length;1==t(m,w,v,E);)y--,r(m,k=10;_/=10,p++);z(b,u+(b.e=p+d*s-1)+1,l,g)}else b.e=d,b.r=+g;return b}}(),T=/^(-?)0([xbo])(?=\w[\w.]*$)/i,C=/^([^.]+)\.$/,I=/^\.([^.]+)$/,k=/^-?(Infinity|NaN)$/,B=/^\s*\+(?=[\w.])|^\s+|\s+$/g,E=function(e,t,r,n){var a,o=r?t:t.replace(B,"");if(k.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(T,(function(e,t,r){return a="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=a?e:t})),n&&(a=n,o=o.replace(C,"$1").replace(I,"0.$1")),t!=o))return new K(o,a);if(K.DEBUG)throw Error(i+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},_.absoluteValue=_.abs=function(){var e=new K(this);return e.s<0&&(e.s=1),e},_.comparedTo=function(e,t){return p(this,new K(e,t))},_.decimalPlaces=_.dp=function(e,t){var r,n,i,a=this;if(null!=e)return g(e,0,f),null==t?t=N:g(t,0,8),z(new K(a),e+a.e+1,t);if(!(r=a.c))return null;if(n=((i=r.length-1)-h(this.e/s))*s,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},_.dividedBy=_.div=function(e,t){return S(this,new K(e,t),O,N)},_.dividedToIntegerBy=_.idiv=function(e,t){return S(this,new K(e,t),0,1)},_.exponentiatedBy=_.pow=function(e,t){var a,o,u,l,c,f,h,d,p=this;if((e=new K(e)).c&&!e.isInteger())throw Error(i+"Exponent not an integer: "+X(e));if(null!=t&&(t=new K(t)),c=e.e>14,!p.c||!p.c[0]||1==p.c[0]&&!p.e&&1==p.c.length||!e.c||!e.c[0])return d=new K(Math.pow(+X(p),c?2-y(e):+X(e))),t?d.mod(t):d;if(f=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new K(NaN);(o=!f&&p.isInteger()&&t.isInteger())&&(p=p.mod(t))}else{if(e.e>9&&(p.e>0||p.e<-1||(0==p.e?p.c[0]>1||c&&p.c[1]>=24e7:p.c[0]<8e13||c&&p.c[0]<=9999975e7)))return l=p.s<0&&y(e)?-0:0,p.e>-1&&(l=1/l),new K(f?1/l:l);U&&(l=r(U/s+2))}for(c?(a=new K(.5),f&&(e.s=1),h=y(e)):h=(u=Math.abs(+X(e)))%2,d=new K(P);;){if(h){if(!(d=d.times(p)).c)break;l?d.c.length>l&&(d.c.length=l):o&&(d=d.mod(t))}if(u){if(0===(u=n(u/2)))break;h=u%2}else if(z(e=e.times(a),e.e+1,1),e.e>14)h=y(e);else{if(0==(u=+X(e)))break;h=u%2}p=p.times(p),l?p.c&&p.c.length>l&&(p.c.length=l):o&&(p=p.mod(t))}return o?d:(f&&(d=P.div(d)),t?d.mod(t):l?z(d,U,N,void 0):d)},_.integerValue=function(e){var t=new K(this);return null==e?e=N:g(e,0,8),z(t,t.e+1,e)},_.isEqualTo=_.eq=function(e,t){return 0===p(this,new K(e,t))},_.isFinite=function(){return!!this.c},_.isGreaterThan=_.gt=function(e,t){return p(this,new K(e,t))>0},_.isGreaterThanOrEqualTo=_.gte=function(e,t){return 1===(t=p(this,new K(e,t)))||0===t},_.isInteger=function(){return!!this.c&&h(this.e/s)>this.c.length-2},_.isLessThan=_.lt=function(e,t){return p(this,new K(e,t))<0},_.isLessThanOrEqualTo=_.lte=function(e,t){return-1===(t=p(this,new K(e,t)))||0===t},_.isNaN=function(){return!this.s},_.isNegative=function(){return this.s<0},_.isPositive=function(){return this.s>0},_.isZero=function(){return!!this.c&&0==this.c[0]},_.minus=function(e,t){var r,n,i,a,u=this,l=u.s;if(t=(e=new K(e,t)).s,!l||!t)return new K(NaN);if(l!=t)return e.s=-t,u.plus(e);var c=u.e/s,f=e.e/s,d=u.c,p=e.c;if(!c||!f){if(!d||!p)return d?(e.s=-t,e):new K(p?u:NaN);if(!d[0]||!p[0])return p[0]?(e.s=-t,e):new K(d[0]?u:3==N?-0:0)}if(c=h(c),f=h(f),d=d.slice(),l=c-f){for((a=l<0)?(l=-l,i=d):(f=c,i=p),i.reverse(),t=l;t--;i.push(0));i.reverse()}else for(n=(a=(l=d.length)<(t=p.length))?l:t,l=t=0;t0)for(;t--;d[r++]=0);for(t=o-1;n>l;){if(d[--n]=0;){for(r=0,y=A[i]%S,m=A[i]/S|0,a=i+(u=f);a>i;)r=((d=y*(d=E[--u]%S)+(l=m*d+(p=E[u]/S|0)*y)%S*S+v[a]+r)/b|0)+(l/S|0)+m*p,v[a--]=d%b;v[a]=r}return r?++n:v.splice(0,1),G(e,v,n)},_.negated=function(){var e=new K(this);return e.s=-e.s||null,e},_.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new K(e,t)).s,!i||!t)return new K(NaN);if(i!=t)return e.s=-t,n.minus(e);var a=n.e/s,u=e.e/s,l=n.c,c=e.c;if(!a||!u){if(!l||!c)return new K(i/0);if(!l[0]||!c[0])return c[0]?e:new K(l[0]?n:0*i)}if(a=h(a),u=h(u),l=l.slice(),i=a-u){for(i>0?(u=a,r=c):(i=-i,r=l),r.reverse();i--;r.push(0));r.reverse()}for((i=l.length)-(t=c.length)<0&&(r=c,c=l,l=r,t=i),i=0;t;)i=(l[--t]=l[t]+c[t]+i)/o|0,l[t]=o===l[t]?0:l[t]%o;return i&&(l=[i].concat(l),++u),G(e,l,u)},_.precision=_.sd=function(e,t){var r,n,i,a=this;if(null!=e&&e!==!!e)return g(e,1,f),null==t?t=N:g(t,0,8),z(new K(a),e,t);if(!(r=a.c))return null;if(n=(i=r.length-1)*s+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&a.e+1>n&&(n=a.e+1),n},_.shiftedBy=function(e){return g(e,-u,u),this.times("1e"+e)},_.squareRoot=_.sqrt=function(){var e,t,r,n,i,a=this,o=a.c,s=a.s,u=a.e,l=O+4,c=new K("0.5");if(1!==s||!o||!o[0])return new K(!s||s<0&&(!o||o[0])?NaN:o?a:1/0);if(0==(s=Math.sqrt(+X(a)))||s==1/0?(((t=d(o)).length+u)%2==0&&(t+="0"),s=Math.sqrt(+t),u=h((u+1)/2)-(u<0||u%2),r=new K(t=s==1/0?"5e"+u:(t=s.toExponential()).slice(0,t.indexOf("e")+1)+u)):r=new K(s+""),r.c[0])for((s=(u=r.e)+l)<3&&(s=0);;)if(i=r,r=c.times(i.plus(S(a,i,l,1))),d(i.c).slice(0,s)===(t=d(r.c)).slice(0,s)){if(r.e0&&g>0){for(o=g%u||u,f=p.substr(0,o);o0&&(f+=c+p.slice(o)),d&&(f="-"+f)}n=h?f+(r.decimalSeparator||"")+((l=+r.fractionGroupSize)?h.replace(new RegExp("\\d{"+l+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):h):f}return(r.prefix||"")+n+(r.suffix||"")},_.toFraction=function(e){var t,r,n,a,o,u,c,f,h,p,g,y,m=this,v=m.c;if(null!=e&&(!(c=new K(e)).isInteger()&&(c.c||1!==c.s)||c.lt(P)))throw Error(i+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+X(c));if(!v)return new K(m);for(t=new K(P),h=r=new K(P),n=f=new K(P),y=d(v),o=t.e=y.length-m.e-1,t.c[0]=l[(u=o%s)<0?s+u:u],e=!e||c.comparedTo(t)>0?o>0?t:h:c,u=D,D=1/0,c=new K(y),f.c[0]=0;p=S(c,t,0,1),1!=(a=r.plus(p.times(n))).comparedTo(e);)r=n,n=a,h=f.plus(p.times(a=h)),f=a,t=c.minus(p.times(a=t)),c=a;return a=S(e.minus(r),n,0,1),f=f.plus(a.times(h)),r=r.plus(a.times(n)),f.s=h.s=m.s,g=S(h,n,o*=2,N).minus(m).abs().comparedTo(S(f,r,o,N).minus(m).abs())<1?[h,n]:[f,r],D=u,g},_.toNumber=function(){return+X(this)},_.toPrecision=function(e,t){return null!=e&&g(e,1,f),J(this,e,t,2)},_.toString=function(e){var t,r=this,n=r.s,i=r.e;return null===i?n?(t="Infinity",n<0&&(t="-"+t)):t="NaN":(null==e?t=i<=R||i>=M?m(d(r.c),i):v(d(r.c),i,"0"):10===e?t=v(d((r=z(new K(r),O+i+1,N)).c),r.e,"0"):(g(e,2,V.length,"Base"),t=w(v(d(r.c),i,"0"),10,e,n,!0)),n<0&&r.c[0]&&(t="-"+t)),t},_.valueOf=_.toJSON=function(){return X(this)},_._isBigNumber=!0,_[Symbol.toStringTag]="BigNumber",_[Symbol.for("nodejs.util.inspect.custom")]=_.valueOf,null!=b&&K.set(b),K}(),S=function(){return(S=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0||s?t:[0];var u=!!a&&t[0]>127,l=Array.from(t).map((function(e){return u?255-e:e})).map((function(t){return e._toLength(8,t.toString(2))})).join(""),c=new e(new b(l,2));return u?c.mul(-1).sub(1):c},e.max=function(){for(var t=[],r=0;r=l)||(u.push(e),!1)}));if(i.length)return c&&Date.now()-s>c?Promise.reject("Timeout error!"):n.wait(f).then((function(){return h(i)}))}))};return h(n.toArray(t)).then((function(){return o?n.head(u):u}))}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(48),a=n(r(73)),o=r(10);t.default=function(e,t){return i.fetchDetails(e,a.default(t)).then((function(e){return o.indexBy(o.prop("assetId"),e)}))}},function(e,t,r){"use strict";var n,i=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o},a=this&&this.__spread||function(){for(var e=[],t=0;t>8,t[i]&=255,++i;for(;n;)t.push(255&n),n>>=8;o++}for(o=0;"1"===e[o]&&o>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},function(e,t,r){"use strict";var n=r(11),i=r(31),a=r(76),o=r(30),s=n.sum32,u=n.sum32_4,l=n.sum32_5,c=a.ch32,f=a.maj32,h=a.s0_256,d=a.s1_256,p=a.g0_256,g=a.g1_256,y=i.BlockHash,m=[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 v(){if(!(this instanceof v))return new v;y.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}n.inherits(v,y),e.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n0&&r[1]||""},e.getSecondMatch=function(e,t){var r=t.match(e);return r&&r.length>1&&r[2]||""},e.matchAndReturnConst=function(e,t,r){if(e.test(t))return r},e.getWindowsVersionName=function(e){switch(e){case"NT":return"NT";case"XP":case"NT 5.1":return"XP";case"NT 5.0":return"2000";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},e.getMacOSVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),10===t[0])switch(t[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},e.getAndroidVersionName=function(e){var t=e.split(".").splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(1===t[0]&&t[1]<5))return 1===t[0]&&t[1]<6?"Cupcake":1===t[0]&&t[1]>=6?"Donut":2===t[0]&&t[1]<2?"Eclair":2===t[0]&&2===t[1]?"Froyo":2===t[0]&&t[1]>2?"Gingerbread":3===t[0]?"Honeycomb":4===t[0]&&t[1]<1?"Ice Cream Sandwich":4===t[0]&&t[1]<4?"Jelly Bean":4===t[0]&&t[1]>=4?"KitKat":5===t[0]?"Lollipop":6===t[0]?"Marshmallow":7===t[0]?"Nougat":8===t[0]?"Oreo":9===t[0]?"Pie":void 0},e.getVersionPrecision=function(e){return e.split(".").length},e.compareVersions=function(t,r,n){void 0===n&&(n=!1);var i=e.getVersionPrecision(t),a=e.getVersionPrecision(r),o=Math.max(i,a),s=0,u=e.map([t,r],(function(t){var r=o-e.getVersionPrecision(t),n=t+new Array(r+1).join(".0");return e.map(n.split("."),(function(e){return new Array(20-e.length).join("0")+e})).reverse()}));for(n&&(s=o-Math.min(i,a)),o-=1;o>=s;){if(u[0][o]>u[1][o])return 1;if(u[0][o]===u[1][o]){if(o===s)return 0;o-=1}else if(u[0][o]1?i-1:0),o=1;o0){var o=Object.keys(r),u=s.default.find(o,(function(e){return t.isOS(e)}));if(u){var l=this.satisfies(r[u]);if(void 0!==l)return l}var c=s.default.find(o,(function(e){return t.isPlatform(e)}));if(c){var f=this.satisfies(r[c]);if(void 0!==f)return f}}if(a>0){var h=Object.keys(i),d=s.default.find(h,(function(e){return t.isBrowser(e,!0)}));if(void 0!==d)return this.compareVersion(i[d])}},t.isBrowser=function(e,t){void 0===t&&(t=!1);var r=this.getBrowserName().toLowerCase(),n=e.toLowerCase(),i=s.default.getBrowserTypeByAlias(n);return t&&i&&(n=i.toLowerCase()),n===r},t.compareVersion=function(e){var t=[0],r=e,n=!1,i=this.getBrowserVersion();if("string"==typeof i)return">"===e[0]||"<"===e[0]?(r=e.substr(1),"="===e[1]?(n=!0,r=e.substr(2)):t=[],">"===e[0]?t.push(1):t.push(-1)):"="===e[0]?r=e.substr(1):"~"===e[0]&&(n=!0,r=e.substr(1)),t.indexOf(s.default.compareVersions(i,r,n))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return void 0===t&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return void 0===e&&(e=[]),e.some((function(e){return t.is(e)}))},e}();t.default=l,e.exports=t.default},92:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},a=/version\/(\d+(\.?_?\d+)+)/i,o=[{test:[/googlebot/i],describe:function(e){var t={name:"Googlebot"},r=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/opera/i],describe:function(e){var t={name:"Opera"},r=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:"Opera"},r=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:"Samsung Internet for Android"},r=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Whale/i],describe:function(e){var t={name:"NAVER Whale Browser"},r=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:"MZ Browser"},r=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/focus/i],describe:function(e){var t={name:"Focus"},r=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/swing/i],describe:function(e){var t={name:"Swing"},r=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/coast/i],describe:function(e){var t={name:"Opera Coast"},r=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:"Opera Touch"},r=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/yabrowser/i],describe:function(e){var t={name:"Yandex Browser"},r=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:"UC Browser"},r=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:"Maxthon"},r=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/epiphany/i],describe:function(e){var t={name:"Epiphany"},r=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/puffin/i],describe:function(e){var t={name:"Puffin"},r=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sleipnir/i],describe:function(e){var t={name:"Sleipnir"},r=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/k-meleon/i],describe:function(e){var t={name:"K-Meleon"},r=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/micromessenger/i],describe:function(e){var t={name:"WeChat"},r=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?"QQ Browser Lite":"QQ Browser"},r=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/msie|trident/i],describe:function(e){var t={name:"Internet Explorer"},r=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/\sedg\//i],describe:function(e){var t={name:"Microsoft Edge"},r=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:"Microsoft Edge"},r=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/vivaldi/i],describe:function(e){var t={name:"Vivaldi"},r=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/seamonkey/i],describe:function(e){var t={name:"SeaMonkey"},r=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/sailfish/i],describe:function(e){var t={name:"Sailfish"},r=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return r&&(t.version=r),t}},{test:[/silk/i],describe:function(e){var t={name:"Amazon Silk"},r=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/phantom/i],describe:function(e){var t={name:"PhantomJS"},r=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/slimerjs/i],describe:function(e){var t={name:"SlimerJS"},r=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:"BlackBerry"},r=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:"WebOS Browser"},r=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/bada/i],describe:function(e){var t={name:"Bada"},r=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/tizen/i],describe:function(e){var t={name:"Tizen"},r=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/qupzilla/i],describe:function(e){var t={name:"QupZilla"},r=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:"Firefox"},r=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/electron/i],describe:function(e){var t={name:"Electron"},r=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:"Miui"},r=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/chromium/i],describe:function(e){var t={name:"Chromium"},r=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:"Chrome"},r=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/GSA/i],describe:function(e){var t={name:"Google Search"},r=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t={name:"Android Browser"},r=i.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/playstation 4/i],describe:function(e){var t={name:"PlayStation 4"},r=i.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:"Safari"},r=i.default.getFirstMatch(a,e);return r&&(t.version=r),t}},{test:[/.*/i],describe:function(e){var t=-1!==e.search("\\(")?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}];t.default=o,e.exports=t.default},93:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},a=r(18),o=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:a.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),r=i.default.getWindowsVersionName(t);return{name:a.OS_MAP.Windows,version:t,versionName:r}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:a.OS_MAP.iOS},r=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return r&&(t.version=r),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,"."),r=i.default.getMacOSVersionName(t),n={name:a.OS_MAP.MacOS,version:t};return r&&(n.versionName=r),n}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,".");return{name:a.OS_MAP.iOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),r=e.test(/android/i);return t&&r},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),r=i.default.getAndroidVersionName(t),n={name:a.OS_MAP.Android,version:t};return r&&(n.versionName=r),n}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),r={name:a.OS_MAP.WebOS};return t&&t.length&&(r.version=t),r}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:a.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:a.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:a.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.PlayStation4,version:t}}}];t.default=o,e.exports=t.default},94:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},a=r(18),o=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&"Nova",r={type:a.PLATFORMS_MAP.mobile,vendor:"Huawei"};return t&&(r.model=t),r}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),r=e.test(/like (ipod|iphone)/i);return t&&!r},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:a.PLATFORMS_MAP.mobile,vendor:"Apple",model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return"blackberry"===e.getBrowserName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(e){return"bada"===e.getBrowserName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return"windows phone"===e.getBrowserName()},describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(".")[0]);return"android"===e.getOSName(!0)&&t>=3},describe:function(){return{type:a.PLATFORMS_MAP.tablet}}},{test:function(e){return"android"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return"macos"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(e){return"windows"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.desktop}}},{test:function(e){return"linux"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.desktop}}},{test:function(e){return"playstation 4"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.tv}}},{test:function(e){return"roku"===e.getOSName(!0)},describe:function(){return{type:a.PLATFORMS_MAP.tv}}}];t.default=o,e.exports=t.default},95:function(e,t,r){"use strict";t.__esModule=!0,t.default=void 0;var n,i=(n=r(17))&&n.__esModule?n:{default:n},a=r(18),o=[{test:function(e){return"microsoft edge"===e.getBrowserName(!0)},describe:function(e){if(/\sedg\//i.test(e))return{name:a.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:a.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:a.ENGINE_MAP.Trident},r=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:a.ENGINE_MAP.Presto},r=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:function(e){var t=e.test(/gecko/i),r=e.test(/like gecko/i);return t&&!r},describe:function(e){var t={name:a.ENGINE_MAP.Gecko},r=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:a.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:a.ENGINE_MAP.WebKit},r=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return r&&(t.version=r),t}}];t.default=o,e.exports=t.default}})},function(e,t,r){"use strict";e.exports=function(){let{mustBeMetaMask:e=!1,silent:t=!1,timeout:r=3e3}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(){if("boolean"!=typeof e)throw new Error("@metamask/detect-provider: Expected option 'mustBeMetaMask' to be a boolean.");if("boolean"!=typeof t)throw new Error("@metamask/detect-provider: Expected option 'silent' to be a boolean.");if("number"!=typeof r)throw new Error("@metamask/detect-provider: Expected option 'timeout' to be a number.")}();let n=!1;return new Promise((i=>{function a(){if(n)return;n=!0,window.removeEventListener("ethereum#initialized",a);const{ethereum:r}=window;if(!r||e&&!r.isMetaMask){const n=e&&r?"Non-MetaMask window.ethereum detected.":"Unable to detect window.ethereum.";!t&&console.error("@metamask/detect-provider:",n),i(null)}else i(r)}window.ethereum?a():(window.addEventListener("ethereum#initialized",a,{once:!0}),setTimeout((()=>{a()}),r))}))}},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return K}));var n=r(2),i=r.n(n),a=r(7),o=r.n(a);function s(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e||"undefined"!=typeof self&&self;var u=l;function l(e,t){if(!e)throw new Error(t||"Assertion failed")}l.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var c=s((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>8,o=255&i;a?r.push(a,o):r.push(o)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}})),f=s((function(e,t){var r=t;r.assert=u,r.toArray=c.toArray,r.zero2=c.zero2,r.toHex=c.toHex,r.encode=c.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-u:u,a.isubn(s)):s=0,n[o]=s,a.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,a=0;e.cmpn(-i)>0||t.cmpn(-a)>0;){var o,s,u=e.andln(3)+i&3,l=t.andln(3)+a&3;3===u&&(u=-1),3===l&&(l=-1),o=0==(1&u)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==l?u:-u,r[0].push(o),s=0==(1&l)?0:3!==(n=t.andln(7)+a&7)&&5!==n||2!==u?l:-l,r[1].push(s),2*i===o+1&&(i=1-i),2*a===s+1&&(a=1-a),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 i.a(e,"hex","le")}})),h=f.getNAF,d=f.getJSF,p=f.assert;function g(e,t){this.type=e,this.p=new i.a(t.p,16),this.red=t.prime?i.a.red(t.prime):i.a.mont(this.p),this.zero=new i.a(0).toRed(this.red),this.one=new i.a(1).toRed(this.red),this.two=new i.a(2).toRed(this.red),this.n=t.n&&new i.a(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 y=g;function m(e,t){this.curve=e,this.type=t,this.precomputed=null}g.prototype.point=function(){throw new Error("Not implemented")},g.prototype.validate=function(){throw new Error("Not implemented")},g.prototype._fixedNafMul=function(e,t){p(e.precomputed);var r=e._getDoubles(),n=h(t,1,this._bitLength),i=(1<=a;u--)o=(o<<1)+n[u];s.push(o)}for(var l=this.jpoint(null,null,null),c=this.jpoint(null,null,null),f=i;f>0;f--){for(a=0;a=0;s--){for(var u=0;s>=0&&0===a[s];s--)u++;if(s>=0&&u++,o=o.dblp(u),s<0)break;var l=a[s];p(0!==l),o="affine"===e.type?l>0?o.mixedAdd(i[l-1>>1]):o.mixedAdd(i[-l-1>>1].neg()):l>0?o.add(i[l-1>>1]):o.add(i[-l-1>>1].neg())}return"affine"===e.type?o.toP():o},g.prototype._wnafMulAdd=function(e,t,r,n,i){var a,o,s,u=this._wnafT1,l=this._wnafT2,c=this._wnafT3,f=0;for(a=0;a=1;a-=2){var g=a-1,y=a;if(1===u[g]&&1===u[y]){var m=[t[g],null,null,t[y]];0===t[g].y.cmp(t[y].y)?(m[1]=t[g].add(t[y]),m[2]=t[g].toJ().mixedAdd(t[y].neg())):0===t[g].y.cmp(t[y].y.redNeg())?(m[1]=t[g].toJ().mixedAdd(t[y]),m[2]=t[g].add(t[y].neg())):(m[1]=t[g].toJ().mixedAdd(t[y]),m[2]=t[g].toJ().mixedAdd(t[y].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],b=d(r[g],r[y]);for(f=Math.max(b[0].length,f),c[g]=new Array(f),c[y]=new Array(f),o=0;o=0;a--){for(var T=0;a>=0;){var C=!0;for(o=0;o=0&&T++,E=E.dblp(T),a<0)break;for(o=0;o0?s=l[o][I-1>>1]:I<0&&(s=l[o][-I-1>>1].neg()),E="affine"===s.type?E.mixedAdd(s):E.add(s))}}for(a=0;a=Math.ceil((e.bitLength()+1)/t.step)},m.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i=0&&(o=t,s=r),n.negative&&(n=n.neg(),a=a.neg()),o.negative&&(o=o.neg(),s=s.neg()),[{a:n,b:a},{a:o,b:s}]},S.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),o=i.mul(r.a),s=a.mul(n.a),u=i.mul(r.b),l=a.mul(n.b);return{k1:e.sub(o).sub(s),k2:u.add(l).neg()}},S.prototype.pointFromX=function(e,t){(e=new i.a(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 a=n.fromRed().isOdd();return(t&&!a||!t&&a)&&(n=n.redNeg()),this.point(e,n)},S.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)},S.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,a=0;a":""},E.prototype.isInfinity=function(){return this.inf},E.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)},E.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),a=i.redSqr().redISub(this.x.redAdd(this.x)),o=i.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,o)},E.prototype.getX=function(){return this.x.fromRed()},E.prototype.getY=function(){return this.y.fromRed()},E.prototype.mul=function(e){return e=new i.a(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)},E.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)},E.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)},E.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))},E.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},E.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},v(A,y.BasePoint),S.prototype.jpoint=function(e,t,r){return new A(this,e,t,r)},A.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)},A.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},A.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),a=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=a.redSub(o);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=s.redSqr(),c=l.redMul(s),f=n.redMul(l),h=u.redSqr().redIAdd(c).redISub(f).redISub(f),d=u.redMul(f.redISub(h)).redISub(a.redMul(c)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,d,p)},A.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,a=e.y.redMul(t).redMul(this.z),o=r.redSub(n),s=i.redSub(a);if(0===o.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=o.redSqr(),l=u.redMul(o),c=r.redMul(u),f=s.redSqr().redIAdd(l).redISub(c).redISub(c),h=s.redMul(c.redISub(f)).redISub(i.redMul(l)),d=this.z.redMul(o);return this.curve.jpoint(f,h,d)},A.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=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},A.prototype.inspect=function(){return this.isInfinity()?"":""},A.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var T=s((function(e,t){var r=t;r.base=y,r.short=w,r.mont=null,r.edwards=null})),C=s((function(e,t){var r,n=t,i=f.assert;function a(e){"short"===e.type?this.curve=new T.short(e):"edwards"===e.type?this.curve=new T.edwards(e):this.curve=new T.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 s(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new a(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=a,s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.a.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.a.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.a.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(e){r=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function I(e){if(!(this instanceof I))return new I(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=c.toArray(e.entropy,e.entropyEnc||"hex"),r=c.toArray(e.nonce,e.nonceEnc||"hex"),n=c.toArray(e.pers,e.persEnc||"hex");u(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var k=I;I.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.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},I.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=c.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var O=f.assert;function N(e,t){if(e instanceof N)return e;this._importDER(e,t)||(O(e.r&&e.s,"Signature without r or s"),this.r=new i.a(e.r,16),this.s=new i.a(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var R=N;function M(){this.place=0}function L(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,a=0,o=t.place;a>>=0;return!(i<=127)&&(t.place=o,i)}function D(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}N.prototype._importDER=function(e,t){e=f.toArray(e,t);var r=new M;if(48!==e[r.place++])return!1;var n=L(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var a=L(e,r);if(!1===a)return!1;var o=e.slice(r.place,a+r.place);if(r.place+=a,2!==e[r.place++])return!1;var s=L(e,r);if(!1===s)return!1;if(e.length!==s+r.place)return!1;var u=e.slice(r.place,s+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}return this.r=new i.a(o),this.s=new i.a(u),this.recoveryParam=null,!0},N.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=D(t),r=D(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];F(n,t.length),(n=n.concat(t)).push(2),F(n,r.length);var i=n.concat(r),a=[48];return F(a,i.length),a=a.concat(i),f.encode(a,e)};var x=function(){throw new Error("unsupported")},U=f.assert;function j(e){if(!(this instanceof j))return new j(e);"string"==typeof e&&(U(Object.prototype.hasOwnProperty.call(C,e),"Unknown curve "+e),e=C[e]),e instanceof C.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 V=j;j.prototype.keyPair=function(e){return new P(this,e)},j.prototype.keyFromPrivate=function(e,t){return P.fromPrivate(this,e,t)},j.prototype.keyFromPublic=function(e,t){return P.fromPublic(this,e,t)},j.prototype.genKeyPair=function(e){e||(e={});for(var t=new k({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||x(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new i.a(2));;){var a=new i.a(t.generate(r));if(!(a.cmp(n)>0))return a.iaddn(1),this.keyFromPrivate(a)}},j.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},j.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 i.a(e,16));for(var a=this.n.byteLength(),o=t.getPrivate().toArray("be",a),s=e.toArray("be",a),u=new k({hash:this.hash,entropy:o,nonce:s,pers:n.pers,persEnc:n.persEnc||"utf8"}),l=this.n.sub(new i.a(1)),c=0;;c++){var f=n.k?n.k(c):new i.a(u.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(l)>=0)){var h=this.g.mul(f);if(!h.isInfinity()){var d=h.getX(),p=d.umod(this.n);if(0!==p.cmpn(0)){var g=f.invm(this.n).mul(p.mul(t.getPrivate()).iadd(e));if(0!==(g=g.umod(this.n)).cmpn(0)){var y=(h.getY().isOdd()?1:0)|(0!==d.cmp(p)?2:0);return n.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),y^=1),new R({r:p,s:g,recoveryParam:y})}}}}}},j.prototype.verify=function(e,t,r,n){e=this._truncateToN(new i.a(e,16)),r=this.keyFromPublic(r,n);var a=(t=new R(t,"hex")).r,o=t.s;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s,u=o.invm(this.n),l=u.mul(e).umod(this.n),c=u.mul(a).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(l,r.getPublic(),c)).isInfinity()&&s.eqXToP(a):!(s=this.g.mulAdd(l,r.getPublic(),c)).isInfinity()&&0===s.getX().umod(this.n).cmp(a)},j.prototype.recoverPubKey=function(e,t,r,n){U((3&r)===r,"The recovery param is more than two bits"),t=new R(t,n);var a=this.n,o=new i.a(e),s=t.r,u=t.s,l=1&r,c=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");s=c?this.curve.pointFromX(s.add(this.curve.n),l):this.curve.pointFromX(s,l);var f=t.r.invm(a),h=a.sub(o).mul(f).umod(a),d=u.mul(f).umod(a);return this.g.mulAdd(h,s,d)},j.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new R(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var a;try{a=this.recoverPubKey(e,t,i)}catch(e){continue}if(a.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var K=s((function(e,t){var r=t;r.version="6.5.4",r.utils=f,r.rand=function(){throw new Error("unsupported")},r.curve=T,r.curves=C,r.ec=V,r.eddsa=null})).ec}).call(this,r(17))},function(e,t,r){(function(t,r){!function(){"use strict";var n="object"==typeof window?window:{};!n.JS_SHA3_NO_NODE_JS&&"object"==typeof t&&t.versions&&t.versions.node&&(n=r);for(var i=!n.JS_SHA3_NO_COMMON_JS&&"object"==typeof e&&e.exports,a="0123456789abcdef".split(""),o=[0,8,16,24],s=[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],u=[224,256,384,512],l=["hex","buffer","arrayBuffer","array"],c=function(e,t,r){return function(n){return new w(e,t,e).update(n)[r]()}},f=function(e,t,r){return function(n,i){return new w(e,t,i).update(n)[r]()}},h=function(e,t){var r=c(e,t,"hex");r.create=function(){return new w(e,t,e)},r.update=function(e){return r.create().update(e)};for(var n=0;n>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}w.prototype.update=function(e){var t="string"!=typeof e;t&&e.constructor===ArrayBuffer&&(e=new Uint8Array(e));for(var r,n,i=e.length,a=this.blocks,s=this.byteCount,u=this.blockCount,l=0,c=this.s;l>2]|=e[l]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(a[r>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=s){for(this.start=r-s,this.block=a[u],r=0;r>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>4&15]+a[15&e]+a[e>>12&15]+a[e>>8&15]+a[e>>20&15]+a[e>>16&15]+a[e>>28&15]+a[e>>24&15];s%t==0&&(E(r),o=0)}return i&&(e=r[o],i>0&&(u+=a[e>>4&15]+a[15&e]),i>1&&(u+=a[e>>12&15]+a[e>>8&15]),i>2&&(u+=a[e>>20&15]+a[e>>16&15])),u},w.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,a=0,o=0,s=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(e);o>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;s%r==0&&E(n)}return a&&(e=s<<2,t=n[o],a>0&&(u[e]=255&t),a>1&&(u[e+1]=t>>8&255),a>2&&(u[e+2]=t>>16&255)),u};var E=function(e){var t,r,n,i,a,o,u,l,c,f,h,d,p,g,y,m,v,b,S,w,E,A,T,C,I,k,B,_,P,O,N,R,M,L,D,F,x,U,j,V,K,J,H,G,z,X,q,Y,Q,Z,W,$,ee,te,re,ne,ie,ae,oe,se,ue,le,ce;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],a=e[1]^e[11]^e[21]^e[31]^e[41],o=e[2]^e[12]^e[22]^e[32]^e[42],u=e[3]^e[13]^e[23]^e[33]^e[43],l=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],f=e[6]^e[16]^e[26]^e[36]^e[46],h=e[7]^e[17]^e[27]^e[37]^e[47],t=(d=e[8]^e[18]^e[28]^e[38]^e[48])^(o<<1|u>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(u<<1|o>>>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^(l<<1|c>>>31),r=a^(c<<1|l>>>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=o^(f<<1|h>>>31),r=u^(h<<1|f>>>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=l^(d<<1|p>>>31),r=c^(p<<1|d>>>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=f^(i<<1|a>>>31),r=h^(a<<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,g=e[0],y=e[1],X=e[11]<<4|e[10]>>>28,q=e[10]<<4|e[11]>>>28,_=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,J=e[40]<<18|e[41]>>>14,H=e[41]<<18|e[40]>>>14,L=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,m=e[13]<<12|e[12]>>>20,v=e[12]<<12|e[13]>>>20,Y=e[22]<<10|e[23]>>>22,Q=e[23]<<10|e[22]>>>22,O=e[33]<<13|e[32]>>>19,N=e[32]<<13|e[33]>>>19,le=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,F=e[14]<<6|e[15]>>>26,x=e[15]<<6|e[14]>>>26,b=e[25]<<11|e[24]>>>21,S=e[24]<<11|e[25]>>>21,Z=e[34]<<15|e[35]>>>17,W=e[35]<<15|e[34]>>>17,R=e[45]<<29|e[44]>>>3,M=e[44]<<29|e[45]>>>3,C=e[6]<<28|e[7]>>>4,I=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,U=e[26]<<25|e[27]>>>7,j=e[27]<<25|e[26]>>>7,w=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,G=e[8]<<27|e[9]>>>5,z=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,B=e[19]<<20|e[18]>>>12,ae=e[29]<<7|e[28]>>>25,oe=e[28]<<7|e[29]>>>25,V=e[38]<<8|e[39]>>>24,K=e[39]<<8|e[38]>>>24,A=e[48]<<14|e[49]>>>18,T=e[49]<<14|e[48]>>>18,e[0]=g^~m&b,e[1]=y^~v&S,e[10]=C^~k&_,e[11]=I^~B&P,e[20]=L^~F&U,e[21]=D^~x&j,e[30]=G^~X&Y,e[31]=z^~q&Q,e[40]=te^~ne&ae,e[41]=re^~ie&oe,e[2]=m^~b&w,e[3]=v^~S&E,e[12]=k^~_&O,e[13]=B^~P&N,e[22]=F^~U&V,e[23]=x^~j&K,e[32]=X^~Y&Z,e[33]=q^~Q&W,e[42]=ne^~ae&se,e[43]=ie^~oe&ue,e[4]=b^~w&A,e[5]=S^~E&T,e[14]=_^~O&R,e[15]=P^~N&M,e[24]=U^~V&J,e[25]=j^~K&H,e[34]=Y^~Z&$,e[35]=Q^~W&ee,e[44]=ae^~se&le,e[45]=oe^~ue&ce,e[6]=w^~A&g,e[7]=E^~T&y,e[16]=O^~R&C,e[17]=N^~M&I,e[26]=V^~J&L,e[27]=K^~H&D,e[36]=Z^~$&G,e[37]=W^~ee&z,e[46]=se^~le&te,e[47]=ue^~ce&re,e[8]=A^~g&m,e[9]=T^~y&v,e[18]=R^~C&k,e[19]=M^~I&B,e[28]=J^~L&F,e[29]=H^~D&x,e[38]=$^~G&X,e[39]=ee^~z&q,e[48]=le^~te&ne,e[49]=ce^~re&ie,e[0]^=s[n],e[1]^=s[n+1]};if(i)e.exports=p;else for(y=0;y=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function l(e,t,r,n){for(var i=0,a=Math.min(e.length,r),o=t;o=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(e){return e instanceof a||null!==e&&"object"==typeof e&&e.constructor.wordSize===a.wordSize&&Array.isArray(e.words)},a.max=function(e,t){return e.cmp(t)>0?e:t},a.min=function(e,t){return e.cmp(t)<0?e:t},a.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=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.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=t;n-=2)i=u(e,t,n)<=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this.strip()},a.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 a=e.length-r,o=a%n,s=Math.min(a,a-o)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var c=["","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"],f=[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],h=[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];function d(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],a=0|t.words[0],o=i*a,s=67108863&o,u=o/67108864|0;r.words[0]=s;for(var l=1;l>>26,f=67108863&u,h=Math.min(l,t.length-1),d=Math.max(0,l-e.length+1);d<=h;d++){var p=l-d|0;c+=(o=(i=0|e.words[p])*(a=0|t.words[d])+f)/67108864|0,f=67108863&o}r.words[l]=0|f,u=0|c}return 0!==u?r.words[l]=0|u:r.length--,r.strip()}a.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,a=0,o=0;o>>24-i&16777215)||o!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(r=a.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 l=f[e],d=h[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(d).toString(e);r=(p=p.idivn(d)).isZero()?g+r:c[l-g.length]+g+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")},a.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},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(e,t){return n(void 0!==o),this.toArrayLike(o,e,t)},a.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},a.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,u="le"===t,l=new e(a),c=this.clone();if(u){for(s=0;!c.isZero();s++)o=c.andln(255),c.iushrn(8),l[s]=o;for(;s=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},a.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},a.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},a.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},a.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},a.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},a.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},a.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},a.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;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(e){return this.clone().inotn(e)},a.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<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},a.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 a=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==a&&o>26,this.words[o]=67108863&t;if(0===a&&o>>13,d=0|o[1],p=8191&d,g=d>>>13,y=0|o[2],m=8191&y,v=y>>>13,b=0|o[3],S=8191&b,w=b>>>13,E=0|o[4],A=8191&E,T=E>>>13,C=0|o[5],I=8191&C,k=C>>>13,B=0|o[6],_=8191&B,P=B>>>13,O=0|o[7],N=8191&O,R=O>>>13,M=0|o[8],L=8191&M,D=M>>>13,F=0|o[9],x=8191&F,U=F>>>13,j=0|s[0],V=8191&j,K=j>>>13,J=0|s[1],H=8191&J,G=J>>>13,z=0|s[2],X=8191&z,q=z>>>13,Y=0|s[3],Q=8191&Y,Z=Y>>>13,W=0|s[4],$=8191&W,ee=W>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],ue=8191&se,le=se>>>13,ce=0|s[8],fe=8191&ce,he=ce>>>13,de=0|s[9],pe=8191&de,ge=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ye=(l+(n=Math.imul(f,V))|0)+((8191&(i=(i=Math.imul(f,K))+Math.imul(h,V)|0))<<13)|0;l=((a=Math.imul(h,K))+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(p,V),i=(i=Math.imul(p,K))+Math.imul(g,V)|0,a=Math.imul(g,K);var me=(l+(n=n+Math.imul(f,H)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(h,H)|0))<<13)|0;l=((a=a+Math.imul(h,G)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,V),i=(i=Math.imul(m,K))+Math.imul(v,V)|0,a=Math.imul(v,K),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(g,H)|0,a=a+Math.imul(g,G)|0;var ve=(l+(n=n+Math.imul(f,X)|0)|0)+((8191&(i=(i=i+Math.imul(f,q)|0)+Math.imul(h,X)|0))<<13)|0;l=((a=a+Math.imul(h,q)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(S,V),i=(i=Math.imul(S,K))+Math.imul(w,V)|0,a=Math.imul(w,K),n=n+Math.imul(m,H)|0,i=(i=i+Math.imul(m,G)|0)+Math.imul(v,H)|0,a=a+Math.imul(v,G)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(g,X)|0,a=a+Math.imul(g,q)|0;var be=(l+(n=n+Math.imul(f,Q)|0)|0)+((8191&(i=(i=i+Math.imul(f,Z)|0)+Math.imul(h,Q)|0))<<13)|0;l=((a=a+Math.imul(h,Z)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(A,V),i=(i=Math.imul(A,K))+Math.imul(T,V)|0,a=Math.imul(T,K),n=n+Math.imul(S,H)|0,i=(i=i+Math.imul(S,G)|0)+Math.imul(w,H)|0,a=a+Math.imul(w,G)|0,n=n+Math.imul(m,X)|0,i=(i=i+Math.imul(m,q)|0)+Math.imul(v,X)|0,a=a+Math.imul(v,q)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,Z)|0)+Math.imul(g,Q)|0,a=a+Math.imul(g,Z)|0;var Se=(l+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(h,$)|0))<<13)|0;l=((a=a+Math.imul(h,ee)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(I,V),i=(i=Math.imul(I,K))+Math.imul(k,V)|0,a=Math.imul(k,K),n=n+Math.imul(A,H)|0,i=(i=i+Math.imul(A,G)|0)+Math.imul(T,H)|0,a=a+Math.imul(T,G)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,q)|0)+Math.imul(w,X)|0,a=a+Math.imul(w,q)|0,n=n+Math.imul(m,Q)|0,i=(i=i+Math.imul(m,Z)|0)+Math.imul(v,Q)|0,a=a+Math.imul(v,Z)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(g,$)|0,a=a+Math.imul(g,ee)|0;var we=(l+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(h,re)|0))<<13)|0;l=((a=a+Math.imul(h,ne)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(_,V),i=(i=Math.imul(_,K))+Math.imul(P,V)|0,a=Math.imul(P,K),n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(k,H)|0,a=a+Math.imul(k,G)|0,n=n+Math.imul(A,X)|0,i=(i=i+Math.imul(A,q)|0)+Math.imul(T,X)|0,a=a+Math.imul(T,q)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,Z)|0)+Math.imul(w,Q)|0,a=a+Math.imul(w,Z)|0,n=n+Math.imul(m,$)|0,i=(i=i+Math.imul(m,ee)|0)+Math.imul(v,$)|0,a=a+Math.imul(v,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(g,re)|0,a=a+Math.imul(g,ne)|0;var Ee=(l+(n=n+Math.imul(f,ae)|0)|0)+((8191&(i=(i=i+Math.imul(f,oe)|0)+Math.imul(h,ae)|0))<<13)|0;l=((a=a+Math.imul(h,oe)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(N,V),i=(i=Math.imul(N,K))+Math.imul(R,V)|0,a=Math.imul(R,K),n=n+Math.imul(_,H)|0,i=(i=i+Math.imul(_,G)|0)+Math.imul(P,H)|0,a=a+Math.imul(P,G)|0,n=n+Math.imul(I,X)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(k,X)|0,a=a+Math.imul(k,q)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,Z)|0)+Math.imul(T,Q)|0,a=a+Math.imul(T,Z)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(w,$)|0,a=a+Math.imul(w,ee)|0,n=n+Math.imul(m,re)|0,i=(i=i+Math.imul(m,ne)|0)+Math.imul(v,re)|0,a=a+Math.imul(v,ne)|0,n=n+Math.imul(p,ae)|0,i=(i=i+Math.imul(p,oe)|0)+Math.imul(g,ae)|0,a=a+Math.imul(g,oe)|0;var Ae=(l+(n=n+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,le)|0)+Math.imul(h,ue)|0))<<13)|0;l=((a=a+Math.imul(h,le)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(L,V),i=(i=Math.imul(L,K))+Math.imul(D,V)|0,a=Math.imul(D,K),n=n+Math.imul(N,H)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(R,H)|0,a=a+Math.imul(R,G)|0,n=n+Math.imul(_,X)|0,i=(i=i+Math.imul(_,q)|0)+Math.imul(P,X)|0,a=a+Math.imul(P,q)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,Z)|0)+Math.imul(k,Q)|0,a=a+Math.imul(k,Z)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(T,$)|0,a=a+Math.imul(T,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(w,re)|0,a=a+Math.imul(w,ne)|0,n=n+Math.imul(m,ae)|0,i=(i=i+Math.imul(m,oe)|0)+Math.imul(v,ae)|0,a=a+Math.imul(v,oe)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(g,ue)|0,a=a+Math.imul(g,le)|0;var Te=(l+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,he)|0)+Math.imul(h,fe)|0))<<13)|0;l=((a=a+Math.imul(h,he)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(x,V),i=(i=Math.imul(x,K))+Math.imul(U,V)|0,a=Math.imul(U,K),n=n+Math.imul(L,H)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(D,H)|0,a=a+Math.imul(D,G)|0,n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,q)|0)+Math.imul(R,X)|0,a=a+Math.imul(R,q)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,Z)|0)+Math.imul(P,Q)|0,a=a+Math.imul(P,Z)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(k,$)|0,a=a+Math.imul(k,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(T,re)|0,a=a+Math.imul(T,ne)|0,n=n+Math.imul(S,ae)|0,i=(i=i+Math.imul(S,oe)|0)+Math.imul(w,ae)|0,a=a+Math.imul(w,oe)|0,n=n+Math.imul(m,ue)|0,i=(i=i+Math.imul(m,le)|0)+Math.imul(v,ue)|0,a=a+Math.imul(v,le)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(g,fe)|0,a=a+Math.imul(g,he)|0;var Ce=(l+(n=n+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ge)|0)+Math.imul(h,pe)|0))<<13)|0;l=((a=a+Math.imul(h,ge)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(x,H),i=(i=Math.imul(x,G))+Math.imul(U,H)|0,a=Math.imul(U,G),n=n+Math.imul(L,X)|0,i=(i=i+Math.imul(L,q)|0)+Math.imul(D,X)|0,a=a+Math.imul(D,q)|0,n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,Z)|0)+Math.imul(R,Q)|0,a=a+Math.imul(R,Z)|0,n=n+Math.imul(_,$)|0,i=(i=i+Math.imul(_,ee)|0)+Math.imul(P,$)|0,a=a+Math.imul(P,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(k,re)|0,a=a+Math.imul(k,ne)|0,n=n+Math.imul(A,ae)|0,i=(i=i+Math.imul(A,oe)|0)+Math.imul(T,ae)|0,a=a+Math.imul(T,oe)|0,n=n+Math.imul(S,ue)|0,i=(i=i+Math.imul(S,le)|0)+Math.imul(w,ue)|0,a=a+Math.imul(w,le)|0,n=n+Math.imul(m,fe)|0,i=(i=i+Math.imul(m,he)|0)+Math.imul(v,fe)|0,a=a+Math.imul(v,he)|0;var Ie=(l+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ge)|0)+Math.imul(g,pe)|0))<<13)|0;l=((a=a+Math.imul(g,ge)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(x,X),i=(i=Math.imul(x,q))+Math.imul(U,X)|0,a=Math.imul(U,q),n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,Z)|0)+Math.imul(D,Q)|0,a=a+Math.imul(D,Z)|0,n=n+Math.imul(N,$)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(R,$)|0,a=a+Math.imul(R,ee)|0,n=n+Math.imul(_,re)|0,i=(i=i+Math.imul(_,ne)|0)+Math.imul(P,re)|0,a=a+Math.imul(P,ne)|0,n=n+Math.imul(I,ae)|0,i=(i=i+Math.imul(I,oe)|0)+Math.imul(k,ae)|0,a=a+Math.imul(k,oe)|0,n=n+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,le)|0)+Math.imul(T,ue)|0,a=a+Math.imul(T,le)|0,n=n+Math.imul(S,fe)|0,i=(i=i+Math.imul(S,he)|0)+Math.imul(w,fe)|0,a=a+Math.imul(w,he)|0;var ke=(l+(n=n+Math.imul(m,pe)|0)|0)+((8191&(i=(i=i+Math.imul(m,ge)|0)+Math.imul(v,pe)|0))<<13)|0;l=((a=a+Math.imul(v,ge)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(x,Q),i=(i=Math.imul(x,Z))+Math.imul(U,Q)|0,a=Math.imul(U,Z),n=n+Math.imul(L,$)|0,i=(i=i+Math.imul(L,ee)|0)+Math.imul(D,$)|0,a=a+Math.imul(D,ee)|0,n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(R,re)|0,a=a+Math.imul(R,ne)|0,n=n+Math.imul(_,ae)|0,i=(i=i+Math.imul(_,oe)|0)+Math.imul(P,ae)|0,a=a+Math.imul(P,oe)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,le)|0)+Math.imul(k,ue)|0,a=a+Math.imul(k,le)|0,n=n+Math.imul(A,fe)|0,i=(i=i+Math.imul(A,he)|0)+Math.imul(T,fe)|0,a=a+Math.imul(T,he)|0;var Be=(l+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,ge)|0)+Math.imul(w,pe)|0))<<13)|0;l=((a=a+Math.imul(w,ge)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(x,$),i=(i=Math.imul(x,ee))+Math.imul(U,$)|0,a=Math.imul(U,ee),n=n+Math.imul(L,re)|0,i=(i=i+Math.imul(L,ne)|0)+Math.imul(D,re)|0,a=a+Math.imul(D,ne)|0,n=n+Math.imul(N,ae)|0,i=(i=i+Math.imul(N,oe)|0)+Math.imul(R,ae)|0,a=a+Math.imul(R,oe)|0,n=n+Math.imul(_,ue)|0,i=(i=i+Math.imul(_,le)|0)+Math.imul(P,ue)|0,a=a+Math.imul(P,le)|0,n=n+Math.imul(I,fe)|0,i=(i=i+Math.imul(I,he)|0)+Math.imul(k,fe)|0,a=a+Math.imul(k,he)|0;var _e=(l+(n=n+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,ge)|0)+Math.imul(T,pe)|0))<<13)|0;l=((a=a+Math.imul(T,ge)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(x,re),i=(i=Math.imul(x,ne))+Math.imul(U,re)|0,a=Math.imul(U,ne),n=n+Math.imul(L,ae)|0,i=(i=i+Math.imul(L,oe)|0)+Math.imul(D,ae)|0,a=a+Math.imul(D,oe)|0,n=n+Math.imul(N,ue)|0,i=(i=i+Math.imul(N,le)|0)+Math.imul(R,ue)|0,a=a+Math.imul(R,le)|0,n=n+Math.imul(_,fe)|0,i=(i=i+Math.imul(_,he)|0)+Math.imul(P,fe)|0,a=a+Math.imul(P,he)|0;var Pe=(l+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ge)|0)+Math.imul(k,pe)|0))<<13)|0;l=((a=a+Math.imul(k,ge)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(x,ae),i=(i=Math.imul(x,oe))+Math.imul(U,ae)|0,a=Math.imul(U,oe),n=n+Math.imul(L,ue)|0,i=(i=i+Math.imul(L,le)|0)+Math.imul(D,ue)|0,a=a+Math.imul(D,le)|0,n=n+Math.imul(N,fe)|0,i=(i=i+Math.imul(N,he)|0)+Math.imul(R,fe)|0,a=a+Math.imul(R,he)|0;var Oe=(l+(n=n+Math.imul(_,pe)|0)|0)+((8191&(i=(i=i+Math.imul(_,ge)|0)+Math.imul(P,pe)|0))<<13)|0;l=((a=a+Math.imul(P,ge)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(x,ue),i=(i=Math.imul(x,le))+Math.imul(U,ue)|0,a=Math.imul(U,le),n=n+Math.imul(L,fe)|0,i=(i=i+Math.imul(L,he)|0)+Math.imul(D,fe)|0,a=a+Math.imul(D,he)|0;var Ne=(l+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,ge)|0)+Math.imul(R,pe)|0))<<13)|0;l=((a=a+Math.imul(R,ge)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(x,fe),i=(i=Math.imul(x,he))+Math.imul(U,fe)|0,a=Math.imul(U,he);var Re=(l+(n=n+Math.imul(L,pe)|0)|0)+((8191&(i=(i=i+Math.imul(L,ge)|0)+Math.imul(D,pe)|0))<<13)|0;l=((a=a+Math.imul(D,ge)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Me=(l+(n=Math.imul(x,pe))|0)+((8191&(i=(i=Math.imul(x,ge))+Math.imul(U,pe)|0))<<13)|0;return l=((a=Math.imul(U,ge))+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,u[0]=ye,u[1]=me,u[2]=ve,u[3]=be,u[4]=Se,u[5]=we,u[6]=Ee,u[7]=Ae,u[8]=Te,u[9]=Ce,u[10]=Ie,u[11]=ke,u[12]=Be,u[13]=_e,u[14]=Pe,u[15]=Oe,u[16]=Ne,u[17]=Re,u[18]=Me,0!==l&&(u[19]=l,r.length++),r};function g(e,t,r){return(new y).mulp(e,t,r)}function y(e,t){this.x=e,this.y=t}Math.imul||(p=d),a.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?p(this,e,t):r<63?d(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,e,t):g(this,e,t)},y.prototype.makeRBT=function(e){for(var t=new Array(e),r=a.prototype._countBits(e)-1,n=0;n>=1;return n},y.prototype.permute=function(e,t,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*t;o>=26,t+=i/67108864|0,t+=a>>>26,this.words[r]=67108863&a}return 0!==t&&(this.words[r]=t,this.length++),this},a.prototype.muln=function(e){return this.clone().imuln(e)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new a(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,l=0;l=0&&(0!==c||l>=i);l--){var f=0|this.words[l];this.words[l]=c<<26-a|f>>>a,c=f&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},a.prototype.shln=function(e){return this.clone().ishln(e)},a.prototype.ushln=function(e){return this.clone().iushln(e)},a.prototype.shrn=function(e){return this.clone().ishrn(e)},a.prototype.ushrn=function(e){return this.clone().iushrn(e)},a.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=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<=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},a.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>26)-(u/67108864|0),this.words[i+r]=67108863&a}for(;i>26,this.words[i+r]=67108863&a;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==t){(s=new a(null)).length=u+1,s.words=new Array(s.length);for(var l=0;l=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(h=Math.min(h/o|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}},a.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:i,mod:o}):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&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new a(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new a(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new a(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,o,s},a.prototype.div=function(e){return this.divmod(e,"div",!1).div},a.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},a.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},a.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),a=r.cmp(n);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},a.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},a.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},a.prototype.divn=function(e){return this.clone().idivn(e)},a.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 a(1),o=new a(0),s=new a(0),u=new a(1),l=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++l;for(var c=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()||o.isOdd())&&(i.iadd(c),o.isub(f)),i.iushrn(1),o.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(c),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),o.isub(u)):(r.isub(t),s.isub(i),u.isub(o))}return{a:s,b:u,gcd:r.iushln(l)}},a.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,o=new a(1),s=new a(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,c=1;0==(t.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(t.iushrn(l);l-- >0;)o.isOdd()&&o.iadd(u),o.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),o.isub(s)):(r.isub(t),s.isub(o))}return(i=0===t.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(e),i},a.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 a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},a.prototype.invm=function(e){return this.egcd(e).a.umod(e)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(e){return this.words[0]&e},a.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.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:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},a.prototype.gtn=function(e){return 1===this.cmpn(e)},a.prototype.gt=function(e){return 1===this.cmp(e)},a.prototype.gten=function(e){return this.cmpn(e)>=0},a.prototype.gte=function(e){return this.cmp(e)>=0},a.prototype.ltn=function(e){return-1===this.cmpn(e)},a.prototype.lt=function(e){return-1===this.cmp(e)},a.prototype.lten=function(e){return this.cmpn(e)<=0},a.prototype.lte=function(e){return this.cmp(e)<=0},a.prototype.eqn=function(e){return 0===this.cmpn(e)},a.prototype.eq=function(e){return 0===this.cmp(e)},a.red=function(e){return new A(e)},a.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)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(e){return this.red=e,this},a.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},a.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},a.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},a.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},a.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},a.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},a.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},a.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new a(t,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"==typeof e){var t=a._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 T(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new a(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.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=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},i(b,v),b.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=a}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},a._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new S;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return m[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):e.umod(this.m)._forceRed(this)},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 a(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),u=s.redNeg(),l=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new a(2*c*c).toRed(this);0!==this.pow(c,l).cmp(u);)c.redIAdd(u);for(var f=this.pow(c,i),h=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=o;0!==d.cmp(s);){for(var g=d,y=0;0!==g.cmp(s);y++)g=g.redSqr();n(y=0;n--){for(var l=t.words[n],c=u-1;c>=0;c--){var f=l>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4===++s||0===n&&0===c)&&(i=this.mul(i,r[o]),s=0,o=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},a.mont=function(e){return new T(e)},i(T,A),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.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),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)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new a(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),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)},T.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(75)(e))},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));const n="random/5.4.0"},,,function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(15);t.default=function(e){var t=n.base58Decode(e),r=t.slice(2,t.byteLength-4);return"0x"+n.base16Encode(r)}},function(e,t,r){"use strict";t.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,n=l(e),o=n[0],s=n[1],u=new a(function(e,t,r){return 3*(t+r)/4-r}(0,o,s)),c=0,f=s>0?o-4:o;for(r=0;r>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===s&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[c++]=255&t),1===s&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,a=[],o=0,s=r-i;os?s:o+16383));return 1===i?(t=e[r-1],a.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],a.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),a.join("")};for(var n=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=o.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,r){for(var i,a,o=[],s=t;s>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,r,n,i){var a,o,s=8*i-n-1,u=(1<>1,c=-7,f=r?i-1:0,h=r?-1:1,d=e[t+f];for(f+=h,a=d&(1<<-c)-1,d>>=-c,c+=s;c>0;a=256*a+e[t+f],f+=h,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+e[t+f],f+=h,c-=8);if(0===a)a=1-l;else{if(a===u)return o?NaN:1/0*(d?-1:1);o+=Math.pow(2,n),a-=l}return(d?-1:1)*o*Math.pow(2,a-n)},t.write=function(e,t,r,n,i,a){var o,s,u,l=8*a-i-1,c=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:a-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(o++,u/=2),o+f>=c?(s=0,o=c):o+f>=1?(s=(t*u-1)*Math.pow(2,i),o+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(o=o<0;e[r+d]=255&o,d+=p,o/=256,l-=8);e[r+d-p]|=128*g}},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var n,i,a,o,s,u=1,l={},c=!1,f=e.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(e);h=h&&h.setTimeout?h:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick((function(){p(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?(o="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&p(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),n=function(t){e.postMessage(o+t,"*")}):e.MessageChannel?((a=new MessageChannel).port1.onmessage=function(e){p(e.data)},n=function(e){a.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(i=f.documentElement,n=function(e){var t=f.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):n=function(e){setTimeout(p,0,e)},h.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r0;)s.push(l%a),l=l/a|0}for(i=0;0===e[i]&&i=0;--i)n+=t[s[i]]}else n=function(e,t){var r=0,n=t.length,i=t.charAt(0),a=[0];for(r=0;r0;)a.push(s%n),s=s/n|0}var u="";for(r=0;0===e.at(r)&&r=0;--r)u+=t[a[r]];return u}(e,t);if(r){var c=new RegExp(".{1,"+r+"}","g");n=n.match(c).join("\r\n")}return n},r.decode=function(e,r){if("string"!=typeof e)throw new TypeError('"input" must be a string.');if("string"!=typeof r)throw new TypeError('"alphabet" must be a string.');var i=n[r];if(!i){i=n[r]=[];for(var a=0;a>=8;for(;f>0;)u.push(255&f),f>>=8}for(var h=0;e[h]===s&&h=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 l(e){var t=null,r=n.util.globalScope,i=r.crypto||r.msCrypto;i&&i.getRandomValues&&(t=function(e){return i.getRandomValues(e)});var a=n.util.createBuffer();if(t)for(;a.length()>16)))<<16,h=4294967295&(c=(2147483647&(c+=l>>15))+(c>>31)),u=0;u<3;++u)f=h>>>(u<<3),f^=Math.floor(256*Math.random()),a.putByte(String.fromCharCode(255&f));return a.getBytes(e)}return t.pools=a,t.pool=0,t.generate=function(e,r){if(!r)return t.generateSync(e);var i=t.plugin.cipher,a=t.plugin.increment,o=t.plugin.formatKey,s=t.plugin.formatSeed,l=n.util.createBuffer();t.key=null,function c(f){if(f)return r(f);if(l.length()>=e)return r(null,l.getBytes(e));if(t.generated>1048575&&(t.key=null),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()}))}(c)}));var h=i(t.key,t.seed);t.generated+=h.length,l.putBytes(h),t.key=o(i(t.key,a(t.seed))),t.seed=s(i(t.key,t.seed)),n.util.setImmediate(c)}()},t.generateSync=function(e){var r=t.plugin.cipher,i=t.plugin.increment,a=t.plugin.formatKey,o=t.plugin.formatSeed;t.key=null;for(var u=n.util.createBuffer();u.length()1048575&&(t.key=null),null===t.key&&s();var l=r(t.key,t.seed);t.generated+=l.length,u.putBytes(l),t.key=a(r(t.key,i(t.seed))),t.seed=o(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,l(e))}catch(e){t(e)}},t.seedFileSync=l),t.collect=function(e){for(var r=e.length,n=0;n>i&255);t.collect(n)},t.registerWorker=function(e){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}}})}: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}}).call(this,r(25))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",i=n.split("").reduce((function(e,t,r){return e[t]=r,e}),{});t.default={encode:function(e){if(!e.length)return"";for(var t=[0],r=0;r>8,t[a]&=255;for(;o;)t.push(255&o),o>>=8}for(r=0;"1"===e[r]&&r>6,128|63&n):n<55296||n>=57344?t.push(224|n>>12,128|n>>6&63,128|63&n):(r++,n=65536+((1023&n)<<10|1023&e.charCodeAt(r)),t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return Uint8Array.from(t)}},function(e,t,r){"use strict";t.__esModule=!0;for(var n="0123456789abcdef".split(""),i=[0,8,16,24],a=[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],o=[224,256,384,512],s=["hex","buffer","arrayBuffer","array"],u=function(e,t,r){return function(n){return new b(e,t,e).update(n)[r]()}},l=function(e,t,r){return function(n,i){return new b(e,t,i).update(n)[r]()}},c=function(e,t){var r=u(e,t,"hex");r.create=function(){return new b(e,t,e)},r.update=function(e){return r.create().update(e)};for(var n=0;n>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}b.prototype.update=function(e){var t="string"!=typeof e;t&&e.constructor===ArrayBuffer&&(e=new Uint8Array(e));for(var r,n,a=e.length,o=this.blocks,s=this.byteCount,u=this.blockCount,l=0,c=this.s;l>2]|=e[l]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(o[r>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=s){for(this.start=r-s,this.block=o[u],r=0;r>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>4&15]+n[15&e]+n[e>>12&15]+n[e>>8&15]+n[e>>20&15]+n[e>>16&15]+n[e>>28&15]+n[e>>24&15];s%t==0&&(S(r),o=0)}return a&&(e=r[o],a>0&&(u+=n[e>>4&15]+n[15&e]),a>1&&(u+=n[e>>12&15]+n[e>>8&15]),a>2&&(u+=n[e>>20&15]+n[e>>16&15])),u},b.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,a=0,o=0,s=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(e);o>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;s%r==0&&S(n)}return a&&(e=s<<2,t=n[o],a>0&&(u[e]=255&t),a>1&&(u[e+1]=t>>8&255),a>2&&(u[e+2]=t>>16&255)),u};var S=function(e){var t,r,n,i,o,s,u,l,c,f,h,d,p,g,y,m,v,b,S,w,E,A,T,C,I,k,B,_,P,O,N,R,M,L,D,F,x,U,j,V,K,J,H,G,z,X,q,Y,Q,Z,W,$,ee,te,re,ne,ie,ae,oe,se,ue,le,ce;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],s=e[2]^e[12]^e[22]^e[32]^e[42],u=e[3]^e[13]^e[23]^e[33]^e[43],l=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],f=e[6]^e[16]^e[26]^e[36]^e[46],h=e[7]^e[17]^e[27]^e[37]^e[47],t=(d=e[8]^e[18]^e[28]^e[38]^e[48])^(s<<1|u>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(u<<1|s>>>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^(l<<1|c>>>31),r=o^(c<<1|l>>>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=s^(f<<1|h>>>31),r=u^(h<<1|f>>>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=l^(d<<1|p>>>31),r=c^(p<<1|d>>>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=f^(i<<1|o>>>31),r=h^(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,g=e[0],y=e[1],X=e[11]<<4|e[10]>>>28,q=e[10]<<4|e[11]>>>28,_=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,J=e[40]<<18|e[41]>>>14,H=e[41]<<18|e[40]>>>14,L=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,m=e[13]<<12|e[12]>>>20,v=e[12]<<12|e[13]>>>20,Y=e[22]<<10|e[23]>>>22,Q=e[23]<<10|e[22]>>>22,O=e[33]<<13|e[32]>>>19,N=e[32]<<13|e[33]>>>19,le=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,F=e[14]<<6|e[15]>>>26,x=e[15]<<6|e[14]>>>26,b=e[25]<<11|e[24]>>>21,S=e[24]<<11|e[25]>>>21,Z=e[34]<<15|e[35]>>>17,W=e[35]<<15|e[34]>>>17,R=e[45]<<29|e[44]>>>3,M=e[44]<<29|e[45]>>>3,C=e[6]<<28|e[7]>>>4,I=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,U=e[26]<<25|e[27]>>>7,j=e[27]<<25|e[26]>>>7,w=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,G=e[8]<<27|e[9]>>>5,z=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,B=e[19]<<20|e[18]>>>12,ae=e[29]<<7|e[28]>>>25,oe=e[28]<<7|e[29]>>>25,V=e[38]<<8|e[39]>>>24,K=e[39]<<8|e[38]>>>24,A=e[48]<<14|e[49]>>>18,T=e[49]<<14|e[48]>>>18,e[0]=g^~m&b,e[1]=y^~v&S,e[10]=C^~k&_,e[11]=I^~B&P,e[20]=L^~F&U,e[21]=D^~x&j,e[30]=G^~X&Y,e[31]=z^~q&Q,e[40]=te^~ne&ae,e[41]=re^~ie&oe,e[2]=m^~b&w,e[3]=v^~S&E,e[12]=k^~_&O,e[13]=B^~P&N,e[22]=F^~U&V,e[23]=x^~j&K,e[32]=X^~Y&Z,e[33]=q^~Q&W,e[42]=ne^~ae&se,e[43]=ie^~oe&ue,e[4]=b^~w&A,e[5]=S^~E&T,e[14]=_^~O&R,e[15]=P^~N&M,e[24]=U^~V&J,e[25]=j^~K&H,e[34]=Y^~Z&$,e[35]=Q^~W&ee,e[44]=ae^~se&le,e[45]=oe^~ue&ce,e[6]=w^~A&g,e[7]=E^~T&y,e[16]=O^~R&C,e[17]=N^~M&I,e[26]=V^~J&L,e[27]=K^~H&D,e[36]=Z^~$&G,e[37]=W^~ee&z,e[46]=se^~le&te,e[47]=ue^~ce&re,e[8]=A^~g&m,e[9]=T^~y&v,e[18]=R^~C&k,e[19]=M^~I&B,e[28]=J^~L&F,e[29]=H^~D&x,e[38]=$^~G&X,e[39]=ee^~z&q,e[48]=le^~te&ne,e[49]=ce^~re&ie,e[0]^=a[n],e[1]^=a[n+1]};t.keccak256=h.keccak_256},function(e,t,r){"use strict";(function(e){function r(e,t,r){var n=e[t]+e[r],i=e[t+1]+e[r+1];n>=4294967296&&i++,e[t]=n,e[t+1]=i}function n(e,t,r,n){var i=e[t]+r;r<0&&(i+=4294967296);var a=e[t+1]+n;i>=4294967296&&a++,e[t]=i,e[t+1]=a}function i(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function a(e,t,i,a,o,s){var c=l[o],f=l[o+1],h=l[s],d=l[s+1];r(u,e,t),n(u,e,c,f);var p=u[a]^u[e],g=u[a+1]^u[e+1];u[a]=g,u[a+1]=p,r(u,i,a),p=u[t]^u[i],g=u[t+1]^u[i+1],u[t]=p>>>24^g<<8,u[t+1]=g>>>24^p<<8,r(u,e,t),n(u,e,h,d),p=u[a]^u[e],g=u[a+1]^u[e+1],u[a]=p>>>16^g<<16,u[a+1]=g>>>16^p<<16,r(u,i,a),p=u[t]^u[i],g=u[t+1]^u[i+1],u[t]=g>>>31^p<<1,u[t+1]=p>>>31^g<<1}t.__esModule=!0;var o=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),s=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map((function(e){return 2*e}))),u=new Uint32Array(32),l=new Uint32Array(32);function c(e,t){var r=0;for(r=0;r<16;r++)u[r]=e.h[r],u[r+16]=o[r];for(u[24]=u[24]^e.t,u[25]=u[25]^e.t/4294967296,t&&(u[28]=~u[28],u[29]=~u[29]),r=0;r<32;r++)l[r]=i(e.b,4*r);for(r=0;r<12;r++)a(0,8,16,24,s[16*r+0],s[16*r+1]),a(2,10,18,26,s[16*r+2],s[16*r+3]),a(4,12,20,28,s[16*r+4],s[16*r+5]),a(6,14,22,30,s[16*r+6],s[16*r+7]),a(0,10,20,30,s[16*r+8],s[16*r+9]),a(2,12,22,24,s[16*r+10],s[16*r+11]),a(4,14,16,26,s[16*r+12],s[16*r+13]),a(6,8,18,28,s[16*r+14],s[16*r+15]);for(r=0;r<16;r++)e.h[r]=e.h[r]^u[r]^u[r+16]}function f(e,t){if(0===e||e>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(t&&t.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");for(var r={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:e},n=0;n<16;n++)r.h[n]=o[n];var i=t?t.length:0;return r.h[0]^=16842752^i<<8^e,t&&(h(r,t),r.c=128),r}function h(e,t){for(var r=0;r>2]>>8*(3&r);return t}function p(t,r,n){n=n||64,t=function(t){var r;if(t instanceof Uint8Array)r=t;else if(t instanceof e)r=new Uint8Array(t);else{if("string"!=typeof t)throw new Error("Input must be an string, Buffer or Uint8Array");r=new Uint8Array(e.from(t,"utf8"))}return r}(t);var i=f(n,r);return h(i,t),d(i)}t.blake2bInit=f,t.blake2bUpdate=h,t.blake2bFinal=d,t.blake2b=p,t.blake2bHex=function(e,t,r){var n;return n=p(e,t,r),Array.prototype.map.call(n,(function(e){return(e<16?"0":"")+e.toString(16)})).join("")}}).call(this,r(24).Buffer)},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(35)),a=r(14),o=r(44),s=r(43),u=r(33);t.signBytes=function(e,t,r){return i.default.sign(a._fromIn(o.isPrivateKey(e)?e.privateKey:s.privateKey(e)),a._fromIn(t),a._fromIn(r||u.randomBytes(64)))}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(27),a=r(58),o=r(14),s=r(19),u=r(43),l=n(r(35));t.verifyAddress=function(e,t){var r=t?t.chainId:void 0;try{var n=o._fromIn(e);if(1!=n[0]||r&&n[1]!=a.ChaidId.toNumber(r))return!1;for(var i=n.slice(0,22),l=n.slice(22,26),c=s._hashChain(i).slice(0,4),f=0;f<4;f++)if(l[f]!=c[f])return!1;if(t&&t.publicKey){var h=u.address({publicKey:t.publicKey},r);if(n.length!==h.length)return!1;for(f=0;f0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]>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,a=e,o=e.length(),s=t,u=Math.ceil(s/8),l=255>>(7&s);for(r=o;r<128;r++)a.putByte(i[a.at(r-1)+a.at(r-o)&255]);for(a.setAt(128-u,i[a.at(128-u)&l]),r=127-u;r>=0;r--)a.setAt(r,i[a.at(r+1)^a.at(r+u)]);return a};var u=function(e,t,r){var i,u,l,c,f=!1,h=null,d=null,p=null,g=[];for(e=n.rc2.expandKey(e,t),l=0;l<64;l++)g.push(e.getInt16Le());r?(i=function(e){for(l=0;l<4;l++)e[l]+=g[c]+(e[(l+3)%4]&e[(l+2)%4])+(~e[(l+3)%4]&e[(l+1)%4]),e[l]=o(e[l],a[l]),c++},u=function(e){for(l=0;l<4;l++)e[l]+=g[63&e[(l+3)%4]]}):(i=function(e){for(l=3;l>=0;l--)e[l]=s(e[l],a[l]),e[l]-=g[c]+(e[(l+3)%4]&e[(l+2)%4])+(~e[(l+3)%4]&e[(l+1)%4]),c--},u=function(e){for(l=3;l>=0;l--)e[l]-=g[63&e[(l+3)%4]]});var y=function(e){var t=[];for(l=0;l<4;l++){var n=h.getInt16Le();null!==p&&(r?n^=p.getInt16Le():p.putInt16Le(n)),t.push(65535&n)}c=r?0:63;for(var i=0;i=8;)y([[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,m.update()),!r&&(t=0===h.length()))if(e)t=e(8,d,!r);else{var i=d.length(),a=d.at(i-1);a>i?t=!1:d.truncate(a)}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)}},function(e,t,r){var n=r(3);r(4),r(18),r(63);var i=e.exports=n.pkcs1=n.pkcs1||{};function a(e,t,r){r||(r=n.md.sha1.create());for(var i="",a=Math.ceil(t/r.digestLength),o=0;o>24&255,o>>16&255,o>>8&255,255&o);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,o,s,u;"string"==typeof r?(i=r,o=arguments[3]||void 0,s=arguments[4]||void 0):r&&(i=r.label||void 0,o=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 l=Math.ceil(e.n.bitLength()/8),c=l-2*s.digestLength-2;if(t.length>c)throw(g=new Error("RSAES-OAEP input message length is too long.")).length=t.length,g.maxLength=c,g;i||(i=""),s.update(i,"raw");for(var f=s.digest(),h="",d=c-t.length,p=0;pe&&(o=u(e,t));var d=o.toString(16);i.target.postMessage({hex:d,workLoad:c}),o.dAddOffset(f,0)}}}d()}(e,t,i,a):s(e,t,i,a)}(e,l,a.options,i);throw new Error("Invalid prime generation algorithm: "+a.name)}}function s(e,t,r,a){var o=u(e,t),s=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}(o.bitLength());"millerRabinTests"in r&&(s=r.millerRabinTests);var l=10;"maxBlockTime"in r&&(l=r.maxBlockTime),function e(t,r,a,o,s,l,c){var f=+new Date;do{if(t.bitLength()>r&&(t=u(r,a)),t.isProbablePrime(s))return c(null,t);t.dAddOffset(i[o++%8],0)}while(l<0||+new Date-f=0&&i.push(s):i.push(s))}return i}function d(e){if(e.composed||e.constructed){for(var t=n.util.createBuffer(),r=0;r0&&(u=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,f));var h=[],d=[];null!==t&&(d=n.util.isArray(t)?t:[t]);for(var p=[],g=0;g0){var b=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,p),S=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(b).getBytes())])]);h.push(S)}var w=null;if(null!==e){var E=a.wrapRsaPrivateKey(a.privateKeyToAsn1(e));w=null===r?i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.keyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[E]),u]):i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.pkcs8ShroudedKeyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[a.encryptPrivateKeyInfo(E,r,s)]),u]);var A=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[w]),T=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(A).getBytes())])]);h.push(T)}var C,I=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,h);if(s.useMac){var k=n.md.sha1.create(),B=new n.util.ByteBuffer(n.random.getBytes(s.saltSize)),_=s.count,P=(e=o.generateKey(r,B,3,_,20),n.hmac.create());P.start(k,e),P.update(i.toDer(I).getBytes());var O=P.getMac();C=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.sha1).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,O.getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,B.getBytes()),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(_).getBytes())])}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(3).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(I).getBytes())])]),C])},o.generateKey=n.pbe.generatePkcs12Key},function(e,t,r){var n=r(3);r(20),r(4);var i=n.asn1,a=e.exports=n.pkcs7asn1=n.pkcs7asn1||{};n.pkcs7=n.pkcs7||{},n.pkcs7.asn1=a;var o={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};a.contentInfoValidator=o;var s={name:"EncryptedContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};a.envelopedDataValidator={name:"EnvelopedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(s)},a.encryptedDataValidator={name:"EncryptedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"}].concat(s)};var u={name:"SignerInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};a.signedDataValidator={name:"SignedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},o,{name:"SignedData.Certificates",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,capture:"signerInfos",optional:!0,value:[u]}]},a.recipientInfoValidator={name:"RecipientInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter"}]},{name:"RecipientInfo.encryptedKey",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}},function(e,t,r){var n=r(3);r(108),e.exports=n.mgf=n.mgf||{},n.mgf.mgf1=n.mgf1},function(e,t,r){var n=r(3);r(4),n.mgf=n.mgf||{},(e.exports=n.mgf.mgf1=n.mgf1=n.mgf1||{}).create=function(e){return{generate:function(t,r){for(var i=new n.util.ByteBuffer,a=Math.ceil(r/e.digestLength),o=0;o>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 F(e,t,r){D.call(this,e,t,r)}D.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(o);if(null===e)throw new Error(o);if(h&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||h&&ArrayBuffer.isView(e)))throw new Error(o);t=!0}for(var n,i,a=this.blocks,s=this.byteCount,u=e.length,l=this.blockCount,c=0,f=this.s;c>2]|=e[c]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(a[n>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=s){for(this.start=n-s,this.block=a[l],n=0;n>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},D.prototype.encodeString=function(e){var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(o);if(null===e)throw new Error(o);if(h&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||h&&ArrayBuffer.isView(e)))throw new Error(o);t=!0}var n=0,i=e.length;if(t)n=i;else for(var a=0;a=57344?n+=3:(s=65536+((1023&s)<<10|1023&e.charCodeAt(++a)),n+=4)}return n+=this.encode(8*n),this.update(e),n},D.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>4&15]+d[15&e]+d[e>>12&15]+d[e>>8&15]+d[e>>20&15]+d[e>>16&15]+d[e>>28&15]+d[e>>24&15];o%t==0&&(x(r),a=0)}return i&&(e=r[a],s+=d[e>>4&15]+d[15&e],i>1&&(s+=d[e>>12&15]+d[e>>8&15]),i>2&&(s+=d[e>>20&15]+d[e>>16&15])),s},D.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,a=0,o=0,s=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(e);o>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;s%r==0&&x(n)}return a&&(e=s<<2,t=n[o],u[e]=255&t,a>1&&(u[e+1]=t>>8&255),a>2&&(u[e+2]=t>>16&255)),u},F.prototype=new D,F.prototype.finalize=function(){return this.encode(this.outputBits,!0),D.prototype.finalize.call(this)};var x=function(e){var t,r,n,i,a,o,s,u,l,c,f,h,d,p,g,m,v,b,S,w,E,A,T,C,I,k,B,_,P,O,N,R,M,L,D,F,x,U,j,V,K,J,H,G,z,X,q,Y,Q,Z,W,$,ee,te,re,ne,ie,ae,oe,se,ue,le,ce;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],a=e[1]^e[11]^e[21]^e[31]^e[41],o=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],l=e[5]^e[15]^e[25]^e[35]^e[45],c=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])^(o<<1|s>>>31),r=(d=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|o>>>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|l>>>31),r=a^(l<<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=o^(c<<1|f>>>31),r=s^(f<<1|c>>>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=l^(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=c^(i<<1|a>>>31),r=f^(a<<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,p=e[0],g=e[1],X=e[11]<<4|e[10]>>>28,q=e[10]<<4|e[11]>>>28,_=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,J=e[40]<<18|e[41]>>>14,H=e[41]<<18|e[40]>>>14,L=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,m=e[13]<<12|e[12]>>>20,v=e[12]<<12|e[13]>>>20,Y=e[22]<<10|e[23]>>>22,Q=e[23]<<10|e[22]>>>22,O=e[33]<<13|e[32]>>>19,N=e[32]<<13|e[33]>>>19,le=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,F=e[14]<<6|e[15]>>>26,x=e[15]<<6|e[14]>>>26,b=e[25]<<11|e[24]>>>21,S=e[24]<<11|e[25]>>>21,Z=e[34]<<15|e[35]>>>17,W=e[35]<<15|e[34]>>>17,R=e[45]<<29|e[44]>>>3,M=e[44]<<29|e[45]>>>3,C=e[6]<<28|e[7]>>>4,I=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,U=e[26]<<25|e[27]>>>7,j=e[27]<<25|e[26]>>>7,w=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,G=e[8]<<27|e[9]>>>5,z=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,B=e[19]<<20|e[18]>>>12,ae=e[29]<<7|e[28]>>>25,oe=e[28]<<7|e[29]>>>25,V=e[38]<<8|e[39]>>>24,K=e[39]<<8|e[38]>>>24,A=e[48]<<14|e[49]>>>18,T=e[49]<<14|e[48]>>>18,e[0]=p^~m&b,e[1]=g^~v&S,e[10]=C^~k&_,e[11]=I^~B&P,e[20]=L^~F&U,e[21]=D^~x&j,e[30]=G^~X&Y,e[31]=z^~q&Q,e[40]=te^~ne&ae,e[41]=re^~ie&oe,e[2]=m^~b&w,e[3]=v^~S&E,e[12]=k^~_&O,e[13]=B^~P&N,e[22]=F^~U&V,e[23]=x^~j&K,e[32]=X^~Y&Z,e[33]=q^~Q&W,e[42]=ne^~ae&se,e[43]=ie^~oe&ue,e[4]=b^~w&A,e[5]=S^~E&T,e[14]=_^~O&R,e[15]=P^~N&M,e[24]=U^~V&J,e[25]=j^~K&H,e[34]=Y^~Z&$,e[35]=Q^~W&ee,e[44]=ae^~se&le,e[45]=oe^~ue&ce,e[6]=w^~A&p,e[7]=E^~T&g,e[16]=O^~R&C,e[17]=N^~M&I,e[26]=V^~J&L,e[27]=K^~H&D,e[36]=Z^~$&G,e[37]=W^~ee&z,e[46]=se^~le&te,e[47]=ue^~ce&re,e[8]=A^~p&m,e[9]=T^~g&v,e[18]=R^~C&k,e[19]=M^~I&B,e[28]=J^~L&F,e[29]=H^~D&x,e[38]=$^~G&X,e[39]=ee^~z&q,e[48]=le^~te&ne,e[49]=ce^~re&ie,e[0]^=y[n],e[1]^=y[n+1]};if(c)e.exports=B;else{for(P=0;P<_.length;++P)u[_[P]]=B[_[P]];f&&(void 0===(a=function(){return B}.call(t,r,t,e))||(e.exports=a))}}()}).call(this,r(25),r(17))},function(e,t){(function(t){e.exports=t}).call(this,{})},function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var i=r(13),a=n(r(66)),o=r(26),s=r(56),u=r(34),l=r(19),c=r(33);function f(e,t){for(void 0===t&&(t=5e3);t--;){var r=i.stringToBytes(e);e=u.base16Encode(l.sha256(r))}return e}function h(e,t,r){void 0===r&&(r=48);for(var n=i.bytesToString(o.concat(e,t),"raw"),s="",u=s;u.length0)&&!(n=a.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o};Object.defineProperty(t,"__esModule",{value:!0});var i=r(19),a=r(26);t.merkleVerify=function(e,t,r){var o=Uint8Array.from([0]),s=Uint8Array.from([1]);if(32!==e.length)throw new Error("Failed to parse merkleProof: Invalid rootHash length");for(var u=i.blake2b(a.concat(o,r)),l=[],c=t.map((function(e){return e}));c.length>0;){var f=0===c[0]?"L":"R",h=c[1];if(h<1)throw new Error("Failed to parse merkleProof: Wrong hash size");var d=c.slice(2,2+h);l.push([f,d]),c=c.slice(2+h)}return l.reduce((function(e,t){var r=n(t,2),o=r[0],u=r[1];return i.blake2b(a.concat(s,"R"===o?a.concat(u,e):a.concat(e,u)))}),u).every((function(t,r){return t===e[r]}))}},function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o},i=this&&this.__spread||function(){for(var e=[],t=0;t0?1:0;return(i.chain?function(e,t,r){return new Promise((function(n,i){var o=t.slice().reverse(),u=[],l=function(){if(!o.length)return n(u),null;var t=o.pop();a.broadcast(e,t).then((function(t){return s.default(e,t,r)})).then((function(e){u.push(e),l()}),i)};l()}))}(e,o.toArray(t),n(n({},i),{confirmations:c})):function(e,t){return Promise.all(t.map((function(t){return a.broadcast(e,t)})))}(e,o.toArray(t))).then((function(t){return i.confirmations<=0?t:s.default(e,t,i)})).then((function(e){return l?o.head(e):e}))}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(29),a=n(r(72));t.default=function(e,t,r,n){return i.fetchTransactions(e,t,r,n).then((function(t){return a.default(e,t).then((function(e){return{transactions:t,assets:e}}))}))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(70),i=r(48),a=r(10);t.default=function(e,t,r){return i.fetchAssetsBalance(e,t).then(a.pipe(a.prop("balances"),a.filter(function(e){return function(t){return t.minSponsoredAssetFee&&n.BigNumber.toBigNumber(t.sponsorBalance||0).gte(e)&&n.BigNumber.toBigNumber(e).div(.001*Math.pow(10,8)).mul(t.minSponsoredAssetFee).lte(t.balance)||!1}}(r)),a.map(function(e){var t=n.BigNumber.toBigNumber(e).div(.001*Math.pow(10,8));return function(r){return{assetId:r.assetId,wavesFee:e,assetFee:n.BigNumber.toBigNumber(r.minSponsoredAssetFee).mul(t).toFixed()}}}(r))))}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(74));t.default=function(e){return i.default(e).then((function(e){return String.fromCharCode(e)}))}},function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o},i=this&&this.__spread||function(){for(var e=[],t=0;t=r?Promise.resolve(t):a.fetchTransactions(s._base,s.address,t.length+100).then((function(r){if(t.length===r.length)return t;var a=e._groupByHeight(r),s=o.keys(a).map(Number).sort((function(e,t){return t-e})),c=n(s,2),f=c[0],h=c[1];return f===u&&h?i(a[f],[a[h][0]]):l(r)}))};return l([t])},e.prototype._addTimeout=function(){var e=this;this._timer=setTimeout((function(){e._run()}),this._interval)},e._groupByHeight=function(e){return e.reduce((function(e,t){return e[t.height]?e[t.height].push(t):e[t.height]=[t],e}),Object.create(null))},e._getTransactionsToDispatch=function(e,t,r){for(var n=[],i=0;i{"use strict";var e={660:(e,t)=>{t.__esModule=!0,t.EventEmitter=void 0;var r=function(){function e(e){this._events=Object.create(null),this.catchHandler=e||function(){}}return e.prototype.hasListeners=function(e){return!(!this._events[e]||!this._events[e].length)},e.prototype.getActiveEvents=function(){var e=this;return Object.keys(this._events).filter((function(t){return e.hasListeners(t)}))},e.prototype.trigger=function(e,t){var r=this;this._events[e]&&(this._events[e].slice().forEach((function(n){try{n.handler.call(n.context,t)}catch(e){r.catchHandler(e)}n.once&&r.off(e,n.handler)})),this._events[e].length||delete this._events[e])},e.prototype.on=function(e,t,r){this._on(e,t,r,!1)},e.prototype.once=function(e,t,r){this._on(e,t,r,!0)},e.prototype.off=function(e,t){var r=this,n="string"==typeof e?e:null,i="function"==typeof t?t:"function"==typeof e?e:null;if(n)if(i){if(n in this._events){var a=this._events[n].map((function(e){return e.handler})).indexOf(i);this._events[n].splice(a,1)}}else delete this._events[n];else Object.keys(this._events).forEach((function(e){r.off(e,i)}))},e.prototype._on=function(e,t,r,n){this._events[e]||(this._events[e]=[]),this._events[e].push({handler:t,context:r,once:n})},e}();t.EventEmitter=r},607:function(e,t,r){var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};t.__esModule=!0;var a=r(660);i(r(660),t),t.default=a.EventEmitter}},t={};return function r(n){if(t[n])return t[n].exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}(607)})()},function(e,t){},function(e,t){"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}}},function(e,t,r){"use strict";t.sha1=r(139),t.sha224=r(140),t.sha256=r(77),t.sha384=r(141),t.sha512=r(78)},function(e,t,r){"use strict";var n=r(11),i=r(31),a=r(76),o=n.rotl32,s=n.sum32,u=n.sum32_5,l=a.ft_1,c=i.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function h(){if(!(this instanceof h))return new h;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(h,c),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(;nthis.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t"0x"+Object(h.bytesToHex)(e),p=e=>JSON.parse(JSON.stringify(e)),g={chainId:"0x"+87..toString(16),chainName:"Waves",nativeCurrency:{name:"WAVES",symbol:"WAVES",decimals:18},rpcUrls:["https://nodes.wavesnodes.com/eth"],blockExplorerUrls:["https://wavesexplorer.com"]},y={chainId:"0x"+83..toString(16),chainName:"Waves stagenet",nativeCurrency:{name:"WAVES",symbol:"WAVES",decimals:18},rpcUrls:["https://nodes-stagenet.wavesnodes.com/eth"],blockExplorerUrls:["https://wavesexplorer.com/?network=stagenet"]},m={chainId:"0x"+84..toString(16),chainName:"Waves testnet",nativeCurrency:{name:"WAVES",symbol:"WAVES",decimals:18},rpcUrls:["https://nodes-testnet.wavesnodes.com/eth"],blockExplorerUrls:["https://wavesexplorer.com/?network=testnet"]};var v,b,S,w,E=r(15);!function(e){e.BINARY="binary",e.BOOLEAN="boolean",e.INTEGER="integer",e.STRING="string"}(v||(v={})),function(e){e.ADDRESS="address",e.BOOL="bool",e.BYTES="bytes",e.INT_32="int32",e.INT_64="int64",e.STRING="string",e.TUPLE="tuple",e.UINT_256="uint256",e.LIST_INT_64="int64[]",e.LIST_STRING="string[]",e.LIST_BYTES="bytes[]",e.LIST_BOOL="bool[]",e.LIST_TUPLE="tuple[]"}(b||(b={})),function(e){e[e.REJECT_REQUEST=4001]="REJECT_REQUEST",e[e.CHAIN_NOT_ADDED=4902]="CHAIN_NOT_ADDED"}(S||(S={})),function(e){e.ASSET_DECIMALS="ASSET_DECIMALS",e.FIXED_DECIMALS="FIXED_DECIMALS"}(w||(w={}));const A=e=>{switch(e){case b.BOOL:return v.BOOLEAN;case b.BYTES:return v.BINARY;case b.INT_64:return v.INTEGER;case b.STRING:return v.STRING;default:throw"Invalid abiType"}},T=e=>{switch(e){case v.BOOLEAN:return b.BOOL;case v.BINARY:return b.BYTES;case v.INTEGER:return b.INT_64;case v.STRING:return b.STRING;default:throw"Invalid dataType"}},C=[{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"success",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],I=(e,t)=>{const r=p(_),n=p(e),i=(e=>{const t={};for(let r=0;r({name:e.key,type:T(e.type)}))))},domain:Object.assign(Object.assign({},r.domain),n),message:i})},k={types:{EIP712Domain:[{name:"name",type:b.STRING},{name:"version",type:b.STRING},{name:"chainId",type:b.UINT_256}],Order:[{name:"version",type:b.INT_32},{name:"matcherPublicKey",type:b.STRING},{name:"amountAsset",type:b.STRING},{name:"priceAsset",type:b.STRING},{name:"orderType",type:b.STRING},{name:"amount",type:b.INT_64},{name:"price",type:b.INT_64},{name:"timestamp",type:b.INT_64},{name:"expiration",type:b.INT_64},{name:"matcherFee",type:b.INT_64},{name:"matcherFeeAssetId",type:b.STRING},{name:"priceMode",type:b.STRING}]},domain:{name:"Waves Order",version:"1",chainId:83},primaryType:"Order",message:{version:4,orderType:"SELL",matcherPublicKey:"",matcherFeeAssetId:"",amountAsset:"",priceAsset:"",matcherFee:0,amount:0,price:0,timestamp:0,expiration:0,priceMode:w.FIXED_DECIMALS}},B={types:{EIP712Domain:[{name:"chainId",type:b.UINT_256}],Message:[{name:"text",type:b.STRING}]},domain:{chainId:83},primaryType:"Message",message:{text:""}},_={types:{EIP712Domain:[{name:"chainId",type:b.UINT_256}],TypedData:[]},domain:{chainId:83},primaryType:"TypedData",message:{}};var P;!function(e){e.ASSET_DECIMALS="assetDecimals",e.FIXED_DECIMALS="fixedDecimals"}(P||(P={}));const O=e=>{switch(e){case P.ASSET_DECIMALS:return w.ASSET_DECIMALS;case P.FIXED_DECIMALS:default:return w.FIXED_DECIMALS}},N=[P.ASSET_DECIMALS,P.FIXED_DECIMALS],R=["BUY","SELL"],M=["string","integer","boolean","binary"],L=["string","number","boolean"],D=e=>{if("string"!=typeof e.key)return{status:!1,message:"Invalid key: ".concat(e.key,"Key should be string")};if(!M.includes(e.type))return{status:!1,message:"Invalid type: ".concat(e.type,"\nSupports: ").concat(M.join(" | "))};if(!L.includes(typeof e.value))return{status:!1,message:"Invalid value type: ".concat(e.value," (").concat(typeof e.value,")\nSupports: ").concat(L.join(" | "))};let t=!0;switch(e.type){case"boolean":"boolean"!=typeof e.value&&(t=!1);break;case"integer":"number"!=typeof e.value&&(t=!1);break;case"string":case"binary":"string"!=typeof e.value&&(t=!1)}return t?{status:!0}:{status:!1,message:"Value does not match type: type ".concat(e.type," key ").concat(e.key," value ").concat(e.value)}},F=e=>0===e.indexOf("base64:")?(e=e.slice(6),d(Object(E.base64Decode)(e))):0===e.indexOf("base58:")?(e=e.slice(6),d(Object(E.base58Decode)(e))):e,x={[b.BOOL]:!1,[b.BYTES]:"0x",[b.INT_64]:0,[b.STRING]:""},U=(e,t)=>{const r=[0];for(var n=1;n{switch(e.type){case b.ADDRESS:case b.BOOL:case b.INT_32:case b.INT_64:case b.STRING:return t;case b.BYTES:return F(t);case b.TUPLE:return U(e.components,t);case b.LIST_BOOL:case b.LIST_INT_64:case b.LIST_STRING:return t.map((e=>e.value));case b.LIST_BYTES:return t.map((e=>F(e.value)));case b.LIST_TUPLE:return t.map(U.bind(null,e.components))}},V=e=>{const t=e.amount;let r=e.assetId;if("WAVES"===r&&(r=null),null===r)r="0x0000000000000000000000000000000000000000000000000000000000000000";else{const e=Object(E.base58Decode)(r);r=d(e)}return[r,t]},K=e=>null===e?"WAVES":e;var J=r(0),H=r(83),G=r.n(H),z=r(1),X=G.a.BN;const q=new z.b("bignumber/5.4.2"),Y={};let Q=!1;class Z{constructor(e,t){q.checkNew(new.target,Z),e!==Y&&q.throwError("cannot call constructor directly; use BigNumber.from",z.b.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return $(ee(this).fromTwos(e))}toTwos(e){return $(ee(this).toTwos(e))}abs(){return"-"===this._hex[0]?Z.from(this._hex.substring(1)):this}add(e){return $(ee(this).add(ee(e)))}sub(e){return $(ee(this).sub(ee(e)))}div(e){return Z.from(e).isZero()&&te("division by zero","div"),$(ee(this).div(ee(e)))}mul(e){return $(ee(this).mul(ee(e)))}mod(e){const t=ee(e);return t.isNeg()&&te("cannot modulo negative values","mod"),$(ee(this).umod(t))}pow(e){const t=ee(e);return t.isNeg()&&te("cannot raise to negative values","pow"),$(ee(this).pow(t))}and(e){const t=ee(e);return(this.isNegative()||t.isNeg())&&te("cannot 'and' negative values","and"),$(ee(this).and(t))}or(e){const t=ee(e);return(this.isNegative()||t.isNeg())&&te("cannot 'or' negative values","or"),$(ee(this).or(t))}xor(e){const t=ee(e);return(this.isNegative()||t.isNeg())&&te("cannot 'xor' negative values","xor"),$(ee(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&te("cannot mask negative values","mask"),$(ee(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&te("cannot shift negative values","shl"),$(ee(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&te("cannot shift negative values","shr"),$(ee(this).shrn(e))}eq(e){return ee(this).eq(ee(e))}lt(e){return ee(this).lt(ee(e))}lte(e){return ee(this).lte(ee(e))}gt(e){return ee(this).gt(ee(e))}gte(e){return ee(this).gte(ee(e))}isNegative(){return"-"===this._hex[0]}isZero(){return ee(this).isZero()}toNumber(){try{return ee(this).toNumber()}catch(e){te("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return q.throwError("this platform does not support BigInt",z.b.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?Q||(Q=!0,q.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?q.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",z.b.errors.UNEXPECTED_ARGUMENT,{}):q.throwError("BigNumber.toString does not accept parameters",z.b.errors.UNEXPECTED_ARGUMENT,{})),ee(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof Z)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new Z(Y,W(e)):e.match(/^-?[0-9]+$/)?new Z(Y,W(new X(e))):q.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&te("underflow","BigNumber.from",e),(e>=9007199254740991||e<=-9007199254740991)&&te("overflow","BigNumber.from",e),Z.from(String(e));const t=e;if("bigint"==typeof t)return Z.from(t.toString());if(Object(J.j)(t))return Z.from(Object(J.i)(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"==typeof e)return Z.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&(Object(J.l)(e)||"-"===e[0]&&Object(J.l)(e.substring(1))))return Z.from(e)}return q.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function W(e){if("string"!=typeof e)return W(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&q.throwArgumentError("invalid hex","value",e),"0x00"===(e=W(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 $(e){return Z.from(W(e))}function ee(e){const t=Z.from(e).toHexString();return"-"===t[0]?new X("-"+t.substring(3),16):new X(t.substring(2),16)}function te(e,t,r){const n={fault:e,operation:t};return null!=r&&(n.value=r),q.throwError(e,z.b.errors.NUMERIC_FAULT,n)}var re=function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))};const ne=new z.b("properties/5.4.1");function ie(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function ae(e,t){for(let 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 oe(e){return re(this,void 0,void 0,(function*(){const t=Object.keys(e).map((t=>{const r=e[t];return Promise.resolve(r).then((e=>({key:t,value:e})))}));return(yield Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}))}function se(e,t){e&&"object"==typeof e||ne.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((r=>{t[r]||ne.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)}))}function ue(e){const t={};for(const r in e)t[r]=e[r];return t}const le={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function ce(e){if(function e(t){if(null==t||le[typeof t])return!0;if(Array.isArray(t)||"object"==typeof t){if(!Object.isFrozen(t))return!1;const r=Object.keys(t);for(let n=0;nfe(e))));if("object"==typeof e){const t={};for(const r in e){const n=e[r];void 0!==n&&ie(t,r,fe(n))}return t}return ne.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function fe(e){return ce(e)}class he{constructor(e){for(const t in e)this[t]=fe(e[t])}}const de=new z.b("abi/5.4.1");function pe(e){const t=[],r=function(e,n){if(Array.isArray(n))for(let i in n){const a=e.slice();a.push(i);try{r(a,n[i])}catch(e){t.push({path:a,error:e})}}};return r([],e),t}class ge{constructor(e,t,r,n){this.name=e,this.type=t,this.localName=r,this.dynamic=n}_throwError(e,t){de.throwArgumentError(e,this.localName,t)}}class ye{constructor(e){ie(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return Object(J.c)(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData(Object(J.b)(e._data))}writeBytes(e){let t=Object(J.a)(e);const r=t.length%this.wordSize;return r&&(t=Object(J.b)([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=Object(J.a)(Z.from(e));return t.length>this.wordSize&&de.throwError("value out-of-bounds",z.b.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=Object(J.b)([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class me{constructor(e,t,r,n){ie(this,"_data",Object(J.a)(e)),ie(this,"wordSize",t||32),ie(this,"_coerceFunc",r),ie(this,"allowLoose",n),this._offset=0}get data(){return Object(J.i)(this._data)}get consumed(){return this._offset}static coerce(e,t){let r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):me.coerce(e,t)}_peekBytes(e,t,r){let n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:de.throwError("data out-of-bounds",z.b.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(e){return new me(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}readValue(){return Z.from(this.readBytes(this.wordSize))}}var ve=r(82),be=r.n(ve);function Se(e){return"0x"+be.a.keccak_256(Object(J.a)(e))}const we=new z.b("rlp/5.4.0");function Ee(e){const t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function Ae(e,t,r){let n=0;for(let i=0;it+1+n&&we.throwError("child data too short",z.b.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function Ie(e,t){if(0===e.length&&we.throwError("data too short",z.b.errors.BUFFER_OVERRUN,{}),e[t]>=248){const r=e[t]-247;t+1+r>e.length&&we.throwError("data short segment too short",z.b.errors.BUFFER_OVERRUN,{});const n=Ae(e,t+1,r);return t+1+r+n>e.length&&we.throwError("data long segment too short",z.b.errors.BUFFER_OVERRUN,{}),Ce(e,t,t+1+r,r+n)}if(e[t]>=192){const r=e[t]-192;return t+1+r>e.length&&we.throwError("data array too short",z.b.errors.BUFFER_OVERRUN,{}),Ce(e,t,t+1,r)}if(e[t]>=184){const r=e[t]-183;t+1+r>e.length&&we.throwError("data array too short",z.b.errors.BUFFER_OVERRUN,{});const n=Ae(e,t+1,r);return t+1+r+n>e.length&&we.throwError("data array too short",z.b.errors.BUFFER_OVERRUN,{}),{consumed:1+r+n,result:Object(J.i)(e.slice(t+1+r,t+1+r+n))}}if(e[t]>=128){const r=e[t]-128;return t+1+r>e.length&&we.throwError("data too short",z.b.errors.BUFFER_OVERRUN,{}),{consumed:1+r,result:Object(J.i)(e.slice(t+1,t+1+r))}}return{consumed:1,result:Object(J.i)(e[t])}}function ke(e){const t=Object(J.a)(e),r=Ie(t,0);return r.consumed!==t.length&&we.throwArgumentError("invalid rlp data","data",e),r.result}const Be=new z.b("address/5.4.0");function _e(e){Object(J.l)(e,20)||Be.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=t[i].charCodeAt(0);const n=Object(J.a)(Se(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(t[i]=t[i].toUpperCase()),(15&n[i>>1])>=8&&(t[i+1]=t[i+1].toUpperCase());return"0x"+t.join("")}const Pe={};for(let wu=0;wu<10;wu++)Pe[String(wu)]=String(wu);for(let wu=0;wu<26;wu++)Pe[String.fromCharCode(65+wu)]=String(10+wu);const Oe=Math.floor((Ne=9007199254740991,Math.log10?Math.log10(Ne):Math.log(Ne)/Math.LN10));var Ne;function Re(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>Pe[e])).join("");for(;t.length>=Oe;){let e=t.substring(0,Oe);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}function Me(e){let t=null;if("string"!=typeof e&&Be.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=_e(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&Be.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)!==Re(e)&&Be.throwArgumentError("bad icap checksum","address",e),r=e.substring(4),t=new X(r,36).toString(16);t.length<40;)t="0"+t;t=_e("0x"+t)}else Be.throwArgumentError("invalid address","address",e);var r;return t}function Le(e){try{return Me(e),!0}catch(e){}return!1}function De(e){let t=(r=Me(e).substring(2),new X(r,16).toString(36)).toUpperCase();for(var r;t.length<30;)t="0"+t;return"XE"+Re("XE00"+t)+t}function Fe(e){let t=null;try{t=Me(e.from)}catch(t){Be.throwArgumentError("missing from address","transaction",e)}const r=Object(J.o)(Object(J.a)(Z.from(e.nonce).toHexString()));return Me(Object(J.e)(Se(Te([t,r])),12))}function xe(e,t,r){return 32!==Object(J.d)(t)&&Be.throwArgumentError("salt must be 32 bytes","salt",t),32!==Object(J.d)(r)&&Be.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),Me(Object(J.e)(Se(Object(J.b)(["0xff",Me(e),t,r])),12))}const Ue=new z.b("strings/5.4.0");var je,Ve;function Ke(e,t,r,n,i){if(e===Ve.BAD_PREFIX||e===Ve.UNEXPECTED_CONTINUE){let e=0;for(let n=t+1;n>6==2;n++)e++;return e}return e===Ve.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(je||(je={})),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"}(Ve||(Ve={}));const Je=Object.freeze({error:function(e,t,r,n,i){return Ue.throwArgumentError("invalid codepoint at offset ".concat(t,"; ").concat(e),"bytes",r)},ignore:Ke,replace:function(e,t,r,n,i){return e===Ve.OVERLONG?(n.push(i),0):(n.push(65533),Ke(e,t,r))}});function He(e,t){null==t&&(t=Je.error),e=Object(J.a)(e);const r=[];let n=0;for(;n>7==0){r.push(i);continue}let a=null,o=null;if(192==(224&i))a=1,o=127;else if(224==(240&i))a=2,o=2047;else{if(240!=(248&i)){n+=t(128==(192&i)?Ve.UNEXPECTED_CONTINUE:Ve.BAD_PREFIX,n-1,e,r);continue}a=3,o=65535}if(n-1+a>=e.length){n+=t(Ve.OVERRUN,n-1,e,r);continue}let s=i&(1<<8-a-1)-1;for(let u=0;u1114111?n+=t(Ve.OUT_OF_RANGE,n-1-a,e,r,s):s>=55296&&s<=57343?n+=t(Ve.UTF16_SURROGATE,n-1-a,e,r,s):s<=o?n+=t(Ve.OVERLONG,n-1-a,e,r,s):r.push(s))}return r}function Ge(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:je.current;t!=je.current&&(Ue.checkNormalize(),e=e.normalize(t));let r=[];for(let n=0;n>6|192),r.push(63&t|128);else if(55296==(64512&t)){n++;const i=e.charCodeAt(n);if(n>=e.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const a=65536+((1023&t)<<10)+(1023&i);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(t>>12|224),r.push(t>>6&63|128),r.push(63&t|128)}return Object(J.a)(r)}function ze(e){const t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function Xe(e,t){return'"'+He(e,t).map((e=>{if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?ze(e):ze(55296+((e-=65536)>>10&1023))+ze(56320+(1023&e))})).join("")+'"'}function qe(e){return e.map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}function Ye(e,t){return qe(He(e,t))}function Qe(e){return He(Ge(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:je.current))}function Ze(e){return Se(Ge(e))}class We extends ge{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=Me(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}decode(e){return Me(Object(J.h)(e.readValue().toHexString(),20))}}class $e extends ge{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}const et=new z.b("abi/5.4.1");function tt(e,t,r){let n=null;if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let e={};n=t.map((t=>{const n=t.localName;return n||et.throwError("cannot encode object for signature with missing names",z.b.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]&&et.throwError("cannot encode object for signature with duplicate names",z.b.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]=!0,r[n]}))}else et.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&et.throwArgumentError("types/value length mismatch","tuple",r);let i=new ye(e.wordSize),a=new ye(e.wordSize),o=[];t.forEach(((e,t)=>{let r=n[t];if(e.dynamic){let t=a.length;e.encode(a,r);let n=i.writeUpdatableValue();o.push((e=>{n(e+t)}))}else e.encode(i,r)})),o.forEach((e=>{e(i.length)}));let s=e.appendWriter(i);return s+=e.appendWriter(a),s}function rt(e,t){let r=[],n=e.subReader(0);t.forEach((t=>{let i=null;if(t.dynamic){let r=e.readValue(),a=n.subReader(r.toNumber());try{i=t.decode(a)}catch(e){if(e.code===z.b.errors.BUFFER_OVERRUN)throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(e){if(e.code===z.b.errors.BUFFER_OVERRUN)throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}null!=i&&r.push(i)}));const i=t.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});t.forEach(((e,t)=>{let n=e.localName;if(!n||1!==i[n])return;if("length"===n&&(n="_length"),null!=r[n])return;const a=r[t];a instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw a}}):r[n]=a}));for(let a=0;a{throw e}})}return Object.freeze(r)}class nt extends ge{constructor(e,t,r){super("array",e.type+"["+(t>=0?t:"")+"]",r,-1===t||e.dynamic),this.coder=e,this.length=t}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let r=0;re._data.length&&et.throwError("insufficient data length",z.b.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let r=[];for(let n=0;n{e.dynamic&&(r=!0),n.push(e.type)})),super("tuple","tuple("+n.join(",")+")",t,r),this.coders=e}defaultValue(){const e=[];this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});return this.coders.forEach(((r,n)=>{let i=r.localName;i&&1===t[i]&&("length"===i&&(i="_length"),null==e[i]&&(e[i]=e[n]))})),Object.freeze(e)}encode(e,t){return tt(e,this.coders,t)}decode(e){return e.coerce(this.name,rt(e,this.coders))}}const St=new z.b("abi/5.4.1"),wt={};let Et={calldata:!0,memory:!0,storage:!0},At={calldata:!0,memory:!0};function Tt(e,t){if("bytes"===e||"string"===e){if(Et[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&At[t])return!0;return(Et[t]||"payable"===t)&&St.throwArgumentError("invalid modifier","name",t),!1}function Ct(e,t){for(let r in t)ie(e,r,t[r])}const It=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),kt=new RegExp(/^(.*)\[([0-9]*)\]$/);class Bt{constructor(e,t){e!==wt&&St.throwError("use fromString",z.b.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),Ct(this,t);let r=this.type.match(kt);Ct(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:Bt.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=It.sighash),It[e]||St.throwArgumentError("invalid format type","format",e),e===It.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==It.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===It.full?", ":",")+")"):t+=this.type,e!==It.sighash&&(!0===this.indexed&&(t+=" indexed"),e===It.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"==typeof e?Bt.fromString(e,t):Bt.fromObject(e)}static fromObject(e){return Bt.isParamType(e)?e:new Bt(wt,{name:e.name||null,type:Ut(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(Bt.fromObject):null})}static fromString(e,t){return function(e){return Bt.fromObject({name:e.name,type:e.type,indexed:e.indexed,components:e.components})}(function(e,t){let r=e;function n(t){St.throwArgumentError("unexpected character at position "+t,"param",e)}function i(e){let r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");let a={type:"",name:"",state:{allowType:!0}},o=a;for(let s=0;sBt.fromString(e,t)))}class Pt{constructor(e,t){e!==wt&&St.throwError("use a static from method",z.b.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Ct(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return Pt.isFragment(e)?e:"string"==typeof e?Pt.fromString(e):Pt.fromObject(e)}static fromObject(e){if(Pt.isFragment(e))return e;switch(e.type){case"function":return Dt.fromObject(e);case"event":return Ot.fromObject(e);case"constructor":return Lt.fromObject(e);case"error":return xt.fromObject(e);case"fallback":case"receive":return null}return St.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?Ot.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?Dt.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?Lt.fromString(e.trim()):"error"===e.split(" ")[0]?xt.fromString(e.substring(5).trim()):St.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class Ot extends Pt{format(e){if(e||(e=It.sighash),It[e]||St.throwArgumentError("invalid format type","format",e),e===It.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==It.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===It.full?", ":",")+") ",e!==It.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"==typeof e?Ot.fromString(e):Ot.fromObject(e)}static fromObject(e){if(Ot.isEventFragment(e))return e;"event"!==e.type&&St.throwArgumentError("invalid event object","value",e);const t={name:Vt(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(Bt.fromObject):[],type:"event"};return new Ot(wt,t)}static fromString(e){let t=e.match(Kt);t||St.throwArgumentError("invalid event string","value",e);let r=!1;return t[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":r=!0;break;case"":break;default:St.warn("unknown modifier: "+e)}})),Ot.fromObject({name:t[1].trim(),anonymous:r,inputs:_t(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function Nt(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&&St.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||St.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=Z.from(r[1]),r[0]):e}function Rt(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function Mt(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&St.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&St.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||St.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&St.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&St.throwArgumentError("unable to determine stateMutability","value",e),t}class Lt extends Pt{format(e){if(e||(e=It.sighash),It[e]||St.throwArgumentError("invalid format type","format",e),e===It.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});e===It.sighash&&St.throwError("cannot format a constructor for sighash",z.b.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===It.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?Lt.fromString(e):Lt.fromObject(e)}static fromObject(e){if(Lt.isConstructorFragment(e))return e;"constructor"!==e.type&&St.throwArgumentError("invalid constructor object","value",e);let t=Mt(e);t.constant&&St.throwArgumentError("constructor cannot be constant","value",e);const r={name:null,type:e.type,inputs:e.inputs?e.inputs.map(Bt.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?Z.from(e.gas):null};return new Lt(wt,r)}static fromString(e){let t={type:"constructor"},r=(e=Nt(e,t)).match(Kt);return r&&"constructor"===r[1].trim()||St.throwArgumentError("invalid constructor string","value",e),t.inputs=_t(r[2].trim(),!1),Rt(r[3].trim(),t),Lt.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class Dt extends Lt{format(e){if(e||(e=It.sighash),It[e]||St.throwArgumentError("invalid format type","format",e),e===It.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==It.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===It.full?", ":",")+") ",e!==It.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((t=>t.format(e))).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return"string"==typeof e?Dt.fromString(e):Dt.fromObject(e)}static fromObject(e){if(Dt.isFunctionFragment(e))return e;"function"!==e.type&&St.throwArgumentError("invalid function object","value",e);let t=Mt(e);const r={type:e.type,name:Vt(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(Bt.fromObject):[],outputs:e.outputs?e.outputs.map(Bt.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?Z.from(e.gas):null};return new Dt(wt,r)}static fromString(e){let t={type:"function"},r=(e=Nt(e,t)).split(" returns ");r.length>2&&St.throwArgumentError("invalid function string","value",e);let n=r[0].match(Kt);if(n||St.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&Vt(t.name),t.inputs=_t(n[2],!1),Rt(n[3].trim(),t),r.length>1){let n=r[1].match(Kt);""==n[1].trim()&&""==n[3].trim()||St.throwArgumentError("unexpected tokens","value",e),t.outputs=_t(n[2],!1)}else t.outputs=[];return Dt.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function Ft(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||St.throwArgumentError("cannot specify user defined ".concat(t," error"),"fragment",e),e}class xt extends Pt{format(e){if(e||(e=It.sighash),It[e]||St.throwArgumentError("invalid format type","format",e),e===It.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==It.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===It.full?", ":",")+") ",t.trim()}static from(e){return"string"==typeof e?xt.fromString(e):xt.fromObject(e)}static fromObject(e){if(xt.isErrorFragment(e))return e;"error"!==e.type&&St.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:Vt(e.name),inputs:e.inputs?e.inputs.map(Bt.fromObject):[]};return Ft(new xt(wt,t))}static fromString(e){let t={type:"error"},r=e.match(Kt);return r||St.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&Vt(t.name),t.inputs=_t(r[2],!1),Ft(xt.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function Ut(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const jt=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Vt(e){return e&&e.match(jt)||St.throwArgumentError('invalid identifier "'.concat(e,'"'),"value",e),e}const Kt=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),Jt=new z.b("abi/5.4.1"),Ht=new RegExp(/^bytes([0-9]*)$/),Gt=new RegExp(/^(u?int)([0-9]*)$/);class zt{constructor(e){Jt.checkNew(new.target,zt),ie(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new We(e.name);case"bool":return new it(e.name);case"string":return new vt(e.name);case"bytes":return new ot(e.name);case"array":return new nt(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new bt((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new ut(e.name)}let t=e.type.match(Gt);if(t){let r=parseInt(t[2]||"256");return(0===r||r>256||r%8!=0)&&Jt.throwArgumentError("invalid "+t[1]+" bit length","param",e),new mt(r/8,"int"===t[1],e.name)}if(t=e.type.match(Ht),t){let r=parseInt(t[1]);return(0===r||r>32)&&Jt.throwArgumentError("invalid bytes length","param",e),new st(r,e.name)}return Jt.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new me(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new ye(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder(Bt.from(e))));return new bt(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&Jt.throwError("types/values length mismatch",z.b.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const r=e.map((e=>this._getCoder(Bt.from(e)))),n=new bt(r,"_"),i=this._getWriter();return n.encode(i,t),i.data}decode(e,t,r){const n=e.map((e=>this._getCoder(Bt.from(e))));return new bt(n,"_").decode(this._getReader(Object(J.a)(t),r))}}const Xt=new zt,qt=new z.b("abi/5.4.1");class Yt extends he{}class Qt extends he{}class Zt extends he{}class Wt extends he{static isIndexed(e){return!(!e||!e._isIndexed)}}const $t={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function er(e,t){const r=new Error("deferred error during ABI decoding triggered accessing "+e);return r.error=t,r}class tr{constructor(e){qt.checkNew(new.target,tr);let t=[];t="string"==typeof e?JSON.parse(e):e,ie(this,"fragments",t.map((e=>Pt.from(e))).filter((e=>null!=e))),ie(this,"_abiCoder",ae(new.target,"getAbiCoder")()),ie(this,"functions",{}),ie(this,"errors",{}),ie(this,"events",{}),ie(this,"structs",{}),this.fragments.forEach((e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void qt.warn("duplicate definition - constructor"):void ie(this,"deploy",e);case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return}let r=e.format();t[r]?qt.warn("duplicate definition - "+r):t[r]=e})),this.deploy||ie(this,"deploy",Lt.from({payable:!1,type:"constructor"})),ie(this,"_isInterface",!0)}format(e){e||(e=It.full),e===It.sighash&&qt.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===It.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return Xt}static getAddress(e){return Me(e)}static getSighash(e){return Object(J.e)(Ze(e.format()),0,4)}static getEventTopic(e){return Ze(e.format())}getFunction(e){if(Object(J.l)(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];qt.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.functions).filter((e=>e.split("(")[0]===t));return 0===r.length?qt.throwArgumentError("no matching function","name",t):r.length>1&&qt.throwArgumentError("multiple matching functions","name",t),this.functions[r[0]]}const t=this.functions[Dt.fromString(e).format()];return t||qt.throwArgumentError("no matching function","signature",e),t}getEvent(e){if(Object(J.l)(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];qt.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.events).filter((e=>e.split("(")[0]===t));return 0===r.length?qt.throwArgumentError("no matching event","name",t):r.length>1&&qt.throwArgumentError("multiple matching events","name",t),this.events[r[0]]}const t=this.events[Ot.fromString(e).format()];return t||qt.throwArgumentError("no matching event","signature",e),t}getError(e){if(Object(J.l)(e)){const t=ae(this.constructor,"getSighash");for(const r in this.errors)if(e===t(this.errors[r]))return this.errors[r];qt.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.errors).filter((e=>e.split("(")[0]===t));return 0===r.length?qt.throwArgumentError("no matching error","name",t):r.length>1&&qt.throwArgumentError("multiple matching errors","name",t),this.errors[r[0]]}const t=this.errors[Dt.fromString(e).format()];return t||qt.throwArgumentError("no matching error","signature",e),t}getSighash(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return ae(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),ae(this.constructor,"getEventTopic")(e)}_decodeParams(e,t){return this._abiCoder.decode(e,t)}_encodeParams(e,t){return this._abiCoder.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){"string"==typeof e&&(e=this.getError(e));const r=Object(J.a)(t);return Object(J.i)(r.slice(0,4))!==this.getSighash(e)&&qt.throwArgumentError("data signature does not match error ".concat(e.name,"."),"data",Object(J.i)(r)),this._decodeParams(e.inputs,r.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),Object(J.i)(Object(J.b)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));const r=Object(J.a)(t);return Object(J.i)(r.slice(0,4))!==this.getSighash(e)&&qt.throwArgumentError("data signature does not match function ".concat(e.name,"."),"data",Object(J.i)(r)),this._decodeParams(e.inputs,r.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Object(J.i)(Object(J.b)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let r=Object(J.a)(t),n=null,i=null,a=null,o=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(e){}break;case 4:{const t=Object(J.i)(r.slice(0,4)),s=$t[t];if(s)i=this._abiCoder.decode(s.inputs,r.slice(4)),a=s.name,o=s.signature,s.reason&&(n=i[0]);else try{const e=this.getError(t);i=this._abiCoder.decode(e.inputs,r.slice(4)),a=e.name,o=e.format()}catch(e){console.log(e)}break}}return qt.throwError("call revert exception",z.b.errors.CALL_EXCEPTION,{method:e.format(),errorArgs:i,errorName:a,errorSignature:o,reason:n})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Object(J.i)(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&qt.throwError("too many arguments for "+e.format(),z.b.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let r=[];e.anonymous||r.push(this.getEventTopic(e));const n=(e,t)=>"string"===e.type?Ze(t):"bytes"===e.type?Se(Object(J.i)(t)):("address"===e.type&&this._abiCoder.encode(["address"],[t]),Object(J.h)(Object(J.i)(t),32));for(t.forEach(((t,i)=>{let a=e.inputs[i];a.indexed?null==t?r.push(null):"array"===a.baseType||"tuple"===a.baseType?qt.throwArgumentError("filtering with tuples or arrays not supported","contract."+a.name,t):Array.isArray(t)?r.push(t.map((e=>n(a,e)))):r.push(n(a,t)):null!=t&&qt.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+a.name,t)}));r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(e,t){"string"==typeof e&&(e=this.getEvent(e));const r=[],n=[],i=[];return e.anonymous||r.push(this.getEventTopic(e)),t.length!==e.inputs.length&&qt.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach(((e,a)=>{const o=t[a];if(e.indexed)if("string"===e.type)r.push(Ze(o));else if("bytes"===e.type)r.push(Se(o));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");r.push(this._abiCoder.encode([e.type],[o]))}else n.push(e),i.push(o)})),{data:this._abiCoder.encode(n,i),topics:r}}decodeEventLog(e,t,r){if("string"==typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){let t=this.getEventTopic(e);Object(J.l)(r[0],32)&&r[0].toLowerCase()===t||qt.throwError("fragment/topic mismatch",z.b.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:t,value:r[0]}),r=r.slice(1)}let n=[],i=[],a=[];e.inputs.forEach(((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(n.push(Bt.fromObject({type:"bytes32",name:e.name})),a.push(!0)):(n.push(e),a.push(!1)):(i.push(e),a.push(!1))}));let o=null!=r?this._abiCoder.decode(n,Object(J.b)(r)):null,s=this._abiCoder.decode(i,t,!0),u=[],l=0,c=0;e.inputs.forEach(((e,t)=>{if(e.indexed)if(null==o)u[t]=new Wt({_isIndexed:!0,hash:null});else if(a[t])u[t]=new Wt({_isIndexed:!0,hash:o[c++]});else try{u[t]=o[c++]}catch(e){u[t]=e}else try{u[t]=s[l++]}catch(e){u[t]=e}if(e.name&&null==u[e.name]){const r=u[t];r instanceof Error?Object.defineProperty(u,e.name,{enumerable:!0,get:()=>{throw er("property "+JSON.stringify(e.name),r)}}):u[e.name]=r}}));for(let f=0;f{throw er("index "+f,e)}})}return Object.freeze(u)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new Qt({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:Z.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new Yt({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=Object(J.i)(e);let r=this.getError(t.substring(0,10).toLowerCase());return r?new Zt({args:this._abiCoder.decode(r.inputs,"0x"+t.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}static isInterface(e){return!(!e||!e._isInterface)}}var rr=function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))};const nr=new z.b("abstract-provider/5.4.1");class ir extends he{static isForkEvent(e){return!(!e||!e._isForkEvent)}}class ar{constructor(){nr.checkAbstract(new.target,ar),ie(this,"_isProvider",!0)}getFeeData(){return rr(this,void 0,void 0,(function*(){const{block:e,gasPrice:t}=yield oe({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((e=>null))});let r=null,n=null;return e&&e.baseFeePerGas&&(n=Z.from("2500000000"),r=e.baseFeePerGas.mul(2).add(n)),{maxFeePerGas:r,maxPriorityFeePerGas:n,gasPrice:t}}))}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}static isProvider(e){return!(!e||!e._isProvider)}}var or=function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))};const sr=new z.b("abstract-signer/5.4.1"),ur=["accessList","chainId","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],lr=[z.b.errors.INSUFFICIENT_FUNDS,z.b.errors.NONCE_EXPIRED,z.b.errors.REPLACEMENT_UNDERPRICED];class cr{constructor(){sr.checkAbstract(new.target,cr),ie(this,"_isSigner",!0)}getBalance(e){return or(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)}))}getTransactionCount(e){return or(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)}))}estimateGas(e){return or(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const t=yield oe(this.checkTransaction(e));return yield this.provider.estimateGas(t)}))}call(e,t){return or(this,void 0,void 0,(function*(){this._checkProvider("call");const r=yield oe(this.checkTransaction(e));return yield this.provider.call(r,t)}))}sendTransaction(e){return or(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const t=yield this.populateTransaction(e),r=yield this.signTransaction(t);return yield this.provider.sendTransaction(r)}))}getChainId(){return or(this,void 0,void 0,(function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return or(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return or(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(e){return or(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)}))}checkTransaction(e){for(const r in e)-1===ur.indexOf(r)&&sr.throwArgumentError("invalid transaction key: "+r,"transaction",e);const t=ue(e);return null==t.from?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then((t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&sr.throwArgumentError("from address mismatch","transaction",e),t[0]))),t}populateTransaction(e){return or(this,void 0,void 0,(function*(){const t=yield oe(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then((e=>or(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.resolveName(e);return null==t&&sr.throwArgumentError("provided ENS name resolves to null","tx.to",e),t})))),t.to.catch((e=>{})));const r=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!r?0!==t.type&&1!==t.type||!r||sr.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):sr.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas)if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{const e=yield this.getFeeData();if(null==t.type)if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)if(t.type=2,null!=t.gasPrice){const e=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=e,t.maxPriorityFeePerGas=e}else null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas);else null!=e.gasPrice?(r&&sr.throwError("network does not support EIP-1559",z.b.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):sr.throwError("failed to get consistent fee data",z.b.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else t.type=2;return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch((e=>{if(lr.indexOf(e.code)>=0)throw e;return sr.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",z.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:t})}))),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then((t=>(0!==t[1]&&t[0]!==t[1]&&sr.throwArgumentError("chainId address mismatch","transaction",e),t[0]))),yield oe(t)}))}_checkProvider(e){this.provider||sr.throwError("missing provider",z.b.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!(!e||!e._isSigner)}}class fr extends cr{constructor(e,t){sr.checkNew(new.target,fr),super(),ie(this,"address",e),ie(this,"provider",t||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,t){return Promise.resolve().then((()=>{sr.throwError(e,z.b.errors.UNSUPPORTED_OPERATION,{operation:t})}))}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,t,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new fr(this.address,e)}}var hr=r(81);const dr=new z.b("signing-key/5.4.0");let pr=null;function gr(){return pr||(pr=new hr.a("secp256k1")),pr}class yr{constructor(e){ie(this,"curve","secp256k1"),ie(this,"privateKey",Object(J.i)(e));const t=gr().keyFromPrivate(Object(J.a)(this.privateKey));ie(this,"publicKey","0x"+t.getPublic(!1,"hex")),ie(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),ie(this,"_isSigningKey",!0)}_addPoint(e){const t=gr().keyFromPublic(Object(J.a)(this.publicKey)),r=gr().keyFromPublic(Object(J.a)(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){const t=gr().keyFromPrivate(Object(J.a)(this.privateKey)),r=Object(J.a)(e);32!==r.length&&dr.throwArgumentError("bad digest length","digest",e);const n=t.sign(r,{canonical:!0});return Object(J.n)({recoveryParam:n.recoveryParam,r:Object(J.h)("0x"+n.r.toString(16),32),s:Object(J.h)("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const t=gr().keyFromPrivate(Object(J.a)(this.privateKey)),r=gr().keyFromPublic(Object(J.a)(vr(e)));return Object(J.h)("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function mr(e,t){const r=Object(J.n)(t),n={r:Object(J.a)(r.r),s:Object(J.a)(r.s)};return"0x"+gr().recoverPubKey(Object(J.a)(e),n,r.recoveryParam).encode("hex",!1)}function vr(e,t){const r=Object(J.a)(e);if(32===r.length){const e=new yr(r);return t?"0x"+gr().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?Object(J.i)(r):"0x"+gr().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+gr().keyFromPublic(r).getPublic(!0,"hex"):Object(J.i)(r):dr.throwArgumentError("invalid public or private key","key","[REDACTED]")}const br=new z.b("transactions/5.4.0");var Sr;function wr(e){return"0x"===e?null:Me(e)}function Er(e){return"0x"===e?ct:Z.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(Sr||(Sr={}));const Ar=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],Tr={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function Cr(e){const t=vr(e);return Me(Object(J.e)(Se(Object(J.e)(t,1)),12))}function Ir(e,t){return Cr(mr(Object(J.a)(e),t))}function kr(e,t){const r=Object(J.o)(Z.from(e).toHexString());return r.length>32&&br.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function Br(e,t){return{address:Me(e),storageKeys:(t||[]).map(((t,r)=>(32!==Object(J.d)(t)&&br.throwArgumentError("invalid access list storageKey","accessList[".concat(e,":").concat(r,"]"),t),t.toLowerCase())))}}function _r(e){if(Array.isArray(e))return e.map(((e,t)=>Array.isArray(e)?(e.length>2&&br.throwArgumentError("access list expected to be [ address, storageKeys[] ]","value[".concat(t,"]"),e),Br(e[0],e[1])):Br(e.address,e.storageKeys)));const t=Object.keys(e).map((t=>{const r=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return Br(t,Object.keys(r).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}function Pr(e){return _r(e).map((e=>[e.address,e.storageKeys]))}function Or(e,t){if(null!=e.gasPrice){const t=Z.from(e.gasPrice),r=Z.from(e.maxFeePerGas||0);t.eq(r)||br.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:r})}const r=[kr(e.chainId||0,"chainId"),kr(e.nonce||0,"nonce"),kr(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),kr(e.maxFeePerGas||0,"maxFeePerGas"),kr(e.gasLimit||0,"gasLimit"),null!=e.to?Me(e.to):"0x",kr(e.value||0,"value"),e.data||"0x",Pr(e.accessList||[])];if(t){const e=Object(J.n)(t);r.push(kr(e.recoveryParam,"recoveryParam")),r.push(Object(J.o)(e.r)),r.push(Object(J.o)(e.s))}return Object(J.c)(["0x02",Te(r)])}function Nr(e,t){const r=[kr(e.chainId||0,"chainId"),kr(e.nonce||0,"nonce"),kr(e.gasPrice||0,"gasPrice"),kr(e.gasLimit||0,"gasLimit"),null!=e.to?Me(e.to):"0x",kr(e.value||0,"value"),e.data||"0x",Pr(e.accessList||[])];if(t){const e=Object(J.n)(t);r.push(kr(e.recoveryParam,"recoveryParam")),r.push(Object(J.o)(e.r)),r.push(Object(J.o)(e.s))}return Object(J.c)(["0x01",Te(r)])}function Rr(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&br.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){se(e,Tr);const r=[];Ar.forEach((function(t){let n=e[t.name]||[];const i={};t.numeric&&(i.hexPad="left"),n=Object(J.a)(Object(J.i)(n,i)),t.length&&n.length!==t.length&&n.length>0&&br.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=Object(J.o)(n),n.length>t.maxLength&&br.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n)),r.push(Object(J.i)(n))}));let n=0;if(null!=e.chainId?(n=e.chainId,"number"!=typeof n&&br.throwArgumentError("invalid transaction.chainId","transaction",e)):t&&!Object(J.k)(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push(Object(J.i)(n)),r.push("0x"),r.push("0x")),!t)return Te(r);const i=Object(J.n)(t);let a=27+i.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),a+=2*n+8,i.v>28&&i.v!==a&&br.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):i.v!==a&&br.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push(Object(J.i)(a)),r.push(Object(J.o)(Object(J.a)(i.r))),r.push(Object(J.o)(Object(J.a)(i.s))),Te(r)}(e,t);switch(e.type){case 1:return Nr(e,t);case 2:return Or(e,t)}return br.throwError("unsupported transaction type: "+e.type,z.b.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function Mr(e,t,r){try{const r=Er(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r}catch(e){br.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=Object(J.h)(t[1],32),e.s=Object(J.h)(t[2],32);try{const t=Se(r(e));e.from=Ir(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){console.log(e)}}function Lr(e){const t=Object(J.a)(e);if(t[0]>127)return function(e){const t=ke(e);9!==t.length&&6!==t.length&&br.throwArgumentError("invalid raw transaction","rawTransaction",e);const r={nonce:Er(t[0]).toNumber(),gasPrice:Er(t[1]),gasLimit:Er(t[2]),to:wr(t[3]),value:Er(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=Z.from(t[6]).toNumber()}catch(e){return console.log(e),r}if(r.r=Object(J.h)(t[7],32),r.s=Object(J.h)(t[8],32),Z.from(r.r).isZero()&&Z.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);let n=r.v-27;const i=t.slice(0,6);0!==r.chainId&&(i.push(Object(J.i)(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);const a=Se(Te(i));try{r.from=Ir(a,{r:Object(J.i)(r.r),s:Object(J.i)(r.s),recoveryParam:n})}catch(e){console.log(e)}r.hash=Se(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){const t=ke(e.slice(1));8!==t.length&&11!==t.length&&br.throwArgumentError("invalid component count for transaction type: 1","payload",Object(J.i)(e));const r={type:1,chainId:Er(t[0]).toNumber(),nonce:Er(t[1]).toNumber(),gasPrice:Er(t[2]),gasLimit:Er(t[3]),to:wr(t[4]),value:Er(t[5]),data:t[6],accessList:_r(t[7])};return 8===t.length||(r.hash=Se(e),Mr(r,t.slice(8),Nr)),r}(t);case 2:return function(e){const t=ke(e.slice(1));9!==t.length&&12!==t.length&&br.throwArgumentError("invalid component count for transaction type: 2","payload",Object(J.i)(e));const r=Er(t[2]),n=Er(t[3]),i={type:2,chainId:Er(t[0]).toNumber(),nonce:Er(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Er(t[4]),to:wr(t[5]),value:Er(t[6]),data:t[7],accessList:_r(t[8])};return 9===t.length||(i.hash=Se(e),Mr(i,t.slice(9),Or)),i}(t)}return br.throwError("unsupported transaction type: "+t[0],z.b.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}var Dr=function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))};const Fr=new z.b("contracts/5.4.1"),xr={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};function Ur(e,t){return Dr(this,void 0,void 0,(function*(){const r=yield t;try{return Me(r)}catch(e){}e||Fr.throwError("a provider or signer is needed to resolve ENS names",z.b.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield e.resolveName(r);return null==n&&Fr.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n}))}function jr(e,t,r){return Dr(this,void 0,void 0,(function*(){return Array.isArray(r)?yield Promise.all(r.map(((r,n)=>jr(e,Array.isArray(t)?t[n]:t[r.name],r)))):"address"===r.type?yield Ur(e,t):"tuple"===r.type?yield jr(e,t,r.components):"array"===r.baseType?Array.isArray(t)?yield Promise.all(t.map((t=>jr(e,t,r.arrayChildren)))):Promise.reject(new Error("invalid value for array")):t}))}function Vr(e,t,r){return Dr(this,void 0,void 0,(function*(){let n={};r.length===t.inputs.length+1&&"object"==typeof r[r.length-1]&&(n=ue(r.pop())),Fr.checkArgumentCount(r.length,t.inputs.length,"passed to contract"),e.signer?n.from?n.from=oe({override:Ur(e.signer,n.from),signer:e.signer.getAddress()}).then((e=>Dr(this,void 0,void 0,(function*(){return Me(e.signer)!==e.override&&Fr.throwError("Contract with a Signer cannot override from",z.b.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.override})))):n.from=e.signer.getAddress():n.from&&(n.from=Ur(e.provider,n.from));const i=yield oe({args:jr(e.signer||e.provider,r,t.inputs),address:e.resolvedAddress,overrides:oe(n)||{}}),a=e.interface.encodeFunctionData(t,i.args),o={data:a,to:i.address},s=i.overrides;if(null!=s.nonce&&(o.nonce=Z.from(s.nonce).toNumber()),null!=s.gasLimit&&(o.gasLimit=Z.from(s.gasLimit)),null!=s.gasPrice&&(o.gasPrice=Z.from(s.gasPrice)),null!=s.maxFeePerGas&&(o.maxFeePerGas=Z.from(s.maxFeePerGas)),null!=s.maxPriorityFeePerGas&&(o.maxPriorityFeePerGas=Z.from(s.maxPriorityFeePerGas)),null!=s.from&&(o.from=s.from),null!=s.type&&(o.type=s.type),null!=s.accessList&&(o.accessList=_r(s.accessList)),null==o.gasLimit&&null!=t.gas){let e=21e3;const r=Object(J.a)(a);for(let t=0;tnull!=n[e]));return u.length&&Fr.throwError("cannot override "+u.map((e=>JSON.stringify(e))).join(","),z.b.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:u}),o}))}function Kr(e,t,r){const n=e.signer||e.provider;return function(){for(var i=arguments.length,a=new Array(i),o=0;oa(t).then((t=>(t.events=t.logs.map((r=>{let n=fe(r),i=null;try{i=e.interface.parseLog(r)}catch(e){}return i&&(n.args=i.args,n.decode=(t,r)=>e.interface.decodeEventLog(i.eventFragment,t,r),n.event=i.name,n.eventSignature=i.signature),n.removeListener=()=>e.provider,n.getBlock=()=>e.provider.getBlock(t.blockHash),n.getTransaction=()=>e.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>Promise.resolve(t),n})),t))),i}))}}(e,t)}function Hr(e){return!e.address||null!=e.topics&&0!==e.topics.length?(e.address||"*")+"@"+(e.topics?e.topics.map((e=>Array.isArray(e)?e.join("|"):e)).join(":"):""):"*"}class Gr{constructor(e,t){ie(this,"tag",e),ie(this,"filter",t),this._listeners=[]}addListener(e,t){this._listeners.push({listener:e,once:t})}removeListener(e){let t=!1;this._listeners=this._listeners.filter((r=>!(!t&&r.listener===e)||(t=!0,!1)))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map((e=>e.listener))}listenerCount(){return this._listeners.length}run(e){const t=this.listenerCount();return this._listeners=this._listeners.filter((t=>{const r=e.slice();return setTimeout((()=>{t.listener.apply(this,r)}),0),!t.once})),t}prepareEvent(e){}getEmit(e){return[e]}}class zr extends Gr{constructor(){super("error",null)}}class Xr extends Gr{constructor(e,t,r,n){const i={address:e};let a=t.getEventTopic(r);n?(a!==n[0]&&Fr.throwArgumentError("topic mismatch","topics",n),i.topics=n.slice()):i.topics=[a],super(Hr(i),i),ie(this,"address",e),ie(this,"interface",t),ie(this,"fragment",r)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(e,t)=>this.interface.decodeEventLog(this.fragment,e,t);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(t){e.args=null,e.decodeError=t}}getEmit(e){const t=pe(e.args);if(t.length)throw t[0].error;const r=(e.args||[]).slice();return r.push(e),r}}class qr extends Gr{constructor(e,t){super("*",{address:e}),ie(this,"address",e),ie(this,"interface",t)}prepareEvent(e){super.prepareEvent(e);try{const t=this.interface.parseLog(e);e.event=t.name,e.eventSignature=t.signature,e.decode=(e,r)=>this.interface.decodeEventLog(t.eventFragment,e,r),e.args=t.args}catch(e){}}}class Yr{constructor(e,t,r){var n=this;Fr.checkNew(new.target,Qr),ie(this,"interface",ae(new.target,"getInterface")(t)),null==r?(ie(this,"provider",null),ie(this,"signer",null)):cr.isSigner(r)?(ie(this,"provider",r.provider||null),ie(this,"signer",r)):ar.isProvider(r)?(ie(this,"provider",r),ie(this,"signer",null)):Fr.throwArgumentError("invalid signer or provider","signerOrProvider",r),ie(this,"callStatic",{}),ie(this,"estimateGas",{}),ie(this,"functions",{}),ie(this,"populateTransaction",{}),ie(this,"filters",{});{const e={};Object.keys(this.interface.events).forEach((t=>{const r=this.interface.events[t];ie(this.filters,t,(function(){for(var e=arguments.length,t=new Array(e),i=0;i{const r=e[t];1===r.length?ie(this.filters,t,this.filters[r[0]]):Fr.warn("Duplicate definition of ".concat(t," (").concat(r.join(", "),")"))}))}if(ie(this,"_runningEvents",{}),ie(this,"_wrappedEmits",{}),null==e&&Fr.throwArgumentError("invalid contract address or ENS name","addressOrName",e),ie(this,"address",e),this.provider)ie(this,"resolvedAddress",Ur(this.provider,e));else try{ie(this,"resolvedAddress",Promise.resolve(Me(e)))}catch(e){Fr.throwError("provider is required to use ENS name as contract address",z.b.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}const i={},a={};Object.keys(this.interface.functions).forEach((e=>{const t=this.interface.functions[e];if(a[e])Fr.warn("Duplicate ABI entry for "+JSON.stringify(e));else{a[e]=!0;{const r=t.name;i[r]||(i[r]=[]),i[r].push(e)}null==this[e]&&ie(this,e,Jr(this,t,!0)),null==this.functions[e]&&ie(this.functions,e,Jr(this,t,!1)),null==this.callStatic[e]&&ie(this.callStatic,e,Kr(this,t,!0)),null==this.populateTransaction[e]&&ie(this.populateTransaction,e,function(e,t){return function(){for(var r=arguments.length,n=new Array(r),i=0;i{const t=i[e];if(t.length>1)return;const r=t[0];try{null==this[e]&&ie(this,e,this[r])}catch(e){}null==this.functions[e]&&ie(this.functions,e,this.functions[r]),null==this.callStatic[e]&&ie(this.callStatic,e,this.callStatic[r]),null==this.populateTransaction[e]&&ie(this.populateTransaction,e,this.populateTransaction[r]),null==this.estimateGas[e]&&ie(this.estimateGas,e,this.estimateGas[r])}))}static getContractAddress(e){return Fe(e)}static getInterface(e){return tr.isInterface(e)?e:new tr(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((()=>this)):this._deployedPromise=this.provider.getCode(this.address,e).then((e=>("0x"===e&&Fr.throwError("contract not deployed",z.b.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(e){this.signer||Fr.throwError("sending a transactions require a signer",z.b.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const t=ue(e||{});return["from","to"].forEach((function(e){null!=t[e]&&Fr.throwError("cannot override "+e,z.b.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(t)))}connect(e){"string"==typeof e&&(e=new fr(e,this.provider));const t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&ie(t,"deployTransaction",this.deployTransaction),t}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return Wt.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if("string"==typeof e){if("error"===e)return this._normalizeRunningEvent(new zr);if("event"===e)return this._normalizeRunningEvent(new Gr("event",null));if("*"===e)return this._normalizeRunningEvent(new qr(this.address,this.interface));const t=this.interface.getEvent(e);return this._normalizeRunningEvent(new Xr(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{const t=e.topics[0];if("string"!=typeof t)throw new Error("invalid topic");const r=this.interface.getEvent(t);return this._normalizeRunningEvent(new Xr(this.address,this.interface,r,e.topics))}catch(e){}const t={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new Gr(Hr(t),t))}return this._normalizeRunningEvent(new qr(this.address,this.interface))}_checkRunningEvents(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag];const t=this._wrappedEmits[e.tag];t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,t,r){const n=fe(t);return n.removeListener=()=>{r&&(e.removeListener(r),this._checkRunningEvents(e))},n.getBlock=()=>this.provider.getBlock(t.blockHash),n.getTransaction=()=>this.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>this.provider.getTransactionReceipt(t.transactionHash),e.prepareEvent(n),n}_addEventListener(e,t,r){if(this.provider||Fr.throwError("events require a provider or a signer with a provider",z.b.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,r),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const r=r=>{let n=this._wrapEvent(e,r,t);if(null==n.decodeError)try{const t=e.getEmit(n);this.emit(e.filter,...t)}catch(e){n.decodeError=e.error}null!=e.filter&&this.emit("event",n),null!=n.decodeError&&this.emit("error",n.decodeError,n)};this._wrappedEmits[e.tag]=r,null!=e.filter&&this.provider.on(e.filter,r)}}queryFilter(e,t,r){const n=this._getRunningEvent(e),i=ue(n.filter);return"string"==typeof t&&Object(J.l)(t,32)?(null!=r&&Fr.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),i.blockHash=t):(i.fromBlock=null!=t?t:0,i.toBlock=null!=r?r:"latest"),this.provider.getLogs(i).then((e=>e.map((e=>this._wrapEvent(n,e,null)))))}on(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}once(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}emit(e){if(!this.provider)return!1;for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n0;return this._checkRunningEvents(i),a}listenerCount(e){return this.provider?null==e?Object.keys(this._runningEvents).reduce(((e,t)=>e+this._runningEvents[t].listenerCount()),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(null==e){const e=[];for(let t in this._runningEvents)this._runningEvents[t].listeners().forEach((t=>{e.push(t)}));return e}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(null==e){for(const e in this._runningEvents){const t=this._runningEvents[e];t.removeAllListeners(),this._checkRunningEvents(t)}return this}const t=this._getRunningEvent(e);return t.removeAllListeners(),this._checkRunningEvents(t),this}off(e,t){if(!this.provider)return this;const r=this._getRunningEvent(e);return r.removeListener(t),this._checkRunningEvents(r),this}removeListener(e,t){return this.off(e,t)}}class Qr extends Yr{}class Zr{constructor(e,t,r){let n=null;n="string"==typeof t?t:Object(J.j)(t)?Object(J.i)(t):t&&"string"==typeof t.object?t.object:"!","0x"!==n.substring(0,2)&&(n="0x"+n),(!Object(J.l)(n)||n.length%2)&&Fr.throwArgumentError("invalid bytecode","bytecode",t),r&&!cr.isSigner(r)&&Fr.throwArgumentError("invalid signer","signer",r),ie(this,"bytecode",n),ie(this,"interface",ae(new.target,"getInterface")(e)),ie(this,"signer",r||null)}getDeployTransaction(){let e={};for(var t=arguments.length,r=new Array(t),n=0;n{null!=e[t]&&Fr.throwError("cannot override "+t,z.b.errors.UNSUPPORTED_OPERATION,{operation:t})})),e.value&&(Z.from(e.value).isZero()||this.interface.deploy.payable||Fr.throwError("non-payable constructor cannot override value",z.b.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:e.value})),Fr.checkArgumentCount(r.length,this.interface.deploy.inputs.length," in Contract constructor"),e.data=Object(J.i)(Object(J.b)([this.bytecode,this.interface.encodeDeploy(r)])),e}deploy(){for(var e=arguments.length,t=new Array(e),r=0;r=0&&e<=256&&!(e%1)?"1"+nn.substring(0,e):Wr.throwArgumentError("invalid decimal size","decimals",e)}function on(e,t){null==t&&(t=0);const r=an(t),n=(e=Z.from(e)).lt(en);n&&(e=e.mul(tn));let i=e.mod(r).toString();for(;i.length2&&Wr.throwArgumentError("too many decimal points","value",e);let a=i[0],o=i[1];for(a||(a="0"),o||(o="0");"0"===o[o.length-1];)o=o.substring(0,o.length-1);for(o.length>r.length-1&&rn("fractional component exceeds decimals","underflow","parseFixed"),""===o&&(o="0");o.lengthnull==e[t]?n:(typeof e[t]!==r&&Wr.throwArgumentError("invalid fixed format ("+t+" not "+r+")","format."+t,e[t]),e[t]);t=i("signed","boolean",t),r=i("width","number",r),n=i("decimals","number",n)}return r%8&&Wr.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&Wr.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new un($r,t,r,n)}}class ln{constructor(e,t,r,n){Wr.checkNew(new.target,ln),e!==$r&&Wr.throwError("cannot use FixedNumber constructor; use FixedNumber.from",z.b.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=t,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&Wr.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=sn(this._value,this.format.decimals),r=sn(e._value,e.format.decimals);return ln.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=sn(this._value,this.format.decimals),r=sn(e._value,e.format.decimals);return ln.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=sn(this._value,this.format.decimals),r=sn(e._value,e.format.decimals);return ln.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=sn(this._value,this.format.decimals),r=sn(e._value,e.format.decimals);return ln.fromValue(t.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=ln.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(cn.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=ln.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(cn.toFormat(t.format))),t}round(e){null==e&&(e=0);const t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&Wr.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const r=ln.from("1"+nn.substring(0,e),this.format),n=fn.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&Wr.throwArgumentError("invalid byte width","width",e);const t=Z.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return Object(J.h)(t,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return ln.fromString(this._value,e)}static fromValue(e,t,r){return null!=r||null==t||function(e){return null!=e&&(Z.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||Object(J.l)(e)||"bigint"==typeof e||Object(J.j)(e))}(t)||(r=t,t=null),null==t&&(t=0),null==r&&(r="fixed"),ln.fromString(on(e,t),un.from(r))}static fromString(e,t){null==t&&(t="fixed");const r=un.from(t),n=sn(e,r.decimals);!r.signed&&n.lt(en)&&rn("unsigned value cannot be negative","overflow","value",e);let i=null;r.signed?i=n.toTwos(r.width).toHexString():(i=n.toHexString(),i=Object(J.h)(i,r.width/8));const a=on(n,r.decimals);return new ln($r,i,a,r)}static fromBytes(e,t){null==t&&(t="fixed");const r=un.from(t);if(Object(J.a)(e).length>r.width/8)throw new Error("overflow");let n=Z.from(e);r.signed&&(n=n.fromTwos(r.width));const i=n.toTwos((r.signed?0:1)+r.width).toHexString(),a=on(n,r.decimals);return new ln($r,i,a,r)}static from(e,t){if("string"==typeof e)return ln.fromString(e,t);if(Object(J.j)(e))return ln.fromBytes(e,t);try{return ln.fromValue(e,0,t)}catch(e){if(e.code!==z.b.errors.INVALID_ARGUMENT)throw e}return Wr.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const cn=ln.from(1),fn=ln.from("0.5");function hn(e){return"string"==typeof e&&(e=Ge(e)),Se(Object(J.b)([Ge("\x19Ethereum Signed Message:\n"),Ge(String(e.length)),e]))}var dn=function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))};const pn=new z.b("hash/5.4.0"),gn=new Uint8Array(32);gn.fill(0);const yn=Z.from(-1),mn=Z.from(0),vn=Z.from(1),bn=Z.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Sn=Object(J.h)(vn.toHexString(),32),wn=Object(J.h)(mn.toHexString(),32),En={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},An=["name","version","chainId","verifyingContract","salt"];function Tn(e){return function(t){return"string"!=typeof t&&pn.throwArgumentError("invalid domain value for "+JSON.stringify(e),"domain."+e,t),t}}const Cn={name:Tn("name"),version:Tn("version"),chainId:function(e){try{return Z.from(e).toString()}catch(e){}return pn.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return Me(e).toLowerCase()}catch(e){}return pn.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{const t=Object(J.a)(e);if(32!==t.length)throw new Error("bad length");return Object(J.i)(t)}catch(e){}return pn.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function In(e){{const t=e.match(/^(u?)int(\d*)$/);if(t){const r=""===t[1],n=parseInt(t[2]||"256");(n%8!=0||n>256||t[2]&&t[2]!==String(n))&&pn.throwArgumentError("invalid numeric width","type",e);const i=bn.mask(r?n-1:n),a=r?i.add(vn).mul(yn):mn;return function(t){const r=Z.from(t);return(r.lt(a)||r.gt(i))&&pn.throwArgumentError("value out-of-bounds for "+e,"value",t),Object(J.h)(r.toTwos(256).toHexString(),32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return(0===r||r>32||t[1]!==String(r))&&pn.throwArgumentError("invalid bytes width","type",e),function(t){return Object(J.a)(t).length!==r&&pn.throwArgumentError("invalid length for "+e,"value",t),function(e){const t=Object(J.a)(e),r=t.length%32;return r?Object(J.c)([t,gn.slice(r)]):Object(J.i)(t)}(t)}}}switch(e){case"address":return function(e){return Object(J.h)(Me(e),32)};case"bool":return function(e){return e?Sn:wn};case"bytes":return function(e){return Se(e)};case"string":return function(e){return Ze(e)}}return null}function kn(e,t){return"".concat(e,"(").concat(t.map((e=>{let{name:t,type:r}=e;return r+" "+t})).join(","),")")}class Bn{constructor(e){ie(this,"types",Object.freeze(fe(e))),ie(this,"_encoderCache",{}),ie(this,"_types",{});const t={},r={},n={};Object.keys(e).forEach((e=>{t[e]={},r[e]=[],n[e]={}}));for(const a in e){const n={};e[a].forEach((i=>{n[i.name]&&pn.throwArgumentError("duplicate variable name ".concat(JSON.stringify(i.name)," in ").concat(JSON.stringify(a)),"types",e),n[i.name]=!0;const o=i.type.match(/^([^\x5b]*)(\x5b|$)/)[1];o===a&&pn.throwArgumentError("circular type reference to "+JSON.stringify(o),"types",e),In(o)||(r[o]||pn.throwArgumentError("unknown type "+JSON.stringify(o),"types",e),r[o].push(a),t[a][o]=!0)}))}const i=Object.keys(r).filter((e=>0===r[e].length));0===i.length?pn.throwArgumentError("missing primary type","types",e):i.length>1&&pn.throwArgumentError("ambiguous primary types or unused types: "+i.map((e=>JSON.stringify(e))).join(", "),"types",e),ie(this,"primaryType",i[0]),function i(a,o){o[a]&&pn.throwArgumentError("circular type reference to "+JSON.stringify(a),"types",e),o[a]=!0,Object.keys(t[a]).forEach((e=>{r[e]&&(i(e,o),Object.keys(o).forEach((t=>{n[t][e]=!0})))})),delete o[a]}(this.primaryType,{});for(const a in n){const t=Object.keys(n[a]);t.sort(),this._types[a]=kn(a,e[a])+t.map((t=>kn(t,e[t]))).join("")}}getEncoder(e){let t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}_getEncoder(e){{const t=In(e);if(t)return t}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const e=t[1],r=this.getEncoder(e),n=parseInt(t[3]);return t=>{n>=0&&t.length!==n&&pn.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let i=t.map(r);return this._types[e]&&(i=i.map(Se)),Se(Object(J.c)(i))}}const r=this.types[e];if(r){const t=Ze(this._types[e]);return e=>{const n=r.map((t=>{let{name:r,type:n}=t;const i=this.getEncoder(n)(e[r]);return this._types[n]?Se(i):i}));return n.unshift(t),Object(J.c)(n)}}return pn.throwArgumentError("unknown type: "+e,"type",e)}encodeType(e){const t=this._types[e];return t||pn.throwArgumentError("unknown type: "+JSON.stringify(e),"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return Se(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){if(In(e))return r(e,t);const n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const e=n[1],i=parseInt(n[3]);return i>=0&&t.length!==i&&pn.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((t=>this._visit(e,t,r)))}const i=this.types[e];return i?i.reduce(((e,n)=>{let{name:i,type:a}=n;return e[i]=this._visit(a,t[i],r),e}),{}):pn.throwArgumentError("unknown type: "+e,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new Bn(e)}static getPrimaryType(e){return Bn.from(e).primaryType}static hashStruct(e,t,r){return Bn.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){const n=En[r];n||pn.throwArgumentError("invalid typed-data domain key: "+JSON.stringify(r),"domain",e),t.push({name:r,type:n})}return t.sort(((e,t)=>An.indexOf(e.name)-An.indexOf(t.name))),Bn.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return Object(J.c)(["0x1901",Bn.hashDomain(e),Bn.from(t).hash(r)])}static hash(e,t,r){return Se(Bn.encode(e,t,r))}static resolveNames(e,t,r,n){return dn(this,void 0,void 0,(function*(){e=ue(e);const i={};e.verifyingContract&&!Object(J.l)(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const a=Bn.from(t);a.visit(r,((e,t)=>("address"!==e||Object(J.l)(t,20)||(i[t]="0x"),t)));for(const e in i)i[e]=yield n(e);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),r=a.visit(r,((e,t)=>"address"===e&&i[t]?i[t]:t)),{domain:e,value:r}}))}static getPayload(e,t,r){Bn.hashDomain(e);const n={},i=[];An.forEach((t=>{const r=e[t];null!=r&&(n[t]=Cn[t](r),i.push({name:t,type:En[t]}))}));const a=Bn.from(t),o=ue(t);return o.EIP712Domain?pn.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):o.EIP712Domain=i,a.encode(r),{types:o,domain:n,primaryType:a.primaryType,message:a.visit(r,((e,t)=>{if(e.match(/^bytes(\d*)/))return Object(J.i)(Object(J.a)(t));if(e.match(/^u?int/))return Z.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&pn.throwArgumentError("invalid string","value",t),t}return pn.throwArgumentError("unsupported type","type",e)}))}}}class _n{constructor(e){ie(this,"alphabet",e),ie(this,"base",e.length),ie(this,"_alphabetMap",{}),ie(this,"_leader",e.charAt(0));for(let t=0;t0;)r.push(e%this.base),e=e/this.base|0}let n="";for(let i=0;0===t[i]&&i=0;--i)n+=this.alphabet[r[i]];return n}decode(e){if("string"!=typeof e)throw new TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let r=0;r>=8;for(;i>0;)t.push(255&i),i>>=8}for(let r=0;e[r]===this._leader&&r>24&255,u[t.length+1]=f>>16&255,u[t.length+2]=f>>8&255,u[t.length+3]=255&f;let h=Object(J.a)(xn(i,e,u));a||(a=h.length,c=new Uint8Array(a),o=Math.ceil(n/a),l=n-(o-1)*a),c.set(h);for(let t=1;te>=65&&e<=90||e>=97&&e<=123)))}function Zn(e){if(null==Yn&&(Yn="A/bacoAbdomenAbejaAbiertoAbogadoAbonoAbortoAbrazoAbrirAbueloAbusoAcabarAcademiaAccesoAccio/nAceiteAcelgaAcentoAceptarA/cidoAclararAcne/AcogerAcosoActivoActoActrizActuarAcudirAcuerdoAcusarAdictoAdmitirAdoptarAdornoAduanaAdultoAe/reoAfectarAficio/nAfinarAfirmarA/gilAgitarAgoni/aAgostoAgotarAgregarAgrioAguaAgudoA/guilaAgujaAhogoAhorroAireAislarAjedrezAjenoAjusteAlacra/nAlambreAlarmaAlbaA/lbumAlcaldeAldeaAlegreAlejarAlertaAletaAlfilerAlgaAlgodo/nAliadoAlientoAlivioAlmaAlmejaAlmi/barAltarAltezaAltivoAltoAlturaAlumnoAlzarAmableAmanteAmapolaAmargoAmasarA/mbarA/mbitoAmenoAmigoAmistadAmorAmparoAmplioAnchoAncianoAnclaAndarAnde/nAnemiaA/nguloAnilloA/nimoAni/sAnotarAntenaAntiguoAntojoAnualAnularAnuncioA~adirA~ejoA~oApagarAparatoApetitoApioAplicarApodoAporteApoyoAprenderAprobarApuestaApuroAradoAra~aArarA/rbitroA/rbolArbustoArchivoArcoArderArdillaArduoA/reaA/ridoAriesArmoni/aArne/sAromaArpaArpo/nArregloArrozArrugaArteArtistaAsaAsadoAsaltoAscensoAsegurarAseoAsesorAsientoAsiloAsistirAsnoAsombroA/speroAstillaAstroAstutoAsumirAsuntoAtajoAtaqueAtarAtentoAteoA/ticoAtletaA/tomoAtraerAtrozAtu/nAudazAudioAugeAulaAumentoAusenteAutorAvalAvanceAvaroAveAvellanaAvenaAvestruzAvio/nAvisoAyerAyudaAyunoAzafra/nAzarAzoteAzu/carAzufreAzulBabaBaborBacheBahi/aBaileBajarBalanzaBalco/nBaldeBambu/BancoBandaBa~oBarbaBarcoBarnizBarroBa/sculaBasto/nBasuraBatallaBateri/aBatirBatutaBau/lBazarBebe/BebidaBelloBesarBesoBestiaBichoBienBingoBlancoBloqueBlusaBoaBobinaBoboBocaBocinaBodaBodegaBoinaBolaBoleroBolsaBombaBondadBonitoBonoBonsa/iBordeBorrarBosqueBoteBoti/nBo/vedaBozalBravoBrazoBrechaBreveBrilloBrincoBrisaBrocaBromaBronceBroteBrujaBruscoBrutoBuceoBucleBuenoBueyBufandaBufo/nBu/hoBuitreBultoBurbujaBurlaBurroBuscarButacaBuzo/nCaballoCabezaCabinaCabraCacaoCada/verCadenaCaerCafe/Cai/daCaima/nCajaCajo/nCalCalamarCalcioCaldoCalidadCalleCalmaCalorCalvoCamaCambioCamelloCaminoCampoCa/ncerCandilCanelaCanguroCanicaCantoCa~aCa~o/nCaobaCaosCapazCapita/nCapoteCaptarCapuchaCaraCarbo/nCa/rcelCaretaCargaCari~oCarneCarpetaCarroCartaCasaCascoCaseroCaspaCastorCatorceCatreCaudalCausaCazoCebollaCederCedroCeldaCe/lebreCelosoCe/lulaCementoCenizaCentroCercaCerdoCerezaCeroCerrarCertezaCe/spedCetroChacalChalecoChampu/ChanclaChapaCharlaChicoChisteChivoChoqueChozaChuletaChuparCiclo/nCiegoCieloCienCiertoCifraCigarroCimaCincoCineCintaCipre/sCircoCiruelaCisneCitaCiudadClamorClanClaroClaseClaveClienteClimaCli/nicaCobreCoccio/nCochinoCocinaCocoCo/digoCodoCofreCogerCoheteCoji/nCojoColaColchaColegioColgarColinaCollarColmoColumnaCombateComerComidaCo/modoCompraCondeConejoCongaConocerConsejoContarCopaCopiaCorazo/nCorbataCorchoCordo/nCoronaCorrerCoserCosmosCostaCra/neoCra/terCrearCrecerCrei/doCremaCri/aCrimenCriptaCrisisCromoCro/nicaCroquetaCrudoCruzCuadroCuartoCuatroCuboCubrirCucharaCuelloCuentoCuerdaCuestaCuevaCuidarCulebraCulpaCultoCumbreCumplirCunaCunetaCuotaCupo/nCu/pulaCurarCuriosoCursoCurvaCutisDamaDanzaDarDardoDa/tilDeberDe/bilDe/cadaDecirDedoDefensaDefinirDejarDelfi/nDelgadoDelitoDemoraDensoDentalDeporteDerechoDerrotaDesayunoDeseoDesfileDesnudoDestinoDesvi/oDetalleDetenerDeudaDi/aDiabloDiademaDiamanteDianaDiarioDibujoDictarDienteDietaDiezDifi/cilDignoDilemaDiluirDineroDirectoDirigirDiscoDise~oDisfrazDivaDivinoDobleDoceDolorDomingoDonDonarDoradoDormirDorsoDosDosisDrago/nDrogaDuchaDudaDueloDue~oDulceDu/oDuqueDurarDurezaDuroE/banoEbrioEcharEcoEcuadorEdadEdicio/nEdificioEditorEducarEfectoEficazEjeEjemploElefanteElegirElementoElevarElipseE/liteElixirElogioEludirEmbudoEmitirEmocio/nEmpateEmpe~oEmpleoEmpresaEnanoEncargoEnchufeEnci/aEnemigoEneroEnfadoEnfermoEnga~oEnigmaEnlaceEnormeEnredoEnsayoEnse~arEnteroEntrarEnvaseEnvi/oE/pocaEquipoErizoEscalaEscenaEscolarEscribirEscudoEsenciaEsferaEsfuerzoEspadaEspejoEspi/aEsposaEspumaEsqui/EstarEsteEstiloEstufaEtapaEternoE/ticaEtniaEvadirEvaluarEventoEvitarExactoExamenExcesoExcusaExentoExigirExilioExistirE/xitoExpertoExplicarExponerExtremoFa/bricaFa/bulaFachadaFa/cilFactorFaenaFajaFaldaFalloFalsoFaltarFamaFamiliaFamosoFarao/nFarmaciaFarolFarsaFaseFatigaFaunaFavorFaxFebreroFechaFelizFeoFeriaFerozFe/rtilFervorFesti/nFiableFianzaFiarFibraFiccio/nFichaFideoFiebreFielFieraFiestaFiguraFijarFijoFilaFileteFilialFiltroFinFincaFingirFinitoFirmaFlacoFlautaFlechaFlorFlotaFluirFlujoFlu/orFobiaFocaFogataFogo/nFolioFolletoFondoFormaForroFortunaForzarFosaFotoFracasoFra/gilFranjaFraseFraudeFrei/rFrenoFresaFri/oFritoFrutaFuegoFuenteFuerzaFugaFumarFuncio/nFundaFurgo/nFuriaFusilFu/tbolFuturoGacelaGafasGaitaGajoGalaGaleri/aGalloGambaGanarGanchoGangaGansoGarajeGarzaGasolinaGastarGatoGavila/nGemeloGemirGenGe/neroGenioGenteGeranioGerenteGermenGestoGiganteGimnasioGirarGiroGlaciarGloboGloriaGolGolfoGolosoGolpeGomaGordoGorilaGorraGotaGoteoGozarGradaGra/ficoGranoGrasaGratisGraveGrietaGrilloGripeGrisGritoGrosorGru/aGruesoGrumoGrupoGuanteGuapoGuardiaGuerraGui/aGui~oGuionGuisoGuitarraGusanoGustarHaberHa/bilHablarHacerHachaHadaHallarHamacaHarinaHazHaza~aHebillaHebraHechoHeladoHelioHembraHerirHermanoHe/roeHervirHieloHierroHi/gadoHigieneHijoHimnoHistoriaHocicoHogarHogueraHojaHombreHongoHonorHonraHoraHormigaHornoHostilHoyoHuecoHuelgaHuertaHuesoHuevoHuidaHuirHumanoHu/medoHumildeHumoHundirHuraca/nHurtoIconoIdealIdiomaI/doloIglesiaIglu/IgualIlegalIlusio/nImagenIma/nImitarImparImperioImponerImpulsoIncapazI/ndiceInerteInfielInformeIngenioInicioInmensoInmuneInnatoInsectoInstanteIntere/sI/ntimoIntuirInu/tilInviernoIraIrisIroni/aIslaIsloteJabali/Jabo/nJamo/nJarabeJardi/nJarraJaulaJazmi/nJefeJeringaJineteJornadaJorobaJovenJoyaJuergaJuevesJuezJugadorJugoJugueteJuicioJuncoJunglaJunioJuntarJu/piterJurarJustoJuvenilJuzgarKiloKoalaLabioLacioLacraLadoLadro/nLagartoLa/grimaLagunaLaicoLamerLa/minaLa/mparaLanaLanchaLangostaLanzaLa/pizLargoLarvaLa/stimaLataLa/texLatirLaurelLavarLazoLealLeccio/nLecheLectorLeerLegio/nLegumbreLejanoLenguaLentoLe~aLeo/nLeopardoLesio/nLetalLetraLeveLeyendaLibertadLibroLicorLi/derLidiarLienzoLigaLigeroLimaLi/miteLimo/nLimpioLinceLindoLi/neaLingoteLinoLinternaLi/quidoLisoListaLiteraLitioLitroLlagaLlamaLlantoLlaveLlegarLlenarLlevarLlorarLloverLluviaLoboLocio/nLocoLocuraLo/gicaLogroLombrizLomoLonjaLoteLuchaLucirLugarLujoLunaLunesLupaLustroLutoLuzMacetaMachoMaderaMadreMaduroMaestroMafiaMagiaMagoMai/zMaldadMaletaMallaMaloMama/MamboMamutMancoMandoManejarMangaManiqui/ManjarManoMansoMantaMa~anaMapaMa/quinaMarMarcoMareaMarfilMargenMaridoMa/rmolMarro/nMartesMarzoMasaMa/scaraMasivoMatarMateriaMatizMatrizMa/ximoMayorMazorcaMechaMedallaMedioMe/dulaMejillaMejorMelenaMelo/nMemoriaMenorMensajeMenteMenu/MercadoMerengueMe/ritoMesMeso/nMetaMeterMe/todoMetroMezclaMiedoMielMiembroMigaMilMilagroMilitarMillo/nMimoMinaMineroMi/nimoMinutoMiopeMirarMisaMiseriaMisilMismoMitadMitoMochilaMocio/nModaModeloMohoMojarMoldeMolerMolinoMomentoMomiaMonarcaMonedaMonjaMontoMo~oMoradaMorderMorenoMorirMorroMorsaMortalMoscaMostrarMotivoMoverMo/vilMozoMuchoMudarMuebleMuelaMuerteMuestraMugreMujerMulaMuletaMultaMundoMu~ecaMuralMuroMu/sculoMuseoMusgoMu/sicaMusloNa/carNacio/nNadarNaipeNaranjaNarizNarrarNasalNatalNativoNaturalNa/useaNavalNaveNavidadNecioNe/ctarNegarNegocioNegroNeo/nNervioNetoNeutroNevarNeveraNichoNidoNieblaNietoNi~ezNi~oNi/tidoNivelNoblezaNocheNo/minaNoriaNormaNorteNotaNoticiaNovatoNovelaNovioNubeNucaNu/cleoNudilloNudoNueraNueveNuezNuloNu/meroNutriaOasisObesoObispoObjetoObraObreroObservarObtenerObvioOcaOcasoOce/anoOchentaOchoOcioOcreOctavoOctubreOcultoOcuparOcurrirOdiarOdioOdiseaOesteOfensaOfertaOficioOfrecerOgroOi/doOi/rOjoOlaOleadaOlfatoOlivoOllaOlmoOlorOlvidoOmbligoOndaOnzaOpacoOpcio/nO/peraOpinarOponerOptarO/pticaOpuestoOracio/nOradorOralO/rbitaOrcaOrdenOrejaO/rganoOrgi/aOrgulloOrienteOrigenOrillaOroOrquestaOrugaOsadi/aOscuroOseznoOsoOstraOto~oOtroOvejaO/vuloO/xidoOxi/genoOyenteOzonoPactoPadrePaellaPa/ginaPagoPai/sPa/jaroPalabraPalcoPaletaPa/lidoPalmaPalomaPalparPanPanalPa/nicoPanteraPa~ueloPapa/PapelPapillaPaquetePararParcelaParedParirParoPa/rpadoParquePa/rrafoPartePasarPaseoPasio/nPasoPastaPataPatioPatriaPausaPautaPavoPayasoPeato/nPecadoPeceraPechoPedalPedirPegarPeinePelarPelda~oPeleaPeligroPellejoPeloPelucaPenaPensarPe~o/nPeo/nPeorPepinoPeque~oPeraPerchaPerderPerezaPerfilPericoPerlaPermisoPerroPersonaPesaPescaPe/simoPesta~aPe/taloPetro/leoPezPezu~aPicarPicho/nPiePiedraPiernaPiezaPijamaPilarPilotoPimientaPinoPintorPinzaPi~aPiojoPipaPirataPisarPiscinaPisoPistaPito/nPizcaPlacaPlanPlataPlayaPlazaPleitoPlenoPlomoPlumaPluralPobrePocoPoderPodioPoemaPoesi/aPoetaPolenPolici/aPolloPolvoPomadaPomeloPomoPompaPonerPorcio/nPortalPosadaPoseerPosiblePostePotenciaPotroPozoPradoPrecozPreguntaPremioPrensaPresoPrevioPrimoPri/ncipePrisio/nPrivarProaProbarProcesoProductoProezaProfesorProgramaProlePromesaProntoPropioPro/ximoPruebaPu/blicoPucheroPudorPuebloPuertaPuestoPulgaPulirPulmo/nPulpoPulsoPumaPuntoPu~alPu~oPupaPupilaPure/QuedarQuejaQuemarQuererQuesoQuietoQui/micaQuinceQuitarRa/banoRabiaRaboRacio/nRadicalRai/zRamaRampaRanchoRangoRapazRa/pidoRaptoRasgoRaspaRatoRayoRazaRazo/nReaccio/nRealidadReba~oReboteRecaerRecetaRechazoRecogerRecreoRectoRecursoRedRedondoReducirReflejoReformaRefra/nRefugioRegaloRegirReglaRegresoRehe/nReinoRei/rRejaRelatoRelevoRelieveRellenoRelojRemarRemedioRemoRencorRendirRentaRepartoRepetirReposoReptilResRescateResinaRespetoRestoResumenRetiroRetornoRetratoReunirReve/sRevistaReyRezarRicoRiegoRiendaRiesgoRifaRi/gidoRigorRinco/nRi~o/nRi/oRiquezaRisaRitmoRitoRizoRobleRoceRociarRodarRodeoRodillaRoerRojizoRojoRomeroRomperRonRoncoRondaRopaRoperoRosaRoscaRostroRotarRubi/RuborRudoRuedaRugirRuidoRuinaRuletaRuloRumboRumorRupturaRutaRutinaSa/badoSaberSabioSableSacarSagazSagradoSalaSaldoSaleroSalirSalmo/nSalo/nSalsaSaltoSaludSalvarSambaSancio/nSandi/aSanearSangreSanidadSanoSantoSapoSaqueSardinaSarte/nSastreSata/nSaunaSaxofo/nSeccio/nSecoSecretoSectaSedSeguirSeisSelloSelvaSemanaSemillaSendaSensorSe~alSe~orSepararSepiaSequi/aSerSerieSermo/nServirSesentaSesio/nSetaSetentaSeveroSexoSextoSidraSiestaSieteSigloSignoSi/labaSilbarSilencioSillaSi/mboloSimioSirenaSistemaSitioSituarSobreSocioSodioSolSolapaSoldadoSoledadSo/lidoSoltarSolucio/nSombraSondeoSonidoSonoroSonrisaSopaSoplarSoporteSordoSorpresaSorteoSoste/nSo/tanoSuaveSubirSucesoSudorSuegraSueloSue~oSuerteSufrirSujetoSulta/nSumarSuperarSuplirSuponerSupremoSurSurcoSure~oSurgirSustoSutilTabacoTabiqueTablaTabu/TacoTactoTajoTalarTalcoTalentoTallaTalo/nTama~oTamborTangoTanqueTapaTapeteTapiaTapo/nTaquillaTardeTareaTarifaTarjetaTarotTarroTartaTatuajeTauroTazaTazo/nTeatroTechoTeclaTe/cnicaTejadoTejerTejidoTelaTele/fonoTemaTemorTemploTenazTenderTenerTenisTensoTeori/aTerapiaTercoTe/rminoTernuraTerrorTesisTesoroTestigoTeteraTextoTezTibioTiburo/nTiempoTiendaTierraTiesoTigreTijeraTildeTimbreTi/midoTimoTintaTi/oTi/picoTipoTiraTiro/nTita/nTi/tereTi/tuloTizaToallaTobilloTocarTocinoTodoTogaToldoTomarTonoTontoToparTopeToqueTo/raxToreroTormentaTorneoToroTorpedoTorreTorsoTortugaTosToscoToserTo/xicoTrabajoTractorTraerTra/ficoTragoTrajeTramoTranceTratoTraumaTrazarTre/bolTreguaTreintaTrenTreparTresTribuTrigoTripaTristeTriunfoTrofeoTrompaTroncoTropaTroteTrozoTrucoTruenoTrufaTuberi/aTuboTuertoTumbaTumorTu/nelTu/nicaTurbinaTurismoTurnoTutorUbicarU/lceraUmbralUnidadUnirUniversoUnoUntarU~aUrbanoUrbeUrgenteUrnaUsarUsuarioU/tilUtopi/aUvaVacaVaci/oVacunaVagarVagoVainaVajillaValeVa/lidoValleValorVa/lvulaVampiroVaraVariarVaro/nVasoVecinoVectorVehi/culoVeinteVejezVelaVeleroVelozVenaVencerVendaVenenoVengarVenirVentaVenusVerVeranoVerboVerdeVeredaVerjaVersoVerterVi/aViajeVibrarVicioVi/ctimaVidaVi/deoVidrioViejoViernesVigorVilVillaVinagreVinoVi~edoVioli/nViralVirgoVirtudVisorVi/speraVistaVitaminaViudoVivazViveroVivirVivoVolca/nVolumenVolverVorazVotarVotoVozVueloVulgarYacerYateYeguaYemaYernoYesoYodoYogaYogurZafiroZanjaZapatoZarzaZonaZorroZumoZurdo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" ").map((e=>function(e){const t=[];return Array.prototype.forEach.call(Ge(e),(e=>{47===e?(t.push(204),t.push(129)):126===e?(t.push(110),t.push(204),t.push(131)):t.push(e)})),Ye(t)}(e))),Yn.forEach(((e,t)=>{qn[Qn(e)]=t})),"0xf74fb7092aeacdfbf8959557de22098da512207fb9f109cb526994938cf40300"!==Vn.check(e)))throw Yn=null,new Error("BIP39 Wordlist for es (Spanish) FAILED")}const Wn=new class extends Vn{constructor(){super("es")}getWord(e){return Zn(this),Yn[e]}getWordIndex(e){return Zn(this),qn[Qn(e)]}};Vn.register(Wn);let $n=null;const ei={};function ti(e){return jn.checkNormalize(),Ye(Array.prototype.filter.call(Ge(e.normalize("NFD").toLowerCase()),(e=>e>=65&&e<=90||e>=97&&e<=123)))}function ri(e){if(null==$n&&($n="AbaisserAbandonAbdiquerAbeilleAbolirAborderAboutirAboyerAbrasifAbreuverAbriterAbrogerAbruptAbsenceAbsoluAbsurdeAbusifAbyssalAcade/mieAcajouAcarienAccablerAccepterAcclamerAccoladeAccrocheAccuserAcerbeAchatAcheterAcidulerAcierAcompteAcque/rirAcronymeActeurActifActuelAdepteAde/quatAdhe/sifAdjectifAdjugerAdmettreAdmirerAdopterAdorerAdoucirAdresseAdroitAdulteAdverbeAe/rerAe/ronefAffaireAffecterAfficheAffreuxAffublerAgacerAgencerAgileAgiterAgraferAgre/ableAgrumeAiderAiguilleAilierAimableAisanceAjouterAjusterAlarmerAlchimieAlerteAlge-breAlgueAlie/nerAlimentAlle/gerAlliageAllouerAllumerAlourdirAlpagaAltesseAlve/oleAmateurAmbiguAmbreAme/nagerAmertumeAmidonAmiralAmorcerAmourAmovibleAmphibieAmpleurAmusantAnalyseAnaphoreAnarchieAnatomieAncienAne/antirAngleAngoisseAnguleuxAnimalAnnexerAnnonceAnnuelAnodinAnomalieAnonymeAnormalAntenneAntidoteAnxieuxApaiserApe/ritifAplanirApologieAppareilAppelerApporterAppuyerAquariumAqueducArbitreArbusteArdeurArdoiseArgentArlequinArmatureArmementArmoireArmureArpenterArracherArriverArroserArsenicArte/rielArticleAspectAsphalteAspirerAssautAsservirAssietteAssocierAssurerAsticotAstreAstuceAtelierAtomeAtriumAtroceAttaqueAttentifAttirerAttraperAubaineAubergeAudaceAudibleAugurerAuroreAutomneAutrucheAvalerAvancerAvariceAvenirAverseAveugleAviateurAvideAvionAviserAvoineAvouerAvrilAxialAxiomeBadgeBafouerBagageBaguetteBaignadeBalancerBalconBaleineBalisageBambinBancaireBandageBanlieueBannie-reBanquierBarbierBarilBaronBarqueBarrageBassinBastionBatailleBateauBatterieBaudrierBavarderBeletteBe/lierBeloteBe/ne/ficeBerceauBergerBerlineBermudaBesaceBesogneBe/tailBeurreBiberonBicycleBiduleBijouBilanBilingueBillardBinaireBiologieBiopsieBiotypeBiscuitBisonBistouriBitumeBizarreBlafardBlagueBlanchirBlessantBlinderBlondBloquerBlousonBobardBobineBoireBoiserBolideBonbonBondirBonheurBonifierBonusBordureBorneBotteBoucleBoueuxBougieBoulonBouquinBourseBoussoleBoutiqueBoxeurBrancheBrasierBraveBrebisBre-cheBreuvageBricolerBrigadeBrillantBriocheBriqueBrochureBroderBronzerBrousseBroyeurBrumeBrusqueBrutalBruyantBuffleBuissonBulletinBureauBurinBustierButinerButoirBuvableBuvetteCabanonCabineCachetteCadeauCadreCafe/ineCaillouCaissonCalculerCalepinCalibreCalmerCalomnieCalvaireCamaradeCame/raCamionCampagneCanalCanetonCanonCantineCanularCapableCaporalCapriceCapsuleCapterCapucheCarabineCarboneCaresserCaribouCarnageCarotteCarreauCartonCascadeCasierCasqueCassureCauserCautionCavalierCaverneCaviarCe/dilleCeintureCe/lesteCelluleCendrierCensurerCentralCercleCe/re/bralCeriseCernerCerveauCesserChagrinChaiseChaleurChambreChanceChapitreCharbonChasseurChatonChaussonChavirerChemiseChenilleChe/quierChercherChevalChienChiffreChignonChime-reChiotChlorureChocolatChoisirChoseChouetteChromeChuteCigareCigogneCimenterCine/maCintrerCirculerCirerCirqueCiterneCitoyenCitronCivilClaironClameurClaquerClasseClavierClientClignerClimatClivageClocheClonageCloporteCobaltCobraCocasseCocotierCoderCodifierCoffreCognerCohe/sionCoifferCoincerCole-reColibriCollineColmaterColonelCombatCome/dieCommandeCompactConcertConduireConfierCongelerConnoterConsonneContactConvexeCopainCopieCorailCorbeauCordageCornicheCorpusCorrectCorte-geCosmiqueCostumeCotonCoudeCoupureCourageCouteauCouvrirCoyoteCrabeCrainteCravateCrayonCre/atureCre/diterCre/meuxCreuserCrevetteCriblerCrierCristalCrite-reCroireCroquerCrotaleCrucialCruelCrypterCubiqueCueillirCuille-reCuisineCuivreCulminerCultiverCumulerCupideCuratifCurseurCyanureCycleCylindreCyniqueDaignerDamierDangerDanseurDauphinDe/battreDe/biterDe/borderDe/briderDe/butantDe/calerDe/cembreDe/chirerDe/ciderDe/clarerDe/corerDe/crireDe/cuplerDe/daleDe/ductifDe/esseDe/fensifDe/filerDe/frayerDe/gagerDe/givrerDe/glutirDe/graferDe/jeunerDe/liceDe/logerDemanderDemeurerDe/molirDe/nicherDe/nouerDentelleDe/nuderDe/partDe/penserDe/phaserDe/placerDe/poserDe/rangerDe/roberDe/sastreDescenteDe/sertDe/signerDe/sobe/irDessinerDestrierDe/tacherDe/testerDe/tourerDe/tresseDevancerDevenirDevinerDevoirDiableDialogueDiamantDicterDiffe/rerDige/rerDigitalDigneDiluerDimancheDiminuerDioxydeDirectifDirigerDiscuterDisposerDissiperDistanceDivertirDiviserDocileDocteurDogmeDoigtDomaineDomicileDompterDonateurDonjonDonnerDopamineDortoirDorureDosageDoseurDossierDotationDouanierDoubleDouceurDouterDoyenDragonDraperDresserDribblerDroitureDuperieDuplexeDurableDurcirDynastieE/blouirE/carterE/charpeE/chelleE/clairerE/clipseE/cloreE/cluseE/coleE/conomieE/corceE/couterE/craserE/cre/merE/crivainE/crouE/cumeE/cureuilE/difierE/duquerEffacerEffectifEffigieEffortEffrayerEffusionE/galiserE/garerE/jecterE/laborerE/largirE/lectronE/le/gantE/le/phantE/le-veE/ligibleE/litismeE/logeE/luciderE/luderEmballerEmbellirEmbryonE/meraudeE/missionEmmenerE/motionE/mouvoirEmpereurEmployerEmporterEmpriseE/mulsionEncadrerEnche-reEnclaveEncocheEndiguerEndosserEndroitEnduireE/nergieEnfanceEnfermerEnfouirEngagerEnginEngloberE/nigmeEnjamberEnjeuEnleverEnnemiEnnuyeuxEnrichirEnrobageEnseigneEntasserEntendreEntierEntourerEntraverE/nume/rerEnvahirEnviableEnvoyerEnzymeE/olienE/paissirE/pargneE/patantE/pauleE/picerieE/pide/mieE/pierE/pilogueE/pineE/pisodeE/pitapheE/poqueE/preuveE/prouverE/puisantE/querreE/quipeE/rigerE/rosionErreurE/ruptionEscalierEspadonEspe-ceEspie-gleEspoirEspritEsquiverEssayerEssenceEssieuEssorerEstimeEstomacEstradeE/tage-reE/talerE/tancheE/tatiqueE/teindreE/tendoirE/ternelE/thanolE/thiqueEthnieE/tirerE/tofferE/toileE/tonnantE/tourdirE/trangeE/troitE/tudeEuphorieE/valuerE/vasionE/ventailE/videnceE/viterE/volutifE/voquerExactExage/rerExaucerExcellerExcitantExclusifExcuseExe/cuterExempleExercerExhalerExhorterExigenceExilerExisterExotiqueExpe/dierExplorerExposerExprimerExquisExtensifExtraireExulterFableFabuleuxFacetteFacileFactureFaiblirFalaiseFameuxFamilleFarceurFarfeluFarineFaroucheFascinerFatalFatigueFauconFautifFaveurFavoriFe/brileFe/conderFe/de/rerFe/linFemmeFe/murFendoirFe/odalFermerFe/roceFerveurFestivalFeuilleFeutreFe/vrierFiascoFicelerFictifFide-leFigureFilatureFiletageFilie-reFilleulFilmerFilouFiltrerFinancerFinirFioleFirmeFissureFixerFlairerFlammeFlasqueFlatteurFle/auFle-cheFleurFlexionFloconFloreFluctuerFluideFluvialFolieFonderieFongibleFontaineForcerForgeronFormulerFortuneFossileFoudreFouge-reFouillerFoulureFourmiFragileFraiseFranchirFrapperFrayeurFre/gateFreinerFrelonFre/mirFre/ne/sieFre-reFriableFrictionFrissonFrivoleFroidFromageFrontalFrotterFruitFugitifFuiteFureurFurieuxFurtifFusionFuturGagnerGalaxieGalerieGambaderGarantirGardienGarnirGarrigueGazelleGazonGe/antGe/latineGe/luleGendarmeGe/ne/ralGe/nieGenouGentilGe/ologieGe/ome-treGe/raniumGermeGestuelGeyserGibierGiclerGirafeGivreGlaceGlaiveGlisserGlobeGloireGlorieuxGolfeurGommeGonflerGorgeGorilleGoudronGouffreGoulotGoupilleGourmandGoutteGraduelGraffitiGraineGrandGrappinGratuitGravirGrenatGriffureGrillerGrimperGrognerGronderGrotteGroupeGrugerGrutierGruye-reGue/pardGuerrierGuideGuimauveGuitareGustatifGymnasteGyrostatHabitudeHachoirHalteHameauHangarHannetonHaricotHarmonieHarponHasardHe/liumHe/matomeHerbeHe/rissonHermineHe/ronHe/siterHeureuxHibernerHibouHilarantHistoireHiverHomardHommageHomoge-neHonneurHonorerHonteuxHordeHorizonHorlogeHormoneHorribleHouleuxHousseHublotHuileuxHumainHumbleHumideHumourHurlerHydromelHygie-neHymneHypnoseIdylleIgnorerIguaneIlliciteIllusionImageImbiberImiterImmenseImmobileImmuableImpactImpe/rialImplorerImposerImprimerImputerIncarnerIncendieIncidentInclinerIncoloreIndexerIndiceInductifIne/ditIneptieInexactInfiniInfligerInformerInfusionInge/rerInhalerInhiberInjecterInjureInnocentInoculerInonderInscrireInsecteInsigneInsoliteInspirerInstinctInsulterIntactIntenseIntimeIntrigueIntuitifInutileInvasionInventerInviterInvoquerIroniqueIrradierIrre/elIrriterIsolerIvoireIvresseJaguarJaillirJambeJanvierJardinJaugerJauneJavelotJetableJetonJeudiJeunesseJoindreJoncherJonglerJoueurJouissifJournalJovialJoyauJoyeuxJubilerJugementJuniorJuponJuristeJusticeJuteuxJuve/nileKayakKimonoKiosqueLabelLabialLabourerLace/rerLactoseLaguneLaineLaisserLaitierLambeauLamelleLampeLanceurLangageLanterneLapinLargeurLarmeLaurierLavaboLavoirLectureLe/galLe/gerLe/gumeLessiveLettreLevierLexiqueLe/zardLiasseLibe/rerLibreLicenceLicorneLie-geLie-vreLigatureLigoterLigueLimerLimiteLimonadeLimpideLine/aireLingotLionceauLiquideLisie-reListerLithiumLitigeLittoralLivreurLogiqueLointainLoisirLombricLoterieLouerLourdLoutreLouveLoyalLubieLucideLucratifLueurLugubreLuisantLumie-reLunaireLundiLuronLutterLuxueuxMachineMagasinMagentaMagiqueMaigreMaillonMaintienMairieMaisonMajorerMalaxerMale/ficeMalheurMaliceMalletteMammouthMandaterManiableManquantManteauManuelMarathonMarbreMarchandMardiMaritimeMarqueurMarronMartelerMascotteMassifMate/rielMatie-reMatraqueMaudireMaussadeMauveMaximalMe/chantMe/connuMe/dailleMe/decinMe/diterMe/duseMeilleurMe/langeMe/lodieMembreMe/moireMenacerMenerMenhirMensongeMentorMercrediMe/riteMerleMessagerMesureMe/talMe/te/oreMe/thodeMe/tierMeubleMiaulerMicrobeMietteMignonMigrerMilieuMillionMimiqueMinceMine/ralMinimalMinorerMinuteMiracleMiroiterMissileMixteMobileModerneMoelleuxMondialMoniteurMonnaieMonotoneMonstreMontagneMonumentMoqueurMorceauMorsureMortierMoteurMotifMoucheMoufleMoulinMoussonMoutonMouvantMultipleMunitionMurailleMure-neMurmureMuscleMuse/umMusicienMutationMuterMutuelMyriadeMyrtilleMyste-reMythiqueNageurNappeNarquoisNarrerNatationNationNatureNaufrageNautiqueNavireNe/buleuxNectarNe/fasteNe/gationNe/gligerNe/gocierNeigeNerveuxNettoyerNeuroneNeutronNeveuNicheNickelNitrateNiveauNobleNocifNocturneNoirceurNoisetteNomadeNombreuxNommerNormatifNotableNotifierNotoireNourrirNouveauNovateurNovembreNoviceNuageNuancerNuireNuisibleNume/roNuptialNuqueNutritifObe/irObjectifObligerObscurObserverObstacleObtenirObturerOccasionOccuperOce/anOctobreOctroyerOctuplerOculaireOdeurOdorantOffenserOfficierOffrirOgiveOiseauOisillonOlfactifOlivierOmbrageOmettreOnctueuxOndulerOne/reuxOniriqueOpaleOpaqueOpe/rerOpinionOpportunOpprimerOpterOptiqueOrageuxOrangeOrbiteOrdonnerOreilleOrganeOrgueilOrificeOrnementOrqueOrtieOscillerOsmoseOssatureOtarieOuraganOursonOutilOutragerOuvrageOvationOxydeOxyge-neOzonePaisiblePalacePalmare-sPalourdePalperPanachePandaPangolinPaniquerPanneauPanoramaPantalonPapayePapierPapoterPapyrusParadoxeParcelleParesseParfumerParlerParoleParrainParsemerPartagerParureParvenirPassionPaste-quePaternelPatiencePatronPavillonPavoiserPayerPaysagePeignePeintrePelagePe/licanPellePelousePeluchePendulePe/ne/trerPe/niblePensifPe/nuriePe/pitePe/plumPerdrixPerforerPe/riodePermuterPerplexePersilPertePeserPe/talePetitPe/trirPeuplePharaonPhobiePhoquePhotonPhrasePhysiquePianoPicturalPie-cePierrePieuvrePilotePinceauPipettePiquerPiroguePiscinePistonPivoterPixelPizzaPlacardPlafondPlaisirPlanerPlaquePlastronPlateauPleurerPlexusPliagePlombPlongerPluiePlumagePochettePoe/siePoe-tePointePoirierPoissonPoivrePolairePolicierPollenPolygonePommadePompierPonctuelPonde/rerPoneyPortiquePositionPosse/derPosturePotagerPoteauPotionPoucePoulainPoumonPourprePoussinPouvoirPrairiePratiquePre/cieuxPre/direPre/fixePre/ludePre/nomPre/sencePre/textePre/voirPrimitifPrincePrisonPriverProble-meProce/derProdigeProfondProgre-sProieProjeterProloguePromenerPropreProspe-reProte/gerProuesseProverbePrudencePruneauPsychosePublicPuceronPuiserPulpePulsarPunaisePunitifPupitrePurifierPuzzlePyramideQuasarQuerelleQuestionQuie/tudeQuitterQuotientRacineRaconterRadieuxRagondinRaideurRaisinRalentirRallongeRamasserRapideRasageRatisserRavagerRavinRayonnerRe/actifRe/agirRe/aliserRe/animerRecevoirRe/citerRe/clamerRe/colterRecruterReculerRecyclerRe/digerRedouterRefaireRe/flexeRe/formerRefrainRefugeRe/galienRe/gionRe/glageRe/gulierRe/ite/rerRejeterRejouerRelatifReleverReliefRemarqueReme-deRemiseRemonterRemplirRemuerRenardRenfortReniflerRenoncerRentrerRenvoiReplierReporterRepriseReptileRequinRe/serveRe/sineuxRe/soudreRespectResterRe/sultatRe/tablirRetenirRe/ticuleRetomberRetracerRe/unionRe/ussirRevancheRevivreRe/volteRe/vulsifRichesseRideauRieurRigideRigolerRincerRiposterRisibleRisqueRituelRivalRivie-reRocheuxRomanceRompreRonceRondinRoseauRosierRotatifRotorRotuleRougeRouilleRouleauRoutineRoyaumeRubanRubisRucheRuelleRugueuxRuinerRuisseauRuserRustiqueRythmeSablerSaboterSabreSacocheSafariSagesseSaisirSaladeSaliveSalonSaluerSamediSanctionSanglierSarcasmeSardineSaturerSaugrenuSaumonSauterSauvageSavantSavonnerScalpelScandaleSce/le/ratSce/narioSceptreSche/maScienceScinderScoreScrutinSculpterSe/anceSe/cableSe/cherSecouerSe/cre/terSe/datifSe/duireSeigneurSe/jourSe/lectifSemaineSemblerSemenceSe/minalSe/nateurSensibleSentenceSe/parerSe/quenceSereinSergentSe/rieuxSerrureSe/rumServiceSe/sameSe/virSevrageSextupleSide/ralSie-cleSie/gerSifflerSigleSignalSilenceSiliciumSimpleSince-reSinistreSiphonSiropSismiqueSituerSkierSocialSocleSodiumSoigneuxSoldatSoleilSolitudeSolubleSombreSommeilSomnolerSondeSongeurSonnetteSonoreSorcierSortirSosieSottiseSoucieuxSoudureSouffleSouleverSoupapeSourceSoutirerSouvenirSpacieuxSpatialSpe/cialSphe-reSpiralStableStationSternumStimulusStipulerStrictStudieuxStupeurStylisteSublimeSubstratSubtilSubvenirSucce-sSucreSuffixeSugge/rerSuiveurSulfateSuperbeSupplierSurfaceSuricateSurmenerSurpriseSursautSurvieSuspectSyllabeSymboleSyme/trieSynapseSyntaxeSyste-meTabacTablierTactileTaillerTalentTalismanTalonnerTambourTamiserTangibleTapisTaquinerTarderTarifTartineTasseTatamiTatouageTaupeTaureauTaxerTe/moinTemporelTenailleTendreTeneurTenirTensionTerminerTerneTerribleTe/tineTexteThe-meThe/orieThe/rapieThoraxTibiaTie-deTimideTirelireTiroirTissuTitaneTitreTituberTobogganTole/rantTomateToniqueTonneauToponymeTorcheTordreTornadeTorpilleTorrentTorseTortueTotemToucherTournageTousserToxineTractionTraficTragiqueTrahirTrainTrancherTravailTre-fleTremperTre/sorTreuilTriageTribunalTricoterTrilogieTriompheTriplerTriturerTrivialTromboneTroncTropicalTroupeauTuileTulipeTumulteTunnelTurbineTuteurTutoyerTuyauTympanTyphonTypiqueTyranUbuesqueUltimeUltrasonUnanimeUnifierUnionUniqueUnitaireUniversUraniumUrbainUrticantUsageUsineUsuelUsureUtileUtopieVacarmeVaccinVagabondVagueVaillantVaincreVaisseauValableValiseVallonValveVampireVanilleVapeurVarierVaseuxVassalVasteVecteurVedetteVe/ge/talVe/hiculeVeinardVe/loceVendrediVe/ne/rerVengerVenimeuxVentouseVerdureVe/rinVernirVerrouVerserVertuVestonVe/te/ranVe/tusteVexantVexerViaducViandeVictoireVidangeVide/oVignetteVigueurVilainVillageVinaigreViolonVipe-reVirementVirtuoseVirusVisageViseurVisionVisqueuxVisuelVitalVitesseViticoleVitrineVivaceVivipareVocationVoguerVoileVoisinVoitureVolailleVolcanVoltigerVolumeVoraceVortexVoterVouloirVoyageVoyelleWagonXe/nonYachtZe-breZe/nithZesteZoologie".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" ").map((e=>function(e){const t=[];return Array.prototype.forEach.call(Ge(e),(e=>{47===e?(t.push(204),t.push(129)):45===e?(t.push(204),t.push(128)):t.push(e)})),Ye(t)}(e))),$n.forEach(((e,t)=>{ei[ti(e)]=t})),"0x51deb7ae009149dc61a6bd18a918eb7ac78d2775726c68e598b92d002519b045"!==Vn.check(e)))throw $n=null,new Error("BIP39 Wordlist for fr (French) FAILED")}const ni=new class extends Vn{constructor(){super("fr")}getWord(e){return ri(this),$n[e]}getWordIndex(e){return ri(this),ei[ti(e)]}};Vn.register(ni);const ii=["AQRASRAGBAGUAIRAHBAghAURAdBAdcAnoAMEAFBAFCBKFBQRBSFBCXBCDBCHBGFBEQBpBBpQBIkBHNBeOBgFBVCBhBBhNBmOBmRBiHBiFBUFBZDBvFBsXBkFBlcBjYBwDBMBBTBBTRBWBBWXXaQXaRXQWXSRXCFXYBXpHXOQXHRXhRXuRXmXXbRXlXXwDXTRXrCXWQXWGaBWaKcaYgasFadQalmaMBacAKaRKKBKKXKKjKQRKDRKCYKCRKIDKeVKHcKlXKjHKrYNAHNBWNaRNKcNIBNIONmXNsXNdXNnBNMBNRBNrXNWDNWMNFOQABQAHQBrQXBQXFQaRQKXQKDQKOQKFQNBQNDQQgQCXQCDQGBQGDQGdQYXQpBQpQQpHQLXQHuQgBQhBQhCQuFQmXQiDQUFQZDQsFQdRQkHQbRQlOQlmQPDQjDQwXQMBQMDQcFQTBQTHQrDDXQDNFDGBDGQDGRDpFDhFDmXDZXDbRDMYDRdDTRDrXSAhSBCSBrSGQSEQSHBSVRShYShkSyQSuFSiBSdcSoESocSlmSMBSFBSFKSFNSFdSFcCByCaRCKcCSBCSRCCrCGbCEHCYXCpBCpQCIBCIHCeNCgBCgFCVECVcCmkCmwCZXCZFCdRClOClmClFCjDCjdCnXCwBCwXCcRCFQCFjGXhGNhGDEGDMGCDGCHGIFGgBGVXGVEGVRGmXGsXGdYGoSGbRGnXGwXGwDGWRGFNGFLGFOGFdGFkEABEBDEBFEXOEaBEKSENBENDEYXEIgEIkEgBEgQEgHEhFEudEuFEiBEiHEiFEZDEvBEsXEsFEdXEdREkFEbBEbRElFEPCEfkEFNYAEYAhYBNYQdYDXYSRYCEYYoYgQYgRYuRYmCYZTYdBYbEYlXYjQYRbYWRpKXpQopQnpSFpCXpIBpISphNpdBpdRpbRpcZpFBpFNpFDpFopFrLADLBuLXQLXcLaFLCXLEhLpBLpFLHXLeVLhILdHLdRLoDLbRLrXIABIBQIBCIBsIBoIBMIBRIXaIaRIKYIKRINBINuICDIGBIIDIIkIgRIxFIyQIiHIdRIbYIbRIlHIwRIMYIcRIRVITRIFBIFNIFQOABOAFOBQOaFONBONMOQFOSFOCDOGBOEQOpBOLXOIBOIFOgQOgFOyQOycOmXOsXOdIOkHOMEOMkOWWHBNHXNHXWHNXHDuHDRHSuHSRHHoHhkHmRHdRHkQHlcHlRHwBHWcgAEgAggAkgBNgBQgBEgXOgYcgLXgHjgyQgiBgsFgdagMYgWSgFQgFEVBTVXEVKBVKNVKDVKYVKRVNBVNYVDBVDxVSBVSRVCjVGNVLXVIFVhBVhcVsXVdRVbRVlRhBYhKYhDYhGShxWhmNhdahdkhbRhjohMXhTRxAXxXSxKBxNBxEQxeNxeQxhXxsFxdbxlHxjcxFBxFNxFQxFOxFoyNYyYoybcyMYuBQuBRuBruDMuCouHBudQukkuoBulVuMXuFEmCYmCRmpRmeDmiMmjdmTFmFQiADiBOiaRiKRiNBiNRiSFiGkiGFiERipRiLFiIFihYibHijBijEiMXiWBiFBiFCUBQUXFUaRUNDUNcUNRUNFUDBUSHUCDUGBUGFUEqULNULoUIRUeEUeYUgBUhFUuRUiFUsXUdFUkHUbBUjSUjYUwXUMDUcHURdUTBUrBUrXUrQZAFZXZZaRZKFZNBZQFZCXZGBZYdZpBZLDZIFZHXZHNZeQZVRZVFZmXZiBZvFZdFZkFZbHZbFZwXZcCZcRZRBvBQvBGvBLvBWvCovMYsAFsBDsaRsKFsNFsDrsSHsSFsCXsCRsEBsEHsEfspBsLBsLDsIgsIRseGsbRsFBsFQsFSdNBdSRdCVdGHdYDdHcdVbdySduDdsXdlRdwXdWYdWcdWRkBMkXOkaRkNIkNFkSFkCFkYBkpRkeNkgBkhVkmXksFklVkMBkWDkFNoBNoaQoaFoNBoNXoNaoNEoSRoEroYXoYCoYbopRopFomXojkowXorFbBEbEIbdBbjYlaRlDElMXlFDjKjjSRjGBjYBjYkjpRjLXjIBjOFjeVjbRjwBnXQnSHnpFnLXnINnMBnTRwXBwXNwXYwNFwQFwSBwGFwLXwLDweNwgBwuHwjDwnXMBXMpFMIBMeNMTHcaQcNBcDHcSFcCXcpBcLXcLDcgFcuFcnXcwXccDcTQcrFTQErXNrCHrpFrgFrbFrTHrFcWNYWNbWEHWMXWTR","ABGHABIJAEAVAYJQALZJAIaRAHNXAHdcAHbRAZJMAZJRAZTRAdVJAklmAbcNAjdRAMnRAMWYAWpRAWgRAFgBAFhBAFdcBNJBBNJDBQKBBQhcBQlmBDEJBYJkBYJTBpNBBpJFBIJBBIJDBIcABOKXBOEJBOVJBOiJBOZJBepBBeLXBeIFBegBBgGJBVJXBuocBiJRBUJQBlXVBlITBwNFBMYVBcqXBTlmBWNFBWiJBWnRBFGHBFwXXKGJXNJBXNZJXDTTXSHSXSVRXSlHXCJDXGQJXEhXXYQJXYbRXOfXXeNcXVJFXhQJXhEJXdTRXjdXXMhBXcQTXRGBXTEBXTnQXFCXXFOFXFgFaBaFaBNJaBCJaBpBaBwXaNJKaNJDaQIBaDpRaEPDaHMFamDJalEJaMZJaFaFaFNBaFQJaFLDaFVHKBCYKBEBKBHDKXaFKXGdKXEJKXpHKXIBKXZDKXwXKKwLKNacKNYJKNJoKNWcKDGdKDTRKChXKGaRKGhBKGbRKEBTKEaRKEPTKLMDKLWRKOHDKVJcKdBcKlIBKlOPKFSBKFEPKFpFNBNJNJBQNBGHNBEPNBHXNBgFNBVXNBZDNBsXNBwXNNaRNNJDNNJENNJkNDCJNDVDNGJRNJiDNZJNNsCJNJFNNFSBNFCXNFEPNFLXNFIFQJBFQCaRQJEQQLJDQLJFQIaRQOqXQHaFQHHQQVJXQVJDQhNJQmEIQZJFQsJXQJrFQWbRDJABDBYJDXNFDXCXDXLXDXZDDXsJDQqXDSJFDJCXDEPkDEqXDYmQDpSJDOCkDOGQDHEIDVJDDuDuDWEBDJFgSBNDSBSFSBGHSBIBSBTQSKVYSJQNSJQiSJCXSEqXSJYVSIiJSOMYSHAHSHaQSeCFSepQSegBSHdHSHrFShSJSJuHSJUFSkNRSrSrSWEBSFaHSJFQSFCXSFGDSFYXSFODSFgBSFVXSFhBSFxFSFkFSFbBSFMFCADdCJXBCXaFCXKFCXNFCXCXCXGBCXEJCXYBCXLDCXIBCXOPCXHXCXgBCXhBCXiBCXlDCXcHCJNBCJNFCDCJCDGBCDVXCDhBCDiDCDJdCCmNCpJFCIaRCOqXCHCHCHZJCViJCuCuCmddCJiFCdNBCdHhClEJCnUJCreSCWlgCWTRCFBFCFNBCFYBCFVFCFhFCFdSCFTBCFWDGBNBGBQFGJBCGBEqGBpBGBgQGNBEGNJYGNkOGNJRGDUFGJpQGHaBGJeNGJeEGVBlGVKjGiJDGvJHGsVJGkEBGMIJGWjNGFBFGFCXGFGBGFYXGFpBGFMFEASJEAWpEJNFECJVEIXSEIQJEOqXEOcFEeNcEHEJEHlFEJgFEhlmEmDJEmZJEiMBEUqXEoSREPBFEPXFEPKFEPSFEPEFEPpFEPLXEPIBEJPdEPcFEPTBEJnXEqlHEMpREFCXEFODEFcFYASJYJAFYBaBYBVXYXpFYDhBYCJBYJGFYYbRYeNcYJeVYiIJYZJcYvJgYvJRYJsXYsJFYMYMYreVpBNHpBEJpBwXpQxFpYEJpeNDpJeDpeSFpeCHpHUJpHbBpHcHpmUJpiiJpUJrpsJuplITpFaBpFQqpFGBpFEfpFYBpFpBpFLJpFIDpFgBpFVXpFyQpFuFpFlFpFjDpFnXpFwXpJFMpFTBLXCJLXEFLXhFLXUJLXbFLalmLNJBLSJQLCLCLGJBLLDJLHaFLeNFLeSHLeCXLepFLhaRLZsJLsJDLsJrLocaLlLlLMdbLFNBLFSBLFEHLFkFIBBFIBXFIBaQIBKXIBSFIBpHIBLXIBgBIBhBIBuHIBmXIBiFIBZXIBvFIBbFIBjQIBwXIBWFIKTRIQUJIDGFICjQIYSRIINXIJeCIVaRImEkIZJFIvJRIsJXIdCJIJoRIbBQIjYBIcqXITFVIreVIFKFIFSFIFCJIFGFIFLDIFIBIJFOIFgBIFVXIJFhIFxFIFmXIFdHIFbBIJFrIJFWOBGBOQfXOOKjOUqXOfXBOqXEOcqXORVJOFIBOFlDHBIOHXiFHNTRHCJXHIaRHHJDHHEJHVbRHZJYHbIBHRsJHRkDHWlmgBKFgBSBgBCDgBGHgBpBgBIBgBVJgBuBgBvFgKDTgQVXgDUJgGSJgOqXgmUMgZIJgTUJgWIEgFBFgFNBgFDJgFSFgFGBgFYXgJFOgFgQgFVXgFhBgFbHgJFWVJABVQKcVDgFVOfXVeDFVhaRVmGdViJYVMaRVFNHhBNDhBCXhBEqhBpFhBLXhNJBhSJRheVXhhKEhxlmhZIJhdBQhkIJhbMNhMUJhMZJxNJgxQUJxDEkxDdFxSJRxplmxeSBxeCXxeGFxeYXxepQxegBxWVcxFEQxFLXxFIBxFgBxFxDxFZtxFdcxFbBxFwXyDJXyDlcuASJuDJpuDIBuCpJuGSJuIJFueEFuZIJusJXudWEuoIBuWGJuFBcuFKEuFNFuFQFuFDJuFGJuFVJuFUtuFdHuFTBmBYJmNJYmQhkmLJDmLJomIdXmiJYmvJRmsJRmklmmMBymMuCmclmmcnQiJABiJBNiJBDiBSFiBCJiBEFiBYBiBpFiBLXiBTHiJNciDEfiCZJiECJiJEqiOkHiHKFieNDiHJQieQcieDHieSFieCXieGFieEFieIHiegFihUJixNoioNXiFaBiFKFiFNDiFEPiFYXitFOitFHiFgBiFVEiFmXiFitiFbBiFMFiFrFUCXQUIoQUIJcUHQJUeCEUHwXUUJDUUqXUdWcUcqXUrnQUFNDUFSHUFCFUFEfUFLXUtFOZBXOZXSBZXpFZXVXZEQJZEJkZpDJZOqXZeNHZeCDZUqXZFBQZFEHZFLXvBAFvBKFvBCXvBEPvBpHvBIDvBgFvBuHvQNJvFNFvFGBvFIBvJFcsXCDsXLXsXsXsXlFsXcHsQqXsJQFsEqXseIFsFEHsFjDdBxOdNpRdNJRdEJbdpJRdhZJdnSJdrjNdFNJdFQHdFhNkNJDkYaRkHNRkHSRkVbRkuMRkjSJkcqDoSJFoEiJoYZJoOfXohEBoMGQocqXbBAFbBXFbBaFbBNDbBGBbBLXbBTBbBWDbGJYbIJHbFQqbFpQlDgQlOrFlVJRjGEBjZJRnXvJnXbBnEfHnOPDngJRnxfXnUJWwXEJwNpJwDpBwEfXwrEBMDCJMDGHMDIJMLJDcQGDcQpHcqXccqNFcqCXcFCJRBSBRBGBRBEJRBpQTBNFTBQJTBpBTBVXTFABTFSBTFCFTFGBTFMDrXCJrXLDrDNJrEfHrFQJrFitWNjdWNTR","AKLJMANOPFASNJIAEJWXAYJNRAIIbRAIcdaAeEfDAgidRAdjNYAMYEJAMIbRAFNJBAFpJFBBIJYBDZJFBSiJhBGdEBBEJfXBEJqXBEJWRBpaUJBLXrXBIYJMBOcfXBeEfFBestXBjNJRBcDJOBFEqXXNvJRXDMBhXCJNYXOAWpXONJWXHDEBXeIaRXhYJDXZJSJXMDJOXcASJXFVJXaBQqXaBZJFasXdQaFSJQaFEfXaFpJHaFOqXKBNSRKXvJBKQJhXKEJQJKEJGFKINJBKIJjNKgJNSKVElmKVhEBKiJGFKlBgJKjnUJKwsJYKMFIJKFNJDKFIJFKFOfXNJBSFNJBCXNBpJFNJBvQNJBMBNJLJXNJOqXNJeCXNJeGFNdsJCNbTKFNwXUJQNFEPQDiJcQDMSJQSFpBQGMQJQJeOcQyCJEQUJEBQJFBrQFEJqDXDJFDJXpBDJXIMDGiJhDIJGRDJeYcDHrDJDVXgFDkAWpDkIgRDjDEqDMvJRDJFNFDJFIBSKclmSJQOFSJQVHSJQjDSJGJBSJGJFSECJoSHEJqSJHTBSJVJDSViJYSZJNBSJsJDSFSJFSFEfXSJFLXCBUJVCJXSBCJXpBCXVJXCJXsXCJXdFCJNJHCLIJgCHiJFCVNJMChCJhCUHEJCsJTRCJdYcCoQJCCFEfXCFIJgCFUJxCFstFGJBaQGJBIDGQJqXGYJNRGJHKFGeQqDGHEJFGJeLXGHIiJGHdBlGUJEBGkIJTGFQPDGJFEqEAGegEJIJBEJVJXEhQJTEiJNcEJZJFEJoEqEjDEqEPDsXEPGJBEPOqXEPeQFEfDiDEJfEFEfepQEfMiJEqXNBEqDIDEqeSFEqVJXEMvJRYXNJDYXEJHYKVJcYYJEBYJeEcYJUqXYFpJFYFstXpAZJMpBSJFpNBNFpeQPDpHLJDpHIJFpHgJFpeitFpHZJFpJFADpFSJFpJFCJpFOqXpFitBpJFZJLXIJFLIJgRLVNJWLVHJMLwNpJLFGJBLFLJDLFOqXLJFUJIBDJXIBGJBIJBYQIJBIBIBOqXIBcqDIEGJFILNJTIIJEBIOiJhIJeNBIJeIBIhiJIIWoTRIJFAHIJFpBIJFuHIFUtFIJFTHOSBYJOEcqXOHEJqOvBpFOkVJrObBVJOncqDOcNJkHhNJRHuHJuHdMhBgBUqXgBsJXgONJBgHNJDgHHJQgJeitgHsJXgJyNagyDJBgZJDrgsVJQgkEJNgkjSJgJFAHgFCJDgFZtMVJXNFVXQfXVJXDJVXoQJVQVJQVDEfXVDvJHVEqNFVeQfXVHpJFVHxfXVVJSRVVmaRVlIJOhCXVJhHjYkhxCJVhWVUJhWiJcxBNJIxeEqDxfXBFxcFEPxFSJFxFYJXyBDQJydaUJyFOPDuYCJYuLvJRuHLJXuZJLDuFOPDuFZJHuFcqXmKHJdmCQJcmOsVJiJAGFitLCFieOfXiestXiZJMEikNJQirXzFiFQqXiFIJFiFZJFiFvtFUHpJFUteIcUteOcUVCJkUhdHcUbEJEUJqXQUMNJhURjYkUFitFZDGJHZJIxDZJVJXZJFDJZJFpQvBNJBvBSJFvJxBrseQqDsVFVJdFLJDkEJNBkmNJYkFLJDoQJOPoGsJRoEAHBoEJfFbBQqDbBZJHbFVJXlFIJBjYIrXjeitcjjCEBjWMNBwXQfXwXOaFwDsJXwCJTRwrCZJMDNJQcDDJFcqDOPRYiJFTBsJXTQIJBTFEfXTFLJDrXEJFrEJXMrFZJFWEJdEWYTlm","ABCDEFACNJTRAMBDJdAcNJVXBLNJEBXSIdWRXErNJkXYDJMBXZJCJaXMNJaYKKVJKcKDEJqXKDcNJhKVJrNYKbgJVXKFVJSBNBYBwDNJeQfXNJeEqXNhGJWENJFiJRQlIJbEQJfXxDQqXcfXQFNDEJQFwXUJDYcnUJDJIBgQDIUJTRDJFEqDSJQSJFSJQIJFSOPeZtSJFZJHCJXQfXCTDEqFGJBSJFGJBOfXGJBcqXGJHNJDGJRLiJEJfXEqEJFEJPEFpBEJYJBZJFYBwXUJYiJMEBYJZJyTYTONJXpQMFXFpeGIDdpJFstXpJFcPDLBVSJRLHQJqXLJFZJFIJBNJDIJBUqXIBkFDJIJEJPTIYJGWRIJeQPDIJeEfHIJFsJXOqGDSFHXEJqXgJCsJCgGQJqXgdQYJEgFMFNBgJFcqDVJwXUJVJFZJchIgJCCxOEJqXxOwXUJyDJBVRuscisciJBiJBieUtqXiJFDJkiFsJXQUGEZJcUJFsJXZtXIrXZDZJDrZJFNJDZJFstXvJFQqXvJFCJEsJXQJqkhkNGBbDJdTRbYJMEBlDwXUJMEFiJFcfXNJDRcNJWMTBLJXC","BraFUtHBFSJFdbNBLJXVJQoYJNEBSJBEJfHSJHwXUJCJdAZJMGjaFVJXEJPNJBlEJfFiJFpFbFEJqIJBVJCrIBdHiJhOPFChvJVJZJNJWxGFNIFLueIBQJqUHEJfUFstOZJDrlXEASJRlXVJXSFwVJNJWD","QJEJNNJDQJEJIBSFQJEJxegBQJEJfHEPSJBmXEJFSJCDEJqXLXNJFQqXIcQsFNJFIFEJqXUJgFsJXIJBUJEJfHNFvJxEqXNJnXUJFQqD","IJBEJqXZJ"];let ai=null;function oi(e){return Object(J.i)(Ge(e))}function si(e){if(null!==ai)return;ai=[];const t={};function r(e){let r="";for(let n=0;nt?1:0})),"0xe3818de38284e3818f"===oi(ai[442])&&"0xe3818de38283e3818f"===oi(ai[443])){const e=ai[442];ai[442]=ai[443],ai[443]=e}if("0xcb36b09e6baa935787fd762ce65e80b0c6a8dabdfbc3a7f86ac0e2c4fd111600"!==Vn.check(e))throw ai=null,new Error("BIP39 Wordlist for ja (Japanese) FAILED")}const ui=new class extends Vn{constructor(){super("ja")}getWord(e){return si(this),ai[e]}getWordIndex(e){return si(this),ai.indexOf(e)}split(e){return jn.checkNormalize(),e.split(/(?:\u3000| )+/g)}join(e){return e.join("\u3000")}};Vn.register(ui);const li=["OYAa","ATAZoATBl3ATCTrATCl8ATDloATGg3ATHT8ATJT8ATJl3ATLlvATLn4ATMT8ATMX8ATMboATMgoAToLbAToMTATrHgATvHnAT3AnAT3JbAT3MTAT8DbAT8JTAT8LmAT8MYAT8MbAT#LnAUHT8AUHZvAUJXrAUJX8AULnrAXJnvAXLUoAXLgvAXMn6AXRg3AXrMbAX3JTAX3QbAYLn3AZLgvAZrSUAZvAcAZ8AaAZ8AbAZ8AnAZ8HnAZ8LgAZ8MYAZ8MgAZ8OnAaAboAaDTrAaFTrAaJTrAaJboAaLVoAaMXvAaOl8AaSeoAbAUoAbAg8AbAl4AbGnrAbMT8AbMXrAbMn4AbQb8AbSV8AbvRlAb8AUAb8AnAb8HgAb8JTAb8NTAb8RbAcGboAcLnvAcMT8AcMX8AcSToAcrAaAcrFnAc8AbAc8MgAfGgrAfHboAfJnvAfLV8AfLkoAfMT8AfMnoAfQb8AfScrAfSgrAgAZ8AgFl3AgGX8AgHZvAgHgrAgJXoAgJX8AgJboAgLZoAgLn4AgOX8AgoATAgoAnAgoCUAgoJgAgoLXAgoMYAgoSeAgrDUAgrJTAhrFnAhrLjAhrQgAjAgoAjJnrAkMX8AkOnoAlCTvAlCV8AlClvAlFg4AlFl6AlFn3AloSnAlrAXAlrAfAlrFUAlrFbAlrGgAlrOXAlvKnAlvMTAl3AbAl3MnAnATrAnAcrAnCZ3AnCl8AnDg8AnFboAnFl3AnHX4AnHbrAnHgrAnIl3AnJgvAnLXoAnLX4AnLbrAnLgrAnLhrAnMXoAnMgrAnOn3AnSbrAnSeoAnvLnAn3OnCTGgvCTSlvCTvAUCTvKnCTvNTCT3CZCT3GUCT3MTCT8HnCUCZrCULf8CULnvCU3HnCU3JUCY6NUCbDb8CbFZoCbLnrCboOTCboScCbrFnCbvLnCb8AgCb8HgCb$LnCkLfoClBn3CloDUDTHT8DTLl3DTSU8DTrAaDTrLXDTrLjDTrOYDTrOgDTvFXDTvFnDT3HUDT3LfDUCT9DUDT4DUFVoDUFV8DUFkoDUGgrDUJnrDULl8DUMT8DUMXrDUMX4DUMg8DUOUoDUOgvDUOg8DUSToDUSZ8DbDXoDbDgoDbGT8DbJn3DbLg3DbLn4DbMXrDbMg8DbOToDboJXGTClvGTDT8GTFZrGTLVoGTLlvGTLl3GTMg8GTOTvGTSlrGToCUGTrDgGTrJYGTrScGTtLnGTvAnGTvQgGUCZrGUDTvGUFZoGUHXrGULnvGUMT8GUoMgGXoLnGXrMXGXrMnGXvFnGYLnvGZOnvGZvOnGZ8LaGZ8LmGbAl3GbDYvGbDlrGbHX3GbJl4GbLV8GbLn3GbMn4GboJTGboRfGbvFUGb3GUGb4JnGgDX3GgFl$GgJlrGgLX6GgLZoGgLf8GgOXoGgrAgGgrJXGgrMYGgrScGgvATGgvOYGnAgoGnJgvGnLZoGnLg3GnLnrGnQn8GnSbrGnrMgHTClvHTDToHTFT3HTQT8HToJTHToJgHTrDUHTrMnHTvFYHTvRfHT8MnHT8SUHUAZ8HUBb4HUDTvHUoMYHXFl6HXJX6HXQlrHXrAUHXrMnHXrSbHXvFYHXvKXHX3LjHX3MeHYvQlHZrScHZvDbHbAcrHbFT3HbFl3HbJT8HbLTrHbMT8HbMXrHbMbrHbQb8HbSX3HboDbHboJTHbrFUHbrHgHbrJTHb8JTHb8MnHb8QgHgAlrHgDT3HgGgrHgHgrHgJTrHgJT8HgLX@HgLnrHgMT8HgMX8HgMboHgOnrHgQToHgRg3HgoHgHgrCbHgrFnHgrLVHgvAcHgvAfHnAloHnCTrHnCnvHnGTrHnGZ8HnGnvHnJT8HnLf8HnLkvHnMg8HnRTrITvFUITvFnJTAXrJTCV8JTFT3JTFT8JTFn4JTGgvJTHT8JTJT8JTJXvJTJl3JTJnvJTLX4JTLf8JTLhvJTMT8JTMXrJTMnrJTObrJTQT8JTSlvJT8DUJT8FkJT8MTJT8OXJT8OgJT8QUJT8RfJUHZoJXFT4JXFlrJXGZ8JXGnrJXLV8JXLgvJXMXoJXMX3JXNboJXPlvJXoJTJXoLkJXrAXJXrHUJXrJgJXvJTJXvOnJX4KnJYAl3JYJT8JYLhvJYQToJYrQXJY6NUJbAl3JbCZrJbDloJbGT8JbGgrJbJXvJbJboJbLf8JbLhrJbLl3JbMnvJbRg8JbSZ8JboDbJbrCZJbrSUJb3KnJb8LnJfRn8JgAXrJgCZrJgDTrJgGZrJgGZ8JgHToJgJT8JgJXoJgJgvJgLX4JgLZ3JgLZ8JgLn4JgMgrJgMn4JgOgvJgPX6JgRnvJgSToJgoCZJgoJbJgoMYJgrJXJgrJgJgrLjJg6MTJlCn3JlGgvJlJl8Jl4AnJl8FnJl8HgJnAToJnATrJnAbvJnDUoJnGnrJnJXrJnJXvJnLhvJnLnrJnLnvJnMToJnMT8JnMXvJnMX3JnMg8JnMlrJnMn4JnOX8JnST4JnSX3JnoAgJnoAnJnoJTJnoObJnrAbJnrAkJnrHnJnrJTJnrJYJnrOYJnrScJnvCUJnvFaJnvJgJnvJnJnvOYJnvQUJnvRUJn3FnJn3JTKnFl3KnLT6LTDlvLTMnoLTOn3LTRl3LTSb4LTSlrLToAnLToJgLTrAULTrAcLTrCULTrHgLTrMgLT3JnLULnrLUMX8LUoJgLVATrLVDTrLVLb8LVoJgLV8MgLV8RTLXDg3LXFlrLXrCnLXrLXLX3GTLX4GgLX4OYLZAXrLZAcrLZAgrLZAhrLZDXyLZDlrLZFbrLZFl3LZJX6LZJX8LZLc8LZLnrLZSU8LZoJTLZoJnLZrAgLZrAnLZrJYLZrLULZrMgLZrSkLZvAnLZvGULZvJeLZvOTLZ3FZLZ4JXLZ8STLZ8ScLaAT3LaAl3LaHT8LaJTrLaJT8LaJXrLaJgvLaJl4LaLVoLaMXrLaMXvLaMX8LbClvLbFToLbHlrLbJn4LbLZ3LbLhvLbMXrLbMnoLbvSULcLnrLc8HnLc8MTLdrMnLeAgoLeOgvLeOn3LfAl3LfLnvLfMl3LfOX8Lf8AnLf8JXLf8LXLgJTrLgJXrLgJl8LgMX8LgRZrLhCToLhrAbLhrFULhrJXLhvJYLjHTrLjHX4LjJX8LjLhrLjSX3LjSZ4LkFX4LkGZ8LkGgvLkJTrLkMXoLkSToLkSU8LkSZ8LkoOYLl3FfLl3MgLmAZrLmCbrLmGgrLmHboLmJnoLmJn3LmLfoLmLhrLmSToLnAX6LnAb6LnCZ3LnCb3LnDTvLnDb8LnFl3LnGnrLnHZvLnHgvLnITvLnJT8LnJX8LnJlvLnLf8LnLg6LnLhvLnLnoLnMXrLnMg8LnQlvLnSbrLnrAgLnrAnLnrDbLnrFkLnrJdLnrMULnrOYLnrSTLnvAnLnvDULnvHgLnvOYLnvOnLn3GgLn4DULn4JTLn4JnMTAZoMTAloMTDb8MTFT8MTJnoMTJnrMTLZrMTLhrMTLkvMTMX8MTRTrMToATMTrDnMTrOnMT3JnMT4MnMT8FUMT8FaMT8FlMT8GTMT8GbMT8GnMT8HnMT8JTMT8JbMT8OTMUCl8MUJTrMUJU8MUMX8MURTrMUSToMXAX6MXAb6MXCZoMXFXrMXHXrMXLgvMXOgoMXrAUMXrAnMXrHgMXrJYMXrJnMXrMTMXrMgMXrOYMXrSZMXrSgMXvDUMXvOTMX3JgMX3OTMX4JnMX8DbMX8FnMX8HbMX8HgMX8HnMX8LbMX8MnMX8OnMYAb8MYGboMYHTvMYHX4MYLTrMYLnvMYMToMYOgvMYRg3MYSTrMbAToMbAXrMbAl3MbAn8MbGZ8MbJT8MbJXrMbMXvMbMX8MbMnoMbrMUMb8AfMb8FbMb8FkMcJXoMeLnrMgFl3MgGTvMgGXoMgGgrMgGnrMgHT8MgHZrMgJnoMgLnrMgLnvMgMT8MgQUoMgrHnMgvAnMg8HgMg8JYMg8LfMloJnMl8ATMl8AXMl8JYMnAToMnAT4MnAZ8MnAl3MnAl4MnCl8MnHT8MnHg8MnJnoMnLZoMnLhrMnMXoMnMX3MnMnrMnOgvMnrFbMnrFfMnrFnMnrNTMnvJXNTMl8OTCT3OTFV8OTFn3OTHZvOTJXrOTOl3OT3ATOT3JUOT3LZOT3LeOT3MbOT8ATOT8AbOT8AgOT8MbOUCXvOUMX3OXHXvOXLl3OXrMUOXvDbOX6NUOX8JbOYFZoOYLbrOYLkoOYMg8OYSX3ObHTrObHT4ObJgrObLhrObMX3ObOX8Ob8FnOeAlrOeJT8OeJXrOeJnrOeLToOeMb8OgJXoOgLXoOgMnrOgOXrOgOloOgoAgOgoJbOgoMYOgoSTOg8AbOjLX4OjMnoOjSV8OnLVoOnrAgOn3DUPXQlrPXvFXPbvFTPdAT3PlFn3PnvFbQTLn4QToAgQToMTQULV8QURg8QUoJnQXCXvQbFbrQb8AaQb8AcQb8FbQb8MYQb8ScQeAlrQeLhrQjAn3QlFXoQloJgQloSnRTLnvRTrGURTrJTRUJZrRUoJlRUrQnRZrLmRZrMnRZrSnRZ8ATRZ8JbRZ8ScRbMT8RbST3RfGZrRfMX8RfMgrRfSZrRnAbrRnGT8RnvJgRnvLfRnvMTRn8AaSTClvSTJgrSTOXrSTRg3STRnvSToAcSToAfSToAnSToHnSToLjSToMTSTrAaSTrEUST3BYST8AgST8LmSUAZvSUAgrSUDT4SUDT8SUGgvSUJXoSUJXvSULTrSU8JTSU8LjSV8AnSV8JgSXFToSXLf8SYvAnSZrDUSZrMUSZrMnSZ8HgSZ8JTSZ8JgSZ8MYSZ8QUSaQUoSbCT3SbHToSbQYvSbSl4SboJnSbvFbSb8HbSb8JgSb8OTScGZrScHgrScJTvScMT8ScSToScoHbScrMTScvAnSeAZrSeAcrSeHboSeJUoSeLhrSeMT8SeMXrSe6JgSgHTrSkJnoSkLnvSk8CUSlFl3SlrSnSl8GnSmAboSmGT8SmJU8","ATLnDlATrAZoATrJX4ATrMT8ATrMX4ATrRTrATvDl8ATvJUoATvMl8AT3AToAT3MX8AT8CT3AT8DT8AT8HZrAT8HgoAUAgFnAUCTFnAXoMX8AXrAT8AXrGgvAXrJXvAXrOgoAXvLl3AZvAgoAZvFbrAZvJXoAZvJl8AZvJn3AZvMX8AZvSbrAZ8FZoAZ8LZ8AZ8MU8AZ8OTvAZ8SV8AZ8SX3AbAgFZAboJnoAbvGboAb8ATrAb8AZoAb8AgrAb8Al4Ab8Db8Ab8JnoAb8LX4Ab8LZrAb8LhrAb8MT8Ab8OUoAb8Qb8Ab8ST8AcrAUoAcrAc8AcrCZ3AcrFT3AcrFZrAcrJl4AcrJn3AcrMX3AcrOTvAc8AZ8Ac8MT8AfAcJXAgoFn4AgoGgvAgoGnrAgoLc8AgoMXoAgrLnrAkrSZ8AlFXCTAloHboAlrHbrAlrLhrAlrLkoAl3CZrAl3LUoAl3LZrAnrAl4AnrMT8An3HT4BT3IToBX4MnvBb!Ln$CTGXMnCToLZ4CTrHT8CT3JTrCT3RZrCT#GTvCU6GgvCU8Db8CU8GZrCU8HT8CboLl3CbrGgrCbrMU8Cb8DT3Cb8GnrCb8LX4Cb8MT8Cb8ObrCgrGgvCgrKX4Cl8FZoDTrAbvDTrDboDTrGT6DTrJgrDTrMX3DTrRZrDTrRg8DTvAVvDTvFZoDT3DT8DT3Ln3DT4HZrDT4MT8DT8AlrDT8MT8DUAkGbDUDbJnDYLnQlDbDUOYDbMTAnDbMXSnDboAT3DboFn4DboLnvDj6JTrGTCgFTGTGgFnGTJTMnGTLnPlGToJT8GTrCT3GTrLVoGTrLnvGTrMX3GTrMboGTvKl3GZClFnGZrDT3GZ8DTrGZ8FZ8GZ8MXvGZ8On8GZ8ST3GbCnQXGbMbFnGboFboGboJg3GboMXoGb3JTvGb3JboGb3Mn6Gb3Qb8GgDXLjGgMnAUGgrDloGgrHX4GgrSToGgvAXrGgvAZvGgvFbrGgvLl3GgvMnvGnDnLXGnrATrGnrMboGnuLl3HTATMnHTAgCnHTCTCTHTrGTvHTrHTvHTrJX8HTrLl8HTrMT8HTrMgoHTrOTrHTuOn3HTvAZrHTvDTvHTvGboHTvJU8HTvLl3HTvMXrHTvQb4HT4GT6HT4JT8HT4Jb#HT8Al3HT8GZrHT8GgrHT8HX4HT8Jb8HT8JnoHT8LTrHT8LgvHT8SToHT8SV8HUoJUoHUoJX8HUoLnrHXrLZoHXvAl3HX3LnrHX4FkvHX4LhrHX4MXoHX4OnoHZrAZ8HZrDb8HZrGZ8HZrJnrHZvGZ8HZvLnvHZ8JnvHZ8LhrHbCXJlHbMTAnHboJl4HbpLl3HbrJX8HbrLnrHbrMnvHbvRYrHgoSTrHgrFV8HgrGZ8HgrJXoHgrRnvHgvBb!HgvGTrHgvHX4HgvHn!HgvLTrHgvSU8HnDnLbHnFbJbHnvDn8Hn6GgvHn!BTvJTCTLnJTQgFnJTrAnvJTrLX4JTrOUoJTvFn3JTvLnrJTvNToJT3AgoJT3Jn4JT3LhvJT3ObrJT8AcrJT8Al3JT8JT8JT8JnoJT8LX4JT8LnrJT8MX3JT8Rg3JT8Sc8JUoBTvJU8AToJU8GZ8JU8GgvJU8JTrJU8JXrJU8JnrJU8LnvJU8ScvJXHnJlJXrGgvJXrJU8JXrLhrJXrMT8JXrMXrJXrQUoJXvCTvJXvGZ8JXvGgrJXvQT8JX8Ab8JX8DT8JX8GZ8JX8HZvJX8LnrJX8MT8JX8MXoJX8MnvJX8ST3JYGnCTJbAkGbJbCTAnJbLTAcJboDT3JboLb6JbrAnvJbrCn3JbrDl8JbrGboJbrIZoJbrJnvJbrMnvJbrQb4Jb8RZrJeAbAnJgJnFbJgScAnJgrATrJgvHZ8JgvMn4JlJlFbJlLiQXJlLjOnJlRbOlJlvNXoJlvRl3Jl4AcrJl8AUoJl8MnrJnFnMlJnHgGbJnoDT8JnoFV8JnoGgvJnoIT8JnoQToJnoRg3JnrCZ3JnrGgrJnrHTvJnrLf8JnrOX8JnvAT3JnvFZoJnvGT8JnvJl4JnvMT8JnvMX8JnvOXrJnvPX6JnvSX3JnvSZrJn3MT8Jn3MX8Jn3RTrLTATKnLTJnLTLTMXKnLTRTQlLToGb8LTrAZ8LTrCZ8LTrDb8LTrHT8LT3PX6LT4FZoLT$CTvLT$GgrLUvHX3LVoATrLVoAgoLVoJboLVoMX3LVoRg3LV8CZ3LV8FZoLV8GTvLXrDXoLXrFbrLXvAgvLXvFlrLXvLl3LXvRn6LX4Mb8LX8GT8LYCXMnLYrMnrLZoSTvLZrAZvLZrAloLZrFToLZrJXvLZrJboLZrJl4LZrLnrLZrMT8LZrOgvLZrRnvLZrST4LZvMX8LZvSlvLZ8AgoLZ8CT3LZ8JT8LZ8LV8LZ8LZoLZ8Lg8LZ8SV8LZ8SbrLZ$HT8LZ$Mn4La6CTvLbFbMnLbRYFTLbSnFZLboJT8LbrAT9LbrGb3LbrQb8LcrJX8LcrMXrLerHTvLerJbrLerNboLgrDb8LgrGZ8LgrHTrLgrMXrLgrSU8LgvJTrLgvLl3Lg6Ll3LhrLnrLhrMT8LhvAl4LiLnQXLkoAgrLkoJT8LkoJn4LlrSU8Ll3FZoLl3HTrLl3JX8Ll3JnoLl3LToLmLeFbLnDUFbLnLVAnLnrATrLnrAZoLnrAb8LnrAlrLnrGgvLnrJU8LnrLZrLnrLhrLnrMb8LnrOXrLnrSZ8LnvAb4LnvDTrLnvDl8LnvHTrLnvHbrLnvJT8LnvJU8LnvJbrLnvLhvLnvMX8LnvMb8LnvNnoLnvSU8Ln3Al3Ln4FZoLn4GT6Ln4JgvLn4LhrLn4MT8Ln4SToMToCZrMToJX8MToLX4MToLf8MToRg3MTrEloMTvGb6MT3BTrMT3Lb6MT8AcrMT8AgrMT8GZrMT8JnoMT8LnrMT8MX3MUOUAnMXAbFnMXoAloMXoJX8MXoLf8MXoLl8MXrAb8MXrDTvMXrGT8MXrGgrMXrHTrMXrLf8MXrMU8MXrOXvMXrQb8MXvGT8MXvHTrMXvLVoMX3AX3MX3Jn3MX3LhrMX3MX3MX4AlrMX4OboMX8GTvMX8GZrMX8GgrMX8JT8MX8JX8MX8LhrMX8MT8MYDUFbMYMgDbMbGnFfMbvLX4MbvLl3Mb8Mb8Mb8ST4MgGXCnMg8ATrMg8AgoMg8CZrMg8DTrMg8DboMg8HTrMg8JgrMg8LT8MloJXoMl8AhrMl8JT8MnLgAUMnoJXrMnoLX4MnoLhrMnoMT8MnrAl4MnrDb8MnrOTvMnrOgvMnrQb8MnrSU8MnvGgrMnvHZ8Mn3MToMn4DTrMn4LTrMn4Mg8NnBXAnOTFTFnOToAToOTrGgvOTrJX8OT3JXoOT6MTrOT8GgrOT8HTpOT8MToOUoHT8OUoJT8OUoLn3OXrAgoOXrDg8OXrMT8OXvSToOX6CTvOX8CZrOX8OgrOb6HgvOb8AToOb8MT8OcvLZ8OgvAlrOgvHTvOgvJTrOgvJnrOgvLZrOgvLn4OgvMT8OgvRTrOg8AZoOg8DbvOnrOXoOnvJn4OnvLhvOnvRTrOn3GgoOn3JnvOn6JbvOn8OTrPTGYFTPbBnFnPbGnDnPgDYQTPlrAnvPlrETvPlrLnvPlrMXvPlvFX4QTMTAnQTrJU8QYCnJlQYJlQlQbGTQbQb8JnrQb8LZoQb8LnvQb8MT8Qb8Ml8Qb8ST4QloAl4QloHZvQloJX8QloMn8QnJZOlRTrAZvRTrDTrRTvJn4RTvLhvRT4Jb8RZrAZrRZ8AkrRZ8JU8RZ8LV8RZ8LnvRbJlQXRg3GboRg3MnvRg8AZ8Rg8JboRg8Jl4RnLTCbRnvFl3RnvQb8SToAl4SToCZrSToFZoSToHXrSToJU8SToJgvSToJl4SToLhrSToMX3STrAlvSTrCT9STrCgrSTrGgrSTrHXrSTrHboSTrJnoSTrNboSTvLnrST4AZoST8Ab8ST8JT8SUoJn3SU6HZ#SU6JTvSU8Db8SU8HboSU8LgrSV8JT8SZrAcrSZrAl3SZrJT8SZrJnvSZrMT8SZvLUoSZ4FZoSZ8JnoSZ8RZrScoLnrScoMT8ScoMX8ScrAT4ScrAZ8ScrLZ8ScrLkvScvDb8ScvLf8ScvNToSgrFZrShvKnrSloHUoSloLnrSlrMXoSl8HgrSmrJUoSn3BX6","ATFlOn3ATLgrDYAT4MTAnAT8LTMnAYJnRTrAbGgJnrAbLV8LnAbvNTAnAeFbLg3AgOYMXoAlQbFboAnDboAfAnJgoJTBToDgAnBUJbAl3BboDUAnCTDlvLnCTFTrSnCYoQTLnDTwAbAnDUDTrSnDUHgHgrDX8LXFnDbJXAcrETvLTLnGTFTQbrGTMnGToGT3DUFbGUJlPX3GbQg8LnGboJbFnGb3GgAYGgAg8ScGgMbAXrGgvAbAnGnJTLnvGnvATFgHTDT6ATHTrDlJnHYLnMn8HZrSbJTHZ8LTFnHbFTJUoHgSeMT8HgrLjAnHgvAbAnHlFUrDlHnDgvAnHnHTFT3HnQTGnrJTAaMXvJTGbCn3JTOgrAnJXvAXMnJbMg8SnJbMnRg3Jb8LTMnJnAl3OnJnGYrQlJnJlQY3LTDlCn3LTJjLg3LTLgvFXLTMg3GTLV8HUOgLXFZLg3LXNXrMnLX8QXFnLX9AlMYLYLXPXrLZAbJU8LZDUJU8LZMXrSnLZ$AgFnLaPXrDULbFYrMnLbMn8LXLboJgJgLeFbLg3LgLZrSnLgOYAgoLhrRnJlLkCTrSnLkOnLhrLnFX%AYLnFZoJXLnHTvJbLnLloAbMTATLf8MTHgJn3MTMXrAXMT3MTFnMUITvFnMXFX%AYMXMXvFbMXrFTDbMYAcMX3MbLf8SnMb8JbFnMgMXrMTMgvAXFnMgvGgCmMnAloSnMnFnJTrOXvMXSnOX8HTMnObJT8ScObLZFl3ObMXCZoPTLgrQXPUFnoQXPU3RXJlPX3RkQXPbrJXQlPlrJbFnQUAhrDbQXGnCXvQYLnHlvQbLfLnvRTOgvJbRXJYrQlRYLnrQlRbLnrQlRlFT8JlRlFnrQXSTClCn3STHTrAnSTLZQlrSTMnGTrSToHgGbSTrGTDnSTvGXCnST3HgFbSU3HXAXSbAnJn3SbFT8LnScLfLnv","AT3JgJX8AT8FZoSnAT8JgFV8AT8LhrDbAZ8JT8DbAb8GgLhrAb8SkLnvAe8MT8SnAlMYJXLVAl3GYDTvAl3LfLnvBUDTvLl3CTOn3HTrCT3DUGgrCU8MT8AbCbFTrJUoCgrDb8MTDTLV8JX8DTLnLXQlDT8LZrSnDUQb8FZ8DUST4JnvDb8ScOUoDj6GbJl4GTLfCYMlGToAXvFnGboAXvLnGgAcrJn3GgvFnSToGnLf8JnvGn#HTDToHTLnFXJlHTvATFToHTvHTDToHTvMTAgoHT3STClvHT4AlFl6HT8HTDToHUoDgJTrHUoScMX3HbRZrMXoHboJg8LTHgDb8JTrHgMToLf8HgvLnLnoHnHn3HT4Hn6MgvAnJTJU8ScvJT3AaQT8JT8HTrAnJXrRg8AnJbAloMXoJbrATFToJbvMnoSnJgDb6GgvJgDb8MXoJgSX3JU8JguATFToJlPYLnQlJlQkDnLbJlQlFYJlJl8Lf8OTJnCTFnLbJnLTHXMnJnLXGXCnJnoFfRg3JnrMYRg3Jn3HgFl3KT8Dg8LnLTRlFnPTLTvPbLbvLVoSbrCZLXMY6HT3LXNU7DlrLXNXDTATLX8DX8LnLZDb8JU8LZMnoLhrLZSToJU8LZrLaLnrLZvJn3SnLZ8LhrSnLaJnoMT8LbFlrHTvLbrFTLnrLbvATLlvLb6OTFn3LcLnJZOlLeAT6Mn4LeJT3ObrLg6LXFlrLhrJg8LnLhvDlPX4LhvLfLnvLj6JTFT3LnFbrMXoLnQluCTvLnrQXCY6LnvLfLnvLnvMgLnvLnvSeLf8MTMbrJn3MT3JgST3MT8AnATrMT8LULnrMUMToCZrMUScvLf8MXoDT8SnMX6ATFToMX8AXMT8MX8FkMT8MX8HTrDUMX8ScoSnMYJT6CTvMgAcrMXoMg8SToAfMlvAXLg3MnFl3AnvOT3AnFl3OUoATHT8OU3RnLXrOXrOXrSnObPbvFn6Og8HgrSnOg8OX8DbPTvAgoJgPU3RYLnrPXrDnJZrPb8CTGgvPlrLTDlvPlvFUJnoQUvFXrQlQeMnoAl3QlrQlrSnRTFTrJUoSTDlLiLXSTFg6HT3STJgoMn4STrFTJTrSTrLZFl3ST4FnMXoSUrDlHUoScvHTvSnSfLkvMXo","AUoAcrMXoAZ8HboAg8AbOg6ATFgAg8AloMXoAl3AT8JTrAl8MX8MXoCT3SToJU8Cl8Db8MXoDT8HgrATrDboOT8MXoGTOTrATMnGT8LhrAZ8GnvFnGnQXHToGgvAcrHTvAXvLl3HbrAZoMXoHgBlFXLg3HgMnFXrSnHgrSb8JUoHn6HT8LgvITvATrJUoJUoLZrRnvJU8HT8Jb8JXvFX8QT8JXvLToJTrJYrQnGnQXJgrJnoATrJnoJU8ScvJnvMnvMXoLTCTLgrJXLTJlRTvQlLbRnJlQYvLbrMb8LnvLbvFn3RnoLdCVSTGZrLeSTvGXCnLg3MnoLn3MToLlrETvMT8SToAl3MbrDU6GTvMb8LX4LhrPlrLXGXCnSToLf8Rg3STrDb8LTrSTvLTHXMnSb3RYLnMnSgOg6ATFg","HUDlGnrQXrJTrHgLnrAcJYMb8DULc8LTvFgGnCk3Mg8JbAnLX4QYvFYHnMXrRUoJnGnvFnRlvFTJlQnoSTrBXHXrLYSUJgLfoMT8Se8DTrHbDb","AbDl8SToJU8An3RbAb8ST8DUSTrGnrAgoLbFU6Db8LTrMg8AaHT8Jb8ObDl8SToJU8Pb3RlvFYoJl"];let ci=null;function fi(e){if(null==ci&&(ci=[],li.forEach(((e,t)=>{t+=4;for(let n=0;n=40?r=r+168-40:r>=19&&(r=r+97-19),Ye([225,132+(r>>6),128+(63&r)]));ci.push(i)}var r})),ci.sort(),"0xf9eddeace9c5d3da9c93cf7d3cd38f6a13ed3affb933259ae865714e8a3ae71a"!==Vn.check(e)))throw ci=null,new Error("BIP39 Wordlist for ko (Korean) FAILED")}const hi=new class extends Vn{constructor(){super("ko")}getWord(e){return fi(this),ci[e]}getWordIndex(e){return fi(this),ci.indexOf(e)}};Vn.register(hi);let di=null;function pi(e){if(null==di&&(di="AbacoAbbaglioAbbinatoAbeteAbissoAbolireAbrasivoAbrogatoAccadereAccennoAccusatoAcetoneAchilleAcidoAcquaAcreAcrilicoAcrobataAcutoAdagioAddebitoAddomeAdeguatoAderireAdipeAdottareAdulareAffabileAffettoAffissoAffrantoAforismaAfosoAfricanoAgaveAgenteAgevoleAggancioAgireAgitareAgonismoAgricoloAgrumetoAguzzoAlabardaAlatoAlbatroAlberatoAlboAlbumeAlceAlcolicoAlettoneAlfaAlgebraAlianteAlibiAlimentoAllagatoAllegroAllievoAllodolaAllusivoAlmenoAlogenoAlpacaAlpestreAltalenaAlternoAlticcioAltroveAlunnoAlveoloAlzareAmalgamaAmanitaAmarenaAmbitoAmbratoAmebaAmericaAmetistaAmicoAmmassoAmmendaAmmirareAmmonitoAmoreAmpioAmpliareAmuletoAnacardoAnagrafeAnalistaAnarchiaAnatraAncaAncellaAncoraAndareAndreaAnelloAngeloAngolareAngustoAnimaAnnegareAnnidatoAnnoAnnuncioAnonimoAnticipoAnziApaticoAperturaApodeApparireAppetitoAppoggioApprodoAppuntoAprileArabicaArachideAragostaAraldicaArancioAraturaArazzoArbitroArchivioArditoArenileArgentoArgineArgutoAriaArmoniaArneseArredatoArringaArrostoArsenicoArsoArteficeArzilloAsciuttoAscoltoAsepsiAsetticoAsfaltoAsinoAsolaAspiratoAsproAssaggioAsseAssolutoAssurdoAstaAstenutoAsticeAstrattoAtavicoAteismoAtomicoAtonoAttesaAttivareAttornoAttritoAttualeAusilioAustriaAutistaAutonomoAutunnoAvanzatoAvereAvvenireAvvisoAvvolgereAzioneAzotoAzzimoAzzurroBabeleBaccanoBacinoBacoBadessaBadilataBagnatoBaitaBalconeBaldoBalenaBallataBalzanoBambinoBandireBaraondaBarbaroBarcaBaritonoBarlumeBaroccoBasilicoBassoBatostaBattutoBauleBavaBavosaBeccoBeffaBelgioBelvaBendaBenevoleBenignoBenzinaBereBerlinaBetaBibitaBiciBidoneBifidoBigaBilanciaBimboBinocoloBiologoBipedeBipolareBirbanteBirraBiscottoBisestoBisnonnoBisonteBisturiBizzarroBlandoBlattaBollitoBonificoBordoBoscoBotanicoBottinoBozzoloBraccioBradipoBramaBrancaBravuraBretellaBrevettoBrezzaBrigliaBrillanteBrindareBroccoloBrodoBronzinaBrulloBrunoBubboneBucaBudinoBuffoneBuioBulboBuonoBurloneBurrascaBussolaBustaCadettoCaducoCalamaroCalcoloCalesseCalibroCalmoCaloriaCambusaCamerataCamiciaCamminoCamolaCampaleCanapaCandelaCaneCaninoCanottoCantinaCapaceCapelloCapitoloCapogiroCapperoCapraCapsulaCarapaceCarcassaCardoCarismaCarovanaCarrettoCartolinaCasaccioCascataCasermaCasoCassoneCastelloCasualeCatastaCatenaCatrameCautoCavilloCedibileCedrataCefaloCelebreCellulareCenaCenoneCentesimoCeramicaCercareCertoCerumeCervelloCesoiaCespoCetoChelaChiaroChiccaChiedereChimeraChinaChirurgoChitarraCiaoCiclismoCifrareCignoCilindroCiottoloCircaCirrosiCitricoCittadinoCiuffoCivettaCivileClassicoClinicaCloroCoccoCodardoCodiceCoerenteCognomeCollareColmatoColoreColposoColtivatoColzaComaCometaCommandoComodoComputerComuneConcisoCondurreConfermaCongelareConiugeConnessoConoscereConsumoContinuoConvegnoCopertoCopioneCoppiaCopricapoCorazzaCordataCoricatoCorniceCorollaCorpoCorredoCorsiaCorteseCosmicoCostanteCotturaCovatoCratereCravattaCreatoCredereCremosoCrescitaCretaCricetoCrinaleCrisiCriticoCroceCronacaCrostataCrucialeCruscaCucireCuculoCuginoCullatoCupolaCuratoreCursoreCurvoCuscinoCustodeDadoDainoDalmataDamerinoDanielaDannosoDanzareDatatoDavantiDavveroDebuttoDecennioDecisoDeclinoDecolloDecretoDedicatoDefinitoDeformeDegnoDelegareDelfinoDelirioDeltaDemenzaDenotatoDentroDepositoDerapataDerivareDerogaDescrittoDesertoDesiderioDesumereDetersivoDevotoDiametroDicembreDiedroDifesoDiffusoDigerireDigitaleDiluvioDinamicoDinnanziDipintoDiplomaDipoloDiradareDireDirottoDirupoDisagioDiscretoDisfareDisgeloDispostoDistanzaDisumanoDitoDivanoDiveltoDividereDivoratoDobloneDocenteDoganaleDogmaDolceDomatoDomenicaDominareDondoloDonoDormireDoteDottoreDovutoDozzinaDragoDruidoDubbioDubitareDucaleDunaDuomoDupliceDuraturoEbanoEccessoEccoEclissiEconomiaEderaEdicolaEdileEditoriaEducareEgemoniaEgliEgoismoEgregioElaboratoElargireEleganteElencatoElettoElevareElficoElicaElmoElsaElusoEmanatoEmblemaEmessoEmiroEmotivoEmozioneEmpiricoEmuloEndemicoEnduroEnergiaEnfasiEnotecaEntrareEnzimaEpatiteEpilogoEpisodioEpocaleEppureEquatoreErarioErbaErbosoEredeEremitaErigereErmeticoEroeErosivoErranteEsagonoEsameEsanimeEsaudireEscaEsempioEsercitoEsibitoEsigenteEsistereEsitoEsofagoEsortatoEsosoEspansoEspressoEssenzaEssoEstesoEstimareEstoniaEstrosoEsultareEtilicoEtnicoEtruscoEttoEuclideoEuropaEvasoEvidenzaEvitatoEvolutoEvvivaFabbricaFaccendaFachiroFalcoFamigliaFanaleFanfaraFangoFantasmaFareFarfallaFarinosoFarmacoFasciaFastosoFasulloFaticareFatoFavolosoFebbreFecolaFedeFegatoFelpaFeltroFemminaFendereFenomenoFermentoFerroFertileFessuraFestivoFettaFeudoFiabaFiduciaFifaFiguratoFiloFinanzaFinestraFinireFioreFiscaleFisicoFiumeFlaconeFlamencoFleboFlemmaFloridoFluenteFluoroFobicoFocacciaFocosoFoderatoFoglioFolataFolcloreFolgoreFondenteFoneticoFoniaFontanaForbitoForchettaForestaFormicaFornaioForoFortezzaForzareFosfatoFossoFracassoFranaFrassinoFratelloFreccettaFrenataFrescoFrigoFrollinoFrondeFrugaleFruttaFucilataFucsiaFuggenteFulmineFulvoFumanteFumettoFumosoFuneFunzioneFuocoFurboFurgoneFuroreFusoFutileGabbianoGaffeGalateoGallinaGaloppoGamberoGammaGaranziaGarboGarofanoGarzoneGasdottoGasolioGastricoGattoGaudioGazeboGazzellaGecoGelatinaGelsoGemelloGemmatoGeneGenitoreGennaioGenotipoGergoGhepardoGhiaccioGhisaGialloGildaGineproGiocareGioielloGiornoGioveGiratoGironeGittataGiudizioGiuratoGiustoGlobuloGlutineGnomoGobbaGolfGomitoGommoneGonfioGonnaGovernoGracileGradoGraficoGrammoGrandeGrattareGravosoGraziaGrecaGreggeGrifoneGrigioGrinzaGrottaGruppoGuadagnoGuaioGuantoGuardareGufoGuidareIbernatoIconaIdenticoIdillioIdoloIdraIdricoIdrogenoIgieneIgnaroIgnoratoIlareIllesoIllogicoIlludereImballoImbevutoImboccoImbutoImmaneImmersoImmolatoImpaccoImpetoImpiegoImportoImprontaInalareInarcareInattivoIncantoIncendioInchinoIncisivoInclusoIncontroIncrocioIncuboIndagineIndiaIndoleIneditoInfattiInfilareInflittoIngaggioIngegnoIngleseIngordoIngrossoInnescoInodoreInoltrareInondatoInsanoInsettoInsiemeInsonniaInsulinaIntasatoInteroIntonacoIntuitoInumidireInvalidoInveceInvitoIperboleIpnoticoIpotesiIppicaIrideIrlandaIronicoIrrigatoIrrorareIsolatoIsotopoIstericoIstitutoIstriceItaliaIterareLabbroLabirintoLaccaLaceratoLacrimaLacunaLaddoveLagoLampoLancettaLanternaLardosoLargaLaringeLastraLatenzaLatinoLattugaLavagnaLavoroLegaleLeggeroLemboLentezzaLenzaLeoneLepreLesivoLessatoLestoLetteraleLevaLevigatoLiberoLidoLievitoLillaLimaturaLimitareLimpidoLineareLinguaLiquidoLiraLiricaLiscaLiteLitigioLivreaLocandaLodeLogicaLombareLondraLongevoLoquaceLorenzoLotoLotteriaLuceLucidatoLumacaLuminosoLungoLupoLuppoloLusingaLussoLuttoMacabroMacchinaMaceroMacinatoMadamaMagicoMagliaMagneteMagroMaiolicaMalafedeMalgradoMalintesoMalsanoMaltoMalumoreManaManciaMandorlaMangiareManifestoMannaroManovraMansardaMantideManubrioMappaMaratonaMarcireMarettaMarmoMarsupioMascheraMassaiaMastinoMaterassoMatricolaMattoneMaturoMazurcaMeandroMeccanicoMecenateMedesimoMeditareMegaMelassaMelisMelodiaMeningeMenoMensolaMercurioMerendaMerloMeschinoMeseMessereMestoloMetalloMetodoMettereMiagolareMicaMicelioMicheleMicroboMidolloMieleMiglioreMilanoMiliteMimosaMineraleMiniMinoreMirinoMirtilloMiscelaMissivaMistoMisurareMitezzaMitigareMitraMittenteMnemonicoModelloModificaModuloMoganoMogioMoleMolossoMonasteroMoncoMondinaMonetarioMonileMonotonoMonsoneMontatoMonvisoMoraMordereMorsicatoMostroMotivatoMotosegaMottoMovenzaMovimentoMozzoMuccaMucosaMuffaMughettoMugnaioMulattoMulinelloMultiploMummiaMuntoMuovereMuraleMusaMuscoloMusicaMutevoleMutoNababboNaftaNanometroNarcisoNariceNarratoNascereNastrareNaturaleNauticaNaviglioNebulosaNecrosiNegativoNegozioNemmenoNeofitaNerettoNervoNessunoNettunoNeutraleNeveNevroticoNicchiaNinfaNitidoNobileNocivoNodoNomeNominaNordicoNormaleNorvegeseNostranoNotareNotiziaNotturnoNovellaNucleoNullaNumeroNuovoNutrireNuvolaNuzialeOasiObbedireObbligoObeliscoOblioOboloObsoletoOccasioneOcchioOccidenteOccorrereOccultareOcraOculatoOdiernoOdorareOffertaOffrireOffuscatoOggettoOggiOgnunoOlandeseOlfattoOliatoOlivaOlogrammaOltreOmaggioOmbelicoOmbraOmegaOmissioneOndosoOnereOniceOnnivoroOnorevoleOntaOperatoOpinioneOppostoOracoloOrafoOrdineOrecchinoOreficeOrfanoOrganicoOrigineOrizzonteOrmaOrmeggioOrnativoOrologioOrrendoOrribileOrtensiaOrticaOrzataOrzoOsareOscurareOsmosiOspedaleOspiteOssaOssidareOstacoloOsteOtiteOtreOttagonoOttimoOttobreOvaleOvestOvinoOviparoOvocitoOvunqueOvviareOzioPacchettoPacePacificoPadellaPadronePaesePagaPaginaPalazzinaPalesarePallidoPaloPaludePandoroPannelloPaoloPaonazzoPapricaParabolaParcellaParerePargoloPariParlatoParolaPartireParvenzaParzialePassivoPasticcaPataccaPatologiaPattumePavonePeccatoPedalarePedonalePeggioPelosoPenarePendicePenisolaPennutoPenombraPensarePentolaPepePepitaPerbenePercorsoPerdonatoPerforarePergamenaPeriodoPermessoPernoPerplessoPersuasoPertugioPervasoPesatorePesistaPesoPestiferoPetaloPettinePetulantePezzoPiacerePiantaPiattinoPiccinoPicozzaPiegaPietraPifferoPigiamaPigolioPigroPilaPiliferoPillolaPilotaPimpantePinetaPinnaPinoloPioggiaPiomboPiramidePireticoPiritePirolisiPitonePizzicoPlaceboPlanarePlasmaPlatanoPlenarioPochezzaPoderosoPodismoPoesiaPoggiarePolentaPoligonoPollicePolmonitePolpettaPolsoPoltronaPolverePomicePomodoroPontePopolosoPorfidoPorosoPorporaPorrePortataPosaPositivoPossessoPostulatoPotassioPoterePranzoPrassiPraticaPreclusoPredicaPrefissoPregiatoPrelievoPremerePrenotarePreparatoPresenzaPretestoPrevalsoPrimaPrincipePrivatoProblemaProcuraProdurreProfumoProgettoProlungaPromessaPronomePropostaProrogaProtesoProvaPrudentePrugnaPruritoPsichePubblicoPudicaPugilatoPugnoPulcePulitoPulsantePuntarePupazzoPupillaPuroQuadroQualcosaQuasiQuerelaQuotaRaccoltoRaddoppioRadicaleRadunatoRafficaRagazzoRagioneRagnoRamarroRamingoRamoRandagioRantolareRapatoRapinaRappresoRasaturaRaschiatoRasenteRassegnaRastrelloRataRavvedutoRealeRecepireRecintoReclutaReconditoRecuperoRedditoRedimereRegalatoRegistroRegolaRegressoRelazioneRemareRemotoRennaReplicaReprimereReputareResaResidenteResponsoRestauroReteRetinaRetoricaRettificaRevocatoRiassuntoRibadireRibelleRibrezzoRicaricaRiccoRicevereRiciclatoRicordoRicredutoRidicoloRidurreRifasareRiflessoRiformaRifugioRigareRigettatoRighelloRilassatoRilevatoRimanereRimbalzoRimedioRimorchioRinascitaRincaroRinforzoRinnovoRinomatoRinsavitoRintoccoRinunciaRinvenireRiparatoRipetutoRipienoRiportareRipresaRipulireRisataRischioRiservaRisibileRisoRispettoRistoroRisultatoRisvoltoRitardoRitegnoRitmicoRitrovoRiunioneRivaRiversoRivincitaRivoltoRizomaRobaRoboticoRobustoRocciaRocoRodaggioRodereRoditoreRogitoRollioRomanticoRompereRonzioRosolareRospoRotanteRotondoRotulaRovescioRubizzoRubricaRugaRullinoRumineRumorosoRuoloRupeRussareRusticoSabatoSabbiareSabotatoSagomaSalassoSaldaturaSalgemmaSalivareSalmoneSaloneSaltareSalutoSalvoSapereSapidoSaporitoSaracenoSarcasmoSartoSassosoSatelliteSatiraSatolloSaturnoSavanaSavioSaziatoSbadiglioSbalzoSbancatoSbarraSbattereSbavareSbendareSbirciareSbloccatoSbocciatoSbrinareSbruffoneSbuffareScabrosoScadenzaScalaScambiareScandaloScapolaScarsoScatenareScavatoSceltoScenicoScettroSchedaSchienaSciarpaScienzaScindereScippoSciroppoScivoloSclerareScodellaScolpitoScompartoSconfortoScoprireScortaScossoneScozzeseScribaScrollareScrutinioScuderiaScultoreScuolaScuroScusareSdebitareSdoganareSeccaturaSecondoSedanoSeggiolaSegnalatoSegregatoSeguitoSelciatoSelettivoSellaSelvaggioSemaforoSembrareSemeSeminatoSempreSensoSentireSepoltoSequenzaSerataSerbatoSerenoSerioSerpenteSerraglioServireSestinaSetolaSettimanaSfaceloSfaldareSfamatoSfarzosoSfaticatoSferaSfidaSfilatoSfingeSfocatoSfoderareSfogoSfoltireSforzatoSfrattoSfruttatoSfuggitoSfumareSfusoSgabelloSgarbatoSgonfiareSgorbioSgrassatoSguardoSibiloSiccomeSierraSiglaSignoreSilenzioSillabaSimboloSimpaticoSimulatoSinfoniaSingoloSinistroSinoSintesiSinusoideSiparioSismaSistoleSituatoSlittaSlogaturaSlovenoSmarritoSmemoratoSmentitoSmeraldoSmilzoSmontareSmottatoSmussatoSnellireSnervatoSnodoSobbalzoSobrioSoccorsoSocialeSodaleSoffittoSognoSoldatoSolenneSolidoSollazzoSoloSolubileSolventeSomaticoSommaSondaSonettoSonniferoSopireSoppesoSopraSorgereSorpassoSorrisoSorsoSorteggioSorvolatoSospiroSostaSottileSpadaSpallaSpargereSpatolaSpaventoSpazzolaSpecieSpedireSpegnereSpelaturaSperanzaSpessoreSpettraleSpezzatoSpiaSpigolosoSpillatoSpinosoSpiraleSplendidoSportivoSposoSprangaSprecareSpronatoSpruzzoSpuntinoSquilloSradicareSrotolatoStabileStaccoStaffaStagnareStampatoStantioStarnutoStaseraStatutoSteloSteppaSterzoStilettoStimaStirpeStivaleStizzosoStonatoStoricoStrappoStregatoStriduloStrozzareStruttoStuccareStufoStupendoSubentroSuccosoSudoreSuggeritoSugoSultanoSuonareSuperboSupportoSurgelatoSurrogatoSussurroSuturaSvagareSvedeseSveglioSvelareSvenutoSveziaSviluppoSvistaSvizzeraSvoltaSvuotareTabaccoTabulatoTacciareTaciturnoTaleTalismanoTamponeTanninoTaraTardivoTargatoTariffaTarpareTartarugaTastoTatticoTavernaTavolataTazzaTecaTecnicoTelefonoTemerarioTempoTemutoTendoneTeneroTensioneTentacoloTeoremaTermeTerrazzoTerzettoTesiTesseratoTestatoTetroTettoiaTifareTigellaTimbroTintoTipicoTipografoTiraggioTiroTitanioTitoloTitubanteTizioTizzoneToccareTollerareToltoTombolaTomoTonfoTonsillaTopazioTopologiaToppaTorbaTornareTorroneTortoraToscanoTossireTostaturaTotanoTraboccoTracheaTrafilaTragediaTralcioTramontoTransitoTrapanoTrarreTraslocoTrattatoTraveTrecciaTremolioTrespoloTributoTrichecoTrifoglioTrilloTrinceaTrioTristezzaTrituratoTrivellaTrombaTronoTroppoTrottolaTrovareTruccatoTubaturaTuffatoTulipanoTumultoTunisiaTurbareTurchinoTutaTutelaUbicatoUccelloUccisoreUdireUditivoUffaUfficioUgualeUlisseUltimatoUmanoUmileUmorismoUncinettoUngereUnghereseUnicornoUnificatoUnisonoUnitarioUnteUovoUpupaUraganoUrgenzaUrloUsanzaUsatoUscitoUsignoloUsuraioUtensileUtilizzoUtopiaVacanteVaccinatoVagabondoVagliatoValangaValgoValicoVallettaValorosoValutareValvolaVampataVangareVanitosoVanoVantaggioVanveraVaporeVaranoVarcatoVarianteVascaVedettaVedovaVedutoVegetaleVeicoloVelcroVelinaVellutoVeloceVenatoVendemmiaVentoVeraceVerbaleVergognaVerificaVeroVerrucaVerticaleVescicaVessilloVestaleVeteranoVetrinaVetustoViandanteVibranteVicendaVichingoVicinanzaVidimareVigiliaVignetoVigoreVileVillanoViminiVincitoreViolaViperaVirgolaVirologoVirulentoViscosoVisioneVispoVissutoVisuraVitaVitelloVittimaVivandaVividoViziareVoceVogaVolatileVolereVolpeVoragineVulcanoZampognaZannaZappatoZatteraZavorraZefiroZelanteZeloZenzeroZerbinoZibettoZincoZirconeZittoZollaZoticoZuccheroZufoloZuluZuppa".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x5c1362d88fd4cf614a96f3234941d29f7d37c08c5292fde03bf62c2db6ff7620"!==Vn.check(e)))throw di=null,new Error("BIP39 Wordlist for it (Italian) FAILED")}const gi=new class extends Vn{constructor(){super("it")}getWord(e){return pi(this),di[e]}getWordIndex(e){return pi(this),di.indexOf(e)}};Vn.register(gi);const yi="}aE#4A=Yv&co#4N#6G=cJ&SM#66|/Z#4t&kn~46#4K~4q%b9=IR#7l,mB#7W_X2*dl}Uo~7s}Uf&Iw#9c&cw~6O&H6&wx&IG%v5=IQ~8a&Pv#47$PR&50%Ko&QM&3l#5f,D9#4L|/H&tQ;v0~6n]nN>2),128+bi.indexOf(yi[3*r+1]),128+bi.indexOf(yi[3*r+2])];if("zh_tw"===e.locale)for(let e=n%4;e<3;e++)i[e]=bi.indexOf("FAZDC6BALcLZCA+GBARCW8wNCcDDZ8LVFBOqqDUiou+M42TFAyERXFb7EjhP+vmBFpFrUpfDV2F7eB+eCltCHJFWLFCED+pWTojEIHFXc3aFn4F68zqjEuKidS1QBVPDEhE7NA4mhMF7oThD49ot3FgtzHFCK0acW1x8DH1EmLoIlrWFBLE+y5+NA3Cx65wJHTaEZVaK1mWAmPGxgYCdxwOjTDIt/faOEhTl1vqNsKtJCOhJWuio2g07KLZEQsFBUpNtwEByBgxFslFheFbiEPvi61msDvApxCzB6rBCzox7joYA5UdDc+Cb4FSgIabpXFAj3bjkmFAxCZE+mD/SFf/0ELecYCt3nLoxC6WEZf2tKDB4oZvrEmqFkKk7BwILA7gtYBpsTq//D4jD0F0wEB9pyQ1BD5Ba0oYHDI+sbDFhvrHXdDHfgFEIJLi5r8qercNFBgFLC4bo5ERJtamWBDFy73KCEb6M8VpmEt330ygCTK58EIIFkYgF84gtGA9Uyh3m68iVrFbWFbcbqiCYHZ9J1jeRPbL8yswhMiDbhEhdNoSwFbZrLT740ABEqgCkO8J1BLd1VhKKR4sD1yUo0z+FF59Mvg71CFbyEhbHSFBKEIKyoQNgQppq9T0KAqePu0ZFGrXOHdKJqkoTFhYvpDNyuuznrN84thJbsCoO6Cu6Xlvntvy0QYuAExQEYtTUBf3CoCqwgGFZ4u1HJFzDVwEy3cjcpV4QvsPaBC3rCGyCF23o4K3pp2gberGgFEJEHo4nHICtyKH2ZqyxhN05KBBJIQlKh/Oujv/DH32VrlqFdIFC7Fz9Ct4kaqFME0UETLprnN9kfy+kFmtQBB0+5CFu0N9Ij8l/VvJDh2oq3hT6EzjTHKFN7ZjZwoTsAZ4Exsko6Fpa6WC+sduz8jyrLpegTv2h1EBeYpLpm2czQW0KoCcS0bCVXCmuWJDBjN1nQNLdF58SFJ0h7i3pC3oEOKy/FjBklL70XvBEEIWp2yZ04xObzAWDDJG7f+DbqBEA7LyiR95j7MDVdDViz2RE5vWlBMv5e4+VfhP3aXNPhvLSynb9O2x4uFBV+3jqu6d5pCG28/sETByvmu/+IJ0L3wb4rj9DNOLBF6XPIODr4L19U9RRofAG6Nxydi8Bki8BhGJbBAJKzbJxkZSlF9Q2Cu8oKqggB9hBArwLLqEBWEtFowy8XK8bEyw9snT+BeyFk1ZCSrdmgfEwFePTgCjELBEnIbjaDDPJm36rG9pztcEzT8dGk23SBhXBB1H4z+OWze0ooFzz8pDBYFvp9j9tvFByf9y4EFdVnz026CGR5qMr7fxMHN8UUdlyJAzlTBDRC28k+L4FB8078ljyD91tUj1ocnTs8vdEf7znbzm+GIjEZnoZE5rnLL700Xc7yHfz05nWxy03vBB9YGHYOWxgMQGBCR24CVYNE1hpfKxN0zKnfJDmmMgMmBWqNbjfSyFCBWSCGCgR8yFXiHyEj+VtD1FB3FpC1zI0kFbzifiKTLm9yq5zFmur+q8FHqjoOBWsBPiDbnCC2ErunV6cJ6TygXFYHYp7MKN9RUlSIS8/xBAGYLzeqUnBF4QbsTuUkUqGs6CaiDWKWjQK9EJkjpkTmNCPYXL"[t++])+(0==e?228:128);mi[e.locale].push(Ye(i))}if(Vn.check(e)!==vi[e.locale])throw mi[e.locale]=null,new Error("BIP39 Wordlist for "+e.locale+" (Chinese) FAILED")}class wi extends Vn{constructor(e){super("zh_"+e)}getWord(e){return Si(this),mi[this.locale][e]}getWordIndex(e){return Si(this),mi[this.locale].indexOf(e)}split(e){return(e=e.replace(/(?:\u3000| )+/g,"")).split("")}}const Ei=new wi("cn");Vn.register(Ei),Vn.register(Ei,"zh");const Ai=new wi("tw");Vn.register(Ai);const Ti={cz:Hn,en:Xn,es:Wn,fr:ni,it:gi,ja:ui,ko:hi,zh:Ei,zh_cn:Ei,zh_tw:Ai},Ci=new z.b("hdnode/5.4.0"),Ii=Z.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),ki=Ge("Bitcoin seed");function Bi(e){return(1<=256)throw new Error("Depth too large!");return Pi(Object(J.b)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",Object(J.i)(this.depth),this.parentFingerprint,Object(J.h)(Object(J.i)(this.index),4),this.chainCode,null!=this.privateKey?Object(J.b)(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new Mi(Ni,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let t=this.path;t&&(t+="/"+(2147483647&e));const r=new Uint8Array(37);if(2147483648&e){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set(Object(J.a)(this.privateKey),1),t&&(t+="'")}else r.set(Object(J.a)(this.publicKey));for(let c=24;c>=0;c-=8)r[33+(c>>3)]=e>>24-c&255;const n=Object(J.a)(xn(On.sha512,this.chainCode,r)),i=n.slice(0,32),a=n.slice(32);let o=null,s=null;this.privateKey?o=_i(Z.from(i).add(this.privateKey).mod(Ii)):s=new yr(Object(J.i)(i))._addPoint(this.publicKey);let u=t;const l=this.mnemonic;return l&&(u=Object.freeze({phrase:l.phrase,path:t,locale:l.locale||"en"})),new Mi(Ni,o,s,this.fingerprint,_i(a),e,this.depth+1,u)}derivePath(e){const t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===t[0]&&t.shift();let r=this;for(let n=0;n=2147483648)throw new Error("invalid path index - "+e);r=r._derive(2147483648+t)}else{if(!e.match(/^[0-9]+$/))throw new Error("invalid path component - "+e);{const t=parseInt(e);if(t>=2147483648)throw new Error("invalid path index - "+e);r=r._derive(t)}}}return r}static _fromSeed(e,t){const r=Object(J.a)(e);if(r.length<16||r.length>64)throw new Error("invalid seed");const n=Object(J.a)(xn(On.sha512,ki,r));return new Mi(Ni,_i(n.slice(0,32)),null,"0x00000000",_i(n.slice(32)),0,0,t)}static fromMnemonic(e,t,r){return e=Fi(Di(e,r=Oi(r)),r),Mi._fromSeed(Li(e,t),{phrase:e,path:"m",locale:r.locale})}static fromSeed(e){return Mi._fromSeed(e,null)}static fromExtendedKey(e){const t=Pn.decode(e);82===t.length&&Pi(t.slice(0,78))===e||Ci.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const r=t[4],n=Object(J.i)(t.slice(5,9)),i=parseInt(Object(J.i)(t.slice(9,13)).substring(2),16),a=Object(J.i)(t.slice(13,45)),o=t.slice(45,78);switch(Object(J.i)(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new Mi(Ni,null,Object(J.i)(o),n,a,i,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==o[0])break;return new Mi(Ni,Object(J.i)(o.slice(1)),null,n,a,i,r,null)}return Ci.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function Li(e,t){t||(t="");const r=Ge("mnemonic"+t,je.NFKD);return Un(Ge(e,je.NFKD),r,2048,64,"sha512")}function Di(e,t){t=Oi(t),Ci.checkNormalize();const r=t.split(e);if(r.length%3!=0)throw new Error("invalid mnemonic");const n=Object(J.a)(new Uint8Array(Math.ceil(11*r.length/8)));let i=0;for(let s=0;s>3]|=1<<7-i%8),i++}const a=32*r.length/3,o=Bi(r.length/3);if((Object(J.a)(Dn(n.slice(0,a/8)))[0]&o)!==(n[n.length-1]&o))throw new Error("invalid checksum");return Object(J.i)(n.slice(0,a/8))}function Fi(e,t){if(t=Oi(t),(e=Object(J.a)(e)).length%4!=0||e.length<16||e.length>32)throw new Error("invalid entropy");const r=[0];let n=11;for(let o=0;o8?(r[r.length-1]<<=8,r[r.length-1]|=e[o],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[o]>>8-n,r.push(e[o]&(1<<8-n)-1),n+=3);const i=e.length/4,a=Object(J.a)(Dn(e))[0]&Bi(i);return r[r.length-1]<<=i,r[r.length-1]|=a>>8-i,t.join(r.map((e=>t.getWord(e))))}function xi(e,t){try{return Di(e,t),!0}catch(e){}return!1}function Ui(e){return("number"!=typeof e||e<0||e>=2147483648||e%1)&&Ci.throwArgumentError("invalid account index","index",e),"m/44'/60'/".concat(e,"'/0/0")}var ji=r(146),Vi=r(9),Ki=r.n(Vi),Ji=r(37),Hi=r.n(Ji);function Gi(e){return"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Object(J.a)(e)}function zi(e,t){for(e=String(e);e.lengtht)),ie(this,"address",Cr(this.publicKey)),this.address!==Me(e.address)&&da.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){const t=e.mnemonic;return t&&t.phrase}(e)){const t=e.mnemonic;ie(this,"_mnemonic",(()=>({phrase:t.phrase,path:t.path||Ri,locale:t.locale||"en"})));const r=this.mnemonic;Cr(Mi.fromMnemonic(r.phrase,null,r.locale).derivePath(r.path).privateKey)!==this.address&&da.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else ie(this,"_mnemonic",(()=>null))}else{if(yr.isSigningKey(e))"secp256k1"!==e.curve&&da.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),ie(this,"_signingKey",(()=>e));else{"string"==typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);const t=new yr(e);ie(this,"_signingKey",(()=>t))}ie(this,"_mnemonic",(()=>null)),ie(this,"address",Cr(this.publicKey))}var r;t&&!ar.isProvider(t)&&da.throwArgumentError("invalid provider","provider",t),ie(this,"provider",t||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new pa(this,e)}signTransaction(e){return oe(e).then((t=>{null!=t.from&&(Me(t.from)!==this.address&&da.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete t.from);const r=this._signingKey().signDigest(Se(Rr(t)));return Rr(t,r)}))}signMessage(e){return ha(this,void 0,void 0,(function*(){return Object(J.m)(this._signingKey().signDigest(hn(e)))}))}_signTypedData(e,t,r){return ha(this,void 0,void 0,(function*(){const n=yield Bn.resolveNames(e,t,r,(e=>(null==this.provider&&da.throwError("cannot resolve ENS names without a provider",z.b.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),this.provider.resolveName(e))));return Object(J.m)(this._signingKey().signDigest(Bn.hash(n.domain,t,n.value)))}))}encrypt(e,t,r){if("function"!=typeof t||r||(r=t,t={}),r&&"function"!=typeof r)throw new Error("invalid callback");return t||(t={}),function(e,t,r,n){try{if(Me(e.address)!==Cr(e.privateKey))throw new Error("address/privateKey mismatch");if(Wi(e)){const t=e.mnemonic;if(Mi.fromMnemonic(t.phrase,null,t.locale).derivePath(t.path||Ri).privateKey!=e.privateKey)throw new Error("mnemonic mismatch")}}catch(e){return Promise.reject(e)}"function"!=typeof r||n||(n=r,r={}),r||(r={});const i=Object(J.a)(e.privateKey),a=Xi(t);let o=null,s=null,u=null;if(Wi(e)){const t=e.mnemonic;o=Object(J.a)(Di(t.phrase,t.locale||"en")),s=t.path||Ri,u=t.locale||"en"}let l=r.client;l||(l="ethers.js");let c=null;c=r.salt?Object(J.a)(r.salt):Object(ji.a)(32);let f=null;if(r.iv){if(f=Object(J.a)(r.iv),16!==f.length)throw new Error("invalid iv")}else f=Object(ji.a)(16);let h=null;if(r.uuid){if(h=Object(J.a)(r.uuid),16!==h.length)throw new Error("invalid uuid")}else h=Object(ji.a)(16);let d=1<<17,p=8,g=1;return r.scrypt&&(r.scrypt.N&&(d=r.scrypt.N),r.scrypt.r&&(p=r.scrypt.r),r.scrypt.p&&(g=r.scrypt.p)),Hi.a.scrypt(a,c,d,p,g,64,n).then((t=>{const r=(t=Object(J.a)(t)).slice(0,16),n=t.slice(16,32),a=t.slice(32,64),y=new Ki.a.Counter(f),m=new Ki.a.ModeOfOperation.ctr(r,y),v=Object(J.a)(m.encrypt(i)),b=Se(Object(J.b)([n,v])),S={address:e.address.substring(2).toLowerCase(),id:Yi(h),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:Object(J.i)(f).substring(2)},ciphertext:Object(J.i)(v).substring(2),kdf:"scrypt",kdfparams:{salt:Object(J.i)(c).substring(2),n:d,dklen:32,p:g,r:p},mac:b.substring(2)}};if(o){const e=Object(ji.a)(16),t=new Ki.a.Counter(e),r=new Ki.a.ModeOfOperation.ctr(a,t),n=Object(J.a)(r.encrypt(o)),i=new Date,c=i.getUTCFullYear()+"-"+zi(i.getUTCMonth()+1,2)+"-"+zi(i.getUTCDate(),2)+"T"+zi(i.getUTCHours(),2)+"-"+zi(i.getUTCMinutes(),2)+"-"+zi(i.getUTCSeconds(),2)+".0Z";S["x-ethers"]={client:l,gethFilename:"UTC--"+c+"--"+S.address,mnemonicCounter:Object(J.i)(e).substring(2),mnemonicCiphertext:Object(J.i)(n).substring(2),path:s,locale:u,version:"0.1"}}return JSON.stringify(S)}))}(this,e,t,r)}static createRandom(e){let t=Object(ji.a)(16);e||(e={}),e.extraEntropy&&(t=Object(J.a)(Object(J.e)(Se(Object(J.b)([t,e.extraEntropy])),0,16)));const r=Fi(t,e.locale);return pa.fromMnemonic(r,e.path,e.locale)}static fromEncryptedJson(e,t,r){return ca(e,t,r).then((e=>new pa(e)))}static fromEncryptedJsonSync(e,t){return new pa(fa(e,t))}static fromMnemonic(e,t,r){return t||(t=Ri),new pa(Mi.fromMnemonic(e,null,r).derivePath(t))}}function ga(e,t){return Ir(hn(e),t)}function ya(e,t,r,n){return Ir(Bn.hash(e,t,r),n)}const ma="0x0000000000000000000000000000000000000000",va="0x0000000000000000000000000000000000000000000000000000000000000000",ba="\u039e",Sa=new z.b("networks/5.4.2");function wa(e){const t=function(t,r){null==r&&(r={});const n=[];if(t.InfuraProvider)try{n.push(new t.InfuraProvider(e,r.infura))}catch(e){}if(t.EtherscanProvider)try{n.push(new t.EtherscanProvider(e,r.etherscan))}catch(e){}if(t.AlchemyProvider)try{n.push(new t.AlchemyProvider(e,r.alchemy))}catch(e){}if(t.PocketProvider){const r=["goerli","ropsten","rinkeby"];try{const i=new t.PocketProvider(e);i.network&&-1===r.indexOf(i.network.name)&&n.push(i)}catch(e){}}if(t.CloudflareProvider)try{n.push(new t.CloudflareProvider(e))}catch(e){}if(0===n.length)return null;if(t.FallbackProvider){let i=1;return null!=r.quorum?i=r.quorum:"homestead"===e&&(i=2),new t.FallbackProvider(n,i)}return n[0]};return t.renetwork=function(e){return wa(e)},t}function Ea(e,t){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return Ea(e,t)},r}const Aa={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:wa("homestead")},Ta={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:wa("ropsten")},Ca={chainId:63,name:"classicMordor",_defaultProvider:Ea("https://www.ethercluster.com/mordor","classicMordor")},Ia={unspecified:{chainId:0,name:"unspecified"},homestead:Aa,mainnet:Aa,morden:{chainId:2,name:"morden"},ropsten:Ta,testnet:Ta,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:wa("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:wa("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:wa("goerli")},classic:{chainId:61,name:"classic",_defaultProvider:Ea("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:Ca,classicTestnet:Ca,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:Ea("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic"},maticmum:{chainId:80001,name:"maticmum"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function ka(e){if(null==e)return null;if("number"==typeof e){for(const t in Ia){const r=Ia[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){const t=Ia[e];return null==t?null:{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress,_defaultProvider:t._defaultProvider||null}}const t=Ia[e.name];if(!t)return"number"!=typeof e.chainId&&Sa.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==t.chainId&&Sa.throwArgumentError("network chainId mismatch","network",e);let r=e._defaultProvider||null;var n;return null==r&&t._defaultProvider&&(r=(n=t._defaultProvider)&&"function"==typeof n.renetwork?t._defaultProvider.renetwork(e):t._defaultProvider),{name:e.name,chainId:t.chainId,ensAddress:e.ensAddress||t.ensAddress||null,_defaultProvider:r}}function Ba(e,t){t||(t=function(e){return[parseInt(e,16)]});let r=0,n={};return e.split(",").forEach((e=>{let i=e.split(":");r+=parseInt(i[0],16),n[r]=t(i[1])})),n}function _a(e){let t=0;return e.split(",").map((e=>{let r=e.split("-");1===r.length?r[1]="0":""===r[1]&&(r[1]="1");let n=t+parseInt(r[0],16);return t=parseInt(r[1],16),{l:n,h:t}}))}function Pa(e,t){let r=0;for(let n=0;n=r&&e<=r+i.h&&(e-r)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(e-r))continue;return i}}return null}const Oa=_a("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),Na="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((e=>parseInt(e,16))),Ra=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],Ma=Ba("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),La=Ba("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),Da=Ba("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!=0)throw new Error("bad data");let t=[];for(let r=0;r{if(Na.indexOf(e)>=0)return[];if(e>=65024&&e<=65039)return[];let t=function(e){let t=Pa(e,Ra);if(t)return[e+t.s];let r=Ma[e];if(r)return r;let n=La[e];return n?[e+n[0]]:Da[e]||null}(e);return t||[e]})),t=r.reduce(((e,t)=>(t.forEach((t=>{e.push(t)})),e)),[]),t=Qe(qe(t),je.NFKC),t.forEach((e=>{if(Pa(e,Fa))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),t.forEach((e=>{if(Pa(e,Oa))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));let n=qe(t);if("-"===n.substring(0,1)||"--"===n.substring(2,4)||"-"===n.substring(n.length-1))throw new Error("invalid hyphen");if(n.length>63)throw new Error("too long");return n}const Ua=new z.b("hash/5.4.0"),ja=new Uint8Array(32);ja.fill(0);const Va=new RegExp("^((.*)\\.)?([^.]+)$");function Ka(e){try{const t=e.split(".");for(let e=0;e{a[t.toLowerCase()]=e})):n.headers.keys().forEach((e=>{a[e.toLowerCase()]=n.headers.get(e)})),{headers:a,statusCode:n.status,statusMessage:n.statusText,body:Object(J.a)(new Uint8Array(i))}}))}var qa=function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))};const Ya=new z.b("web/5.4.0");function Qa(e){return new Promise((t=>{setTimeout(t,e)}))}function Za(e,t){if(null==e)return null;if("string"==typeof e)return e;if(Object(J.k)(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return Ye(e)}catch(e){}return Object(J.i)(e)}return e}function Wa(e,t,r){const n="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;Ya.assertArgument(n>0&&n%1==0,"invalid connection throttle limit","connection.throttleLimit",n);const i="object"==typeof e?e.throttleCallback:null,a="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;Ya.assertArgument(a>0&&a%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",a);const o={};let s=null;const u={method:"GET"};let l=!1,c=12e4;if("string"==typeof e)s=e;else if("object"==typeof e){if(null!=e&&null!=e.url||Ya.throwArgumentError("missing URL","connection.url",e),s=e.url,"number"==typeof e.timeout&&e.timeout>0&&(c=e.timeout),e.headers)for(const t in e.headers)o[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(l=!0);if(u.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==s.substring(0,6)&&!0!==e.allowInsecureAuthentication&&Ya.throwError("basic authentication requires a secure https url",z.b.errors.INVALID_ARGUMENT,{argument:"url",url:s,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;o.authorization={key:"Authorization",value:"Basic "+Ga(Ge(t))}}}t&&(u.method="POST",u.body=t,null==o["content-type"]&&(o["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==o["content-length"]&&(o["content-length"]={key:"Content-Length",value:String(t.length)}));const f={};Object.keys(o).forEach((e=>{const t=o[e];f[t.key]=t.value})),u.headers=f;const h=function(){let e=null;return{promise:new Promise((function(t,r){c&&(e=setTimeout((()=>{null!=e&&(e=null,r(Ya.makeError("timeout",z.b.errors.TIMEOUT,{requestBody:Za(u.body,f["content-type"]),requestMethod:u.method,timeout:c,url:s})))}),c))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),d=function(){return qa(this,void 0,void 0,(function*(){for(let t=0;t=300)&&(h.cancel(),Ya.throwError("bad response",z.b.errors.SERVER_ERROR,{status:o.statusCode,headers:o.headers,body:Za(c,o.headers?o.headers["content-type"]:null),requestBody:Za(u.body,f["content-type"]),requestMethod:u.method,url:s})),r)try{const e=yield r(c,o);return h.cancel(),e}catch(r){if(r.throttleRetry&&t"content-type"===e.toLowerCase())).length||(r.headers=ue(r.headers),r.headers["content-type"]="application/json"):r.headers={"content-type":"application/json"},e=r}return Wa(e,n,((e,t)=>{let n=null;if(null!=e)try{n=JSON.parse(Ye(e))}catch(t){Ya.throwError("invalid JSON",z.b.errors.SERVER_ERROR,{body:e,error:t})}return r&&(n=r(n,t)),n}))}function eo(e,t){return t||(t={}),null==(t=ue(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise((function(r,n){let i=null,a=!1;const o=()=>!a&&(a=!0,i&&clearTimeout(i),!0);t.timeout&&(i=setTimeout((()=>{o()&&n(new Error("timeout"))}),t.timeout));const s=t.retryLimit;let u=0;!function i(){return e().then((function(e){if(void 0!==e)o()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",i);else if(t.onceBlock)t.onceBlock.once("block",i);else if(!a){if(u++,u>s)return void(o()&&n(new Error("retry limit reached")));let e=t.interval*parseInt(String(Math.random()*Math.pow(2,u)));et.ceiling&&(e=t.ceiling),setTimeout(i,e)}return null}),(function(e){o()&&n(e)}))}()}))}var to=r(49),ro=r.n(to);const no=new z.b("providers/5.4.5");class io{constructor(){no.checkNew(new.target,io),this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},t=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),i=this.data.bind(this),a=this.hash.bind(this),o=this.hex.bind(this),s=this.number.bind(this),u=this.type.bind(this);return e.transaction={hash:a,type:u,accessList:io.allowNull(this.accessList.bind(this),null),blockHash:io.allowNull(a,null),blockNumber:io.allowNull(s,null),transactionIndex:io.allowNull(s,null),confirmations:io.allowNull(s,null),from:t,gasPrice:io.allowNull(r),maxPriorityFeePerGas:io.allowNull(r),maxFeePerGas:io.allowNull(r),gasLimit:r,to:io.allowNull(t,null),value:r,nonce:s,data:i,r:io.allowNull(this.uint256),s:io.allowNull(this.uint256),v:io.allowNull(s),creates:io.allowNull(t,null),raw:io.allowNull(i)},e.transactionRequest={from:io.allowNull(t),nonce:io.allowNull(s),gasLimit:io.allowNull(r),gasPrice:io.allowNull(r),maxPriorityFeePerGas:io.allowNull(r),maxFeePerGas:io.allowNull(r),to:io.allowNull(t),value:io.allowNull(r),data:io.allowNull((e=>this.data(e,!0))),type:io.allowNull(s),accessList:io.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:s,blockNumber:s,transactionHash:a,address:t,topics:io.arrayOf(a),data:i,logIndex:s,blockHash:a},e.receipt={to:io.allowNull(this.address,null),from:io.allowNull(this.address,null),contractAddress:io.allowNull(t,null),transactionIndex:s,root:io.allowNull(o),gasUsed:r,logsBloom:io.allowNull(i),blockHash:a,transactionHash:a,logs:io.arrayOf(this.receiptLog.bind(this)),blockNumber:s,confirmations:io.allowNull(s,null),cumulativeGasUsed:r,effectiveGasPrice:io.allowNull(r),status:io.allowNull(s),type:u},e.block={hash:a,parentHash:a,number:s,timestamp:s,nonce:io.allowNull(o),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:t,extraData:i,transactions:io.allowNull(io.arrayOf(a)),baseFeePerGas:io.allowNull(r)},e.blockWithTransactions=ue(e.block),e.blockWithTransactions.transactions=io.allowNull(io.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:io.allowNull(n,void 0),toBlock:io.allowNull(n,void 0),blockHash:io.allowNull(a,void 0),address:io.allowNull(t,void 0),topics:io.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:io.allowNull(s),blockHash:io.allowNull(a),transactionIndex:s,removed:io.allowNull(this.boolean.bind(this)),address:t,data:io.allowFalsish(i,"0x"),topics:io.arrayOf(a),transactionHash:a,logIndex:s},e}accessList(e){return _r(e||[])}number(e){return"0x"===e?0:Z.from(e).toNumber()}type(e){return"0x"===e||null==e?0:Z.from(e).toNumber()}bigNumber(e){return Z.from(e)}boolean(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)}hex(e,t){return"string"==typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),Object(J.l)(e))?e.toLowerCase():no.throwArgumentError("invalid hash","value",e)}data(e,t){const r=this.hex(e,t);if(r.length%2!=0)throw new Error("invalid data; odd-length - "+e);return r}address(e){return Me(e)}callAddress(e){if(!Object(J.l)(e,32))return null;const t=Me(Object(J.e)(e,12));return t===ma?null:t}contractAddress(e){return Fe(e)}blockTag(e){if(null==e)return"latest";if("earliest"===e)return"0x0";if("latest"===e||"pending"===e)return e;if("number"==typeof e||Object(J.l)(e))return Object(J.g)(e);throw new Error("invalid blockTag")}hash(e,t){const r=this.hex(e,t);return 32!==Object(J.d)(r)?no.throwArgumentError("invalid hash","value",e):r}difficulty(e){if(null==e)return null;const t=Z.from(e);try{return t.toNumber()}catch(e){}return null}uint256(e){if(!Object(J.l)(e))throw new Error("invalid uint256");return Object(J.h)(e,32)}_block(e,t){return null!=e.author&&null==e.miner&&(e.miner=e.author),io.check(t,e)}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return io.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&Z.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),1!==e.type&&2!==e.type||null!=e.accessList||(e.accessList=[]);const t=io.check(this.formats.transaction,e);if(null!=e.chainId){let r=e.chainId;Object(J.l)(r)&&(r=Z.from(r).toNumber()),t.chainId=r}else{let r=e.networkId;null==r&&null==t.v&&(r=e.chainId),Object(J.l)(r)&&(r=Z.from(r).toNumber()),"number"!=typeof r&&null!=t.v&&(r=(t.v-35)/2,r<0&&(r=0),r=parseInt(r)),"number"!=typeof r&&(r=0),t.chainId=r}return t.blockHash&&"x"===t.blockHash.replace(/0/g,"")&&(t.blockHash=null),t}transaction(e){return Lr(e)}receiptLog(e){return io.check(this.formats.receiptLog,e)}receipt(e){const t=io.check(this.formats.receipt,e);if(null!=t.root)if(t.root.length<=4){const e=Z.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&no.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):no.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&no.throwArgumentError("invalid root hash","value.root",t.root);return null!=t.status&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map((e=>this.topics(e))):null!=e?this.hash(e,!0):null}filter(e){return io.check(this.formats.filter,e)}filterLog(e){return io.check(this.formats.filterLog,e)}static check(e,t){const r={};for(const n in e)try{const i=e[n](t[n]);void 0!==i&&(r[n]=i)}catch(e){throw e.checkKey=n,e.checkValue=t[n],e}return r}static allowNull(e,t){return function(r){return null==r?t:e(r)}}static allowFalsish(e,t){return function(r){return r?e(r):t}}static arrayOf(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");const r=[];return t.forEach((function(t){r.push(e(t))})),r}}}function ao(e){return e&&"function"==typeof e.isCommunityResource}function oo(e){return ao(e)&&e.isCommunityResource()}let so=!1;function uo(){so||(so=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}var lo=function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))};const co=new z.b("providers/5.4.5");function fo(e){return null==e?"null":(32!==Object(J.d)(e)&&co.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function ho(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((e=>{if(Array.isArray(e)){const t={};e.forEach((e=>{t[fo(e)]=!0}));const r=Object.keys(t);return r.sort(),r.join("|")}return fo(e)})).join("&")}function po(e){if("string"==typeof e){if(e=e.toLowerCase(),32===Object(J.d)(e))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+ho(e);if(ir.isForkEvent(e))throw co.warn("not implemented"),new Error("not implemented");if(e&&"object"==typeof e)return"filter:"+(e.address||"*")+":"+ho(e.topics||[])}throw new Error("invalid event - "+e)}function go(){return(new Date).getTime()}function yo(e){return new Promise((t=>{setTimeout(t,e)}))}const mo=["block","network","pending","poll"];class vo{constructor(e,t,r){ie(this,"tag",e),ie(this,"listener",t),ie(this,"once",r)}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}get filter(){const e=this.tag.split(":");if("filter"!==e[0])return null;const t=e[1],r=""===(n=e[2])?[]:n.split(/&/g).map((e=>{if(""===e)return[];const t=e.split("|").map((e=>"null"===e?null:e));return 1===t.length?t[0]:t}));var n;const i={};return r.length>0&&(i.topics=r),t&&"*"!==t&&(i.address=t),i}pollable(){return this.tag.indexOf(":")>=0||mo.indexOf(this.tag)>=0}}const bo={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 So(e){return Object(J.h)(Z.from(e).toHexString(),32)}function wo(e){return Pn.encode(Object(J.b)([e,Object(J.e)(Dn(Dn(e)),0,4)]))}class Eo{constructor(e,t,r){ie(this,"provider",e),ie(this,"name",r),ie(this,"address",e.formatter.address(t))}_fetchBytes(e,t){return lo(this,void 0,void 0,(function*(){const r={to:this.address,data:Object(J.c)([e,Ja(this.name),t||"0x"])};try{const e=yield this.provider.call(r);if("0x"===e)return null;const t=Z.from(Object(J.e)(e,0,32)).toNumber(),n=Z.from(Object(J.e)(e,t,t+32)).toNumber();return Object(J.e)(e,t+32,t+32+n)}catch(e){return e.code,z.b.errors.CALL_EXCEPTION,null}}))}_getAddress(e,t){const r=bo[String(e)];if(null==r&&co.throwError("unsupported coin type: "+e,z.b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(e,")")}),"eth"===r.ilk)return this.provider.formatter.address(t);const n=Object(J.a)(t);if(null!=r.p2pkh){const e=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return wo(Object(J.b)([[r.p2pkh],"0x"+e[2]]))}}if(null!=r.p2sh){const e=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return wo(Object(J.b)([[r.p2sh],"0x"+e[2]]))}}if(null!=r.prefix){const e=n[1];let t=n[0];if(0===t?20!==e&&32!==e&&(t=-1):t=-1,t>=0&&n.length===2+e&&e>=1&&e<=75){const e=ro.a.toWords(n.slice(2));return e.unshift(t),ro.a.encode(r.prefix,e)}}return null}getAddress(e){return lo(this,void 0,void 0,(function*(){if(null==e&&(e=60),60===e)try{const e={to:this.address,data:"0x3b3b57de"+Ja(this.name).substring(2)},t=yield this.provider.call(e);return"0x"===t||t===va?null:this.provider.formatter.callAddress(t)}catch(e){if(e.code===z.b.errors.CALL_EXCEPTION)return null;throw e}const t=yield this._fetchBytes("0xf1cb7e06",So(e));if(null==t||"0x"===t)return null;const r=this._getAddress(e,t);return null==r&&co.throwError("invalid or unsupported coin data",z.b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(e,")"),coinType:e,data:t}),r}))}getContentHash(){return lo(this,void 0,void 0,(function*(){const e=yield this._fetchBytes("0xbc1c58d1");if(null==e||"0x"===e)return null;const t=e.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){const e=parseInt(t[3],16);if(t[4].length===2*e)return"ipfs://"+Pn.encode("0x"+t[1])}const r=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);return r&&64===r[1].length?"bzz://"+r[1]:co.throwError("invalid or unsupported content hash data",z.b.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})}))}getText(e){return lo(this,void 0,void 0,(function*(){let t=Ge(e);t=Object(J.b)([So(64),So(t.length),t]),t.length%32!=0&&(t=Object(J.b)([t,Object(J.h)("0x",32-e.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",Object(J.i)(t));return null==r||"0x"===r?null:Ye(r)}))}}let Ao=null,To=1;class Co extends ar{constructor(e){if(co.checkNew(new.target,ar),super(),this._events=[],this._emitted={block:-2},this.formatter=new.target.getFormatter(),ie(this,"anyNetwork","any"===e),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch((e=>{})),this._ready().catch((e=>{}));else{const t=ae(new.target,"getNetwork")(e);t?(ie(this,"_network",t),this.emit("network",t,null)):co.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return lo(this,void 0,void 0,(function*(){if(null==this._network){let t=null;if(this._networkPromise)try{t=yield this._networkPromise}catch(e){}null==t&&(t=yield this.detectNetwork()),t||co.throwError("no network detected",z.b.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=t:ie(this,"_network",t),this.emit("network",t,null))}return this._network}))}get ready(){return eo((()=>this._ready().then((e=>e),(e=>{if(e.code!==z.b.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))))}static getFormatter(){return null==Ao&&(Ao=new io),Ao}static getNetwork(e){return ka(null==e?"homestead":e)}_getInternalBlockNumber(e){return lo(this,void 0,void 0,(function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const t=this._internalBlockNumber;try{const r=yield t;if(go()-r.respTime<=e)return r.blockNumber;break}catch(e){if(this._internalBlockNumber===t)break}}const t=go(),r=oe({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((e=>null),(e=>e))}).then((e=>{let{blockNumber:n,networkError:i}=e;if(i)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),i;const a=go();return(n=Z.from(n).toNumber()){this._internalBlockNumber===r&&(this._internalBlockNumber=null)})),(yield r).blockNumber}))}poll(){return lo(this,void 0,void 0,(function*(){const e=To++,t=[];let r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(e){return void this.emit("error",e)}if(this._setFastBlockNumber(r),this.emit("poll",e,r),r!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)co.warn("network block skew detected; skipping block events (emitted=".concat(this._emitted.block," blockNumber").concat(r,")")),this.emit("error",co.makeError("network block skew detected",z.b.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let e=this._emitted.block+1;e<=r;e++)this.emit("block",e);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach((e=>{if("block"===e)return;const t=this._emitted[e];"pending"!==t&&r-t>12&&delete this._emitted[e]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach((e=>{switch(e.type){case"tx":{const r=e.hash;let n=this.getTransactionReceipt(r).then((e=>e&&null!=e.blockNumber?(this._emitted["t:"+r]=e.blockNumber,this.emit(r,e),null):null)).catch((e=>{this.emit("error",e)}));t.push(n);break}case"filter":{const n=e.filter;n.fromBlock=this._lastBlockNumber+1,n.toBlock=r;const i=this.getLogs(n).then((e=>{0!==e.length&&e.forEach((e=>{this._emitted["b:"+e.blockHash]=e.blockNumber,this._emitted["t:"+e.transactionHash]=e.blockNumber,this.emit(n,e)}))})).catch((e=>{this.emit("error",e)}));t.push(i);break}}})),this._lastBlockNumber=r,Promise.all(t).then((()=>{this.emit("didPoll",e)})).catch((e=>{this.emit("error",e)}))}else this.emit("didPoll",e)}))}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return lo(this,void 0,void 0,(function*(){return co.throwError("provider does not support network detection",z.b.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return lo(this,void 0,void 0,(function*(){const e=yield this._ready(),t=yield this.detectNetwork();if(e.chainId!==t.chainId){if(this.anyNetwork)return this._network=t,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",t,e),yield yo(0),this._network;const r=co.makeError("underlying network changed",z.b.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t});throw this.emit("error",r),r}return e}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((e=>{this._setFastBlockNumber(e)}),(e=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(e){e&&!this._poller?(this._poller=setInterval((()=>{this.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((()=>{this.poll(),this._bootstrapPoll=setTimeout((()=>{this._poller||this.poll(),this._bootstrapPoll=null}),this.pollingInterval)}),0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){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((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const e=go();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((e=>((null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(e){null!=this._fastBlockNumber&&ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,r){return lo(this,void 0,void 0,(function*(){return this._waitForTransaction(e,null==t?1:t,r||0,null)}))}_waitForTransaction(e,t,r,n){return lo(this,void 0,void 0,(function*(){const i=yield this.getTransactionReceipt(e);return(i?i.confirmations:0)>=t?i:new Promise(((i,a)=>{const o=[];let s=!1;const u=function(){return!!s||(s=!0,o.forEach((e=>{e()})),!1)},l=e=>{e.confirmations{this.removeListener(e,l)})),n){let r=n.startBlock,i=null;const l=o=>lo(this,void 0,void 0,(function*(){s||(yield yo(1e3),this.getTransactionCount(n.from).then((c=>lo(this,void 0,void 0,(function*(){if(!s){if(c<=n.nonce)r=o;else{{const t=yield this.getTransaction(e);if(t&&null!=t.blockNumber)return}for(null==i&&(i=r-3,i{s||this.once("block",l)})))}));if(s)return;this.once("block",l),o.push((()=>{this.removeListener("block",l)}))}if("number"==typeof r&&r>0){const e=setTimeout((()=>{u()||a(co.makeError("timeout exceeded",z.b.errors.TIMEOUT,{timeout:r}))}),r);e.unref&&e.unref(),o.push((()=>{clearTimeout(e)}))}}))}))}getBlockNumber(){return lo(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return lo(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return Z.from(e)}catch(t){return co.throwError("bad result from backend",z.b.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}}))}getBalance(e,t){return lo(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield oe({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getBalance",r);try{return Z.from(n)}catch(e){return co.throwError("bad result from backend",z.b.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:e})}}))}getTransactionCount(e,t){return lo(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield oe({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getTransactionCount",r);try{return Z.from(n).toNumber()}catch(e){return co.throwError("bad result from backend",z.b.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:e})}}))}getCode(e,t){return lo(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield oe({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getCode",r);try{return Object(J.i)(n)}catch(e){return co.throwError("bad result from backend",z.b.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:e})}}))}getStorageAt(e,t,r){return lo(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield oe({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then((e=>Object(J.g)(e)))}),i=yield this.perform("getStorageAt",n);try{return Object(J.i)(i)}catch(e){return co.throwError("bad result from backend",z.b.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:e})}}))}_wrapTransaction(e,t,r){if(null!=t&&32!==Object(J.d)(t))throw new Error("invalid response - sendTransaction");const n=e;return null!=t&&e.hash!==t&&co.throwError("Transaction hash mismatch from Provider.sendTransaction.",z.b.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),n.wait=(t,n)=>lo(this,void 0,void 0,(function*(){let i;null==t&&(t=1),null==n&&(n=0),0!==t&&null!=r&&(i={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r});const a=yield this._waitForTransaction(e.hash,t,n,i);return null==a&&0===t?null:(this._emitted["t:"+e.hash]=a.blockNumber,0===a.status&&co.throwError("transaction failed",z.b.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:a}),a)})),n}sendTransaction(e){return lo(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then((e=>Object(J.i)(e))),r=this.formatter.transaction(e);null==r.confirmations&&(r.confirmations=0);const n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const e=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(r,e,n)}catch(e){throw e.transaction=r,e.transactionHash=r.hash,e}}))}_getTransactionRequest(e){return lo(this,void 0,void 0,(function*(){const t=yield e,r={};return["from","to"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?this._getAddress(e):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?Z.from(e):null)))})),["type"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>null!=e?e:null)))})),t.accessList&&(r.accessList=this.formatter.accessList(t.accessList)),["data"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?Object(J.i)(e):null)))})),this.formatter.transactionRequest(yield oe(r))}))}_getFilter(e){return lo(this,void 0,void 0,(function*(){e=yield e;const t={};return null!=e.address&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach((r=>{null!=e[r]&&(t[r]=e[r])})),["fromBlock","toBlock"].forEach((r=>{null!=e[r]&&(t[r]=this._getBlockTag(e[r]))})),this.formatter.filter(yield oe(t))}))}call(e,t){return lo(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield oe({transaction:this._getTransactionRequest(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("call",r);try{return Object(J.i)(n)}catch(e){return co.throwError("bad result from backend",z.b.errors.SERVER_ERROR,{method:"call",params:r,result:n,error:e})}}))}estimateGas(e){return lo(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield oe({transaction:this._getTransactionRequest(e)}),r=yield this.perform("estimateGas",t);try{return Z.from(r)}catch(e){return co.throwError("bad result from backend",z.b.errors.SERVER_ERROR,{method:"estimateGas",params:t,result:r,error:e})}}))}_getAddress(e){return lo(this,void 0,void 0,(function*(){const t=yield this.resolveName(e);return null==t&&co.throwError("ENS name not configured",z.b.errors.UNSUPPORTED_OPERATION,{operation:"resolveName(".concat(JSON.stringify(e),")")}),t}))}_getBlock(e,t){return lo(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;let r=-128;const n={includeTransactions:!!t};if(Object(J.l)(e,32))n.blockHash=e;else try{n.blockTag=this.formatter.blockTag(yield this._getBlockTag(e)),Object(J.l)(n.blockTag)&&(r=parseInt(n.blockTag.substring(2),16))}catch(t){co.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",e)}return eo((()=>lo(this,void 0,void 0,(function*(){const e=yield this.perform("getBlock",n);if(null==e)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(t){let t=null;for(let n=0;nthis._wrapTransaction(e))),r}return this.formatter.block(e)}))),{oncePoll:this})}))}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return lo(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return eo((()=>lo(this,void 0,void 0,(function*(){const r=yield this.perform("getTransaction",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;const n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return this._wrapTransaction(n)}))),{oncePoll:this})}))}getTransactionReceipt(e){return lo(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return eo((()=>lo(this,void 0,void 0,(function*(){const r=yield this.perform("getTransactionReceipt",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;if(null==r.blockHash)return;const n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return n}))),{oncePoll:this})}))}getLogs(e){return lo(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield oe({filter:this._getFilter(e)}),r=yield this.perform("getLogs",t);return r.forEach((e=>{null==e.removed&&(e.removed=!1)})),io.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return lo(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(e){return lo(this,void 0,void 0,(function*(){if("number"==typeof(e=yield e)&&e<0){e%1&&co.throwArgumentError("invalid BlockTag","blockTag",e);let t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return t+=e,t<0&&(t=0),this.formatter.blockTag(t)}return this.formatter.blockTag(e)}))}getResolver(e){return lo(this,void 0,void 0,(function*(){try{const t=yield this._getResolver(e);return null==t?null:new Eo(this,t,e)}catch(e){return e.code,z.b.errors.CALL_EXCEPTION,null}}))}_getResolver(e){return lo(this,void 0,void 0,(function*(){const t=yield this.getNetwork();t.ensAddress||co.throwError("network does not support ENS",z.b.errors.UNSUPPORTED_OPERATION,{operation:"ENS",network:t.name});const r={to:t.ensAddress,data:"0x0178b8bf"+Ja(e).substring(2)};try{return this.formatter.callAddress(yield this.call(r))}catch(e){if(e.code===z.b.errors.CALL_EXCEPTION)return null;throw e}}))}resolveName(e){return lo(this,void 0,void 0,(function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(t){if(Object(J.l)(e))throw t}"string"!=typeof e&&co.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null}))}lookupAddress(e){return lo(this,void 0,void 0,(function*(){e=yield e;const t=(e=this.formatter.address(e)).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(t);if(!r)return null;let n=Object(J.a)(yield this.call({to:r,data:"0x691f3431"+Ja(t).substring(2)}));if(n.length<32||!Z.from(n.slice(0,32)).eq(32))return null;if(n=n.slice(32),n.length<32)return null;const i=Z.from(n.slice(0,32)).toNumber();if(n=n.slice(32),i>n.length)return null;const a=Ye(n.slice(0,i));return(yield this.resolveName(a))!=e?null:a}))}perform(e,t){return co.throwError(e+" not implemented",z.b.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_stopEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_addEventListener(e,t,r){const n=new vo(po(e),t,r);return this._events.push(n),this._startEvent(n),this}on(e,t){return this._addEventListener(e,t,!1)}once(e,t){return this._addEventListener(e,t,!0)}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;ne.tag!==o||(setTimeout((()=>{e.listener.apply(this,r)}),0),i=!0,!e.once||(a.push(e),!1)))),a.forEach((e=>{this._stopEvent(e)})),i}listenerCount(e){if(!e)return this._events.length;let t=po(e);return this._events.filter((e=>e.tag===t)).length}listeners(e){if(null==e)return this._events.map((e=>e.listener));let t=po(e);return this._events.filter((e=>e.tag===t)).map((e=>e.listener))}off(e,t){if(null==t)return this.removeAllListeners(e);const r=[];let n=!1,i=po(e);return this._events=this._events.filter((e=>e.tag!==i||e.listener!=t||!!n||(n=!0,r.push(e),!1))),r.forEach((e=>{this._stopEvent(e)})),this}removeAllListeners(e){let t=[];if(null==e)t=this._events,this._events=[];else{const r=po(e);this._events=this._events.filter((e=>e.tag!==r||(t.push(e),!1)))}return t.forEach((e=>{this._stopEvent(e)})),this}}var Io=function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))};const ko=new z.b("providers/5.4.5"),Bo=["call","estimateGas"];function _o(e,t,r){if("call"===e&&t.code===z.b.errors.SERVER_ERROR){const e=t.error;if(e&&e.message.match("reverted")&&Object(J.l)(e.data))return e.data;ko.throwError("missing revert data in call exception",z.b.errors.CALL_EXCEPTION,{error:t,data:"0x"})}let n=t.message;t.code===z.b.errors.SERVER_ERROR&&t.error&&"string"==typeof t.error.message?n=t.error.message:"string"==typeof t.body?n=t.body:"string"==typeof t.responseText&&(n=t.responseText),n=(n||"").toLowerCase();const i=r.transaction||r.signedTransaction;throw n.match(/insufficient funds|base fee exceeds gas limit/)&&ko.throwError("insufficient funds for intrinsic transaction cost",z.b.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:i}),n.match(/nonce too low/)&&ko.throwError("nonce has already been used",z.b.errors.NONCE_EXPIRED,{error:t,method:e,transaction:i}),n.match(/replacement transaction underpriced/)&&ko.throwError("replacement fee too low",z.b.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:i}),n.match(/only replay-protected/)&&ko.throwError("legacy pre-eip-155 transactions not supported",z.b.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:i}),Bo.indexOf(e)>=0&&n.match(/gas required exceeds allowance|always failing transaction|execution reverted/)&&ko.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",z.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:i}),t}function Po(e){return new Promise((function(t){setTimeout(t,e)}))}function Oo(e){if(e.error){const t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function No(e){return e?e.toLowerCase():e}const Ro={};class Mo extends cr{constructor(e,t,r){if(ko.checkNew(new.target,Mo),super(),e!==Ro)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");ie(this,"provider",t),null==r&&(r=0),"string"==typeof r?(ie(this,"_address",this.provider.formatter.address(r)),ie(this,"_index",null)):"number"==typeof r?(ie(this,"_index",r),ie(this,"_address",null)):ko.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(e){return ko.throwError("cannot alter JSON-RPC Signer connection",z.b.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new Lo(Ro,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((e=>(e.length<=this._index&&ko.throwError("unknown account #"+this._index,z.b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index]))))}sendUncheckedTransaction(e){e=ue(e);const t=this.getAddress().then((e=>(e&&(e=e.toLowerCase()),e)));if(null==e.gasLimit){const r=ue(e);r.from=t,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((e=>Io(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.provider.resolveName(e);return null==t&&ko.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))))),oe({tx:oe(e),sender:t}).then((t=>{let{tx:r,sender:n}=t;null!=r.from?r.from.toLowerCase()!==n&&ko.throwArgumentError("from address mismatch","transaction",e):r.from=n;const i=this.provider.constructor.hexlifyTransaction(r,{from:!0});return this.provider.send("eth_sendTransaction",[i]).then((e=>e),(e=>_o("sendTransaction",e,i)))}))}signTransaction(e){return ko.throwError("signing transactions is unsupported",z.b.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return Io(this,void 0,void 0,(function*(){const t=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(e);try{return yield eo((()=>Io(this,void 0,void 0,(function*(){const e=yield this.provider.getTransaction(r);if(null!==e)return this.provider._wrapTransaction(e,r,t)}))),{oncePoll:this.provider})}catch(e){throw e.transactionHash=r,e}}))}signMessage(e){return Io(this,void 0,void 0,(function*(){const t="string"==typeof e?Ge(e):e,r=yield this.getAddress();return yield this.provider.send("eth_sign",[r.toLowerCase(),Object(J.i)(t)])}))}_signTypedData(e,t,r){return Io(this,void 0,void 0,(function*(){const n=yield Bn.resolveNames(e,t,r,(e=>this.provider.resolveName(e))),i=yield this.getAddress();return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(Bn.getPayload(n.domain,t,n.value))])}))}unlock(e){return Io(this,void 0,void 0,(function*(){const t=this.provider,r=yield this.getAddress();return t.send("personal_unlockAccount",[r.toLowerCase(),e,null])}))}}class Lo extends Mo{sendTransaction(e){return this.sendUncheckedTransaction(e).then((e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:t=>this.provider.waitForTransaction(e,t)})))}}const Do={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class Fo extends Co{constructor(e,t){ko.checkNew(new.target,Fo);let r=t;null==r&&(r=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then((t=>{e(t)}),(e=>{t(e)}))}),0)}))),super(r),e||(e=ae(this.constructor,"defaultUrl")()),ie(this,"connection","string"==typeof e?Object.freeze({url:e}):Object.freeze(ue(e))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((()=>{this._cache.detectNetwork=null}),0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return Io(this,void 0,void 0,(function*(){yield Po(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch(t){try{e=yield this.send("net_version",[])}catch(e){}}if(null!=e){const r=ae(this.constructor,"getNetwork");try{return r(Z.from(e).toNumber())}catch(t){return ko.throwError("could not detect network",z.b.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return ko.throwError("could not detect network",z.b.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(e){return new Mo(Ro,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((e=>e.map((e=>this.formatter.address(e)))))}send(e,t){const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:fe(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];const i=$a(this.connection,JSON.stringify(r),Oo).then((e=>(this.emit("debug",{action:"response",request:r,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:r,provider:this}),e}));return n&&(this._cache[e]=i,setTimeout((()=>{this._cache[e]=null}),0)),i}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[No(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[No(t.address),t.blockTag]];case"getCode":return["eth_getCode",[No(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[No(t.address),t.position,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",[ae(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[ae(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=No(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return Io(this,void 0,void 0,(function*(){if("call"===e||"estimateGas"===e){const e=t.transaction;if(e&&null!=e.type&&Z.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((t=ue(t)).transaction=ue(e),delete t.transaction.type)}}const r=this.prepareRequest(e,t);null==r&&ko.throwError(e+" not implemented",z.b.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(r[0],r[1])}catch(r){return _o(e,r,t)}}))}_startEvent(e){"pending"===e.tag&&this._startPending(),super._startEvent(e)}_startPending(){if(null!=this._pendingFilter)return;const 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;let 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 Po(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){n()}),0),null;e.send("eth_uninstallFilter",[r])})).catch((e=>{}))}(),r})).catch((e=>{}))}_stopEvent(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){const r=ue(Do);if(t)for(const i in t)t[i]&&(r[i]=!0);se(e,r);const n={};return["gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null==e[t])return;const r=Object(J.g)(e[t]);"gasLimit"===t&&(t="gas"),n[t]=r})),["from","to","data"].forEach((function(t){null!=e[t]&&(n[t]=Object(J.i)(e[t]))})),e.accessList&&(n.accessList=_r(e.accessList)),n}}let xo=null;try{if(xo=WebSocket,null==xo)throw new Error("inject please")}catch(e){const t=new z.b("providers/5.4.5");xo=function(){t.throwError("WebSockets not supported in this environment",z.b.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var Uo=function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))};const jo=new z.b("providers/5.4.5");let Vo=1;class Ko extends Fo{constructor(e,t){"any"===t&&jo.throwError("WebSocketProvider does not support 'any' network yet",z.b.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),super(e,t),this._pollingInterval=-1,this._wsReady=!1,ie(this,"_websocket",new xo(this.connection.url)),ie(this,"_requests",{}),ie(this,"_subs",{}),ie(this,"_subIds",{}),ie(this,"_detectNetwork",super.detectNetwork()),this._websocket.onopen=()=>{this._wsReady=!0,Object.keys(this._requests).forEach((e=>{this._websocket.send(this._requests[e].payload)}))},this._websocket.onmessage=e=>{const t=e.data,r=JSON.parse(t);if(null!=r.id){const e=String(r.id),n=this._requests[e];if(delete this._requests[e],void 0!==r.result)n.callback(null,r.result),this.emit("debug",{action:"response",request:JSON.parse(n.payload),response:r.result,provider:this});else{let e=null;r.error?(e=new Error(r.error.message||"unknown error"),ie(e,"code",r.error.code||null),ie(e,"response",t)):e=new Error("unknown error"),n.callback(e,void 0),this.emit("debug",{action:"response",error:e,request:JSON.parse(n.payload),provider:this})}}else if("eth_subscription"===r.method){const e=this._subs[r.params.subscription];e&&e.processFunc(r.params.result)}else console.warn("this should not happen")};const r=setInterval((()=>{this.emit("poll")}),1e3);r.unref&&r.unref()}detectNetwork(){return this._detectNetwork}get pollingInterval(){return 0}resetEventsBlock(e){jo.throwError("cannot reset events block on WebSocketProvider",z.b.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}set pollingInterval(e){jo.throwError("cannot set polling interval on WebSocketProvider",z.b.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}poll(){return Uo(this,void 0,void 0,(function*(){return null}))}set polling(e){e&&jo.throwError("cannot set polling on WebSocketProvider",z.b.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}send(e,t){const r=Vo++;return new Promise(((n,i)=>{const a=JSON.stringify({method:e,params:t,id:r,jsonrpc:"2.0"});this.emit("debug",{action:"request",request:JSON.parse(a),provider:this}),this._requests[String(r)]={callback:function(e,t){return e?i(e):n(t)},payload:a},this._wsReady&&this._websocket.send(a)}))}static defaultUrl(){return"ws://localhost:8546"}_subscribe(e,t,r){return Uo(this,void 0,void 0,(function*(){let n=this._subIds[e];null==n&&(n=Promise.all(t).then((e=>this.send("eth_subscribe",e))),this._subIds[e]=n);const i=yield n;this._subs[i]={tag:e,processFunc:r}}))}_startEvent(e){switch(e.type){case"block":this._subscribe("block",["newHeads"],(e=>{const t=Z.from(e.number).toNumber();this._emitted.block=t,this.emit("block",t)}));break;case"pending":this._subscribe("pending",["newPendingTransactions"],(e=>{this.emit("pending",e)}));break;case"filter":this._subscribe(e.tag,["logs",this._getFilter(e.filter)],(t=>{null==t.removed&&(t.removed=!1),this.emit(e.filter,this.formatter.filterLog(t))}));break;case"tx":{const t=e=>{const t=e.hash;this.getTransactionReceipt(t).then((e=>{e&&this.emit(t,e)}))};t(e),this._subscribe("tx",["newHeads"],(e=>{this._events.filter((e=>"tx"===e.type)).forEach(t)}));break}case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",e)}}_stopEvent(e){let t=e.tag;if("tx"===e.type){if(this._events.filter((e=>"tx"===e.type)).length)return;t="tx"}else if(this.listenerCount(e.event))return;const r=this._subIds[t];r&&(delete this._subIds[t],r.then((e=>{this._subs[e]&&(delete this._subs[e],this.send("eth_unsubscribe",[e]))})))}destroy(){return Uo(this,void 0,void 0,(function*(){this._websocket.readyState===xo.CONNECTING&&(yield new Promise((e=>{this._websocket.onopen=function(){e(!0)},this._websocket.onerror=function(){e(!1)}}))),this._websocket.close(1e3)}))}}var Jo=function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))};const Ho=new z.b("providers/5.4.5");class Go extends Fo{detectNetwork(){const e=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return Jo(this,void 0,void 0,(function*(){let t=this.network;return null==t&&(t=yield e.detectNetwork.call(this),t||Ho.throwError("no network detected",z.b.errors.UNKNOWN_ERROR,{}),null==this._network&&(ie(this,"_network",t),this.emit("network",t,null))),t}))}}class zo extends Go{constructor(e,t){Ho.checkAbstract(new.target,zo),e=ae(new.target,"getNetwork")(e),t=ae(new.target,"getApiKey")(t),super(ae(new.target,"getUrl")(e,t),e),"string"==typeof t?ie(this,"apiKey",t):null!=t&&Object.keys(t).forEach((e=>{ie(this,e,t[e])}))}_startPending(){Ho.warn("WARNING: API provider does not support pending filters")}isCommunityResource(){return!1}getSigner(e){return Ho.throwError("API provider does not support signing",z.b.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(e){return e}static getUrl(e,t){return Ho.throwError("not implemented; sub-classes must override getUrl",z.b.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}const Xo=new z.b("providers/5.4.5"),qo="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class Yo extends Ko{constructor(e,t){const r=new Qo(e,t);super(r.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi."),r.network),ie(this,"apiKey",r.apiKey)}isCommunityResource(){return this.apiKey===qo}}class Qo extends zo{static getWebSocketProvider(e,t){return new Yo(e,t)}static getApiKey(e){return null==e?qo:(e&&"string"!=typeof e&&Xo.throwArgumentError("invalid apiKey","apiKey",e),e)}static getUrl(e,t){let r=null;switch(e.name){case"homestead":r="eth-mainnet.alchemyapi.io/v2/";break;case"ropsten":r="eth-ropsten.alchemyapi.io/v2/";break;case"rinkeby":r="eth-rinkeby.alchemyapi.io/v2/";break;case"goerli":r="eth-goerli.alchemyapi.io/v2/";break;case"kovan":r="eth-kovan.alchemyapi.io/v2/";break;case"matic":r="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":r="polygon-mumbai.g.alchemy.com/v2/";break;default:Xo.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+r+t,throttleCallback:(e,r)=>(t===qo&&uo(),Promise.resolve(!0))}}isCommunityResource(){return this.apiKey===qo}}var Zo=function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))};const Wo=new z.b("providers/5.4.5");class $o extends zo{static getApiKey(e){return null!=e&&Wo.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null}static getUrl(e,t){let r=null;return"homestead"===e.name?r="https://cloudflare-eth.com/":Wo.throwArgumentError("unsupported network","network",arguments[0]),r}perform(e,t){const r=Object.create(null,{perform:{get:()=>super.perform}});return Zo(this,void 0,void 0,(function*(){return"getBlockNumber"===e?(yield r.perform.call(this,"getBlock",{blockTag:"latest"})).number:r.perform.call(this,e,t)}))}}var es=function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))};const ts=new z.b("providers/5.4.5");function rs(e){const t={};for(let r in e){if(null==e[r])continue;let n=e[r];"type"===r&&0===n||(n={type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[r]?Object(J.g)(Object(J.i)(n)):"accessList"===r?"["+_r(n).map((e=>'{address:"'.concat(e.address,'",storageKeys:["').concat(e.storageKeys.join('","'),'"]}'))).join(",")+"]":Object(J.i)(n),t[r]=n)}return t}function ns(e){if(0==e.status&&("No records found"===e.message||"No transactions found"===e.message))return e.result;if(1!=e.status||"OK"!=e.message){const t=new Error("invalid response");throw t.result=JSON.stringify(e),(e.result||"").toLowerCase().indexOf("rate limit")>=0&&(t.throttleRetry=!0),t}return e.result}function is(e){if(e&&0==e.status&&"NOTOK"==e.message&&(e.result||"").toLowerCase().indexOf("rate limit")>=0){const t=new Error("throttled response");throw t.result=JSON.stringify(e),t.throttleRetry=!0,t}if("2.0"!=e.jsonrpc){const t=new Error("invalid response");throw t.result=JSON.stringify(e),t}if(e.error){const t=new Error(e.error.message||"unknown error");throw e.error.code&&(t.code=e.error.code),e.error.data&&(t.data=e.error.data),t}return e.result}function as(e){if("pending"===e)throw new Error("pending not supported");return"latest"===e?e:parseInt(e.substring(2),16)}function os(e,t,r){if("call"===e&&t.code===z.b.errors.SERVER_ERROR){const e=t.error;if(e&&(e.message.match(/reverted/i)||e.message.match(/VM execution error/i))){let r=e.data;if(r&&(r="0x"+r.replace(/^.*0x/i,"")),Object(J.l)(r))return r;ts.throwError("missing revert data in call exception",z.b.errors.CALL_EXCEPTION,{error:t,data:"0x"})}}let n=t.message;throw t.code===z.b.errors.SERVER_ERROR&&(t.error&&"string"==typeof t.error.message?n=t.error.message:"string"==typeof t.body?n=t.body:"string"==typeof t.responseText&&(n=t.responseText)),n=(n||"").toLowerCase(),n.match(/insufficient funds/)&&ts.throwError("insufficient funds for intrinsic transaction cost",z.b.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:r}),n.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&ts.throwError("nonce has already been used",z.b.errors.NONCE_EXPIRED,{error:t,method:e,transaction:r}),n.match(/another transaction with same nonce/)&&ts.throwError("replacement fee too low",z.b.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:r}),n.match(/execution failed due to an exception|execution reverted/)&&ts.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",z.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}class ss extends Co{constructor(e,t){ts.checkNew(new.target,ss),super(e),ie(this,"baseUrl",this.getBaseUrl()),ie(this,"apiKey",t||"9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB")}getBaseUrl(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"ropsten":return"https://api-ropsten.etherscan.io";case"rinkeby":return"https://api-rinkeby.etherscan.io";case"kovan":return"https://api-kovan.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io"}return ts.throwArgumentError("unsupported network","network",name)}getUrl(e,t){const r=Object.keys(t).reduce(((e,r)=>{const n=t[r];return null!=n&&(e+="&".concat(r,"=").concat(n)),e}),""),n=this.apiKey?"&apikey="+this.apiKey:"";return"".concat(this.baseUrl,"/api?module=").concat(e).concat(r).concat(n)}getPostUrl(){return this.baseUrl+"/api"}getPostData(e,t){return t.module=e,t.apikey=this.apiKey,t}fetch(e,t,r){return es(this,void 0,void 0,(function*(){const n=r?this.getPostUrl():this.getUrl(e,t),i=r?this.getPostData(e,t):null,a="proxy"===e?is:ns;this.emit("debug",{action:"request",request:n,provider:this});const o={url:n,throttleSlotInterval:1e3,throttleCallback:(e,t)=>(this.isCommunityResource()&&uo(),Promise.resolve(!0))};let s=null;i&&(o.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},s=Object.keys(i).map((e=>"".concat(e,"=").concat(i[e]))).join("&"));const u=yield $a(o,s,a||is);return this.emit("debug",{action:"response",request:n,response:fe(u),provider:this}),u}))}detectNetwork(){return es(this,void 0,void 0,(function*(){return this.network}))}perform(e,t){const r=Object.create(null,{perform:{get:()=>super.perform}});return es(this,void 0,void 0,(function*(){switch(e){case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getBalance":return this.fetch("account",{action:"balance",address:t.address,tag:t.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:t.address,tag:t.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:t.address,tag:t.blockTag});case"getStorageAt":return this.fetch("proxy",{action:"eth_getStorageAt",address:t.address,position:t.position,tag:t.blockTag});case"sendTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:t.signedTransaction},!0).catch((e=>os("sendTransaction",e,t.signedTransaction)));case"getBlock":if(t.blockTag)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:t.blockTag,boolean:t.includeTransactions?"true":"false"});throw new Error("getBlock by blockHash not implemented");case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:t.transactionHash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:t.transactionHash});case"call":{if("latest"!==t.blockTag)throw new Error("EtherscanProvider does not support blockTag for call");const r=rs(t.transaction);r.module="proxy",r.action="eth_call";try{return yield this.fetch("proxy",r,!0)}catch(e){return os("call",e,t.transaction)}}case"estimateGas":{const r=rs(t.transaction);r.module="proxy",r.action="eth_estimateGas";try{return yield this.fetch("proxy",r,!0)}catch(e){return os("estimateGas",e,t.transaction)}}case"getLogs":{const e={action:"getLogs"};if(t.filter.fromBlock&&(e.fromBlock=as(t.filter.fromBlock)),t.filter.toBlock&&(e.toBlock=as(t.filter.toBlock)),t.filter.address&&(e.address=t.filter.address),t.filter.topics&&t.filter.topics.length>0&&(t.filter.topics.length>1&&ts.throwError("unsupported topic count",z.b.errors.UNSUPPORTED_OPERATION,{topics:t.filter.topics}),1===t.filter.topics.length)){const r=t.filter.topics[0];"string"==typeof r&&66===r.length||ts.throwError("unsupported topic format",z.b.errors.UNSUPPORTED_OPERATION,{topic0:r}),e.topic0=r}const r=yield this.fetch("logs",e);let n={};for(let t=0;t{["contractAddress","to"].forEach((function(t){""==e[t]&&delete e[t]})),null==e.creates&&null!=e.contractAddress&&(e.creates=e.contractAddress);const t=this.formatter.transactionResponse(e);return e.timeStamp&&(t.timestamp=parseInt(e.timeStamp)),t}))}))}isCommunityResource(){return"9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB"===this.apiKey}}function us(e){for(let t=(e=e.slice()).length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}var ls=function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))};const cs=new z.b("providers/5.4.5");function fs(){return(new Date).getTime()}function hs(e){let t=null;for(let r=0;rt?null:(n+i)/2}function ps(e){if(null===e)return"null";if("number"==typeof e||"boolean"==typeof e)return JSON.stringify(e);if("string"==typeof e)return e;if(Z.isBigNumber(e))return e.toString();if(Array.isArray(e))return JSON.stringify(e.map((e=>ps(e))));if("object"==typeof e){const t=Object.keys(e);return t.sort(),"{"+t.map((t=>{let r=e[t];return r="function"==typeof r?"[function]":ps(r),JSON.stringify(t)+":"+r})).join(",")+"}"}throw new Error("unknown value type: "+typeof e)}let gs=1;function ys(e){let t=null,r=null,n=new Promise((n=>{t=function(){r&&(clearTimeout(r),r=null),n()},r=setTimeout(t,e)}));return{cancel:t,getPromise:function(){return n},wait:e=>(n=n.then(e),n)}}const ms=[z.b.errors.CALL_EXCEPTION,z.b.errors.INSUFFICIENT_FUNDS,z.b.errors.NONCE_EXPIRED,z.b.errors.REPLACEMENT_UNDERPRICED,z.b.errors.UNPREDICTABLE_GAS_LIMIT],vs=["address","args","errorArgs","errorSignature","method","transaction"];function bs(e,t){const r={weight:e.weight};return Object.defineProperty(r,"provider",{get:()=>e.provider}),e.start&&(r.start=e.start),t&&(r.duration=t-e.start),e.done&&(e.error?r.error=e.error:r.result=e.result||null),r}function Ss(e,t,r){let n=ps;switch(t){case"getBlockNumber":return function(t){const r=t.map((e=>e.result));let n=ds(t.map((e=>e.result)),2);if(null!=n)return n=Math.ceil(n),r.indexOf(n+1)>=0&&n++,n>=e._highestBlockNumber&&(e._highestBlockNumber=n),e._highestBlockNumber};case"getGasPrice":return function(e){const t=e.map((e=>e.result));return t.sort(),t[Math.floor(t.length/2)]};case"getEtherPrice":return function(e){return ds(e.map((e=>e.result)))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(e){return null==e?null:((e=ue(e)).confirmations=-1,ps(e))};break;case"getBlock":n=r.includeTransactions?function(e){return null==e?null:((e=ue(e)).transactions=e.transactions.map((e=>((e=ue(e)).confirmations=-1,e))),ps(e))}:function(e){return null==e?null:ps(e)};break;default:throw new Error("unknown method: "+t)}return function(e,t){return function(r){const n={};r.forEach((t=>{const r=e(t.result);n[r]||(n[r]={count:0,result:t.result}),n[r].count++}));const i=Object.keys(n);for(let e=0;e=t)return r.result}}}(n,e.quorum)}function ws(e,t){return ls(this,void 0,void 0,(function*(){const r=e.provider;return null!=r.blockNumber&&r.blockNumber>=t||-1===t?r:eo((()=>new Promise(((n,i)=>{setTimeout((function(){return r.blockNumber>=t?n(r):e.cancelled?n(null):n(void 0)}),0)}))),{oncePoll:r})}))}function Es(e,t,r,n){return ls(this,void 0,void 0,(function*(){let i=e.provider;switch(r){case"getBlockNumber":case"getGasPrice":return i[r]();case"getEtherPrice":if(i.getEtherPrice)return i.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return n.blockTag&&Object(J.l)(n.blockTag)&&(i=yield ws(e,t)),i[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&Object(J.l)(n.blockTag)&&(i=yield ws(e,t)),i.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&Object(J.l)(n.blockTag)&&(i=yield ws(e,t)),i[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":return n.blockTag&&Object(J.l)(n.blockTag)&&(i=yield ws(e,t)),i[r](n.transaction);case"getTransaction":case"getTransactionReceipt":return i[r](n.transactionHash);case"getLogs":{let r=n.filter;return(r.fromBlock&&Object(J.l)(r.fromBlock)||r.toBlock&&Object(J.l)(r.toBlock))&&(i=yield ws(e,t)),i.getLogs(r)}}return cs.throwError("unknown method error",z.b.errors.UNKNOWN_ERROR,{method:r,params:n})}))}class As extends Co{constructor(e,t){cs.checkNew(new.target,As),0===e.length&&cs.throwArgumentError("missing providers","providers",e);const r=e.map(((e,t)=>{if(ar.isProvider(e)){const t=oo(e)?2e3:750,r=1;return Object.freeze({provider:e,weight:1,stallTimeout:t,priority:r})}const r=ue(e);null==r.priority&&(r.priority=1),null==r.stallTimeout&&(r.stallTimeout=oo(e)?2e3:750),null==r.weight&&(r.weight=1);const n=r.weight;return(n%1||n>512||n<1)&&cs.throwArgumentError("invalid weight; must be integer in [1, 512]","providers[".concat(t,"].weight"),n),Object.freeze(r)})),n=r.reduce(((e,t)=>e+t.weight),0);null==t?t=n/2:t>n&&cs.throwArgumentError("quorum will always fail; larger than total weight","quorum",t);let i=hs(r.map((e=>e.provider.network)));null==i&&(i=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then(e,t)}),0)}))),super(i),ie(this,"providerConfigs",Object.freeze(r)),ie(this,"quorum",t),this._highestBlockNumber=-1}detectNetwork(){return ls(this,void 0,void 0,(function*(){return hs(yield Promise.all(this.providerConfigs.map((e=>e.provider.getNetwork()))))}))}perform(e,t){return ls(this,void 0,void 0,(function*(){if("sendTransaction"===e){const e=yield Promise.all(this.providerConfigs.map((e=>e.provider.sendTransaction(t.signedTransaction).then((e=>e.hash),(e=>e)))));for(let t=0;te.priority-t.priority));const i=this._highestBlockNumber;let a=0,o=!0;for(;;){const s=fs();let u=n.filter((e=>e.runner&&s-e.starte+t.weight),0);for(;u{r.staller=null})),r.runner=Es(r,i,e,t).then((n=>{r.done=!0,r.result=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:o,backend:bs(r,fs()),request:{method:e,params:fe(t)},provider:this})}),(n=>{r.done=!0,r.error=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:o,backend:bs(r,fs()),request:{method:e,params:fe(t)},provider:this})})),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:o,backend:bs(r,null),request:{method:e,params:fe(t)},provider:this}),u+=r.weight}const l=[];n.forEach((e=>{!e.done&&e.runner&&(l.push(e.runner),e.staller&&l.push(e.staller.getPromise()))})),l.length&&(yield Promise.race(l));const c=n.filter((e=>e.done&&null==e.error));if(c.length>=this.quorum){const e=r(c);if(void 0!==e)return n.forEach((e=>{e.staller&&e.staller.cancel(),e.cancelled=!0})),e;o||(yield ys(100).getPromise()),o=!1}const f=n.reduce(((e,t)=>{if(!t.done||null==t.error)return e;const r=t.error.code;return ms.indexOf(r)>=0&&(e[r]||(e[r]={error:t.error,weight:0}),e[r].weight+=t.weight),e}),{});if(Object.keys(f).forEach((e=>{const t=f[e];if(t.weight{e.staller&&e.staller.cancel(),e.cancelled=!0}));const r=t.error,i={};vs.forEach((e=>{null!=r[e]&&(i[e]=r[e])})),cs.throwError(r.reason||r.message,e,i)})),0===n.filter((e=>!e.done)).length)break}return n.forEach((e=>{e.staller&&e.staller.cancel(),e.cancelled=!0})),cs.throwError("failed to meet quorum",z.b.errors.SERVER_ERROR,{method:e,params:t,results:n.map((e=>bs(e))),provider:this})}))}}const Ts=null,Cs=new z.b("providers/5.4.5"),Is="84842078b09946638c03157f83405213";class ks extends Ko{constructor(e,t){const r=new Bs(e,t),n=r.connection;n.password&&Cs.throwError("INFURA WebSocket project secrets unsupported",z.b.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"}),super(n.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/"),e),ie(this,"apiKey",r.projectId),ie(this,"projectId",r.projectId),ie(this,"projectSecret",r.projectSecret)}isCommunityResource(){return this.projectId===Is}}class Bs extends zo{static getWebSocketProvider(e,t){return new ks(e,t)}static getApiKey(e){const t={apiKey:Is,projectId:Is,projectSecret:null};return null==e||("string"==typeof e?t.projectId=e:null!=e.projectSecret?(Cs.assertArgument("string"==typeof e.projectId,"projectSecret requires a projectId","projectId",e.projectId),Cs.assertArgument("string"==typeof e.projectSecret,"invalid projectSecret","projectSecret","[REDACTED]"),t.projectId=e.projectId,t.projectSecret=e.projectSecret):e.projectId&&(t.projectId=e.projectId),t.apiKey=t.projectId),t}static getUrl(e,t){let r=null;switch(e?e.name:"unknown"){case"homestead":r="mainnet.infura.io";break;case"ropsten":r="ropsten.infura.io";break;case"rinkeby":r="rinkeby.infura.io";break;case"kovan":r="kovan.infura.io";break;case"goerli":r="goerli.infura.io";break;case"matic":r="polygon-mainnet.infura.io";break;case"maticmum":r="polygon-mumbai.infura.io";break;default:Cs.throwError("unsupported network",z.b.errors.INVALID_ARGUMENT,{argument:"network",value:e})}const n={allowGzip:!0,url:"https://"+r+"/v3/"+t.projectId,throttleCallback:(e,r)=>(t.projectId===Is&&uo(),Promise.resolve(!0))};return null!=t.projectSecret&&(n.user="",n.password=t.projectSecret),n}isCommunityResource(){return this.projectId===Is}}class _s extends Fo{send(e,t){const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};null==this._pendingBatch&&(this._pendingBatch=[]);const n={request:r,resolve:null,reject:null},i=new Promise(((e,t)=>{n.resolve=e,n.reject=t}));return this._pendingBatch.push(n),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout((()=>{const e=this._pendingBatch;this._pendingBatch=null,this._pendingBatchAggregator=null;const t=e.map((e=>e.request));return this.emit("debug",{action:"requestBatch",request:fe(t),provider:this}),$a(this.connection,JSON.stringify(t)).then((r=>{this.emit("debug",{action:"response",request:t,response:r,provider:this}),e.forEach(((e,t)=>{const n=r[t];if(n.error){const t=new Error(n.error.message);t.code=n.error.code,t.data=n.error.data,e.reject(t)}else e.resolve(n.result)}))}),(r=>{this.emit("debug",{action:"response",error:r,request:t,provider:this}),e.forEach((e=>{e.reject(r)}))}))}),10)),i}}const Ps=new z.b("providers/5.4.5");class Os extends zo{static getApiKey(e){return e&&"string"!=typeof e&&Ps.throwArgumentError("invalid apiKey","apiKey",e),e||"ETHERS_JS_SHARED"}static getUrl(e,t){Ps.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");let r=null;switch(e.name){case"homestead":r="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":r="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":r="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":r="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":r="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:Ps.throwArgumentError("unsupported network","network",arguments[0])}return r+"?apiKey="+t}}const Ns=new z.b("providers/5.4.5"),Rs={homestead:"6004bcd10040261633ade990",ropsten:"6004bd4d0040261633ade991",rinkeby:"6004bda20040261633ade994",goerli:"6004bd860040261633ade992"};class Ms extends zo{constructor(e,t){if(null==t){const r=ae(new.target,"getNetwork")(e);if(r){const e=Rs[r.name];e&&(t={applicationId:e,loadBalancer:!0})}null==t&&Ns.throwError("unsupported network",z.b.errors.INVALID_ARGUMENT,{argument:"network",value:e})}super(e,t)}static getApiKey(e){null==e&&Ns.throwArgumentError("PocketProvider.getApiKey does not support null apiKey","apiKey",e);const t={applicationId:null,loadBalancer:!1,applicationSecretKey:null};return"string"==typeof e?t.applicationId=e:null!=e.applicationSecretKey?(Ns.assertArgument("string"==typeof e.applicationId,"applicationSecretKey requires an applicationId","applicationId",e.applicationId),Ns.assertArgument("string"==typeof e.applicationSecretKey,"invalid applicationSecretKey","applicationSecretKey","[REDACTED]"),t.applicationId=e.applicationId,t.applicationSecretKey=e.applicationSecretKey,t.loadBalancer=!!e.loadBalancer):e.applicationId?(Ns.assertArgument("string"==typeof e.applicationId,"apiKey.applicationId must be a string","apiKey.applicationId",e.applicationId),t.applicationId=e.applicationId,t.loadBalancer=!!e.loadBalancer):Ns.throwArgumentError("unsupported PocketProvider apiKey","apiKey",e),t}static getUrl(e,t){let r=null;switch(e?e.name:"unknown"){case"homestead":r="eth-mainnet.gateway.pokt.network";break;case"ropsten":r="eth-ropsten.gateway.pokt.network";break;case"rinkeby":r="eth-rinkeby.gateway.pokt.network";break;case"goerli":r="eth-goerli.gateway.pokt.network";break;default:Ns.throwError("unsupported network",z.b.errors.INVALID_ARGUMENT,{argument:"network",value:e})}let n=null;n=t.loadBalancer?"https://".concat(r,"/v1/lb/").concat(t.applicationId):"https://".concat(r,"/v1/").concat(t.applicationId);const i={url:n,headers:{}};return null!=t.applicationSecretKey&&(i.user="",i.password=t.applicationSecretKey),i}isCommunityResource(){return this.applicationId===Rs[this.network.name]}}const Ls=new z.b("providers/5.4.5");let Ds=1;function Fs(e,t){const r="Web3LegacyFetcher";return function(n,i){"eth_sign"==n&&(e.isMetaMask||e.isStatus)&&(n="personal_sign",i=[i[1],i[0]]);const a={method:n,params:i,id:Ds++,jsonrpc:"2.0"};return new Promise(((e,n)=>{this.emit("debug",{action:"request",fetcher:r,request:fe(a),provider:this}),t(a,((t,i)=>{if(t)return this.emit("debug",{action:"response",fetcher:r,error:t,request:a,provider:this}),n(t);if(this.emit("debug",{action:"response",fetcher:r,request:a,response:i,provider:this}),i.error){const e=new Error(i.error.message);return e.code=i.error.code,e.data=i.error.data,n(e)}e(i.result)}))}))}}class xs extends Fo{constructor(e,t){Ls.checkNew(new.target,xs),null==e&&Ls.throwArgumentError("missing provider","provider",e);let r=null,n=null,i=null;"function"==typeof e?(r="unknown:",n=e):(r=e.host||e.path||"",!r&&e.isMetaMask&&(r="metamask"),i=e,e.request?(""===r&&(r="eip-1193:"),n=function(e){return function(t,r){null==r&&(r=[]),"eth_sign"==t&&(e.isMetaMask||e.isStatus)&&(t="personal_sign",r=[r[1],r[0]]);const n={method:t,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:fe(n),provider:this}),e.request(n).then((e=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:e,provider:this}),e}))}}(e)):e.sendAsync?n=Fs(e,e.sendAsync.bind(e)):e.send?n=Fs(e,e.send.bind(e)):Ls.throwArgumentError("unsupported provider","provider",e),r||(r="unknown:")),super(r,t),ie(this,"jsonRpcFetchFunc",n),ie(this,"provider",i)}send(e,t){return this.jsonRpcFetchFunc(e,t)}}const Us=new z.b("providers/5.4.5");function js(e,t){if(null==e&&(e="homestead"),"string"==typeof e){const t=e.match(/^(ws|http)s?:/i);if(t)switch(t[1]){case"http":return new Fo(e);case"ws":return new Ko(e);default:Us.throwArgumentError("unsupported URL scheme","network",e)}}const r=ka(e);return r&&r._defaultProvider||Us.throwError("unsupported getDefaultProvider network",z.b.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:e}),r._defaultProvider({FallbackProvider:As,AlchemyProvider:Qo,CloudflareProvider:$o,EtherscanProvider:ss,InfuraProvider:Bs,JsonRpcProvider:Fo,NodesmithProvider:Os,PocketProvider:Ms,Web3Provider:xs,IpcProvider:Ts},t)}const Vs=new RegExp("^bytes([0-9]+)$"),Ks=new RegExp("^(u?int)([0-9]*)$"),Js=new RegExp("^(.*)\\[([0-9]*)\\]$");function Hs(e,t){if(e.length!=t.length)throw new Error("type/value count mismatch");const r=[];return e.forEach((function(e,n){r.push(function e(t,r,n){switch(t){case"address":return n?Object(J.p)(r,32):Object(J.a)(r);case"string":return Ge(r);case"bytes":return Object(J.a)(r);case"bool":return r=r?"0x01":"0x00",n?Object(J.p)(r,32):Object(J.a)(r)}let i=t.match(Ks);if(i){let e=parseInt(i[2]||"256");if(i[2]&&String(e)!==i[2]||e%8!=0||0===e||e>256)throw new Error("invalid number type - "+t);return n&&(e=256),r=Z.from(r).toTwos(e),Object(J.p)(r,e/8)}if(i=t.match(Vs),i){const e=parseInt(i[1]);if(String(e)!==i[1]||0===e||e>32)throw new Error("invalid bytes type - "+t);if(Object(J.a)(r).byteLength!==e)throw new Error("invalid value for "+t);return n?Object(J.a)((r+"0000000000000000000000000000000000000000000000000000000000000000").substring(0,66)):r}if(i=t.match(Js),i&&Array.isArray(r)){const n=i[1];if(parseInt(i[2]||String(r.length))!=r.length)throw new Error("invalid value for "+t);const a=[];return r.forEach((function(t){a.push(e(n,t,!0))})),Object(J.b)(a)}throw new Error("invalid type - "+t)}(e,t[n]))})),Object(J.i)(Object(J.b)(r))}function Gs(e,t){return Se(Hs(e,t))}function zs(e,t){return Dn(Hs(e,t))}function Xs(e){const t=Ge(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return Object(J.i)(Object(J.b)([t,va]).slice(0,32))}function qs(e){const t=Object(J.a)(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;0===t[r-1];)r--;return Ye(t.slice(0,r))}const Ys=new z.b("units/5.4.0"),Qs=["wei","kwei","mwei","gwei","szabo","finney","ether"];function Zs(e){const t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&Ys.throwArgumentError("invalid value","value",e);let r=t[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");let i="";for(2===t.length&&(i="."+(t[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);const a=[];for(;r.length;){if(r.length<=3){a.unshift(r);break}{const e=r.length-3;a.unshift(r.substring(e)),r=r.substring(0,e)}}return n+a.join(",")+i}function Ws(e,t){if("string"==typeof t){const e=Qs.indexOf(t);-1!==e&&(t=3*e)}return on(e,null!=t?t:18)}function $s(e,t){if("string"!=typeof e&&Ys.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=Qs.indexOf(t);-1!==e&&(t=3*e)}return sn(e,null!=t?t:18)}function eu(e){return Ws(e,18)}function tu(e){return $s(e,18)}const ru="ethers/5.4.7",nu=new z.b(ru);try{const e=window;null==e._ethers&&(e._ethers=u)}catch(e){}var iu=r(79),au=r.n(iu);function ou(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))}function su(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]pu.isMetaMaskInstalled();var vu={_accounts:[],_api:void 0,api:async function(){return this._api||(this._api=await yu()()),this._api},requestAccounts:async function(){const e=await this.api();try{const t=await e.request({method:"eth_requestAccounts"});return this._accounts=t,this._accounts}catch(e){throw console.error(e),"Error requestAccounts"}},getAccounts:async function(){const e=await this.api();try{const t=await e.request({method:"eth_accounts"});return this._accounts=t,this._accounts}catch(e){throw console.error(e),e}},addEthereumChain:async function(e){const t=await this.api();try{await t.request({method:"wallet_addEthereumChain",params:[e]})}catch(e){throw e}},switchEthereumChain:async function(e){const t=await this.api();try{await t.request({method:"wallet_switchEthereumChain",params:[{chainId:e.chainId}]})}catch(e){throw e}},createContract:async function(e,t){const r=await this.api(),n=new u.providers.Web3Provider(r,"any"),i=Object(l.wavesAddress2eth)(e),a=new URL(t);a.pathname="/eth/abi/"+e;const o=await fetch(a.toString()),s=await o.json();if(s.error)throw s;const c=s,f=new u.ContractFactory(c,"0x",n.getSigner());return{contract:await f.attach(i),abi:c}},async transferWaves(e,t){const r=await this.api(),n="0x"+((e,t)=>e*10**10)(Number(t)).toString(16),i={from:this._accounts[0],to:e,value:n};return await r.request({method:"eth_sendTransaction",params:[i]})},async transferAsset(e,t,r){const n=await this.api(),i=this._accounts[0],a=new u.providers.Web3Provider(n,"any"),o=new u.ContractFactory(C,"0x",a.getSigner()),s=await o.attach(t);return await s.transfer(e,r,{from:i})},signOrder:async function(e){return this.signTypedDataV4(JSON.stringify(e))},signTypedDataV4:async function(e){const t=await this.api(),r=this._accounts[0];return await t.request({method:"eth_signTypedData_v4",params:[r,e]})},signTypedData:async function(e){const t=await this.api(),r=this._accounts[0];return await t.request({method:"eth_signTypedData_v4",params:[r,e]})}};class bu{constructor(e){var t,r;if(this.isSignAndBroadcastByProvider=!0,this.user=null,!mu())throw"Metamask is not installed";(null==e?void 0:e.wavesConfig)&&console.warn("ProviderMetamask: config.wavesConfig is deprecated and will be removed. Just omit it."),(null===(t=null==e?void 0:e.wavesConfig)||void 0===t?void 0:t.chainId)&&console.warn("ProviderMetamask: config.wavesConfig.chainId is deprecated and will be removed. Just omit it."),(null===(r=null==e?void 0:e.wavesConfig)||void 0===r?void 0:r.nodeUrl)&&console.warn("ProviderMetamask: config.wavesConfig.nodeUrl is deprecated and will be removed. Just omit it."),this._config=e||f,this._connectOptions=null,this._connectPromisify=function(){let e,t;return{promise:new Promise(((r,n)=>{e=r,t=n})),resolve:e,reject:t}}(),this.__log("constructor",this._config)}async login(){this.__log("login"),await this._connectPromisify.promise,await this.trySwitchNetwork();const e=await vu.requestAccounts();if(null==e?void 0:e.length){const t=e[0];return this.user={id:0,path:"",publicKey:"",address:Object(l.ethAddress2waves)(t,this._connectOptions.NETWORK_BYTE),statusCode:""},this.__log("login :",this.user),this.user}throw"Can not get user from metamask"}logout(){return this.__log("logout"),Promise.resolve()}async sign(e){return this.__log("sign"),await this._connectPromisify.promise,await this.trySwitchNetwork(),Promise.all(e.map(this.signOneTx,this)).then((e=>1===e.length?e[0]:e))}async signMessage(e){this.__log("signMessage :",e),await this._connectPromisify.promise,await this.trySwitchNetwork();const t=((e,t)=>{const r=p(B),n=p(e),i=p(t);return Object.assign(Object.assign({},r),{domain:Object.assign(Object.assign({},r.domain),n),message:Object.assign({},i)})})({chainId:this._connectOptions.NETWORK_BYTE},{text:e});this.__log("signMessage :: metamaskApi.signMessage :",t);const r=await vu.signTypedDataV4(JSON.stringify(t));return this.__log("signMessage :: metamaskApi.signMessage :: result :",r),r}async signTypedData(e){this.__log("signTypedData :",e),await this._connectPromisify.promise,await this.trySwitchNetwork();const t=(e=>{if(!e||0===e.length)return{status:!1,message:"Empty typed data"};const t=e.map((e=>e.key)),r=t.filter(((e,r)=>t.indexOf(e)!==r));if(r.length)return{status:!1,message:"Duplicate keys: "+r.join(", ")};for(let n=0;n{if(4!==e.version)return{status:!1,message:"Provider only supports order version: 4"};const t=String(e.orderType).toUpperCase();return e.orderType&&R.includes(t)?e.hasOwnProperty("priceMode")&&!N.includes(e.priceMode)?{status:!1,message:'Invalid field priceMode: "'.concat(e.priceMode,'"\nSupports: ').concat(N.join(" | "))}:{status:!0}:{status:!1,message:'Invalid field orderType: "'.concat(String(e.orderType),'"\nSupports: ').concat(R.join(" | "))}})(t);if(!1===n.status)throw new Error(n.message);const i=((e,t)=>{const r=p(k),n=p(e),i=p(t);return Object.assign(Object.assign({},r),{domain:Object.assign(Object.assign({},r.domain),n),message:Object.assign({},i)})})({chainId:r},{version:t.version,orderType:t.orderType.toUpperCase(),matcherPublicKey:t.matcherPublicKey,matcherFeeAssetId:t.matcherFeeAssetId,amountAsset:t.assetPair.amountAsset,priceAsset:t.assetPair.priceAsset,matcherFee:t.matcherFee,amount:t.amount,price:t.price,timestamp:t.timestamp,expiration:t.expiration,priceMode:O(t.priceMode)});this.__log("signOrder :: metamaskApi.signOrder :",i);const a=await vu.signTypedDataV4(JSON.stringify(i));return this.__log("signOrder :: metamaskApi.signOrder :: result :",a),a}async connect(e){this.__log("connect",e),this._connectOptions=Object.assign({},e),this._connectPromisify.resolve()}async trySwitchNetwork(){this.__log("trySwitchNetwork");const e=(e=>{let t,{NETWORK_BYTE:r,NODE_URL:n}=e;switch(r){case 87:t=g;break;case 83:t=y;break;case 84:t=m;break;default:t=null}return t&&!t.rpcUrls[0].includes(n)&&(t=null),t})(this._connectOptions);if(null!==e){await vu.addEthereumChain(e);try{this.__log("trySwitchNetwork :: metamaskApi.switchEthereumChain",e),await vu.switchEthereumChain(e)}catch(e){throw e}}else this.__log("trySwitchNetwork :: skiped")}async signOneTx(e){if(e.type==c.TRANSACTION_TYPE.TRANSFER){let t;if("WAVES"!==e.assetId&&void 0!==e.assetId||(e.assetId=null),this.__log("signOneTx :: transfer :",e),null===e.assetId)this.__log("signOneTx :: transfer waves"),t=await vu.transferWaves(Object(l.wavesAddress2eth)(e.recipient),String(e.amount)),this.__log("signOneTx :: transfer waves :: result :",t);else{this.__log("signOneTx :: transfer asset");const r=await vu.transferAsset(Object(l.wavesAddress2eth)(e.recipient),Object(l.wavesAsset2Eth)(e.assetId),String(e.amount));this.__log("signOneTx :: transfer asset :: result :",r),t=r.hash}const r=Object.assign(Object.assign({},e),{id:Object(l.ethTxId2waves)(t.slice(2))});return this.__log("signOneTx :: result :",r),r}if(e.type==c.TRANSACTION_TYPE.INVOKE_SCRIPT){const n=e,i=n.call,a=i.function,o=n.dApp,s=await vu.createContract(o,this._connectOptions.NODE_URL),u=((e,t)=>e.find((e=>e.name===t)))(s.abi,a),c=(t=i.args,r=u.inputs,t.map(((e,t)=>j(r[t],e.value)))),f=(e=>e.map(V))(n.payment||[]);this.__log("signOneTx :: invoke",e,a,c,f);const h=await s.contract[a](...c,f);this.__log("signOneTx :: invoke result :",e,a,c,f);const d=h.hash,p=Object.assign(Object.assign({},e),{id:Object(l.ethTxId2waves)(d.slice(2))});return this.__log("signOneTx :: result :",p),p}var t,r}on(e,t){return this.__log("on"),console.error("Not implemented"),this}once(e,t){return this.__log("once"),console.error("Not implemented"),this}off(e,t){return this.__log("off"),console.error("Not implemented"),this}__log(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n1024||e%1)&&o.throwArgumentError("invalid length","length",e);const t=new Uint8Array(e);return u.getRandomValues(t),Object(n.a)(t)}u&&u.getRandomValues||(o.warn("WARNING: Missing strong random number source"),u={getRandomValues:function(e){return o.throwError("no secure random source avaialble",i.b.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}})}).call(this,r(17))}])},4182:(e,t,r)=>{"use strict";r.d(t,{Signer:()=>wt});var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)};function i(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var a=function(){return a=Object.assign||function(e){for(var t,r=1,n=arguments.length;r=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,r,o):i(t,r))||o);return a>3&&o&&Object.defineProperty(t,r,o),o}function s(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(t){a(t)}}function s(e){try{u(n.throw(e))}catch(t){a(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(o,s)}u((n=n.apply(e,t||[])).next())}))}function u(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]Math.pow(10,8)&&(t.minSponsoredAssetFee||0){"use strict";r.d(t,{Signer:()=>a.Signer});var n=r(8021);r.o(n,"Signer")&&r.d(t,{Signer:function(){return n.Signer}});var i=r(6293);r.o(i,"Signer")&&r.d(t,{Signer:function(){return i.Signer}});var a=r(4182)},8021:()=>{},6293:()=>{},1344:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(3900),a=n(r(6463)),o=r(5009),s=r(3449);t.base64Decode=function(e){return s.stringToBytes(i.decode64(e),"raw")},t.base64Encode=function(e){return i.encode64(s.bytesToString(o._fromIn(e),"raw"))},t.base58Decode=function(e){return a.default.decode(e)},t.base58Encode=function(e){return a.default.encode(o._fromIn(e))},t.base16Decode=function(e){return s.stringToBytes(i.hexToBytes(e),"raw")},t.base16Encode=function(e){return i.bytesToHex(s.bytesToString(o._fromIn(e),"raw"))}},5009:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1344),i=r(3449),a=function(e){return"string"===typeof e||e instanceof String},o=function(e){return e instanceof Uint8Array};t._fromIn=function(e){return a(e)?n.base58Decode(e):o(e)?e:Uint8Array.from(e)},t._fromRawIn=function(e){return a(e)?i.stringToBytes(e):o(e)?e:Uint8Array.from(e)}},3449:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"===typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(s){i={error:s}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o},i=this&&this.__spread||function(){for(var e=[],t=0;t0)for(var n=t,i=3;i>=0;i--)r[3-i]=Math.floor(n/Math.pow(2,8*i)),n%=Math.pow(2,8*i);var a=u.concat(r,e),s=o._hashChain(a);return o.sha256(s)}(t.seed,t.nonce),n=c.default.generateKeyPair(r);return{privateKey:n.private,publicKey:n.public}},t.address=function(e,r){return void 0===r&&(r=i.MAIN_NET_CHAIN_ID),l.isPublicKey(e)?t.buildAddress(s._fromIn(e.publicKey),r):t.address(t.keyPair(e),r)},t.publicKey=function(e){return l.isPrivateKey(e)?c.default.generateKeyPair(s._fromIn(e.privateKey)).public:t.keyPair(e).publicKey},t.privateKey=function(e){return t.keyPair(e).privateKey}},6693:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"===typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(s){i={error:s}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o},i=this&&this.__spread||function(){for(var e=[],t=0;t0)&&!(n=a.next()).done;)o.push(n.value)}catch(s){i={error:s}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o},a=this&&this.__spread||function(){for(var e=[],t=0;t0)&&!(n=a.next()).done;)o.push(n.value)}catch(s){i={error:s}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(r(9151)),s=i(r(3900)),u=r(8043),l=r(5009),c=r(6030),f=r(6693),h=a(r(2333)),d=r(3449);t.aesEncrypt=function(e,t,r,n){void 0===r&&(r="CBC");var i=o.createCipher("AES-"+r,d.bytesToString(l._fromIn(t),"raw"));return i.start({iv:n&&s.createBuffer(d.bytesToString(l._fromIn(n),"raw"))}),i.update(s.createBuffer(d.bytesToString(e,"raw"))),i.finish(),d.stringToBytes(i.output.getBytes(),"raw")},t.aesDecrypt=function(e,t,r,n){void 0===r&&(r="CBC");var i=o.createDecipher("AES-"+r,d.bytesToString(l._fromIn(t),"raw"));i.start({iv:n&&s.createBuffer(d.bytesToString(l._fromIn(n),"raw"))});var a=s.createBuffer(d.bytesToString(l._fromIn(e),"raw"));if(i.update(a),!i.finish())throw new Error("Failed to decrypt data with provided key");return d.stringToBytes(i.output.getBytes(),"raw")},t.messageEncrypt=function(e,r){var n=Uint8Array.from([1]),i=u.randomBytes(32),a=u.randomBytes(16),o=d.stringToBytes(r),s=t.aesEncrypt(o,i,"CTR",a),l=t.aesEncrypt(i,e,"ECB"),h=c.hmacSHA256(o,i),p=c.hmacSHA256(f.concat(i,a),e);return f.concat(n,l,p,h,a,s)},t.messageDecrypt=function(e,r){var i=n(f.split(r,1,48,32,32,16),6),a=(i[0],i[1]),o=i[2],s=i[3],u=i[4],h=i[5],p=t.aesDecrypt(a,e,"ECB");if(!l._fromIn(c.hmacSHA256(f.concat(p,u),l._fromIn(e))).every((function(e,t){return e===o[t]})))throw new Error("Invalid key");var g=t.aesDecrypt(h,p,"CTR",u);if(!l._fromIn(c.hmacSHA256(g,p)).every((function(e,t){return e===s[t]})))throw new Error("Invalid message");return d.bytesToString(g)},t.sharedKey=function(e,t,r){var n=h.default.sharedKey(l._fromIn(e),l._fromIn(t)),i=c.sha256(l._fromRawIn(r));return c.hmacSHA256(n,i)}},6030:function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var i=r(5009),a=r(5780),o=n(r(8163)),s=n(r(5693));r(3899);var u=n(r(4662)),l=r(3449);t._hashChain=function(e){return i._fromIn(t.keccak(t.blake2b(i._fromIn(e))))},t.sha256=function(e){var t=s.algorithms.sha256.create();return t.update(l.bytesToString(e,"raw")),l.stringToBytes(t.digest().getBytes(),"raw")},t.blake2b=function(e){return u.blake2b(i._fromIn(e),null,32)},t.keccak=function(e){return i._fromIn(a.keccak256.array(i._fromIn(e)))},t.hmacSHA256=function(e,t){var r=o.create();return r.start("sha256",l.bytesToString(i._fromIn(t),"raw")),r.update(l.bytesToString(i._fromIn(e),"raw")),l.stringToBytes(r.digest().getBytes(),"raw")}},5909:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PUBLIC_KEY_LENGTH=32,t.PRIVATE_KEY_LENGTH=32,t.SIGNATURE_LENGTH=64,t.ADDRESS_LENGTH=26,t.MAIN_NET_CHAIN_ID=87,t.TEST_NET_CHAIN_ID=84},8486:function(e,t,r){"use strict";var n=this&&this.__read||function(e,t){var r="function"===typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(s){i={error:s}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o};Object.defineProperty(t,"__esModule",{value:!0});var i=r(6030),a=r(6693);t.merkleVerify=function(e,t,r){var o=Uint8Array.from([0]),s=Uint8Array.from([1]);if(32!==e.length)throw new Error("Failed to parse merkleProof: Invalid rootHash length");for(var u=i.blake2b(a.concat(o,r)),l=[],c=t.map((function(e){return e}));c.length>0;){var f=0===c[0]?"L":"R",h=c[1];if(h<1)throw new Error("Failed to parse merkleProof: Wrong hash size");var d=c.slice(2,2+h);l.push([f,d]),c=c.slice(2+h)}return l.reduce((function(e,t){var r=n(t,2),o=r[0],u=r[1];return i.blake2b(a.concat(s,"R"===o?a.concat(u,e):a.concat(e,u)))}),u).every((function(t,r){return t===e[r]}))}},8043:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(2795)),a=r(6926),o=r(3449),s=function(e){return o.stringToBytes(i.default.getBytesSync(e),"raw")};t.random=function(e,r){switch(r){case"Array8":return Array.from(s(e));case"Array16":return Array.from(t.random(e,"Uint16Array"));case"Array32":return Array.from(t.random(e,"Uint32Array"));case"Buffer":return function(){try{new Buffer(1)}catch(e){throw new Error("Buffer not supported in this environment. Use Node.js or Browserify for browser support.")}}(),Buffer.from(s(e));case"Uint8Array":return s(e);case"Uint16Array":return new Uint16Array(e).map((function(e){return s(2).reduce((function(e,t,r){return e|t<<8*(1-r)}),0)}));case"Uint32Array":return new Uint32Array(e).map((function(e){return s(4).reduce((function(e,t,r){return e|t<<8*(1-r)}),0)}));default:throw new Error(r+" is unsupported.")}},t.randomBytes=function(e){return t.random(e,"Uint8Array")},t.randomSeed=function(e){return void 0===e&&(e=15),t.random(e,"Array32").map((function(e){return a.seedWordsList[e%a.seedWordsList.length]})).join(" ")}},640:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(t){a(t)}}function s(e){try{u(n.throw(e))}catch(t){a(t)}}function u(e){e.done?i(e.value):new r((function(t){t(e.value)})).then(o,s)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"===typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===a[0]||2===a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.seedWordsList=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"]},6761:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(2333)),a=r(5009),o=r(3052),s=r(7405),u=r(8043);t.signBytes=function(e,t,r){return i.default.sign(a._fromIn(o.isPrivateKey(e)?e.privateKey:s.privateKey(e)),a._fromIn(t),a._fromIn(r||u.randomBytes(64)))}},3052:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPublicKey=function(e){return void 0!==e.publicKey},t.isPrivateKey=function(e){return void 0!==e.privateKey}},1907:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(5909),a=r(9664),o=r(5009),s=r(6030),u=r(7405),l=n(r(2333));t.verifyAddress=function(e,t){var r=t?t.chainId:void 0;try{var n=o._fromIn(e);if(1!=n[0]||r&&n[1]!=a.ChaidId.toNumber(r))return!1;for(var i=n.slice(0,22),l=n.slice(22,26),c=s._hashChain(i).slice(0,4),f=0;f<4;f++)if(l[f]!=c[f])return!1;if(t&&t.publicKey){var h=u.address({publicKey:t.publicKey},r);if(n.length!==h.length)return!1;for(f=0;f{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5909),i=r(5909);t.ChaidId={toNumber:function(e){return"string"===typeof e?e.charCodeAt(0):e},isMainnet:function(e){return t.ChaidId.toNumber(e)===n.MAIN_NET_CHAIN_ID},isTestnet:function(e){return t.ChaidId.toNumber(e)===i.TEST_NET_CHAIN_ID}}},5448:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5009),i=r(3449);t.Seed={isSeedWithNonce:function(e){return void 0!==e.nonce},toBinary:function(e){return t.Seed.isSeedWithNonce(e)?{seed:t.Seed.toBinary(e.seed).seed,nonce:e.nonce}:{seed:n._fromRawIn(e),nonce:void 0}},toString:function(e){return i.bytesToString(t.Seed.toBinary(e).seed)}}},9846:(e,t,r)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0});var i=r(3317),a=r(6926);t.seedWordsList=a.seedWordsList;var o=r(9664);t.ChaidId=o.ChaidId;var s=r(5448);t.Seed=s.Seed;var u=r(3052);t.isPrivateKey=u.isPrivateKey,t.isPublicKey=u.isPublicKey;var l=r(3317);t.crypto=l.crypto,function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(5909)),t.signBytes=(n=i.crypto({output:"Base58"})).signBytes,t.keyPair=n.keyPair,t.publicKey=n.publicKey,t.privateKey=n.privateKey,t.address=n.address,t.buildAddress=n.buildAddress,t.blake2b=n.blake2b,t.keccak=n.keccak,t.sha256=n.sha256,t.sharedKey=n.sharedKey,t.seedWithNonce=n.seedWithNonce,t.base64Encode=n.base64Encode,t.base64Decode=n.base64Decode,t.base58Encode=n.base58Encode,t.base58Decode=n.base58Decode,t.base16Encode=n.base16Encode,t.base16Decode=n.base16Decode,t.stringToBytes=n.stringToBytes,t.bytesToString=n.bytesToString,t.random=n.random,t.randomSeed=n.randomSeed,t.randomBytes=n.randomBytes,t.verifySignature=n.verifySignature,t.verifyPublicKey=n.verifyPublicKey,t.verifyAddress=n.verifyAddress,t.messageDecrypt=n.messageDecrypt,t.messageEncrypt=n.messageEncrypt,t.aesDecrypt=n.aesDecrypt,t.aesEncrypt=n.aesEncrypt,t.encryptSeed=n.encryptSeed,t.decryptSeed=n.decryptSeed,t.rsaKeyPair=n.rsaKeyPair,t.rsaKeyPairSync=n.rsaKeyPairSync,t.rsaSign=n.rsaSign,t.rsaVerify=n.rsaVerify,t.merkleVerify=n.merkleVerify,t.split=n.split,t.concat=n.concat},9716:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.utf8ArrayToStr=function(){var e=new Array(128),t=String.fromCodePoint||String.fromCharCode,r=[];return function(n){var i,a,o=n.length;r.length=0;for(var s=0;s>6,128|63&n):n<55296||n>=57344?t.push(224|n>>12,128|n>>6&63,128|63&n):(r++,n=65536+((1023&n)<<10|1023&e.charCodeAt(r)),t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return Uint8Array.from(t)}},2333:(e,t)=>{"use strict";t.__esModule=!0;var r=Object.create(null),n=function(e){var t,r=new Float64Array(16);if(e)for(t=0;t>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r,e[t+4]=n>>24&255,e[t+5]=n>>16&255,e[t+6]=n>>8&255,e[t+7]=255&n}function p(e,t,r,n){return function(e,t,r,n,i){var a,o=0;for(a=0;a>>8)-1}(e,t,r,n,32)}function g(e,t){for(var r=0;r<16;r++)e[r]=0|t[r]}function y(e){var t,r,n=1;for(t=0;t<16;t++)r=e[t]+n+65535,n=Math.floor(r/65536),e[t]=r-65536*n;e[0]+=n-1+37*(n-1)}function m(e,t,r){for(var n,i=~(r-1),a=0;a<16;a++)n=i&(e[a]^t[a]),e[a]^=n,t[a]^=n}function v(e,t){var r,i,a,o=n(),s=n();for(r=0;r<16;r++)s[r]=t[r];for(y(s),y(s),y(s),i=0;i<2;i++){for(o[0]=s[0]-65517,r=1;r<15;r++)o[r]=s[r]-65535-(o[r-1]>>16&1),o[r-1]&=65535;o[15]=s[15]-32767-(o[14]>>16&1),a=o[15]>>16&1,o[14]&=65535,m(s,o,1-a)}for(r=0;r<16;r++)e[2*r]=255&s[r],e[2*r+1]=s[r]>>8}function b(e,t){var r=new Uint8Array(32),n=new Uint8Array(32);return v(r,e),v(n,t),p(r,0,n,0)}function S(e){var t=new Uint8Array(32);return v(t,e),1&t[0]}function w(e,t){for(var r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function E(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]+r[n]}function A(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]-r[n]}function T(e,t,r){var n,i,a=0,o=0,s=0,u=0,l=0,c=0,f=0,h=0,d=0,p=0,g=0,y=0,m=0,v=0,b=0,S=0,w=0,E=0,A=0,T=0,C=0,I=0,k=0,B=0,_=0,P=0,O=0,N=0,R=0,M=0,L=0,D=r[0],F=r[1],x=r[2],U=r[3],j=r[4],V=r[5],K=r[6],J=r[7],H=r[8],G=r[9],z=r[10],X=r[11],q=r[12],Y=r[13],Q=r[14],Z=r[15];a+=(n=t[0])*D,o+=n*F,s+=n*x,u+=n*U,l+=n*j,c+=n*V,f+=n*K,h+=n*J,d+=n*H,p+=n*G,g+=n*z,y+=n*X,m+=n*q,v+=n*Y,b+=n*Q,S+=n*Z,o+=(n=t[1])*D,s+=n*F,u+=n*x,l+=n*U,c+=n*j,f+=n*V,h+=n*K,d+=n*J,p+=n*H,g+=n*G,y+=n*z,m+=n*X,v+=n*q,b+=n*Y,S+=n*Q,w+=n*Z,s+=(n=t[2])*D,u+=n*F,l+=n*x,c+=n*U,f+=n*j,h+=n*V,d+=n*K,p+=n*J,g+=n*H,y+=n*G,m+=n*z,v+=n*X,b+=n*q,S+=n*Y,w+=n*Q,E+=n*Z,u+=(n=t[3])*D,l+=n*F,c+=n*x,f+=n*U,h+=n*j,d+=n*V,p+=n*K,g+=n*J,y+=n*H,m+=n*G,v+=n*z,b+=n*X,S+=n*q,w+=n*Y,E+=n*Q,A+=n*Z,l+=(n=t[4])*D,c+=n*F,f+=n*x,h+=n*U,d+=n*j,p+=n*V,g+=n*K,y+=n*J,m+=n*H,v+=n*G,b+=n*z,S+=n*X,w+=n*q,E+=n*Y,A+=n*Q,T+=n*Z,c+=(n=t[5])*D,f+=n*F,h+=n*x,d+=n*U,p+=n*j,g+=n*V,y+=n*K,m+=n*J,v+=n*H,b+=n*G,S+=n*z,w+=n*X,E+=n*q,A+=n*Y,T+=n*Q,C+=n*Z,f+=(n=t[6])*D,h+=n*F,d+=n*x,p+=n*U,g+=n*j,y+=n*V,m+=n*K,v+=n*J,b+=n*H,S+=n*G,w+=n*z,E+=n*X,A+=n*q,T+=n*Y,C+=n*Q,I+=n*Z,h+=(n=t[7])*D,d+=n*F,p+=n*x,g+=n*U,y+=n*j,m+=n*V,v+=n*K,b+=n*J,S+=n*H,w+=n*G,E+=n*z,A+=n*X,T+=n*q,C+=n*Y,I+=n*Q,k+=n*Z,d+=(n=t[8])*D,p+=n*F,g+=n*x,y+=n*U,m+=n*j,v+=n*V,b+=n*K,S+=n*J,w+=n*H,E+=n*G,A+=n*z,T+=n*X,C+=n*q,I+=n*Y,k+=n*Q,B+=n*Z,p+=(n=t[9])*D,g+=n*F,y+=n*x,m+=n*U,v+=n*j,b+=n*V,S+=n*K,w+=n*J,E+=n*H,A+=n*G,T+=n*z,C+=n*X,I+=n*q,k+=n*Y,B+=n*Q,_+=n*Z,g+=(n=t[10])*D,y+=n*F,m+=n*x,v+=n*U,b+=n*j,S+=n*V,w+=n*K,E+=n*J,A+=n*H,T+=n*G,C+=n*z,I+=n*X,k+=n*q,B+=n*Y,_+=n*Q,P+=n*Z,y+=(n=t[11])*D,m+=n*F,v+=n*x,b+=n*U,S+=n*j,w+=n*V,E+=n*K,A+=n*J,T+=n*H,C+=n*G,I+=n*z,k+=n*X,B+=n*q,_+=n*Y,P+=n*Q,O+=n*Z,m+=(n=t[12])*D,v+=n*F,b+=n*x,S+=n*U,w+=n*j,E+=n*V,A+=n*K,T+=n*J,C+=n*H,I+=n*G,k+=n*z,B+=n*X,_+=n*q,P+=n*Y,O+=n*Q,N+=n*Z,v+=(n=t[13])*D,b+=n*F,S+=n*x,w+=n*U,E+=n*j,A+=n*V,T+=n*K,C+=n*J,I+=n*H,k+=n*G,B+=n*z,_+=n*X,P+=n*q,O+=n*Y,N+=n*Q,R+=n*Z,b+=(n=t[14])*D,S+=n*F,w+=n*x,E+=n*U,A+=n*j,T+=n*V,C+=n*K,I+=n*J,k+=n*H,B+=n*G,_+=n*z,P+=n*X,O+=n*q,N+=n*Y,R+=n*Q,M+=n*Z,S+=(n=t[15])*D,o+=38*(E+=n*x),s+=38*(A+=n*U),u+=38*(T+=n*j),l+=38*(C+=n*V),c+=38*(I+=n*K),f+=38*(k+=n*J),h+=38*(B+=n*H),d+=38*(_+=n*G),p+=38*(P+=n*z),g+=38*(O+=n*X),y+=38*(N+=n*q),m+=38*(R+=n*Y),v+=38*(M+=n*Q),b+=38*(L+=n*Z),a=(n=(a+=38*(w+=n*F))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),S=(n=S+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=(a+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),o=(n=o+i+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),S=(n=S+i+65535)-65536*(i=Math.floor(n/65536)),a+=i-1+37*(i-1),e[0]=a,e[1]=o,e[2]=s,e[3]=u,e[4]=l,e[5]=c,e[6]=f,e[7]=h,e[8]=d,e[9]=p,e[10]=g,e[11]=y,e[12]=m,e[13]=v,e[14]=b,e[15]=S}function C(e,t){T(e,t,t)}function I(e,t){var r,i=n();for(r=0;r<16;r++)i[r]=t[r];for(r=253;r>=0;r--)C(i,i),2!==r&&4!==r&&T(i,i,t);for(r=0;r<16;r++)e[r]=i[r]}function k(e,t,r){var i,a,o=new Uint8Array(32),u=new Float64Array(80),l=n(),c=n(),f=n(),h=n(),d=n(),p=n();for(a=0;a<31;a++)o[a]=t[a];for(o[31]=127&t[31]|64,o[0]&=248,w(u,r),a=0;a<16;a++)c[a]=u[a],h[a]=l[a]=f[a]=0;for(l[0]=h[0]=1,a=254;a>=0;--a)m(l,c,i=o[a>>>3]>>>(7&a)&1),m(f,h,i),E(d,l,f),A(l,l,f),E(f,c,h),A(c,c,h),C(h,d),C(p,l),T(l,f,l),T(f,c,d),E(d,l,f),A(l,l,f),C(c,l),A(f,h,p),T(l,f,s),E(l,l,h),T(f,f,l),T(l,h,p),T(h,c,u),C(c,d),m(l,c,i),m(f,h,i);for(a=0;a<16;a++)u[a+16]=l[a],u[a+32]=f[a],u[a+48]=c[a],u[a+64]=h[a];var g=u.subarray(32),y=u.subarray(16);return I(g,g),T(y,y,g),v(e,y),0}var B=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function _(e,t,r,n){for(var i,a,o,s,u,l,c,f,h,d,p,g,y,m,v,b,S,w,E,A,T,C,I,k,_,P,O=new Int32Array(16),N=new Int32Array(16),R=e[0],M=e[1],L=e[2],D=e[3],F=e[4],x=e[5],U=e[6],j=e[7],V=t[0],K=t[1],J=t[2],H=t[3],G=t[4],z=t[5],X=t[6],q=t[7],Y=0;n>=128;){for(E=0;E<16;E++)A=8*E+Y,O[E]=r[A+0]<<24|r[A+1]<<16|r[A+2]<<8|r[A+3],N[E]=r[A+4]<<24|r[A+5]<<16|r[A+6]<<8|r[A+7];for(E=0;E<80;E++)if(i=R,a=M,o=L,s=D,u=F,l=x,c=U,j,h=V,d=K,p=J,g=H,y=G,m=z,v=X,q,I=65535&(C=q),k=C>>>16,_=65535&(T=j),P=T>>>16,I+=65535&(C=(G>>>14|F<<18)^(G>>>18|F<<14)^(F>>>9|G<<23)),k+=C>>>16,_+=65535&(T=(F>>>14|G<<18)^(F>>>18|G<<14)^(G>>>9|F<<23)),P+=T>>>16,I+=65535&(C=G&z^~G&X),k+=C>>>16,_+=65535&(T=F&x^~F&U),P+=T>>>16,T=B[2*E],I+=65535&(C=B[2*E+1]),k+=C>>>16,_+=65535&T,P+=T>>>16,T=O[E%16],k+=(C=N[E%16])>>>16,_+=65535&T,P+=T>>>16,_+=(k+=(I+=65535&C)>>>16)>>>16,I=65535&(C=w=65535&I|k<<16),k=C>>>16,_=65535&(T=S=65535&_|(P+=_>>>16)<<16),P=T>>>16,I+=65535&(C=(V>>>28|R<<4)^(R>>>2|V<<30)^(R>>>7|V<<25)),k+=C>>>16,_+=65535&(T=(R>>>28|V<<4)^(V>>>2|R<<30)^(V>>>7|R<<25)),P+=T>>>16,k+=(C=V&K^V&J^K&J)>>>16,_+=65535&(T=R&M^R&L^M&L),P+=T>>>16,f=65535&(_+=(k+=(I+=65535&C)>>>16)>>>16)|(P+=_>>>16)<<16,b=65535&I|k<<16,I=65535&(C=g),k=C>>>16,_=65535&(T=s),P=T>>>16,k+=(C=w)>>>16,_+=65535&(T=S),P+=T>>>16,M=i,L=a,D=o,F=s=65535&(_+=(k+=(I+=65535&C)>>>16)>>>16)|(P+=_>>>16)<<16,x=u,U=l,j=c,R=f,K=h,J=d,H=p,G=g=65535&I|k<<16,z=y,X=m,q=v,V=b,E%16===15)for(A=0;A<16;A++)T=O[A],I=65535&(C=N[A]),k=C>>>16,_=65535&T,P=T>>>16,T=O[(A+9)%16],I+=65535&(C=N[(A+9)%16]),k+=C>>>16,_+=65535&T,P+=T>>>16,S=O[(A+1)%16],I+=65535&(C=((w=N[(A+1)%16])>>>1|S<<31)^(w>>>8|S<<24)^(w>>>7|S<<25)),k+=C>>>16,_+=65535&(T=(S>>>1|w<<31)^(S>>>8|w<<24)^S>>>7),P+=T>>>16,S=O[(A+14)%16],k+=(C=((w=N[(A+14)%16])>>>19|S<<13)^(S>>>29|w<<3)^(w>>>6|S<<26))>>>16,_+=65535&(T=(S>>>19|w<<13)^(w>>>29|S<<3)^S>>>6),P+=T>>>16,P+=(_+=(k+=(I+=65535&C)>>>16)>>>16)>>>16,O[A]=65535&_|P<<16,N[A]=65535&I|k<<16;I=65535&(C=V),k=C>>>16,_=65535&(T=R),P=T>>>16,T=e[0],k+=(C=t[0])>>>16,_+=65535&T,P+=T>>>16,P+=(_+=(k+=(I+=65535&C)>>>16)>>>16)>>>16,e[0]=R=65535&_|P<<16,t[0]=V=65535&I|k<<16,I=65535&(C=K),k=C>>>16,_=65535&(T=M),P=T>>>16,T=e[1],k+=(C=t[1])>>>16,_+=65535&T,P+=T>>>16,P+=(_+=(k+=(I+=65535&C)>>>16)>>>16)>>>16,e[1]=M=65535&_|P<<16,t[1]=K=65535&I|k<<16,I=65535&(C=J),k=C>>>16,_=65535&(T=L),P=T>>>16,T=e[2],k+=(C=t[2])>>>16,_+=65535&T,P+=T>>>16,P+=(_+=(k+=(I+=65535&C)>>>16)>>>16)>>>16,e[2]=L=65535&_|P<<16,t[2]=J=65535&I|k<<16,I=65535&(C=H),k=C>>>16,_=65535&(T=D),P=T>>>16,T=e[3],k+=(C=t[3])>>>16,_+=65535&T,P+=T>>>16,P+=(_+=(k+=(I+=65535&C)>>>16)>>>16)>>>16,e[3]=D=65535&_|P<<16,t[3]=H=65535&I|k<<16,I=65535&(C=G),k=C>>>16,_=65535&(T=F),P=T>>>16,T=e[4],k+=(C=t[4])>>>16,_+=65535&T,P+=T>>>16,P+=(_+=(k+=(I+=65535&C)>>>16)>>>16)>>>16,e[4]=F=65535&_|P<<16,t[4]=G=65535&I|k<<16,I=65535&(C=z),k=C>>>16,_=65535&(T=x),P=T>>>16,T=e[5],k+=(C=t[5])>>>16,_+=65535&T,P+=T>>>16,P+=(_+=(k+=(I+=65535&C)>>>16)>>>16)>>>16,e[5]=x=65535&_|P<<16,t[5]=z=65535&I|k<<16,I=65535&(C=X),k=C>>>16,_=65535&(T=U),P=T>>>16,T=e[6],k+=(C=t[6])>>>16,_+=65535&T,P+=T>>>16,P+=(_+=(k+=(I+=65535&C)>>>16)>>>16)>>>16,e[6]=U=65535&_|P<<16,t[6]=X=65535&I|k<<16,I=65535&(C=q),k=C>>>16,_=65535&(T=j),P=T>>>16,T=e[7],k+=(C=t[7])>>>16,_+=65535&T,P+=T>>>16,P+=(_+=(k+=(I+=65535&C)>>>16)>>>16)>>>16,e[7]=j=65535&_|P<<16,t[7]=q=65535&I|k<<16,Y+=128,n-=128}return n}function P(e,t,r){var n,i=new Int32Array(8),a=new Int32Array(8),o=new Uint8Array(256),s=r;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,a[0]=4089235720,a[1]=2227873595,a[2]=4271175723,a[3]=1595750129,a[4]=2917565137,a[5]=725511199,a[6]=4215389547,a[7]=327033209,_(i,a,t,r),r%=128,n=0;n=0;--i)N(e,t,n=r[i/8|0]>>(7&i)&1),O(t,e),O(e,e),N(e,t,n)}function L(e,t){var r=[n(),n(),n(),n()];g(r[0],c),g(r[1],f),g(r[2],o),T(r[3],c,f),M(e,r,t)}var D=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function F(e,t){var r,n,i,a;for(n=63;n>=32;--n){for(r=0,i=n-32,a=n-12;i>8,t[i]-=256*r;t[i]+=r,t[n]=0}for(r=0,i=0;i<32;i++)t[i]+=r-(t[31]>>4)*D[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=r*D[i];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function x(e){var t,r=new Float64Array(64);for(t=0;t<64;t++)r[t]=e[t];for(t=0;t<64;t++)e[t]=0;F(e,r)}function U(e,t,r,i,a){for(var o=new Uint8Array(64),s=[n(),n(),n(),n()],u=0;u<32;u++)o[u]=i[u];o[0]&=248,o[31]&=127,o[31]|=64,L(s,o),R(o.subarray(32),s);var l,c=128&o[63];return l=a?function(e,t,r,i,a){new Uint8Array(64);var o,s,u=new Uint8Array(64),l=new Uint8Array(64),c=new Float64Array(64),f=[n(),n(),n(),n()];for(e[0]=254,o=1;o<32;o++)e[o]=255;for(o=0;o<32;o++)e[32+o]=i[o];for(o=0;o=0;r--)C(i,i),1!==r&&T(i,i,t);for(r=0;r<16;r++)e[r]=i[r]}(r,r),T(r,r,s),T(r,r,l),T(r,r,l),T(e[0],r,l),C(i,e[0]),T(i,i,l),b(i,s)&&T(e[0],e[0],h),C(i,e[0]),T(i,i,l),b(i,s)?-1:(S(e[0])===t[31]>>7&&A(e[0],a,e[0]),T(e[3],e[0],e[1]),0)}function V(e,t,r,i){var a=function(e){var t=new Uint8Array(32),r=n(),i=n(),a=n();return w(r,e),E(i,r,o),A(a,r,o),I(i,i),T(i,i,a),v(t,i),t}(i);return a[31]|=128&t[63],t[63]&=127,function(e,t,r,i){var a,o=new Uint8Array(32),s=new Uint8Array(64),u=[n(),n(),n(),n()],l=[n(),n(),n(),n()];if(r<64)return-1;if(j(l,i))return-1;for(a=0;a=0},r.generateKeyPair=function(e){if(K(e),32!==e.length)throw new Error("wrong seed length");for(var t=new Uint8Array(32),r=new Uint8Array(32),n=0;n<32;n++)t[n]=e[n];return k(r,t,i),t[0]&=248,t[31]&=127,t[31]|=64,r[31]&=127,{public:r,private:t}},t.default=r},6463:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",n=r.split("").reduce((function(e,t,r){return e[t]=r,e}),{});t.default={encode:function(e){if(!e.length)return"";for(var t=[0],n=0;n>8,t[a]&=255;for(;o;)t.push(255&o),o>>=8}for(r=0;"1"===e[r]&&r{"use strict";t.__esModule=!0;var r="Input must be an string, Buffer or Uint8Array";function n(e,t,r){var n=e[t]+e[r],i=e[t+1]+e[r+1];n>=4294967296&&i++,e[t]=n,e[t+1]=i}function i(e,t,r,n){var i=e[t]+r;r<0&&(i+=4294967296);var a=e[t+1]+n;i>=4294967296&&a++,e[t]=i,e[t+1]=a}function a(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function o(e,t,r,a,o,s){var u=c[o],f=c[o+1],h=c[s],d=c[s+1];n(l,e,t),i(l,e,u,f);var p=l[a]^l[e],g=l[a+1]^l[e+1];l[a]=g,l[a+1]=p,n(l,r,a),p=l[t]^l[r],g=l[t+1]^l[r+1],l[t]=p>>>24^g<<8,l[t+1]=g>>>24^p<<8,n(l,e,t),i(l,e,h,d),p=l[a]^l[e],g=l[a+1]^l[e+1],l[a]=p>>>16^g<<16,l[a+1]=g>>>16^p<<16,n(l,r,a),p=l[t]^l[r],g=l[t+1]^l[r+1],l[t]=g>>>31^p<<1,l[t+1]=p>>>31^g<<1}var s=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),u=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map((function(e){return 2*e}))),l=new Uint32Array(32),c=new Uint32Array(32);function f(e,t){var r=0;for(r=0;r<16;r++)l[r]=e.h[r],l[r+16]=s[r];for(l[24]=l[24]^e.t,l[25]=l[25]^e.t/4294967296,t&&(l[28]=~l[28],l[29]=~l[29]),r=0;r<32;r++)c[r]=a(e.b,4*r);for(r=0;r<12;r++)o(0,8,16,24,u[16*r+0],u[16*r+1]),o(2,10,18,26,u[16*r+2],u[16*r+3]),o(4,12,20,28,u[16*r+4],u[16*r+5]),o(6,14,22,30,u[16*r+6],u[16*r+7]),o(0,10,20,30,u[16*r+8],u[16*r+9]),o(2,12,22,24,u[16*r+10],u[16*r+11]),o(4,14,16,26,u[16*r+12],u[16*r+13]),o(6,8,18,28,u[16*r+14],u[16*r+15]);for(r=0;r<16;r++)e.h[r]=e.h[r]^l[r]^l[r+16]}function h(e,t){if(0===e||e>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(t&&t.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");for(var r={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:e},n=0;n<16;n++)r.h[n]=s[n];var i=t?t.length:0;return r.h[0]^=16842752^i<<8^e,t&&(d(r,t),r.c=128),r}function d(e,t){for(var r=0;r>2]>>8*(3&r);return t}function g(e,t,n){n=n||64,e=function(e){var t;if(e instanceof Uint8Array)t=e;else if(e instanceof Buffer)t=new Uint8Array(e);else{if("string"!==typeof e)throw new Error(r);t=new Uint8Array(Buffer.from(e,"utf8"))}return t}(e);var i=h(n,t);return d(i,e),p(i)}t.blake2bInit=h,t.blake2bUpdate=d,t.blake2bFinal=p,t.blake2b=g,t.blake2bHex=function(e,t,r){var n,i=g(e,t,r);return n=i,Array.prototype.map.call(n,(function(e){return(e<16?"0":"")+e.toString(16)})).join("")}},5780:(e,t)=>{"use strict";t.__esModule=!0;for(var r="0123456789abcdef".split(""),n=[0,8,16,24],i=[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],a=[224,256,384,512],o=["hex","buffer","arrayBuffer","array"],s=function(e,t,r){return function(n){return new v(e,t,e).update(n)[r]()}},u=function(e,t,r){return function(n,i){return new v(e,t,i).update(n)[r]()}},l=function(e,t){var r=s(e,t,"hex");r.create=function(){return new v(e,t,e)},r.update=function(e){return r.create().update(e)};for(var n=0;n>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}v.prototype.update=function(e){var t="string"!==typeof e;t&&e.constructor===ArrayBuffer&&(e=new Uint8Array(e));for(var r,i,a=e.length,o=this.blocks,s=this.byteCount,u=this.blockCount,l=0,c=this.s;l>2]|=e[l]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(o[r>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=s){for(this.start=r-s,this.block=o[u],r=0;r>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>4&15]+r[15&e]+r[e>>12&15]+r[e>>8&15]+r[e>>20&15]+r[e>>16&15]+r[e>>28&15]+r[e>>24&15];s%t===0&&(b(n),o=0)}return a&&(e=n[o],a>0&&(u+=r[e>>4&15]+r[15&e]),a>1&&(u+=r[e>>12&15]+r[e>>8&15]),a>2&&(u+=r[e>>20&15]+r[e>>16&15])),u},v.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,a=0,o=0,s=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(e);o>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;s%r===0&&b(n)}return a&&(e=s<<2,t=n[o],a>0&&(u[e]=255&t),a>1&&(u[e+1]=t>>8&255),a>2&&(u[e+2]=t>>16&255)),u};var b=function(e){var t,r,n,a,o,s,u,l,c,f,h,d,p,g,y,m,v,b,S,w,E,A,T,C,I,k,B,_,P,O,N,R,M,L,D,F,x,U,j,V,K,J,H,G,z,X,q,Y,Q,Z,W,$,ee,te,re,ne,ie,ae,oe,se,ue,le,ce;for(n=0;n<48;n+=2)a=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],u=e[3]^e[13]^e[23]^e[33]^e[43],l=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],f=e[6]^e[16]^e[26]^e[36]^e[46],h=e[7]^e[17]^e[27]^e[37]^e[47],t=(d=e[8]^e[18]^e[28]^e[38]^e[48])^(s<<1|u>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(u<<1|s>>>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=a^(l<<1|c>>>31),r=o^(c<<1|l>>>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=s^(f<<1|h>>>31),r=u^(h<<1|f>>>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=l^(d<<1|p>>>31),r=c^(p<<1|d>>>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=f^(a<<1|o>>>31),r=h^(o<<1|a>>>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,g=e[0],y=e[1],X=e[11]<<4|e[10]>>>28,q=e[10]<<4|e[11]>>>28,_=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,J=e[40]<<18|e[41]>>>14,H=e[41]<<18|e[40]>>>14,L=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,m=e[13]<<12|e[12]>>>20,v=e[12]<<12|e[13]>>>20,Y=e[22]<<10|e[23]>>>22,Q=e[23]<<10|e[22]>>>22,O=e[33]<<13|e[32]>>>19,N=e[32]<<13|e[33]>>>19,le=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,F=e[14]<<6|e[15]>>>26,x=e[15]<<6|e[14]>>>26,b=e[25]<<11|e[24]>>>21,S=e[24]<<11|e[25]>>>21,Z=e[34]<<15|e[35]>>>17,W=e[35]<<15|e[34]>>>17,R=e[45]<<29|e[44]>>>3,M=e[44]<<29|e[45]>>>3,C=e[6]<<28|e[7]>>>4,I=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,U=e[26]<<25|e[27]>>>7,j=e[27]<<25|e[26]>>>7,w=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,G=e[8]<<27|e[9]>>>5,z=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,B=e[19]<<20|e[18]>>>12,ae=e[29]<<7|e[28]>>>25,oe=e[28]<<7|e[29]>>>25,V=e[38]<<8|e[39]>>>24,K=e[39]<<8|e[38]>>>24,A=e[48]<<14|e[49]>>>18,T=e[49]<<14|e[48]>>>18,e[0]=g^~m&b,e[1]=y^~v&S,e[10]=C^~k&_,e[11]=I^~B&P,e[20]=L^~F&U,e[21]=D^~x&j,e[30]=G^~X&Y,e[31]=z^~q&Q,e[40]=te^~ne&ae,e[41]=re^~ie&oe,e[2]=m^~b&w,e[3]=v^~S&E,e[12]=k^~_&O,e[13]=B^~P&N,e[22]=F^~U&V,e[23]=x^~j&K,e[32]=X^~Y&Z,e[33]=q^~Q&W,e[42]=ne^~ae&se,e[43]=ie^~oe&ue,e[4]=b^~w&A,e[5]=S^~E&T,e[14]=_^~O&R,e[15]=P^~N&M,e[24]=U^~V&J,e[25]=j^~K&H,e[34]=Y^~Z&$,e[35]=Q^~W&ee,e[44]=ae^~se&le,e[45]=oe^~ue&ce,e[6]=w^~A&g,e[7]=E^~T&y,e[16]=O^~R&C,e[17]=N^~M&I,e[26]=V^~J&L,e[27]=K^~H&D,e[36]=Z^~$&G,e[37]=W^~ee&z,e[46]=se^~le&te,e[47]=ue^~ce&re,e[8]=A^~g&m,e[9]=T^~y&v,e[18]=R^~C&k,e[19]=M^~I&B,e[28]=J^~L&F,e[29]=H^~D&x,e[38]=$^~G&X,e[39]=ee^~z&q,e[48]=le^~te&ne,e[49]=ce^~re&ie,e[0]^=i[n],e[1]^=i[n+1]};t.keccak256=f.keccak_256},2082:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.DATA_FIELD_TYPE=t.TRANSACTION_TYPE=t.BINARY_DATA_TYPE=t.STRING_DATA_TYPE=t.BOOLEAN_DATA_TYPE=t.INTEGER_DATA_TYPE=t.ETHEREUM=t.UPDATE_ASSET_INFO_TYPE=t.INVOKE_SCRIPT_TYPE=t.SET_ASSET_SCRIPT_TYPE=t.SPONSORSHIP_TYPE=t.SET_SCRIPT_TYPE=t.DATA_TYPE=t.MASS_TRANSFER_TYPE=t.ALIAS_TYPE=t.CANCEL_LEASE_TYPE=t.LEASE_TYPE=t.EXCHANGE_TYPE=t.BURN_TYPE=t.REISSUE_TYPE=t.TRANSFER_TYPE=t.ISSUE_TYPE=t.PAYMENT_TYPE=t.GENESIS_TYPE=void 0,i(r(7521),t),i(r(9252),t),t.GENESIS_TYPE=1,t.PAYMENT_TYPE=2,t.ISSUE_TYPE=3,t.TRANSFER_TYPE=4,t.REISSUE_TYPE=5,t.BURN_TYPE=6,t.EXCHANGE_TYPE=7,t.LEASE_TYPE=8,t.CANCEL_LEASE_TYPE=9,t.ALIAS_TYPE=10,t.MASS_TRANSFER_TYPE=11,t.DATA_TYPE=12,t.SET_SCRIPT_TYPE=13,t.SPONSORSHIP_TYPE=14,t.SET_ASSET_SCRIPT_TYPE=15,t.INVOKE_SCRIPT_TYPE=16,t.UPDATE_ASSET_INFO_TYPE=17,t.ETHEREUM=18,t.INTEGER_DATA_TYPE="integer",t.BOOLEAN_DATA_TYPE="boolean",t.STRING_DATA_TYPE="string",t.BINARY_DATA_TYPE="binary",t.TRANSACTION_TYPE={GENESIS:t.GENESIS_TYPE,PAYMENT:t.PAYMENT_TYPE,ISSUE:t.ISSUE_TYPE,TRANSFER:t.TRANSFER_TYPE,REISSUE:t.REISSUE_TYPE,BURN:t.BURN_TYPE,EXCHANGE:t.EXCHANGE_TYPE,LEASE:t.LEASE_TYPE,CANCEL_LEASE:t.CANCEL_LEASE_TYPE,ALIAS:t.ALIAS_TYPE,MASS_TRANSFER:t.MASS_TRANSFER_TYPE,DATA:t.DATA_TYPE,SET_SCRIPT:t.SET_SCRIPT_TYPE,SPONSORSHIP:t.SPONSORSHIP_TYPE,SET_ASSET_SCRIPT:t.SET_ASSET_SCRIPT_TYPE,INVOKE_SCRIPT:t.INVOKE_SCRIPT_TYPE,UPDATE_ASSET_INFO:t.UPDATE_ASSET_INFO_TYPE,ETHEREUM:t.ETHEREUM},t.DATA_FIELD_TYPE={INTEGER:t.INTEGER_DATA_TYPE,BOOLEAN:t.BOOLEAN_DATA_TYPE,STRING:t.STRING_DATA_TYPE,BINARY:t.BINARY_DATA_TYPE}},9252:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},7521:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});r(2082)},1156:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){};t.Adapter=r},5600:function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),i=this&&this.__assign||function(){return i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7784);!function(e){e[e.Event=0]="Event",e[e.Action=1]="Action",e[e.Response=2]="Response"}(t.EventType||(t.EventType={})),function(e){e[e.Success=0]="Success",e[e.Error=1]="Error"}(t.ResponseStatus||(t.ResponseStatus={}));var i=function(){function e(e,t){var r=this;this.id=n.uniqueId("bus"),this._timeout=t||5e3,this._adapter=e,this._adapter.addListener((function(e){return r._onMessage(e)})),this._eventHandlers=Object.create(null),this._activeRequestHash=Object.create(null),this._requestHandlers=Object.create(null),n.console.info('Create Bus with id "'+this.id+'"')}return e.prototype.dispatchEvent=function(t,r){return this._adapter.send(e._createEvent(t,r)),n.console.info('Dispatch event "'+t+'"',r),this},e.prototype.request=function(e,t,r){var i=this;return new Promise((function(a,o){var s,u=n.uniqueId(i.id+"-action"),l=r||i._timeout;-1!==(r||i._timeout)&&(s=setTimeout((function(){delete i._activeRequestHash[u];var t=new Error('Timeout error for request with name "'+e+'" and timeout '+l+"!");n.console.error(t),o(t)}),l));var c=function(){s&&clearTimeout(s)};i._activeRequestHash[u]={reject:function(t){c(),n.console.error('Error request with name "'+e+'"',t),o(t)},resolve:function(t){c(),n.console.info('Request with name "'+e+'" success resolved!',t),a(t)}},i._adapter.send({id:u,type:1,name:e,data:t}),n.console.info('Request with name "'+e+'"',t)}))},e.prototype.on=function(e,t,r){return this._addEventHandler(e,t,r,!1)},e.prototype.once=function(e,t,r){return this._addEventHandler(e,t,r,!0)},e.prototype.off=function(e,t){var r=this;return e?this._eventHandlers[e]?t?(this._eventHandlers[e]=this._eventHandlers[e].filter((function(e){return e.handler!==t})),this._eventHandlers[e].length||delete this._eventHandlers[e],this):(this._eventHandlers[e].slice().forEach((function(t){r.off(e,t.handler)})),this):this:(Object.keys(this._eventHandlers).forEach((function(e){return r.off(e,t)})),this)},e.prototype.registerRequestHandler=function(e,t){if(this._requestHandlers[e])throw new Error("Duplicate request handler!");return this._requestHandlers[e]=t,this},e.prototype.unregisterHandler=function(e){return this._requestHandlers[e]&&delete this._requestHandlers[e],this},e.prototype.changeAdapter=function(t){var r=this,n=new e(t,this._timeout);return Object.keys(this._eventHandlers).forEach((function(e){r._eventHandlers[e].forEach((function(t){t.once?n.once(e,t.handler,t.context):n.on(e,t.handler,t.context)}))})),Object.keys(this._requestHandlers).forEach((function(e){n.registerRequestHandler(e,r._requestHandlers[e])})),n},e.prototype.destroy=function(){n.console.info("Destroy Bus"),this.off(),this._adapter.destroy()},e.prototype._addEventHandler=function(e,t,r,n){return this._eventHandlers[e]||(this._eventHandlers[e]=[]),this._eventHandlers[e].push({handler:t,once:n,context:r}),this},e.prototype._onMessage=function(e){switch(e.type){case 0:n.console.info('Has event with name "'+String(e.name)+'"',e.data),this._fireEvent(String(e.name),e.data);break;case 1:n.console.info('Start action with id "'+e.id+'" and name "'+String(e.name)+'"',e.data),this._createResponse(e);break;case 2:n.console.info('Start response with name "'+e.id+'" and status "'+e.status+'"',e.content),this._fireEndAction(e)}},e.prototype._createResponse=function(t){var r=this,i=function(e){n.console.error(e),r._adapter.send({id:t.id,type:2,status:1,content:String(e)})};if(this._requestHandlers[String(t.name)])try{var a=this._requestHandlers[String(t.name)](t.data);e._isPromise(a)?a.then((function(e){r._adapter.send({id:t.id,type:2,status:0,content:e})}),i):this._adapter.send({id:t.id,type:2,status:0,content:a})}catch(o){i(o)}else i(new Error('Has no handler for "'+String(t.name)+'" action!'))},e.prototype._fireEndAction=function(e){if(this._activeRequestHash[e.id]){switch(e.status){case 1:this._activeRequestHash[e.id].reject(e.content);break;case 0:this._activeRequestHash[e.id].resolve(e.content)}delete this._activeRequestHash[e.id]}},e.prototype._fireEvent=function(e,t){this._eventHandlers[e]&&(this._eventHandlers[e]=this._eventHandlers[e].slice().filter((function(e){try{e.handler.call(e.context,t)}catch(r){n.console.warn(r)}return!e.once})),this._eventHandlers[e].length||delete this._eventHandlers[e])},e._createEvent=function(e,t){return{type:0,name:e,data:t}},e._isPromise=function(e){return e&&e.then&&"function"===typeof e.then},e}();t.Bus=i},5269:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){!function(e){e.LOG_LEVEL={PRODUCTION:0,ERRORS:1,VERBOSE:2},e.logLevel=e.LOG_LEVEL.PRODUCTION,e.methodsData={log:{save:!1,logLevel:e.LOG_LEVEL.VERBOSE},info:{save:!1,logLevel:e.LOG_LEVEL.VERBOSE},warn:{save:!1,logLevel:e.LOG_LEVEL.VERBOSE},error:{save:!0,logLevel:e.LOG_LEVEL.ERRORS}}}(e.console||(e.console={}))}(t.config||(t.config={}))},9294:(e,t,r)=>{"use strict";function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),n(r(8641)),n(r(1156)),n(r(5600)),n(r(8102)),n(r(5269)),n(r(7784))},8102:function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(r,n){var i=e.call(this)||this;return i.win=r,i.type=n,i.handler=function(e){i.trigger("message",e)},n===t.PROTOCOL_TYPES.LISTEN&&i.win.addEventListener("message",i.handler,!1),i}return n(t,e),t.prototype.dispatch=function(e){return this.win.postMessage(e,"*"),this},t.prototype.destroy=function(){this.type===t.PROTOCOL_TYPES.LISTEN&&this.win.removeEventListener("message",this.handler,!1),this.win=t._fakeWin},t._fakeWin=function(){var e=function(){return null};return{postMessage:e,addEventListener:e,removeEventListener:e}}(),t}(r(778).EventEmitter);t.WindowProtocol=i,function(e){e.PROTOCOL_TYPES={LISTEN:"listen",DISPATCH:"dispatch"}}(i=t.WindowProtocol||(t.WindowProtocol={})),t.WindowProtocol=i},406:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e){this.size=0,this.hash=Object.create(null),e&&e.forEach(this.add,this)}return e.prototype.add=function(e){return this.hash[e]=!0,this.size=Object.keys(this.hash).length,this},e.prototype.has=function(e){return e in this.hash},e.prototype.toArray=function(){return Object.keys(this.hash)},e}();t.UniqPrimitiveCollection=r},478:function(e,t,r){"use strict";var n=this&&this.__assign||function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r{"use strict";function n(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}Object.defineProperty(t,"__esModule",{value:!0}),n(r(8506)),n(r(478)),n(r(406))},8506:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keys=function(e){return Object.keys(e)};var r=Math.floor(Date.now()*Math.random()),n=0;t.uniqueId=function(e){return e+"-"+r+"-"+n++},t.toArray=function(e){return Array.isArray(e)?e:[e]},t.pipe=function(){for(var e=[],t=0;t{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_VERSIONS=void 0,t.DEFAULT_VERSIONS={ISSUE:3,TRANSFER:3,REISSUE:3,BURN:3,EXCHANGE:3,LEASE:3,CANCEL_LEASE:3,ALIAS:3,MASS_TRANSFER:2,DATA:2,SET_SCRIPT:2,SPONSORSHIP:2,SET_ASSET_SCRIPT:2,INVOKE_SCRIPT:2,UPDATE_ASSET_INFO:1,INVOKE_EXPRESSION:1}},9096:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.cancelSubmittedOrder=t.submitOrder=t.verifyWavesAuthData=t.verifyAuthData=t.verifyCustomData=t.verify=t.serialize=t.signTx=t.txTypeMap=void 0;const i=r(6106),a=r(9846),o=n(r(6406)),s=n(r(1830)),u=r(6063),l=r(4713),c=r(5256),f=r(7852),h=r(42),d=r(8191),p=r(5198),g=r(2516),y=r(412),m=r(6210),v=r(637),b=r(8289),S=r(2919),w=r(1936),E=r(9e3),A=r(233),T=r(4397),C=r(9543),I=r(2082),k=r(7915);function B(e){return v.isOrder(e)?i.binary.serializeOrder(e):i.binary.serializeTx(e)}t.txTypeMap={[I.TRANSACTION_TYPE.ISSUE]:{sign:(e,t)=>u.issue(e,t)},[I.TRANSACTION_TYPE.TRANSFER]:{sign:(e,t)=>l.transfer(e,t)},[I.TRANSACTION_TYPE.REISSUE]:{sign:(e,t)=>c.reissue(e,t)},[I.TRANSACTION_TYPE.BURN]:{sign:(e,t)=>f.burn(e,t)},[I.TRANSACTION_TYPE.LEASE]:{sign:(e,t)=>h.lease(e,t)},[I.TRANSACTION_TYPE.CANCEL_LEASE]:{sign:(e,t)=>d.cancelLease(e,t)},[I.TRANSACTION_TYPE.ALIAS]:{sign:(e,t)=>y.alias(e,t)},[I.TRANSACTION_TYPE.MASS_TRANSFER]:{sign:(e,t)=>g.massTransfer(e,t)},[I.TRANSACTION_TYPE.DATA]:{sign:(e,t)=>p.data(e,t)},[I.TRANSACTION_TYPE.SET_SCRIPT]:{sign:(e,t)=>m.setScript(e,t)},[I.TRANSACTION_TYPE.SET_ASSET_SCRIPT]:{sign:(e,t)=>b.setAssetScript(e,t)},[I.TRANSACTION_TYPE.SPONSORSHIP]:{sign:(e,t)=>w.sponsorship(e,t)},[I.TRANSACTION_TYPE.EXCHANGE]:{sign:(e,t)=>S.exchange(e,t)},[I.TRANSACTION_TYPE.INVOKE_SCRIPT]:{sign:(e,t)=>E.invokeScript(e,t)},[I.TRANSACTION_TYPE.UPDATE_ASSET_INFO]:{sign:(e,t)=>k.updateAssetInfo(e,t)}},t.signTx=function(e,r){if(!t.txTypeMap[e.type])throw new Error("Unknown tx type: ".concat(e.type));return t.txTypeMap[e.type].sign(e,r)},t.serialize=B,t.verify=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2?arguments[2]:void 0;r=r||e.senderPublicKey;const n=B(e),i=null==e.version?e.signature:e.proofs[t];return a.verifySignature(r,n,i)},t.verifyCustomData=function(e){const t=A.serializeCustomData(e);return a.verifySignature(e.publicKey,t,e.signature)},t.verifyAuthData=function(e,t,r){r=r||"W";const n=T.serializeAuthData(t);return a.address({publicKey:e.publicKey},r)===e.address&&a.verifySignature(e.publicKey,n,e.signature)},t.verifyWavesAuthData=function(e,t,r){r=r||"W";const n=C.serializeWavesAuthData(t);return a.address({publicKey:e.publicKey},r)===e.address&&a.verifySignature(e.publicKey,n,e.signature)},t.submitOrder=function(e,t){let r,n;return"string"===typeof t?(n=t,r="matcher/orderbook"):(n=t.matcherUrl,r=t.market?"matcher/orderbook/market":"matcher/orderbook"),o.default({base:n,url:r,options:{method:"POST",body:s.default(e),headers:{"Content-Type":"application/json"}}})},t.cancelSubmittedOrder=function(e,t,r,n){const i="matcher/orderbook/".concat(t||"WAVES","/").concat(r||"WAVES","/cancel");return o.default({base:n,url:i,options:{method:"POST",body:s.default(e),headers:{"Content-Type":"application/json"}}})}},637:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.chainIdFromRecipient=t.normalizeAssetId=t.fee=t.networkByte=t.isOrder=t.convertToPairs=t.addProof=t.base64Prefix=t.getSenderPublicKey=t.mapObj=void 0;const n=r(9846);t.mapObj=(e,t)=>Object.entries(e).map((e=>{let[r,n]=e;return[r,t(n)]})).reduce(((e,t)=>{let[r,n]=t;return Object.assign(Object.assign({},e),{[r]:n})}),{}),t.getSenderPublicKey=function(e,t){if(0===e.length&&null==t.senderPublicKey)throw new Error("Please provide either seed or senderPublicKey");return null==t.senderPublicKey?n.publicKey(e[0][0]):t.senderPublicKey},t.base64Prefix=e=>null==e||"base64:"===e.slice(0,7)?e:"base64:"+e,t.addProof=function(e,t,r){if(null==r)return e.proofs=[...e.proofs,t],e;if(null!=e.proofs&&e.proofs[r])throw new Error("Proof at index ".concat(r," already exists."));for(let n=e.proofs.length;n[e,t])).filter((e=>{let[t,r]=e;return t})):Object.keys(e).map((e=>parseInt(e))).filter((e=>!isNaN(e))).sort().map((t=>[e[t],t]))},t.isOrder=e=>void 0!==e.assetPair,t.networkByte=function(e,t){switch(typeof e){case"string":return e.charCodeAt(0);case"number":return e;default:return t}},t.fee=function(e,t){return null!=e.fee?e.fee:e.additionalFee?t+e.additionalFee:t},t.normalizeAssetId=function(e){return"WAVES"===(e=e||null)?null:e},t.chainIdFromRecipient=function(e){if(e.startsWith("alias"))return e.charCodeAt(6);try{return n.base58Decode(e)[1]}catch(t){throw new Error("Invalid recipient: ".concat(e))}}},5496:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.protoSerialize=t.validators=t.nodeInteraction=t.seedUtils=t.libs=void 0;var o=r(2516);Object.defineProperty(t,"massTransfer",{enumerable:!0,get:function(){return o.massTransfer}});var s=r(5256);Object.defineProperty(t,"reissue",{enumerable:!0,get:function(){return s.reissue}});var u=r(7852);Object.defineProperty(t,"burn",{enumerable:!0,get:function(){return u.burn}});var l=r(2919);Object.defineProperty(t,"exchange",{enumerable:!0,get:function(){return l.exchange}});var c=r(42);Object.defineProperty(t,"lease",{enumerable:!0,get:function(){return c.lease}});var f=r(8191);Object.defineProperty(t,"cancelLease",{enumerable:!0,get:function(){return f.cancelLease}});var h=r(5198);Object.defineProperty(t,"data",{enumerable:!0,get:function(){return h.data}});var d=r(6063);Object.defineProperty(t,"issue",{enumerable:!0,get:function(){return d.issue}});var p=r(4713);Object.defineProperty(t,"transfer",{enumerable:!0,get:function(){return p.transfer}});var g=r(412);Object.defineProperty(t,"alias",{enumerable:!0,get:function(){return g.alias}});var y=r(6210);Object.defineProperty(t,"setScript",{enumerable:!0,get:function(){return y.setScript}});var m=r(8289);Object.defineProperty(t,"setAssetScript",{enumerable:!0,get:function(){return m.setAssetScript}});var v=r(1936);Object.defineProperty(t,"sponsorship",{enumerable:!0,get:function(){return v.sponsorship}});var b=r(4331);Object.defineProperty(t,"order",{enumerable:!0,get:function(){return b.order}});var S=r(8312);Object.defineProperty(t,"cancelOrder",{enumerable:!0,get:function(){return S.cancelOrder}});var w=r(233);Object.defineProperty(t,"customData",{enumerable:!0,get:function(){return w.customData}}),Object.defineProperty(t,"serializeCustomData",{enumerable:!0,get:function(){return w.serializeCustomData}});var E=r(4397);Object.defineProperty(t,"auth",{enumerable:!0,get:function(){return E.auth}});var A=r(9543);Object.defineProperty(t,"wavesAuth",{enumerable:!0,get:function(){return A.wavesAuth}});var T=r(9e3);Object.defineProperty(t,"invokeScript",{enumerable:!0,get:function(){return T.invokeScript}});var C=r(7915);Object.defineProperty(t,"updateAssetInfo",{enumerable:!0,get:function(){return C.updateAssetInfo}});var I=r(9096);Object.defineProperty(t,"signTx",{enumerable:!0,get:function(){return I.signTx}}),Object.defineProperty(t,"verify",{enumerable:!0,get:function(){return I.verify}}),Object.defineProperty(t,"serialize",{enumerable:!0,get:function(){return I.serialize}}),Object.defineProperty(t,"submitOrder",{enumerable:!0,get:function(){return I.submitOrder}}),Object.defineProperty(t,"cancelSubmittedOrder",{enumerable:!0,get:function(){return I.cancelSubmittedOrder}}),Object.defineProperty(t,"verifyAuthData",{enumerable:!0,get:function(){return I.verifyAuthData}}),Object.defineProperty(t,"verifyCustomData",{enumerable:!0,get:function(){return I.verifyCustomData}}),Object.defineProperty(t,"verifyWavesAuthData",{enumerable:!0,get:function(){return I.verifyWavesAuthData}});var k=r(6056);Object.defineProperty(t,"waitForTx",{enumerable:!0,get:function(){return k.waitForTx}}),Object.defineProperty(t,"broadcast",{enumerable:!0,get:function(){return k.broadcast}});var B=r(6973);Object.defineProperty(t,"makeTx",{enumerable:!0,get:function(){return B.makeTx}}),Object.defineProperty(t,"makeTxBytes",{enumerable:!0,get:function(){return B.makeTxBytes}});const _={crypto:a(r(9846)),marshall:a(r(6106))};t.libs=_;const P=a(r(3297));t.seedUtils=P;const O=a(r(6056));t.nodeInteraction=O;const N=a(r(6042));t.validators=N;const R=a(r(1909));t.protoSerialize=R},6973:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.makeTxBytes=t.makeTx=void 0;const n=r(6063),i=r(4713),a=r(5256),o=r(7852),s=r(42),u=r(8191),l=r(412),c=r(2516),f=r(5198),h=r(6210),d=r(8289),p=r(1936),g=r(2919),y=r(9e3),m=r(7915),v=r(1909),b=r(6106),S=r(2082);t.makeTx=function(e){switch(e.type){case S.TRANSACTION_TYPE.ISSUE:return n.issue(e);case S.TRANSACTION_TYPE.TRANSFER:return i.transfer(e);case S.TRANSACTION_TYPE.REISSUE:return a.reissue(e);case S.TRANSACTION_TYPE.BURN:return o.burn(e);case S.TRANSACTION_TYPE.LEASE:return s.lease(e);case S.TRANSACTION_TYPE.CANCEL_LEASE:return u.cancelLease(e);case S.TRANSACTION_TYPE.ALIAS:return l.alias(e);case S.TRANSACTION_TYPE.MASS_TRANSFER:return c.massTransfer(e);case S.TRANSACTION_TYPE.DATA:return f.data(e);case S.TRANSACTION_TYPE.SET_SCRIPT:return h.setScript(e);case S.TRANSACTION_TYPE.SET_ASSET_SCRIPT:return d.setAssetScript(e);case S.TRANSACTION_TYPE.SPONSORSHIP:return p.sponsorship(e);case S.TRANSACTION_TYPE.EXCHANGE:return g.exchange(e);case S.TRANSACTION_TYPE.INVOKE_SCRIPT:return y.invokeScript(e);case S.TRANSACTION_TYPE.UPDATE_ASSET_INFO:return m.updateAssetInfo(e);default:throw new Error("Unknown tx type: ".concat(e.type))}},t.makeTxBytes=function(e){switch(e.type){case S.TRANSACTION_TYPE.ISSUE:case S.TRANSACTION_TYPE.TRANSFER:case S.TRANSACTION_TYPE.REISSUE:case S.TRANSACTION_TYPE.BURN:case S.TRANSACTION_TYPE.LEASE:case S.TRANSACTION_TYPE.CANCEL_LEASE:case S.TRANSACTION_TYPE.ALIAS:return e.version>2?v.txToProtoBytes(e):b.binary.serializeTx(e);case S.TRANSACTION_TYPE.MASS_TRANSFER:case S.TRANSACTION_TYPE.DATA:case S.TRANSACTION_TYPE.SET_SCRIPT:case S.TRANSACTION_TYPE.SET_ASSET_SCRIPT:case S.TRANSACTION_TYPE.SPONSORSHIP:return e.version>1?v.txToProtoBytes(e):b.binary.serializeTx(e);case S.TRANSACTION_TYPE.EXCHANGE:return e.version>2?v.txToProtoBytes(e):b.binary.serializeTx(e);case S.TRANSACTION_TYPE.INVOKE_SCRIPT:return e.version>1?v.txToProtoBytes(e):b.binary.serializeTx(e);case S.TRANSACTION_TYPE.UPDATE_ASSET_INFO:return v.txToProtoBytes(e);default:throw new Error("Unknown tx type: ".concat(e.type))}}},6056:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},o=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(t){a(t)}}function s(e){try{u(n.throw(e))}catch(t){a(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(o,s)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.broadcast=t.stateChanges=t.rewards=t.scriptMeta=t.scriptInfo=t.accountDataByKey=t.accountData=t.assetBalance=t.balanceDetails=t.balance=t.transactionById=t.waitNBlocks=t.waitForTxWithNConfirmations=t.waitForTx=t.waitForHeight=t.currentHeight=void 0;const s=a(r(9265)),u=a(r(3338)),l=a(r(2812)),c=a(r(2929)),f=a(r(5964)),h=a(r(787)),d=e=>{const t={},r=new Promise(((r,n)=>{t.resolve=r,t.id=setTimeout(r,e)}));return r.cancel=()=>{t.resolve(),clearTimeout(t.id)},r},p=function(e,t){return d(arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3).then((r=>t?Promise.reject(new Error("Tx wait stopped: timeout")):e()))},g={timeout:12e4,apiBase:"https://nodes.wavesplatform.com"};function y(e,r){return o(this,void 0,void 0,(function*(){const{timeout:n,apiBase:i}=Object.assign(Object.assign({},g),r);let a=!1;const o=d(n);o.then((()=>a=!0));const s=()=>t.currentHeight(i).then((t=>t>=e?(o.cancel(),t):p(s,a,1e4))).catch((e=>p(s,a)));return s()}))}function m(e,t,r){return o(this,void 0,void 0,(function*(){const{timeout:n,apiBase:i}=Object.assign(Object.assign({},g),t);let a=!1;const o=d(n);o.then((()=>a=!0));const u=()=>s.fetchInfo(i,e,r).then((e=>(o.cancel(),e))).catch((e=>d(1e3).then((e=>a?Promise.reject(new Error("Tx wait stopped: timeout")):u()))));return u()}))}t.currentHeight=e=>o(void 0,void 0,void 0,(function*(){return u.fetchHeight(e).then((e=>{let{height:t}=e;return t}))})),t.waitForHeight=y,t.waitForTx=m;t.waitForTxWithNConfirmations=function(e,t,r,n){return o(this,void 0,void 0,(function*(){const{timeout:i}=Object.assign(Object.assign({},g),r);let a=!1;d(i).then((()=>a=!0));let o=yield m(e,r,n),s=o.height,u=o.height;for(;s+t>u;){if(a)throw new Error("Tx wait stopped: timeout");yield y(s+t,r),o=yield m(e,r,n),s=o.height}return o}))},t.waitNBlocks=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:g;return o(this,void 0,void 0,(function*(){const{apiBase:n}=Object.assign(Object.assign({},g),r),i=(yield t.currentHeight(n))+e;return yield y(i,r)}))},t.transactionById=function(e,t,r){return o(this,void 0,void 0,(function*(){return s.fetchInfo(t,e,r)}))},t.balance=function(e,t,r){return o(this,void 0,void 0,(function*(){return l.fetchBalance(t,e,r).then((e=>+e.balance))}))},t.balanceDetails=function(e,t,r){return o(this,void 0,void 0,(function*(){return l.fetchBalanceDetails(t,e,r)}))},t.assetBalance=function(e,t,r,n){return o(this,void 0,void 0,(function*(){return c.fetchBalanceAddressAssetId(r,t,e,n).then((e=>e.balance))}))},t.accountData=function(e,t,r){return o(this,void 0,void 0,(function*(){let n,i;"string"===typeof e?(n=e,i=void 0):(n=e.address,i=e.match&&encodeURIComponent("string"===typeof e.match?e.match:e.match.source));return(yield l.data(t,n,{matches:i},r)).reduce(((e,t)=>Object.assign(Object.assign({},e),{[t.key]:t})),{})}))},t.accountDataByKey=function(e,t,r,n){return o(this,void 0,void 0,(function*(){return l.fetchDataKey(r,t,e,n).catch((e=>{if(304===e.error)return null;throw e}))}))},t.scriptInfo=function(e,t,r){return o(this,void 0,void 0,(function*(){return l.fetchScriptInfo(t,e,r)}))},t.scriptMeta=function(e,t){return o(this,void 0,void 0,(function*(){return l.fetchScriptInfoMeta(t,e)}))},t.rewards=function(){for(var e=arguments.length,t=new Array(e),r=0;re.stateChanges))}))},t.broadcast=function(e,t,r){return s.broadcast(t,e,r)}},1909:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},o=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i{if(e.alias)return"alias:".concat(String.fromCharCode(t),":").concat(e.alias);const r=l.concat([1],[t],e.publicKeyHash),n=l.keccak(l.blake2b(r)).slice(0,4);return l.base58Encode(l.concat(r,n))};function y(e){const t=Math.pow(2,53)-1;return e.toNumber()>t?e.toString():e.toNumber()}function m(e){let t={version:e.version,type:I[e.data],senderPublicKey:l.base58Encode(e.senderPublicKey),timestamp:e.timestamp.toNumber(),fee:y(e.fee.amount)};switch(e.fee.hasOwnProperty("assetId")?t.feeAssetId=l.base58Encode(e.fee.assetId):t.feeAssetId=null,e.hasOwnProperty("chainId")&&(t.chainId=e.chainId),e.data){case"issue":t.name=e.issue.name,t.description=e.issue.description,t.quantity=y(e.issue.amount),t.decimals=e.issue.decimals,t.reissuable=e.issue.reissuable,t.script=e.issue.hasOwnProperty("script")?h.base64Prefix(l.base64Encode(e.issue.script)):null;break;case"transfer":t.amount=y(e.transfer.amount.amount),t.recipient=g(e.transfer.recipient,e.chainId),t.attachment=e.transfer.hasOwnProperty("attachment")?l.base58Encode(e.transfer.attachment):"",t.assetId=e.transfer.amount.hasOwnProperty("assetId")?l.base58Encode(e.transfer.amount.assetId):null;break;case"reissue":t.quantity=y(e.reissue.assetAmount.amount),t.assetId=null==e.reissue.assetAmount.assetId?null:l.base58Encode(e.reissue.assetAmount.assetId),t.reissuable=e.reissue.reissuable;break;case"burn":t.amount=y(e.burn.assetAmount.amount),t.assetId=l.base58Encode(e.burn.assetAmount.assetId);break;case"exchange":t.amount=y(e.exchange.amount),t.price=y(e.exchange.price),t.buyMatcherFee=y(e.exchange.buyMatcherFee),t.sellMatcherFee=y(e.exchange.sellMatcherFee),t.order1=w(e.exchange.orders[0]),t.order2=w(e.exchange.orders[1]);break;case"lease":t.recipient=g(e.lease.recipient,e.chainId),t.amount=y(e.lease.amount);break;case"leaseCancel":t.leaseId=l.base58Encode(e.leaseCancel.leaseId);break;case"createAlias":t.alias=e.createAlias.alias;break;case"massTransfer":t.assetId=e.massTransfer.hasOwnProperty("assetId")?l.base58Encode(e.massTransfer.assetId):null,t.attachment=e.massTransfer.hasOwnProperty("attachment")?l.base58Encode(e.massTransfer.attachment):"",t.transfers=e.massTransfer.transfers.map((t=>{let{amount:r,recipient:n}=t;return{amount:y(r),recipient:g(n,e.chainId)}}));break;case"dataTransaction":t.data=e.dataTransaction.data.map((e=>e.hasOwnProperty("binaryValue")?{key:e.key,type:"binary",value:h.base64Prefix(l.base64Encode(e.binaryValue))}:e.hasOwnProperty("boolValue")?{key:e.key,type:"boolean",value:e.boolValue}:e.hasOwnProperty("intValue")?{key:e.key,type:"integer",value:y(e.intValue)}:e.hasOwnProperty("stringValue")?{key:e.key,type:"string",value:e.stringValue}:{key:e.key,value:null}));break;case"setScript":t.script=e.setScript.hasOwnProperty("script")?h.base64Prefix(l.base64Encode(e.setScript.script)):null;break;case"sponsorFee":t.minSponsoredAssetFee=y(e.sponsorFee.minFee.amount),t.assetId=l.base58Encode(e.sponsorFee.minFee.assetId);break;case"setAssetScript":t.assetId=l.base58Encode(e.setAssetScript.assetId),t.script=h.base64Prefix(l.base64Encode(e.setAssetScript.script));break;case"invokeScript":t.dApp=g(e.invokeScript.dApp,e.chainId),null!=e.invokeScript.functionCall&&(t.call=c.binary.parserFromSchema(p)(e.invokeScript.functionCall).value),t.payment=e.invokeScript.payments.map((e=>({amount:y(e.amount),assetId:e.hasOwnProperty("assetId")?l.base58Encode(e.assetId):null})));break;case"updateAssetInfo":t.assetId=l.base58Encode(e.updateAssetInfo.assetId),t.name=e.updateAssetInfo.name,t.description=e.updateAssetInfo.description;break;default:throw new Error("Unsupported tx type ".concat(e.data))}if(t.hasOwnProperty("chainId"))t.sender=l.address({publicKey:e.senderPublicKey},e.chainId);else{let r=t.recipient||t.dApp||t.transfers&&t.transfers[0]&&t.transfers[0].recipient;r&&(t.sender=l.address({publicKey:e.senderPublicKey},h.chainIdFromRecipient(r)))}return t}t.txToProtoBytes=function(e){return new Uint8Array(u.waves.Transaction.encode(t.txToProto(e)).finish())},t.signedTxToProtoBytes=function(e){return new Uint8Array(u.waves.SignedTransaction.encode(t.signedTxToProto(e)).finish())},t.protoBytesToSignedTx=function(e){const t=u.waves.SignedTransaction.decode(e),r=m(t.transaction);return Object.assign(Object.assign({},r),{proofs:(t.proofs||[]).map(B)})},t.protoBytesToTx=function(e){return m(u.waves.Transaction.decode(e))},t.protoTxDataToTx=m,t.orderToProtoBytes=function(e){return u.waves.Order.encode(S(e)).finish()},t.protoBytesToOrder=function(e){const t=u.waves.Order.decode(e);return w(t)};const v=e=>{var{senderPublicKey:t,fee:r,timestamp:n,type:i,version:a}=e,s=o(e,["senderPublicKey","fee","timestamp","type","version"]);const u=C[i];let c=s.chainId;if(null==c){const e=s;let t=e.recipient||e.dApp||e.transfers&&e.transfers[0]&&e.transfers[0].recipient;t&&(c=h.chainIdFromRecipient(t))}return{version:a,type:i,chainId:c,senderPublicKey:l.base58Decode(t),timestamp:d.default.fromValue(n),fee:A(r,s.feeAssetId),data:u}},b=e=>{let r;switch(e.type){case f.TRANSACTION_TYPE.ISSUE:r=(e=>({name:e.name,description:""===e.description?null:e.description,amount:d.default.fromValue(e.quantity),decimals:0===e.decimals?null:e.decimals,reissuable:!!e.reissuable||void 0,script:null==e.script?null:t.scriptToProto(e.script)}))(e);break;case f.TRANSACTION_TYPE.TRANSFER:r=(e=>({recipient:E(e.recipient),amount:A(e.amount,e.assetId),attachment:null==e.attachment||""==e.attachment?void 0:l.base58Decode(e.attachment)}))(e);break;case f.TRANSACTION_TYPE.REISSUE:r=(e=>({assetAmount:A(e.quantity,e.assetId),reissuable:!!e.reissuable||void 0}))(e);break;case f.TRANSACTION_TYPE.BURN:r=(e=>({assetAmount:A(e.amount||e.amount,e.assetId)}))(e);break;case f.TRANSACTION_TYPE.LEASE:r=(e=>({recipient:E(e.recipient),amount:d.default.fromValue(e.amount)}))(e);break;case f.TRANSACTION_TYPE.CANCEL_LEASE:r=(e=>({leaseId:l.base58Decode(e.leaseId)}))(e);break;case f.TRANSACTION_TYPE.ALIAS:r=(e=>({alias:e.alias}))(e);break;case f.TRANSACTION_TYPE.MASS_TRANSFER:r=(e=>({assetId:null==e.assetId?null:l.base58Decode(e.assetId),attachment:null==e.attachment||""==e.attachment?void 0:l.base58Decode(e.attachment),transfers:e.transfers.map(T)}))(e);break;case f.TRANSACTION_TYPE.DATA:r=(e=>({data:e.data.map(t.dataEntryToProto)}))(e);break;case f.TRANSACTION_TYPE.SET_SCRIPT:r=(e=>({script:null==e.script?null:t.scriptToProto(e.script)}))(e);break;case f.TRANSACTION_TYPE.SET_ASSET_SCRIPT:r=(e=>({assetId:l.base58Decode(e.assetId),script:null==e.script?null:t.scriptToProto(e.script)}))(e);break;case f.TRANSACTION_TYPE.SPONSORSHIP:r=(e=>({minFee:null===e.minSponsoredAssetFee?A(0,e.assetId):A(e.minSponsoredAssetFee,e.assetId)}))(e);break;case f.TRANSACTION_TYPE.EXCHANGE:r=(e=>({amount:d.default.fromValue(e.amount),price:d.default.fromValue(e.price),buyMatcherFee:d.default.fromValue(e.buyMatcherFee),sellMatcherFee:d.default.fromValue(e.sellMatcherFee),orders:[S(Object.assign({chainId:e.chainId},e.order1)),S(Object.assign({chainId:e.chainId},e.order2))]}))(e);break;case f.TRANSACTION_TYPE.INVOKE_SCRIPT:r=(e=>({dApp:E(e.dApp),functionCall:c.binary.serializerFromSchema(c.schemas.invokeScriptSchemaV1.schema[5][1])(e.call),payments:null==e.payment?null:e.payment.map((e=>{let{amount:t,assetId:r}=e;return A(t,r)}))}))(e);break;case f.TRANSACTION_TYPE.UPDATE_ASSET_INFO:r=(e=>({assetId:l.base58Decode(e.assetId),name:e.name,description:""===e.description?null:e.description}))(e)}return r};t.txToProto=e=>{const t=v(e),r=b(e);return Object.assign(Object.assign({},t),{[t.data]:r})},t.signedTxToProto=e=>{const t=(e=>{const t=v(e);return e.hasOwnProperty("proofs")&&(t.proofs=e.proofs),t})(e),r=b(e);return{wavesTransaction:Object.assign(Object.assign({},t),{[t.data]:r}),proofs:(e.proofs||[]).map(k)}};const S=e=>{var t;let r,n;4===e.version&&"priceMode"in e?(0!==e.priceMode&&"default"!==e.priceMode||(r=void 0),r="assetDecimals"===e.priceMode?u.waves.Order.PriceMode.ASSET_DECIMALS:u.waves.Order.PriceMode.FIXED_DECIMALS):r=void 0,n=4===e.version&&"attachment"in e?l.base64Decode(e.attachment.startsWith("base64:")?e.attachment.slice(7):e.attachment):void 0;const i=e=>null==e||"waves"==e.toLowerCase();return{chainId:e.chainId,senderPublicKey:e.senderPublicKey?l.base58Decode(e.senderPublicKey):null,matcherPublicKey:l.base58Decode(e.matcherPublicKey),assetPair:{amountAssetId:i(e.assetPair.amountAsset)?null:l.base58Decode(e.assetPair.amountAsset),priceAssetId:i(e.assetPair.priceAsset)?null:l.base58Decode(e.assetPair.priceAsset)},orderSide:"buy"===e.orderType?void 0:u.waves.Order.Side.SELL,amount:d.default.fromValue(e.amount),price:d.default.fromValue(e.price),timestamp:d.default.fromValue(e.timestamp),expiration:d.default.fromValue(e.expiration),matcherFee:A(e.matcherFee,e.matcherFeeAssetId?e.matcherFeeAssetId:null),version:e.version,proofs:null===(t=e.proofs)||void 0===t?void 0:t.map(l.base58Decode),eip712Signature:e.eip712Signature?l.base16Decode(e.eip712Signature.slice(2)):void 0,priceMode:r,attachment:n}},w=e=>{var t,r;let n;return n=4===e.version&&e.priceMode?1===e.priceMode?"fixedDecimals":"assetDecimals":void 0,{version:e.version,senderPublicKey:l.base58Encode(e.senderPublicKey),matcherPublicKey:l.base58Encode(e.matcherPublicKey),assetPair:{amountAsset:null==e.assetPair.amountAssetId?null:l.base58Encode(e.assetPair.amountAssetId),priceAsset:null==e.assetPair.priceAssetId?null:l.base58Encode(e.assetPair.priceAssetId)},chainId:e.chainId,orderType:e.orderSide===u.waves.Order.Side.BUY?"buy":"sell",amount:y(e.amount),price:y(e.price),timestamp:e.timestamp.toNumber(),expiration:e.expiration.toNumber(),matcherFee:y(e.matcherFee.amount),matcherFeeAssetId:null==e.matcherFee.assetId?null:l.base58Encode(e.matcherFee.assetId),attachment:(null===(t=e.attachment)||void 0===t?void 0:t.length)?l.base64Encode(e.attachment):void 0,priceMode:n,eip712Signature:(null===(r=e.eip712Signature)||void 0===r?void 0:r.length)?"0x".concat(l.base16Encode(e.eip712Signature)):void 0}},E=e=>({alias:e.startsWith("alias")?e.slice(8):void 0,publicKeyHash:e.startsWith("alias")?void 0:l.base58Decode(e).slice(2,-4)}),A=(e,t)=>({amount:0==e?null:d.default.fromValue(e),assetId:null==t?null:l.base58Decode(t)}),T=e=>({recipient:E(e.recipient),amount:0==e.amount?null:d.default.fromValue(e.amount)});t.dataEntryToProto=e=>({key:e.key,intValue:"integer"===e.type?d.default.fromValue(e.value):void 0,boolValue:"boolean"===e.type?e.value:void 0,binaryValue:"binary"===e.type?l.base64Decode(e.value.startsWith("base64:")?e.value.slice(7):e.value):void 0,stringValue:"string"===e.type?e.value:void 0}),t.scriptToProto=e=>e?l.base64Decode(e.toString().startsWith("base64:")?e.slice(7):e):null;const C={1:"genesis",2:"payment",3:"issue",4:"transfer",5:"reissue",6:"burn",7:"exchange",8:"lease",9:"leaseCancel",10:"createAlias",11:"massTransfer",12:"dataTransaction",13:"setScript",14:"sponsorFee",15:"setAssetScript",16:"invokeScript",17:"updateAssetInfo"},I={genesis:1,payment:2,issue:3,transfer:4,reissue:5,burn:6,exchange:7,lease:8,leaseCancel:9,createAlias:10,massTransfer:11,dataTransaction:12,setScript:13,sponsorFee:14,setAssetScript:15,invokeScript:16,updateAssetInfo:17},k=e=>l.base58Decode(e),B=e=>l.base58Encode(e)},4397:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.auth=t.serializeAuthData=void 0;const n=r(9846),i=r(6106),{STRING:a,LEN:o,SHORT:s}=i.serializePrimitives,u=r(637),l=r(6042);t.serializeAuthData=e=>n.concat(o(s)(a)("WavesWalletAuthentication"),o(s)(a)(e.host||""),o(s)(a)(e.data||"")),t.auth=function(e,r,i){const a=u.convertToPairs(r),o=e.publicKey||u.getSenderPublicKey(a,{senderPublicKey:void 0});l.validate.auth(e);const s={hash:"",signature:"",host:e.host,data:e.data,publicKey:o,address:n.address({publicKey:o},i)},c=t.serializeAuthData(s);return s.signature=null!=r&&n.signBytes(r,c)||"",s.hash=n.base58Encode(n.blake2b(Uint8Array.from(c))),s}},8312:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cancelOrder=t.cancelOrderParamsToBytes=void 0;const n=r(9846),i=r(6106),{BASE58_STRING:a}=i.serializePrimitives,o=r(637),s=r(6042);t.cancelOrderParamsToBytes=e=>n.concat(a(e.sender),a(e.orderId)),t.cancelOrder=function(e,t){const r=o.convertToPairs(t),i=e.senderPublicKey||o.getSenderPublicKey(r,{senderPublicKey:void 0}),u=n.concat(a(i),a(e.orderId)),l=e.signature||null!=t&&n.signBytes(t,u)||"",c=n.base58Encode(n.blake2b(Uint8Array.from(u))),f={sender:i,orderId:e.orderId,signature:l,hash:c};return s.validate.cancelOrder(f),f}},233:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeCustomData=t.customData=void 0;const n=r(9846),i=r(6106),a=r(6106),o=r(6042);function s(e){if(1===e.version)return n.concat([255,255,255,1],i.serializePrimitives.BASE64_STRING(e.binary));if(2===e.version){const t=a.binary.serializerFromSchema(i.schemas.txFields.data[1]);return n.concat([255,255,255,2],t(e.data))}throw new Error("Invalid CustomData version: ".concat(e.version))}t.customData=function(e,t){o.validate.customData(e);let r=s(e);const i=n.base58Encode(n.blake2b(r)),a=e.publicKey?e.publicKey:t&&n.publicKey(t),u=t&&n.signBytes(t,r);return Object.assign(Object.assign({},e),{hash:i,publicKey:a,signature:u})},t.serializeCustomData=s},4331:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.order=void 0;const n=r(9846),i=r(637),a=r(6106),o=r(6042),s=r(1909);t.order=function(e,t){const r=i.isOrder(e)?e.assetPair.amountAsset:e.amountAsset,u=i.isOrder(e)?e.assetPair.priceAsset:e.priceAsset,l=i.isOrder(e)?e.proofs:[],{matcherFee:c,matcherPublicKey:f,price:h,amount:d,orderType:p,expiration:g,timestamp:y}=e,m=y||Date.now(),v=i.convertToPairs(t),b=e.senderPublicKey||i.getSenderPublicKey(v,e),S={orderType:p,version:null===e.version?void 0:e.version,assetPair:{amountAsset:r,priceAsset:u},price:h,amount:d,timestamp:m,expiration:g||m+25056e5,matcherFee:c||3e5,matcherPublicKey:f,senderPublicKey:b,proofs:l,matcherFeeAssetId:null,id:"",priceMode:e.priceMode};S.version>=3&&(S.matcherFeeAssetId="WAVES"===e.matcherFeeAssetId?null:e.matcherFeeAssetId),4===S.version&&(S.priceMode=e.priceMode||"fixedDecimals",S.chainId=i.networkByte(e.chainId,87),e.eip712Signature&&(S.eip712Signature=e.eip712Signature),e.attachment&&(S.attachment=e.attachment));const w=S.version>3?s.orderToProtoBytes(S):a.binary.serializeOrder(S);return v.forEach((e=>{let[t,r]=e;return i.addProof(S,n.signBytes(t,w),r)})),o.validate.order(S),S.id=n.base58Encode(n.blake2b(w)),void 0!==S.version&&1!==S.version||(S.signature=S.proofs&&S.proofs[0]),S}},9543:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wavesAuth=t.serializeWavesAuthData=void 0;const n=r(9846),i=r(6106),{LONG:a,BASE58_STRING:o}=i.serializePrimitives,s=r(637),u=r(6042);t.serializeWavesAuthData=e=>n.concat(o(e.publicKey),a(e.timestamp)),t.wavesAuth=function(e,r,i){const a=s.convertToPairs(r),o=e.publicKey||s.getSenderPublicKey(a,{senderPublicKey:void 0}),l=e.timestamp||Date.now();u.validate.wavesAuth({publicKey:o,timestamp:l});const c={hash:"",signature:"",timestamp:l,publicKey:o,address:n.address({publicKey:o},i)},f=t.serializeWavesAuthData(c);return c.signature=a.map((e=>{let[t]=e;return n.signBytes(t,f)}))[0]||"",c.hash=n.base58Encode(n.blake2b(Uint8Array.from(f))),c}},3297:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decryptSeed=t.encryptSeed=t.strengthenPassword=t.generateNewSeed=t.Seed=void 0;const n=r(9846);Object.defineProperty(t,"encryptSeed",{enumerable:!0,get:function(){return n.encryptSeed}}),Object.defineProperty(t,"decryptSeed",{enumerable:!0,get:function(){return n.decryptSeed}});const i=r(6106);class a{constructor(e,t){if(e.length<12)throw new Error("Your seed length is less than allowed in config");this.phrase=e,this.address=n.address(e,t),this.keyPair={privateKey:n.privateKey(e),publicKey:n.publicKey(e)},Object.freeze(this),Object.freeze(this.keyPair)}encrypt(e,t){return a.encryptSeedPhrase(this.phrase,e,t)}static encryptSeedPhrase(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3;if(t&&t.length,e.length<12)throw new Error("The seed phrase you are trying to encrypt is too short");return n.encryptSeed(e,t,r)}static decryptSeedPhrase(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5e3;const i="The password is wrong";let a;try{a=n.decryptSeed(e,t,r)}catch(o){throw new Error(i)}if(""===a||a.length<12)throw new Error(i);return a}static create(){const e=o(arguments.length>0&&void 0!==arguments[0]?arguments[0]:15);if(e.length<12)throw new Error("The resulted seed length is less than the minimum length (".concat(12,")"));return new a(e)}static fromExistingPhrase(e){if(e.length<12)throw new Error("The resulted seed length is less than the minimum length (".concat(12,")"));return new a(e)}}function o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:15;return n.randomSeed(e)}t.Seed=a,t.generateNewSeed=o,t.strengthenPassword=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5e3;for(;t--;){const t=i.serializePrimitives.STRING(e);e=n.base16Encode(n.sha256(t))}return e}},412:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.alias=void 0;const n=r(6106),i=r(9846),a=r(1909),o=r(637),s=r(6042),u=r(7560),l=r(2082);t.alias=function(e,t){const r=l.TRANSACTION_TYPE.ALIAS,c=e.version||u.DEFAULT_VERSIONS.ALIAS,f=o.convertToPairs(t),h={type:r,version:c,senderPublicKey:o.getSenderPublicKey(f,e),alias:e.alias,fee:o.fee(e,1e5),timestamp:e.timestamp||Date.now(),chainId:o.networkByte(e.chainId,87),proofs:e.proofs||[],id:""};s.validate.alias(h);const d=c>2?a.txToProtoBytes(h):n.binary.serializeTx(h),p=c>2?d:[d[0],...d.slice(36,-16)];return f.forEach((e=>{let[t,r]=e;return o.addProof(h,i.signBytes(t,d),r)})),h.id=i.base58Encode(i.blake2b(Uint8Array.from(p))),h}},7852:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.burn=void 0;const n=r(6106),i=r(9846),a=r(637),o=r(6042),s=r(1909),u=r(7560),l=r(2082);t.burn=function(e,t){const r=l.TRANSACTION_TYPE.BURN,c=e.version||u.DEFAULT_VERSIONS.BURN,f=a.convertToPairs(t),h={type:r,version:c,senderPublicKey:a.getSenderPublicKey(f,e),assetId:e.assetId,amount:e.amount,chainId:a.networkByte(e.chainId,87),fee:a.fee(e,1e5),timestamp:e.timestamp||Date.now(),proofs:e.proofs||[],id:""};o.validate.burn(h);const d=c>2?s.txToProtoBytes(h):n.binary.serializeTx(h);return f.forEach((e=>{let[t,r]=e;return a.addProof(h,i.signBytes(t,d),r)})),h.id=i.base58Encode(i.blake2b(d)),h}},8191:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cancelLease=void 0;const n=r(6106),i=r(9846),a=r(637),o=r(6042),s=r(1909),u=r(7560),l=r(2082);t.cancelLease=function(e,t){const r=l.TRANSACTION_TYPE.CANCEL_LEASE,c=e.version||u.DEFAULT_VERSIONS.CANCEL_LEASE,f=a.convertToPairs(t),h={type:r,version:c,senderPublicKey:a.getSenderPublicKey(f,e),leaseId:e.leaseId,fee:a.fee(e,1e5),timestamp:e.timestamp||Date.now(),chainId:a.networkByte(e.chainId,87),proofs:e.proofs||[],id:""};o.validate.cancelLease(h);const d=c>2?s.txToProtoBytes(h):n.binary.serializeTx(h);return f.forEach((e=>{let[t,r]=e;return a.addProof(h,i.signBytes(t,d),r)})),h.id=i.base58Encode(i.blake2b(d)),h}},5198:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.data=void 0;const o=a(r(7218)),s=r(6106),u=r(9846),l=r(637),c=r(6042),f=r(1909),h=r(7560),d=r(2082),{BASE58_STRING:p,BASE64_STRING:g,BYTE:y,BYTES:m,COUNT:v,LEN:b,LONG:S,SHORT:w,STRING:E}=s.serializePrimitives,A={integer:["integer",0,S],number:["integer",0,S],boolean:["boolean",1,y],string:["string",3,b(w)(E)],binary:["binary",2,e=>b(w)(g)(e)],_:["binary",2,b(w)(m)]},T=(e,t)=>t?A[t]:A[typeof e]||A._,C=(e,t,r)=>"binary"===e&&(Uint8Array.prototype.isPrototypeOf(t)||Array.isArray(t))?"base64:"+Buffer.from(t).toString("base64"):t;t.data=function(e,t){var r;const n=d.TRANSACTION_TYPE.DATA,i=e.version||h.DEFAULT_VERSIONS.DATA,a=l.convertToPairs(t),g=l.getSenderPublicKey(a,e);if(!Array.isArray(e.data))throw new Error('["data should be array"]');if(e.data.some((e=>null===e.value))&&1===e.version)throw new Error('The value of the "value" field can only be null in a version greater than 1.');const m=e.timestamp||Date.now(),A=(null!==(r=e.data)&&void 0!==r?r:[]).map((e=>{if(null==e.value)return e;if(e.type){if(c.validate.dataFieldValidator(e))return Object.assign(Object.assign({},e),{value:C(e.type,e.value)});throw new Error('type "'.concat(e.type,'" does not match value "').concat(e.value,'"(').concat(typeof e.value,")"))}{const t=T(e.value,e.type)[0];return{type:t,key:e.key,value:C(t,e.value)}}})),I=e=>u.concat(b(w)(E)(e.key),[T(e.value,e.type)[1]],T(e.value,e.type)[2](e.value));let k;if(i<2){let e=u.concat(y(d.TRANSACTION_TYPE.DATA),y(1),p(g),v(w)(I)(A),S(m));k=1e5*Math.floor(1+(e.length-1)/1024)}else{let e=A.map(f.dataEntryToProto),t=o.waves.DataTransactionData.encode({data:e}).finish();k=1e5*Math.ceil(t.length/1024)}const B={type:n,version:i,senderPublicKey:g,fee:l.fee(e,k),timestamp:m,proofs:e.proofs||[],chainId:l.networkByte(e.chainId,87),id:"",data:A};c.validate.data(B);const _=i>1?f.txToProtoBytes(B):s.binary.serializeTx(B);return a.forEach((e=>{let[t,r]=e;return l.addProof(B,u.signBytes(t,_),r)})),B.id=u.base58Encode(u.blake2b(_)),B}},2919:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exchange=void 0;const n=r(6106),i=r(9846),a=r(637),o=r(6042),s=r(1909),u=r(7560),l=r(2082);t.exchange=function(e,t){const r=l.TRANSACTION_TYPE.EXCHANGE,c=e.version||u.DEFAULT_VERSIONS.EXCHANGE,f=a.convertToPairs(t),h={type:r,version:c,senderPublicKey:a.getSenderPublicKey(f,e),order1:e.order1,order2:e.order2,price:e.price,amount:e.amount,buyMatcherFee:e.buyMatcherFee,sellMatcherFee:e.sellMatcherFee,fee:a.fee(e,1e5),timestamp:e.timestamp||Date.now(),proofs:e.proofs||[],chainId:a.networkByte(e.chainId,87),id:""};o.validate.exchange(h);const d=c>2?s.txToProtoBytes(h):n.binary.serializeTx(h);return f.forEach((e=>{let[t,r]=e;return a.addProof(h,i.signBytes(t,d),r)})),Object.assign(Object.assign({},h),{id:i.base58Encode(i.blake2b(d))})}},9e3:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.invokeScript=void 0;const n=r(9846),i=r(637),a=r(6106),o=r(6042),s=r(1909),u=r(7560),l=r(2082);t.invokeScript=function(e,t){const r=l.TRANSACTION_TYPE.INVOKE_SCRIPT,h=e.version||u.DEFAULT_VERSIONS.INVOKE_SCRIPT,d=i.convertToPairs(t),p={type:r,version:h,senderPublicKey:i.getSenderPublicKey(d,e),dApp:e.dApp,call:f(e),payment:c(e.payment),fee:i.fee(e,5e5),feeAssetId:i.normalizeAssetId(e.feeAssetId),timestamp:e.timestamp||Date.now(),chainId:i.networkByte(e.chainId,87),proofs:e.proofs||[],id:""};o.validate.invokeScript(p);const g=h>1?s.txToProtoBytes(p):a.binary.serializeTx(p);return d.forEach((e=>{let[t,r]=e;return i.addProof(p,n.signBytes(t,g),r)})),p.id=n.base58Encode(n.base58Encode(n.blake2b(g))),p};const c=e=>null==e?[]:e.map((e=>Object.assign(Object.assign({},e),{assetId:"WAVES"===e.assetId?null:e.assetId}))),f=e=>e.call?Object.assign({args:e.call.args||[]},e.call):null},6063:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.issue=void 0;const n=r(9846),i=r(637),a=r(6106),o=r(6042),s=r(1909),u=r(7560),l=r(2082);t.issue=function(e,t){const r=l.TRANSACTION_TYPE.ISSUE,f=e.version||u.DEFAULT_VERSIONS.ISSUE,h=i.convertToPairs(t),d={type:r,version:f,senderPublicKey:i.getSenderPublicKey(h,e),name:e.name,description:e.description,quantity:e.quantity,script:null==e.script?null:i.base64Prefix(e.script),decimals:null==e.decimals?8:e.decimals,reissuable:e.reissuable||!1,fee:c(e)?i.fee(e,1e5):i.fee(e,1e8),timestamp:e.timestamp||Date.now(),chainId:i.networkByte(e.chainId,87),proofs:e.proofs||[],id:""};o.validate.issue(d);const p=f>2?s.txToProtoBytes(d):a.binary.serializeTx(d);return h.forEach((e=>{let[t,r]=e;return i.addProof(d,n.signBytes(t,p),r)})),d.id=n.base58Encode(n.blake2b(p)),d};const c=e=>1===e.quantity&&0==e.reissuable&&0==e.decimals},42:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lease=void 0;const n=r(9846),i=r(637),a=r(6106),o=r(6042),s=r(1909),u=r(7560),l=r(2082);t.lease=function(e,t){const r=l.TRANSACTION_TYPE.LEASE,c=e.version||u.DEFAULT_VERSIONS.LEASE,f=i.convertToPairs(t),h={type:r,version:c,senderPublicKey:i.getSenderPublicKey(f,e),amount:e.amount,recipient:e.recipient,fee:i.fee(e,1e5),timestamp:e.timestamp||Date.now(),proofs:e.proofs||[],chainId:i.networkByte(e.chainId,87),id:""};o.validate.lease(h);const d=c>2?s.txToProtoBytes(h):a.binary.serializeTx(h);return f.forEach((e=>{let[t,r]=e;return i.addProof(h,n.signBytes(t,d),r)})),h.id=n.base58Encode(n.blake2b(d)),h}},2516:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.massTransfer=void 0;const n=r(637),i=r(9846),a=r(6106),o=r(6042),s=r(1909),u=r(7560),l=r(2082);t.massTransfer=function(e,t){var r;const c=l.TRANSACTION_TYPE.MASS_TRANSFER,f=e.version||u.DEFAULT_VERSIONS.MASS_TRANSFER,h=n.convertToPairs(t),d=n.getSenderPublicKey(h,e);if(!Array.isArray(e.transfers)||0===e.transfers.length)throw new Error("Should contain at least one transfer");const p={type:c,version:f,senderPublicKey:d,assetId:n.normalizeAssetId(e.assetId),transfers:e.transfers,fee:n.fee(e,1e5+1e5*Math.ceil(.5*e.transfers.length)),timestamp:e.timestamp||Date.now(),attachment:e.attachment||"",proofs:e.proofs||[],chainId:n.networkByte(e.chainId,n.chainIdFromRecipient(null===(r=e.transfers[0])||void 0===r?void 0:r.recipient)),id:""};o.validate.massTransfer(p);const g=f>1?s.txToProtoBytes(p):a.binary.serializeTx(p);return h.forEach((e=>{let[t,r]=e;return n.addProof(p,i.signBytes(t,g),r)})),p.id=i.base58Encode(i.blake2b(g)),p}},5256:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reissue=void 0;const n=r(9846),i=r(637),a=r(6106),o=r(6042),s=r(1909),u=r(7560),l=r(2082);t.reissue=function(e,t){const r=l.TRANSACTION_TYPE.REISSUE,c=e.version||u.DEFAULT_VERSIONS.REISSUE,f=i.convertToPairs(t),h={type:r,version:c,senderPublicKey:i.getSenderPublicKey(f,e),assetId:e.assetId,quantity:e.quantity,reissuable:e.reissuable,chainId:i.networkByte(e.chainId,87),fee:i.fee(e,1e5),timestamp:e.timestamp||Date.now(),proofs:e.proofs||[],id:""};o.validate.reissue(h);const d=c>2?s.txToProtoBytes(h):a.binary.serializeTx(h);return f.forEach((e=>{let[t,r]=e;return i.addProof(h,n.signBytes(t,d),r)})),h.id=n.base58Encode(n.blake2b(d)),h}},8289:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setAssetScript=void 0;const n=r(9846),i=r(637),a=r(6106),o=r(6042),s=r(1909),u=r(7560),l=r(2082);t.setAssetScript=function(e,t){const r=l.TRANSACTION_TYPE.SET_ASSET_SCRIPT,c=e.version||u.DEFAULT_VERSIONS.SET_ASSET_SCRIPT,f=i.convertToPairs(t),h=i.getSenderPublicKey(f,e);if(null==e.script)throw new Error("Asset script cannot be empty");const d={type:r,version:c,senderPublicKey:h,assetId:e.assetId,chainId:i.networkByte(e.chainId,87),fee:i.fee(e,1e8),timestamp:e.timestamp||Date.now(),proofs:e.proofs||[],id:"",script:i.base64Prefix(e.script)||""};o.validate.setAssetScript(d);const p=c>1?s.txToProtoBytes(d):a.binary.serializeTx(d);return f.forEach((e=>{let[t,r]=e;return i.addProof(d,n.signBytes(t,p),r)})),d.id=n.base58Encode(n.blake2b(p)),d}},6210:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setScript=void 0;const n=r(9846),i=r(637),a=r(6106),o=r(6042),s=r(1909),u=r(7560),l=r(2082);t.setScript=function(e,t){const r=l.TRANSACTION_TYPE.SET_SCRIPT,c=e.version||u.DEFAULT_VERSIONS.SET_SCRIPT,f=i.convertToPairs(t),h=i.getSenderPublicKey(f,e);if(void 0===e.script)throw new Error("Script field cannot be undefined. Use null explicitly to remove script");let d=s.scriptToProto(e.script);const p=null!=d?1e5*Math.ceil(d.length/1024):5e5,g={type:r,version:c,senderPublicKey:h,chainId:i.networkByte(e.chainId,87),fee:i.fee(e,p),timestamp:e.timestamp||Date.now(),proofs:e.proofs||[],id:"",script:i.base64Prefix(e.script)};o.validate.setScript(g);const y=c>1?s.txToProtoBytes(g):a.binary.serializeTx(g);return f.forEach((e=>{let[t,r]=e;return i.addProof(g,n.signBytes(t,y),r)})),g.id=n.base58Encode(n.blake2b(y)),g}},1936:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sponsorship=void 0;const n=r(9846),i=r(637),a=r(6106),o=r(6042),s=r(1909),u=r(7560),l=r(2082);t.sponsorship=function(e,t){const r=l.TRANSACTION_TYPE.SPONSORSHIP,c=e.version||u.DEFAULT_VERSIONS.SPONSORSHIP,f=i.convertToPairs(t),h={type:r,version:c,senderPublicKey:i.getSenderPublicKey(f,e),minSponsoredAssetFee:e.minSponsoredAssetFee,assetId:e.assetId,fee:i.fee(e,1e5),timestamp:e.timestamp||Date.now(),chainId:i.networkByte(e.chainId,87),proofs:e.proofs||[],id:""};o.validate.sponsorship(h);const d=c>1?s.txToProtoBytes(h):a.binary.serializeTx(h);return f.forEach((e=>{let[t,r]=e;return i.addProof(h,n.signBytes(t,d),r)})),h.id=n.base58Encode(n.blake2b(d)),h}},4713:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transfer=void 0;const n=r(9846),i=r(637),a=r(6042),o=r(6106),s=r(1909),u=r(7560),l=r(2082);t.transfer=function(e,t){const r=l.TRANSACTION_TYPE.TRANSFER,c=e.version||u.DEFAULT_VERSIONS.TRANSFER,f=i.convertToPairs(t),h={type:r,version:c,senderPublicKey:i.getSenderPublicKey(f,e),assetId:i.normalizeAssetId(e.assetId),recipient:e.recipient,amount:e.amount,attachment:e.attachment||"",fee:i.fee(e,1e5),feeAssetId:i.normalizeAssetId(e.feeAssetId),timestamp:e.timestamp||Date.now(),proofs:e.proofs||[],chainId:i.networkByte(e.chainId,i.chainIdFromRecipient(e.recipient)),id:""};a.validate.transfer(h);const d=c>2?s.txToProtoBytes(h):o.binary.serializeTx(h);return f.forEach((e=>{let[t,r]=e;return i.addProof(h,n.signBytes(t,d),r)})),h.id=n.base58Encode(n.blake2b(d)),h}},7915:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateAssetInfo=void 0;const n=r(9846),i=r(637),a=r(6042),o=r(1909),s=r(7560),u=r(2082);t.updateAssetInfo=function(e,t){const r=u.TRANSACTION_TYPE.UPDATE_ASSET_INFO,l=e.version||s.DEFAULT_VERSIONS.UPDATE_ASSET_INFO,c=i.convertToPairs(t),f={type:r,version:l,senderPublicKey:i.getSenderPublicKey(c,e),name:e.name,description:e.description,assetId:e.assetId,fee:i.fee(e,1e5),timestamp:e.timestamp||Date.now(),proofs:e.proofs||[],chainId:i.networkByte(e.chainId,87),id:""};a.validate.updateAssetInfo(f);const h=o.txToProtoBytes(f);return c.forEach((e=>{let[t,r]=e;return i.addProof(f,n.signBytes(t,h),r)})),f.id=n.base58Encode(n.blake2b(h)),f}},2070:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.aliasValidator=void 0;const n=r(9347),i=r(2082),a={type:n.isEq(i.TRANSACTION_TYPE.ALIAS),version:n.orEq([void 0,2,3]),senderPublicKey:n.isPublicKey,alias:n.isValidAliasName,fee:n.isNaturalNumberOrZeroLike,chainId:n.isNumber,timestamp:n.isNumber,proofs:n.ifElse(n.isArray,n.defaultValue(!0),n.orEq([void 0]))};t.aliasValidator=n.validateByShema(a,n.getError)},5846:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.authValidator=void 0;const n=r(9347),i={data:n.isString,host:n.isString};t.authValidator=n.validateByShema(i,n.getError)},2357:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.burnValidator=void 0;const n=r(2082),i=r(9347),a={type:i.isEq(n.TRANSACTION_TYPE.BURN),senderPublicKey:i.isPublicKey,version:i.orEq([void 0,2,3]),assetId:i.isAssetId,amount:i.isNaturalNumberLike,chainId:i.isNaturalNumberLike,fee:i.isNaturalNumberOrZeroLike,timestamp:i.isNumber,proofs:i.ifElse(i.isArray,i.defaultValue(!0),i.orEq([void 0]))};t.burnValidator=i.validateByShema(a,i.getError)},2945:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cancelLeaseValidator=void 0;const n=r(2082),i=r(9347),a={type:i.isEq(n.TRANSACTION_TYPE.CANCEL_LEASE),senderPublicKey:i.isPublicKey,version:i.orEq([void 0,2,3]),leaseId:i.isAssetId,chainId:i.isNumber,fee:i.isNaturalNumberOrZeroLike,timestamp:i.isNumber,proofs:i.ifElse(i.isArray,i.defaultValue(!0),i.orEq([void 0]))};t.cancelLeaseValidator=i.validateByShema(a,i.getError)},5807:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cancelOrderValidator=void 0;const n=r(9347),i={sender:n.isPublicKey,orderId:n.isHash,signature:n.isBase58,hash:n.isBase58};t.cancelOrderValidator=n.validateByShema(i,n.getError)},1732:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.customDataValidator=void 0;const n=r(9347),i={version:n.isEq(1),binary:n.isBase64},a={version:n.isEq(2),data:n.validatePipe(n.isArray,(e=>e.every(n.validatePipe(n.isRequired(!0),n.isValidDataPair))))},o=n.validateByShema(i,n.getError),s=n.validateByShema(a,n.getError);t.customDataValidator=n.ifElse(n.pipe(n.prop("version"),n.isEq(1)),o,s)},728:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dataValidator=t.dataFieldValidator=void 0;const n=r(2082),i=r(9347),a={type:i.isEq(n.TRANSACTION_TYPE.DATA),senderPublicKey:i.isPublicKey,version:i.orEq([void 0,1,2]),data:e=>i.isArray(e)&&e.every((e=>i.isValidData(e)||i.isValidDeleteRequest(e))),fee:i.isNaturalNumberOrZeroLike,timestamp:i.isNumber,proofs:i.ifElse(i.isArray,i.defaultValue(!0),i.orEq([void 0]))};t.dataFieldValidator=e=>i.isValidData(e)||i.isValidDeleteRequest(e),t.dataValidator=i.validateByShema(a,i.getError)},4933:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.exchangeValidator=void 0;const n=r(2082),i=r(3886),a=r(9347),o={type:a.isEq(n.TRANSACTION_TYPE.EXCHANGE),senderPublicKey:a.isPublicKey,version:a.orEq([void 0,1,2,3]),order1:a.validatePipe(a.isRequired(!0),i.orderValidator),order2:a.validatePipe(a.isRequired(!0),i.orderValidator),amount:a.isNumberLike,price:a.isNumberLike,buyMatcherFee:a.isNumberLike,sellMatcherFee:a.isNumberLike,fee:a.isNaturalNumberOrZeroLike,timestamp:a.isNumber,proofs:a.ifElse(a.isArray,a.defaultValue(!0),a.orEq([void 0]))};t.exchangeValidator=a.validateByShema(o,a.getError)},6042:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.validate=void 0,i(r(9347),t);const a=r(9807),o=r(9150),s=r(2070),u=r(2357),l=r(2945),c=r(728),f=r(3578),h=r(571),d=r(6711),p=r(6850),g=r(9437),y=r(4604),m=r(2266),v=r(4933),b=r(4109),S=r(3886),w=r(5807),E=r(1732),A=r(5846),T=r(2486);t.validate={transfer:a.transferValidator,massTransfer:o.massTransferValidator,alias:s.aliasValidator,issue:g.issueValidator,reissue:p.reissueValidator,sponsorship:f.sponsorshipValidator,burn:u.burnValidator,setAssetScript:h.setAssetScriptValidator,cancelLease:l.cancelLeaseValidator,data:c.dataValidator,dataFieldValidator:c.dataFieldValidator,lease:y.leaseValidator,setScript:d.setScriptValidator,invokeScript:m.invokeValidator,exchange:v.exchangeValidator,updateAssetInfo:b.updateAssetInfoValidator,cancelOrder:w.cancelOrderValidator,customData:E.customDataValidator,order:S.orderValidator,wavesAuth:T.authValidator,auth:A.authValidator}},2266:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.invokeValidator=void 0;const n=r(2082),i=r(9347),a={type:i.isEq(n.TRANSACTION_TYPE.INVOKE_SCRIPT),senderPublicKey:i.isPublicKey,version:i.orEq([void 0,1,2]),dApp:i.isRecipient,call:i.ifElse(i.isRequired(!1),i.defaultValue(!0),i.validatePipe(i.pipe(i.prop("function"),i.isString),i.pipe(i.prop("function"),i.prop("length"),i.gte(0)),i.pipe(i.prop("args"),i.isArray),(e=>e.every(i.validatePipe(i.isRequired(!0),i.isValidDataPair))))),payment:i.validatePipe(i.isArray,(e=>e.every(i.validatePipe(i.pipe(i.prop("amount"),i.isNumberLike),i.pipe(i.prop("assetId"),i.isWavesOrAssetId))))),fee:i.isNaturalNumberOrZeroLike,feeAssetId:i.isWavesOrAssetId,chainId:i.isNaturalNumberLike,timestamp:i.isNaturalNumberLike,proofs:i.ifElse(i.isArray,i.defaultValue(!0),i.orEq([void 0]))};t.invokeValidator=i.validateByShema(a,i.getError)},9437:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.issueValidator=void 0;const n=r(2082),i=r(9347),a={type:i.isEq(n.TRANSACTION_TYPE.ISSUE),version:i.orEq([void 0,2,3]),senderPublicKey:i.isPublicKey,name:i.isValidAssetName,description:i.isValidAssetDescription,quantity:i.isNaturalNumberLike,decimals:i.isNumber,reissuable:i.isBoolean,script:i.ifElse(i.isRequired(!0),i.isBase64,i.defaultValue(!0)),chainId:i.isNumber,fee:i.isNaturalNumberOrZeroLike,timestamp:i.isNumber,proofs:i.ifElse(i.isArray,i.defaultValue(!0),i.orEq([void 0]))};t.issueValidator=i.validateByShema(a,i.getError)},4604:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.leaseValidator=void 0;const n=r(2082),i=r(9347),a={type:i.isEq(n.TRANSACTION_TYPE.LEASE),version:i.orEq([void 0,2,3]),senderPublicKey:i.isPublicKey,recipient:i.isRecipient,amount:i.isNaturalNumberLike,fee:i.isNaturalNumberOrZeroLike,timestamp:i.isNumber,proofs:i.ifElse(i.isArray,i.defaultValue(!0),i.orEq([void 0]))};t.leaseValidator=i.validateByShema(a,i.getError)},9150:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.massTransferValidator=void 0;const n=r(2082),i=r(9347),a={type:i.isEq(n.TRANSACTION_TYPE.MASS_TRANSFER),senderPublicKey:i.isPublicKey,version:i.orEq([void 0,1,2]),transfers:i.validatePipe(i.isArray,i.pipe(i.prop("length"),i.gte(0)),i.pipe(i.prop("length"),i.lte(100)),(e=>e.every(i.validatePipe(i.isRequired(!0),i.pipe(i.prop("recipient"),i.isRecipient),i.pipe(i.prop("amount"),i.isNaturalNumberOrZeroLike))))),assetId:i.isWavesOrAssetId,attachment:i.isAttachment,fee:i.isNaturalNumberOrZeroLike,timestamp:i.isNumber,proofs:i.ifElse(i.isArray,i.defaultValue(!0),i.orEq([void 0]))};t.massTransferValidator=i.validateByShema(a,i.getError)},3886:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.orderValidator=void 0;const n=r(9347),i={orderType:n.orEq(["sell","buy"]),matcherPublicKey:n.isPublicKey,version:n.orEq([void 0,1,2,3,4]),assetPair:n.validatePipe(n.isRequired(!0),n.pipe(n.prop("amountAsset"),n.isWavesOrAssetId),n.pipe(n.prop("priceAsset"),n.isWavesOrAssetId)),price:n.isNumberLike,amount:n.isNumberLike,matcherFee:n.isNumberLike,expiration:n.isNumberLike,timestamp:n.isNumber,proofs:n.ifElse(n.isArray,n.defaultValue(!0),n.orEq([void 0]))},a={matcherFeeAssetId:n.orEq([void 0,null,"WAVES"]),senderPublicKey:n.isPublicKey},o={matcherFeeAssetId:n.isWavesOrAssetId,senderPublicKey:n.isPublicKey},s={matcherFeeAssetId:n.isWavesOrAssetId,senderPublicKey:n.isPublicKeyForEthSuppTx},u=n.validateByShema(i,n.getError),l=n.validateByShema(a,n.getError),c=n.validateByShema(o,n.getError),f=n.validateByShema(s,n.getError);t.orderValidator=n.validatePipe(u,n.ifElse(n.pipe(n.prop("version"),(e=>e>=3)),n.ifElse(n.pipe(n.prop("version"),(e=>e>=4)),f,c),l))},6850:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reissueValidator=void 0;const n=r(2082),i=r(9347),a={type:i.isEq(n.TRANSACTION_TYPE.REISSUE),senderPublicKey:i.isPublicKey,version:i.orEq([void 0,2,3]),assetId:i.isAssetId,quantity:i.isNaturalNumberLike,reissuable:i.isBoolean,chainId:i.isNaturalNumberLike,fee:i.isNaturalNumberOrZeroLike,timestamp:i.isNumber,proofs:i.ifElse(i.isArray,i.defaultValue(!0),i.orEq([void 0]))};t.reissueValidator=i.validateByShema(a,i.getError)},571:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setAssetScriptValidator=void 0;const n=r(2082),i=r(9347),a={type:i.isEq(n.TRANSACTION_TYPE.SET_ASSET_SCRIPT),senderPublicKey:i.isPublicKey,version:i.orEq([void 0,1,2]),assetId:i.isAssetId,chainId:i.isNaturalNumberLike,fee:i.isNaturalNumberOrZeroLike,timestamp:i.isNumber,script:i.isBase64,proofs:i.ifElse(i.isArray,i.defaultValue(!0),i.orEq([void 0]))};t.setAssetScriptValidator=i.validateByShema(a,i.getError)},6711:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.setScriptValidator=void 0;const n=r(2082),i=r(9347),a={type:i.isEq(n.TRANSACTION_TYPE.SET_SCRIPT),senderPublicKey:i.isPublicKey,version:i.orEq([void 0,1,2]),chainId:i.isNaturalNumberLike,fee:i.isNaturalNumberOrZeroLike,timestamp:i.isNumber,script:i.ifElse(i.isEq(null),i.defaultValue(!0),i.isBase64),proofs:i.ifElse(i.isArray,i.defaultValue(!0),i.orEq([void 0]))};t.setScriptValidator=i.validateByShema(a,i.getError)},3578:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sponsorshipValidator=void 0;const n=r(2082),i=r(9347),a={type:i.isEq(n.TRANSACTION_TYPE.SPONSORSHIP),senderPublicKey:i.isPublicKey,version:i.orEq([void 0,1,2]),assetId:i.isAssetId,minSponsoredAssetFee:i.isNaturalNumberOrNullLike,fee:i.isNaturalNumberOrZeroLike,timestamp:i.isNumber,proofs:i.ifElse(i.isArray,i.defaultValue(!0),i.orEq([void 0]))};t.sponsorshipValidator=i.validateByShema(a,i.getError)},9807:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transferValidator=void 0;const n=r(9347),i=r(2082),a={type:n.isEq(i.TRANSACTION_TYPE.TRANSFER),senderPublicKey:n.isPublicKey,version:n.orEq([void 0,2,3]),assetId:n.isWavesOrAssetId,feeAssetId:n.isWavesOrAssetId,recipient:n.isRecipient,amount:n.isNaturalNumberOrZeroLike,attachment:n.isAttachment,fee:n.isNaturalNumberOrZeroLike,timestamp:n.isNaturalNumberOrZeroLike,proofs:n.ifElse(n.isArray,n.defaultValue(!0),n.orEq([void 0]))};t.transferValidator=n.validateByShema(a,n.getError)},4109:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.updateAssetInfoValidator=void 0;const n=r(2082),i=r(9347),a={type:i.isEq(n.TRANSACTION_TYPE.UPDATE_ASSET_INFO),senderPublicKey:i.isPublicKey,name:i.isValidAssetName,description:i.isValidAssetDescription,version:i.orEq([1]),assetId:i.isAssetId,fee:i.isNaturalNumberOrZeroLike,timestamp:i.isNumber,proofs:i.ifElse(i.isArray,i.defaultValue(!0),i.orEq([void 0]))};t.updateAssetInfoValidator=i.validateByShema(a,i.getError)},9347:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getError=t.validateByShema=t.isRecipient=t.exception=t.isValidAssetDescription=t.isValidAssetName=t.isValidDeleteRequest=t.isValidData=t.isValidDataPair=t.isAttachment=t.isAssetId=t.isWavesOrAssetId=t.isPublicKeyForEthSuppTx=t.isPublicKey=t.isHash=t.isValidAlias=t.isValidAliasName=t.isValidAddress=t.isBase64=t.isBase58=t.bytesLength=t.isArray=t.isByteArray=t.isBoolean=t.isNaturalNumberOrNullLike=t.isNaturalNumberOrZeroLike=t.isNaturalNumberLike=t.isNumberLike=t.isNumber=t.isString=t.isRequired=t.orEq=t.isEq=t.ifElse=t.gte=t.lte=t.prop=t.validatePipe=t.pipe=t.nope=t.defaultValue=void 0;const n=r(9846),i=140,a={AVAILABLE_CHARS:"-.0123456789@_abcdefghijklmnopqrstuvwxyz",MAX_ALIAS_LENGTH:30,MIN_ALIAS_LENGTH:4},o=4,s=16,u=1e3;t.defaultValue=e=>()=>e,t.nope=e=>e,t.pipe=function(){for(var e=arguments.length,t=new Array(e),r=0;rt.reduce(((e,t)=>t(e)),e)},t.validatePipe=function(){for(var e=arguments.length,t=new Array(e),r=0;r{let r=!0;for(const n of t)if(r=!!n(e),!r)return!1;return r}},t.prop=e=>t=>t?t[e]:void 0,t.lte=e=>t=>e>=t,t.gte=e=>t=>e<=t,t.ifElse=(e,t,r)=>n=>e(n)?t(n):r(n),t.isEq=e=>r=>{switch(!0){case t.isNumber(r)&&t.isNumber(e):return Number(r)===Number(e);case t.isString(r)&&t.isString(e):return String(e)===String(r);case t.isBoolean(r)&&t.isBoolean(e):return Boolean(r)===Boolean(e);default:return e===r}},t.orEq=e=>r=>e.some(t.isEq(r)),t.isRequired=e=>t=>!e||null!=t,t.isString=e=>"string"===typeof e||e instanceof String,t.isNumber=e=>("number"===typeof e||e instanceof Number)&&!isNaN(Number(e)),t.isNumberLike=e=>null!=e&&!isNaN(Number(e))&&!(!e&&0!==e),t.isNaturalNumberLike=e=>null!=e&&!isNaN(Number(e))&&Number(e)>0,t.isNaturalNumberOrZeroLike=e=>null!=e&&!isNaN(Number(e))&&Number(e)>=0,t.isNaturalNumberOrNullLike=e=>!isNaN(Number(e))&&Number(e)>0||null===e,t.isBoolean=e=>null!=e&&("boolean"===typeof e||e instanceof Boolean),t.isByteArray=e=>{if(!e)return!1;const r=new Uint8Array(e);return r.length===e.length&&r.every(((r,n)=>t.isEq(r)(e[n])))},t.isArray=e=>Array.isArray(e),t.bytesLength=e=>t=>{try{return Uint8Array.from(t).length===e}catch(r){return!1}},t.isBase58=e=>{try{n.base58Decode(e)}catch(t){return!1}return!0},t.isBase64=e=>{try{e=e.replace(/^base64:/,""),n.base64Decode(e)}catch(t){return!1}return!0},t.isValidAddress=(e,r)=>{if("string"!==typeof e||!t.isBase58(e))return!1;let i=n.base58Decode(e);if(1!==i[0])return!1;if(null!=r&&i[1]!=r)return!1;let a=i.slice(0,22),o=i.slice(22,26),s=n.keccak(n.blake2b(a)).slice(0,4);for(let t=0;t<4;t++)if(o[t]!==s[t])return!1;return!0};var l;t.isValidAliasName=t.ifElse((l=a.AVAILABLE_CHARS,e=>e.split("").every((e=>l.includes(e)))),t.pipe(t.prop("length"),t.validatePipe(t.lte(a.MAX_ALIAS_LENGTH),t.gte(a.MIN_ALIAS_LENGTH))),t.defaultValue(!1)),t.isValidAlias=t.validatePipe(t.isString,t.pipe((e=>e.split(":")),t.ifElse((e=>"alias"!==e[0]||3!==e.length),t.defaultValue(!1),t.pipe(t.prop(2),t.isValidAliasName)))),t.isHash=t.validatePipe(t.isRequired(!0),t.isBase58,t.pipe((e=>n.base58Decode(e)),t.bytesLength(32))),t.isPublicKey=t.isHash,t.isPublicKeyForEthSuppTx=t.ifElse(t.orEq(["",null,void 0]),t.defaultValue(!0),t.pipe((e=>n.base58Decode(e)),(e=>{try{return 32===Uint8Array.from(e).length||64===Uint8Array.from(e).length}catch(t){return!1}}))),t.isWavesOrAssetId=t.ifElse(t.orEq(["",null,void 0,"WAVES"]),t.defaultValue(!0),t.isHash),t.isAssetId=t.isHash,t.isAttachment=t.ifElse(t.orEq([null,void 0]),t.defaultValue(!0),t.ifElse(t.validatePipe(t.isArray,(e=>e.every(t.isValidDataPair))),t.defaultValue(!0),t.pipe(t.ifElse(t.isBase58,n.base58Decode,t.nope),t.ifElse(t.isByteArray,t.pipe(t.prop("length"),t.lte(i)),t.defaultValue(!1)))));const c={integer:t.isNumberLike,boolean:t.isBoolean,string:t.isString,binary:t.isBase64,list:t.isArray};t.isValidDataPair=e=>!(!c[e.type]||!c[e.type](e.value)),t.isValidData=t.validatePipe(t.isRequired(!0),t.pipe(t.prop("key"),t.validatePipe(t.isString,(e=>!!e))),t.isValidDataPair),t.isValidDeleteRequest=t.validatePipe(t.isRequired(!0),t.pipe(t.prop("key"),t.validatePipe(t.isString,(e=>!!e))),(e=>{let{type:t,value:r}=e;return null==t&&null==r})),t.isValidAssetName=t.validatePipe(t.isRequired(!0),t.isString,t.pipe(n.stringToBytes,t.prop("length"),t.ifElse(t.gte(o),t.lte(s),t.defaultValue(!1)))),t.isValidAssetDescription=t.validatePipe(t.isRequired(!1),t.defaultValue(!0),t.pipe(n.stringToBytes,t.prop("length"),t.lte(u))),t.exception=e=>{throw new Error(e)},t.isRecipient=t.ifElse(t.isValidAddress,t.defaultValue(!0),t.isValidAlias),t.validateByShema=(e,r)=>n=>(Object.entries(e).forEach((e=>{let[i,a]=e;const o=t.prop(i)(n||{});a(o)||t.exception(r(i,o))})),!0),t.getError=(e,t)=>'tx "'.concat(e,'", has wrong data: ').concat(JSON.stringify(t),". Check tx data.")},2486:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.authValidator=void 0;const n=r(9347),i={publicKey:n.isPublicKey,timestamp:n.isNumber};t.authValidator=n.validateByShema(i,n.getError)},4445:(e,t)=>{"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,a=s(e),o=a[0],u=a[1],l=new i(function(e,t,r){return 3*(t+r)/4-r}(0,o,u)),c=0,f=u>0?o-4:o;for(r=0;r>16&255,l[c++]=t>>8&255,l[c++]=255&t;2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,l[c++]=255&t);1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,l[c++]=t>>8&255,l[c++]=255&t);return l},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,a=[],o=16383,s=0,l=n-i;sl?l:s+o));1===i?(t=e[n-1],a.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],a.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return a.join("")};for(var r=[],n=[],i="undefined"!==typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=a[o],n[a.charCodeAt(o)]=o;function s(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,n){for(var i,a,o=[],s=t;s>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},2161:(e,t,r)=>{var n;!function(){"use strict";var i="input is invalid type",a="object"===typeof window,o=a?window:{};o.JS_SHA3_NO_WINDOW&&(a=!1);var s=!a&&"object"===typeof self;!o.JS_SHA3_NO_NODE_JS&&"object"===typeof process&&process.versions&&process.versions.node?o=r.g:s&&(o=self);var u=!o.JS_SHA3_NO_COMMON_JS&&e.exports,l=r.amdO,c=!o.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],g=[224,256,384,512],y=[128,256],m=["hex","buffer","arrayBuffer","array","digest"],v={128:168,256:136};!o.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!c||!o.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 M(e,t,e).update(n)[r]()}},S=function(e,t,r){return function(n,i){return new M(e,t,i).update(n)[r]()}},w=function(e,t,r){return function(t,n,i,a){return I["cshake"+e].update(t,n,i,a)[r]()}},E=function(e,t,r){return function(t,n,i,a){return I["kmac"+e].update(t,n,i,a)[r]()}},A=function(e,t,r,n){for(var i=0;i>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 L(e,t,r){M.call(this,e,t,r)}M.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(c&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!c||!ArrayBuffer.isView(e)))throw new Error(i);t=!0}for(var n,a,o=this.blocks,s=this.byteCount,u=e.length,l=this.blockCount,f=0,h=this.s;f>2]|=e[f]<>2]|=a<>2]|=(192|a>>6)<>2]|=(128|63&a)<=57344?(o[n>>2]|=(224|a>>12)<>2]|=(128|a>>6&63)<>2]|=(128|63&a)<>2]|=(240|a>>18)<>2]|=(128|a>>12&63)<>2]|=(128|a>>6&63)<>2]|=(128|63&a)<=s){for(this.start=n-s,this.block=o[l],n=0;n>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},M.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(c&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!c||!ArrayBuffer.isView(e)))throw new Error(i);t=!0}var n=0,a=e.length;if(t)n=a;else for(var o=0;o=57344?n+=3:(s=65536+((1023&s)<<10|1023&e.charCodeAt(++o)),n+=4)}return n+=this.encode(8*n),this.update(e),n},M.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>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];o%t===0&&(D(r),a=0)}return i&&(e=r[a],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},M.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,a=0,o=0,s=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(e);o>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;s%r===0&&D(n)}return a&&(e=s<<2,t=n[o],u[e]=255&t,a>1&&(u[e+1]=t>>8&255),a>2&&(u[e+2]=t>>16&255)),u},L.prototype=new M,L.prototype.finalize=function(){return this.encode(this.outputBits,!0),M.prototype.finalize.call(this)};var D=function(e){var t,r,n,i,a,o,s,u,l,c,f,h,d,g,y,m,v,b,S,w,E,A,T,C,I,k,B,_,P,O,N,R,M,L,D,F,x,U,j,V,K,J,H,G,z,X,q,Y,Q,Z,W,$,ee,te,re,ne,ie,ae,oe,se,ue,le,ce;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],a=e[1]^e[11]^e[21]^e[31]^e[41],o=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],l=e[5]^e[15]^e[25]^e[35]^e[45],c=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])^(o<<1|s>>>31),r=(d=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|o>>>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|l>>>31),r=a^(l<<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=o^(c<<1|f>>>31),r=s^(f<<1|c>>>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=l^(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=c^(i<<1|a>>>31),r=f^(a<<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,g=e[0],y=e[1],X=e[11]<<4|e[10]>>>28,q=e[10]<<4|e[11]>>>28,_=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,J=e[40]<<18|e[41]>>>14,H=e[41]<<18|e[40]>>>14,L=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,m=e[13]<<12|e[12]>>>20,v=e[12]<<12|e[13]>>>20,Y=e[22]<<10|e[23]>>>22,Q=e[23]<<10|e[22]>>>22,O=e[33]<<13|e[32]>>>19,N=e[32]<<13|e[33]>>>19,le=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,F=e[14]<<6|e[15]>>>26,x=e[15]<<6|e[14]>>>26,b=e[25]<<11|e[24]>>>21,S=e[24]<<11|e[25]>>>21,Z=e[34]<<15|e[35]>>>17,W=e[35]<<15|e[34]>>>17,R=e[45]<<29|e[44]>>>3,M=e[44]<<29|e[45]>>>3,C=e[6]<<28|e[7]>>>4,I=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,U=e[26]<<25|e[27]>>>7,j=e[27]<<25|e[26]>>>7,w=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,G=e[8]<<27|e[9]>>>5,z=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,B=e[19]<<20|e[18]>>>12,ae=e[29]<<7|e[28]>>>25,oe=e[28]<<7|e[29]>>>25,V=e[38]<<8|e[39]>>>24,K=e[39]<<8|e[38]>>>24,A=e[48]<<14|e[49]>>>18,T=e[49]<<14|e[48]>>>18,e[0]=g^~m&b,e[1]=y^~v&S,e[10]=C^~k&_,e[11]=I^~B&P,e[20]=L^~F&U,e[21]=D^~x&j,e[30]=G^~X&Y,e[31]=z^~q&Q,e[40]=te^~ne&ae,e[41]=re^~ie&oe,e[2]=m^~b&w,e[3]=v^~S&E,e[12]=k^~_&O,e[13]=B^~P&N,e[22]=F^~U&V,e[23]=x^~j&K,e[32]=X^~Y&Z,e[33]=q^~Q&W,e[42]=ne^~ae&se,e[43]=ie^~oe&ue,e[4]=b^~w&A,e[5]=S^~E&T,e[14]=_^~O&R,e[15]=P^~N&M,e[24]=U^~V&J,e[25]=j^~K&H,e[34]=Y^~Z&$,e[35]=Q^~W&ee,e[44]=ae^~se&le,e[45]=oe^~ue&ce,e[6]=w^~A&g,e[7]=E^~T&y,e[16]=O^~R&C,e[17]=N^~M&I,e[26]=V^~J&L,e[27]=K^~H&D,e[36]=Z^~$&G,e[37]=W^~ee&z,e[46]=se^~le&te,e[47]=ue^~ce&re,e[8]=A^~g&m,e[9]=T^~y&v,e[18]=R^~C&k,e[19]=M^~I&B,e[28]=J^~L&F,e[29]=H^~D&x,e[38]=$^~G&X,e[39]=ee^~z&q,e[48]=le^~te&ne,e[49]=ce^~re&ie,e[0]^=p[n],e[1]^=p[n+1]};if(u)e.exports=I;else{for(B=0;B{e.exports=r;var t=null;try{t=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(C){}function r(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function n(e){return!0===(e&&e.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=n;var i={},a={};function o(e,t){var r,n,o;return t?(o=0<=(e>>>=0)&&e<256)&&(n=a[e])?n:(r=u(e,(0|e)<0?-1:0,!0),o&&(a[e]=r),r):(o=-128<=(e|=0)&&e<128)&&(n=i[e])?n:(r=u(e,e<0?-1:0,!1),o&&(i[e]=r),r)}function s(e,t){if(isNaN(e))return t?m:y;if(t){if(e<0)return m;if(e>=d)return E}else{if(e<=-p)return A;if(e+1>=p)return w}return e<0?s(-e,t).neg():u(e%h|0,e/h|0,t)}function u(e,t,n){return new r(e,t,n)}r.fromInt=o,r.fromNumber=s,r.fromBits=u;var l=Math.pow;function c(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return y;if("number"===typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||360)throw Error("interior hyphen");if(0===n)return c(e.substring(1),t,r).neg();for(var i=s(l(r,8)),a=y,o=0;o>>0:this.low},T.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},T.toString=function(e){if((e=e||10)<2||36>>0).toString(e);if((a=u).isZero())return c+o;for(;c.length<6;)c="0"+c;o=""+c+o}},T.getHighBits=function(){return this.high},T.getHighBitsUnsigned=function(){return this.high>>>0},T.getLowBits=function(){return this.low},T.getLowBitsUnsigned=function(){return this.low>>>0},T.getNumBitsAbs=function(){if(this.isNegative())return this.eq(A)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<=0},T.isOdd=function(){return 1===(1&this.low)},T.isEven=function(){return 0===(1&this.low)},T.equals=function(e){return n(e)||(e=f(e)),(this.unsigned===e.unsigned||this.high>>>31!==1||e.high>>>31!==1)&&(this.high===e.high&&this.low===e.low)},T.eq=T.equals,T.notEquals=function(e){return!this.eq(e)},T.neq=T.notEquals,T.ne=T.notEquals,T.lessThan=function(e){return this.comp(e)<0},T.lt=T.lessThan,T.lessThanOrEqual=function(e){return this.comp(e)<=0},T.lte=T.lessThanOrEqual,T.le=T.lessThanOrEqual,T.greaterThan=function(e){return this.comp(e)>0},T.gt=T.greaterThan,T.greaterThanOrEqual=function(e){return this.comp(e)>=0},T.gte=T.greaterThanOrEqual,T.ge=T.greaterThanOrEqual,T.compare=function(e){if(n(e)||(e=f(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},T.comp=T.compare,T.negate=function(){return!this.unsigned&&this.eq(A)?A:this.not().add(v)},T.neg=T.negate,T.add=function(e){n(e)||(e=f(e));var t=this.high>>>16,r=65535&this.high,i=this.low>>>16,a=65535&this.low,o=e.high>>>16,s=65535&e.high,l=e.low>>>16,c=0,h=0,d=0,p=0;return d+=(p+=a+(65535&e.low))>>>16,h+=(d+=i+l)>>>16,c+=(h+=r+s)>>>16,c+=t+o,u((d&=65535)<<16|(p&=65535),(c&=65535)<<16|(h&=65535),this.unsigned)},T.subtract=function(e){return n(e)||(e=f(e)),this.add(e.neg())},T.sub=T.subtract,T.multiply=function(e){if(this.isZero())return y;if(n(e)||(e=f(e)),t)return u(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return y;if(this.eq(A))return e.isOdd()?A:y;if(e.eq(A))return this.isOdd()?A:y;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(g)&&e.lt(g))return s(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,i=65535&this.high,a=this.low>>>16,o=65535&this.low,l=e.high>>>16,c=65535&e.high,h=e.low>>>16,d=65535&e.low,p=0,m=0,v=0,b=0;return v+=(b+=o*d)>>>16,m+=(v+=a*d)>>>16,v&=65535,m+=(v+=o*h)>>>16,p+=(m+=i*d)>>>16,m&=65535,p+=(m+=a*h)>>>16,m&=65535,p+=(m+=o*c)>>>16,p+=r*d+i*h+a*c+o*l,u((v&=65535)<<16|(b&=65535),(p&=65535)<<16|(m&=65535),this.unsigned)},T.mul=T.multiply,T.divide=function(e){if(n(e)||(e=f(e)),e.isZero())throw Error("division by zero");var r,i,a;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?u((this.unsigned?t.div_u:t.div_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?m:y;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return m;if(e.gt(this.shru(1)))return b;a=m}else{if(this.eq(A))return e.eq(v)||e.eq(S)?A:e.eq(A)?v:(r=this.shr(1).div(e).shl(1)).eq(y)?e.isNegative()?v:S:(i=this.sub(e.mul(r)),a=r.add(i.div(e)));if(e.eq(A))return this.unsigned?m:y;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();a=y}for(i=this;i.gte(e);){r=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(r)/Math.LN2),c=o<=48?1:l(2,o-48),h=s(r),d=h.mul(e);d.isNegative()||d.gt(i);)d=(h=s(r-=c,this.unsigned)).mul(e);h.isZero()&&(h=v),a=a.add(h),i=i.sub(d)}return a},T.div=T.divide,T.modulo=function(e){return n(e)||(e=f(e)),t?u((this.unsigned?t.rem_u:t.rem_s)(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},T.mod=T.modulo,T.rem=T.modulo,T.not=function(){return u(~this.low,~this.high,this.unsigned)},T.and=function(e){return n(e)||(e=f(e)),u(this.low&e.low,this.high&e.high,this.unsigned)},T.or=function(e){return n(e)||(e=f(e)),u(this.low|e.low,this.high|e.high,this.unsigned)},T.xor=function(e){return n(e)||(e=f(e)),u(this.low^e.low,this.high^e.high,this.unsigned)},T.shiftLeft=function(e){return n(e)&&(e=e.toInt()),0===(e&=63)?this:e<32?u(this.low<>>32-e,this.unsigned):u(0,this.low<>>e|this.high<<32-e,this.high>>e,this.unsigned):u(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},T.shr=T.shiftRight,T.shiftRightUnsigned=function(e){if(n(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?u(this.low>>>e|t<<32-e,t>>>e,this.unsigned):u(32===e?t:t>>>e-32,0,this.unsigned)},T.shru=T.shiftRightUnsigned,T.shr_u=T.shiftRightUnsigned,T.toSigned=function(){return this.unsigned?u(this.low,this.high,!1):this},T.toUnsigned=function(){return this.unsigned?this:u(this.low,this.high,!0)},T.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},T.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},T.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},r.fromBytes=function(e,t,n){return n?r.fromBytesLE(e,t):r.fromBytesBE(e,t)},r.fromBytesLE=function(e,t){return new r(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},r.fromBytesBE=function(e,t){return new r(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},7541:(e,t,r)=>{"use strict";var n=function(){if("undefined"!==typeof self)return self;if("undefined"!==typeof window)return window;if("undefined"!==typeof r.g)return r.g;throw new Error("unable to locate global object")}();e.exports=t=n.fetch,n.fetch&&(t.default=n.fetch.bind(n)),t.Headers=n.Headers,t.Request=n.Request,t.Response=n.Response},9353:(e,t,r)=>{var n=r(45);function i(e,t){n.cipher.registerAlgorithm(e,(function(){return new n.aes.Algorithm(e,t)}))}r(9151),r(1655),r(3900),e.exports=n.aes=n.aes||{},n.aes.startEncrypting=function(e,t,r,n){var i=g({key:e,output:r,decrypt:!1,mode:n});return i.start(t),i},n.aes.createEncryptionCipher=function(e,t){return g({key:e,output:null,decrypt:!1,mode:t})},n.aes.startDecrypting=function(e,t,r,n){var i=g({key:e,output:r,decrypt:!0,mode:n});return i.start(t),i},n.aes.createDecryptionCipher=function(e,t){return g({key:e,output:null,decrypt:!0,mode:t})},n.aes.Algorithm=function(e,t){c||h();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(e,t){return p(r._w,e,t,!1)},decrypt:function(e,t){return p(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>>=2;for(i=0;i>8^255&f^99,a[g]=f,o[f]=g,d=(h=e[f])<<24^f<<16^f<<8^f^h,p=((r=e[g])^(n=e[r])^(i=e[n]))<<24^(g^i)<<16^(g^n^i)<<8^g^r^i;for(var m=0;m<4;++m)u[m][g]=d,l[m][f]=p,d=d<<24|d>>>8,p=p<<24|p>>>8;0===g?g=y=1:(g=r^e[e[e[r^i]]],y^=e[e[y]])}}function d(e,t){for(var r,n=e.slice(0),i=1,o=n.length,u=f*(o+6+1),c=o;c>>16&255]<<24^a[r>>>8&255]<<16^a[255&r]<<8^a[r>>>24]^s[i]<<24,i++):o>6&&c%o===4&&(r=a[r>>>24]<<24^a[r>>>16&255]<<16^a[r>>>8&255]<<8^a[255&r]),n[c]=n[c-o]^r;if(t){for(var h,d=l[0],p=l[1],g=l[2],y=l[3],m=n.slice(0),v=(c=0,(u=n.length)-f);c>>24]]^p[a[h>>>16&255]]^g[a[h>>>8&255]]^y[a[255&h]];n=m}return n}function p(e,t,r,n){var i,s,c,f,h,d,p,g,y,m,v,b,S=e.length/4-1;n?(i=l[0],s=l[1],c=l[2],f=l[3],h=o):(i=u[0],s=u[1],c=u[2],f=u[3],h=a),d=t[0]^e[0],p=t[n?3:1]^e[1],g=t[2]^e[2],y=t[n?1:3]^e[3];for(var w=3,E=1;E>>24]^s[p>>>16&255]^c[g>>>8&255]^f[255&y]^e[++w],v=i[p>>>24]^s[g>>>16&255]^c[y>>>8&255]^f[255&d]^e[++w],b=i[g>>>24]^s[y>>>16&255]^c[d>>>8&255]^f[255&p]^e[++w],y=i[y>>>24]^s[d>>>16&255]^c[p>>>8&255]^f[255&g]^e[++w],d=m,p=v,g=b;r[0]=h[d>>>24]<<24^h[p>>>16&255]<<16^h[g>>>8&255]<<8^h[255&y]^e[++w],r[n?3:1]=h[p>>>24]<<24^h[g>>>16&255]<<16^h[y>>>8&255]<<8^h[255&d]^e[++w],r[2]=h[g>>>24]<<24^h[y>>>16&255]<<16^h[d>>>8&255]<<8^h[255&p]^e[++w],r[n?1:3]=h[y>>>24]<<24^h[d>>>16&255]<<16^h[p>>>8&255]<<8^h[255&g]^e[++w]}function g(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 a=null;r instanceof n.util.ByteBuffer&&(a=r,r={}),(r=r||{}).output=a,r.iv=e,i.call(t,r)},t}},5465:(e,t,r)=>{var n=r(45);r(3900),r(3225);var i=e.exports=n.asn1=n.asn1||{};function a(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,a,o){if(n.util.isArray(a)){for(var s=[],u=0;ut){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 g=32===(32&u);if(g)if(f=[],void 0===d)for(;;){if(a(e,t,2),e.bytes(2)===String.fromCharCode(0,0)){e.getBytes(2),t-=2;break}s=e.length(),f.push(o(e,t,r+1,n)),t-=s-e.length()}else for(;d>0;)s=e.length(),f.push(o(e,d,r+1,n)),t-=s-e.length(),d-=s-e.length();if(void 0===f&&l===i.Class.UNIVERSAL&&c===i.Type.BITSTRING&&(h=e.bytes(d)),void 0===f&&n.decodeBitStrings&&l===i.Class.UNIVERSAL&&c===i.Type.BITSTRING&&d>1){var y=e.read,m=t,v=0;if(c===i.Type.BITSTRING&&(a(e,t,1),v=e.getByte(),t--),0===v)try{s=e.length();var b=o(e,t,r+1,{verbose:n.verbose,strict:!0,decodeBitStrings:!0}),S=s-e.length();t-=S,c==i.Type.BITSTRING&&S++;var w=b.tagClass;S!==d||w!==i.Class.UNIVERSAL&&w!==i.Class.CONTEXT_SPECIFIC||(f=[b])}catch(A){}void 0===f&&(e.read=y,t=m)}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(c===i.Type.BMPSTRING)for(f="";d>0;d-=2)a(e,t,2),f+=String.fromCharCode(e.getInt16()),t-=2;else f=e.getBytes(d)}var E=void 0===h?null:{bitStringContents:h};return i.create(l,c,g,f,E)}i.fromDer=function(e,t){return void 0===t&&(t={strict:!0,decodeBitStrings:!0}),"boolean"===typeof t&&(t={strict:t,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),"string"===typeof e&&(e=n.util.createBuffer(e)),o(e,e.length(),0,t)},i.toDer=function(e){var t=n.util.createBuffer(),r=e.tagClass|e.type,a=n.util.createBuffer(),o=!1;if("bitStringContents"in e&&(o=!0,e.original&&(o=i.equals(e,e.original))),o)a.putBytes(e.bitStringContents);else if(e.composed){e.constructed?r|=32:a.putByte(0);for(var s=0;s1&&(0===e.value.charCodeAt(0)&&0===(128&e.value.charCodeAt(1))||255===e.value.charCodeAt(0)&&128===(128&e.value.charCodeAt(1)))?a.putBytes(e.value.substr(1)):a.putBytes(e.value);if(t.putByte(r),a.length()<=127)t.putByte(127&a.length());else{var u=a.length(),l="";do{l+=String.fromCharCode(255&u),u>>>=8}while(u>0);t.putByte(128|l.length);for(s=l.length-1;s>=0;--s)t.putByte(l.charCodeAt(s))}return t.putBuffer(a),t},i.oidToDer=function(e){var t,r,i,a,o=e.split("."),s=n.util.createBuffer();s.putByte(40*parseInt(o[0],10)+parseInt(o[1],10));for(var u=2;u>>=7,t||(a|=128),r.push(a),t=!1}while(i>0);for(var l=r.length-1;l>=0;--l)s.putByte(r[l])}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),a=parseInt(e.substr(6,2),10),o=parseInt(e.substr(8,2),10),s=0;if(e.length>11){var u=e.charAt(10),l=10;"+"!==u&&"-"!==u&&(s=parseInt(e.substr(10,2),10),l+=2)}if(t.setUTCFullYear(r,n,i),t.setUTCHours(a,o,s,0),l&&("+"===(u=e.charAt(l))||"-"===u)){var c=60*parseInt(e.substr(l+1,2),10)+parseInt(e.substr(l+4,2),10);c*=6e4,"+"===u?t.setTime(+t-c):t.setTime(+t+c)}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),a=parseInt(e.substr(8,2),10),o=parseInt(e.substr(10,2),10),s=parseInt(e.substr(12,2),10),u=0,l=0,c=!1;"Z"===e.charAt(e.length-1)&&(c=!0);var f=e.length-5,h=e.charAt(f);"+"!==h&&"-"!==h||(l=60*parseInt(e.substr(f+1,2),10)+parseInt(e.substr(f+4,2),10),l*=6e4,"+"===h&&(l*=-1),c=!0);return"."===e.charAt(14)&&(u=1e3*parseFloat(e.substr(14),10)),c?(t.setUTCFullYear(r,n,i),t.setUTCHours(a,o,s,u),t.setTime(+t+l)):(t.setFullYear(r,n,i),t.setHours(a,o,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=-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,a){var o=!1;if(e.tagClass!==t.tagClass&&"undefined"!==typeof t.tagClass||e.type!==t.type&&"undefined"!==typeof t.type)a&&(e.tagClass!==t.tagClass&&a.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&a.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));else if(e.constructed===t.constructed||"undefined"===typeof t.constructed){if(o=!0,t.value&&n.util.isArray(t.value))for(var s=0,u=0;o&&u0&&(a+="\n");for(var o="",u=0;u1?a+="0x"+n.util.bytesToHex(e.value.slice(1)):a+="(none)",e.value.length>0){var h=e.value.charCodeAt(0);1==h?a+=" (1 unused bit shown)":h>1&&(a+=" ("+h+" unused bits shown)")}}else e.type===i.Type.OCTETSTRING?(s.test(e.value)||(a+="("+e.value+") "),a+="0x"+n.util.bytesToHex(e.value)):e.type===i.Type.UTF8?a+=n.util.decodeUtf8(e.value):e.type===i.Type.PRINTABLESTRING||e.type===i.Type.IA5String?a+=e.value:s.test(e.value)?a+="0x"+n.util.bytesToHex(e.value):0===e.value.length?a+="[null]":a+=e.value}return a}},6407: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,a=t.length,o=t.charAt(0),s=[0];for(i=0;i0;)s.push(l%a),l=l/a|0}for(i=0;0===e[i]&&i=0;--i)n+=t[s[i]]}else n=function(e,t){var r=0,n=t.length,i=t.charAt(0),a=[0];for(r=0;r0;)a.push(s%n),s=s/n|0}var u="";for(r=0;0===e.at(r)&&r=0;--r)u+=t[a[r]];return u}(e,t);if(r){var c=new RegExp(".{1,"+r+"}","g");n=n.match(c).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>=8;for(;c>0;)s.push(255&c),c>>=8}for(var f=0;e[f]===o&&f{var n=r(45);r(3900),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)))}},1655:(e,t,r)=>{var n=r(45);r(3900),n.cipher=n.cipher||{};var i=e.exports=n.cipher.modes=n.cipher.modes||{};function a(e){if("string"===typeof e&&(e=n.util.createBuffer(e)),n.util.isArray(e)&&e.length>4){var t=e;e=n.util.createBuffer();for(var r=0;r0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)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=a(e.iv),this._prev=this._iv.slice(0)}},i.cbc.prototype.encrypt=function(e,t,r){if(e.length()0))return!0;for(var n=0;n0))return!0;for(var n=0;n0)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=a(e.iv),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;i0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i0)e.read-=this.blockSize;else for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!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;i0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i0)e.read-=this.blockSize;else for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!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=a(e.iv),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;i0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i0)e.read-=this.blockSize;else for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!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=a(e.iv),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;i0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}o(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),o(this._inBlock),this._partialBytes=0,t=n.util.createBuffer(t),this._aDataLength=s(8*t.length());var a=t.length()%this.blockSize;for(a&&t.fillWithByte(0,this.blockSize-a),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;i0&&(a=this.blockSize-a),this._partialOutput.clear();for(i=0;i0&&this._partialOutput.getBytes(this._partialBytes),a>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(a-this._partialBytes)),this._partialBytes=a,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),o(this._inBlock)},i.gcm.prototype.decrypt=function(e,t,r){var n=e.length();if(n0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),o(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;i0;--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,a=new Array(i),o=0;o>>1,i=new Array(r);i[n]=e.slice(0);for(var a=n>>>1;a>0;)this.pow(i[2*a],i[a]=[]),a>>=1;for(a=2;a{var n=r(45);function i(e,t){n.cipher.registerAlgorithm(e,(function(){return new n.des.Algorithm(e,t)}))}r(9151),r(1655),r(3900),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],a=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],o=[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],l=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],c=[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],g=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],y=e.length()>8?3:1,m=[],v=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],b=0,S=0;S>>4^E))<<4,w^=t=65535&((E^=t)>>>-16^w),w^=(t=858993459&(w>>>2^(E^=t<<-16)))<<2,w^=t=65535&((E^=t)>>>-16^w),w^=(t=1431655765&(w>>>1^(E^=t<<-16)))<<1,w^=t=16711935&((E^=t)>>>8^w),t=(w^=(t=1431655765&(w>>>1^(E^=t<<8)))<<1)<<8|(E^=t)>>>20&240,w=E<<24|E<<8&16711680|E>>>8&65280|E>>>24&240,E=t;for(var A=0;A>>26,E=E<<2|E>>>26):(w=w<<1|w>>>27,E=E<<1|E>>>27),E&=-15;var T=r[(w&=-15)>>>28]|n[w>>>24&15]|i[w>>>20&15]|a[w>>>16&15]|o[w>>>12&15]|s[w>>>8&15]|u[w>>>4&15],C=l[E>>>28]|c[E>>>24&15]|f[E>>>20&15]|h[E>>>16&15]|d[E>>>12&15]|p[E>>>8&15]|g[E>>>4&15];t=65535&(C>>>16^T),m[b++]=T^t,m[b++]=C^t<<16}}return m}(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 a=[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],o=[-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],l=[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],c=[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 g=t[0],y=t[1];g^=(d=252645135&(g>>>4^y))<<4,g^=(d=65535&(g>>>16^(y^=d)))<<16,g^=d=858993459&((y^=d)>>>2^g),g^=d=16711935&((y^=d<<2)>>>8^g),g=(g^=(d=1431655765&(g>>>1^(y^=d<<8)))<<1)<<1|g>>>31,y=(y^=d)<<1|y>>>31;for(var m=0;m>>4|y<<28)^e[S+1];d=g,g=y,y=d^(o[w>>>24&63]|u[w>>>16&63]|c[w>>>8&63]|h[63&w]|a[E>>>24&63]|s[E>>>16&63]|l[E>>>8&63]|f[63&E])}d=g,g=y,y=d}y=y>>>1|y<<31,y^=d=1431655765&((g=g>>>1|g<<31)>>>1^y),y^=(d=16711935&(y>>>8^(g^=d<<1)))<<8,y^=(d=858993459&(y>>>2^(g^=d)))<<2,y^=d=65535&((g^=d)>>>16^y),y^=d=252645135&((g^=d<<16)>>>4^y),g^=d<<4,r[0]=g,r[1]=y}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 a=null;r instanceof n.util.ByteBuffer&&(a=r,r={}),(r=r||{}).output=a,r.iv=e,i.call(t,r)},t}},45:e=>{e.exports={options:{usePureJavaScript:!1}}},8163:(e,t,r)=>{var n=r(45);r(5693),r(3900),(e.exports=n.hmac=n.hmac||{}).create=function(){var e=null,t=null,r=null,i=null,a={start:function(a,o){if(null!==a)if("string"===typeof a){if(!((a=a.toLowerCase())in n.md.algorithms))throw new Error('Unknown hash algorithm "'+a+'"');t=n.md.algorithms[a].create()}else t=a;if(null===o)o=e;else{if("string"===typeof o)o=n.util.createBuffer(o);else if(n.util.isArray(o)){var s=o;o=n.util.createBuffer();for(var u=0;ut.blockLength&&(t.start(),t.update(o.bytes()),o=t.digest()),r=n.util.createBuffer(),i=n.util.createBuffer(),l=o.length();for(u=0;u{var n,i=r(45);e.exports=i.jsbn=i.jsbn||{};function a(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 o(){return new a(null)}function s(e,t,r,n,i,a){for(var o=16383&t,s=t>>14;--a>=0;){var u=16383&this.data[e],l=this.data[e++]>>14,c=s*u+l*o;i=((u=o*u+((16383&c)<<14)+r.data[n]+i)>>28)+(c>>14)+s*l,r.data[n++]=268435455&u}return i}i.jsbn.BigInteger=a,"undefined"===typeof navigator?(a.prototype.am=s,n=28):"Microsoft Internet Explorer"==navigator.appName?(a.prototype.am=function(e,t,r,n,i,a){for(var o=32767&t,s=t>>15;--a>=0;){var u=32767&this.data[e],l=this.data[e++]>>15,c=s*u+l*o;i=((u=o*u+((32767&c)<<15)+r.data[n]+(1073741823&i))>>>30)+(c>>>15)+s*l+(i>>>30),r.data[n++]=1073741823&u}return i},n=30):"Netscape"!=navigator.appName?(a.prototype.am=function(e,t,r,n,i,a){for(;--a>=0;){var o=t*this.data[e++]+r.data[n]+i;i=Math.floor(o/67108864),r.data[n++]=67108863&o}return i},n=26):(a.prototype.am=s,n=28),a.prototype.DB=n,a.prototype.DM=(1<>>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 y(e){this.m=e}function m(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=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 A(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function T(){}function C(e){return e}function I(e){this.r2=o(),this.q3=o(),a.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}y.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},y.prototype.revert=function(e){return e},y.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},y.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},y.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},m.prototype.convert=function(e){var t=o();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(a.ZERO)>0&&this.m.subTo(t,t),t},m.prototype.revert=function(e){var t=o();return e.copyTo(t),this.reduce(t),t},m.prototype.reduce=function(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;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)},m.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},m.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},a.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},a.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},a.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,o=0;--n>=0;){var s=8==r?255&e[n]:d(e,n);s<0?"-"==e.charAt(n)&&(i=!0):(i=!1,0==o?this.data[this.t++]=s:o+r>this.DB?(this.data[this.t-1]|=(s&(1<>this.DB-o):this.data[this.t-1]|=s<=this.DB&&(o-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,o>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==e;)--this.t},a.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},a.prototype.drShiftTo=function(e,t){for(var r=e;r=0;--r)t.data[r+o+1]=this.data[r]>>i|s,s=(this.data[r]&a)<=0;--r)t.data[r]=0;t.data[o]=s,t.t=this.t+o+1,t.s=this.s,t.clamp()},a.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,a=(1<>n;for(var o=r+1;o>n;n>0&&(t.data[this.t-r-1]|=(this.s&a)<>=this.DB;if(e.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=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()},a.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=0;)e.data[r]=0;for(r=0;r=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()},a.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t0?(n.lShiftTo(c,s),i.lShiftTo(c,r)):(n.copyTo(s),i.copyTo(r));var f=s.t,h=s.data[f-1];if(0!=h){var d=h*(1<1?s.data[f-2]>>this.F2:0),p=this.FV/d,y=(1<=0&&(r.data[r.t++]=1,r.subTo(S,r)),a.ONE.dlShiftTo(f,S),S.subTo(s,s);s.t=0;){var w=r.data[--v]==h?this.DM:Math.floor(r.data[v]*p+(r.data[v-1]+m)*y);if((r.data[v]+=s.am(0,w,r,b,0,f))0&&r.rShiftTo(c,r),u<0&&a.ZERO.subTo(r,r)}}},a.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},a.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},a.prototype.exp=function(e,t){if(e>4294967295||e<1)return a.ONE;var r=o(),n=o(),i=t.convert(this),s=g(e)-1;for(i.copyTo(r);--s>=0;)if(t.sqrTo(r,n),(e&1<0)t.mulTo(n,i,r);else{var u=r;r=n,n=u}return t.revert(r)},a.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<0)for(s>s)>0&&(i=!0,a=h(r));o>=0;)s>(s+=this.DB-t)):(r=this.data[o]>>(s-=t)&n,s<=0&&(s+=this.DB,--o)),r>0&&(i=!0),i&&(a+=h(r));return i?a:"0"},a.prototype.negate=function(){var e=o();return a.ZERO.subTo(this,e),e},a.prototype.abs=function(){return this.s<0?this.negate():this},a.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},a.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+g(this.data[this.t-1]^this.s&this.DM)},a.prototype.mod=function(e){var t=o();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(a.ZERO)>0&&e.subTo(t,t),t},a.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new y(t):new m(t),this.exp(e,r)},a.ZERO=p(0),a.ONE=p(1),T.prototype.convert=C,T.prototype.revert=C,T.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},T.prototype.sqrTo=function(e,t){e.squareTo(t)},I.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=o();return e.copyTo(t),this.reduce(t),t},I.prototype.revert=function(e){return e},I.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)},I.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},I.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var k=[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],B=(1<<26)/k[k.length-1];a.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},a.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=p(r),i=o(),a=o(),s="";for(this.divRemTo(n,i,a);i.signum()>0;)s=(r+a.intValue()).toString(e).substr(1)+s,i.divRemTo(n,i,a);return a.intValue().toString(e)+s},a.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,o=0,s=0,u=0;u=r&&(this.dMultiply(n),this.dAddOffset(s,0),o=0,s=0))}o>0&&(this.dMultiply(Math.pow(t,o)),this.dAddOffset(s,0)),i&&a.ZERO.subTo(this,this)},a.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(a.ONE.shiftLeft(e-1),b,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(a.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<>=this.DB;if(e.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=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()},a.prototype.dMultiply=function(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},a.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]}},a.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=0;)r.data[n]=0;for(n=Math.max(t-this.t,0);n0)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},a.prototype.millerRabin=function(e){var t=this.subtract(a.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var n,i=t.shiftRight(r),o={nextBytes:function(e){for(var t=0;t=0);var u=n.modPow(i,this);if(0!=u.compareTo(a.ONE)&&0!=u.compareTo(t)){for(var l=1;l++>24},a.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},a.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},a.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>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<=0;)n<8?(r=(this.data[e]&(1<>(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},a.prototype.equals=function(e){return 0==this.compareTo(e)},a.prototype.min=function(e){return this.compareTo(e)<0?this:e},a.prototype.max=function(e){return this.compareTo(e)>0?this:e},a.prototype.and=function(e){var t=o();return this.bitwiseTo(e,v,t),t},a.prototype.or=function(e){var t=o();return this.bitwiseTo(e,b,t),t},a.prototype.xor=function(e){var t=o();return this.bitwiseTo(e,S,t),t},a.prototype.andNot=function(e){var t=o();return this.bitwiseTo(e,w,t),t},a.prototype.not=function(){for(var e=o(),t=0;t=this.t?0!=this.s:0!=(this.data[t]&1<1){var f=o();for(n.sqrTo(s[1],f);u<=c;)s[u]=o(),n.mulTo(f,s[u-2],s[u]),u+=2}var h,d,v=e.t-1,b=!0,S=o();for(i=g(e.data[v])-1;v>=0;){for(i>=l?h=e.data[v]>>i-l&c:(h=(e.data[v]&(1<0&&(h|=e.data[v-1]>>this.DB+i-l)),u=r;0==(1&h);)h>>=1,--u;if((i-=u)<0&&(i+=this.DB,--v),b)s[h].copyTo(a),b=!1;else{for(;u>1;)n.sqrTo(a,S),n.sqrTo(S,a),u-=2;u>0?n.sqrTo(a,S):(d=a,a=S,S=d),n.mulTo(S,s[h],a)}for(;v>=0&&0==(e.data[v]&1<=0?(r.subTo(n,r),t&&i.subTo(s,i),o.subTo(u,o)):(n.subTo(r,n),t&&s.subTo(i,s),u.subTo(o,u))}return 0!=n.compareTo(a.ONE)?a.ZERO:u.compareTo(e)>=0?u.subtract(e):u.signum()<0?(u.addTo(e,u),u.signum()<0?u.add(e):u):u},a.prototype.pow=function(e){return this.exp(e,new T)},a.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(),a=r.getLowestSetBit();if(a<0)return t;for(i0&&(t.rShiftTo(a,t),r.rShiftTo(a,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 a>0&&r.lShiftTo(a,r),r},a.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=k[k.length-1]){for(t=0;t{var n=r(45);e.exports=n.md=n.md||{},n.md.algorithms=n.md.algorithms||{}},6574:(e,t,r)=>{var n=r(45);r(5693),r(3900);var i=e.exports=n.md5=n.md5||{};n.md.md5=n.md.algorithms.md5=i,i.create=function(){l||function(){a=String.fromCharCode(128),a+=n.util.fillString(String.fromCharCode(0),64),o=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1,6,11,0,5,10,15,4,9,14,3,8,13,2,7,12,5,8,11,14,1,4,7,10,13,0,3,6,9,12,15,2,0,7,14,5,12,3,10,1,8,15,6,13,4,11,2,9],s=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],u=new Array(64);for(var e=0;e<64;++e)u[e]=Math.floor(4294967296*Math.abs(Math.sin(e+1)));l=!0}();var e=null,t=n.util.createBuffer(),r=new Array(16),i={algorithm:"md5",blockLength:64,digestLength:16,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,a=0;a>>0,s>>>0];for(var u=i.fullMessageLength.length-1;u>=0;--u)i.fullMessageLength[u]+=s[1],s[1]=s[0]+(i.fullMessageLength[u]/4294967296>>>0),i.fullMessageLength[u]=i.fullMessageLength[u]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(a),c(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var o=n.util.createBuffer();o.putBytes(t.bytes());var s=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;o.putBytes(a.substr(0,i.blockLength-s));for(var u,l=0,f=i.fullMessageLength.length-1;f>=0;--f)l=(u=8*i.fullMessageLength[f]+l)/4294967296>>>0,o.putInt32Le(u>>>0);var h={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3};c(h,r,o);var d=n.util.createBuffer();return d.putInt32Le(h.h0),d.putInt32Le(h.h1),d.putInt32Le(h.h2),d.putInt32Le(h.h3),d},i};var a=null,o=null,s=null,u=null,l=!1;function c(e,t,r){for(var n,i,a,l,c,f,h,d=r.length();d>=64;){for(i=e.h0,a=e.h1,l=e.h2,c=e.h3,h=0;h<16;++h)t[h]=r.getInt32Le(),n=i+(c^a&(l^c))+u[h]+t[h],i=c,c=l,l=a,a+=n<<(f=s[h])|n>>>32-f;for(;h<32;++h)n=i+(l^c&(a^l))+u[h]+t[o[h]],i=c,c=l,l=a,a+=n<<(f=s[h])|n>>>32-f;for(;h<48;++h)n=i+(a^l^c)+u[h]+t[o[h]],i=c,c=l,l=a,a+=n<<(f=s[h])|n>>>32-f;for(;h<64;++h)n=i+(l^(a|~c))+u[h]+t[o[h]],i=c,c=l,l=a,a+=n<<(f=s[h])|n>>>32-f;e.h0=e.h0+i|0,e.h1=e.h1+a|0,e.h2=e.h2+l|0,e.h3=e.h3+c|0,d-=64}}},9624:(e,t,r)=>{var n=r(45);r(1657),e.exports=n.mgf=n.mgf||{},n.mgf.mgf1=n.mgf1},1657:(e,t,r)=>{var n=r(45);r(3900),n.mgf=n.mgf||{},(e.exports=n.mgf.mgf1=n.mgf1=n.mgf1||{}).create=function(e){return{generate:function(t,r){for(var i=new n.util.ByteBuffer,a=Math.ceil(r/e.digestLength),o=0;o{var n=r(45);n.pki=n.pki||{};var i=e.exports=n.pki.oids=n.oids=n.oids||{};function a(e,t){i[e]=t,i[t]=e}function o(e,t){i[e]=t}a("1.2.840.113549.1.1.1","rsaEncryption"),a("1.2.840.113549.1.1.4","md5WithRSAEncryption"),a("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),a("1.2.840.113549.1.1.7","RSAES-OAEP"),a("1.2.840.113549.1.1.8","mgf1"),a("1.2.840.113549.1.1.9","pSpecified"),a("1.2.840.113549.1.1.10","RSASSA-PSS"),a("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),a("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),a("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),a("1.2.840.10040.4.3","dsa-with-sha1"),a("1.3.14.3.2.7","desCBC"),a("1.3.14.3.2.26","sha1"),a("2.16.840.1.101.3.4.2.1","sha256"),a("2.16.840.1.101.3.4.2.2","sha384"),a("2.16.840.1.101.3.4.2.3","sha512"),a("1.2.840.113549.2.5","md5"),a("1.2.840.113549.1.7.1","data"),a("1.2.840.113549.1.7.2","signedData"),a("1.2.840.113549.1.7.3","envelopedData"),a("1.2.840.113549.1.7.4","signedAndEnvelopedData"),a("1.2.840.113549.1.7.5","digestedData"),a("1.2.840.113549.1.7.6","encryptedData"),a("1.2.840.113549.1.9.1","emailAddress"),a("1.2.840.113549.1.9.2","unstructuredName"),a("1.2.840.113549.1.9.3","contentType"),a("1.2.840.113549.1.9.4","messageDigest"),a("1.2.840.113549.1.9.5","signingTime"),a("1.2.840.113549.1.9.6","counterSignature"),a("1.2.840.113549.1.9.7","challengePassword"),a("1.2.840.113549.1.9.8","unstructuredAddress"),a("1.2.840.113549.1.9.14","extensionRequest"),a("1.2.840.113549.1.9.20","friendlyName"),a("1.2.840.113549.1.9.21","localKeyId"),a("1.2.840.113549.1.9.22.1","x509Certificate"),a("1.2.840.113549.1.12.10.1.1","keyBag"),a("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),a("1.2.840.113549.1.12.10.1.3","certBag"),a("1.2.840.113549.1.12.10.1.4","crlBag"),a("1.2.840.113549.1.12.10.1.5","secretBag"),a("1.2.840.113549.1.12.10.1.6","safeContentsBag"),a("1.2.840.113549.1.5.13","pkcs5PBES2"),a("1.2.840.113549.1.5.12","pkcs5PBKDF2"),a("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),a("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),a("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),a("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),a("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),a("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),a("1.2.840.113549.2.7","hmacWithSHA1"),a("1.2.840.113549.2.8","hmacWithSHA224"),a("1.2.840.113549.2.9","hmacWithSHA256"),a("1.2.840.113549.2.10","hmacWithSHA384"),a("1.2.840.113549.2.11","hmacWithSHA512"),a("1.2.840.113549.3.7","des-EDE3-CBC"),a("2.16.840.1.101.3.4.1.2","aes128-CBC"),a("2.16.840.1.101.3.4.1.22","aes192-CBC"),a("2.16.840.1.101.3.4.1.42","aes256-CBC"),a("2.5.4.3","commonName"),a("2.5.4.5","serialName"),a("2.5.4.6","countryName"),a("2.5.4.7","localityName"),a("2.5.4.8","stateOrProvinceName"),a("2.5.4.10","organizationName"),a("2.5.4.11","organizationalUnitName"),a("2.5.4.13","description"),a("2.16.840.1.113730.1.1","nsCertType"),a("2.16.840.1.113730.1.13","nsComment"),o("2.5.29.1","authorityKeyIdentifier"),o("2.5.29.2","keyAttributes"),o("2.5.29.3","certificatePolicies"),o("2.5.29.4","keyUsageRestriction"),o("2.5.29.5","policyMapping"),o("2.5.29.6","subtreesConstraint"),o("2.5.29.7","subjectAltName"),o("2.5.29.8","issuerAltName"),o("2.5.29.9","subjectDirectoryAttributes"),o("2.5.29.10","basicConstraints"),o("2.5.29.11","nameConstraints"),o("2.5.29.12","policyConstraints"),o("2.5.29.13","basicConstraints"),a("2.5.29.14","subjectKeyIdentifier"),a("2.5.29.15","keyUsage"),o("2.5.29.16","privateKeyUsagePeriod"),a("2.5.29.17","subjectAltName"),a("2.5.29.18","issuerAltName"),a("2.5.29.19","basicConstraints"),o("2.5.29.20","cRLNumber"),o("2.5.29.21","cRLReason"),o("2.5.29.22","expirationDate"),o("2.5.29.23","instructionCode"),o("2.5.29.24","invalidityDate"),o("2.5.29.25","cRLDistributionPoints"),o("2.5.29.26","issuingDistributionPoint"),o("2.5.29.27","deltaCRLIndicator"),o("2.5.29.28","issuingDistributionPoint"),o("2.5.29.29","certificateIssuer"),o("2.5.29.30","nameConstraints"),a("2.5.29.31","cRLDistributionPoints"),a("2.5.29.32","certificatePolicies"),o("2.5.29.33","policyMappings"),o("2.5.29.34","policyConstraints"),a("2.5.29.35","authorityKeyIdentifier"),o("2.5.29.36","policyConstraints"),a("2.5.29.37","extKeyUsage"),o("2.5.29.46","freshestCRL"),o("2.5.29.54","inhibitAnyPolicy"),a("1.3.6.1.4.1.11129.2.4.2","timestampList"),a("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),a("1.3.6.1.5.5.7.3.1","serverAuth"),a("1.3.6.1.5.5.7.3.2","clientAuth"),a("1.3.6.1.5.5.7.3.3","codeSigning"),a("1.3.6.1.5.5.7.3.4","emailProtection"),a("1.3.6.1.5.5.7.3.8","timeStamping")},3555:(e,t,r)=>{var n=r(45);if(r(9353),r(5465),r(2986),r(5693),r(3225),r(8009),r(5224),r(2795),r(1577),r(9408),r(3900),"undefined"===typeof i)var i=n.jsbn.BigInteger;var a=n.asn1,o=n.pki=n.pki||{};e.exports=o.pbe=n.pbe=n.pbe||{};var s=o.oids,u={name:"EncryptedPrivateKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",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:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},l={name:"PBES2Algorithms",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},c={name:"pkcs-12PbeParams",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:a.Class.UNIVERSAL,type:a.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=o.oids[a.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()}o.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,l,c=n.random.getBytesSync(r.saltSize),f=r.count,h=a.integerToDer(f);if(0===r.algorithm.indexOf("aes")||"des"===r.algorithm){var p,g,y;switch(r.algorithm){case"aes128":i=16,p=16,g=s["aes128-CBC"],y=n.aes.createEncryptionCipher;break;case"aes192":i=24,p=16,g=s["aes192-CBC"],y=n.aes.createEncryptionCipher;break;case"aes256":i=32,p=16,g=s["aes256-CBC"],y=n.aes.createEncryptionCipher;break;case"des":i=8,p=8,g=s.desCBC,y=n.des.createEncryptionCipher;break;default:throw(E=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,E}var m="hmacWith"+r.prfAlgorithm.toUpperCase(),v=d(m),b=n.pkcs5.pbkdf2(t,c,f,i,v),S=n.random.getBytesSync(p);(A=y(b)).start(S),A.update(a.toDer(e)),A.finish(),l=A.output.getBytes();var w=function(e,t,r,i){var s=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,e),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,t.getBytes())]);"hmacWithSHA1"!==i&&s.value.push(a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,n.util.hexToBytes(r.toString(16))),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(o.oids[i]).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")]));return s}(c,h,i,m);u=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(s.pkcs5PBES2).getBytes()),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(s.pkcs5PBKDF2).getBytes()),w]),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(g).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,S)])])])}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 A,T=new n.util.ByteBuffer(c);b=o.pbe.generatePkcs12Key(t,T,1,f,i),S=o.pbe.generatePkcs12Key(t,T,2,f,i);(A=n.des.createEncryptionCipher(b)).start(S),A.update(a.toDer(e)),A.finish(),l=A.output.getBytes(),u=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(s["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,c),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,h.getBytes())])])}return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[u,a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,l)])},o.decryptPrivateKeyInfo=function(e,t){var r=null,i={},s=[];if(!a.validate(e,u,i,s)){var l=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw l.errors=s,l}var c=a.derToOid(i.encryptionOid),f=o.pbe.getCipher(c,i.encryptionParams,t),h=n.util.createBuffer(i.encryptedData);return f.update(h),f.finish()&&(r=a.fromDer(f.output)),r},o.encryptedPrivateKeyToPem=function(e,t){var r={type:"ENCRYPTED PRIVATE KEY",body:a.toDer(e).getBytes()};return n.pem.encode(r,{maxline:t})},o.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 a.fromDer(t.body)},o.encryptRsaPrivateKey=function(e,t,r){if(!(r=r||{}).legacy){var i=o.wrapRsaPrivateKey(o.privateKeyToAsn1(e));return i=o.encryptPrivateKeyInfo(i,t,r),o.encryptedPrivateKeyToPem(i)}var s,u,l,c;switch(r.algorithm){case"aes128":s="AES-128-CBC",l=16,u=n.random.getBytesSync(16),c=n.aes.createEncryptionCipher;break;case"aes192":s="AES-192-CBC",l=24,u=n.random.getBytesSync(16),c=n.aes.createEncryptionCipher;break;case"aes256":s="AES-256-CBC",l=32,u=n.random.getBytesSync(16),c=n.aes.createEncryptionCipher;break;case"3des":s="DES-EDE3-CBC",l=24,u=n.random.getBytesSync(8),c=n.des.createEncryptionCipher;break;case"des":s="DES-CBC",l=8,u=n.random.getBytesSync(8),c=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=c(n.pbe.opensslDeriveBytes(t,u.substr(0,8),l));h.start(u),h.update(a.toDer(o.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)},o.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(l=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".')).headerType=l,l;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 l;throw(l=new Error('Could not decrypt private key; unsupported encryption algorithm "'+i.dekInfo.algorithm+'".')).algorithm=i.dekInfo.algorithm,l}var c=n.util.hexToBytes(i.dekInfo.parameters),f=u(n.pbe.opensslDeriveBytes(t,c.substr(0,8),s));if(f.start(c),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?o.decryptPrivateKeyInfo(a.fromDer(r),t):a.fromDer(r))&&(r=o.privateKeyFromAsn1(r)),r},o.pbe.generatePkcs12Key=function(e,t,r,i,a,o){var s,u;if("undefined"===typeof o||null===o){if(!("sha1"in n.md))throw new Error('"sha1" hash algorithm unavailable.');o=n.md.sha1.create()}var l=o.digestLength,c=o.blockLength,f=new n.util.ByteBuffer,h=new n.util.ByteBuffer;if(null!==e&&void 0!==e){for(u=0;u=0;u--)_>>=8,_+=C.at(u)+B.at(u),B.setAt(u,255&_);k.putBuffer(B)}S=k,f.putBuffer(A)}return f.truncate(f.length()-a),f},o.pbe.getCipher=function(e,t,r){switch(e){case o.oids.pkcs5PBES2:return o.pbe.getCipherForPBES2(e,t,r);case o.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case o.oids["pbewithSHAAnd40BitRC2-CBC"]:return o.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}},o.pbe.getCipherForPBES2=function(e,t,r){var i,s={},u=[];if(!a.validate(t,l,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=a.derToOid(s.kdfOid))!==o.oids.pkcs5PBKDF2)throw(i=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=e,i.supportedOids=["pkcs5PBKDF2"],i;if((e=a.derToOid(s.encOid))!==o.oids["aes128-CBC"]&&e!==o.oids["aes192-CBC"]&&e!==o.oids["aes256-CBC"]&&e!==o.oids["des-EDE3-CBC"]&&e!==o.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 c,f,d=s.kdfSalt,p=n.util.createBuffer(s.kdfIterationCount);switch(p=p.getInt(p.length()<<3),o.oids[e]){case"aes128-CBC":c=16,f=n.aes.createDecryptionCipher;break;case"aes192-CBC":c=24,f=n.aes.createDecryptionCipher;break;case"aes256-CBC":c=32,f=n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":c=24,f=n.des.createDecryptionCipher;break;case"desCBC":c=8,f=n.des.createDecryptionCipher}var g=h(s.prfOid),y=n.pkcs5.pbkdf2(r,d,p,c,g),m=s.encIv,v=f(y);return v.start(m),v},o.pbe.getCipherForPKCS12PBE=function(e,t,r){var i={},s=[];if(!a.validate(t,c,i,s))throw(g=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=s,g;var u,l,f,d=n.util.createBuffer(i.salt),p=n.util.createBuffer(i.iterations);switch(p=p.getInt(p.length()<<3),e){case o.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,l=8,f=n.des.startDecrypting;break;case o.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,l=8,f=function(e,t){var r=n.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var g;throw(g=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=e,g}var y=h(i.prfOid),m=o.pbe.generatePkcs12Key(r,d,1,p,u,y);return y.start(),f(m,o.pbe.generatePkcs12Key(r,d,2,p,l,y))},o.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 a=[f(i,e+t)],o=16,s=1;o{var n=r(45);r(8163),r(5693),r(3900);var i,a=n.pkcs5=n.pkcs5||{};n.util.isNodejs&&!n.options.usePureJavaScript&&(i=r(310)),e.exports=n.pbkdf2=a.pbkdf2=function(e,t,r,a,o,s){if("function"===typeof o&&(s=o,o=null),n.util.isNodejs&&!n.options.usePureJavaScript&&i.pbkdf2&&(null===o||"object"!==typeof o)&&(i.pbkdf2Sync.length>4||!o||"sha1"===o))return"string"!==typeof o&&(o="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),s?4===i.pbkdf2Sync.length?i.pbkdf2(e,t,r,a,(function(e,t){if(e)return s(e);s(null,t.toString("binary"))})):i.pbkdf2(e,t,r,a,o,(function(e,t){if(e)return s(e);s(null,t.toString("binary"))})):4===i.pbkdf2Sync.length?i.pbkdf2Sync(e,t,r,a).toString("binary"):i.pbkdf2Sync(e,t,r,a,o).toString("binary");if("undefined"!==typeof o&&null!==o||(o="sha1"),"string"===typeof o){if(!(o in n.md.algorithms))throw new Error("Unknown hash algorithm: "+o);o=n.md[o].create()}var u=o.digestLength;if(a>4294967295*u){var l=new Error("Derived key is too long.");if(s)return s(l);throw l}var c=Math.ceil(a/u),f=a-(c-1)*u,h=n.hmac.create();h.start(o,e);var d,p,g,y="";if(!s){for(var m=1;m<=c;++m){h.start(null,null),h.update(t),h.update(n.util.int32ToBytes(m)),d=g=h.digest().getBytes();for(var v=2;v<=r;++v)h.start(null,null),h.update(g),p=h.digest().getBytes(),d=n.util.xorBytes(d,p,u),g=p;y+=mc)return s(null,y);h.start(null,null),h.update(t),h.update(n.util.int32ToBytes(m)),d=g=h.digest().getBytes(),v=2,S()}function S(){if(v<=r)return h.start(null,null),h.update(g),p=h.digest().getBytes(),d=n.util.xorBytes(d,p,u),g=p,++v,n.util.setImmediate(S);y+=m{var n=r(45);r(3900);var i=e.exports=n.pem=n.pem||{};function a(e){for(var t=e.name+": ",r=[],n=function(e,t){return" "+t},i=0;i65&&-1!==o){var s=t[o];","===s?(++o,t=t.substr(0,o)+"\r\n "+t.substr(o)):t=t.substr(0,o)+"\r\n"+s+t.substr(o+1),a=i-o-1,o=-1,++i}else" "!==t[i]&&"\t"!==t[i]&&","!==t[i]||(o=i);return t}function o(e){return e.replace(/^\s+/,"")}i.encode=function(e,t){t=t||{};var r,i="-----BEGIN "+e.type+"-----\r\n";if(e.procType&&(i+=a(r={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]})),e.contentDomain&&(i+=a(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+=a(r)),e.headers)for(var o=0;o{var n=r(45);r(3900),r(2795),r(3753);var i=e.exports=n.pkcs1=n.pkcs1||{};function a(e,t,r){r||(r=n.md.sha1.create());for(var i="",a=Math.ceil(t/r.digestLength),o=0;o>24&255,o>>16&255,o>>8&255,255&o);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,o,s,u;"string"===typeof r?(i=r,o=arguments[3]||void 0,s=arguments[4]||void 0):r&&(i=r.label||void 0,o=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 l=Math.ceil(e.n.bitLength()/8),c=l-2*s.digestLength-2;if(t.length>c)throw(y=new Error("RSAES-OAEP input message length is too long.")).length=t.length,y.maxLength=c,y;i||(i=""),s.update(i,"raw");for(var f=s.digest(),h="",d=c-t.length,p=0;p{var n=r(45);r(5465),r(8163),r(3225),r(9139),r(3555),r(2795),r(9408),r(3753),r(3900),r(4620);var i=n.asn1,a=n.pki,o=e.exports=n.pkcs12=n.pkcs12||{},s={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"content"}]},u={name:"PFX",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},s,{name:"PFX.macData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"mac",value:[{name:"PFX.macData.mac",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"PFX.macData.mac.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"macAlgorithm"},{name:"PFX.macData.mac.digestAlgorithm.parameters",tagClass:i.Class.UNIVERSAL,captureAsn1:"macAlgorithmParameters"}]},{name:"PFX.macData.mac.digest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"macDigest"}]},{name:"PFX.macData.macSalt",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"macSalt"},{name:"PFX.macData.iterations",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,optional:!0,capture:"macIterations"}]}]},l={name:"SafeBag",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SafeBag.bagId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"bagId"},{name:"SafeBag.bagValue",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,captureAsn1:"bagValue"},{name:"SafeBag.bagAttributes",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,optional:!0,capture:"bagAttributes"}]},c={name:"Attribute",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Attribute.attrId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"oid"},{name:"Attribute.attrValues",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,capture:"values"}]},f={name:"CertBag",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertBag.certId",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certId"},{name:"CertBag.certValue",tagClass:i.Class.CONTEXT_SPECIFIC,constructed:!0,value:[{name:"CertBag.certValue[0]",tagClass:i.Class.UNIVERSAL,type:i.Class.OCTETSTRING,constructed:!1,capture:"cert"}]}]};function h(e,t,r,n){for(var i=[],a=0;a=0&&i.push(s):i.push(s))}return i}function d(e){if(e.composed||e.constructed){for(var t=n.util.createBuffer(),r=0;r0&&(u=i.create(i.Class.UNIVERSAL,i.Type.SET,!0,f));var h=[],d=[];null!==t&&(d=n.util.isArray(t)?t:[t]);for(var p=[],g=0;g0){var b=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,p),S=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(b).getBytes())])]);h.push(S)}var w=null;if(null!==e){var E=a.wrapRsaPrivateKey(a.privateKeyToAsn1(e));w=null===r?i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.keyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[E]),u]):i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.pkcs8ShroudedKeyBag).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[a.encryptPrivateKeyInfo(E,r,s)]),u]);var A=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[w]),T=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(A).getBytes())])]);h.push(T)}var C,I=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,h);if(s.useMac){var k=n.md.sha1.create(),B=new n.util.ByteBuffer(n.random.getBytes(s.saltSize)),_=s.count,P=(e=o.generateKey(r,B,3,_,20),n.hmac.create());P.start(k,e),P.update(i.toDer(I).getBytes());var O=P.getMac();C=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.sha1).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.NULL,!1,"")]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,O.getBytes())]),i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,B.getBytes()),i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(_).getBytes())])}return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(3).getBytes()),i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(a.oids.data).getBytes()),i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,i.toDer(I).getBytes())])]),C])},o.generateKey=n.pbe.generatePkcs12Key},9139:(e,t,r)=>{var n=r(45);r(5465),r(3900);var i=n.asn1,a=e.exports=n.pkcs7asn1=n.pkcs7asn1||{};n.pkcs7=n.pkcs7||{},n.pkcs7.asn1=a;var o={name:"ContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"ContentInfo.ContentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"ContentInfo.content",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,captureAsn1:"content"}]};a.contentInfoValidator=o;var s={name:"EncryptedContentInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentType",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"contentType"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,captureAsn1:"encParameter"}]},{name:"EncryptedContentInfo.encryptedContent",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,capture:"encryptedContent",captureAsn1:"encryptedContentAsn1"}]};a.envelopedDataValidator={name:"EnvelopedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EnvelopedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"EnvelopedData.RecipientInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"recipientInfos"}].concat(s)},a.encryptedDataValidator={name:"EncryptedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"}].concat(s)};var u={name:"SignerInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1},{name:"SignerInfo.issuerAndSerialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.issuerAndSerialNumber.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"SignerInfo.issuerAndSerialNumber.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"SignerInfo.digestAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignerInfo.digestAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"digestAlgorithm"},{name:"SignerInfo.digestAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"digestParameter",optional:!0}]},{name:"SignerInfo.authenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"authenticatedAttributes"},{name:"SignerInfo.digestEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,capture:"signatureAlgorithm"},{name:"SignerInfo.encryptedDigest",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"signature"},{name:"SignerInfo.unauthenticatedAttributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,capture:"unauthenticatedAttributes"}]};a.signedDataValidator={name:"SignedData",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"SignedData.Version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"SignedData.DigestAlgorithms",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0,captureAsn1:"digestAlgorithms"},o,{name:"SignedData.Certificates",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,optional:!0,captureAsn1:"certificates"},{name:"SignedData.CertificateRevocationLists",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,optional:!0,captureAsn1:"crls"},{name:"SignedData.SignerInfos",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,capture:"signerInfos",optional:!0,value:[u]}]},a.recipientInfoValidator={name:"RecipientInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.version",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"version"},{name:"RecipientInfo.issuerAndSerial",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.issuerAndSerial.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"issuer"},{name:"RecipientInfo.issuerAndSerial.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"serial"}]},{name:"RecipientInfo.keyEncryptionAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"encAlgorithm"},{name:"RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass:i.Class.UNIVERSAL,constructed:!1,captureAsn1:"encParameter"}]},{name:"RecipientInfo.encryptedKey",tagClass:i.Class.UNIVERSAL,type:i.Type.OCTETSTRING,constructed:!1,capture:"encKey"}]}},470:(e,t,r)=>{var n=r(45);r(5465),r(3225),r(3555),r(5224),r(8009),r(3588),r(4188),r(9408),r(3900),r(4620);var i=n.asn1,a=e.exports=n.pki=n.pki||{};a.pemToDer=function(e){var t=n.pem.decode(e)[0];if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert PEM to DER; PEM is encrypted.");return n.util.createBuffer(t.body)},a.privateKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("PRIVATE KEY"!==t.type&&"RSA PRIVATE KEY"!==t.type){var r=new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert private key from PEM; PEM is encrypted.");var o=i.fromDer(t.body);return a.privateKeyFromAsn1(o)},a.privateKeyToPem=function(e,t){var r={type:"RSA PRIVATE KEY",body:i.toDer(a.privateKeyToAsn1(e)).getBytes()};return n.pem.encode(r,{maxline:t})},a.privateKeyInfoToPem=function(e,t){var r={type:"PRIVATE KEY",body:i.toDer(e).getBytes()};return n.pem.encode(r,{maxline:t})}},8353:(e,t,r)=>{var n=r(45);r(3900),r(9463),r(2795),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],a=new r(null);a.fromInt(30);var o=function(e,t){return e|t};t.generateProbablePrime=function(e,t,i){"function"===typeof t&&(i=t,t={});var a=(t=t||{}).algorithm||"PRIMEINC";"string"===typeof a&&(a={name:a}),a.options=a.options||{};var o=t.prng||n.random,u={nextBytes:function(e){for(var t=o.getBytesSync(e.length),r=0;re&&(o=l(e,t));var d=o.toString(16);i.target.postMessage({hex:d,workLoad:c}),o.dAddOffset(f,0)}}}d()}(e,t,i,a);return s(e,t,i,a)}(e,u,a.options,i);throw new Error("Invalid prime generation algorithm: "+a.name)}}function s(e,t,r,n){var i=l(e,t),a=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&&(a=r.millerRabinTests);var o=10;"maxBlockTime"in r&&(o=r.maxBlockTime),u(i,e,t,0,a,o,n)}function u(e,t,r,a,o,s,c){var f=+new Date;do{if(e.bitLength()>t&&(e=l(t,r)),e.isProbablePrime(o))return c(null,e);e.dAddOffset(i[a++%8],0)}while(s<0||+new Date-f{var n=r(45);r(3900);var i=null;!n.util.isNodejs||n.options.usePureJavaScript||process.versions["node-webkit"]||(i=r(310)),(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,a=new Array(32),o=0;o<32;++o)a[o]=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 l(e){var t=null,r=n.util.globalScope,i=r.crypto||r.msCrypto;i&&i.getRandomValues&&(t=function(e){return i.getRandomValues(e)});var a=n.util.createBuffer();if(t)for(;a.length()>16)))<<16,h=4294967295&(c=(2147483647&(c+=l>>15))+(c>>31));for(u=0;u<3;++u)f=h>>>(u<<3),f^=Math.floor(256*Math.random()),a.putByte(String.fromCharCode(255&f))}return a.getBytes(e)}return t.pools=a,t.pool=0,t.generate=function(e,r){if(!r)return t.generateSync(e);var i=t.plugin.cipher,a=t.plugin.increment,o=t.plugin.formatKey,s=t.plugin.formatSeed,l=n.util.createBuffer();t.key=null,function c(f){if(f)return r(f);if(l.length()>=e)return r(null,l.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()}))}(c)}));var h=i(t.key,t.seed);t.generated+=h.length,l.putBytes(h),t.key=o(i(t.key,a(t.seed))),t.seed=s(i(t.key,t.seed)),n.util.setImmediate(c)}()},t.generateSync=function(e){var r=t.plugin.cipher,i=t.plugin.increment,a=t.plugin.formatKey,o=t.plugin.formatSeed;t.key=null;for(var u=n.util.createBuffer();u.length()1048575&&(t.key=null),null===t.key&&s();var l=r(t.key,t.seed);t.generated+=l.length,u.putBytes(l),t.key=a(r(t.key,i(t.seed))),t.seed=o(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,l(e))}catch(r){t(r)}},t.seedFileSync=l),t.collect=function(e){for(var r=e.length,n=0;n>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}},4188:(e,t,r)=>{var n=r(45);r(2795),r(3900),(e.exports=n.pss=n.pss||{}).create=function(e){3===arguments.length&&(e={md:arguments[0],mgf:arguments[1],saltLength:arguments[2]});var t,r=e.md,i=e.mgf,a=r.digestLength,o=e.salt||null;if("string"===typeof o&&(o=n.util.createBuffer(o)),"saltLength"in e)t=e.saltLength;else{if(null===o)throw new Error("Salt length not specified or specific salt not given.");t=o.length()}if(null!==o&&o.length()!==t)throw new Error("Given salt length does not match length of given salt.");var s=e.prng||n.random,u={encode:function(e,u){var l,c,f=u-1,h=Math.ceil(f/8),d=e.digest().getBytes();if(h>8*h-f&255;return(S=String.fromCharCode(S.charCodeAt(0)&~w)+S.substr(1))+g+String.fromCharCode(188)},verify:function(e,o,s){var u,l=s-1,c=Math.ceil(l/8);if(o=o.substr(-c),c>8*c-l&255;if(0!==(h.charCodeAt(0)&p))throw new Error("Bits beyond keysize not zero as expected.");var g=i.generate(d,f),y="";for(u=0;u{var n=r(45);r(9353),r(3899),r(1513),r(3900),n.random&&n.random.getBytes?e.exports=n.random:function(t){var r={},i=new Array(4),a=n.util.createBuffer();function o(){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),a.putInt32(i[0]),a.putInt32(i[1]),a.putInt32(i[2]),a.putInt32(i[3]),a.getBytes()},r.increment=function(e){return++e[3],e},r.md=n.md.sha256;var s=o(),u=null,l=n.util.globalScope,c=l.crypto||l.msCrypto;if(c&&c.getRandomValues&&(u=function(e){return c.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=o,e.exports=n.random}("undefined"!==typeof jQuery?jQuery:null)},1577:(e,t,r)=>{var n=r(45);r(3900);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],a=[1,2,3,5],o=function(e,t){return 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,a=e,o=e.length(),s=t,u=Math.ceil(s/8),l=255>>(7&s);for(r=o;r<128;r++)a.putByte(i[a.at(r-1)+a.at(r-o)&255]);for(a.setAt(128-u,i[a.at(128-u)&l]),r=127-u;r>=0;r--)a.setAt(r,i[a.at(r+1)^a.at(r+u)]);return a};var u=function(e,t,r){var i,u,l,c,f=!1,h=null,d=null,p=null,g=[];for(e=n.rc2.expandKey(e,t),l=0;l<64;l++)g.push(e.getInt16Le());r?(i=function(e){for(l=0;l<4;l++)e[l]+=g[c]+(e[(l+3)%4]&e[(l+2)%4])+(~e[(l+3)%4]&e[(l+1)%4]),e[l]=o(e[l],a[l]),c++},u=function(e){for(l=0;l<4;l++)e[l]+=g[63&e[(l+3)%4]]}):(i=function(e){for(l=3;l>=0;l--)e[l]=s(e[l],a[l]),e[l]-=g[c]+(e[(l+3)%4]&e[(l+2)%4])+(~e[(l+3)%4]&e[(l+1)%4]),c--},u=function(e){for(l=3;l>=0;l--)e[l]-=g[63&e[(l+3)%4]]});var y=function(e){var t=[];for(l=0;l<4;l++){var n=h.getInt16Le();null!==p&&(r?n^=p.getInt16Le():p.putInt16Le(n)),t.push(65535&n)}c=r?0:63;for(var i=0;i=8;)y([[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,m.update()),!r&&(t=0===h.length()))if(e)t=e(8,d,!r);else{var i=d.length(),a=d.at(i-1);a>i?t=!1:d.truncate(a)}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)}},9408:(e,t,r)=>{var n=r(45);if(r(5465),r(9463),r(3225),r(7668),r(8353),r(2795),r(3900),"undefined"===typeof i)var i=n.jsbn.BigInteger;var a=n.util.isNodejs?r(310):null,o=n.asn1,s=n.util;n.pki=n.pki||{},e.exports=n.pki.rsa=n.rsa=n.rsa||{};var u=n.pki,l=[6,4,2,4,2,4,6,2],c={name:"PrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",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:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},f={name:"RSAPrivateKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},h={name:"RSAPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},d=n.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",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:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},p=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=o.oidToDer(t).getBytes(),i=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]),a=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]);a.value.push(o.create(o.Class.UNIVERSAL,o.Type.OID,!1,n)),a.value.push(o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,""));var s=o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(a),i.value.push(s),o.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 a;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{a=new i(n.util.bytesToHex(n.random.getBytes(t.n.bitLength()/8)),16)}while(a.compareTo(t.n)>=0||!a.gcd(t.n).equals(i.ONE));for(var o=(e=e.multiply(a.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);o.compareTo(s)<0;)o=o.add(t.p);var u=o.subtract(s).multiply(t.qInv).mod(t.p).multiply(t.q).add(s);return u=u.multiply(a.modInverse(t.n)).mod(t.n)};function y(e,t,r){var i=n.util.createBuffer(),a=Math.ceil(t.n.bitLength()/8);if(e.length>a-11){var o=new Error("Message is too long for PKCS#1 v1.5 padding.");throw o.length=e.length,o.max=a-11,o}i.putByte(0),i.putByte(r);var s,u=a-3-e.length;if(0===r||1===r){s=0===r?0:255;for(var l=0;l0;){var c=0,f=n.random.getBytes(u);for(l=0;l1;){if(255!==o.getByte()){--o.read;break}++l}else if(2===u)for(l=0;o.length()>1;){if(0===o.getByte()){--o.read;break}++l}if(0!==o.getByte()||l!==a-3-o.length())throw new Error("Encryption block is invalid.");return o.getBytes()}function v(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 b(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 S(e){return n.util.isNodejs&&"function"===typeof a[e]}function w(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 E(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 A(e){for(var t=n.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),i=0;i0;)c.putByte(0),--f;return c.putBytes(n.util.hexToBytes(l)),c.getBytes()},u.rsa.decrypt=function(e,t,r,a){var o=Math.ceil(t.n.bitLength()/8);if(e.length!==o){var s=new Error("Encrypted message length is invalid.");throw s.length=e.length,s.expected=o,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 l=g(u,t,r).toString(16),c=n.util.createBuffer(),f=o-Math.ceil(l.length/2);f>0;)c.putByte(0),--f;return c.putBytes(n.util.hexToBytes(l)),!1!==a?m(c.getBytes(),t,r):c.getBytes()},u.rsa.createKeyPairGenerationState=function(e,t,r){"string"===typeof e&&(e=parseInt(e,10)),e=e||2048;var a,o=(r=r||{}).prng||n.random,s={nextBytes:function(e){for(var t=o.getBytesSync(e.length),r=0;r>1,pBits:e-(e>>1),pqState:0,num:null,keys:null}).e.fromInt(a.eInt),a},u.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new i(null);r.fromInt(30);for(var n,a=0,o=function(e,t){return e|t},s=+new Date,c=0;null===e.keys&&(t<=0||cf?e.pqState=0:e.num.isProbablePrime(b(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(l[a++%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)}}c+=(n=+new Date)-s,s=n}return null!==e.keys},u.rsa.generateKeyPair=function(e,t,r,l){if(1===arguments.length?"object"===typeof e?(r=e,e=void 0):"function"===typeof e&&(l=e,e=void 0):2===arguments.length?"number"===typeof e?"function"===typeof t?(l=t,t=void 0):"number"!==typeof t&&(r=t,t=void 0):(r=e,l=t,e=void 0,t=void 0):3===arguments.length&&("number"===typeof t?"function"===typeof r&&(l=r,r=void 0):(l=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(l){if(S("generateKeyPair"))return a.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},(function(e,t,r){if(e)return l(e);l(null,{privateKey:u.privateKeyFromPem(r),publicKey:u.publicKeyFromPem(t)})}));if(w("generateKey")&&w("exportKey"))return s.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:A(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){l(e)})).then((function(e){if(e){var t=u.privateKeyFromAsn1(o.fromDer(n.util.createBuffer(e)));l(null,{privateKey:t,publicKey:u.setRsaPublicKey(t.n,t.e)})}}));if(E("generateKey")&&E("exportKey")){var c=s.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:A(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(o.fromDer(n.util.createBuffer(t)));l(null,{privateKey:r,publicKey:u.setRsaPublicKey(r.n,r.e)})},r.onerror=function(e){l(e)}},void(c.onerror=function(e){l(e)})}}else if(S("generateKeyPairSync")){var f=a.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:u.privateKeyFromPem(f.privateKey),publicKey:u.publicKeyFromPem(f.publicKey)}}var h=u.rsa.createKeyPairGenerationState(e,t,r);if(!l)return u.rsa.stepKeyPairGenerationState(h,0),h.keys;!function(e,t,r){"function"===typeof t&&(r=t,t={});t=t||{};var a={algorithm:{name:t.algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};"prng"in t&&(a.prng=t.prng);function o(){s(e.pBits,(function(t,n){return t?r(t):(e.p=n,null!==e.q?l(t,e.q):void s(e.qBits,l))}))}function s(e,t){n.prime.generateProbablePrime(e,a,t)}function l(t,n){if(t)return r(t);if(e.q=n,e.p.compareTo(e.q)<0){var a=e.p;e.p=e.q,e.q=a}if(0!==e.p.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.p=null,void o();if(0!==e.q.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.q=null,void s(e.qBits,l);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 o();if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits)return e.q=null,void s(e.qBits,l);var c=e.e.modInverse(e.phi);e.keys={privateKey:u.rsa.setPrivateKey(e.n,e.e,c,e.p,e.q,c.mod(e.p1),c.mod(e.q1),e.q.modInverse(e.p)),publicKey:u.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}o()}(h,r,l)},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 a=t.encode(e,r,!0);return u.rsa.encrypt(a,r,!0)},verify:function(e,t,n){"string"===typeof n?n=n.toUpperCase():void 0===n&&(n="RSASSA-PKCS1-V1_5"),"RSASSA-PKCS1-V1_5"===n?n={verify:function(e,t){return t=m(t,r,!0),e===o.fromDer(t).value[1].value}}:"NONE"!==n&&"NULL"!==n&&null!==n||(n={verify:function(e,t){return e===(t=m(t,r,!0))}});var i=u.rsa.decrypt(t,r,!0,!1);return n.verify(e,i,r.n.bitLength())}};return r},u.setRsaPrivateKey=u.rsa.setPrivateKey=function(e,t,r,i,a,o,s,l){var c={n:e,e:t,d:r,p:i,q:a,dP:o,dQ:s,qInv:l,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,c,!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,c,!1)},sign:function(e,t){var r=!1;"string"===typeof t&&(t=t.toUpperCase()),void 0===t||"RSASSA-PKCS1-V1_5"===t?(t={encode:p},r=1):"NONE"!==t&&"NULL"!==t&&null!==t||(t={encode:function(){return e}},r=1);var n=t.encode(e,c.n.bitLength());return u.rsa.encrypt(n,c,r)}};return c},u.wrapRsaPrivateKey=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(0).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(u.oids.rsaEncryption).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]),o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,o.toDer(e).getBytes())])},u.privateKeyFromAsn1=function(e){var t,r,a,s,l,h,d,p,g={},y=[];if(o.validate(e,c,g,y)&&(e=o.fromDer(n.util.createBuffer(g.privateKey))),g={},y=[],!o.validate(e,f,g,y)){var m=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw m.errors=y,m}return t=n.util.createBuffer(g.privateKeyModulus).toHex(),r=n.util.createBuffer(g.privateKeyPublicExponent).toHex(),a=n.util.createBuffer(g.privateKeyPrivateExponent).toHex(),s=n.util.createBuffer(g.privateKeyPrime1).toHex(),l=n.util.createBuffer(g.privateKeyPrime2).toHex(),h=n.util.createBuffer(g.privateKeyExponent1).toHex(),d=n.util.createBuffer(g.privateKeyExponent2).toHex(),p=n.util.createBuffer(g.privateKeyCoefficient).toHex(),u.setRsaPrivateKey(new i(t,16),new i(r,16),new i(a,16),new i(s,16),new i(l,16),new i(h,16),new i(d,16),new i(p,16))},u.privateKeyToAsn1=u.privateKeyToRSAPrivateKey=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(0).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,v(e.n)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,v(e.e)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,v(e.d)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,v(e.p)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,v(e.q)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,v(e.dP)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,v(e.dQ)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,v(e.qInv))])},u.publicKeyFromAsn1=function(e){var t={},r=[];if(o.validate(e,d,t,r)){var a,s=o.derToOid(t.publicKeyOid);if(s!==u.oids.rsaEncryption)throw(a=new Error("Cannot read public key. Unknown OID.")).oid=s,a;e=t.rsaPublicKey}if(r=[],!o.validate(e,h,t,r))throw(a=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,a;var l=n.util.createBuffer(t.publicKeyModulus).toHex(),c=n.util.createBuffer(t.publicKeyExponent).toHex();return u.setRsaPublicKey(new i(l,16),new i(c,16))},u.publicKeyToAsn1=u.publicKeyToSubjectPublicKeyInfo=function(e){return 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(u.oids.rsaEncryption).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]),o.create(o.Class.UNIVERSAL,o.Type.BITSTRING,!1,[u.publicKeyToRSAPublicKey(e)])])},u.publicKeyToRSAPublicKey=function(e){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,v(e.n)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,v(e.e))])}},3753:(e,t,r)=>{var n=r(45);r(5693),r(3900);var i=e.exports=n.sha1=n.sha1||{};n.md.sha1=n.md.algorithms.sha1=i,i.create=function(){o||(a=String.fromCharCode(128),a+=n.util.fillString(String.fromCharCode(0),64),o=!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,a=0;a>>0,u>>>0];for(var l=i.fullMessageLength.length-1;l>=0;--l)i.fullMessageLength[l]+=u[1],u[1]=u[0]+(i.fullMessageLength[l]/4294967296>>>0),i.fullMessageLength[l]=i.fullMessageLength[l]>>>0,u[0]=u[1]/4294967296>>>0;return t.putBytes(a),s(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var o=n.util.createBuffer();o.putBytes(t.bytes());var u,l=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;o.putBytes(a.substr(0,i.blockLength-l));for(var c=8*i.fullMessageLength[0],f=0;f>>0,o.putInt32(c>>>0),c=u>>>0;o.putInt32(c);var h={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};s(h,r,o);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 a=null,o=!1;function s(e,t,r){for(var n,i,a,o,s,u,l,c=r.length();c>=64;){for(i=e.h0,a=e.h1,o=e.h2,s=e.h3,u=e.h4,l=0;l<16;++l)n=r.getInt32(),t[l]=n,n=(i<<5|i>>>27)+(s^a&(o^s))+u+1518500249+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;l<20;++l)n=(n=t[l-3]^t[l-8]^t[l-14]^t[l-16])<<1|n>>>31,t[l]=n,n=(i<<5|i>>>27)+(s^a&(o^s))+u+1518500249+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;l<32;++l)n=(n=t[l-3]^t[l-8]^t[l-14]^t[l-16])<<1|n>>>31,t[l]=n,n=(i<<5|i>>>27)+(a^o^s)+u+1859775393+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;l<40;++l)n=(n=t[l-6]^t[l-16]^t[l-28]^t[l-32])<<2|n>>>30,t[l]=n,n=(i<<5|i>>>27)+(a^o^s)+u+1859775393+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;l<60;++l)n=(n=t[l-6]^t[l-16]^t[l-28]^t[l-32])<<2|n>>>30,t[l]=n,n=(i<<5|i>>>27)+(a&o|s&(a^o))+u+2400959708+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;for(;l<80;++l)n=(n=t[l-6]^t[l-16]^t[l-28]^t[l-32])<<2|n>>>30,t[l]=n,n=(i<<5|i>>>27)+(a^o^s)+u+3395469782+n,u=s,s=o,o=(a<<30|a>>>2)>>>0,a=i,i=n;e.h0=e.h0+i|0,e.h1=e.h1+a|0,e.h2=e.h2+o|0,e.h3=e.h3+s|0,e.h4=e.h4+u|0,c-=64}}},3899:(e,t,r)=>{var n=r(45);r(5693),r(3900);var i=e.exports=n.sha256=n.sha256||{};n.md.sha256=n.md.algorithms.sha256=i,i.create=function(){o||(a=String.fromCharCode(128),a+=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],o=!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,a=0;a>>0,s>>>0];for(var l=i.fullMessageLength.length-1;l>=0;--l)i.fullMessageLength[l]+=s[1],s[1]=s[0]+(i.fullMessageLength[l]/4294967296>>>0),i.fullMessageLength[l]=i.fullMessageLength[l]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(a),u(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var o=n.util.createBuffer();o.putBytes(t.bytes());var s,l=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;o.putBytes(a.substr(0,i.blockLength-l));for(var c=8*i.fullMessageLength[0],f=0;f>>0,o.putInt32(c>>>0),c=s>>>0;o.putInt32(c);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,o);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 a=null,o=!1,s=null;function u(e,t,r){for(var n,i,a,o,u,l,c,f,h,d,p,g,y,m=r.length();m>=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(l=e.h0,c=e.h1,f=e.h2,h=e.h3,d=e.h4,p=e.h5,g=e.h6,y=e.h7,u=0;u<64;++u)a=(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10),o=l&c|f&(l^c),n=y+((d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(g^d&(p^g))+s[u]+t[u],y=g,g=p,p=d,d=h+n>>>0,h=f,f=c,c=l,l=n+(i=a+o)>>>0;e.h0=e.h0+l|0,e.h1=e.h1+c|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+g|0,e.h7=e.h7+y|0,m-=64}}},3900:(e,t,r)=>{var n=r(45),i=r(6407),a=e.exports=n.util=n.util||{};function o(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(a.isArrayBuffer(e)||a.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;r15?(r=Date.now(),o(e)):(t.push(e),1===t.length&&i.setAttribute("a",n=!n))}}a.nextTick=a.setImmediate}(),a.isNodejs="undefined"!==typeof process&&process.versions&&process.versions.node,a.globalScope=a.isNodejs?r.g:"undefined"===typeof self?window:self,a.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a.isArrayBuffer=function(e){return"undefined"!==typeof ArrayBuffer&&e instanceof ArrayBuffer},a.isArrayBufferView=function(e){return e&&a.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},a.ByteBuffer=s,a.ByteStringBuffer=s;a.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},a.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},a.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},a.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},a.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},a.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},a.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(a.encodeUtf8(e))},a.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},a.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},a.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))},a.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},a.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},a.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))},a.ByteStringBuffer.prototype.putInt=function(e,t){o(t);var r="";do{t-=8,r+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(r)},a.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<0);return t},a.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<=r&&(t-=r<<1),t},a.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},a.ByteStringBuffer.prototype.bytes=function(e){return"undefined"===typeof e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},a.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},a.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},a.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},a.ByteStringBuffer.prototype.copy=function(){var e=a.createBuffer(this.data);return e.read=this.read,e},a.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},a.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},a.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},a.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t=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},a.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},a.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},a.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},a.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},a.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},a.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},a.DataBuffer.prototype.putInt=function(e,t){o(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},a.DataBuffer.prototype.putSignedInt=function(e,t){return o(t),this.accommodate(t/8),e<0&&(e+=2<0);return t},a.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<=r&&(t-=r<<1),t},a.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},a.DataBuffer.prototype.bytes=function(e){return"undefined"===typeof e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},a.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},a.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},a.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},a.DataBuffer.prototype.copy=function(){return new a.DataBuffer(this)},a.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},a.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},a.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},a.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},a.xorBytes=function(e,t,r){for(var n="",i="",a="",o=0,s=0;r>0;--r,++o)i=e.charCodeAt(o)^t.charCodeAt(o),s>=10&&(n+=a,a="",s=0),a+=String.fromCharCode(i),++s;return n+=a},a.hexToBytes=function(e){var t="",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l=[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],c="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";a.encode64=function(e,t){for(var r,n,i,a="",o="",s=0;s>2),a+=u.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=u.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":u.charAt(63&i)),t&&a.length>t&&(o+=a.substr(0,t)+"\r\n",a=a.substr(t));return o+=a},a.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,r,n,i,a="",o=0;o>4),64!==n&&(a+=String.fromCharCode((15&r)<<4|n>>2),64!==i&&(a+=String.fromCharCode((3&n)<<6|i)));return a},a.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},a.decodeUtf8=function(e){return decodeURIComponent(escape(e))},a.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:i.encode,decode:i.decode}},a.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},a.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,a=0;a>2),a+=u.charAt((3&r)<<4|n>>4),isNaN(n)?a+="==":(a+=u.charAt((15&n)<<2|i>>6),a+=isNaN(i)?"=":u.charAt(63&i)),t&&a.length>t&&(o+=a.substr(0,t)+"\r\n",a=a.substr(t));return o+=a},a.binary.base64.decode=function(e,t,r){var n,i,a,o,s=t;s||(s=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var u=0,c=r=r||0;u>4,64!==a&&(s[c++]=(15&i)<<4|a>>2,64!==o&&(s[c++]=(3&a)<<6|o));return t?c-r:s.subarray(0,c)},a.binary.base58.encode=function(e,t){return a.binary.baseN.encode(e,c,t)},a.binary.base58.decode=function(e,t){return a.binary.baseN.decode(e,c,t)},a.text={utf8:{},utf16:{}},a.text.utf8.encode=function(e,t,r){e=a.encodeUtf8(e);var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,o=0;o0?(i=r[n].substring(0,o),a=r[n].substring(o+1)):(i=r[n],a=null),i in t||(t[i]=[]),i in Object.prototype||null===a||t[i].push(unescape(a))}return t};return"undefined"===typeof e?(null===v&&(v="undefined"!==typeof window&&window.location&&window.location.search?r(window.location.search.substring(1)):{}),t=v):t=r(e),t},a.parseFragment=function(e){var t=e,r="",n=e.indexOf("?");n>0&&(t=e.substring(0,n),r=e.substring(n+1));var i=t.split("/");return i.length>0&&""===i[0]&&i.shift(),{pathString:t,queryString:r,path:i,query:""===r?{}:a.getQueryVariables(r)}},a.makeRequest=function(e){var t=a.parseFragment(e),r={path:t.pathString,query:t.queryString,getPath:function(e){return"undefined"===typeof e?t.path:t.path[e]},getQuery:function(e,r){var n;return"undefined"===typeof e?n=t.query:(n=t.query[e])&&"undefined"!==typeof r&&(n=n[r]),n},getQueryLast:function(e,t){var n=r.getQuery(e);return n?n[n.length-1]:t}};return r},a.makeLink=function(e,t,r){e=jQuery.isArray(e)?e.join("/"):e;var n=jQuery.param(t||{});return r=r||"",e+(n.length>0?"?"+n:"")+(r.length>0?"#"+r:"")},a.setPath=function(e,t,r){if("object"===typeof e&&null!==e)for(var n=0,i=t.length;n0&&a.push(r),o=n.lastIndex;var s=t[0][1];switch(s){case"s":case"o":i");break;case"%":a.push("%");break;default:a.push("<%"+s+"?>")}}return a.push(e.substring(o)),a.join("")},a.formatNumber=function(e,t,r,n){var i=e,a=isNaN(t=Math.abs(t))?2:t,o=void 0===r?",":r,s=void 0===n?".":n,u=i<0?"-":"",l=parseInt(i=Math.abs(+i||0).toFixed(a),10)+"",c=l.length>3?l.length%3:0;return u+(c?l.substr(0,c)+s:"")+l.substr(c).replace(/(\d{3})(?=\d)/g,"$1"+s)+(a?o+Math.abs(i-l).toFixed(a).slice(2):"")},a.formatSize=function(e){return e=e>=1073741824?a.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?a.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?a.formatNumber(e/1024,0)+" KiB":a.formatNumber(e,0)+" bytes"},a.bytesFromIP=function(e){return-1!==e.indexOf(".")?a.bytesFromIPv4(e):-1!==e.indexOf(":")?a.bytesFromIPv6(e):null},a.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var t=a.createBuffer(),r=0;rr[n].end-r[n].start&&(n=r.length-1)):r.push({start:u,end:u})}t.push(o)}if(r.length>0){var l=r[n];l.end-l.start>0&&(t.splice(l.start,l.end-l.start+1,""),0===l.start&&t.unshift(""),7===l.end&&t.push(""))}return t.join(":")},a.estimateCores=function(e,t){if("function"===typeof e&&(t=e,e={}),e=e||{},"cores"in a&&!e.update)return t(null,a.cores);if("undefined"!==typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return a.cores=navigator.hardwareConcurrency,t(null,a.cores);if("undefined"===typeof Worker)return a.cores=1,t(null,a.cores);if("undefined"===typeof Blob)return a.cores=2,t(null,a.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",(function(e){for(var t=Date.now(),r=t+4;Date.now()s.st&&i.sti.st&&s.st{var n=r(45);r(9353),r(5465),r(2986),r(5693),r(9624),r(3225),r(5224),r(4188),r(9408),r(3900);var i=n.asn1,a=e.exports=n.pki=n.pki||{},o=a.oids,s={};s.CN=o.commonName,s.commonName="CN",s.C=o.countryName,s.countryName="C",s.L=o.localityName,s.localityName="L",s.ST=o.stateOrProvinceName,s.stateOrProvinceName="ST",s.O=o.organizationName,s.organizationName="O",s.OU=o.organizationalUnitName,s.organizationalUnitName="OU",s.E=o.emailAddress,s.emailAddress="E";var u=n.pki.rsa.publicKeyValidator,l={name:"Certificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"tbsCertificate",value:[{name:"Certificate.TBSCertificate.version",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.version.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certVersion"}]},{name:"Certificate.TBSCertificate.serialNumber",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certSerialNumber"},{name:"Certificate.TBSCertificate.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.signature.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certinfoSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certinfoSignatureParams"}]},{name:"Certificate.TBSCertificate.issuer",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certIssuer"},{name:"Certificate.TBSCertificate.validity",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.TBSCertificate.validity.notBefore (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity1UTCTime"},{name:"Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity2GeneralizedTime"},{name:"Certificate.TBSCertificate.validity.notAfter (utc)",tagClass:i.Class.UNIVERSAL,type:i.Type.UTCTIME,constructed:!1,optional:!0,capture:"certValidity3UTCTime"},{name:"Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass:i.Class.UNIVERSAL,type:i.Type.GENERALIZEDTIME,constructed:!1,optional:!0,capture:"certValidity4GeneralizedTime"}]},{name:"Certificate.TBSCertificate.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certSubject"},u,{name:"Certificate.TBSCertificate.issuerUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.issuerUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certIssuerUniqueId"}]},{name:"Certificate.TBSCertificate.subjectUniqueID",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,constructed:!0,optional:!0,value:[{name:"Certificate.TBSCertificate.subjectUniqueID.id",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSubjectUniqueId"}]},{name:"Certificate.TBSCertificate.extensions",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,constructed:!0,captureAsn1:"certExtensions",optional:!0}]},{name:"Certificate.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"Certificate.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"certSignatureOid"},{name:"Certificate.TBSCertificate.signature.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"certSignatureParams"}]},{name:"Certificate.signatureValue",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"certSignature"}]},c={name:"rsapss",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.hashAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"hashOid"}]}]},{name:"rsapss.maskGenAlgorithm",tagClass:i.Class.CONTEXT_SPECIFIC,type:1,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass:i.Class.UNIVERSAL,type:i.Class.SEQUENCE,constructed:!0,optional:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenOid"},{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"maskGenHashOid"}]}]}]},{name:"rsapss.saltLength",tagClass:i.Class.CONTEXT_SPECIFIC,type:2,optional:!0,value:[{name:"rsapss.saltLength.saltLength",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"saltLength"}]},{name:"rsapss.trailerField",tagClass:i.Class.CONTEXT_SPECIFIC,type:3,optional:!0,value:[{name:"rsapss.trailer.trailer",tagClass:i.Class.UNIVERSAL,type:i.Class.INTEGER,constructed:!1,capture:"trailer"}]}]},f={name:"CertificationRequestInfo",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfo",value:[{name:"CertificationRequestInfo.integer",tagClass:i.Class.UNIVERSAL,type:i.Type.INTEGER,constructed:!1,capture:"certificationRequestInfoVersion"},{name:"CertificationRequestInfo.subject",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"certificationRequestInfoSubject"},u,{name:"CertificationRequestInfo.attributes",tagClass:i.Class.CONTEXT_SPECIFIC,type:0,constructed:!0,optional:!0,capture:"certificationRequestInfoAttributes",value:[{name:"CertificationRequestInfo.attributes",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequestInfo.attributes.type",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1},{name:"CertificationRequestInfo.attributes.value",tagClass:i.Class.UNIVERSAL,type:i.Type.SET,constructed:!0}]}]}]},h={name:"CertificationRequest",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,captureAsn1:"csr",value:[f,{name:"CertificationRequest.signatureAlgorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.SEQUENCE,constructed:!0,value:[{name:"CertificationRequest.signatureAlgorithm.algorithm",tagClass:i.Class.UNIVERSAL,type:i.Type.OID,constructed:!1,capture:"csrSignatureOid"},{name:"CertificationRequest.signatureAlgorithm.parameters",tagClass:i.Class.UNIVERSAL,optional:!0,captureAsn1:"csrSignatureParams"}]},{name:"CertificationRequest.signature",tagClass:i.Class.UNIVERSAL,type:i.Type.BITSTRING,constructed:!1,captureBitStringValue:"csrSignature"}]};function d(e,t){"string"===typeof t&&(t={shortName:t});for(var r,n=null,i=0;null===n&&i128)throw new Error('Invalid "nsComment" content.');e.value=i.create(i.Class.UNIVERSAL,i.Type.IA5STRING,!1,e.comment)}else if("subjectKeyIdentifier"===e.name&&t.cert){var d=t.cert.generateSubjectKeyIdentifier();e.subjectKeyIdentifier=d.toHex(),e.value=i.create(i.Class.UNIVERSAL,i.Type.OCTETSTRING,!1,d.getBytes())}else if("authorityKeyIdentifier"===e.name&&t.cert){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);c=e.value.value;if(e.keyIdentifier){var p=!0===e.keyIdentifier?t.cert.generateSubjectKeyIdentifier().getBytes():e.keyIdentifier;c.push(i.create(i.Class.CONTEXT_SPECIFIC,0,!1,p))}if(e.authorityCertIssuer){var y=[i.create(i.Class.CONTEXT_SPECIFIC,4,!0,[g(!0===e.authorityCertIssuer?t.cert.issuer:e.authorityCertIssuer)])];c.push(i.create(i.Class.CONTEXT_SPECIFIC,1,!0,y))}if(e.serialNumber){var m=n.util.hexToBytes(!0===e.serialNumber?t.cert.serialNumber:e.serialNumber);c.push(i.create(i.Class.CONTEXT_SPECIFIC,2,!1,m))}}else if("cRLDistributionPoints"===e.name){e.value=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);c=e.value.value;var v,b=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]),S=i.create(i.Class.CONTEXT_SPECIFIC,0,!0,[]);for(h=0;h2)throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");if(f.length<2)throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");if(u.validity.notBefore=f[0],u.validity.notAfter=f[1],u.tbsCertificate=r.tbsCertificate,t){var h;if(u.md=null,u.signatureOid in o)switch(o[u.signatureOid]){case"sha1WithRSAEncryption":u.md=n.md.sha1.create();break;case"md5WithRSAEncryption":u.md=n.md.md5.create();break;case"sha256WithRSAEncryption":case"RSASSA-PSS":u.md=n.md.sha256.create();break;case"sha384WithRSAEncryption":u.md=n.md.sha384.create();break;case"sha512WithRSAEncryption":u.md=n.md.sha512.create()}if(null===u.md)throw(h=new Error("Could not compute certificate digest. Unknown signature OID.")).signatureOid=u.signatureOid,h;var g=i.toDer(u.tbsCertificate);u.md.update(g.getBytes())}var m=n.md.sha1.create();u.issuer.getField=function(e){return d(u.issuer,e)},u.issuer.addField=function(e){y([e]),u.issuer.attributes.push(e)},u.issuer.attributes=a.RDNAttributesAsArray(r.certIssuer,m),r.certIssuerUniqueId&&(u.issuer.uniqueId=r.certIssuerUniqueId),u.issuer.hash=m.digest().toHex();var v=n.md.sha1.create();return u.subject.getField=function(e){return d(u.subject,e)},u.subject.addField=function(e){y([e]),u.subject.attributes.push(e)},u.subject.attributes=a.RDNAttributesAsArray(r.certSubject,v),r.certSubjectUniqueId&&(u.subject.uniqueId=r.certSubjectUniqueId),u.subject.hash=v.digest().toHex(),r.certExtensions?u.extensions=a.certificateExtensionsFromAsn1(r.certExtensions):u.extensions=[],u.publicKey=a.publicKeyFromAsn1(r.subjectPublicKeyInfo),u},a.certificateExtensionsFromAsn1=function(e){for(var t=[],r=0;r1&&(r=u.value.charCodeAt(1),a=u.value.length>2?u.value.charCodeAt(2):0),t.digitalSignature=128===(128&r),t.nonRepudiation=64===(64&r),t.keyEncipherment=32===(32&r),t.dataEncipherment=16===(16&r),t.keyAgreement=8===(8&r),t.keyCertSign=4===(4&r),t.cRLSign=2===(2&r),t.encipherOnly=1===(1&r),t.decipherOnly=128===(128&a)}else if("basicConstraints"===t.name){(u=i.fromDer(t.value)).value.length>0&&u.value[0].type===i.Type.BOOLEAN?t.cA=0!==u.value[0].value.charCodeAt(0):t.cA=!1;var s=null;u.value.length>0&&u.value[0].type===i.Type.INTEGER?s=u.value[0].value:u.value.length>1&&(s=u.value[1].value),null!==s&&(t.pathLenConstraint=i.derToInteger(s))}else if("extKeyUsage"===t.name)for(var u=i.fromDer(t.value),l=0;l1&&(r=u.value.charCodeAt(1)),t.client=128===(128&r),t.server=64===(64&r),t.email=32===(32&r),t.objsign=16===(16&r),t.reserved=8===(8&r),t.sslCA=4===(4&r),t.emailCA=2===(2&r),t.objCA=1===(1&r)}else if("subjectAltName"===t.name||"issuerAltName"===t.name){var f;t.altNames=[];u=i.fromDer(t.value);for(var h=0;h=S&&e0&&o.value.push(a.certificateExtensionsToAsn1(e.extensions)),o},a.getCertificationRequestInfo=function(e){return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.INTEGER,!1,i.integerToDer(e.version).getBytes()),g(e.subject),a.publicKeyToAsn1(e.publicKey),b(e)])},a.distinguishedNameToAsn1=function(e){return g(e)},a.certificateToAsn1=function(e){var t=e.tbsCertificate||a.getTBSCertificate(e);return i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[t,i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[i.create(i.Class.UNIVERSAL,i.Type.OID,!1,i.oidToDer(e.signatureOid).getBytes()),v(e.signatureOid,e.signatureParameters)]),i.create(i.Class.UNIVERSAL,i.Type.BITSTRING,!1,String.fromCharCode(0)+e.signature)])},a.certificateExtensionsToAsn1=function(e){var t=i.create(i.Class.CONTEXT_SPECIFIC,3,!0,[]),r=i.create(i.Class.UNIVERSAL,i.Type.SEQUENCE,!0,[]);t.value.push(r);for(var n=0;nc.validity.notAfter)&&(u={message:"Certificate is not valid yet or has expired.",error:a.certificateError.certificate_expired,notBefore:c.validity.notBefore,notAfter:c.validity.notAfter,now:o}),null===u){if(null===(f=t[0]||e.getIssuer(c))&&c.isIssuer(c)&&(h=!0,f=c),f){var d=f;n.util.isArray(d)||(d=[d]);for(var p=!1;!p&&d.length>0;){f=d.shift();try{p=f.verify(c)}catch(E){}}p||(u={message:"Certificate signature is invalid.",error:a.certificateError.bad_certificate})}null!==u||f&&!h||e.hasCertificate(c)||(u={message:"Certificate is not trusted.",error:a.certificateError.unknown_ca})}if(null===u&&f&&!c.isIssuer(f)&&(u={message:"Certificate issuer is invalid.",error:a.certificateError.bad_certificate}),null===u)for(var g={keyUsage:!0,basicConstraints:!0},y=0;null===u&&yv.pathLenConstraint&&(u={message:"Certificate basicConstraints pathLenConstraint violated.",error:a.certificateError.bad_certificate})}var S=null===u||u.error,w=r.verify?r.verify(S,l,i):S;if(!0!==w)throw!0===S&&(u={message:"The application rejected the certificate.",error:a.certificateError.bad_certificate}),(w||0===w)&&("object"!==typeof w||n.util.isArray(w)?"string"===typeof w&&(u.error=w):(w.message&&(u.message=w.message),w.error&&(u.error=w.error))),u;u=null,s=!1,++l}while(t.length>0);return!0}},1099:(e,t,r)=>{"use strict";e.exports=r(9191)},9191:(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(5850),n.BufferWriter=r(3931),n.Reader=r(957),n.BufferReader=r(7707),n.util=r(1509),n.rpc=r(8094),n.roots=r(1368),n.configure=i,i()},957:(e,t,r)=>{"use strict";e.exports=u;var n,i=r(1509),a=i.LongBits,o=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 l="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")},c=function(){return i.Buffer?function(e){return(u.create=function(e){return i.Buffer.isBuffer(e)?new n(e):l(e)})(e)}:l};function f(){var e=new a(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 a(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}u.create=c(),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 o.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=c(),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)}})}},7707:(e,t,r)=>{"use strict";e.exports=a;var n=r(957);(a.prototype=Object.create(n.prototype)).constructor=a;var i=r(1509);function a(e){n.call(this,e)}a._configure=function(){i.Buffer&&(a.prototype._slice=i.Buffer.prototype.slice)},a.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))},a._configure()},1368:e=>{"use strict";e.exports={}},8094:(e,t,r)=>{"use strict";t.Service=r(3694)},3694:(e,t,r)=>{"use strict";e.exports=i;var n=r(1509);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,a,o){if(!a)throw TypeError("request must be specified");var s=this;if(!o)return n.asPromise(e,s,t,r,i,a);if(s.rpcImpl)try{return s.rpcImpl(t,r[s.requestDelimited?"encodeDelimited":"encode"](a).finish(),(function(e,r){if(e)return s.emit("error",e,t),o(e);if(null!==r){if(!(r instanceof i))try{r=i[s.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return s.emit("error",e,t),o(e)}return s.emit("data",r,t),o(null,r)}s.end(!0)}))}catch(u){return s.emit("error",u,t),void setTimeout((function(){o(u)}),0)}else setTimeout((function(){o(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}},6350:(e,t,r)=>{"use strict";e.exports=i;var n=r(1509);function i(e,t){this.lo=e>>>0,this.hi=t>>>0}var a=i.zero=new i(0,0);a.toNumber=function(){return 0},a.zzEncode=a.zzDecode=function(){return this},a.length=function(){return 1};var o=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(e){if(0===e)return a;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):a},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===o?a: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}},1509:function(e,t,r){"use strict";var n=t;function i(e,t,r){for(var n=Object.keys(t),i=0;i0)},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=a,n.ProtocolError=a("ProtocolError"),n.oneOfGetter=function(e){for(var t={},r=0;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{"use strict";e.exports=f;var n,i=r(1509),a=i.LongBits,o=i.base64,s=i.utf8;function u(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function l(){}function c(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(l,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 g(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 y(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(g,10,a.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=a.from(e);return this._push(g,t.length(),t)},f.prototype.int64=f.prototype.uint64,f.prototype.sint64=function(e){var t=a.from(e).zzEncode();return this._push(g,t.length(),t)},f.prototype.bool=function(e){return this._push(d,1,e?1:0)},f.prototype.fixed32=function(e){return this._push(y,4,e>>>0)},f.prototype.sfixed32=f.prototype.fixed32,f.prototype.fixed64=function(e){var t=a.from(e);return this._push(y,4,t.lo)._push(y,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 m=i.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var n=0;n>>0;if(!t)return this._push(d,1,0);if(i.isString(e)){var r=f.alloc(t=o.length(e));o.decode(e,r,0),e=r}return this.uint32(t)._push(m,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 c(this),this.head=this.tail=new u(l,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(l,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()}},3931:(e,t,r)=>{"use strict";e.exports=a;var n=r(5850);(a.prototype=Object.create(n.prototype)).constructor=a;var i=r(1509);function a(){n.call(this)}function o(e,t,r){e.length<40?i.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}a._configure=function(){a.alloc=i._Buffer_allocUnsafe,a.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>>0;return this.uint32(t),t&&this._push(a.writeBytesBuffer,t,e),this},a.prototype.string=function(e){var t=i.Buffer.byteLength(e);return this.uint32(t),t&&this._push(o,t,e),this},a._configure()},149:(e,t,r)=>{var n=r(6257)((function(e){return function(){return e}}));e.exports=n},9651:(e,t,r)=>{var n=r(1030),i=r(6120)((function(e,t){return n(e.length,(function(){return e.apply(t,arguments)}))}));e.exports=i},9771:(e,t,r)=>{var n=r(1030),i=r(6257),a=r(6120),o=r(4796),s=a((function(e,t){return 1===e?i(t):n(e,o(e,[],t))}));e.exports=s},70:(e,t,r)=>{var n=r(6120)((function(e,t){return null==t||t!==t?e:t}));e.exports=n},5553:(e,t,r)=>{var n=r(6120),i=r(8546),a=n((function(e,t){return i(e,t,[],[])}));e.exports=a},4095:(e,t,r)=>{var n=r(6257),i=r(9771),a=n((function(e){return i(e.length,(function(t,r){var n=Array.prototype.slice.call(arguments,0);return n[0]=r,n[1]=t,e.apply(this,n)}))}));e.exports=a},9092:(e,t,r)=>{var n=r(6120)((function(e,t){return e>=t}));e.exports=n},6498:(e,t,r)=>{var n=r(735),i=r(9771),a=n((function(e,t,r){return i(Math.max(e.length,t.length,r.length),(function(){return e.apply(this,arguments)?t.apply(this,arguments):r.apply(this,arguments)}))}));e.exports=a},745:(e,t,r)=>{var n=r(6286),i=r(6120)(n);e.exports=i},1030:e=>{e.exports=function(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(e){return t.apply(this,arguments)};case 2:return function(e,r){return t.apply(this,arguments)};case 3:return function(e,r,n){return t.apply(this,arguments)};case 4:return function(e,r,n,i){return t.apply(this,arguments)};case 5:return function(e,r,n,i,a){return t.apply(this,arguments)};case 6:return function(e,r,n,i,a,o){return t.apply(this,arguments)};case 7:return function(e,r,n,i,a,o,s){return t.apply(this,arguments)};case 8:return function(e,r,n,i,a,o,s,u){return t.apply(this,arguments)};case 9:return function(e,r,n,i,a,o,s,u,l){return t.apply(this,arguments)};case 10:return function(e,r,n,i,a,o,s,u,l,c){return t.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}},6836:e=>{e.exports=function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}},7849:(e,t,r)=>{var n=r(6542);e.exports=function(e,t){return function(){var r=arguments.length;if(0===r)return t();var i=arguments[r-1];return n(i)||"function"!==typeof i[e]?t.apply(this,arguments):i[e].apply(i,Array.prototype.slice.call(arguments,0,r-1))}}},3967:e=>{e.exports=function(e,t){var r;t=t||[];var n=(e=e||[]).length,i=t.length,a=[];for(r=0;r{var n=r(4838);e.exports=function(e){return function t(r){return 0===arguments.length||n(r)?t:e.apply(this,arguments)}}},6120:(e,t,r)=>{var n=r(6257),i=r(4838);e.exports=function(e){return function t(r,a){switch(arguments.length){case 0:return t;case 1:return i(r)?t:n((function(t){return e(r,t)}));default:return i(r)&&i(a)?t:i(r)?n((function(t){return e(t,a)})):i(a)?n((function(t){return e(r,t)})):e(r,a)}}}},735:(e,t,r)=>{var n=r(6257),i=r(6120),a=r(4838);e.exports=function(e){return function t(r,o,s){switch(arguments.length){case 0:return t;case 1:return a(r)?t:i((function(t,n){return e(r,t,n)}));case 2:return a(r)&&a(o)?t:a(r)?i((function(t,r){return e(t,o,r)})):a(o)?i((function(t,n){return e(r,t,n)})):n((function(t){return e(r,o,t)}));default:return a(r)&&a(o)&&a(s)?t:a(r)&&a(o)?i((function(t,r){return e(t,r,s)})):a(r)&&a(s)?i((function(t,r){return e(t,o,r)})):a(o)&&a(s)?i((function(t,n){return e(r,t,n)})):a(r)?n((function(t){return e(t,o,s)})):a(o)?n((function(t){return e(r,t,s)})):a(s)?n((function(t){return e(r,o,t)})):e(r,o,s)}}}},4796:(e,t,r)=>{var n=r(1030),i=r(4838);e.exports=function e(t,r,a){return function(){for(var o=[],s=0,u=t,l=0;l=arguments.length)?c=r[l]:(c=arguments[s],s+=1),o[l]=c,i(c)||(u-=1),l+=1}return u<=0?a.apply(this,o):n(u,e(t,o,a))}}},3601:(e,t,r)=>{var n=r(6542),i=r(8256);e.exports=function(e,t,r){return function(){if(0===arguments.length)return r();var a=Array.prototype.slice.call(arguments,0),o=a.pop();if(!n(o)){for(var s=0;s{var n=r(6836),i=r(5210),a=r(6760),o=r(7487),s=r(5912),u=r(9176),l=r(8096);function c(e,t,r,a){var o=n(e),s=n(t);function u(e,t){return f(e,t,r.slice(),a.slice())}return!i((function(e,t){return!i(u,t,e)}),s,o)}function f(e,t,r,n){if(s(e,t))return!0;var i=l(e);if(i!==l(t))return!1;if(null==e||null==t)return!1;if("function"===typeof e["fantasy-land/equals"]||"function"===typeof t["fantasy-land/equals"])return"function"===typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](t)&&"function"===typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](e);if("function"===typeof e.equals||"function"===typeof t.equals)return"function"===typeof e.equals&&e.equals(t)&&"function"===typeof t.equals&&t.equals(e);switch(i){case"Arguments":case"Array":case"Object":if("function"===typeof e.constructor&&"Promise"===a(e.constructor))return e===t;break;case"Boolean":case"Number":case"String":if(typeof e!==typeof t||!s(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!s(e.valueOf(),t.valueOf()))return!1;break;case"Error":return e.name===t.name&&e.message===t.message;case"RegExp":if(e.source!==t.source||e.global!==t.global||e.ignoreCase!==t.ignoreCase||e.multiline!==t.multiline||e.sticky!==t.sticky||e.unicode!==t.unicode)return!1}for(var h=r.length-1;h>=0;){if(r[h]===e)return n[h]===t;h-=1}switch(i){case"Map":return e.size===t.size&&c(e.entries(),t.entries(),r.concat([e]),n.concat([t]));case"Set":return e.size===t.size&&c(e.values(),t.values(),r.concat([e]),n.concat([t]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var d=u(e);if(d.length!==u(t).length)return!1;var p=r.concat([e]),g=n.concat([t]);for(h=d.length-1;h>=0;){var y=d[h];if(!o(y,t)||!f(t[y],e[y],p,g))return!1;h-=1}return!0}e.exports=f},6760:e=>{e.exports=function(e){var t=String(e).match(/^function (\w*)/);return null==t?"":t[1]}},7487:e=>{e.exports=function(e,t){return Object.prototype.hasOwnProperty.call(t,e)}},6286:(e,t,r)=>{var n=r(2238);e.exports=function(e,t){return n(t,e,0)>=0}},5210:e=>{e.exports=function(e,t,r){for(var n=0,i=r.length;n{var n=r(5553);e.exports=function(e,t,r){var i,a;if("function"===typeof e.indexOf)switch(typeof t){case"number":if(0===t){for(i=1/t;r{var n=r(7487),i=Object.prototype.toString,a=function(){return"[object Arguments]"===i.call(arguments)?function(e){return"[object Arguments]"===i.call(e)}:function(e){return n("callee",e)}}();e.exports=a},6542:e=>{e.exports=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)}},1385:(e,t,r)=>{var n=r(6257),i=r(6542),a=r(5778),o=n((function(e){return!!i(e)||!!e&&("object"===typeof e&&(!a(e)&&(1===e.nodeType?!!e.length:0===e.length||e.length>0&&(e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1)))))}));e.exports=o},9749:e=>{e.exports=Number.isInteger||function(e){return e<<0===e}},4838:e=>{e.exports=function(e){return null!=e&&"object"===typeof e&&!0===e["@@functional/placeholder"]}},5778:e=>{e.exports=function(e){return"[object String]"===Object.prototype.toString.call(e)}},8256:e=>{e.exports=function(e){return null!=e&&"function"===typeof e["@@transducer/step"]}},5912:e=>{e.exports="function"===typeof Object.is?Object.is:function(e,t){return e===t?0!==e||1/e===1/t:e!==e&&t!==t}},3323:e=>{e.exports=function(e,t){return function(){return t.call(this,e.apply(this,arguments))}}},8537:(e,t,r)=>{var n=r(1385),i=r(531),a=r(9651);function o(e,t,r){for(var n=r.next();!n.done;){if((t=e["@@transducer/step"](t,n.value))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}n=r.next()}return e["@@transducer/result"](t)}function s(e,t,r,n){return e["@@transducer/result"](r[n](a(e["@@transducer/step"],e),t))}var u="undefined"!==typeof Symbol?Symbol.iterator:"@@iterator";e.exports=function(e,t,r){if("function"===typeof e&&(e=i(e)),n(r))return function(e,t,r){for(var n=0,i=r.length;n{e.exports=function(e){return e&&e["@@transducer/reduced"]?e:{"@@transducer/value":e,"@@transducer/reduced":!0}}},4228:e=>{e.exports={init:function(){return this.xf["@@transducer/init"]()},result:function(e){return this.xf["@@transducer/result"](e)}}},6952:(e,t,r)=>{var n=r(6120),i=r(8969),a=r(4228),o=function(){function e(e,t){this.xf=t,this.n=e,this.i=0}return e.prototype["@@transducer/init"]=a.init,e.prototype["@@transducer/result"]=a.result,e.prototype["@@transducer/step"]=function(e,t){this.i+=1;var r=0===this.n?e:this.xf["@@transducer/step"](e,t);return this.n>=0&&this.i>=this.n?i(r):r},e}(),s=n((function(e,t){return new o(e,t)}));e.exports=s},531:e=>{var t=function(){function e(e){this.f=e}return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(e){return e},e.prototype["@@transducer/step"]=function(e,t){return this.f(e,t)},e}();e.exports=function(e){return new t(e)}},6081:(e,t,r)=>{var n=r(6257)((function(e){return null==e}));e.exports=n},9176:(e,t,r)=>{var n=r(6257),i=r(7487),a=r(683),o=!{toString:null}.propertyIsEnumerable("toString"),s=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],u=function(){"use strict";return arguments.propertyIsEnumerable("length")}(),l=function(e,t){for(var r=0;r=0;)i(t=s[r],e)&&!l(n,t)&&(n[n.length]=t),r-=1;return n})):n((function(e){return Object(e)!==e?[]:Object.keys(e)}));e.exports=c},1277:(e,t,r)=>{var n=r(6120)((function(e,t){return e<=t}));e.exports=n},5147:(e,t,r)=>{var n=r(6257)((function(e){return!e}));e.exports=n},6928:(e,t,r)=>{var n=r(6120),i=r(5778),a=n((function(e,t){var r=e<0?t.length+e:e;return i(t)?t.charAt(r):t[r]}));e.exports=a},2339:(e,t,r)=>{var n=r(6120),i=r(8374),a=n((function(e,t){return i([e],t)[0]}));e.exports=a},8374:(e,t,r)=>{var n=r(6120),i=r(9749),a=r(6928),o=n((function(e,t){return e.map((function(e){for(var r,n=t,o=0;o{var n=r(1030),i=r(3323),a=r(1094),o=r(2130);e.exports=function(){if(0===arguments.length)throw new Error("pipe requires at least one argument");return n(arguments[0].length,a(i,arguments[0],o(arguments)))}},6657:(e,t,r)=>{var n=r(6120),i=r(2339),a=n((function(e,t){return i([e],t)}));e.exports=a},1094:(e,t,r)=>{var n=r(735)(r(8537));e.exports=n},120:(e,t,r)=>{var n=r(7849),i=r(735)(n("slice",(function(e,t,r){return Array.prototype.slice.call(r,e,t)})));e.exports=i},2181:(e,t,r)=>{var n=r(6120),i=r(5553),a=r(2879),o=n((function(e,t){return i(a(e.length,t),e)}));e.exports=o},2130:(e,t,r)=>{var n=r(7849),i=r(6257)(n("tail",r(120)(1,1/0)));e.exports=i},2879:(e,t,r)=>{var n=r(6120),i=r(3601),a=r(6952),o=r(120),s=n(i(["take"],a,(function(e,t){return o(0,e<0?1/0:e,t)})));e.exports=s},688:(e,t,r)=>{var n=r(1030),i=r(3967),a=r(6120)((function(e,t){return n(e.length,(function(){try{return e.apply(this,arguments)}catch(r){return t.apply(this,i([r],arguments))}}))}));e.exports=a},8096:(e,t,r)=>{var n=r(6257)((function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)}));e.exports=n},2730:(e,t,r)=>{"use strict";var n=r(5043),i=r(8853);function a(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r