@ukeyfe/hardware-web-sdk 1.1.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["ukey-js-sdk"]=t():e["ukey-js-sdk"]=t()}(self,(()=>(()=>{var __webpack_modules__={3808:e=>{"use strict";e.exports=function(e,t){var r=new Array(arguments.length-1),i=0,n=2,s=!0;for(;n<arguments.length;)r[i++]=arguments[n++];return new Promise((function(n,o){r[i]=function(e){if(s)if(s=!1,e)o(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];n.apply(null,t)}};try{e.apply(t||null,r)}catch(e){s&&(s=!1,o(e))}}))}},3320:(e,t)=>{"use strict";var r=t;r.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var i=new Array(64),n=new Array(123),s=0;s<64;)n[i[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;r.encode=function(e,t,r){for(var n,s=null,o=[],a=0,d=0;t<r;){var u=e[t++];switch(d){case 0:o[a++]=i[u>>2],n=(3&u)<<4,d=1;break;case 1:o[a++]=i[n|u>>4],n=(15&u)<<2,d=2;break;case 2:o[a++]=i[n|u>>6],o[a++]=i[63&u],d=0}a>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,o)),a=0)}return d&&(o[a++]=i[n],o[a++]=61,1===d&&(o[a++]=61)),s?(a&&s.push(String.fromCharCode.apply(String,o.slice(0,a))),s.join("")):String.fromCharCode.apply(String,o.slice(0,a))};var o="invalid encoding";r.decode=function(e,t,r){for(var i,s=r,a=0,d=0;d<e.length;){var u=e.charCodeAt(d++);if(61===u&&a>1)break;if(void 0===(u=n[u]))throw Error(o);switch(a){case 0:i=u,a=1;break;case 1:t[r++]=i<<2|(48&u)>>4,i=u,a=2;break;case 2:t[r++]=(15&i)<<4|(60&u)>>2,i=u,a=3;break;case 3:t[r++]=(3&i)<<6|u,a=0}}if(1===a)throw Error(o);return r-s},r.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},4132:e=>{"use strict";function t(e,r){"string"==typeof e&&(r=e,e=void 0);var i=[];function n(e){if("string"!=typeof e){var r=s();if(t.verbose&&console.log("codegen: "+r),r="return "+r,e){for(var o=Object.keys(e),a=new Array(o.length+1),d=new Array(o.length),u=0;u<o.length;)a[u]=o[u],d[u]=e[o[u++]];return a[u]=r,Function.apply(null,a).apply(null,d)}return Function(r)()}for(var l=new Array(arguments.length-1),c=0;c<l.length;)l[c]=arguments[++c];if(c=0,e=e.replace(/%([%dfijs])/g,(function(e,t){var r=l[c++];switch(t){case"d":case"f":return String(Number(r));case"i":return String(Math.floor(r));case"j":return JSON.stringify(r);case"s":return String(r)}return"%"})),c!==l.length)throw Error("parameter count mismatch");return i.push(e),n}function s(t){return"function "+(t||r||"")+"("+(e&&e.join(",")||"")+"){\n "+i.join("\n ")+"\n}"}return n.toString=s,n}e.exports=t,t.verbose=!1},2149: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],i=0;i<r.length;)r[i].fn===t?r.splice(i,1):++i;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],i=1;i<arguments.length;)r.push(arguments[i++]);for(i=0;i<t.length;)t[i].fn.apply(t[i++].ctx,r)}return this}},177:(e,t,r)=>{"use strict";e.exports=s;var i=r(3808),n=r(3768)("fs");function s(e,t,r){return"function"==typeof t?(r=t,t={}):t||(t={}),r?!t.xhr&&n&&n.readFile?n.readFile(e,(function(i,n){return i&&"undefined"!=typeof XMLHttpRequest?s.xhr(e,t,r):i?r(i):r(null,t.binary?n:n.toString("utf8"))})):s.xhr(e,t,r):i(s,this,e,t)}s.xhr=function(e,t,r){var i=new XMLHttpRequest;i.onreadystatechange=function(){if(4===i.readyState){if(0!==i.status&&200!==i.status)return r(Error("status "+i.status));if(t.binary){var e=i.response;if(!e){e=[];for(var n=0;n<i.responseText.length;++n)e.push(255&i.responseText.charCodeAt(n))}return r(null,"undefined"!=typeof Uint8Array?new Uint8Array(e):e)}return r(null,i.responseText)}},t.binary&&("overrideMimeType"in i&&i.overrideMimeType("text/plain; charset=x-user-defined"),i.responseType="arraybuffer"),i.open("GET",e),i.send()}},1727:e=>{"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),i=128===r[3];function n(e,i,n){t[0]=e,i[n]=r[0],i[n+1]=r[1],i[n+2]=r[2],i[n+3]=r[3]}function s(e,i,n){t[0]=e,i[n]=r[3],i[n+1]=r[2],i[n+2]=r[1],i[n+3]=r[0]}function o(e,i){return r[0]=e[i],r[1]=e[i+1],r[2]=e[i+2],r[3]=e[i+3],t[0]}function a(e,i){return r[3]=e[i],r[2]=e[i+1],r[1]=e[i+2],r[0]=e[i+3],t[0]}e.writeFloatLE=i?n:s,e.writeFloatBE=i?s:n,e.readFloatLE=i?o:a,e.readFloatBE=i?a:o}():function(){function t(e,t,r,i){var n=t<0?1:0;if(n&&(t=-t),0===t)e(1/t>0?0:2147483648,r,i);else if(isNaN(t))e(2143289344,r,i);else if(t>34028234663852886e22)e((n<<31|2139095040)>>>0,r,i);else if(t<11754943508222875e-54)e((n<<31|Math.round(t/1401298464324817e-60))>>>0,r,i);else{var s=Math.floor(Math.log(t)/Math.LN2);e((n<<31|s+127<<23|8388607&Math.round(t*Math.pow(2,-s)*8388608))>>>0,r,i)}}function o(e,t,r){var i=e(t,r),n=2*(i>>31)+1,s=i>>>23&255,o=8388607&i;return 255===s?o?NaN:n*(1/0):0===s?1401298464324817e-60*n*o:n*Math.pow(2,s-150)*(o+8388608)}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,i),e.readFloatLE=o.bind(null,n),e.readFloatBE=o.bind(null,s)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),i=128===r[7];function n(e,i,n){t[0]=e,i[n]=r[0],i[n+1]=r[1],i[n+2]=r[2],i[n+3]=r[3],i[n+4]=r[4],i[n+5]=r[5],i[n+6]=r[6],i[n+7]=r[7]}function s(e,i,n){t[0]=e,i[n]=r[7],i[n+1]=r[6],i[n+2]=r[5],i[n+3]=r[4],i[n+4]=r[3],i[n+5]=r[2],i[n+6]=r[1],i[n+7]=r[0]}function o(e,i){return r[0]=e[i],r[1]=e[i+1],r[2]=e[i+2],r[3]=e[i+3],r[4]=e[i+4],r[5]=e[i+5],r[6]=e[i+6],r[7]=e[i+7],t[0]}function a(e,i){return r[7]=e[i],r[6]=e[i+1],r[5]=e[i+2],r[4]=e[i+3],r[3]=e[i+4],r[2]=e[i+5],r[1]=e[i+6],r[0]=e[i+7],t[0]}e.writeDoubleLE=i?n:s,e.writeDoubleBE=i?s:n,e.readDoubleLE=i?o:a,e.readDoubleBE=i?a:o}():function(){function t(e,t,r,i,n,s){var o=i<0?1:0;if(o&&(i=-i),0===i)e(0,n,s+t),e(1/i>0?0:2147483648,n,s+r);else if(isNaN(i))e(0,n,s+t),e(2146959360,n,s+r);else if(i>17976931348623157e292)e(0,n,s+t),e((o<<31|2146435072)>>>0,n,s+r);else{var a;if(i<22250738585072014e-324)e((a=i/5e-324)>>>0,n,s+t),e((o<<31|a/4294967296)>>>0,n,s+r);else{var d=Math.floor(Math.log(i)/Math.LN2);1024===d&&(d=1023),e(4503599627370496*(a=i*Math.pow(2,-d))>>>0,n,s+t),e((o<<31|d+1023<<20|1048576*a&1048575)>>>0,n,s+r)}}}function o(e,t,r,i,n){var s=e(i,n+t),o=e(i,n+r),a=2*(o>>31)+1,d=o>>>20&2047,u=4294967296*(1048575&o)+s;return 2047===d?u?NaN:a*(1/0):0===d?5e-324*a*u:a*Math.pow(2,d-1075)*(u+4503599627370496)}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,i,4,0),e.readDoubleLE=o.bind(null,n,0,4),e.readDoubleBE=o.bind(null,s,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 i(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 n(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function s(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},3768: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},1080:(e,t)=>{"use strict";var r=t,i=r.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},n=r.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),r=i(e),n="";r&&(n=t.shift()+"/");for(var s=0;s<t.length;)".."===t[s]?s>0&&".."!==t[s-1]?t.splice(--s,2):r?t.splice(s,1):++s:"."===t[s]?t.splice(s,1):++s;return n+t.join("/")};r.resolve=function(e,t,r){return r||(t=n(t)),i(t)?t:(r||(e=n(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?n(e+"/"+t):t)}},2461:e=>{"use strict";e.exports=function(e,t,r){var i=r||8192,n=i>>>1,s=null,o=i;return function(r){if(r<1||r>n)return e(r);o+r>i&&(s=e(i),o=0);var a=t.call(s,o,o+=r);return 7&o&&(o=1+(7|o)),a}}},5184:(e,t)=>{"use strict";var r=t;r.length=function(e){for(var t=0,r=0,i=0;i<e.length;++i)(r=e.charCodeAt(i))<128?t+=1:r<2048?t+=2:55296==(64512&r)&&56320==(64512&e.charCodeAt(i+1))?(++i,t+=4):t+=3;return t},r.read=function(e,t,r){if(r-t<1)return"";for(var i,n=null,s=[],o=0;t<r;)(i=e[t++])<128?s[o++]=i:i>191&&i<224?s[o++]=(31&i)<<6|63&e[t++]:i>239&&i<365?(i=((7&i)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,s[o++]=55296+(i>>10),s[o++]=56320+(1023&i)):s[o++]=(15&i)<<12|(63&e[t++])<<6|63&e[t++],o>8191&&((n||(n=[])).push(String.fromCharCode.apply(String,s)),o=0);return n?(o&&n.push(String.fromCharCode.apply(String,s.slice(0,o))),n.join("")):String.fromCharCode.apply(String,s.slice(0,o))},r.write=function(e,t,r){for(var i,n,s=r,o=0;o<e.length;++o)(i=e.charCodeAt(o))<128?t[r++]=i:i<2048?(t[r++]=i>>6|192,t[r++]=63&i|128):55296==(64512&i)&&56320==(64512&(n=e.charCodeAt(o+1)))?(i=65536+((1023&i)<<10)+(1023&n),++o,t[r++]=i>>18|240,t[r++]=i>>12&63|128,t[r++]=i>>6&63|128,t[r++]=63&i|128):(t[r++]=i>>12|224,t[r++]=i>>6&63|128,t[r++]=63&i|128);return r-s}},5747:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var n=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(r,i){function n(r){e.removeListener(t,s),i(r)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",n),r([].slice.call(arguments))}y(e,t,s,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&y(e,"error",t,r)}(e,n,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function d(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function u(e,t,r,i){var n,s,o,u;if(a(r),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),s=e._events),o=s[t]),void 0===o)o=s[t]=r,++e._eventsCount;else if("function"==typeof o?o=s[t]=i?[r,o]:[o,r]:i?o.unshift(r):o.push(r),(n=d(e))>0&&o.length>n&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=o.length,u=l,console&&console.warn&&console.warn(u)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(e,t,r){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},n=l.bind(i);return n.listener=r,i.wrapFn=n,n}function p(e,t,r){var i=e._events;if(void 0===i)return[];var n=i[t];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(n):f(n,n.length)}function h(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function f(e,t){for(var r=new Array(t),i=0;i<t;++i)r[i]=e[i];return r}function y(e,t,r,i){if("function"==typeof e.on)i.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function n(s){i.once&&e.removeEventListener(t,n),r(s)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||n(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||n(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return d(this)},s.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,s=this._events;if(void 0!==s)n=n&&void 0===s.error;else if(!n)return!1;if(n){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var d=s[e];if(void 0===d)return!1;if("function"==typeof d)i(d,this,t);else{var u=d.length,l=f(d,u);for(r=0;r<u;++r)i(l[r],this,t)}return!0},s.prototype.addListener=function(e,t){return u(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return u(this,e,t,!0)},s.prototype.once=function(e,t){return a(t),this.on(e,c(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,c(this,e,t)),this},s.prototype.removeListener=function(e,t){var r,i,n,s,o;if(a(t),void 0===(i=this._events))return this;if(void 0===(r=i[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(n=-1,s=r.length-1;s>=0;s--)if(r[s]===t||r[s].listener===t){o=r[s].listener,n=s;break}if(n<0)return this;0===n?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,n),1===r.length&&(i[e]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,r,i;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var n,s=Object.keys(r);for(i=0;i<s.length;++i)"removeListener"!==(n=s[i])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h,s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},6093:(e,t,r)=>{"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var n,s,o=r(1342).codes,a=o.ERR_AMBIGUOUS_ARGUMENT,d=o.ERR_INVALID_ARG_TYPE,u=o.ERR_INVALID_ARG_VALUE,l=o.ERR_INVALID_RETURN_VALUE,c=o.ERR_MISSING_ARGS,p=r(9801),h=r(9208).inspect,f=r(9208).types,y=f.isPromise,g=f.isRegExp,m=Object.assign?Object.assign:r(3046).assign,v=Object.is?Object.is:r(5968);new Map;function b(){var e=r(5656);n=e.isDeepEqual,s=e.isDeepStrictEqual}var _=!1,w=e.exports=A,T={};function E(e){if(e.message instanceof Error)throw e.message;throw new p(e)}function S(e,t,r,i){if(!r){var n=!1;if(0===t)n=!0,i="No value argument passed to `assert.ok()`";else if(i instanceof Error)throw i;var s=new p({actual:r,expected:!0,message:i,operator:"==",stackStartFn:e});throw s.generatedMessage=n,s}}function A(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];S.apply(void 0,[A,t.length].concat(t))}w.fail=function e(t,r,i,n,s){var o,a=arguments.length;if(0===a)o="Failed";else if(1===a)i=t,t=void 0;else{if(!1===_)_=!0,(process.emitWarning?process.emitWarning:console.warn.bind(console))("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094");2===a&&(n="!=")}if(i instanceof Error)throw i;var d={actual:t,expected:r,operator:void 0===n?"fail":n,stackStartFn:s||e};void 0!==i&&(d.message=i);var u=new p(d);throw o&&(u.message=o,u.generatedMessage=!0),u},w.AssertionError=p,w.ok=A,w.equal=function e(t,r,i){if(arguments.length<2)throw new c("actual","expected");t!=r&&E({actual:t,expected:r,message:i,operator:"==",stackStartFn:e})},w.notEqual=function e(t,r,i){if(arguments.length<2)throw new c("actual","expected");t==r&&E({actual:t,expected:r,message:i,operator:"!=",stackStartFn:e})},w.deepEqual=function e(t,r,i){if(arguments.length<2)throw new c("actual","expected");void 0===n&&b(),n(t,r)||E({actual:t,expected:r,message:i,operator:"deepEqual",stackStartFn:e})},w.notDeepEqual=function e(t,r,i){if(arguments.length<2)throw new c("actual","expected");void 0===n&&b(),n(t,r)&&E({actual:t,expected:r,message:i,operator:"notDeepEqual",stackStartFn:e})},w.deepStrictEqual=function e(t,r,i){if(arguments.length<2)throw new c("actual","expected");void 0===n&&b(),s(t,r)||E({actual:t,expected:r,message:i,operator:"deepStrictEqual",stackStartFn:e})},w.notDeepStrictEqual=function e(t,r,i){if(arguments.length<2)throw new c("actual","expected");void 0===n&&b();s(t,r)&&E({actual:t,expected:r,message:i,operator:"notDeepStrictEqual",stackStartFn:e})},w.strictEqual=function e(t,r,i){if(arguments.length<2)throw new c("actual","expected");v(t,r)||E({actual:t,expected:r,message:i,operator:"strictEqual",stackStartFn:e})},w.notStrictEqual=function e(t,r,i){if(arguments.length<2)throw new c("actual","expected");v(t,r)&&E({actual:t,expected:r,message:i,operator:"notStrictEqual",stackStartFn:e})};var R=function e(t,r,i){var n=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r.forEach((function(e){e in t&&(void 0!==i&&"string"==typeof i[e]&&g(t[e])&&t[e].test(i[e])?n[e]=i[e]:n[e]=t[e])}))};function M(e,t,r,o){if("function"!=typeof t){if(g(t))return t.test(e);if(2===arguments.length)throw new d("expected",["Function","RegExp"],t);if("object"!==i(e)||null===e){var a=new p({actual:e,expected:t,message:r,operator:"deepStrictEqual",stackStartFn:o});throw a.operator=o.name,a}var l=Object.keys(t);if(t instanceof Error)l.push("name","message");else if(0===l.length)throw new u("error",t,"may not be an empty object");return void 0===n&&b(),l.forEach((function(i){"string"==typeof e[i]&&g(t[i])&&t[i].test(e[i])||function(e,t,r,i,n,o){if(!(r in e)||!s(e[r],t[r])){if(!i){var a=new R(e,n),d=new R(t,n,e),u=new p({actual:a,expected:d,operator:"deepStrictEqual",stackStartFn:o});throw u.actual=e,u.expected=t,u.operator=o.name,u}E({actual:e,expected:t,message:i,operator:o.name,stackStartFn:o})}}(e,t,i,r,l,o)})),!0}return void 0!==t.prototype&&e instanceof t||!Error.isPrototypeOf(t)&&!0===t.call({},e)}function I(e){if("function"!=typeof e)throw new d("fn","Function",e);try{e()}catch(e){return e}return T}function O(e){return y(e)||null!==e&&"object"===i(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function x(e){return Promise.resolve().then((function(){var t;if("function"==typeof e){if(!O(t=e()))throw new l("instance of Promise","promiseFn",t)}else{if(!O(e))throw new d("promiseFn",["Function","Promise"],e);t=e}return Promise.resolve().then((function(){return t})).then((function(){return T})).catch((function(e){return e}))}))}function k(e,t,r,n){if("string"==typeof r){if(4===arguments.length)throw new d("error",["Object","Error","Function","RegExp"],r);if("object"===i(t)&&null!==t){if(t.message===r)throw new a("error/message",'The error message "'.concat(t.message,'" is identical to the message.'))}else if(t===r)throw new a("error/message",'The error "'.concat(t,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==i(r)&&"function"!=typeof r)throw new d("error",["Object","Error","Function","RegExp"],r);if(t===T){var s="";r&&r.name&&(s+=" (".concat(r.name,")")),s+=n?": ".concat(n):".";var o="rejects"===e.name?"rejection":"exception";E({actual:void 0,expected:r,operator:e.name,message:"Missing expected ".concat(o).concat(s),stackStartFn:e})}if(r&&!M(t,r,n,e))throw t}function C(e,t,r,i){if(t!==T){if("string"==typeof r&&(i=r,r=void 0),!r||M(t,r)){var n=i?": ".concat(i):".",s="doesNotReject"===e.name?"rejection":"exception";E({actual:t,expected:r,operator:e.name,message:"Got unwanted ".concat(s).concat(n,"\n")+'Actual message: "'.concat(t&&t.message,'"'),stackStartFn:e})}throw t}}function P(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];S.apply(void 0,[P,t.length].concat(t))}w.throws=function e(t){for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];k.apply(void 0,[e,I(t)].concat(i))},w.rejects=function e(t){for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];return x(t).then((function(t){return k.apply(void 0,[e,t].concat(i))}))},w.doesNotThrow=function e(t){for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];C.apply(void 0,[e,I(t)].concat(i))},w.doesNotReject=function e(t){for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];return x(t).then((function(t){return C.apply(void 0,[e,t].concat(i))}))},w.ifError=function e(t){if(null!=t){var r="ifError got unwanted exception: ";"object"===i(t)&&"string"==typeof t.message?0===t.message.length&&t.constructor?r+=t.constructor.name:r+=t.message:r+=h(t);var n=new p({actual:t,expected:null,operator:"ifError",message:r,stackStartFn:e}),s=t.stack;if("string"==typeof s){var o=s.split("\n");o.shift();for(var a=n.stack.split("\n"),d=0;d<o.length;d++){var u=a.indexOf(o[d]);if(-1!==u){a=a.slice(0,u);break}}n.stack="".concat(a.join("\n"),"\n").concat(o.join("\n"))}throw n}},w.strict=m(P,w,{equal:w.strictEqual,deepEqual:w.deepStrictEqual,notEqual:w.notStrictEqual,notDeepEqual:w.notDeepStrictEqual}),w.strict.strict=w.strict},9801:(e,t,r)=>{"use strict";function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function n(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function s(e,t){return!t||"object"!==c(t)&&"function"!=typeof t?o(e):t}function o(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function a(e){var t="function"==typeof Map?new Map:void 0;return a=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,i)}function i(){return d(e,arguments,l(this).constructor)}return i.prototype=Object.create(e.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),u(i,e)},a(e)}function d(e,t,r){return d=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}()?Reflect.construct:function(e,t,r){var i=[null];i.push.apply(i,t);var n=new(Function.bind.apply(e,i));return r&&u(n,r.prototype),n},d.apply(null,arguments)}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}function c(e){return c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(e)}var p=r(9208).inspect,h=r(1342).codes.ERR_INVALID_ARG_TYPE;function f(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}var y="",g="",m="",v="",b={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function _(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach((function(t){r[t]=e[t]})),Object.defineProperty(r,"message",{value:e.message}),r}function w(e){return p(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function T(e,t,r){var i="",n="",s=0,o="",a=!1,d=w(e),u=d.split("\n"),l=w(t).split("\n"),p=0,h="";if("strictEqual"===r&&"object"===c(e)&&"object"===c(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===u.length&&1===l.length&&u[0]!==l[0]){var _=u[0].length+l[0].length;if(_<=10){if(!("object"===c(e)&&null!==e||"object"===c(t)&&null!==t||0===e&&0===t))return"".concat(b[r],"\n\n")+"".concat(u[0]," !== ").concat(l[0],"\n")}else if("strictEqualObject"!==r){if(_<(process.stderr&&process.stderr.isTTY?process.stderr.columns:80)){for(;u[0][p]===l[0][p];)p++;p>2&&(h="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",p),"^"),p=0)}}}for(var T=u[u.length-1],E=l[l.length-1];T===E&&(p++<2?o="\n ".concat(T).concat(o):i=T,u.pop(),l.pop(),0!==u.length&&0!==l.length);)T=u[u.length-1],E=l[l.length-1];var S=Math.max(u.length,l.length);if(0===S){var A=d.split("\n");if(A.length>30)for(A[26]="".concat(y,"...").concat(v);A.length>27;)A.pop();return"".concat(b.notIdentical,"\n\n").concat(A.join("\n"),"\n")}p>3&&(o="\n".concat(y,"...").concat(v).concat(o),a=!0),""!==i&&(o="\n ".concat(i).concat(o),i="");var R=0,M=b[r]+"\n".concat(g,"+ actual").concat(v," ").concat(m,"- expected").concat(v),I=" ".concat(y,"...").concat(v," Lines skipped");for(p=0;p<S;p++){var O=p-s;if(u.length<p+1)O>1&&p>2&&(O>4?(n+="\n".concat(y,"...").concat(v),a=!0):O>3&&(n+="\n ".concat(l[p-2]),R++),n+="\n ".concat(l[p-1]),R++),s=p,i+="\n".concat(m,"-").concat(v," ").concat(l[p]),R++;else if(l.length<p+1)O>1&&p>2&&(O>4?(n+="\n".concat(y,"...").concat(v),a=!0):O>3&&(n+="\n ".concat(u[p-2]),R++),n+="\n ".concat(u[p-1]),R++),s=p,n+="\n".concat(g,"+").concat(v," ").concat(u[p]),R++;else{var x=l[p],k=u[p],C=k!==x&&(!f(k,",")||k.slice(0,-1)!==x);C&&f(x,",")&&x.slice(0,-1)===k&&(C=!1,k+=","),C?(O>1&&p>2&&(O>4?(n+="\n".concat(y,"...").concat(v),a=!0):O>3&&(n+="\n ".concat(u[p-2]),R++),n+="\n ".concat(u[p-1]),R++),s=p,n+="\n".concat(g,"+").concat(v," ").concat(k),i+="\n".concat(m,"-").concat(v," ").concat(x),R+=2):(n+=i,i="",1!==O&&0!==p||(n+="\n ".concat(k),R++))}if(R>20&&p<S-2)return"".concat(M).concat(I,"\n").concat(n,"\n").concat(y,"...").concat(v).concat(i,"\n")+"".concat(y,"...").concat(v)}return"".concat(M).concat(a?I:"","\n").concat(n).concat(i).concat(o).concat(h)}var E=function(e){function t(e){var r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),"object"!==c(e)||null===e)throw new h("options","Object",e);var i=e.message,n=e.operator,a=e.stackStartFn,d=e.actual,u=e.expected,p=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=i)r=s(this,l(t).call(this,String(i)));else if(process.stderr&&process.stderr.isTTY&&(process.stderr&&process.stderr.getColorDepth&&1!==process.stderr.getColorDepth()?(y="",g="",v="",m=""):(y="",g="",v="",m="")),"object"===c(d)&&null!==d&&"object"===c(u)&&null!==u&&"stack"in d&&d instanceof Error&&"stack"in u&&u instanceof Error&&(d=_(d),u=_(u)),"deepStrictEqual"===n||"strictEqual"===n)r=s(this,l(t).call(this,T(d,u,n)));else if("notDeepStrictEqual"===n||"notStrictEqual"===n){var f=b[n],E=w(d).split("\n");if("notStrictEqual"===n&&"object"===c(d)&&null!==d&&(f=b.notStrictEqualObject),E.length>30)for(E[26]="".concat(y,"...").concat(v);E.length>27;)E.pop();r=1===E.length?s(this,l(t).call(this,"".concat(f," ").concat(E[0]))):s(this,l(t).call(this,"".concat(f,"\n\n").concat(E.join("\n"),"\n")))}else{var S=w(d),A="",R=b[n];"notDeepEqual"===n||"notEqual"===n?(S="".concat(b[n],"\n\n").concat(S)).length>1024&&(S="".concat(S.slice(0,1021),"...")):(A="".concat(w(u)),S.length>512&&(S="".concat(S.slice(0,509),"...")),A.length>512&&(A="".concat(A.slice(0,509),"...")),"deepEqual"===n||"equal"===n?S="".concat(R,"\n\n").concat(S,"\n\nshould equal\n\n"):A=" ".concat(n," ").concat(A)),r=s(this,l(t).call(this,"".concat(S).concat(A)))}return Error.stackTraceLimit=p,r.generatedMessage=!i,Object.defineProperty(o(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=d,r.expected=u,r.operator=n,Error.captureStackTrace&&Error.captureStackTrace(o(r),a),r.stack,r.name="AssertionError",s(r)}var r,a,d;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(t,e),r=t,a=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:p.custom,value:function(e,t){return p(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){i(e,t,r[t])}))}return e}({},t,{customInspect:!1,depth:0}))}}],a&&n(r.prototype,a),d&&n(r,d),t}(a(Error));e.exports=E},1342:(e,t,r)=>{"use strict";function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function n(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}function o(e,t){return o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}var a,d,u={};function l(e,t,r){r||(r=Error);var i=function(r){function i(r,o,a){var d;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),d=n(this,s(i).call(this,function(e,r,i){return"string"==typeof t?t:t(e,r,i)}(r,o,a))),d.code=e,d}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(i,r),i}(r);u[e]=i}function c(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}l("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),l("ERR_INVALID_ARG_TYPE",(function(e,t,n){var s,o,d,u;if(void 0===a&&(a=r(6093)),a("string"==typeof e,"'name' must be a string"),"string"==typeof t&&(o="not ",t.substr(!d||d<0?0:+d,o.length)===o)?(s="must not be",t=t.replace(/^not /,"")):s="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))u="The ".concat(e," ").concat(s," ").concat(c(t,"type"));else{var l=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";u='The "'.concat(e,'" ').concat(l," ").concat(s," ").concat(c(t,"type"))}return u+=". Received type ".concat(i(n))}),TypeError),l("ERR_INVALID_ARG_VALUE",(function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===d&&(d=r(9208));var n=d.inspect(t);return n.length>128&&(n="".concat(n.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(i,". Received ").concat(n)}),TypeError,RangeError),l("ERR_INVALID_RETURN_VALUE",(function(e,t,r){var n;return n=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(i(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(n,".")}),TypeError),l("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];void 0===a&&(a=r(6093)),a(t.length>0,"At least one arg needs to be specified");var n="The ",s=t.length;switch(t=t.map((function(e){return'"'.concat(e,'"')})),s){case 1:n+="".concat(t[0]," argument");break;case 2:n+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:n+=t.slice(0,s-1).join(", "),n+=", and ".concat(t[s-1]," arguments")}return"".concat(n," must be specified")}),TypeError),e.exports.codes=u},5656:(e,t,r)=>{"use strict";function i(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=[],i=!0,n=!1,s=void 0;try{for(var o,a=e[Symbol.iterator]();!(i=(o=a.next()).done)&&(r.push(o.value),!t||r.length!==t);i=!0);}catch(e){n=!0,s=e}finally{try{i||null==a.return||a.return()}finally{if(n)throw s}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var s=void 0!==/a/g.flags,o=function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t},a=function(e){var t=[];return e.forEach((function(e,r){return t.push([r,e])})),t},d=Object.is?Object.is:r(5968),u=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},l=Number.isNaN?Number.isNaN:r(7838);function c(e){return e.call.bind(e)}var p=c(Object.prototype.hasOwnProperty),h=c(Object.prototype.propertyIsEnumerable),f=c(Object.prototype.toString),y=r(9208).types,g=y.isAnyArrayBuffer,m=y.isArrayBufferView,v=y.isDate,b=y.isMap,_=y.isRegExp,w=y.isSet,T=y.isNativeError,E=y.isBoxedPrimitive,S=y.isNumberObject,A=y.isStringObject,R=y.isBooleanObject,M=y.isBigIntObject,I=y.isSymbolObject,O=y.isFloat32Array,x=y.isFloat64Array;function k(e){if(0===e.length||e.length>10)return!0;for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(r<48||r>57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function C(e){return Object.keys(e).filter(k).concat(u(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function P(e,t){if(e===t)return 0;for(var r=e.length,i=t.length,n=0,s=Math.min(r,i);n<s;++n)if(e[n]!==t[n]){r=e[n],i=t[n];break}return r<i?-1:i<r?1:0}var D=0,N=1,B=2,q=3;function L(e,t,r,i){if(e===t)return 0!==e||(!r||d(e,t));if(r){if("object"!==n(e))return"number"==typeof e&&l(e)&&l(t);if("object"!==n(t)||null===e||null===t)return!1;if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(null===e||"object"!==n(e))return(null===t||"object"!==n(t))&&e==t;if(null===t||"object"!==n(t))return!1}var o,a,u,c,p=f(e);if(p!==f(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var h=C(e),y=C(t);return h.length===y.length&&F(e,t,r,i,N,h)}if("[object Object]"===p&&(!b(e)&&b(t)||!w(e)&&w(t)))return!1;if(v(e)){if(!v(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(_(e)){if(!_(t)||(u=e,c=t,!(s?u.source===c.source&&u.flags===c.flags:RegExp.prototype.toString.call(u)===RegExp.prototype.toString.call(c))))return!1}else if(T(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else{if(m(e)){if(r||!O(e)&&!x(e)){if(!function(e,t){return e.byteLength===t.byteLength&&0===P(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}(e,t))return!1}else if(!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}(e,t))return!1;var k=C(e),L=C(t);return k.length===L.length&&F(e,t,r,i,D,k)}if(w(e))return!(!w(t)||e.size!==t.size)&&F(e,t,r,i,B);if(b(e))return!(!b(t)||e.size!==t.size)&&F(e,t,r,i,q);if(g(e)){if(a=t,(o=e).byteLength!==a.byteLength||0!==P(new Uint8Array(o),new Uint8Array(a)))return!1}else if(E(e)&&!function(e,t){return S(e)?S(t)&&d(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t)):A(e)?A(t)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(t):R(e)?R(t)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(t):M(e)?M(t)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(t):I(t)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t)}(e,t))return!1}return F(e,t,r,i,D)}function j(e,t){return t.filter((function(t){return h(e,t)}))}function F(e,t,r,s,d,l){if(5===arguments.length){l=Object.keys(e);var c=Object.keys(t);if(l.length!==c.length)return!1}for(var f=0;f<l.length;f++)if(!p(t,l[f]))return!1;if(r&&5===arguments.length){var y=u(e);if(0!==y.length){var g=0;for(f=0;f<y.length;f++){var m=y[f];if(h(e,m)){if(!h(t,m))return!1;l.push(m),g++}else if(h(t,m))return!1}var v=u(t);if(y.length!==v.length&&j(t,v).length!==g)return!1}else{var b=u(t);if(0!==b.length&&0!==j(t,b).length)return!1}}if(0===l.length&&(d===D||d===N&&0===e.length||0===e.size))return!0;if(void 0===s)s={val1:new Map,val2:new Map,position:0};else{var _=s.val1.get(e);if(void 0!==_){var w=s.val2.get(t);if(void 0!==w)return _===w}s.position++}s.val1.set(e,s.position),s.val2.set(t,s.position);var T=function(e,t,r,s,d,u){var l=0;if(u===B){if(!function(e,t,r,i){for(var s=null,a=o(e),d=0;d<a.length;d++){var u=a[d];if("object"===n(u)&&null!==u)null===s&&(s=new Set),s.add(u);else if(!t.has(u)){if(r)return!1;if(!H(e,t,u))return!1;null===s&&(s=new Set),s.add(u)}}if(null!==s){for(var l=o(t),c=0;c<l.length;c++){var p=l[c];if("object"===n(p)&&null!==p){if(!U(s,p,r,i))return!1}else if(!r&&!e.has(p)&&!U(s,p,r,i))return!1}return 0===s.size}return!0}(e,t,r,d))return!1}else if(u===q){if(!function(e,t,r,s){for(var o=null,d=a(e),u=0;u<d.length;u++){var l=i(d[u],2),c=l[0],p=l[1];if("object"===n(c)&&null!==c)null===o&&(o=new Set),o.add(c);else{var h=t.get(c);if(void 0===h&&!t.has(c)||!L(p,h,r,s)){if(r)return!1;if(!G(e,t,c,p,s))return!1;null===o&&(o=new Set),o.add(c)}}}if(null!==o){for(var f=a(t),y=0;y<f.length;y++){var g=i(f[y],2),m=(c=g[0],g[1]);if("object"===n(c)&&null!==c){if(!K(o,e,c,m,r,s))return!1}else if(!(r||e.has(c)&&L(e.get(c),m,!1,s)||K(o,e,c,m,!1,s)))return!1}return 0===o.size}return!0}(e,t,r,d))return!1}else if(u===N)for(;l<e.length;l++){if(!p(e,l)){if(p(t,l))return!1;for(var c=Object.keys(e);l<c.length;l++){var h=c[l];if(!p(t,h)||!L(e[h],t[h],r,d))return!1}return c.length===Object.keys(t).length}if(!p(t,l)||!L(e[l],t[l],r,d))return!1}for(l=0;l<s.length;l++){var f=s[l];if(!L(e[f],t[f],r,d))return!1}return!0}(e,t,r,l,s,d);return s.val1.delete(e),s.val2.delete(t),T}function U(e,t,r,i){for(var n=o(e),s=0;s<n.length;s++){var a=n[s];if(L(t,a,r,i))return e.delete(a),!0}return!1}function z(e){switch(n(e)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":e=+e;case"number":if(l(e))return!1}return!0}function H(e,t,r){var i=z(r);return null!=i?i:t.has(i)&&!e.has(i)}function G(e,t,r,i,n){var s=z(r);if(null!=s)return s;var o=t.get(s);return!(void 0===o&&!t.has(s)||!L(i,o,!1,n))&&(!e.has(s)&&L(i,o,!1,n))}function K(e,t,r,i,n,s){for(var a=o(e),d=0;d<a.length;d++){var u=a[d];if(L(r,u,n,s)&&L(i,t.get(u),n,s))return e.delete(u),!0}return!1}e.exports={isDeepEqual:function(e,t){return L(e,t,false)},isDeepStrictEqual:function(e,t){return L(e,t,true)}}},4362:(e,t,r)=>{"use strict";var i=r(2722),n=r(8492),s=r(7764),o=r(5250),a=r(8219),d=r(2943),u=r(7170),l=r(3599),c=r(4368),p=r(3063),h=r(1592),f=r(6899),y=r(5503),g=r(311),m=r(1048);function v(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var b=v(i),_=v(s),w=v(d),T=v(u),E=v(h);function S(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(e);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(r[i[n]]=e[i[n]])}return r}function A(e,t,r,i){return new(r||(r=Promise))((function(n,s){function o(e){try{d(i.next(e))}catch(e){s(e)}}function a(e){try{d(i.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}d((i=i.apply(e,t||[])).next())}))}function R(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function M(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=R(e),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(r){t[r]=e[r]&&function(t){return new Promise((function(i,n){(function(e,t,r,i){Promise.resolve(i).then((function(t){e({value:t,done:r})}),t)})(i,n,(t=e[r](t)).done,t.value)}))}}}"function"==typeof SuppressedError&&SuppressedError;const I=new Map,O=()=>`callback_${Date.now()}_${Math.random().toString(36).substring(2,11)}`,x=(e,t)=>{I.set(e,t)},k=e=>{I.delete(e)},C=e=>({getLogs:()=>e({method:"getLogs"}),searchDevices:()=>e({method:"searchDevices"}),getFeatures:(t,r)=>e(Object.assign(Object.assign({},r),{connectId:t,method:"getFeatures"})),getUkeyFeatures:(t,r)=>e(Object.assign(Object.assign({},r),{connectId:t,method:"getUkeyFeatures"})),checkFirmwareRelease:t=>e({connectId:t,method:"checkFirmwareRelease"}),checkBLEFirmwareRelease:t=>e({connectId:t,method:"checkBLEFirmwareRelease"}),checkBridgeStatus:()=>e({method:"checkBridgeStatus"}),checkBridgeRelease:(t,r)=>e(Object.assign(Object.assign({},r),{connectId:t,method:"checkBridgeRelease"})),checkBootloaderRelease:(t,r)=>e(Object.assign(Object.assign({},r),{connectId:t,method:"checkBootloaderRelease"})),checkAllFirmwareRelease:(t,r)=>e(Object.assign(Object.assign({},r),{connectId:t,method:"checkAllFirmwareRelease"})),cipherKeyValue:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"cipherKeyValue"})),testInitializeDeviceDuration:(t,r)=>e(Object.assign(Object.assign({},r),{connectId:t,method:"testInitializeDeviceDuration"})),deviceBackup:t=>e({connectId:t,method:"deviceBackup"}),deviceChangePin:(t,r)=>e(Object.assign(Object.assign({},r),{connectId:t,method:"deviceChangePin"})),deviceFlags:(t,r)=>e(Object.assign(Object.assign({},r),{connectId:t,method:"deviceFlags"})),deviceRebootToBoardloader:t=>e({connectId:t,method:"deviceRebootToBoardloader"}),deviceRebootToBootloader:t=>e({connectId:t,method:"deviceRebootToBootloader"}),deviceRecovery:(t,r)=>e(Object.assign(Object.assign({},r),{connectId:t,method:"deviceRecovery"})),deviceReset:(t,r)=>e(Object.assign(Object.assign({},r),{connectId:t,method:"deviceReset"})),deviceSettings:(t,r)=>e(Object.assign(Object.assign({},r),{connectId:t,method:"deviceSettings"})),deviceUpdateReboot:t=>e({connectId:t,method:"deviceUpdateReboot"}),deviceUploadResource:(t,r)=>e(Object.assign(Object.assign({},r),{connectId:t,method:"deviceUploadResource"})),deviceSupportFeatures:t=>e({connectId:t,method:"deviceSupportFeatures"}),deviceVerify:(t,r)=>e(Object.assign(Object.assign({},r),{connectId:t,method:"deviceVerify"})),deviceWipe:t=>e({connectId:t,method:"deviceWipe"}),deviceFullyUploadResource:(t,r)=>e(Object.assign(Object.assign({},r),{connectId:t,method:"deviceFullyUploadResource"})),deviceUpdateBootloader:(t,r)=>e(Object.assign(Object.assign({},r),{connectId:t,method:"deviceUpdateBootloader"})),getPassphraseState:(t,r)=>e(Object.assign(Object.assign({},r),{connectId:t,method:"getPassphraseState"})),deviceCancel:(t,r)=>e(Object.assign(Object.assign({},r),{connectId:t,method:"deviceCancel"})),deviceLock:(t,r)=>e(Object.assign(Object.assign({},r),{connectId:t,method:"deviceLock"})),deviceUnlock:(t,r)=>e(Object.assign(Object.assign({},r),{useEmptyPassphrase:!0,connectId:t,method:"deviceUnlock"})),getNextU2FCounter:(t,r)=>e(Object.assign(Object.assign({},r),{connectId:t,method:"getNextU2FCounter"})),setU2FCounter:(t,r)=>e(Object.assign(Object.assign({},r),{connectId:t,method:"setU2FCounter"})),allNetworkGetAddress:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"allNetworkGetAddress"})),allNetworkGetAddressByLoop:(t,r,i)=>{const{onLoopItemResponse:n,onAllItemsResponse:s}=i,o=S(i,["onLoopItemResponse","onAllItemsResponse"]),a=O();x(a,n);const d=O();return x(d,((e,t)=>{null==s||s(e,t),k(d),k(a)})),e(Object.assign(Object.assign({},o),{connectId:t,deviceId:r,method:"allNetworkGetAddressByLoop",callbackId:a,callbackIdFinish:d}))},evmGetAddress:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"evmGetAddress"})),evmGetPublicKey:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"evmGetPublicKey"})),evmSignMessage:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"evmSignMessage"})),evmSignMessageEIP712:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"evmSignMessageEIP712"})),evmSignTransaction:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"evmSignTransaction"})),evmSignTypedData:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"evmSignTypedData"})),evmVerifyMessage:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"evmVerifyMessage"})),btcGetAddress:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"btcGetAddress"})),btcGetPublicKey:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"btcGetPublicKey"})),btcSignMessage:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"btcSignMessage"})),btcSignPsbt:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"btcSignPsbt"})),btcSignTransaction:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"btcSignTransaction"})),btcVerifyMessage:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"btcVerifyMessage"})),starcoinGetAddress:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"starcoinGetAddress"})),starcoinGetPublicKey:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"starcoinGetPublicKey"})),starcoinSignMessage:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"starcoinSignMessage"})),starcoinSignTransaction:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"starcoinSignTransaction"})),starcoinVerifyMessage:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"starcoinVerifyMessage"})),nemGetAddress:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"nemGetAddress"})),nemSignTransaction:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"nemSignTransaction"})),solGetAddress:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"solGetAddress"})),solSignTransaction:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"solSignTransaction"})),solSignOffchainMessage:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"solSignOffchainMessage"})),solSignMessage:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"solSignMessage"})),stellarGetAddress:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"stellarGetAddress"})),stellarSignTransaction:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"stellarSignTransaction"})),firmwareUpdate:(t,r)=>e(Object.assign(Object.assign({},r),{connectId:t,method:"firmwareUpdate"})),firmwareUpdateV2:(t,r)=>e(Object.assign(Object.assign({},r),{connectId:t,method:"firmwareUpdateV2"})),firmwareUpdateV3:(t,r)=>e(Object.assign(Object.assign({},r),{connectId:t,method:"firmwareUpdateV3"})),emmcFileWrite:(t,r)=>e(Object.assign(Object.assign({},r),{connectId:t,method:"emmcFileWrite"})),promptWebDeviceAccess:t=>e(Object.assign(Object.assign({},t),{method:"promptWebDeviceAccess"})),tronGetAddress:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"tronGetAddress"})),tronSignMessage:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"tronSignMessage"})),tronSignTransaction:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"tronSignTransaction"})),confluxGetAddress:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"confluxGetAddress"})),confluxSignMessage:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"confluxSignMessage"})),confluxSignMessageCIP23:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"confluxSignMessageCIP23"})),confluxSignTransaction:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"confluxSignTransaction"})),nearGetAddress:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"nearGetAddress"})),nearSignTransaction:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"nearSignTransaction"})),aptosGetAddress:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"aptosGetAddress"})),aptosGetPublicKey:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"aptosGetPublicKey"})),aptosSignMessage:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"aptosSignMessage"})),aptosSignInMessage:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"aptosSignInMessage"})),aptosSignTransaction:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"aptosSignTransaction"})),algoGetAddress:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"algoGetAddress"})),algoSignTransaction:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"algoSignTransaction"})),cosmosGetAddress:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"cosmosGetAddress"})),cosmosGetPublicKey:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"cosmosGetPublicKey"})),cosmosSignTransaction:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"cosmosSignTransaction"})),xrpGetAddress:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"xrpGetAddress"})),xrpSignTransaction:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"xrpSignTransaction"})),suiGetAddress:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"suiGetAddress"})),suiGetPublicKey:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"suiGetPublicKey"})),suiSignMessage:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"suiSignMessage"})),suiSignTransaction:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"suiSignTransaction"})),cardanoGetAddress:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"cardanoGetAddress"})),cardanoGetPublicKey:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"cardanoGetPublicKey"})),cardanoSignTransaction:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"cardanoSignTransaction"})),cardanoSignMessage:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"cardanoSignMessage"})),filecoinGetAddress:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"filecoinGetAddress"})),filecoinSignTransaction:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"filecoinSignTransaction"})),polkadotGetAddress:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"polkadotGetAddress"})),polkadotSignTransaction:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"polkadotSignTransaction"})),kaspaGetAddress:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"kaspaGetAddress"})),kaspaSignTransaction:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"kaspaSignTransaction"})),nexaGetAddress:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"nexaGetAddress"})),nexaSignTransaction:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"nexaSignTransaction"})),nostrGetPublicKey:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"nostrGetPublicKey"})),nostrSignEvent:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"nostrSignEvent"})),nostrEncryptMessage:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"nostrEncryptMessage"})),nostrDecryptMessage:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"nostrDecryptMessage"})),nostrSignSchnorr:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"nostrSignSchnorr"})),lnurlAuth:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"lnurlAuth"})),nervosGetAddress:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"nervosGetAddress"})),nervosSignTransaction:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"nervosSignTransaction"})),dnxGetAddress:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"dnxGetAddress"})),dnxSignTransaction:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"dnxSignTransaction"})),tonGetAddress:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"tonGetAddress"})),tonSignMessage:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"tonSignMessage"})),tonSignProof:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"tonSignProof"})),scdoGetAddress:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"scdoGetAddress"})),scdoSignMessage:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"scdoSignMessage"})),scdoSignTransaction:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"scdoSignTransaction"})),alephiumGetAddress:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"alephiumGetAddress"})),alephiumSignMessage:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"alephiumSignMessage"})),alephiumSignTransaction:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"alephiumSignTransaction"})),benfenGetAddress:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"benfenGetAddress"})),benfenGetPublicKey:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"benfenGetPublicKey"})),benfenSignTransaction:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"benfenSignTransaction"})),benfenSignMessage:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"benfenSignMessage"})),neoGetAddress:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"neoGetAddress"})),neoSignTransaction:(t,r,i)=>e(Object.assign(Object.assign({},i),{connectId:t,deviceId:r,method:"neoSignTransaction"}))});var P,D={exports:{}},N="object"==typeof Reflect?Reflect:null,B=N&&"function"==typeof N.apply?N.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};P=N&&"function"==typeof N.ownKeys?N.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var q=Number.isNaN||function(e){return e!=e};function L(){L.init.call(this)}D.exports=L,D.exports.once=function(e,t){return new Promise((function(r,i){function n(r){e.removeListener(t,s),i(r)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",n),r([].slice.call(arguments))}$(e,t,s,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&$(e,"error",t,r)}(e,n,{once:!0})}))},L.EventEmitter=L,L.prototype._events=void 0,L.prototype._eventsCount=0,L.prototype._maxListeners=void 0;var j=10;function F(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function U(e){return void 0===e._maxListeners?L.defaultMaxListeners:e._maxListeners}function z(e,t,r,i){var n,s,o,a;if(F(r),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),s=e._events),o=s[t]),void 0===o)o=s[t]=r,++e._eventsCount;else if("function"==typeof o?o=s[t]=i?[r,o]:[o,r]:i?o.unshift(r):o.push(r),(n=U(e))>0&&o.length>n&&!o.warned){o.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=e,d.type=t,d.count=o.length,a=d,console&&console.warn&&console.warn(a)}return e}function H(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function G(e,t,r){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},n=H.bind(i);return n.listener=r,i.wrapFn=n,n}function K(e,t,r){var i=e._events;if(void 0===i)return[];var n=i[t];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(n):V(n,n.length)}function W(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function V(e,t){for(var r=new Array(t),i=0;i<t;++i)r[i]=e[i];return r}function $(e,t,r,i){if("function"==typeof e.on)i.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function n(s){i.once&&e.removeEventListener(t,n),r(s)}))}}Object.defineProperty(L,"defaultMaxListeners",{enumerable:!0,get:function(){return j},set:function(e){if("number"!=typeof e||e<0||q(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");j=e}}),L.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},L.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||q(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},L.prototype.getMaxListeners=function(){return U(this)},L.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,n=this._events;if(void 0!==n)i=i&&void 0===n.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var o=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw o.context=s,o}var a=n[e];if(void 0===a)return!1;if("function"==typeof a)B(a,this,t);else{var d=a.length,u=V(a,d);for(r=0;r<d;++r)B(u[r],this,t)}return!0},L.prototype.addListener=function(e,t){return z(this,e,t,!1)},L.prototype.on=L.prototype.addListener,L.prototype.prependListener=function(e,t){return z(this,e,t,!0)},L.prototype.once=function(e,t){return F(t),this.on(e,G(this,e,t)),this},L.prototype.prependOnceListener=function(e,t){return F(t),this.prependListener(e,G(this,e,t)),this},L.prototype.removeListener=function(e,t){var r,i,n,s,o;if(F(t),void 0===(i=this._events))return this;if(void 0===(r=i[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(n=-1,s=r.length-1;s>=0;s--)if(r[s]===t||r[s].listener===t){o=r[s].listener,n=s;break}if(n<0)return this;0===n?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,n),1===r.length&&(i[e]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",e,o||t)}return this},L.prototype.off=L.prototype.removeListener,L.prototype.removeAllListeners=function(e){var t,r,i;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var n,s=Object.keys(r);for(i=0;i<s.length;++i)"removeListener"!==(n=s[i])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this},L.prototype.listeners=function(e){return K(this,e,!0)},L.prototype.rawListeners=function(e){return K(this,e,!1)},L.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):W.call(e,t)},L.prototype.listenerCount=W,L.prototype.eventNames=function(){return this._eventsCount>0?P(this._events):[]};const Z=new D.exports,Y="LOG_EVENT",J={OUTPUT:"log-output"},X=(e,t)=>({event:Y,type:e,payload:t});let Q;class ee{constructor(e,t){this.prefix=e,this.enabled=t,this.messages=[]}addMessage(e,t,...r){this.messages.push({level:e,prefix:t,message:r,timestamp:(new Date).getTime()}),this.messages.length>500&&this.messages.shift()}log(...e){this.addMessage("log",this.prefix,...e),ae(this.prefix,...e),this.enabled&&console.log(this.prefix,...e)}error(...e){this.addMessage("error",this.prefix,...e),ae(this.prefix,...e),this.enabled&&console.error(this.prefix,...e)}warn(...e){this.addMessage("warn",this.prefix,...e),ae(this.prefix,...e),this.enabled&&console.warn(this.prefix,...e)}debug(...e){this.addMessage("debug",this.prefix,...e),ae(this.prefix,...e),this.enabled&&console.log(this.prefix,...e)}}const te={},re=(e,t)=>{const r=new ee(e,!!t);return te[e]=r,r},ie=e=>{Object.keys(te).forEach((t=>{te[t].enabled=!!e}))},ne=()=>{let e=[];return Object.keys(te).forEach((t=>{e=e.concat(te[t].messages)})),e.sort(((e,t)=>e.timestamp-t.timestamp)),e},se=e=>{Q=e},oe=()=>{const e=new WeakSet;return(t,r)=>{if("object"==typeof r&&null!==r){if(e.has(r))return;e.add(r)}return r}},ae=(e,...t)=>{null==Q||Q(X(J.OUTPUT,((...e)=>e.map((e=>"string"==typeof e||"number"==typeof e||"boolean"==typeof e||void 0===e?e:"object"==typeof e?JSON.stringify(e,oe()):e)))(e,...t)))};var de;t.d3=void 0,(de=t.d3||(t.d3={})).Core="@ukey/hd-core",de.Transport="Transport",de.Device="Device",de.DeviceCommands="DeviceCommands",de.DeviceConnector="DeviceConnector",de.DeviceList="DeviceList",de.DevicePool="DevicePool",de.HdCommonConnectSdk="@ukey/common-connect-sdk",de.HdBleSdk="@ukey/hd-ble-sdk",de.HdTransportHttp="@ukey/hd-transport-http",de.HdTransportLowLevel="@ukey/hd-transport-lowlevel",de.HdBleTransport="@ukey/hd-ble-transport",de.HdWebBleTransport="@ukey/hd-web-ble-transport",de.Connect="@ukey/connect",de.Iframe="IFrame",de.SendMessage="[SendMessage]",de.Method="[Method]";const ue={[t.d3.Core]:re(t.d3.Core),[t.d3.Transport]:re(t.d3.Transport),[t.d3.Device]:re(t.d3.Device),[t.d3.DeviceCommands]:re(t.d3.DeviceCommands),[t.d3.DeviceConnector]:re(t.d3.DeviceConnector),[t.d3.DeviceList]:re(t.d3.DeviceList),[t.d3.DevicePool]:re(t.d3.DevicePool),[t.d3.HdBleSdk]:re(t.d3.HdBleSdk),[t.d3.HdTransportHttp]:re(t.d3.HdTransportHttp),[t.d3.HdBleTransport]:re(t.d3.HdBleTransport),[t.d3.HdWebBleTransport]:re(t.d3.HdWebBleTransport),[t.d3.HdTransportLowLevel]:re(t.d3.HdTransportLowLevel),[t.d3.Connect]:re(t.d3.Connect),[t.d3.Iframe]:re(t.d3.Iframe),[t.d3.SendMessage]:re(t.d3.SendMessage),[t.d3.Method]:re(t.d3.Method),[t.d3.HdCommonConnectSdk]:re(t.d3.Method)},le=e=>ue[e],ce=(e,t)=>((e,t="text")=>A(void 0,void 0,void 0,(function*(){const r={};e.indexOf("ngrok-free.app")>-1&&(r["ngrok-skip-browser-warning"]=!0);const i=yield _.default.request({url:e,withCredentials:!1,responseType:"binary"===t?"arraybuffer":"json",headers:r});if(200==+i.status)return i.data;throw new Error(`httpRequest error: ${e} ${i.statusText}`)})))(e,t),pe=()=>(new Date).getTime(),he=new RegExp(/^[0-9]{1,3}(\.[0-9]{1,3}){0,2}$/),fe=e=>he.test(e),ye=e=>{if(!Array.isArray(e))return!1;if(0===e.length||e.length>3)return!1;if(0===e[0])return!1;for(let t=0;t<e.length;t++)if("number"!=typeof e[t]||e[t]<0)return!1;return!0},ge=e=>{if(3===e.length)return e;const t=[...e];for(let r=e.length;r<3;r++)t.push(0);return t},me=e=>fe(e)?e.split(".").map((e=>Number(e))):[0,0,0];function ve(e){return"Features"!==e.type||e.message.major_version<1&&(e.message.major_version=1),e}var be;t.fc=void 0,(be=t.fc||(t.fc={})).bootloader="bootloader",be.normal="normal",be.notInitialized="notInitialized",be.backupMode="backupMode";const _e={model_mini:[n.EDeviceType.Classic,n.EDeviceType.Classic1s,n.EDeviceType.ClassicPure,n.EDeviceType.Mini],model_touch:[n.EDeviceType.Touch,n.EDeviceType.Pro],model_classic:[n.EDeviceType.Classic,n.EDeviceType.Classic1s,n.EDeviceType.ClassicPure],model_classic1s:[n.EDeviceType.Classic1s,n.EDeviceType.ClassicPure]},we={[n.EDeviceType.Classic]:["model_classic","model_mini"],[n.EDeviceType.Classic1s]:["model_classic","model_mini","model_classic1s"],[n.EDeviceType.ClassicPure]:["model_classic","model_mini","model_classic1s"],[n.EDeviceType.Mini]:["model_mini"],[n.EDeviceType.Touch]:["model_touch"],[n.EDeviceType.Pro]:["model_touch"],[n.EDeviceType.Unknown]:[]},Te=(e,t)=>{var r;return null===(r=null==e?void 0:e.capabilities)||void 0===r?void 0:r.includes(t)},Ee=e=>{if(!e||"object"!=typeof e)return n.EDeviceType.Unknown;switch(e.ukey_device_type){case"CLASSIC":return n.EDeviceType.Classic;case"CLASSIC1S":return n.EDeviceType.Classic1s;case"MINI":return n.EDeviceType.Mini;case"TOUCH":return n.EDeviceType.Touch;case"PRO":return n.EDeviceType.Pro;case"PURE":return n.EDeviceType.ClassicPure;default:if(!o.isEmpty(e.ukey_serial_no))return n.EDeviceType.Unknown}const t=Re(e);if(o.isEmpty(t)&&!0===e.bootloader_mode&&"1"===e.model)return n.EDeviceType.Classic;if(o.isEmpty(t))return n.EDeviceType.Unknown;const r=t.slice(0,2);return"bi"===r.toLowerCase()||"cl"===r.toLowerCase()?n.EDeviceType.Classic:"cp"===r.toLowerCase()?n.EDeviceType.ClassicPure:"mi"===r.toLowerCase()?n.EDeviceType.Mini:"tc"===r.toLowerCase()?n.EDeviceType.Touch:"pr"===r.toLowerCase()?n.EDeviceType.Pro:n.EDeviceType.Unknown},Se=e=>e?e.startsWith("BixinKey")||e.startsWith("K")?n.EDeviceType.Classic:e.startsWith("T")||e.startsWith("Touch")?n.EDeviceType.Touch:e.startsWith("Pro")?n.EDeviceType.Pro:n.EDeviceType.Unknown:n.EDeviceType.Unknown,Ae=e=>null==e?null:e.ukey_ble_name||e.ble_name||null,Re=e=>{const t=e.ukey_serial_no||e.ukey_serial||e.serial_no;return null!=t?t:""},Me=e=>{if(!e)return null;const t=Ee(e);if(null==t)return null;if("string"==typeof e.label&&!o.isEmpty(e.label))return e.label;const r=Ae(e);return o.isEmpty(r)?t===n.EDeviceType.ClassicPure?"UKey Classic 1S":`UKey ${t.charAt(0).toUpperCase()+t.slice(1)}`:r},Ie=(e,t)=>{const r=Ee(e);let i=t(r);if(i)return i;const n=["model_classic1s","model_classic","model_mini","model_touch"];for(const e of n)if(_e[e].includes(r)&&(i=t(e),i))return i;return i},Oe=e=>{var t,r;return e?b.default.valid(e.ukey_firmware_version)?null===(t=e.ukey_firmware_version)||void 0===t?void 0:t.split("."):b.default.valid(e.ukey_version)?null===(r=e.ukey_version)||void 0===r?void 0:r.split("."):[0,0,0]:[0,0,0]},xe=e=>{const t=(null==e?void 0:e.ukey_ble_version)||(null==e?void 0:e.ble_ver);return t&&b.default.valid(t)&&t?t.split(".").map(Number):[0,0,0]},ke=e=>{var t,r,i,n,s;return e?b.default.valid(e.ukey_boot_version)?null===(t=e.ukey_boot_version)||void 0===t?void 0:t.split("."):e.bootloader_version?b.default.valid(e.bootloader_version)?null===(s=e.bootloader_version)||void 0===s?void 0:s.split("."):[0,0,0]:e.bootloader_mode?[null!==(r=null==e?void 0:e.major_version)&&void 0!==r?r:0,null!==(i=null==e?void 0:e.minor_version)&&void 0!==i?i:0,null!==(n=null==e?void 0:e.patch_version)&&void 0!==n?n:0]:[0,0,0]:[0,0,0]},Ce=2147483648,Pe=e=>(e|Ce)>>>0,De=e=>(2147483647&e)>>>0,Ne=n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodInvalidParameter,"Not a valid path"),Be=n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodInvalidParameter,"Path cannot contain negative values"),qe=e=>{const t=e.toLowerCase().split("/");if("m"!==t[0])throw Ne;return t.filter((e=>"m"!==e&&""!==e)).map((e=>{let t=!1;"'"===e.substr(e.length-1)&&(t=!0,e=e.substr(0,e.length-1));let r=parseInt(e);if(Number.isNaN(r))throw Ne;if(r<0)throw Be;return t&&(r=Pe(r)),r}))},Le=e=>Array.isArray(e)&&e[0]===Pe(44),je=e=>Array.isArray(e)&&(e[0]===Pe(86)||e[0]===Pe(10025)),Fe=e=>{if(!Array.isArray(e)||e.length<1)return"SPENDADDRESS";switch(De(e[0])){case 48:return"SPENDMULTISIG";case 49:return"SPENDP2SHWITNESS";case 84:return"SPENDWITNESS";case 86:case 10025:return"SPENDTAPROOT";default:return"SPENDADDRESS"}},Ue=e=>{if(!Array.isArray(e)||e.length<1)return"PAYTOADDRESS";if(49===e[0])return"PAYTOP2SHWITNESS";switch(De(e[0])){case 48:return"PAYTOMULTISIG";case 49:return"PAYTOP2SHWITNESS";case 84:return"PAYTOWITNESS";case 86:case 10025:return"PAYTOTAPROOT";default:return"PAYTOADDRESS"}},ze=e=>`m/${e.map((e=>e&Ce?(2147483647&e)+"'":e)).join("/")}`,He=(e,t=0,r=!1)=>{let i;if(i="string"==typeof e?qe(e):Array.isArray(e)?e.map((e=>{const t=parseInt(e);if(Number.isNaN(t))throw Ne;if(t<0)throw Be;return t})):void 0,!i)throw Ne;if(t>0&&i.length<t)throw Ne;return r?i.splice(0,3):i};var Ge={nested:{AlephiumGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2},include_public_key:{type:"bool",id:3},target_group:{type:"uint32",id:4}}},AlephiumAddress:{fields:{address:{rule:"required",type:"string",id:1},public_key:{type:"bytes",id:2},derived_path:{rule:"repeated",type:"uint32",id:3,options:{packed:!1}}}},AlephiumSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},data_initial_chunk:{rule:"required",type:"bytes",id:2},data_length:{type:"uint32",id:3}}},AlephiumSignedTx:{fields:{signature:{rule:"required",type:"bytes",id:1},address:{rule:"required",type:"string",id:2}}},AlephiumTxRequest:{fields:{data_length:{type:"uint32",id:1},public_key:{type:"bytes",id:2},signature:{type:"bytes",id:3}}},AlephiumTxAck:{fields:{data_chunk:{rule:"required",type:"bytes",id:1}}},AlephiumBytecodeRequest:{fields:{data_length:{type:"uint32",id:1},public_key:{type:"bytes",id:2},signature:{type:"bytes",id:3}}},AlephiumBytecodeAck:{fields:{bytecode_data:{rule:"required",type:"bytes",id:1}}},AlephiumSignMessage:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},message:{type:"bytes",id:2},message_type:{type:"bytes",id:3}}},AlephiumMessageSignature:{fields:{signature:{type:"bytes",id:1},address:{type:"string",id:2}}},AlgorandGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:3}}},AlgorandAddress:{fields:{address:{type:"string",id:1}}},AlgorandSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},raw_tx:{rule:"required",type:"bytes",id:2}}},AlgorandSignedTx:{fields:{signature:{rule:"required",type:"bytes",id:1}}},AptosGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},AptosAddress:{fields:{address:{type:"string",id:1}}},AptosSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},raw_tx:{rule:"required",type:"bytes",id:2},tx_type:{type:"AptosTransactionType",id:3,options:{default:"STANDARD"}}},nested:{AptosTransactionType:{values:{STANDARD:0,WITH_DATA:1}}}},AptosSignedTx:{fields:{public_key:{rule:"required",type:"bytes",id:1},signature:{rule:"required",type:"bytes",id:2}}},AptosSignMessage:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},payload:{rule:"required",type:"AptosMessagePayload",id:2}},nested:{AptosMessagePayload:{fields:{address:{type:"string",id:2},chain_id:{type:"string",id:3},application:{type:"string",id:4},nonce:{rule:"required",type:"string",id:5},message:{rule:"required",type:"string",id:6}}}}},AptosMessageSignature:{fields:{signature:{rule:"required",type:"bytes",id:1},address:{rule:"required",type:"string",id:2}}},AptosSignSIWAMessage:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},siwa_payload:{rule:"required",type:"string",id:2}}},BenfenGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},BenfenAddress:{fields:{address:{type:"string",id:1}}},BenfenSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},raw_tx:{rule:"required",type:"bytes",id:2},data_initial_chunk:{type:"bytes",id:3,options:{default:""}},coin_type:{type:"bytes",id:4},data_length:{type:"uint32",id:5}}},BenfenSignedTx:{fields:{public_key:{rule:"required",type:"bytes",id:1},signature:{rule:"required",type:"bytes",id:2}}},BenfenTxRequest:{fields:{data_length:{type:"uint32",id:1},public_key:{type:"bytes",id:2},signature:{type:"bytes",id:3}}},BenfenTxAck:{fields:{data_chunk:{rule:"required",type:"bytes",id:1}}},BenfenSignMessage:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},message:{rule:"required",type:"bytes",id:2}}},BenfenMessageSignature:{fields:{signature:{rule:"required",type:"bytes",id:1},address:{rule:"required",type:"string",id:2}}},BinanceGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},BinanceAddress:{fields:{address:{rule:"required",type:"string",id:1}}},BinanceGetPublicKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},BinancePublicKey:{fields:{public_key:{rule:"required",type:"bytes",id:1}}},BinanceSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},msg_count:{type:"uint32",id:2},account_number:{type:"sint64",id:3},chain_id:{type:"string",id:4},memo:{type:"string",id:5},sequence:{type:"sint64",id:6},source:{type:"sint64",id:7}}},BinanceTxRequest:{fields:{}},BinanceTransferMsg:{fields:{inputs:{rule:"repeated",type:"BinanceInputOutput",id:1},outputs:{rule:"repeated",type:"BinanceInputOutput",id:2}},nested:{BinanceInputOutput:{fields:{address:{type:"string",id:1},coins:{rule:"repeated",type:"BinanceCoin",id:2}}},BinanceCoin:{fields:{amount:{type:"sint64",id:1},denom:{type:"string",id:2}}}}},BinanceOrderMsg:{fields:{id:{type:"string",id:1},ordertype:{type:"BinanceOrderType",id:2},price:{type:"sint64",id:3},quantity:{type:"sint64",id:4},sender:{type:"string",id:5},side:{type:"BinanceOrderSide",id:6},symbol:{type:"string",id:7},timeinforce:{type:"BinanceTimeInForce",id:8}},nested:{BinanceOrderType:{values:{OT_UNKNOWN:0,MARKET:1,LIMIT:2,OT_RESERVED:3}},BinanceOrderSide:{values:{SIDE_UNKNOWN:0,BUY:1,SELL:2}},BinanceTimeInForce:{values:{TIF_UNKNOWN:0,GTE:1,TIF_RESERVED:2,IOC:3}}}},BinanceCancelMsg:{fields:{refid:{type:"string",id:1},sender:{type:"string",id:2},symbol:{type:"string",id:3}}},BinanceSignedTx:{fields:{signature:{rule:"required",type:"bytes",id:1},public_key:{rule:"required",type:"bytes",id:2}}},InputScriptType:{values:{SPENDADDRESS:0,SPENDMULTISIG:1,EXTERNAL:2,SPENDWITNESS:3,SPENDP2SHWITNESS:4,SPENDTAPROOT:5}},OutputScriptType:{values:{PAYTOADDRESS:0,PAYTOSCRIPTHASH:1,PAYTOMULTISIG:2,PAYTOOPRETURN:3,PAYTOWITNESS:4,PAYTOP2SHWITNESS:5,PAYTOTAPROOT:6}},DecredStakingSpendType:{values:{SSGen:0,SSRTX:1}},AmountUnit:{values:{BITCOIN:0,MILLIBITCOIN:1,MICROBITCOIN:2,SATOSHI:3}},MultisigRedeemScriptType:{fields:{pubkeys:{rule:"repeated",type:"HDNodePathType",id:1},signatures:{rule:"repeated",type:"bytes",id:2},m:{rule:"required",type:"uint32",id:3},nodes:{rule:"repeated",type:"HDNodeType",id:4},address_n:{rule:"repeated",type:"uint32",id:5,options:{packed:!1}}},nested:{HDNodePathType:{fields:{node:{rule:"required",type:"HDNodeType",id:1},address_n:{rule:"repeated",type:"uint32",id:2,options:{packed:!1}}}}}},GetPublicKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},ecdsa_curve_name:{type:"string",id:2},show_display:{type:"bool",id:3},coin_name:{type:"string",id:4,options:{default:"Bitcoin"}},script_type:{type:"InputScriptType",id:5,options:{default:"SPENDADDRESS"}},ignore_xpub_magic:{type:"bool",id:6}}},PublicKey:{fields:{node:{rule:"required",type:"HDNodeType",id:1},xpub:{rule:"required",type:"string",id:2},root_fingerprint:{type:"uint32",id:3}}},GetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},coin_name:{type:"string",id:2,options:{default:"Bitcoin"}},show_display:{type:"bool",id:3},multisig:{type:"MultisigRedeemScriptType",id:4},script_type:{type:"InputScriptType",id:5,options:{default:"SPENDADDRESS"}},ignore_xpub_magic:{type:"bool",id:6}}},Address:{fields:{address:{rule:"required",type:"string",id:1}}},GetOwnershipId:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},coin_name:{type:"string",id:2,options:{default:"Bitcoin"}},multisig:{type:"MultisigRedeemScriptType",id:3},script_type:{type:"InputScriptType",id:4,options:{default:"SPENDADDRESS"}}}},OwnershipId:{fields:{ownership_id:{rule:"required",type:"bytes",id:1}}},SignMessage:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},message:{rule:"required",type:"bytes",id:2},coin_name:{type:"string",id:3,options:{default:"Bitcoin"}},script_type:{type:"InputScriptType",id:4,options:{default:"SPENDADDRESS"}},no_script_type:{type:"bool",id:5},is_bip322_simple:{type:"bool",id:10,options:{default:!1}}}},MessageSignature:{fields:{address:{rule:"required",type:"string",id:1},signature:{rule:"required",type:"bytes",id:2}}},VerifyMessage:{fields:{address:{rule:"required",type:"string",id:1},signature:{rule:"required",type:"bytes",id:2},message:{rule:"required",type:"bytes",id:3},coin_name:{type:"string",id:4,options:{default:"Bitcoin"}}}},SignTx:{fields:{outputs_count:{rule:"required",type:"uint32",id:1},inputs_count:{rule:"required",type:"uint32",id:2},coin_name:{type:"string",id:3,options:{default:"Bitcoin"}},version:{type:"uint32",id:4,options:{default:1}},lock_time:{type:"uint32",id:5,options:{default:0}},expiry:{type:"uint32",id:6},overwintered:{type:"bool",id:7,options:{deprecated:!0}},version_group_id:{type:"uint32",id:8},timestamp:{type:"uint32",id:9},branch_id:{type:"uint32",id:10},amount_unit:{type:"AmountUnit",id:11,options:{default:"BITCOIN"}},decred_staking_ticket:{type:"bool",id:12,options:{default:!1}}}},TxRequest:{fields:{request_type:{type:"RequestType",id:1},details:{type:"TxRequestDetailsType",id:2},serialized:{type:"TxRequestSerializedType",id:3}},nested:{RequestType:{values:{TXINPUT:0,TXOUTPUT:1,TXMETA:2,TXFINISHED:3,TXEXTRADATA:4,TXORIGINPUT:5,TXORIGOUTPUT:6}},TxRequestDetailsType:{fields:{request_index:{type:"uint32",id:1},tx_hash:{type:"bytes",id:2},extra_data_len:{type:"uint32",id:3},extra_data_offset:{type:"uint32",id:4}}},TxRequestSerializedType:{fields:{signature_index:{type:"uint32",id:1},signature:{type:"bytes",id:2},serialized_tx:{type:"bytes",id:3}}}}},TxAck:{options:{deprecated:!0},fields:{tx:{type:"TransactionType",id:1}},nested:{TransactionType:{fields:{version:{type:"uint32",id:1},inputs:{rule:"repeated",type:"TxInputType",id:2},bin_outputs:{rule:"repeated",type:"TxOutputBinType",id:3},lock_time:{type:"uint32",id:4},outputs:{rule:"repeated",type:"TxOutputType",id:5},inputs_cnt:{type:"uint32",id:6},outputs_cnt:{type:"uint32",id:7},extra_data:{type:"bytes",id:8},extra_data_len:{type:"uint32",id:9},expiry:{type:"uint32",id:10},overwintered:{type:"bool",id:11,options:{deprecated:!0}},version_group_id:{type:"uint32",id:12},timestamp:{type:"uint32",id:13},branch_id:{type:"uint32",id:14}},nested:{TxInputType:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},prev_hash:{rule:"required",type:"bytes",id:2},prev_index:{rule:"required",type:"uint32",id:3},script_sig:{type:"bytes",id:4},sequence:{type:"uint32",id:5,options:{default:4294967295}},script_type:{type:"InputScriptType",id:6,options:{default:"SPENDADDRESS"}},multisig:{type:"MultisigRedeemScriptType",id:7},amount:{type:"uint64",id:8},decred_tree:{type:"uint32",id:9},witness:{type:"bytes",id:13},ownership_proof:{type:"bytes",id:14},commitment_data:{type:"bytes",id:15},orig_hash:{type:"bytes",id:16},orig_index:{type:"uint32",id:17},decred_staking_spend:{type:"DecredStakingSpendType",id:18},script_pubkey:{type:"bytes",id:19}}},TxOutputBinType:{fields:{amount:{rule:"required",type:"uint64",id:1},script_pubkey:{rule:"required",type:"bytes",id:2},decred_script_version:{type:"uint32",id:3}}},TxOutputType:{fields:{address:{type:"string",id:1},address_n:{rule:"repeated",type:"uint32",id:2,options:{packed:!1}},amount:{rule:"required",type:"uint64",id:3},script_type:{type:"OutputScriptType",id:4,options:{default:"PAYTOADDRESS"}},multisig:{type:"MultisigRedeemScriptType",id:5},op_return_data:{type:"bytes",id:6},orig_hash:{type:"bytes",id:10},orig_index:{type:"uint32",id:11}}}}}}},TxInput:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},prev_hash:{rule:"required",type:"bytes",id:2},prev_index:{rule:"required",type:"uint32",id:3},script_sig:{type:"bytes",id:4},sequence:{type:"uint32",id:5,options:{default:4294967295}},script_type:{type:"InputScriptType",id:6,options:{default:"SPENDADDRESS"}},multisig:{type:"MultisigRedeemScriptType",id:7},amount:{rule:"required",type:"uint64",id:8},decred_tree:{type:"uint32",id:9},witness:{type:"bytes",id:13},ownership_proof:{type:"bytes",id:14},commitment_data:{type:"bytes",id:15},orig_hash:{type:"bytes",id:16},orig_index:{type:"uint32",id:17},decred_staking_spend:{type:"DecredStakingSpendType",id:18},script_pubkey:{type:"bytes",id:19}}},TxOutput:{fields:{address:{type:"string",id:1},address_n:{rule:"repeated",type:"uint32",id:2,options:{packed:!1}},amount:{rule:"required",type:"uint64",id:3},script_type:{type:"OutputScriptType",id:4,options:{default:"PAYTOADDRESS"}},multisig:{type:"MultisigRedeemScriptType",id:5},op_return_data:{type:"bytes",id:6},orig_hash:{type:"bytes",id:10},orig_index:{type:"uint32",id:11}}},PrevTx:{fields:{version:{rule:"required",type:"uint32",id:1},lock_time:{rule:"required",type:"uint32",id:4},inputs_count:{rule:"required",type:"uint32",id:6},outputs_count:{rule:"required",type:"uint32",id:7},extra_data_len:{type:"uint32",id:9,options:{default:0}},expiry:{type:"uint32",id:10},version_group_id:{type:"uint32",id:12},timestamp:{type:"uint32",id:13},branch_id:{type:"uint32",id:14}}},PrevInput:{fields:{prev_hash:{rule:"required",type:"bytes",id:2},prev_index:{rule:"required",type:"uint32",id:3},script_sig:{rule:"required",type:"bytes",id:4},sequence:{rule:"required",type:"uint32",id:5},decred_tree:{type:"uint32",id:9}}},PrevOutput:{fields:{amount:{rule:"required",type:"uint64",id:1},script_pubkey:{rule:"required",type:"bytes",id:2},decred_script_version:{type:"uint32",id:3}}},TxAckInput:{options:{"(wire_type)":22},fields:{tx:{rule:"required",type:"TxAckInputWrapper",id:1}},nested:{TxAckInputWrapper:{fields:{input:{rule:"required",type:"TxInput",id:2}}}}},TxAckOutput:{options:{"(wire_type)":22},fields:{tx:{rule:"required",type:"TxAckOutputWrapper",id:1}},nested:{TxAckOutputWrapper:{fields:{output:{rule:"required",type:"TxOutput",id:5}}}}},TxAckPrevMeta:{options:{"(wire_type)":22},fields:{tx:{rule:"required",type:"PrevTx",id:1}}},TxAckPrevInput:{options:{"(wire_type)":22},fields:{tx:{rule:"required",type:"TxAckPrevInputWrapper",id:1}},nested:{TxAckPrevInputWrapper:{fields:{input:{rule:"required",type:"PrevInput",id:2}}}}},TxAckPrevOutput:{options:{"(wire_type)":22},fields:{tx:{rule:"required",type:"TxAckPrevOutputWrapper",id:1}},nested:{TxAckPrevOutputWrapper:{fields:{output:{rule:"required",type:"PrevOutput",id:3}}}}},TxAckPrevExtraData:{options:{"(wire_type)":22},fields:{tx:{rule:"required",type:"TxAckPrevExtraDataWrapper",id:1}},nested:{TxAckPrevExtraDataWrapper:{fields:{extra_data_chunk:{rule:"required",type:"bytes",id:8}}}}},GetOwnershipProof:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},coin_name:{type:"string",id:2,options:{default:"Bitcoin"}},script_type:{type:"InputScriptType",id:3,options:{default:"SPENDWITNESS"}},multisig:{type:"MultisigRedeemScriptType",id:4},user_confirmation:{type:"bool",id:5,options:{default:!1}},ownership_ids:{rule:"repeated",type:"bytes",id:6},commitment_data:{type:"bytes",id:7,options:{default:""}}}},OwnershipProof:{fields:{ownership_proof:{rule:"required",type:"bytes",id:1},signature:{rule:"required",type:"bytes",id:2}}},AuthorizeCoinJoin:{options:{"(unstable)":!0},fields:{coordinator:{rule:"required",type:"string",id:1},max_total_fee:{rule:"required",type:"uint64",id:2},fee_per_anonymity:{type:"uint32",id:3,options:{default:0}},address_n:{rule:"repeated",type:"uint32",id:4,options:{packed:!1}},coin_name:{type:"string",id:5,options:{default:"Bitcoin"}},script_type:{type:"InputScriptType",id:6,options:{default:"SPENDADDRESS"}},amount_unit:{type:"AmountUnit",id:11,options:{default:"BITCOIN"}}}},GetPublicKeyMultiple:{fields:{addresses:{rule:"repeated",type:"BIP32Address",id:1},ecdsa_curve_name:{type:"string",id:2},show_display:{type:"bool",id:3},coin_name:{type:"string",id:4,options:{default:"Bitcoin"}},script_type:{type:"InputScriptType",id:5,options:{default:"SPENDADDRESS"}},ignore_xpub_magic:{type:"bool",id:6}},nested:{BIP32Address:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}}}}}},PublicKeyMultiple:{fields:{xpubs:{rule:"repeated",type:"string",id:1}}},SignPsbt:{fields:{psbt:{rule:"required",type:"bytes",id:1},coin_name:{type:"string",id:2,options:{default:"Bitcoin"}}}},SignedPsbt:{fields:{psbt:{rule:"required",type:"bytes",id:1}}},FirmwareErase:{fields:{length:{type:"uint32",id:1}}},FirmwareRequest:{fields:{offset:{type:"uint32",id:1},length:{type:"uint32",id:2}}},FirmwareUpload:{fields:{payload:{rule:"required",type:"bytes",id:1},hash:{type:"bytes",id:2}}},SelfTest:{fields:{payload:{type:"bytes",id:1}}},FirmwareErase_ex:{fields:{length:{type:"uint32",id:1}}},RebootType:{values:{Normal:0,Boardloader:1,BootLoader:2}},Reboot:{fields:{reboot_type:{rule:"required",type:"RebootType",id:1}}},FirmwareUpdateEmmc:{fields:{path:{rule:"required",type:"string",id:1},reboot_on_success:{type:"bool",id:2}}},CardanoDerivationType:{values:{LEDGER:0,ICARUS:1,ICARUS_TREZOR:2}},CardanoAddressType:{values:{BASE:0,BASE_SCRIPT_KEY:1,BASE_KEY_SCRIPT:2,BASE_SCRIPT_SCRIPT:3,POINTER:4,POINTER_SCRIPT:5,ENTERPRISE:6,ENTERPRISE_SCRIPT:7,BYRON:8,REWARD:14,REWARD_SCRIPT:15}},CardanoNativeScriptType:{values:{PUB_KEY:0,ALL:1,ANY:2,N_OF_K:3,INVALID_BEFORE:4,INVALID_HEREAFTER:5}},CardanoNativeScriptHashDisplayFormat:{values:{HIDE:0,BECH32:1,POLICY_ID:2}},CardanoTxOutputSerializationFormat:{values:{ARRAY_LEGACY:0,MAP_BABBAGE:1}},CardanoCertificateType:{values:{STAKE_REGISTRATION:0,STAKE_DEREGISTRATION:1,STAKE_DELEGATION:2,STAKE_POOL_REGISTRATION:3,STAKE_REGISTRATION_CONWAY:7,STAKE_DEREGISTRATION_CONWAY:8,VOTE_DELEGATION:9}},CardanoDRepType:{values:{KEY_HASH:0,SCRIPT_HASH:1,ABSTAIN:2,NO_CONFIDENCE:3}},CardanoPoolRelayType:{values:{SINGLE_HOST_IP:0,SINGLE_HOST_NAME:1,MULTIPLE_HOST_NAME:2}},CardanoTxAuxiliaryDataSupplementType:{values:{NONE:0,CVOTE_REGISTRATION_SIGNATURE:1}},CardanoCVoteRegistrationFormat:{values:{CIP15:0,CIP36:1}},CardanoTxSigningMode:{values:{ORDINARY_TRANSACTION:0,POOL_REGISTRATION_AS_OWNER:1,MULTISIG_TRANSACTION:2,PLUTUS_TRANSACTION:3}},CardanoTxWitnessType:{values:{BYRON_WITNESS:0,SHELLEY_WITNESS:1}},CardanoBlockchainPointerType:{fields:{block_index:{rule:"required",type:"uint32",id:1},tx_index:{rule:"required",type:"uint32",id:2},certificate_index:{rule:"required",type:"uint32",id:3}}},CardanoNativeScript:{fields:{type:{rule:"required",type:"CardanoNativeScriptType",id:1},scripts:{rule:"repeated",type:"CardanoNativeScript",id:2},key_hash:{type:"bytes",id:3},key_path:{rule:"repeated",type:"uint32",id:4,options:{packed:!1}},required_signatures_count:{type:"uint32",id:5},invalid_before:{type:"uint64",id:6},invalid_hereafter:{type:"uint64",id:7}}},CardanoGetNativeScriptHash:{fields:{script:{rule:"required",type:"CardanoNativeScript",id:1},display_format:{rule:"required",type:"CardanoNativeScriptHashDisplayFormat",id:2},derivation_type:{rule:"required",type:"CardanoDerivationType",id:3}}},CardanoNativeScriptHash:{fields:{script_hash:{rule:"required",type:"bytes",id:1}}},CardanoAddressParametersType:{fields:{address_type:{rule:"required",type:"CardanoAddressType",id:1},address_n:{rule:"repeated",type:"uint32",id:2,options:{packed:!1}},address_n_staking:{rule:"repeated",type:"uint32",id:3,options:{packed:!1}},staking_key_hash:{type:"bytes",id:4},certificate_pointer:{type:"CardanoBlockchainPointerType",id:5},script_payment_hash:{type:"bytes",id:6},script_staking_hash:{type:"bytes",id:7}}},CardanoGetAddress:{fields:{show_display:{type:"bool",id:2,options:{default:!1}},protocol_magic:{rule:"required",type:"uint32",id:3},network_id:{rule:"required",type:"uint32",id:4},address_parameters:{rule:"required",type:"CardanoAddressParametersType",id:5},derivation_type:{rule:"required",type:"CardanoDerivationType",id:6},chunkify:{type:"bool",id:7}}},CardanoAddress:{fields:{address:{rule:"required",type:"string",id:1}}},CardanoGetPublicKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2},derivation_type:{rule:"required",type:"CardanoDerivationType",id:3}}},CardanoPublicKey:{fields:{xpub:{rule:"required",type:"string",id:1},node:{rule:"required",type:"HDNodeType",id:2}}},CardanoSignTxInit:{fields:{signing_mode:{rule:"required",type:"CardanoTxSigningMode",id:1},protocol_magic:{rule:"required",type:"uint32",id:2},network_id:{rule:"required",type:"uint32",id:3},inputs_count:{rule:"required",type:"uint32",id:4},outputs_count:{rule:"required",type:"uint32",id:5},fee:{rule:"required",type:"uint64",id:6},ttl:{type:"uint64",id:7},certificates_count:{rule:"required",type:"uint32",id:8},withdrawals_count:{rule:"required",type:"uint32",id:9},has_auxiliary_data:{rule:"required",type:"bool",id:10},validity_interval_start:{type:"uint64",id:11},witness_requests_count:{rule:"required",type:"uint32",id:12},minting_asset_groups_count:{rule:"required",type:"uint32",id:13},derivation_type:{rule:"required",type:"CardanoDerivationType",id:14},include_network_id:{type:"bool",id:15,options:{default:!1}},script_data_hash:{type:"bytes",id:16},collateral_inputs_count:{rule:"required",type:"uint32",id:17},required_signers_count:{rule:"required",type:"uint32",id:18},has_collateral_return:{type:"bool",id:19,options:{default:!1}},total_collateral:{type:"uint64",id:20},reference_inputs_count:{type:"uint32",id:21,options:{default:0}},chunkify:{type:"bool",id:22},tag_cbor_sets:{type:"bool",id:23,options:{default:!1}}}},CardanoTxInput:{fields:{prev_hash:{rule:"required",type:"bytes",id:1},prev_index:{rule:"required",type:"uint32",id:2}}},CardanoTxOutput:{fields:{address:{type:"string",id:1},address_parameters:{type:"CardanoAddressParametersType",id:2},amount:{rule:"required",type:"uint64",id:3},asset_groups_count:{rule:"required",type:"uint32",id:4},datum_hash:{type:"bytes",id:5},format:{type:"CardanoTxOutputSerializationFormat",id:6,options:{default:"ARRAY_LEGACY"}},inline_datum_size:{type:"uint32",id:7,options:{default:0}},reference_script_size:{type:"uint32",id:8,options:{default:0}}}},CardanoAssetGroup:{fields:{policy_id:{rule:"required",type:"bytes",id:1},tokens_count:{rule:"required",type:"uint32",id:2}}},CardanoToken:{fields:{asset_name_bytes:{rule:"required",type:"bytes",id:1},amount:{type:"uint64",id:2},mint_amount:{type:"sint64",id:3}}},CardanoTxInlineDatumChunk:{fields:{data:{rule:"required",type:"bytes",id:1}}},CardanoTxReferenceScriptChunk:{fields:{data:{rule:"required",type:"bytes",id:1}}},CardanoPoolOwner:{fields:{staking_key_path:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},staking_key_hash:{type:"bytes",id:2}}},CardanoPoolRelayParameters:{fields:{type:{rule:"required",type:"CardanoPoolRelayType",id:1},ipv4_address:{type:"bytes",id:2},ipv6_address:{type:"bytes",id:3},host_name:{type:"string",id:4},port:{type:"uint32",id:5}}},CardanoPoolMetadataType:{fields:{url:{rule:"required",type:"string",id:1},hash:{rule:"required",type:"bytes",id:2}}},CardanoPoolParametersType:{fields:{pool_id:{rule:"required",type:"bytes",id:1},vrf_key_hash:{rule:"required",type:"bytes",id:2},pledge:{rule:"required",type:"uint64",id:3},cost:{rule:"required",type:"uint64",id:4},margin_numerator:{rule:"required",type:"uint64",id:5},margin_denominator:{rule:"required",type:"uint64",id:6},reward_account:{rule:"required",type:"string",id:7},metadata:{type:"CardanoPoolMetadataType",id:10},owners_count:{rule:"required",type:"uint32",id:11},relays_count:{rule:"required",type:"uint32",id:12}}},CardanoDRep:{fields:{type:{rule:"required",type:"CardanoDRepType",id:1},key_hash:{type:"bytes",id:2},script_hash:{type:"bytes",id:3}}},CardanoTxCertificate:{fields:{type:{rule:"required",type:"CardanoCertificateType",id:1},path:{rule:"repeated",type:"uint32",id:2,options:{packed:!1}},pool:{type:"bytes",id:3},pool_parameters:{type:"CardanoPoolParametersType",id:4},script_hash:{type:"bytes",id:5},key_hash:{type:"bytes",id:6},deposit:{type:"uint64",id:7},drep:{type:"CardanoDRep",id:8}}},CardanoTxWithdrawal:{fields:{path:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},amount:{rule:"required",type:"uint64",id:2},script_hash:{type:"bytes",id:3},key_hash:{type:"bytes",id:4}}},CardanoCVoteRegistrationDelegation:{fields:{vote_public_key:{rule:"required",type:"bytes",id:1},weight:{rule:"required",type:"uint32",id:2}}},CardanoCVoteRegistrationParametersType:{fields:{vote_public_key:{type:"bytes",id:1},staking_path:{rule:"repeated",type:"uint32",id:2,options:{packed:!1}},payment_address_parameters:{type:"CardanoAddressParametersType",id:3},nonce:{rule:"required",type:"uint64",id:4},format:{type:"CardanoCVoteRegistrationFormat",id:5,options:{default:"CIP15"}},delegations:{rule:"repeated",type:"CardanoCVoteRegistrationDelegation",id:6},voting_purpose:{type:"uint64",id:7},payment_address:{type:"string",id:8}}},CardanoTxAuxiliaryData:{fields:{cvote_registration_parameters:{type:"CardanoCVoteRegistrationParametersType",id:1},hash:{type:"bytes",id:2}}},CardanoTxMint:{fields:{asset_groups_count:{rule:"required",type:"uint32",id:1}}},CardanoTxCollateralInput:{fields:{prev_hash:{rule:"required",type:"bytes",id:1},prev_index:{rule:"required",type:"uint32",id:2}}},CardanoTxRequiredSigner:{fields:{key_hash:{type:"bytes",id:1},key_path:{rule:"repeated",type:"uint32",id:2,options:{packed:!1}}}},CardanoTxReferenceInput:{fields:{prev_hash:{rule:"required",type:"bytes",id:1},prev_index:{rule:"required",type:"uint32",id:2}}},CardanoTxItemAck:{fields:{}},CardanoTxAuxiliaryDataSupplement:{fields:{type:{rule:"required",type:"CardanoTxAuxiliaryDataSupplementType",id:1},auxiliary_data_hash:{type:"bytes",id:2},cvote_registration_signature:{type:"bytes",id:3}}},CardanoTxWitnessRequest:{fields:{path:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}}}},CardanoTxWitnessResponse:{fields:{type:{rule:"required",type:"CardanoTxWitnessType",id:1},pub_key:{rule:"required",type:"bytes",id:2},signature:{rule:"required",type:"bytes",id:3},chain_code:{type:"bytes",id:4}}},CardanoTxHostAck:{fields:{}},CardanoTxBodyHash:{fields:{tx_hash:{rule:"required",type:"bytes",id:1}}},CardanoSignTxFinished:{fields:{}},CardanoSignMessage:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},message:{rule:"required",type:"bytes",id:2},derivation_type:{rule:"required",type:"CardanoDerivationType",id:3},network_id:{rule:"required",type:"uint32",id:4},address_type:{type:"CardanoAddressType",id:5}}},CardanoMessageSignature:{fields:{signature:{rule:"required",type:"bytes",id:1},key:{rule:"required",type:"bytes",id:2}}},Success:{fields:{message:{type:"string",id:1,options:{default:""}}}},Failure:{fields:{code:{type:"FailureType",id:1},message:{type:"string",id:2}},nested:{FailureType:{values:{Failure_UnexpectedMessage:1,Failure_ButtonExpected:2,Failure_DataError:3,Failure_ActionCancelled:4,Failure_PinExpected:5,Failure_PinCancelled:6,Failure_PinInvalid:7,Failure_InvalidSignature:8,Failure_ProcessError:9,Failure_NotEnoughFunds:10,Failure_NotInitialized:11,Failure_PinMismatch:12,Failure_WipeCodeMismatch:13,Failure_InvalidSession:14,Failure_FirmwareError:99}}}},ButtonRequest:{fields:{code:{type:"ButtonRequestType",id:1},pages:{type:"uint32",id:2}},nested:{ButtonRequestType:{values:{ButtonRequest_Other:1,ButtonRequest_FeeOverThreshold:2,ButtonRequest_ConfirmOutput:3,ButtonRequest_ResetDevice:4,ButtonRequest_ConfirmWord:5,ButtonRequest_WipeDevice:6,ButtonRequest_ProtectCall:7,ButtonRequest_SignTx:8,ButtonRequest_FirmwareCheck:9,ButtonRequest_Address:10,ButtonRequest_PublicKey:11,ButtonRequest_MnemonicWordCount:12,ButtonRequest_MnemonicInput:13,_Deprecated_ButtonRequest_PassphraseType:14,ButtonRequest_UnknownDerivationPath:15,ButtonRequest_RecoveryHomepage:16,ButtonRequest_Success:17,ButtonRequest_Warning:18,ButtonRequest_PassphraseEntry:19,ButtonRequest_PinEntry:20,ButtonRequest_AttachPin:8e3}}}},ButtonAck:{fields:{}},PinMatrixRequest:{fields:{type:{type:"PinMatrixRequestType",id:1}},nested:{PinMatrixRequestType:{values:{PinMatrixRequestType_Current:1,PinMatrixRequestType_NewFirst:2,PinMatrixRequestType_NewSecond:3,PinMatrixRequestType_WipeCodeFirst:4,PinMatrixRequestType_WipeCodeSecond:5,PinMatrixRequestType_BackupFirst:6,PinMatrixRequestType_BackupSecond:7,PinMatrixRequestType_AttachToPin:8e3}}}},PinMatrixAck:{fields:{pin:{rule:"required",type:"string",id:1},new_pin:{type:"string",id:2}}},PassphraseRequest:{fields:{_on_device:{type:"bool",id:1,options:{deprecated:!0}},exists_attach_pin_user:{type:"bool",id:8e3}}},PassphraseAck:{fields:{passphrase:{type:"string",id:1},_state:{type:"bytes",id:2,options:{deprecated:!0}},on_device:{type:"bool",id:3},on_device_attach_pin:{type:"bool",id:8e3}}},Deprecated_PassphraseStateRequest:{options:{deprecated:!0},fields:{state:{type:"bytes",id:1}}},Deprecated_PassphraseStateAck:{options:{deprecated:!0},fields:{}},HDNodeType:{fields:{depth:{rule:"required",type:"uint32",id:1},fingerprint:{rule:"required",type:"uint32",id:2},child_num:{rule:"required",type:"uint32",id:3},chain_code:{rule:"required",type:"bytes",id:4},private_key:{type:"bytes",id:5},public_key:{rule:"required",type:"bytes",id:6}}},BixinPinInputOnDevice:{fields:{}},ConfluxGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2},chain_id:{type:"uint32",id:3}}},ConfluxAddress:{fields:{address:{type:"string",id:1}}},ConfluxSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},nonce:{type:"bytes",id:2},gas_price:{type:"bytes",id:3},gas_limit:{type:"bytes",id:4},to:{type:"string",id:5},value:{type:"bytes",id:6},epoch_height:{type:"bytes",id:7},storage_limit:{type:"bytes",id:8},data_initial_chunk:{type:"bytes",id:9},data_length:{type:"uint32",id:10},chain_id:{type:"uint32",id:11}}},ConfluxTxRequest:{fields:{data_length:{type:"uint32",id:1},signature_v:{type:"uint32",id:2},signature_r:{type:"bytes",id:3},signature_s:{type:"bytes",id:4}}},ConfluxTxAck:{fields:{data_chunk:{type:"bytes",id:1}}},ConfluxSignMessage:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},message:{type:"bytes",id:2}}},ConfluxMessageSignature:{fields:{signature:{type:"bytes",id:2},address:{type:"string",id:3}}},ConfluxSignMessageCIP23:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},domain_hash:{type:"bytes",id:2},message_hash:{type:"bytes",id:3}}},CosmosGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},hrp:{type:"string",id:2},show_display:{type:"bool",id:3}}},CosmosAddress:{fields:{address:{type:"string",id:1}}},CosmosSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},raw_tx:{rule:"required",type:"bytes",id:2}}},CosmosSignedTx:{fields:{signature:{rule:"required",type:"bytes",id:1}}},CipherKeyValue:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},key:{rule:"required",type:"string",id:2},value:{rule:"required",type:"bytes",id:3},encrypt:{type:"bool",id:4},ask_on_encrypt:{type:"bool",id:5},ask_on_decrypt:{type:"bool",id:6},iv:{type:"bytes",id:7}}},CipheredKeyValue:{fields:{value:{rule:"required",type:"bytes",id:1}}},IdentityType:{fields:{proto:{type:"string",id:1},user:{type:"string",id:2},host:{type:"string",id:3},port:{type:"string",id:4},path:{type:"string",id:5},index:{type:"uint32",id:6,options:{default:0}}}},SignIdentity:{fields:{identity:{rule:"required",type:"IdentityType",id:1},challenge_hidden:{type:"bytes",id:2,options:{default:""}},challenge_visual:{type:"string",id:3,options:{default:""}},ecdsa_curve_name:{type:"string",id:4}}},SignedIdentity:{fields:{address:{type:"string",id:1},public_key:{rule:"required",type:"bytes",id:2},signature:{rule:"required",type:"bytes",id:3}}},GetECDHSessionKey:{fields:{identity:{rule:"required",type:"IdentityType",id:1},peer_public_key:{rule:"required",type:"bytes",id:2},ecdsa_curve_name:{type:"string",id:3}}},ECDHSessionKey:{fields:{session_key:{rule:"required",type:"bytes",id:1},public_key:{type:"bytes",id:2}}},CosiCommit:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},data:{type:"bytes",id:2}}},CosiCommitment:{fields:{commitment:{type:"bytes",id:1},pubkey:{type:"bytes",id:2}}},CosiSign:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},data:{type:"bytes",id:2},global_commitment:{type:"bytes",id:3},global_pubkey:{type:"bytes",id:4}}},CosiSignature:{fields:{signature:{rule:"required",type:"bytes",id:1}}},BatchGetPublickeys:{fields:{ecdsa_curve_name:{type:"string",id:1,options:{default:"ed25519"}},paths:{rule:"repeated",type:"Path",id:2},include_node:{type:"bool",id:3,options:{default:!1}}},nested:{Path:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}}}}}},EcdsaPublicKeys:{fields:{public_keys:{rule:"repeated",type:"bytes",id:1},hd_nodes:{rule:"repeated",type:"HDNodeType",id:2},root_fingerprint:{type:"uint32",id:3}}},DebugLinkDecision:{fields:{yes_no:{type:"bool",id:1},swipe:{type:"DebugSwipeDirection",id:2},input:{type:"string",id:3},x:{type:"uint32",id:4},y:{type:"uint32",id:5},wait:{type:"bool",id:6},hold_ms:{type:"uint32",id:7}},nested:{DebugSwipeDirection:{values:{UP:0,DOWN:1,LEFT:2,RIGHT:3}}}},DebugLinkLayout:{fields:{lines:{rule:"repeated",type:"string",id:1}}},DebugLinkReseedRandom:{fields:{value:{type:"uint32",id:1}}},DebugLinkRecordScreen:{fields:{target_directory:{type:"string",id:1}}},DebugLinkGetState:{fields:{wait_word_list:{type:"bool",id:1},wait_word_pos:{type:"bool",id:2},wait_layout:{type:"bool",id:3}}},DebugLinkState:{fields:{layout:{type:"bytes",id:1},pin:{type:"string",id:2},matrix:{type:"string",id:3},mnemonic_secret:{type:"bytes",id:4},node:{type:"HDNodeType",id:5},passphrase_protection:{type:"bool",id:6},reset_word:{type:"string",id:7},reset_entropy:{type:"bytes",id:8},recovery_fake_word:{type:"string",id:9},recovery_word_pos:{type:"uint32",id:10},reset_word_pos:{type:"uint32",id:11},mnemonic_type:{type:"BackupType",id:12},layout_lines:{rule:"repeated",type:"string",id:13}}},DebugLinkStop:{fields:{}},DebugLinkLog:{fields:{level:{type:"uint32",id:1},bucket:{type:"string",id:2},text:{type:"string",id:3}}},DebugLinkMemoryRead:{fields:{address:{type:"uint32",id:1},length:{type:"uint32",id:2}}},DebugLinkMemory:{fields:{memory:{type:"bytes",id:1}}},DebugLinkMemoryWrite:{fields:{address:{type:"uint32",id:1},memory:{type:"bytes",id:2},flash:{type:"bool",id:3}}},DebugLinkFlashErase:{fields:{sector:{type:"uint32",id:1}}},DebugLinkEraseSdCard:{fields:{format:{type:"bool",id:1}}},DebugLinkWatchLayout:{fields:{watch:{type:"bool",id:1}}},DnxGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},DnxAddress:{fields:{address:{type:"string",id:1}}},DnxSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},inputs_count:{rule:"required",type:"uint32",id:2},to_address:{rule:"required",type:"string",id:3},amount:{rule:"required",type:"uint64",id:4},fee:{rule:"required",type:"uint64",id:5},payment_id:{type:"bytes",id:6}}},DnxInputRequest:{fields:{request_index:{type:"uint32",id:1},tx_key:{type:"DnxTxKey",id:2},computed_key_image:{type:"DnxComputedKeyImage",id:3}},nested:{DnxTxKey:{fields:{ephemeral_tx_sec_key:{type:"bytes",id:1},ephemeral_tx_pub_key:{type:"bytes",id:2}}},DnxComputedKeyImage:{fields:{key_image:{type:"bytes",id:1}}}}},DnxInputAck:{fields:{prev_index:{rule:"required",type:"uint32",id:1},global_index:{rule:"required",type:"uint32",id:2},tx_pubkey:{rule:"required",type:"bytes",id:3},prev_out_pubkey:{rule:"required",type:"bytes",id:4},amount:{rule:"required",type:"uint64",id:5}}},DnxRTSigsRequest:{fields:{}},DnxSignedTx:{fields:{signatures:{rule:"repeated",type:"bytes",id:1},output_keys:{rule:"repeated",type:"bytes",id:2}}},EmmcFixPermission:{fields:{}},EmmcPath:{fields:{exist:{rule:"required",type:"bool",id:1},size:{rule:"required",type:"uint64",id:2},year:{rule:"required",type:"uint32",id:3},month:{rule:"required",type:"uint32",id:4},day:{rule:"required",type:"uint32",id:5},hour:{rule:"required",type:"uint32",id:6},minute:{rule:"required",type:"uint32",id:7},second:{rule:"required",type:"uint32",id:8},readonly:{rule:"required",type:"bool",id:9},hidden:{rule:"required",type:"bool",id:10},system:{rule:"required",type:"bool",id:11},archive:{rule:"required",type:"bool",id:12},directory:{rule:"required",type:"bool",id:13}}},EmmcPathInfo:{fields:{path:{rule:"required",type:"string",id:1}}},EmmcFile:{fields:{path:{rule:"required",type:"string",id:1},offset:{rule:"required",type:"uint32",id:2},len:{rule:"required",type:"uint32",id:3},data:{type:"bytes",id:4},data_hash:{type:"uint32",id:5},processed_byte:{type:"uint32",id:6}}},EmmcFileRead:{fields:{file:{rule:"required",type:"EmmcFile",id:1},ui_percentage:{type:"uint32",id:2}}},EmmcFileWrite:{fields:{file:{rule:"required",type:"EmmcFile",id:1},overwrite:{rule:"required",type:"bool",id:2},append:{rule:"required",type:"bool",id:3},ui_percentage:{type:"uint32",id:4}}},EmmcFileDelete:{fields:{path:{rule:"required",type:"string",id:1}}},EmmcDir:{fields:{path:{rule:"required",type:"string",id:1},child_dirs:{type:"string",id:2},child_files:{type:"string",id:3}}},EmmcDirList:{fields:{path:{rule:"required",type:"string",id:1}}},EmmcDirMake:{fields:{path:{rule:"required",type:"string",id:1}}},EmmcDirRemove:{fields:{path:{rule:"required",type:"string",id:1}}},EosGetPublicKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},EosPublicKey:{fields:{wif_public_key:{rule:"required",type:"string",id:1},raw_public_key:{rule:"required",type:"bytes",id:2}}},EosSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},chain_id:{type:"bytes",id:2},header:{type:"EosTxHeader",id:3},num_actions:{type:"uint32",id:4}},nested:{EosTxHeader:{fields:{expiration:{rule:"required",type:"uint32",id:1},ref_block_num:{rule:"required",type:"uint32",id:2},ref_block_prefix:{rule:"required",type:"uint32",id:3},max_net_usage_words:{rule:"required",type:"uint32",id:4},max_cpu_usage_ms:{rule:"required",type:"uint32",id:5},delay_sec:{rule:"required",type:"uint32",id:6}}}}},EosTxActionRequest:{fields:{data_size:{type:"uint32",id:1}}},EosTxActionAck:{fields:{common:{type:"EosActionCommon",id:1},transfer:{type:"EosActionTransfer",id:2},delegate:{type:"EosActionDelegate",id:3},undelegate:{type:"EosActionUndelegate",id:4},refund:{type:"EosActionRefund",id:5},buy_ram:{type:"EosActionBuyRam",id:6},buy_ram_bytes:{type:"EosActionBuyRamBytes",id:7},sell_ram:{type:"EosActionSellRam",id:8},vote_producer:{type:"EosActionVoteProducer",id:9},update_auth:{type:"EosActionUpdateAuth",id:10},delete_auth:{type:"EosActionDeleteAuth",id:11},link_auth:{type:"EosActionLinkAuth",id:12},unlink_auth:{type:"EosActionUnlinkAuth",id:13},new_account:{type:"EosActionNewAccount",id:14},unknown:{type:"EosActionUnknown",id:15}},nested:{EosAsset:{fields:{amount:{type:"sint64",id:1},symbol:{type:"uint64",id:2}}},EosPermissionLevel:{fields:{actor:{type:"uint64",id:1},permission:{type:"uint64",id:2}}},EosAuthorizationKey:{fields:{type:{rule:"required",type:"uint32",id:1},key:{type:"bytes",id:2},address_n:{rule:"repeated",type:"uint32",id:3,options:{packed:!1}},weight:{rule:"required",type:"uint32",id:4}}},EosAuthorizationAccount:{fields:{account:{type:"EosPermissionLevel",id:1},weight:{type:"uint32",id:2}}},EosAuthorizationWait:{fields:{wait_sec:{type:"uint32",id:1},weight:{type:"uint32",id:2}}},EosAuthorization:{fields:{threshold:{type:"uint32",id:1},keys:{rule:"repeated",type:"EosAuthorizationKey",id:2},accounts:{rule:"repeated",type:"EosAuthorizationAccount",id:3},waits:{rule:"repeated",type:"EosAuthorizationWait",id:4}}},EosActionCommon:{fields:{account:{type:"uint64",id:1},name:{type:"uint64",id:2},authorization:{rule:"repeated",type:"EosPermissionLevel",id:3}}},EosActionTransfer:{fields:{sender:{type:"uint64",id:1},receiver:{type:"uint64",id:2},quantity:{type:"EosAsset",id:3},memo:{type:"string",id:4}}},EosActionDelegate:{fields:{sender:{type:"uint64",id:1},receiver:{type:"uint64",id:2},net_quantity:{type:"EosAsset",id:3},cpu_quantity:{type:"EosAsset",id:4},transfer:{type:"bool",id:5}}},EosActionUndelegate:{fields:{sender:{type:"uint64",id:1},receiver:{type:"uint64",id:2},net_quantity:{type:"EosAsset",id:3},cpu_quantity:{type:"EosAsset",id:4}}},EosActionRefund:{fields:{owner:{type:"uint64",id:1}}},EosActionBuyRam:{fields:{payer:{type:"uint64",id:1},receiver:{type:"uint64",id:2},quantity:{type:"EosAsset",id:3}}},EosActionBuyRamBytes:{fields:{payer:{type:"uint64",id:1},receiver:{type:"uint64",id:2},bytes:{type:"uint32",id:3}}},EosActionSellRam:{fields:{account:{type:"uint64",id:1},bytes:{type:"uint64",id:2}}},EosActionVoteProducer:{fields:{voter:{type:"uint64",id:1},proxy:{type:"uint64",id:2},producers:{rule:"repeated",type:"uint64",id:3,options:{packed:!1}}}},EosActionUpdateAuth:{fields:{account:{type:"uint64",id:1},permission:{type:"uint64",id:2},parent:{type:"uint64",id:3},auth:{type:"EosAuthorization",id:4}}},EosActionDeleteAuth:{fields:{account:{type:"uint64",id:1},permission:{type:"uint64",id:2}}},EosActionLinkAuth:{fields:{account:{type:"uint64",id:1},code:{type:"uint64",id:2},type:{type:"uint64",id:3},requirement:{type:"uint64",id:4}}},EosActionUnlinkAuth:{fields:{account:{type:"uint64",id:1},code:{type:"uint64",id:2},type:{type:"uint64",id:3}}},EosActionNewAccount:{fields:{creator:{type:"uint64",id:1},name:{type:"uint64",id:2},owner:{type:"EosAuthorization",id:3},active:{type:"EosAuthorization",id:4}}},EosActionUnknown:{fields:{data_size:{rule:"required",type:"uint32",id:1},data_chunk:{type:"bytes",id:2}}}}},EosSignedTx:{fields:{signature:{rule:"required",type:"string",id:1}}},EthereumDefinitionType:{values:{NETWORK:0,TOKEN:1}},EthereumNetworkInfo:{fields:{chain_id:{rule:"required",type:"uint64",id:1},symbol:{rule:"required",type:"string",id:2},slip44:{rule:"required",type:"uint32",id:3},name:{rule:"required",type:"string",id:4},icon:{type:"string",id:101},primary_color:{type:"uint64",id:102}}},EthereumTokenInfo:{fields:{address:{rule:"required",type:"bytes",id:1},chain_id:{rule:"required",type:"uint64",id:2},symbol:{rule:"required",type:"string",id:3},decimals:{rule:"required",type:"uint32",id:4},name:{rule:"required",type:"string",id:5}}},EthereumDefinitions:{fields:{encoded_network:{type:"bytes",id:1},encoded_token:{type:"bytes",id:2}}},EthereumSignTypedDataUKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},primary_type:{rule:"required",type:"string",id:2},metamask_v4_compat:{type:"bool",id:3,options:{default:!0}},chain_id:{type:"uint64",id:4}}},EthereumGnosisSafeTxOperation:{values:{CALL:0,DELEGATE_CALL:1}},EthereumGnosisSafeTxRequest:{fields:{}},EthereumGnosisSafeTxAck:{fields:{to:{rule:"required",type:"string",id:1},value:{rule:"required",type:"bytes",id:2},data:{type:"bytes",id:3},operation:{rule:"required",type:"EthereumGnosisSafeTxOperation",id:4},safeTxGas:{rule:"required",type:"bytes",id:5},baseGas:{rule:"required",type:"bytes",id:6},gasPrice:{rule:"required",type:"bytes",id:7},gasToken:{rule:"required",type:"string",id:8},refundReceiver:{rule:"required",type:"string",id:9},nonce:{rule:"required",type:"bytes",id:10},chain_id:{rule:"required",type:"uint64",id:11},verifyingContract:{rule:"required",type:"string",id:12}}},EthereumTypedDataStructRequestUKey:{fields:{name:{rule:"required",type:"string",id:1}}},EthereumTypedDataStructAckUKey:{fields:{members:{rule:"repeated",type:"EthereumStructMemberUKey",id:1}},nested:{EthereumStructMemberUKey:{fields:{type:{rule:"required",type:"EthereumFieldTypeUKey",id:1},name:{rule:"required",type:"string",id:2}}},EthereumFieldTypeUKey:{fields:{data_type:{rule:"required",type:"EthereumDataTypeUKey",id:1},size:{type:"uint32",id:2},entry_type:{type:"EthereumFieldTypeUKey",id:3},struct_name:{type:"string",id:4}}},EthereumDataTypeUKey:{values:{UINT:1,INT:2,BYTES:3,STRING:4,BOOL:5,ADDRESS:6,ARRAY:7,STRUCT:8}}}},EthereumTypedDataValueRequestUKey:{fields:{member_path:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}}}},EthereumTypedDataValueAckUKey:{fields:{value:{rule:"required",type:"bytes",id:1}}},EthereumSignTypedData:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},primary_type:{rule:"required",type:"string",id:2},metamask_v4_compat:{type:"bool",id:3,options:{default:!0}},definitions:{type:"EthereumDefinitions",id:4}}},EthereumTypedDataStructRequest:{fields:{name:{rule:"required",type:"string",id:1}}},EthereumTypedDataStructAck:{fields:{members:{rule:"repeated",type:"EthereumStructMember",id:1}},nested:{EthereumStructMember:{fields:{type:{rule:"required",type:"EthereumFieldType",id:1},name:{rule:"required",type:"string",id:2}}},EthereumFieldType:{fields:{data_type:{rule:"required",type:"EthereumDataType",id:1},size:{type:"uint32",id:2},entry_type:{type:"EthereumFieldType",id:3},struct_name:{type:"string",id:4}}},EthereumDataType:{values:{UINT:1,INT:2,BYTES:3,STRING:4,BOOL:5,ADDRESS:6,ARRAY:7,STRUCT:8}}}},EthereumTypedDataValueRequest:{fields:{member_path:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}}}},EthereumTypedDataValueAck:{fields:{value:{rule:"required",type:"bytes",id:1}}},EthereumGetPublicKeyUKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2},chain_id:{type:"uint64",id:3}}},EthereumPublicKeyUKey:{fields:{node:{rule:"required",type:"HDNodeType",id:1},xpub:{rule:"required",type:"string",id:2}}},EthereumGetAddressUKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2},chain_id:{type:"uint64",id:3}}},EthereumAddressUKey:{fields:{_old_address:{type:"bytes",id:1,options:{deprecated:!0}},address:{type:"string",id:2}}},EthereumSignTxUKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},nonce:{type:"bytes",id:2,options:{default:""}},gas_price:{rule:"required",type:"bytes",id:3},gas_limit:{rule:"required",type:"bytes",id:4},to:{type:"string",id:11,options:{default:""}},value:{type:"bytes",id:6,options:{default:""}},data_initial_chunk:{type:"bytes",id:7,options:{default:""}},data_length:{type:"uint32",id:8,options:{default:0}},chain_id:{rule:"required",type:"uint64",id:9},tx_type:{type:"uint32",id:10}}},EthereumAccessListUKey:{fields:{address:{rule:"required",type:"string",id:1},storage_keys:{rule:"repeated",type:"bytes",id:2}}},EthereumSignTxEIP1559UKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},nonce:{rule:"required",type:"bytes",id:2},max_gas_fee:{rule:"required",type:"bytes",id:3},max_priority_fee:{rule:"required",type:"bytes",id:4},gas_limit:{rule:"required",type:"bytes",id:5},to:{type:"string",id:6,options:{default:""}},value:{rule:"required",type:"bytes",id:7},data_initial_chunk:{type:"bytes",id:8,options:{default:""}},data_length:{rule:"required",type:"uint32",id:9},chain_id:{rule:"required",type:"uint64",id:10},access_list:{rule:"repeated",type:"EthereumAccessListUKey",id:11}}},EthereumAuthorizationSignature:{fields:{y_parity:{rule:"required",type:"uint32",id:1},r:{rule:"required",type:"bytes",id:2},s:{rule:"required",type:"bytes",id:3}}},EthereumSignTxEIP7702UKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},nonce:{rule:"required",type:"bytes",id:2},max_gas_fee:{rule:"required",type:"bytes",id:3},max_priority_fee:{rule:"required",type:"bytes",id:4},gas_limit:{rule:"required",type:"bytes",id:5},to:{rule:"required",type:"string",id:6},value:{rule:"required",type:"bytes",id:7},data_initial_chunk:{type:"bytes",id:8,options:{default:""}},data_length:{rule:"required",type:"uint32",id:9},chain_id:{rule:"required",type:"uint64",id:10},access_list:{rule:"repeated",type:"EthereumAccessListUKey",id:11},authorization_list:{rule:"repeated",type:"EthereumAuthorizationUKey",id:12}},nested:{EthereumAuthorizationUKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},chain_id:{rule:"required",type:"uint64",id:2},address:{rule:"required",type:"string",id:3},nonce:{rule:"required",type:"bytes",id:4},signature:{type:"EthereumAuthorizationSignature",id:5}}}}},EthereumTxRequestUKey:{fields:{data_length:{type:"uint32",id:1},signature_v:{type:"uint32",id:2},signature_r:{type:"bytes",id:3},signature_s:{type:"bytes",id:4},authorization_signatures:{rule:"repeated",type:"EthereumAuthorizationSignature",id:10}}},EthereumTxAckUKey:{fields:{data_chunk:{rule:"required",type:"bytes",id:1}}},EthereumSignMessageUKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},message:{rule:"required",type:"bytes",id:2},chain_id:{type:"uint64",id:3}}},EthereumMessageSignatureUKey:{fields:{signature:{rule:"required",type:"bytes",id:2},address:{rule:"required",type:"string",id:3}}},EthereumVerifyMessageUKey:{fields:{signature:{rule:"required",type:"bytes",id:2},message:{rule:"required",type:"bytes",id:3},address:{rule:"required",type:"string",id:4},chain_id:{type:"uint64",id:5}}},EthereumSignTypedHashUKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},domain_separator_hash:{rule:"required",type:"bytes",id:2},message_hash:{type:"bytes",id:3},chain_id:{type:"uint64",id:4}}},EthereumTypedDataSignatureUKey:{fields:{signature:{rule:"required",type:"bytes",id:1},address:{rule:"required",type:"string",id:2}}},EthereumSignMessageEIP712:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},domain_hash:{type:"bytes",id:2},message_hash:{type:"bytes",id:3}}},EthereumGetPublicKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},EthereumPublicKey:{fields:{node:{rule:"required",type:"HDNodeType",id:1},xpub:{rule:"required",type:"string",id:2}}},EthereumGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2},encoded_network:{type:"bytes",id:3}}},EthereumAddress:{fields:{_old_address:{type:"bytes",id:1,options:{deprecated:!0}},address:{type:"string",id:2}}},EthereumSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},nonce:{type:"bytes",id:2,options:{default:""}},gas_price:{rule:"required",type:"bytes",id:3},gas_limit:{rule:"required",type:"bytes",id:4},to:{type:"string",id:11,options:{default:""}},value:{type:"bytes",id:6,options:{default:""}},data_initial_chunk:{type:"bytes",id:7,options:{default:""}},data_length:{type:"uint32",id:8,options:{default:0}},chain_id:{rule:"required",type:"uint64",id:9},tx_type:{type:"uint32",id:10},definitions:{type:"EthereumDefinitions",id:12}}},EthereumSignTxEIP1559:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},nonce:{rule:"required",type:"bytes",id:2},max_gas_fee:{rule:"required",type:"bytes",id:3},max_priority_fee:{rule:"required",type:"bytes",id:4},gas_limit:{rule:"required",type:"bytes",id:5},to:{type:"string",id:6,options:{default:""}},value:{rule:"required",type:"bytes",id:7},data_initial_chunk:{type:"bytes",id:8,options:{default:""}},data_length:{rule:"required",type:"uint32",id:9},chain_id:{rule:"required",type:"uint64",id:10},access_list:{rule:"repeated",type:"EthereumAccessList",id:11},definitions:{type:"EthereumDefinitions",id:12}},nested:{EthereumAccessList:{fields:{address:{rule:"required",type:"string",id:1},storage_keys:{rule:"repeated",type:"bytes",id:2}}}}},EthereumTxRequest:{fields:{data_length:{type:"uint32",id:1},signature_v:{type:"uint32",id:2},signature_r:{type:"bytes",id:3},signature_s:{type:"bytes",id:4}}},EthereumTxAck:{fields:{data_chunk:{rule:"required",type:"bytes",id:1}}},EthereumSignMessage:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},message:{rule:"required",type:"bytes",id:2},encoded_network:{type:"bytes",id:3}}},EthereumMessageSignature:{fields:{signature:{rule:"required",type:"bytes",id:2},address:{rule:"required",type:"string",id:3}}},EthereumVerifyMessage:{fields:{signature:{rule:"required",type:"bytes",id:2},message:{rule:"required",type:"bytes",id:3},address:{rule:"required",type:"string",id:4}}},EthereumSignTypedHash:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},domain_separator_hash:{rule:"required",type:"bytes",id:2},message_hash:{type:"bytes",id:3},encoded_network:{type:"bytes",id:4}}},EthereumTypedDataSignature:{fields:{signature:{rule:"required",type:"bytes",id:1},address:{rule:"required",type:"string",id:2}}},FilecoinGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2},testnet:{type:"bool",id:3}}},FilecoinAddress:{fields:{address:{type:"string",id:1}}},FilecoinSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},raw_tx:{rule:"required",type:"bytes",id:2},testnet:{type:"bool",id:3}}},FilecoinSignedTx:{fields:{signature:{rule:"required",type:"bytes",id:1}}},KaspaGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2},prefix:{type:"string",id:3,options:{default:"kaspa"}},scheme:{type:"string",id:4,options:{default:"schnorr"}},use_tweak:{type:"bool",id:5,options:{default:!0}}}},KaspaAddress:{fields:{address:{rule:"required",type:"string",id:1}}},KaspaSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},raw_message:{rule:"required",type:"bytes",id:2},scheme:{type:"string",id:3,options:{default:"schnorr"}},prefix:{type:"string",id:4,options:{default:"kaspa"}},input_count:{type:"uint32",id:5,options:{default:1}},use_tweak:{type:"bool",id:6,options:{default:!0}}}},KaspaTxInputRequest:{fields:{request_index:{rule:"required",type:"uint32",id:1},signature:{type:"bytes",id:2}}},KaspaTxInputAck:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},raw_message:{rule:"required",type:"bytes",id:2}}},KaspaSignedTx:{fields:{signature:{rule:"required",type:"bytes",id:2}}},LnurlAuth:{fields:{domain:{rule:"required",type:"bytes",id:2},data:{rule:"required",type:"bytes",id:3}}},LnurlAuthResp:{fields:{publickey:{type:"string",id:1},path:{type:"string",id:2},signature:{type:"bytes",id:3}}},BackupType:{values:{Bip39:0,Slip39_Basic:1,Slip39_Advanced:2}},SafetyCheckLevel:{values:{Strict:0,PromptAlways:1,PromptTemporarily:2}},Initialize:{fields:{session_id:{type:"bytes",id:1},_skip_passphrase:{type:"bool",id:2,options:{deprecated:!0}},derive_cardano:{type:"bool",id:3},passphrase_state:{type:"string",id:8e3},is_contains_attach:{type:"bool",id:8001}}},GetFeatures:{fields:{}},UkeyGetFeatures:{fields:{}},UKeyDeviceType:{values:{CLASSIC:0,CLASSIC1S:1,MINI:2,TOUCH:3,PRO:5,PURE:6}},UKeySeType:{values:{THD89:0,SE608A:1}},UKeySEState:{values:{BOOT:0,APP:1}},Features:{fields:{vendor:{type:"string",id:1},major_version:{rule:"required",type:"uint32",id:2},minor_version:{rule:"required",type:"uint32",id:3},patch_version:{rule:"required",type:"uint32",id:4},bootloader_mode:{type:"bool",id:5},device_id:{type:"string",id:6},pin_protection:{type:"bool",id:7},passphrase_protection:{type:"bool",id:8},language:{type:"string",id:9},label:{type:"string",id:10},initialized:{type:"bool",id:12},revision:{type:"bytes",id:13},bootloader_hash:{type:"bytes",id:14},imported:{type:"bool",id:15},unlocked:{type:"bool",id:16},_passphrase_cached:{type:"bool",id:17,options:{deprecated:!0}},firmware_present:{type:"bool",id:18},needs_backup:{type:"bool",id:19},flags:{type:"uint32",id:20},model:{type:"string",id:21},fw_major:{type:"uint32",id:22},fw_minor:{type:"uint32",id:23},fw_patch:{type:"uint32",id:24},fw_vendor:{type:"string",id:25},unfinished_backup:{type:"bool",id:27},no_backup:{type:"bool",id:28},recovery_mode:{type:"bool",id:29},capabilities:{rule:"repeated",type:"Capability",id:30,options:{packed:!1}},backup_type:{type:"BackupType",id:31},sd_card_present:{type:"bool",id:32},sd_protection:{type:"bool",id:33},wipe_code_protection:{type:"bool",id:34},session_id:{type:"bytes",id:35},passphrase_always_on_device:{type:"bool",id:36},safety_checks:{type:"SafetyCheckLevel",id:37},auto_lock_delay_ms:{type:"uint32",id:38},display_rotation:{type:"uint32",id:39},experimental_features:{type:"bool",id:40},busy:{type:"bool",id:41},offset:{type:"uint32",id:500},ble_name:{type:"string",id:501},ble_ver:{type:"string",id:502},ble_enable:{type:"bool",id:503},se_enable:{type:"bool",id:504},se_ver:{type:"string",id:506},backup_only:{type:"bool",id:507},ukey_version:{type:"string",id:508},ukey_serial:{type:"string",id:509},bootloader_version:{type:"string",id:510},serial_no:{type:"string",id:511},spi_flash:{type:"string",id:512},initstates:{type:"uint32",id:513},NFT_voucher:{type:"bytes",id:514},cpu_info:{type:"string",id:515},pre_firmware:{type:"string",id:516},coin_switch:{type:"uint32",id:517},build_id:{type:"bytes",id:518},boardloader_version:{type:"string",id:519},battery_level:{type:"uint32",id:520},ukey_device_type:{type:"UKeyDeviceType",id:600},ukey_se_type:{type:"UKeySeType",id:601},ukey_board_version:{type:"string",id:602},ukey_board_hash:{type:"bytes",id:603},ukey_boot_version:{type:"string",id:604},ukey_boot_hash:{type:"bytes",id:605},ukey_se01_version:{type:"string",id:606},ukey_se01_hash:{type:"bytes",id:607},ukey_se01_build_id:{type:"string",id:608},ukey_firmware_version:{type:"string",id:609},ukey_firmware_hash:{type:"bytes",id:610},ukey_firmware_build_id:{type:"string",id:611},ukey_serial_no:{type:"string",id:612},ukey_boot_build_id:{type:"string",id:613},ukey_ble_name:{type:"string",id:614},ukey_ble_version:{type:"string",id:615},ukey_ble_build_id:{type:"string",id:616},ukey_ble_hash:{type:"bytes",id:617},ukey_se02_version:{type:"string",id:618},ukey_se03_version:{type:"string",id:619},ukey_se04_version:{type:"string",id:620},ukey_se01_state:{type:"UKeySEState",id:621},ukey_se02_state:{type:"UKeySEState",id:622},ukey_se03_state:{type:"UKeySEState",id:623},ukey_se04_state:{type:"UKeySEState",id:624},attach_to_pin_user:{type:"bool",id:625},unlocked_attach_pin:{type:"bool",id:626}},nested:{Capability:{options:{"(has_bitcoin_only_values)":!0},values:{Capability_Bitcoin:1,Capability_Bitcoin_like:2,Capability_Binance:3,Capability_Cardano:4,Capability_Crypto:5,Capability_EOS:6,Capability_Ethereum:7,Capability_Lisk:8,Capability_Monero:9,Capability_NEM:10,Capability_Ripple:11,Capability_Stellar:12,Capability_Tezos:13,Capability_U2F:14,Capability_Shamir:15,Capability_ShamirGroups:16,Capability_PassphraseEntry:17,Capability_EthereumTypedData:1e3,Capability_AttachToPin:8e3}}}},UkeyFeatures:{fields:{ukey_device_type:{type:"UKeyDeviceType",id:1},ukey_board_version:{type:"string",id:2},ukey_boot_version:{type:"string",id:3},ukey_firmware_version:{type:"string",id:4},ukey_board_hash:{type:"bytes",id:5},ukey_boot_hash:{type:"bytes",id:6},ukey_firmware_hash:{type:"bytes",id:7},ukey_board_build_id:{type:"string",id:8},ukey_boot_build_id:{type:"string",id:9},ukey_firmware_build_id:{type:"string",id:10},ukey_serial_no:{type:"string",id:11},ukey_ble_name:{type:"string",id:12},ukey_ble_version:{type:"string",id:13},ukey_ble_build_id:{type:"string",id:14},ukey_ble_hash:{type:"bytes",id:15},ukey_se_type:{type:"UKeySeType",id:16},ukey_se01_state:{type:"UKeySEState",id:17},ukey_se02_state:{type:"UKeySEState",id:18},ukey_se03_state:{type:"UKeySEState",id:19},ukey_se04_state:{type:"UKeySEState",id:20},ukey_se01_version:{type:"string",id:21},ukey_se02_version:{type:"string",id:22},ukey_se03_version:{type:"string",id:23},ukey_se04_version:{type:"string",id:24},ukey_se01_hash:{type:"bytes",id:25},ukey_se02_hash:{type:"bytes",id:26},ukey_se03_hash:{type:"bytes",id:27},ukey_se04_hash:{type:"bytes",id:28},ukey_se01_build_id:{type:"string",id:29},ukey_se02_build_id:{type:"string",id:30},ukey_se03_build_id:{type:"string",id:31},ukey_se04_build_id:{type:"string",id:32},ukey_se01_boot_version:{type:"string",id:33},ukey_se02_boot_version:{type:"string",id:34},ukey_se03_boot_version:{type:"string",id:35},ukey_se04_boot_version:{type:"string",id:36},ukey_se01_boot_hash:{type:"bytes",id:37},ukey_se02_boot_hash:{type:"bytes",id:38},ukey_se03_boot_hash:{type:"bytes",id:39},ukey_se04_boot_hash:{type:"bytes",id:40},ukey_se01_boot_build_id:{type:"string",id:41},ukey_se02_boot_build_id:{type:"string",id:42},ukey_se03_boot_build_id:{type:"string",id:43},ukey_se04_boot_build_id:{type:"string",id:44}}},LockDevice:{fields:{}},EndSession:{fields:{}},ApplySettings:{fields:{language:{type:"string",id:1},label:{type:"string",id:2},use_passphrase:{type:"bool",id:3},homescreen:{type:"bytes",id:4},_passphrase_source:{type:"uint32",id:5,options:{deprecated:!0}},auto_lock_delay_ms:{type:"uint32",id:6},display_rotation:{type:"uint32",id:7},passphrase_always_on_device:{type:"bool",id:8},safety_checks:{type:"SafetyCheckLevel",id:9},experimental_features:{type:"bool",id:10},use_ble:{type:"bool",id:100},use_se:{type:"bool",id:101},is_bixinapp:{type:"bool",id:102},fastpay_pin:{type:"bool",id:103},fastpay_confirm:{type:"bool",id:104},fastpay_money_limit:{type:"uint64",id:105},fastpay_times:{type:"uint32",id:106}},nested:{ExportType:{values:{SeedEncExportType_NO:0,SeedEncExportType_YES:1,MnemonicPlainExportType_YES:2}}}},ApplyFlags:{fields:{flags:{rule:"required",type:"uint32",id:1}}},ChangePin:{fields:{remove:{type:"bool",id:1}}},ChangeWipeCode:{fields:{remove:{type:"bool",id:1}}},SdProtect:{fields:{operation:{rule:"required",type:"SdProtectOperationType",id:1}},nested:{SdProtectOperationType:{values:{DISABLE:0,ENABLE:1,REFRESH:2}}}},Ping:{fields:{message:{type:"string",id:1,options:{default:""}},button_protection:{type:"bool",id:2}}},Cancel:{fields:{}},GetEntropy:{fields:{size:{rule:"required",type:"uint32",id:1}}},Entropy:{fields:{entropy:{rule:"required",type:"bytes",id:1}}},WipeDevice:{fields:{}},LoadDevice:{fields:{mnemonics:{rule:"repeated",type:"string",id:1},pin:{type:"string",id:3},passphrase_protection:{type:"bool",id:4},language:{type:"string",id:5,options:{default:"en-US"}},label:{type:"string",id:6},skip_checksum:{type:"bool",id:7},u2f_counter:{type:"uint32",id:8},needs_backup:{type:"bool",id:9},no_backup:{type:"bool",id:10}}},ResetDevice:{fields:{display_random:{type:"bool",id:1},strength:{type:"uint32",id:2,options:{default:256}},passphrase_protection:{type:"bool",id:3},pin_protection:{type:"bool",id:4},language:{type:"string",id:5,options:{default:"en-US"}},label:{type:"string",id:6},u2f_counter:{type:"uint32",id:7},skip_backup:{type:"bool",id:8},no_backup:{type:"bool",id:9},backup_type:{type:"BackupType",id:10,options:{default:"Bip39"}}}},BackupDevice:{fields:{}},EntropyRequest:{fields:{}},EntropyAck:{fields:{entropy:{rule:"required",type:"bytes",id:1}}},RecoveryDevice:{fields:{word_count:{type:"uint32",id:1},passphrase_protection:{type:"bool",id:2},pin_protection:{type:"bool",id:3},language:{type:"string",id:4},label:{type:"string",id:5},enforce_wordlist:{type:"bool",id:6},type:{type:"RecoveryDeviceType",id:8},u2f_counter:{type:"uint32",id:9},dry_run:{type:"bool",id:10}},nested:{RecoveryDeviceType:{values:{RecoveryDeviceType_ScrambledWords:0,RecoveryDeviceType_Matrix:1}}}},WordRequest:{fields:{type:{rule:"required",type:"WordRequestType",id:1}},nested:{WordRequestType:{values:{WordRequestType_Plain:0,WordRequestType_Matrix9:1,WordRequestType_Matrix6:2}}}},WordAck:{fields:{word:{rule:"required",type:"string",id:1}}},SetU2FCounter:{fields:{u2f_counter:{rule:"required",type:"uint32",id:1}}},GetNextU2FCounter:{fields:{}},NextU2FCounter:{fields:{u2f_counter:{rule:"required",type:"uint32",id:1}}},DoPreauthorized:{fields:{}},PreauthorizedRequest:{fields:{}},CancelAuthorization:{fields:{}},BixinSeedOperate:{fields:{type:{rule:"required",type:"SeedRequestType",id:1},seed_importData:{type:"bytes",id:2}},nested:{SeedRequestType:{values:{SeedRequestType_Gen:0,SeedRequestType_EncExport:1,SeedRequestType_EncImport:2}}}},BixinMessageSE:{fields:{inputmessage:{rule:"required",type:"bytes",id:1}}},BixinOutMessageSE:{fields:{outmessage:{type:"bytes",id:1}}},DeviceBackToBoot:{fields:{}},BixinBackupRequest:{fields:{}},BixinBackupAck:{fields:{data:{rule:"required",type:"bytes",id:1}}},BixinRestoreRequest:{fields:{data:{rule:"required",type:"bytes",id:1},language:{type:"string",id:2},label:{type:"string",id:3},passphrase_protection:{type:"bool",id:4}}},BixinRestoreAck:{fields:{data:{rule:"required",type:"bytes",id:1}}},BixinVerifyDeviceRequest:{fields:{data:{rule:"required",type:"bytes",id:1}}},BixinVerifyDeviceAck:{fields:{cert:{rule:"required",type:"bytes",id:1},signature:{rule:"required",type:"bytes",id:2}}},BixinWhiteListRequest:{fields:{type:{rule:"required",type:"WL_OperationType",id:1},addr_in:{type:"string",id:2}},nested:{WL_OperationType:{values:{WL_OperationType_Add:0,WL_OperationType_Delete:1,WL_OperationType_Inquire:2}}}},BixinWhiteListAck:{fields:{address:{rule:"repeated",type:"string",id:1}}},BixinLoadDevice:{fields:{mnemonics:{rule:"required",type:"string",id:1},language:{type:"string",id:5,options:{default:"en-US"}},label:{type:"string",id:6},skip_checksum:{type:"bool",id:7}}},BixinBackupDevice:{fields:{}},BixinBackupDeviceAck:{fields:{mnemonics:{rule:"required",type:"string",id:1}}},DeviceInfoSettings:{fields:{serial_no:{type:"string",id:1},cpu_info:{type:"string",id:2},pre_firmware:{type:"string",id:3}}},GetDeviceInfo:{fields:{}},DeviceInfo:{fields:{serial_no:{type:"string",id:1},spiFlash_info:{type:"string",id:2},SE_info:{type:"string",id:3},NFT_voucher:{type:"bytes",id:4},cpu_info:{type:"string",id:5},pre_firmware:{type:"string",id:6}}},ReadSEPublicKey:{fields:{}},SEPublicKey:{fields:{public_key:{rule:"required",type:"bytes",id:1}}},WriteSEPublicCert:{fields:{public_cert:{rule:"required",type:"bytes",id:1}}},ReadSEPublicCert:{fields:{}},SEPublicCert:{fields:{public_cert:{rule:"required",type:"bytes",id:1}}},SpiFlashWrite:{fields:{address:{rule:"required",type:"uint32",id:1},data:{rule:"required",type:"bytes",id:2}}},SpiFlashRead:{fields:{address:{rule:"required",type:"uint32",id:1},len:{rule:"required",type:"uint32",id:2}}},SpiFlashData:{fields:{data:{rule:"required",type:"bytes",id:1}}},SESignMessage:{fields:{message:{rule:"required",type:"bytes",id:1}}},SEMessageSignature:{fields:{signature:{rule:"required",type:"bytes",id:1}}},ResourceUpload:{fields:{extension:{rule:"required",type:"string",id:1},data_length:{rule:"required",type:"uint32",id:2},res_type:{rule:"required",type:"ResourceType",id:3},nft_meta_data:{type:"bytes",id:4},zoom_data_length:{rule:"required",type:"uint32",id:5},file_name_no_ext:{type:"string",id:6}},nested:{ResourceType:{values:{WallPaper:0,Nft:1}}}},ZoomRequest:{fields:{offset:{type:"uint32",id:1},data_length:{rule:"required",type:"uint32",id:2}}},ResourceRequest:{fields:{offset:{type:"uint32",id:1},data_length:{rule:"required",type:"uint32",id:2}}},ResourceAck:{fields:{data_chunk:{rule:"required",type:"bytes",id:1},hash:{type:"bytes",id:2}}},ResourceUpdate:{fields:{file_name:{rule:"required",type:"string",id:1},data_length:{rule:"required",type:"uint32",id:2},initial_data_chunk:{rule:"required",type:"bytes",id:3},hash:{type:"bytes",id:4}}},NFTWriteInfo:{fields:{index:{rule:"required",type:"uint32",id:1},width:{rule:"required",type:"uint32",id:2},height:{rule:"required",type:"uint32",id:3},name_zh:{type:"string",id:4},name_en:{type:"string",id:5}}},NFTWriteData:{fields:{index:{rule:"required",type:"uint32",id:1},data:{rule:"required",type:"bytes",id:2},offset:{rule:"required",type:"uint32",id:3}}},RebootToBootloader:{fields:{}},RebootToBoardloader:{fields:{}},ListResDir:{fields:{path:{rule:"required",type:"string",id:1}}},FileInfoList:{fields:{files:{rule:"repeated",type:"FileInfo",id:1}},nested:{FileInfo:{fields:{name:{rule:"required",type:"string",id:1},size:{rule:"required",type:"uint64",id:2}}}}},DeviceEraseSector:{fields:{sector:{rule:"required",type:"uint32",id:1}}},UnLockDevice:{fields:{}},UnLockDeviceResponse:{fields:{unlocked:{type:"bool",id:1},unlocked_attach_pin:{type:"bool",id:2},passphrase_protection:{type:"bool",id:3}}},GetPassphraseState:{fields:{passphrase_state:{type:"string",id:1}}},PassphraseState:{fields:{passphrase_state:{type:"string",id:1},session_id:{type:"bytes",id:2},unlocked_attach_pin:{type:"bool",id:3}}},MoneroTransactionSourceEntry:{fields:{outputs:{rule:"repeated",type:"MoneroOutputEntry",id:1},real_output:{type:"uint64",id:2},real_out_tx_key:{type:"bytes",id:3},real_out_additional_tx_keys:{rule:"repeated",type:"bytes",id:4},real_output_in_tx_index:{type:"uint64",id:5},amount:{type:"uint64",id:6},rct:{type:"bool",id:7},mask:{type:"bytes",id:8},multisig_kLRki:{type:"MoneroMultisigKLRki",id:9},subaddr_minor:{type:"uint32",id:10}},nested:{MoneroOutputEntry:{fields:{idx:{type:"uint64",id:1},key:{type:"MoneroRctKeyPublic",id:2}},nested:{MoneroRctKeyPublic:{fields:{dest:{type:"bytes",id:1},commitment:{type:"bytes",id:2}}}}},MoneroMultisigKLRki:{fields:{K:{type:"bytes",id:1},L:{type:"bytes",id:2},R:{type:"bytes",id:3},ki:{type:"bytes",id:4}}}}},MoneroTransactionDestinationEntry:{fields:{amount:{type:"uint64",id:1},addr:{type:"MoneroAccountPublicAddress",id:2},is_subaddress:{type:"bool",id:3},original:{type:"bytes",id:4},is_integrated:{type:"bool",id:5}},nested:{MoneroAccountPublicAddress:{fields:{spend_public_key:{type:"bytes",id:1},view_public_key:{type:"bytes",id:2}}}}},MoneroTransactionRsigData:{fields:{rsig_type:{type:"uint32",id:1},offload_type:{type:"uint32",id:2},grouping:{rule:"repeated",type:"uint64",id:3,options:{packed:!1}},mask:{type:"bytes",id:4},rsig:{type:"bytes",id:5},rsig_parts:{rule:"repeated",type:"bytes",id:6},bp_version:{type:"uint32",id:7}}},MoneroGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2},network_type:{type:"uint32",id:3},account:{type:"uint32",id:4},minor:{type:"uint32",id:5},payment_id:{type:"bytes",id:6}}},MoneroAddress:{fields:{address:{type:"bytes",id:1}}},MoneroGetWatchKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},network_type:{type:"uint32",id:2}}},MoneroWatchKey:{fields:{watch_key:{type:"bytes",id:1},address:{type:"bytes",id:2}}},MoneroTransactionInitRequest:{fields:{version:{type:"uint32",id:1},address_n:{rule:"repeated",type:"uint32",id:2,options:{packed:!1}},network_type:{type:"uint32",id:3},tsx_data:{type:"MoneroTransactionData",id:4}},nested:{MoneroTransactionData:{fields:{version:{type:"uint32",id:1},payment_id:{type:"bytes",id:2},unlock_time:{type:"uint64",id:3},outputs:{rule:"repeated",type:"MoneroTransactionDestinationEntry",id:4},change_dts:{type:"MoneroTransactionDestinationEntry",id:5},num_inputs:{type:"uint32",id:6},mixin:{type:"uint32",id:7},fee:{type:"uint64",id:8},account:{type:"uint32",id:9},minor_indices:{rule:"repeated",type:"uint32",id:10,options:{packed:!1}},rsig_data:{type:"MoneroTransactionRsigData",id:11},integrated_indices:{rule:"repeated",type:"uint32",id:12,options:{packed:!1}},client_version:{type:"uint32",id:13},hard_fork:{type:"uint32",id:14},monero_version:{type:"bytes",id:15}}}}},MoneroTransactionInitAck:{fields:{hmacs:{rule:"repeated",type:"bytes",id:1},rsig_data:{type:"MoneroTransactionRsigData",id:2}}},MoneroTransactionSetInputRequest:{fields:{src_entr:{type:"MoneroTransactionSourceEntry",id:1}}},MoneroTransactionSetInputAck:{fields:{vini:{type:"bytes",id:1},vini_hmac:{type:"bytes",id:2},pseudo_out:{type:"bytes",id:3},pseudo_out_hmac:{type:"bytes",id:4},pseudo_out_alpha:{type:"bytes",id:5},spend_key:{type:"bytes",id:6}}},MoneroTransactionInputsPermutationRequest:{fields:{perm:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}}}},MoneroTransactionInputsPermutationAck:{fields:{}},MoneroTransactionInputViniRequest:{fields:{src_entr:{type:"MoneroTransactionSourceEntry",id:1},vini:{type:"bytes",id:2},vini_hmac:{type:"bytes",id:3},pseudo_out:{type:"bytes",id:4},pseudo_out_hmac:{type:"bytes",id:5},orig_idx:{type:"uint32",id:6}}},MoneroTransactionInputViniAck:{fields:{}},MoneroTransactionAllInputsSetRequest:{fields:{}},MoneroTransactionAllInputsSetAck:{fields:{rsig_data:{type:"MoneroTransactionRsigData",id:1}}},MoneroTransactionSetOutputRequest:{fields:{dst_entr:{type:"MoneroTransactionDestinationEntry",id:1},dst_entr_hmac:{type:"bytes",id:2},rsig_data:{type:"MoneroTransactionRsigData",id:3},is_offloaded_bp:{type:"bool",id:4}}},MoneroTransactionSetOutputAck:{fields:{tx_out:{type:"bytes",id:1},vouti_hmac:{type:"bytes",id:2},rsig_data:{type:"MoneroTransactionRsigData",id:3},out_pk:{type:"bytes",id:4},ecdh_info:{type:"bytes",id:5}}},MoneroTransactionAllOutSetRequest:{fields:{rsig_data:{type:"MoneroTransactionRsigData",id:1}}},MoneroTransactionAllOutSetAck:{fields:{extra:{type:"bytes",id:1},tx_prefix_hash:{type:"bytes",id:2},rv:{type:"MoneroRingCtSig",id:4},full_message_hash:{type:"bytes",id:5}},nested:{MoneroRingCtSig:{fields:{txn_fee:{type:"uint64",id:1},message:{type:"bytes",id:2},rv_type:{type:"uint32",id:3}}}}},MoneroTransactionSignInputRequest:{fields:{src_entr:{type:"MoneroTransactionSourceEntry",id:1},vini:{type:"bytes",id:2},vini_hmac:{type:"bytes",id:3},pseudo_out:{type:"bytes",id:4},pseudo_out_hmac:{type:"bytes",id:5},pseudo_out_alpha:{type:"bytes",id:6},spend_key:{type:"bytes",id:7},orig_idx:{type:"uint32",id:8}}},MoneroTransactionSignInputAck:{fields:{signature:{type:"bytes",id:1},pseudo_out:{type:"bytes",id:2}}},MoneroTransactionFinalRequest:{fields:{}},MoneroTransactionFinalAck:{fields:{cout_key:{type:"bytes",id:1},salt:{type:"bytes",id:2},rand_mult:{type:"bytes",id:3},tx_enc_keys:{type:"bytes",id:4},opening_key:{type:"bytes",id:5}}},MoneroKeyImageExportInitRequest:{fields:{num:{type:"uint64",id:1},hash:{type:"bytes",id:2},address_n:{rule:"repeated",type:"uint32",id:3,options:{packed:!1}},network_type:{type:"uint32",id:4},subs:{rule:"repeated",type:"MoneroSubAddressIndicesList",id:5}},nested:{MoneroSubAddressIndicesList:{fields:{account:{type:"uint32",id:1},minor_indices:{rule:"repeated",type:"uint32",id:2,options:{packed:!1}}}}}},MoneroKeyImageExportInitAck:{fields:{}},MoneroKeyImageSyncStepRequest:{fields:{tdis:{rule:"repeated",type:"MoneroTransferDetails",id:1}},nested:{MoneroTransferDetails:{fields:{out_key:{type:"bytes",id:1},tx_pub_key:{type:"bytes",id:2},additional_tx_pub_keys:{rule:"repeated",type:"bytes",id:3},internal_output_index:{type:"uint64",id:4},sub_addr_major:{type:"uint32",id:5},sub_addr_minor:{type:"uint32",id:6}}}}},MoneroKeyImageSyncStepAck:{fields:{kis:{rule:"repeated",type:"MoneroExportedKeyImage",id:1}},nested:{MoneroExportedKeyImage:{fields:{iv:{type:"bytes",id:1},blob:{type:"bytes",id:3}}}}},MoneroKeyImageSyncFinalRequest:{fields:{}},MoneroKeyImageSyncFinalAck:{fields:{enc_key:{type:"bytes",id:1}}},MoneroGetTxKeyRequest:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},network_type:{type:"uint32",id:2},salt1:{type:"bytes",id:3},salt2:{type:"bytes",id:4},tx_enc_keys:{type:"bytes",id:5},tx_prefix_hash:{type:"bytes",id:6},reason:{type:"uint32",id:7},view_public_key:{type:"bytes",id:8}}},MoneroGetTxKeyAck:{fields:{salt:{type:"bytes",id:1},tx_keys:{type:"bytes",id:2},tx_derivations:{type:"bytes",id:3}}},MoneroLiveRefreshStartRequest:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},network_type:{type:"uint32",id:2}}},MoneroLiveRefreshStartAck:{fields:{}},MoneroLiveRefreshStepRequest:{fields:{out_key:{type:"bytes",id:1},recv_deriv:{type:"bytes",id:2},real_out_idx:{type:"uint64",id:3},sub_addr_major:{type:"uint32",id:4},sub_addr_minor:{type:"uint32",id:5}}},MoneroLiveRefreshStepAck:{fields:{salt:{type:"bytes",id:1},key_image:{type:"bytes",id:2}}},MoneroLiveRefreshFinalRequest:{fields:{}},MoneroLiveRefreshFinalAck:{fields:{}},DebugMoneroDiagRequest:{fields:{ins:{type:"uint64",id:1},p1:{type:"uint64",id:2},p2:{type:"uint64",id:3},pd:{rule:"repeated",type:"uint64",id:4,options:{packed:!1}},data1:{type:"bytes",id:5},data2:{type:"bytes",id:6}}},DebugMoneroDiagAck:{fields:{ins:{type:"uint64",id:1},p1:{type:"uint64",id:2},p2:{type:"uint64",id:3},pd:{rule:"repeated",type:"uint64",id:4,options:{packed:!1}},data1:{type:"bytes",id:5},data2:{type:"bytes",id:6}}},NearGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},NearAddress:{fields:{address:{type:"string",id:1}}},NearSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},raw_tx:{rule:"required",type:"bytes",id:2}}},NearSignedTx:{fields:{signature:{rule:"required",type:"bytes",id:1}}},NEMGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},network:{type:"uint32",id:2},show_display:{type:"bool",id:3}}},NEMAddress:{fields:{address:{rule:"required",type:"string",id:1}}},NEMSignTx:{fields:{transaction:{type:"NEMTransactionCommon",id:1},multisig:{type:"NEMTransactionCommon",id:2},transfer:{type:"NEMTransfer",id:3},cosigning:{type:"bool",id:4},provision_namespace:{type:"NEMProvisionNamespace",id:5},mosaic_creation:{type:"NEMMosaicCreation",id:6},supply_change:{type:"NEMMosaicSupplyChange",id:7},aggregate_modification:{type:"NEMAggregateModification",id:8},importance_transfer:{type:"NEMImportanceTransfer",id:9}},nested:{NEMTransactionCommon:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},network:{type:"uint32",id:2},timestamp:{type:"uint32",id:3},fee:{type:"uint64",id:4},deadline:{type:"uint32",id:5},signer:{type:"bytes",id:6}}},NEMTransfer:{fields:{recipient:{type:"string",id:1},amount:{type:"uint64",id:2},payload:{type:"bytes",id:3},public_key:{type:"bytes",id:4},mosaics:{rule:"repeated",type:"NEMMosaic",id:5}},nested:{NEMMosaic:{fields:{namespace:{type:"string",id:1},mosaic:{type:"string",id:2},quantity:{type:"uint64",id:3}}}}},NEMProvisionNamespace:{fields:{namespace:{type:"string",id:1},parent:{type:"string",id:2},sink:{type:"string",id:3},fee:{type:"uint64",id:4}}},NEMMosaicCreation:{fields:{definition:{type:"NEMMosaicDefinition",id:1},sink:{type:"string",id:2},fee:{type:"uint64",id:3}},nested:{NEMMosaicDefinition:{fields:{name:{type:"string",id:1},ticker:{type:"string",id:2},namespace:{type:"string",id:3},mosaic:{type:"string",id:4},divisibility:{type:"uint32",id:5},levy:{type:"NEMMosaicLevy",id:6},fee:{type:"uint64",id:7},levy_address:{type:"string",id:8},levy_namespace:{type:"string",id:9},levy_mosaic:{type:"string",id:10},supply:{type:"uint64",id:11},mutable_supply:{type:"bool",id:12},transferable:{type:"bool",id:13},description:{type:"string",id:14},networks:{rule:"repeated",type:"uint32",id:15,options:{packed:!1}}},nested:{NEMMosaicLevy:{values:{MosaicLevy_Absolute:1,MosaicLevy_Percentile:2}}}}}},NEMMosaicSupplyChange:{fields:{namespace:{type:"string",id:1},mosaic:{type:"string",id:2},type:{type:"NEMSupplyChangeType",id:3},delta:{type:"uint64",id:4}},nested:{NEMSupplyChangeType:{values:{SupplyChange_Increase:1,SupplyChange_Decrease:2}}}},NEMAggregateModification:{fields:{modifications:{rule:"repeated",type:"NEMCosignatoryModification",id:1},relative_change:{type:"sint32",id:2}},nested:{NEMCosignatoryModification:{fields:{type:{type:"NEMModificationType",id:1},public_key:{type:"bytes",id:2}},nested:{NEMModificationType:{values:{CosignatoryModification_Add:1,CosignatoryModification_Delete:2}}}}}},NEMImportanceTransfer:{fields:{mode:{type:"NEMImportanceTransferMode",id:1},public_key:{type:"bytes",id:2}},nested:{NEMImportanceTransferMode:{values:{ImportanceTransfer_Activate:1,ImportanceTransfer_Deactivate:2}}}}}},NEMSignedTx:{fields:{data:{rule:"required",type:"bytes",id:1},signature:{rule:"required",type:"bytes",id:2}}},NEMDecryptMessage:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},network:{type:"uint32",id:2},public_key:{type:"bytes",id:3},payload:{type:"bytes",id:4}}},NEMDecryptedMessage:{fields:{payload:{rule:"required",type:"bytes",id:1}}},NeoGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},NeoAddress:{fields:{address:{type:"string",id:1},public_key:{type:"bytes",id:2}}},NeoSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},raw_tx:{rule:"required",type:"bytes",id:2},network_magic:{type:"uint32",id:3,options:{default:860833102}}}},NeoSignedTx:{fields:{public_key:{rule:"required",type:"bytes",id:1},signature:{rule:"required",type:"bytes",id:2}}},NervosGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},network:{rule:"required",type:"string",id:2},show_display:{type:"bool",id:3}}},NervosAddress:{fields:{address:{rule:"required",type:"string",id:1}}},NervosSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},data_initial_chunk:{rule:"required",type:"bytes",id:2},witness_buffer:{rule:"required",type:"bytes",id:3},network:{rule:"required",type:"string",id:4},data_length:{type:"uint32",id:5}}},NervosSignedTx:{fields:{signature:{rule:"required",type:"bytes",id:1},address:{rule:"required",type:"string",id:2}}},NervosTxRequest:{fields:{data_length:{type:"uint32",id:1},public_key:{type:"bytes",id:2},signature:{type:"bytes",id:3}}},NervosTxAck:{fields:{data_chunk:{rule:"required",type:"bytes",id:1}}},NexaGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2},prefix:{type:"string",id:3,options:{default:"nexa"}}}},NexaAddress:{fields:{address:{rule:"required",type:"string",id:1},public_key:{rule:"required",type:"bytes",id:2}}},NexaSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},raw_message:{rule:"required",type:"bytes",id:2},prefix:{type:"string",id:3,options:{default:"nexa"}},input_count:{type:"uint32",id:4,options:{default:1}}}},NexaTxInputRequest:{fields:{request_index:{rule:"required",type:"uint32",id:1},signature:{type:"bytes",id:2}}},NexaTxInputAck:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},raw_message:{rule:"required",type:"bytes",id:2}}},NexaSignedTx:{fields:{signature:{rule:"required",type:"bytes",id:1}}},NostrGetPublicKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},NostrPublicKey:{fields:{publickey:{type:"string",id:1},npub:{type:"string",id:2}}},NostrSignEvent:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},event:{rule:"required",type:"bytes",id:2}}},NostrSignedEvent:{fields:{event:{rule:"required",type:"bytes",id:1}}},NostrSignSchnorr:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},hash:{rule:"required",type:"string",id:2}}},NostrSignedSchnorr:{fields:{signature:{rule:"required",type:"bytes",id:1}}},NostrEncryptMessage:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},pubkey:{rule:"required",type:"string",id:2},msg:{rule:"required",type:"string",id:3},show_display:{type:"bool",id:4}}},NostrEncryptedMessage:{fields:{msg:{rule:"required",type:"string",id:1}}},NostrDecryptMessage:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},pubkey:{rule:"required",type:"string",id:2},msg:{rule:"required",type:"string",id:3},show_display:{type:"bool",id:4}}},NostrDecryptedMessage:{fields:{msg:{rule:"required",type:"string",id:1}}},PolkadotGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},prefix:{rule:"required",type:"uint32",id:2},network:{rule:"required",type:"string",id:3},show_display:{type:"bool",id:4}}},PolkadotAddress:{fields:{address:{type:"string",id:1},public_key:{type:"string",id:2}}},PolkadotSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},raw_tx:{rule:"required",type:"bytes",id:2},network:{rule:"required",type:"string",id:3}}},PolkadotSignedTx:{fields:{signature:{rule:"required",type:"bytes",id:1}}},RippleGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},RippleAddress:{fields:{address:{rule:"required",type:"string",id:1}}},RippleSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},fee:{type:"uint64",id:2},flags:{type:"uint32",id:3},sequence:{type:"uint32",id:4},last_ledger_sequence:{type:"uint32",id:5},payment:{type:"RipplePayment",id:6}},nested:{RipplePayment:{fields:{amount:{rule:"required",type:"uint64",id:1},destination:{rule:"required",type:"string",id:2},destination_tag:{type:"uint32",id:3}}}}},RippleSignedTx:{fields:{signature:{rule:"required",type:"bytes",id:1},serialized_tx:{rule:"required",type:"bytes",id:2}}},ScdoGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},ScdoAddress:{fields:{address:{rule:"required",type:"string",id:1}}},ScdoSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},nonce:{rule:"required",type:"bytes",id:2},gas_price:{rule:"required",type:"bytes",id:3},gas_limit:{rule:"required",type:"bytes",id:4},to:{rule:"required",type:"string",id:5},value:{rule:"required",type:"bytes",id:6},timestamp:{type:"bytes",id:7},data_initial_chunk:{type:"bytes",id:8,options:{default:""}},data_length:{type:"uint32",id:9,options:{default:0}},tx_type:{type:"uint32",id:10,options:{default:0}}}},ScdoSignedTx:{fields:{data_length:{type:"uint32",id:1},signature:{type:"bytes",id:2}}},ScdoTxAck:{fields:{data_chunk:{type:"bytes",id:1}}},ScdoSignMessage:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},message:{type:"bytes",id:2}}},ScdoSignedMessage:{fields:{signature:{type:"bytes",id:1},address:{type:"string",id:2}}},SolanaGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},SolanaAddress:{fields:{address:{type:"string",id:1}}},SolanaSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},raw_tx:{rule:"required",type:"bytes",id:2}}},SolanaSignedTx:{fields:{signature:{type:"bytes",id:1}}},SolanaOffChainMessageVersion:{values:{MESSAGE_VERSION_0:0}},SolanaOffChainMessageFormat:{values:{V0_RESTRICTED_ASCII:0,V0_LIMITED_UTF8:1}},SolanaSignOffChainMessage:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},message:{rule:"required",type:"bytes",id:2},message_version:{type:"SolanaOffChainMessageVersion",id:3,options:{default:"MESSAGE_VERSION_0"}},message_format:{type:"SolanaOffChainMessageFormat",id:4,options:{default:"V0_RESTRICTED_ASCII"}},application_domain:{type:"bytes",id:5}}},SolanaSignUnsafeMessage:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},message:{rule:"required",type:"bytes",id:2}}},SolanaMessageSignature:{fields:{signature:{rule:"required",type:"bytes",id:1},public_key:{type:"bytes",id:2}}},StarcoinGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},StarcoinAddress:{fields:{address:{type:"string",id:1}}},StarcoinGetPublicKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},StarcoinPublicKey:{fields:{public_key:{rule:"required",type:"bytes",id:1}}},StarcoinSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},raw_tx:{type:"bytes",id:2}}},StarcoinSignedTx:{fields:{public_key:{rule:"required",type:"bytes",id:1},signature:{rule:"required",type:"bytes",id:2}}},StarcoinSignMessage:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},message:{type:"bytes",id:2}}},StarcoinMessageSignature:{fields:{public_key:{rule:"required",type:"bytes",id:1},signature:{rule:"required",type:"bytes",id:2}}},StarcoinVerifyMessage:{fields:{public_key:{type:"bytes",id:1},signature:{type:"bytes",id:2},message:{type:"bytes",id:3}}},StellarAssetType:{values:{NATIVE:0,ALPHANUM4:1,ALPHANUM12:2}},StellarAsset:{fields:{type:{rule:"required",type:"StellarAssetType",id:1},code:{type:"string",id:2},issuer:{type:"string",id:3}}},StellarGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},StellarAddress:{fields:{address:{rule:"required",type:"string",id:1}}},StellarSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:2,options:{packed:!1}},network_passphrase:{rule:"required",type:"string",id:3},source_account:{rule:"required",type:"string",id:4},fee:{rule:"required",type:"uint32",id:5},sequence_number:{rule:"required",type:"uint64",id:6},timebounds_start:{rule:"required",type:"uint32",id:8},timebounds_end:{rule:"required",type:"uint32",id:9},memo_type:{rule:"required",type:"StellarMemoType",id:10},memo_text:{type:"string",id:11},memo_id:{type:"uint64",id:12},memo_hash:{type:"bytes",id:13},num_operations:{rule:"required",type:"uint32",id:14}},nested:{StellarMemoType:{values:{NONE:0,TEXT:1,ID:2,HASH:3,RETURN:4}}}},StellarTxOpRequest:{fields:{}},StellarPaymentOp:{fields:{source_account:{type:"string",id:1},destination_account:{rule:"required",type:"string",id:2},asset:{rule:"required",type:"StellarAsset",id:3},amount:{rule:"required",type:"sint64",id:4}}},StellarCreateAccountOp:{fields:{source_account:{type:"string",id:1},new_account:{rule:"required",type:"string",id:2},starting_balance:{rule:"required",type:"sint64",id:3}}},StellarPathPaymentStrictReceiveOp:{fields:{source_account:{type:"string",id:1},send_asset:{rule:"required",type:"StellarAsset",id:2},send_max:{rule:"required",type:"sint64",id:3},destination_account:{rule:"required",type:"string",id:4},destination_asset:{rule:"required",type:"StellarAsset",id:5},destination_amount:{rule:"required",type:"sint64",id:6},paths:{rule:"repeated",type:"StellarAsset",id:7}}},StellarPathPaymentStrictSendOp:{fields:{source_account:{type:"string",id:1},send_asset:{rule:"required",type:"StellarAsset",id:2},send_amount:{rule:"required",type:"sint64",id:3},destination_account:{rule:"required",type:"string",id:4},destination_asset:{rule:"required",type:"StellarAsset",id:5},destination_min:{rule:"required",type:"sint64",id:6},paths:{rule:"repeated",type:"StellarAsset",id:7}}},StellarManageSellOfferOp:{fields:{source_account:{type:"string",id:1},selling_asset:{rule:"required",type:"StellarAsset",id:2},buying_asset:{rule:"required",type:"StellarAsset",id:3},amount:{rule:"required",type:"sint64",id:4},price_n:{rule:"required",type:"uint32",id:5},price_d:{rule:"required",type:"uint32",id:6},offer_id:{rule:"required",type:"uint64",id:7}}},StellarManageBuyOfferOp:{fields:{source_account:{type:"string",id:1},selling_asset:{rule:"required",type:"StellarAsset",id:2},buying_asset:{rule:"required",type:"StellarAsset",id:3},amount:{rule:"required",type:"sint64",id:4},price_n:{rule:"required",type:"uint32",id:5},price_d:{rule:"required",type:"uint32",id:6},offer_id:{rule:"required",type:"uint64",id:7}}},StellarCreatePassiveSellOfferOp:{fields:{source_account:{type:"string",id:1},selling_asset:{rule:"required",type:"StellarAsset",id:2},buying_asset:{rule:"required",type:"StellarAsset",id:3},amount:{rule:"required",type:"sint64",id:4},price_n:{rule:"required",type:"uint32",id:5},price_d:{rule:"required",type:"uint32",id:6}}},StellarSetOptionsOp:{fields:{source_account:{type:"string",id:1},inflation_destination_account:{type:"string",id:2},clear_flags:{type:"uint32",id:3},set_flags:{type:"uint32",id:4},master_weight:{type:"uint32",id:5},low_threshold:{type:"uint32",id:6},medium_threshold:{type:"uint32",id:7},high_threshold:{type:"uint32",id:8},home_domain:{type:"string",id:9},signer_type:{type:"StellarSignerType",id:10},signer_key:{type:"bytes",id:11},signer_weight:{type:"uint32",id:12}},nested:{StellarSignerType:{values:{ACCOUNT:0,PRE_AUTH:1,HASH:2}}}},StellarChangeTrustOp:{fields:{source_account:{type:"string",id:1},asset:{rule:"required",type:"StellarAsset",id:2},limit:{rule:"required",type:"uint64",id:3}}},StellarAllowTrustOp:{fields:{source_account:{type:"string",id:1},trusted_account:{rule:"required",type:"string",id:2},asset_type:{rule:"required",type:"StellarAssetType",id:3},asset_code:{type:"string",id:4},is_authorized:{rule:"required",type:"bool",id:5}}},StellarAccountMergeOp:{fields:{source_account:{type:"string",id:1},destination_account:{rule:"required",type:"string",id:2}}},StellarManageDataOp:{fields:{source_account:{type:"string",id:1},key:{rule:"required",type:"string",id:2},value:{type:"bytes",id:3}}},StellarBumpSequenceOp:{fields:{source_account:{type:"string",id:1},bump_to:{rule:"required",type:"uint64",id:2}}},StellarSignedTx:{fields:{public_key:{rule:"required",type:"bytes",id:1},signature:{rule:"required",type:"bytes",id:2}}},SuiGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},SuiAddress:{fields:{address:{type:"string",id:1}}},SuiSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},raw_tx:{rule:"required",type:"bytes",id:2},data_initial_chunk:{type:"bytes",id:3,options:{default:""}},data_length:{type:"uint32",id:4}}},SuiSignedTx:{fields:{public_key:{rule:"required",type:"bytes",id:1},signature:{rule:"required",type:"bytes",id:2}}},SuiTxRequest:{fields:{data_length:{type:"uint32",id:1},public_key:{type:"bytes",id:2},signature:{type:"bytes",id:3}}},SuiTxAck:{fields:{data_chunk:{rule:"required",type:"bytes",id:1}}},SuiSignMessage:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},message:{rule:"required",type:"bytes",id:2}}},SuiMessageSignature:{fields:{signature:{rule:"required",type:"bytes",id:1},address:{rule:"required",type:"string",id:2}}},TezosGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},TezosAddress:{fields:{address:{rule:"required",type:"string",id:1}}},TezosGetPublicKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},TezosPublicKey:{fields:{public_key:{rule:"required",type:"string",id:1}}},TezosSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},branch:{rule:"required",type:"bytes",id:2},reveal:{type:"TezosRevealOp",id:3},transaction:{type:"TezosTransactionOp",id:4},origination:{type:"TezosOriginationOp",id:5},delegation:{type:"TezosDelegationOp",id:6},proposal:{type:"TezosProposalOp",id:7},ballot:{type:"TezosBallotOp",id:8}},nested:{TezosContractID:{fields:{tag:{rule:"required",type:"TezosContractType",id:1},hash:{rule:"required",type:"bytes",id:2}},nested:{TezosContractType:{values:{Implicit:0,Originated:1}}}},TezosRevealOp:{fields:{source:{rule:"required",type:"bytes",id:7},fee:{rule:"required",type:"uint64",id:2},counter:{rule:"required",type:"uint64",id:3},gas_limit:{rule:"required",type:"uint64",id:4},storage_limit:{rule:"required",type:"uint64",id:5},public_key:{rule:"required",type:"bytes",id:6}}},TezosTransactionOp:{fields:{source:{rule:"required",type:"bytes",id:9},fee:{rule:"required",type:"uint64",id:2},counter:{rule:"required",type:"uint64",id:3},gas_limit:{rule:"required",type:"uint64",id:4},storage_limit:{rule:"required",type:"uint64",id:5},amount:{rule:"required",type:"uint64",id:6},destination:{rule:"required",type:"TezosContractID",id:7},parameters:{type:"bytes",id:8},parameters_manager:{type:"TezosParametersManager",id:10}},nested:{TezosParametersManager:{fields:{set_delegate:{type:"bytes",id:1},cancel_delegate:{type:"bool",id:2},transfer:{type:"TezosManagerTransfer",id:3}},nested:{TezosManagerTransfer:{fields:{destination:{type:"TezosContractID",id:1},amount:{type:"uint64",id:2}}}}}}},TezosOriginationOp:{fields:{source:{rule:"required",type:"bytes",id:12},fee:{rule:"required",type:"uint64",id:2},counter:{rule:"required",type:"uint64",id:3},gas_limit:{rule:"required",type:"uint64",id:4},storage_limit:{rule:"required",type:"uint64",id:5},manager_pubkey:{type:"bytes",id:6},balance:{rule:"required",type:"uint64",id:7},spendable:{type:"bool",id:8},delegatable:{type:"bool",id:9},delegate:{type:"bytes",id:10},script:{rule:"required",type:"bytes",id:11}}},TezosDelegationOp:{fields:{source:{rule:"required",type:"bytes",id:7},fee:{rule:"required",type:"uint64",id:2},counter:{rule:"required",type:"uint64",id:3},gas_limit:{rule:"required",type:"uint64",id:4},storage_limit:{rule:"required",type:"uint64",id:5},delegate:{rule:"required",type:"bytes",id:6}}},TezosProposalOp:{fields:{source:{type:"bytes",id:1},period:{type:"uint64",id:2},proposals:{rule:"repeated",type:"bytes",id:4}}},TezosBallotOp:{fields:{source:{type:"bytes",id:1},period:{type:"uint64",id:2},proposal:{type:"bytes",id:3},ballot:{type:"TezosBallotType",id:4}},nested:{TezosBallotType:{values:{Yay:0,Nay:1,Pass:2}}}}}},TezosSignedTx:{fields:{signature:{rule:"required",type:"string",id:1},sig_op_contents:{rule:"required",type:"bytes",id:2},operation_hash:{rule:"required",type:"string",id:3}}},TonWalletVersion:{values:{V4R2:3}},TonWorkChain:{values:{BASECHAIN:0,MASTERCHAIN:1}},TonGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2},wallet_version:{type:"TonWalletVersion",id:3,options:{default:"V4R2"}},is_bounceable:{type:"bool",id:4,options:{default:!1}},is_testnet_only:{type:"bool",id:5,options:{default:!1}},workchain:{type:"TonWorkChain",id:6,options:{default:"BASECHAIN"}},wallet_id:{type:"uint32",id:7,options:{default:698983191}}}},TonAddress:{fields:{public_key:{rule:"required",type:"bytes",id:1},address:{rule:"required",type:"string",id:2}}},TonSignMessage:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},destination:{rule:"required",type:"string",id:2},jetton_master_address:{type:"string",id:3},jetton_wallet_address:{type:"string",id:4},ton_amount:{rule:"required",type:"uint64",id:5},jetton_amount:{type:"uint64",id:6},fwd_fee:{type:"uint64",id:7,options:{default:0}},comment:{type:"string",id:8},is_raw_data:{type:"bool",id:9,options:{default:!1}},mode:{type:"uint32",id:10,options:{default:3}},seqno:{rule:"required",type:"uint32",id:11},expire_at:{rule:"required",type:"uint64",id:12},wallet_version:{type:"TonWalletVersion",id:13,options:{default:"V4R2"}},wallet_id:{type:"uint32",id:14,options:{default:698983191}},workchain:{type:"TonWorkChain",id:15,options:{default:"BASECHAIN"}},is_bounceable:{type:"bool",id:16,options:{default:!1}},is_testnet_only:{type:"bool",id:17,options:{default:!1}},ext_destination:{rule:"repeated",type:"string",id:18},ext_ton_amount:{rule:"repeated",type:"uint64",id:19,options:{packed:!1}},ext_payload:{rule:"repeated",type:"string",id:20},jetton_amount_bytes:{type:"bytes",id:21},init_data_initial_chunk:{type:"bytes",id:22},init_data_length:{type:"uint32",id:23},signing_message_repr:{type:"bytes",id:24}}},TonTxAck:{fields:{init_data_chunk:{rule:"required",type:"bytes",id:1}}},TonSignedMessage:{fields:{signature:{type:"bytes",id:1},signning_message:{type:"bytes",id:2},init_data_length:{type:"uint32",id:3}}},TonSignProof:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},appdomain:{rule:"required",type:"bytes",id:2},comment:{type:"bytes",id:3},expire_at:{rule:"required",type:"uint64",id:4},wallet_version:{type:"TonWalletVersion",id:5,options:{default:"V4R2"}},wallet_id:{type:"uint32",id:6,options:{default:698983191}},workchain:{type:"TonWorkChain",id:7,options:{default:"BASECHAIN"}},is_bounceable:{type:"bool",id:8,options:{default:!1}},is_testnet_only:{type:"bool",id:9,options:{default:!1}}}},TonSignedProof:{fields:{signature:{type:"bytes",id:1}}},TronGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},TronAddress:{fields:{address:{type:"string",id:1}}},TronSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},ref_block_bytes:{rule:"required",type:"bytes",id:2},ref_block_hash:{rule:"required",type:"bytes",id:3},expiration:{rule:"required",type:"uint64",id:4},data:{type:"bytes",id:5},contract:{rule:"required",type:"TronContract",id:6},timestamp:{rule:"required",type:"uint64",id:7},fee_limit:{type:"uint64",id:8}},nested:{TronContract:{fields:{transfer_contract:{type:"TronTransferContract",id:2},provider:{type:"bytes",id:3},vote_witness_contract:{type:"TronVoteWitnessContract",id:4},contract_name:{type:"bytes",id:5},permission_id:{type:"uint32",id:6},freeze_balance_contract:{type:"TronFreezeBalanceContract",id:11},unfreeze_balance_contract:{type:"TronUnfreezeBalanceContract",id:12},withdraw_balance_contract:{type:"TronWithdrawBalanceContract",id:13},trigger_smart_contract:{type:"TronTriggerSmartContract",id:31},freeze_balance_v2_contract:{type:"TronFreezeBalanceV2Contract",id:54},unfreeze_balance_v2_contract:{type:"TronUnfreezeBalanceV2Contract",id:55},withdraw_expire_unfreeze_contract:{type:"TronWithdrawExpireUnfreezeContract",id:56},delegate_resource_contract:{type:"TronDelegateResourceContract",id:57},undelegate_resource_contract:{type:"TronUnDelegateResourceContract",id:58},cancel_all_unfreeze_v2_contract:{type:"TronCancelAllUnfreezeV2Contract",id:59}},nested:{TronTransferContract:{fields:{to_address:{type:"string",id:2},amount:{type:"uint64",id:3}}},TronTriggerSmartContract:{fields:{contract_address:{type:"string",id:2},call_value:{type:"uint64",id:3},data:{type:"bytes",id:4},call_token_value:{type:"uint64",id:5},asset_id:{type:"uint64",id:6}}},TronResourceCode:{values:{BANDWIDTH:0,ENERGY:1,TRON_POWER:2}},TronFreezeBalanceContract:{fields:{frozen_balance:{type:"uint64",id:1},frozen_duration:{type:"uint64",id:2},resource:{type:"TronResourceCode",id:3},receiver_address:{type:"string",id:4}}},TronUnfreezeBalanceContract:{fields:{resource:{type:"TronResourceCode",id:1},receiver_address:{type:"string",id:2}}},TronWithdrawBalanceContract:{fields:{owner_address:{type:"bytes",id:1}}},TronFreezeBalanceV2Contract:{fields:{frozen_balance:{type:"uint64",id:2},resource:{type:"TronResourceCode",id:3}}},TronUnfreezeBalanceV2Contract:{fields:{unfreeze_balance:{type:"uint64",id:2},resource:{type:"TronResourceCode",id:3}}},TronWithdrawExpireUnfreezeContract:{fields:{}},TronDelegateResourceContract:{fields:{resource:{type:"TronResourceCode",id:2},balance:{type:"uint64",id:3},receiver_address:{type:"string",id:4},lock:{type:"bool",id:5},lock_period:{type:"uint64",id:6}}},TronUnDelegateResourceContract:{fields:{resource:{type:"TronResourceCode",id:2},balance:{type:"uint64",id:3},receiver_address:{type:"string",id:4}}},TronVoteWitnessContract:{fields:{votes:{rule:"repeated",type:"Vote",id:2},support:{type:"bool",id:3}},nested:{Vote:{fields:{vote_address:{rule:"required",type:"string",id:1},vote_count:{rule:"required",type:"uint32",id:2}}}}},TronCancelAllUnfreezeV2Contract:{fields:{}}}}}},TronSignedTx:{fields:{signature:{rule:"required",type:"bytes",id:1},serialized_tx:{type:"bytes",id:2}}},TronMessageType:{values:{V1:1,V2:2}},TronSignMessage:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},message:{rule:"required",type:"bytes",id:2},message_type:{type:"TronMessageType",id:3,options:{default:"V1"}}}},TronMessageSignature:{fields:{address:{rule:"required",type:"bytes",id:1},signature:{rule:"required",type:"bytes",id:2}}},WebAuthnListResidentCredentials:{fields:{}},WebAuthnAddResidentCredential:{fields:{credential_id:{type:"bytes",id:1}}},WebAuthnRemoveResidentCredential:{fields:{index:{type:"uint32",id:1}}},WebAuthnCredentials:{fields:{credentials:{rule:"repeated",type:"WebAuthnCredential",id:1}},nested:{WebAuthnCredential:{fields:{index:{type:"uint32",id:1},id:{type:"bytes",id:2},rp_id:{type:"string",id:3},rp_name:{type:"string",id:4},user_id:{type:"bytes",id:5},user_name:{type:"string",id:6},user_display_name:{type:"string",id:7},creation_time:{type:"uint32",id:8},hmac_secret:{type:"bool",id:9},use_sign_count:{type:"bool",id:10},algorithm:{type:"sint32",id:11},curve:{type:"sint32",id:12}}}}},wire_in:{type:"bool",id:50002,extend:"google.protobuf.EnumValueOptions"},wire_out:{type:"bool",id:50003,extend:"google.protobuf.EnumValueOptions"},wire_debug_in:{type:"bool",id:50004,extend:"google.protobuf.EnumValueOptions"},wire_debug_out:{type:"bool",id:50005,extend:"google.protobuf.EnumValueOptions"},wire_tiny:{type:"bool",id:50006,extend:"google.protobuf.EnumValueOptions"},wire_bootloader:{type:"bool",id:50007,extend:"google.protobuf.EnumValueOptions"},wire_no_fsm:{type:"bool",id:50008,extend:"google.protobuf.EnumValueOptions"},facotry:{type:"bool",id:50501,extend:"google.protobuf.EnumValueOptions"},bitcoin_only:{type:"bool",id:6e4,extend:"google.protobuf.EnumValueOptions"},has_bitcoin_only_values:{type:"bool",id:51001,extend:"google.protobuf.EnumOptions"},unstable:{type:"bool",id:52001,extend:"google.protobuf.MessageOptions"},wire_type:{type:"uint32",id:52002,extend:"google.protobuf.MessageOptions"},experimental:{type:"bool",id:53001,extend:"google.protobuf.FieldOptions"},include_in_bitcoin_only:{type:"bool",id:6e4,extend:"google.protobuf.FileOptions"},CommandFlags:{values:{Default:0,Factory_Only:1}},MessageType:{options:{"(has_bitcoin_only_values)":!0},values:{MessageType_Initialize:0,MessageType_Ping:1,MessageType_Success:2,MessageType_Failure:3,MessageType_ChangePin:4,MessageType_WipeDevice:5,MessageType_GetEntropy:9,MessageType_Entropy:10,MessageType_LoadDevice:13,MessageType_ResetDevice:14,MessageType_Features:17,MessageType_PinMatrixRequest:18,MessageType_PinMatrixAck:19,MessageType_Cancel:20,MessageType_LockDevice:24,MessageType_ApplySettings:25,MessageType_ButtonRequest:26,MessageType_ButtonAck:27,MessageType_ApplyFlags:28,MessageType_BackupDevice:34,MessageType_EntropyRequest:35,MessageType_EntropyAck:36,MessageType_PassphraseRequest:41,MessageType_PassphraseAck:42,MessageType_RecoveryDevice:45,MessageType_WordRequest:46,MessageType_WordAck:47,MessageType_GetFeatures:55,MessageType_SdProtect:79,MessageType_ChangeWipeCode:82,MessageType_EndSession:83,MessageType_DoPreauthorized:84,MessageType_PreauthorizedRequest:85,MessageType_CancelAuthorization:86,MessageType_RebootToBootloader:87,MessageType_SetU2FCounter:63,MessageType_GetNextU2FCounter:80,MessageType_NextU2FCounter:81,MessageType_Deprecated_PassphraseStateRequest:77,MessageType_Deprecated_PassphraseStateAck:78,MessageType_FirmwareErase:6,MessageType_FirmwareErase_ex:16,MessageType_FirmwareUpload:7,MessageType_FirmwareRequest:8,MessageType_SelfTest:32,MessageType_Reboot:3e4,MessageType_FirmwareUpdateEmmc:30001,MessageType_GetPublicKey:11,MessageType_PublicKey:12,MessageType_SignTx:15,MessageType_TxRequest:21,MessageType_TxAck:22,MessageType_GetAddress:29,MessageType_Address:30,MessageType_SignMessage:38,MessageType_VerifyMessage:39,MessageType_MessageSignature:40,MessageType_GetOwnershipId:43,MessageType_OwnershipId:44,MessageType_GetOwnershipProof:49,MessageType_OwnershipProof:50,MessageType_AuthorizeCoinJoin:51,MessageType_SignPsbt:10052,MessageType_SignedPsbt:10053,MessageType_CipherKeyValue:23,MessageType_CipheredKeyValue:48,MessageType_SignIdentity:53,MessageType_SignedIdentity:54,MessageType_GetECDHSessionKey:61,MessageType_ECDHSessionKey:62,MessageType_CosiCommit:71,MessageType_CosiCommitment:72,MessageType_CosiSign:73,MessageType_CosiSignature:74,MessageType_BatchGetPublickeys:10016,MessageType_EcdsaPublicKeys:10017,MessageType_DebugLinkDecision:100,MessageType_DebugLinkGetState:101,MessageType_DebugLinkState:102,MessageType_DebugLinkStop:103,MessageType_DebugLinkLog:104,MessageType_DebugLinkMemoryRead:110,MessageType_DebugLinkMemory:111,MessageType_DebugLinkMemoryWrite:112,MessageType_DebugLinkFlashErase:113,MessageType_DebugLinkLayout:9001,MessageType_DebugLinkReseedRandom:9002,MessageType_DebugLinkRecordScreen:9003,MessageType_DebugLinkEraseSdCard:9005,MessageType_DebugLinkWatchLayout:9006,MessageType_EmmcFixPermission:30100,MessageType_EmmcPath:30101,MessageType_EmmcPathInfo:30102,MessageType_EmmcFile:30103,MessageType_EmmcFileRead:30104,MessageType_EmmcFileWrite:30105,MessageType_EmmcFileDelete:30106,MessageType_EmmcDir:30107,MessageType_EmmcDirList:30108,MessageType_EmmcDirMake:30109,MessageType_EmmcDirRemove:30110,MessageType_EthereumGetPublicKey:450,MessageType_EthereumPublicKey:451,MessageType_EthereumGetAddress:56,MessageType_EthereumAddress:57,MessageType_EthereumSignTx:58,MessageType_EthereumSignTxEIP1559:452,MessageType_EthereumTxRequest:59,MessageType_EthereumTxAck:60,MessageType_EthereumSignMessage:64,MessageType_EthereumVerifyMessage:65,MessageType_EthereumMessageSignature:66,MessageType_EthereumSignTypedData:464,MessageType_EthereumTypedDataStructRequest:465,MessageType_EthereumTypedDataStructAck:466,MessageType_EthereumTypedDataValueRequest:467,MessageType_EthereumTypedDataValueAck:468,MessageType_EthereumTypedDataSignature:469,MessageType_EthereumSignTypedHash:470,MessageType_EthereumGetPublicKeyUKey:20100,MessageType_EthereumPublicKeyUKey:20101,MessageType_EthereumGetAddressUKey:20102,MessageType_EthereumAddressUKey:20103,MessageType_EthereumSignTxUKey:20104,MessageType_EthereumSignTxEIP1559UKey:20105,MessageType_EthereumTxRequestUKey:20106,MessageType_EthereumTxAckUKey:20107,MessageType_EthereumSignMessageUKey:20108,MessageType_EthereumVerifyMessageUKey:20109,MessageType_EthereumMessageSignatureUKey:20110,MessageType_EthereumSignTypedDataUKey:20111,MessageType_EthereumTypedDataStructRequestUKey:20112,MessageType_EthereumTypedDataStructAckUKey:20113,MessageType_EthereumTypedDataValueRequestUKey:20114,MessageType_EthereumTypedDataValueAckUKey:20115,MessageType_EthereumTypedDataSignatureUKey:20116,MessageType_EthereumSignTypedHashUKey:20117,MessageType_EthereumGnosisSafeTxAck:20118,MessageType_EthereumGnosisSafeTxRequest:20119,MessageType_EthereumSignTxEIP7702UKey:20120,MessageType_NEMGetAddress:67,MessageType_NEMAddress:68,MessageType_NEMSignTx:69,MessageType_NEMSignedTx:70,MessageType_NEMDecryptMessage:75,MessageType_NEMDecryptedMessage:76,MessageType_TezosGetAddress:150,MessageType_TezosAddress:151,MessageType_TezosSignTx:152,MessageType_TezosSignedTx:153,MessageType_TezosGetPublicKey:154,MessageType_TezosPublicKey:155,MessageType_StellarSignTx:202,MessageType_StellarTxOpRequest:203,MessageType_StellarGetAddress:207,MessageType_StellarAddress:208,MessageType_StellarCreateAccountOp:210,MessageType_StellarPaymentOp:211,MessageType_StellarPathPaymentStrictReceiveOp:212,MessageType_StellarManageSellOfferOp:213,MessageType_StellarCreatePassiveSellOfferOp:214,MessageType_StellarSetOptionsOp:215,MessageType_StellarChangeTrustOp:216,MessageType_StellarAllowTrustOp:217,MessageType_StellarAccountMergeOp:218,MessageType_StellarManageDataOp:220,MessageType_StellarBumpSequenceOp:221,MessageType_StellarManageBuyOfferOp:222,MessageType_StellarPathPaymentStrictSendOp:223,MessageType_StellarSignedTx:230,MessageType_CardanoGetPublicKey:305,MessageType_CardanoPublicKey:306,MessageType_CardanoGetAddress:307,MessageType_CardanoAddress:308,MessageType_CardanoTxItemAck:313,MessageType_CardanoTxAuxiliaryDataSupplement:314,MessageType_CardanoTxWitnessRequest:315,MessageType_CardanoTxWitnessResponse:316,MessageType_CardanoTxHostAck:317,MessageType_CardanoTxBodyHash:318,MessageType_CardanoSignTxFinished:319,MessageType_CardanoSignTxInit:320,MessageType_CardanoTxInput:321,MessageType_CardanoTxOutput:322,MessageType_CardanoAssetGroup:323,MessageType_CardanoToken:324,MessageType_CardanoTxCertificate:325,MessageType_CardanoTxWithdrawal:326,MessageType_CardanoTxAuxiliaryData:327,MessageType_CardanoPoolOwner:328,MessageType_CardanoPoolRelayParameters:329,MessageType_CardanoGetNativeScriptHash:330,MessageType_CardanoNativeScriptHash:331,MessageType_CardanoTxMint:332,MessageType_CardanoTxCollateralInput:333,MessageType_CardanoTxRequiredSigner:334,MessageType_CardanoTxInlineDatumChunk:335,MessageType_CardanoTxReferenceScriptChunk:336,MessageType_CardanoTxReferenceInput:337,MessageType_CardanoSignMessage:350,MessageType_CardanoMessageSignature:351,MessageType_RippleGetAddress:400,MessageType_RippleAddress:401,MessageType_RippleSignTx:402,MessageType_RippleSignedTx:403,MessageType_MoneroTransactionInitRequest:501,MessageType_MoneroTransactionInitAck:502,MessageType_MoneroTransactionSetInputRequest:503,MessageType_MoneroTransactionSetInputAck:504,MessageType_MoneroTransactionInputsPermutationRequest:505,MessageType_MoneroTransactionInputsPermutationAck:506,MessageType_MoneroTransactionInputViniRequest:507,MessageType_MoneroTransactionInputViniAck:508,MessageType_MoneroTransactionAllInputsSetRequest:509,MessageType_MoneroTransactionAllInputsSetAck:510,MessageType_MoneroTransactionSetOutputRequest:511,MessageType_MoneroTransactionSetOutputAck:512,MessageType_MoneroTransactionAllOutSetRequest:513,MessageType_MoneroTransactionAllOutSetAck:514,MessageType_MoneroTransactionSignInputRequest:515,MessageType_MoneroTransactionSignInputAck:516,MessageType_MoneroTransactionFinalRequest:517,MessageType_MoneroTransactionFinalAck:518,MessageType_MoneroKeyImageExportInitRequest:530,MessageType_MoneroKeyImageExportInitAck:531,MessageType_MoneroKeyImageSyncStepRequest:532,MessageType_MoneroKeyImageSyncStepAck:533,MessageType_MoneroKeyImageSyncFinalRequest:534,MessageType_MoneroKeyImageSyncFinalAck:535,MessageType_MoneroGetAddress:540,MessageType_MoneroAddress:541,MessageType_MoneroGetWatchKey:542,MessageType_MoneroWatchKey:543,MessageType_DebugMoneroDiagRequest:546,MessageType_DebugMoneroDiagAck:547,MessageType_MoneroGetTxKeyRequest:550,MessageType_MoneroGetTxKeyAck:551,MessageType_MoneroLiveRefreshStartRequest:552,MessageType_MoneroLiveRefreshStartAck:553,MessageType_MoneroLiveRefreshStepRequest:554,MessageType_MoneroLiveRefreshStepAck:555,MessageType_MoneroLiveRefreshFinalRequest:556,MessageType_MoneroLiveRefreshFinalAck:557,MessageType_EosGetPublicKey:600,MessageType_EosPublicKey:601,MessageType_EosSignTx:602,MessageType_EosTxActionRequest:603,MessageType_EosTxActionAck:604,MessageType_EosSignedTx:605,MessageType_BinanceGetAddress:700,MessageType_BinanceAddress:701,MessageType_BinanceGetPublicKey:702,MessageType_BinancePublicKey:703,MessageType_BinanceSignTx:704,MessageType_BinanceTxRequest:705,MessageType_BinanceTransferMsg:706,MessageType_BinanceOrderMsg:707,MessageType_BinanceCancelMsg:708,MessageType_BinanceSignedTx:709,MessageType_SolanaGetAddress:10100,MessageType_SolanaAddress:10101,MessageType_SolanaSignTx:10102,MessageType_SolanaSignedTx:10103,MessageType_SolanaSignOffChainMessage:10104,MessageType_SolanaMessageSignature:10105,MessageType_SolanaSignUnsafeMessage:10106,MessageType_StarcoinGetAddress:10300,MessageType_StarcoinAddress:10301,MessageType_StarcoinGetPublicKey:10302,MessageType_StarcoinPublicKey:10303,MessageType_StarcoinSignTx:10304,MessageType_StarcoinSignedTx:10305,MessageType_StarcoinSignMessage:10306,MessageType_StarcoinMessageSignature:10307,MessageType_StarcoinVerifyMessage:10308,MessageType_AptosGetAddress:10600,MessageType_AptosAddress:10601,MessageType_AptosSignTx:10602,MessageType_AptosSignedTx:10603,MessageType_AptosSignMessage:10604,MessageType_AptosMessageSignature:10605,MessageType_AptosSignSIWAMessage:10606,MessageType_WebAuthnListResidentCredentials:800,MessageType_WebAuthnCredentials:801,MessageType_WebAuthnAddResidentCredential:802,MessageType_WebAuthnRemoveResidentCredential:803,MessageType_BixinSeedOperate:901,MessageType_BixinMessageSE:902,MessageType_BixinOutMessageSE:904,MessageType_BixinBackupRequest:905,MessageType_BixinBackupAck:906,MessageType_BixinRestoreRequest:907,MessageType_BixinRestoreAck:908,MessageType_BixinVerifyDeviceRequest:909,MessageType_BixinVerifyDeviceAck:910,MessageType_BixinWhiteListRequest:911,MessageType_BixinWhiteListAck:912,MessageType_BixinLoadDevice:913,MessageType_BixinBackupDevice:914,MessageType_BixinBackupDeviceAck:915,MessageType_BixinPinInputOnDevice:1e4,MessageType_EthereumSignMessageEIP712:10200,MessageType_GetPublicKeyMultiple:10210,MessageType_PublicKeyMultiple:10211,MessageType_ConfluxGetAddress:10112,MessageType_ConfluxAddress:10113,MessageType_ConfluxSignTx:10114,MessageType_ConfluxTxRequest:10115,MessageType_ConfluxTxAck:10116,MessageType_ConfluxSignMessage:10117,MessageType_ConfluxSignMessageCIP23:10118,MessageType_ConfluxMessageSignature:10119,MessageType_TronGetAddress:10501,MessageType_TronAddress:10502,MessageType_TronSignTx:10503,MessageType_TronSignedTx:10504,MessageType_TronSignMessage:10505,MessageType_TronMessageSignature:10506,MessageType_NearGetAddress:10701,MessageType_NearAddress:10702,MessageType_NearSignTx:10703,MessageType_NearSignedTx:10704,MessageType_CosmosGetAddress:10800,MessageType_CosmosAddress:10801,MessageType_CosmosSignTx:10802,MessageType_CosmosSignedTx:10803,MessageType_AlgorandGetAddress:10900,MessageType_AlgorandAddress:10901,MessageType_AlgorandSignTx:10902,MessageType_AlgorandSignedTx:10903,MessageType_PolkadotGetAddress:11e3,MessageType_PolkadotAddress:11001,MessageType_PolkadotSignTx:11002,MessageType_PolkadotSignedTx:11003,MessageType_SuiGetAddress:11100,MessageType_SuiAddress:11101,MessageType_SuiSignTx:11102,MessageType_SuiSignedTx:11103,MessageType_SuiSignMessage:11104,MessageType_SuiMessageSignature:11105,MessageType_SuiTxRequest:11106,MessageType_SuiTxAck:11107,MessageType_FilecoinGetAddress:11200,MessageType_FilecoinAddress:11201,MessageType_FilecoinSignTx:11202,MessageType_FilecoinSignedTx:11203,MessageType_KaspaGetAddress:11300,MessageType_KaspaAddress:11301,MessageType_KaspaSignTx:11302,MessageType_KaspaSignedTx:11303,MessageType_KaspaTxInputRequest:11304,MessageType_KaspaTxInputAck:11305,MessageType_NexaGetAddress:11400,MessageType_NexaAddress:11401,MessageType_NexaSignTx:11402,MessageType_NexaSignedTx:11403,MessageType_NexaTxInputRequest:11404,MessageType_NexaTxInputAck:11405,MessageType_NostrGetPublicKey:11500,MessageType_NostrPublicKey:11501,MessageType_NostrSignEvent:11502,MessageType_NostrSignedEvent:11503,MessageType_NostrEncryptMessage:11504,MessageType_NostrEncryptedMessage:11505,MessageType_NostrDecryptMessage:11506,MessageType_NostrDecryptedMessage:11507,MessageType_NostrSignSchnorr:11508,MessageType_NostrSignedSchnorr:11509,MessageType_LnurlAuth:11600,MessageType_LnurlAuthResp:11601,MessageType_NervosGetAddress:11701,MessageType_NervosAddress:11702,MessageType_NervosSignTx:11703,MessageType_NervosSignedTx:11704,MessageType_NervosTxRequest:11705,MessageType_NervosTxAck:11706,MessageType_DnxGetAddress:11800,MessageType_DnxAddress:11801,MessageType_DnxSignTx:11802,MessageType_DnxInputRequest:11803,MessageType_DnxInputAck:11804,MessageType_DnxRTSigsRequest:11805,MessageType_DnxSignedTx:11806,MessageType_TonGetAddress:11901,MessageType_TonAddress:11902,MessageType_TonSignMessage:11903,MessageType_TonSignedMessage:11904,MessageType_TonSignProof:11905,MessageType_TonSignedProof:11906,MessageType_TonTxAck:11907,MessageType_ScdoGetAddress:12001,MessageType_ScdoAddress:12002,MessageType_ScdoSignTx:12003,MessageType_ScdoSignedTx:12004,MessageType_ScdoTxAck:12005,MessageType_ScdoSignMessage:12006,MessageType_ScdoSignedMessage:12007,MessageType_AlephiumGetAddress:12101,MessageType_AlephiumAddress:12102,MessageType_AlephiumSignTx:12103,MessageType_AlephiumSignedTx:12104,MessageType_AlephiumTxRequest:12105,MessageType_AlephiumTxAck:12106,MessageType_AlephiumBytecodeRequest:12107,MessageType_AlephiumBytecodeAck:12108,MessageType_AlephiumSignMessage:12109,MessageType_AlephiumMessageSignature:12110,MessageType_BenfenGetAddress:12201,MessageType_BenfenAddress:12202,MessageType_BenfenSignTx:12203,MessageType_BenfenSignedTx:12204,MessageType_BenfenSignMessage:12205,MessageType_BenfenMessageSignature:12206,MessageType_BenfenTxRequest:12207,MessageType_BenfenTxAck:12208,MessageType_NeoGetAddress:12301,MessageType_NeoAddress:12302,MessageType_NeoSignTx:12303,MessageType_NeoSignedTx:12304,MessageType_DeviceBackToBoot:903,MessageType_DeviceInfoSettings:10001,MessageType_GetDeviceInfo:10002,MessageType_DeviceInfo:10003,MessageType_ReadSEPublicKey:10004,MessageType_SEPublicKey:10005,MessageType_WriteSEPublicCert:10006,MessageType_ReadSEPublicCert:10007,MessageType_SEPublicCert:10008,MessageType_SpiFlashWrite:10009,MessageType_SpiFlashRead:10010,MessageType_SpiFlashData:10011,MessageType_SESignMessage:10012,MessageType_SEMessageSignature:10013,MessageType_NFTWriteInfo:10014,MessageType_NFTWriteData:10015,MessageType_ResourceUpload:10018,MessageType_ZoomRequest:10019,MessageType_ResourceRequest:10020,MessageType_ResourceAck:10021,MessageType_ResourceUpdate:10022,MessageType_ListResDir:10023,MessageType_FileInfoList:10024,MessageType_UkeyGetFeatures:10025,MessageType_UkeyFeatures:10026,MessageType_GetPassphraseState:10028,MessageType_PassphraseState:10029,MessageType_UnLockDevice:10030,MessageType_UnLockDeviceResponse:10031}},google:{nested:{protobuf:{nested:{FileDescriptorSet:{fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}}},FileDescriptorProto:{fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},public_dependency:{rule:"repeated",type:"int32",id:10,options:{packed:!1}},weak_dependency:{rule:"repeated",type:"int32",id:11,options:{packed:!1}},message_type:{rule:"repeated",type:"DescriptorProto",id:4},enum_type:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},source_code_info:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12}}},DescriptorProto:{fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nested_type:{rule:"repeated",type:"DescriptorProto",id:3},enum_type:{rule:"repeated",type:"EnumDescriptorProto",id:4},extension_range:{rule:"repeated",type:"ExtensionRange",id:5},oneof_decl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reserved_range:{rule:"repeated",type:"ReservedRange",id:9},reserved_name:{rule:"repeated",type:"string",id:10}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},FieldDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},type_name:{type:"string",id:6},extendee:{type:"string",id:2},default_value:{type:"string",id:7},oneof_index:{type:"int32",id:9},json_name:{type:"string",id:10},options:{type:"FieldOptions",id:8}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REQUIRED:2,LABEL_REPEATED:3}}}},OneofDescriptorProto:{fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3}}},EnumValueDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{fields:{name:{type:"string",id:1},input_type:{type:"string",id:2},output_type:{type:"string",id:3},options:{type:"MethodOptions",id:4},client_streaming:{type:"bool",id:5},server_streaming:{type:"bool",id:6}}},FileOptions:{fields:{java_package:{type:"string",id:1},java_outer_classname:{type:"string",id:8},java_multiple_files:{type:"bool",id:10},java_generate_equals_and_hash:{type:"bool",id:20,options:{deprecated:!0}},java_string_check_utf8:{type:"bool",id:27},optimize_for:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},go_package:{type:"string",id:11},cc_generic_services:{type:"bool",id:16},java_generic_services:{type:"bool",id:17},py_generic_services:{type:"bool",id:18},deprecated:{type:"bool",id:23},cc_enable_arenas:{type:"bool",id:31},objc_class_prefix:{type:"string",id:36},csharp_namespace:{type:"string",id:37},uninterpreted_option:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[38,38]],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{fields:{message_set_wire_format:{type:"bool",id:1},no_standard_descriptor_accessor:{type:"bool",id:2},deprecated:{type:"bool",id:3},map_entry:{type:"bool",id:7},uninterpreted_option:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[8,8]]},FieldOptions:{fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5},deprecated:{type:"bool",id:3},weak:{type:"bool",id:10},uninterpreted_option:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}}}},OneofOptions:{fields:{uninterpreted_option:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{fields:{allow_alias:{type:"bool",id:2},deprecated:{type:"bool",id:3},uninterpreted_option:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumValueOptions:{fields:{deprecated:{type:"bool",id:1},uninterpreted_option:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{fields:{deprecated:{type:"bool",id:33},uninterpreted_option:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{fields:{deprecated:{type:"bool",id:33},uninterpreted_option:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},UninterpretedOption:{fields:{name:{rule:"repeated",type:"NamePart",id:2},identifier_value:{type:"string",id:3},positive_int_value:{type:"uint64",id:4},negative_int_value:{type:"int64",id:5},double_value:{type:"double",id:6},string_value:{type:"bytes",id:7},aggregate_value:{type:"string",id:8}},nested:{NamePart:{fields:{name_part:{rule:"required",type:"string",id:1},is_extension:{rule:"required",type:"bool",id:2}}}}},SourceCodeInfo:{fields:{location:{rule:"repeated",type:"Location",id:1}},nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1},span:{rule:"repeated",type:"int32",id:2},leading_comments:{type:"string",id:3},trailing_comments:{type:"string",id:4},leading_detached_comments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1},source_file:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4}}}}}}}}}}},Ke={nested:{AlgorandGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:3}}},AlgorandAddress:{fields:{address:{type:"string",id:1}}},AlgorandSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},raw_tx:{rule:"required",type:"bytes",id:2}}},AlgorandSignedTx:{fields:{signature:{rule:"required",type:"bytes",id:1}}},AptosGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},AptosAddress:{fields:{address:{type:"string",id:1}}},AptosSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},raw_tx:{rule:"required",type:"bytes",id:2}}},AptosSignedTx:{fields:{public_key:{rule:"required",type:"bytes",id:1},signature:{rule:"required",type:"bytes",id:2}}},AptosSignMessage:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},payload:{rule:"required",type:"AptosMessagePayload",id:2}},nested:{AptosMessagePayload:{fields:{address:{type:"string",id:2},chain_id:{type:"string",id:3},application:{type:"string",id:4},nonce:{rule:"required",type:"string",id:5},message:{rule:"required",type:"string",id:6}}}}},AptosMessageSignature:{fields:{signature:{rule:"required",type:"bytes",id:1},address:{rule:"required",type:"string",id:2}}},BinanceGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},BinanceAddress:{fields:{address:{rule:"required",type:"string",id:1}}},BinanceGetPublicKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},BinancePublicKey:{fields:{public_key:{rule:"required",type:"bytes",id:1}}},BinanceSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},msg_count:{type:"uint32",id:2},account_number:{type:"sint64",id:3},chain_id:{type:"string",id:4},memo:{type:"string",id:5},sequence:{type:"sint64",id:6},source:{type:"sint64",id:7}}},BinanceTxRequest:{fields:{}},BinanceTransferMsg:{fields:{inputs:{rule:"repeated",type:"BinanceInputOutput",id:1},outputs:{rule:"repeated",type:"BinanceInputOutput",id:2}},nested:{BinanceInputOutput:{fields:{address:{type:"string",id:1},coins:{rule:"repeated",type:"BinanceCoin",id:2}}},BinanceCoin:{fields:{amount:{type:"sint64",id:1},denom:{type:"string",id:2}}}}},BinanceOrderMsg:{fields:{id:{type:"string",id:1},ordertype:{type:"BinanceOrderType",id:2},price:{type:"sint64",id:3},quantity:{type:"sint64",id:4},sender:{type:"string",id:5},side:{type:"BinanceOrderSide",id:6},symbol:{type:"string",id:7},timeinforce:{type:"BinanceTimeInForce",id:8}},nested:{BinanceOrderType:{values:{OT_UNKNOWN:0,MARKET:1,LIMIT:2,OT_RESERVED:3}},BinanceOrderSide:{values:{SIDE_UNKNOWN:0,BUY:1,SELL:2}},BinanceTimeInForce:{values:{TIF_UNKNOWN:0,GTE:1,TIF_RESERVED:2,IOC:3}}}},BinanceCancelMsg:{fields:{refid:{type:"string",id:1},sender:{type:"string",id:2},symbol:{type:"string",id:3}}},BinanceSignedTx:{fields:{signature:{rule:"required",type:"bytes",id:1},public_key:{rule:"required",type:"bytes",id:2}}},InputScriptType:{values:{SPENDADDRESS:0,SPENDMULTISIG:1,EXTERNAL:2,SPENDWITNESS:3,SPENDP2SHWITNESS:4,SPENDTAPROOT:5}},OutputScriptType:{values:{PAYTOADDRESS:0,PAYTOSCRIPTHASH:1,PAYTOMULTISIG:2,PAYTOOPRETURN:3,PAYTOWITNESS:4,PAYTOP2SHWITNESS:5,PAYTOTAPROOT:6}},DecredStakingSpendType:{values:{SSGen:0,SSRTX:1}},AmountUnit:{values:{BITCOIN:0,MILLIBITCOIN:1,MICROBITCOIN:2,SATOSHI:3}},MultisigRedeemScriptType:{fields:{pubkeys:{rule:"repeated",type:"HDNodePathType",id:1},signatures:{rule:"repeated",type:"bytes",id:2},m:{rule:"required",type:"uint32",id:3},nodes:{rule:"repeated",type:"HDNodeType",id:4},address_n:{rule:"repeated",type:"uint32",id:5,options:{packed:!1}}},nested:{HDNodePathType:{fields:{node:{rule:"required",type:"HDNodeType",id:1},address_n:{rule:"repeated",type:"uint32",id:2,options:{packed:!1}}}}}},GetPublicKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},ecdsa_curve_name:{type:"string",id:2},show_display:{type:"bool",id:3},coin_name:{type:"string",id:4,options:{default:"Bitcoin"}},script_type:{type:"InputScriptType",id:5,options:{default:"SPENDADDRESS"}},ignore_xpub_magic:{type:"bool",id:6}}},PublicKey:{fields:{node:{rule:"required",type:"HDNodeType",id:1},xpub:{rule:"required",type:"string",id:2},root_fingerprint:{type:"uint32",id:3}}},GetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},coin_name:{type:"string",id:2,options:{default:"Bitcoin"}},show_display:{type:"bool",id:3},multisig:{type:"MultisigRedeemScriptType",id:4},script_type:{type:"InputScriptType",id:5,options:{default:"SPENDADDRESS"}},ignore_xpub_magic:{type:"bool",id:6}}},Address:{fields:{address:{rule:"required",type:"string",id:1}}},GetOwnershipId:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},coin_name:{type:"string",id:2,options:{default:"Bitcoin"}},multisig:{type:"MultisigRedeemScriptType",id:3},script_type:{type:"InputScriptType",id:4,options:{default:"SPENDADDRESS"}}}},OwnershipId:{fields:{ownership_id:{rule:"required",type:"bytes",id:1}}},SignMessage:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},message:{rule:"required",type:"bytes",id:2},coin_name:{type:"string",id:3,options:{default:"Bitcoin"}},script_type:{type:"InputScriptType",id:4,options:{default:"SPENDADDRESS"}},no_script_type:{type:"bool",id:5}}},MessageSignature:{fields:{address:{rule:"required",type:"string",id:1},signature:{rule:"required",type:"bytes",id:2}}},VerifyMessage:{fields:{address:{rule:"required",type:"string",id:1},signature:{rule:"required",type:"bytes",id:2},message:{rule:"required",type:"bytes",id:3},coin_name:{type:"string",id:4,options:{default:"Bitcoin"}}}},SignTx:{fields:{outputs_count:{rule:"required",type:"uint32",id:1},inputs_count:{rule:"required",type:"uint32",id:2},coin_name:{type:"string",id:3,options:{default:"Bitcoin"}},version:{type:"uint32",id:4,options:{default:1}},lock_time:{type:"uint32",id:5,options:{default:0}},expiry:{type:"uint32",id:6},overwintered:{type:"bool",id:7,options:{deprecated:!0}},version_group_id:{type:"uint32",id:8},timestamp:{type:"uint32",id:9},branch_id:{type:"uint32",id:10},amount_unit:{type:"AmountUnit",id:11,options:{default:"BITCOIN"}},decred_staking_ticket:{type:"bool",id:12,options:{default:!1}}}},TxRequest:{fields:{request_type:{type:"RequestType",id:1},details:{type:"TxRequestDetailsType",id:2},serialized:{type:"TxRequestSerializedType",id:3}},nested:{RequestType:{values:{TXINPUT:0,TXOUTPUT:1,TXMETA:2,TXFINISHED:3,TXEXTRADATA:4,TXORIGINPUT:5,TXORIGOUTPUT:6}},TxRequestDetailsType:{fields:{request_index:{type:"uint32",id:1},tx_hash:{type:"bytes",id:2},extra_data_len:{type:"uint32",id:3},extra_data_offset:{type:"uint32",id:4}}},TxRequestSerializedType:{fields:{signature_index:{type:"uint32",id:1},signature:{type:"bytes",id:2},serialized_tx:{type:"bytes",id:3}}}}},TxAck:{options:{deprecated:!0},fields:{tx:{type:"TransactionType",id:1}},nested:{TransactionType:{fields:{version:{type:"uint32",id:1},inputs:{rule:"repeated",type:"TxInputType",id:2},bin_outputs:{rule:"repeated",type:"TxOutputBinType",id:3},lock_time:{type:"uint32",id:4},outputs:{rule:"repeated",type:"TxOutputType",id:5},inputs_cnt:{type:"uint32",id:6},outputs_cnt:{type:"uint32",id:7},extra_data:{type:"bytes",id:8},extra_data_len:{type:"uint32",id:9},expiry:{type:"uint32",id:10},overwintered:{type:"bool",id:11,options:{deprecated:!0}},version_group_id:{type:"uint32",id:12},timestamp:{type:"uint32",id:13},branch_id:{type:"uint32",id:14}},nested:{TxInputType:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},prev_hash:{rule:"required",type:"bytes",id:2},prev_index:{rule:"required",type:"uint32",id:3},script_sig:{type:"bytes",id:4},sequence:{type:"uint32",id:5,options:{default:4294967295}},script_type:{type:"InputScriptType",id:6,options:{default:"SPENDADDRESS"}},multisig:{type:"MultisigRedeemScriptType",id:7},amount:{type:"uint64",id:8},decred_tree:{type:"uint32",id:9},witness:{type:"bytes",id:13},ownership_proof:{type:"bytes",id:14},commitment_data:{type:"bytes",id:15},orig_hash:{type:"bytes",id:16},orig_index:{type:"uint32",id:17},decred_staking_spend:{type:"DecredStakingSpendType",id:18},script_pubkey:{type:"bytes",id:19}}},TxOutputBinType:{fields:{amount:{rule:"required",type:"uint64",id:1},script_pubkey:{rule:"required",type:"bytes",id:2},decred_script_version:{type:"uint32",id:3}}},TxOutputType:{fields:{address:{type:"string",id:1},address_n:{rule:"repeated",type:"uint32",id:2,options:{packed:!1}},amount:{rule:"required",type:"uint64",id:3},script_type:{type:"OutputScriptType",id:4,options:{default:"PAYTOADDRESS"}},multisig:{type:"MultisigRedeemScriptType",id:5},op_return_data:{type:"bytes",id:6},orig_hash:{type:"bytes",id:10},orig_index:{type:"uint32",id:11}}}}}}},TxInput:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},prev_hash:{rule:"required",type:"bytes",id:2},prev_index:{rule:"required",type:"uint32",id:3},script_sig:{type:"bytes",id:4},sequence:{type:"uint32",id:5,options:{default:4294967295}},script_type:{type:"InputScriptType",id:6,options:{default:"SPENDADDRESS"}},multisig:{type:"MultisigRedeemScriptType",id:7},amount:{rule:"required",type:"uint64",id:8},decred_tree:{type:"uint32",id:9},witness:{type:"bytes",id:13},ownership_proof:{type:"bytes",id:14},commitment_data:{type:"bytes",id:15},orig_hash:{type:"bytes",id:16},orig_index:{type:"uint32",id:17},decred_staking_spend:{type:"DecredStakingSpendType",id:18},script_pubkey:{type:"bytes",id:19}}},TxOutput:{fields:{address:{type:"string",id:1},address_n:{rule:"repeated",type:"uint32",id:2,options:{packed:!1}},amount:{rule:"required",type:"uint64",id:3},script_type:{type:"OutputScriptType",id:4,options:{default:"PAYTOADDRESS"}},multisig:{type:"MultisigRedeemScriptType",id:5},op_return_data:{type:"bytes",id:6},orig_hash:{type:"bytes",id:10},orig_index:{type:"uint32",id:11}}},PrevTx:{fields:{version:{rule:"required",type:"uint32",id:1},lock_time:{rule:"required",type:"uint32",id:4},inputs_count:{rule:"required",type:"uint32",id:6},outputs_count:{rule:"required",type:"uint32",id:7},extra_data_len:{type:"uint32",id:9,options:{default:0}},expiry:{type:"uint32",id:10},version_group_id:{type:"uint32",id:12},timestamp:{type:"uint32",id:13},branch_id:{type:"uint32",id:14}}},PrevInput:{fields:{prev_hash:{rule:"required",type:"bytes",id:2},prev_index:{rule:"required",type:"uint32",id:3},script_sig:{rule:"required",type:"bytes",id:4},sequence:{rule:"required",type:"uint32",id:5},decred_tree:{type:"uint32",id:9}}},PrevOutput:{fields:{amount:{rule:"required",type:"uint64",id:1},script_pubkey:{rule:"required",type:"bytes",id:2},decred_script_version:{type:"uint32",id:3}}},TxAckInput:{options:{"(wire_type)":22},fields:{tx:{rule:"required",type:"TxAckInputWrapper",id:1}},nested:{TxAckInputWrapper:{fields:{input:{rule:"required",type:"TxInput",id:2}}}}},TxAckOutput:{options:{"(wire_type)":22},fields:{tx:{rule:"required",type:"TxAckOutputWrapper",id:1}},nested:{TxAckOutputWrapper:{fields:{output:{rule:"required",type:"TxOutput",id:5}}}}},TxAckPrevMeta:{options:{"(wire_type)":22},fields:{tx:{rule:"required",type:"PrevTx",id:1}}},TxAckPrevInput:{options:{"(wire_type)":22},fields:{tx:{rule:"required",type:"TxAckPrevInputWrapper",id:1}},nested:{TxAckPrevInputWrapper:{fields:{input:{rule:"required",type:"PrevInput",id:2}}}}},TxAckPrevOutput:{options:{"(wire_type)":22},fields:{tx:{rule:"required",type:"TxAckPrevOutputWrapper",id:1}},nested:{TxAckPrevOutputWrapper:{fields:{output:{rule:"required",type:"PrevOutput",id:3}}}}},TxAckPrevExtraData:{options:{"(wire_type)":22},fields:{tx:{rule:"required",type:"TxAckPrevExtraDataWrapper",id:1}},nested:{TxAckPrevExtraDataWrapper:{fields:{extra_data_chunk:{rule:"required",type:"bytes",id:8}}}}},GetOwnershipProof:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},coin_name:{type:"string",id:2,options:{default:"Bitcoin"}},script_type:{type:"InputScriptType",id:3,options:{default:"SPENDWITNESS"}},multisig:{type:"MultisigRedeemScriptType",id:4},user_confirmation:{type:"bool",id:5,options:{default:!1}},ownership_ids:{rule:"repeated",type:"bytes",id:6},commitment_data:{type:"bytes",id:7,options:{default:""}}}},OwnershipProof:{fields:{ownership_proof:{rule:"required",type:"bytes",id:1},signature:{rule:"required",type:"bytes",id:2}}},AuthorizeCoinJoin:{options:{"(unstable)":!0},fields:{coordinator:{rule:"required",type:"string",id:1},max_total_fee:{rule:"required",type:"uint64",id:2},fee_per_anonymity:{type:"uint32",id:3,options:{default:0}},address_n:{rule:"repeated",type:"uint32",id:4,options:{packed:!1}},coin_name:{type:"string",id:5,options:{default:"Bitcoin"}},script_type:{type:"InputScriptType",id:6,options:{default:"SPENDADDRESS"}},amount_unit:{type:"AmountUnit",id:11,options:{default:"BITCOIN"}}}},GetPublicKeyMultiple:{fields:{addresses:{rule:"repeated",type:"BIP32Address",id:1},ecdsa_curve_name:{type:"string",id:2},show_display:{type:"bool",id:3},coin_name:{type:"string",id:4,options:{default:"Bitcoin"}},script_type:{type:"InputScriptType",id:5,options:{default:"SPENDADDRESS"}},ignore_xpub_magic:{type:"bool",id:6}},nested:{BIP32Address:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}}}}}},PublicKeyMultiple:{fields:{xpubs:{rule:"repeated",type:"string",id:1}}},FirmwareErase:{fields:{length:{type:"uint32",id:1}}},FirmwareRequest:{fields:{offset:{type:"uint32",id:1},length:{type:"uint32",id:2}}},FirmwareUpload:{fields:{payload:{rule:"required",type:"bytes",id:1},hash:{type:"bytes",id:2}}},SelfTest:{fields:{payload:{type:"bytes",id:1}}},FirmwareErase_ex:{fields:{length:{type:"uint32",id:1}}},RebootType:{values:{Normal:0,Boardloader:1,BootLoader:2}},Reboot:{fields:{reboot_type:{rule:"required",type:"RebootType",id:1}}},FirmwareUpdateEmmc:{fields:{path:{rule:"required",type:"string",id:1},reboot_on_success:{type:"bool",id:2}}},CardanoDerivationType:{values:{LEDGER:0,ICARUS:1,ICARUS_TREZOR:2}},CardanoAddressType:{values:{BASE:0,BASE_SCRIPT_KEY:1,BASE_KEY_SCRIPT:2,BASE_SCRIPT_SCRIPT:3,POINTER:4,POINTER_SCRIPT:5,ENTERPRISE:6,ENTERPRISE_SCRIPT:7,BYRON:8,REWARD:14,REWARD_SCRIPT:15}},CardanoNativeScriptType:{values:{PUB_KEY:0,ALL:1,ANY:2,N_OF_K:3,INVALID_BEFORE:4,INVALID_HEREAFTER:5}},CardanoNativeScriptHashDisplayFormat:{values:{HIDE:0,BECH32:1,POLICY_ID:2}},CardanoTxOutputSerializationFormat:{values:{ARRAY_LEGACY:0,MAP_BABBAGE:1}},CardanoCertificateType:{values:{STAKE_REGISTRATION:0,STAKE_DEREGISTRATION:1,STAKE_DELEGATION:2,STAKE_POOL_REGISTRATION:3}},CardanoPoolRelayType:{values:{SINGLE_HOST_IP:0,SINGLE_HOST_NAME:1,MULTIPLE_HOST_NAME:2}},CardanoTxAuxiliaryDataSupplementType:{values:{NONE:0,GOVERNANCE_REGISTRATION_SIGNATURE:1}},CardanoGovernanceRegistrationFormat:{values:{CIP15:0,CIP36:1}},CardanoTxSigningMode:{values:{ORDINARY_TRANSACTION:0,POOL_REGISTRATION_AS_OWNER:1,MULTISIG_TRANSACTION:2,PLUTUS_TRANSACTION:3}},CardanoTxWitnessType:{values:{BYRON_WITNESS:0,SHELLEY_WITNESS:1}},CardanoBlockchainPointerType:{fields:{block_index:{rule:"required",type:"uint32",id:1},tx_index:{rule:"required",type:"uint32",id:2},certificate_index:{rule:"required",type:"uint32",id:3}}},CardanoNativeScript:{fields:{type:{rule:"required",type:"CardanoNativeScriptType",id:1},scripts:{rule:"repeated",type:"CardanoNativeScript",id:2},key_hash:{type:"bytes",id:3},key_path:{rule:"repeated",type:"uint32",id:4,options:{packed:!1}},required_signatures_count:{type:"uint32",id:5},invalid_before:{type:"uint64",id:6},invalid_hereafter:{type:"uint64",id:7}}},CardanoGetNativeScriptHash:{fields:{script:{rule:"required",type:"CardanoNativeScript",id:1},display_format:{rule:"required",type:"CardanoNativeScriptHashDisplayFormat",id:2},derivation_type:{rule:"required",type:"CardanoDerivationType",id:3}}},CardanoNativeScriptHash:{fields:{script_hash:{rule:"required",type:"bytes",id:1}}},CardanoAddressParametersType:{fields:{address_type:{rule:"required",type:"CardanoAddressType",id:1},address_n:{rule:"repeated",type:"uint32",id:2,options:{packed:!1}},address_n_staking:{rule:"repeated",type:"uint32",id:3,options:{packed:!1}},staking_key_hash:{type:"bytes",id:4},certificate_pointer:{type:"CardanoBlockchainPointerType",id:5},script_payment_hash:{type:"bytes",id:6},script_staking_hash:{type:"bytes",id:7}}},CardanoGetAddress:{fields:{show_display:{type:"bool",id:2,options:{default:!1}},protocol_magic:{rule:"required",type:"uint32",id:3},network_id:{rule:"required",type:"uint32",id:4},address_parameters:{rule:"required",type:"CardanoAddressParametersType",id:5},derivation_type:{rule:"required",type:"CardanoDerivationType",id:6}}},CardanoAddress:{fields:{address:{rule:"required",type:"string",id:1}}},CardanoGetPublicKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2},derivation_type:{rule:"required",type:"CardanoDerivationType",id:3}}},CardanoPublicKey:{fields:{xpub:{rule:"required",type:"string",id:1},node:{rule:"required",type:"HDNodeType",id:2}}},CardanoSignTxInit:{fields:{signing_mode:{rule:"required",type:"CardanoTxSigningMode",id:1},protocol_magic:{rule:"required",type:"uint32",id:2},network_id:{rule:"required",type:"uint32",id:3},inputs_count:{rule:"required",type:"uint32",id:4},outputs_count:{rule:"required",type:"uint32",id:5},fee:{rule:"required",type:"uint64",id:6},ttl:{type:"uint64",id:7},certificates_count:{rule:"required",type:"uint32",id:8},withdrawals_count:{rule:"required",type:"uint32",id:9},has_auxiliary_data:{rule:"required",type:"bool",id:10},validity_interval_start:{type:"uint64",id:11},witness_requests_count:{rule:"required",type:"uint32",id:12},minting_asset_groups_count:{rule:"required",type:"uint32",id:13},derivation_type:{rule:"required",type:"CardanoDerivationType",id:14},include_network_id:{type:"bool",id:15,options:{default:!1}},script_data_hash:{type:"bytes",id:16},collateral_inputs_count:{rule:"required",type:"uint32",id:17},required_signers_count:{rule:"required",type:"uint32",id:18},has_collateral_return:{type:"bool",id:19,options:{default:!1}},total_collateral:{type:"uint64",id:20},reference_inputs_count:{type:"uint32",id:21,options:{default:0}}}},CardanoTxInput:{fields:{prev_hash:{rule:"required",type:"bytes",id:1},prev_index:{rule:"required",type:"uint32",id:2}}},CardanoTxOutput:{fields:{address:{type:"string",id:1},address_parameters:{type:"CardanoAddressParametersType",id:2},amount:{rule:"required",type:"uint64",id:3},asset_groups_count:{rule:"required",type:"uint32",id:4},datum_hash:{type:"bytes",id:5},format:{type:"CardanoTxOutputSerializationFormat",id:6,options:{default:"ARRAY_LEGACY"}},inline_datum_size:{type:"uint32",id:7,options:{default:0}},reference_script_size:{type:"uint32",id:8,options:{default:0}}}},CardanoAssetGroup:{fields:{policy_id:{rule:"required",type:"bytes",id:1},tokens_count:{rule:"required",type:"uint32",id:2}}},CardanoToken:{fields:{asset_name_bytes:{rule:"required",type:"bytes",id:1},amount:{type:"uint64",id:2},mint_amount:{type:"sint64",id:3}}},CardanoTxInlineDatumChunk:{fields:{data:{rule:"required",type:"bytes",id:1}}},CardanoTxReferenceScriptChunk:{fields:{data:{rule:"required",type:"bytes",id:1}}},CardanoPoolOwner:{fields:{staking_key_path:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},staking_key_hash:{type:"bytes",id:2}}},CardanoPoolRelayParameters:{fields:{type:{rule:"required",type:"CardanoPoolRelayType",id:1},ipv4_address:{type:"bytes",id:2},ipv6_address:{type:"bytes",id:3},host_name:{type:"string",id:4},port:{type:"uint32",id:5}}},CardanoPoolMetadataType:{fields:{url:{rule:"required",type:"string",id:1},hash:{rule:"required",type:"bytes",id:2}}},CardanoPoolParametersType:{fields:{pool_id:{rule:"required",type:"bytes",id:1},vrf_key_hash:{rule:"required",type:"bytes",id:2},pledge:{rule:"required",type:"uint64",id:3},cost:{rule:"required",type:"uint64",id:4},margin_numerator:{rule:"required",type:"uint64",id:5},margin_denominator:{rule:"required",type:"uint64",id:6},reward_account:{rule:"required",type:"string",id:7},metadata:{type:"CardanoPoolMetadataType",id:10},owners_count:{rule:"required",type:"uint32",id:11},relays_count:{rule:"required",type:"uint32",id:12}}},CardanoTxCertificate:{fields:{type:{rule:"required",type:"CardanoCertificateType",id:1},path:{rule:"repeated",type:"uint32",id:2,options:{packed:!1}},pool:{type:"bytes",id:3},pool_parameters:{type:"CardanoPoolParametersType",id:4},script_hash:{type:"bytes",id:5},key_hash:{type:"bytes",id:6}}},CardanoTxWithdrawal:{fields:{path:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},amount:{rule:"required",type:"uint64",id:2},script_hash:{type:"bytes",id:3},key_hash:{type:"bytes",id:4}}},CardanoGovernanceRegistrationDelegation:{fields:{voting_public_key:{rule:"required",type:"bytes",id:1},weight:{rule:"required",type:"uint32",id:2}}},CardanoGovernanceRegistrationParametersType:{fields:{voting_public_key:{type:"bytes",id:1},staking_path:{rule:"repeated",type:"uint32",id:2,options:{packed:!1}},reward_address_parameters:{rule:"required",type:"CardanoAddressParametersType",id:3},nonce:{rule:"required",type:"uint64",id:4},format:{type:"CardanoGovernanceRegistrationFormat",id:5,options:{default:"CIP15"}},delegations:{rule:"repeated",type:"CardanoGovernanceRegistrationDelegation",id:6},voting_purpose:{type:"uint64",id:7}}},CardanoTxAuxiliaryData:{fields:{governance_registration_parameters:{type:"CardanoGovernanceRegistrationParametersType",id:1},hash:{type:"bytes",id:2}}},CardanoTxMint:{fields:{asset_groups_count:{rule:"required",type:"uint32",id:1}}},CardanoTxCollateralInput:{fields:{prev_hash:{rule:"required",type:"bytes",id:1},prev_index:{rule:"required",type:"uint32",id:2}}},CardanoTxRequiredSigner:{fields:{key_hash:{type:"bytes",id:1},key_path:{rule:"repeated",type:"uint32",id:2,options:{packed:!1}}}},CardanoTxReferenceInput:{fields:{prev_hash:{rule:"required",type:"bytes",id:1},prev_index:{rule:"required",type:"uint32",id:2}}},CardanoTxItemAck:{fields:{}},CardanoTxAuxiliaryDataSupplement:{fields:{type:{rule:"required",type:"CardanoTxAuxiliaryDataSupplementType",id:1},auxiliary_data_hash:{type:"bytes",id:2},governance_signature:{type:"bytes",id:3}}},CardanoTxWitnessRequest:{fields:{path:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}}}},CardanoTxWitnessResponse:{fields:{type:{rule:"required",type:"CardanoTxWitnessType",id:1},pub_key:{rule:"required",type:"bytes",id:2},signature:{rule:"required",type:"bytes",id:3},chain_code:{type:"bytes",id:4}}},CardanoTxHostAck:{fields:{}},CardanoTxBodyHash:{fields:{tx_hash:{rule:"required",type:"bytes",id:1}}},CardanoSignTxFinished:{fields:{}},CardanoSignMessage:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},message:{rule:"required",type:"bytes",id:2},derivation_type:{rule:"required",type:"CardanoDerivationType",id:3},network_id:{rule:"required",type:"uint32",id:4}}},CardanoMessageSignature:{fields:{signature:{rule:"required",type:"bytes",id:1},key:{rule:"required",type:"bytes",id:2}}},Success:{fields:{message:{type:"string",id:1,options:{default:""}}}},Failure:{fields:{code:{type:"FailureType",id:1},message:{type:"string",id:2}},nested:{FailureType:{values:{Failure_UnexpectedMessage:1,Failure_ButtonExpected:2,Failure_DataError:3,Failure_ActionCancelled:4,Failure_PinExpected:5,Failure_PinCancelled:6,Failure_PinInvalid:7,Failure_InvalidSignature:8,Failure_ProcessError:9,Failure_NotEnoughFunds:10,Failure_NotInitialized:11,Failure_PinMismatch:12,Failure_WipeCodeMismatch:13,Failure_InvalidSession:14,Failure_FirmwareError:99}}}},ButtonRequest:{fields:{code:{type:"ButtonRequestType",id:1},pages:{type:"uint32",id:2}},nested:{ButtonRequestType:{values:{ButtonRequest_Other:1,ButtonRequest_FeeOverThreshold:2,ButtonRequest_ConfirmOutput:3,ButtonRequest_ResetDevice:4,ButtonRequest_ConfirmWord:5,ButtonRequest_WipeDevice:6,ButtonRequest_ProtectCall:7,ButtonRequest_SignTx:8,ButtonRequest_FirmwareCheck:9,ButtonRequest_Address:10,ButtonRequest_PublicKey:11,ButtonRequest_MnemonicWordCount:12,ButtonRequest_MnemonicInput:13,_Deprecated_ButtonRequest_PassphraseType:14,ButtonRequest_UnknownDerivationPath:15,ButtonRequest_RecoveryHomepage:16,ButtonRequest_Success:17,ButtonRequest_Warning:18,ButtonRequest_PassphraseEntry:19,ButtonRequest_PinEntry:20}}}},ButtonAck:{fields:{}},PinMatrixRequest:{fields:{type:{type:"PinMatrixRequestType",id:1}},nested:{PinMatrixRequestType:{values:{PinMatrixRequestType_Current:1,PinMatrixRequestType_NewFirst:2,PinMatrixRequestType_NewSecond:3,PinMatrixRequestType_WipeCodeFirst:4,PinMatrixRequestType_WipeCodeSecond:5,PinMatrixRequestType_BackupFirst:6,PinMatrixRequestType_BackupSecond:7}}}},PinMatrixAck:{fields:{pin:{rule:"required",type:"string",id:1},new_pin:{type:"string",id:2}}},PassphraseRequest:{fields:{_on_device:{type:"bool",id:1,options:{deprecated:!0}}}},PassphraseAck:{fields:{passphrase:{type:"string",id:1},_state:{type:"bytes",id:2,options:{deprecated:!0}},on_device:{type:"bool",id:3}}},Deprecated_PassphraseStateRequest:{options:{deprecated:!0},fields:{state:{type:"bytes",id:1}}},Deprecated_PassphraseStateAck:{options:{deprecated:!0},fields:{}},HDNodeType:{fields:{depth:{rule:"required",type:"uint32",id:1},fingerprint:{rule:"required",type:"uint32",id:2},child_num:{rule:"required",type:"uint32",id:3},chain_code:{rule:"required",type:"bytes",id:4},private_key:{type:"bytes",id:5},public_key:{rule:"required",type:"bytes",id:6}}},BixinPinInputOnDevice:{fields:{}},ConfluxGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2},chain_id:{type:"uint32",id:3}}},ConfluxAddress:{fields:{address:{type:"string",id:1}}},ConfluxSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},nonce:{type:"bytes",id:2},gas_price:{type:"bytes",id:3},gas_limit:{type:"bytes",id:4},to:{type:"string",id:5},value:{type:"bytes",id:6},epoch_height:{type:"bytes",id:7},storage_limit:{type:"bytes",id:8},data_initial_chunk:{type:"bytes",id:9},data_length:{type:"uint32",id:10},chain_id:{type:"uint32",id:11}}},ConfluxTxRequest:{fields:{data_length:{type:"uint32",id:1},signature_v:{type:"uint32",id:2},signature_r:{type:"bytes",id:3},signature_s:{type:"bytes",id:4}}},ConfluxTxAck:{fields:{data_chunk:{type:"bytes",id:1}}},ConfluxSignMessage:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},message:{type:"bytes",id:2}}},ConfluxMessageSignature:{fields:{signature:{type:"bytes",id:2},address:{type:"string",id:3}}},ConfluxSignMessageCIP23:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},domain_hash:{type:"bytes",id:2},message_hash:{type:"bytes",id:3}}},CosmosGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},hrp:{type:"string",id:2},show_display:{type:"bool",id:3}}},CosmosAddress:{fields:{address:{type:"string",id:1}}},CosmosSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},raw_tx:{rule:"required",type:"bytes",id:2}}},CosmosSignedTx:{fields:{signature:{rule:"required",type:"bytes",id:1}}},CipherKeyValue:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},key:{rule:"required",type:"string",id:2},value:{rule:"required",type:"bytes",id:3},encrypt:{type:"bool",id:4},ask_on_encrypt:{type:"bool",id:5},ask_on_decrypt:{type:"bool",id:6},iv:{type:"bytes",id:7}}},CipheredKeyValue:{fields:{value:{rule:"required",type:"bytes",id:1}}},IdentityType:{fields:{proto:{type:"string",id:1},user:{type:"string",id:2},host:{type:"string",id:3},port:{type:"string",id:4},path:{type:"string",id:5},index:{type:"uint32",id:6,options:{default:0}}}},SignIdentity:{fields:{identity:{rule:"required",type:"IdentityType",id:1},challenge_hidden:{type:"bytes",id:2,options:{default:""}},challenge_visual:{type:"string",id:3,options:{default:""}},ecdsa_curve_name:{type:"string",id:4}}},SignedIdentity:{fields:{address:{type:"string",id:1},public_key:{rule:"required",type:"bytes",id:2},signature:{rule:"required",type:"bytes",id:3}}},GetECDHSessionKey:{fields:{identity:{rule:"required",type:"IdentityType",id:1},peer_public_key:{rule:"required",type:"bytes",id:2},ecdsa_curve_name:{type:"string",id:3}}},ECDHSessionKey:{fields:{session_key:{rule:"required",type:"bytes",id:1},public_key:{type:"bytes",id:2}}},CosiCommit:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},data:{type:"bytes",id:2}}},CosiCommitment:{fields:{commitment:{type:"bytes",id:1},pubkey:{type:"bytes",id:2}}},CosiSign:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},data:{type:"bytes",id:2},global_commitment:{type:"bytes",id:3},global_pubkey:{type:"bytes",id:4}}},CosiSignature:{fields:{signature:{rule:"required",type:"bytes",id:1}}},BatchGetPublickeys:{fields:{ecdsa_curve_name:{type:"string",id:1,options:{default:"ed25519"}},paths:{rule:"repeated",type:"Path",id:2}},nested:{Path:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}}}}}},EcdsaPublicKeys:{fields:{public_keys:{rule:"repeated",type:"bytes",id:1}}},DebugLinkDecision:{fields:{yes_no:{type:"bool",id:1},swipe:{type:"DebugSwipeDirection",id:2},input:{type:"string",id:3},x:{type:"uint32",id:4},y:{type:"uint32",id:5},wait:{type:"bool",id:6},hold_ms:{type:"uint32",id:7}},nested:{DebugSwipeDirection:{values:{UP:0,DOWN:1,LEFT:2,RIGHT:3}}}},DebugLinkLayout:{fields:{lines:{rule:"repeated",type:"string",id:1}}},DebugLinkReseedRandom:{fields:{value:{type:"uint32",id:1}}},DebugLinkRecordScreen:{fields:{target_directory:{type:"string",id:1}}},DebugLinkGetState:{fields:{wait_word_list:{type:"bool",id:1},wait_word_pos:{type:"bool",id:2},wait_layout:{type:"bool",id:3}}},DebugLinkState:{fields:{layout:{type:"bytes",id:1},pin:{type:"string",id:2},matrix:{type:"string",id:3},mnemonic_secret:{type:"bytes",id:4},node:{type:"HDNodeType",id:5},passphrase_protection:{type:"bool",id:6},reset_word:{type:"string",id:7},reset_entropy:{type:"bytes",id:8},recovery_fake_word:{type:"string",id:9},recovery_word_pos:{type:"uint32",id:10},reset_word_pos:{type:"uint32",id:11},mnemonic_type:{type:"BackupType",id:12},layout_lines:{rule:"repeated",type:"string",id:13}}},DebugLinkStop:{fields:{}},DebugLinkLog:{fields:{level:{type:"uint32",id:1},bucket:{type:"string",id:2},text:{type:"string",id:3}}},DebugLinkMemoryRead:{fields:{address:{type:"uint32",id:1},length:{type:"uint32",id:2}}},DebugLinkMemory:{fields:{memory:{type:"bytes",id:1}}},DebugLinkMemoryWrite:{fields:{address:{type:"uint32",id:1},memory:{type:"bytes",id:2},flash:{type:"bool",id:3}}},DebugLinkFlashErase:{fields:{sector:{type:"uint32",id:1}}},DebugLinkEraseSdCard:{fields:{format:{type:"bool",id:1}}},DebugLinkWatchLayout:{fields:{watch:{type:"bool",id:1}}},EmmcFixPermission:{fields:{}},EmmcPath:{fields:{exist:{rule:"required",type:"bool",id:1},size:{rule:"required",type:"uint64",id:2},year:{rule:"required",type:"uint32",id:3},month:{rule:"required",type:"uint32",id:4},day:{rule:"required",type:"uint32",id:5},hour:{rule:"required",type:"uint32",id:6},minute:{rule:"required",type:"uint32",id:7},second:{rule:"required",type:"uint32",id:8},readonly:{rule:"required",type:"bool",id:9},hidden:{rule:"required",type:"bool",id:10},system:{rule:"required",type:"bool",id:11},archive:{rule:"required",type:"bool",id:12},directory:{rule:"required",type:"bool",id:13}}},EmmcPathInfo:{fields:{path:{rule:"required",type:"string",id:1}}},EmmcFile:{fields:{path:{rule:"required",type:"string",id:1},offset:{rule:"required",type:"uint32",id:2},len:{rule:"required",type:"uint32",id:3},data:{type:"bytes",id:4},data_hash:{type:"uint32",id:5},processed_byte:{type:"uint32",id:6}}},EmmcFileRead:{fields:{file:{rule:"required",type:"EmmcFile",id:1},ui_percentage:{type:"uint32",id:2}}},EmmcFileWrite:{fields:{file:{rule:"required",type:"EmmcFile",id:1},overwrite:{rule:"required",type:"bool",id:2},append:{rule:"required",type:"bool",id:3},ui_percentage:{type:"uint32",id:4}}},EmmcFileDelete:{fields:{path:{rule:"required",type:"string",id:1}}},EmmcDir:{fields:{path:{rule:"required",type:"string",id:1},child_dirs:{type:"string",id:2},child_files:{type:"string",id:3}}},EmmcDirList:{fields:{path:{rule:"required",type:"string",id:1}}},EmmcDirMake:{fields:{path:{rule:"required",type:"string",id:1}}},EmmcDirRemove:{fields:{path:{rule:"required",type:"string",id:1}}},EosGetPublicKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},EosPublicKey:{fields:{wif_public_key:{rule:"required",type:"string",id:1},raw_public_key:{rule:"required",type:"bytes",id:2}}},EosSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},chain_id:{type:"bytes",id:2},header:{type:"EosTxHeader",id:3},num_actions:{type:"uint32",id:4}},nested:{EosTxHeader:{fields:{expiration:{rule:"required",type:"uint32",id:1},ref_block_num:{rule:"required",type:"uint32",id:2},ref_block_prefix:{rule:"required",type:"uint32",id:3},max_net_usage_words:{rule:"required",type:"uint32",id:4},max_cpu_usage_ms:{rule:"required",type:"uint32",id:5},delay_sec:{rule:"required",type:"uint32",id:6}}}}},EosTxActionRequest:{fields:{data_size:{type:"uint32",id:1}}},EosTxActionAck:{fields:{common:{type:"EosActionCommon",id:1},transfer:{type:"EosActionTransfer",id:2},delegate:{type:"EosActionDelegate",id:3},undelegate:{type:"EosActionUndelegate",id:4},refund:{type:"EosActionRefund",id:5},buy_ram:{type:"EosActionBuyRam",id:6},buy_ram_bytes:{type:"EosActionBuyRamBytes",id:7},sell_ram:{type:"EosActionSellRam",id:8},vote_producer:{type:"EosActionVoteProducer",id:9},update_auth:{type:"EosActionUpdateAuth",id:10},delete_auth:{type:"EosActionDeleteAuth",id:11},link_auth:{type:"EosActionLinkAuth",id:12},unlink_auth:{type:"EosActionUnlinkAuth",id:13},new_account:{type:"EosActionNewAccount",id:14},unknown:{type:"EosActionUnknown",id:15}},nested:{EosAsset:{fields:{amount:{type:"sint64",id:1},symbol:{type:"uint64",id:2}}},EosPermissionLevel:{fields:{actor:{type:"uint64",id:1},permission:{type:"uint64",id:2}}},EosAuthorizationKey:{fields:{type:{rule:"required",type:"uint32",id:1},key:{type:"bytes",id:2},address_n:{rule:"repeated",type:"uint32",id:3,options:{packed:!1}},weight:{rule:"required",type:"uint32",id:4}}},EosAuthorizationAccount:{fields:{account:{type:"EosPermissionLevel",id:1},weight:{type:"uint32",id:2}}},EosAuthorizationWait:{fields:{wait_sec:{type:"uint32",id:1},weight:{type:"uint32",id:2}}},EosAuthorization:{fields:{threshold:{type:"uint32",id:1},keys:{rule:"repeated",type:"EosAuthorizationKey",id:2},accounts:{rule:"repeated",type:"EosAuthorizationAccount",id:3},waits:{rule:"repeated",type:"EosAuthorizationWait",id:4}}},EosActionCommon:{fields:{account:{type:"uint64",id:1},name:{type:"uint64",id:2},authorization:{rule:"repeated",type:"EosPermissionLevel",id:3}}},EosActionTransfer:{fields:{sender:{type:"uint64",id:1},receiver:{type:"uint64",id:2},quantity:{type:"EosAsset",id:3},memo:{type:"string",id:4}}},EosActionDelegate:{fields:{sender:{type:"uint64",id:1},receiver:{type:"uint64",id:2},net_quantity:{type:"EosAsset",id:3},cpu_quantity:{type:"EosAsset",id:4},transfer:{type:"bool",id:5}}},EosActionUndelegate:{fields:{sender:{type:"uint64",id:1},receiver:{type:"uint64",id:2},net_quantity:{type:"EosAsset",id:3},cpu_quantity:{type:"EosAsset",id:4}}},EosActionRefund:{fields:{owner:{type:"uint64",id:1}}},EosActionBuyRam:{fields:{payer:{type:"uint64",id:1},receiver:{type:"uint64",id:2},quantity:{type:"EosAsset",id:3}}},EosActionBuyRamBytes:{fields:{payer:{type:"uint64",id:1},receiver:{type:"uint64",id:2},bytes:{type:"uint32",id:3}}},EosActionSellRam:{fields:{account:{type:"uint64",id:1},bytes:{type:"uint64",id:2}}},EosActionVoteProducer:{fields:{voter:{type:"uint64",id:1},proxy:{type:"uint64",id:2},producers:{rule:"repeated",type:"uint64",id:3,options:{packed:!1}}}},EosActionUpdateAuth:{fields:{account:{type:"uint64",id:1},permission:{type:"uint64",id:2},parent:{type:"uint64",id:3},auth:{type:"EosAuthorization",id:4}}},EosActionDeleteAuth:{fields:{account:{type:"uint64",id:1},permission:{type:"uint64",id:2}}},EosActionLinkAuth:{fields:{account:{type:"uint64",id:1},code:{type:"uint64",id:2},type:{type:"uint64",id:3},requirement:{type:"uint64",id:4}}},EosActionUnlinkAuth:{fields:{account:{type:"uint64",id:1},code:{type:"uint64",id:2},type:{type:"uint64",id:3}}},EosActionNewAccount:{fields:{creator:{type:"uint64",id:1},name:{type:"uint64",id:2},owner:{type:"EosAuthorization",id:3},active:{type:"EosAuthorization",id:4}}},EosActionUnknown:{fields:{data_size:{rule:"required",type:"uint32",id:1},data_chunk:{type:"bytes",id:2}}}}},EosSignedTx:{fields:{signature:{rule:"required",type:"string",id:1}}},EthereumSignTypedData:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},primary_type:{rule:"required",type:"string",id:2},metamask_v4_compat:{type:"bool",id:3,options:{default:!0}},chain_id:{type:"uint64",id:4}}},EthereumTypedDataStructRequest:{fields:{name:{rule:"required",type:"string",id:1}}},EthereumTypedDataStructAck:{fields:{members:{rule:"repeated",type:"EthereumStructMember",id:1}},nested:{EthereumStructMember:{fields:{type:{rule:"required",type:"EthereumFieldType",id:1},name:{rule:"required",type:"string",id:2}}},EthereumFieldType:{fields:{data_type:{rule:"required",type:"EthereumDataType",id:1},size:{type:"uint32",id:2},entry_type:{type:"EthereumFieldType",id:3},struct_name:{type:"string",id:4}}},EthereumDataType:{values:{UINT:1,INT:2,BYTES:3,STRING:4,BOOL:5,ADDRESS:6,ARRAY:7,STRUCT:8}}}},EthereumTypedDataValueRequest:{fields:{member_path:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}}}},EthereumTypedDataValueAck:{fields:{value:{rule:"required",type:"bytes",id:1}}},EthereumGetPublicKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2},chain_id:{type:"uint64",id:3}}},EthereumPublicKey:{fields:{node:{rule:"required",type:"HDNodeType",id:1},xpub:{rule:"required",type:"string",id:2}}},EthereumGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2},chain_id:{type:"uint64",id:3}}},EthereumAddress:{fields:{_old_address:{type:"bytes",id:1,options:{deprecated:!0}},address:{type:"string",id:2}}},EthereumSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},nonce:{type:"bytes",id:2,options:{default:""}},gas_price:{rule:"required",type:"bytes",id:3},gas_limit:{rule:"required",type:"bytes",id:4},to:{type:"string",id:11,options:{default:""}},value:{type:"bytes",id:6,options:{default:""}},data_initial_chunk:{type:"bytes",id:7,options:{default:""}},data_length:{type:"uint32",id:8,options:{default:0}},chain_id:{rule:"required",type:"uint64",id:9},tx_type:{type:"uint32",id:10}}},EthereumSignTxEIP1559:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},nonce:{rule:"required",type:"bytes",id:2},max_gas_fee:{rule:"required",type:"bytes",id:3},max_priority_fee:{rule:"required",type:"bytes",id:4},gas_limit:{rule:"required",type:"bytes",id:5},to:{type:"string",id:6,options:{default:""}},value:{rule:"required",type:"bytes",id:7},data_initial_chunk:{type:"bytes",id:8,options:{default:""}},data_length:{rule:"required",type:"uint32",id:9},chain_id:{rule:"required",type:"uint64",id:10},access_list:{rule:"repeated",type:"EthereumAccessList",id:11}},nested:{EthereumAccessList:{fields:{address:{rule:"required",type:"string",id:1},storage_keys:{rule:"repeated",type:"bytes",id:2}}}}},EthereumTxRequest:{fields:{data_length:{type:"uint32",id:1},signature_v:{type:"uint32",id:2},signature_r:{type:"bytes",id:3},signature_s:{type:"bytes",id:4}}},EthereumTxAck:{fields:{data_chunk:{rule:"required",type:"bytes",id:1}}},EthereumSignMessage:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},message:{rule:"required",type:"bytes",id:2},chain_id:{type:"uint64",id:3}}},EthereumMessageSignature:{fields:{signature:{rule:"required",type:"bytes",id:2},address:{rule:"required",type:"string",id:3}}},EthereumVerifyMessage:{fields:{signature:{rule:"required",type:"bytes",id:2},message:{rule:"required",type:"bytes",id:3},address:{rule:"required",type:"string",id:4},chain_id:{type:"uint64",id:5}}},EthereumSignMessageEIP712:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},domain_hash:{type:"bytes",id:2},message_hash:{type:"bytes",id:3}}},EthereumSignTypedHash:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},domain_separator_hash:{rule:"required",type:"bytes",id:2},message_hash:{type:"bytes",id:3},chain_id:{type:"uint64",id:4}}},EthereumTypedDataSignature:{fields:{signature:{rule:"required",type:"bytes",id:1},address:{rule:"required",type:"string",id:2}}},FilecoinGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2},testnet:{type:"bool",id:3}}},FilecoinAddress:{fields:{address:{type:"string",id:1}}},FilecoinSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},raw_tx:{rule:"required",type:"bytes",id:2},testnet:{type:"bool",id:3}}},FilecoinSignedTx:{fields:{signature:{rule:"required",type:"bytes",id:1}}},KaspaGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2},prefix:{type:"string",id:3,options:{default:"kaspa"}},scheme:{type:"string",id:4,options:{default:"schnorr"}}}},KaspaAddress:{fields:{address:{rule:"required",type:"string",id:1}}},KaspaSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},raw_message:{rule:"required",type:"bytes",id:2},scheme:{type:"string",id:3,options:{default:"schnorr"}},prefix:{type:"string",id:4,options:{default:"kaspa"}},input_count:{type:"uint32",id:5,options:{default:1}}}},KaspaTxInputRequest:{fields:{request_index:{rule:"required",type:"uint32",id:1},signature:{type:"bytes",id:2}}},KaspaTxInputAck:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},raw_message:{rule:"required",type:"bytes",id:2}}},KaspaSignedTx:{fields:{signature:{rule:"required",type:"bytes",id:2}}},BackupType:{values:{Bip39:0,Slip39_Basic:1,Slip39_Advanced:2}},SafetyCheckLevel:{values:{Strict:0,PromptAlways:1,PromptTemporarily:2}},Initialize:{fields:{session_id:{type:"bytes",id:1},_skip_passphrase:{type:"bool",id:2,options:{deprecated:!0}},derive_cardano:{type:"bool",id:3}}},GetFeatures:{fields:{}},Features:{fields:{vendor:{type:"string",id:1},major_version:{rule:"required",type:"uint32",id:2},minor_version:{rule:"required",type:"uint32",id:3},patch_version:{rule:"required",type:"uint32",id:4},bootloader_mode:{type:"bool",id:5},device_id:{type:"string",id:6},pin_protection:{type:"bool",id:7},passphrase_protection:{type:"bool",id:8},language:{type:"string",id:9},label:{type:"string",id:10},initialized:{type:"bool",id:12},revision:{type:"bytes",id:13},bootloader_hash:{type:"bytes",id:14},imported:{type:"bool",id:15},unlocked:{type:"bool",id:16},_passphrase_cached:{type:"bool",id:17,options:{deprecated:!0}},firmware_present:{type:"bool",id:18},needs_backup:{type:"bool",id:19},flags:{type:"uint32",id:20},model:{type:"string",id:21},fw_major:{type:"uint32",id:22},fw_minor:{type:"uint32",id:23},fw_patch:{type:"uint32",id:24},fw_vendor:{type:"string",id:25},fw_vendor_keys:{type:"bytes",id:26},unfinished_backup:{type:"bool",id:27},no_backup:{type:"bool",id:28},recovery_mode:{type:"bool",id:29},capabilities:{rule:"repeated",type:"Capability",id:30,options:{packed:!1}},backup_type:{type:"BackupType",id:31},sd_card_present:{type:"bool",id:32},sd_protection:{type:"bool",id:33},wipe_code_protection:{type:"bool",id:34},session_id:{type:"bytes",id:35},passphrase_always_on_device:{type:"bool",id:36},safety_checks:{type:"SafetyCheckLevel",id:37},auto_lock_delay_ms:{type:"uint32",id:38},display_rotation:{type:"uint32",id:39},experimental_features:{type:"bool",id:40},offset:{type:"uint32",id:500},ble_name:{type:"string",id:501},ble_ver:{type:"string",id:502},ble_enable:{type:"bool",id:503},se_enable:{type:"bool",id:504},se_ver:{type:"string",id:506},backup_only:{type:"bool",id:507},ukey_version:{type:"string",id:508},ukey_serial:{type:"string",id:509},bootloader_version:{type:"string",id:510},serial_no:{type:"string",id:511},spi_flash:{type:"string",id:512},initstates:{type:"uint32",id:513},NFT_voucher:{type:"bytes",id:514},cpu_info:{type:"string",id:515},pre_firmware:{type:"string",id:516},coin_switch:{type:"uint32",id:517},build_id:{type:"string",id:518},battery_level:{type:"uint32",id:520}},nested:{Capability:{options:{"(has_bitcoin_only_values)":!0},values:{Capability_Bitcoin:1,Capability_Bitcoin_like:2,Capability_Binance:3,Capability_Cardano:4,Capability_Crypto:5,Capability_EOS:6,Capability_Ethereum:7,Capability_Lisk:8,Capability_Monero:9,Capability_NEM:10,Capability_Ripple:11,Capability_Stellar:12,Capability_Tezos:13,Capability_U2F:14,Capability_Shamir:15,Capability_ShamirGroups:16,Capability_PassphraseEntry:17}}}},LockDevice:{fields:{}},EndSession:{fields:{}},ApplySettings:{fields:{language:{type:"string",id:1},label:{type:"string",id:2},use_passphrase:{type:"bool",id:3},homescreen:{type:"bytes",id:4},_passphrase_source:{type:"uint32",id:5,options:{deprecated:!0}},auto_lock_delay_ms:{type:"uint32",id:6},display_rotation:{type:"uint32",id:7},passphrase_always_on_device:{type:"bool",id:8},safety_checks:{type:"SafetyCheckLevel",id:9},experimental_features:{type:"bool",id:10},use_ble:{type:"bool",id:100},use_se:{type:"bool",id:101},is_bixinapp:{type:"bool",id:102},fastpay_pin:{type:"bool",id:103},fastpay_confirm:{type:"bool",id:104},fastpay_money_limit:{type:"uint64",id:105},fastpay_times:{type:"uint32",id:106}},nested:{ExportType:{values:{SeedEncExportType_NO:0,SeedEncExportType_YES:1,MnemonicPlainExportType_YES:2}}}},ApplyFlags:{fields:{flags:{rule:"required",type:"uint32",id:1}}},ChangePin:{fields:{remove:{type:"bool",id:1}}},ChangeWipeCode:{fields:{remove:{type:"bool",id:1}}},SdProtect:{fields:{operation:{rule:"required",type:"SdProtectOperationType",id:1}},nested:{SdProtectOperationType:{values:{DISABLE:0,ENABLE:1,REFRESH:2}}}},Ping:{fields:{message:{type:"string",id:1,options:{default:""}},button_protection:{type:"bool",id:2}}},Cancel:{fields:{}},GetEntropy:{fields:{size:{rule:"required",type:"uint32",id:1}}},Entropy:{fields:{entropy:{rule:"required",type:"bytes",id:1}}},WipeDevice:{fields:{}},LoadDevice:{fields:{mnemonics:{rule:"repeated",type:"string",id:1},pin:{type:"string",id:3},passphrase_protection:{type:"bool",id:4},language:{type:"string",id:5,options:{default:"en-US"}},label:{type:"string",id:6},skip_checksum:{type:"bool",id:7},u2f_counter:{type:"uint32",id:8},needs_backup:{type:"bool",id:9},no_backup:{type:"bool",id:10}}},ResetDevice:{fields:{display_random:{type:"bool",id:1},strength:{type:"uint32",id:2,options:{default:256}},passphrase_protection:{type:"bool",id:3},pin_protection:{type:"bool",id:4},language:{type:"string",id:5,options:{default:"en-US"}},label:{type:"string",id:6},u2f_counter:{type:"uint32",id:7},skip_backup:{type:"bool",id:8},no_backup:{type:"bool",id:9},backup_type:{type:"BackupType",id:10,options:{default:"Bip39"}}}},BackupDevice:{fields:{}},EntropyRequest:{fields:{}},EntropyAck:{fields:{entropy:{rule:"required",type:"bytes",id:1}}},RecoveryDevice:{fields:{word_count:{type:"uint32",id:1},passphrase_protection:{type:"bool",id:2},pin_protection:{type:"bool",id:3},language:{type:"string",id:4},label:{type:"string",id:5},enforce_wordlist:{type:"bool",id:6},type:{type:"RecoveryDeviceType",id:8},u2f_counter:{type:"uint32",id:9},dry_run:{type:"bool",id:10}},nested:{RecoveryDeviceType:{values:{RecoveryDeviceType_ScrambledWords:0,RecoveryDeviceType_Matrix:1}}}},WordRequest:{fields:{type:{rule:"required",type:"WordRequestType",id:1}},nested:{WordRequestType:{values:{WordRequestType_Plain:0,WordRequestType_Matrix9:1,WordRequestType_Matrix6:2}}}},WordAck:{fields:{word:{rule:"required",type:"string",id:1}}},SetU2FCounter:{fields:{u2f_counter:{rule:"required",type:"uint32",id:1}}},GetNextU2FCounter:{fields:{}},NextU2FCounter:{fields:{u2f_counter:{rule:"required",type:"uint32",id:1}}},DoPreauthorized:{fields:{}},PreauthorizedRequest:{fields:{}},CancelAuthorization:{fields:{}},BixinSeedOperate:{fields:{type:{rule:"required",type:"SeedRequestType",id:1},seed_importData:{type:"bytes",id:2}},nested:{SeedRequestType:{values:{SeedRequestType_Gen:0,SeedRequestType_EncExport:1,SeedRequestType_EncImport:2}}}},BixinMessageSE:{fields:{inputmessage:{rule:"required",type:"bytes",id:1}}},BixinOutMessageSE:{fields:{outmessage:{type:"bytes",id:1}}},DeviceBackToBoot:{fields:{}},BixinBackupRequest:{fields:{}},BixinBackupAck:{fields:{data:{rule:"required",type:"bytes",id:1}}},BixinRestoreRequest:{fields:{data:{rule:"required",type:"bytes",id:1},language:{type:"string",id:2},label:{type:"string",id:3},passphrase_protection:{type:"bool",id:4}}},BixinRestoreAck:{fields:{data:{rule:"required",type:"bytes",id:1}}},BixinVerifyDeviceRequest:{fields:{data:{rule:"required",type:"bytes",id:1}}},BixinVerifyDeviceAck:{fields:{cert:{rule:"required",type:"bytes",id:1},signature:{rule:"required",type:"bytes",id:2}}},BixinWhiteListRequest:{fields:{type:{rule:"required",type:"WL_OperationType",id:1},addr_in:{type:"string",id:2}},nested:{WL_OperationType:{values:{WL_OperationType_Add:0,WL_OperationType_Delete:1,WL_OperationType_Inquire:2}}}},BixinWhiteListAck:{fields:{address:{rule:"repeated",type:"string",id:1}}},BixinLoadDevice:{fields:{mnemonics:{rule:"required",type:"string",id:1},language:{type:"string",id:5,options:{default:"en-US"}},label:{type:"string",id:6},skip_checksum:{type:"bool",id:7}}},BixinBackupDevice:{fields:{}},BixinBackupDeviceAck:{fields:{mnemonics:{rule:"required",type:"string",id:1}}},DeviceInfoSettings:{fields:{serial_no:{type:"string",id:1},cpu_info:{type:"string",id:2},pre_firmware:{type:"string",id:3}}},GetDeviceInfo:{fields:{}},DeviceInfo:{fields:{serial_no:{type:"string",id:1},spiFlash_info:{type:"string",id:2},SE_info:{type:"string",id:3},NFT_voucher:{type:"bytes",id:4},cpu_info:{type:"string",id:5},pre_firmware:{type:"string",id:6}}},ReadSEPublicKey:{fields:{}},SEPublicKey:{fields:{public_key:{rule:"required",type:"bytes",id:1}}},WriteSEPublicCert:{fields:{public_cert:{rule:"required",type:"bytes",id:1}}},ReadSEPublicCert:{fields:{}},SEPublicCert:{fields:{public_cert:{rule:"required",type:"bytes",id:1}}},SpiFlashWrite:{fields:{address:{rule:"required",type:"uint32",id:1},data:{rule:"required",type:"bytes",id:2}}},SpiFlashRead:{fields:{address:{rule:"required",type:"uint32",id:1},len:{rule:"required",type:"uint32",id:2}}},SpiFlashData:{fields:{data:{rule:"required",type:"bytes",id:1}}},SESignMessage:{fields:{message:{rule:"required",type:"bytes",id:1}}},SEMessageSignature:{fields:{signature:{rule:"required",type:"bytes",id:1}}},ResourceUpload:{fields:{extension:{rule:"required",type:"string",id:1},data_length:{rule:"required",type:"uint32",id:2},res_type:{rule:"required",type:"ResourceType",id:3},nft_meta_data:{type:"bytes",id:4},zoom_data_length:{rule:"required",type:"uint32",id:5},file_name_no_ext:{type:"string",id:6}},nested:{ResourceType:{values:{WallPaper:0,Nft:1}}}},ZoomRequest:{fields:{offset:{type:"uint32",id:1},data_length:{rule:"required",type:"uint32",id:2}}},ResourceRequest:{fields:{offset:{type:"uint32",id:1},data_length:{rule:"required",type:"uint32",id:2}}},ResourceAck:{fields:{data_chunk:{rule:"required",type:"bytes",id:1},hash:{type:"bytes",id:2}}},ResourceUpdate:{fields:{file_name:{rule:"required",type:"string",id:1},data_length:{rule:"required",type:"uint32",id:2},initial_data_chunk:{rule:"required",type:"bytes",id:3},hash:{type:"bytes",id:4}}},NFTWriteInfo:{fields:{index:{rule:"required",type:"uint32",id:1},width:{rule:"required",type:"uint32",id:2},height:{rule:"required",type:"uint32",id:3},name_zh:{type:"string",id:4},name_en:{type:"string",id:5}}},NFTWriteData:{fields:{index:{rule:"required",type:"uint32",id:1},data:{rule:"required",type:"bytes",id:2},offset:{rule:"required",type:"uint32",id:3}}},RebootToBootloader:{fields:{}},RebootToBoardloader:{fields:{}},ListResDir:{fields:{path:{rule:"required",type:"string",id:1}}},FileInfoList:{fields:{files:{rule:"repeated",type:"FileInfo",id:1}},nested:{FileInfo:{fields:{name:{rule:"required",type:"string",id:1},size:{rule:"required",type:"uint64",id:2}}}}},DeviceEraseSector:{fields:{sector:{rule:"required",type:"uint32",id:1}}},MoneroTransactionSourceEntry:{fields:{outputs:{rule:"repeated",type:"MoneroOutputEntry",id:1},real_output:{type:"uint64",id:2},real_out_tx_key:{type:"bytes",id:3},real_out_additional_tx_keys:{rule:"repeated",type:"bytes",id:4},real_output_in_tx_index:{type:"uint64",id:5},amount:{type:"uint64",id:6},rct:{type:"bool",id:7},mask:{type:"bytes",id:8},multisig_kLRki:{type:"MoneroMultisigKLRki",id:9},subaddr_minor:{type:"uint32",id:10}},nested:{MoneroOutputEntry:{fields:{idx:{type:"uint64",id:1},key:{type:"MoneroRctKeyPublic",id:2}},nested:{MoneroRctKeyPublic:{fields:{dest:{type:"bytes",id:1},commitment:{type:"bytes",id:2}}}}},MoneroMultisigKLRki:{fields:{K:{type:"bytes",id:1},L:{type:"bytes",id:2},R:{type:"bytes",id:3},ki:{type:"bytes",id:4}}}}},MoneroTransactionDestinationEntry:{fields:{amount:{type:"uint64",id:1},addr:{type:"MoneroAccountPublicAddress",id:2},is_subaddress:{type:"bool",id:3},original:{type:"bytes",id:4},is_integrated:{type:"bool",id:5}},nested:{MoneroAccountPublicAddress:{fields:{spend_public_key:{type:"bytes",id:1},view_public_key:{type:"bytes",id:2}}}}},MoneroTransactionRsigData:{fields:{rsig_type:{type:"uint32",id:1},offload_type:{type:"uint32",id:2},grouping:{rule:"repeated",type:"uint64",id:3,options:{packed:!1}},mask:{type:"bytes",id:4},rsig:{type:"bytes",id:5},rsig_parts:{rule:"repeated",type:"bytes",id:6},bp_version:{type:"uint32",id:7}}},MoneroGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2},network_type:{type:"uint32",id:3},account:{type:"uint32",id:4},minor:{type:"uint32",id:5},payment_id:{type:"bytes",id:6}}},MoneroAddress:{fields:{address:{type:"bytes",id:1}}},MoneroGetWatchKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},network_type:{type:"uint32",id:2}}},MoneroWatchKey:{fields:{watch_key:{type:"bytes",id:1},address:{type:"bytes",id:2}}},MoneroTransactionInitRequest:{fields:{version:{type:"uint32",id:1},address_n:{rule:"repeated",type:"uint32",id:2,options:{packed:!1}},network_type:{type:"uint32",id:3},tsx_data:{type:"MoneroTransactionData",id:4}},nested:{MoneroTransactionData:{fields:{version:{type:"uint32",id:1},payment_id:{type:"bytes",id:2},unlock_time:{type:"uint64",id:3},outputs:{rule:"repeated",type:"MoneroTransactionDestinationEntry",id:4},change_dts:{type:"MoneroTransactionDestinationEntry",id:5},num_inputs:{type:"uint32",id:6},mixin:{type:"uint32",id:7},fee:{type:"uint64",id:8},account:{type:"uint32",id:9},minor_indices:{rule:"repeated",type:"uint32",id:10,options:{packed:!1}},rsig_data:{type:"MoneroTransactionRsigData",id:11},integrated_indices:{rule:"repeated",type:"uint32",id:12,options:{packed:!1}},client_version:{type:"uint32",id:13},hard_fork:{type:"uint32",id:14},monero_version:{type:"bytes",id:15}}}}},MoneroTransactionInitAck:{fields:{hmacs:{rule:"repeated",type:"bytes",id:1},rsig_data:{type:"MoneroTransactionRsigData",id:2}}},MoneroTransactionSetInputRequest:{fields:{src_entr:{type:"MoneroTransactionSourceEntry",id:1}}},MoneroTransactionSetInputAck:{fields:{vini:{type:"bytes",id:1},vini_hmac:{type:"bytes",id:2},pseudo_out:{type:"bytes",id:3},pseudo_out_hmac:{type:"bytes",id:4},pseudo_out_alpha:{type:"bytes",id:5},spend_key:{type:"bytes",id:6}}},MoneroTransactionInputsPermutationRequest:{fields:{perm:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}}}},MoneroTransactionInputsPermutationAck:{fields:{}},MoneroTransactionInputViniRequest:{fields:{src_entr:{type:"MoneroTransactionSourceEntry",id:1},vini:{type:"bytes",id:2},vini_hmac:{type:"bytes",id:3},pseudo_out:{type:"bytes",id:4},pseudo_out_hmac:{type:"bytes",id:5},orig_idx:{type:"uint32",id:6}}},MoneroTransactionInputViniAck:{fields:{}},MoneroTransactionAllInputsSetRequest:{fields:{}},MoneroTransactionAllInputsSetAck:{fields:{rsig_data:{type:"MoneroTransactionRsigData",id:1}}},MoneroTransactionSetOutputRequest:{fields:{dst_entr:{type:"MoneroTransactionDestinationEntry",id:1},dst_entr_hmac:{type:"bytes",id:2},rsig_data:{type:"MoneroTransactionRsigData",id:3},is_offloaded_bp:{type:"bool",id:4}}},MoneroTransactionSetOutputAck:{fields:{tx_out:{type:"bytes",id:1},vouti_hmac:{type:"bytes",id:2},rsig_data:{type:"MoneroTransactionRsigData",id:3},out_pk:{type:"bytes",id:4},ecdh_info:{type:"bytes",id:5}}},MoneroTransactionAllOutSetRequest:{fields:{rsig_data:{type:"MoneroTransactionRsigData",id:1}}},MoneroTransactionAllOutSetAck:{fields:{extra:{type:"bytes",id:1},tx_prefix_hash:{type:"bytes",id:2},rv:{type:"MoneroRingCtSig",id:4},full_message_hash:{type:"bytes",id:5}},nested:{MoneroRingCtSig:{fields:{txn_fee:{type:"uint64",id:1},message:{type:"bytes",id:2},rv_type:{type:"uint32",id:3}}}}},MoneroTransactionSignInputRequest:{fields:{src_entr:{type:"MoneroTransactionSourceEntry",id:1},vini:{type:"bytes",id:2},vini_hmac:{type:"bytes",id:3},pseudo_out:{type:"bytes",id:4},pseudo_out_hmac:{type:"bytes",id:5},pseudo_out_alpha:{type:"bytes",id:6},spend_key:{type:"bytes",id:7},orig_idx:{type:"uint32",id:8}}},MoneroTransactionSignInputAck:{fields:{signature:{type:"bytes",id:1},pseudo_out:{type:"bytes",id:2}}},MoneroTransactionFinalRequest:{fields:{}},MoneroTransactionFinalAck:{fields:{cout_key:{type:"bytes",id:1},salt:{type:"bytes",id:2},rand_mult:{type:"bytes",id:3},tx_enc_keys:{type:"bytes",id:4},opening_key:{type:"bytes",id:5}}},MoneroKeyImageExportInitRequest:{fields:{num:{type:"uint64",id:1},hash:{type:"bytes",id:2},address_n:{rule:"repeated",type:"uint32",id:3,options:{packed:!1}},network_type:{type:"uint32",id:4},subs:{rule:"repeated",type:"MoneroSubAddressIndicesList",id:5}},nested:{MoneroSubAddressIndicesList:{fields:{account:{type:"uint32",id:1},minor_indices:{rule:"repeated",type:"uint32",id:2,options:{packed:!1}}}}}},MoneroKeyImageExportInitAck:{fields:{}},MoneroKeyImageSyncStepRequest:{fields:{tdis:{rule:"repeated",type:"MoneroTransferDetails",id:1}},nested:{MoneroTransferDetails:{fields:{out_key:{type:"bytes",id:1},tx_pub_key:{type:"bytes",id:2},additional_tx_pub_keys:{rule:"repeated",type:"bytes",id:3},internal_output_index:{type:"uint64",id:4},sub_addr_major:{type:"uint32",id:5},sub_addr_minor:{type:"uint32",id:6}}}}},MoneroKeyImageSyncStepAck:{fields:{kis:{rule:"repeated",type:"MoneroExportedKeyImage",id:1}},nested:{MoneroExportedKeyImage:{fields:{iv:{type:"bytes",id:1},blob:{type:"bytes",id:3}}}}},MoneroKeyImageSyncFinalRequest:{fields:{}},MoneroKeyImageSyncFinalAck:{fields:{enc_key:{type:"bytes",id:1}}},MoneroGetTxKeyRequest:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},network_type:{type:"uint32",id:2},salt1:{type:"bytes",id:3},salt2:{type:"bytes",id:4},tx_enc_keys:{type:"bytes",id:5},tx_prefix_hash:{type:"bytes",id:6},reason:{type:"uint32",id:7},view_public_key:{type:"bytes",id:8}}},MoneroGetTxKeyAck:{fields:{salt:{type:"bytes",id:1},tx_keys:{type:"bytes",id:2},tx_derivations:{type:"bytes",id:3}}},MoneroLiveRefreshStartRequest:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},network_type:{type:"uint32",id:2}}},MoneroLiveRefreshStartAck:{fields:{}},MoneroLiveRefreshStepRequest:{fields:{out_key:{type:"bytes",id:1},recv_deriv:{type:"bytes",id:2},real_out_idx:{type:"uint64",id:3},sub_addr_major:{type:"uint32",id:4},sub_addr_minor:{type:"uint32",id:5}}},MoneroLiveRefreshStepAck:{fields:{salt:{type:"bytes",id:1},key_image:{type:"bytes",id:2}}},MoneroLiveRefreshFinalRequest:{fields:{}},MoneroLiveRefreshFinalAck:{fields:{}},DebugMoneroDiagRequest:{fields:{ins:{type:"uint64",id:1},p1:{type:"uint64",id:2},p2:{type:"uint64",id:3},pd:{rule:"repeated",type:"uint64",id:4,options:{packed:!1}},data1:{type:"bytes",id:5},data2:{type:"bytes",id:6}}},DebugMoneroDiagAck:{fields:{ins:{type:"uint64",id:1},p1:{type:"uint64",id:2},p2:{type:"uint64",id:3},pd:{rule:"repeated",type:"uint64",id:4,options:{packed:!1}},data1:{type:"bytes",id:5},data2:{type:"bytes",id:6}}},NearGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},NearAddress:{fields:{address:{type:"string",id:1}}},NearSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},raw_tx:{rule:"required",type:"bytes",id:2}}},NearSignedTx:{fields:{signature:{rule:"required",type:"bytes",id:1}}},NEMGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},network:{type:"uint32",id:2},show_display:{type:"bool",id:3}}},NEMAddress:{fields:{address:{rule:"required",type:"string",id:1}}},NEMSignTx:{fields:{transaction:{type:"NEMTransactionCommon",id:1},multisig:{type:"NEMTransactionCommon",id:2},transfer:{type:"NEMTransfer",id:3},cosigning:{type:"bool",id:4},provision_namespace:{type:"NEMProvisionNamespace",id:5},mosaic_creation:{type:"NEMMosaicCreation",id:6},supply_change:{type:"NEMMosaicSupplyChange",id:7},aggregate_modification:{type:"NEMAggregateModification",id:8},importance_transfer:{type:"NEMImportanceTransfer",id:9}},nested:{NEMTransactionCommon:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},network:{type:"uint32",id:2},timestamp:{type:"uint32",id:3},fee:{type:"uint64",id:4},deadline:{type:"uint32",id:5},signer:{type:"bytes",id:6}}},NEMTransfer:{fields:{recipient:{type:"string",id:1},amount:{type:"uint64",id:2},payload:{type:"bytes",id:3},public_key:{type:"bytes",id:4},mosaics:{rule:"repeated",type:"NEMMosaic",id:5}},nested:{NEMMosaic:{fields:{namespace:{type:"string",id:1},mosaic:{type:"string",id:2},quantity:{type:"uint64",id:3}}}}},NEMProvisionNamespace:{fields:{namespace:{type:"string",id:1},parent:{type:"string",id:2},sink:{type:"string",id:3},fee:{type:"uint64",id:4}}},NEMMosaicCreation:{fields:{definition:{type:"NEMMosaicDefinition",id:1},sink:{type:"string",id:2},fee:{type:"uint64",id:3}},nested:{NEMMosaicDefinition:{fields:{name:{type:"string",id:1},ticker:{type:"string",id:2},namespace:{type:"string",id:3},mosaic:{type:"string",id:4},divisibility:{type:"uint32",id:5},levy:{type:"NEMMosaicLevy",id:6},fee:{type:"uint64",id:7},levy_address:{type:"string",id:8},levy_namespace:{type:"string",id:9},levy_mosaic:{type:"string",id:10},supply:{type:"uint64",id:11},mutable_supply:{type:"bool",id:12},transferable:{type:"bool",id:13},description:{type:"string",id:14},networks:{rule:"repeated",type:"uint32",id:15,options:{packed:!1}}},nested:{NEMMosaicLevy:{values:{MosaicLevy_Absolute:1,MosaicLevy_Percentile:2}}}}}},NEMMosaicSupplyChange:{fields:{namespace:{type:"string",id:1},mosaic:{type:"string",id:2},type:{type:"NEMSupplyChangeType",id:3},delta:{type:"uint64",id:4}},nested:{NEMSupplyChangeType:{values:{SupplyChange_Increase:1,SupplyChange_Decrease:2}}}},NEMAggregateModification:{fields:{modifications:{rule:"repeated",type:"NEMCosignatoryModification",id:1},relative_change:{type:"sint32",id:2}},nested:{NEMCosignatoryModification:{fields:{type:{type:"NEMModificationType",id:1},public_key:{type:"bytes",id:2}},nested:{NEMModificationType:{values:{CosignatoryModification_Add:1,CosignatoryModification_Delete:2}}}}}},NEMImportanceTransfer:{fields:{mode:{type:"NEMImportanceTransferMode",id:1},public_key:{type:"bytes",id:2}},nested:{NEMImportanceTransferMode:{values:{ImportanceTransfer_Activate:1,ImportanceTransfer_Deactivate:2}}}}}},NEMSignedTx:{fields:{data:{rule:"required",type:"bytes",id:1},signature:{rule:"required",type:"bytes",id:2}}},NEMDecryptMessage:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},network:{type:"uint32",id:2},public_key:{type:"bytes",id:3},payload:{type:"bytes",id:4}}},NEMDecryptedMessage:{fields:{payload:{rule:"required",type:"bytes",id:1}}},NexaGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2},prefix:{type:"string",id:3,options:{default:"nexa"}}}},NexaAddress:{fields:{address:{rule:"required",type:"string",id:1},public_key:{rule:"required",type:"bytes",id:2}}},NexaSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},raw_message:{rule:"required",type:"bytes",id:2},prefix:{type:"string",id:3,options:{default:"nexa"}},input_count:{type:"uint32",id:4,options:{default:1}}}},NexaTxInputRequest:{fields:{request_index:{rule:"required",type:"uint32",id:1},signature:{type:"bytes",id:2}}},NexaTxInputAck:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},raw_message:{rule:"required",type:"bytes",id:2}}},NexaSignedTx:{fields:{signature:{rule:"required",type:"bytes",id:1}}},PolkadotGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},prefix:{rule:"required",type:"uint32",id:2},network:{rule:"required",type:"string",id:3},show_display:{type:"bool",id:4}}},PolkadotAddress:{fields:{address:{type:"string",id:1},public_key:{type:"string",id:2}}},PolkadotSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},raw_tx:{rule:"required",type:"bytes",id:2},network:{rule:"required",type:"string",id:3}}},PolkadotSignedTx:{fields:{signature:{rule:"required",type:"bytes",id:1}}},RippleGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},RippleAddress:{fields:{address:{rule:"required",type:"string",id:1}}},RippleSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},fee:{type:"uint64",id:2},flags:{type:"uint32",id:3},sequence:{type:"uint32",id:4},last_ledger_sequence:{type:"uint32",id:5},payment:{type:"RipplePayment",id:6}},nested:{RipplePayment:{fields:{amount:{rule:"required",type:"uint64",id:1},destination:{rule:"required",type:"string",id:2},destination_tag:{type:"uint32",id:3}}}}},RippleSignedTx:{fields:{signature:{rule:"required",type:"bytes",id:1},serialized_tx:{rule:"required",type:"bytes",id:2}}},SolanaGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},SolanaAddress:{fields:{address:{type:"string",id:1}}},SolanaSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},raw_tx:{rule:"required",type:"bytes",id:2}}},SolanaSignedTx:{fields:{signature:{type:"bytes",id:1}}},StarcoinGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},StarcoinAddress:{fields:{address:{type:"string",id:1}}},StarcoinGetPublicKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},StarcoinPublicKey:{fields:{public_key:{rule:"required",type:"bytes",id:1}}},StarcoinSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},raw_tx:{type:"bytes",id:2}}},StarcoinSignedTx:{fields:{public_key:{rule:"required",type:"bytes",id:1},signature:{rule:"required",type:"bytes",id:2}}},StarcoinSignMessage:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},message:{type:"bytes",id:2}}},StarcoinMessageSignature:{fields:{public_key:{rule:"required",type:"bytes",id:1},signature:{rule:"required",type:"bytes",id:2}}},StarcoinVerifyMessage:{fields:{public_key:{type:"bytes",id:1},signature:{type:"bytes",id:2},message:{type:"bytes",id:3}}},StellarAssetType:{values:{NATIVE:0,ALPHANUM4:1,ALPHANUM12:2}},StellarAsset:{fields:{type:{rule:"required",type:"StellarAssetType",id:1},code:{type:"string",id:2},issuer:{type:"string",id:3}}},StellarGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},StellarAddress:{fields:{address:{rule:"required",type:"string",id:1}}},StellarSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:2,options:{packed:!1}},network_passphrase:{rule:"required",type:"string",id:3},source_account:{rule:"required",type:"string",id:4},fee:{rule:"required",type:"uint32",id:5},sequence_number:{rule:"required",type:"uint64",id:6},timebounds_start:{rule:"required",type:"uint32",id:8},timebounds_end:{rule:"required",type:"uint32",id:9},memo_type:{rule:"required",type:"StellarMemoType",id:10},memo_text:{type:"string",id:11},memo_id:{type:"uint64",id:12},memo_hash:{type:"bytes",id:13},num_operations:{rule:"required",type:"uint32",id:14}},nested:{StellarMemoType:{values:{NONE:0,TEXT:1,ID:2,HASH:3,RETURN:4}}}},StellarTxOpRequest:{fields:{}},StellarPaymentOp:{fields:{source_account:{type:"string",id:1},destination_account:{rule:"required",type:"string",id:2},asset:{rule:"required",type:"StellarAsset",id:3},amount:{rule:"required",type:"sint64",id:4}}},StellarCreateAccountOp:{fields:{source_account:{type:"string",id:1},new_account:{rule:"required",type:"string",id:2},starting_balance:{rule:"required",type:"sint64",id:3}}},StellarPathPaymentStrictReceiveOp:{fields:{source_account:{type:"string",id:1},send_asset:{rule:"required",type:"StellarAsset",id:2},send_max:{rule:"required",type:"sint64",id:3},destination_account:{rule:"required",type:"string",id:4},destination_asset:{rule:"required",type:"StellarAsset",id:5},destination_amount:{rule:"required",type:"sint64",id:6},paths:{rule:"repeated",type:"StellarAsset",id:7}}},StellarPathPaymentStrictSendOp:{fields:{source_account:{type:"string",id:1},send_asset:{rule:"required",type:"StellarAsset",id:2},send_amount:{rule:"required",type:"sint64",id:3},destination_account:{rule:"required",type:"string",id:4},destination_asset:{rule:"required",type:"StellarAsset",id:5},destination_min:{rule:"required",type:"sint64",id:6},paths:{rule:"repeated",type:"StellarAsset",id:7}}},StellarManageSellOfferOp:{fields:{source_account:{type:"string",id:1},selling_asset:{rule:"required",type:"StellarAsset",id:2},buying_asset:{rule:"required",type:"StellarAsset",id:3},amount:{rule:"required",type:"sint64",id:4},price_n:{rule:"required",type:"uint32",id:5},price_d:{rule:"required",type:"uint32",id:6},offer_id:{rule:"required",type:"uint64",id:7}}},StellarManageBuyOfferOp:{fields:{source_account:{type:"string",id:1},selling_asset:{rule:"required",type:"StellarAsset",id:2},buying_asset:{rule:"required",type:"StellarAsset",id:3},amount:{rule:"required",type:"sint64",id:4},price_n:{rule:"required",type:"uint32",id:5},price_d:{rule:"required",type:"uint32",id:6},offer_id:{rule:"required",type:"uint64",id:7}}},StellarCreatePassiveSellOfferOp:{fields:{source_account:{type:"string",id:1},selling_asset:{rule:"required",type:"StellarAsset",id:2},buying_asset:{rule:"required",type:"StellarAsset",id:3},amount:{rule:"required",type:"sint64",id:4},price_n:{rule:"required",type:"uint32",id:5},price_d:{rule:"required",type:"uint32",id:6}}},StellarSetOptionsOp:{fields:{source_account:{type:"string",id:1},inflation_destination_account:{type:"string",id:2},clear_flags:{type:"uint32",id:3},set_flags:{type:"uint32",id:4},master_weight:{type:"uint32",id:5},low_threshold:{type:"uint32",id:6},medium_threshold:{type:"uint32",id:7},high_threshold:{type:"uint32",id:8},home_domain:{type:"string",id:9},signer_type:{type:"StellarSignerType",id:10},signer_key:{type:"bytes",id:11},signer_weight:{type:"uint32",id:12}},nested:{StellarSignerType:{values:{ACCOUNT:0,PRE_AUTH:1,HASH:2}}}},StellarChangeTrustOp:{fields:{source_account:{type:"string",id:1},asset:{rule:"required",type:"StellarAsset",id:2},limit:{rule:"required",type:"uint64",id:3}}},StellarAllowTrustOp:{fields:{source_account:{type:"string",id:1},trusted_account:{rule:"required",type:"string",id:2},asset_type:{rule:"required",type:"StellarAssetType",id:3},asset_code:{type:"string",id:4},is_authorized:{rule:"required",type:"bool",id:5}}},StellarAccountMergeOp:{fields:{source_account:{type:"string",id:1},destination_account:{rule:"required",type:"string",id:2}}},StellarManageDataOp:{fields:{source_account:{type:"string",id:1},key:{rule:"required",type:"string",id:2},value:{type:"bytes",id:3}}},StellarBumpSequenceOp:{fields:{source_account:{type:"string",id:1},bump_to:{rule:"required",type:"uint64",id:2}}},StellarSignedTx:{fields:{public_key:{rule:"required",type:"bytes",id:1},signature:{rule:"required",type:"bytes",id:2}}},SuiGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},SuiAddress:{fields:{address:{type:"string",id:1}}},SuiSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},raw_tx:{rule:"required",type:"bytes",id:2}}},SuiSignedTx:{fields:{public_key:{rule:"required",type:"bytes",id:1},signature:{rule:"required",type:"bytes",id:2}}},TezosGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},TezosAddress:{fields:{address:{rule:"required",type:"string",id:1}}},TezosGetPublicKey:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},TezosPublicKey:{fields:{public_key:{rule:"required",type:"string",id:1}}},TezosSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},branch:{rule:"required",type:"bytes",id:2},reveal:{type:"TezosRevealOp",id:3},transaction:{type:"TezosTransactionOp",id:4},origination:{type:"TezosOriginationOp",id:5},delegation:{type:"TezosDelegationOp",id:6},proposal:{type:"TezosProposalOp",id:7},ballot:{type:"TezosBallotOp",id:8}},nested:{TezosContractID:{fields:{tag:{rule:"required",type:"TezosContractType",id:1},hash:{rule:"required",type:"bytes",id:2}},nested:{TezosContractType:{values:{Implicit:0,Originated:1}}}},TezosRevealOp:{fields:{source:{rule:"required",type:"bytes",id:7},fee:{rule:"required",type:"uint64",id:2},counter:{rule:"required",type:"uint64",id:3},gas_limit:{rule:"required",type:"uint64",id:4},storage_limit:{rule:"required",type:"uint64",id:5},public_key:{rule:"required",type:"bytes",id:6}}},TezosTransactionOp:{fields:{source:{rule:"required",type:"bytes",id:9},fee:{rule:"required",type:"uint64",id:2},counter:{rule:"required",type:"uint64",id:3},gas_limit:{rule:"required",type:"uint64",id:4},storage_limit:{rule:"required",type:"uint64",id:5},amount:{rule:"required",type:"uint64",id:6},destination:{rule:"required",type:"TezosContractID",id:7},parameters:{type:"bytes",id:8},parameters_manager:{type:"TezosParametersManager",id:10}},nested:{TezosParametersManager:{fields:{set_delegate:{type:"bytes",id:1},cancel_delegate:{type:"bool",id:2},transfer:{type:"TezosManagerTransfer",id:3}},nested:{TezosManagerTransfer:{fields:{destination:{type:"TezosContractID",id:1},amount:{type:"uint64",id:2}}}}}}},TezosOriginationOp:{fields:{source:{rule:"required",type:"bytes",id:12},fee:{rule:"required",type:"uint64",id:2},counter:{rule:"required",type:"uint64",id:3},gas_limit:{rule:"required",type:"uint64",id:4},storage_limit:{rule:"required",type:"uint64",id:5},manager_pubkey:{type:"bytes",id:6},balance:{rule:"required",type:"uint64",id:7},spendable:{type:"bool",id:8},delegatable:{type:"bool",id:9},delegate:{type:"bytes",id:10},script:{rule:"required",type:"bytes",id:11}}},TezosDelegationOp:{fields:{source:{rule:"required",type:"bytes",id:7},fee:{rule:"required",type:"uint64",id:2},counter:{rule:"required",type:"uint64",id:3},gas_limit:{rule:"required",type:"uint64",id:4},storage_limit:{rule:"required",type:"uint64",id:5},delegate:{rule:"required",type:"bytes",id:6}}},TezosProposalOp:{fields:{source:{type:"bytes",id:1},period:{type:"uint64",id:2},proposals:{rule:"repeated",type:"bytes",id:4}}},TezosBallotOp:{fields:{source:{type:"bytes",id:1},period:{type:"uint64",id:2},proposal:{type:"bytes",id:3},ballot:{type:"TezosBallotType",id:4}},nested:{TezosBallotType:{values:{Yay:0,Nay:1,Pass:2}}}}}},TezosSignedTx:{fields:{signature:{rule:"required",type:"string",id:1},sig_op_contents:{rule:"required",type:"bytes",id:2},operation_hash:{rule:"required",type:"string",id:3}}},TronGetAddress:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},show_display:{type:"bool",id:2}}},TronAddress:{fields:{address:{type:"string",id:1}}},TronSignTx:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},ref_block_bytes:{rule:"required",type:"bytes",id:2},ref_block_hash:{rule:"required",type:"bytes",id:3},expiration:{rule:"required",type:"uint64",id:4},data:{type:"string",id:5},contract:{rule:"required",type:"TronContract",id:6},timestamp:{rule:"required",type:"uint64",id:7},fee_limit:{type:"uint64",id:8}},nested:{TronContract:{fields:{transfer_contract:{type:"TronTransferContract",id:2},freeze_balance_contract:{type:"TronFreezeBalanceContract",id:11},unfreeze_balance_contract:{type:"TronUnfreezeBalanceContract",id:12},withdraw_balance_contract:{type:"TronWithdrawBalanceContract",id:13},trigger_smart_contract:{type:"TronTriggerSmartContract",id:31},freeze_balance_v2_contract:{type:"TronFreezeBalanceV2Contract",id:54},unfreeze_balance_v2_contract:{type:"TronUnfreezeBalanceV2Contract",id:55},withdraw_expire_unfreeze_contract:{type:"TronWithdrawExpireUnfreezeContract",id:56},delegate_resource_contract:{type:"TronDelegateResourceContract",id:57},undelegate_resource_contract:{type:"TronUnDelegateResourceContract",id:58}},nested:{TronTransferContract:{fields:{to_address:{type:"string",id:2},amount:{type:"uint64",id:3}}},TronTriggerSmartContract:{fields:{contract_address:{type:"string",id:2},call_value:{type:"uint64",id:3},data:{type:"bytes",id:4},call_token_value:{type:"uint64",id:5},asset_id:{type:"uint64",id:6}}},TronResourceCode:{values:{BANDWIDTH:0,ENERGY:1}},TronFreezeBalanceContract:{fields:{frozen_balance:{type:"uint64",id:1},frozen_duration:{type:"uint64",id:2},resource:{type:"TronResourceCode",id:3},receiver_address:{type:"string",id:4}}},TronUnfreezeBalanceContract:{fields:{resource:{type:"TronResourceCode",id:1},receiver_address:{type:"string",id:2}}},TronWithdrawBalanceContract:{fields:{owner_address:{type:"bytes",id:1}}},TronFreezeBalanceV2Contract:{fields:{frozen_balance:{type:"uint64",id:2},resource:{type:"TronResourceCode",id:3}}},TronUnfreezeBalanceV2Contract:{fields:{unfreeze_balance:{type:"uint64",id:2},resource:{type:"TronResourceCode",id:3}}},TronWithdrawExpireUnfreezeContract:{fields:{}},TronDelegateResourceContract:{fields:{resource:{type:"TronResourceCode",id:2},balance:{type:"uint64",id:3},receiver_address:{type:"string",id:4},lock:{type:"bool",id:5}}},TronUnDelegateResourceContract:{fields:{resource:{type:"TronResourceCode",id:2},balance:{type:"uint64",id:3},receiver_address:{type:"string",id:4}}}}}}},TronSignedTx:{fields:{signature:{rule:"required",type:"bytes",id:1},serialized_tx:{type:"bytes",id:2}}},TronSignMessage:{fields:{address_n:{rule:"repeated",type:"uint32",id:1,options:{packed:!1}},message:{rule:"required",type:"bytes",id:2}}},TronMessageSignature:{fields:{address:{rule:"required",type:"bytes",id:1},signature:{rule:"required",type:"bytes",id:2}}},WebAuthnListResidentCredentials:{fields:{}},WebAuthnAddResidentCredential:{fields:{credential_id:{type:"bytes",id:1}}},WebAuthnRemoveResidentCredential:{fields:{index:{type:"uint32",id:1}}},WebAuthnCredentials:{fields:{credentials:{rule:"repeated",type:"WebAuthnCredential",id:1}},nested:{WebAuthnCredential:{fields:{index:{type:"uint32",id:1},id:{type:"bytes",id:2},rp_id:{type:"string",id:3},rp_name:{type:"string",id:4},user_id:{type:"bytes",id:5},user_name:{type:"string",id:6},user_display_name:{type:"string",id:7},creation_time:{type:"uint32",id:8},hmac_secret:{type:"bool",id:9},use_sign_count:{type:"bool",id:10},algorithm:{type:"sint32",id:11},curve:{type:"sint32",id:12}}}}},wire_in:{type:"bool",id:50002,extend:"google.protobuf.EnumValueOptions"},wire_out:{type:"bool",id:50003,extend:"google.protobuf.EnumValueOptions"},wire_debug_in:{type:"bool",id:50004,extend:"google.protobuf.EnumValueOptions"},wire_debug_out:{type:"bool",id:50005,extend:"google.protobuf.EnumValueOptions"},wire_tiny:{type:"bool",id:50006,extend:"google.protobuf.EnumValueOptions"},wire_bootloader:{type:"bool",id:50007,extend:"google.protobuf.EnumValueOptions"},wire_no_fsm:{type:"bool",id:50008,extend:"google.protobuf.EnumValueOptions"},facotry:{type:"bool",id:50501,extend:"google.protobuf.EnumValueOptions"},bitcoin_only:{type:"bool",id:6e4,extend:"google.protobuf.EnumValueOptions"},has_bitcoin_only_values:{type:"bool",id:51001,extend:"google.protobuf.EnumOptions"},unstable:{type:"bool",id:52001,extend:"google.protobuf.MessageOptions"},wire_type:{type:"uint32",id:52002,extend:"google.protobuf.MessageOptions"},experimental:{type:"bool",id:53001,extend:"google.protobuf.FieldOptions"},include_in_bitcoin_only:{type:"bool",id:6e4,extend:"google.protobuf.FileOptions"},CommandFlags:{values:{Default:0,Factory_Only:1}},MessageType:{options:{"(has_bitcoin_only_values)":!0},values:{MessageType_Initialize:0,MessageType_Ping:1,MessageType_Success:2,MessageType_Failure:3,MessageType_ChangePin:4,MessageType_WipeDevice:5,MessageType_GetEntropy:9,MessageType_Entropy:10,MessageType_LoadDevice:13,MessageType_ResetDevice:14,MessageType_Features:17,MessageType_PinMatrixRequest:18,MessageType_PinMatrixAck:19,MessageType_Cancel:20,MessageType_LockDevice:24,MessageType_ApplySettings:25,MessageType_ButtonRequest:26,MessageType_ButtonAck:27,MessageType_ApplyFlags:28,MessageType_BackupDevice:34,MessageType_EntropyRequest:35,MessageType_EntropyAck:36,MessageType_PassphraseRequest:41,MessageType_PassphraseAck:42,MessageType_RecoveryDevice:45,MessageType_WordRequest:46,MessageType_WordAck:47,MessageType_GetFeatures:55,MessageType_SdProtect:79,MessageType_ChangeWipeCode:82,MessageType_EndSession:83,MessageType_DoPreauthorized:84,MessageType_PreauthorizedRequest:85,MessageType_CancelAuthorization:86,MessageType_RebootToBootloader:87,MessageType_SetU2FCounter:63,MessageType_GetNextU2FCounter:80,MessageType_NextU2FCounter:81,MessageType_Deprecated_PassphraseStateRequest:77,MessageType_Deprecated_PassphraseStateAck:78,MessageType_FirmwareErase:6,MessageType_FirmwareErase_ex:16,MessageType_FirmwareUpload:7,MessageType_FirmwareRequest:8,MessageType_SelfTest:32,MessageType_Reboot:3e4,MessageType_FirmwareUpdateEmmc:30001,MessageType_GetPublicKey:11,MessageType_PublicKey:12,MessageType_SignTx:15,MessageType_TxRequest:21,MessageType_TxAck:22,MessageType_GetAddress:29,MessageType_Address:30,MessageType_SignMessage:38,MessageType_VerifyMessage:39,MessageType_MessageSignature:40,MessageType_GetOwnershipId:43,MessageType_OwnershipId:44,MessageType_GetOwnershipProof:49,MessageType_OwnershipProof:50,MessageType_AuthorizeCoinJoin:51,MessageType_CipherKeyValue:23,MessageType_CipheredKeyValue:48,MessageType_SignIdentity:53,MessageType_SignedIdentity:54,MessageType_GetECDHSessionKey:61,MessageType_ECDHSessionKey:62,MessageType_CosiCommit:71,MessageType_CosiCommitment:72,MessageType_CosiSign:73,MessageType_CosiSignature:74,MessageType_BatchGetPublickeys:10016,MessageType_EcdsaPublicKeys:10017,MessageType_DebugLinkDecision:100,MessageType_DebugLinkGetState:101,MessageType_DebugLinkState:102,MessageType_DebugLinkStop:103,MessageType_DebugLinkLog:104,MessageType_DebugLinkMemoryRead:110,MessageType_DebugLinkMemory:111,MessageType_DebugLinkMemoryWrite:112,MessageType_DebugLinkFlashErase:113,MessageType_DebugLinkLayout:9001,MessageType_DebugLinkReseedRandom:9002,MessageType_DebugLinkRecordScreen:9003,MessageType_DebugLinkEraseSdCard:9005,MessageType_DebugLinkWatchLayout:9006,MessageType_EmmcFixPermission:30100,MessageType_EmmcPath:30101,MessageType_EmmcPathInfo:30102,MessageType_EmmcFile:30103,MessageType_EmmcFileRead:30104,MessageType_EmmcFileWrite:30105,MessageType_EmmcFileDelete:30106,MessageType_EmmcDir:30107,MessageType_EmmcDirList:30108,MessageType_EmmcDirMake:30109,MessageType_EmmcDirRemove:30110,MessageType_EthereumGetPublicKey:450,MessageType_EthereumPublicKey:451,MessageType_EthereumGetAddress:56,MessageType_EthereumAddress:57,MessageType_EthereumSignTx:58,MessageType_EthereumSignTxEIP1559:452,MessageType_EthereumTxRequest:59,MessageType_EthereumTxAck:60,MessageType_EthereumSignMessage:64,MessageType_EthereumVerifyMessage:65,MessageType_EthereumMessageSignature:66,MessageType_EthereumSignTypedData:464,MessageType_EthereumTypedDataStructRequest:465,MessageType_EthereumTypedDataStructAck:466,MessageType_EthereumTypedDataValueRequest:467,MessageType_EthereumTypedDataValueAck:468,MessageType_EthereumTypedDataSignature:469,MessageType_EthereumSignTypedHash:470,MessageType_NEMGetAddress:67,MessageType_NEMAddress:68,MessageType_NEMSignTx:69,MessageType_NEMSignedTx:70,MessageType_NEMDecryptMessage:75,MessageType_NEMDecryptedMessage:76,MessageType_TezosGetAddress:150,MessageType_TezosAddress:151,MessageType_TezosSignTx:152,MessageType_TezosSignedTx:153,MessageType_TezosGetPublicKey:154,MessageType_TezosPublicKey:155,MessageType_StellarSignTx:202,MessageType_StellarTxOpRequest:203,MessageType_StellarGetAddress:207,MessageType_StellarAddress:208,MessageType_StellarCreateAccountOp:210,MessageType_StellarPaymentOp:211,MessageType_StellarPathPaymentStrictReceiveOp:212,MessageType_StellarManageSellOfferOp:213,MessageType_StellarCreatePassiveSellOfferOp:214,MessageType_StellarSetOptionsOp:215,MessageType_StellarChangeTrustOp:216,MessageType_StellarAllowTrustOp:217,MessageType_StellarAccountMergeOp:218,MessageType_StellarManageDataOp:220,MessageType_StellarBumpSequenceOp:221,MessageType_StellarManageBuyOfferOp:222,MessageType_StellarPathPaymentStrictSendOp:223,MessageType_StellarSignedTx:230,MessageType_CardanoGetPublicKey:305,MessageType_CardanoPublicKey:306,MessageType_CardanoGetAddress:307,MessageType_CardanoAddress:308,MessageType_CardanoTxItemAck:313,MessageType_CardanoTxAuxiliaryDataSupplement:314,MessageType_CardanoTxWitnessRequest:315,MessageType_CardanoTxWitnessResponse:316,MessageType_CardanoTxHostAck:317,MessageType_CardanoTxBodyHash:318,MessageType_CardanoSignTxFinished:319,MessageType_CardanoSignTxInit:320,MessageType_CardanoTxInput:321,MessageType_CardanoTxOutput:322,MessageType_CardanoAssetGroup:323,MessageType_CardanoToken:324,MessageType_CardanoTxCertificate:325,MessageType_CardanoTxWithdrawal:326,MessageType_CardanoTxAuxiliaryData:327,MessageType_CardanoPoolOwner:328,MessageType_CardanoPoolRelayParameters:329,MessageType_CardanoGetNativeScriptHash:330,MessageType_CardanoNativeScriptHash:331,MessageType_CardanoTxMint:332,MessageType_CardanoTxCollateralInput:333,MessageType_CardanoTxRequiredSigner:334,MessageType_CardanoTxInlineDatumChunk:335,MessageType_CardanoTxReferenceScriptChunk:336,MessageType_CardanoTxReferenceInput:337,MessageType_CardanoSignMessage:350,MessageType_CardanoMessageSignature:351,MessageType_RippleGetAddress:400,MessageType_RippleAddress:401,MessageType_RippleSignTx:402,MessageType_RippleSignedTx:403,MessageType_MoneroTransactionInitRequest:501,MessageType_MoneroTransactionInitAck:502,MessageType_MoneroTransactionSetInputRequest:503,MessageType_MoneroTransactionSetInputAck:504,MessageType_MoneroTransactionInputsPermutationRequest:505,MessageType_MoneroTransactionInputsPermutationAck:506,MessageType_MoneroTransactionInputViniRequest:507,MessageType_MoneroTransactionInputViniAck:508,MessageType_MoneroTransactionAllInputsSetRequest:509,MessageType_MoneroTransactionAllInputsSetAck:510,MessageType_MoneroTransactionSetOutputRequest:511,MessageType_MoneroTransactionSetOutputAck:512,MessageType_MoneroTransactionAllOutSetRequest:513,MessageType_MoneroTransactionAllOutSetAck:514,MessageType_MoneroTransactionSignInputRequest:515,MessageType_MoneroTransactionSignInputAck:516,MessageType_MoneroTransactionFinalRequest:517,MessageType_MoneroTransactionFinalAck:518,MessageType_MoneroKeyImageExportInitRequest:530,MessageType_MoneroKeyImageExportInitAck:531,MessageType_MoneroKeyImageSyncStepRequest:532,MessageType_MoneroKeyImageSyncStepAck:533,MessageType_MoneroKeyImageSyncFinalRequest:534,MessageType_MoneroKeyImageSyncFinalAck:535,MessageType_MoneroGetAddress:540,MessageType_MoneroAddress:541,MessageType_MoneroGetWatchKey:542,MessageType_MoneroWatchKey:543,MessageType_DebugMoneroDiagRequest:546,MessageType_DebugMoneroDiagAck:547,MessageType_MoneroGetTxKeyRequest:550,MessageType_MoneroGetTxKeyAck:551,MessageType_MoneroLiveRefreshStartRequest:552,MessageType_MoneroLiveRefreshStartAck:553,MessageType_MoneroLiveRefreshStepRequest:554,MessageType_MoneroLiveRefreshStepAck:555,MessageType_MoneroLiveRefreshFinalRequest:556,MessageType_MoneroLiveRefreshFinalAck:557,MessageType_EosGetPublicKey:600,MessageType_EosPublicKey:601,MessageType_EosSignTx:602,MessageType_EosTxActionRequest:603,MessageType_EosTxActionAck:604,MessageType_EosSignedTx:605,MessageType_BinanceGetAddress:700,MessageType_BinanceAddress:701,MessageType_BinanceGetPublicKey:702,MessageType_BinancePublicKey:703,MessageType_BinanceSignTx:704,MessageType_BinanceTxRequest:705,MessageType_BinanceTransferMsg:706,MessageType_BinanceOrderMsg:707,MessageType_BinanceCancelMsg:708,MessageType_BinanceSignedTx:709,MessageType_SolanaGetAddress:10100,MessageType_SolanaAddress:10101,MessageType_SolanaSignTx:10102,MessageType_SolanaSignedTx:10103,MessageType_StarcoinGetAddress:10300,MessageType_StarcoinAddress:10301,MessageType_StarcoinGetPublicKey:10302,MessageType_StarcoinPublicKey:10303,MessageType_StarcoinSignTx:10304,MessageType_StarcoinSignedTx:10305,MessageType_StarcoinSignMessage:10306,MessageType_StarcoinMessageSignature:10307,MessageType_StarcoinVerifyMessage:10308,MessageType_AptosGetAddress:10600,MessageType_AptosAddress:10601,MessageType_AptosSignTx:10602,MessageType_AptosSignedTx:10603,MessageType_AptosSignMessage:10604,MessageType_AptosMessageSignature:10605,MessageType_WebAuthnListResidentCredentials:800,MessageType_WebAuthnCredentials:801,MessageType_WebAuthnAddResidentCredential:802,MessageType_WebAuthnRemoveResidentCredential:803,MessageType_BixinSeedOperate:901,MessageType_BixinMessageSE:902,MessageType_BixinOutMessageSE:904,MessageType_BixinBackupRequest:905,MessageType_BixinBackupAck:906,MessageType_BixinRestoreRequest:907,MessageType_BixinRestoreAck:908,MessageType_BixinVerifyDeviceRequest:909,MessageType_BixinVerifyDeviceAck:910,MessageType_BixinWhiteListRequest:911,MessageType_BixinWhiteListAck:912,MessageType_BixinLoadDevice:913,MessageType_BixinBackupDevice:914,MessageType_BixinBackupDeviceAck:915,MessageType_BixinPinInputOnDevice:1e4,MessageType_EthereumSignMessageEIP712:10200,MessageType_GetPublicKeyMultiple:10210,MessageType_PublicKeyMultiple:10211,MessageType_ConfluxGetAddress:10112,MessageType_ConfluxAddress:10113,MessageType_ConfluxSignTx:10114,MessageType_ConfluxTxRequest:10115,MessageType_ConfluxTxAck:10116,MessageType_ConfluxSignMessage:10117,MessageType_ConfluxSignMessageCIP23:10118,MessageType_ConfluxMessageSignature:10119,MessageType_TronGetAddress:10501,MessageType_TronAddress:10502,MessageType_TronSignTx:10503,MessageType_TronSignedTx:10504,MessageType_TronSignMessage:10505,MessageType_TronMessageSignature:10506,MessageType_NearGetAddress:10701,MessageType_NearAddress:10702,MessageType_NearSignTx:10703,MessageType_NearSignedTx:10704,MessageType_CosmosGetAddress:10800,MessageType_CosmosAddress:10801,MessageType_CosmosSignTx:10802,MessageType_CosmosSignedTx:10803,MessageType_AlgorandGetAddress:10900,MessageType_AlgorandAddress:10901,MessageType_AlgorandSignTx:10902,MessageType_AlgorandSignedTx:10903,MessageType_PolkadotGetAddress:11e3,MessageType_PolkadotAddress:11001,MessageType_PolkadotSignTx:11002,MessageType_PolkadotSignedTx:11003,MessageType_SuiGetAddress:11100,MessageType_SuiAddress:11101,MessageType_SuiSignTx:11102,MessageType_SuiSignedTx:11103,MessageType_FilecoinGetAddress:11200,MessageType_FilecoinAddress:11201,MessageType_FilecoinSignTx:11202,MessageType_FilecoinSignedTx:11203,MessageType_KaspaGetAddress:11300,MessageType_KaspaAddress:11301,MessageType_KaspaSignTx:11302,MessageType_KaspaSignedTx:11303,MessageType_KaspaTxInputRequest:11304,MessageType_KaspaTxInputAck:11305,MessageType_NexaGetAddress:11400,MessageType_NexaAddress:11401,MessageType_NexaSignTx:11402,MessageType_NexaSignedTx:11403,MessageType_NexaTxInputRequest:11404,MessageType_NexaTxInputAck:11405,MessageType_DeviceBackToBoot:903,MessageType_DeviceInfoSettings:10001,MessageType_GetDeviceInfo:10002,MessageType_DeviceInfo:10003,MessageType_ReadSEPublicKey:10004,MessageType_SEPublicKey:10005,MessageType_WriteSEPublicCert:10006,MessageType_ReadSEPublicCert:10007,MessageType_SEPublicCert:10008,MessageType_SpiFlashWrite:10009,MessageType_SpiFlashRead:10010,MessageType_SpiFlashData:10011,MessageType_SESignMessage:10012,MessageType_SEMessageSignature:10013,MessageType_NFTWriteInfo:10014,MessageType_NFTWriteData:10015,MessageType_ResourceUpload:10018,MessageType_ZoomRequest:10019,MessageType_ResourceRequest:10020,MessageType_ResourceAck:10021,MessageType_ResourceUpdate:10022,MessageType_ListResDir:10023,MessageType_FileInfoList:10024,MessageType_RebootToBoardloader:10025,MessageType_DeviceEraseSector:10026}},google:{nested:{protobuf:{nested:{FileDescriptorSet:{fields:{file:{rule:"repeated",type:"FileDescriptorProto",id:1}}},FileDescriptorProto:{fields:{name:{type:"string",id:1},package:{type:"string",id:2},dependency:{rule:"repeated",type:"string",id:3},public_dependency:{rule:"repeated",type:"int32",id:10,options:{packed:!1}},weak_dependency:{rule:"repeated",type:"int32",id:11,options:{packed:!1}},message_type:{rule:"repeated",type:"DescriptorProto",id:4},enum_type:{rule:"repeated",type:"EnumDescriptorProto",id:5},service:{rule:"repeated",type:"ServiceDescriptorProto",id:6},extension:{rule:"repeated",type:"FieldDescriptorProto",id:7},options:{type:"FileOptions",id:8},source_code_info:{type:"SourceCodeInfo",id:9},syntax:{type:"string",id:12}}},DescriptorProto:{fields:{name:{type:"string",id:1},field:{rule:"repeated",type:"FieldDescriptorProto",id:2},extension:{rule:"repeated",type:"FieldDescriptorProto",id:6},nested_type:{rule:"repeated",type:"DescriptorProto",id:3},enum_type:{rule:"repeated",type:"EnumDescriptorProto",id:4},extension_range:{rule:"repeated",type:"ExtensionRange",id:5},oneof_decl:{rule:"repeated",type:"OneofDescriptorProto",id:8},options:{type:"MessageOptions",id:7},reserved_range:{rule:"repeated",type:"ReservedRange",id:9},reserved_name:{rule:"repeated",type:"string",id:10}},nested:{ExtensionRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}},ReservedRange:{fields:{start:{type:"int32",id:1},end:{type:"int32",id:2}}}}},FieldDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:3},label:{type:"Label",id:4},type:{type:"Type",id:5},type_name:{type:"string",id:6},extendee:{type:"string",id:2},default_value:{type:"string",id:7},oneof_index:{type:"int32",id:9},json_name:{type:"string",id:10},options:{type:"FieldOptions",id:8}},nested:{Type:{values:{TYPE_DOUBLE:1,TYPE_FLOAT:2,TYPE_INT64:3,TYPE_UINT64:4,TYPE_INT32:5,TYPE_FIXED64:6,TYPE_FIXED32:7,TYPE_BOOL:8,TYPE_STRING:9,TYPE_GROUP:10,TYPE_MESSAGE:11,TYPE_BYTES:12,TYPE_UINT32:13,TYPE_ENUM:14,TYPE_SFIXED32:15,TYPE_SFIXED64:16,TYPE_SINT32:17,TYPE_SINT64:18}},Label:{values:{LABEL_OPTIONAL:1,LABEL_REQUIRED:2,LABEL_REPEATED:3}}}},OneofDescriptorProto:{fields:{name:{type:"string",id:1},options:{type:"OneofOptions",id:2}}},EnumDescriptorProto:{fields:{name:{type:"string",id:1},value:{rule:"repeated",type:"EnumValueDescriptorProto",id:2},options:{type:"EnumOptions",id:3}}},EnumValueDescriptorProto:{fields:{name:{type:"string",id:1},number:{type:"int32",id:2},options:{type:"EnumValueOptions",id:3}}},ServiceDescriptorProto:{fields:{name:{type:"string",id:1},method:{rule:"repeated",type:"MethodDescriptorProto",id:2},options:{type:"ServiceOptions",id:3}}},MethodDescriptorProto:{fields:{name:{type:"string",id:1},input_type:{type:"string",id:2},output_type:{type:"string",id:3},options:{type:"MethodOptions",id:4},client_streaming:{type:"bool",id:5},server_streaming:{type:"bool",id:6}}},FileOptions:{fields:{java_package:{type:"string",id:1},java_outer_classname:{type:"string",id:8},java_multiple_files:{type:"bool",id:10},java_generate_equals_and_hash:{type:"bool",id:20,options:{deprecated:!0}},java_string_check_utf8:{type:"bool",id:27},optimize_for:{type:"OptimizeMode",id:9,options:{default:"SPEED"}},go_package:{type:"string",id:11},cc_generic_services:{type:"bool",id:16},java_generic_services:{type:"bool",id:17},py_generic_services:{type:"bool",id:18},deprecated:{type:"bool",id:23},cc_enable_arenas:{type:"bool",id:31},objc_class_prefix:{type:"string",id:36},csharp_namespace:{type:"string",id:37},uninterpreted_option:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[38,38]],nested:{OptimizeMode:{values:{SPEED:1,CODE_SIZE:2,LITE_RUNTIME:3}}}},MessageOptions:{fields:{message_set_wire_format:{type:"bool",id:1},no_standard_descriptor_accessor:{type:"bool",id:2},deprecated:{type:"bool",id:3},map_entry:{type:"bool",id:7},uninterpreted_option:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[8,8]]},FieldOptions:{fields:{ctype:{type:"CType",id:1,options:{default:"STRING"}},packed:{type:"bool",id:2},jstype:{type:"JSType",id:6,options:{default:"JS_NORMAL"}},lazy:{type:"bool",id:5},deprecated:{type:"bool",id:3},weak:{type:"bool",id:10},uninterpreted_option:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]],reserved:[[4,4]],nested:{CType:{values:{STRING:0,CORD:1,STRING_PIECE:2}},JSType:{values:{JS_NORMAL:0,JS_STRING:1,JS_NUMBER:2}}}},OneofOptions:{fields:{uninterpreted_option:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumOptions:{fields:{allow_alias:{type:"bool",id:2},deprecated:{type:"bool",id:3},uninterpreted_option:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},EnumValueOptions:{fields:{deprecated:{type:"bool",id:1},uninterpreted_option:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},ServiceOptions:{fields:{deprecated:{type:"bool",id:33},uninterpreted_option:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},MethodOptions:{fields:{deprecated:{type:"bool",id:33},uninterpreted_option:{rule:"repeated",type:"UninterpretedOption",id:999}},extensions:[[1e3,536870911]]},UninterpretedOption:{fields:{name:{rule:"repeated",type:"NamePart",id:2},identifier_value:{type:"string",id:3},positive_int_value:{type:"uint64",id:4},negative_int_value:{type:"int64",id:5},double_value:{type:"double",id:6},string_value:{type:"bytes",id:7},aggregate_value:{type:"string",id:8}},nested:{NamePart:{fields:{name_part:{rule:"required",type:"string",id:1},is_extension:{rule:"required",type:"bool",id:2}}}}},SourceCodeInfo:{fields:{location:{rule:"repeated",type:"Location",id:1}},nested:{Location:{fields:{path:{rule:"repeated",type:"int32",id:1},span:{rule:"repeated",type:"int32",id:2},leading_comments:{type:"string",id:3},trailing_comments:{type:"string",id:4},leading_detached_comments:{rule:"repeated",type:"string",id:6}}}}},GeneratedCodeInfo:{fields:{annotation:{rule:"repeated",type:"Annotation",id:1}},nested:{Annotation:{fields:{path:{rule:"repeated",type:"int32",id:1},source_file:{type:"string",id:2},begin:{type:"int32",id:3},end:{type:"int32",id:4}}}}}}}}}}};const We=(e,t)=>{const r=e.filter((e=>b.default.gt(e.version.join("."),t)));return 0===r.length?"valid":r.some((e=>e.required))?"required":"outdated"},Ve=(e,t)=>e.filter((e=>b.default.gt(e.version.join("."),t))).map((e=>e.changelog)),$e=e=>{let t=e[0];return e.forEach((e=>{b.default.gt(e.version.join("."),t.version.join("."))&&(t=e)})),t};var Ze;class Ye{static load(e){return A(this,void 0,void 0,(function*(){if(this.settings=e,e.fetchConfig)try{const t=e.preRelease?"https://data.onekey.so/pre-config.json":"https://data.onekey.so/config.json",{data:r}=yield _.default.get(`${t}?noCache=${pe()}`,{timeout:7e3});this.deviceMap={[n.EDeviceType.Classic]:r.classic,[n.EDeviceType.Classic1s]:r.classic1s,[n.EDeviceType.ClassicPure]:r.classicpure,[n.EDeviceType.Mini]:r.mini,[n.EDeviceType.Touch]:r.touch,[n.EDeviceType.Pro]:r.pro},this.assets={bridge:r.bridge}}catch(e){}}))}static updateEnv(e){if(this.settings){const t=this.settings.env;this.settings=Object.assign(Object.assign({},this.settings),{env:e}),console.debug(`DataManager env updated: ${t} -> ${e}`)}}static checkAndReloadData(){return A(this,void 0,void 0,(function*(){pe()-this.lastCheckTimestamp>108e5&&(yield this.load(this.settings).then((()=>{this.lastCheckTimestamp=pe()})))}))}static getProtobufMessages(e="latest"){return this.messages[e]}static getSettings(e){return this.settings?"string"==typeof e?this.settings[e]:this.settings:null}}Ze=Ye,Ye.deviceMap={[n.EDeviceType.Classic]:{firmware:[],ble:[]},[n.EDeviceType.Classic1s]:{firmware:[],ble:[]},[n.EDeviceType.Mini]:{firmware:[],ble:[]},[n.EDeviceType.Touch]:{firmware:[],ble:[]},[n.EDeviceType.Pro]:{firmware:[],ble:[]},[n.EDeviceType.ClassicPure]:{firmware:[],ble:[]}},Ye.assets=null,Ye.messages={latest:Ge,v1:Ke},Ye.lastCheckTimestamp=0,Ye.getFirmwareStatus=e=>{var t,r;const i=Ee(e);if(i===n.EDeviceType.Unknown)return"unknown";const s=Oe(e);if(!1===e.firmware_present)return"none";if(_e.model_mini.includes(i)&&e.bootloader_mode)return"unknown";const o=it({features:e,updateType:"firmware"}),a=null!==(r=null===(t=Ze.deviceMap[i])||void 0===t?void 0:t[o])&&void 0!==r?r:[],d=s.join(".");return We(a,d)},Ye.getSysResourcesLatestRelease=(e,t)=>{var r,i,s;const o=Ee(e),a=Oe(e);if(o!==n.EDeviceType.Pro&&o!==n.EDeviceType.Touch)return;const d=it({features:e,updateType:"firmware"}),u=null!==(i=null===(r=Ze.deviceMap[o])||void 0===r?void 0:r[d])&&void 0!==i?i:[],l=a.join("."),c=u.filter((e=>(t||b.default.gt(e.version.join("."),l))&&!!e.resource));return null===(s=$e(c))||void 0===s?void 0:s.resource},Ye.getSysFullResource=e=>{var t,r,i;const s=Ee(e);if(s===n.EDeviceType.Unknown)return;if(s!==n.EDeviceType.Pro&&s!==n.EDeviceType.Touch)return;const o=it({features:e,updateType:"firmware"}),a=(null!==(r=null===(t=Ze.deviceMap[s])||void 0===t?void 0:t[o])&&void 0!==r?r:[]).filter((e=>!!e.fullResource));return null===(i=$e(a))||void 0===i?void 0:i.fullResource},Ye.getBootloaderResource=e=>{var t,r,i;const s=Ee(e);if(s===n.EDeviceType.Unknown)throw new Error("Device type is unknown");if(s!==n.EDeviceType.Pro&&s!==n.EDeviceType.Touch)return;const o=it({features:e,updateType:"firmware"}),a=null!==(r=null===(t=Ze.deviceMap[s])||void 0===t?void 0:t[o])&&void 0!==r?r:[];if(0===a.length)throw new Error(`Could not found bootloader resource with deviceType:${s} firmwareUpdateField:${o}`);const d=a.filter((e=>!!e.bootloaderResource));return null===(i=$e(d))||void 0===i?void 0:i.bootloaderResource},Ye.getBootloaderTargetVersion=e=>{var t,r,i,s;const o=Ee(e);if(o===n.EDeviceType.Unknown)return;const a=it({features:e,updateType:"firmware"}),d=(null!==(r=null===(t=Ze.deviceMap[o])||void 0===t?void 0:t[a])&&void 0!==r?r:[]).filter((e=>!!e.bootloaderResource));return null!==(s=null===(i=null==d?void 0:d[0])||void 0===i?void 0:i.bootloaderVersion)&&void 0!==s?s:void 0},Ye.getBootloaderRelatedFirmwareVersion=e=>{var t,r,i,s;const o=Ee(e);if(o===n.EDeviceType.Unknown)return;if(!_e.model_mini.includes(o))return;const a=it({features:e,updateType:"firmware"}),d=(null!==(r=null===(t=Ze.deviceMap[o])||void 0===t?void 0:t[a])&&void 0!==r?r:[]).filter((e=>!!e.bootloaderRelatedFirmwareVersion));return null!==(s=null===(i=null==d?void 0:d[0])||void 0===i?void 0:i.bootloaderRelatedFirmwareVersion)&&void 0!==s?s:void 0},Ye.getFirmwareChangelog=e=>{var t,r;const i=Ee(e);if(i===n.EDeviceType.Unknown)return[];const s=Oe(e),o=it({features:e,updateType:"firmware"}),a=null!==(r=null===(t=Ze.deviceMap[i])||void 0===t?void 0:t[o])&&void 0!==r?r:[];if(!1===e.firmware_present||_e.model_classic.includes(i)&&e.bootloader_mode)return Ve(a,"0.0.0");const d=s.join(".");return Ve(a,d)},Ye.getFirmwareLatestRelease=e=>{var t,r;const i=Ee(e);if(i===n.EDeviceType.Unknown)return;const s=it({features:e,updateType:"firmware"}),o=null!==(r=null===(t=Ze.deviceMap[i])||void 0===t?void 0:t[s])&&void 0!==r?r:[],a=$e(o);if(!a)return a;if(!a.resource){const t=Ze.getSysResourcesLatestRelease(e);return Object.assign(Object.assign({},a),{resource:t})}return a},Ye.getBLEFirmwareStatus=e=>{var t,r;const i=Ee(e);if(i===n.EDeviceType.Unknown)return"unknown";const s=xe(e);if(!s)return"none";const o=null!==(r=null===(t=Ze.deviceMap[i])||void 0===t?void 0:t.ble)&&void 0!==r?r:[],a=s.join(".");return We(o,a)},Ye.getBleFirmwareChangelog=e=>{var t,r;const i=Ee(e);if(i===n.EDeviceType.Unknown)return[];const s=xe(e);if(!s)return[];const o=null!==(r=null===(t=Ze.deviceMap[i])||void 0===t?void 0:t.ble)&&void 0!==r?r:[],a=s.join(".");return Ve(o,a)},Ye.getBleFirmwareLatestRelease=e=>{var t,r;const i=Ee(e);if(i===n.EDeviceType.Unknown)return;const s=null!==(r=null===(t=Ze.deviceMap[i])||void 0===t?void 0:t.ble)&&void 0!==r?r:[];return $e(s)},Ye.getTransportStatus=e=>{var t,r;const i=null===(r=null===(t=Ze.assets)||void 0===t?void 0:t.bridge)||void 0===r?void 0:r.version;if(!i)return"valid";return b.default.gte(e,i.join("."))?"valid":"outdated"},Ye.getBridgeChangelog=()=>{var e;return null===(e=Ze.assets)||void 0===e?void 0:e.bridge.changelog},Ye.isBleConnect=e=>"react-native"===e||"lowlevel"===e||"desktop-web-ble"===e,Ye.isWebUsbConnect=e=>"webusb"===e;const Je={model_mini:[{minVersion:"3.3.0",messageVersion:"latest"},{minVersion:"0.0.0",messageVersion:"v1"}],model_touch:[{minVersion:"4.5.0",messageVersion:"latest"},{minVersion:"0.0.0",messageVersion:"v1"}]},Xe=e=>{if(!e)return{support:!1};const t=Ee(e);if(t===n.EDeviceType.Touch||t===n.EDeviceType.Pro)return{support:!1};const r=Oe(e).join(".");return{support:b.default.gte(r,"2.3.0"),require:"2.3.0"}},Qe=(e,t)=>A(void 0,void 0,void 0,(function*(){var r,i,s,o,a;const{features:d,commands:u}=e,l=!1===(null==d?void 0:d.unlocked),{passphraseState:c,newSession:p,unlockedAttachPin:h}=yield et(d,u,Object.assign({},t)),f=Ee(d)===n.EDeviceType.Touch||Ee(d)===n.EDeviceType.Pro,y=c&&!0!==(null==d?void 0:d.passphrase_protection);return(f&&l||y)&&(yield e.getFeatures()),(null==d?void 0:d.device_id)&&e.updateInternalState(null!==(i=null===(r=e.features)||void 0===r?void 0:r.passphrase_protection)&&void 0!==i&&i,c,null!==(o=null===(s=e.features)||void 0===s?void 0:s.device_id)&&void 0!==o?o:"",p,null===(a=e.features)||void 0===a?void 0:a.session_id),{passphraseState:c,newSession:p,unlockedAttachPin:h}})),et=(e,t,r)=>A(void 0,void 0,void 0,(function*(){if(!e)return{passphraseState:void 0,newSession:void 0,unlockedAttachPin:void 0};const i=Oe(e),s=Ee(e);if(Te(e,a.Enum_Capability.Capability_AttachToPin)||s===n.EDeviceType.Pro&&b.default.gte(i.join("."),"4.15.0")){const{message:e,type:i}=yield t.typedCall("GetPassphraseState","PassphraseState",{passphrase_state:(null==r?void 0:r.onlyMainPin)||null==r?void 0:r.expectPassphraseState});if("CallMethodError"===i)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"Get the passphrase state error");return{passphraseState:e.passphrase_state,newSession:e.session_id,unlockedAttachPin:e.unlocked_attach_pin}}const{message:o,type:d}=yield t.typedCall("GetAddress","Address",{address_n:[Pe(44),Pe(1),Pe(0),0,0],coin_name:"Testnet",script_type:"SPENDADDRESS",show_display:!1});if("CallMethodError"===d)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"Get the passphrase state error");return{passphraseState:o.address,newSession:void 0,unlockedAttachPin:void 0}})),tt=(e,t)=>{if(!e)return!1;const r=Oe(e).join("."),i=Ee(e);return(null==t?void 0:t.includeNode)&&i===n.EDeviceType.Pro?b.default.gte(r,"4.14.0"):(null==t?void 0:t.includeNode)&&i===n.EDeviceType.Touch?b.default.gte(r,"4.11.0"):(null==t?void 0:t.includeNode)&&_e.model_classic1s.includes(i)?b.default.gte(r,"3.12.0"):(null==t?void 0:t.includeNode)&&_e.model_mini.includes(i)?b.default.gte(r,"3.10.0"):!(null==t?void 0:t.includeNode)&&(i===n.EDeviceType.Touch||i===n.EDeviceType.Pro?b.default.gte(r,"3.1.0"):b.default.gte(r,"2.6.0"))},rt=e=>{if(!e)return{support:!1};const t=Oe(e).join("."),r=Ee(e);return _e.model_mini.includes(r)?{support:!0}:{support:b.default.gte(t,"3.4.0")}},it=({features:e,updateType:t,targetVersion:r})=>{const i=Ee(e),s=Oe(e);if("ble"===t)return"ble";if(_e.model_mini.includes(i))return"firmware-v7";if(i===n.EDeviceType.Touch){if(r){if(b.default.eq(r,"4.0.0"))return"firmware-v2";if(b.default.gt(r,"4.0.0"))return"firmware-v7"}return b.default.lt(s.join("."),"3.4.0")?"firmware":"firmware-v7"}return i===n.EDeviceType.Pro?"firmware-v7":"firmware"};function nt(e){let t=e.split(".");for(;t.length<3;)t.push("0");return t=t.map((e=>o.isNaN(parseInt(e,10))?"0":e)),t.join(".")}const st=r(5698),ot=()=>st.version,at=`https://jssdk.onekey.so/${ot()}/`;var dt;const ut={configSrc:"./data/config.json",version:"",debug:!1,priority:2,trustedHost:!1,connectSrc:at,iframeSrc:`${at}iframe.html`,parentOrigin:"undefined"!=typeof window&&window.location?window.location.origin:"",extension:"undefined"!=typeof chrome&&(null===(dt=null===chrome||void 0===chrome?void 0:chrome.runtime)||void 0===dt?void 0:dt.id)||"",supportedBrowser:"undefined"==typeof navigator||!/Trident|MSIE|Edge/.test(navigator.userAgent),env:"web",lazyLoad:!1,timestamp:(new Date).getTime()},lt=()=>{if("undefined"!=typeof chrome&&chrome.runtime&&void 0!==chrome.runtime.onConnect)return"webextension";if("undefined"!=typeof navigator){if("string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase())return"react-native";if(navigator.userAgent.toLowerCase().indexOf(" electron/")>-1)return"electron"}return"web"},ct=e=>{if("string"==typeof e)return e.match(/^https:\/\/([A-Za-z0-9\-_]+\.)*onekey\.so\//)||e.match(/^https?:\/\/localhost:[58][0-9]{3}\//),e};function pt(e){const t=Ee(e);if(!_e.model_touch.includes(t))return!1;const r=Oe(e).join("."),i=ke(e).join("."),n=Ye.getBootloaderTargetVersion(e);return!!n&&(b.default.gte(r,"3.2.0")&&b.default.gte(r,"4.1.0")&&b.default.lte(i,n.join(".")))}function ht(e,t){const r=Ee(e);if(!_e.model_mini.includes(r))return!1;if(!t)return!1;const i=Oe(e).join("."),n=ke(e).join("."),s=Ye.getBootloaderTargetVersion(e);if(s&&b.default.gte(n,s.join(".")))return!1;const o=Ye.getBootloaderRelatedFirmwareVersion(e);return!!o&&function({currentVersion:e,bootloaderVersion:t,willUpdateFirmware:r,targetBootloaderVersion:i,bootloaderRelatedFirmwareVersion:n}){return!(i&&b.default.gte(t,i.join("."))||!b.default.gte(r,n.join("."))&&!b.default.gte(e,n.join(".")))}({currentVersion:i,bootloaderVersion:n,willUpdateFirmware:t,targetBootloaderVersion:s,bootloaderRelatedFirmwareVersion:o})}const ft=e=>new Promise((t=>{setTimeout(t,e)})),yt=e=>{if(!e)return;const{ukey_serial:t,se_ver:r}=e;if(!t)return;const i=+t.slice(5);return Number.isNaN(i)?void 0:i>=21032200001&&i<=21032201500&&"1.1.0.2"===r},gt="CORE_EVENT",mt="UI_EVENT",vt={REQUEST_PIN:"ui-request_pin",INVALID_PIN:"ui-invalid_pin",REQUEST_BUTTON:"ui-button",REQUEST_PASSPHRASE:"ui-request_passphrase",REQUEST_PASSPHRASE_ON_DEVICE:"ui-request_passphrase_on_device",REQUEST_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE:"ui-request_select_device_in_bootloader_for_web_device",CLOSE_UI_WINDOW:"ui-close_window",CLOSE_UI_PIN_WINDOW:"ui-close_pin_window",DEVICE_PROGRESS:"ui-device_progress",BLUETOOTH_PERMISSION:"ui-bluetooth_permission",BLUETOOTH_UNSUPPORTED:"ui-bluetooth_unsupported",BLUETOOTH_POWERED_OFF:"ui-bluetooth_powered_off",BLUETOOTH_CHARACTERISTIC_NOTIFY_CHANGE_FAILURE:"ui-bluetooth_characteristic_notify_change_failure",LOCATION_PERMISSION:"ui-location_permission",LOCATION_SERVICE_PERMISSION:"ui-location_service_permission",FIRMWARE_PROCESSING:"ui-firmware-processing",FIRMWARE_PROGRESS:"ui-firmware-progress",FIRMWARE_TIP:"ui-firmware-tip",PREVIOUS_ADDRESS_RESULT:"ui-previous_address_result",WEB_DEVICE_PROMPT_ACCESS_PERMISSION:"ui-web_device_prompt_access_permission",BOOTLOADER:"ui-device_bootloader_mode",NOT_IN_BOOTLOADER:"ui-device_not_in_bootloader_mode",REQUIRE_MODE:"ui-device_require_mode",NOT_INITIALIZE:"ui-device_not_initialized",SEEDLESS:"ui-device_seedless",FIRMWARE_OLD:"ui-device_firmware_old",FIRMWARE_NOT_SUPPORTED:"ui-device_firmware_unsupported",FIRMWARE_NOT_COMPATIBLE:"ui-device_firmware_not_compatible",FIRMWARE_NOT_INSTALLED:"ui-device_firmware_not_installed",NOT_USE_UKEY_DEVICE:"ui-device_please_use_ukey_device"};var bt;t.nn=void 0,(bt=t.nn||(t.nn={})).CheckLatestUiResource="CheckLatestUiResource",bt.StartDownloadFirmware="StartDownloadFirmware",bt.FinishDownloadFirmware="FinishDownloadFirmware",bt.DownloadLatestUiResource="DownloadLatestUiResource",bt.DownloadFirmware="DownloadFirmware",bt.DownloadBleFirmware="DownloadBleFirmware",bt.DownloadLatestBootloaderResource="DownloadLatestBootloaderResource",bt.DownloadLatestUiResourceSuccess="DownloadLatestUiResourceSuccess",bt.DownloadFirmwareSuccess="DownloadFirmwareSuccess",bt.DownloadBleFirmwareSuccess="DownloadBleFirmwareSuccess",bt.DownloadLatestBootloaderResourceSuccess="DownloadLatestBootloaderResourceSuccess",bt.AutoRebootToBootloader="AutoRebootToBootloader",bt.GoToBootloaderSuccess="GoToBootloaderSuccess",bt.SelectDeviceInBootloaderForWebDevice="SelectDeviceInBootloaderForWebDevice",bt.ConfirmOnDevice="ConfirmOnDevice",bt.FirmwareEraseSuccess="FirmwareEraseSuccess",bt.StartTransferData="StartTransferData",bt.InstallingFirmware="InstallingFirmware",bt.UpdateBootloader="UpdateBootloader",bt.UpdateBootloaderSuccess="UpdateBootloaderSuccess",bt.UpdateSysResource="UpdateSysResource",bt.UpdateSysResourceSuccess="UpdateSysResourceSuccess",bt.FirmwareUpdating="FirmwareUpdating",bt.FirmwareUpdateCompleted="FirmwareUpdateCompleted";const _t=(e,t)=>({event:mt,type:e,payload:t}),wt={INIT:"iframe-init",INIT_BRIDGE:"iframe-init-bridge",CALL:"iframe-call",CANCEL:"iframe-cancel",SWITCH_TRANSPORT:"iframe-switch-transport",CALLBACK:"iframe-callback"},Tt="RESPONSE_EVENT",Et=(e,t,r)=>({event:Tt,type:Tt,id:e,success:t,payload:t?r:n.serializeError(r)}),St={RECEIVE_PIN:"ui-receive_pin",RECEIVE_PASSPHRASE:"ui-receive_passphrase",SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE:"ui-receive_select-device-in-bootloader-for-web-device"},At="DEVICE_EVENT",Rt={CONNECT:"device-connect",CONNECT_UNACQUIRED:"device-connect_unacquired",DISCONNECT:"device-disconnect",CHANGED:"device-changed",ACQUIRE:"device-acquire",RELEASE:"device-release",ACQUIRED:"device-acquired",RELEASED:"device-released",USED_ELSEWHERE:"device-used_elsewhere",UNREADABLE:"unreadable-device",LOADING:"device-loading",BUTTON:"button",PIN:"pin",PASSPHRASE:"passphrase",PASSPHRASE_ON_DEVICE:"passphrase_on_device",WORD:"word",SUPPORT_FEATURES:"support_features",SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE:"select_device_in_bootloader_for_web_device",FEATURES:"features"},Mt=(e,t)=>({event:At,type:e,payload:t}),It="FIRMWARE_EVENT",Ot={RELEASE_INFO:"firmware-release-info",BLE_RELEASE_INFO:"ble-firmware-release-info"},xt=(e,t)=>({event:It,type:e,payload:t}),kt=new Set([St.RECEIVE_PIN,St.RECEIVE_PASSPHRASE]),Ct=le(t.d3.DevicePool);class Pt extends D.exports{static setConnector(e){this.connector=e}static getDevices(e,t,r){var i,n,s,o,a,d,u;return A(this,void 0,void 0,(function*(){const l={},c=[];if(t){const i=this.devicesCache[t];if(i){const n=e.find((e=>e.path===i.originalDescriptor.path));if(n)return i.updateDescriptor(n,!0),l[t]=i,c.push(i),yield this._checkDevicePool(r),{devices:l,deviceList:c};Ct.debug("found device in cache, but path is different: ",t)}}try{for(i=!0,n=M(e);s=yield n.next(),!(o=s.done);i=!0){u=s.value,i=!1;const e=u,t=yield this._createDevice(e,r);if(t.features){const r=Re(t.features);if(this.devicesCache[r]){this.devicesCache[r].updateDescriptor(e,!0)}this.devicesCache[r]=t,l[r]=t}c.push(t)}}catch(e){a={error:e}}finally{try{i||o||!(d=n.return)||(yield d.call(n))}finally{if(a)throw a.error}}return yield this._checkDevicePool(r),{devices:l,deviceList:c}}))}static clearDeviceCache(e){e&&delete this.devicesCache[e]}static _createDevice(e,t){return A(this,void 0,void 0,(function*(){let r=this.getDeviceByPath(e.path);return r||(r=Wt.fromDescriptor(e),r.deviceConnector=this.connector,yield r.connect(),yield r.initialize(t),yield r.release()),r}))}static _checkDevicePool(e){return A(this,void 0,void 0,(function*(){yield this._sendConnectMessage(e),this._sendDisconnectMessage()}))}static _sendConnectMessage(e){return A(this,void 0,void 0,(function*(){for(let t=this.connectedPool.length-1;t>=0;t--){const r=this.connectedPool[t],i=yield this._createDevice(r,e);Ct.debug("emit DEVICE.CONNECT: ",null==i?void 0:i.features),this.emitter.emit(Rt.CONNECT,i),this.connectedPool.splice(t,1)}}))}static _sendDisconnectMessage(){for(let e=this.disconnectPool.length-1;e>=0;e--){const t=this.connectedPool[e],r=(null==t?void 0:t.path)?this.getDeviceByPath(t.path):null;r&&this.emitter.emit(Rt.DISCONNECT,r),this.disconnectPool.splice(e,1)}}static reportDeviceChange(e){const t=((e,t)=>{const r=t.filter((t=>void 0===e.find((e=>e.path===t.path)))),i=e.filter((e=>void 0===t.find((t=>t.path===e.path)))),n=t.filter((t=>{const r=e.find((e=>e.path===t.path));return!!r&&r.session!==t.session})),s=n.filter((e=>"string"==typeof e.session)),o=n.filter((e=>"string"!=typeof e.session)),a=t.filter((t=>{const r=e.find((e=>e.path===t.path));return!!r&&r.debugSession!==t.debugSession})),d=n.filter((e=>"string"==typeof e.debugSession)),u=n.filter((e=>"string"!=typeof e.debugSession));return{connected:r,disconnected:i,changedSessions:n,acquired:s,released:o,changedDebugSessions:a,debugAcquired:d,debugReleased:u,didUpdate:r.length+i.length+n.length+a.length>0,descriptors:t}})(this.current||[],e);this.upcoming=e,this.current=this.upcoming,Ct.debug("device pool -> current: ",this.current),Ct.debug("device pool -> upcomming: ",this.upcoming),Ct.debug("DeviceCache.reportDeviceChange diff: ",t),t.didUpdate&&(t.connected.forEach((e=>{const t=this.getDeviceByPath(e.path);t?(Ct.debug("emit DEVICE.CONNECT: ",t.features),this.emitter.emit(Rt.CONNECT,t)):this._addConnectedDeviceToPool(e)})),t.disconnected.forEach((e=>{this._removeDeviceFromConnectedPool(e.path);const t=this.getDeviceByPath(e.path);t?(Ct.debug("emit DEVICE.DISCONNECT: ",t.features),this.emitter.emit(Rt.DISCONNECT,t)):this._addDisconnectedDeviceToPool(e)})))}static getDeviceByPath(e){return Object.values(this.devicesCache).find((t=>t.originalDescriptor.path===e))}static _addConnectedDeviceToPool(e){const t=this.connectedPool.findIndex((t=>t.path===e.path));t>-1?this.connectedPool.splice(t,1,e):this.connectedPool.push(e)}static _removeDeviceFromConnectedPool(e){const t=this.connectedPool.findIndex((t=>t.path===e));t>-1&&this.connectedPool.splice(t,1)}static _addDisconnectedDeviceToPool(e){const t=this.disconnectPool.findIndex((t=>t.path===e.path));t>-1?this.disconnectPool.splice(t,1,e):this.disconnectPool.push(e)}static resetState(){this.current=null,this.upcoming=[],this.connectedPool=[],this.disconnectPool=[],this.devicesCache={},this.emitter.removeAllListeners(),Ct.debug("DevicePool state has been reset")}}Pt.current=null,Pt.upcoming=[],Pt.connectedPool=[],Pt.disconnectPool=[],Pt.devicesCache={},Pt.emitter=new D.exports;const Dt=le(t.d3.Transport),Nt=le(t.d3.HdBleTransport),Bt=le(t.d3.HdTransportHttp),qt=le(t.d3.HdTransportLowLevel),Lt=le(t.d3.HdWebBleTransport);class jt{static load(){Dt.debug("transport manager load"),this.defaultMessages=Ye.getProtobufMessages(),this.currentMessages=this.defaultMessages,this.messageVersion="latest"}static configure(){return A(this,void 0,void 0,(function*(){try{const e=Ye.getSettings("env");if(Dt.debug("Initializing transports"),"react-native"===e)this.reactNativeInit?Dt.debug("React Native Do Not Initializing transports"):(yield this.transport.init(Nt,Pt.emitter),this.reactNativeInit=!0);else if("lowlevel"===e){if(!this.plugin)throw n.ERRORS.TypedError(n.HardwareErrorCode.TransportNotConfigured,"Lowlevel transport mast have plugin");yield this.transport.init(qt,Pt.emitter,this.plugin)}else"desktop-web-ble"===e?yield this.transport.init(Lt):yield this.transport.init(Bt);Dt.debug("Configuring transports"),yield this.transport.configure(JSON.stringify(this.defaultMessages)),Dt.debug("Configuring transports done")}catch(e){if(Dt.debug("Initializing transports error: ",e),"ECONNABORTED"===e.code)throw n.ERRORS.TypedError(n.HardwareErrorCode.BridgeTimeoutError)}}))}static reconfigure(e){return A(this,void 0,void 0,(function*(){Dt.debug("Begin reconfiguring transports");const{messageVersion:t,messages:r}=(e=>{var t;if(!e)return{messages:Ye.messages.latest,messageVersion:"latest"};const r=Oe(e).join("."),i=Ee(e),n=Je[i]||we[i]&&we[i].map((e=>Je[e])).find((e=>void 0!==e)),s=null!==(t=null==n?void 0:n.sort(((e,t)=>b.default.compare(t.minVersion,e.minVersion))))&&void 0!==t?t:[];for(const{minVersion:e,messageVersion:t}of s)if(b.default.gte(r,e))return{messages:Ye.messages[t],messageVersion:t};return{messages:Ye.messages.latest,messageVersion:"latest"}})(e);if(this.currentMessages!==r&&r){Dt.debug(`Reconfiguring transports version:${t}`);try{yield this.transport.configure(JSON.stringify(r)),this.currentMessages=r,this.messageVersion=t}catch(e){throw n.ERRORS.TypedError(n.HardwareErrorCode.TransportInvalidProtobuf,`Transport_InvalidProtobuf: ${e.message}`)}}}))}static setTransport(e,t){const r=Ye.getSettings("env");this.transport="react-native"===r?new e({scanTimeout:3e3}):new e,t&&(this.plugin=t,Dt.debug("set transport plugin: ",this.plugin)),Dt.debug("set transport: ",this.transport.name,this.transport.version,this.transport.configured)}static getTransport(){return this.transport}static getDefaultMessages(){return this.defaultMessages}static getCurrentMessages(){return this.currentMessages}static getMessageVersion(){return this.messageVersion}}jt.reactNativeInit=!1,jt.messageVersion="latest",jt.plugin=null;const Ft=(e,t=!0)=>{var r;const i=e.hasDeviceAcquire()?e.mainId:void 0;if(!i)return Promise.resolve({success:!1,error:n.HardwareErrorCode.RuntimeError,payload:{message:"Device disconnected or acquired by someone else"}});const s=null===(r=e.commands)||void 0===r?void 0:r.transport;return t?null==s?void 0:s.call(i,"Cancel",{}).then((()=>({success:!0,error:null,payload:{message:"Cancel request sent"}}))).catch((e=>({success:!1,error:e.errorCode,payload:{message:e.message}}))):null==s?void 0:s.post(i,"Cancel",{}).then((()=>({success:!0,error:n.HardwareErrorCode.RuntimeError,payload:{message:"Cancel request sent"}})))},Ut=e=>{var t;const r=e.hasDeviceAcquire()?e.mainId:void 0;if(!r)return Promise.resolve({success:!1,error:n.HardwareErrorCode.RuntimeError,payload:{message:"Device disconnected or acquired by someone else"}});const i=null===(t=e.commands)||void 0===t?void 0:t.transport;return null==i?void 0:i.call(r,"Initialize",{}).then((()=>({success:!0,error:null,payload:{message:"Cancel request sent"}}))).catch((e=>({success:!1,error:e.errorCode,payload:{message:e.message}})))},zt=le(t.d3.DeviceCommands);class Ht{constructor(e,t){this.device=e,this.mainId=t,this.transport=jt.getTransport(),this.disposed=!1}dispose(e){var t,r;return A(this,void 0,void 0,(function*(){this.disposed=!0,yield null===(r=(t=this.transport).cancel)||void 0===r?void 0:r.call(t)}))}checkDisposed(){if(this.disposed)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"DeviceCommands already disposed")}cancelDeviceOnUKeyDevice(){return A(this,void 0,void 0,(function*(){const{name:e}=this.transport;if("HttpTransport"!==e)return Ut(this.device);try{yield this.device.acquire(),yield Ut(this.device)}catch(e){}}))}cancelDevice(){return A(this,void 0,void 0,(function*(){const{name:e}=this.transport;if("HttpTransport"!==e)return Ft(this.device,!1);try{yield this.device.acquire(),yield Ft(this.device,!1)}catch(e){}}))}cancel(){return A(this,void 0,void 0,(function*(){if(!this.disposed&&(this.dispose(!0),this.callPromise))try{yield Promise.all([new Promise(((e,t)=>setTimeout((()=>t(new Error("cancel timeout"))),1e4))),yield this.callPromise])}catch(e){this.callPromise=void 0}}))}call(e,t={}){var r;return A(this,void 0,void 0,(function*(){zt.debug("[DeviceCommands] [call] Sending",e);try{const r=this.transport.call(this.mainId,e,t);this.callPromise=r;const i=yield r;return zt.debug("[DeviceCommands] [call] Received",i.type),i}catch(e){if(zt.debug("[DeviceCommands] [call] Received error",e),e.errorCode===n.HardwareErrorCode.BleDeviceBondError)return{type:"BleDeviceBondError",message:{error:null==e?void 0:e.message}};const t=null===(r=null==e?void 0:e.response)||void 0===r?void 0:r.data;let i=null==t?void 0:t.error;if(!i&&t&&"string"==typeof t)try{const e=JSON.parse(t);i=null==e?void 0:e.error}catch(e){}if(t&&zt.debug("error response",t),"device disconnected during action"===i)return{type:"BridgeDeviceDisconnected",message:{error:i}};if(i&&-1!==i.indexOf("Request failed with status code"))return{type:"CallMethodError",message:{error:null!=t?t:""}};throw e}}))}typedCall(e,t,r){return A(this,void 0,void 0,(function*(){if(this.disposed)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"typedCall: DeviceCommands already disposed");try{!["ButtonAck","PinMatrixAck","PassphraseAck","Cancel","BixinPinInputOnDevice"].includes(e)&&r&&zt.debug("[DeviceCommands] [typedCall] Sending payload",e,r)}catch(e){}const i=yield this._commonCall(e,r);try{((e,t)=>{if(!(Array.isArray(t)?t:t.split("|")).includes(e.type))throw n.ERRORS.TypedError(n.HardwareErrorCode.ResponseUnexpectTypeError,`assertType: Response of unexpected type: ${e.type}. Should be ${t}`)})(i,t)}catch(e){if(zt.debug("DeviceCommands typedcall error: ",e),!(e instanceof n.HardwareError))throw e;if(e.errorCode===n.HardwareErrorCode.ResponseUnexpectTypeError){if(e.message.indexOf("BridgeNetworkError")>-1)throw n.ERRORS.TypedError(n.HardwareErrorCode.BridgeNetworkError);if(e.message.indexOf("BleDeviceBondError")>-1)throw n.ERRORS.TypedError(n.HardwareErrorCode.BleDeviceBondError);if(e.message.indexOf("BridgeDeviceDisconnected")>-1)throw n.ERRORS.TypedError(n.HardwareErrorCode.BridgeDeviceDisconnected);throw n.ERRORS.TypedError(n.HardwareErrorCode.ResponseUnexpectTypeError)}}return i}))}_commonCall(e,t){return A(this,void 0,void 0,(function*(){const r=yield this.call(e,t);return this._filterCommonTypes(r,e)}))}_filterCommonTypes(e,t){try{"react-native"===Ye.getSettings("env")?zt.debug("_filterCommonTypes: ",JSON.stringify(e)):zt.debug("_filterCommonTypes: ",e)}catch(e){}if(this.device.clearCancelableAction(),"Failure"===e.type){const{code:r,message:i}=e.message;let s=null;return"Failure_FirmwareError"!==r||i||(s=n.ERRORS.TypedError(n.HardwareErrorCode.FirmwareError)),"Failure_ActionCancelled"===r&&(s=n.ERRORS.TypedError(n.HardwareErrorCode.ActionCancelled)),"Failure_PinInvalid"===r&&(s=n.ERRORS.TypedError(n.HardwareErrorCode.PinInvalid,i)),"Failure_PinCancelled"===r&&(s=n.ERRORS.TypedError(n.HardwareErrorCode.PinCancelled)),"Failure_DataError"===r&&("Please confirm the BlindSign enabled"===i&&(s=n.ERRORS.TypedError(n.HardwareErrorCode.BlindSignDisabled)),"File already exists"===i&&(s=n.ERRORS.TypedError(n.HardwareErrorCode.FileAlreadyExists)),(null==i?void 0:i.includes("bytes overflow"))&&(s=n.ERRORS.TypedError(n.HardwareErrorCode.DataOverload))),"Failure_ProcessError"===r&&((null==i?void 0:i.includes("Bootloader file verify failed"))||(null==i?void 0:i.includes("verify failed")))&&(s=n.ERRORS.TypedError(n.HardwareErrorCode.FirmwareVerificationFailed,i)),"Failure_UnexpectedMessage"===r&&("PassphraseAck"===t&&(s=n.ERRORS.TypedError(n.HardwareErrorCode.UnexpectPassphrase)),"Not in Signing mode"===i&&(s=n.ERRORS.TypedError(n.HardwareErrorCode.NotInSigningMode))),s?Promise.reject(s):Promise.reject(n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,`${r||"Failure_UnknownCode"},${i||"Failure_UnknownMessage"}`))}if("Features"===e.type)return Promise.resolve(ve(e));if("ButtonRequest"===e.type){const t=Ee(this.device.features);return _e.model_mini.includes(t)?this.device.setCancelableAction((()=>this.cancelDeviceOnUKeyDevice())):this.device.setCancelableAction((()=>this.cancelDevice())),"ButtonRequest_PassphraseEntry"===e.message.code?this.device.emit(Rt.PASSPHRASE_ON_DEVICE,this.device):this.device.emit(Rt.BUTTON,this.device,e.message),this._commonCall("ButtonAck",{})}if(e.type,"PinMatrixRequest"===e.type)return this._promptPin(e.message.type).then((e=>"@@UKEY_INPUT_PIN_IN_DEVICE"===e?(this.device.setCancelableAction((()=>this.cancelDeviceOnUKeyDevice())),this._commonCall("BixinPinInputOnDevice").finally((()=>{this.device.clearCancelableAction()}))):this._commonCall("PinMatrixAck",{pin:e})),(e=>Promise.reject(e)));if("PassphraseRequest"===e.type){const t=e.message.exists_attach_pin_user;return this._promptPassphrase({existsAttachPinUser:t}).then((e=>{const{passphrase:r,passphraseOnDevice:i,attachPinOnDevice:n}=e;return n&&t?this._commonCall("PassphraseAck",{on_device_attach_pin:!0}):i?this._commonCall("PassphraseAck",{on_device:!0}):this._commonCall("PassphraseAck",{passphrase:r})}))}return e.type,e.type,Promise.resolve(e)}_promptPin(e){return new Promise(((t,r)=>{const i=e=>Ft(this.device,!1).then((e=>{const t=n.ERRORS.TypedError(n.HardwareErrorCode.ActionCancelled,`${Rt.PIN} canceled`);if(e){const{payload:i}=e||{};r(t||new Error(null==i?void 0:i.message))}else r(t)})).catch((e=>{r(e)}));this.device.listenerCount(Rt.PIN)>0?(this.device.setCancelableAction(i),this.device.emit(Rt.PIN,this.device,e,((e,r)=>{this.device.clearCancelableAction(),e?i():t(r)}))):(console.warn("[DeviceCommands] [call] PIN callback not configured, cancelling request"),r(n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"_promptPin: PIN callback not configured")))}))}_promptPassphrase(e){return new Promise(((t,r)=>{const i=e=>Ft(this.device,!1).then((e=>{const t=n.ERRORS.TypedError(n.HardwareErrorCode.ActionCancelled,`${Rt.PASSPHRASE} canceled`);if(e){const{payload:i}=e||{};r(t||new Error(null==i?void 0:i.message))}else r(t)})).catch((e=>{r(e)}));this.device.listenerCount(Rt.PASSPHRASE)>0?(this.device.setCancelableAction(i),this.device.emit(Rt.PASSPHRASE,this.device,e,((e,r)=>{this.device.clearCancelableAction(),r?i():t(e)}))):(zt.error("[DeviceCommands] [call] Passphrase callback not configured, cancelling request"),r(n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"_promptPassphrase: Passphrase callback not configured")))}))}}const Gt=le(t.d3.Device),Kt={};class Wt extends D.exports{constructor(e){super(),this.deviceConnector=null,this.deviceAcquired=!1,this.features=void 0,this.featuresNeedsReload=!1,this.externalState=[],this.unavailableCapabilities={},this.instance=0,this.internalState=[],this.needReloadDevice=!1,this.keepSession=!1,this.passphraseState=void 0,this.originalDescriptor=e}static fromDescriptor(e){const t=Object.assign({},e);return new Wt(t)}toMessageObject(){if(this.isUnacquired()||!this.features)return null;const e=Ye.getSettings("env"),t=Ee(this.features),r=Ae(this.features),i=Me(this.features);return{connectId:Ye.isBleConnect(e)?this.mainId||null:Re(this.features),uuid:Re(this.features),deviceType:t,deviceId:this.features.device_id||null,path:this.originalDescriptor.path,bleName:r,name:r||i||`UKey ${null==t?void 0:t.toUpperCase()}`,label:i||"UKey",mode:this.getMode(),features:this.features,firmwareVersion:this.getFirmwareVersion(),bleFirmwareVersion:this.getBLEFirmwareVersion(),unavailableCapabilities:this.unavailableCapabilities}}connect(){const e=Ye.getSettings("env");return new Promise(((t,r)=>A(this,void 0,void 0,(function*(){if(Ye.isBleConnect(e))try{yield this.acquire(),t(!0)}catch(e){r(e)}else if(!this.mainId||!this.isUsedHere()&&this.originalDescriptor)try{yield this.acquire(),t(!0)}catch(e){r(e)}else this.isUsedHere()?t(!0):t(!1)}))))}acquire(){var e,t,r,i;return A(this,void 0,void 0,(function*(){const n=Ye.getSettings("env"),s=Ye.isBleConnect(n)?"id":"session";try{if(Ye.isBleConnect(n)){const r=yield null===(e=this.deviceConnector)||void 0===e?void 0:e.acquire(this.originalDescriptor.id);this.mainId=null!==(t=r.uuid)&&void 0!==t?t:"",Gt.debug("Expected uuid:",this.mainId)}else this.mainId=yield null===(r=this.deviceConnector)||void 0===r?void 0:r.acquire(this.originalDescriptor.path,this.originalDescriptor.session),Gt.debug("Expected session id:",this.mainId);this.deviceAcquired=!0,this.updateDescriptor({[s]:this.mainId}),this.commands&&(yield this.commands.dispose(!1)),this.commands=new Ht(this,null!==(i=this.mainId)&&void 0!==i?i:"")}catch(e){if(!this.runPromise)throw e;this.runPromise.reject(e),this.runPromise=null}}))}release(){var e;return A(this,void 0,void 0,(function*(){const t=Ye.getSettings("env");if(this.isUsedHere()&&!this.keepSession&&this.mainId||this.mainId&&Ye.isBleConnect(t)){if(this.pendingCallbackPromise)try{Gt.debug("Waiting for callback tasks to complete before releasing device (in release method)"),yield this.pendingCallbackPromise.promise}catch(e){Gt.error("Error waiting for callback tasks in release method:",e)}if(this.commands&&(this.commands.dispose(!1),this.commands.callPromise))try{yield this.commands.callPromise}catch(e){this.commands.callPromise=void 0}try{yield null===(e=this.deviceConnector)||void 0===e?void 0:e.release(this.mainId,!1),this.updateDescriptor({session:null})}catch(e){Gt.error("[Device] release error: ",e)}finally{this.needReloadDevice=!0}}this.deviceAcquired=!1}))}getCommands(){return this.commands}generateStateKey(e,t){return t?`${e}@${t}`:e}getInternalState(e){var t,r;Gt.debug("getInternalState session cache: ",Kt),Gt.debug("getInternalState session param: ",`device_id: ${e}`,`features.device_id: ${null===(t=this.features)||void 0===t?void 0:t.device_id}`,`passphraseState: ${this.passphraseState}`);const i=e||(null===(r=this.features)||void 0===r?void 0:r.device_id);if(!i)return;if(!this.passphraseState)return;const n=this.generateStateKey(i,this.passphraseState);return Kt[n]}updateInternalState(e,t,r,i=null,n=null){Gt.debug("updateInternalState session param: ",`device_id: ${r}`,`enablePassphrase: ${e}`,`passphraseState: ${t}`,`sessionId: ${i}`,`featuresSessionId: ${n}`),e&&(i?Kt[this.generateStateKey(r,t)]=i:n&&(Kt[this.generateStateKey(r,t)]=n));const s=`${r}`;Kt[s]&&delete Kt[s],Gt.debug("updateInternalState session cache: ",Kt)}setInternalState(e,t){var r,i;if(Gt.debug("setInternalState session param: ",`state: ${e}`,`initSession: ${t}`,`device_id: ${null===(r=this.features)||void 0===r?void 0:r.device_id}`,`passphraseState: ${this.passphraseState}`),!this.features)return;if(!this.passphraseState&&!t)return;const n=null===(i=this.features)||void 0===i?void 0:i.device_id;if(!n)return;const s=this.generateStateKey(n,this.passphraseState);e&&(Kt[s]=e),Gt.debug("setInternalState done session cache: ",Kt)}clearInternalState(e){var t;Gt.debug("clearInternalState param: ",e);const r=e||(null===(t=this.features)||void 0===t?void 0:t.device_id);if(!r)return;if(delete Kt[`${r}`],this.passphraseState){const e=this.generateStateKey(r,this.passphraseState);delete Kt[e]}}initialize(e){return A(this,void 0,void 0,(function*(){this.passphraseState=null==e?void 0:e.passphraseState,(null==e?void 0:e.initSession)&&this.clearInternalState(null==e?void 0:e.deviceId);const t=this.getInternalState(null==e?void 0:e.deviceId),r={};t&&(r.session_id=t),(null==e?void 0:e.deriveCardano)&&(r.derive_cardano=!0),r.passphrase_state=null==e?void 0:e.passphraseState,r.is_contains_attach=!0,Gt.debug("Initialize device begin:",{deviceId:null==e?void 0:e.deviceId,passphraseState:null==e?void 0:e.passphraseState,initSession:null==e?void 0:e.initSession,InitializePayload:r});try{const{message:t}=yield Promise.race([this.commands.typedCall("Initialize","Features",r),new Promise(((e,t)=>{setTimeout((()=>{t(n.ERRORS.TypedError(n.HardwareErrorCode.DeviceInitializeFailed))}),25e3)}))]);Gt.debug("Initialize device end: ",t),this._updateFeatures(t,null==e?void 0:e.initSession),yield jt.reconfigure(this.features)}catch(e){throw Gt.error("Initialization failed:",e),e}}))}getFeatures(){return A(this,void 0,void 0,(function*(){const{message:e}=yield this.commands.typedCall("GetFeatures","Features",{});this._updateFeatures(e)}))}_updateFeatures(e,t){var r;this.features&&this.features.session_id&&!e.session_id&&(e.session_id=this.features.session_id),this.features&&this.features.device_id&&e.session_id&&this.setInternalState(e.session_id,t),e.unlocked=null===(r=e.unlocked)||void 0===r||r,e=(e=>{const t=Object.assign({},e);return t.ukey_firmware_version&&!b.default.valid(t.ukey_firmware_version)&&(t.ukey_firmware_version=nt(t.ukey_firmware_version)),t.ukey_version&&!b.default.valid(t.ukey_version)&&(t.ukey_version=nt(t.ukey_version)),t})(e),this.features=e,this.featuresNeedsReload=!1,this.emit(Rt.FEATURES,this,e)}updateDescriptor(e,t=!1){const r=Ye.getSettings("env");if(Ye.isBleConnect(r))return;const i=this.originalDescriptor.session,n=e.session;i!==n&&(this.originalDescriptor.session=n),t&&(this.originalDescriptor=e)}updateFromCache(e){this.mainId=e.mainId,this.commands=e.commands,this.updateDescriptor(e.originalDescriptor,!0),e.features&&this._updateFeatures(e.features)}run(e,t){return A(this,void 0,void 0,(function*(){return this.runPromise&&(yield this.interruptionFromOutside(),Gt.debug("[Device] run error:","Device is running, but will cancel previous operate")),t=(e=>(e||(e={}),e))(t),this.runPromise=n.createDeferred(this._runInner.bind(this,e,t)),this.runPromise.promise}))}_runInner(e,t){return A(this,void 0,void 0,(function*(){if(!this.isUsedHere()||this.commands.disposed){const r=Ye.getSettings("env");if("react-native"!==r){try{yield this.acquire()}catch(e){return this.runPromise=null,Promise.reject(e)}try{e&&(yield this.initialize(t))}catch(e){return this.runPromise=null,e instanceof n.HardwareError?Promise.reject(e):Promise.reject(n.ERRORS.TypedError(n.HardwareErrorCode.DeviceInitializeFailed,`Initialize failed: ${e.message}, code: ${e.code}`))}}else"react-native"===r&&this.commands&&(this.commands.disposed=!1)}if(t.keepSession&&(this.keepSession=!0),e)try{yield e()}catch(e){return this.runPromise&&this.runPromise.reject(e),e instanceof n.HardwareError&&(e.errorCode===n.HardwareErrorCode.DeviceInitializeFailed||e.errorCode===n.HardwareErrorCode.DeviceInterruptedFromOutside||e.errorCode===n.HardwareErrorCode.DeviceInterruptedFromUser||e.errorCode===n.HardwareErrorCode.DeviceCheckPassphraseStateError||e.errorCode===n.HardwareErrorCode.ResponseUnexpectTypeError||e.errorCode===n.HardwareErrorCode.PinInvalid||e.errorCode===n.HardwareErrorCode.PinCancelled||e.errorCode===n.HardwareErrorCode.UnexpectPassphrase)&&(yield this.release(),Gt.debug(`error code ${e.errorCode} release device, mainId: ${this.mainId}`)),void(this.runPromise=null)}(!this.keepSession&&"boolean"!=typeof t.keepSession||!1===t.keepSession)&&(this.keepSession=!1,yield this.release(),Gt.debug("release device, mainId: ",this.mainId)),this.runPromise&&this.runPromise.resolve(),this.runPromise=null}))}interruptionFromOutside(){return A(this,void 0,void 0,(function*(){this.commands&&(yield this.commands.dispose(!1)),this.runPromise&&this.runPromise.reject(n.ERRORS.TypedError(n.HardwareErrorCode.DeviceInterruptedFromOutside))}))}interruptionFromUser(){var e,t;return A(this,void 0,void 0,(function*(){const r=n.ERRORS.TypedError(n.HardwareErrorCode.DeviceInterruptedFromUser);yield null===(e=this.cancelableAction)||void 0===e?void 0:e.call(this,r),yield null===(t=this.commands)||void 0===t?void 0:t.cancel(),this.runPromise&&(this.runPromise.reject(r),this.runPromise=null)}))}setCancelableAction(e){this.cancelableAction=t=>e(t).catch((e=>{Gt.debug("cancelableAction error",e)})).finally((()=>{this.clearCancelableAction()}))}clearCancelableAction(){this.cancelableAction=void 0}getMode(){var e,r,i;return(null===(e=this.features)||void 0===e?void 0:e.bootloader_mode)?t.fc.bootloader:(null===(r=this.features)||void 0===r?void 0:r.initialized)?(null===(i=this.features)||void 0===i?void 0:i.no_backup)?t.fc.backupMode:t.fc.normal:t.fc.notInitialized}getFirmwareVersion(){return this.features?Oe(this.features):null}getBLEFirmwareVersion(){return this.features?xe(this.features):null}isUsed(){return"string"==typeof this.originalDescriptor.session}hasDeviceAcquire(){const e=Ye.getSettings("env");return(Ye.isBleConnect(e)||this.isUsed())&&this.deviceAcquired}isUsedHere(){const e=Ye.getSettings("env");return!Ye.isBleConnect(e)&&(this.isUsed()&&this.originalDescriptor.session===this.mainId)}isUsedElsewhere(){return this.isUsed()&&!this.isUsedHere()}isBootloader(){return this.features&&!!this.features.bootloader_mode}isInitialized(){return this.features&&!!this.features.initialized}isSeedless(){return this.features&&!!this.features.no_backup}isUnacquired(){return void 0===this.features}hasUnexpectedMode(e,t){if(this.features){if(this.isBootloader()&&!e.includes(vt.BOOTLOADER))return vt.BOOTLOADER;if(!this.isInitialized()&&!e.includes(vt.NOT_INITIALIZE))return vt.NOT_INITIALIZE;if(this.isSeedless()&&!e.includes(vt.SEEDLESS))return vt.SEEDLESS;if(!this.isBootloader()&&t.includes(vt.BOOTLOADER))return vt.NOT_IN_BOOTLOADER}return null}hasUsePassphrase(){var e;const t=(Ee(this.features)===n.EDeviceType.Touch||Ee(this.features)===n.EDeviceType.Pro)&&!1===(null===(e=this.features)||void 0===e?void 0:e.unlocked);return this.features&&(!!this.features.passphrase_protection||t)}checkDeviceId(e){return!!this.features&&this.features.device_id===e}lockDevice(){return A(this,void 0,void 0,(function*(){return(yield this.commands.typedCall("LockDevice","Success",{})).message}))}supportUnlockVersionRange(){return{pro:{min:"4.15.0"}}}unlockDevice(){var e;return A(this,void 0,void 0,(function*(){const t=null===(e=Oe(this.features))||void 0===e?void 0:e.join("."),r=Ie(this.features,(e=>this.supportUnlockVersionRange()[e]));if(Te(this.features,a.Enum_Capability.Capability_AttachToPin)||r&&b.default.gte(t,r.min)){const e=yield this.commands.typedCall("UnLockDevice","UnLockDeviceResponse");if(this.features)return this.features.unlocked=null==e.message.unlocked?null:e.message.unlocked,this.features.unlocked_attach_pin=null==e.message.unlocked_attach_pin?void 0:e.message.unlocked_attach_pin,this.features.passphrase_protection=null==e.message.passphrase_protection?null:e.message.passphrase_protection,Promise.resolve(this.features);const t=yield this.commands.typedCall("GetFeatures","Features");return this._updateFeatures(t.message),Promise.resolve(t.message)}const{type:i}=yield this.commands.typedCall("GetAddress","Address",{address_n:[Pe(44),Pe(1),Pe(0),0,0],coin_name:"Testnet",script_type:"SPENDADDRESS",show_display:!1});if("CallMethodError"===i)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"unlock device error");const s=yield this.commands.typedCall("GetFeatures","Features");return this._updateFeatures(s.message),Promise.resolve(s.message)}))}checkPassphraseStateSafety(e,t,r){return A(this,void 0,void 0,(function*(){if(!this.features)return!1;const{passphraseState:i,unlockedAttachPin:s}=yield Qe(this,{expectPassphraseState:e,onlyMainPin:t});if(r)return!0;const o=s&&t,a=s&&e&&e!==i;if(Gt.debug("Check passphrase state safety: ",{passphraseState:e,newPassphraseState:i,unlockedAttachPin:s,useEmptyPassphrase:t}),o||a){try{yield this.lockDevice()}catch(e){}return this.clearInternalState(),Promise.reject(n.ERRORS.TypedError(n.HardwareErrorCode.DeviceCheckUnlockTypeError))}return!e||e===i||(this.clearInternalState(),!1)}))}}class Vt extends D.exports{constructor(){super(...arguments),this.devices={}}getDeviceLists(e,t){var r,i;return A(this,void 0,void 0,(function*(){const n=yield null===(r=this.connector)||void 0===r?void 0:r.enumerate(),s=null!==(i=null==n?void 0:n.descriptors)&&void 0!==i?i:[];this.devices={};const{deviceList:o,devices:a}=yield Pt.getDevices(s,e,t);return this.devices=a,o}))}allDevices(){return Object.keys(this.devices).map((e=>this.devices[e]))}getDevice(e){return this.devices[e]}}const $t=e=>({status:Ye.getFirmwareStatus(e),changelog:Ye.getFirmwareChangelog(e),release:Ye.getFirmwareLatestRelease(e),bootloaderMode:!!e.bootloader_mode}),Zt=e=>({status:Ye.getBLEFirmwareStatus(e),changelog:Ye.getBleFirmwareChangelog(e),release:Ye.getBleFirmwareLatestRelease(e),bootloaderMode:!!e.bootloader_mode}),Yt=(e,t)=>{const r=Ye.getFirmwareLatestRelease(e),i=[null==r?void 0:r.bootloaderChangelog].filter((e=>null!=e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"zh-CN")&&Object.prototype.hasOwnProperty.call(e,"en-US"))),n=!!e.bootloader_mode;let s=!1;const o=Ee(e);return _e.model_mini.includes(o)?s=!!ht(e,t):_e.model_touch.includes(o)&&(s=pt(e)),{status:s?"outdated":"valid",changelog:i,release:r,bootloaderMode:n,shouldUpdate:s}},Jt=le(t.d3.Method);class Xt{constructor(e){this.shouldEnsureConnected=!0,this.checkDeviceId=!1,this.useDevicePassphraseState=!0,this.skipForceUpdateCheck=!1,this.strictCheckDeviceSupport=!1,this.postPreviousAddressMessage=e=>{this.postMessage(_t(vt.PREVIOUS_ADDRESS_RESULT,{device:this.device.toMessageObject(),data:e}))};const{payload:t}=e;this.name=t.method,this.payload=t,this.responseID=e.id||0,this.connectId=t.connectId||"",this.deviceId=t.deviceId||"",this.useDevice=!0,this.allowDeviceMode=[vt.NOT_INITIALIZE],this.requireDeviceMode=[]}getVersionRange(){return{}}setDevice(e){this.device=e}checkFirmwareRelease(){if(!this.device||!this.device.features)return;const e=$t(this.device.features);this.postMessage(xt(Ot.RELEASE_INFO,Object.assign(Object.assign({},e),{device:this.device.toMessageObject()})));const t=Zt(this.device.features);this.postMessage(xt(Ot.BLE_RELEASE_INFO,Object.assign(Object.assign({},t),{device:this.device.toMessageObject()})))}checkDeviceSupportFeature(){if(!this.device||!this.device.features)return;const e=Xe(this.device.features),t=rt(this.device.features);this.postMessage(Mt(Rt.SUPPORT_FEATURES,{inputPinOnSoftware:e,modifyHomescreen:t,device:this.device.toMessageObject()}))}checkFeatureVersionLimit(e,t,r){var i;if(!e())return;const s=null===(i=Oe(this.device.features))||void 0===i?void 0:i.join("."),o=Ie(this.device.features,(e=>t()[e]));if(o){if(b.default.valid(s)&&b.default.lt(s,o.min))throw n.createNeedUpgradeFirmwareHardwareError(s,o.min)}else if(null==r?void 0:r.strictCheckDeviceSupport)throw n.ERRORS.TypedError(n.HardwareErrorCode.DeviceNotSupportMethod,"Device does not support this method")}checkSafetyLevelOnTestNet(){var e,t,r;return A(this,void 0,void 0,(function*(){let i=!1;"evmSignTransaction"===this.name&&[3,4,5,420,11155111].includes(Number(null===(t=null===(e=this.payload)||void 0===e?void 0:e.transaction)||void 0===t?void 0:t.chainId))&&(i=!0),i&&"Strict"===(null===(r=this.device.features)||void 0===r?void 0:r.safety_checks)&&(Jt.debug("will change safety_checks level"),yield this.device.commands.typedCall("ApplySettings","Success",{safety_checks:"PromptTemporarily"}))}))}dispose(){}}const Qt="2.2.0",er="4.3.0",tr="3.1.0";function rr({deviceType:e,currentFirmwareVersion:t,willUpdateFirmwareVersion:r}){return A(this,void 0,void 0,(function*(){try{const{data:i}=yield _.default.request({url:"http://localhost:21320",method:"POST",withCredentials:!1,timeout:3e3}),{version:n="0.0.0"}=i,s=b.default.lt(n,Qt);let o=!1;_e.model_touch.includes(e)&&(r&&b.default.gte(r,er)&&s&&(o=!0),b.default.gte(t,er)&&s&&(o=!0)),_e.model_mini.includes(e)&&(r&&b.default.gte(r,tr)&&s&&(o=!0),b.default.gte(t,tr)&&s&&(o=!0));const a=Ye.getBridgeChangelog();return{shouldUpdate:o,status:o?"outdated":"valid",releaseVersion:Qt,changelog:a}}catch(e){if("ECONNABORTED"===e.code)throw n.ERRORS.TypedError(n.HardwareErrorCode.BridgeTimeoutError);throw n.ERRORS.TypedError(n.HardwareErrorCode.BridgeNotInstalled)}}))}const ir=e=>"0x"===e.slice(0,2).toLowerCase(),nr=e=>ir(e)?e.slice(2):e,sr=e=>ir(e)?e:`0x${e}`,or=e=>{for(;/^00/.test(e);)e=e.slice(2);return e},ar=e=>{if("string"==typeof e){let t=nr(e);return t.length%2!=0&&(t=`0${t}`),t}return Array.isArray(e)?e.map(ar):"object"==typeof e?(t=e,r=e=>ar(e),Object.fromEntries(Object.entries(t).map((([e,t])=>[e,r(t,e)])))):e;var t,r},dr=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function ur(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=dr[e[r]];return t}function lr(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const i=2*r,n=e.slice(i,i+2),s=Number.parseInt(n,16);if(Number.isNaN(s)||s<0)throw new Error("Invalid byte sequence");t[r]=s}return t}function cr(e){if(!e)return 0;if("string"==typeof e){if(""===e.trim())return 0;if(e.match(/^[0-9]+$/))return new T.default(e,10).toNumber();if(e.startsWith("0x")||e.match(/^[0-9a-fA-F]+$/))return new T.default(e,16).toNumber();throw new Error(`Invalid chainId ${e}`)}if("number"==typeof e)return new T.default(e).toNumber();throw new Error(`Invalid chainId ${e}`)}const pr=e=>n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodInvalidParameter,e),hr=e=>n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodError,e),fr=(e,t)=>{t.forEach((t=>{if(!Object.prototype.hasOwnProperty.call(e,t.name)&&t.required)throw pr(`Missing required parameter: ${t.name}`);const r=e[t.name];if(r&&t.type)switch(t.type){case"array":if(!Array.isArray(r))throw pr(`Parameter [${t.name}] is of type invalid and should be [${t.type}].`);if(!t.allowEmpty&&r.length<1)throw pr(`Parameter "${t.name}" is empty.`);break;case"uint":if("string"!=typeof r&&"number"!=typeof r)throw pr(`Parameter [${t.name}] has invalid type. "string|number" expected.`);if("number"==typeof r&&!Number.isSafeInteger(r)||!/^(?:[1-9]\d*|\d)$/.test(r.toString().replace(/^-/,t.allowNegative?"":"-")))throw pr(`Parameter [${t.name}] has invalid value "${r}". Integer representation expected.`);break;case"bigNumber":if("string"!=typeof r)throw pr(`Parameter [${t.name}] is of type invalid and should be [string].`);try{if(new T.default(r).toFixed(0)!==r)throw new Error("")}catch(e){throw pr(`Parameter [${t.name}] is of type invalid and should be [${t.type}].`)}break;case"buffer":if(void 0===r||"function"==typeof r.constructor.isBuffer&&r.constructor.isBuffer(r))throw pr(`Parameter [${t.name}] is of type invalid and should be [buffer].`);break;case"hexString":if("string"!=typeof r||!((e,t)=>!("string"!=typeof e||!e.match(/^(0x|0X)?[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t))(sr(r)))throw pr(`Parameter [${t.name}] is of type invalid and should be [${t.type}].`);break;default:if(typeof r!==t.type)throw pr(`Parameter [${t.name}] is of type invalid and should be [${t.type}].`)}}))};function yr(e,t,r){if(Array.isArray(e)){if(null!==(null==r?void 0:r.expectedLength)&&e.length!==(null==r?void 0:r.expectedLength))throw hr(`Expected array length of ${null==r?void 0:r.expectedLength}, but got ${e.length}`);e.forEach(((e,r)=>{t.forEach((t=>{if(null==e[t])throw hr(`Field '${t}' in array item at index ${r} is null`)}))}))}else{if("object"!=typeof e||null===e)throw hr("Result is neither an array nor a valid object");t.forEach((t=>{if(null==e[t])throw hr(`Field '${t}' in object is null`)}))}}const gr=e=>{throw e instanceof n.HardwareError?e:"ERR_NETWORK"===e.code?n.ERRORS.TypedError(n.HardwareErrorCode.BridgeNotInstalled):"ECONNABORTED"===e.code?n.ERRORS.TypedError(n.HardwareErrorCode.BridgeTimeoutError):"ERR_BAD_REQUEST"===e.code?n.ERRORS.TypedError(n.HardwareErrorCode.BridgeNetworkError):n.ERRORS.TypedError(e)};const mr=({features:e,updateType:t,version:r,isUpdateBootloader:i})=>A(void 0,void 0,void 0,(function*(){const s=br({features:e,updateType:t,targetVersion:null==r?void 0:r.join(".")});if(!s)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"no firmware found for this device");if(r&&!b.default.eq(s.version.join("."),r.join("."))){if(!("touch"===Ee(e)&&!e.ukey_version))throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"firmware version mismatch")}const o="ble"===t?s.webUpdate:i?s.bootloaderResource:s.url;let a;try{a=yield ce(o,"binary")}catch(e){throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"Method_FirmwareUpdate_DownloadFailed")}return Object.assign(Object.assign({},s),{binary:a})})),vr=e=>A(void 0,void 0,void 0,(function*(){let t;try{t=yield ce(e,"binary")}catch(e){throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"Method_FirmwareUpdate_DownloadFailed")}return{binary:t}})),br=({features:e,updateType:t,targetVersion:r})=>{var i,n;const s=Ee(e);if("unknown"===s)return null;const{deviceMap:o}=Ye,a=it({features:e,updateType:t,targetVersion:r}),d=null!==(n=null===(i=null==o?void 0:o[s])||void 0===i?void 0:i[a])&&void 0!==n?n:[];return $e(d)},_r="session not found",wr=le(t.d3.Method),Tr=e=>{var t;(null===(t=e.features)||void 0===t?void 0:t.firmware_present)&&e.emit(Rt.BUTTON,e,{code:"ButtonRequest_FirmwareUpdate"})},Er=(e,t,r,i)=>{i(_t(vt.FIRMWARE_PROGRESS,{device:e.toMessageObject(),progress:t,progressType:r}))},Sr=(e,t,r)=>{r(_t(vt.FIRMWARE_TIP,{device:e.toMessageObject(),data:{message:t}}))},Ar=e=>A(void 0,void 0,void 0,(function*(){"ble"===e&&(yield ft(1e4))})),Rr=(e,t,r,i,{payload:s,rebootOnSuccess:o})=>A(void 0,void 0,void 0,(function*(){const a=Ee(i.features);if(_e.model_mini.includes(a)){Tr(i),Sr(i,"ConfirmOnDevice",r);const o="firmware"===e?"FirmwareErase":"FirmwareErase_ex";if("Success"!==(yield t(o,"Success",{})).type)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"erase firmware error");Sr(i,"FirmwareEraseSuccess",r),Er(i,0,"installingFirmware",r);const{message:a,type:d}=yield t("FirmwareUpload","Success",{payload:s});if(Er(i,100,"installingFirmware",r),yield Ar(e),"Success"!==d)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"install firmware error");return a}if(_e.model_touch.includes(a)){if(i.features){const t=ke(i.features);if(b.default.gte(t.join("."),"2.4.5")){return(yield Mr(e,r,i,{payload:s},o)).message}}Tr(i),Sr(i,"ConfirmOnDevice",r);const a=s.byteLength;let d=yield t("FirmwareErase",["FirmwareRequest","Success"],{length:a});for(Sr(i,"FirmwareEraseSuccess",r);"Success"!==d.type;){const e=d.message.offset,o=d.message.offset+d.message.length,u=s.slice(e,o);if(e>0&&Er(i,Math.round(e/a*100),"transferData",r),d=yield t("FirmwareUpload",["FirmwareRequest","Success"],{payload:u}),"CallMethodError"===d.type)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"upload firmware error")}return Er(i,100,"transferData",r),yield Ar(e),d.message}throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"uploadFirmware: unknown device model")})),Mr=(e,t,r,{payload:i},s=!0)=>A(void 0,void 0,void 0,(function*(){var o,a,d,u,l;let c=r.getCommands().typedCall.bind(r.getCommands());Sr(r,"StartTransferData",t);const p=`0:${"ble"===e?"ble-":""}firmware.bin`,h=Ye.getSettings("env"),f=1024*(Ye.isBleConnect(h)?16:128),y=Math.ceil(i.byteLength/f);let g=0;for(let e=0;e<y;e++){const n=e*f,s=Math.min(n+f,i.byteLength),o=s-n,a=i.slice(n,s),d=0===e,u=Math.round((e+1)/y*100);g+=(yield Ir(r,p,o,g,a,d,u)).message.processed_byte,Er(r,u,"transferData",t)}Tr(r),Sr(r,"ConfirmOnDevice",t),Sr(r,"InstallingFirmware",t),c=r.getCommands().typedCall.bind(r.getCommands());const m=yield c("FirmwareUpdateEmmc","Success",{path:p,reboot_on_success:s});if("Success"===m.type&&"Firmware install confirmed"===(null===(o=null==m?void 0:m.message)||void 0===o?void 0:o.message)){const e=12e4,t=Date.now(),i=Ye.isBleConnect(h);for(;Date.now()-t<e;)try{if(i)try{yield null===(a=r.deviceConnector)||void 0===a?void 0:a.acquire(r.originalDescriptor.id,null,!0);const e=r.getCommands().typedCall.bind(r.getCommands());yield Promise.race([e("Initialize","Features",{}),new Promise(((e,t)=>{setTimeout((()=>{t(n.ERRORS.TypedError(n.HardwareErrorCode.DeviceInitializeFailed))}),3e3)}))])}catch(e){wr.log("catch Bluetooth error when device is restarting: ",e)}else{const e=yield null===(d=r.deviceConnector)||void 0===d?void 0:d.enumerate(),t=null!==(u=null==e?void 0:e.descriptors)&&void 0!==u?u:[],{deviceList:i}=yield Pt.getDevices(t,r.originalDescriptor.id);1===i.length&&(r.updateFromCache(i[0]),yield r.acquire(),r.commands.disposed=!1,r.getCommands().mainId=null!==(l=r.mainId)&&void 0!==l?l:"")}const e=r.getCommands().typedCall.bind(r.getCommands());yield e("GetFeatures","Features",{}),Pt.resetState();break}catch(e){console.error("Device reconnect failed: ",e),wr.error("Device reconnect failed:",e),yield ft(1e3)}}return m})),Ir=(e,t,r,i,s,o,a)=>A(void 0,void 0,void 0,(function*(){var d,u,l,c,p,h,f,y,g;let m=10;for(;m>0;)try{return yield A(void 0,void 0,void 0,(function*(){var d;const u=e.getCommands().typedCall.bind(e.getCommands()),l=yield u("EmmcFileWrite","EmmcFile",{file:{path:t,len:r,offset:i,data:s},overwrite:o,append:0!==i,ui_percentage:a});if("EmmcFile"!==l.type){if("CallMethodError"===l.type&&(null!==(d=l.message.error)&&void 0!==d?d:"").indexOf(_r)>-1)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,_r);throw n.ERRORS.TypedError(n.HardwareErrorCode.EmmcFileWriteFirmwareError,"transfer data error")}return l}))}catch(t){if(wr.error("emmcWrite error: ",t),m--,0===m)throw n.ERRORS.TypedError(n.HardwareErrorCode.EmmcFileWriteFirmwareError,"transfer data error");const r=Ye.getSettings("env");if(Ye.isBleConnect(r))yield ft(3e3),yield null===(d=e.deviceConnector)||void 0===d?void 0:d.acquire(e.originalDescriptor.id,null,!0),yield e.initialize();else if((null===(u=null==t?void 0:t.message)||void 0===u?void 0:u.indexOf(_r))>-1||(null===(c=null===(l=null==t?void 0:t.response)||void 0===l?void 0:l.data)||void 0===c?void 0:c.indexOf(_r))>-1){const t=yield null===(p=e.deviceConnector)||void 0===p?void 0:p.enumerate(),r=null!==(h=null==t?void 0:t.descriptors)&&void 0!==h?h:[],{deviceList:i}=yield Pt.getDevices(r,void 0);1===i.length&&(null===(y=null===(f=i[0])||void 0===f?void 0:f.features)||void 0===y?void 0:y.bootloader_mode)&&(e.updateFromCache(i[0]),yield e.acquire(),e.getCommands().mainId=null!==(g=e.mainId)&&void 0!==g?g:"")}yield ft(3e3)}})),Or=(e,t,r)=>A(void 0,void 0,void 0,(function*(){if("Success"===t.type)return t.message;const{offset:i,data_length:n}=t.message;if(void 0===i)throw new Error("offset is undefined");const s=new Uint8Array(r.slice(i,Math.min(i+n,r.byteLength))),o=c.blake2s(s),a={data_chunk:ur(s),hash:ur(o)},d=yield e("ResourceAck",["ResourceRequest","Success"],Object.assign({},a));return Or(e,d,r)})),xr=(e,t,r,i)=>A(void 0,void 0,void 0,(function*(){const n=new Uint8Array(r.slice(0,Math.min(16384,r.byteLength))),s=c.blake2s(n),o=yield e("ResourceUpdate",["ResourceRequest","Success"],{file_name:t,data_length:r.byteLength,initial_data_chunk:ur(n),hash:ur(s)});return null==i||i(),Or(e,o,r)})),kr=(e,t,r,i)=>A(void 0,void 0,void 0,(function*(){Sr(r,"UpdateSysResource",t);const n=yield E.default.loadAsync(i),s=Object.entries(n.files);let o=0;const a=100/s.length;for(const[i,n]of s){const s=i.split("/").pop();if(!n.dir&&-1===i.indexOf("__MACOSX")&&s){const t=yield n.async("arraybuffer");yield xr(e,s,t)}o+=a,Er(r,Math.floor(o),"installingFirmware",t)}return Er(r,100,"installingFirmware",t),Sr(r,"UpdateSysResourceSuccess",t),!0})),Cr=(e,t,r,i)=>A(void 0,void 0,void 0,(function*(){return Sr(r,"UpdateBootloader",t),Er(r,Math.floor(0),"installingFirmware",t),yield xr(e,"bootloader.bin",i,(()=>{((e,t)=>{t(_t(vt.FIRMWARE_PROCESSING,{type:e}))})("resource",t)})),Er(r,Math.floor(100),"installingFirmware",t),Sr(r,"UpdateBootloaderSuccess",t),!0}));const Pr=le(t.d3.Method);const Dr=le(t.d3.Method);const Nr=le(t.d3.Method),Br="session not found";class qr extends Xt{constructor(){super(...arguments),this.checkPromise=null,this.postTipMessage=e=>{this.postMessage(_t(vt.FIRMWARE_TIP,{device:this.device.toMessageObject(),data:{message:e}}))},this.postProcessingMessage=e=>{this.postMessage(_t(vt.FIRMWARE_PROCESSING,{type:e}))},this.postProgressMessage=(e,t)=>{this.postMessage(_t(vt.FIRMWARE_PROGRESS,{device:this.device.toMessageObject(),progress:e,progressType:t}))}}init(){}run(){return Promise.resolve()}isBleReconnect(){const e=Ye.getSettings("env");return this.payload.connectId&&Ye.isBleConnect(e)}_promptDeviceInBootloaderForWebDevice(){return A(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{this.device.listenerCount(Rt.SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE)>0&&this.device.emit(Rt.SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE,this.device,((r,i)=>{r?t(r):e(i)}))}))}))}checkDeviceToBootloader(e){var r,i;this.checkPromise=n.createDeferred();const s=Ye.getSettings("env"),o=e&&Ye.isBleConnect(s);Nr.log("FirmwareUpdateBaseMethod [checkDeviceToBootloader] isBleReconnect: ",o);let a,d=!0,u=0;const l=Ee(null===(r=null==this?void 0:this.device)||void 0===r?void 0:r.features)===n.EDeviceType.Touch||Ee(null===(i=null==this?void 0:this.device)||void 0===i?void 0:i.features)===n.EDeviceType.Pro,c=setInterval((()=>A(this,void 0,void 0,(function*(){var r,i,n,s;if(u+=1,Nr.log("FirmwareUpdateBaseMethod [checkDeviceToBootloader] isFirstCheck: ",d),l&&d&&(d=!1,Nr.log("FirmwareUpdateBaseMethod [checkDeviceToBootloader] wait 3000ms"),yield ft(3e3)),u>4&&Ye.isWebUsbConnect(Ye.getSettings("env"))){clearInterval(c),clearTimeout(a);try{this.postTipMessage(t.nn.SelectDeviceInBootloaderForWebDevice);(yield this._promptDeviceInBootloaderForWebDevice())&&(yield this._checkDeviceInBootloaderMode(e,c,a))}catch(e){Nr.log("FirmwareUpdateBaseMethod [checkDeviceToBootloader] promptDeviceInBootloaderForWebDevice failed: ",e),null===(r=this.checkPromise)||void 0===r||r.reject(e)}}else if(o)try{yield null===(i=this.device.deviceConnector)||void 0===i?void 0:i.acquire(this.device.originalDescriptor.id,null,!0),yield this.device.initialize(),(null===(n=this.device.features)||void 0===n?void 0:n.bootloader_mode)&&(clearInterval(c),null===(s=this.checkPromise)||void 0===s||s.resolve(!0))}catch(e){Nr.log("catch Bluetooth error when device is restarting: ",e)}else yield this._checkDeviceInBootloaderMode(e,c,a)}))),o?3e3:2e3);a=setTimeout((()=>{this.checkPromise&&(clearInterval(c),this.checkPromise.reject(new Error))}),3e4)}_checkDeviceInBootloaderMode(e,t,r){var i,n,s,o,a;return A(this,void 0,void 0,(function*(){const d=yield null===(i=this.device.deviceConnector)||void 0===i?void 0:i.enumerate(),u=null!==(n=null==d?void 0:d.descriptors)&&void 0!==n?n:[],{deviceList:l}=yield Pt.getDevices(u,e);return!(1!==l.length||!(null===(o=null===(s=l[0])||void 0===s?void 0:s.features)||void 0===o?void 0:o.bootloader_mode))&&(this.device.updateFromCache(l[0]),this.device.commands.disposed=!1,t&&clearInterval(t),r&&clearTimeout(r),null===(a=this.checkPromise)||void 0===a||a.resolve(!0),!0)}))}enterBootloaderMode(){var e;return A(this,void 0,void 0,(function*(){const r=this.device.getCommands().typedCall.bind(this.device.getCommands());if(this.device.features&&!this.device.features.bootloader_mode){const i=Re(this.device.features),s=Ee(this.device.features);try{this.postTipMessage(t.nn.AutoRebootToBootloader);if("CallMethodError"===(yield r("DeviceBackToBoot","Success")).type)throw n.ERRORS.TypedError(n.HardwareErrorCode.FirmwareUpdateAutoEnterBootFailure);this.postTipMessage(t.nn.GoToBootloaderSuccess),this.checkDeviceToBootloader(this.payload.connectId),_e.model_classic.includes(s)&&Pt.clearDeviceCache(i),delete Pt.devicesCache[""],yield null===(e=this.checkPromise)||void 0===e?void 0:e.promise,this.checkPromise=null;const o=_e.model_touch.includes(s);return yield ft(o?3e3:1500),yield this.device.acquire(),!0}catch(e){return e instanceof n.HardwareError?Promise.reject(e):(console.log("auto go to bootloader mode failed: ",e),Promise.reject(n.ERRORS.TypedError(n.HardwareErrorCode.FirmwareUpdateAutoEnterBootFailure)))}}}))}startEmmcFirmwareUpdate({path:e}){return A(this,void 0,void 0,(function*(){const r=this.device.getCommands().typedCall.bind(this.device.getCommands());if("Success"!==(yield r("FirmwareUpdateEmmc","Success",{path:e,reboot_on_success:!0})).type)throw n.ERRORS.TypedError(n.HardwareErrorCode.FirmwareError,"firmware update error");this.postTipMessage(t.nn.FirmwareUpdating)}))}createUpdatesFolderIfNotExists(e){return A(this,void 0,void 0,(function*(){const t=this.device.getCommands().typedCall.bind(this.device.getCommands());yield t("EmmcDirMake","Success",{path:e})}))}emmcCommonUpdateProcess({payload:e,filePath:t,processedSize:r,totalSize:i}){return A(this,void 0,void 0,(function*(){if(!t.startsWith("0:"))throw new Error("filePath must start with 0:");const n=Ye.getSettings("env"),s=1024*(Ye.isBleConnect(n)?16:128),o=Math.ceil(e.byteLength/s);let a=0,d=0;for(let n=0;n<o;n++){const u=n*s,l=Math.min(u+s,e.byteLength),c=l-u,p=e.slice(u,l),h=0===n;let f;void 0!==i&&void 0!==r?(d=r+l,f=Math.min(Math.ceil(d/i*100),99)):f=Math.min(Math.ceil((n+1)/o*100),99);a+=(yield this.emmcFileWriteWithRetry(t,c,a,p,h,f)).message.processed_byte,this.postProgressMessage(f,"transferData")}return void 0!==i?(null!=r?r:0)+e.byteLength:0}))}emmcFileWriteWithRetry(e,t,r,i,s,o){var a,d,u,l,c,p,h,f,y;return A(this,void 0,void 0,(function*(){const g=()=>A(this,void 0,void 0,(function*(){var a;const d=this.device.getCommands().typedCall.bind(this.device.getCommands()),u=yield d("EmmcFileWrite","EmmcFile",{file:{path:e,len:t,offset:r,data:i},overwrite:s,append:0!==r,ui_percentage:o});if("EmmcFile"!==u.type){if("CallMethodError"===u.type&&(null!==(a=u.message.error)&&void 0!==a?a:"").indexOf(Br)>-1)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,Br);throw n.ERRORS.TypedError(n.HardwareErrorCode.EmmcFileWriteFirmwareError,"transfer data error")}return u}));let m=10;for(;m>0;)try{return yield g()}catch(e){if(Nr.error("emmcWrite error: ",e),m--,0===m)throw n.ERRORS.TypedError(n.HardwareErrorCode.EmmcFileWriteFirmwareError,"transfer data error");const t=Ye.getSettings("env");if(Ye.isBleConnect(t))yield ft(3e3),yield null===(a=this.device.deviceConnector)||void 0===a?void 0:a.acquire(this.device.originalDescriptor.id,null,!0),yield this.device.initialize();else if((null===(d=null==e?void 0:e.message)||void 0===d?void 0:d.indexOf(Br))>-1||(null===(l=null===(u=null==e?void 0:e.response)||void 0===u?void 0:u.data)||void 0===l?void 0:l.indexOf(Br))>-1){const e=yield null===(c=this.device.deviceConnector)||void 0===c?void 0:c.enumerate(),t=null!==(p=null==e?void 0:e.descriptors)&&void 0!==p?p:[],{deviceList:r}=yield Pt.getDevices(t,void 0);1===r.length&&(null===(f=null===(h=r[0])||void 0===h?void 0:h.features)||void 0===f?void 0:f.bootloader_mode)&&(this.device.updateFromCache(r[0]),yield this.device.acquire(),this.device.getCommands().mainId=null!==(y=this.device.mainId)&&void 0!==y?y:"")}yield ft(2e3)}}))}reboot(e){return A(this,void 0,void 0,(function*(){const t=this.device.getCommands().typedCall.bind(this.device.getCommands());return(yield t("Reboot","Success",{reboot_type:e})).message}))}}const Lr=le(t.d3.Method);const jr=le(t.d3.Method);const Fr="mainnet",Ur={tbtc:{name:"btc",coin:"Testnet"},bch:{name:"btc",coin:"Bcash"},doge:{name:"btc",coin:"Dogecoin"},ltc:{name:"btc",coin:"Litecoin"},neurai:{name:"btc",coin:"Neurai"}},zr={btc:{methodName:"btcGetPublicKey",getParams:(e,t)=>Object.assign({coin:t},e)},evm:{methodName:"evmGetAddress",getParams:(e,t)=>{const{path:r,showOnOneKey:i}=e;let n;return t&&(n=parseInt(t)),{chainId:n,path:r,showOnOneKey:i}}},sol:{methodName:"solGetAddress"},algo:{methodName:"algoGetAddress"},near:{methodName:"nearGetAddress"},stc:{methodName:"starcoinGetAddress"},cfx:{methodName:"confluxGetAddress",getParams:(e,t)=>{const{path:r,showOnOneKey:i}=e;return{chainId:parseInt(null!=t?t:"1029"),path:r,showOnOneKey:i}}},tron:{methodName:"tronGetAddress"},aptos:{methodName:"aptosGetAddress"},xrp:{methodName:"xrpGetAddress"},cosmos:{methodName:"cosmosGetPublicKey",getParams:e=>{const{path:t,prefix:r,showOnOneKey:i}=e;return{hrp:r,path:t,showOnOneKey:i}}},ada:{methodName:"cardanoGetAddress",getParams:(e,t)=>{const{path:r,showOnOneKey:i}=e,n="string"==typeof r?`${r}/0/0`:ze([...r,0,0]),s="string"==typeof r?`${r}/2/0`:ze([...r,2,0]);let o=1;return t&&(o=t===Fr?1:0),{addressParameters:{addressType:a.Messages.CardanoAddressType.BASE,path:n,stakingPath:s},protocolMagic:764824073,networkId:o,derivationType:a.Messages.CardanoDerivationType.ICARUS,showOnOneKey:i,address:"",isCheck:!1}}},sui:{methodName:"suiGetAddress"},benfen:{methodName:"benfenGetAddress"},fil:{methodName:"filecoinGetAddress",getParams:(e,t)=>{const{path:r,showOnOneKey:i}=e;let n=!1;return t&&(n=t!==Fr),{isTestnet:n,path:r,showOnOneKey:i}}},dot:{methodName:"polkadotGetAddress",getParams:(e,t)=>{const{path:r,prefix:i,showOnOneKey:n}=e;if(!i||!t)throw new Error("Invalid params");return{prefix:parseInt(i),network:t,path:r,showOnOneKey:n}}},kaspa:{methodName:"kaspaGetAddress",getParams:e=>{const{path:t,prefix:r,showOnOneKey:i,useTweak:n}=e;return{scheme:"schnorr",prefix:r,path:t,showOnOneKey:i,useTweak:n}}},nexa:{methodName:"nexaGetAddress",getParams:e=>{const{path:t,prefix:r,showOnOneKey:i}=e;return{scheme:"Schnorr",prefix:r,path:t,showOnOneKey:i}}},dynex:{methodName:"dnxGetAddress"},nervos:{methodName:"nervosGetAddress",getParams:(e,t)=>{const{path:r,showOnOneKey:i}=e;return{network:t,path:r,showOnOneKey:i}}},scdo:{methodName:"scdoGetAddress"},ton:{methodName:"tonGetAddress"},alph:{methodName:"alephiumGetAddress"},nostr:{methodName:"nostrGetPublicKey"},neo:{methodName:"neoGetAddress"}};class Hr extends Xt{constructor(){super(...arguments),this.abortController=null}init(){var e,t;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"bundle",type:"array"}]),null===(t=null===(e=this.payload)||void 0===e?void 0:e.bundle)||void 0===t||t.forEach((e=>{fr(e,[{name:"path",required:!0},{name:"network",type:"string",required:!0},{name:"chainName",type:"string"},{name:"showOnOneKey",type:"boolean"}])}))}generateMethodName({network:e,payload:t,originalIndex:r}){var i,n;const{name:s,coin:o}=Ur[e]||{name:e,coin:null==t?void 0:t.chainName},a=zr[s];if(!a)throw new Error(`Unsupported network: ${e}`);return{methodName:a.methodName,params:Object.assign(Object.assign({},null!==(n=null===(i=null==a?void 0:a.getParams)||void 0===i?void 0:i.call(a,t,o,a.methodName))&&void 0!==n?n:t),{originPayload:t}),_originRequestParams:t,_originalIndex:r}}callMethod(e,t,r){var i;return A(this,void 0,void 0,(function*(){const s=ln({event:wt.CALL,type:wt.CALL,payload:Object.assign({connectId:this.payload.connectId,deviceId:this.payload.deviceId,method:e},t)});let o;s.connector=this.connector,s.postMessage=this.postMessage;try{s.init(),null===(i=s.setDevice)||void 0===i||i.call(s,this.device),s.context=this.context;const e=()=>{var e;null===(e=this.abortController)||void 0===e||e.abort(n.HardwareErrorCodeMessage[n.HardwareErrorCode.RepeatUnlocking])},a=(...[t,r])=>{"ButtonRequest_PinEntry"===r.code||"ButtonRequest_AttachPin"===r.code?e():Fn(t,r)};this.device.on(Rt.BUTTON,a),this.device.on(Rt.PIN,e),this.device.on(Rt.PASSPHRASE,e),function(e,t){const r=Ie(e.features,(e=>t.getVersionRange()[e])),i=Oe(e.features).join(".");if(r&&b.default.valid(r.min)&&b.default.lt(i,r.min))throw n.ERRORS.createNeedUpgradeFirmwareHardwareError(i,r.min);if(t.strictCheckDeviceSupport&&!r)throw n.ERRORS.TypedError(n.HardwareErrorCode.DeviceNotSupportMethod)}(this.device,s);const d=yield s.run();if(!Array.isArray(d)||0===d.length)throw new Error("No response");o=d.map(((e,i)=>Object.assign(Object.assign({},t.bundle[i]._originRequestParams),{success:!0,payload:Object.assign(Object.assign({},e),{rootFingerprint:r})})))}catch(e){const r=function(e,t,r){var i,s,o,a,d;let u;if(e instanceof n.HardwareError&&e.errorCode!==n.HardwareErrorCode.RuntimeError){const{errorCode:t}=e;(t===n.HardwareErrorCode.CallMethodNeedUpgradeFirmware||t===n.HardwareErrorCode.DeviceNotSupportMethod)&&(u=e)}else if(null===(i=e.message)||void 0===i?void 0:i.includes("Failure_UnexpectedMessage")){const i=Ie(t.features,(e=>r.getVersionRange()[e])),s=Oe(t.features).join(".");u=i&&b.default.valid(i.min)&&b.default.lt(s,i.min)?n.ERRORS.createNeedUpgradeFirmwareHardwareError(s,i.min):n.ERRORS.TypedError(n.HardwareErrorCode.DeviceNotSupportMethod,e.message)}else((null===(o=null===(s=e.message)||void 0===s?void 0:s.toLowerCase())||void 0===o?void 0:o.includes("forbidden key path"))||(null===(d=null===(a=e.message)||void 0===a?void 0:a.toLowerCase())||void 0===d?void 0:d.includes("invalid path")))&&(u=n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodInvalidParameter,e.message));return u}(e,this.device,s);if(!r)throw e;o=t.bundle.map((e=>Object.assign(Object.assign({},e._originRequestParams),{success:!1,payload:{error:r.message,code:r.errorCode,params:r.params,connectId:s.connectId,deviceId:s.deviceId}})))}return o}))}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("GetPublicKey","PublicKey",{address_n:[Pe(44),Pe(1),Pe(0)],coin_name:"Testnet",script_type:"SPENDADDRESS",show_display:!1});if(this.postMessage(_t(vt.CLOSE_UI_PIN_WINDOW)),null==e.message.root_fingerprint)throw n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodInvalidParameter);return this.abortController=new AbortController,this.getAllNetworkAddress(e.message.root_fingerprint).catch((e=>{if(e instanceof n.HardwareError&&e.errorCode===n.HardwareErrorCode.RepeatUnlocking)throw n.ERRORS.TypedError(n.HardwareErrorCode.RepeatUnlocking,e.message);throw e}))}))}}var Gr=[{name:"Bitcoin",label:"BTC",slip44:0},{name:"Regtest",label:"REGTEST",slip44:1},{name:"Testnet",label:"TEST",slip44:1},{name:"Actinium",label:"ACM",slip44:228},{name:"Axe",label:"AXE",slip44:4242},{name:"Bcash",label:"BCH",slip44:145},{name:"Bitcore",label:"BTX",slip44:160},{name:"Dash",label:"DASH",slip44:5},{name:"Dash Testnet",label:"tDASH",slip44:1},{name:"Decred",label:"DCR",slip44:42},{name:"Decred Testnet",label:"TDCR",slip44:1},{name:"DigiByte",label:"DGB",slip44:20},{name:"Dogecoin",label:"DOGE",slip44:3},{name:"Feathercoin",label:"FTC",slip44:8},{name:"Firo",label:"FIRO",slip44:136},{name:"Firo Testnet",label:"tFIRO",slip44:1},{name:"Fujicoin",label:"FJC",slip44:75},{name:"GameCredits",label:"GAME",slip44:101},{name:"Komodo",label:"KMD",slip44:141},{name:"Koto",label:"KOTO",slip44:510},{name:"Litecoin",label:"LTC",slip44:2},{name:"Litecoin Testnet",label:"tLTC",slip44:1},{name:"Monacoin",label:"MONA",slip44:22},{name:"MonetaryUnit",label:"MUE",slip44:31},{name:"NIX",label:"NIX",slip44:400},{name:"Namecoin",label:"NMC",slip44:7},{name:"Peercoin",label:"PPC",slip44:6},{name:"Peercoin Testnet",label:"tPPC",slip44:1},{name:"Polis",label:"POLIS",slip44:1997},{name:"Primecoin",label:"XPM",slip44:24},{name:"Ravencoin",label:"RVN",slip44:175},{name:"Ritocoin",label:"RITO",slip44:19169},{name:"Stakenet",label:"XSN",slip44:199},{name:"Syscoin",label:"SYS",slip44:57},{name:"Unobtanium",label:"UNO",slip44:92},{name:"Verge",label:"XVG",slip44:77},{name:"Vertcoin",label:"VTC",slip44:28},{name:"Viacoin",label:"VIA",slip44:14},{name:"ZCore",label:"ZCR",slip44:428},{name:"Zcash",label:"ZEC",slip44:133},{name:"Zcash Testnet",label:"TAZ",slip44:1},{name:"Neurai",label:"XNA",slip44:1900}];const Kr=(e,t)=>{let r;if(t){const e=t.toLowerCase();r=Gr.find((t=>t.name.toLowerCase()===e||t.label.toLowerCase()===e))}else if(e){const t=De(e[1]);r=Gr.find((e=>e.slip44===t))}if(!r)throw t?n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodInvalidParameter,`Invalid coin name: ${t}`):e?n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodInvalidParameter,`Invalid path: ${e[0]}`):n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodInvalidParameter);return r},Wr=(e,t,r)=>{const i=Kr(e,t).name;let n=r;void 0===n&&(n=(e=>Array.isArray(e)&&e[0]===Pe(48))(e));let s=Fe(e);return"SPENDMULTISIG"!==s||n||(s="SPENDADDRESS"),{coinName:i,scriptType:null!=s?s:"SPENDADDRESS"}};function Vr(e){return function(e,t){for(let r=0;r<t.length;r++){const i=t[r];if((null==i?void 0:i.toLowerCase())===(null==e?void 0:e.toLowerCase()))return!0}return!1}("Neurai",e)?{model_mini:{min:"3.7.0"},model_touch:{min:"4.9.0"}}:{}}function $r(e,t,r,i,s){var o;return A(this,void 0,void 0,(function*(){if(t.find((e=>e.address_n.length<3)))throw n.TypedError(n.HardwareErrorCode.ForbiddenKeyPath,"Path length must be greater than 3");if(!tt(e.features,s))throw n.TypedError(n.HardwareErrorCode.DeviceNotSupportMethod);const a=t.find((e=>!((e,t)=>Le(e)&&e[1]===Pe(t))(e.address_n,i)));if(!1===(null==s?void 0:s.ignoreCoinType)&&a)throw n.TypedError(n.HardwareErrorCode.ForbiddenKeyPath);let d=10;const u=Ee(e.features);_e.model_mini.includes(u)?d=10:_e.model_touch.includes(u)&&(d=20);const l={public_keys:[],hd_nodes:[]},c=function(e,t){const r=[];for(let i=0;i<e.length;i+=t)r.push(e.slice(i,i+t));return r}(t,d);for(const t of c){const i=yield e.commands.typedCall("BatchGetPublickeys","EcdsaPublicKeys",{paths:t,ecdsa_curve_name:r,include_node:null!==(o=null==s?void 0:s.includeNode)&&void 0!==o&&o});if("EcdsaPublicKeys"!==i.type)throw n.TypedError(n.HardwareErrorCode.DeviceNotSupportMethod,"BatchGetPublickeys failed");l.root_fingerprint=i.message.root_fingerprint,l.public_keys.push(...i.message.public_keys),l.hd_nodes.push(...i.message.hd_nodes)}if(l.hd_nodes.length!==t.length&&(null==s?void 0:s.includeNode))throw n.TypedError(n.HardwareErrorCode.CallMethodError,"BatchGetPublickeys failed, hd_nodes length not match");if(l.public_keys.length!==t.length&&!(null==s?void 0:s.includeNode))throw n.TypedError(n.HardwareErrorCode.CallMethodError,"BatchGetPublickeys failed, public_keys length not match");return l}))}const Zr={XPUB:76067358,YPUB:77429938,ZPUB:78792518};function Yr(e,t){if("bitcoin"===e.toLowerCase())switch(t){case"SPENDADDRESS":case"SPENDMULTISIG":default:return Zr.XPUB;case"SPENDP2SHWITNESS":return Zr.YPUB;case"SPENDWITNESS":return Zr.ZPUB}else if("litecoin"===e.toLowerCase())switch(t){case"SPENDADDRESS":case"SPENDMULTISIG":return 27108450;case"SPENDP2SHWITNESS":return 28471030;case"SPENDWITNESS":return 78792518;default:return}else if("dogecoin"===e.toLowerCase())return"SPENDADDRESS"===t?49990397:"SPENDMULTISIG"===t?76067358:void 0}function Jr(e,t,r,i,n,s,o){const a=Yr(e,o);if(!a)throw new Error(`Invalid coinName, not support generate xpub for scriptType: ${o}`);const d=Buffer.alloc(78);return d.writeUInt32BE(a,0),d.writeUInt8(t,4),d.writeUInt32BE(r,5),d.writeUInt32BE(i,9),d.write(n,13,"hex"),d.write(s,45,"hex"),function(e){const t=p.sha256(p.sha256(new Uint8Array(e))).slice(0,4),r=Buffer.concat([new Uint8Array(e),new Uint8Array(t)]);let i="",n=BigInt(`0x${r.toString("hex")}`);const s=BigInt(58);for(;n>0;){const e=Number(n%s);n/=s,i="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"[e]+i}for(let e=0;e<r.length&&0===r[e];e++)i=`1${i}`;return i}(d)}function Xr(e,t,r){return Jr(t,e.depth,e.fingerprint,e.child_num,e.chain_code,e.public_key,r)}const Qr=e=>{const{tx_hash:t}=e.txRequest.details;return t?(({typedCall:e,txRequest:{request_type:t,details:r},refTxs:i})=>{const{tx_hash:s}=r;if(!s)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"requestPrevTxInfo: unknown details.tx_hash");const o=i[s.toLowerCase()];if(!o)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,`requestPrevTxInfo: Requested unknown tx: ${s}`);if("TXINPUT"===t){if(!o.bin_outputs)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,`requestPrevTxInfo: Requested unknown TXINPUT: ${s}`);return e("TxAckPrevInput","TxRequest",{tx:{input:o.inputs[r.request_index]}})}if("TXOUTPUT"===t){if(!o.bin_outputs)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,`requestPrevTxInfo: Requested unknown TXOUTPUT: ${s}`);return e("TxAckPrevOutput","TxRequest",{tx:{output:o.bin_outputs[r.request_index]}})}if("TXORIGINPUT"===t){if(!o.outputs)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,`requestPrevTxInfo: Requested unknown TXORIGINPUT: ${s}`);return e("TxAckInput","TxRequest",{tx:{input:o.inputs[r.request_index]}})}if("TXORIGOUTPUT"===t){if(!o.outputs)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,`requestPrevTxInfo: Requested unknown TXORIGOUTPUT: ${s}`);return e("TxAckOutput","TxRequest",{tx:{output:o.outputs[r.request_index]}})}if("TXEXTRADATA"===t){if("number"!=typeof r.extra_data_len)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"requestPrevTxInfo: Missing extra_data_len");if("number"!=typeof r.extra_data_offset)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"requestPrevTxInfo: Missing extra_data_offset");if("string"!=typeof o.extra_data)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,`requestPrevTxInfo: No extra data for transaction ${o.hash}`);const t=o.extra_data,i=r.extra_data_len,s=r.extra_data_offset;return e("TxAckPrevExtraData","TxRequest",{tx:{extra_data_chunk:t.substring(2*s,2*(s+i))}})}if("TXMETA"===t){const t=o.extra_data;return e("TxAckPrevMeta","TxRequest",{tx:{version:o.version,lock_time:o.lock_time,inputs_count:o.inputs.length,outputs_count:o.outputs?o.outputs.length:o.bin_outputs.length,timestamp:o.timestamp,version_group_id:o.version_group_id,expiry:o.expiry,branch_id:o.branch_id,extra_data_len:t?t.length/2:void 0}})}throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,`requestPrevTxInfo: Unknown request type: ${t}`)})(e):(({typedCall:e,txRequest:{request_type:t,details:r},inputs:i,outputs:s})=>{if("TXINPUT"===t)return e("TxAckInput","TxRequest",{tx:{input:i[r.request_index]}});if("TXOUTPUT"===t)return e("TxAckOutput","TxRequest",{tx:{output:s[r.request_index]}});if("TXMETA"===t)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"requestSignedTxInfo: Cannot read TXMETA from signed transaction");if("TXEXTRADATA"===t)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"requestSignedTxInfo: Cannot read TXEXTRADATA from signed transaction");throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,`requestSignedTxInfo: Unknown request type: ${t}`)})(e)},ei=e=>A(void 0,void 0,void 0,(function*(){const{typedCall:t,txRequest:r,refTxs:i,inputs:s,outputs:o,serializedTx:a,signatures:d}=e;if(((e,t,r)=>{if(!r)return;const{signature_index:i,signature:s,serialized_tx:o}=r;if(o&&e.push(o),"number"==typeof i){if(!s)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"saveTxSignatures: Unexpected null in trezor:TxRequestSerialized signature.");t[i]=s}})(a,d,r.serialized),"TXFINISHED"===r.request_type)return Promise.resolve({signatures:d,serializedTx:a.join("")});const{message:u}=yield Qr(e);return ei({typedCall:t,txRequest:u,refTxs:i,inputs:s,outputs:o,serializedTx:a,signatures:d})}));var ti=(e,t,r,i,n,s)=>A(void 0,void 0,void 0,(function*(){const o={};i.forEach((e=>{o[e.hash.toLowerCase()]=e}));const{message:a}=yield e("SignTx","TxRequest",Object.assign(Object.assign({},n),{inputs_count:t.length,outputs_count:r.length,coin_name:s}));return ei({typedCall:e,txRequest:a,refTxs:o,inputs:t,outputs:r,serializedTx:[],signatures:[]})}));const ri=e=>{const{tx_hash:t}=e.txRequest.details;return t?(({txRequest:{request_type:e,details:t},refTxs:r})=>{const{tx_hash:i}=t;if(!i)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"requestPrevTxInfo: unknown details.tx_hash");const s=r[i.toLowerCase()];if(!s)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,`requestPrevTxInfo: Requested unknown tx: ${i}`);if(!s.bin_outputs)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,`requestPrevTxInfo: bin_outputs not set tx: ${i}`);if("TXINPUT"===e)return{inputs:[s.inputs[t.request_index]]};if("TXOUTPUT"===e)return{bin_outputs:[s.bin_outputs[t.request_index]]};if("TXEXTRADATA"===e){if("number"!=typeof t.extra_data_len)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"requestPrevTxInfo: Missing extra_data_len");if("number"!=typeof t.extra_data_offset)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"requestPrevTxInfo: Missing extra_data_offset");if("string"!=typeof s.extra_data)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,`requestPrevTxInfo: No extra data for transaction ${s.hash}`);const e=s.extra_data,r=t.extra_data_len,i=t.extra_data_offset;return{extra_data:e.substring(2*i,2*(i+r))}}if("TXMETA"===e){const e=s.extra_data,t={version:s.version,lock_time:s.lock_time,inputs_cnt:s.inputs.length,outputs_cnt:s.bin_outputs.length,timestamp:s.timestamp,version_group_id:s.version_group_id,expiry:s.expiry,branch_id:s.branch_id};return"string"==typeof e&&0!==e.length?Object.assign(Object.assign({},t),{extra_data_len:e.length/2}):t}throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,`requestPrevTxInfo: Unknown request type: ${e}`)})(e):(({txRequest:{request_type:e,details:t},inputs:r,outputs:i})=>{if("TXINPUT"===e)return{inputs:[r[t.request_index]]};if("TXOUTPUT"===e)return{outputs:[i[t.request_index]]};if("TXMETA"===e)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"requestSignedTxInfo: Cannot read TXMETA from signed transaction");if("TXEXTRADATA"===e)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"requestSignedTxInfo: Cannot read TXEXTRADATA from signed transaction");throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,`requestSignedTxInfo: Unknown request type: ${e}`)})(e)},ii=e=>A(void 0,void 0,void 0,(function*(){const{typedCall:t,txRequest:r,refTxs:i,inputs:s,outputs:o,serializedTx:a,signatures:d}=e;if(((e,t,r)=>{if(!r)return;const{signature_index:i,signature:s,serialized_tx:o}=r;if(o&&e.push(o),"number"==typeof i){if(!s)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"saveTxSignatures: Unexpected null in uKey:TxRequestSerialized signature.");t[i]=s}})(a,d,r.serialized),"TXFINISHED"===r.request_type)return Promise.resolve({signatures:d,serializedTx:a.join("")});const u=ri(e),{message:l}=yield t("TxAck","TxRequest",{tx:u});return ii({typedCall:t,txRequest:l,refTxs:i,inputs:s,outputs:o,serializedTx:a,signatures:d})}));var ni=(e,t,r,i,n,s)=>A(void 0,void 0,void 0,(function*(){const o={};i.forEach((e=>{o[e.hash.toLowerCase()]=e}));const{message:a}=yield e("SignTx","TxRequest",Object.assign(Object.assign({},n),{inputs_count:t.length,outputs_count:r.length,coin_name:s}));return ii({typedCall:e,txRequest:a,refTxs:o,inputs:t,outputs:r,serializedTx:[],signatures:[]})}));const si=(e,t)=>{if(!e)return["",""];return[e.slice(0,t),e.slice(t)]};const oi=({typedCall:e,request:t,data:r,chainId:i,supportTrezor:s})=>A(void 0,void 0,void 0,(function*(){if(!t.data_length){let e=t.signature_v;const r=t.signature_r,s=t.signature_s,o="authorization_signatures"in t?t.authorization_signatures:void 0;if(null==e||null==r||null==s)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"processTxRequest: Unexpected request");i&&e<=1&&(e+=2*i+35);const a={v:`0x${e.toString(16)}`,r:`0x${r}`,s:`0x${s}`};return o&&o.length>0&&(a.authorizationSignatures=o.map((e=>({yParity:e.y_parity,r:e.r,s:e.s})))),Promise.resolve(a)}const[o,a]=si(r,2*t.data_length);let d;return d=s?yield e("EthereumTxAck","EthereumTxRequest",{data_chunk:o}):yield e("EthereumTxAckUKey","EthereumTxRequestUKey",{data_chunk:o}),oi({typedCall:e,request:d.message,data:a,chainId:i,supportTrezor:s})})),ai=({typedCall:e,addressN:t,tx:r,supportTrezor:i})=>A(void 0,void 0,void 0,(function*(){const{to:n,value:s,gasPrice:o,gasLimit:a,nonce:d,data:u,chainId:l,txType:c}=r,p=null==u?0:u.length/2,[h,f]=si(u,2048);let y,g={address_n:t,nonce:or(d),gas_price:or(o),gas_limit:or(a),to:n,value:or(s),chain_id:l};return 0!==p&&(g=Object.assign(Object.assign({},g),{data_length:p,data_initial_chunk:h})),null!==c&&(g=Object.assign(Object.assign({},g),{tx_type:c})),y=i?yield e("EthereumSignTx","EthereumTxRequest",g):yield e("EthereumSignTxUKey","EthereumTxRequestUKey",g),oi({typedCall:e,request:y.message,data:f,chainId:l,supportTrezor:i})})),di=({typedCall:e,addressN:t,tx:r,supportTrezor:i})=>A(void 0,void 0,void 0,(function*(){const{to:n,value:s,gasLimit:o,nonce:a,data:d,chainId:u,maxFeePerGas:l,maxPriorityFeePerGas:c,accessList:p}=r,h=null==d?0:d.length/2,[f,y]=si(d,2048),g={address_n:t,nonce:or(a),max_gas_fee:or(l),max_priority_fee:or(c),gas_limit:or(o),to:n,value:or(s),data_length:h,data_initial_chunk:f,chain_id:u,access_list:(p||[]).map((e=>({address:e.address,storage_keys:e.storageKeys})))};let m;return m=i?yield e("EthereumSignTxEIP1559","EthereumTxRequest",g):yield e("EthereumSignTxEIP1559UKey","EthereumTxRequestUKey",g),oi({typedCall:e,request:m.message,data:y,supportTrezor:i})})),ui=({typedCall:e,addressN:t,tx:r,supportTrezor:i})=>A(void 0,void 0,void 0,(function*(){const{to:s,value:o,gasLimit:a,nonce:d,data:u,chainId:l,maxFeePerGas:c,maxPriorityFeePerGas:p,accessList:h,authorizationList:f}=r,y=null==u?0:u.length/2,[g,m]=si(u,2048),v={address_n:t,nonce:or(d),max_gas_fee:or(c),max_priority_fee:or(p),gas_limit:or(a),to:s,value:or(o),data_length:y,data_initial_chunk:g,chain_id:l,access_list:(h||[]).map((e=>({address:e.address,storage_keys:e.storageKeys}))),authorization_list:f.map((e=>({address_n:e.addressN||[],chain_id:e.chainId,address:sr(e.address),nonce:or(e.nonce),signature:void 0!==e.yParity&&e.r&&e.s?{y_parity:e.yParity,r:e.r,s:e.s}:void 0})))};let b;if(i)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"EIP7702 not supported by Trezor");return b=yield e("EthereumSignTxEIP7702UKey","EthereumTxRequestUKey",v),oi({typedCall:e,request:b.message,data:m,supportTrezor:i})}));const li=(e,t,r)=>{let i=new T.default(e);if(r&&(i=((e,t)=>{if(t<1||t>32)throw n.ERRORS.TypedError("Runtime","Int byte size must be between 1 and 32 (8 and 256 bits)");const r=new T.default(2).exponentiatedBy(8*t-1).negated(),i=r.negated().minus(1),s=new T.default(e);if(s.isGreaterThan(i)||s.isLessThan(r))throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,`Overflow when trying to convert number ${e.toString()} into ${t} bytes`);return s.isPositive()?s:s.minus(r).minus(r)})(i,t)),i.isNegative())throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,`Cannot convert negative number to unsigned interger: ${e.toString()}`);const s=i.toString(16),o=2*t;if(s.length>o)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,`Overflow when trying to convert number ${e.toString()} into ${t} bytes`);return s.padStart(2*t,"0")},ci=new RegExp(/^(.*)\[([0-9]*)\]$/),pi=new RegExp(/^bytes([0-9]*)$/),hi=new RegExp(/^(u?int)([0-9]*)$/),fi=e=>{const t=ci.exec(e);if(null===t)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,`typename ${e} could not be parsed as an EIP-712 array`);const[r,i,s]=t;return{entryTypeName:i,arraySize:parseInt(s,10)||null}},yi=(e,t)=>{if(pi.test(e)||"address"===e)return ar(t);if("string"===e)return Buffer.from(t,"utf-8").toString("hex");const r=hi.exec(e);if(r){const[e,i,n]=r,s=Math.ceil(parseInt(n,10)/8);return li(t,s,"int"===i)}if("bool"===e)return t?"01":"00";throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,`Unsupported data type for direct field encoding: ${e}`)},gi={string:a.EthereumDataType.STRING,bool:a.EthereumDataType.BOOL,address:a.EthereumDataType.ADDRESS},mi=(e,t)=>{const r=ci.exec(e);if(r){const[e,i,n]=r,s=mi(i,t);return{data_type:a.EthereumDataType.ARRAY,size:parseInt(n,10)||void 0,entry_type:s}}const i=hi.exec(e);if(i){const[e,t,r]=i;return{data_type:"uint"===t?a.EthereumDataType.UINT:a.EthereumDataType.INT,size:Math.floor(parseInt(r,10)/8)}}const s=pi.exec(e);if(s){const[e,t]=s;return{data_type:a.EthereumDataType.BYTES,size:parseInt(t,10)||void 0}}const o=gi[e];if(o)return{data_type:o};if(e in t)return{data_type:a.EthereumDataType.STRUCT,size:t[e].length,struct_name:e};throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,`No type definition specified: ${e}`)};const vi=32,bi=0;function _i(e){const t=new Uint8Array(33);return t.set([bi]),t.set(l.hexToBytes(e),1),function(e,t=!1){let r=e.toLowerCase();return!t&&r.startsWith("0x")&&(r=r.slice(2)),`0x${r.padStart(2*vi,"0")}`.toLowerCase()}(l.bytesToHex(g.blake2b(t,{dkLen:32})).slice(0,2*vi))}const wi=e=>{fr(e,[{name:"addressType",type:"number",required:!0},{name:"stakingKeyHash",type:"string"},{name:"paymentScriptHash",type:"string"},{name:"stakingScriptHash",type:"string"}]),e.path&&He(e.path),e.stakingPath&&He(e.stakingPath),e.certificatePointer&&fr(e.certificatePointer,[{name:"blockIndex",type:"number",required:!0},{name:"txIndex",type:"number",required:!0},{name:"certificateIndex",type:"number",required:!0}])},Ti=e=>{let t=[];e.path&&(t=He(e.path,3));let r,i=[];return e.stakingPath&&(i=He(e.stakingPath,3)),e.certificatePointer&&(r={block_index:e.certificatePointer.blockIndex,tx_index:e.certificatePointer.txIndex,certificate_index:e.certificatePointer.certificateIndex}),{address_type:e.addressType,address_n:t,address_n_staking:i,staking_key_hash:e.stakingKeyHash,certificate_pointer:r,script_payment_hash:e.paymentScriptHash,script_staking_hash:e.stakingScriptHash}},Ei=e=>{let t;return e.certificate_pointer&&(t={blockIndex:e.certificate_pointer.block_index,txIndex:e.certificate_pointer.tx_index,certificateIndex:e.certificate_pointer.certificate_index}),{addressType:e.address_type,path:e.address_n,stakingPath:e.address_n_staking,stakingKeyHash:e.staking_key_hash,certificatePointer:t}};const Si=e=>(fr(e,[{name:"prev_hash",type:"string",required:!0},{name:"prev_index",type:"number",required:!0}]),{input:{prev_hash:e.prev_hash,prev_index:e.prev_index},path:e.path?He(e.path,5):void 0}),Ai=e=>(fr(e,[{name:"prev_hash",type:"string",required:!0},{name:"prev_index",type:"number",required:!0}]),{collateralInput:{prev_hash:e.prev_hash,prev_index:e.prev_index},path:e.path?He(e.path,5):void 0}),Ri=e=>(fr(e,[{name:"prev_hash",type:"string",required:!0},{name:"prev_index",type:"number",required:!0}]),{prev_hash:e.prev_hash,prev_index:e.prev_index}),Mi=e=>{e.forEach((e=>{fr(e,[{name:"policyId",type:"string",required:!0},{name:"tokenAmounts",type:"array",required:!0}]),e.tokenAmounts.forEach((e=>{fr(e,[{name:"assetNameBytes",type:"string",required:!0},{name:"amount",type:"uint"},{name:"mintAmount",type:"uint",allowNegative:!0}])}))}))},Ii=e=>(Mi(e),e.map((e=>({policyId:e.policyId,tokens:Oi(e.tokenAmounts)})))),Oi=e=>e.map((e=>({asset_name_bytes:e.assetNameBytes,amount:e.amount,mint_amount:e.mintAmount}))),xi=e=>e.length/2,ki=(e,t,r,i)=>A(void 0,void 0,void 0,(function*(){let n=0;for(;n<t.length;){const s=t.slice(n,n+r);yield e(i,"CardanoTxItemAck",{data:s}),n+=r}})),Ci=e=>{fr(e,[{name:"address",type:"string"},{name:"amount",type:"uint",required:!0},{name:"tokenBundle",type:"array",allowEmpty:!0},{name:"datumHash",type:"string"},{name:"format",type:"number"},{name:"inlineDatum",type:"string"},{name:"referenceScript",type:"string"}]);const t={output:{amount:e.amount,asset_groups_count:0,datum_hash:e.datumHash,format:e.format,inline_datum_size:e.inlineDatum?xi(e.inlineDatum):void 0,reference_script_size:e.referenceScript?xi(e.referenceScript):void 0},inlineDatum:e.inlineDatum,referenceScript:e.referenceScript};return e.addressParameters?(wi(e.addressParameters),t.output.address_parameters=Ti(e.addressParameters)):t.output.address=e.address,e.tokenBundle?(t.tokenBundle=Ii(e.tokenBundle),t.output.asset_groups_count=t.tokenBundle.length):t.output.asset_groups_count=0,t},Pi=(e,t)=>A(void 0,void 0,void 0,(function*(){const{output:r,tokenBundle:i,inlineDatum:n,referenceScript:s}=t;if(yield e("CardanoTxOutput","CardanoTxItemAck",r),i)for(const t of i){yield e("CardanoAssetGroup","CardanoTxItemAck",{policy_id:t.policyId,tokens_count:t.tokens.length});for(const r of t.tokens)yield e("CardanoToken","CardanoTxItemAck",r)}n&&(yield ki(e,n,2048,"CardanoTxInlineDatumChunk")),s&&(yield ki(e,s,2048,"CardanoTxReferenceScriptChunk"))})),Di=e=>{if(fr(e,[{name:"type",type:"number",required:!0}]),e.type===a.Messages.CardanoPoolRelayType.SINGLE_HOST_IP){const t=[{name:"port",type:"number",required:!0}];if(e.ipv4Address&&t.push({name:"ipv4Address",type:"string",required:!1}),e.ipv6Address&&t.push({name:"ipv6Address",type:"string",required:!1}),fr(e,t),!e.ipv4Address&&!e.ipv6Address)throw n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodInvalidParameter,"Either ipv4Address or ipv6Address must be supplied")}else e.type===a.Messages.CardanoPoolRelayType.SINGLE_HOST_NAME?fr(e,[{name:"hostName",type:"string",required:!0},{name:"port",type:"number",required:!0}]):e.type===a.Messages.CardanoPoolRelayType.MULTIPLE_HOST_NAME&&fr(e,[{name:"hostName",type:"string",required:!0}])},Ni=e=>{var t,r;fr(e,[{name:"poolId",type:"string",required:!0},{name:"vrfKeyHash",type:"string",required:!0},{name:"pledge",type:"string",required:!0},{name:"cost",type:"string",required:!0},{name:"margin",type:"object",required:!0},{name:"rewardAccount",type:"string",required:!0},{name:"owners",type:"array",required:!0},{name:"relays",type:"array",required:!0,allowEmpty:!0},{name:"metadata",type:"object"}]),t=e.margin,fr(t,[{name:"numerator",type:"string",required:!0},{name:"denominator",type:"string",required:!0}]),(e=>{if(e.forEach((e=>{if(e.stakingKeyHash&&fr(e,[{name:"stakingKeyHash",type:"string",required:!e.stakingKeyPath}]),e.stakingKeyPath&&He(e.stakingKeyPath,5),!e.stakingKeyHash&&!e.stakingKeyPath)throw n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodInvalidParameter,"Either stakingKeyHash or stakingKeyPath must be supplied")})),1!==e.filter((e=>!!e.stakingKeyPath)).length)throw n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodInvalidParameter,"Exactly one pool owner must be given as a path")})(e.owners),e.relays.forEach(Di),e.metadata&&(r=e.metadata,fr(r,[{name:"url",type:"string",required:!0},{name:"hash",type:"string",required:!0}]))},Bi=e=>{const t=[{name:"type",type:"number",required:!0}];e.type!==a.Messages.CardanoCertificateType.STAKE_POOL_REGISTRATION&&(t.push({name:"scriptHash",type:"string"}),t.push({name:"keyHash",type:"string"})),e.type===a.Messages.CardanoCertificateType.STAKE_DELEGATION&&t.push({name:"pool",type:"string",required:!0}),e.type===a.Messages.CardanoCertificateType.STAKE_POOL_REGISTRATION&&t.push({name:"poolParameters",type:"object",required:!0}),e.type!==a.Messages.CardanoCertificateType.STAKE_REGISTRATION_CONWAY&&e.type!==a.Messages.CardanoCertificateType.STAKE_DEREGISTRATION_CONWAY||t.push({name:"deposit",required:!0}),e.type===a.Messages.CardanoCertificateType.VOTE_DELEGATION&&t.push({name:"dRep",type:"object",required:!0}),fr(e,t);const{poolParameters:r,poolOwners:i,poolRelays:s}=(e=>e?(Ni(e),{poolParameters:{pool_id:e.poolId,vrf_key_hash:e.vrfKeyHash,pledge:e.pledge,cost:e.cost,margin_numerator:e.margin.numerator,margin_denominator:e.margin.denominator,reward_account:e.rewardAccount,metadata:e.metadata,owners_count:e.owners.length,relays_count:e.relays.length},poolOwners:e.owners.map((e=>({staking_key_hash:e.stakingKeyHash,staking_key_path:e.stakingKeyPath?He(e.stakingKeyPath,5):void 0}))),poolRelays:e.relays.map((e=>{return{type:e.type,ipv4_address:e.ipv4Address?(r=e.ipv4Address,Buffer.from(r.split(".").map((e=>parseInt(e,10)))).toString("hex")):void 0,ipv6_address:e.ipv6Address?(t=e.ipv6Address,t.split(":").join("")):void 0,host_name:e.hostName,port:e.port};var t,r}))}):{poolParameters:void 0,poolOwners:[],poolRelays:[]})(e.poolParameters),o=(e=>{if(e){if(fr(e,[{name:"type",type:"number",required:!0},{name:"keyHash",type:"string"},{name:"scriptHash",type:"string"}]),e.type===a.Messages.CardanoDRepType.KEY_HASH&&!e.keyHash)throw n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodInvalidParameter,"key_hash must be supplied for key_hash type");if(e.type===a.Messages.CardanoDRepType.SCRIPT_HASH&&!e.scriptHash)throw n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodInvalidParameter,"script_hash must be supplied for script_hash type");return{type:e.type,key_hash:e.keyHash,script_hash:e.scriptHash}}})(e.dRep);return{certificate:{type:e.type,path:e.path?He(e.path,5):void 0,script_hash:e.scriptHash,key_hash:e.keyHash,pool:e.pool,pool_parameters:r,deposit:e.deposit,drep:o},poolOwners:i,poolRelays:s}},qi=e=>(e.votingPublicKey&&(console.warn("Please use votePublicKey instead of votingPublicKey."),e.votePublicKey=e.votingPublicKey),fr(e,[{name:"votingPublicKey",type:"string",required:!0},{name:"weight",type:"uint",required:!0}]),{vote_public_key:e.votePublicKey,weight:e.weight}),Li=e=>{let t;return fr(e,[{name:"hash",type:"string"}]),e.cVoteRegistrationParameters&&(t=(e=>{var t;e.votingPublicKey&&(console.warn("Please use votePublicKey instead of votingPublicKey."),e.votePublicKey=e.votingPublicKey),e.rewardAddressParameters&&(console.warn("Please use paymentAddressParameters instead of rewardAddressParameters."),e.paymentAddressParameters=e.rewardAddressParameters),fr(e,[{name:"votePublicKey",type:"string"},{name:"stakingPath",required:!0},{name:"nonce",type:"uint",required:!0},{name:"format",type:"number"},{name:"delegations",type:"array",allowEmpty:!0},{name:"votingPurpose",type:"uint"},{name:"paymentAddress",type:"string"}]);const{paymentAddressParameters:r}=e;wi(r);const{delegations:i}=e;if(i&&i.length>32)throw n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodInvalidParameter,"At most 32 delegations are allowed in a governance registration");return{vote_public_key:e.votePublicKey,staking_path:He(e.stakingPath,3),payment_address_parameters:r?Ti(r):void 0,nonce:e.nonce,format:e.format,delegations:null!==(t=null==i?void 0:i.map(qi))&&void 0!==t?t:[],voting_purpose:e.votingPurpose,payment_address:e.paymentAddress}})(e.cVoteRegistrationParameters)),{hash:e.hash,cvote_registration_parameters:t}},ji=e=>{const{cvote_registration_parameters:t}=e;return(null==t?void 0:t.payment_address_parameters)?(t.payment_address_parameters=(e=>{if(e.address_type===a.Messages.CardanoAddressType.REWARD){let{address_n:t,address_n_staking:r}=e;if(t.length>0&&r.length>0)throw n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodInvalidParameter,"Only stakingPath is allowed for CardanoAddressType.REWARD");return t.length>0&&(r=t,t=[]),Object.assign(Object.assign({},e),{address_n:t,address_n_staking:r})}return e})(t.payment_address_parameters),Object.assign(Object.assign({},e),{cvote_registration_parameters:t})):e},Fi=(e,t,r,i,n,s,o)=>{const d=new Map;function u(e){const t=JSON.stringify(e);d.set(t,e)}return o!==a.Messages.CardanoTxSigningMode.MULTISIG_TRANSACTION&&(e.forEach((({path:e})=>{e&&u(e)})),t.forEach((({certificate:e,poolOwners:t})=>{!e.path||e.type!==a.Messages.CardanoCertificateType.STAKE_DELEGATION&&e.type!==a.Messages.CardanoCertificateType.STAKE_DEREGISTRATION||u(e.path),t.forEach((e=>{e.staking_key_path&&u(e.staking_key_path)}))})),r.forEach((({path:e})=>{e&&u(e)}))),o===a.Messages.CardanoTxSigningMode.PLUTUS_TRANSACTION&&i.forEach((({path:e})=>{e&&u(e)})),n.forEach((({key_path:e})=>{e&&u(e)})),s.forEach((e=>{u(e)})),Array.from(d.values())};var Ui;!function(e){e.Polkadot="polkadot",e.Westend="westend",e.Kusama="kusama",e.Astar="astar",e.JoyStream="joystream",e.Manta="manta"}(Ui||(Ui={}));const zi={model_mini:{min:"3.0.0"},model_touch:{min:"4.3.0"}},Hi={[Ui.JoyStream]:{model_mini:{min:"3.6.0"},model_touch:{min:"4.7.0"}},[Ui.Manta]:{model_mini:{min:"3.7.0"},model_touch:{min:"4.9.0"}}};var Gi;function Ki(e){return m.Buffer.isBuffer(e)||e instanceof Uint8Array}function Wi(e,t){const r=e.toString(16).padStart(2*t.size,"0");return m.Buffer.from(r,"hex")}!function(e){e[e.SIGHASH_ALL=1]="SIGHASH_ALL",e[e.SIGHASH_NONE=2]="SIGHASH_NONE",e[e.SIGHASH_SINGLE=3]="SIGHASH_SINGLE",e[e.SIGHASH_FORKID=64]="SIGHASH_FORKID",e[e.SIGHASH_ANYONECANPAY=128]="SIGHASH_ANYONECANPAY"}(Gi||(Gi={}));class Vi{constructor(e){this.bufLen=0,e?this.set(e):this.bufs=[]}set(e){return this.bufs=e.bufs||this.bufs||[],this.bufLen=this.bufs.reduce(((e,t)=>e+t.length),0),this}toBuffer(){return this.concat()}concat(){return m.Buffer.concat(this.bufs,this.bufLen)}write(e){if(!Ki(e))throw new Error("BufferWriter.write: Invalid type");return this.bufs.push(e),this.bufLen+=e.length,this}writeReverse(e){if(!Ki(e))throw new Error("BufferWriter.write: Invalid type");return this.bufs.push(e.reverse()),this.bufLen+=e.length,this}writeVarBytes(e){if(!Ki(e))throw new Error("BufferWriter.write: Invalid type");return this.writeUInt64LE(new T.default(e.length)),this.write(e),this}writeUInt8(e){const t=m.Buffer.alloc(1);return t.writeUInt8(e,0),this.write(t),this}writeUInt16BE(e){const t=m.Buffer.alloc(2);return t.writeUInt16BE(e,0),this.write(t),this}writeUInt16LE(e){const t=m.Buffer.alloc(2);return t.writeUInt16LE(e,0),this.write(t),this}writeUInt32BE(e){const t=m.Buffer.alloc(4);return t.writeUInt32BE(e,0),this.write(t),this}writeInt32LE(e){const t=m.Buffer.alloc(4);return t.writeInt32LE(e,0),this.write(t),this}writeUInt32LE(e){const t=m.Buffer.alloc(4);return t.writeUInt32LE(e,0),this.write(t),this}writeUInt64BEBN(e){const t=Wi(e,{size:8});return this.write(t),this}writeUInt64LE(e){const t=Wi(e,{size:8});return this.writeReverse(t),this}writeVarintNum(e){const t=Vi.varintBufNum(e);return this.write(t),this}writeVarintBN(e){const t=Vi.varintBufBN(e);return this.write(t),this}static varintBufNum(e){let t;return e<253?(t=m.Buffer.alloc(1),t.writeUInt8(e,0)):e<65536?(t=m.Buffer.alloc(3),t.writeUInt8(253,0),t.writeUInt16LE(e,1)):e<4294967296?(t=m.Buffer.alloc(5),t.writeUInt8(254,0),t.writeUInt32LE(e,1)):(t=m.Buffer.alloc(9),t.writeUInt8(255,0),t.writeInt32LE(-1&e,1),t.writeUInt32LE(Math.floor(e/4294967296),5)),t}static varintBufBN(e){let t;const r=e.toNumber();if(r<253)t=m.Buffer.alloc(1),t.writeUInt8(r,0);else if(r<65536)t=m.Buffer.alloc(3),t.writeUInt8(253,0),t.writeUInt16LE(r,1);else if(r<4294967296)t=m.Buffer.alloc(5),t.writeUInt8(254,0),t.writeUInt32LE(r,1);else{const r=new Vi;r.writeUInt8(255),r.writeUInt64LE(e),t=r.concat()}return t}}const $i=Buffer.from("TransactionSigningHash");class Zi{constructor(){this.bw=new Vi,this.blake2b=g.blake2b.create({dkLen:32,key:$i}),this.hash={update:e=>{this.bw.write(e),this.blake2b.update(e)},digest:()=>Buffer.from(this.blake2b.digest())}}writeUInt8(e){const t=new Vi;t.writeUInt8(e),this.hash.update(t.toBuffer())}writeUInt16LE(e){const t=new Vi;t.writeUInt16LE(e),this.hash.update(t.toBuffer())}writeUInt32LE(e){const t=new Vi;t.writeUInt32LE(e),this.hash.update(t.toBuffer())}writeUInt64LE(e){const t=new Vi;t.writeUInt64LE(new T.default(e)),this.hash.update(t.toBuffer())}writeVarBytes(e){this.writeUInt64LE(e.length),this.hash.update(e)}writeHash(e){this.hash.update(e)}finalize(){return this.hash.digest()}toBuffer(){return this.bw.toBuffer()}}function Yi(){return Buffer.alloc(32)}function Ji(){return Buffer.alloc(20)}function Xi(e){return(e&Gi.SIGHASH_ANYONECANPAY)===Gi.SIGHASH_ANYONECANPAY}function Qi(e){return(31&e)===Gi.SIGHASH_SINGLE}function en(e){return(31&e)===Gi.SIGHASH_NONE}function tn(e,t){e.writeHash(Buffer.from(t.prevTxId,"hex")),e.writeUInt32LE(t.outputIndex)}function rn(e,t,r){if(en(r))return Yi();if(Qi(r)){if(t>=e.outputs.length)return Yi();return(new Zi).finalize()}const i=new Zi;return e.outputs.forEach((e=>function(e,t){e.writeUInt64LE(t.satoshis),e.writeUInt16LE(0),e.writeVarBytes(Buffer.from(t.script,"hex"))}(i,e))),i.finalize()}function nn(e,t){var r;const i=new Zi;i.writeUInt16LE(e.version),i.writeHash(function(e,t){if(Xi(t))return Yi();const r=new Zi;return e.inputs.forEach((e=>tn(r,e))),r.finalize()}(e,e.sigHashType)),i.writeHash(function(e,t){if(Qi(t)||Xi(t)||en(t))return Yi();const r=new Zi;return e.inputs.forEach((e=>r.writeUInt64LE(e.sequenceNumber))),r.finalize()}(e,e.sigHashType)),i.writeHash(function(e,t){if(Xi(t))return Yi();const r=new Zi;return e.inputs.forEach((e=>r.writeUInt8(e.sigOpCount))),r.finalize()}(e,e.sigHashType));const n=e.inputs[t];return tn(i,n),i.writeUInt16LE(0),i.writeVarBytes(Buffer.from(n.output.script,"hex")),i.writeUInt64LE(n.output.satoshis),i.writeUInt64LE(n.sequenceNumber),i.writeUInt8(null!==(r=e.sigOpCount)&&void 0!==r?r:1),i.writeHash(rn(e,t,e.sigHashType)),i.writeUInt64LE(e.lockTime),i.writeHash(Ji()),i.writeUInt64LE(0),i.writeHash(Yi()),i.writeUInt8(e.sigHashType),{hash:i.finalize(),raw:i.toBuffer()}}const sn=32,on=0;function an(e){const t=new Uint8Array(33);return t.set([on]),t.set(l.hexToBytes(e),1),function(e,t=!1){let r=e.toLowerCase();return!t&&r.startsWith("0x")&&(r=r.slice(2)),`0x${r.padStart(2*sn,"0")}`.toLowerCase()}(l.bytesToHex(g.blake2b(t,{dkLen:32})).slice(0,2*sn))}function dn(e){if(/^BFC/i.test(e))return e;const t=e.replace(/^0x/,"").padStart(64,"0").toLowerCase(),r=p.sha256((new TextEncoder).encode(t));return`BFC${t}${l.bytesToHex(r).slice(0,4)}`}var un=Object.freeze({__proto__:null,testInitializeDeviceDuration:class extends Xt{init(){this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE,vt.BOOTLOADER],this.useDevicePassphraseState=!1,this.skipForceUpdateCheck=!0}run(){return A(this,void 0,void 0,(function*(){const e=Date.now();yield this.device.commands.typedCall("Initialize","Features");const t=Date.now()-e;return Promise.resolve(t)}))}},searchDevices:class extends Xt{init(){this.useDevice=!1,this.useDevicePassphraseState=!1,this.skipForceUpdateCheck=!0}run(){var e,t,r,i;return A(this,void 0,void 0,(function*(){yield jt.configure();const n=yield null===(e=this.connector)||void 0===e?void 0:e.enumerate(),s=null!==(t=null==n?void 0:n.descriptors)&&void 0!==t?t:[],o=Ye.getSettings("env");if(Ye.isBleConnect(o)){const e=[],t=new Set;for(const n of s){const s=null===(r=n.id)||void 0===r?void 0:r.toLowerCase();t.has(s)||(t.add(s),e.push(Object.assign(Object.assign({},n),{connectId:n.id,deviceType:Se(null!==(i=n.name)&&void 0!==i?i:"")})))}return e}const{deviceList:a}=yield Pt.getDevices(s);return a.map((e=>e.toMessageObject()))}))}},getFeatures:class extends Xt{init(){this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE,vt.BOOTLOADER],this.useDevicePassphraseState=!1,this.skipForceUpdateCheck=!0}run(){var e,t;return(null===(e=this.payload)||void 0===e?void 0:e.detectBootloaderDevice)&&(null===(t=this.device.features)||void 0===t?void 0:t.bootloader_mode)?Promise.reject(n.ERRORS.TypedError(n.HardwareErrorCode.DeviceDetectInBootloaderMode)):Promise.resolve(this.device.features)}},getUkeyFeatures:class extends Xt{init(){this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE,vt.BOOTLOADER],this.useDevicePassphraseState=!1,this.skipForceUpdateCheck=!0}run(){return A(this,void 0,void 0,(function*(){const{message:e}=yield this.device.commands.typedCall("UkeyGetFeatures","UkeyFeatures");return e.ukey_firmware_version&&!b.default.valid(e.ukey_firmware_version)&&(e.ukey_firmware_version=nt(e.ukey_firmware_version)),Promise.resolve(e)}))}},getPassphraseState:class extends Xt{init(){this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.useDevicePassphraseState=!1}run(){return A(this,void 0,void 0,(function*(){if(!this.device.features)return Promise.reject(n.ERRORS.TypedError(n.HardwareErrorCode.DeviceInitializeFailed));const{passphraseState:e}=yield Qe(this.device),{features:t}=this.device;return t&&!0===t.passphrase_protection?Promise.resolve(e):Promise.resolve(void 0)}))}},getLogs:class extends Xt{init(){this.useDevice=!1,this.useDevicePassphraseState=!1,this.skipForceUpdateCheck=!0}serializeLog({level:e,prefix:t,message:r,timestamp:i}){const n=new Date(i).toISOString(),s=r.map((e=>"object"==typeof e?JSON.stringify(e):String(e))).join(" ");return`[${n}] ${e.toUpperCase()} ${t}: ${s}`}run(){return A(this,void 0,void 0,(function*(){const e=ne().map((e=>this.serializeLog(e)));return Promise.resolve(e)}))}},checkFirmwareRelease:class extends Xt{init(){this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE,vt.BOOTLOADER],this.useDevicePassphraseState=!1,this.skipForceUpdateCheck=!0}run(){if(this.device.features){const e=$t(this.device.features);return Promise.resolve(e)}return Promise.resolve(null)}},checkBLEFirmwareRelease:class extends Xt{init(){this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE,vt.BOOTLOADER],this.useDevicePassphraseState=!1,this.skipForceUpdateCheck=!0}run(){if(this.device.features){const e=Zt(this.device.features);return Promise.resolve(e)}return Promise.resolve(null)}},checkBridgeStatus:class extends Xt{init(){this.useDevice=!1,this.useDevicePassphraseState=!1,this.skipForceUpdateCheck=!0}run(){return A(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{_.default.request({url:"http://localhost:21320",method:"POST",withCredentials:!1,timeout:3e3}).then((()=>e(!0))).catch((r=>{"ECONNABORTED"===r.code?t(n.ERRORS.TypedError(n.HardwareErrorCode.BridgeTimeoutError)):e(!1)}))}))}))}},checkBridgeRelease:class extends Xt{init(){this.allowDeviceMode=[...this.allowDeviceMode,vt.BOOTLOADER],this.useDevicePassphraseState=!1,this.skipForceUpdateCheck=!0}run(){return A(this,void 0,void 0,(function*(){if(!this.device.features)return null;const{willUpdateFirmwareVersion:e}=this.payload,{features:t}=this.device;return rr({deviceType:Ee(t),currentFirmwareVersion:Oe(t).join("."),willUpdateFirmwareVersion:e})}))}},checkBootloaderRelease:class extends Xt{init(){this.allowDeviceMode=[...this.allowDeviceMode,vt.BOOTLOADER],this.useDevicePassphraseState=!1,this.skipForceUpdateCheck=!0}run(){return A(this,void 0,void 0,(function*(){if(!this.device.features)return null;const{features:e}=this.device,t=Yt(e,this.payload.willUpdateFirmwareVersion);return Promise.resolve(t)}))}},checkAllFirmwareRelease:class extends Xt{init(){this.allowDeviceMode=[...this.allowDeviceMode,vt.BOOTLOADER],this.useDevicePassphraseState=!1,this.skipForceUpdateCheck=!0}run(){var e,t;return A(this,void 0,void 0,(function*(){const{features:r}=this.device,{checkBridgeRelease:i}=this.payload;if(!r)return Promise.resolve(null);const n=$t(r),s=Oe(r).join("."),o=null===(t=null===(e=n.release)||void 0===e?void 0:e.version)||void 0===t?void 0:t.join("."),a=Ee(r);let d=null;!i||"required"!==n.status&&"outdated"!==n.status||(d=yield rr({deviceType:a,currentFirmwareVersion:s,willUpdateFirmwareVersion:o}));return{firmware:n,bootloader:Yt(r,o),ble:Zt(r),bridge:d?{shouldUpdate:d.shouldUpdate,status:d.shouldUpdate?"outdated":"valid",changelog:d.changelog,release:d.releaseVersion}:void 0}}))}},deviceBackup:class extends Xt{init(){this.useDevicePassphraseState=!1}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("BackupDevice","Success");return Promise.resolve(e.message)}))}},deviceChangePin:class extends Xt{init(){this.useDevicePassphraseState=!1,fr(this.payload,[{name:"remove",type:"boolean"}]),this.params={remove:this.payload.remove}}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("ChangePin","Success",Object.assign({},this.params));return Promise.resolve(e.message)}))}},deviceFlags:class extends Xt{init(){this.useDevicePassphraseState=!1,fr(this.payload,[{name:"flags",type:"number"}]),this.params={flags:this.payload.flags}}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("ApplyFlags","Success",Object.assign({},this.params));return Promise.resolve(e.message)}))}},deviceRebootToBootloader:class extends Xt{init(){this.useDevicePassphraseState=!1,this.skipForceUpdateCheck=!0}getVersionRange(){return{classic:{min:"2.1.11"},mini:{min:"2.1.11"}}}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("RebootToBootloader","Success");return Promise.resolve(e.message)}))}},deviceRebootToBoardloader:class extends Xt{init(){this.useDevicePassphraseState=!1,this.skipForceUpdateCheck=!0}getVersionRange(){return{classic:{min:"2.1.11"},mini:{min:"2.1.11"}}}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("BixinOutMessageSE","Success");return Promise.resolve(e.message)}))}},deviceRecovery:class extends Xt{init(){this.useDevicePassphraseState=!1,fr(this.payload,[{name:"wordCount",type:"number"},{name:"passphraseProtection",type:"boolean"},{name:"pinProtection",type:"boolean"},{name:"language",type:"string"},{name:"label",type:"string"},{name:"enforceWordlist",type:"boolean"},{name:"type",type:"object"},{name:"u2fCounter",type:"number"},{name:"dryRun",type:"boolean"}]),this.params={word_count:this.payload.wordCount,passphrase_protection:this.payload.passphraseProtection,pin_protection:this.payload.pinProtection,language:this.payload.language,label:this.payload.label,enforce_wordlist:this.payload.enforceWordlist,type:this.payload.type,u2f_counter:this.payload.u2fCounter||Math.floor(Date.now()/1e3),dry_run:this.payload.dryRun}}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("RecoveryDevice","Success",Object.assign({},this.params));return Promise.resolve(e.message)}))}},deviceReset:class extends Xt{init(){this.useDevicePassphraseState=!1,fr(this.payload,[{name:"displayRandom",type:"boolean"},{name:"strength",type:"number"},{name:"passphraseProtection",type:"boolean"},{name:"pinProtection",type:"boolean"},{name:"language",type:"string"},{name:"label",type:"string"},{name:"u2fCounter",type:"number"},{name:"skipBackup",type:"boolean"},{name:"noBackup",type:"boolean"},{name:"backupType"}]),this.params={display_random:this.payload.displayRandom,strength:this.payload.strength||256,passphrase_protection:this.payload.passphraseProtection,pin_protection:this.payload.pinProtection,language:this.payload.language,label:this.payload.label,u2f_counter:this.payload.u2fCounter||Math.floor(Date.now()/1e3),skip_backup:this.payload.skipBackup,no_backup:this.payload.noBackup,backup_type:this.payload.backupType}}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("ResetDevice","Success",Object.assign({},this.params));return Promise.resolve(e.message)}))}},deviceSettings:class extends Xt{init(){this.useDevicePassphraseState=!1,fr(this.payload,[{name:"language",type:"string"},{name:"label",type:"string"},{name:"usePassphrase",type:"boolean"},{name:"homescreen",type:"string"},{name:"passphraseSource",type:"number"},{name:"autoLockDelayMs",type:"number"},{name:"displayRotation",type:"number"},{name:"passphraseAlwaysOnDevice",type:"boolean"},{name:"safetyChecks",type:"number"},{name:"experimentalFeatures",type:"boolean"}]),this.params={language:this.payload.language,label:this.payload.label,use_passphrase:this.payload.usePassphrase,homescreen:this.payload.homescreen,_passphrase_source:this.payload.passphraseSource,auto_lock_delay_ms:this.payload.autoLockDelayMs,display_rotation:this.payload.displayRotation,passphrase_always_on_device:this.payload.passphraseAlwaysOnDevice,safety_checks:this.payload.safetyChecks,experimental_features:this.payload.experimentalFeatures}}getVersionRange(){return this.payload.usePassphrase?{model_mini:{min:"2.4.0"}}:{}}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("ApplySettings","Success",Object.assign({},this.params));return Promise.resolve(e.message)}))}},deviceUpdateReboot:class extends Xt{init(){this.useDevicePassphraseState=!1,this.skipForceUpdateCheck=!0}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("DeviceBackToBoot","Success");return Promise.resolve(e.message)}))}},deviceUploadResource:class extends Xt{constructor(){super(...arguments),this.paramsData={data:new Uint8Array,thumbnailData:new Uint8Array},this.processResourceRequest=e=>A(this,void 0,void 0,(function*(){if("Success"===e.type)return e.message;const{offset:t,data_length:r}=e.message,{data:i,thumbnailData:n}=this.paramsData;if(void 0===t)throw new Error("offset is undefined");let s;s="ResourceRequest"===e.type?new Uint8Array(i.slice(t,Math.min(t+r,i.byteLength))):new Uint8Array(n.slice(t,Math.min(t+r,n.byteLength)));const o=c.blake2s(s),a={data_chunk:l.bytesToHex(s),hash:l.bytesToHex(o)},d=yield this.device.commands.typedCall("ResourceAck",["ResourceRequest","ZoomRequest","Success"],a);return this.processResourceRequest(d)}))}getVersionRange(){return{model_touch:{min:"3.2.0"}}}checkUploadNFTSupport(){const e=Ee(this.device.features),t=Oe(this.device.features).join(".");if(!_e.model_touch.includes(e))throw n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodError,"Device Not Support Upload NFT");if(b.default.lt(t,"4.1.0"))throw n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodNeedUpgradeFirmware,"Device firmware version is too low, please update to 4.1.0",{current:t,require:"4.1.0"})}init(){this.useDevicePassphraseState=!1,this.skipForceUpdateCheck=!0,fr(this.payload,[{name:"suffix",type:"string",required:!0},{name:"dataHex",type:"string",required:!0},{name:"thumbnailDataHex",type:"string",required:!0},{name:"resType",type:"number",required:!0},{name:"nftMetaData",type:"string"},{name:"fileNameNoExt",type:"string"}]);const{suffix:e,dataHex:t,thumbnailDataHex:r,resType:i,nftMetaData:n}=this.payload;this.paramsData={data:lr(t),thumbnailData:lr(r)};const s=l.bytesToHex(c.blake2s(this.payload.dataHex)).slice(0,8),a=o.isEmpty(this.payload.fileNameNoExt)?`${0===i?"wp":"nft"}-${s}-${Math.floor(Date.now()/1e3)}`:this.payload.fileNameNoExt;this.params={extension:e,data_length:this.paramsData.data.byteLength,zoom_data_length:this.paramsData.thumbnailData.byteLength,res_type:i,nft_meta_data:n,file_name_no_ext:a}}run(){return A(this,void 0,void 0,(function*(){this.payload.resType===a.Messages.ResourceType.Nft&&this.checkUploadNFTSupport();const e=yield this.device.commands.typedCall("ResourceUpload",["ResourceRequest","ZoomRequest","Success"],this.params);return this.postMessage(_t(vt.CLOSE_UI_WINDOW)),this.processResourceRequest(e)}))}},deviceSupportFeatures:class extends Xt{init(){this.useDevicePassphraseState=!1,this.skipForceUpdateCheck=!0}run(){if(!this.device.features)return Promise.reject(n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"Device not initialized"));const e=Xe(this.device.features),t=rt(this.device.features);return Promise.resolve({inputPinOnSoftware:e,modifyHomescreen:t,device:this.device.toMessageObject()})}},deviceVerify:class extends Xt{init(){this.useDevicePassphraseState=!1,fr(this.payload,[{name:"dataHex",type:"hexString"}]),this.params={data:ar(this.payload.dataHex)}}run(){return A(this,void 0,void 0,(function*(){const e=Ee(this.device.features);let t;if(_e.model_classic.includes(e)){t=(yield this.device.commands.typedCall("BixinVerifyDeviceRequest","BixinVerifyDeviceAck",Object.assign(Object.assign({},this.params),{data:l.bytesToHex(p.sha256(this.params.data))}))).message}else{const e=yield this.device.commands.typedCall("SESignMessage","SEMessageSignature",{message:this.params.data});t={cert:(yield this.device.commands.typedCall("ReadSEPublicCert","SEPublicCert")).message.public_cert,signature:e.message.signature}}return yr(t,["cert","signature"]),t?Promise.resolve(t):Promise.reject(n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"Device not support verify"))}))}},deviceWipe:class extends Xt{init(){this.useDevicePassphraseState=!1}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("WipeDevice","Success");return Promise.resolve(e.message)}))}},deviceFullyUploadResource:class extends Xt{constructor(){super(...arguments),this.checkPromise=null,this.postTipMessage=e=>{this.postMessage(_t(vt.FIRMWARE_TIP,{device:this.device.toMessageObject(),data:{message:e}}))}}init(){this.requireDeviceMode=[],this.useDevicePassphraseState=!1,this.skipForceUpdateCheck=!0}isSupportResourceUpdate(e,t){if("firmware"!==t)return!1;const r=Ee(e),i=r===n.EDeviceType.Touch||r===n.EDeviceType.Pro,s=Oe(e).join(".");return i&&b.default.gte(s,"3.4.0")}run(){return A(this,void 0,void 0,(function*(){const{device:e}=this,{features:t}=e;if(!(null==t?void 0:t.bootloader_mode)&&t&&t){let{binary:r}=this.payload;if(!r){this.postTipMessage("CheckLatestUiResource");const e=Ye.getSysFullResource(t);if(e){this.postTipMessage("DownloadLatestUiResource");const t=yield vr(e);this.postTipMessage("DownloadLatestUiResourceSuccess"),t&&(r=t.binary)}}yield kr(this.device.getCommands().typedCall.bind(this.device.getCommands()),this.postMessage,e,r)}}))}},deviceUpdateBootloader:class extends Xt{constructor(){super(...arguments),this.checkPromise=null,this.postTipMessage=e=>{this.postMessage(_t(vt.FIRMWARE_TIP,{device:this.device.toMessageObject(),data:{message:e}}))}}init(){this.allowDeviceMode=[vt.BOOTLOADER,vt.NOT_INITIALIZE],this.requireDeviceMode=[],this.useDevicePassphraseState=!1,this.skipForceUpdateCheck=!0}updateTouchBootloader(e,t){return A(this,void 0,void 0,(function*(){if(t&&!t.bootloader_mode){let{binary:r}=this.payload;if(!r){this.postTipMessage("CheckLatestUiResource");const e=Ye.getBootloaderResource(t);if(e){this.postTipMessage("DownloadLatestBootloaderResource");const t=yield vr(e);this.postTipMessage("DownloadLatestBootloaderResourceSuccess"),t&&(r=t.binary)}}if(!function(e){const t=new Uint8Array(e.slice(0,Math.min(16384,e.byteLength))),r=w.default.wrap(t,void 0,void 0,!0);r.LE(),r.readByte(),r.readByte(),r.readByte(),r.readByte();const i=r.readUint32();return r.readUint32(),i+r.readUint32()===e.byteLength}(r))throw n.ERRORS.TypedError(n.HardwareErrorCode.CheckDownloadFileError);return yield Cr(this.device.getCommands().typedCall.bind(this.device.getCommands()),this.postMessage,e,r),Promise.resolve(!0)}return Promise.resolve(!0)}))}run(){return A(this,void 0,void 0,(function*(){const{device:e}=this,{features:t}=e,r=Ee(t);return _e.model_touch.includes(r)?this.updateTouchBootloader(e,t):Promise.resolve(!0)}))}},deviceLock:class extends Xt{init(){this.useDevicePassphraseState=!1}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("LockDevice","Success");return Promise.resolve(e.message)}))}},deviceUnlock:class extends Xt{init(){this.useDevicePassphraseState=!1}run(){return A(this,void 0,void 0,(function*(){return this.device.unlockDevice()}))}},deviceCancel:class extends Xt{init(){this.useDevicePassphraseState=!1}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("Cancel","Success");return Promise.resolve(e.message)}))}},setU2FCounter:class extends Xt{init(){this.useDevicePassphraseState=!1,this.params={u2f_counter:this.payload.u2f_counter}}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("SetU2FCounter","Success",this.params);return Promise.resolve(e.message)}))}},getNextU2FCounter:class extends Xt{init(){this.useDevicePassphraseState=!1}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("GetNextU2FCounter","NextU2FCounter");return Promise.resolve(e.message)}))}},firmwareUpdate:class extends Xt{constructor(){super(...arguments),this.checkPromise=null,this.postTipMessage=e=>{this.postMessage(_t(vt.FIRMWARE_TIP,{device:this.device.toMessageObject(),data:{message:e}}))}}init(){this.allowDeviceMode=[vt.BOOTLOADER,vt.NOT_INITIALIZE],this.requireDeviceMode=[],this.useDevicePassphraseState=!1,this.skipForceUpdateCheck=!0;const{payload:e}=this;fr(e,[{name:"version",type:"array"},{name:"binary",type:"buffer"},{name:"updateType",type:"string",required:!0},{name:"rebootOnSuccess",type:"boolean"}]),this.params={updateType:e.updateType},"version"in e&&(this.params=Object.assign(Object.assign({},this.params),{version:e.version})),"binary"in e&&(this.params=Object.assign(Object.assign({},this.params),{binary:e.binary}))}checkDeviceToBootloader(e){this.checkPromise=n.createDeferred();const t=Ye.getSettings("env"),r=e&&Ye.isBleConnect(t);Pr.log("FirmwareUpdate [checkDeviceToBootloader] isBleReconnect: ",r);const i=setInterval((()=>A(this,void 0,void 0,(function*(){var t,n,s,o,a,d,u,l;if(r)try{yield null===(t=this.device.deviceConnector)||void 0===t?void 0:t.acquire(this.device.originalDescriptor.id,null,!0),yield this.device.initialize(),(null===(n=this.device.features)||void 0===n?void 0:n.bootloader_mode)&&(clearInterval(i),null===(s=this.checkPromise)||void 0===s||s.resolve(!0))}catch(e){Pr.log("catch Bluetooth error when device is restarting: ",e)}else{const t=yield null===(o=this.device.deviceConnector)||void 0===o?void 0:o.enumerate(),r=null!==(a=null==t?void 0:t.descriptors)&&void 0!==a?a:[],{deviceList:n}=yield Pt.getDevices(r,e);1===n.length&&(null===(u=null===(d=n[0])||void 0===d?void 0:d.features)||void 0===u?void 0:u.bootloader_mode)&&(this.device.updateFromCache(n[0]),this.device.commands.disposed=!1,clearInterval(i),null===(l=this.checkPromise)||void 0===l||l.resolve(!0))}}))),r?3e3:2e3);setTimeout((()=>{this.checkPromise&&(clearInterval(i),this.checkPromise.reject(new Error))}),3e4)}run(){var e,t;return A(this,void 0,void 0,(function*(){const{device:r,params:i}=this,{features:s,commands:o}=r,a=Ee(s);if(!(null==s?void 0:s.bootloader_mode)&&s){const t=Re(s);if(function(e,t){const r=Ee(e),i=r===n.EDeviceType.Mini,s="firmware"===t&&r===n.EDeviceType.Classic&&"1.8.3"===e.bootloader_version;return i||s}(s,i.updateType))return Promise.reject(n.ERRORS.TypedError(n.HardwareErrorCode.FirmwareUpdateManuallyEnterBoot));try{this.postTipMessage("AutoRebootToBootloader");if("CallMethodError"===(yield o.typedCall("DeviceBackToBoot","Success")).type)throw n.ERRORS.TypedError(n.HardwareErrorCode.FirmwareUpdateAutoEnterBootFailure);this.postTipMessage("GoToBootloaderSuccess"),this.checkDeviceToBootloader(this.payload.connectId),_e.model_classic.includes(a)&&Pt.clearDeviceCache(t),delete Pt.devicesCache[""],yield null===(e=this.checkPromise)||void 0===e?void 0:e.promise,this.checkPromise=null;const r=_e.model_touch.includes(a);yield ft(r?3e3:1500)}catch(e){return e instanceof n.HardwareError?Promise.reject(e):(Pr.log("auto go to bootloader mode failed: ",e),Promise.reject(n.ERRORS.TypedError(n.HardwareErrorCode.FirmwareUpdateAutoEnterBootFailure)))}}let d;try{if(i.binary)d=this.params.binary;else{if(!r.features)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"no features found for this device");this.postTipMessage("DownloadFirmware");d=(yield mr({features:r.features,version:i.version,updateType:i.updateType})).binary,this.postTipMessage("DownloadFirmwareSuccess")}}catch(e){throw n.ERRORS.TypedError(n.HardwareErrorCode.FirmwareUpdateDownloadFailed,null!==(t=e.message)&&void 0!==t?t:e)}yield this.device.acquire();const u=yield Rr(i.updateType,this.device.getCommands().typedCall.bind(this.device.getCommands()),this.postMessage,r,{payload:d,rebootOnSuccess:this.payload.rebootOnSuccess});return this.connectId&&Pt.clearDeviceCache(this.connectId),u}))}},firmwareUpdateV2:class extends Xt{constructor(){super(...arguments),this.checkPromise=null,this.postTipMessage=e=>{this.postMessage(_t(vt.FIRMWARE_TIP,{device:this.device.toMessageObject(),data:{message:e}}))}}init(){this.allowDeviceMode=[vt.BOOTLOADER,vt.NOT_INITIALIZE],this.requireDeviceMode=[],this.useDevicePassphraseState=!1,this.skipForceUpdateCheck=!0;const{payload:e}=this;if(fr(e,[{name:"version",type:"array"},{name:"binary",type:"buffer"},{name:"forcedUpdateRes",type:"boolean"},{name:"platform",type:"string",required:!0}]),!e.updateType)throw n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodInvalidParameter,"updateType is required");this.params={updateType:e.updateType,forcedUpdateRes:e.forcedUpdateRes,isUpdateBootloader:e.isUpdateBootloader},"version"in e&&(this.params=Object.assign(Object.assign({},this.params),{version:e.version})),"binary"in e&&(this.params=Object.assign(Object.assign({},this.params),{binary:e.binary}))}_promptDeviceInBootloaderForWebDevice({device:e}){return A(this,void 0,void 0,(function*(){return new Promise(((e,t)=>{this.device.listenerCount(Rt.SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE)>0&&this.device.emit(Rt.SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE,this.device,((r,i)=>{r?t(r):e(i)}))}))}))}checkDeviceToBootloader(e){var r,i;this.checkPromise=n.createDeferred();const s=Ye.getSettings("env"),o=e&&Ye.isBleConnect(s);Dr.log("FirmwareUpdateV2 [checkDeviceToBootloader] isBleReconnect: ",o);let a,d=!0,u=0;const l=Ee(null===(r=null==this?void 0:this.device)||void 0===r?void 0:r.features)===n.EDeviceType.Touch||Ee(null===(i=null==this?void 0:this.device)||void 0===i?void 0:i.features)===n.EDeviceType.Pro,c=setInterval((()=>A(this,void 0,void 0,(function*(){var r,i,n,s;if(u+=1,Dr.log("FirmwareUpdateV2 [checkDeviceToBootloader] isFirstCheck: ",d),l&&d&&(d=!1,Dr.log("FirmwareUpdateV2 [checkDeviceToBootloader] wait 3000ms"),yield ft(3e3)),u>4&&Ye.isWebUsbConnect(Ye.getSettings("env"))){clearInterval(c),clearTimeout(a);try{this.postTipMessage(t.nn.SelectDeviceInBootloaderForWebDevice);(yield this._promptDeviceInBootloaderForWebDevice({device:this.device}))&&(yield this._checkDeviceInBootloaderMode(e,c,a))}catch(e){Dr.log("FirmwareUpdateV2 [checkDeviceToBootloader] promptDeviceInBootloaderForWebDevice failed: ",e),null===(r=this.checkPromise)||void 0===r||r.reject(e)}}else if(o)try{yield null===(i=this.device.deviceConnector)||void 0===i?void 0:i.acquire(this.device.originalDescriptor.id,null,!0),yield this.device.initialize(),(null===(n=this.device.features)||void 0===n?void 0:n.bootloader_mode)&&(clearInterval(c),null===(s=this.checkPromise)||void 0===s||s.resolve(!0))}catch(e){Dr.log("catch Bluetooth error when device is restarting: ",e)}else yield this._checkDeviceInBootloaderMode(e,c,a)}))),o?3e3:2e3);a=setTimeout((()=>{this.checkPromise&&(clearInterval(c),this.checkPromise.reject(new Error))}),3e4)}_checkDeviceInBootloaderMode(e,t,r){var i,n,s,o,a;return A(this,void 0,void 0,(function*(){const d=yield null===(i=this.device.deviceConnector)||void 0===i?void 0:i.enumerate(),u=null!==(n=null==d?void 0:d.descriptors)&&void 0!==n?n:[],{deviceList:l}=yield Pt.getDevices(u,e);return!(1!==l.length||!(null===(o=null===(s=l[0])||void 0===s?void 0:s.features)||void 0===o?void 0:o.bootloader_mode))&&(this.device.updateFromCache(l[0]),this.device.commands.disposed=!1,t&&clearInterval(t),r&&clearTimeout(r),null===(a=this.checkPromise)||void 0===a||a.resolve(!0),!0)}))}isEnteredManuallyBoot(e){const t=Ee(e),r=t===n.EDeviceType.Mini,i="firmware"===this.params.updateType&&t===n.EDeviceType.Classic&&"1.8.3"===e.bootloader_version;return r||i}isSupportResourceUpdate(e,t){if("firmware"!==t)return!1;const r=Ee(e),i=r===n.EDeviceType.Touch||r===n.EDeviceType.Pro,s=Oe(e).join(".");return i&&b.default.gte(s,"3.2.0")}checkVersionForCopyTouchResource(e){var t;if(!e)return;const r=Ee(e),i=Oe(e).join("."),s=null===(t=this.params.version)||void 0===t?void 0:t.join("."),{updateType:o}=this.params,a=br({features:e,updateType:o});if(!a)return;const{fullResourceRange:d}=a;if(!d)return;const[u,l]=d;if(r===n.EDeviceType.Touch&&"firmware"===o&&s&&b.default.lt(i,u)&&b.default.gte(s,l)&&"desktop"!==this.payload.platform)throw n.ERRORS.TypedError(n.HardwareErrorCode.UseDesktopToUpdateFirmware)}run(){var e,t,r,i,s,o,a,d;return A(this,void 0,void 0,(function*(){const{device:u,params:l}=this,{features:c,commands:p}=u,h=Ee(c);if(this.checkVersionForCopyTouchResource(c),!(null==c?void 0:c.bootloader_mode)&&c){const o=Re(c);if(this.isEnteredManuallyBoot(c))return Promise.reject(n.ERRORS.TypedError(n.HardwareErrorCode.FirmwareUpdateManuallyEnterBoot));if(c&&this.isSupportResourceUpdate(c,l.updateType)){this.postTipMessage("CheckLatestUiResource");const e=Ye.getSysResourcesLatestRelease(c,l.forcedUpdateRes);if(e){this.postTipMessage("DownloadLatestUiResource");const t=yield vr(e);this.postTipMessage("DownloadLatestUiResourceSuccess"),t&&(yield kr(this.device.getCommands().typedCall.bind(this.device.getCommands()),this.postMessage,u,t.binary))}}null===(t=null===(e=this.device)||void 0===e?void 0:e.commands)||void 0===t||t.checkDisposed();try{this.postTipMessage("AutoRebootToBootloader");if("CallMethodError"===(yield p.typedCall("DeviceBackToBoot","Success")).type)throw n.ERRORS.TypedError(n.HardwareErrorCode.FirmwareUpdateAutoEnterBootFailure);this.postTipMessage("GoToBootloaderSuccess"),this.checkDeviceToBootloader(this.payload.connectId),_e.model_classic.includes(h)&&Pt.clearDeviceCache(o),delete Pt.devicesCache[""],yield null===(r=this.checkPromise)||void 0===r?void 0:r.promise,this.checkPromise=null,null===(s=null===(i=this.device)||void 0===i?void 0:i.commands)||void 0===s||s.checkDisposed();const e=_e.model_touch.includes(h);yield ft(e?3e3:1500)}catch(e){return e instanceof n.HardwareError?Promise.reject(e):(console.log("auto go to bootloader mode failed: ",e),Promise.reject(n.ERRORS.TypedError(n.HardwareErrorCode.FirmwareUpdateAutoEnterBootFailure)))}}let f;try{if(l.binary)f=this.params.binary;else{if(!u.features)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"no features found for this device");this.postTipMessage("DownloadFirmware");f=(yield mr({features:u.features,version:l.version,updateType:l.updateType,isUpdateBootloader:l.isUpdateBootloader})).binary,this.postTipMessage("DownloadFirmwareSuccess")}}catch(e){throw n.ERRORS.TypedError(n.HardwareErrorCode.FirmwareUpdateDownloadFailed,null!==(o=e.message)&&void 0!==o?o:e)}null===(d=null===(a=this.device)||void 0===a?void 0:a.commands)||void 0===d||d.checkDisposed(),yield this.device.acquire();const y=yield Rr(l.updateType,this.device.getCommands().typedCall.bind(this.device.getCommands()),this.postMessage,u,{payload:f,rebootOnSuccess:!0});return this.connectId&&Pt.clearDeviceCache(this.connectId),y}))}},firmwareUpdateV3:class extends qr{constructor(){super(...arguments),this.checkPromise=null}init(){this.allowDeviceMode=[vt.BOOTLOADER,vt.NOT_INITIALIZE],this.requireDeviceMode=[],this.useDevicePassphraseState=!1,this.skipForceUpdateCheck=!0;const{payload:e}=this;fr(e,[{name:"bleVersion",type:"array"},{name:"bleBinary",type:"buffer"},{name:"firmwareVersion",type:"array"},{name:"firmwareBinary",type:"buffer"},{name:"resourceBinary",type:"buffer"},{name:"forcedUpdateRes",type:"boolean"},{name:"bootloaderVersion",type:"array"},{name:"bootloaderBinary",type:"buffer"},{name:"platform",type:"string"}]),this.params={bleBinary:e.bleBinary,firmwareBinary:e.firmwareBinary,forcedUpdateRes:e.forcedUpdateRes,bleVersion:e.bleVersion,bootloaderVersion:e.bootloaderVersion,bootloaderBinary:e.bootloaderBinary,firmwareVersion:e.firmwareVersion,resourceBinary:e.resourceBinary,platform:e.platform}}run(){var e;return A(this,void 0,void 0,(function*(){const{device:r}=this,{features:i}=r,s=Ee(i),o=ke(i).join(".");if(this.validateDeviceAndVersion(s,o),!i)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"Device features not available");let a=null,d=[],u=null;try{this.postTipMessage(t.nn.StartDownloadFirmware),a=yield this.prepareResourceBinary(),d=yield this.prepareFirmwareAndBleBinary(),u=yield this.prepareBootloaderBinary(),this.postTipMessage(t.nn.FinishDownloadFirmware)}catch(t){throw n.ERRORS.TypedError(n.HardwareErrorCode.FirmwareUpdateDownloadFailed,null!==(e=t.message)&&void 0!==e?e:t)}if(!u&&0===d.length)throw n.ERRORS.TypedError(n.HardwareErrorCode.FirmwareUpdateDownloadFailed,"No firmware to update");yield this.enterBootloaderMode();return yield this.executeUpdate({resourceBinary:a,fwBinaryMap:d,bootloaderBinary:u})}))}validateDeviceAndVersion(e,t){if(e===n.EDeviceType.Unknown)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"unknown device type");if(e!==n.EDeviceType.Pro)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"only pro device is supported");if(b.default.lt(t,"2.8.0"))throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"bootloader version needs to be updated")}prepareResourceBinary(){return A(this,void 0,void 0,(function*(){if(this.params.resourceBinary)return this.params.resourceBinary;const{features:e}=this.device;if(!e)return null;const t=Ye.getSysResourcesLatestRelease(e,this.params.forcedUpdateRes);if(t){return(yield vr(t)).binary}return Lr.warn("No resource url found"),null}))}prepareBootloaderBinary(){return A(this,void 0,void 0,(function*(){if(this.params.bootloaderBinary)return this.params.bootloaderBinary;const{features:e}=this.device;if(!e)return null;if(this.params.bootloaderVersion){const t=Ye.getBootloaderResource(e);if(t){return(yield vr(t)).binary}}return null}))}prepareFirmwareAndBleBinary(){return A(this,void 0,void 0,(function*(){const e=[];if(this.params.firmwareBinary)e.push({fileName:"firmware.bin",binary:this.params.firmwareBinary});else if(this.params.firmwareVersion){const{features:t}=this.device;if(t){const r=(yield mr({features:t,version:this.params.firmwareVersion,updateType:"firmware",isUpdateBootloader:!1})).binary;e.push({fileName:"firmware.bin",binary:r})}}if(this.params.bleBinary)e.push({fileName:"ble-firmware.bin",binary:this.params.bleBinary});else if(this.params.bleVersion){const{features:t}=this.device;if(t){const r=yield mr({features:t,version:this.params.bleVersion,updateType:"ble"});e.push({fileName:"ble-firmware.bin",binary:r.binary})}}return e}))}executeUpdate({resourceBinary:e,fwBinaryMap:r,bootloaderBinary:i}){var s;return A(this,void 0,void 0,(function*(){let o=0,a=0;e&&(o+=e.byteLength);for(const e of r)o+=e.binary.byteLength;if(i&&(o+=i.byteLength),this.postTipMessage(t.nn.StartTransferData),e){const t=yield E.default.loadAsync(e),r=Object.entries(t.files);for(const[e,t]of r){const r=e.split("/").pop();if(!t.dir&&-1===e.indexOf("__MACOSX")&&r){const e=yield t.async("arraybuffer");a=yield this.emmcCommonUpdateProcess({payload:e,filePath:`0:res/${r}`,processedSize:a,totalSize:o})}}}i&&(a=yield this.emmcCommonUpdateProcess({payload:i,filePath:"0:boot/bootloader.bin",processedSize:a,totalSize:o})),yield this.createUpdatesFolderIfNotExists("0:updates/");for(const e of r)e&&(a=yield this.emmcCommonUpdateProcess({payload:e.binary,filePath:`0:updates/${e.fileName}`,processedSize:a,totalSize:o}));try{this.postTipMessage(t.nn.ConfirmOnDevice),yield this.startEmmcFirmwareUpdate({path:"0:updates"})}catch(e){if(Lr.error("triggerFirmwareUpdateEmmc error: ",e),null==e?void 0:e.errorCode){if([n.HardwareErrorCode.ActionCancelled,n.HardwareErrorCode.FirmwareVerificationFailed,n.HardwareErrorCode.BleDeviceNotBonded,n.HardwareErrorCode.BleServiceNotFound,n.HardwareErrorCode.BlePoweredOff,n.HardwareErrorCode.BleUnsupported,n.HardwareErrorCode.BlePermissionError,n.HardwareErrorCode.BleLocationError,n.HardwareErrorCode.BleDeviceBondError,n.HardwareErrorCode.BleCharacteristicNotifyError,n.HardwareErrorCode.BleTimeoutError,n.HardwareErrorCode.BleWriteCharacteristicError,n.HardwareErrorCode.WebDeviceNotFoundOrNeedsPermission].includes(e.errorCode))throw e}throw n.ERRORS.TypedError(n.HardwareErrorCode.FirmwareError,(null==e?void 0:e.message)||"Firmware update failed")}yield n.wait(1500),this.postProcessingMessage("firmware"),this.postProgressMessage(0,"installingFirmware");const d=Date.now();for(;;){if(Date.now()-d>3e5)throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"Firmware update process timeout after 5 minutes");try{const e=this.device.getCommands().typedCall.bind(this.device.getCommands()),r=(yield Promise.race([e("GetFeatures","Features",{}),new Promise(((e,t)=>{setTimeout((()=>t(new Error("GetFeatures timeout after 3 seconds"))),3e3)}))])).message,i=ke(r).join("."),n=xe(r).join("."),s=Oe(r).join(".");return this.postTipMessage(t.nn.FirmwareUpdateCompleted),Pt.resetState(),{bootloaderVersion:i,bleVersion:n,firmwareVersion:s}}catch(e){if(e.message&&e.message.includes("Update mode")){const t=e.message.split("Update mode "),r=null!==(s=t[1])&&void 0!==s?s:"0",i=parseInt(r,10)||0;this.postProgressMessage(i,"installingFirmware"),yield n.wait(1e3)}else{yield n.wait(1e3);const e=this.isBleReconnect()&&(this.params.bleBinary||this.params.bleVersion)?18e4:6e4;yield this.waitForDeviceReconnect(e)}}}}))}waitForDeviceReconnect(e){var t,r,i,s;return A(this,void 0,void 0,(function*(){const o=Date.now(),a=this.isBleReconnect();for(;Date.now()-o<e;)try{if(a)try{yield null===(t=this.device.deviceConnector)||void 0===t?void 0:t.acquire(this.device.originalDescriptor.id,null,!0);const e=this.device.getCommands().typedCall.bind(this.device.getCommands());return void(yield Promise.race([e("Initialize","Features",{}),new Promise(((e,t)=>{setTimeout((()=>{t(n.ERRORS.TypedError(n.HardwareErrorCode.DeviceInitializeFailed))}),3e3)}))]))}catch(e){Lr.log("catch Bluetooth error when device is restarting: ",e)}else{const e=yield null===(r=this.device.deviceConnector)||void 0===r?void 0:r.enumerate(),t=null!==(i=null==e?void 0:e.descriptors)&&void 0!==i?i:[],{deviceList:n}=yield Pt.getDevices(t,this.connectId);if(1===n.length)return this.device.updateFromCache(n[0]),yield this.device.acquire(),this.device.commands.disposed=!1,void(this.device.getCommands().mainId=null!==(s=this.device.mainId)&&void 0!==s?s:"")}yield n.wait(1e3)}catch(e){console.error("Device reconnect failed: ",e),Lr.error("Device reconnect failed:",e),yield n.wait(1e3)}throw n.ERRORS.TypedError(n.HardwareErrorCode.DeviceNotFound,`Device not reconnected within ${e/1e3}s`)}))}},promptWebDeviceAccess:class extends Xt{init(){this.useDevice=!1,this.useDevicePassphraseState=!1,this.skipForceUpdateCheck=!0}run(){var e,t;return A(this,void 0,void 0,(function*(){const{deviceSerialNumberFromUI:r}=this.payload;yield jt.configure();const i="webusb"===Ye.getSettings("env");if(!i)return Promise.reject(n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"Not webusb environment"));try{let s,o;if(r)o=[{path:r,device:{serialNumber:r},debug:!0}];else{if(s=yield null===(e=this.connector)||void 0===e?void 0:e.promptDeviceAccess(),!s)return yield Promise.reject(n.ERRORS.TypedError(n.HardwareErrorCode.WebDevicePromptAccessError));i&&(o=[{path:null!==(t=s.serialNumber)&&void 0!==t?t:"",device:s,debug:!0}])}const{deviceList:a}=yield Pt.getDevices(o);return a.length>0?{device:a[0].toMessageObject()}:{device:null}}catch(e){return jr.debug(e),Promise.reject(n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"Please select the device to connect"))}}))}},emmcFileWrite:class extends qr{init(){const{payload:e}=this;fr(e,[{name:"payload",type:"buffer",required:!0},{name:"filePath",type:"string",required:!0}]),this.allowDeviceMode=[vt.BOOTLOADER,vt.NOT_INITIALIZE],this.useDevicePassphraseState=!1,this.params={payload:e.payload,filePath:e.filePath}}run(){return A(this,void 0,void 0,(function*(){const{payload:e,filePath:t}=this.params;yield this.enterBootloaderMode(),yield this.emmcCommonUpdateProcess({payload:e,filePath:t});try{yield this.reboot(a.RebootType.Normal)}catch(e){}return{filePath:t}}))}},cipherKeyValue:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};fr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{const t=He(e.path);fr(e,[{name:"path",required:!0},{name:"key",type:"string"},{name:"value",type:"hexString"},{name:"encrypt",type:"boolean"},{name:"askOnEncrypt",type:"boolean"},{name:"askOnDecrypt",type:"boolean"},{name:"iv",type:"hexString"}]),this.params.push({address_n:t,key:e.key,value:ar(e.value),encrypt:e.encrypt,ask_on_encrypt:e.askOnEncrypt,ask_on_decrypt:e.askOnDecrypt,iv:ar(e.iv)})}))}run(){return A(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("CipherKeyValue","CipheredKeyValue",Object.assign({},r));e.push(Object.assign({path:ze(r.address_n)},i.message))}return Promise.resolve(this.hasBundle?e:e[0])}))}},allNetworkGetAddress:class extends Hr{getAllNetworkAddress(e){var t,r,i,s;return A(this,void 0,void 0,(function*(){const o=[],a={},{bundle:d}=this.payload,u=d.map(((e,t)=>this.generateMethodName({network:e.network,payload:e,originalIndex:t}))).reduce(((e,t)=>(e[t.methodName]||(e[t.methodName]=[]),e[t.methodName].push(t),e)),{});let l=0;for(const[o,d]of Object.entries(u)){const u={bundle:d.map((e=>Object.assign({},e.params)))};if(null===(t=this.abortController)||void 0===t?void 0:t.signal.aborted)throw new Error(n.HardwareErrorCodeMessage[n.HardwareErrorCode.RepeatUnlocking]);const c=yield this.callMethod(o,u,e);if(null===(r=this.abortController)||void 0===r?void 0:r.signal.aborted)throw new Error(n.HardwareErrorCodeMessage[n.HardwareErrorCode.RepeatUnlocking]);for(let e=0;e<d.length;e++){const{_originRequestParams:t,_originalIndex:r}=d[e];a[`${r}`]=Object.assign(Object.assign({},t),c[e])}if((null===(s=null===(i=this.payload)||void 0===i?void 0:i.bundle)||void 0===s?void 0:s.length)>1){const e=Math.round((l+1)/this.payload.bundle.length*100);this.postMessage(_t(vt.DEVICE_PROGRESS,{progress:e}))}l++}for(let e=0;e<d.length;e++)o.push(a[e]);return this.abortController=null,Promise.resolve(o)}))}},allNetworkGetAddressByLoop:class extends Hr{getAllNetworkAddress(e){return A(this,void 0,void 0,(function*(){const{callbackId:t,callbackIdFinish:r}=this.payload;if(!t)throw new Error("callbackId is required");if(!r)throw new Error("callbackIdFinish is required");const i=this.payload.bundle||[this.payload],s=this.processCallbacksInBackground(i,e,t,r);return this.device.pendingCallbackPromise=n.createDeferred(s),this.context&&this.payload.connectId&&this.context.registerCallbackTask(this.payload.connectId,this.device.pendingCallbackPromise),Promise.resolve([])}))}processCallbacksInBackground(e,t,r,i){var s,o,a;return A(this,void 0,void 0,(function*(){try{const a=[];for(let i=0;i<e.length;i++){const d=e[i];if(null===(s=this.abortController)||void 0===s?void 0:s.signal.aborted)throw new Error(n.HardwareErrorCodeMessage[n.HardwareErrorCode.RepeatUnlocking]);const u=this.generateMethodName({network:d.network,payload:d,originalIndex:i}),l={bundle:[u.params]},c=yield this.callMethod(u.methodName,l,t);if(null===(o=this.abortController)||void 0===o?void 0:o.signal.aborted)throw new Error(n.HardwareErrorCodeMessage[n.HardwareErrorCode.RepeatUnlocking]);const p=Object.assign(Object.assign({},d),c[0]);a.push(p),this.sendItemCallback(r,p,i)}this.sendFinishCallback({callbackId:i,data:a})}catch(e){let t=e.errorCode||e.code,r=e.message;if(e instanceof n.HardwareError)t=e.errorCode,r=e.message;else if(e.message===n.HardwareErrorCodeMessage[n.HardwareErrorCode.RepeatUnlocking])t=n.HardwareErrorCode.RepeatUnlocking,r=e.message;else{const i=n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,e.message);t=i.errorCode,r=i.message}this.sendFinishCallback({callbackId:i,error:{success:!1,payload:{error:r,code:t}}})}finally{null===(a=this.context)||void 0===a||a.cancelCallbackTasks(this.payload.connectId),this.abortController=null}}))}sendFinishCallback({callbackId:e,data:t,error:r}){this.postMessage({event:wt.CALLBACK,type:wt.CALLBACK,payload:{callbackId:e,data:t,error:r}})}sendItemCallback(e,t,r){this.postMessage({event:wt.CALLBACK,type:wt.CALLBACK,payload:{callbackId:e,data:Object.assign(Object.assign({},t),{index:r})}})}},btcGetAddress:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=Object.prototype.hasOwnProperty.call(this.payload,"bundle");const e=this.hasBundle?this.payload:{bundle:[this.payload]};fr(e,[{name:"bundle",type:"array"}]),this.params=[],e.bundle.forEach((e=>{var t;const r=He(e.path,1);fr(e,[{name:"path",required:!0},{name:"coin",type:"string"},{name:"showOnOneKey",type:"boolean"},{name:"multisig",type:"object"},{name:"scriptType",type:"string"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t,{multisig:n,coin:s}=e;let{scriptType:o}=e;o||(o=Fe(r),"SPENDMULTISIG"!==o||n||(o="SPENDADDRESS"));const a=Kr(r,s).name;this.params.push({address_n:r,show_display:i,coin_name:a,multisig:n,script_type:o||"SPENDADDRESS"})}))}getVersionRange(){return Vr(this.params.map((e=>e.coin_name)))}run(){return A(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("GetAddress","Address",Object.assign({},r)),n=ze(r.address_n);e.push(Object.assign({path:n},i.message)),this.postPreviousAddressMessage({address:i.message.address,path:n})}return yr(e,["address"],{expectedLength:this.params.length}),Promise.resolve(this.hasBundle?e:e[0])}))}},btcGetPublicKey:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=Object.prototype.hasOwnProperty.call(this.payload,"bundle");const e=this.hasBundle?this.payload:{bundle:[this.payload]};fr(e,[{name:"bundle",type:"array"}]),this.params=[],e.bundle.forEach((e=>{var t;const r=He(e.path,1);fr(e,[{name:"path",required:!0},{name:"coin",type:"string"},{name:"showOnOneKey",type:"boolean"},{name:"scriptType",type:"string"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t,{multisig:n,coin:s}=e;let{scriptType:o}=e;o||(o=Fe(r),"SPENDMULTISIG"!==o||n||(o="SPENDADDRESS"));const a=Kr(r,s).name;this.params.push({address_n:r,show_display:i,coin_name:a,script_type:o||"SPENDADDRESS"})}))}isBtcNetwork(e){return"Testnet"===e.coin_name||"Bitcoin"===e.coin_name}getVersionRange(){return Vr(this.params.map((e=>e.coin_name)))}run(){return A(this,void 0,void 0,(function*(){let e=[];try{if(this.params.some((e=>e.show_display))||!this.hasBundle)throw new Error("Goto getPublickey");for(const e of this.params){if(!Yr(e.coin_name,e.script_type))throw new Error(`Invalid coinName, not support generate xpub for scriptType: ${e.script_type}`)}const t=yield $r(this.device,this.params,"secp256k1",0,{includeNode:!0,ignoreCoinType:!0});if(!(null==t?void 0:t.hd_nodes)||this.params.length!==t.hd_nodes.length)throw new Error("Invalid response from Publickeys");for(let r=0;r<this.params.length;r++){const i=this.params[r],n=t.hd_nodes[r],s=ze(i.address_n),o=Xr(n,i.coin_name,i.script_type),a=t.root_fingerprint;let d=o;if(this.isBtcNetwork(i)&&je(i.address_n)){const e=Number(a||0).toString(16).padStart(8,"0");d=`tr([${`${e}${s.substring(1)}`}]${o}/<0;1>/*)`}e.push({path:s,node:n,xpub:o,root_fingerprint:a,xpubSegwit:d})}}catch(t){if(t instanceof n.HardwareError){const{errorCode:e}=t;if(e===n.HardwareErrorCode.PinCancelled||e===n.HardwareErrorCode.ActionCancelled||e===n.HardwareErrorCode.ResponseUnexpectTypeError||e===n.HardwareErrorCode.PinInvalid)throw t}e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("GetPublicKey","PublicKey",Object.assign({},r)),n=Object.assign(Object.assign({path:ze(r.address_n)},i.message),{xpubSegwit:i.message.xpub});if(this.isBtcNetwork(r)&&je(r.address_n)){const e=`${Number(n.root_fingerprint||0).toString(16).padStart(8,"0")}${n.path.substring(1)}`;n.xpubSegwit=`tr([${e}]${n.xpub}/<0;1>/*)`}e.push(n)}}return yr(e,["xpub"],{expectedLength:this.params.length}),Promise.resolve(this.hasBundle?e:e[0])}))}},btcSignMessage:class extends Xt{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"path",required:!0},{name:"messageHex",type:"hexString",required:!0},{name:"coin",type:"string"},{name:"noScriptType",type:"boolean"},{name:"dAppSignType",type:"string"}]);const{path:e,messageHex:t,coin:r,noScriptType:i,dAppSignType:n}=this.payload;let s=i,o=!1;const a=He(e),{coinName:d,scriptType:u}=Wr(a,r,!1);let l=u;"ecdsa"===n||"bip322-simple"===n?"ecdsa"===n?s=!0:(o=!0,s=!1):l=u,this.params={address_n:a,message:ar(t),coin_name:d,script_type:l,no_script_type:s,is_bip322_simple:o}}getVersionRange(){return this.payload.dAppSignType?{pro:{min:"4.9.3"}}:Vr([this.params.coin_name])}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("SignMessage","MessageSignature",Object.assign({},this.params));return Promise.resolve(e.message)}))}},btcSignPsbt:class extends Xt{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"psbt",type:"hexString",required:!0},{name:"coin",type:"string"}]);const{psbt:e,coin:t}=this.payload,r=Kr(void 0,t);this.params={psbt:ar(e),coin_name:r.name}}getVersionRange(){return{pro:{min:"4.9.3"},model_classic1s:{min:"3.10.1"}}}run(){return A(this,void 0,void 0,(function*(){try{return(yield this.device.commands.typedCall("SignPsbt","SignedPsbt",Object.assign({},this.params))).message}catch(e){const{message:t}=e,r=Ee(this.device.features);if(t.includes("PSBT parse failed")&&(r===n.EDeviceType.Classic1s||r===n.EDeviceType.ClassicPure))throw n.TypedError(n.HardwareErrorCode.BTCPsbtTooManyUtxos,"PSBT too many utxos",{count:5});throw e}}))}},btcSignTransaction:class extends Xt{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"coin",type:"string",required:!0},{name:"inputs",type:"array",required:!0},{name:"outputs",type:"array",required:!0},{name:"refTxs",type:"array",required:!0,allowEmpty:!0},{name:"locktime",type:"number"},{name:"version",type:"number"},{name:"expiry",type:"number"},{name:"overwintered",type:"boolean"},{name:"versionGroupId",type:"number"},{name:"branchId",type:"number"},{name:"timestamp",type:"number"}]),this.payload.refTxs.forEach((e=>{fr(e,[{name:"hash",type:"hexString",required:!0},{name:"inputs",type:"array",required:!0},{name:"bin_outputs",type:"array",required:!Array.isArray(e.outputs)},{name:"outputs",type:"array"},{name:"version",type:"number",required:!0},{name:"lock_time",type:"number",required:!0},{name:"extra_data",type:"string"},{name:"timestamp",type:"number"},{name:"version_group_id",type:"number"}])})),this.payload.inputs.forEach((e=>{He(e.address_n);const t=(r=e.address_n,Array.isArray(r)&&r[0]===Pe(49));var r;fr(e,[{name:"prev_hash",type:"hexString",required:!0},{name:"prev_index",type:"number",required:!0},{name:"script_type",type:"string"},{name:"amount",type:"string",required:t},{name:"sequence",type:"number"},{name:"multisig",type:"object"}])})),this.payload.outputs.forEach((e=>{if(fr(e,[{name:"address_n",type:"array"},{name:"address",type:"string"},{name:"amount",type:"string"},{name:"op_return_data",type:"string"},{name:"multisig",type:"object"}]),Object.prototype.hasOwnProperty.call(e,"address_n")&&Object.prototype.hasOwnProperty.call(e,"address"))throw n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodInvalidParameter,"Cannot use address and address_n in one output");if(e.address_n){const t=Ue(e.address_n);if(e.script_type!==t)throw n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodInvalidParameter,`Output change script_type should be set to ${t}`)}}));const{inputs:e,outputs:t,refTxs:r,account:i,coin:s}=this.payload,o=Kr(void 0,s).name;this.params={inputs:e,outputs:t,refTxs:r,addresses:i?i.addresses:void 0,options:{lock_time:this.payload.locktime,timestamp:this.payload.timestamp,version:this.payload.version,expiry:this.payload.expiry,overwintered:this.payload.overwintered,version_group_id:this.payload.versionGroupId,branch_id:this.payload.branchId},coinName:o}}getVersionRange(){return Vr([this.params.coinName])}run(){return A(this,void 0,void 0,(function*(){const{device:e,params:t}=this,r=e.unavailableCapabilities.replaceTransaction,{refTxs:i}=t,n=r?ni:ti;return yield n(e.commands.typedCall.bind(e.commands),t.inputs,t.outputs,i,t.options,t.coinName)}))}},btcVerifyMessage:class extends Xt{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"address",type:"string",required:!0},{name:"messageHex",type:"hexString",required:!0},{name:"signature",type:"hexString",required:!0},{name:"coin",type:"string",required:!0}]);const{coin:e}=this.payload,{address:t,messageHex:r,signature:i}=ar(this.payload),n=Kr(void 0,e).name;this.params={address:t,message:r,signature:i,coin_name:n}}getVersionRange(){return Vr([this.params.coin_name])}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("VerifyMessage","Success",Object.assign({},this.params));return Promise.resolve(e.message)}))}},confluxGetAddress:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};fr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t,r;const i=He(e.path,3);fr(e,[{name:"path",required:!0},{name:"chainId",type:"number"},{name:"showOnOneKey",type:"boolean"}]);const n=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:i,chain_id:null!==(r=e.chainId)&&void 0!==r?r:1029,show_display:n})}))}getVersionRange(){return{model_mini:{min:"2.4.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("ConfluxGetAddress","ConfluxAddress",Object.assign({},r)),n=ze(r.address_n);e.push(Object.assign({path:n},i.message)),this.postPreviousAddressMessage({path:n,address:i.message.address})}return yr(e,["address"],{expectedLength:this.params.length}),Promise.resolve(this.hasBundle?e:e[0])}))}},confluxSignMessage:class extends Xt{init(){this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"path",required:!0},{name:"messageHex",type:"hexString",required:!0}]);const{path:e,messageHex:t}=this.payload,r=He(e,3);this.params={address_n:r,message:ar(t)}}getVersionRange(){return{model_mini:{min:"2.4.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("ConfluxSignMessage","ConfluxMessageSignature",Object.assign({},this.params));return Promise.resolve(e.message)}))}},confluxSignMessageCIP23:class extends Xt{init(){this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"path",required:!0},{name:"domainHash",type:"hexString",required:!0},{name:"messageHash",type:"hexString",required:!0}]);const{path:e,domainHash:t,messageHash:r}=this.payload,i=He(e,3);this.params={address_n:i,domain_hash:ar(t),message_hash:ar(r)}}getVersionRange(){return{model_mini:{min:"2.4.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("ConfluxSignMessageCIP23","ConfluxMessageSignature",Object.assign({},this.params));return Promise.resolve(e.message)}))}},confluxSignTransaction:class extends Xt{constructor(){super(...arguments),this.addressN=[],this.processTxRequest=(e,t)=>A(this,void 0,void 0,(function*(){if(!e.data_length){const t=e.signature_v,r=e.signature_r,i=e.signature_s;if(null==t||null==r||null==i)throw n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodError,"sign transaction failed");return Promise.resolve({v:`0x${t.toString(16)}`,r:`0x${r}`,s:`0x${i}`})}const[r,i]=si(t,2*e.data_length),s=yield this.device.commands.typedCall("ConfluxTxAck","ConfluxTxRequest",{data_chunk:r});return this.processTxRequest(s.message,i)})),this.evmSignTx=(e,t)=>A(this,void 0,void 0,(function*(){const{to:r,value:i,gasPrice:n,gasLimit:s,nonce:o,data:a,chainId:d,epochHeight:u,storageLimit:l}=t,c=null==a?0:a.length/2,[p,h]=si(a,2048);let f={address_n:e,nonce:or(o),gas_price:or(n),gas_limit:or(s),to:r,value:or(i),epoch_height:or(u),storage_limit:or(l),chain_id:d};0!==c&&(f=Object.assign(Object.assign({},f),{data_length:c,data_initial_chunk:p}));const y=yield this.device.commands.typedCall("ConfluxSignTx","ConfluxTxRequest",f);return this.processTxRequest(y.message,h)}))}init(){this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"path",required:!0},{name:"transaction",type:"object",required:!0}]);const{path:e,transaction:t}=this.payload;this.addressN=He(e,3);const r=t;fr(r,[{name:"to",type:"hexString",required:!0},{name:"value",type:"hexString",required:!0},{name:"gasLimit",type:"hexString",required:!0},{name:"gasPrice",type:"hexString",required:!0},{name:"nonce",type:"hexString",required:!0},{name:"epochHeight",type:"hexString",required:!0},{name:"storageLimit",type:"hexString",required:!0},{name:"chainId",type:"number",required:!0},{name:"data",type:"hexString"}]),this.formattedTx=ar(r)}getVersionRange(){return{model_mini:{min:"2.4.0"}}}run(){return A(this,void 0,void 0,(function*(){const{addressN:e,formattedTx:t}=this;if(null==t)throw n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodInvalidParameter,"ConfluxSignTransaction: format tx error");const r=yield this.evmSignTx(e,t);return Promise.resolve(r)}))}},evmGetAddress:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};fr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=He(e.path,3);fr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"},{name:"chainId",type:"number"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i,chain_id:e.chainId})}))}getEvmAddress(e){return A(this,void 0,void 0,(function*(){return"v1"===jt.getMessageVersion()?function({typedCall:e,param:t}){return A(this,void 0,void 0,(function*(){return e("EthereumGetAddress","EthereumAddress",{address_n:t.address_n,show_display:t.show_display,chain_id:t.chain_id})}))}({typedCall:this.device.commands.typedCall.bind(this.device.commands),param:e}):function({typedCall:e,param:t}){return A(this,void 0,void 0,(function*(){return e("EthereumGetAddressUKey","EthereumAddressUKey",Object.assign({},t))}))}({typedCall:this.device.commands.typedCall.bind(this.device.commands),param:e})}))}run(){return A(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.getEvmAddress(r),{address:n}=i.message;if(!n)throw new Error("EthereumGetAddressUKey: address is undefined");const s={path:ze(r.address_n),address:n};e.push(s),this.postPreviousAddressMessage(s)}return yr(e,["address"],{expectedLength:this.params.length}),Promise.resolve(this.hasBundle?e:e[0])}))}},evmGetPublicKey:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1,this.confirmShowOnUKey=!1,this.useBatch=!1}init(){var e,t,r;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle),this.confirmShowOnUKey=null===(r=null===(t=this.payload)||void 0===t?void 0:t.bundle)||void 0===r?void 0:r.some((e=>!!e.showOnOneKey)),this.useBatch=!this.confirmShowOnUKey&&this.hasBundle&&this.payload.useBatch;const i=this.hasBundle?this.payload:{bundle:[this.payload]};fr(i,[{name:"bundle",type:"array"}]),this.params=[],i.bundle.forEach((e=>{var t;const r=He(e.path,3);fr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"},{name:"chainId",type:"number"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i,chain_id:e.chainId})}))}getEvmPublicKey(e){return"v1"===jt.getMessageVersion()?function({typedCall:e,param:t}){return A(this,void 0,void 0,(function*(){return e("EthereumGetPublicKey","EthereumPublicKey",{address_n:t.address_n,show_display:t.show_display,chain_id:t.chain_id})}))}({typedCall:this.device.commands.typedCall.bind(this.device.commands),param:e}):function({typedCall:e,param:t}){return A(this,void 0,void 0,(function*(){return e("EthereumGetPublicKeyUKey","EthereumPublicKeyUKey",Object.assign({},t))}))}({typedCall:this.device.commands.typedCall.bind(this.device.commands),param:e})}run(){var e;return A(this,void 0,void 0,(function*(){const t=[];if(this.useBatch&&tt(null===(e=this.device)||void 0===e?void 0:e.features))try{const e=(yield $r(this.device,this.params,"secp256k1",60,{includeNode:!1,ignoreCoinType:!0})).public_keys.map(((e,t)=>({path:ze(this.params[t].address_n),pub:e,publicKey:e})));return yr(e,["pub"],{expectedLength:this.params.length}),yield Promise.resolve(e)}catch(e){}for(let e=0;e<this.params.length;e++){const r=this.params[e],i=yield this.getEvmPublicKey(r);t.push(Object.assign({path:ze(r.address_n),pub:i.message.node.public_key,publicKey:i.message.node.public_key},i.message))}return yr(t,["pub"],{expectedLength:this.params.length}),Promise.resolve(this.hasBundle?t:t[0])}))}},evmSignMessage:class extends Xt{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"path",required:!0},{name:"messageHex",type:"hexString",required:!0},{name:"chainId",type:"number"}]);const{path:e,messageHex:t,chainId:r}=this.payload,i=He(e,3);this.params={address_n:i,message:ar(t),chain_id:r}}run(){return A(this,void 0,void 0,(function*(){return"v1"===jt.getMessageVersion()?function({typedCall:e,params:t}){return A(this,void 0,void 0,(function*(){const r=yield e("EthereumSignMessage","EthereumMessageSignature",{address_n:t.address_n,message:t.message,chain_id:t.chain_id});return Promise.resolve(r.message)}))}({typedCall:this.device.commands.typedCall.bind(this.device.commands),params:this.params}):function({typedCall:e,params:t}){return A(this,void 0,void 0,(function*(){const r=yield e("EthereumSignMessageUKey","EthereumMessageSignatureUKey",Object.assign({},t));return Promise.resolve(r.message)}))}({typedCall:this.device.commands.typedCall.bind(this.device.commands),params:this.params})}))}},evmSignMessageEIP712:class extends Xt{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"path",required:!0},{name:"domainHash",type:"hexString",required:!0},{name:"messageHash",type:"hexString",required:!0}]);const{path:e,domainHash:t,messageHash:r}=this.payload,i=He(e,3);this.params={address_n:i,domain_hash:ar(t),message_hash:ar(r)}}getVersionRange(){return{model_mini:{min:"2.1.9"},model_classic1s:{min:"3.14.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("EthereumSignMessageEIP712","EthereumMessageSignature",Object.assign({},this.params));return Promise.resolve(e.message)}))}},evmSignTransaction:class extends Xt{constructor(){super(...arguments),this.addressN=[],this.isEIP1559=!1,this.isEIP7702=!1}hasEIP7702Features(e){const t=e.authorizationList;return!!(t&&Array.isArray(t)&&t.length>0)}hasEIP1559Features(e){return!(!e.maxFeePerGas||!e.maxPriorityFeePerGas)}init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"path",required:!0},{name:"transaction",type:"object",required:!0}]);const{path:e,transaction:t}=this.payload;this.addressN=He(e,3);const r=t;this.isEIP7702=this.hasEIP7702Features(r),this.isEIP1559=this.hasEIP1559Features(r)&&!this.isEIP7702;const i=[{name:"to",type:"hexString",required:!0},{name:"value",type:"hexString",required:!0},{name:"gasLimit",type:"hexString",required:!0},{name:"nonce",type:"hexString",required:!0},{name:"chainId",type:"number",required:!0},{name:"data",type:"hexString"}];this.isEIP7702?(i.push({name:"maxFeePerGas",type:"hexString",required:!0}),i.push({name:"maxPriorityFeePerGas",type:"hexString",required:!0}),i.push({name:"authorizationList",type:"array",required:!0})):this.isEIP1559?(i.push({name:"maxFeePerGas",type:"hexString",required:!0}),i.push({name:"maxPriorityFeePerGas",type:"hexString",required:!0})):(i.push({name:"gasPrice",type:"hexString",required:!0}),i.push({name:"txType",type:"number"})),fr(r,i),this.formattedTx=ar(r)}getVersionRange(){return this.isEIP7702?{model_classic1s:{min:"3.13.0"},pro:{min:"4.16.0"}}:this.isEIP1559?{model_mini:{min:"2.1.11"}}:{model_mini:{min:"1.0.0"}}}run(){return A(this,void 0,void 0,(function*(){const{addressN:e,isEIP1559:t,isEIP7702:r,formattedTx:i}=this;if(null==i)throw n.ERRORS.TypedError("Runtime","formattedTx is not set");return"v1"===jt.getMessageVersion()?(({typedCall:e,isEIP1559:t,isEIP7702:r,addressN:i,tx:n})=>A(void 0,void 0,void 0,(function*(){return r?ui({typedCall:e,addressN:i,tx:n,supportTrezor:!0}):t?di({typedCall:e,addressN:i,tx:n,supportTrezor:!0}):ai({typedCall:e,addressN:i,tx:n,supportTrezor:!0})})))({typedCall:this.device.commands.typedCall.bind(this.device.commands),addressN:e,tx:i,isEIP1559:t,isEIP7702:r}):(({typedCall:e,isEIP1559:t,isEIP7702:r,addressN:i,tx:n})=>A(void 0,void 0,void 0,(function*(){return r?ui({typedCall:e,addressN:i,tx:n}):t?di({typedCall:e,addressN:i,tx:n}):ai({typedCall:e,addressN:i,tx:n})})))({typedCall:this.device.commands.typedCall.bind(this.device.commands),addressN:e,tx:i,isEIP1559:t,isEIP7702:r})}))}},evmSignTypedData:class extends Xt{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"path",required:!0},{name:"metamaskV4Compat",type:"boolean"},{name:"data",type:"object"},{name:"domainHash",type:"hexString"},{name:"messageHash",type:"hexString"},{name:"chainId",type:"number"}]);const{path:e,data:t,metamaskV4Compat:r,domainHash:i,messageHash:s,chainId:o}=this.payload,a=He(e,3);if(this.params={addressN:a,metamaskV4Compat:r,data:t,chainId:o},i)if(this.params.domainHash=ar(i),s)this.params.messageHash=ar(s);else if(t&&(!t.primaryType||"EIP712Domain"!==t.primaryType))throw n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodInvalidParameter,"message_hash should only be empty when data.primaryType=EIP712Domain")}handleSignTypedData({typedCall:e,signData:t,response:r,supportTrezor:i}){return A(this,void 0,void 0,(function*(){const{types:s,primaryType:o,domain:a,message:d}=t;for(;"EthereumTypedDataStructRequest"===r.type||"EthereumTypedDataStructRequestUKey"===r.type;){const{name:t}=r.message,o=s[t];if(void 0===o)throw n.ERRORS.TypedError("Runtime",`Type ${t} was not defined in types object`);const a={members:o.map((({name:e,type:t})=>({name:e,type:mi(t,s)})))};r=i?yield e("EthereumTypedDataStructAck",["EthereumTypedDataStructRequest","EthereumTypedDataValueRequest","EthereumTypedDataSignature"],a):yield e("EthereumTypedDataStructAckUKey",["EthereumTypedDataStructRequestUKey","EthereumTypedDataValueRequestUKey","EthereumTypedDataSignatureUKey"],a)}for(;"EthereumTypedDataValueRequest"===r.type||"EthereumTypedDataValueRequestUKey"===r.type;){const{member_path:t}=r.message;let u,l;const[c,...p]=t;switch(c){case 0:u=a,l="EIP712Domain";break;case 1:u=d,l=o;break;default:throw n.ERRORS.TypedError("Runtime","Root index can only be 0 or 1")}for(const e of p)if(Array.isArray(u))l=fi(l).entryTypeName,u=u[e];else if("object"==typeof u&&null!==u){const t=s[l][e];l=t.type,u=u[t.name]}let h;h=Array.isArray(u)?yi("uint16",u.length):yi(l,u),r=i?yield e("EthereumTypedDataValueAck",["EthereumTypedDataValueRequest","EthereumTypedDataSignature"],{value:h}):yield e("EthereumTypedDataValueAckUKey",["EthereumTypedDataValueRequestUKey","EthereumTypedDataSignatureUKey"],{value:h})}if("EthereumGnosisSafeTxRequest"===r.type){const{data:t}=this.params,i={to:t.message.to,value:ar(new T.default(t.message.value).toString(16)),data:or(ar(t.message.data)),operation:parseInt(t.message.operation),safeTxGas:ar(new T.default(t.message.safeTxGas).toString(16)),baseGas:ar(new T.default(t.message.baseGas).toString(16)),gasPrice:ar(new T.default(t.message.gasPrice).toString(16)),gasToken:t.message.gasToken,refundReceiver:t.message.refundReceiver,nonce:ar(new T.default(t.message.nonce).toString(16)),chain_id:cr(t.domain.chainId),verifyingContract:t.domain.verifyingContract};r=yield e("EthereumGnosisSafeTxAck",["EthereumTypedDataSignature","EthereumTypedDataSignatureUKey"],i)}if("EthereumTypedDataSignature"!==r.type&&"EthereumTypedDataSignatureUKey"!==r.type)throw n.ERRORS.TypedError("Runtime","Unexpected response type");const{address:u,signature:l}=r.message;return{address:u,signature:l}}))}signTypedData(){return A(this,void 0,void 0,(function*(){const{addressN:e,data:t,metamaskV4Compat:r,chainId:i}=this.params;let n,s=!1;if("v1"===jt.getMessageVersion())s=!0,n=yield(({typedCall:e,addressN:t,data:r,metamaskV4Compat:i,chainId:n})=>A(void 0,void 0,void 0,(function*(){const{primaryType:s}=r;return yield e("EthereumSignTypedData",["EthereumTypedDataStructRequest","EthereumTypedDataValueRequest","EthereumTypedDataSignature","EthereumGnosisSafeTxRequest"],{address_n:t,primary_type:s,metamask_v4_compat:i,chain_id:n})})))({typedCall:this.device.commands.typedCall.bind(this.device.commands),addressN:e,data:t,metamaskV4Compat:r,chainId:i});else s=!1,n=yield(({typedCall:e,addressN:t,data:r,metamaskV4Compat:i,chainId:n})=>A(void 0,void 0,void 0,(function*(){const{primaryType:s}=r;return e("EthereumSignTypedDataUKey",["EthereumTypedDataStructRequestUKey","EthereumTypedDataValueRequestUKey","EthereumTypedDataSignatureUKey","EthereumGnosisSafeTxRequest"],{address_n:t,primary_type:s,metamask_v4_compat:i,chain_id:n})})))({typedCall:this.device.commands.typedCall.bind(this.device.commands),addressN:e,data:t,metamaskV4Compat:r,chainId:i});return this.handleSignTypedData({typedCall:this.device.commands.typedCall.bind(this.device.commands),signData:t,response:n,supportTrezor:s})}))}signTypedHash({typedCall:e,addressN:t,chainId:r,domainHash:i,messageHash:s}){if(!i)throw n.ERRORS.TypedError("Runtime","domainHash is required");return"v1"===jt.getMessageVersion()?(({typedCall:e,addressN:t,device:r,chainId:i,domainHash:s,messageHash:o})=>A(void 0,void 0,void 0,(function*(){const a=Ee(r.features);if(a===n.EDeviceType.Touch||a===n.EDeviceType.Pro){const e=Oe(r.features).join("."),t="4.2.0";if(b.default.lt(e,t))throw n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodNeedUpgradeFirmware,`Device firmware version is too low, please update to ${t}`,{current:e,require:t})}return e("EthereumSignTypedHash","EthereumTypedDataSignature",{address_n:t,domain_separator_hash:null!=s?s:"",message_hash:o,chain_id:i})})))({typedCall:e,addressN:t,domainHash:i,messageHash:s,chainId:r,device:this.device}):(({typedCall:e,addressN:t,device:r,chainId:i,domainHash:s,messageHash:o})=>A(void 0,void 0,void 0,(function*(){const a=Ee(r.features);if(a===n.EDeviceType.Touch||a===n.EDeviceType.Pro){const e=Oe(r.features).join("."),t="4.2.0";if(b.default.lt(e,t))throw n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodNeedUpgradeFirmware,`Device firmware version is too low, please update to ${t}`,{current:e,require:t})}return e("EthereumSignTypedHashUKey","EthereumTypedDataSignatureUKey",{address_n:t,domain_separator_hash:null!=s?s:"",message_hash:o,chain_id:i})})))({typedCall:e,addressN:t,domainHash:i,messageHash:s,chainId:r,device:this.device})}getVersionRange(){return{model_mini:{min:"2.1.9"}}}hasBiggerData(e){const t=o.get(e.message,"data",void 0);if(!t)return!1;let r=1024;const i=Oe(this.device.features).join(".");b.default.gte(i,"4.4.0")&&(r=1536);const n=t.startsWith("0x")?2:0;return(t.length-n)/2>r}hasNestedArrays(e){if(!e)return!1;if(Array.isArray(e))for(const t of e){if(Array.isArray(t))return!0;if("object"==typeof t&&null!==t&&this.hasNestedArrays(t))return!0}else if("object"==typeof e&&null!==e)for(const t in e)if(this.hasNestedArrays(e[t]))return!0;return!1}supportSignTyped(){const e=Ee(this.device.features);if(_e.model_mini.includes(e)){const e=Oe(this.device.features).join("."),t="2.2.0";if(b.default.lt(e,t))return!1}return!0}run(){return A(this,void 0,void 0,(function*(){if(!this.device.features)throw n.ERRORS.TypedError("Device_InitializeFailed","Device initialization failed. Please try again.");const{addressN:e,chainId:t}=this.params,r=Ee(this.device.features);if(_e.model_mini.includes(r)){const i=Oe(this.device.features).join(".");if((r===n.EDeviceType.Classic1s||r===n.EDeviceType.ClassicPure)&&b.default.gte(i,"3.14.0")||Te(this.device.features,a.Enum_Capability.Capability_EthereumTypedData))return this.signTypedData();fr(this.params,[{name:"domainHash",type:"hexString",required:!0},{name:"messageHash",type:"hexString",required:!0}]);const{domainHash:s,messageHash:o}=this.params;let d;return d=this.supportSignTyped()?yield this.signTypedHash({typedCall:this.device.commands.typedCall.bind(this.device.commands),addressN:e,domainHash:s,messageHash:o,chainId:t}):yield this.device.commands.typedCall("EthereumSignMessageEIP712","EthereumMessageSignature",{address_n:e,domain_hash:null!=s?s:"",message_hash:null!=o?o:""}),Promise.resolve(d.message)}if(this.hasNestedArrays(this.params.data)||this.hasBiggerData(this.params.data)){fr(this.params,[{name:"domainHash",type:"hexString",required:!0},{name:"messageHash",type:"hexString",required:!0}]);const{domainHash:r,messageHash:i}=this.params;if(!r)throw n.ERRORS.TypedError("Runtime","domainHash is required");const s=yield this.signTypedHash({typedCall:this.device.commands.typedCall.bind(this.device.commands),addressN:e,domainHash:r,messageHash:i,chainId:t});return Promise.resolve(s.message)}return this.signTypedData()}))}},evmVerifyMessage:class extends Xt{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"address",type:"string",required:!0},{name:"messageHex",type:"hexString",required:!0},{name:"signature",type:"hexString",required:!0},{name:"chainId",type:"number"}]);const{address:e,messageHex:t,signature:r}=ar(this.payload);this.params={address:e,message:t,signature:r,chain_id:this.payload.chainId}}run(){return A(this,void 0,void 0,(function*(){return"v1"===jt.getMessageVersion()?function({typedCall:e,params:t}){return A(this,void 0,void 0,(function*(){const r=yield e("EthereumVerifyMessage","Success",{signature:t.signature,message:t.message,address:t.address,chain_id:t.chain_id});return Promise.resolve(r.message)}))}({typedCall:this.device.commands.typedCall.bind(this.device.commands),params:this.params}):function({typedCall:e,params:t}){return A(this,void 0,void 0,(function*(){const r=yield e("EthereumVerifyMessageUKey","Success",Object.assign({},t));return Promise.resolve(r.message)}))}({typedCall:this.device.commands.typedCall.bind(this.device.commands),params:this.params})}))}},starcoinGetAddress:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};fr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=He(e.path,3);fr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i})}))}run(){return A(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("StarcoinGetAddress","StarcoinAddress",Object.assign({},r)),n=ze(r.address_n);e.push(Object.assign({path:n},i.message)),this.postPreviousAddressMessage({path:n,address:i.message.address})}return yr(e,["address"],{expectedLength:this.params.length}),Promise.resolve(this.hasBundle?e:e[0])}))}},starcoinGetPublicKey:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};fr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=He(e.path,3);fr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i})}))}run(){return A(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("StarcoinGetPublicKey","StarcoinPublicKey",Object.assign({},r));e.push(Object.assign({path:ze(r.address_n)},i.message))}return yr(e,["public_key"],{expectedLength:this.params.length}),Promise.resolve(this.hasBundle?e:e[0])}))}},starcoinSignMessage:class extends Xt{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"path",required:!0},{name:"messageHex",type:"hexString",required:!0}]);const{path:e,messageHex:t}=this.payload,r=He(e,3);this.params={address_n:r,message:ar(t)}}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("StarcoinSignMessage","StarcoinMessageSignature",Object.assign({},this.params));return Promise.resolve(e.message)}))}},starcoinSignTransaction:class extends Xt{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"path",required:!0},{name:"rawTx",type:"hexString",required:!0}]);const{path:e,rawTx:t}=this.payload,r=He(e,3);this.params={address_n:r,raw_tx:ar(t)}}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("StarcoinSignTx","StarcoinSignedTx",Object.assign({},this.params));return Promise.resolve(e.message)}))}},starcoinVerifyMessage:class extends Xt{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"publicKey",type:"string",required:!0},{name:"messageHex",type:"hexString",required:!0},{name:"signature",type:"hexString",required:!0}]);const{publicKey:e,messageHex:t,signature:r}=ar(this.payload);this.params={public_key:e,message:t,signature:r}}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("StarcoinVerifyMessage","Success",Object.assign({},this.params));return Promise.resolve(e.message)}))}},nemGetAddress:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};fr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=He(e.path,3);fr(e,[{name:"path",required:!0},{name:"network",type:"number"},{name:"showOnOneKey",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,network:e.network||104,show_display:i})}))}run(){return A(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("NEMGetAddress","NEMAddress",Object.assign({},r)),n=ze(r.address_n);e.push(Object.assign({path:n},i.message)),this.postPreviousAddressMessage({path:n,address:i.message.address})}return yr(e,["address"],{expectedLength:this.params.length}),Promise.resolve(this.hasBundle?e:e[0])}))}},nemSignTransaction:class extends Xt{constructor(){super(...arguments),this.NEM_MOSAIC_LEVY_TYPES={1:"MosaicLevy_Absolute",2:"MosaicLevy_Percentile"},this.NEM_SUPPLY_CHANGE_TYPES={1:"SupplyChange_Increase",2:"SupplyChange_Decrease"},this.NEM_AGGREGATE_MODIFICATION_TYPES={1:"CosignatoryModification_Add",2:"CosignatoryModification_Delete"},this.NEM_IMPORTANCE_TRANSFER_MODES={1:"ImportanceTransfer_Activate",2:"ImportanceTransfer_Deactivate"},this.getCommon=(e,t)=>{var r;return{address_n:t,network:e.version>>24&255,timestamp:e.timeStamp,fee:e.fee,deadline:null!==(r=e.deadline)&&void 0!==r?r:0,signer:t?void 0:e.signer}},this.transferMessage=e=>{const t=e.mosaics?e.mosaics.map((e=>({namespace:e.mosaicId.namespaceId,mosaic:e.mosaicId.name,quantity:e.quantity}))):void 0;return{recipient:e.recipient,amount:e.amount,payload:e.message?e.message.payload:void 0,public_key:e.message&&2===e.message.type?e.message.publicKey:void 0,mosaics:t}},this.importanceTransferMessage=e=>({mode:this.NEM_IMPORTANCE_TRANSFER_MODES[e.importanceTransfer.mode],public_key:e.importanceTransfer.publicKey}),this.aggregateModificationMessage=e=>({modifications:e.modifications?e.modifications.map((e=>({type:this.NEM_AGGREGATE_MODIFICATION_TYPES[e.modificationType],public_key:e.cosignatoryAccount}))):void 0,relative_change:e.minCosignatories.relativeChange}),this.provisionNamespaceMessage=e=>{var t,r,i;return{namespace:null!==(t=e.newPart)&&void 0!==t?t:"",parent:e.parent||void 0,sink:null!==(r=e.rentalFeeSink)&&void 0!==r?r:"",fee:null!==(i=e.rentalFee)&&void 0!==i?i:0}},this.mosaicCreationMessage=e=>{var t,r;const{levy:i}=e.mosaicDefinition,n={namespace:e.mosaicDefinition.id.namespaceId,mosaic:e.mosaicDefinition.id.name,levy:i&&i.type?this.NEM_MOSAIC_LEVY_TYPES[i.type]:void 0,fee:i&&i.fee,levy_address:i&&i.recipient,levy_namespace:i&&i.mosaicId&&i.mosaicId.namespaceId,levy_mosaic:i&&i.mosaicId&&i.mosaicId.name,description:e.mosaicDefinition.description},{properties:s}=e.mosaicDefinition;return Array.isArray(s)&&s.forEach((e=>{const{name:t,value:r}=e;switch(t){case"divisibility":n.divisibility=parseInt(r);break;case"initialSupply":n.supply=parseInt(r);break;case"supplyMutable":n.mutable_supply="true"===r;break;case"transferable":n.transferable="true"===r}})),{definition:n,sink:null!==(t=e.creationFeeSink)&&void 0!==t?t:"",fee:null!==(r=e.creationFee)&&void 0!==r?r:0}},this.supplyChangeMessage=e=>{var t;return{namespace:e.mosaicId.namespaceId,mosaic:e.mosaicId.name,type:this.NEM_SUPPLY_CHANGE_TYPES[e.supplyType],delta:null!==(t=e.delta)&&void 0!==t?t:0}},this.parseTx=(e,t)=>{let r=e;const i={transaction:this.getCommon(e,t),transfer:void 0,importance_transfer:void 0,aggregate_modification:void 0,provision_namespace:void 0,mosaic_creation:void 0,supply_change:void 0};switch(258!==e.type&&4100!==e.type&&4098!==e.type||(i.cosigning=258===e.type||4098===e.type,r=e.otherTrans,i.multisig=this.getCommon(r)),r.type){case 257:i.transfer=this.transferMessage(r);break;case 2049:i.importance_transfer=this.importanceTransferMessage(r);break;case 4097:i.aggregate_modification=this.aggregateModificationMessage(r);break;case 8193:i.provision_namespace=this.provisionNamespaceMessage(r);break;case 16385:i.mosaic_creation=this.mosaicCreationMessage(r);break;case 16386:i.supply_change=this.supplyChangeMessage(r);break;default:throw n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodInvalidParameter,"Unknown transaction type")}return i}}init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"path",required:!0},{name:"transaction",type:"object",required:!0}]);const{path:e,transaction:t}=this.payload,r=He(e,3);this.params=this.parseTx(t,r)}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("NEMSignTx","NEMSignedTx",Object.assign({},this.params));return Promise.resolve(e)}))}},solGetAddress:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};fr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=He(e.path,3);fr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i})}))}run(){return A(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("SolanaGetAddress","SolanaAddress",Object.assign({},r)),{address:n}=i.message,s={path:ze(r.address_n),address:n};e.push(s),this.postPreviousAddressMessage(s)}return yr(e,["address"],{expectedLength:this.params.length}),Promise.resolve(this.hasBundle?e:e[0])}))}},solSignTransaction:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};fr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{const t=He(e.path,3);fr(e,[{name:"path",required:!0},{name:"rawTx",type:"hexString",required:!0}]),this.params.push({address_n:t,raw_tx:ar(e.rawTx)})}))}getVersionRange(){return this.existsVersionedTx()?{model_mini:{min:"3.1.0"},model_touch:{min:"4.3.0"}}:{classic:{min:"2.1.9"},mini:{min:"2.1.9"}}}isVersionedTx(e){if(0===e.length)return!1;try{const t=e.startsWith("0x")?e.slice(2):e;return"1"===parseInt(t[0],16).toString(2)[0]}catch(e){return!1}}existsVersionedTx(){for(let e=0;e<this.params.length;e++){const t=this.params[e],{raw_tx:r}=t;if(this.isVersionedTx(r))return!0}return!1}run(){return A(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("SolanaSignTx","SolanaSignedTx",Object.assign({},r)),{signature:n}=i.message;e.push({path:ze(r.address_n),signature:n})}return Promise.resolve(this.hasBundle?e:e[0])}))}},solSignOffchainMessage:class extends Xt{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"path",required:!0},{name:"messageHex",type:"hexString",required:!0},{name:"messageVersion",type:"number",required:!1},{name:"messageFormat",type:"number",required:!1},{name:"applicationDomainHex",type:"hexString",required:!1}]);const{path:e,messageHex:t,messageVersion:r,messageFormat:i,applicationDomainHex:n}=this.payload,s=He(e,3);this.params={address_n:s,message:nr(t),message_version:null!=r?r:void 0,message_format:null!=i?i:void 0,application_domain:null!=n?n:void 0}}getVersionRange(){return{pro:{min:"4.12.0"},model_classic1s:{min:"3.11.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("SolanaSignOffChainMessage","SolanaMessageSignature",Object.assign({},this.params));return Promise.resolve({signature:e.message.signature,pub:e.message.public_key})}))}},solSignMessage:class extends Xt{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"path",required:!0},{name:"messageHex",type:"hexString",required:!0}]);const{path:e,messageHex:t}=this.payload,r=He(e,3);this.params={address_n:r,message:nr(t)}}getVersionRange(){return{pro:{min:"4.12.0"},touch:{min:"4.10.0"},model_classic1s:{min:"3.11.0"},model_mini:{min:"3.10.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("SolanaSignUnsafeMessage","SolanaMessageSignature",Object.assign({},this.params));return Promise.resolve({signature:e.message.signature,pub:e.message.public_key})}))}},stellarGetAddress:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};fr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=He(e.path,3);fr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i})}))}run(){return A(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("StellarGetAddress","StellarAddress",Object.assign({},r)),{address:n}=i.message,s={path:ze(r.address_n),address:n};e.push(s),this.postPreviousAddressMessage(s)}return yr(e,["address"],{expectedLength:this.params.length}),Promise.resolve(this.hasBundle?e:e[0])}))}},stellarSignTransaction:class extends Xt{constructor(){super(...arguments),this.operations=[],this.parseOperation=e=>{switch(e.type){case"createAccount":return fr(e,[{name:"destination",type:"string",required:!0},{name:"startingBalance",type:"bigNumber",required:!0}]),{type:"StellarCreateAccountOp",source_account:e.source,new_account:e.destination,starting_balance:e.startingBalance};case"payment":return fr(e,[{name:"destination",type:"string",required:!0},{name:"amount",type:"bigNumber",required:!0},{name:"asset",required:!0}]),{type:"StellarPaymentOp",source_account:e.source,destination_account:e.destination,asset:e.asset,amount:e.amount};case"pathPayment":return fr(e,[{name:"destAmount",type:"bigNumber",required:!0}]),{type:"StellarPathPaymentOp",source_account:e.source,send_asset:e.sendAsset,send_max:e.sendMax,destination_account:e.destination,destination_asset:e.destAsset,destination_amount:e.destAmount,paths:e.path};case"createPassiveOffer":return fr(e,[{name:"amount",type:"bigNumber",required:!0}]),{type:"StellarCreatePassiveOfferOp",source_account:e.source,buying_asset:e.buying,selling_asset:e.selling,amount:e.amount,price_n:e.price.n,price_d:e.price.d};case"manageOffer":return fr(e,[{name:"amount",type:"bigNumber",required:!0}]),{type:"StellarManageOfferOp",source_account:e.source,buying_asset:e.buying,selling_asset:e.selling,amount:e.amount,offer_id:e.offerId,price_n:e.price.n,price_d:e.price.d};case"setOptions":{const t=e.signer?{signer_type:e.signer.type,signer_key:e.signer.key,signer_weight:e.signer.weight}:void 0;return Object.assign({type:"StellarSetOptionsOp",source_account:e.source,clear_flags:e.clearFlags,set_flags:e.setFlags,master_weight:e.masterWeight,low_threshold:e.lowThreshold,medium_threshold:e.medThreshold,high_threshold:e.highThreshold,home_domain:e.homeDomain,inflation_destination_account:e.inflationDest},t)}case"changeTrust":return fr(e,[{name:"limit",type:"bigNumber"}]),{type:"StellarChangeTrustOp",source_account:e.source,asset:e.line,limit:e.limit};case"allowTrust":return{type:"StellarAllowTrustOp",source_account:e.source,trusted_account:e.trustor,asset_type:e.assetType,asset_code:e.assetCode,is_authorized:e.authorize?1:0};case"accountMerge":return{type:"StellarAccountMergeOp",source_account:e.source,destination_account:e.destination};case"manageData":return{type:"StellarManageDataOp",source_account:e.source,key:e.name,value:e.value};case"bumpSequence":return{type:"StellarBumpSequenceOp",source_account:e.source,bump_to:e.bumpTo};default:return{}}},this.processTxRequest=(e,t)=>A(this,void 0,void 0,(function*(){const r=t+1>=e.length,i=e[t],{type:n}=i,s=S(i,["type"]);if(r){return(yield this.device.commands.typedCall(n,"StellarSignedTx",s)).message}return yield this.device.commands.typedCall(n,"StellarTxOpRequest",s),this.processTxRequest(e,t+1)}))}init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"path",required:!0},{name:"networkPassphrase",type:"string",required:!0},{name:"transaction",type:"object",required:!0}]);const{transaction:e,networkPassphrase:t}=this.payload;if(!e.timebounds)throw n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodInvalidParameter,"timebounds is required");const r=He(this.payload.path,3);this.params={address_n:r,network_passphrase:t,source_account:e.source,fee:e.fee,sequence_number:e.sequence,num_operations:e.operations.length,memo_type:a.StellarMemoType.NONE,timebounds_start:e.timebounds.minTime,timebounds_end:e.timebounds.maxTime},e.memo&&(this.params.memo_type=e.memo.type,this.params.memo_text=e.memo.text,this.params.memo_id=e.memo.id,this.params.memo_hash=e.memo.hash),e.operations.forEach((e=>{const t=this.parseOperation(e);t&&this.operations.push(t)}))}run(){return A(this,void 0,void 0,(function*(){return yield this.device.commands.typedCall("StellarSignTx","StellarTxOpRequest",Object.assign({},this.params)),this.processTxRequest(this.operations,0)}))}},tronGetAddress:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};fr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=He(e.path,3);fr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i})}))}getVersionRange(){return{model_mini:{min:"2.5.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("TronGetAddress","TronAddress",Object.assign({},r)),{address:n}=i.message,s={path:ze(r.address_n),address:n};e.push(s),this.postPreviousAddressMessage(s)}return yr(e,["address"],{expectedLength:this.params.length}),Promise.resolve(this.hasBundle?e:e[0])}))}},tronSignMessage:class extends Xt{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"path",required:!0},{name:"messageHex",type:"hexString",required:!0},{name:"messageType",type:"string"}]);const{path:e,messageHex:t}=this.payload,r=He(e,3);if("V1"===this.payload.messageType||null==this.payload.messageType)throw n.ERRORS.TypedError(n.HardwareErrorCode.DeviceNotSupportMethod,"not support tron message v1");const i=a.TronMessageType.V2;this.params={address_n:r,message:nr(t),message_type:i}}getVersionRange(){return{model_mini:{min:"2.5.0"}}}getMessageV2VersionRange(){return{pro:{min:"4.16.0"},classic1s:{min:"3.13.0"}}}run(){return A(this,void 0,void 0,(function*(){this.checkFeatureVersionLimit((()=>this.params.message_type===a.TronMessageType.V2),(()=>this.getMessageV2VersionRange()),{strictCheckDeviceSupport:!0});const e=yield this.device.commands.typedCall("TronSignMessage","TronMessageSignature",Object.assign({},this.params));return Promise.resolve(e.message)}))}},tronSignTransaction:class extends Xt{parseTx(e,t){var r;const i={address_n:t,data:e.data,timestamp:e.timestamp,fee_limit:e.feeLimit,ref_block_bytes:e.refBlockBytes,ref_block_hash:e.refBlockHash,expiration:e.expiration,contract:{}};return e.contract&&(e.contract.transferContract&&(i.contract={transfer_contract:{to_address:e.contract.transferContract.toAddress,amount:e.contract.transferContract.amount}}),e.contract.triggerSmartContract&&(i.contract={trigger_smart_contract:{contract_address:e.contract.triggerSmartContract.contractAddress,call_value:e.contract.triggerSmartContract.callValue,data:e.contract.triggerSmartContract.data,call_token_value:e.contract.triggerSmartContract.callTokenValue,asset_id:e.contract.triggerSmartContract.assetId}}),e.contract.freezeBalanceV2Contract&&(i.contract={freeze_balance_v2_contract:{frozen_balance:e.contract.freezeBalanceV2Contract.frozenBalance,resource:e.contract.freezeBalanceV2Contract.resource}}),e.contract.unfreezeBalanceV2Contract&&(i.contract={unfreeze_balance_v2_contract:{unfreeze_balance:e.contract.unfreezeBalanceV2Contract.unfreezeBalance,resource:e.contract.unfreezeBalanceV2Contract.resource}}),e.contract.delegateResourceContract&&(i.contract={delegate_resource_contract:{resource:e.contract.delegateResourceContract.resource,balance:e.contract.delegateResourceContract.balance,receiver_address:e.contract.delegateResourceContract.receiverAddress,lock:e.contract.delegateResourceContract.lock,lock_period:e.contract.delegateResourceContract.lockPeriod}}),e.contract.unDelegateResourceContract&&(i.contract={undelegate_resource_contract:{resource:e.contract.unDelegateResourceContract.resource,balance:e.contract.unDelegateResourceContract.balance,receiver_address:e.contract.unDelegateResourceContract.receiverAddress}}),e.contract.withdrawExpireUnfreezeContract&&(i.contract={withdraw_expire_unfreeze_contract:{}}),e.contract.withdrawBalanceContract&&(i.contract={withdraw_balance_contract:{owner_address:e.contract.withdrawBalanceContract.ownerAddress}}),e.contract.voteWitnessContract&&(i.contract={vote_witness_contract:{votes:null===(r=e.contract.voteWitnessContract.votes)||void 0===r?void 0:r.map((e=>({vote_address:e.voteAddress,vote_count:e.voteCount}))),support:e.contract.voteWitnessContract.support}}),e.contract.cancelAllUnfreezeV2Contract&&(i.contract={cancel_all_unfreeze_v2_contract:{}})),i}init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"path",required:!0},{name:"transaction",type:"object",required:!0}]);const{path:e,transaction:t}=this.payload,r=He(e,3);fr(t,[{name:"refBlockBytes",type:"hexString",required:!0},{name:"refBlockHash",type:"hexString",required:!0},{name:"expiration",type:"number",required:!0},{name:"timestamp",type:"number",required:!0},{name:"contract",type:"object",required:!0}]),this.params=this.parseTx(ar(t),r)}getVersionRange(){return{model_mini:{min:"2.5.0"}}}getFixDataTypeVersionRange(){return{pro:{min:"4.13.0"},model_classic1s:{min:"3.12.0"}}}checkFixDataTypeSupportVoteWitnessError(){const{data:e}=this.payload,{cancel_all_unfreeze_v2_contract:t,vote_witness_contract:r}=this.params.contract;this.checkFeatureVersionLimit((()=>!o.isEmpty(e)||!!t||!!r),(()=>this.getFixDataTypeVersionRange()))}supportDelegateResourceLockPeriodVersionRange(){return{pro:{min:"4.15.0"}}}checkSupportDelegateContractLockPeriod(){const{delegate_resource_contract:e}=this.params.contract;this.checkFeatureVersionLimit((()=>!!e&&void 0!==e.lock_period&&null!==e.lock_period),(()=>this.supportDelegateResourceLockPeriodVersionRange()))}run(){return A(this,void 0,void 0,(function*(){this.checkFixDataTypeSupportVoteWitnessError(),this.checkSupportDelegateContractLockPeriod();const e=yield this.device.commands.typedCall("TronSignTx","TronSignedTx",Object.assign({},this.params));return Promise.resolve(e.message)}))}},nearGetAddress:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};fr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=He(e.path,3);fr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i})}))}getVersionRange(){return{model_mini:{min:"2.5.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("NearGetAddress","NearAddress",Object.assign({},r)),{address:n}=i.message,s={path:ze(r.address_n),address:n};e.push(s),this.postPreviousAddressMessage(s)}return yr(e,["address"],{expectedLength:this.params.length}),Promise.resolve(this.hasBundle?e:e[0])}))}},nearSignTransaction:class extends Xt{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"path",required:!0},{name:"rawTx",type:"hexString",required:!0}]);const{path:e,rawTx:t}=this.payload,r=He(e,3);this.params={address_n:r,raw_tx:ar(t)}}getVersionRange(){return{model_mini:{min:"2.5.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("NearSignTx","NearSignedTx",Object.assign({},this.params));return Promise.resolve(e.message)}))}},aptosGetAddress:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1,this.shouldConfirm=!1}init(){var e,t;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const r=this.hasBundle?this.payload:{bundle:[this.payload]};this.shouldConfirm=this.payload.showOnOneKey||(null===(t=this.payload.bundle)||void 0===t?void 0:t.some((e=>!!e.showOnOneKey))),fr(r,[{name:"bundle",type:"array"}]),this.params=[],r.bundle.forEach((e=>{var t;const r=He(e.path,3);fr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i})}))}publicKeyToAddress(e){const t=f.sha3_256.create();return t.update(lr(e)),t.update("\0"),`0x${l.bytesToHex(t.digest())}`}getVersionRange(){return{model_mini:{min:"2.6.0"}}}run(){var e,t,r;return A(this,void 0,void 0,(function*(){let i=[];if(tt(null===(e=this.device)||void 0===e?void 0:e.features)){const e=yield $r(this.device,this.params,"ed25519",637);for(let n=0;n<this.params.length;n++){const s=this.params[n],o=e.public_keys[n];let a;if(this.shouldConfirm){const e=yield this.device.commands.typedCall("AptosGetAddress","AptosAddress",s);a=null!==(r=null===(t=e.message.address)||void 0===t?void 0:t.toLowerCase())&&void 0!==r?r:""}else a=this.publicKeyToAddress(o);const d={path:ze(s.address_n),address:a,publicKey:o,pub:o};this.shouldConfirm&&this.postPreviousAddressMessage(d),i.push(d)}}else i=yield Promise.all(this.params.map((e=>A(this,void 0,void 0,(function*(){var t,r;const i=yield this.device.commands.typedCall("AptosGetAddress","AptosAddress",e),n={path:ze(e.address_n),address:null!==(r=null===(t=i.message.address)||void 0===t?void 0:t.toLowerCase())&&void 0!==r?r:""};return this.shouldConfirm&&this.postPreviousAddressMessage(n),n})))));return yr(i,["address"],{expectedLength:this.params.length}),this.hasBundle?i:i[0]}))}},aptosGetPublicKey:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};fr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=He(e.path,3);fr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i})}))}getVersionRange(){return{model_mini:{min:"2.6.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=(yield $r(this.device,this.params,"ed25519",637)).public_keys.map(((e,t)=>({path:ze(this.params[t].address_n),pub:e,publicKey:e})));return yr(e,["pub"],{expectedLength:this.params.length}),Promise.resolve(this.hasBundle?e:e[0])}))}},aptosSignTransaction:class extends Xt{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"path",required:!0},{name:"rawTx",type:"hexString",required:!0},{name:"transactionType",type:"number",required:!1}]);const{path:e,rawTx:t,transactionType:r}=this.payload,i=He(e,3);this.params={address_n:i,raw_tx:ar(t),tx_type:r}}getVersionRange(){return{model_mini:{min:"2.6.0"}}}getWithDataVersionRange(){return{pro:{min:"4.14.0"},model_classic1s:{min:"3.12.0"},classic:{min:"3.10.0"}}}checkWithDataError(){const{transactionType:e}=this.payload;this.checkFeatureVersionLimit((()=>1===e),(()=>this.getWithDataVersionRange()))}run(){return A(this,void 0,void 0,(function*(){this.checkWithDataError();const e=yield this.device.commands.typedCall("AptosSignTx","AptosSignedTx",Object.assign({},this.params));return Promise.resolve(e.message)}))}},aptosSignMessage:class extends Xt{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"path",required:!0},{name:"payload",type:"object",required:!0}]);const{path:e,payload:t}=this.payload,r=He(e,3);fr(t,[{name:"address",type:"string"},{name:"chainId",type:"string"},{name:"application",type:"string"},{name:"nonce",type:"string",required:!0},{name:"message",type:"string",required:!0}]),this.params={address_n:r,payload:{address:t.address,chain_id:t.chainId,application:t.application,nonce:t.nonce,message:t.message}}}getVersionRange(){return{model_mini:{min:"2.6.0"}}}run(){return A(this,void 0,void 0,(function*(){let e="APTOS\n";this.params.payload.address&&(e+=`address: ${this.params.payload.address}\n`),this.params.payload.application&&(e+=`application: ${this.params.payload.application}\n`),this.params.payload.chain_id&&(e+=`chainId: ${this.params.payload.chain_id}\n`),e+=`message: ${this.params.payload.message}\n`,e+=`nonce: ${this.params.payload.nonce}`;const t=yield this.device.commands.typedCall("AptosSignMessage","AptosMessageSignature",Object.assign({},this.params)),{address:r,signature:i}=t.message;return Promise.resolve({path:ze(this.params.address_n),address:r,signature:i,fullMessage:e})}))}},aptosSignInMessage:class extends Xt{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"path",required:!0},{name:"payload",type:"string",required:!0}]);const{path:e,payload:t}=this.payload,r=He(e,3);this.params={address_n:r,siwa_payload:t}}getVersionRange(){return{pro:{min:"4.16.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("AptosSignSIWAMessage","AptosMessageSignature",Object.assign({},this.params)),{address:t,signature:r}=e.message;return Promise.resolve({path:ze(this.params.address_n),address:t,signature:r})}))}},algoGetAddress:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};fr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=He(e.path,3);fr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i})}))}getVersionRange(){return{model_mini:{min:"2.6.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("AlgorandGetAddress","AlgorandAddress",Object.assign({},r)),{address:n}=i.message,s={path:ze(r.address_n),address:n};e.push(s),this.postPreviousAddressMessage(s)}return yr(e,["address"],{expectedLength:this.params.length}),Promise.resolve(this.hasBundle?e:e[0])}))}},algoSignTransaction:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode],fr(this.payload,[{name:"path",required:!0},{name:"rawTx",type:"hexString",required:!0}]);const{path:e,rawTx:t}=this.payload,r=He(e,3);this.params={address_n:r,raw_tx:ar(t)}}getVersionRange(){return{model_mini:{min:"2.6.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("AlgorandSignTx","AlgorandSignedTx",Object.assign({},this.params)),{signature:t}=e.message;return{path:ze(this.params.address_n),signature:t}}))}},cosmosGetAddress:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};fr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=He(e.path,3);fr(e,[{name:"path",required:!0},{name:"hrp",type:"string"},{name:"showOnOneKey",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t,{hrp:n}=e;this.params.push({address_n:r,hrp:n,show_display:i})}))}getVersionRange(){return{model_mini:{min:"2.10.0"},model_touch:{min:"4.0.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("CosmosGetAddress","CosmosAddress",Object.assign({},r)),{address:n}=i.message,s={path:ze(r.address_n),address:n};e.push(s),this.postPreviousAddressMessage(s)}return yr(e,["address"],{expectedLength:this.params.length}),Promise.resolve(this.hasBundle?e:e[0])}))}},cosmosGetPublicKey:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};if(fr(t,[{name:"bundle",type:"array"}]),0===t.bundle.length)throw new Error("Bundle is empty");this.params=[],t.bundle.forEach((e=>{var t,r;const i=He(e.path,3);fr(e,[{name:"path",required:!0},{name:"curve",type:"string"},{name:"showOnOneKey",type:"boolean"}]);const n=null===(t=e.showOnOneKey)||void 0===t||t,s=null!==(r=e.curve)&&void 0!==r?r:"secp256k1";if("secp256k1"!==s)throw new Error("Curve name is not supported");this.params.push({address_n:i,curve:s,show_display:n})}))}getVersionRange(){return{model_mini:{min:"2.10.0"},model_touch:{min:"4.0.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=(yield $r(this.device,this.params,this.params[0].curve,118)).public_keys.map(((e,t)=>({path:ze(this.params[t].address_n),pub:e,publicKey:e})));return yr(e,["pub"],{expectedLength:this.params.length}),Promise.resolve(this.hasBundle?e:e[0])}))}},cosmosSignTransaction:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode],fr(this.payload,[{name:"path",required:!0},{name:"rawTx",type:"hexString",required:!0}]);const{path:e,rawTx:t}=this.payload,r=He(e,3);this.params={address_n:r,raw_tx:ar(t)}}getVersionRange(){return{model_mini:{min:"2.10.0"},model_touch:{min:"4.0.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("CosmosSignTx","CosmosSignedTx",Object.assign({},this.params)),{signature:t}=e.message;return{path:ze(this.params.address_n),signature:t}}))}},xrpGetAddress:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1,this.shouldConfirm=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};this.shouldConfirm=!!this.hasBundle&&this.payload.bundle.some((e=>!!e.showOnOneKey)),fr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=He(e.path,3);fr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i})}))}getVersionRange(){return{model_mini:{min:"2.9.0"}}}run(){var e,t,r,i,n;return A(this,void 0,void 0,(function*(){if(this.hasBundle&&tt(null===(e=this.device)||void 0===e?void 0:e.features)&&!this.shouldConfirm){const e=(yield $r(this.device,this.params,"secp256k1",144)).public_keys.map(((e,t)=>({path:ze(this.params[t].address_n),address:y.deriveAddress(e),publicKey:e,pub:e})));return yr(e,["address","publicKey"],{expectedLength:this.params.length}),Promise.resolve(e)}const s=[];for(let e=0;e<this.params.length;e++){const o=this.params[e],a=yield this.device.commands.typedCall("RippleGetAddress","RippleAddress",Object.assign({},o)),d=yield this.device.commands.typedCall("BatchGetPublickeys","EcdsaPublicKeys",{paths:[{address_n:o.address_n}],ecdsa_curve_name:"secp256k1"}),{address:u}=a.message,l=ze(o.address_n);s.push({path:l,address:u,publicKey:null===(r=null===(t=d.message)||void 0===t?void 0:t.public_keys)||void 0===r?void 0:r[0],pub:null===(n=null===(i=d.message)||void 0===i?void 0:i.public_keys)||void 0===n?void 0:n[0]}),this.postPreviousAddressMessage({path:l,address:u})}return yr(s,["address","pub"],{expectedLength:this.params.length}),Promise.resolve(this.hasBundle?s:s[0])}))}},xrpSignTransaction:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE];const{payload:e}=this;fr(e,[{name:"path",required:!0},{name:"transaction",required:!0}]);const t=He(e.path,5),{transaction:r}=e;fr(r,[{name:"fee",type:"string"},{name:"flags",type:"number"},{name:"sequence",type:"number"},{name:"maxLedgerVersion",type:"number"},{name:"payment",type:"object"}]),fr(r.payment,[{name:"amount",type:"number",required:!0},{name:"destination",type:"string",required:!0},{name:"destinationTag",type:"number"}]),this.params={address_n:t,fee:r.fee,flags:r.flags,sequence:r.sequence,last_ledger_sequence:r.maxLedgerVersion,payment:{amount:r.payment.amount,destination:r.payment.destination,destination_tag:r.payment.destinationTag}}}getVersionRange(){return{model_mini:{min:"2.9.0"}}}run(){return A(this,void 0,void 0,(function*(){const{message:e}=yield this.device.commands.typedCall("RippleSignTx","RippleSignedTx",this.params);return{serializedTx:e.serialized_tx,signature:e.signature}}))}},suiGetAddress:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1,this.shouldConfirm=!1}init(){var e,t;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const r=this.hasBundle?this.payload:{bundle:[this.payload]};this.shouldConfirm=this.payload.showOnOneKey||(null===(t=this.payload.bundle)||void 0===t?void 0:t.some((e=>!!e.showOnOneKey))),fr(r,[{name:"bundle",type:"array"}]),this.params=[],r.bundle.forEach((e=>{var t;const r=He(e.path,3);fr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i})}))}getVersionRange(){return{model_mini:{min:"3.0.0"},model_touch:{min:"4.3.0"}}}run(){var e,t;return A(this,void 0,void 0,(function*(){let r=[];if(tt(null===(e=this.device)||void 0===e?void 0:e.features)){const e=yield $r(this.device,this.params,"ed25519",784);for(let i=0;i<this.params.length;i++){const n=this.params[i],s=e.public_keys[i];let o;if(this.shouldConfirm){const e=yield this.device.commands.typedCall("SuiGetAddress","SuiAddress",n);o=null===(t=e.message.address)||void 0===t?void 0:t.toLowerCase()}else o=_i(s);const a={path:ze(n.address_n),address:o,publicKey:s,pub:s};this.shouldConfirm&&this.postPreviousAddressMessage(a),r.push(a)}}else r=yield Promise.all(this.params.map((e=>A(this,void 0,void 0,(function*(){var t,r;const i=yield this.device.commands.typedCall("SuiGetAddress","SuiAddress",e),n={path:ze(e.address_n),address:null!==(r=null===(t=i.message.address)||void 0===t?void 0:t.toLowerCase())&&void 0!==r?r:""};return this.shouldConfirm&&this.postPreviousAddressMessage(n),n})))));return yr(r,["address"],{expectedLength:this.params.length}),this.hasBundle?r:r[0]}))}},suiGetPublicKey:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};fr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=He(e.path,3);fr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i})}))}getVersionRange(){return{model_mini:{min:"3.0.0"},model_touch:{min:"4.3.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=(yield $r(this.device,this.params,"ed25519",784)).public_keys.map(((e,t)=>({path:ze(this.params[t].address_n),publicKey:e,pub:e})));return yr(e,["pub"],{expectedLength:this.params.length}),Promise.resolve(this.hasBundle?e:e[0])}))}},suiSignMessage:class extends Xt{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"path",required:!0},{name:"messageHex",type:"hexString",required:!0}]);const{path:e,messageHex:t}=this.payload,r=He(e,3);this.params={address_n:r,message:nr(t)}}getVersionRange(){return{model_mini:{min:"3.4.0"},model_touch:{min:"4.6.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("SuiSignMessage","SuiMessageSignature",Object.assign({},this.params));return Promise.resolve(e.message)}))}},suiSignTransaction:class extends Xt{constructor(){super(...arguments),this.chunkByteSize=1024,this.processTxRequest=(e,t,r,i=0)=>A(this,void 0,void 0,(function*(){if("SuiSignedTx"===t.type)return t.message;const{data_length:n}=t.message;if(!n)return t.message;const s=r.subarray(i,i+n),o=i+s.length,a={data_chunk:l.bytesToHex(s)},d=yield e("SuiTxAck",["SuiSignedTx","SuiTxRequest"],Object.assign({},a));return this.processTxRequest(e,d,r,o)}))}init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"path",required:!0},{name:"rawTx",type:"hexString",required:!0}]);const{path:e,rawTx:t}=this.payload,r=He(e,3);this.params={address_n:r,raw_tx:ar(t)}}getVersionRange(){return{model_mini:{min:"3.0.0"},model_touch:{min:"4.3.0"}}}supportChunkTransfer(){const e=Ee(this.device.features),t=Oe(this.device.features).join(".");if(_e.model_mini.includes(e)){if(b.default.valid(t))return b.default.gte(t,"3.7.0")}else if(_e.model_touch.includes(e)&&b.default.valid(t))return b.default.gte(t,"4.8.0");return!1}run(){return A(this,void 0,void 0,(function*(){const e=this.device.getCommands().typedCall.bind(this.device.getCommands());let t,r=0;this.supportChunkTransfer()&&(r=this.chunkByteSize,t=Buffer.from(this.params.raw_tx,"hex"),this.params={address_n:this.params.address_n,raw_tx:"",data_initial_chunk:l.bytesToHex(t.subarray(0,this.chunkByteSize)),data_length:t.length});const i=yield e("SuiSignTx",["SuiSignedTx","SuiTxRequest"],Object.assign({},this.params));return this.processTxRequest(e,i,t,r)}))}},cardanoGetAddress:class extends Xt{init(){var e,t,r;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle),this.isCheck=this.hasBundle?!!(null===(t=this.payload)||void 0===t?void 0:t.bundle.every((e=>!!e.isCheck))):!!(null===(r=this.payload)||void 0===r?void 0:r.isCheck);const i=this.hasBundle?this.payload:{bundle:[this.payload]};this.params=i.bundle.map((e=>(fr(e,[{name:"addressParameters",type:"object",required:!0},{name:"networkId",type:"number",required:!0},{name:"protocolMagic",type:"number",required:!0},{name:"derivationType",type:"number"},{name:"address",type:"string"},{name:"showOnOneKey",type:"boolean"}]),wi(e.addressParameters),{address_parameters:Ti(e.addressParameters),address:e.address,protocol_magic:e.protocolMagic,network_id:e.networkId,derivation_type:void 0!==e.derivationType?e.derivationType:a.Messages.CardanoDerivationType.ICARUS,show_display:"boolean"!=typeof e.showOnOneKey||!!e.showOnOneKey})))}getVersionRange(){return{model_mini:{min:"3.0.0"},model_touch:{min:"4.1.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=[];for(const t of this.params){const{address_parameters:r,protocol_magic:i,network_id:n,derivation_type:s,show_display:o}=t,d=yield this.device.commands.typedCall("CardanoGetAddress","CardanoAddress",{address_parameters:r,protocol_magic:i,network_id:n,derivation_type:s,show_display:o});let u,l;if(r.address_type===a.Messages.CardanoAddressType.BASE&&!this.isCheck){u=(yield this.device.commands.typedCall("CardanoGetPublicKey","CardanoPublicKey",{address_n:r.address_n.slice(0,3),derivation_type:s,show_display:!1})).message.xpub;l=(yield this.device.commands.typedCall("CardanoGetAddress","CardanoAddress",{address_parameters:{address_type:a.Messages.CardanoAddressType.REWARD,address_n:[],address_n_staking:r.address_n_staking},protocol_magic:i,network_id:n,derivation_type:s,show_display:!1})).message.address}const c=ze(t.address_parameters.address_n);e.push({addressParameters:Ei(t.address_parameters),protocolMagic:t.protocol_magic,networkId:t.network_id,serializedPath:c,serializedStakingPath:ze(t.address_parameters.address_n_staking),address:d.message.address,xpub:u,stakeAddress:l}),this.postPreviousAddressMessage({path:c,address:d.message.address})}return yr(e,["serializedPath","serializedStakingPath","address"],{expectedLength:this.params.length}),this.hasBundle?e:e[0]}))}},cardanoGetPublicKey:class extends Xt{init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};fr(t,[{name:"bundle",type:"array"}]),this.params=t.bundle.map((e=>{fr(e,[{name:"path",required:!0},{name:"derivationType",type:"number"},{name:"showOnOneKey",type:"boolean"}]);return{address_n:He(e.path,3),derivation_type:void 0!==e.derivationType?e.derivationType:a.Messages.CardanoDerivationType.ICARUS,show_display:"boolean"==typeof e.showOnOneKey&&e.showOnOneKey}}))}getVersionRange(){return{model_mini:{min:"3.0.0"},model_touch:{min:"4.1.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=[],t=this.device.getCommands();for(let r=0;r<this.params.length;r++){const i=this.params[r],{message:n}=yield t.typedCall("CardanoGetPublicKey","CardanoPublicKey",i);e.push({path:i.address_n,serializedPath:ze(i.address_n),xpub:n.xpub,node:n.node})}return yr(e,["xpub"],{expectedLength:this.params.length}),this.hasBundle?e:e[0]}))}},cardanoSignTransaction:class extends Xt{constructor(){super(...arguments),this.hasConway=()=>{var e,t;const r=this.payload;if(!0===r.tagCborSets)return!0;if(null!=(null===(e=r.auxiliaryData)||void 0===e?void 0:e.cVoteRegistrationParameters))return!0;for(const e of null!==(t=r.certificates)&&void 0!==t?t:[]){if(null!=e.dRep)return!0;if(null!=e.deposit)return!0;if(e.type===a.Messages.CardanoCertificateType.STAKE_REGISTRATION_CONWAY||e.type===a.Messages.CardanoCertificateType.STAKE_DEREGISTRATION_CONWAY||e.type===a.Messages.CardanoCertificateType.VOTE_DELEGATION)return!0}return!1},this.supportConwayVersionRange=()=>({pro:{min:"4.12.0"},touch:{min:"4.10.0"},classic:{min:"3.10.0"}}),this.checkSupportConway=()=>{var e;if(!this.hasConway())return;const t=null===(e=Oe(this.device.features))||void 0===e?void 0:e.join("."),r=Ie(this.device.features,(e=>this.supportConwayVersionRange()[e]));if(r&&(!b.default.valid(t)||b.default.lt(t,r.min)))throw n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodNeedUpgradeFirmware,`Device firmware version is too low, please update to ${r.min}`,{current:t,require:r.min})}}getVersionRange(){return{model_mini:{min:"3.0.0"},model_touch:{min:"4.1.0"}}}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const{payload:t}=this;t.auxiliaryData&&t.auxiliaryData.governanceRegistrationParameters&&(console.warn("Please use cVoteRegistrationParameters instead of governanceRegistrationParameters."),t.auxiliaryData.cVoteRegistrationParameters=t.auxiliaryData.governanceRegistrationParameters),fr(t,[{name:"signingMode",type:"number",required:!0},{name:"inputs",type:"array",required:!0},{name:"outputs",type:"array",required:!0,allowEmpty:!0},{name:"fee",type:"uint",required:!0},{name:"ttl",type:"uint"},{name:"certificates",type:"array",allowEmpty:!0},{name:"withdrawals",type:"array",allowEmpty:!0},{name:"mint",type:"array",allowEmpty:!0},{name:"validityIntervalStart",type:"uint"},{name:"scriptDataHash",type:"string"},{name:"collateralInputs",type:"array",allowEmpty:!0},{name:"requiredSigners",type:"array",allowEmpty:!0},{name:"totalCollateral",type:"uint"},{name:"referenceInputs",type:"array",allowEmpty:!0},{name:"protocolMagic",type:"number",required:!0},{name:"networkId",type:"number",required:!0},{name:"additionalWitnessRequests",type:"array",allowEmpty:!0},{name:"derivationType",type:"number"},{name:"includeNetworkId",type:"boolean"},{name:"chunkify",type:"boolean"},{name:"tagCborSets",type:"boolean"}]);const r=t.inputs.map(Si),i=t.outputs.map(Ci);let n=[];t.certificates&&(n=t.certificates.map(Bi));let s=[];t.withdrawals&&(s=t.withdrawals.map((e=>(fr(e,[{name:"amount",type:"uint",required:!0},{name:"scriptHash",type:"string"},{name:"keyHash",type:"string"}]),{path:e.path?He(e.path,5):void 0,amount:e.amount,script_hash:e.scriptHash,key_hash:e.keyHash}))));let o,d=[];t.mint&&(d=Ii(t.mint)),t.auxiliaryData&&(o=Li(t.auxiliaryData));let u=[];t.additionalWitnessRequests&&(u=t.additionalWitnessRequests.map((e=>He(e,3))));let l=[];t.collateralInputs&&(l=t.collateralInputs.map(Ai));let c=[];t.requiredSigners&&(c=t.requiredSigners.map((e=>(fr(e,[{name:"keyHash",type:"string"}]),{key_path:e.keyPath?He(e.keyPath,3):void 0,key_hash:e.keyHash}))));const p=t.collateralReturn?Ci(t.collateralReturn):void 0;let h=[];t.referenceInputs&&(h=t.referenceInputs.map(Ri)),this.params={signingMode:t.signingMode,inputsWithPath:r,outputsWithData:i,fee:t.fee,ttl:t.ttl,certificatesWithPoolOwnersAndRelays:n,withdrawals:s,mint:d,auxiliaryData:o,validityIntervalStart:t.validityIntervalStart,scriptDataHash:t.scriptDataHash,collateralInputsWithPath:l,requiredSigners:c,collateralReturnWithData:p,totalCollateral:t.totalCollateral,referenceInputs:h,protocolMagic:t.protocolMagic,networkId:t.networkId,witnessPaths:Fi(r,n,s,l,c,u,t.signingMode),additionalWitnessRequests:u,derivationType:void 0!==t.derivationType?t.derivationType:a.Messages.CardanoDerivationType.ICARUS,includeNetworkId:t.includeNetworkId,chunkify:t.chunkify,tagCborSets:t.tagCborSets}}signTx(){return A(this,void 0,void 0,(function*(){const e=this.device.getCommands().typedCall.bind(this.device.getCommands()),t=!!this.params.auxiliaryData,r={signing_mode:this.params.signingMode,protocol_magic:this.params.protocolMagic,network_id:this.params.networkId,inputs_count:this.params.inputsWithPath.length,outputs_count:this.params.outputsWithData.length,fee:this.params.fee,ttl:this.params.ttl,certificates_count:this.params.certificatesWithPoolOwnersAndRelays.length,withdrawals_count:this.params.withdrawals.length,has_auxiliary_data:t,validity_interval_start:this.params.validityIntervalStart,witness_requests_count:this.params.witnessPaths.length,minting_asset_groups_count:this.params.mint.length,script_data_hash:this.params.scriptDataHash,collateral_inputs_count:this.params.collateralInputsWithPath.length,required_signers_count:this.params.requiredSigners.length,has_collateral_return:null!=this.params.collateralReturnWithData,total_collateral:this.params.totalCollateral,reference_inputs_count:this.params.referenceInputs.length,derivation_type:this.params.derivationType,include_network_id:this.params.includeNetworkId,chunkify:this.params.chunkify,tag_cbor_sets:this.params.tagCborSets};yield e("CardanoSignTxInit","CardanoTxItemAck",r);for(const{input:t}of this.params.inputsWithPath)yield e("CardanoTxInput","CardanoTxItemAck",t);for(const t of this.params.outputsWithData)yield Pi(e,t);for(const{certificate:t,poolOwners:r,poolRelays:i}of this.params.certificatesWithPoolOwnersAndRelays){yield e("CardanoTxCertificate","CardanoTxItemAck",t);for(const t of r)yield e("CardanoPoolOwner","CardanoTxItemAck",t);for(const t of i)yield e("CardanoPoolRelayParameters","CardanoTxItemAck",t)}for(const t of this.params.withdrawals)yield e("CardanoTxWithdrawal","CardanoTxItemAck",t);let i;if(this.params.auxiliaryData){const{catalyst_registration_parameters:t}=this.params.auxiliaryData;t&&(this.params.auxiliaryData=ji(this.params.auxiliaryData));const{message:r}=yield e("CardanoTxAuxiliaryData","CardanoTxAuxiliaryDataSupplement",this.params.auxiliaryData),n=a.Messages.CardanoTxAuxiliaryDataSupplementType[r.type];n!==a.Messages.CardanoTxAuxiliaryDataSupplementType.NONE&&(i={type:n,auxiliaryDataHash:r.auxiliary_data_hash,cVoteRegistrationSignature:r.cvote_registration_signature,catalystSignature:r.cvote_registration_signature,governanceSignature:r.cvote_registration_signature}),yield e("CardanoTxHostAck","CardanoTxItemAck")}if(this.params.mint.length>0){yield e("CardanoTxMint","CardanoTxItemAck",{asset_groups_count:this.params.mint.length});for(const t of this.params.mint){yield e("CardanoAssetGroup","CardanoTxItemAck",{policy_id:t.policyId,tokens_count:t.tokens.length});for(const r of t.tokens)yield e("CardanoToken","CardanoTxItemAck",r)}}for(const{collateralInput:t}of this.params.collateralInputsWithPath)yield e("CardanoTxCollateralInput","CardanoTxItemAck",t);for(const t of this.params.requiredSigners)yield e("CardanoTxRequiredSigner","CardanoTxItemAck",t);this.params.collateralReturnWithData&&(yield Pi(e,this.params.collateralReturnWithData));for(const t of this.params.referenceInputs)yield e("CardanoTxReferenceInput","CardanoTxItemAck",t);const n=[];for(const t of this.params.witnessPaths){const{message:r}=yield e("CardanoTxWitnessRequest","CardanoTxWitnessResponse",{path:t});n.push({type:a.Messages.CardanoTxWitnessType[r.type],pubKey:r.pub_key,signature:r.signature,chainCode:r.chain_code})}const{message:s}=yield e("CardanoTxHostAck","CardanoTxBodyHash");return yield e("CardanoTxHostAck","CardanoSignTxFinished"),{hash:s.tx_hash,witnesses:n,auxiliaryDataSupplement:i}}))}run(){return this.checkSupportConway(),this.signTx()}},cardanoSignMessage:class extends Xt{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE];const{payload:e}=this;fr(e,[{name:"path",type:"string",required:!0},{name:"message",type:"string",required:!0},{name:"derivationType",type:"number"},{name:"networkId",type:"number",required:!0},{name:"addressType",type:"number"}]);const t=He(e.path,3);this.params={address_n:t,message:e.message,derivation_type:void 0!==e.derivationType?e.derivationType:a.Messages.CardanoDerivationType.ICARUS,network_id:e.networkId,address_type:e.addressType}}getVersionRange(){return{model_touch:{min:"4.10.0"}}}getAddressTypeVersionRange(){return{pro:{min:"4.9.3"}}}run(){return A(this,void 0,void 0,(function*(){this.checkFeatureVersionLimit((()=>null!==this.params.address_type&&void 0!==this.params.address_type),(()=>this.getAddressTypeVersionRange()));return(yield this.device.commands.typedCall("CardanoSignMessage","CardanoMessageSignature",this.params)).message}))}},filecoinGetAddress:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};fr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=He(e.path,3);fr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"},{name:"isTestnet",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i,testnet:e.isTestnet})}))}getVersionRange(){return{model_mini:{min:"2.10.0"},model_touch:{min:"3.5.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("FilecoinGetAddress","FilecoinAddress",Object.assign({},r)),{address:n}=i.message,s={path:ze(r.address_n),address:n};e.push(s),this.postPreviousAddressMessage(s)}return yr(e,["address"],{expectedLength:this.params.length}),Promise.resolve(this.hasBundle?e:e[0])}))}},filecoinSignTransaction:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode],fr(this.payload,[{name:"path",required:!0},{name:"rawTx",type:"hexString",required:!0},{name:"isTestnet",type:"boolean"}]);const{path:e,rawTx:t,isTestnet:r}=this.payload,i=He(e,3);this.params={address_n:i,raw_tx:ar(t),testnet:r}}getVersionRange(){return{model_mini:{min:"2.10.0"},model_touch:{min:"3.5.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("FilecoinSignTx","FilecoinSignedTx",Object.assign({},this.params)),{signature:t}=e.message;return{path:ze(this.params.address_n),signature:t}}))}},polkadotGetAddress:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};fr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=He(e.path,3);fr(e,[{name:"path",required:!0},{name:"prefix",required:!0},{name:"network",required:!0},{name:"showOnOneKey",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t,{prefix:n,network:s}=e;this.params.push({address_n:r,prefix:n,network:s,show_display:i})}))}getVersionRange(){return function(e){return e.includes(Ui.JoyStream)?Hi[Ui.JoyStream]:e.includes(Ui.Manta)?Hi[Ui.Manta]:zi}(this.params.map((e=>e.network)))}run(){return A(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("PolkadotGetAddress","PolkadotAddress",Object.assign({},r)),{address:n,public_key:s}=i.message,o=ze(r.address_n);e.push({path:o,address:n,pub:null!=s?s:"",publicKey:null!=s?s:""}),this.postPreviousAddressMessage({path:o,address:n})}return yr(e,["address","pub"],{expectedLength:this.params.length}),Promise.resolve(this.hasBundle?e:e[0])}))}},polkadotSignTransaction:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode],fr(this.payload,[{name:"path",required:!0},{name:"network",required:!0},{name:"rawTx",type:"hexString",required:!0}]);const{path:e,rawTx:t,network:r}=this.payload,i=He(e,3);this.params={address_n:i,network:r,raw_tx:ar(t)}}getVersionRange(){return function(e){var t;return null!==(t=Hi[e])&&void 0!==t?t:zi}(this.params.network)}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("PolkadotSignTx","PolkadotSignedTx",Object.assign({},this.params)),{signature:t}=e.message;return{path:ze(this.params.address_n),signature:t}}))}},kaspaGetAddress:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};fr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=He(e.path,3);fr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"},{name:"prefix",type:"string"},{name:"scheme",type:"string"},{name:"useTweak",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i,prefix:e.prefix,scheme:e.scheme,use_tweak:e.useTweak})}))}getVersionRange(){return{model_mini:{min:"3.0.0"},model_touch:{min:"4.3.0"}}}getUseTweakVersionRange(){return{pro:{min:"4.14.0"},model_classic1s:{min:"3.12.0"}}}run(){return A(this,void 0,void 0,(function*(){this.checkFeatureVersionLimit((()=>this.params.some((e=>!1===e.use_tweak))),(()=>this.getUseTweakVersionRange()),{strictCheckDeviceSupport:!0});const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("KaspaGetAddress","KaspaAddress",Object.assign({},r)),{address:n}=i.message,s={path:ze(r.address_n),address:n};e.push(s),this.postPreviousAddressMessage(s)}return yr(e,["address"],{expectedLength:this.params.length}),Promise.resolve(this.hasBundle?e:e[0])}))}},kaspaSignTransaction:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){var e,t,r,i,n;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE];const s=this.payload;fr(s,[{name:"version",type:"number"},{name:"sigHashType",type:"number",required:!0},{name:"inputs",type:"array",required:!0},{name:"outputs",type:"array",required:!0},{name:"lockTime",required:!0},{name:"sigOpCount",type:"number"},{name:"subNetworkID",type:"string"},{name:"useTweak",type:"boolean"}]);const o=s.inputs.map((e=>{var t;fr(e,[{name:"path",type:"string",required:!0},{name:"prevTxId",type:"string",required:!0},{name:"outputIndex",type:"number",required:!0},{name:"sequenceNumber",required:!0}]);const r=He(e.path,3);return Object.assign(Object.assign({},e),{path:r,sigOpCount:null!==(t=e.sigOpCount)&&void 0!==t?t:1})})),a=s.outputs.map((e=>{var t;return fr(e,[{name:"satoshis",required:!0},{name:"script",type:"string",required:!0},{name:"scriptVersion",type:"number"}]),Object.assign(Object.assign({},e),{scriptVersion:null!==(t=e.scriptVersion)&&void 0!==t?t:0})}));this.params=Object.assign(Object.assign({},s),{inputs:o,outputs:a,scheme:null!==(e=s.scheme)&&void 0!==e?e:"schnorr",prefix:null!==(t=s.prefix)&&void 0!==t?t:"kaspa",sigHashType:null!==(r=s.sigHashType)&&void 0!==r?r:Gi.SIGHASH_ALL|Gi.SIGHASH_FORKID,sigOpCount:null!==(i=s.sigOpCount)&&void 0!==i?i:1,subNetworkID:null!==(n=s.subNetworkID)&&void 0!==n?n:l.bytesToHex(Ji()),useTweak:s.useTweak})}getVersionRange(){return{model_mini:{min:"3.0.0"},model_touch:{min:"4.3.0"}}}getUseTweakVersionRange(){return{pro:{min:"4.14.0"},model_classic1s:{min:"3.12.0"}}}processTxRequest(e,t,r,i){var n;return A(this,void 0,void 0,(function*(){if("KaspaSignedTx"===t.type)return i.push({index:r,signature:t.message.signature}),i;if("KaspaTxInputRequest"===t.type){i.push({index:r,signature:null!==(n=t.message.signature)&&void 0!==n?n:""});const s=t.message.request_index,{raw:o}=nn(this.params,s),a=this.params.inputs[s],d=yield e("KaspaTxInputAck",["KaspaTxInputRequest","KaspaSignedTx"],{address_n:a.path,raw_message:l.bytesToHex(o)});return this.processTxRequest(e,d,s,i)}return i}))}run(){return A(this,void 0,void 0,(function*(){this.checkFeatureVersionLimit((()=>!1===this.params.useTweak),(()=>this.getUseTweakVersionRange()),{strictCheckDeviceSupport:!0});const{raw:e}=nn(this.params,0),t=this.params.inputs[0],{device:r,params:i}=this,n=yield r.commands.typedCall("KaspaSignTx",["KaspaTxInputRequest","KaspaSignedTx"],{address_n:t.path,raw_message:l.bytesToHex(e),scheme:i.scheme,prefix:i.prefix,input_count:i.inputs.length,use_tweak:i.useTweak});return this.processTxRequest(r.commands.typedCall.bind(r.commands),n,0,[])}))}},nexaGetAddress:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};fr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=He(e.path,3);fr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"},{name:"prefix",type:"string"},{name:"scheme",type:"string"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i,prefix:e.prefix,scheme:e.scheme})}))}getVersionRange(){return{model_mini:{min:"3.2.0"},model_touch:{min:"4.4.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("NexaGetAddress","NexaAddress",Object.assign({},r)),{address:n}=i.message,s={path:ze(r.address_n),pub:i.message.public_key,address:n};e.push(s),this.postPreviousAddressMessage(s)}return yr(e,["address","pub"],{expectedLength:this.params.length}),Promise.resolve(this.hasBundle?e:e[0])}))}},nexaSignTransaction:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){const e=this.payload;e.inputs.forEach((e=>(fr(e,[{name:"path",type:"string",required:!0},{name:"message",type:"string",required:!0},{name:"prefix",type:"string",required:!0}]),e))),this.params=e}getVersionRange(){return{model_mini:{min:"3.2.0"},model_touch:{min:"4.4.0"}}}processTxRequest(e,t,r,i){return A(this,void 0,void 0,(function*(){const{signature:s}=t.message;if(!s)throw n.ERRORS.TypedError(n.HardwareErrorCode.ResponseUnexpectTypeError,"signature is not valid");if("NexaSignedTx"===t.type)return i.push({index:r,signature:s}),i;if("NexaTxInputRequest"===t.type){i.push({index:r,signature:s});const n=t.message.request_index,o=this.params.inputs[n],a=yield e("NexaTxInputAck",["NexaTxInputRequest","NexaSignedTx"],{address_n:o.path,raw_message:o.message});return this.processTxRequest(e,a,n,i)}return i}))}run(){return A(this,void 0,void 0,(function*(){const{device:e,params:t}=this,r=t.inputs[0],i=yield e.commands.typedCall("NexaSignTx",["NexaTxInputRequest","NexaSignedTx"],{address_n:He(r.path,3),raw_message:r.message,prefix:r.prefix,input_count:t.inputs.length});return this.processTxRequest(e.commands.typedCall.bind(e.commands),i,0,[])}))}},nostrGetPublicKey:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=Object.prototype.hasOwnProperty.call(this.payload,"bundle");const e=this.hasBundle?this.payload:{bundle:[this.payload]};fr(e,[{name:"bundle",type:"array"}]),this.params=[],e.bundle.forEach((e=>{var t;const r=He(e.path,1);fr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i})}))}getVersionRange(){return{model_mini:{min:"3.6.0"},model_touch:{min:"4.7.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("NostrGetPublicKey","NostrPublicKey",Object.assign({},r)),n={path:ze(r.address_n),npub:i.message.npub,pub:i.message.publickey,publickey:i.message.publickey};e.push(n)}return Promise.resolve(this.hasBundle?e:e[0])}))}},nostrSignEvent:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE];const{payload:e}=this;if(!function(e){if(!(e instanceof Object))return!1;if("number"!=typeof e.kind)return!1;if("string"!=typeof e.content)return!1;if("number"!=typeof e.created_at)return!1;if(!Array.isArray(e.tags))return!1;for(let t=0;t<e.tags.length;t+=1){const r=e.tags[t];if(!Array.isArray(r))return!1;for(let e=0;e<r.length;e+=1)if("object"==typeof r[e])return!1}return!0}(e.event))throw n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodInvalidParameter,"Can't serialize event with wrong or missing properties");fr(e,[{name:"path",required:!0}]);const t=He(e.path,5);this.params={address_n:t,event:ur(Buffer.from(JSON.stringify(e.event,null,0),"utf-8"))}}getVersionRange(){return{model_mini:{min:"3.6.0"},model_touch:{min:"4.7.0"}}}run(){return A(this,void 0,void 0,(function*(){const{message:e}=yield this.device.commands.typedCall("NostrSignEvent","NostrSignedEvent",this.params);try{const t=Buffer.from(lr(e.event)).toString("utf-8"),r=JSON.parse(t);return{path:ze(this.params.address_n),rawTx:e.event,event:r}}catch(e){throw n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodError,"Failed to parse signed event",e)}}))}},nostrEncryptMessage:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE];const{payload:t}=this;fr(t,[{name:"path",required:!0},{name:"pubkey",required:!0,type:"string"},{name:"plaintext",required:!0,type:"string"},{name:"showOnOneKey",type:"boolean"}]);const r=He(t.path,5);this.params={address_n:r,pubkey:t.pubkey,msg:t.plaintext,show_display:null===(e=t.showOnOneKey)||void 0===e||e}}getVersionRange(){return{model_mini:{min:"3.6.0"},model_touch:{min:"4.7.0"}}}run(){return A(this,void 0,void 0,(function*(){const{message:e}=yield this.device.commands.typedCall("NostrEncryptMessage","NostrEncryptedMessage",this.params);return{path:ze(this.params.address_n),pubkey:this.params.pubkey,plaintext:this.params.msg,encryptedMessage:e.msg}}))}},nostrDecryptMessage:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE];const{payload:t}=this;fr(t,[{name:"path",required:!0},{name:"pubkey",required:!0,type:"string"},{name:"ciphertext",required:!0,type:"string"},{name:"showOnOneKey",type:"boolean"}]);const r=He(t.path,5);this.params={address_n:r,pubkey:t.pubkey,msg:t.ciphertext,show_display:null===(e=t.showOnOneKey)||void 0===e||e}}getVersionRange(){return{model_mini:{min:"3.6.0"},model_touch:{min:"4.7.0"}}}run(){return A(this,void 0,void 0,(function*(){const{message:e}=yield this.device.commands.typedCall("NostrDecryptMessage","NostrDecryptedMessage",this.params);return{path:ze(this.params.address_n),pubkey:this.params.pubkey,ciphertext:this.params.msg,decryptedMessage:e.msg}}))}},nostrSignSchnorr:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE];const{payload:e}=this;fr(e,[{name:"path",required:!0},{name:"hash",required:!0,type:"string"}]);const t=He(e.path,5);this.params={address_n:t,hash:e.hash}}getVersionRange(){return{model_mini:{min:"3.6.0"},model_touch:{min:"4.7.0"}}}run(){return A(this,void 0,void 0,(function*(){const{message:e}=yield this.device.commands.typedCall("NostrSignSchnorr","NostrSignedSchnorr",this.params);return{path:ze(this.params.address_n),rawHash:this.params.hash,signature:e.signature}}))}},lnurlAuth:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE];const{payload:e}=this;fr(e,[{name:"domain",type:"string",required:!0},{name:"k1",type:"string",required:!0}]),this.params={domain:ur(Buffer.from(e.domain,"utf-8")),data:ur(Buffer.from(e.k1,"hex"))}}getVersionRange(){return{model_mini:{min:"3.7.0"},model_touch:{min:"4.8.0"}}}run(){return A(this,void 0,void 0,(function*(){const{message:e}=yield this.device.commands.typedCall("LnurlAuth","LnurlAuthResp",this.params);return yr(e,["publickey","path"]),Object.assign(Object.assign({},e),{pub:e.publickey})}))}},nervosGetAddress:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};fr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=He(e.path,3);fr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"},{name:"network",type:"string"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i,network:e.network})}))}getVersionRange(){return{model_mini:{min:"3.7.0"},model_touch:{min:"4.9.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("NervosGetAddress","NervosAddress",Object.assign({},r)),{address:n}=i.message,s={path:ze(r.address_n),address:n};e.push(s),this.postPreviousAddressMessage(s)}return yr(e,["address"],{expectedLength:this.params.length}),Promise.resolve(this.hasBundle?e:e[0])}))}},nervosSignTransaction:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1,this.chunkByteSize=1024,this.processTxRequest=(e,t,r,i=0)=>A(this,void 0,void 0,(function*(){var n,s;if("NervosSignedTx"===t.type){if(!(null===(n=null==t?void 0:t.message)||void 0===n?void 0:n.signature))throw new Error("No signature returned");return Object.assign(Object.assign({},t.message),{path:ze(this.params.address_n)})}const{data_length:o}=t.message;if(!o){if(!(null===(s=null==t?void 0:t.message)||void 0===s?void 0:s.signature))throw new Error("No signature returned");return Object.assign(Object.assign({},t.message),{path:ze(this.params.address_n)})}const a=r.subarray(i,i+o),d=i+a.length,u={data_chunk:l.bytesToHex(a)},c=yield e("NervosTxAck",["NervosSignedTx","NervosTxRequest"],Object.assign({},u));return this.processTxRequest(e,c,r,d)}))}init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode],fr(this.payload,[{name:"path",required:!0},{name:"rawTx",type:"hexString",required:!0},{name:"witnessHex",type:"hexString",required:!0},{name:"network",type:"string",required:!0}]);const{path:e,rawTx:t,witnessHex:r,network:i}=this.payload,n=He(e,3);this.params={address_n:n,raw_tx:Buffer.from(ar(t),"hex"),witness_buffer:ar(r),network:i}}getVersionRange(){return{model_mini:{min:"3.7.0"},model_touch:{min:"4.9.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=this.params.raw_tx.length,t=e,r=this.params.raw_tx,i=this.device.getCommands().typedCall.bind(this.device.getCommands()),n=yield i("NervosSignTx","NervosSignedTx",{address_n:this.params.address_n,data_initial_chunk:l.bytesToHex(r.subarray(0,t)),data_length:e,witness_buffer:this.params.witness_buffer,network:this.params.network});return this.processTxRequest(i,n,r,t)}))}},dnxGetAddress:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};fr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=He(e.path,3);fr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i})}))}getVersionRange(){return{classic:{min:"3.8.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("DnxGetAddress","DnxAddress",Object.assign({},r)),{address:n}=i.message,s={path:ze(r.address_n),address:n};e.push(s),this.postPreviousAddressMessage(s)}return yr(e,["address"],{expectedLength:this.params.length}),Promise.resolve(this.hasBundle?e:e[0])}))}},dnxSignTransaction:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE];const{payload:e}=this,t=He(e.path,3);if(fr(e,[{name:"path",required:!0},{name:"inputs",type:"array",required:!0},{name:"toAddress",type:"string",required:!0},{name:"amount",required:!0},{name:"fee",required:!0},{name:"paymentIdHex",type:"string"}]),e.paymentIdHex&&64!==nr(e.paymentIdHex).length)throw new Error("Payment ID must be 32 bytes long");this.params={address_n:t,inputs_count:e.inputs.length,to_address:e.toAddress,amount:e.amount,fee:e.fee},e.paymentIdHex&&(this.params.payment_id=nr(e.paymentIdHex))}getVersionRange(){return{classic:{min:"3.8.0"}}}processTxRequest(e,t,r){var i,n;return A(this,void 0,void 0,(function*(){if("DnxInputRequest"===t.type){const{inputs:s}=this.payload,{request_index:o,tx_key:a,computed_key_image:d}=t.message;if((null==a?void 0:a.ephemeral_tx_sec_key)&&(null==a?void 0:a.ephemeral_tx_pub_key)&&(r=Object.assign(Object.assign({},r),{txKey:{ephemeralTxSecKey:a.ephemeral_tx_sec_key,ephemeralTxPubKey:a.ephemeral_tx_pub_key}})),(null==d?void 0:d.key_image)&&(r=Object.assign(Object.assign({},r),{computedKeyImages:[...null!==(i=r.computedKeyImages)&&void 0!==i?i:[],d.key_image]})),o){const t=s[o-1],i=yield e("DnxInputAck","DnxInputRequest",{prev_index:t.prevIndex,global_index:t.globalIndex,tx_pubkey:t.txPubkey,prev_out_pubkey:t.prevOutPubkey,amount:t.amount});return this.processTxRequest(e,i,r)}const u=yield e("DnxRTSigsRequest","DnxSignedTx",{});if(null==r.txKey||null==r.txKey.ephemeralTxSecKey||null==r.txKey.ephemeralTxPubKey)throw new Error("signatures or tx_key missing in response");return{path:ze(this.params.address_n),txKey:r.txKey,computedKeyImages:null!==(n=r.computedKeyImages)&&void 0!==n?n:[],signatures:u.message.signatures,outputKeys:u.message.output_keys}}throw new Error("Unexpected response")}))}run(){return A(this,void 0,void 0,(function*(){const e=this.device.getCommands().typedCall.bind(this.device.getCommands()),t=yield this.device.commands.typedCall("DnxSignTx","DnxInputRequest",Object.assign({},this.params));return this.processTxRequest(e,t,{})}))}},tonGetAddress:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1,this.shouldConfirm=!1}init(){var e;this.strictCheckDeviceSupport=!0,this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};this.shouldConfirm=!!this.hasBundle&&this.payload.bundle.some((e=>!!e.showOnOneKey)),fr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=He(e.path,3);fr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"},{name:"walletVersion"},{name:"isBounceable",type:"boolean"},{name:"isTestnetOnly",type:"boolean"},{name:"workchain"},{name:"walletId",type:"number"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i,wallet_version:e.walletVersion,is_bounceable:e.isBounceable,is_testnet_only:e.isTestnetOnly,workchain:e.workchain,wallet_id:e.walletId})}))}getVersionRange(){return{model_touch:{min:"4.10.0"},model_classic1s:{min:"3.10.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("TonGetAddress","TonAddress",Object.assign({},r)),{address:n,public_key:s}=i.message,o={path:ze(r.address_n),publicKey:s,pub:s,address:n};e.push(o),this.postPreviousAddressMessage(o)}return yr(e,["address","pub"],{expectedLength:this.params.length}),Promise.resolve(this.hasBundle?e:e[0])}))}},tonSignMessage:class extends Xt{constructor(){super(...arguments),this.initState=null,this.processTxRequest=(e,t)=>A(this,void 0,void 0,(function*(){if(!e.init_data_length){const t=Ee(this.device.features),r=_e.model_classic1s.includes(t),i=null==e.signning_message;return Promise.resolve(Object.assign(Object.assign({},e),{skip_validate:r||i}))}const[r,i]=si(t,2*e.init_data_length),n=yield this.device.commands.typedCall("TonTxAck","TonSignedMessage",{init_data_chunk:r});return this.processTxRequest(n.message,i)}))}init(){this.strictCheckDeviceSupport=!0,this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"path",required:!0},{name:"destination",type:"string"},{name:"jettonMasterAddress",type:"string"},{name:"jettonWalletAddress",type:"string"},{name:"tonAmount"},{name:"jettonAmount"},{name:"fwdFee"},{name:"comment",type:"string"},{name:"isRawData",type:"boolean"},{name:"mode",type:"number"},{name:"seqno",type:"number"},{name:"expireAt"},{name:"walletVersion"},{name:"walletId",type:"number"},{name:"workchain"},{name:"isBounceable",type:"boolean"},{name:"isTestnetOnly",type:"boolean"},{name:"extDestination",type:"array"},{name:"extTonAmount",type:"array"},{name:"extPayload",type:"array"},{name:"initState",type:"hexString"},{name:"signingMessageRepr",type:"hexString"}]);const{path:e}=this.payload,t=He(e,3);this.initState=or(ar(this.payload.initState));const r=null==this.initState?0:this.initState.length/2;this.params={address_n:t,destination:this.payload.destination,jetton_master_address:this.payload.jettonMasterAddress,jetton_wallet_address:this.payload.jettonWalletAddress,ton_amount:this.payload.tonAmount,fwd_fee:this.payload.fwdFee,comment:this.payload.comment,mode:this.payload.mode,is_raw_data:this.payload.isRawData,seqno:this.payload.seqno,expire_at:this.payload.expireAt,wallet_version:this.payload.walletVersion,wallet_id:this.payload.walletId,workchain:this.payload.workchain,is_bounceable:this.payload.isBounceable,is_testnet_only:this.payload.isTestnetOnly,ext_destination:this.payload.extDestination,ext_ton_amount:this.payload.extTonAmount,ext_payload:this.payload.extPayload,init_data_length:r,signing_message_repr:or(ar(this.payload.signingMessageRepr))}}getVersionRange(){return{model_touch:{min:"4.10.0"},model_classic1s:{min:"3.10.0"}}}getSupportJettonAmountBytesVersionRange(){return{pro:{min:"4.10.2"},model_classic1s:{min:"3.10.0"}}}checkSupportJettonAmountBytes(){var e;const t=null===(e=Oe(this.device.features))||void 0===e?void 0:e.join("."),r=Ie(this.device.features,(e=>this.getSupportJettonAmountBytesVersionRange()[e]));return!r||!(!b.default.valid(t)||!b.default.gte(t,r.min))}getFixCommentErrorVersionRange(){return{pro:{min:"4.10.1"},model_classic1s:{min:"3.10.0"}}}checkFixCommentError(){const{comment:e,jettonAmount:t}=this.payload;this.checkFeatureVersionLimit((()=>!o.isEmpty(e)&&null!=t),(()=>this.getFixCommentErrorVersionRange()))}getFixInitStateErrorVersionRange(){return{pro:{min:"4.13.0"},model_classic1s:{min:"3.12.0"}}}checkFixInitStateError(){const{initState:e,signingMessageRepr:t}=this.payload;this.checkFeatureVersionLimit((()=>!o.isEmpty(e)&&!o.isEmpty(t)),(()=>this.getFixInitStateErrorVersionRange()))}run(){var e;return A(this,void 0,void 0,(function*(){this.checkFixCommentError(),this.checkFixInitStateError();const{jettonAmount:t}=this.payload;t&&(this.checkSupportJettonAmountBytes()?this.params.jetton_amount_bytes=or(ar(new T.default(t).toString(16))):this.params.jetton_amount=t);let r=null!==(e=this.initState)&&void 0!==e?e:"";if(this.initState){const[e,t]=si(r,2048);this.params.init_data_initial_chunk=e,r=t}const i=this.device.getCommands().typedCall.bind(this.device.getCommands()),n=yield i("TonSignMessage","TonSignedMessage",Object.assign({},this.params));return this.processTxRequest(n.message,r)}))}},tonSignProof:class extends Xt{init(){this.strictCheckDeviceSupport=!0,this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"path",required:!0},{name:"appdomain",type:"string"},{name:"comment",type:"string"},{name:"expireAt"},{name:"walletVersion"},{name:"walletId",type:"number"},{name:"workchain"},{name:"isBounceable",type:"boolean"},{name:"isTestnetOnly",type:"boolean"}]);const{path:e}=this.payload,t=He(e,3);this.params={address_n:t,appdomain:this.payload.appdomain,comment:this.payload.comment,expire_at:this.payload.expireAt,wallet_version:this.payload.walletVersion,wallet_id:this.payload.walletId,workchain:this.payload.workchain,is_bounceable:this.payload.isBounceable,is_testnet_only:this.payload.isTestnetOnly}}getVersionRange(){return{model_touch:{min:"4.10.0"},model_classic1s:{min:"3.10.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("TonSignProof","TonSignedProof",Object.assign({},this.params));return Promise.resolve(e.message)}))}},scdoGetAddress:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};fr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=He(e.path,3);fr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i})}))}getVersionRange(){return{model_touch:{min:"4.10.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("ScdoGetAddress","ScdoAddress",Object.assign({},r)),{address:n}=i.message,s={path:ze(r.address_n),address:n};e.push(s),this.postPreviousAddressMessage(s)}return yr(e,["address"],{expectedLength:this.params.length}),Promise.resolve(this.hasBundle?e:e[0])}))}},scdoSignTransaction:class extends Xt{constructor(){super(...arguments),this.chunkByteSize=1024,this.processTxRequest=(e,t,r,i=0)=>A(this,void 0,void 0,(function*(){const{data_length:n}=t.message;if(!n)return t.message;const s=r.subarray(i,i+n),o=i+s.length,a={data_chunk:l.bytesToHex(s)},d=yield e("ScdoTxAck","ScdoSignedTx",Object.assign({},a));return this.processTxRequest(e,d,r,o)}))}init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"path",required:!0},{name:"nonce",required:!0},{name:"gasPrice",required:!0,type:"string"},{name:"gasLimit",required:!0,type:"string"},{name:"to",required:!0,type:"string"},{name:"value",required:!0,type:"string"},{name:"timestamp",required:!0,type:"string"},{name:"data",type:"hexString"},{name:"txType",type:"number"}]);const{path:e,nonce:t,gasPrice:r,gasLimit:i,to:n,value:s,timestamp:o,txType:a}=this.payload,d=He(e,3);this.params={address_n:d,nonce:or(ar(t)),gas_price:or(ar(r)),gas_limit:or(ar(i)),to:n,value:or(ar(s)),timestamp:o?or(ar(o)):void 0,tx_type:a}}getVersionRange(){return{model_touch:{min:"4.10.0"}}}run(){var e;return A(this,void 0,void 0,(function*(){const t=this.device.getCommands().typedCall.bind(this.device.getCommands()),r=null===(e=this.payload)||void 0===e?void 0:e.data,i=r&&Buffer.from(or(ar(r)),"hex"),n=this.chunkByteSize;i&&i.length>0&&(this.params.data_initial_chunk=l.bytesToHex(i.subarray(0,this.chunkByteSize)),this.params.data_length=i.length);const s=yield t("ScdoSignTx",["ScdoSignedTx"],Object.assign({},this.params));return this.processTxRequest(t,s,i,n)}))}},scdoSignMessage:class extends Xt{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"path",required:!0},{name:"messageHex",type:"hexString",required:!0}]);const{path:e,messageHex:t}=this.payload,r=He(e,3);this.params={address_n:r,message:nr(t)}}getVersionRange(){return{model_touch:{min:"4.10.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("ScdoSignMessage","ScdoSignedMessage",Object.assign({},this.params));return Promise.resolve(e.message)}))}},alephiumGetAddress:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};fr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t,r,i;const n=He(e.path,3);fr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"},{name:"includePublicKey",type:"boolean"},{name:"group",type:"number"}]);const s=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push(Object.assign({address_n:n,show_display:s,include_public_key:null!==(r=e.includePublicKey)&&void 0!==r&&r},null!==e.group&&{target_group:null!==(i=e.group)&&void 0!==i?i:0}))}))}getVersionRange(){return{model_touch:{min:"4.10.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=[];for(let t=0;t<this.params.length;t++){const r=this.params[t],i=yield this.device.commands.typedCall("AlephiumGetAddress","AlephiumAddress",Object.assign({},r)),{address:n}=i.message,s={path:ze(r.address_n),address:n,publicKey:r.include_public_key?i.message.public_key:void 0,pub:r.include_public_key?i.message.public_key:void 0,derivedPath:ze(i.message.derived_path)};e.push(s),this.postPreviousAddressMessage(s)}return yr(e,["address"],{expectedLength:this.params.length}),Promise.resolve(this.hasBundle?e:e[0])}))}},alephiumSignTransaction:class extends Xt{constructor(){super(...arguments),this.chunkByteSize=1024,this.processTxRequest=(e,t,r,i,s=0)=>A(this,void 0,void 0,(function*(){if("AlephiumSignedTx"===t.type)return t.message;const{data_length:o}=t.message;let a;if("AlephiumTxRequest"===t.type){if(!o)return t.message;const n=r.subarray(s,s+o),d=s+n.length,u={data_chunk:l.bytesToHex(n)};return a=yield e("AlephiumTxAck",["AlephiumSignedTx","AlephiumTxRequest","AlephiumBytecodeRequest"],Object.assign({},u)),this.processTxRequest(e,a,r,i,d)}if("AlephiumBytecodeRequest"===t.type){if(!(null==i?void 0:i.length))throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"scriptOpt is required");const t={bytecode_data:l.bytesToHex(i)};return a=yield e("AlephiumBytecodeAck",["AlephiumSignedTx","AlephiumBytecodeRequest"],Object.assign({},t)),this.processTxRequest(e,a,r,i,s)}throw n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,`Unknown response type: ${t.type}`)}))}init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"path",required:!0},{name:"rawTx",required:!0,type:"hexString"},{name:"scriptOpt",type:"string"}]);const{path:e}=this.payload,t=He(e,3);this.params={address_n:t,data_initial_chunk:"",data_length:0}}getVersionRange(){return{model_touch:{min:"4.10.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=this.device.getCommands().typedCall.bind(this.device.getCommands()),t=this.chunkByteSize,r=Buffer.from(this.payload.rawTx,"hex"),i=this.payload.scriptOpt&&Buffer.from(this.payload.scriptOpt,"hex");this.params={address_n:this.params.address_n,data_initial_chunk:l.bytesToHex(r.subarray(0,this.chunkByteSize)),data_length:r.length};const n=yield e("AlephiumSignTx",["AlephiumSignedTx","AlephiumTxRequest","AlephiumBytecodeRequest"],Object.assign({},this.params));return this.processTxRequest(e,n,r,i,t)}))}},alephiumSignMessage:class extends Xt{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"path",required:!0},{name:"messageHex",type:"hexString",required:!0},{name:"messageType",type:"string"}]);const{path:e,messageHex:t,messageType:r}=this.payload,i=He(e,3);this.params={address_n:i,message:nr(t),message_type:Buffer.from(null!=r?r:"alephium","utf-8").toString("hex")}}getVersionRange(){return{model_touch:{min:"4.10.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("AlephiumSignMessage","AlephiumMessageSignature",Object.assign({},this.params));return Promise.resolve(e.message)}))}},benfenGetAddress:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1,this.shouldConfirm=!1,this.strictCheckDeviceSupport=!0}init(){var e,t;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const r=this.hasBundle?this.payload:{bundle:[this.payload]};this.shouldConfirm=this.payload.showOnOneKey||(null===(t=this.payload.bundle)||void 0===t?void 0:t.some((e=>!!e.showOnOneKey))),fr(r,[{name:"bundle",type:"array"}]),this.params=[],r.bundle.forEach((e=>{var t;const r=He(e.path,3);fr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i})}))}getVersionRange(){return{pro:{min:"4.12.0"},model_classic1s:{min:"3.11.0"}}}run(){var e;return A(this,void 0,void 0,(function*(){let t=[];if(tt(null===(e=this.device)||void 0===e?void 0:e.features)){const e=yield $r(this.device,this.params,"ed25519",728);for(let r=0;r<this.params.length;r++){const i=this.params[r],n=e.public_keys[r];let s;if(this.shouldConfirm){s=(yield this.device.commands.typedCall("BenfenGetAddress","BenfenAddress",i)).message.address}else s=an(n);const o={path:ze(i.address_n),address:dn(s),pub:n};this.shouldConfirm&&this.postPreviousAddressMessage(o),t.push(o)}}else t=yield Promise.all(this.params.map((e=>A(this,void 0,void 0,(function*(){const t=yield this.device.commands.typedCall("BenfenGetAddress","BenfenAddress",e),r={path:ze(e.address_n),address:dn(t.message.address)};return this.shouldConfirm&&this.postPreviousAddressMessage(r),r})))));return yr(t,["address"],{expectedLength:this.params.length}),this.hasBundle?t:t[0]}))}},benfenGetPublicKey:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1,this.strictCheckDeviceSupport=!0}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};fr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=He(e.path,3);fr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i})}))}getVersionRange(){return{pro:{min:"4.12.0"},model_classic1s:{min:"3.11.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=(yield $r(this.device,this.params,"ed25519",728)).public_keys.map(((e,t)=>({path:ze(this.params[t].address_n),pub:e})));return yr(e,["pub"],{expectedLength:this.params.length}),Promise.resolve(this.hasBundle?e:e[0])}))}},benfenSignMessage:class extends Xt{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"path",required:!0},{name:"messageHex",type:"hexString",required:!0}]);const{path:e,messageHex:t}=this.payload,r=He(e,3);this.params={address_n:r,message:nr(t)}}getVersionRange(){return{pro:{min:"4.12.0"},model_classic1s:{min:"3.11.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=yield this.device.commands.typedCall("BenfenSignMessage","BenfenMessageSignature",Object.assign({},this.params));return Promise.resolve(e.message)}))}},benfenSignTransaction:class extends Xt{constructor(){super(...arguments),this.chunkByteSize=1024,this.processTxRequest=(e,t,r,i=0)=>A(this,void 0,void 0,(function*(){if("BenfenSignedTx"===t.type)return t.message;const{data_length:n}=t.message;if(!n)return t.message;const s=r.subarray(i,i+n),o=i+s.length,a={data_chunk:l.bytesToHex(new Uint8Array(s))},d=yield e("BenfenTxAck",["BenfenSignedTx","BenfenTxRequest"],Object.assign({},a));return this.processTxRequest(e,d,r,o)}))}init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],fr(this.payload,[{name:"path",required:!0},{name:"rawTx",type:"hexString",required:!0},{name:"coinType",type:"string",required:!1}]);const{path:e,rawTx:t,coinType:r}=this.payload,i=He(e,3);this.params=Object.assign({address_n:i,raw_tx:ar(t)},r&&{coin_type:ar(Buffer.from(r).toString("hex"))})}getVersionRange(){return{pro:{min:"4.12.0"},model_classic1s:{min:"3.11.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=this.device.getCommands().typedCall.bind(this.device.getCommands()),t=this.chunkByteSize,r=Buffer.from(this.params.raw_tx,"hex");this.params={address_n:this.params.address_n,coin_type:this.params.coin_type,raw_tx:"",data_initial_chunk:l.bytesToHex(new Uint8Array(r.buffer).subarray(0,this.chunkByteSize)),data_length:r.length};const i=yield e("BenfenSignTx",["BenfenSignedTx","BenfenTxRequest"],Object.assign({},this.params));return this.processTxRequest(e,i,r,t)}))}},neoGetAddress:class extends Xt{constructor(){super(...arguments),this.hasBundle=!1}init(){var e;this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.strictCheckDeviceSupport=!0,this.hasBundle=!!(null===(e=this.payload)||void 0===e?void 0:e.bundle);const t=this.hasBundle?this.payload:{bundle:[this.payload]};fr(t,[{name:"bundle",type:"array"}]),this.params=[],t.bundle.forEach((e=>{var t;const r=He(e.path,3);fr(e,[{name:"path",required:!0},{name:"showOnOneKey",type:"boolean"}]);const i=null===(t=e.showOnOneKey)||void 0===t||t;this.params.push({address_n:r,show_display:i})}))}getVersionRange(){return{pro:{min:"4.12.0"},model_classic1s:{min:"3.11.0"}}}run(){var e,t;return A(this,void 0,void 0,(function*(){const r=[];for(let i=0;i<this.params.length;i++){const n=this.params[i],s=yield this.device.commands.typedCall("NeoGetAddress","NeoAddress",Object.assign({},n)),o=ze(n.address_n);r.push({path:o,address:null!==(e=s.message.address)&&void 0!==e?e:"",pub:null!==(t=s.message.public_key)&&void 0!==t?t:""}),this.postPreviousAddressMessage({address:s.message.address,path:o})}return yr(r,["address"],{expectedLength:this.params.length}),Promise.resolve(this.hasBundle?r:r[0])}))}},neoSignTransaction:class extends Xt{init(){this.checkDeviceId=!0,this.allowDeviceMode=[...this.allowDeviceMode,vt.NOT_INITIALIZE],this.strictCheckDeviceSupport=!0,fr(this.payload,[{name:"path",required:!0},{name:"rawTx",type:"hexString",required:!0},{name:"magicNumber",type:"number",required:!0}]);const{path:e,rawTx:t,magicNumber:r}=this.payload,i=He(e,3);this.params={address_n:i,raw_tx:ar(t),network_magic:r}}getVersionRange(){return{pro:{min:"4.12.0"},model_classic1s:{min:"3.11.0"}}}run(){return A(this,void 0,void 0,(function*(){const e=this.device.getCommands().typedCall.bind(this.device.getCommands());this.params={address_n:this.params.address_n,raw_tx:this.params.raw_tx,network_magic:this.params.network_magic};const t=yield e("NeoSignTx",["NeoSignedTx"],Object.assign({},this.params));return{signature:t.message.signature,publicKey:t.message.public_key}}))}}});function ln(e){const{method:t}=e.payload;if("string"!=typeof t)throw n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodInvalidParameter,"Method is not set");const r=un[t];if(r)return new r(e);throw n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodInvalidParameter,`Method ${t} is not set`)}const cn=le(t.d3.DeviceConnector);class pn{constructor(){this.listenTimestamp=0,this.current=null,this.upcoming=[],this.listening=!1,jt.load(),this.transport=jt.getTransport(),Pt.setConnector(this)}enumerate(){return A(this,void 0,void 0,(function*(){try{const e=yield this.transport.enumerate();return this.upcoming=e,this._reportDevicesChange(),{descriptors:e}}catch(e){gr(e)}}))}listen(){return A(this,void 0,void 0,(function*(){const e=null!==this.current,t=this.current||[];let r;this.listening=!0;try{if(cn.debug("Start listening",t),this.listenTimestamp=(new Date).getTime(),r=e?yield this.transport.listen(t):yield this.transport.enumerate(),!this.listening)return;this.upcoming=r,cn.debug("Listen result",r),this._reportDevicesChange(),this.listening&&this.listen()}catch(e){const t=(new Date).getTime()-this.listenTimestamp;cn.debug("Listen error","timestamp",t,typeof e),t>1100?(yield(i=1e3,n=null,new Promise((e=>{setTimeout(e,i,n)}))),this.listening&&this.listen()):cn.warn("Transport error")}var i,n}))}stop(){this.listening=!1}acquire(e,t,r){return A(this,void 0,void 0,(function*(){cn.debug("acquire",e,t);const i=Ye.getSettings("env");try{let n;return n=Ye.isBleConnect(i)?yield this.transport.acquire({uuid:e,forceCleanRunPromise:r}):yield this.transport.acquire({path:e,previous:null!=t?t:null}),n}catch(e){cn.error("acquire error: ",e.message),gr(e)}}))}release(e,t){return A(this,void 0,void 0,(function*(){try{return yield this.transport.release(e,t)}catch(e){gr(e)}}))}promptDeviceAccess(){return this.transport.promptDeviceAccess?this.transport.promptDeviceAccess():Promise.resolve(null)}_reportDevicesChange(){Pt.reportDeviceChange(this.upcoming)}}const hn=le(t.d3.Core);class fn{constructor(){this.requestQueue=new Map,this.pendingCallbackTasks=new Map,this.generateRequestId=e=>e&&null!=e.responseID?e.responseID:Date.now()}createTask(e){const t=this.generateRequestId(e);e&&e.responseID!==t&&(e.responseID=t);const r={id:t,method:e,abortController:new AbortController};return this.requestQueue.set(t,r),r}getTask(e){return this.requestQueue.get(e)}getAbortController(e){var t;return null===(t=this.requestQueue.get(e))||void 0===t?void 0:t.abortController}abortRequest(e){const t=this.requestQueue.get(e);return!!(null==t?void 0:t.abortController)&&(hn.debug(`Aborting request ${e}`),t.abortController.abort(),!0)}abortRequestsByConnectId(e){let t=0;return this.requestQueue.forEach(((r,i)=>{r.abortController&&r.method.connectId===e&&(r.abortController.abort(),r.abortController=void 0,t++)})),t}abortAllRequests(){let e=0;return this.requestQueue.forEach((t=>{t.abortController&&(t.abortController.abort(),e++)})),e}getRequestTasksId(){return Array.from(this.requestQueue.keys())}resolveRequest(e,t){var r;const i=this.requestQueue.get(e);i&&(null===(r=i.callPromise)||void 0===r||r.resolve(t)),this.releaseTask(e)}rejectRequest(e,t){var r;const i=this.requestQueue.get(e);i&&(null===(r=i.callPromise)||void 0===r||r.reject(t)),this.releaseTask(e)}releaseTask(e){this.requestQueue.delete(e)}registerPendingCallbackTask(e,t){this.pendingCallbackTasks.set(e,t),t.promise.finally((()=>{hn.debug(`Callback task completed for connectId: ${e}`),this.pendingCallbackTasks.delete(e)}))}waitForPendingCallbackTasks(e){return A(this,void 0,void 0,(function*(){const t=this.pendingCallbackTasks.get(e);t&&(hn.debug(`Waiting for pending callback task to complete for connectId: ${e}`),yield t.promise)}))}cancelCallbackTasks(e){const t=this.pendingCallbackTasks.get(e);t&&t.resolve()}}const yn=e=>{const t=null!=e?e:(()=>{const e=Symbol(),t={};return(r=e)=>A(void 0,void 0,void 0,(function*(){for(;t[r];)yield t[r];let e=()=>{};return t[r]=new Promise((t=>{e=t})).finally((()=>{delete t[r]})),e}))})();return(e,r)=>t(r).then((t=>Promise.resolve().then(e).finally(t)))},gn=le(t.d3.Core);function mn(e){var t;return!!(e.name.startsWith("allNetworkGetAddress")&&e.payload&&e.payload.bundle&&e.payload.bundle.some((e=>e&&"ada"===e.network)))||(e.name.startsWith("cardano")||(null===(t=e.payload)||void 0===t?void 0:t.deriveCardano))}const vn=e=>({initSession:null==e?void 0:e.payload.initSession,passphraseState:null==e?void 0:e.payload.passphraseState,deviceId:null==e?void 0:e.payload.deviceId,deriveCardano:e&&mn(e)});let bn,_n,wn,Tn=[];const En=new Map;let Sn=1;const An={};let Rn={passphraseState:void 0};const Mn=(e,t)=>A(void 0,void 0,void 0,(function*(){const r=e();if(r){gn.debug("pre pending call promise before call method, wait for it");try{yield(i=r,n=5e3,A(void 0,void 0,void 0,(function*(){const e=new Promise(((e,t)=>{setTimeout((()=>t(new Error("Request timeout"))),n)}));return Promise.race([i,e])})))}catch(e){}null==t||t(r),gn.debug("pre pending call promise before call method done")}var i,n})),In=(e,t,r)=>A(void 0,void 0,void 0,(function*(){var i,s;let o;const{requestQueue:a,getPrePendingCallPromise:d,setPrePendingCallPromise:u}=e,l=Rn.passphraseState!==r.payload.passphraseState;Rn={passphraseState:r.payload.passphraseState},(l||r.payload.initSession)&&(gn.debug("passphrase state change, clear device cache"),Pt.clearDeviceCache(r.payload.connectId)),r.connectId&&(yield e.waitForCallbackTasks(r.connectId)),yield Mn(d,u);const c=a.createTask(r);let p;try{An[Sn]&&(An[Sn]=!1),Sn+=1,p=yield Cn(e,r,Sn,null===(i=c.abortController)||void 0===i?void 0:i.signal)}catch(e){return console.log("ensureConnected error: ",e),"AbortError"===e.name||"Request aborted"===e.message?(a.releaseTask(r.responseID),Et(r.responseID,!1,{error:n.ERRORS.TypedError(n.HardwareErrorCode.ActionCancelled,"Request cancelled by user")})):(a.releaseTask(r.responseID),Et(r.responseID,!1,{error:e}))}gn.debug("Call API - setDevice: ",p.mainId),null===(s=r.setDevice)||void 0===s||s.call(r,p),r.context=e,p.on(Rt.PIN,jn),p.on(Rt.BUTTON,Fn),p.on(Rt.PASSPHRASE,t.payload.useEmptyPassphrase?Hn:zn),p.on(Rt.PASSPHRASE_ON_DEVICE,Gn),p.on(Rt.FEATURES,Un),p.on(Rt.SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE,Kn);try{r.connectId&&(yield e.waitForCallbackTasks(r.connectId)),yield Mn(d,u);const t=()=>A(void 0,void 0,void 0,(function*(){var e,t,i,s,d;const u=Ie(p.features,(e=>r.getVersionRange()[e]));if(p.features){if(yield Ye.checkAndReloadData(),yt(p.features)){const e=(e=>{if(!yt(e))return null;const t=Re(e),r=Ee(e);return{serialNo:t,seVersion:e.se_ver,deviceType:r||"Unknown"}})(p.features);if(e)throw n.createDefectiveFirmwareError(e.serialNo,e.seVersion||"Unknown",e.deviceType,r.connectId,r.deviceId)}const e=Ye.getFirmwareStatus(p.features),t=Ye.getBLEFirmwareStatus(p.features),i=Oe(p.features).join("."),s=xe(p.features).join(".");if(("required"===e||"required"===t)&&!1===r.skipForceUpdateCheck){const o={firmware:i,ble:s},a=[];throw"required"===e&&a.push("firmware"),"required"===t&&a.push("ble"),n.createNewFirmwareForceUpdateHardwareError(r.connectId,r.deviceId,a,o)}if(u){if(b.default.valid(u.min)&&b.default.lt(i,u.min)){if("none"===e||"valid"===e)throw n.createNewFirmwareUnReleaseHardwareError(i,u.min,r.name);return Promise.reject(n.createNeedUpgradeFirmwareHardwareError(i,u.min,r.name))}if(u.max&&b.default.valid(u.max)&&b.default.gte(i,u.max))return Promise.reject(n.createDeprecatedHardwareError(i,u.max,r.name))}else if(r.strictCheckDeviceSupport)throw n.ERRORS.TypedError(n.HardwareErrorCode.DeviceNotSupportMethod,`Method '${r.name}' is not supported by this device`)}const l=p.hasUnexpectedMode(r.allowDeviceMode,r.requireDeviceMode);if(l)return l===vt.NOT_IN_BOOTLOADER?Promise.reject(n.ERRORS.TypedError(n.HardwareErrorCode.RequiredButInBootloaderMode)):l===vt.BOOTLOADER?Promise.reject(n.ERRORS.TypedError(n.HardwareErrorCode.NotAllowInBootloaderMode)):Promise.reject(n.ERRORS.TypedError(n.HardwareErrorCode.DeviceUnexpectedMode,l));if(r.deviceId&&r.checkDeviceId){if(!p.checkDeviceId(r.deviceId))return Promise.reject(n.ERRORS.TypedError(n.HardwareErrorCode.DeviceCheckDeviceIdError))}if(r.checkFirmwareRelease(),r.checkDeviceSupportFeature(),_n&&(yield jt.reconfigure(p.features)),Pn(r,p.features),p.hasUsePassphrase()&&r.useDevicePassphraseState){const s=(e=>{if(!e)return{support:!1};const t=Ee(e);if(t===n.EDeviceType.Touch||t===n.EDeviceType.Pro)return{support:!0};const r=Oe(e).join(".");return{support:b.default.gte(r,"2.4.0"),require:"2.4.0"}})(p.features);if(!s.support)return Promise.reject(n.ERRORS.TypedError(n.HardwareErrorCode.DeviceNotSupportPassphrase,`Device not support passphrase, please update to ${s.require}`,{require:s.require}));const o=yield p.checkPassphraseStateSafety(null===(e=r.payload)||void 0===e?void 0:e.passphraseState,null===(t=r.payload)||void 0===t?void 0:t.useEmptyPassphrase,null===(i=r.payload)||void 0===i?void 0:i.skipPassphraseCheck);if(Pn(r,p.features),!o)return Pt.clearDeviceCache(r.payload.connectId),Promise.reject(n.ERRORS.TypedError(n.HardwareErrorCode.DeviceCheckPassphraseStateError));Wn(_t(vt.CLOSE_UI_PIN_WINDOW))}try{yield r.checkSafetyLevelOnTestNet()}catch(e){throw e instanceof n.HardwareError?e:n.ERRORS.TypedError(n.HardwareErrorCode.RuntimeError,"open safety check failed.")}null===(d=null===(s=r.device)||void 0===s?void 0:s.commands)||void 0===d||d.checkDisposed();try{const e=yield r.run();gn.debug("Call API - Inner Method Run: "),o=Et(r.responseID,!0,e),a.resolveRequest(r.responseID,o)}catch(e){gn.debug("Call API - Inner Method Run Error: ",e),o=Et(r.responseID,!1,{error:e}),a.resolveRequest(r.responseID,o)}}));gn.debug("Call API - Device Run: ",p.mainId);const i=Object.assign({keepSession:r.payload.keepSession},vn(r)),s=()=>p.run(t,i);c.callPromise=n.createDeferred(s);try{return yield c.callPromise.promise}catch(e){return gn.debug("Device Run Error: ",e),Et(r.responseID,!1,{error:e})}}catch(e){o=Et(r.responseID,!1,{error:e}),a.rejectRequest(r.responseID,n.ERRORS.TypedError(n.HardwareErrorCode.CallMethodError,e.message)),gn.debug("Call API - Run Error: ",e)}finally{o&&r&&r.dispose(),a.releaseTask(r.responseID),Bn(),Dn(),Nn(p)}}));function On(e){var t;if(!_n)throw n.ERRORS.TypedError(n.HardwareErrorCode.DeviceListNotInitialized);let r;const i=_n.allDevices();if((null===(t=e.payload)||void 0===t?void 0:t.detectBootloaderDevice)&&i.some((e=>{var t;return null===(t=e.features)||void 0===t?void 0:t.bootloader_mode})))throw n.ERRORS.TypedError(n.HardwareErrorCode.DeviceDetectInBootloaderMode);if(e.connectId)r=_n.getDevice(e.connectId);else if(1===i.length)[r]=i;else if(i.length>1)throw n.ERRORS.TypedError(["firmwareUpdateV3","firmwareUpdateV2","checkFirmwareRelease","checkBootloaderRelease","checkBLEFirmwareRelease"].includes(e.name)?n.HardwareErrorCode.FirmwareUpdateLimitOneDevice:n.HardwareErrorCode.SelectDevice);if(!r){const t=Ye.getSettings("env");if(Ye.isWebUsbConnect(t))throw e.payload.skipWebDevicePrompt||Wn(_t(vt.WEB_DEVICE_PROMPT_ACCESS_PERMISSION)),n.ERRORS.TypedError(n.HardwareErrorCode.WebDeviceNotFoundOrNeedsPermission);throw n.ERRORS.TypedError(n.HardwareErrorCode.DeviceNotFound)}return r.deviceConnector=wn,r}let xn=0;function kn(e,t){return A(this,void 0,void 0,(function*(){try{yield t.acquire(),yield t.initialize(vn(e))}catch(r){if(!(r.errorCode===n.HardwareErrorCode.BleTimeoutError&&xn<=5))throw r;xn+=1,gn.debug(`Bletooth connect timeout and will retry, retry count: ${xn}`),yield ft(3e3),yield kn(e,t)}}))}const Cn=(e,t,r,i)=>A(void 0,void 0,void 0,(function*(){let e=0;const s=t.payload&&"number"==typeof t.payload.retryCount?t.payload.retryCount:5,o=t.payload&&t.payload.pollIntervalTime||1e3,a=t.payload&&t.payload.timeout||1e4;let d=null;gn.debug(`EnsureConnected function start, MAX_RETRY_COUNT=${s}, POLL_INTERVAL_TIME=${o} `);const u=(l=o)=>A(void 0,void 0,void 0,(function*(){return new Promise(((o,c)=>A(void 0,void 0,void 0,(function*(){const p=()=>!(!i||!i.aborted)&&(d&&clearTimeout(d),c(n.ERRORS.TypedError(n.HardwareErrorCode.ActionCancelled)),!0);if(p())return;if(!An[r])return gn.debug("EnsureConnected function stop, polling id: ",r),void c(n.ERRORS.TypedError(n.HardwareErrorCode.PollingStop));d&&clearTimeout(d),d=setTimeout((()=>{c(n.ERRORS.TypedError(n.HardwareErrorCode.PollingTimeout))}),a),e+=1,gn.debug("EnsureConnected function try count: ",e," poll interval time: ",l);try{yield function(e){return A(this,void 0,void 0,(function*(){const t=Ye.getSettings("env");Ye.isBleConnect(t)&&e.connectId?yield jt.configure():(_n||(_n=new Vt,yield jt.configure(),_n.connector=wn),yield _n.getDeviceLists(e.connectId,vn(e)))}))}(t)}catch(e){if(gn.debug("device list error: ",e),[n.HardwareErrorCode.BridgeNotInstalled,n.HardwareErrorCode.BridgeTimeoutError,n.HardwareErrorCode.BridgeNeedsPermission].includes(e.errorCode))return _n=void 0,void c(e);e.errorCode===n.HardwareErrorCode.TransportNotConfigured&&(yield jt.configure())}if(p())return;const h=Ye.getSettings("env");let f;try{if(f=Ye.isBleConnect(h)?function(e){if(!e.connectId&&!_n)throw n.ERRORS.TypedError(n.HardwareErrorCode.DeviceListNotInitialized);if(!e.connectId)return On(e);let t;return En.has(e.connectId)?t=En.get(e.connectId):(t=Wt.fromDescriptor({id:e.connectId}),En.set(e.connectId,t)),t.deviceConnector=wn,t}(t):On(t),f){if(d&&clearTimeout(d),Ye.isBleConnect(h)){if(xn=0,p())return;yield kn(t,f)}return void o(f)}}catch(e){if(gn.debug("device error: ",e),[n.HardwareErrorCode.BleCharacteristicNotifyChangeFailure].includes(e.errorCode)&&Wn(_t(vt.BLUETOOTH_CHARACTERISTIC_NOTIFY_CHANGE_FAILURE)),[n.HardwareErrorCode.BlePoweredOff,n.HardwareErrorCode.BleUnsupported,n.HardwareErrorCode.BlePermissionError,n.HardwareErrorCode.BleLocationError,n.HardwareErrorCode.BleLocationServicesDisabled,n.HardwareErrorCode.BleDeviceNotBonded,n.HardwareErrorCode.BleDeviceBondError,n.HardwareErrorCode.BleDeviceBondedCanceled,n.HardwareErrorCode.BleCharacteristicNotifyError,n.HardwareErrorCode.BleTimeoutError,n.HardwareErrorCode.BleWriteCharacteristicError,n.HardwareErrorCode.BleAlreadyConnected,n.HardwareErrorCode.FirmwareUpdateLimitOneDevice,n.HardwareErrorCode.SelectDevice,n.HardwareErrorCode.DeviceDetectInBootloaderMode,n.HardwareErrorCode.BleCharacteristicNotifyChangeFailure,n.HardwareErrorCode.WebDeviceNotFoundOrNeedsPermission,n.HardwareErrorCode.BridgeNeedsPermission].includes(e.errorCode))return void c(e)}return e>s?(d&&clearTimeout(d),gn.debug("EnsureConnected get to max try count, will return: ",e),void c(n.ERRORS.TypedError(n.HardwareErrorCode.DeviceNotFound))):p()?void 0:setTimeout((()=>o(u(1.5*l))),l)}))))}));return An[r]=!0,u()})),Pn=(e,t)=>{if(e.useDevicePassphraseState){if(!0===(null==t?void 0:t.passphrase_protection)){const t=null==e.payload.passphraseState||""===e.payload.passphraseState,r=!e.payload.useEmptyPassphrase&&!e.payload.skipPassphraseCheck;if(t&&r)throw Pt.clearDeviceCache(e.payload.connectId),n.ERRORS.TypedError(n.HardwareErrorCode.DeviceOpenedPassphrase)}if(!1===(null==t?void 0:t.passphrase_protection)&&e.payload.passphraseState)throw Pt.clearDeviceCache(e.payload.connectId),n.ERRORS.TypedError(n.HardwareErrorCode.DeviceNotOpenedPassphrase)}},Dn=()=>{Tn=[],gn.debug("Cleanup...")},Nn=e=>{e.removeAllListeners(),Pt.emitter.removeAllListeners(Rt.CONNECT)},Bn=()=>{Wn(_t(vt.CLOSE_UI_WINDOW))},qn=e=>{const t=Ye.getSettings("env"),r=Ye.isBleConnect(t)?e:e.toMessageObject();Wn(Mt(Rt.CONNECT,{device:r}))},Ln=e=>{const t=Ye.getSettings("env"),r=Ye.isBleConnect(t)?e:e.toMessageObject();Wn(Mt(Rt.DISCONNECT,{device:r}))},jn=(...[e,t,r])=>A(void 0,void 0,void 0,(function*(){gn.log("request Input PIN");const i=Vn(St.RECEIVE_PIN,e);Wn(_t(vt.REQUEST_PIN,{device:e.toMessageObject(),type:t}));const n=yield i.promise;r(null,n.payload)})),Fn=(...[e,t])=>{Wn(Mt(Rt.BUTTON,Object.assign(Object.assign({},t),{device:e.toMessageObject()}))),"ButtonRequest_PinEntry"===t.code||"ButtonRequest_AttachPin"===t.code?(gn.log("request Confirm Input PIN or Attach PIN"),Wn(_t(vt.REQUEST_PIN,{device:e.toMessageObject(),type:t.code}))):(gn.log("request Confirm Button"),Wn(_t(vt.REQUEST_BUTTON,{device:e.toMessageObject()})))},Un=(...[e,t])=>{Wn(Mt(Rt.FEATURES,Object.assign({},t)))},zn=(...[e,t,r])=>A(void 0,void 0,void 0,(function*(){gn.debug("onDevicePassphraseHandler");const i=Vn(St.RECEIVE_PASSPHRASE,e);Wn(_t(vt.REQUEST_PASSPHRASE,{device:e.toMessageObject(),passphraseState:e.passphraseState,existsAttachPinUser:t.existsAttachPinUser}));const n=yield i.promise,{value:s,passphraseOnDevice:o,save:a,attachPinOnDevice:d}=n.payload;r({passphrase:s.normalize("NFKD"),passphraseOnDevice:o,attachPinOnDevice:d,cache:a})})),Hn=(...[e,,t])=>{gn.debug("onEmptyPassphraseHandler"),t({passphrase:""})},Gn=(...[e])=>{Wn(_t(vt.REQUEST_PASSPHRASE_ON_DEVICE,{device:e.toMessageObject(),passphraseState:e.passphraseState}))},Kn=(...[e,t])=>A(void 0,void 0,void 0,(function*(){gn.debug("onSelectDeviceInBootloaderForWebDeviceHandler");const r=Vn(St.SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE,e);Wn(_t(vt.REQUEST_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE,{device:e.toMessageObject()}));const i=yield r.promise;t(null,i.payload.deviceId)})),Wn=e=>{bn.emit(gt,e)},Vn=(e,t)=>{const r=n.createDeferred(e,t);return Tn.push(r),r};class $n extends D.exports{constructor(){super(...arguments),this.requestQueue=new fn,this.methodSynchronize=yn()}getCoreContext(){return{requestQueue:this.requestQueue,methodSynchronize:this.methodSynchronize,getPrePendingCallPromise:()=>this.prePendingCallPromise,setPrePendingCallPromise:e=>{this.prePendingCallPromise=e},registerCallbackTask:(e,t)=>{this.requestQueue.registerPendingCallbackTask(e,t)},waitForCallbackTasks:e=>this.requestQueue.waitForPendingCallbackTasks(e),cancelCallbackTasks:e=>this.requestQueue.cancelCallbackTasks(e)}}handleMessage(e){var t,r,i,s;return A(this,void 0,void 0,(function*(){switch(e.type){case St.RECEIVE_PIN:case St.RECEIVE_PASSPHRASE:case St.SELECT_DEVICE_IN_BOOTLOADER_FOR_WEB_DEVICE:{const t=(a=e.type,Tn.find((e=>e.id===a)));t&&(gn.log("receive UI Response: ",e.type),t.resolve(e),o=t,Tn=Tn.filter((e=>e!==o)));break}case vt.BLUETOOTH_UNSUPPORTED:case vt.BLUETOOTH_POWERED_OFF:case vt.BLUETOOTH_PERMISSION:case vt.BLUETOOTH_CHARACTERISTIC_NOTIFY_CHANGE_FAILURE:case vt.LOCATION_PERMISSION:case vt.LOCATION_SERVICE_PERMISSION:Wn(e);break;case wt.CALL:{gn.log("call API: ",e);const o=yield((e,t)=>A(void 0,void 0,void 0,(function*(){if(!t.id||!t.payload||t.type!==wt.CALL)return Promise.reject(n.ERRORS.TypedError("on call: message.id or message.payload is missing"));let r;try{r=ln(t),r.connector=wn,r.postMessage=Wn,r.init()}catch(o){return Promise.reject(o)}if(Pt.emitter.on(Rt.CONNECT,qn),!r.useDevice)try{const e=yield r.run();return Et(r.responseID,!0,e)}catch(o){return Et(r.responseID,!1,{error:o})}const{requestQueue:i,methodSynchronize:s}=e,o=yield s((()=>{for(const e of i.getRequestTasksId()){const t=i.getTask(e);gn.debug("pre request task: ",`task?.id: ${null==t?void 0:t.id},\n task?.method.connectId: ${null==t?void 0:t.method.connectId},\n task?.method.deviceId: ${null==t?void 0:t.method.deviceId},\n task?.method.name: ${null==t?void 0:t.method.name}`)}return null}));return o?Et(r.responseID,!1,{error:o}):In(e,t,r)})))(this.getCoreContext(),e),{success:a,payload:d}=o;return gn.log("call API Response: ",o),a?o:Object.assign(Object.assign({},o),{payload:Object.assign(Object.assign({},d),{connectId:null!==(r=null===(t=e.payload)||void 0===t?void 0:t.connectId)&&void 0!==r?r:"",deviceId:null!==(s=null===(i=e.payload)||void 0===i?void 0:i.deviceId)&&void 0!==s?s:""})})}case wt.CANCEL:gn.log("cancel API: ",e),((e,t)=>{var r,i;const{requestQueue:s,setPrePendingCallPromise:o}=e;if(t)try{s.cancelCallbackTasks(t);const e=s.getRequestTasksId();gn.debug(`Cancel Api connect requestQueues: length:${e.length} requestIds:${e.join(",")}`);const i=[];for(const t of e){const e=s.getTask(t);if(gn.debug("Cancel Api connect task: ",e),e&&(null===(r=e.method)||void 0===r?void 0:r.device)){if(!i.includes(e.method.device)){const{device:t}=e.method;o(null==t?void 0:t.interruptionFromUser()),i.push(t)}s.rejectRequest(t,n.ERRORS.TypedError(n.HardwareErrorCode.ActionCancelled))}}s.abortRequestsByConnectId(t)}catch(e){gn.error("Cancel API Error: ",e)}else{const e=Ye.getSettings("env");if(Ye.isBleConnect(e)){gn.debug("Cancel Api all _deviceList: ");const e=[];for(const t of s.getRequestTasksId()){const r=s.getTask(t);if(gn.debug("Cancel Api connect task: ",r),r&&(null===(i=r.method)||void 0===i?void 0:i.device)){if(!e.includes(r.method.device)){const{device:t}=r.method;null==t||t.interruptionFromUser(),e.push(t)}s.rejectRequest(t,n.ERRORS.TypedError(n.HardwareErrorCode.ActionCancelled))}}}else null==_n||_n.allDevices().forEach((e=>{gn.debug("device: ",e," device.hasDeviceAcquire: ",e.hasDeviceAcquire()),e.hasDeviceAcquire()&&(null==e||e.interruptionFromUser())})),s.getRequestTasksId().forEach((e=>{s.rejectRequest(e,n.ERRORS.TypedError(n.HardwareErrorCode.ActionCancelled))}))}Dn(),Bn()})(this.getCoreContext(),e.payload.connectId);break;case wt.CALLBACK:gn.log("callback message: ",e),Wn(e)}var o,a;return Promise.resolve(e)}))}dispose(){}}const Zn=()=>(wn=new pn,Pt.emitter.on(Rt.DISCONNECT,Ln),wn);t.db=Rt,t._4=At,t.zi=It,t.NH=({init:e,call:t,dispose:r,eventEmitter:i,addHardwareGlobalEventListener:n,uiResponse:s,cancel:o,updateSettings:a,switchTransport:d})=>(({call:e,cancel:t,dispose:r,eventEmitter:i,init:n,uiResponse:s,updateSettings:o,switchTransport:a,addHardwareGlobalEventListener:d})=>Object.assign({addHardwareGlobalEventListener:d,removeAllListeners:e=>{i.removeAllListeners(e)},init:n,call:e,dispose:r,uiResponse:s,cancel:t,updateSettings:o,switchTransport:a,emit:()=>{}},C(e)))({init:e,call:t,dispose:r,eventEmitter:i,addHardwareGlobalEventListener:n,uiResponse:s,cancel:o,updateSettings:a,switchTransport:d}),t.O3=()=>(()=>{let e;const t=t=>e?e.call(t):Promise.resolve(void 0),r=Object.assign(Object.assign({on:(e,t)=>{Z.on(e,t)},emit:(e,...t)=>{Z.emit(e,...t)},off:(e,t)=>{Z.emit(e,t)},init:(t,r)=>{var i;return e=r,null!==(i=null==e?void 0:e.init(t))&&void 0!==i?i:Promise.resolve(!1)},call:t},C(t)),{removeAllListeners:t=>{Z.removeAllListeners(t),null==e||e.removeAllListeners(t)},dispose:()=>null==e?void 0:e.dispose(),uiResponse:t=>null==e?void 0:e.uiResponse(t),cancel:t=>null==e?void 0:e.cancel(t),updateSettings:t=>{var r;return null!==(r=null==e?void 0:e.updateSettings(t))&&void 0!==r?r:Promise.resolve(!1)},switchTransport:t=>{var r;return null!==(r=null==e?void 0:e.switchTransport(t))&&void 0!==r?r:Promise.resolve({success:!1})}});return r})(),t.P3=wt,t.i3=Y,t.Qk=kt,t.y2=mt,t.Pr=vt,t.Gy=e=>{let t={error:e.message,code:e.code};return e instanceof n.HardwareError&&(t={error:e.message,code:e.errorCode}),{success:!1,payload:t}},t.Ay=({init:e,call:t,dispose:r,eventEmitter:i,uiResponse:n,cancel:s,updateSettings:o,switchTransport:a})=>(({call:e,cancel:t,dispose:r,eventEmitter:i,init:n,updateSettings:s,switchTransport:o,uiResponse:a})=>Object.assign({on:(e,t)=>{i.on(e,t)},emit:()=>{},off:(e,t)=>{i.removeListener(e,t)},removeAllListeners:e=>{i.removeAllListeners(e)},init:n,call:e,dispose:r,uiResponse:a,cancel:t,updateSettings:s,switchTransport:o},C(e)))({init:e,call:t,dispose:r,eventEmitter:i,uiResponse:n,cancel:s,updateSettings:o,switchTransport:a}),t.sp=ie,t.bm=(e,...t)=>{const r=I.get(e);r&&r(...t)},t.tZ=le,t.h1=(e={})=>{const t=Object.assign({},ut);let i;Object.prototype.hasOwnProperty.call(e,"debug")&&(t.debug=e.debug),e.isFrame&&(t.parentOrigin=e.parentOrigin),"string"==typeof e.connectSrc&&(t.connectSrc=e.connectSrc),"undefined"!=typeof window?i=window.UKEY_CONNECT_SRC:void 0!==r.g&&(i=r.g.UKEY_CONNECT_SRC),"string"==typeof i&&(t.connectSrc=ct(i),t.debug=!0);const n=t.connectSrc||at;return t.iframeSrc=`${n}iframe.html`,e.transportReconnect&&(t.transportReconnect=e.transportReconnect),e.lazyLoad&&(t.lazyLoad=e.lazyLoad),"string"==typeof e.env?t.env=e.env:t.env=lt(),e.timestamp&&(t.timestamp=e.timestamp),e.preRelease&&(t.preRelease=e.preRelease),e.fetchConfig&&(t.fetchConfig=e.fetchConfig),t},t.vY=e=>{const{data:t}=e,r={event:t.event,type:t.type,payload:t.payload};return"number"==typeof e.id&&(r.id=e.id),"boolean"==typeof r.success&&(r.success=t.success),r},t.ao=se,t.qX=[{origin:"file://"},{origin:"1key.so"},{origin:"onekey.so"},{origin:"onekeycn.com"},{origin:"onekeytest.com"},{origin:"localhost"}]},8219:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=r(958),n=r(1219),s=r(2943),o=r(1048);function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function d(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var u=d(i),l=d(n),c=a(s);"function"==typeof SuppressedError&&SuppressedError;const p=["bool","string","bytes","int32","int64","uint32","uint64","sint32","sint64","fixed32","fixed64","sfixed32","sfixed64","double","float"],h=e=>p.includes(e),f=(e,t)=>(null==e?void 0:e.optional)&&void 0===t?null:"bytes"===(null==e?void 0:e.type)?c.default.wrap(t).toString("hex"):(null==e?void 0:e.long)?Number.isSafeInteger(t.toNumber())?t.toNumber():t.toString():t;function y(e,t){const r=function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(e);n<i.length;n++)t.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(e,i[n])&&(r[i[n]]=e[i[n]])}return r}(e,[]),i={};return Object.keys(t).forEach((e=>{const n=t[e],s=r[e];if(n.repeated)if(h(n.type))i[e]=s.map((e=>f(n,e)));else if("valuesById"in n.resolvedType)i[e]=s;else{if(!("fields"in n.resolvedType))throw new Error(`case not handled for repeated key: ${e}`);i[e]=s.map((e=>y(e,n.resolvedType.fields)))}else if(h(n.type))i[e]=f(n,s);else if("valuesById"in n.resolvedType)i[e]=n.resolvedType.valuesById[s];else{if(!n.resolvedType.fields)throw new Error(`case not handled: ${e}`);i[e]=y(s,n.resolvedType.fields)}})),i}const g=(e,t)=>{if("bytes"===e)return"string"!=typeof t||t?o.Buffer.from(t,"hex"):t;if("number"==typeof t&&!Number.isSafeInteger(t))throw new RangeError("field value is not within safe integer range");return t};function m(e,t){const r={};return e.fields?(Object.keys(e.fields).forEach((i=>{const n=e.fields[i],s=t[i];if(void 0!==s)if(n&&h(n.type))n.repeated?r[i]=s.map((e=>g(n.type,e))):r[i]=g(n.type,s);else if(n.repeated){const t=e.lookupTypeOrEnum(n.type);r[i]=s.map((e=>m(t,e)))}else if("object"==typeof s&&null!==s){const t=e.lookupType(n.type);r[i]=m(t,s)}else if("number"==typeof s){const t=e.lookupEnum(n.type);r[i]=t.values[s]}else r[i]=s})),r):r}const v=(e,t)=>{const r=m(e,t),i=e.fromObject(r),n=e.encode(i).finish(),s=new c.default(n.byteLength);return s.append(n),s.reset(),s};const b=(e,t)=>{const r=e.lookupType(t);let i=e.lookupEnum("MessageType").values[`MessageType_${t}`];return!i&&r.options&&(i=r.options["(wire_type)"]),{Message:r,messageType:i}},_=35,w=8,T=63,E=e=>{const{typeId:t}=(e=>({typeId:e.readUint16(),length:e.readUint32()}))(e);return{typeId:t,buffer:e}};var S=Object.freeze({__proto__:null,decode:E,decodeChunked:e=>{const t=c.default.wrap(e,void 0,void 0,!0),{sharp1:r,sharp2:i,typeId:n,length:s}=(e=>({sharp1:e.readByte(),sharp2:e.readByte(),typeId:e.readUint16(),length:e.readUint32()}))(t);if(r!==_||i!==_)throw new Error("Didn't receive expected header signature.");return{length:s,typeId:n,restBuffer:t}}});function A(e,t){const{addTrezorHeaders:r,chunked:i,messageType:n}=t,s=(r?w:w-2)+e.limit,o=new c.default(s);if(r&&(o.writeByte(_),o.writeByte(_)),o.writeUint16(n),o.writeUint32(e.limit),o.append(e.buffer),o.reset(),!1===i)return o;const a=[],d=T,u=Math.floor((o.limit-1)/d)+1||1;for(let e=0;e<u;e++){const t=e*d,r=Math.min((e+1)*d,o.limit),i=o.slice(t,r);i.compact(),a.push(i.buffer)}return a}const R=(e,t,r)=>{const{Message:i,messageType:n}=b(e,t);return A(v(i,r),{addTrezorHeaders:!0,chunked:!0,messageType:n})};const M="Wrong result type.";function I(e){if(null==e)return null;if("string"!=typeof e)throw new Error(M);return e}var O,x,k,C,P,D,N,B,q,L,j,F,U,z,H,G,K,W,V,$,Z,Y,J,X,Q,ee,te,re,ie,ne,se,oe,ae,de,ue,le,ce,pe,he,fe,ye,ge,me,ve,be,_e,we,Te,Ee,Se,Ae,Re,Me,Ie,Oe,xe,ke,Ce,Pe=Object.freeze({__proto__:null,info:function(e){if("object"!=typeof e||null==e)throw new Error("Wrong result type.");const{version:t}=e;if("string"!=typeof t)throw new Error(M);return{version:t,configured:!!e.configured}},version:function(e){if("string"!=typeof e)throw new Error(M);return e.trim()},devices:function(e){if("object"!=typeof e)throw new Error(M);if(!(e instanceof Array))throw new Error(M);return e.map((e=>{if("object"!=typeof e||null==e)throw new Error(M);const{path:t}=e;if("string"!=typeof t)throw new Error(M);return{path:t.toString(),session:I(e.session),debugSession:I(e.debugSession),product:e.product,vendor:e.vendor,debug:!!e.debug}}))},acquire:function(e){if("object"!=typeof e||null==e)throw new Error(M);const{session:t}=e;if("string"!=typeof t&&"number"!=typeof t)throw new Error(M);return t.toString()},call:function(e){if("object"!=typeof e||null==e)throw new Error(M);const{type:t}=e;if("string"!=typeof t)throw new Error(M);const{message:r}=e;if("object"!=typeof r||null==r)throw new Error(M);return{type:t,message:r}}});t.AptosTransactionType=void 0,(O=t.AptosTransactionType||(t.AptosTransactionType={}))[O.STANDARD=0]="STANDARD",O[O.WITH_DATA=1]="WITH_DATA",t.BinanceOrderType=void 0,(x=t.BinanceOrderType||(t.BinanceOrderType={}))[x.OT_UNKNOWN=0]="OT_UNKNOWN",x[x.MARKET=1]="MARKET",x[x.LIMIT=2]="LIMIT",x[x.OT_RESERVED=3]="OT_RESERVED",t.BinanceOrderSide=void 0,(k=t.BinanceOrderSide||(t.BinanceOrderSide={}))[k.SIDE_UNKNOWN=0]="SIDE_UNKNOWN",k[k.BUY=1]="BUY",k[k.SELL=2]="SELL",t.BinanceTimeInForce=void 0,(C=t.BinanceTimeInForce||(t.BinanceTimeInForce={}))[C.TIF_UNKNOWN=0]="TIF_UNKNOWN",C[C.GTE=1]="GTE",C[C.TIF_RESERVED=2]="TIF_RESERVED",C[C.IOC=3]="IOC",t.Enum_InputScriptType=void 0,(P=t.Enum_InputScriptType||(t.Enum_InputScriptType={}))[P.SPENDADDRESS=0]="SPENDADDRESS",P[P.SPENDMULTISIG=1]="SPENDMULTISIG",P[P.EXTERNAL=2]="EXTERNAL",P[P.SPENDWITNESS=3]="SPENDWITNESS",P[P.SPENDP2SHWITNESS=4]="SPENDP2SHWITNESS",P[P.SPENDTAPROOT=5]="SPENDTAPROOT",t.Enum_OutputScriptType=void 0,(D=t.Enum_OutputScriptType||(t.Enum_OutputScriptType={}))[D.PAYTOADDRESS=0]="PAYTOADDRESS",D[D.PAYTOSCRIPTHASH=1]="PAYTOSCRIPTHASH",D[D.PAYTOMULTISIG=2]="PAYTOMULTISIG",D[D.PAYTOOPRETURN=3]="PAYTOOPRETURN",D[D.PAYTOWITNESS=4]="PAYTOWITNESS",D[D.PAYTOP2SHWITNESS=5]="PAYTOP2SHWITNESS",D[D.PAYTOTAPROOT=6]="PAYTOTAPROOT",t.DecredStakingSpendType=void 0,(N=t.DecredStakingSpendType||(t.DecredStakingSpendType={}))[N.SSGen=0]="SSGen",N[N.SSRTX=1]="SSRTX",t.AmountUnit=void 0,(B=t.AmountUnit||(t.AmountUnit={}))[B.BITCOIN=0]="BITCOIN",B[B.MILLIBITCOIN=1]="MILLIBITCOIN",B[B.MICROBITCOIN=2]="MICROBITCOIN",B[B.SATOSHI=3]="SATOSHI",t.Enum_RequestType=void 0,(q=t.Enum_RequestType||(t.Enum_RequestType={}))[q.TXINPUT=0]="TXINPUT",q[q.TXOUTPUT=1]="TXOUTPUT",q[q.TXMETA=2]="TXMETA",q[q.TXFINISHED=3]="TXFINISHED",q[q.TXEXTRADATA=4]="TXEXTRADATA",q[q.TXORIGINPUT=5]="TXORIGINPUT",q[q.TXORIGOUTPUT=6]="TXORIGOUTPUT",t.RebootType=void 0,(L=t.RebootType||(t.RebootType={}))[L.Normal=0]="Normal",L[L.Boardloader=1]="Boardloader",L[L.BootLoader=2]="BootLoader",t.CardanoDerivationType=void 0,(j=t.CardanoDerivationType||(t.CardanoDerivationType={}))[j.LEDGER=0]="LEDGER",j[j.ICARUS=1]="ICARUS",j[j.ICARUS_TREZOR=2]="ICARUS_TREZOR",t.CardanoAddressType=void 0,(F=t.CardanoAddressType||(t.CardanoAddressType={}))[F.BASE=0]="BASE",F[F.BASE_SCRIPT_KEY=1]="BASE_SCRIPT_KEY",F[F.BASE_KEY_SCRIPT=2]="BASE_KEY_SCRIPT",F[F.BASE_SCRIPT_SCRIPT=3]="BASE_SCRIPT_SCRIPT",F[F.POINTER=4]="POINTER",F[F.POINTER_SCRIPT=5]="POINTER_SCRIPT",F[F.ENTERPRISE=6]="ENTERPRISE",F[F.ENTERPRISE_SCRIPT=7]="ENTERPRISE_SCRIPT",F[F.BYRON=8]="BYRON",F[F.REWARD=14]="REWARD",F[F.REWARD_SCRIPT=15]="REWARD_SCRIPT",t.CardanoNativeScriptType=void 0,(U=t.CardanoNativeScriptType||(t.CardanoNativeScriptType={}))[U.PUB_KEY=0]="PUB_KEY",U[U.ALL=1]="ALL",U[U.ANY=2]="ANY",U[U.N_OF_K=3]="N_OF_K",U[U.INVALID_BEFORE=4]="INVALID_BEFORE",U[U.INVALID_HEREAFTER=5]="INVALID_HEREAFTER",t.CardanoNativeScriptHashDisplayFormat=void 0,(z=t.CardanoNativeScriptHashDisplayFormat||(t.CardanoNativeScriptHashDisplayFormat={}))[z.HIDE=0]="HIDE",z[z.BECH32=1]="BECH32",z[z.POLICY_ID=2]="POLICY_ID",t.CardanoTxOutputSerializationFormat=void 0,(H=t.CardanoTxOutputSerializationFormat||(t.CardanoTxOutputSerializationFormat={}))[H.ARRAY_LEGACY=0]="ARRAY_LEGACY",H[H.MAP_BABBAGE=1]="MAP_BABBAGE",t.CardanoCertificateType=void 0,(G=t.CardanoCertificateType||(t.CardanoCertificateType={}))[G.STAKE_REGISTRATION=0]="STAKE_REGISTRATION",G[G.STAKE_DEREGISTRATION=1]="STAKE_DEREGISTRATION",G[G.STAKE_DELEGATION=2]="STAKE_DELEGATION",G[G.STAKE_POOL_REGISTRATION=3]="STAKE_POOL_REGISTRATION",G[G.STAKE_REGISTRATION_CONWAY=7]="STAKE_REGISTRATION_CONWAY",G[G.STAKE_DEREGISTRATION_CONWAY=8]="STAKE_DEREGISTRATION_CONWAY",G[G.VOTE_DELEGATION=9]="VOTE_DELEGATION",t.CardanoDRepType=void 0,(K=t.CardanoDRepType||(t.CardanoDRepType={}))[K.KEY_HASH=0]="KEY_HASH",K[K.SCRIPT_HASH=1]="SCRIPT_HASH",K[K.ABSTAIN=2]="ABSTAIN",K[K.NO_CONFIDENCE=3]="NO_CONFIDENCE",t.CardanoPoolRelayType=void 0,(W=t.CardanoPoolRelayType||(t.CardanoPoolRelayType={}))[W.SINGLE_HOST_IP=0]="SINGLE_HOST_IP",W[W.SINGLE_HOST_NAME=1]="SINGLE_HOST_NAME",W[W.MULTIPLE_HOST_NAME=2]="MULTIPLE_HOST_NAME",t.CardanoTxAuxiliaryDataSupplementType=void 0,(V=t.CardanoTxAuxiliaryDataSupplementType||(t.CardanoTxAuxiliaryDataSupplementType={}))[V.NONE=0]="NONE",V[V.CVOTE_REGISTRATION_SIGNATURE=1]="CVOTE_REGISTRATION_SIGNATURE",t.CardanoCVoteRegistrationFormat=void 0,($=t.CardanoCVoteRegistrationFormat||(t.CardanoCVoteRegistrationFormat={}))[$.CIP15=0]="CIP15",$[$.CIP36=1]="CIP36",t.CardanoTxSigningMode=void 0,(Z=t.CardanoTxSigningMode||(t.CardanoTxSigningMode={}))[Z.ORDINARY_TRANSACTION=0]="ORDINARY_TRANSACTION",Z[Z.POOL_REGISTRATION_AS_OWNER=1]="POOL_REGISTRATION_AS_OWNER",Z[Z.MULTISIG_TRANSACTION=2]="MULTISIG_TRANSACTION",Z[Z.PLUTUS_TRANSACTION=3]="PLUTUS_TRANSACTION",t.CardanoTxWitnessType=void 0,(Y=t.CardanoTxWitnessType||(t.CardanoTxWitnessType={}))[Y.BYRON_WITNESS=0]="BYRON_WITNESS",Y[Y.SHELLEY_WITNESS=1]="SHELLEY_WITNESS",t.FailureType=void 0,(J=t.FailureType||(t.FailureType={}))[J.Failure_UnexpectedMessage=1]="Failure_UnexpectedMessage",J[J.Failure_ButtonExpected=2]="Failure_ButtonExpected",J[J.Failure_DataError=3]="Failure_DataError",J[J.Failure_ActionCancelled=4]="Failure_ActionCancelled",J[J.Failure_PinExpected=5]="Failure_PinExpected",J[J.Failure_PinCancelled=6]="Failure_PinCancelled",J[J.Failure_PinInvalid=7]="Failure_PinInvalid",J[J.Failure_InvalidSignature=8]="Failure_InvalidSignature",J[J.Failure_ProcessError=9]="Failure_ProcessError",J[J.Failure_NotEnoughFunds=10]="Failure_NotEnoughFunds",J[J.Failure_NotInitialized=11]="Failure_NotInitialized",J[J.Failure_PinMismatch=12]="Failure_PinMismatch",J[J.Failure_WipeCodeMismatch=13]="Failure_WipeCodeMismatch",J[J.Failure_InvalidSession=14]="Failure_InvalidSession",J[J.Failure_FirmwareError=99]="Failure_FirmwareError",t.Enum_ButtonRequestType=void 0,(X=t.Enum_ButtonRequestType||(t.Enum_ButtonRequestType={}))[X.ButtonRequest_Other=1]="ButtonRequest_Other",X[X.ButtonRequest_FeeOverThreshold=2]="ButtonRequest_FeeOverThreshold",X[X.ButtonRequest_ConfirmOutput=3]="ButtonRequest_ConfirmOutput",X[X.ButtonRequest_ResetDevice=4]="ButtonRequest_ResetDevice",X[X.ButtonRequest_ConfirmWord=5]="ButtonRequest_ConfirmWord",X[X.ButtonRequest_WipeDevice=6]="ButtonRequest_WipeDevice",X[X.ButtonRequest_ProtectCall=7]="ButtonRequest_ProtectCall",X[X.ButtonRequest_SignTx=8]="ButtonRequest_SignTx",X[X.ButtonRequest_FirmwareCheck=9]="ButtonRequest_FirmwareCheck",X[X.ButtonRequest_Address=10]="ButtonRequest_Address",X[X.ButtonRequest_PublicKey=11]="ButtonRequest_PublicKey",X[X.ButtonRequest_MnemonicWordCount=12]="ButtonRequest_MnemonicWordCount",X[X.ButtonRequest_MnemonicInput=13]="ButtonRequest_MnemonicInput",X[X._Deprecated_ButtonRequest_PassphraseType=14]="_Deprecated_ButtonRequest_PassphraseType",X[X.ButtonRequest_UnknownDerivationPath=15]="ButtonRequest_UnknownDerivationPath",X[X.ButtonRequest_RecoveryHomepage=16]="ButtonRequest_RecoveryHomepage",X[X.ButtonRequest_Success=17]="ButtonRequest_Success",X[X.ButtonRequest_Warning=18]="ButtonRequest_Warning",X[X.ButtonRequest_PassphraseEntry=19]="ButtonRequest_PassphraseEntry",X[X.ButtonRequest_PinEntry=20]="ButtonRequest_PinEntry",X[X.ButtonRequest_AttachPin=8e3]="ButtonRequest_AttachPin",t.Enum_PinMatrixRequestType=void 0,(Q=t.Enum_PinMatrixRequestType||(t.Enum_PinMatrixRequestType={}))[Q.PinMatrixRequestType_Current=1]="PinMatrixRequestType_Current",Q[Q.PinMatrixRequestType_NewFirst=2]="PinMatrixRequestType_NewFirst",Q[Q.PinMatrixRequestType_NewSecond=3]="PinMatrixRequestType_NewSecond",Q[Q.PinMatrixRequestType_WipeCodeFirst=4]="PinMatrixRequestType_WipeCodeFirst",Q[Q.PinMatrixRequestType_WipeCodeSecond=5]="PinMatrixRequestType_WipeCodeSecond",Q[Q.PinMatrixRequestType_BackupFirst=6]="PinMatrixRequestType_BackupFirst",Q[Q.PinMatrixRequestType_BackupSecond=7]="PinMatrixRequestType_BackupSecond",Q[Q.PinMatrixRequestType_AttachToPin=8e3]="PinMatrixRequestType_AttachToPin",t.EthereumDefinitionType=void 0,(ee=t.EthereumDefinitionType||(t.EthereumDefinitionType={}))[ee.NETWORK=0]="NETWORK",ee[ee.TOKEN=1]="TOKEN",t.EthereumGnosisSafeTxOperation=void 0,(te=t.EthereumGnosisSafeTxOperation||(t.EthereumGnosisSafeTxOperation={}))[te.CALL=0]="CALL",te[te.DELEGATE_CALL=1]="DELEGATE_CALL",t.EthereumDataTypeUKey=void 0,(re=t.EthereumDataTypeUKey||(t.EthereumDataTypeUKey={}))[re.UINT=1]="UINT",re[re.INT=2]="INT",re[re.BYTES=3]="BYTES",re[re.STRING=4]="STRING",re[re.BOOL=5]="BOOL",re[re.ADDRESS=6]="ADDRESS",re[re.ARRAY=7]="ARRAY",re[re.STRUCT=8]="STRUCT",t.EthereumDataType=void 0,(ie=t.EthereumDataType||(t.EthereumDataType={}))[ie.UINT=1]="UINT",ie[ie.INT=2]="INT",ie[ie.BYTES=3]="BYTES",ie[ie.STRING=4]="STRING",ie[ie.BOOL=5]="BOOL",ie[ie.ADDRESS=6]="ADDRESS",ie[ie.ARRAY=7]="ARRAY",ie[ie.STRUCT=8]="STRUCT",t.Enum_BackupType=void 0,(ne=t.Enum_BackupType||(t.Enum_BackupType={}))[ne.Bip39=0]="Bip39",ne[ne.Slip39_Basic=1]="Slip39_Basic",ne[ne.Slip39_Advanced=2]="Slip39_Advanced",t.Enum_SafetyCheckLevel=void 0,(se=t.Enum_SafetyCheckLevel||(t.Enum_SafetyCheckLevel={}))[se.Strict=0]="Strict",se[se.PromptAlways=1]="PromptAlways",se[se.PromptTemporarily=2]="PromptTemporarily",t.UKeyDeviceType=void 0,(oe=t.UKeyDeviceType||(t.UKeyDeviceType={}))[oe.CLASSIC=0]="CLASSIC",oe[oe.CLASSIC1S=1]="CLASSIC1S",oe[oe.MINI=2]="MINI",oe[oe.TOUCH=3]="TOUCH",oe[oe.PRO=5]="PRO",oe[oe.PURE=6]="PURE",t.UKeySeType=void 0,(ae=t.UKeySeType||(t.UKeySeType={}))[ae.THD89=0]="THD89",ae[ae.SE608A=1]="SE608A",t.UKeySEState=void 0,(de=t.UKeySEState||(t.UKeySEState={}))[de.BOOT=0]="BOOT",de[de.APP=1]="APP",t.Enum_Capability=void 0,(ue=t.Enum_Capability||(t.Enum_Capability={}))[ue.Capability_Bitcoin=1]="Capability_Bitcoin",ue[ue.Capability_Bitcoin_like=2]="Capability_Bitcoin_like",ue[ue.Capability_Binance=3]="Capability_Binance",ue[ue.Capability_Cardano=4]="Capability_Cardano",ue[ue.Capability_Crypto=5]="Capability_Crypto",ue[ue.Capability_EOS=6]="Capability_EOS",ue[ue.Capability_Ethereum=7]="Capability_Ethereum",ue[ue.Capability_Lisk=8]="Capability_Lisk",ue[ue.Capability_Monero=9]="Capability_Monero",ue[ue.Capability_NEM=10]="Capability_NEM",ue[ue.Capability_Ripple=11]="Capability_Ripple",ue[ue.Capability_Stellar=12]="Capability_Stellar",ue[ue.Capability_Tezos=13]="Capability_Tezos",ue[ue.Capability_U2F=14]="Capability_U2F",ue[ue.Capability_Shamir=15]="Capability_Shamir",ue[ue.Capability_ShamirGroups=16]="Capability_ShamirGroups",ue[ue.Capability_PassphraseEntry=17]="Capability_PassphraseEntry",ue[ue.Capability_EthereumTypedData=1e3]="Capability_EthereumTypedData",ue[ue.Capability_AttachToPin=8e3]="Capability_AttachToPin",t.ExportType=void 0,(le=t.ExportType||(t.ExportType={}))[le.SeedEncExportType_NO=0]="SeedEncExportType_NO",le[le.SeedEncExportType_YES=1]="SeedEncExportType_YES",le[le.MnemonicPlainExportType_YES=2]="MnemonicPlainExportType_YES",t.SdProtectOperationType=void 0,(ce=t.SdProtectOperationType||(t.SdProtectOperationType={}))[ce.DISABLE=0]="DISABLE",ce[ce.ENABLE=1]="ENABLE",ce[ce.REFRESH=2]="REFRESH",t.RecoveryDeviceType=void 0,(pe=t.RecoveryDeviceType||(t.RecoveryDeviceType={}))[pe.RecoveryDeviceType_ScrambledWords=0]="RecoveryDeviceType_ScrambledWords",pe[pe.RecoveryDeviceType_Matrix=1]="RecoveryDeviceType_Matrix",t.Enum_WordRequestType=void 0,(he=t.Enum_WordRequestType||(t.Enum_WordRequestType={}))[he.WordRequestType_Plain=0]="WordRequestType_Plain",he[he.WordRequestType_Matrix9=1]="WordRequestType_Matrix9",he[he.WordRequestType_Matrix6=2]="WordRequestType_Matrix6",t.SeedRequestType=void 0,(fe=t.SeedRequestType||(t.SeedRequestType={}))[fe.SeedRequestType_Gen=0]="SeedRequestType_Gen",fe[fe.SeedRequestType_EncExport=1]="SeedRequestType_EncExport",fe[fe.SeedRequestType_EncImport=2]="SeedRequestType_EncImport",t.WL_OperationType=void 0,(ye=t.WL_OperationType||(t.WL_OperationType={}))[ye.WL_OperationType_Add=0]="WL_OperationType_Add",ye[ye.WL_OperationType_Delete=1]="WL_OperationType_Delete",ye[ye.WL_OperationType_Inquire=2]="WL_OperationType_Inquire",t.ResourceType=void 0,(ge=t.ResourceType||(t.ResourceType={}))[ge.WallPaper=0]="WallPaper",ge[ge.Nft=1]="Nft",t.NEMMosaicLevy=void 0,(me=t.NEMMosaicLevy||(t.NEMMosaicLevy={}))[me.MosaicLevy_Absolute=1]="MosaicLevy_Absolute",me[me.MosaicLevy_Percentile=2]="MosaicLevy_Percentile",t.NEMSupplyChangeType=void 0,(ve=t.NEMSupplyChangeType||(t.NEMSupplyChangeType={}))[ve.SupplyChange_Increase=1]="SupplyChange_Increase",ve[ve.SupplyChange_Decrease=2]="SupplyChange_Decrease",t.NEMModificationType=void 0,(be=t.NEMModificationType||(t.NEMModificationType={}))[be.CosignatoryModification_Add=1]="CosignatoryModification_Add",be[be.CosignatoryModification_Delete=2]="CosignatoryModification_Delete",t.NEMImportanceTransferMode=void 0,(_e=t.NEMImportanceTransferMode||(t.NEMImportanceTransferMode={}))[_e.ImportanceTransfer_Activate=1]="ImportanceTransfer_Activate",_e[_e.ImportanceTransfer_Deactivate=2]="ImportanceTransfer_Deactivate",t.SolanaOffChainMessageVersion=void 0,(we=t.SolanaOffChainMessageVersion||(t.SolanaOffChainMessageVersion={}))[we.MESSAGE_VERSION_0=0]="MESSAGE_VERSION_0",t.SolanaOffChainMessageFormat=void 0,(Te=t.SolanaOffChainMessageFormat||(t.SolanaOffChainMessageFormat={}))[Te.V0_RESTRICTED_ASCII=0]="V0_RESTRICTED_ASCII",Te[Te.V0_LIMITED_UTF8=1]="V0_LIMITED_UTF8",t.StellarAssetType=void 0,(Ee=t.StellarAssetType||(t.StellarAssetType={}))[Ee.NATIVE=0]="NATIVE",Ee[Ee.ALPHANUM4=1]="ALPHANUM4",Ee[Ee.ALPHANUM12=2]="ALPHANUM12",t.StellarMemoType=void 0,(Se=t.StellarMemoType||(t.StellarMemoType={}))[Se.NONE=0]="NONE",Se[Se.TEXT=1]="TEXT",Se[Se.ID=2]="ID",Se[Se.HASH=3]="HASH",Se[Se.RETURN=4]="RETURN",t.StellarSignerType=void 0,(Ae=t.StellarSignerType||(t.StellarSignerType={}))[Ae.ACCOUNT=0]="ACCOUNT",Ae[Ae.PRE_AUTH=1]="PRE_AUTH",Ae[Ae.HASH=2]="HASH",t.TezosContractType=void 0,(Re=t.TezosContractType||(t.TezosContractType={}))[Re.Implicit=0]="Implicit",Re[Re.Originated=1]="Originated",t.TezosBallotType=void 0,(Me=t.TezosBallotType||(t.TezosBallotType={}))[Me.Yay=0]="Yay",Me[Me.Nay=1]="Nay",Me[Me.Pass=2]="Pass",t.TonWalletVersion=void 0,(Ie=t.TonWalletVersion||(t.TonWalletVersion={}))[Ie.V4R2=3]="V4R2",t.TonWorkChain=void 0,(Oe=t.TonWorkChain||(t.TonWorkChain={}))[Oe.BASECHAIN=0]="BASECHAIN",Oe[Oe.MASTERCHAIN=1]="MASTERCHAIN",t.TronResourceCode=void 0,(xe=t.TronResourceCode||(t.TronResourceCode={}))[xe.BANDWIDTH=0]="BANDWIDTH",xe[xe.ENERGY=1]="ENERGY",xe[xe.TRON_POWER=2]="TRON_POWER",t.TronMessageType=void 0,(ke=t.TronMessageType||(t.TronMessageType={}))[ke.V1=1]="V1",ke[ke.V2=2]="V2",t.CommandFlags=void 0,(Ce=t.CommandFlags||(t.CommandFlags={}))[Ce.Default=0]="Default",Ce[Ce.Factory_Only=1]="Factory_Only";var De=Object.freeze({__proto__:null,get AptosTransactionType(){return t.AptosTransactionType},get BinanceOrderType(){return t.BinanceOrderType},get BinanceOrderSide(){return t.BinanceOrderSide},get BinanceTimeInForce(){return t.BinanceTimeInForce},get Enum_InputScriptType(){return t.Enum_InputScriptType},get Enum_OutputScriptType(){return t.Enum_OutputScriptType},get DecredStakingSpendType(){return t.DecredStakingSpendType},get AmountUnit(){return t.AmountUnit},get Enum_RequestType(){return t.Enum_RequestType},get RebootType(){return t.RebootType},get CardanoDerivationType(){return t.CardanoDerivationType},get CardanoAddressType(){return t.CardanoAddressType},get CardanoNativeScriptType(){return t.CardanoNativeScriptType},get CardanoNativeScriptHashDisplayFormat(){return t.CardanoNativeScriptHashDisplayFormat},get CardanoTxOutputSerializationFormat(){return t.CardanoTxOutputSerializationFormat},get CardanoCertificateType(){return t.CardanoCertificateType},get CardanoDRepType(){return t.CardanoDRepType},get CardanoPoolRelayType(){return t.CardanoPoolRelayType},get CardanoTxAuxiliaryDataSupplementType(){return t.CardanoTxAuxiliaryDataSupplementType},get CardanoCVoteRegistrationFormat(){return t.CardanoCVoteRegistrationFormat},get CardanoTxSigningMode(){return t.CardanoTxSigningMode},get CardanoTxWitnessType(){return t.CardanoTxWitnessType},get FailureType(){return t.FailureType},get Enum_ButtonRequestType(){return t.Enum_ButtonRequestType},get Enum_PinMatrixRequestType(){return t.Enum_PinMatrixRequestType},get EthereumDefinitionType(){return t.EthereumDefinitionType},get EthereumGnosisSafeTxOperation(){return t.EthereumGnosisSafeTxOperation},get EthereumDataTypeUKey(){return t.EthereumDataTypeUKey},get EthereumDataType(){return t.EthereumDataType},get Enum_BackupType(){return t.Enum_BackupType},get Enum_SafetyCheckLevel(){return t.Enum_SafetyCheckLevel},get UKeyDeviceType(){return t.UKeyDeviceType},get UKeySeType(){return t.UKeySeType},get UKeySEState(){return t.UKeySEState},get Enum_Capability(){return t.Enum_Capability},get ExportType(){return t.ExportType},get SdProtectOperationType(){return t.SdProtectOperationType},get RecoveryDeviceType(){return t.RecoveryDeviceType},get Enum_WordRequestType(){return t.Enum_WordRequestType},get SeedRequestType(){return t.SeedRequestType},get WL_OperationType(){return t.WL_OperationType},get ResourceType(){return t.ResourceType},get NEMMosaicLevy(){return t.NEMMosaicLevy},get NEMSupplyChangeType(){return t.NEMSupplyChangeType},get NEMModificationType(){return t.NEMModificationType},get NEMImportanceTransferMode(){return t.NEMImportanceTransferMode},get SolanaOffChainMessageVersion(){return t.SolanaOffChainMessageVersion},get SolanaOffChainMessageFormat(){return t.SolanaOffChainMessageFormat},get StellarAssetType(){return t.StellarAssetType},get StellarMemoType(){return t.StellarMemoType},get StellarSignerType(){return t.StellarSignerType},get TezosContractType(){return t.TezosContractType},get TezosBallotType(){return t.TezosBallotType},get TonWalletVersion(){return t.TonWalletVersion},get TonWorkChain(){return t.TonWorkChain},get TronResourceCode(){return t.TronResourceCode},get TronMessageType(){return t.TronMessageType},get CommandFlags(){return t.CommandFlags}});const Ne=new Set(["PassphraseAck","PinMatrixAck"]);u.util.Long=l,u.configure();var Be={check:Pe,buildOne:function(e,t,r){const{Message:i,messageType:n}=b(e,t);return A(v(i,r),{addTrezorHeaders:!1,chunked:!1,messageType:n})},buildBuffers:(e,t,r)=>{const i=R(e,t,r),n=[];for(const e of i){const t=new c.default(T+1);t.writeByte(63),t.append(e),t.reset(),n.push(t)}return n},buildEncodeBuffers:R,receiveOne:function(e,t){const r=c.default.wrap(t,"hex"),{typeId:i,buffer:n}=E(r),{Message:s,messageName:o}=((e,t)=>{const r=e.lookupEnum("MessageType").valuesById[t].replace("MessageType_","");return{Message:e.lookupType(r),messageName:r}})(e,i),a=((e,t)=>{const r=t.toBuffer(),i=new Uint8Array(r);let n;try{n=e.decode(i)}catch(t){if(!(i.length>1&&255===i[i.length-1]))throw t;i[i.length-1]=4,n=e.decode(i)}return y(n,n.$type.fields)})(s,n);return{message:a,type:o}},parseConfigure:function(e){return"string"==typeof e?u.Root.fromJSON(JSON.parse(e)):u.Root.fromJSON(e)},decodeProtocol:S};t.BUFFER_SIZE=T,t.COMMON_HEADER_SIZE=6,t.HEADER_SIZE=w,t.LogBlockCommand=Ne,t.MESSAGE_HEADER_BYTE=_,t.MESSAGE_TOP_CHAR=63,t.Messages=De,t.default=Be},8492:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r;t.EUKeyBleMessageKeys=void 0,(r=t.EUKeyBleMessageKeys||(t.EUKeyBleMessageKeys={})).BLE_SELECT="$ukey-ble-select",r.BLE_SELECT_RESULT="$ukey-ble-select-result",r.BLE_STOP_SCAN="$ukey-ble-stop-scan",r.BLE_CANCEL_REQUEST="$ukey-ble-cancel-request",r.BLE_PRE_SELECT="$ukey-ble-pre-select",r.BLE_CLEAR_PRE_SELECT="$ukey-ble-clear-pre-select",r.BLE_PAIRING_REQUEST="$ukey-ble-pairing-request",r.BLE_PAIRING_RESPONSE="$ukey-ble-pairing-response",r.BLE_ENUMERATE="$ukey-ble-enumerate",r.BLE_ENUMERATE_RESULT="$ukey-ble-enumerate-result",r.BLE_DEVICE_DISCONNECTED="$ukey-ble-device-disconnected",r.BLE_AVAILABILITY_CHECK="$ukey-ble-availability-check",r.NOBLE_BLE_ENUMERATE="$ukey-noble-ble-enumerate",r.NOBLE_BLE_STOP_SCAN="$ukey-noble-ble-stop-scan",r.NOBLE_BLE_GET_DEVICE="$ukey-noble-ble-get-device",r.NOBLE_BLE_CONNECT="$ukey-noble-ble-connect",r.NOBLE_BLE_DISCONNECT="$ukey-noble-ble-disconnect",r.NOBLE_BLE_WRITE="$ukey-noble-ble-write",r.NOBLE_BLE_SUBSCRIBE="$ukey-noble-ble-subscribe",r.NOBLE_BLE_UNSUBSCRIBE="$ukey-noble-ble-unsubscribe",r.NOBLE_BLE_NOTIFICATION="$ukey-noble-ble-notification",r.NOBLE_BLE_CANCEL_PAIRING="$ukey-noble-ble-cancel-pairing";function i(e,t,r,i){return new(r||(r=Promise))((function(n,s){function o(e){try{d(i.next(e))}catch(e){s(e)}}function a(e){try{d(i.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}d((i=i.apply(e,t||[])).next())}))}"function"==typeof SuppressedError&&SuppressedError;class n extends Error{constructor(e){var t;super(),this.errorCode=s.UnknownError,this.message="",this.params={};const r=o;if(this.message=r[s.UnknownError],"string"==typeof e)this.errorCode=s.UnknownError,this.message=e;else{const i=null!==(t=e.message||r[e.errorCode])&&void 0!==t?t:"";i&&(this.message=function(e,t){if("string"!=typeof e)return e;if(-1===e.indexOf("{"))return e;let r="",i=0;const n=t;for(;i<e.length;){const t=e.indexOf("{",i);if(-1===t){r+=e.slice(i);break}const s=e.indexOf("}",t+1);if(-1===s){r+=e.slice(i);break}r+=e.slice(i,t);const o=e.slice(t+1,s);if(0===o.length)r+="{}";else{const e=n[o];r+=e?String(e):"?"}i=s+1}return r}(i,e)),this.params=e.params,this.errorCode=e.errorCode}this.name="HardwareError"}}const s={UnknownError:0,DeviceFwException:101,DeviceUnexpectedMode:102,DeviceListNotInitialized:103,SelectDevice:104,DeviceNotFound:105,DeviceInitializeFailed:106,DeviceInterruptedFromOutside:107,RequiredButInBootloaderMode:108,DeviceInterruptedFromUser:109,DeviceCheckDeviceIdError:110,DeviceNotSupportPassphrase:111,DeviceCheckPassphraseStateError:112,DeviceNotOpenedPassphrase:113,DeviceOpenedPassphrase:114,DeviceDetectInBootloaderMode:115,NotAllowInBootloaderMode:116,DeviceBusy:117,DeviceCheckUnlockTypeError:118,NotInitialized:200,IFrameNotInitialized:300,IFrameAleradyInitialized:301,IFrameLoadFail:302,IframeTimeout:303,IframeBlocked:304,IframeDistrust:305,CallMethodError:400,CallMethodNotResponse:404,CallMethodInvalidParameter:405,FirmwareUpdateDownloadFailed:406,CallMethodNeedUpgradeFirmware:407,CallMethodDeprecated:408,FirmwareUpdateLimitOneDevice:409,FirmwareUpdateManuallyEnterBoot:410,FirmwareUpdateAutoEnterBootFailure:411,NewFirmwareUnRelease:412,UseDesktopToUpdateFirmware:413,NewFirmwareForceUpdate:414,DeviceNotSupportMethod:415,ForbiddenKeyPath:416,RepeatUnlocking:417,DefectiveFirmware:418,NetworkError:500,TransportNotConfigured:600,TransportCallInProgress:601,TransportNotFound:602,TransportInvalidProtobuf:603,BleScanError:700,BlePermissionError:701,BleLocationError:702,BleRequiredUUID:703,BleConnectedError:704,BleDeviceNotBonded:705,BleServiceNotFound:706,BleCharacteristicNotFound:707,BleMonitorError:708,BleCharacteristicNotifyError:709,BleWriteCharacteristicError:710,BleAlreadyConnected:711,BleLocationServicesDisabled:712,BleTimeoutError:713,BleForceCleanRunPromise:714,BleDeviceBondError:715,BleCharacteristicNotifyChangeFailure:716,BleTransportCallCanceled:717,BleDeviceBondedCanceled:718,BlePeerRemovedPairingInformation:719,BleDeviceDisconnected:720,BlePoweredOff:721,BleUnsupported:722,RuntimeError:800,PinInvalid:801,PinCancelled:802,ActionCancelled:803,FirmwareError:804,ResponseUnexpectTypeError:805,BridgeNetworkError:806,BridgeTimeoutError:807,BridgeNotInstalled:808,PollingTimeout:809,PollingStop:810,BlindSignDisabled:811,UnexpectPassphrase:812,FileAlreadyExists:813,CheckDownloadFileError:814,NotInSigningMode:815,DataOverload:816,BridgeDeviceDisconnected:817,BTCPsbtTooManyUtxos:818,EmmcFileWriteFirmwareError:819,FirmwareVerificationFailed:820,BridgeNeedsPermission:821,LowlevelTrasnportConnectError:900,WebDeviceNotFoundOrNeedsPermission:901,WebDevicePromptAccessError:902},o={[s.UnknownError]:"Unknown error occurred. Check message property.",[s.DeviceFwException]:"Firmware version mismatch",[s.DeviceUnexpectedMode]:"Device unexpected mode",[s.DeviceListNotInitialized]:"Device list is not initialized",[s.SelectDevice]:"Please select the connected device",[s.DeviceNotFound]:"Device not found",[s.DeviceInitializeFailed]:"Device initialization failed",[s.DeviceInterruptedFromOutside]:"Device interrupted",[s.DeviceInterruptedFromUser]:"Device interrupted",[s.RequiredButInBootloaderMode]:"Device should be in bootloader mode",[s.DeviceCheckDeviceIdError]:"Device Id in the features is not same.",[s.DeviceNotSupportPassphrase]:"Device not support passphrase",[s.DeviceCheckPassphraseStateError]:"Device passphrase state error",[s.DeviceNotOpenedPassphrase]:"Device not opened passphrase",[s.DeviceOpenedPassphrase]:"Device opened passphrase",[s.DeviceDetectInBootloaderMode]:"Device in bootloader mode",[s.NotAllowInBootloaderMode]:"Device not allow in bootloader mode",[s.DeviceBusy]:"Device is busy",[s.DeviceCheckUnlockTypeError]:"Device check unlock type not match error",[s.NotInitialized]:"Not initialized",[s.IFrameNotInitialized]:"IFrame not initialized",[s.IFrameAleradyInitialized]:"IFrame alerady initialized",[s.IFrameLoadFail]:"IFrame load fail",[s.IframeTimeout]:"init iframe time out",[s.IframeBlocked]:"IFrame blocked",[s.IframeDistrust]:"IFrame host not trust",[s.CallMethodError]:"Runtime errors during method execution",[s.CallMethodNotResponse]:"Method does not responding",[s.CallMethodInvalidParameter]:"Call method invalid parameter",[s.FirmwareUpdateDownloadFailed]:"Firmware update download failed",[s.CallMethodNeedUpgradeFirmware]:"Call method need upgrade firmware",[s.CallMethodDeprecated]:"Call method is deprecated",[s.FirmwareUpdateLimitOneDevice]:"Only one device can be connected during firmware upgrade",[s.FirmwareUpdateManuallyEnterBoot]:"You need to manually enter boot",[s.FirmwareUpdateAutoEnterBootFailure]:"Description Failed to automatically enter boot",[s.NewFirmwareUnRelease]:"new firmware has not been released yet",[s.NewFirmwareForceUpdate]:"new firmware has been released, please update",[s.UseDesktopToUpdateFirmware]:"Please use UKey desktop client to update the firmware",[s.DeviceNotSupportMethod]:"Device not support this method",[s.ForbiddenKeyPath]:"Forbidden key path",[s.RepeatUnlocking]:"Repeat unlocking",[s.DefectiveFirmware]:"Device firmware is defective, please update immediately",[s.NetworkError]:"Network request error",[s.TransportNotConfigured]:"Transport not configured",[s.TransportCallInProgress]:"Transport call in progress",[s.TransportNotFound]:"Transport not found",[s.TransportInvalidProtobuf]:"Transport invalid protobuf",[s.BleScanError]:"BLE scan error",[s.BlePermissionError]:"Bluetooth required to be turned on",[s.BleLocationError]:"Location permissions for the application are not available",[s.BleRequiredUUID]:"uuid is required",[s.BleConnectedError]:"connected error is always runtime error",[s.BleDeviceNotBonded]:"device is not bonded",[s.BleDeviceBondedCanceled]:"device is canceled bonding",[s.BlePeerRemovedPairingInformation]:"need to delete pairing information",[s.BleServiceNotFound]:"BLEServiceNotFound: service not found",[s.BleCharacteristicNotFound]:"BLEServiceNotFound: service not found",[s.BleMonitorError]:"Monitor Error: characteristic not found",[s.BleCharacteristicNotifyError]:"Characteristic Notify Error",[s.BleWriteCharacteristicError]:"Write Characteristic Error",[s.BleAlreadyConnected]:"Already connected to device",[s.BleLocationServicesDisabled]:"Location Services disabled",[s.BleTimeoutError]:"The connection has timed out unexpectedly.",[s.BleForceCleanRunPromise]:"Force clean Bluetooth run promise",[s.BleDeviceBondError]:"Bluetooth pairing failed",[s.BleCharacteristicNotifyChangeFailure]:"Characteristic Notify Change Failure",[s.BleTransportCallCanceled]:"Ble Transport call canceled",[s.BleDeviceDisconnected]:"Device disconnected",[s.BlePoweredOff]:"Bluetooth is turned off",[s.BleUnsupported]:"Bluetooth is not supported on this device",[s.RuntimeError]:"Runtime error",[s.PinInvalid]:"Pin invalid",[s.PinCancelled]:"Pin cancelled",[s.ActionCancelled]:"Action cancelled by user",[s.FirmwareError]:"Firmware installation failed",[s.ResponseUnexpectTypeError]:"Response type is not expected",[s.BridgeNetworkError]:"Bridge network error",[s.BridgeTimeoutError]:"Bridge network timeout",[s.BridgeNotInstalled]:"Bridge not installed",[s.BridgeDeviceDisconnected]:"Bridge device disconnected during action",[s.PollingTimeout]:"Polling timeout",[s.PollingStop]:"Polling stop",[s.BlindSignDisabled]:"Please confirm the BlindSign enabled",[s.UnexpectPassphrase]:"Unexpect passphrase",[s.FileAlreadyExists]:"File already exists",[s.CheckDownloadFileError]:"Check download file error",[s.NotInSigningMode]:"not in signing mode",[s.DataOverload]:"Params data overload",[s.BTCPsbtTooManyUtxos]:"PSBT too many utxos",[s.EmmcFileWriteFirmwareError]:"EMMC file write firmware error",[s.FirmwareVerificationFailed]:"Firmware verification failed",[s.BridgeNeedsPermission]:"Bridge needs permission",[s.LowlevelTrasnportConnectError]:"Lowlevel transport connect error",[s.WebDeviceNotFoundOrNeedsPermission]:"Web-USB or Web-Bluetooth device not found or needs permission",[s.WebDevicePromptAccessError]:"Web-USB or Web-Bluetooth device prompt access error"},a=(e,t,r)=>new n("string"==typeof e?e:{errorCode:e,message:null!=t?t:"",params:r}),d=e=>e&&e.error instanceof n?{error:e.error.message,code:e.error.errorCode,params:e.error.params}:e&&e.error&&"AxiosError"===e.error.name?{error:e.error.message,code:s.BridgeNetworkError}:e&&e.error instanceof Error?{error:e.error.message,code:e.error.code}:e,u=e=>{for(const t of Object.values(s))if(o[t]===e)return a(t);return new n(e)},l=e=>{const t=String(e||"");return t.includes("LIBUSB_ERROR_ACCESS")?a(s.BridgeNeedsPermission,"LIBUSB_ERROR_ACCESS"):a(s.BridgeNetworkError,t)},c=(e,t,r)=>{const i=r?` for method '${r}'`:"";return a(s.NewFirmwareUnRelease,`Device firmware version is too low${i}, please update to the latest version`,{current:e,require:t,method:r})},p=(e,t,r)=>{const i=r?` for method '${r}'`:"";return a(s.CallMethodNeedUpgradeFirmware,`Device firmware version is too low${i}, please update to ${t}`,{current:e,require:t,method:r})},h=(e,t,r,i)=>{const n={firmware:"firmware",ble:"BLE firmware"},o=`Device ${(r||[]).filter((e=>e in n)).map((e=>n[e])).join(" and ")} version is too low. ${(()=>{const e=[];return(null==i?void 0:i.firmware)&&e.push(`firmware version: ${i.firmware}`),(null==i?void 0:i.ble)&&e.push(`BLE version: ${i.ble}`),e.length>0?` (${e.join(", ")})`:""})()}`;return a(s.NewFirmwareForceUpdate,o,{connectId:e,deviceId:t,versionTypes:r,currentVersions:i})},f=(e,t,r)=>{const i=r?` Method '${r}'`:"This method";return a(s.CallMethodDeprecated,`Device firmware version is too high. ${i} has been deprecated in ${t}`,{current:e,deprecated:t,method:r})},y=(e,t,r,i,n)=>{const o=`Defective firmware detected (Serial: ${e}, SE: ${t}). Please update immediately.`;return a(s.DefectiveFirmware,o,{serialNo:e,seVersion:t,deviceType:r,connectId:i,deviceId:n})};var g=Object.freeze({__proto__:null,HardwareError:n,HardwareErrorCode:s,HardwareErrorCodeMessage:o,TypedError:a,serializeError:d,CreateErrorByMessage:u,CreateHardwareErrorByBridgeError:l,createNewFirmwareUnReleaseHardwareError:c,createNeedUpgradeFirmwareHardwareError:p,createNewFirmwareForceUpdateHardwareError:h,createDeprecatedHardwareError:f,createDefectiveFirmwareError:y});var m,v;t.EDeviceType=void 0,(m=t.EDeviceType||(t.EDeviceType={})).Unknown="unknown",m.Classic="classic",m.Classic1s="classic1s",m.ClassicPure="classicpure",m.Mini="mini",m.Touch="touch",m.Pro="pro",t.EFirmwareType=void 0,(v=t.EFirmwareType||(t.EFirmwareType={})).Universal="universal",v.BitcoinOnly="bitcoinonly",t.CreateErrorByMessage=u,t.CreateHardwareErrorByBridgeError=l,t.ERRORS=g,t.HardwareError=n,t.HardwareErrorCode=s,t.HardwareErrorCodeMessage=o,t.TypedError=a,t.UKEY_NOTIFY_CHARACTERISTIC_UUID="00000003-0000-1000-8000-00805f9b34fb",t.UKEY_SERVICE_UUID="00000001-0000-1000-8000-00805f9b34fb",t.UKEY_WEBUSB_FILTER=[{vendorId:4617,productId:21440},{vendorId:4617,productId:21441},{vendorId:4617,productId:20298},{vendorId:4617,productId:20299}],t.UKEY_WRITE_CHARACTERISTIC_UUID="00000002-0000-1000-8000-00805f9b34fb",t.createDefectiveFirmwareError=y,t.createDeferred=function(e,t){let r,n=e=>{},s=e=>{};const o=new Promise(((t,o)=>i(this,void 0,void 0,(function*(){if(n=t,s=o,"function"==typeof e)try{yield e()}catch(e){o(e)}"string"==typeof e&&(r=e)}))));return{id:r,data:t,resolve:n,reject:s,promise:o}},t.createDeprecatedHardwareError=f,t.createNeedUpgradeFirmwareHardwareError=p,t.createNewFirmwareForceUpdateHardwareError=h,t.createNewFirmwareUnReleaseHardwareError=c,t.isHeaderChunk=e=>{if(e.length<9)return!1;const[t,r,i]=e;return String.fromCharCode(t)===String.fromCharCode(63)&&String.fromCharCode(r)===String.fromCharCode(35)&&String.fromCharCode(i)===String.fromCharCode(35)},t.isUkeyDevice=(e,t)=>{var r;if(null===(r=null==t?void 0:t.startsWith)||void 0===r?void 0:r.call(t,"MI"))return!0;return!(!e||!/(BixinKey\d{10})|(K\d{4})|(T\d{4})|(Touch\s\w{4})|(Pro\s\w{4})/i.exec(e))},t.serializeError=d,t.wait=e=>new Promise((t=>{setTimeout(t,e)}))},7991:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],i=t[1];return 3*(r+i)/4-i},t.toByteArray=function(e){var t,r,s=a(e),o=s[0],d=s[1],u=new n(function(e,t,r){return 3*(t+r)/4-r}(0,o,d)),l=0,c=d>0?o-4:o;for(r=0;r<c;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;2===d&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[l++]=255&t);1===d&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t);return u},t.fromByteArray=function(e){for(var t,i=e.length,n=i%3,s=[],o=16383,a=0,u=i-n;a<u;a+=o)s.push(d(e,a,a+o>u?u:a+o));1===n?(t=e[i-1],s.push(r[t>>2]+r[t<<4&63]+"==")):2===n&&(t=(e[i-2]<<8)+e[i-1],s.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"="));return s.join("")};for(var r=[],i=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)r[o]=s[o],i[s.charCodeAt(o)]=o;function a(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 d(e,t,i){for(var n,s,o=[],a=t;a<i;a+=3)n=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(r[(s=n)>>18&63]+r[s>>12&63]+r[s>>6&63]+r[63&s]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},2823:function(e,t,r){!function(e,t){"use strict";function i(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function s(e,t,r){if(s.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=s:t.BN=s,s.BN=s,s.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(8379).Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void i(!1,"Invalid character in "+e)}function d(e,t,r){var i=a(e,r);return r-1>=t&&(i|=a(e,r-1)<<4),i}function u(e,t,r,n){for(var s=0,o=0,a=Math.min(e.length,r),d=t;d<a;d++){var u=e.charCodeAt(d)-48;s*=n,o=u>=49?u-49+10:u>=17?u-17+10:u,i(u>=0&&o<n,"Invalid character"),s+=o}return s}function l(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(s.isBN=function(e){return e instanceof s||null!==e&&"object"==typeof e&&e.constructor.wordSize===s.wordSize&&Array.isArray(e.words)},s.max=function(e,t){return e.cmp(t)>0?e:t},s.min=function(e,t){return e.cmp(t)<0?e:t},s.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),i(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<e.length&&(16===t?this._parseHex(e,n,r):(this._parseBase(e,t,n),"le"===r&&this._initArray(this.toArray(),t,r)))},s.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(i(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},s.prototype._initArray=function(e,t,r){if(i("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var s,o,a=0;if("be"===r)for(n=e.length-1,s=0;n>=0;n-=3)o=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===r)for(n=0,s=0;n<e.length;n+=3)o=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this._strip()},s.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,s=0,o=0;if("be"===r)for(i=e.length-1;i>=t;i-=2)n=d(e,t,i)<<s,this.words[o]|=67108863&n,s>=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;else for(i=(e.length-t)%2==0?t+1:t;i<e.length;i+=2)n=d(e,t,i)<<s,this.words[o]|=67108863&n,s>=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;this._strip()},s.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var s=e.length-r,o=s%i,a=Math.min(s,s-o)+r,d=0,l=r;l<a;l+=i)d=u(e,l,l+i,t),this.imuln(n),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(0!==o){var c=1;for(d=u(e,l,e.length,t),l=0;l<o;l++)c*=t;this.imuln(c),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}this._strip()},s.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},s.prototype._move=function(e){l(e,this)},s.prototype.clone=function(){var e=new s(null);return this.copy(e),e},s.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch(e){s.prototype.inspect=c}else s.prototype.inspect=c;function c(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var p=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[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];s.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,s=0,o=0;o<this.length;o++){var a=this.words[o],d=(16777215&(a<<n|s)).toString(16);s=a>>>24-n&16777215,(n+=2)>=26&&(n-=26,o--),r=0!==s||o!==this.length-1?p[6-d.length]+d+r:d+r}for(0!==s&&(r=s.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 u=h[e],l=f[e];r="";var c=this.clone();for(c.negative=0;!c.isZero();){var y=c.modrn(l).toString(e);r=(c=c.idivn(l)).isZero()?y+r:p[u-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},s.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&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(e,t){return this.toArrayLike(o,e,t)}),s.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function y(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],s=0|t.words[0],o=n*s,a=67108863&o,d=o/67108864|0;r.words[0]=a;for(var u=1;u<i;u++){for(var l=d>>>26,c=67108863&d,p=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=p;h++){var f=u-h|0;l+=(o=(n=0|e.words[f])*(s=0|t.words[h])+c)/67108864|0,c=67108863&o}r.words[u]=0|c,d=0|l}return 0!==d?r.words[u]=0|d:r.length--,r._strip()}s.prototype.toArrayLike=function(e,t,r){this._strip();var n=this.byteLength(),s=r||Math.max(1,n);i(n<=s,"byte array longer than desired length"),i(s>0,"Requested array length <= 0");var o=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,s);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,n),o},s.prototype._toArrayLikeLE=function(e,t){for(var r=0,i=0,n=0,s=0;n<this.length;n++){var o=this.words[n]<<s|i;e[r++]=255&o,r<e.length&&(e[r++]=o>>8&255),r<e.length&&(e[r++]=o>>16&255),6===s?(r<e.length&&(e[r++]=o>>24&255),i=0,s=0):(i=o>>>24,s+=2)}if(r<e.length)for(e[r++]=i;r<e.length;)e[r++]=0},s.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,i=0,n=0,s=0;n<this.length;n++){var o=this.words[n]<<s|i;e[r--]=255&o,r>=0&&(e[r--]=o>>8&255),r>=0&&(e[r--]=o>>16&255),6===s?(r>=0&&(e[r--]=o>>24&255),i=0,s=0):(i=o>>>24,s+=2)}if(r>=0)for(e[r--]=i;r>=0;)e[r--]=0},Math.clz32?s.prototype._countBits=function(e){return 32-Math.clz32(e)}:s.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},s.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},s.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},s.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},s.prototype.ior=function(e){return i(0==(this.negative|e.negative)),this.iuor(e)},s.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},s.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},s.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},s.prototype.iand=function(e){return i(0==(this.negative|e.negative)),this.iuand(e)},s.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},s.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},s.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this._strip()},s.prototype.ixor=function(e){return i(0==(this.negative|e.negative)),this.iuxor(e)},s.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},s.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},s.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},s.prototype.notn=function(e){return this.clone().inotn(e)},s.prototype.setn=function(e,t){i("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<n:this.words[r]&~(1<<n),this._strip()},s.prototype.iadd=function(e){var t,r,i;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0,s=0;s<i.length;s++)t=(0|r.words[s])+(0|i.words[s])+n,this.words[s]=67108863&t,n=t>>>26;for(;0!==n&&s<r.length;s++)t=(0|r.words[s])+n,this.words[s]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this},s.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},s.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,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var s=0,o=0;o<i.length;o++)s=(t=(0|r.words[o])-(0|i.words[o])+s)>>26,this.words[o]=67108863&t;for(;0!==s&&o<r.length;o++)s=(t=(0|r.words[o])+s)>>26,this.words[o]=67108863&t;if(0===s&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(e){return this.clone().isub(e)};var g=function(e,t,r){var i,n,s,o=e.words,a=t.words,d=r.words,u=0,l=0|o[0],c=8191&l,p=l>>>13,h=0|o[1],f=8191&h,y=h>>>13,g=0|o[2],m=8191&g,v=g>>>13,b=0|o[3],_=8191&b,w=b>>>13,T=0|o[4],E=8191&T,S=T>>>13,A=0|o[5],R=8191&A,M=A>>>13,I=0|o[6],O=8191&I,x=I>>>13,k=0|o[7],C=8191&k,P=k>>>13,D=0|o[8],N=8191&D,B=D>>>13,q=0|o[9],L=8191&q,j=q>>>13,F=0|a[0],U=8191&F,z=F>>>13,H=0|a[1],G=8191&H,K=H>>>13,W=0|a[2],V=8191&W,$=W>>>13,Z=0|a[3],Y=8191&Z,J=Z>>>13,X=0|a[4],Q=8191&X,ee=X>>>13,te=0|a[5],re=8191&te,ie=te>>>13,ne=0|a[6],se=8191&ne,oe=ne>>>13,ae=0|a[7],de=8191&ae,ue=ae>>>13,le=0|a[8],ce=8191&le,pe=le>>>13,he=0|a[9],fe=8191&he,ye=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(i=Math.imul(c,U))|0)+((8191&(n=(n=Math.imul(c,z))+Math.imul(p,U)|0))<<13)|0;u=((s=Math.imul(p,z))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(f,U),n=(n=Math.imul(f,z))+Math.imul(y,U)|0,s=Math.imul(y,z);var me=(u+(i=i+Math.imul(c,G)|0)|0)+((8191&(n=(n=n+Math.imul(c,K)|0)+Math.imul(p,G)|0))<<13)|0;u=((s=s+Math.imul(p,K)|0)+(n>>>13)|0)+(me>>>26)|0,me&=67108863,i=Math.imul(m,U),n=(n=Math.imul(m,z))+Math.imul(v,U)|0,s=Math.imul(v,z),i=i+Math.imul(f,G)|0,n=(n=n+Math.imul(f,K)|0)+Math.imul(y,G)|0,s=s+Math.imul(y,K)|0;var ve=(u+(i=i+Math.imul(c,V)|0)|0)+((8191&(n=(n=n+Math.imul(c,$)|0)+Math.imul(p,V)|0))<<13)|0;u=((s=s+Math.imul(p,$)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(_,U),n=(n=Math.imul(_,z))+Math.imul(w,U)|0,s=Math.imul(w,z),i=i+Math.imul(m,G)|0,n=(n=n+Math.imul(m,K)|0)+Math.imul(v,G)|0,s=s+Math.imul(v,K)|0,i=i+Math.imul(f,V)|0,n=(n=n+Math.imul(f,$)|0)+Math.imul(y,V)|0,s=s+Math.imul(y,$)|0;var be=(u+(i=i+Math.imul(c,Y)|0)|0)+((8191&(n=(n=n+Math.imul(c,J)|0)+Math.imul(p,Y)|0))<<13)|0;u=((s=s+Math.imul(p,J)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(E,U),n=(n=Math.imul(E,z))+Math.imul(S,U)|0,s=Math.imul(S,z),i=i+Math.imul(_,G)|0,n=(n=n+Math.imul(_,K)|0)+Math.imul(w,G)|0,s=s+Math.imul(w,K)|0,i=i+Math.imul(m,V)|0,n=(n=n+Math.imul(m,$)|0)+Math.imul(v,V)|0,s=s+Math.imul(v,$)|0,i=i+Math.imul(f,Y)|0,n=(n=n+Math.imul(f,J)|0)+Math.imul(y,Y)|0,s=s+Math.imul(y,J)|0;var _e=(u+(i=i+Math.imul(c,Q)|0)|0)+((8191&(n=(n=n+Math.imul(c,ee)|0)+Math.imul(p,Q)|0))<<13)|0;u=((s=s+Math.imul(p,ee)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(R,U),n=(n=Math.imul(R,z))+Math.imul(M,U)|0,s=Math.imul(M,z),i=i+Math.imul(E,G)|0,n=(n=n+Math.imul(E,K)|0)+Math.imul(S,G)|0,s=s+Math.imul(S,K)|0,i=i+Math.imul(_,V)|0,n=(n=n+Math.imul(_,$)|0)+Math.imul(w,V)|0,s=s+Math.imul(w,$)|0,i=i+Math.imul(m,Y)|0,n=(n=n+Math.imul(m,J)|0)+Math.imul(v,Y)|0,s=s+Math.imul(v,J)|0,i=i+Math.imul(f,Q)|0,n=(n=n+Math.imul(f,ee)|0)+Math.imul(y,Q)|0,s=s+Math.imul(y,ee)|0;var we=(u+(i=i+Math.imul(c,re)|0)|0)+((8191&(n=(n=n+Math.imul(c,ie)|0)+Math.imul(p,re)|0))<<13)|0;u=((s=s+Math.imul(p,ie)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(O,U),n=(n=Math.imul(O,z))+Math.imul(x,U)|0,s=Math.imul(x,z),i=i+Math.imul(R,G)|0,n=(n=n+Math.imul(R,K)|0)+Math.imul(M,G)|0,s=s+Math.imul(M,K)|0,i=i+Math.imul(E,V)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(S,V)|0,s=s+Math.imul(S,$)|0,i=i+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,J)|0)+Math.imul(w,Y)|0,s=s+Math.imul(w,J)|0,i=i+Math.imul(m,Q)|0,n=(n=n+Math.imul(m,ee)|0)+Math.imul(v,Q)|0,s=s+Math.imul(v,ee)|0,i=i+Math.imul(f,re)|0,n=(n=n+Math.imul(f,ie)|0)+Math.imul(y,re)|0,s=s+Math.imul(y,ie)|0;var Te=(u+(i=i+Math.imul(c,se)|0)|0)+((8191&(n=(n=n+Math.imul(c,oe)|0)+Math.imul(p,se)|0))<<13)|0;u=((s=s+Math.imul(p,oe)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(C,U),n=(n=Math.imul(C,z))+Math.imul(P,U)|0,s=Math.imul(P,z),i=i+Math.imul(O,G)|0,n=(n=n+Math.imul(O,K)|0)+Math.imul(x,G)|0,s=s+Math.imul(x,K)|0,i=i+Math.imul(R,V)|0,n=(n=n+Math.imul(R,$)|0)+Math.imul(M,V)|0,s=s+Math.imul(M,$)|0,i=i+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,J)|0)+Math.imul(S,Y)|0,s=s+Math.imul(S,J)|0,i=i+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,s=s+Math.imul(w,ee)|0,i=i+Math.imul(m,re)|0,n=(n=n+Math.imul(m,ie)|0)+Math.imul(v,re)|0,s=s+Math.imul(v,ie)|0,i=i+Math.imul(f,se)|0,n=(n=n+Math.imul(f,oe)|0)+Math.imul(y,se)|0,s=s+Math.imul(y,oe)|0;var Ee=(u+(i=i+Math.imul(c,de)|0)|0)+((8191&(n=(n=n+Math.imul(c,ue)|0)+Math.imul(p,de)|0))<<13)|0;u=((s=s+Math.imul(p,ue)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(N,U),n=(n=Math.imul(N,z))+Math.imul(B,U)|0,s=Math.imul(B,z),i=i+Math.imul(C,G)|0,n=(n=n+Math.imul(C,K)|0)+Math.imul(P,G)|0,s=s+Math.imul(P,K)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,$)|0)+Math.imul(x,V)|0,s=s+Math.imul(x,$)|0,i=i+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,J)|0)+Math.imul(M,Y)|0,s=s+Math.imul(M,J)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(S,Q)|0,s=s+Math.imul(S,ee)|0,i=i+Math.imul(_,re)|0,n=(n=n+Math.imul(_,ie)|0)+Math.imul(w,re)|0,s=s+Math.imul(w,ie)|0,i=i+Math.imul(m,se)|0,n=(n=n+Math.imul(m,oe)|0)+Math.imul(v,se)|0,s=s+Math.imul(v,oe)|0,i=i+Math.imul(f,de)|0,n=(n=n+Math.imul(f,ue)|0)+Math.imul(y,de)|0,s=s+Math.imul(y,ue)|0;var Se=(u+(i=i+Math.imul(c,ce)|0)|0)+((8191&(n=(n=n+Math.imul(c,pe)|0)+Math.imul(p,ce)|0))<<13)|0;u=((s=s+Math.imul(p,pe)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(L,U),n=(n=Math.imul(L,z))+Math.imul(j,U)|0,s=Math.imul(j,z),i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,K)|0)+Math.imul(B,G)|0,s=s+Math.imul(B,K)|0,i=i+Math.imul(C,V)|0,n=(n=n+Math.imul(C,$)|0)+Math.imul(P,V)|0,s=s+Math.imul(P,$)|0,i=i+Math.imul(O,Y)|0,n=(n=n+Math.imul(O,J)|0)+Math.imul(x,Y)|0,s=s+Math.imul(x,J)|0,i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,ee)|0)+Math.imul(M,Q)|0,s=s+Math.imul(M,ee)|0,i=i+Math.imul(E,re)|0,n=(n=n+Math.imul(E,ie)|0)+Math.imul(S,re)|0,s=s+Math.imul(S,ie)|0,i=i+Math.imul(_,se)|0,n=(n=n+Math.imul(_,oe)|0)+Math.imul(w,se)|0,s=s+Math.imul(w,oe)|0,i=i+Math.imul(m,de)|0,n=(n=n+Math.imul(m,ue)|0)+Math.imul(v,de)|0,s=s+Math.imul(v,ue)|0,i=i+Math.imul(f,ce)|0,n=(n=n+Math.imul(f,pe)|0)+Math.imul(y,ce)|0,s=s+Math.imul(y,pe)|0;var Ae=(u+(i=i+Math.imul(c,fe)|0)|0)+((8191&(n=(n=n+Math.imul(c,ye)|0)+Math.imul(p,fe)|0))<<13)|0;u=((s=s+Math.imul(p,ye)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(L,G),n=(n=Math.imul(L,K))+Math.imul(j,G)|0,s=Math.imul(j,K),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,$)|0)+Math.imul(B,V)|0,s=s+Math.imul(B,$)|0,i=i+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,J)|0)+Math.imul(P,Y)|0,s=s+Math.imul(P,J)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,ee)|0)+Math.imul(x,Q)|0,s=s+Math.imul(x,ee)|0,i=i+Math.imul(R,re)|0,n=(n=n+Math.imul(R,ie)|0)+Math.imul(M,re)|0,s=s+Math.imul(M,ie)|0,i=i+Math.imul(E,se)|0,n=(n=n+Math.imul(E,oe)|0)+Math.imul(S,se)|0,s=s+Math.imul(S,oe)|0,i=i+Math.imul(_,de)|0,n=(n=n+Math.imul(_,ue)|0)+Math.imul(w,de)|0,s=s+Math.imul(w,ue)|0,i=i+Math.imul(m,ce)|0,n=(n=n+Math.imul(m,pe)|0)+Math.imul(v,ce)|0,s=s+Math.imul(v,pe)|0;var Re=(u+(i=i+Math.imul(f,fe)|0)|0)+((8191&(n=(n=n+Math.imul(f,ye)|0)+Math.imul(y,fe)|0))<<13)|0;u=((s=s+Math.imul(y,ye)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul(L,V),n=(n=Math.imul(L,$))+Math.imul(j,V)|0,s=Math.imul(j,$),i=i+Math.imul(N,Y)|0,n=(n=n+Math.imul(N,J)|0)+Math.imul(B,Y)|0,s=s+Math.imul(B,J)|0,i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,ee)|0)+Math.imul(P,Q)|0,s=s+Math.imul(P,ee)|0,i=i+Math.imul(O,re)|0,n=(n=n+Math.imul(O,ie)|0)+Math.imul(x,re)|0,s=s+Math.imul(x,ie)|0,i=i+Math.imul(R,se)|0,n=(n=n+Math.imul(R,oe)|0)+Math.imul(M,se)|0,s=s+Math.imul(M,oe)|0,i=i+Math.imul(E,de)|0,n=(n=n+Math.imul(E,ue)|0)+Math.imul(S,de)|0,s=s+Math.imul(S,ue)|0,i=i+Math.imul(_,ce)|0,n=(n=n+Math.imul(_,pe)|0)+Math.imul(w,ce)|0,s=s+Math.imul(w,pe)|0;var Me=(u+(i=i+Math.imul(m,fe)|0)|0)+((8191&(n=(n=n+Math.imul(m,ye)|0)+Math.imul(v,fe)|0))<<13)|0;u=((s=s+Math.imul(v,ye)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(L,Y),n=(n=Math.imul(L,J))+Math.imul(j,Y)|0,s=Math.imul(j,J),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,ee)|0)+Math.imul(B,Q)|0,s=s+Math.imul(B,ee)|0,i=i+Math.imul(C,re)|0,n=(n=n+Math.imul(C,ie)|0)+Math.imul(P,re)|0,s=s+Math.imul(P,ie)|0,i=i+Math.imul(O,se)|0,n=(n=n+Math.imul(O,oe)|0)+Math.imul(x,se)|0,s=s+Math.imul(x,oe)|0,i=i+Math.imul(R,de)|0,n=(n=n+Math.imul(R,ue)|0)+Math.imul(M,de)|0,s=s+Math.imul(M,ue)|0,i=i+Math.imul(E,ce)|0,n=(n=n+Math.imul(E,pe)|0)+Math.imul(S,ce)|0,s=s+Math.imul(S,pe)|0;var Ie=(u+(i=i+Math.imul(_,fe)|0)|0)+((8191&(n=(n=n+Math.imul(_,ye)|0)+Math.imul(w,fe)|0))<<13)|0;u=((s=s+Math.imul(w,ye)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(L,Q),n=(n=Math.imul(L,ee))+Math.imul(j,Q)|0,s=Math.imul(j,ee),i=i+Math.imul(N,re)|0,n=(n=n+Math.imul(N,ie)|0)+Math.imul(B,re)|0,s=s+Math.imul(B,ie)|0,i=i+Math.imul(C,se)|0,n=(n=n+Math.imul(C,oe)|0)+Math.imul(P,se)|0,s=s+Math.imul(P,oe)|0,i=i+Math.imul(O,de)|0,n=(n=n+Math.imul(O,ue)|0)+Math.imul(x,de)|0,s=s+Math.imul(x,ue)|0,i=i+Math.imul(R,ce)|0,n=(n=n+Math.imul(R,pe)|0)+Math.imul(M,ce)|0,s=s+Math.imul(M,pe)|0;var Oe=(u+(i=i+Math.imul(E,fe)|0)|0)+((8191&(n=(n=n+Math.imul(E,ye)|0)+Math.imul(S,fe)|0))<<13)|0;u=((s=s+Math.imul(S,ye)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(L,re),n=(n=Math.imul(L,ie))+Math.imul(j,re)|0,s=Math.imul(j,ie),i=i+Math.imul(N,se)|0,n=(n=n+Math.imul(N,oe)|0)+Math.imul(B,se)|0,s=s+Math.imul(B,oe)|0,i=i+Math.imul(C,de)|0,n=(n=n+Math.imul(C,ue)|0)+Math.imul(P,de)|0,s=s+Math.imul(P,ue)|0,i=i+Math.imul(O,ce)|0,n=(n=n+Math.imul(O,pe)|0)+Math.imul(x,ce)|0,s=s+Math.imul(x,pe)|0;var xe=(u+(i=i+Math.imul(R,fe)|0)|0)+((8191&(n=(n=n+Math.imul(R,ye)|0)+Math.imul(M,fe)|0))<<13)|0;u=((s=s+Math.imul(M,ye)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(L,se),n=(n=Math.imul(L,oe))+Math.imul(j,se)|0,s=Math.imul(j,oe),i=i+Math.imul(N,de)|0,n=(n=n+Math.imul(N,ue)|0)+Math.imul(B,de)|0,s=s+Math.imul(B,ue)|0,i=i+Math.imul(C,ce)|0,n=(n=n+Math.imul(C,pe)|0)+Math.imul(P,ce)|0,s=s+Math.imul(P,pe)|0;var ke=(u+(i=i+Math.imul(O,fe)|0)|0)+((8191&(n=(n=n+Math.imul(O,ye)|0)+Math.imul(x,fe)|0))<<13)|0;u=((s=s+Math.imul(x,ye)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(L,de),n=(n=Math.imul(L,ue))+Math.imul(j,de)|0,s=Math.imul(j,ue),i=i+Math.imul(N,ce)|0,n=(n=n+Math.imul(N,pe)|0)+Math.imul(B,ce)|0,s=s+Math.imul(B,pe)|0;var Ce=(u+(i=i+Math.imul(C,fe)|0)|0)+((8191&(n=(n=n+Math.imul(C,ye)|0)+Math.imul(P,fe)|0))<<13)|0;u=((s=s+Math.imul(P,ye)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul(L,ce),n=(n=Math.imul(L,pe))+Math.imul(j,ce)|0,s=Math.imul(j,pe);var Pe=(u+(i=i+Math.imul(N,fe)|0)|0)+((8191&(n=(n=n+Math.imul(N,ye)|0)+Math.imul(B,fe)|0))<<13)|0;u=((s=s+Math.imul(B,ye)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var De=(u+(i=Math.imul(L,fe))|0)+((8191&(n=(n=Math.imul(L,ye))+Math.imul(j,fe)|0))<<13)|0;return u=((s=Math.imul(j,ye))+(n>>>13)|0)+(De>>>26)|0,De&=67108863,d[0]=ge,d[1]=me,d[2]=ve,d[3]=be,d[4]=_e,d[5]=we,d[6]=Te,d[7]=Ee,d[8]=Se,d[9]=Ae,d[10]=Re,d[11]=Me,d[12]=Ie,d[13]=Oe,d[14]=xe,d[15]=ke,d[16]=Ce,d[17]=Pe,d[18]=De,0!==u&&(d[19]=u,r.length++),r};function m(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,s=0;s<r.length-1;s++){var o=n;n=0;for(var a=67108863&i,d=Math.min(s,t.length-1),u=Math.max(0,s-e.length+1);u<=d;u++){var l=s-u,c=(0|e.words[l])*(0|t.words[u]),p=67108863&c;a=67108863&(p=p+a|0),n+=(o=(o=o+(c/67108864|0)|0)+(p>>>26)|0)>>>26,o&=67108863}r.words[s]=a,i=o,o=n}return 0!==i?r.words[s]=i:r.length--,r._strip()}function v(e,t,r){return m(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(g=y),s.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):r<63?y(this,e,t):r<1024?m(this,e,t):v(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=s.prototype._countBits(e)-1,i=0;i<e;i++)t[i]=this.revBin(i,r,e);return t},b.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var i=0,n=0;n<t;n++)i|=(1&e)<<t-n-1,e>>=1;return i},b.prototype.permute=function(e,t,r,i,n,s){for(var o=0;o<s;o++)i[o]=t[e[o]],n[o]=r[e[o]]},b.prototype.transform=function(e,t,r,i,n,s){this.permute(s,e,t,r,i,n);for(var o=1;o<n;o<<=1)for(var a=o<<1,d=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),l=0;l<n;l+=a)for(var c=d,p=u,h=0;h<o;h++){var f=r[l+h],y=i[l+h],g=r[l+h+o],m=i[l+h+o],v=c*g-p*m;m=c*m+p*g,g=v,r[l+h]=f+g,i[l+h]=y+m,r[l+h+o]=f-g,i[l+h+o]=y-m,h!==a&&(v=d*c-u*p,p=d*p+u*c,c=v)}},b.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},b.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=e[i];e[i]=e[r-i-1],e[r-i-1]=n,n=t[i],t[i]=-t[r-i-1],t[r-i-1]=-n}},b.prototype.normalize13b=function(e,t){for(var r=0,i=0;i<t/2;i++){var n=8192*Math.round(e[2*i+1]/t)+Math.round(e[2*i]/t)+r;e[i]=67108863&n,r=n<67108864?0:n/67108864|0}return e},b.prototype.convert13b=function(e,t,r,n){for(var s=0,o=0;o<t;o++)s+=0|e[o],r[2*o]=8191&s,s>>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*t;o<n;++o)r[o]=0;i(0===s),i(0==(-8192&s))},b.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},b.prototype.mulp=function(e,t,r){var i=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(i),s=this.stub(i),o=new Array(i),a=new Array(i),d=new Array(i),u=new Array(i),l=new Array(i),c=new Array(i),p=r.words;p.length=i,this.convert13b(e.words,e.length,o,i),this.convert13b(t.words,t.length,u,i),this.transform(o,s,a,d,i,n),this.transform(u,s,l,c,i,n);for(var h=0;h<i;h++){var f=a[h]*l[h]-d[h]*c[h];d[h]=a[h]*c[h]+d[h]*l[h],a[h]=f}return this.conjugate(a,d,i),this.transform(a,d,p,s,i,n),this.conjugate(p,s,i),this.normalize13b(p,i),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},s.prototype.mul=function(e){var t=new s(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},s.prototype.mulf=function(e){var t=new s(null);return t.words=new Array(this.length+e.length),v(this,e,t)},s.prototype.imul=function(e){return this.clone().mulTo(e,this)},s.prototype.imuln=function(e){var t=e<0;t&&(e=-e),i("number"==typeof e),i(e<67108864);for(var r=0,n=0;n<this.length;n++){var s=(0|this.words[n])*e,o=(67108863&s)+(67108863&r);r>>=26,r+=s/67108864|0,r+=o>>>26,this.words[n]=67108863&o}return 0!==r&&(this.words[n]=r,this.length++),t?this.ineg():this},s.prototype.muln=function(e){return this.clone().imuln(e)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=e.words[i]>>>n&1}return t}(e);if(0===t.length)return new s(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var n=r.sqr();i<t.length;i++,n=n.sqr())0!==t[i]&&(r=r.mul(n));return r},s.prototype.iushln=function(e){i("number"==typeof e&&e>=0);var t,r=e%26,n=(e-r)/26,s=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t<this.length;t++){var a=this.words[t]&s,d=(0|this.words[t])-a<<r;this.words[t]=d|o,o=a>>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this._strip()},s.prototype.ishln=function(e){return i(0===this.negative),this.iushln(e)},s.prototype.iushrn=function(e,t,r){var n;i("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var s=e%26,o=Math.min((e-s)/26,this.length),a=67108863^67108863>>>s<<s,d=r;if(n-=o,n=Math.max(0,n),d){for(var u=0;u<o;u++)d.words[u]=this.words[u];d.length=o}if(0===o);else if(this.length>o)for(this.length-=o,u=0;u<this.length;u++)this.words[u]=this.words[u+o];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=n);u--){var c=0|this.words[u];this.words[u]=l<<26-s|c>>>s,l=c&a}return d&&0!==l&&(d.words[d.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},s.prototype.shln=function(e){return this.clone().ishln(e)},s.prototype.ushln=function(e){return this.clone().iushln(e)},s.prototype.shrn=function(e){return this.clone().ishrn(e)},s.prototype.ushrn=function(e){return this.clone().iushrn(e)},s.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<<t;return!(this.length<=r)&&!!(this.words[r]&n)},s.prototype.imaskn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(i(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 n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return this._strip()},s.prototype.maskn=function(e){return this.clone().imaskn(e)},s.prototype.iaddn=function(e){return i("number"==typeof e),i(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},s.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},s.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},s.prototype.addn=function(e){return this.clone().iaddn(e)},s.prototype.subn=function(e){return this.clone().isubn(e)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(e,t,r){var n,s,o=e.length+r;this._expand(o);var a=0;for(n=0;n<e.length;n++){s=(0|this.words[n+r])+a;var d=(0|e.words[n])*t;a=((s-=67108863&d)>>26)-(d/67108864|0),this.words[n+r]=67108863&s}for(;n<this.length-r;n++)a=(s=(0|this.words[n+r])+a)>>26,this.words[n+r]=67108863&s;if(0===a)return this._strip();for(i(-1===a),a=0,n=0;n<this.length;n++)a=(s=-(0|this.words[n])+a)>>26,this.words[n]=67108863&s;return this.negative=1,this._strip()},s.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,o=0|n.words[n.length-1];0!==(r=26-this._countBits(o))&&(n=n.ushln(r),i.iushln(r),o=0|n.words[n.length-1]);var a,d=i.length-n.length;if("mod"!==t){(a=new s(null)).length=d+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var l=i.clone()._ishlnsubmul(n,1,d);0===l.negative&&(i=l,a&&(a.words[d]=1));for(var c=d-1;c>=0;c--){var p=67108864*(0|i.words[n.length+c])+(0|i.words[n.length+c-1]);for(p=Math.min(p/o|0,67108863),i._ishlnsubmul(n,p,c);0!==i.negative;)p--,i.negative=0,i._ishlnsubmul(n,1,c),i.isZero()||(i.negative^=1);a&&(a.words[c]=p)}return a&&a._strip(),i._strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},s.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(n=a.div.neg()),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:n,mod:o}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:a.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new s(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new s(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new s(this.modrn(e.words[0]))}:this._wordDiv(e,t);var n,o,a},s.prototype.div=function(e){return this.divmod(e,"div",!1).div},s.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},s.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},s.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),s=r.cmp(i);return s<0||1===n&&0===s?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},s.prototype.modrn=function(e){var t=e<0;t&&(e=-e),i(e<=67108863);for(var r=(1<<26)%e,n=0,s=this.length-1;s>=0;s--)n=(r*n+(0|this.words[s]))%e;return t?-n:n},s.prototype.modn=function(e){return this.modrn(e)},s.prototype.idivn=function(e){var t=e<0;t&&(e=-e),i(e<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var s=(0|this.words[n])+67108864*r;this.words[n]=s/e|0,r=s%e}return this._strip(),t?this.ineg():this},s.prototype.divn=function(e){return this.clone().idivn(e)},s.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new s(1),o=new s(0),a=new s(0),d=new s(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var l=r.clone(),c=t.clone();!t.isZero();){for(var p=0,h=1;0==(t.words[0]&h)&&p<26;++p,h<<=1);if(p>0)for(t.iushrn(p);p-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(l),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var f=0,y=1;0==(r.words[0]&y)&&f<26;++f,y<<=1);if(f>0)for(r.iushrn(f);f-- >0;)(a.isOdd()||d.isOdd())&&(a.iadd(l),d.isub(c)),a.iushrn(1),d.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(a),o.isub(d)):(r.isub(t),a.isub(n),d.isub(o))}return{a,b:d,gcd:r.iushln(u)}},s.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,o=new s(1),a=new s(0),d=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,l=1;0==(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(d),o.iushrn(1);for(var c=0,p=1;0==(r.words[0]&p)&&c<26;++c,p<<=1);if(c>0)for(r.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(d),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(a)):(r.isub(t),a.isub(o))}return(n=0===t.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(e),n},s.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var s=t;t=r,r=s}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},s.prototype.invm=function(e){return this.egcd(e).a.umod(e)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(e){return this.words[0]&e},s.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var s=n,o=r;0!==s&&o<this.length;o++){var a=0|this.words[o];s=(a+=s)>>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.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),i(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},s.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},s.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},s.prototype.gtn=function(e){return 1===this.cmpn(e)},s.prototype.gt=function(e){return 1===this.cmp(e)},s.prototype.gten=function(e){return this.cmpn(e)>=0},s.prototype.gte=function(e){return this.cmp(e)>=0},s.prototype.ltn=function(e){return-1===this.cmpn(e)},s.prototype.lt=function(e){return-1===this.cmp(e)},s.prototype.lten=function(e){return this.cmpn(e)<=0},s.prototype.lte=function(e){return this.cmp(e)<=0},s.prototype.eqn=function(e){return 0===this.cmpn(e)},s.prototype.eq=function(e){return 0===this.cmp(e)},s.red=function(e){return new R(e)},s.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(e){return this.red=e,this},s.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},s.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},s.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},s.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},s.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},s.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},s.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},s.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(e){return i(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var _={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new s(t,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function T(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function R(e){if("string"==typeof e){var t=s._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){R.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var e=new s(null);return e.words=new Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},n(T,w),T.prototype.split=function(e,t){for(var r=4194303,i=Math.min(e.length,9),n=0;n<i;n++)t.words[n]=e.words[n];if(t.length=i,e.length<=9)return e.words[0]=0,void(e.length=1);var s=e.words[9];for(t.words[t.length++]=s&r,n=10;n<e.length;n++){var o=0|e.words[n];e.words[n-10]=(o&r)<<4|s>>>22,s=o}s>>>=22,e.words[n-10]=s,0===s&&e.length>10?e.length-=10:e.length-=9},T.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(E,w),n(S,w),n(A,w),A.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},s._prime=function(e){if(_[e])return _[e];var t;if("k256"===e)t=new T;else if("p224"===e)t=new E;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return _[e]=t,t},R.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},R.prototype._verify2=function(e,t){i(0==(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},R.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},R.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},R.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)},R.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},R.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)},R.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},R.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},R.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},R.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},R.prototype.isqr=function(e){return this.imul(e,e.clone())},R.prototype.sqr=function(e){return this.mul(e,e)},R.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2==1),3===t){var r=this.m.add(new s(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var a=new s(1).toRed(this),d=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new s(2*l*l).toRed(this);0!==this.pow(l,u).cmp(d);)l.redIAdd(d);for(var c=this.pow(l,n),p=this.pow(e,n.addn(1).iushrn(1)),h=this.pow(e,n),f=o;0!==h.cmp(a);){for(var y=h,g=0;0!==y.cmp(a);g++)y=y.redSqr();i(g<f);var m=this.pow(c,new s(1).iushln(f-g-1));p=p.redMul(m),c=m.redSqr(),h=h.redMul(c),f=g}return p},R.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},R.prototype.pow=function(e,t){if(t.isZero())return new s(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new s(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var n=r[0],o=0,a=0,d=t.bitLength()%26;for(0===d&&(d=26),i=t.length-1;i>=0;i--){for(var u=t.words[i],l=d-1;l>=0;l--){var c=u>>l&1;n!==r[0]&&(n=this.sqr(n)),0!==c||0!==o?(o<<=1,o|=c,(4===++a||0===i&&0===l)&&(n=this.mul(n,r[o]),a=0,o=0)):a=0}d=26}return n},R.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},R.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},s.mont=function(e){return new M(e)},n(M,R),M.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},M.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},M.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},M.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new s(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},M.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},7048:(e,t,r)=>{var i;function n(e){this.rand=e}if(e.exports=function(e){return i||(i=new n(null)),i.generate(e)},e.exports.Rand=n,n.prototype.generate=function(e){return this._rand(e)},n.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?n.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?n.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(n.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var s=r(3553);if("function"!=typeof s.randomBytes)throw new Error("Not supported");n.prototype._rand=function(e){return s.randomBytes(e)}}catch(e){}},1048:(e,t,r)=>{"use strict";const i=r(7991),n=r(9318),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=d,t.SlowBuffer=function(e){+e!=e&&(e=0);return d.alloc(+e)},t.INSPECT_MAX_BYTES=50;const o=2147483647;function a(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,d.prototype),t}function d(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return c(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!d.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let i=a(r);const n=i.write(e,t);n!==r&&(i=i.slice(0,n));return i}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Z(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return p(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Z(e,ArrayBuffer)||e&&Z(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Z(e,SharedArrayBuffer)||e&&Z(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const i=e.valueOf&&e.valueOf();if(null!=i&&i!==e)return d.from(i,t,r);const n=function(e){if(d.isBuffer(e)){const t=0|f(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||Y(e.length)?a(0):p(e);if("Buffer"===e.type&&Array.isArray(e.data))return p(e.data)}(e);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return d.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return l(e),a(e<0?0:0|f(e))}function p(e){const t=e.length<0?0:0|f(e.length),r=a(t);for(let i=0;i<t;i+=1)r[i]=255&e[i];return r}function h(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let i;return i=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(i,d.prototype),i}function f(e){if(e>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function y(e,t){if(d.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Z(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;let n=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return W(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 i?-1:W(e).length;t=(""+t).toLowerCase(),n=!0}}function g(e,t,r){let i=!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 x(this,t,r);case"utf8":case"utf-8":return R(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return O(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function m(e,t,r){const i=e[t];e[t]=e[r],e[r]=i}function v(e,t,r,i,n){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(n)return-1;r=e.length-1}else if(r<0){if(!n)return-1;r=0}if("string"==typeof t&&(t=d.from(t,i)),d.isBuffer(t))return 0===t.length?-1:b(e,t,r,i,n);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,i,n);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,i,n){let s,o=1,a=e.length,d=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;o=2,a/=2,d/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(n){let i=-1;for(s=r;s<a;s++)if(u(e,s)===u(t,-1===i?0:s-i)){if(-1===i&&(i=s),s-i+1===d)return i*o}else-1!==i&&(s-=s-i),i=-1}else for(r+d>a&&(r=a-d),s=r;s>=0;s--){let r=!0;for(let i=0;i<d;i++)if(u(e,s+i)!==u(t,i)){r=!1;break}if(r)return s}return-1}function _(e,t,r,i){r=Number(r)||0;const n=e.length-r;i?(i=Number(i))>n&&(i=n):i=n;const s=t.length;let o;for(i>s/2&&(i=s/2),o=0;o<i;++o){const i=parseInt(t.substr(2*o,2),16);if(Y(i))return o;e[r+o]=i}return o}function w(e,t,r,i){return $(W(t,e.length-r),e,r,i)}function T(e,t,r,i){return $(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,i)}function E(e,t,r,i){return $(V(t),e,r,i)}function S(e,t,r,i){return $(function(e,t){let r,i,n;const s=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)r=e.charCodeAt(o),i=r>>8,n=r%256,s.push(n),s.push(i);return s}(t,e.length-r),e,r,i)}function A(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function R(e,t,r){r=Math.min(e.length,r);const i=[];let n=t;for(;n<r;){const t=e[n];let s=null,o=t>239?4:t>223?3:t>191?2:1;if(n+o<=r){let r,i,a,d;switch(o){case 1:t<128&&(s=t);break;case 2:r=e[n+1],128==(192&r)&&(d=(31&t)<<6|63&r,d>127&&(s=d));break;case 3:r=e[n+1],i=e[n+2],128==(192&r)&&128==(192&i)&&(d=(15&t)<<12|(63&r)<<6|63&i,d>2047&&(d<55296||d>57343)&&(s=d));break;case 4:r=e[n+1],i=e[n+2],a=e[n+3],128==(192&r)&&128==(192&i)&&128==(192&a)&&(d=(15&t)<<18|(63&r)<<12|(63&i)<<6|63&a,d>65535&&d<1114112&&(s=d))}}null===s?(s=65533,o=1):s>65535&&(s-=65536,i.push(s>>>10&1023|55296),s=56320|1023&s),i.push(s),n+=o}return function(e){const t=e.length;if(t<=M)return String.fromCharCode.apply(String,e);let r="",i=0;for(;i<t;)r+=String.fromCharCode.apply(String,e.slice(i,i+=M));return r}(i)}t.kMaxLength=o,d.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),d.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}}),Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}}),d.poolSize=8192,d.from=function(e,t,r){return u(e,t,r)},Object.setPrototypeOf(d.prototype,Uint8Array.prototype),Object.setPrototypeOf(d,Uint8Array),d.alloc=function(e,t,r){return function(e,t,r){return l(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},d.allocUnsafe=function(e){return c(e)},d.allocUnsafeSlow=function(e){return c(e)},d.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==d.prototype},d.compare=function(e,t){if(Z(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),Z(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)),!d.isBuffer(e)||!d.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,i=t.length;for(let n=0,s=Math.min(r,i);n<s;++n)if(e[n]!==t[n]){r=e[n],i=t[n];break}return r<i?-1:i<r?1:0},d.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},d.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return d.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const i=d.allocUnsafe(t);let n=0;for(r=0;r<e.length;++r){let t=e[r];if(Z(t,Uint8Array))n+t.length>i.length?(d.isBuffer(t)||(t=d.from(t)),t.copy(i,n)):Uint8Array.prototype.set.call(i,t,n);else{if(!d.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(i,n)}n+=t.length}return i},d.byteLength=y,d.prototype._isBuffer=!0,d.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)m(this,t,t+1);return this},d.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},d.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},d.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?R(this,0,e):g.apply(this,arguments)},d.prototype.toLocaleString=d.prototype.toString,d.prototype.equals=function(e){if(!d.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===d.compare(this,e)},d.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},s&&(d.prototype[s]=d.prototype.inspect),d.prototype.compare=function(e,t,r,i,n){if(Z(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw new RangeError("out of range index");if(i>=n&&t>=r)return 0;if(i>=n)return-1;if(t>=r)return 1;if(this===e)return 0;let s=(n>>>=0)-(i>>>=0),o=(r>>>=0)-(t>>>=0);const a=Math.min(s,o),u=this.slice(i,n),l=e.slice(t,r);for(let e=0;e<a;++e)if(u[e]!==l[e]){s=u[e],o=l[e];break}return s<o?-1:o<s?1:0},d.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},d.prototype.indexOf=function(e,t,r){return v(this,e,t,r,!0)},d.prototype.lastIndexOf=function(e,t,r){return v(this,e,t,r,!1)},d.prototype.write=function(e,t,r,i){if(void 0===t)i="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)i=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}const n=this.length-t;if((void 0===r||r>n)&&(r=n),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let s=!1;for(;;)switch(i){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":case"latin1":case"binary":return T(this,e,t,r);case"base64":return E(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,r);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const M=4096;function I(e,t,r){let i="";r=Math.min(e.length,r);for(let n=t;n<r;++n)i+=String.fromCharCode(127&e[n]);return i}function O(e,t,r){let i="";r=Math.min(e.length,r);for(let n=t;n<r;++n)i+=String.fromCharCode(e[n]);return i}function x(e,t,r){const i=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>i)&&(r=i);let n="";for(let i=t;i<r;++i)n+=J[e[i]];return n}function k(e,t,r){const i=e.slice(t,r);let n="";for(let e=0;e<i.length-1;e+=2)n+=String.fromCharCode(i[e]+256*i[e+1]);return n}function C(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,r,i,n,s){if(!d.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>n||t<s)throw new RangeError('"value" argument is out of bounds');if(r+i>e.length)throw new RangeError("Index out of range")}function D(e,t,r,i,n){z(t,i,n,e,r,7);let s=Number(t&BigInt(4294967295));e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function N(e,t,r,i,n){z(t,i,n,e,r,7);let s=Number(t&BigInt(4294967295));e[r+7]=s,s>>=8,e[r+6]=s,s>>=8,e[r+5]=s,s>>=8,e[r+4]=s;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function B(e,t,r,i,n,s){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function q(e,t,r,i,s){return t=+t,r>>>=0,s||B(e,0,r,4),n.write(e,t,r,i,23,4),r+4}function L(e,t,r,i,s){return t=+t,r>>>=0,s||B(e,0,r,8),n.write(e,t,r,i,52,8),r+8}d.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const i=this.subarray(e,t);return Object.setPrototypeOf(i,d.prototype),i},d.prototype.readUintLE=d.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let i=this[e],n=1,s=0;for(;++s<t&&(n*=256);)i+=this[e+s]*n;return i},d.prototype.readUintBE=d.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let i=this[e+--t],n=1;for(;t>0&&(n*=256);)i+=this[e+--t]*n;return i},d.prototype.readUint8=d.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},d.prototype.readBigUInt64LE=X((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const i=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,n=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(i)+(BigInt(n)<<BigInt(32))})),d.prototype.readBigUInt64BE=X((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const i=t*2**24+65536*this[++e]+256*this[++e]+this[++e],n=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(i)<<BigInt(32))+BigInt(n)})),d.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let i=this[e],n=1,s=0;for(;++s<t&&(n*=256);)i+=this[e+s]*n;return n*=128,i>=n&&(i-=Math.pow(2,8*t)),i},d.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let i=t,n=1,s=this[e+--i];for(;i>0&&(n*=256);)s+=this[e+--i]*n;return n*=128,s>=n&&(s-=Math.pow(2,8*t)),s},d.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},d.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},d.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},d.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},d.prototype.readInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},d.prototype.readBigInt64LE=X((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const i=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(i)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),d.prototype.readBigInt64BE=X((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||G(e,this.length-8);const i=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(i)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),d.prototype.readFloatLE=function(e,t){return e>>>=0,t||C(e,4,this.length),n.read(this,e,!0,23,4)},d.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),n.read(this,e,!1,23,4)},d.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),n.read(this,e,!0,52,8)},d.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),n.read(this,e,!1,52,8)},d.prototype.writeUintLE=d.prototype.writeUIntLE=function(e,t,r,i){if(e=+e,t>>>=0,r>>>=0,!i){P(this,e,t,r,Math.pow(2,8*r)-1,0)}let n=1,s=0;for(this[t]=255&e;++s<r&&(n*=256);)this[t+s]=e/n&255;return t+r},d.prototype.writeUintBE=d.prototype.writeUIntBE=function(e,t,r,i){if(e=+e,t>>>=0,r>>>=0,!i){P(this,e,t,r,Math.pow(2,8*r)-1,0)}let n=r-1,s=1;for(this[t+n]=255&e;--n>=0&&(s*=256);)this[t+n]=e/s&255;return t+r},d.prototype.writeUint8=d.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,1,255,0),this[t]=255&e,t+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},d.prototype.writeBigUInt64LE=X((function(e,t=0){return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),d.prototype.writeBigUInt64BE=X((function(e,t=0){return N(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),d.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){const i=Math.pow(2,8*r-1);P(this,e,t,r,i-1,-i)}let n=0,s=1,o=0;for(this[t]=255&e;++n<r&&(s*=256);)e<0&&0===o&&0!==this[t+n-1]&&(o=1),this[t+n]=(e/s>>0)-o&255;return t+r},d.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){const i=Math.pow(2,8*r-1);P(this,e,t,r,i-1,-i)}let n=r-1,s=1,o=0;for(this[t+n]=255&e;--n>=0&&(s*=256);)e<0&&0===o&&0!==this[t+n+1]&&(o=1),this[t+n]=(e/s>>0)-o&255;return t+r},d.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},d.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},d.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},d.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},d.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},d.prototype.writeBigInt64LE=X((function(e,t=0){return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),d.prototype.writeBigInt64BE=X((function(e,t=0){return N(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),d.prototype.writeFloatLE=function(e,t,r){return q(this,e,t,!0,r)},d.prototype.writeFloatBE=function(e,t,r){return q(this,e,t,!1,r)},d.prototype.writeDoubleLE=function(e,t,r){return L(this,e,t,!0,r)},d.prototype.writeDoubleBE=function(e,t,r){return L(this,e,t,!1,r)},d.prototype.copy=function(e,t,r,i){if(!d.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i<r&&(i=r),i===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t<i-r&&(i=e.length-t+r);const n=i-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,i):Uint8Array.prototype.set.call(e,this.subarray(r,i),t),n},d.prototype.fill=function(e,t,r,i){if("string"==typeof e){if("string"==typeof t?(i=t,t=0,r=this.length):"string"==typeof r&&(i=r,r=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!d.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===e.length){const t=e.charCodeAt(0);("utf8"===i&&t<128||"latin1"===i)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let n;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(n=t;n<r;++n)this[n]=e;else{const s=d.isBuffer(e)?e:d.from(e,i),o=s.length;if(0===o)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(n=0;n<r-t;++n)this[n+t]=s[n%o]}return this};const j={};function F(e,t,r){j[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function U(e){let t="",r=e.length;const i="-"===e[0]?1:0;for(;r>=i+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function z(e,t,r,i,n,s){if(e>r||e<t){const i="bigint"==typeof t?"n":"";let n;throw n=s>3?0===t||t===BigInt(0)?`>= 0${i} and < 2${i} ** ${8*(s+1)}${i}`:`>= -(2${i} ** ${8*(s+1)-1}${i}) and < 2 ** ${8*(s+1)-1}${i}`:`>= ${t}${i} and <= ${r}${i}`,new j.ERR_OUT_OF_RANGE("value",n,e)}!function(e,t,r){H(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||G(t,e.length-(r+1))}(i,n,s)}function H(e,t){if("number"!=typeof e)throw new j.ERR_INVALID_ARG_TYPE(t,"number",e)}function G(e,t,r){if(Math.floor(e)!==e)throw H(e,r),new j.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),F("ERR_OUT_OF_RANGE",(function(e,t,r){let i=`The value of "${e}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=U(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=U(n)),n+="n"),i+=` It must be ${t}. Received ${n}`,i}),RangeError);const K=/[^+/0-9A-Za-z-_]/g;function W(e,t){let r;t=t||1/0;const i=e.length;let n=null;const s=[];for(let o=0;o<i;++o){if(r=e.charCodeAt(o),r>55295&&r<57344){if(!n){if(r>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===i){(t-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),n=r;continue}r=65536+(n-55296<<10|r-56320)}else n&&(t-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.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;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return s}function V(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(K,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function $(e,t,r,i){let n;for(n=0;n<i&&!(n+r>=t.length||n>=e.length);++n)t[n+r]=e[n];return n}function Z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}const J=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const i=16*r;for(let n=0;n<16;++n)t[i+n]=e[r]+e[n]}return t}();function X(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},2943:function(e,t,r){var i,n,s;n=[r(8027)],i=function(e){"use strict";var t=function(e,r,n){if(void 0===e&&(e=t.DEFAULT_CAPACITY),void 0===r&&(r=t.DEFAULT_ENDIAN),void 0===n&&(n=t.DEFAULT_NOASSERT),!n){if((e|=0)<0)throw RangeError("Illegal capacity");r=!!r,n=!!n}this.buffer=0===e?i:new ArrayBuffer(e),this.view=0===e?null:new Uint8Array(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=e,this.littleEndian=r,this.noAssert=n};t.VERSION="5.0.1",t.LITTLE_ENDIAN=!0,t.BIG_ENDIAN=!1,t.DEFAULT_CAPACITY=16,t.DEFAULT_ENDIAN=t.BIG_ENDIAN,t.DEFAULT_NOASSERT=!1,t.Long=e||null;var r=t.prototype;r.__isByteBuffer__,Object.defineProperty(r,"__isByteBuffer__",{value:!0,enumerable:!1,configurable:!1});var i=new ArrayBuffer(0),n=String.fromCharCode;function s(e){var t=0;return function(){return t<e.length?e.charCodeAt(t++):null}}function o(){var e=[],t=[];return function(){if(0===arguments.length)return t.join("")+n.apply(String,e);e.length+arguments.length>1024&&(t.push(n.apply(String,e)),e.length=0),Array.prototype.push.apply(e,arguments)}}function a(e,t,r,i,n){var s,o,a=8*n-i-1,d=(1<<a)-1,u=d>>1,l=-7,c=r?n-1:0,p=r?-1:1,h=e[t+c];for(c+=p,s=h&(1<<-l)-1,h>>=-l,l+=a;l>0;s=256*s+e[t+c],c+=p,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=i;l>0;o=256*o+e[t+c],c+=p,l-=8);if(0===s)s=1-u;else{if(s===d)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,i),s-=u}return(h?-1:1)*o*Math.pow(2,s-i)}function d(e,t,r,i,n,s){var o,a,d,u=8*s-n-1,l=(1<<u)-1,c=l>>1,p=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,h=i?0:s-1,f=i?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(d=Math.pow(2,-o))<1&&(o--,d*=2),(t+=o+c>=1?p/d:p*Math.pow(2,1-c))*d>=2&&(o++,d/=2),o+c>=l?(a=0,o=l):o+c>=1?(a=(t*d-1)*Math.pow(2,n),o+=c):(a=t*Math.pow(2,c-1)*Math.pow(2,n),o=0));n>=8;e[r+h]=255&a,h+=f,a/=256,n-=8);for(o=o<<n|a,u+=n;u>0;e[r+h]=255&o,h+=f,o/=256,u-=8);e[r+h-f]|=128*y}t.accessor=function(){return Uint8Array},t.allocate=function(e,r,i){return new t(e,r,i)},t.concat=function(e,r,i,n){"boolean"!=typeof r&&"string"==typeof r||(n=i,i=r,r=void 0);for(var s,o=0,a=0,d=e.length;a<d;++a)t.isByteBuffer(e[a])||(e[a]=t.wrap(e[a],r)),(s=e[a].limit-e[a].offset)>0&&(o+=s);if(0===o)return new t(0,i,n);var u,l=new t(o,i,n);for(a=0;a<d;)(s=(u=e[a++]).limit-u.offset)<=0||(l.view.set(u.view.subarray(u.offset,u.limit),l.offset),l.offset+=s);return l.limit=l.offset,l.offset=0,l},t.isByteBuffer=function(e){return!0===(e&&e.__isByteBuffer__)},t.type=function(){return ArrayBuffer},t.wrap=function(e,i,n,s){if("string"!=typeof i&&(s=n,n=i,i=void 0),"string"==typeof e)switch(void 0===i&&(i="utf8"),i){case"base64":return t.fromBase64(e,n);case"hex":return t.fromHex(e,n);case"binary":return t.fromBinary(e,n);case"utf8":return t.fromUTF8(e,n);case"debug":return t.fromDebug(e,n);default:throw Error("Unsupported encoding: "+i)}if(null===e||"object"!=typeof e)throw TypeError("Illegal buffer");var o;if(t.isByteBuffer(e))return(o=r.clone.call(e)).markedOffset=-1,o;if(e instanceof Uint8Array)o=new t(0,n,s),e.length>0&&(o.buffer=e.buffer,o.offset=e.byteOffset,o.limit=e.byteOffset+e.byteLength,o.view=new Uint8Array(e.buffer));else if(e instanceof ArrayBuffer)o=new t(0,n,s),e.byteLength>0&&(o.buffer=e,o.offset=0,o.limit=e.byteLength,o.view=e.byteLength>0?new Uint8Array(e):null);else{if("[object Array]"!==Object.prototype.toString.call(e))throw TypeError("Illegal buffer");(o=new t(e.length,n,s)).limit=e.length;for(var a=0;a<e.length;++a)o.view[a]=e[a]}return o},r.writeBitSet=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if(!(e instanceof Array))throw TypeError("Illegal BitSet: Not an array");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var i,n=t,s=e.length,o=s>>3,a=0;for(t+=this.writeVarint32(s,t);o--;)i=1&!!e[a++]|(1&!!e[a++])<<1|(1&!!e[a++])<<2|(1&!!e[a++])<<3|(1&!!e[a++])<<4|(1&!!e[a++])<<5|(1&!!e[a++])<<6|(1&!!e[a++])<<7,this.writeByte(i,t++);if(a<s){var d=0;for(i=0;a<s;)i|=(1&!!e[a++])<<d++;this.writeByte(i,t++)}return r?(this.offset=t,this):t-n},r.readBitSet=function(e){var t=void 0===e;t&&(e=this.offset);var r,i=this.readVarint32(e),n=i.value,s=n>>3,o=0,a=[];for(e+=i.length;s--;)r=this.readByte(e++),a[o++]=!!(1&r),a[o++]=!!(2&r),a[o++]=!!(4&r),a[o++]=!!(8&r),a[o++]=!!(16&r),a[o++]=!!(32&r),a[o++]=!!(64&r),a[o++]=!!(128&r);if(o<n){var d=0;for(r=this.readByte(e++);o<n;)a[o++]=!!(r>>d++&1)}return t&&(this.offset=e),a},r.readBytes=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+"+e+") <= "+this.buffer.byteLength)}var i=this.slice(t,t+e);return r&&(this.offset+=e),i},r.writeBytes=r.append,r.writeInt8=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=1;var i=this.buffer.byteLength;return t>i&&this.resize((i*=2)>t?i:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},r.writeByte=r.writeInt8,r.readInt8=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r=this.view[e];return 128==(128&r)&&(r=-(255-r+1)),t&&(this.offset+=1),r},r.readByte=r.readInt8,r.writeUint8=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=1;var i=this.buffer.byteLength;return t>i&&this.resize((i*=2)>t?i:t),t-=1,this.view[t]=e,r&&(this.offset+=1),this},r.writeUInt8=r.writeUint8,r.readUint8=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r=this.view[e];return t&&(this.offset+=1),r},r.readUInt8=r.readUint8,r.writeInt16=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=2;var i=this.buffer.byteLength;return t>i&&this.resize((i*=2)>t?i:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),r&&(this.offset+=2),this},r.writeShort=r.writeInt16,r.readInt16=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[e],r|=this.view[e+1]<<8):(r=this.view[e]<<8,r|=this.view[e+1]),32768==(32768&r)&&(r=-(65535-r+1)),t&&(this.offset+=2),r},r.readShort=r.readInt16,r.writeUint16=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=2;var i=this.buffer.byteLength;return t>i&&this.resize((i*=2)>t?i:t),t-=2,this.littleEndian?(this.view[t+1]=(65280&e)>>>8,this.view[t]=255&e):(this.view[t]=(65280&e)>>>8,this.view[t+1]=255&e),r&&(this.offset+=2),this},r.writeUInt16=r.writeUint16,r.readUint16=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[e],r|=this.view[e+1]<<8):(r=this.view[e]<<8,r|=this.view[e+1]),t&&(this.offset+=2),r},r.readUInt16=r.readUint16,r.writeInt32=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var i=this.buffer.byteLength;return t>i&&this.resize((i*=2)>t?i:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),r&&(this.offset+=4),this},r.writeInt=r.writeInt32,r.readInt32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[e+2]<<16,r|=this.view[e+1]<<8,r|=this.view[e],r+=this.view[e+3]<<24>>>0):(r=this.view[e+1]<<16,r|=this.view[e+2]<<8,r|=this.view[e+3],r+=this.view[e]<<24>>>0),r|=0,t&&(this.offset+=4),r},r.readInt=r.readInt32,r.writeUint32=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var i=this.buffer.byteLength;return t>i&&this.resize((i*=2)>t?i:t),t-=4,this.littleEndian?(this.view[t+3]=e>>>24&255,this.view[t+2]=e>>>16&255,this.view[t+1]=e>>>8&255,this.view[t]=255&e):(this.view[t]=e>>>24&255,this.view[t+1]=e>>>16&255,this.view[t+2]=e>>>8&255,this.view[t+3]=255&e),r&&(this.offset+=4),this},r.writeUInt32=r.writeUint32,r.readUint32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var r=0;return this.littleEndian?(r=this.view[e+2]<<16,r|=this.view[e+1]<<8,r|=this.view[e],r+=this.view[e+3]<<24>>>0):(r=this.view[e+1]<<16,r|=this.view[e+2]<<8,r|=this.view[e+3],r+=this.view[e]<<24>>>0),t&&(this.offset+=4),r},r.readUInt32=r.readUint32,e&&(r.writeInt64=function(t,r){var i=void 0===r;if(i&&(r=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),r+=8;var n=this.buffer.byteLength;r>n&&this.resize((n*=2)>r?n:r),r-=8;var s=t.low,o=t.high;return this.littleEndian?(this.view[r+3]=s>>>24&255,this.view[r+2]=s>>>16&255,this.view[r+1]=s>>>8&255,this.view[r]=255&s,r+=4,this.view[r+3]=o>>>24&255,this.view[r+2]=o>>>16&255,this.view[r+1]=o>>>8&255,this.view[r]=255&o):(this.view[r]=o>>>24&255,this.view[r+1]=o>>>16&255,this.view[r+2]=o>>>8&255,this.view[r+3]=255&o,r+=4,this.view[r]=s>>>24&255,this.view[r+1]=s>>>16&255,this.view[r+2]=s>>>8&255,this.view[r+3]=255&s),i&&(this.offset+=8),this},r.writeLong=r.writeInt64,r.readInt64=function(t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var i=0,n=0;this.littleEndian?(i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0,t+=4,n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0):(n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0,t+=4,i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=this.view[t]<<24>>>0);var s=new e(i,n,!1);return r&&(this.offset+=8),s},r.readLong=r.readInt64,r.writeUint64=function(t,r){var i=void 0===r;if(i&&(r=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),r+=8;var n=this.buffer.byteLength;r>n&&this.resize((n*=2)>r?n:r),r-=8;var s=t.low,o=t.high;return this.littleEndian?(this.view[r+3]=s>>>24&255,this.view[r+2]=s>>>16&255,this.view[r+1]=s>>>8&255,this.view[r]=255&s,r+=4,this.view[r+3]=o>>>24&255,this.view[r+2]=o>>>16&255,this.view[r+1]=o>>>8&255,this.view[r]=255&o):(this.view[r]=o>>>24&255,this.view[r+1]=o>>>16&255,this.view[r+2]=o>>>8&255,this.view[r+3]=255&o,r+=4,this.view[r]=s>>>24&255,this.view[r+1]=s>>>16&255,this.view[r+2]=s>>>8&255,this.view[r+3]=255&s),i&&(this.offset+=8),this},r.writeUInt64=r.writeUint64,r.readUint64=function(t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var i=0,n=0;this.littleEndian?(i=this.view[t+2]<<16,i|=this.view[t+1]<<8,i|=this.view[t],i+=this.view[t+3]<<24>>>0,t+=4,n=this.view[t+2]<<16,n|=this.view[t+1]<<8,n|=this.view[t],n+=this.view[t+3]<<24>>>0):(n=this.view[t+1]<<16,n|=this.view[t+2]<<8,n|=this.view[t+3],n+=this.view[t]<<24>>>0,t+=4,i=this.view[t+1]<<16,i|=this.view[t+2]<<8,i|=this.view[t+3],i+=this.view[t]<<24>>>0);var s=new e(i,n,!0);return r&&(this.offset+=8),s},r.readUInt64=r.readUint64),r.writeFloat32=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var i=this.buffer.byteLength;return t>i&&this.resize((i*=2)>t?i:t),t-=4,d(this.view,e,t,this.littleEndian,23,4),r&&(this.offset+=4),this},r.writeFloat=r.writeFloat32,r.readFloat32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var r=a(this.view,e,this.littleEndian,23,4);return t&&(this.offset+=4),r},r.readFloat=r.readFloat32,r.writeFloat64=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=8;var i=this.buffer.byteLength;return t>i&&this.resize((i*=2)>t?i:t),t-=8,d(this.view,e,t,this.littleEndian,52,8),r&&(this.offset+=8),this},r.writeDouble=r.writeFloat64,r.readFloat64=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var r=a(this.view,e,this.littleEndian,52,8);return t&&(this.offset+=8),r},r.readDouble=r.readFloat64,t.MAX_VARINT32_BYTES=5,t.calculateVarint32=function(e){return(e>>>=0)<128?1:e<16384?2:e<1<<21?3:e<1<<28?4:5},t.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},t.zigZagDecode32=function(e){return e>>>1^-(1&e)|0},r.writeVarint32=function(e,r){var i=void 0===r;if(i&&(r=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}var n,s=t.calculateVarint32(e);r+=s;var o=this.buffer.byteLength;for(r>o&&this.resize((o*=2)>r?o:r),r-=s,e>>>=0;e>=128;)n=127&e|128,this.view[r++]=n,e>>>=7;return this.view[r++]=e,i?(this.offset=r,this):s},r.writeVarint32ZigZag=function(e,r){return this.writeVarint32(t.zigZagEncode32(e),r)},r.readVarint32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r,i=0,n=0;do{if(!this.noAssert&&e>this.limit){var s=Error("Truncated");throw s.truncated=!0,s}r=this.view[e++],i<5&&(n|=(127&r)<<7*i),++i}while(0!=(128&r));return n|=0,t?(this.offset=e,n):{value:n,length:i}},r.readVarint32ZigZag=function(e){var r=this.readVarint32(e);return"object"==typeof r?r.value=t.zigZagDecode32(r.value):r=t.zigZagDecode32(r),r},e&&(t.MAX_VARINT64_BYTES=10,t.calculateVarint64=function(t){"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t));var r=t.toInt()>>>0,i=t.shiftRightUnsigned(28).toInt()>>>0,n=t.shiftRightUnsigned(56).toInt()>>>0;return 0==n?0==i?r<16384?r<128?1:2:r<1<<21?3:4:i<16384?i<128?5:6:i<1<<21?7:8:n<128?9:10},t.zigZagEncode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()},t.zigZagDecode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()},r.writeVarint64=function(r,i){var n=void 0===i;if(n&&(i=this.offset),!this.noAssert){if("number"==typeof r)r=e.fromNumber(r);else if("string"==typeof r)r=e.fromString(r);else if(!(r&&r instanceof e))throw TypeError("Illegal value: "+r+" (not an integer or Long)");if("number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}"number"==typeof r?r=e.fromNumber(r,!1):"string"==typeof r?r=e.fromString(r,!1):!1!==r.unsigned&&(r=r.toSigned());var s=t.calculateVarint64(r),o=r.toInt()>>>0,a=r.shiftRightUnsigned(28).toInt()>>>0,d=r.shiftRightUnsigned(56).toInt()>>>0;i+=s;var u=this.buffer.byteLength;switch(i>u&&this.resize((u*=2)>i?u:i),i-=s,s){case 10:this.view[i+9]=d>>>7&1;case 9:this.view[i+8]=9!==s?128|d:127&d;case 8:this.view[i+7]=8!==s?a>>>21|128:a>>>21&127;case 7:this.view[i+6]=7!==s?a>>>14|128:a>>>14&127;case 6:this.view[i+5]=6!==s?a>>>7|128:a>>>7&127;case 5:this.view[i+4]=5!==s?128|a:127&a;case 4:this.view[i+3]=4!==s?o>>>21|128:o>>>21&127;case 3:this.view[i+2]=3!==s?o>>>14|128:o>>>14&127;case 2:this.view[i+1]=2!==s?o>>>7|128:o>>>7&127;case 1:this.view[i]=1!==s?128|o:127&o}return n?(this.offset+=s,this):s},r.writeVarint64ZigZag=function(e,r){return this.writeVarint64(t.zigZagEncode64(e),r)},r.readVarint64=function(t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var i=t,n=0,s=0,o=0,a=0;if(n=127&(a=this.view[t++]),128&a&&(n|=(127&(a=this.view[t++]))<<7,(128&a||this.noAssert&&void 0===a)&&(n|=(127&(a=this.view[t++]))<<14,(128&a||this.noAssert&&void 0===a)&&(n|=(127&(a=this.view[t++]))<<21,(128&a||this.noAssert&&void 0===a)&&(s=127&(a=this.view[t++]),(128&a||this.noAssert&&void 0===a)&&(s|=(127&(a=this.view[t++]))<<7,(128&a||this.noAssert&&void 0===a)&&(s|=(127&(a=this.view[t++]))<<14,(128&a||this.noAssert&&void 0===a)&&(s|=(127&(a=this.view[t++]))<<21,(128&a||this.noAssert&&void 0===a)&&(o=127&(a=this.view[t++]),(128&a||this.noAssert&&void 0===a)&&(o|=(127&(a=this.view[t++]))<<7,128&a||this.noAssert&&void 0===a))))))))))throw Error("Buffer overrun");var d=e.fromBits(n|s<<28,s>>>4|o<<24,!1);return r?(this.offset=t,d):{value:d,length:t-i}},r.readVarint64ZigZag=function(r){var i=this.readVarint64(r);return i&&i.value instanceof e?i.value=t.zigZagDecode64(i.value):i=t.zigZagDecode64(i),i}),r.writeCString=function(e,t){var r=void 0===t;r&&(t=this.offset);var i,n=e.length;if(!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(i=0;i<n;++i)if(0===e.charCodeAt(i))throw RangeError("Illegal str: Contains NULL-characters");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}n=l.calculateUTF16asUTF8(s(e))[1],t+=n+1;var o=this.buffer.byteLength;return t>o&&this.resize((o*=2)>t?o:t),t-=n+1,l.encodeUTF16toUTF8(s(e),function(e){this.view[t++]=e}.bind(this)),this.view[t++]=0,r?(this.offset=t,this):n},r.readCString=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r,i=e,n=-1;return l.decodeUTF8toUTF16(function(){if(0===n)return null;if(e>=this.limit)throw RangeError("Illegal range: Truncated data, "+e+" < "+this.limit);return 0===(n=this.view[e++])?null:n}.bind(this),r=o(),!0),t?(this.offset=e,r()):{string:r(),length:e-i}},r.writeIString=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var i,n=t;i=l.calculateUTF16asUTF8(s(e),this.noAssert)[1],t+=4+i;var o=this.buffer.byteLength;if(t>o&&this.resize((o*=2)>t?o:t),t-=4+i,this.littleEndian?(this.view[t+3]=i>>>24&255,this.view[t+2]=i>>>16&255,this.view[t+1]=i>>>8&255,this.view[t]=255&i):(this.view[t]=i>>>24&255,this.view[t+1]=i>>>16&255,this.view[t+2]=i>>>8&255,this.view[t+3]=255&i),t+=4,l.encodeUTF16toUTF8(s(e),function(e){this.view[t++]=e}.bind(this)),t!==n+4+i)throw RangeError("Illegal range: Truncated data, "+t+" == "+(t+4+i));return r?(this.offset=t,this):t-n},r.readIString=function(e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var i=e,n=this.readUint32(e),s=this.readUTF8String(n,t.METRICS_BYTES,e+=4);return e+=s.length,r?(this.offset=e,s.string):{string:s.string,length:e-i}},t.METRICS_CHARS="c",t.METRICS_BYTES="b",r.writeUTF8String=function(e,t){var r,i=void 0===t;if(i&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var n=t;r=l.calculateUTF16asUTF8(s(e))[1],t+=r;var o=this.buffer.byteLength;return t>o&&this.resize((o*=2)>t?o:t),t-=r,l.encodeUTF16toUTF8(s(e),function(e){this.view[t++]=e}.bind(this)),i?(this.offset=t,this):t-n},r.writeString=r.writeUTF8String,t.calculateUTF8Chars=function(e){return l.calculateUTF16asUTF8(s(e))[0]},t.calculateUTF8Bytes=function(e){return l.calculateUTF16asUTF8(s(e))[1]},t.calculateString=t.calculateUTF8Bytes,r.readUTF8String=function(e,r,i){"number"==typeof r&&(i=r,r=void 0);var n=void 0===i;if(n&&(i=this.offset),void 0===r&&(r=t.METRICS_CHARS),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}var s,a=0,d=i;if(r===t.METRICS_CHARS){if(s=o(),l.decodeUTF8(function(){return a<e&&i<this.limit?this.view[i++]:null}.bind(this),(function(e){++a,l.UTF8toUTF16(e,s)})),a!==e)throw RangeError("Illegal range: Truncated data, "+a+" == "+e);return n?(this.offset=i,s()):{string:s(),length:i-d}}if(r===t.METRICS_BYTES){if(!this.noAssert){if("number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+"+e+") <= "+this.buffer.byteLength)}var u=i+e;if(l.decodeUTF8toUTF16(function(){return i<u?this.view[i++]:null}.bind(this),s=o(),this.noAssert),i!==u)throw RangeError("Illegal range: Truncated data, "+i+" == "+u);return n?(this.offset=i,s()):{string:s(),length:i-d}}throw TypeError("Unsupported metrics: "+r)},r.readString=r.readUTF8String,r.writeVString=function(e,r){var i=void 0===r;if(i&&(r=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}var n,o,a=r;n=l.calculateUTF16asUTF8(s(e),this.noAssert)[1],o=t.calculateVarint32(n),r+=o+n;var d=this.buffer.byteLength;if(r>d&&this.resize((d*=2)>r?d:r),r-=o+n,r+=this.writeVarint32(n,r),l.encodeUTF16toUTF8(s(e),function(e){this.view[r++]=e}.bind(this)),r!==a+n+o)throw RangeError("Illegal range: Truncated data, "+r+" == "+(r+n+o));return i?(this.offset=r,this):r-a},r.readVString=function(e){var r=void 0===e;if(r&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var i=e,n=this.readVarint32(e),s=this.readUTF8String(n.value,t.METRICS_BYTES,e+=n.length);return e+=s.length,r?(this.offset=e,s.string):{string:s.string,length:e-i}},r.append=function(e,r,i){"number"!=typeof r&&"string"==typeof r||(i=r,r=void 0);var n=void 0===i;if(n&&(i=this.offset),!this.noAssert){if("number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}e instanceof t||(e=t.wrap(e,r));var s=e.limit-e.offset;if(s<=0)return this;i+=s;var o=this.buffer.byteLength;return i>o&&this.resize((o*=2)>i?o:i),i-=s,this.view.set(e.view.subarray(e.offset,e.limit),i),e.offset+=s,n&&(this.offset+=s),this},r.appendTo=function(e,t){return e.append(this,t),this},r.assert=function(e){return this.noAssert=!e,this},r.capacity=function(){return this.buffer.byteLength},r.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},r.clone=function(e){var r=new t(0,this.littleEndian,this.noAssert);return e?(r.buffer=new ArrayBuffer(this.buffer.byteLength),r.view=new Uint8Array(r.buffer)):(r.buffer=this.buffer,r.view=this.view),r.offset=this.offset,r.markedOffset=this.markedOffset,r.limit=this.limit,r},r.compact=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(0===e&&t===this.buffer.byteLength)return this;var r=t-e;if(0===r)return this.buffer=i,this.view=null,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=0,this;var n=new ArrayBuffer(r),s=new Uint8Array(n);return s.set(this.view.subarray(e,t)),this.buffer=n,this.view=s,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=r,this},r.copy=function(e,r){if(void 0===e&&(e=this.offset),void 0===r&&(r=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal end: Not an integer");if(r>>>=0,e<0||e>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+r+" <= "+this.buffer.byteLength)}if(e===r)return new t(0,this.littleEndian,this.noAssert);var i=r-e,n=new t(i,this.littleEndian,this.noAssert);return n.offset=0,n.limit=i,n.markedOffset>=0&&(n.markedOffset-=e),this.copyTo(n,0,e,r),n},r.copyTo=function(e,r,i,n){var s,o;if(!this.noAssert&&!t.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(r=(o=void 0===r)?e.offset:0|r,i=(s=void 0===i)?this.offset:0|i,n=void 0===n?this.limit:0|n,r<0||r>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+r+" <= "+e.buffer.byteLength);if(i<0||n>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+i+" <= "+this.buffer.byteLength);var a=n-i;return 0===a?e:(e.ensureCapacity(r+a),e.view.set(this.view.subarray(i,n),r),s&&(this.offset+=a),o&&(e.offset+=a),this)},r.ensureCapacity=function(e){var t=this.buffer.byteLength;return t<e?this.resize((t*=2)>e?t:e):this},r.fill=function(e,t,r){var i=void 0===t;if(i&&(t=this.offset),"string"==typeof e&&e.length>0&&(e=e.charCodeAt(0)),void 0===t&&(t=this.offset),void 0===r&&(r=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal end: Not an integer");if(r>>>=0,t<0||t>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+r+" <= "+this.buffer.byteLength)}if(t>=r)return this;for(;t<r;)this.view[t++]=e;return i&&(this.offset=t),this},r.flip=function(){return this.limit=this.offset,this.offset=0,this},r.mark=function(e){if(e=void 0===e?this.offset:e,!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}return this.markedOffset=e,this},r.order=function(e){if(!this.noAssert&&"boolean"!=typeof e)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!e,this},r.LE=function(e){return this.littleEndian=void 0===e||!!e,this},r.BE=function(e){return this.littleEndian=void 0!==e&&!e,this},r.prepend=function(e,r,i){"number"!=typeof r&&"string"==typeof r||(i=r,r=void 0);var n=void 0===i;if(n&&(i=this.offset),!this.noAssert){if("number"!=typeof i||i%1!=0)throw TypeError("Illegal offset: "+i+" (not an integer)");if((i>>>=0)<0||i+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+i+" (+0) <= "+this.buffer.byteLength)}e instanceof t||(e=t.wrap(e,r));var s=e.limit-e.offset;if(s<=0)return this;var o=s-i;if(o>0){var a=new ArrayBuffer(this.buffer.byteLength+o),d=new Uint8Array(a);d.set(this.view.subarray(i,this.buffer.byteLength),s),this.buffer=a,this.view=d,this.offset+=o,this.markedOffset>=0&&(this.markedOffset+=o),this.limit+=o,i+=o}else new Uint8Array(this.buffer);return this.view.set(e.view.subarray(e.offset,e.limit),i-s),e.offset=e.limit,n&&(this.offset-=s),this},r.prependTo=function(e,t){return e.prepend(this,t),this},r.printDebug=function(e){"function"!=typeof e&&(e=console.log.bind(console)),e(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},r.remaining=function(){return this.limit-this.offset},r.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},r.resize=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal capacity: "+e+" (not an integer)");if((e|=0)<0)throw RangeError("Illegal capacity: 0 <= "+e)}if(this.buffer.byteLength<e){var t=new ArrayBuffer(e),r=new Uint8Array(t);r.set(this.view),this.buffer=t,this.view=r}return this},r.reverse=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}return e===t||Array.prototype.reverse.call(this.view.subarray(e,t)),this},r.skip=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");e|=0}var t=this.offset+e;if(!this.noAssert&&(t<0||t>this.buffer.byteLength))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+e+" <= "+this.buffer.byteLength);return this.offset=t,this},r.slice=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var r=this.clone();return r.offset=e,r.limit=t,r},r.toBuffer=function(e){var t=this.offset,r=this.limit;if(!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: Not an integer");if(t>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal limit: Not an integer");if(r>>>=0,t<0||t>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+r+" <= "+this.buffer.byteLength)}if(!e&&0===t&&r===this.buffer.byteLength)return this.buffer;if(t===r)return i;var n=new ArrayBuffer(r-t);return new Uint8Array(n).set(new Uint8Array(this.buffer).subarray(t,r),0),n},r.toArrayBuffer=r.toBuffer,r.toString=function(e,t,r){if(void 0===e)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof e&&(r=t=e="utf8"),e){case"utf8":return this.toUTF8(t,r);case"base64":return this.toBase64(t,r);case"hex":return this.toHex(t,r);case"binary":return this.toBinary(t,r);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+e)}};var u=function(){for(var e={},t=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],r=[],i=0,n=t.length;i<n;++i)r[t[i]]=i;return e.encode=function(e,r){for(var i,n;null!==(i=e());)r(t[i>>2&63]),n=(3&i)<<4,null!==(i=e())?(r(t[63&((n|=i>>4&15)|i>>4&15)]),n=(15&i)<<2,null!==(i=e())?(r(t[63&(n|i>>6&3)]),r(t[63&i])):(r(t[63&n]),r(61))):(r(t[63&n]),r(61),r(61))},e.decode=function(e,t){var i,n,s;function o(e){throw Error("Illegal character code: "+e)}for(;null!==(i=e());)if(void 0===(n=r[i])&&o(i),null!==(i=e())&&(void 0===(s=r[i])&&o(i),t(n<<2>>>0|(48&s)>>4),null!==(i=e()))){if(void 0===(n=r[i])){if(61===i)break;o(i)}if(t((15&s)<<4>>>0|(60&n)>>2),null!==(i=e())){if(void 0===(s=r[i])){if(61===i)break;o(i)}t((3&n)<<6>>>0|s)}}},e.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)},e}();r.toBase64=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),t|=0,(e|=0)<0||t>this.capacity||e>t)throw RangeError("begin, end");var r;return u.encode(function(){return e<t?this.view[e++]:null}.bind(this),r=o()),r()},t.fromBase64=function(e,r){if("string"!=typeof e)throw TypeError("str");var i=new t(e.length/4*3,r),n=0;return u.decode(s(e),(function(e){i.view[n++]=e})),i.limit=n,i},t.btoa=function(e){return t.fromBinary(e).toBase64()},t.atob=function(e){return t.fromBase64(e).toBinary()},r.toBinary=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),t|=0,(e|=0)<0||t>this.capacity()||e>t)throw RangeError("begin, end");if(e===t)return"";for(var r=[],i=[];e<t;)r.push(this.view[e++]),r.length>=1024&&(i.push(String.fromCharCode.apply(String,r)),r=[]);return i.join("")+String.fromCharCode.apply(String,r)},t.fromBinary=function(e,r){if("string"!=typeof e)throw TypeError("str");for(var i,n=0,s=e.length,o=new t(s,r);n<s;){if((i=e.charCodeAt(n))>255)throw RangeError("illegal char code: "+i);o.view[n++]=i}return o.limit=s,o},r.toDebug=function(e){for(var t,r=-1,i=this.buffer.byteLength,n="",s="",o="";r<i;){if(-1!==r&&(n+=(t=this.view[r])<16?"0"+t.toString(16).toUpperCase():t.toString(16).toUpperCase(),e&&(s+=t>32&&t<127?String.fromCharCode(t):".")),++r,e&&r>0&&r%16==0&&r!==i){for(;n.length<51;)n+=" ";o+=n+s+"\n",n=s=""}r===this.offset&&r===this.limit?n+=r===this.markedOffset?"!":"|":r===this.offset?n+=r===this.markedOffset?"[":"<":r===this.limit?n+=r===this.markedOffset?"]":">":n+=r===this.markedOffset?"'":e||0!==r&&r!==i?" ":""}if(e&&" "!==n){for(;n.length<51;)n+=" ";o+=n+s+"\n"}return e?o:n},t.fromDebug=function(e,r,i){for(var n,s,o=e.length,a=new t((o+1)/3|0,r,i),d=0,u=0,l=!1,c=!1,p=!1,h=!1,f=!1;d<o;){switch(n=e.charAt(d++)){case"!":if(!i){if(c||p||h){f=!0;break}c=p=h=!0}a.offset=a.markedOffset=a.limit=u,l=!1;break;case"|":if(!i){if(c||h){f=!0;break}c=h=!0}a.offset=a.limit=u,l=!1;break;case"[":if(!i){if(c||p){f=!0;break}c=p=!0}a.offset=a.markedOffset=u,l=!1;break;case"<":if(!i){if(c){f=!0;break}c=!0}a.offset=u,l=!1;break;case"]":if(!i){if(h||p){f=!0;break}h=p=!0}a.limit=a.markedOffset=u,l=!1;break;case">":if(!i){if(h){f=!0;break}h=!0}a.limit=u,l=!1;break;case"'":if(!i){if(p){f=!0;break}p=!0}a.markedOffset=u,l=!1;break;case" ":l=!1;break;default:if(!i&&l){f=!0;break}if(s=parseInt(n+e.charAt(d++),16),!i&&(isNaN(s)||s<0||s>255))throw TypeError("Illegal str: Not a debug encoded string");a.view[u++]=s,l=!0}if(f)throw TypeError("Illegal str: Invalid symbol at "+d)}if(!i){if(!c||!h)throw TypeError("Illegal str: Missing offset or limit");if(u<a.buffer.byteLength)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+u+" < "+o)}return a},r.toHex=function(e,t){if(e=void 0===e?this.offset:e,t=void 0===t?this.limit:t,!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}for(var r,i=new Array(t-e);e<t;)(r=this.view[e++])<16?i.push("0",r.toString(16)):i.push(r.toString(16));return i.join("")},t.fromHex=function(e,r,i){if(!i){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if(e.length%2!=0)throw TypeError("Illegal str: Length not a multiple of 2")}for(var n,s=e.length,o=new t(s/2|0,r),a=0,d=0;a<s;a+=2){if(n=parseInt(e.substring(a,a+2),16),!i&&(!isFinite(n)||n<0||n>255))throw TypeError("Illegal str: Contains non-hex characters");o.view[d++]=n}return o.limit=d,o};var l=function(){var e={MAX_CODEPOINT:1114111,encodeUTF8:function(e,t){var r=null;for("number"==typeof e&&(r=e,e=function(){return null});null!==r||null!==(r=e());)r<128?t(127&r):r<2048?(t(r>>6&31|192),t(63&r|128)):r<65536?(t(r>>12&15|224),t(r>>6&63|128),t(63&r|128)):(t(r>>18&7|240),t(r>>12&63|128),t(r>>6&63|128),t(63&r|128)),r=null},decodeUTF8:function(e,t){for(var r,i,n,s,o=function(e){e=e.slice(0,e.indexOf(null));var t=Error(e.toString());throw t.name="TruncatedError",t.bytes=e,t};null!==(r=e());)if(0==(128&r))t(r);else if(192==(224&r))null===(i=e())&&o([r,i]),t((31&r)<<6|63&i);else if(224==(240&r))(null===(i=e())||null===(n=e()))&&o([r,i,n]),t((15&r)<<12|(63&i)<<6|63&n);else{if(240!=(248&r))throw RangeError("Illegal starting byte: "+r);(null===(i=e())||null===(n=e())||null===(s=e()))&&o([r,i,n,s]),t((7&r)<<18|(63&i)<<12|(63&n)<<6|63&s)}},UTF16toUTF8:function(e,t){for(var r,i=null;null!==(r=null!==i?i:e());)r>=55296&&r<=57343&&null!==(i=e())&&i>=56320&&i<=57343?(t(1024*(r-55296)+i-56320+65536),i=null):t(r);null!==i&&t(i)},UTF8toUTF16:function(e,t){var r=null;for("number"==typeof e&&(r=e,e=function(){return null});null!==r||null!==(r=e());)r<=65535?t(r):(t(55296+((r-=65536)>>10)),t(r%1024+56320)),r=null},encodeUTF16toUTF8:function(t,r){e.UTF16toUTF8(t,(function(t){e.encodeUTF8(t,r)}))},decodeUTF8toUTF16:function(t,r){e.decodeUTF8(t,(function(t){e.UTF8toUTF16(t,r)}))},calculateCodePoint:function(e){return e<128?1:e<2048?2:e<65536?3:4},calculateUTF8:function(e){for(var t,r=0;null!==(t=e());)r+=t<128?1:t<2048?2:t<65536?3:4;return r},calculateUTF16asUTF8:function(t){var r=0,i=0;return e.UTF16toUTF8(t,(function(e){++r,i+=e<128?1:e<2048?2:e<65536?3:4})),[r,i]}};return e}();return r.toUTF8=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var r;try{l.decodeUTF8toUTF16(function(){return e<t?this.view[e++]:null}.bind(this),r=o())}catch(r){if(e!==t)throw RangeError("Illegal range: Truncated data, "+e+" != "+t)}return r()},t.fromUTF8=function(e,r,i){if(!i&&"string"!=typeof e)throw TypeError("Illegal str: Not a string");var n=new t(l.calculateUTF16asUTF8(s(e),!0)[1],r,i),o=0;return l.encodeUTF16toUTF8(s(e),(function(e){n.view[o++]=e})),n.limit=o,n},t},void 0===(s="function"==typeof i?i.apply(t,n):i)||(e.exports=s)},8027:function(e,t){var r,i,n;i=[],void 0===(n="function"==typeof(r=function(){"use strict";function e(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function t(e){return!0===(e&&e.__isLong__)}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=t;var r={},i={};function n(e,t){var n,s,a;return t?(a=0<=(e>>>=0)&&e<256)&&(s=i[e])?s:(n=o(e,(0|e)<0?-1:0,!0),a&&(i[e]=n),n):(a=-128<=(e|=0)&&e<128)&&(s=r[e])?s:(n=o(e,e<0?-1:0,!1),a&&(r[e]=n),n)}function s(e,t){if(isNaN(e)||!isFinite(e))return t?g:y;if(t){if(e<0)return g;if(e>=p)return w}else{if(e<=-h)return T;if(e+1>=h)return _}return e<0?s(-e,t).neg():o(e%c|0,e/c|0,t)}function o(t,r,i){return new e(t,r,i)}e.fromInt=n,e.fromNumber=s,e.fromBits=o;var a=Math.pow;function d(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||36<r)throw RangeError("radix");var i;if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return d(e.substring(1),t,r).neg();for(var n=s(a(r,8)),o=y,u=0;u<e.length;u+=8){var l=Math.min(8,e.length-u),c=parseInt(e.substring(u,u+l),r);if(l<8){var p=s(a(r,l));o=o.mul(p).add(s(c))}else o=(o=o.mul(n)).add(s(c))}return o.unsigned=t,o}function u(t){return t instanceof e?t:"number"==typeof t?s(t):"string"==typeof t?d(t):o(t.low,t.high,t.unsigned)}e.fromString=d,e.fromValue=u;var l=65536,c=l*l,p=c*c,h=p/2,f=n(1<<24),y=n(0);e.ZERO=y;var g=n(0,!0);e.UZERO=g;var m=n(1);e.ONE=m;var v=n(1,!0);e.UONE=v;var b=n(-1);e.NEG_ONE=b;var _=o(-1,2147483647,!1);e.MAX_VALUE=_;var w=o(-1,-1,!0);e.MAX_UNSIGNED_VALUE=w;var T=o(0,-2147483648,!1);e.MIN_VALUE=T;var E=e.prototype;return E.toInt=function(){return this.unsigned?this.low>>>0:this.low},E.toNumber=function(){return this.unsigned?(this.high>>>0)*c+(this.low>>>0):this.high*c+(this.low>>>0)},E.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(T)){var t=s(e),r=this.div(t),i=r.mul(t).sub(this);return r.toString(e)+i.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var n=s(a(e,6),this.unsigned),o=this,d="";;){var u=o.div(n),l=(o.sub(u.mul(n)).toInt()>>>0).toString(e);if((o=u).isZero())return l+d;for(;l.length<6;)l="0"+l;d=""+l+d}},E.getHighBits=function(){return this.high},E.getHighBitsUnsigned=function(){return this.high>>>0},E.getLowBits=function(){return this.low},E.getLowBitsUnsigned=function(){return this.low>>>0},E.getNumBitsAbs=function(){if(this.isNegative())return this.eq(T)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},E.isZero=function(){return 0===this.high&&0===this.low},E.isNegative=function(){return!this.unsigned&&this.high<0},E.isPositive=function(){return this.unsigned||this.high>=0},E.isOdd=function(){return 1==(1&this.low)},E.isEven=function(){return 0==(1&this.low)},E.equals=function(e){return t(e)||(e=u(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&this.high===e.high&&this.low===e.low},E.eq=E.equals,E.notEquals=function(e){return!this.eq(e)},E.neq=E.notEquals,E.lessThan=function(e){return this.comp(e)<0},E.lt=E.lessThan,E.lessThanOrEqual=function(e){return this.comp(e)<=0},E.lte=E.lessThanOrEqual,E.greaterThan=function(e){return this.comp(e)>0},E.gt=E.greaterThan,E.greaterThanOrEqual=function(e){return this.comp(e)>=0},E.gte=E.greaterThanOrEqual,E.compare=function(e){if(t(e)||(e=u(e)),this.eq(e))return 0;var r=this.isNegative(),i=e.isNegative();return r&&!i?-1:!r&&i?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},E.comp=E.compare,E.negate=function(){return!this.unsigned&&this.eq(T)?T:this.not().add(m)},E.neg=E.negate,E.add=function(e){t(e)||(e=u(e));var r=this.high>>>16,i=65535&this.high,n=this.low>>>16,s=65535&this.low,a=e.high>>>16,d=65535&e.high,l=e.low>>>16,c=0,p=0,h=0,f=0;return h+=(f+=s+(65535&e.low))>>>16,p+=(h+=n+l)>>>16,c+=(p+=i+d)>>>16,c+=r+a,o((h&=65535)<<16|(f&=65535),(c&=65535)<<16|(p&=65535),this.unsigned)},E.subtract=function(e){return t(e)||(e=u(e)),this.add(e.neg())},E.sub=E.subtract,E.multiply=function(e){if(this.isZero())return y;if(t(e)||(e=u(e)),e.isZero())return y;if(this.eq(T))return e.isOdd()?T:y;if(e.eq(T))return this.isOdd()?T: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(f)&&e.lt(f))return s(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,i=65535&this.high,n=this.low>>>16,a=65535&this.low,d=e.high>>>16,l=65535&e.high,c=e.low>>>16,p=65535&e.low,h=0,g=0,m=0,v=0;return m+=(v+=a*p)>>>16,g+=(m+=n*p)>>>16,m&=65535,g+=(m+=a*c)>>>16,h+=(g+=i*p)>>>16,g&=65535,h+=(g+=n*c)>>>16,g&=65535,h+=(g+=a*l)>>>16,h+=r*p+i*c+n*l+a*d,o((m&=65535)<<16|(v&=65535),(h&=65535)<<16|(g&=65535),this.unsigned)},E.mul=E.multiply,E.divide=function(e){if(t(e)||(e=u(e)),e.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?g:y;var r,i,n;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return g;if(e.gt(this.shru(1)))return v;n=g}else{if(this.eq(T))return e.eq(m)||e.eq(b)?T:e.eq(T)?m:(r=this.shr(1).div(e).shl(1)).eq(y)?e.isNegative()?m:b:(i=this.sub(e.mul(r)),n=r.add(i.div(e)));if(e.eq(T))return this.unsigned?g: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();n=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),d=o<=48?1:a(2,o-48),l=s(r),c=l.mul(e);c.isNegative()||c.gt(i);)c=(l=s(r-=d,this.unsigned)).mul(e);l.isZero()&&(l=m),n=n.add(l),i=i.sub(c)}return n},E.div=E.divide,E.modulo=function(e){return t(e)||(e=u(e)),this.sub(this.div(e).mul(e))},E.mod=E.modulo,E.not=function(){return o(~this.low,~this.high,this.unsigned)},E.and=function(e){return t(e)||(e=u(e)),o(this.low&e.low,this.high&e.high,this.unsigned)},E.or=function(e){return t(e)||(e=u(e)),o(this.low|e.low,this.high|e.high,this.unsigned)},E.xor=function(e){return t(e)||(e=u(e)),o(this.low^e.low,this.high^e.high,this.unsigned)},E.shiftLeft=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?o(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):o(0,this.low<<e-32,this.unsigned)},E.shl=E.shiftLeft,E.shiftRight=function(e){return t(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?o(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):o(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},E.shr=E.shiftRight,E.shiftRightUnsigned=function(e){if(t(e)&&(e=e.toInt()),0==(e&=63))return this;var r=this.high;return e<32?o(this.low>>>e|r<<32-e,r>>>e,this.unsigned):o(32===e?r:r>>>e-32,0,this.unsigned)},E.shru=E.shiftRightUnsigned,E.toSigned=function(){return this.unsigned?o(this.low,this.high,!1):this},E.toUnsigned=function(){return this.unsigned?this:o(this.low,this.high,!0)},E.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},E.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24&255,255&e,e>>>8&255,e>>>16&255,e>>>24&255]},E.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t]},e})?r.apply(t,i):r)||(e.exports=n)},8165:(e,t,r)=>{"use strict";var i=r(9138),n=r(6095),s=r(4531),o=r(7196);e.exports=o||i.call(s,n)},2012:(e,t,r)=>{"use strict";var i=r(9138),n=r(6095),s=r(8165);e.exports=function(){return s(i,n,arguments)}},6095:e=>{"use strict";e.exports=Function.prototype.apply},4531:e=>{"use strict";e.exports=Function.prototype.call},2284:(e,t,r)=>{"use strict";var i=r(9138),n=r(3468),s=r(4531),o=r(8165);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new n("a function is required");return o(i,s,e)}},7196:e=>{"use strict";e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},9818:(e,t,r)=>{"use strict";var i=r(528),n=r(8498),s=n(i("String.prototype.indexOf"));e.exports=function(e,t){var r=i(e,!!t);return"function"==typeof r&&s(e,".prototype.")>-1?n(r):r}},8498:(e,t,r)=>{"use strict";var i=r(9138),n=r(528),s=r(6108),o=n("%TypeError%"),a=n("%Function.prototype.apply%"),d=n("%Function.prototype.call%"),u=n("%Reflect.apply%",!0)||i.call(d,a),l=n("%Object.defineProperty%",!0),c=n("%Math.max%");if(l)try{l({},"a",{value:1})}catch(e){l=null}e.exports=function(e){if("function"!=typeof e)throw new o("a function is required");var t=u(i,d,arguments);return s(t,1+c(0,e.length-(arguments.length-1)),!0)};var p=function(){return u(i,a,arguments)};l?l(e.exports,"apply",{value:p}):e.exports.apply=p},4607:(e,t,r)=>{"use strict";var i=r(3495),n=r(2284),s=n([i("%String.prototype.indexOf%")]);e.exports=function(e,t){var r=i(e,!!t);return"function"==typeof r&&s(e,".prototype.")>-1?n([r]):r}},3495:(e,t,r)=>{"use strict";var i,n=r(9629),s=r(9838),o=r(9110),a=r(1155),d=r(4943),u=r(5731),l=r(3468),c=r(2140),p=r(8479),h=r(8449),f=r(8129),y=r(2387),g=r(5865),m=r(1319),v=r(6882),b=Function,_=function(e){try{return b('"use strict"; return ('+e+").constructor;")()}catch(e){}},w=r(9336),T=r(4940),E=function(){throw new l},S=w?function(){try{return E}catch(e){try{return w(arguments,"callee").get}catch(e){return E}}}():E,A=r(8941)(),R=r(6369),M=r(7345),I=r(7859),O=r(6095),x=r(4531),k={},C="undefined"!=typeof Uint8Array&&R?R(Uint8Array):i,P={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?i:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?i:ArrayBuffer,"%ArrayIteratorPrototype%":A&&R?R([][Symbol.iterator]()):i,"%AsyncFromSyncIteratorPrototype%":i,"%AsyncFunction%":k,"%AsyncGenerator%":k,"%AsyncGeneratorFunction%":k,"%AsyncIteratorPrototype%":k,"%Atomics%":"undefined"==typeof Atomics?i:Atomics,"%BigInt%":"undefined"==typeof BigInt?i:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?i:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?i:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?i:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":s,"%eval%":eval,"%EvalError%":o,"%Float16Array%":"undefined"==typeof Float16Array?i:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?i:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?i:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?i:FinalizationRegistry,"%Function%":b,"%GeneratorFunction%":k,"%Int8Array%":"undefined"==typeof Int8Array?i:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?i:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?i:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":A&&R?R(R([][Symbol.iterator]())):i,"%JSON%":"object"==typeof JSON?JSON:i,"%Map%":"undefined"==typeof Map?i:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&A&&R?R((new Map)[Symbol.iterator]()):i,"%Math%":Math,"%Number%":Number,"%Object%":n,"%Object.getOwnPropertyDescriptor%":w,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?i:Promise,"%Proxy%":"undefined"==typeof Proxy?i:Proxy,"%RangeError%":a,"%ReferenceError%":d,"%Reflect%":"undefined"==typeof Reflect?i:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?i:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&A&&R?R((new Set)[Symbol.iterator]()):i,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?i:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":A&&R?R(""[Symbol.iterator]()):i,"%Symbol%":A?Symbol:i,"%SyntaxError%":u,"%ThrowTypeError%":S,"%TypedArray%":C,"%TypeError%":l,"%Uint8Array%":"undefined"==typeof Uint8Array?i:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?i:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?i:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?i:Uint32Array,"%URIError%":c,"%WeakMap%":"undefined"==typeof WeakMap?i:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?i:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?i:WeakSet,"%Function.prototype.call%":x,"%Function.prototype.apply%":O,"%Object.defineProperty%":T,"%Object.getPrototypeOf%":M,"%Math.abs%":p,"%Math.floor%":h,"%Math.max%":f,"%Math.min%":y,"%Math.pow%":g,"%Math.round%":m,"%Math.sign%":v,"%Reflect.getPrototypeOf%":I};if(R)try{null.error}catch(e){var D=R(R(e));P["%Error.prototype%"]=D}var N=function e(t){var r;if("%AsyncFunction%"===t)r=_("async function () {}");else if("%GeneratorFunction%"===t)r=_("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=_("async function* () {}");else if("%AsyncGenerator%"===t){var i=e("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if("%AsyncIteratorPrototype%"===t){var n=e("%AsyncGenerator%");n&&R&&(r=R(n.prototype))}return P[t]=r,r},B={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},q=r(9138),L=r(8554),j=q.call(x,Array.prototype.concat),F=q.call(O,Array.prototype.splice),U=q.call(x,String.prototype.replace),z=q.call(x,String.prototype.slice),H=q.call(x,RegExp.prototype.exec),G=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,K=/\\(\\)?/g,W=function(e,t){var r,i=e;if(L(B,i)&&(i="%"+(r=B[i])[0]+"%"),L(P,i)){var n=P[i];if(n===k&&(n=N(i)),void 0===n&&!t)throw new l("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:i,value:n}}throw new u("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new l('"allowMissing" argument must be a boolean');if(null===H(/^%?[^%]*%?$/,e))throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=z(e,0,1),r=z(e,-1);if("%"===t&&"%"!==r)throw new u("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new u("invalid intrinsic syntax, expected opening `%`");var i=[];return U(e,G,(function(e,t,r,n){i[i.length]=r?U(n,K,"$1"):t||e})),i}(e),i=r.length>0?r[0]:"",n=W("%"+i+"%",t),s=n.name,o=n.value,a=!1,d=n.alias;d&&(i=d[0],F(r,j([0,1],d)));for(var c=1,p=!0;c<r.length;c+=1){var h=r[c],f=z(h,0,1),y=z(h,-1);if(('"'===f||"'"===f||"`"===f||'"'===y||"'"===y||"`"===y)&&f!==y)throw new u("property names with quotes must have matching quotes");if("constructor"!==h&&p||(a=!0),L(P,s="%"+(i+="."+h)+"%"))o=P[s];else if(null!=o){if(!(h in o)){if(!t)throw new l("base intrinsic for "+e+" exists, but the property is not available.");return}if(w&&c+1>=r.length){var g=w(o,h);o=(p=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:o[h]}else p=L(o,h),o=o[h];p&&!a&&(P[s]=o)}}return o}},8941:(e,t,r)=>{"use strict";var i="undefined"!=typeof Symbol&&Symbol,n=r(9903);e.exports=function(){return"function"==typeof i&&("function"==typeof Symbol&&("symbol"==typeof i("foo")&&("symbol"==typeof Symbol("bar")&&n())))}},9903:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var i in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var s=Object.getOwnPropertyDescriptor(e,t);if(42!==s.value||!0!==s.enumerable)return!1}return!0}},7589:(e,t,r)=>{"use strict";var i=r(5636).Buffer,n=r(1983).Transform,s=r(6296).I;function o(e){n.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(5615)(o,n);var a="undefined"!=typeof Uint8Array,d="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&ArrayBuffer.isView&&(i.prototype instanceof Uint8Array||i.TYPED_ARRAY_SUPPORT);o.prototype.update=function(e,t,r){var n;if(e instanceof i)n=e;else if("string"==typeof e)n=i.from(e,t);else if(d&&ArrayBuffer.isView(e))n=i.from(e.buffer,e.byteOffset,e.byteLength);else if(a&&e instanceof Uint8Array)n=i.from(e);else{if(!(i.isBuffer(e)&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))throw new Error('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.');n=i.from(e)}var s=this._update(n);return this.hashMode?this:(r&&(s=this._toString(s,r)),s)},o.prototype.setAutoPadding=function(){},o.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},o.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},o.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},o.prototype._transform=function(e,t,r){var i;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){i=e}finally{r(i)}},o.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},o.prototype._finalOrDigest=function(e){var t=this.__final()||i.alloc(0);return e&&(t=this._toString(t,e,!0)),t},o.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new s(t),this._encoding=t),this._encoding!==t)throw new Error("can’t switch encodings");var i=this._decoder.write(e);return r&&(i+=this._decoder.end()),i},e.exports=o},3257:(e,t,r)=>{"use strict";var i=r(5615),n=r(3275),s=r(5586),o=r(3229),a=r(7589);function d(e){a.call(this,"digest"),this._hash=e}i(d,a),d.prototype._update=function(e){this._hash.update(e)},d.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new n:"rmd160"===e||"ripemd160"===e?new s:new d(o(e))}},686:(e,t,r)=>{"use strict";var i=r(7239)(),n=r(528),s=i&&n("%Object.defineProperty%",!0);if(s)try{s({},"a",{value:1})}catch(e){s=!1}var o=n("%SyntaxError%"),a=n("%TypeError%"),d=r(3436);e.exports=function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new a("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new a("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new a("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new a("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new a("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new a("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,n=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],c=!!d&&d(e,t);if(s)s(e,t,{configurable:null===u&&c?c.configurable:!u,enumerable:null===i&&c?c.enumerable:!i,value:r,writable:null===n&&c?c.writable:!n});else{if(!l&&(i||n||u))throw new o("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},3436:(e,t,r)=>{"use strict";var i=r(528)("%Object.getOwnPropertyDescriptor%",!0);if(i)try{i([],"length")}catch(e){i=null}e.exports=i},1857:(e,t,r)=>{"use strict";var i=r(9228),n="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),s=Object.prototype.toString,o=Array.prototype.concat,a=r(686),d=r(7239)(),u=function(e,t,r,i){if(t in e)if(!0===i){if(e[t]===r)return}else if("function"!=typeof(n=i)||"[object Function]"!==s.call(n)||!i())return;var n;d?a(e,t,r,!0):a(e,t,r)},l=function(e,t){var r=arguments.length>2?arguments[2]:{},s=i(t);n&&(s=o.call(s,Object.getOwnPropertySymbols(t)));for(var a=0;a<s.length;a+=1)u(e,s[a],t[s[a]],r[s[a]])};l.supportsDescriptors=!!d,e.exports=l},6423:(e,t,r)=>{"use strict";var i,n=r(2284),s=r(9336);try{i=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var o=!!i&&s&&s(Object.prototype,"__proto__"),a=Object,d=a.getPrototypeOf;e.exports=o&&"function"==typeof o.get?n([o.get]):"function"==typeof d&&function(e){return d(null==e?e:a(e))}},3360:(e,t,r)=>{"use strict";var i=t;i.version=r(183).rE,i.utils=r(1874),i.rand=r(7048),i.curve=r(7131),i.curves=r(6443),i.ec=r(5064),i.eddsa=r(4807)},5174:(e,t,r)=>{"use strict";var i=r(4845),n=r(1874),s=n.getNAF,o=n.getJSF,a=n.assert;function d(e,t){this.type=e,this.p=new i(t.p,16),this.red=t.prime?i.red(t.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=t.n&&new i(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))}function u(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=d,d.prototype.point=function(){throw new Error("Not implemented")},d.prototype.validate=function(){throw new Error("Not implemented")},d.prototype._fixedNafMul=function(e,t){a(e.precomputed);var r=e._getDoubles(),i=s(t,1,this._bitLength),n=(1<<r.step+1)-(r.step%2==0?2:1);n/=3;var o,d,u=[];for(o=0;o<i.length;o+=r.step){d=0;for(var l=o+r.step-1;l>=o;l--)d=(d<<1)+i[l];u.push(d)}for(var c=this.jpoint(null,null,null),p=this.jpoint(null,null,null),h=n;h>0;h--){for(o=0;o<u.length;o++)(d=u[o])===h?p=p.mixedAdd(r.points[o]):d===-h&&(p=p.mixedAdd(r.points[o].neg()));c=c.add(p)}return c.toP()},d.prototype._wnafMul=function(e,t){var r=4,i=e._getNAFPoints(r);r=i.wnd;for(var n=i.points,o=s(t,r,this._bitLength),d=this.jpoint(null,null,null),u=o.length-1;u>=0;u--){for(var l=0;u>=0&&0===o[u];u--)l++;if(u>=0&&l++,d=d.dblp(l),u<0)break;var c=o[u];a(0!==c),d="affine"===e.type?c>0?d.mixedAdd(n[c-1>>1]):d.mixedAdd(n[-c-1>>1].neg()):c>0?d.add(n[c-1>>1]):d.add(n[-c-1>>1].neg())}return"affine"===e.type?d.toP():d},d.prototype._wnafMulAdd=function(e,t,r,i,n){var a,d,u,l=this._wnafT1,c=this._wnafT2,p=this._wnafT3,h=0;for(a=0;a<i;a++){var f=(u=t[a])._getNAFPoints(e);l[a]=f.wnd,c[a]=f.points}for(a=i-1;a>=1;a-=2){var y=a-1,g=a;if(1===l[y]&&1===l[g]){var m=[t[y],null,null,t[g]];0===t[y].y.cmp(t[g].y)?(m[1]=t[y].add(t[g]),m[2]=t[y].toJ().mixedAdd(t[g].neg())):0===t[y].y.cmp(t[g].y.redNeg())?(m[1]=t[y].toJ().mixedAdd(t[g]),m[2]=t[y].add(t[g].neg())):(m[1]=t[y].toJ().mixedAdd(t[g]),m[2]=t[y].toJ().mixedAdd(t[g].neg()));var v=[-3,-1,-5,-7,0,7,5,1,3],b=o(r[y],r[g]);for(h=Math.max(b[0].length,h),p[y]=new Array(h),p[g]=new Array(h),d=0;d<h;d++){var _=0|b[0][d],w=0|b[1][d];p[y][d]=v[3*(_+1)+(w+1)],p[g][d]=0,c[y]=m}}else p[y]=s(r[y],l[y],this._bitLength),p[g]=s(r[g],l[g],this._bitLength),h=Math.max(p[y].length,h),h=Math.max(p[g].length,h)}var T=this.jpoint(null,null,null),E=this._wnafT4;for(a=h;a>=0;a--){for(var S=0;a>=0;){var A=!0;for(d=0;d<i;d++)E[d]=0|p[d][a],0!==E[d]&&(A=!1);if(!A)break;S++,a--}if(a>=0&&S++,T=T.dblp(S),a<0)break;for(d=0;d<i;d++){var R=E[d];0!==R&&(R>0?u=c[d][R-1>>1]:R<0&&(u=c[d][-R-1>>1].neg()),T="affine"===u.type?T.mixedAdd(u):T.add(u))}}for(a=0;a<i;a++)c[a]=null;return n?T:T.toP()},d.BasePoint=u,u.prototype.eq=function(){throw new Error("Not implemented")},u.prototype.validate=function(){return this.curve.validate(this)},d.prototype.decodePoint=function(e,t){e=n.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?a(e[e.length-1]%2==0):7===e[0]&&a(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},u.prototype.encodeCompressed=function(e){return this.encode(e,!0)},u.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},u.prototype.encode=function(e,t){return n.encode(this._encode(t),e)},u.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},u.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},u.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n<t;n+=e){for(var s=0;s<e;s++)i=i.dbl();r.push(i)}return{step:e,points:r}},u.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,i=1===r?null:this.dbl(),n=1;n<r;n++)t[n]=t[n-1].add(i);return{wnd:e,points:t}},u.prototype._getBeta=function(){return null},u.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},1547:(e,t,r)=>{"use strict";var i=r(1874),n=r(4845),s=r(5615),o=r(5174),a=i.assert;function d(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,o.call(this,"edwards",e),this.a=new n(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new n(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new n(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function u(e,t,r,i,s){o.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===i?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new n(t,16),this.y=new n(r,16),this.z=i?new n(i,16):this.curve.one,this.t=s&&new n(s,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}s(d,o),e.exports=d,d.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},d.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},d.prototype.jpoint=function(e,t,r,i){return this.point(e,t,r,i)},d.prototype.pointFromX=function(e,t){(e=new n(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),i=this.c2.redSub(this.a.redMul(r)),s=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=i.redMul(s.redInvm()),a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var d=a.fromRed().isOdd();return(t&&!d||!t&&d)&&(a=a.redNeg()),this.point(e,a)},d.prototype.pointFromY=function(e,t){(e=new n(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),i=r.redSub(this.c2),s=r.redMul(this.d).redMul(this.c2).redSub(this.a),o=i.redMul(s.redInvm());if(0===o.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=o.redSqrt();if(0!==a.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},d.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),i=t.redMul(this.a).redAdd(r),n=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===i.cmp(n)},s(u,o.BasePoint),d.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},d.prototype.point=function(e,t,r,i){return new u(this,e,t,r,i)},u.fromJSON=function(e,t){return new u(e,t[0],t[1],t[2])},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(e),n=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),s=i.redAdd(t),o=s.redSub(r),a=i.redSub(t),d=n.redMul(o),u=s.redMul(a),l=n.redMul(a),c=o.redMul(s);return this.curve.point(d,u,c,l)},u.prototype._projDbl=function(){var e,t,r,i,n,s,o=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),d=this.y.redSqr();if(this.curve.twisted){var u=(i=this.curve._mulA(a)).redAdd(d);this.zOne?(e=o.redSub(a).redSub(d).redMul(u.redSub(this.curve.two)),t=u.redMul(i.redSub(d)),r=u.redSqr().redSub(u).redSub(u)):(n=this.z.redSqr(),s=u.redSub(n).redISub(n),e=o.redSub(a).redISub(d).redMul(s),t=u.redMul(i.redSub(d)),r=u.redMul(s))}else i=a.redAdd(d),n=this.curve._mulC(this.z).redSqr(),s=i.redSub(n).redSub(n),e=this.curve._mulC(o.redISub(i)).redMul(s),t=this.curve._mulC(i).redMul(a.redISub(d)),r=i.redMul(s);return this.curve.point(e,t,r)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),n=this.z.redMul(e.z.redAdd(e.z)),s=r.redSub(t),o=n.redSub(i),a=n.redAdd(i),d=r.redAdd(t),u=s.redMul(o),l=a.redMul(d),c=s.redMul(d),p=o.redMul(a);return this.curve.point(u,l,p,c)},u.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),s=this.x.redMul(e.x),o=this.y.redMul(e.y),a=this.curve.d.redMul(s).redMul(o),d=n.redSub(a),u=n.redAdd(a),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(s).redISub(o),c=i.redMul(d).redMul(l);return this.curve.twisted?(t=i.redMul(u).redMul(o.redSub(this.curve._mulA(s))),r=d.redMul(u)):(t=i.redMul(u).redMul(o.redSub(s)),r=this.curve._mulC(d).redMul(u)),this.curve.point(c,t,r)},u.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},u.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},u.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},u.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},7131:(e,t,r)=>{"use strict";var i=t;i.base=r(5174),i.short=r(277),i.mont=r(3245),i.edwards=r(1547)},3245:(e,t,r)=>{"use strict";var i=r(4845),n=r(5615),s=r(5174),o=r(1874);function a(e){s.call(this,"mont",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.i4=new i(4).toRed(this.red).redInvm(),this.two=new i(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function d(e,t,r){s.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new i(t,16),this.z=new i(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}n(a,s),e.exports=a,a.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),i=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===i.redSqrt().redSqr().cmp(i)},n(d,s.BasePoint),a.prototype.decodePoint=function(e,t){return this.point(o.toArray(e,t),1)},a.prototype.point=function(e,t){return new d(this,e,t)},a.prototype.pointFromJSON=function(e){return d.fromJSON(this,e)},d.prototype.precompute=function(){},d.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},d.fromJSON=function(e,t){return new d(e,t[0],t[1]||e.one)},d.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},d.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},d.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),i=e.redMul(t),n=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},d.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},d.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),s=e.x.redSub(e.z).redMul(r),o=n.redMul(i),a=t.z.redMul(s.redAdd(o).redSqr()),d=t.x.redMul(s.redISub(o).redSqr());return this.curve.point(a,d)},d.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.iushrn(1))n.push(t.andln(1));for(var s=n.length-1;s>=0;s--)0===n[s]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},d.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},d.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},d.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},d.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},d.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},277:(e,t,r)=>{"use strict";var i=r(1874),n=r(4845),s=r(5615),o=r(5174),a=i.assert;function d(e){o.call(this,"short",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function u(e,t,r,i){o.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new n(t,16),this.y=new n(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function l(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new n(0)):(this.x=new n(t,16),this.y=new n(r,16),this.z=new n(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}s(d,o),e.exports=d,d.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new n(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new n(e.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(t))?r=s[0]:(r=s[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new n(e.a,16),b:new n(e.b,16)}})):this._getEndoBasis(r)}}},d.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:n.mont(e),r=new n(2).toRed(t).redInvm(),i=r.redNeg(),s=new n(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(s).fromRed(),i.redSub(s).fromRed()]},d.prototype._getEndoBasis=function(e){for(var t,r,i,s,o,a,d,u,l,c=this.n.ushrn(Math.floor(this.n.bitLength()/2)),p=e,h=this.n.clone(),f=new n(1),y=new n(0),g=new n(0),m=new n(1),v=0;0!==p.cmpn(0);){var b=h.div(p);u=h.sub(b.mul(p)),l=g.sub(b.mul(f));var _=m.sub(b.mul(y));if(!i&&u.cmp(c)<0)t=d.neg(),r=f,i=u.neg(),s=l;else if(i&&2==++v)break;d=u,h=p,p=u,g=f,f=l,m=y,y=_}o=u.neg(),a=l;var w=i.sqr().add(s.sqr());return o.sqr().add(a.sqr()).cmp(w)>=0&&(o=t,a=r),i.negative&&(i=i.neg(),s=s.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:i,b:s},{a:o,b:a}]},d.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),s=r.b.neg().mul(e).divRound(this.n),o=n.mul(r.a),a=s.mul(i.a),d=n.mul(r.b),u=s.mul(i.b);return{k1:e.sub(o).sub(a),k2:d.add(u).neg()}},d.prototype.pointFromX=function(e,t){(e=new n(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var s=i.fromRed().isOdd();return(t&&!s||!t&&s)&&(i=i.redNeg()),this.point(e,i)},d.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,i=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},d.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,s=0;s<e.length;s++){var o=this._endoSplit(t[s]),a=e[s],d=a._getBeta();o.k1.negative&&(o.k1.ineg(),a=a.neg(!0)),o.k2.negative&&(o.k2.ineg(),d=d.neg(!0)),i[2*s]=a,i[2*s+1]=d,n[2*s]=o.k1,n[2*s+1]=o.k2}for(var u=this._wnafMulAdd(1,i,n,2*s,r),l=0;l<2*s;l++)i[l]=null,n[l]=null;return u},s(u,o.BasePoint),d.prototype.point=function(e,t,r){return new u(this,e,t,r)},d.prototype.pointFromJSON=function(e,t){return u.fromJSON(this,e,t)},u.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,i=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(i)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(i)}}}return t}},u.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},u.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var i=e.point(t[0],t[1],r);if(!t[2])return i;function n(t){return e.point(t[0],t[1],r)}var s=t[2];return i.precomputed={beta:null,doubles:s.doubles&&{step:s.doubles.step,points:[i].concat(s.doubles.points.map(n))},naf:s.naf&&{wnd:s.naf.wnd,points:[i].concat(s.naf.points.map(n))}},i},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return this.inf},u.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),i=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},u.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),i=e.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(i),s=n.redSqr().redISub(this.x.redAdd(this.x)),o=n.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return e=new n(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)},u.prototype.mulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},u.prototype.jmulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},u.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))},u.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,i=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return t},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},s(l,o.BasePoint),d.prototype.jpoint=function(e,t,r){return new l(this,e,t,r)},l.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(r,i)},l.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},l.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(t),n=e.x.redMul(r),s=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),a=i.redSub(n),d=s.redSub(o);if(0===a.cmpn(0))return 0!==d.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),l=u.redMul(a),c=i.redMul(u),p=d.redSqr().redIAdd(l).redISub(c).redISub(c),h=d.redMul(c.redISub(p)).redISub(s.redMul(l)),f=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(p,h,f)},l.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,i=e.x.redMul(t),n=this.y,s=e.y.redMul(t).redMul(this.z),o=r.redSub(i),a=n.redSub(s);if(0===o.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var d=o.redSqr(),u=d.redMul(o),l=r.redMul(d),c=a.redSqr().redIAdd(u).redISub(l).redISub(l),p=a.redMul(l.redISub(c)).redISub(n.redMul(u)),h=this.z.redMul(o);return this.curve.jpoint(c,p,h)},l.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var i=this.curve.a,n=this.curve.tinv,s=this.x,o=this.y,a=this.z,d=a.redSqr().redSqr(),u=o.redAdd(o);for(t=0;t<e;t++){var l=s.redSqr(),c=u.redSqr(),p=c.redSqr(),h=l.redAdd(l).redIAdd(l).redIAdd(i.redMul(d)),f=s.redMul(c),y=h.redSqr().redISub(f.redAdd(f)),g=f.redISub(y),m=h.redMul(g);m=m.redIAdd(m).redISub(p);var v=u.redMul(a);t+1<e&&(d=d.redMul(p)),s=y,a=v,u=m}return this.curve.jpoint(s,u.redMul(n),a)},l.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},l.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),s=n.redSqr(),o=this.x.redAdd(n).redSqr().redISub(i).redISub(s);o=o.redIAdd(o);var a=i.redAdd(i).redIAdd(i),d=a.redSqr().redISub(o).redISub(o),u=s.redIAdd(s);u=(u=u.redIAdd(u)).redIAdd(u),e=d,t=a.redMul(o.redISub(d)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),c=this.y.redSqr(),p=c.redSqr(),h=this.x.redAdd(c).redSqr().redISub(l).redISub(p);h=h.redIAdd(h);var f=l.redAdd(l).redIAdd(l),y=f.redSqr(),g=p.redIAdd(p);g=(g=g.redIAdd(g)).redIAdd(g),e=y.redISub(h).redISub(h),t=f.redMul(h.redISub(e)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},l.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),s=n.redSqr(),o=this.x.redAdd(n).redSqr().redISub(i).redISub(s);o=o.redIAdd(o);var a=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),d=a.redSqr().redISub(o).redISub(o);e=d;var u=s.redIAdd(s);u=(u=u.redIAdd(u)).redIAdd(u),t=a.redMul(o.redISub(d)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),c=this.y.redSqr(),p=this.x.redMul(c),h=this.x.redSub(l).redMul(this.x.redAdd(l));h=h.redAdd(h).redIAdd(h);var f=p.redIAdd(p),y=(f=f.redIAdd(f)).redAdd(f);e=h.redSqr().redISub(y),r=this.y.redAdd(this.z).redSqr().redISub(c).redISub(l);var g=c.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=h.redMul(f.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,r)},l.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,i=this.z,n=i.redSqr().redSqr(),s=t.redSqr(),o=r.redSqr(),a=s.redAdd(s).redIAdd(s).redIAdd(e.redMul(n)),d=t.redAdd(t),u=(d=d.redIAdd(d)).redMul(o),l=a.redSqr().redISub(u.redAdd(u)),c=u.redISub(l),p=o.redSqr();p=(p=(p=p.redIAdd(p)).redIAdd(p)).redIAdd(p);var h=a.redMul(c).redISub(p),f=r.redAdd(r).redMul(i);return this.curve.jpoint(l,h,f)},l.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),i=t.redSqr(),n=e.redAdd(e).redIAdd(e),s=n.redSqr(),o=this.x.redAdd(t).redSqr().redISub(e).redISub(i),a=(o=(o=(o=o.redIAdd(o)).redAdd(o).redIAdd(o)).redISub(s)).redSqr(),d=i.redIAdd(i);d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var u=n.redIAdd(o).redSqr().redISub(s).redISub(a).redISub(d),l=t.redMul(u);l=(l=l.redIAdd(l)).redIAdd(l);var c=this.x.redMul(a).redISub(l);c=(c=c.redIAdd(c)).redIAdd(c);var p=this.y.redMul(u.redMul(d.redISub(u)).redISub(o.redMul(a)));p=(p=(p=p.redIAdd(p)).redIAdd(p)).redIAdd(p);var h=this.z.redAdd(o).redSqr().redISub(r).redISub(a);return this.curve.jpoint(c,p,h)},l.prototype.mul=function(e,t){return e=new n(e,t),this.curve._wnafMul(this,e)},l.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var i=t.redMul(this.z),n=r.redMul(e.z);return 0===this.y.redMul(n).redISub(e.y.redMul(i)).cmpn(0)},l.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var i=e.clone(),n=this.curve.redN.redMul(t);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},l.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},6443:(e,t,r)=>{"use strict";var i,n=t,s=r(9499),o=r(7131),a=r(1874).assert;function d(e){"short"===e.type?this.curve=new o.short(e):"edwards"===e.type?this.curve=new o.edwards(e):this.curve=new o.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new d(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=d,u("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:s.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("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:s.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("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:s.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("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:s.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"]}),u("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:s.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"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:s.sha256,gRed:!1,g:["9"]}),u("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:s.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{i=r(3986)}catch(e){i=void 0}u("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:s.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",i]})},5064:(e,t,r)=>{"use strict";var i=r(4845),n=r(4742),s=r(1874),o=r(6443),a=r(7048),d=s.assert,u=r(7531),l=r(7782);function c(e){if(!(this instanceof c))return new c(e);"string"==typeof e&&(d(Object.prototype.hasOwnProperty.call(o,e),"Unknown curve "+e),e=o[e]),e instanceof o.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}e.exports=c,c.prototype.keyPair=function(e){return new u(this,e)},c.prototype.keyFromPrivate=function(e,t){return u.fromPrivate(this,e,t)},c.prototype.keyFromPublic=function(e,t){return u.fromPublic(this,e,t)},c.prototype.genKeyPair=function(e){e||(e={});for(var t=new n({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),s=this.n.sub(new i(2));;){var o=new i(t.generate(r));if(!(o.cmp(s)>0))return o.iaddn(1),this.keyFromPrivate(o)}},c.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},c.prototype.sign=function(e,t,r,s){"object"==typeof r&&(s=r,r=null),s||(s={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new i(e,16));for(var o=this.n.byteLength(),a=t.getPrivate().toArray("be",o),d=e.toArray("be",o),u=new n({hash:this.hash,entropy:a,nonce:d,pers:s.pers,persEnc:s.persEnc||"utf8"}),c=this.n.sub(new i(1)),p=0;;p++){var h=s.k?s.k(p):new i(u.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(c)>=0)){var f=this.g.mul(h);if(!f.isInfinity()){var y=f.getX(),g=y.umod(this.n);if(0!==g.cmpn(0)){var m=h.invm(this.n).mul(g.mul(t.getPrivate()).iadd(e));if(0!==(m=m.umod(this.n)).cmpn(0)){var v=(f.getY().isOdd()?1:0)|(0!==y.cmp(g)?2:0);return s.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),v^=1),new l({r:g,s:m,recoveryParam:v})}}}}}},c.prototype.verify=function(e,t,r,n){e=this._truncateToN(new i(e,16)),r=this.keyFromPublic(r,n);var s=(t=new l(t,"hex")).r,o=t.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,d=o.invm(this.n),u=d.mul(e).umod(this.n),c=d.mul(s).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,r.getPublic(),c)).isInfinity()&&a.eqXToP(s):!(a=this.g.mulAdd(u,r.getPublic(),c)).isInfinity()&&0===a.getX().umod(this.n).cmp(s)},c.prototype.recoverPubKey=function(e,t,r,n){d((3&r)===r,"The recovery param is more than two bits"),t=new l(t,n);var s=this.n,o=new i(e),a=t.r,u=t.s,c=1&r,p=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&p)throw new Error("Unable to find sencond key candinate");a=p?this.curve.pointFromX(a.add(this.curve.n),c):this.curve.pointFromX(a,c);var h=t.r.invm(s),f=s.sub(o).mul(h).umod(s),y=u.mul(h).umod(s);return this.g.mulAdd(f,a,y)},c.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new l(t,i)).recoveryParam)return t.recoveryParam;for(var n=0;n<4;n++){var s;try{s=this.recoverPubKey(e,t,n)}catch(e){continue}if(s.eq(r))return n}throw new Error("Unable to find valid recovery factor")}},7531:(e,t,r)=>{"use strict";var i=r(4845),n=r(1874).assert;function s(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=s,s.fromPublic=function(e,t,r){return t instanceof s?t:new s(e,{pub:t,pubEnc:r})},s.fromPrivate=function(e,t,r){return t instanceof s?t:new s(e,{priv:t,privEnc:r})},s.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},s.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},s.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},s.prototype._importPrivate=function(e,t){this.priv=new i(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},s.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},s.prototype.derive=function(e){return e.validate()||n(e.validate(),"public point not validated"),e.mul(this.priv).getX()},s.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},s.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},s.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},7782:(e,t,r)=>{"use strict";var i=r(4845),n=r(1874),s=n.assert;function o(e,t){if(e instanceof o)return e;this._importDER(e,t)||(s(e.r&&e.s,"Signature without r or s"),this.r=new i(e.r,16),this.s=new i(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function a(){this.place=0}function d(e,t){var r=e[t.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;for(var n=0,s=0,o=t.place;s<i;s++,o++)n<<=8,n|=e[o],n>>>=0;return!(n<=127)&&(t.place=o,n)}function u(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function l(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=o,o.prototype._importDER=function(e,t){e=n.toArray(e,t);var r=new a;if(48!==e[r.place++])return!1;var s=d(e,r);if(!1===s)return!1;if(s+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var o=d(e,r);if(!1===o)return!1;var u=e.slice(r.place,o+r.place);if(r.place+=o,2!==e[r.place++])return!1;var l=d(e,r);if(!1===l)return!1;if(e.length!==l+r.place)return!1;var c=e.slice(r.place,l+r.place);if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}return this.r=new i(u),this.s=new i(c),this.recoveryParam=null,!0},o.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=u(t),r=u(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];l(i,t.length),(i=i.concat(t)).push(2),l(i,r.length);var s=i.concat(r),o=[48];return l(o,s.length),o=o.concat(s),n.encode(o,e)}},4807:(e,t,r)=>{"use strict";var i=r(9499),n=r(6443),s=r(1874),o=s.assert,a=s.parseBytes,d=r(4672),u=r(8401);function l(e){if(o("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof l))return new l(e);e=n[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=i.sha512}e.exports=l,l.prototype.sign=function(e,t){e=a(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),n=this.g.mul(i),s=this.encodePoint(n),o=this.hashInt(s,r.pubBytes(),e).mul(r.priv()),d=i.add(o).umod(this.curve.n);return this.makeSignature({R:n,S:d,Rencoded:s})},l.prototype.verify=function(e,t,r){e=a(e),t=this.makeSignature(t);var i=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),i.pubBytes(),e),s=this.g.mul(t.S());return t.R().add(i.pub().mul(n)).eq(s)},l.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return s.intFromLE(e.digest()).umod(this.curve.n)},l.prototype.keyFromPublic=function(e){return d.fromPublic(this,e)},l.prototype.keyFromSecret=function(e){return d.fromSecret(this,e)},l.prototype.makeSignature=function(e){return e instanceof u?e:new u(this,e)},l.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},l.prototype.decodePoint=function(e){var t=(e=s.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),i=0!=(128&e[t]),n=s.intFromLE(r);return this.curve.pointFromY(n,i)},l.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},l.prototype.decodeInt=function(e){return s.intFromLE(e)},l.prototype.isPoint=function(e){return e instanceof this.pointClass}},4672:(e,t,r)=>{"use strict";var i=r(1874),n=i.assert,s=i.parseBytes,o=i.cachedProperty;function a(e,t){this.eddsa=e,this._secret=s(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=s(t.pub)}a.fromPublic=function(e,t){return t instanceof a?t:new a(e,{pub:t})},a.fromSecret=function(e,t){return t instanceof a?t:new a(e,{secret:t})},a.prototype.secret=function(){return this._secret},o(a,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),o(a,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),o(a,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,i=t.slice(0,e.encodingLength);return i[0]&=248,i[r]&=127,i[r]|=64,i})),o(a,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),o(a,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),o(a,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function(e){return n(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},a.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},a.prototype.getSecret=function(e){return n(this._secret,"KeyPair is public only"),i.encode(this.secret(),e)},a.prototype.getPublic=function(e){return i.encode(this.pubBytes(),e)},e.exports=a},8401:(e,t,r)=>{"use strict";var i=r(4845),n=r(1874),s=n.assert,o=n.cachedProperty,a=n.parseBytes;function d(e,t){this.eddsa=e,"object"!=typeof t&&(t=a(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),s(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof i&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}o(d,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),o(d,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),o(d,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),o(d,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),d.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},d.prototype.toHex=function(){return n.encode(this.toBytes(),"hex").toUpperCase()},e.exports=d},3986:e=>{e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},1874:(e,t,r)=>{"use strict";var i=t,n=r(4845),s=r(7784),o=r(9042);i.assert=s,i.toArray=o.toArray,i.zero2=o.zero2,i.toHex=o.toHex,i.encode=o.encode,i.getNAF=function(e,t,r){var i=new Array(Math.max(e.bitLength(),r)+1);i.fill(0);for(var n=1<<t+1,s=e.clone(),o=0;o<i.length;o++){var a,d=s.andln(n-1);s.isOdd()?(a=d>(n>>1)-1?(n>>1)-d:d,s.isubn(a)):a=0,i[o]=a,s.iushrn(1)}return i},i.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var i,n=0,s=0;e.cmpn(-n)>0||t.cmpn(-s)>0;){var o,a,d=e.andln(3)+n&3,u=t.andln(3)+s&3;3===d&&(d=-1),3===u&&(u=-1),o=0==(1&d)?0:3!==(i=e.andln(7)+n&7)&&5!==i||2!==u?d:-d,r[0].push(o),a=0==(1&u)?0:3!==(i=t.andln(7)+s&7)&&5!==i||2!==d?u:-u,r[1].push(a),2*n===o+1&&(n=1-n),2*s===a+1&&(s=1-s),e.iushrn(1),t.iushrn(1)}return r},i.cachedProperty=function(e,t,r){var i="_"+t;e.prototype[t]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},i.parseBytes=function(e){return"string"==typeof e?i.toArray(e,"hex"):e},i.intFromLE=function(e){return new n(e,"hex","le")}},4845:function(e,t,r){!function(e,t){"use strict";function i(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function s(e,t,r){if(s.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=s:t.BN=s,s.BN=s,s.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(2661).Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function d(e,t,r){var i=a(e,r);return r-1>=t&&(i|=a(e,r-1)<<4),i}function u(e,t,r,i){for(var n=0,s=Math.min(e.length,r),o=t;o<s;o++){var a=e.charCodeAt(o)-48;n*=i,n+=a>=49?a-49+10:a>=17?a-17+10:a}return n}s.isBN=function(e){return e instanceof s||null!==e&&"object"==typeof e&&e.constructor.wordSize===s.wordSize&&Array.isArray(e.words)},s.max=function(e,t){return e.cmp(t)>0?e:t},s.min=function(e,t){return e.cmp(t)<0?e:t},s.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),i(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<e.length&&(16===t?this._parseHex(e,n,r):(this._parseBase(e,t,n),"le"===r&&this._initArray(this.toArray(),t,r)))},s.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(i(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},s.prototype._initArray=function(e,t,r){if(i("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var s,o,a=0;if("be"===r)for(n=e.length-1,s=0;n>=0;n-=3)o=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);else if("le"===r)for(n=0,s=0;n<e.length;n+=3)o=e[n]|e[n+1]<<8|e[n+2]<<16,this.words[s]|=o<<a&67108863,this.words[s+1]=o>>>26-a&67108863,(a+=24)>=26&&(a-=26,s++);return this.strip()},s.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var n,s=0,o=0;if("be"===r)for(i=e.length-1;i>=t;i-=2)n=d(e,t,i)<<s,this.words[o]|=67108863&n,s>=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;else for(i=(e.length-t)%2==0?t+1:t;i<e.length;i+=2)n=d(e,t,i)<<s,this.words[o]|=67108863&n,s>=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;this.strip()},s.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=t)i++;i--,n=n/t|0;for(var s=e.length-r,o=s%i,a=Math.min(s,s-o)+r,d=0,l=r;l<a;l+=i)d=u(e,l,l+i,t),this.imuln(n),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(0!==o){var c=1;for(d=u(e,l,e.length,t),l=0;l<o;l++)c*=t;this.imuln(c),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}this.strip()},s.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},s.prototype.clone=function(){var e=new s(null);return this.copy(e),e},s.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],s=0|t.words[0],o=n*s,a=67108863&o,d=o/67108864|0;r.words[0]=a;for(var u=1;u<i;u++){for(var l=d>>>26,c=67108863&d,p=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=p;h++){var f=u-h|0;l+=(o=(n=0|e.words[f])*(s=0|t.words[h])+c)/67108864|0,c=67108863&o}r.words[u]=0|c,d=0|l}return 0!==d?r.words[u]=0|d:r.length--,r.strip()}s.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,s=0,o=0;o<this.length;o++){var a=this.words[o],d=(16777215&(a<<n|s)).toString(16);r=0!==(s=a>>>24-n&16777215)||o!==this.length-1?l[6-d.length]+d+r:d+r,(n+=2)>=26&&(n-=26,o--)}for(0!==s&&(r=s.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 u=c[e],h=p[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var y=f.modn(h).toString(e);r=(f=f.idivn(h)).isZero()?y+r:l[u-y.length]+y+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},s.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&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(e,t){return i(void 0!==o),this.toArrayLike(o,e,t)},s.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},s.prototype.toArrayLike=function(e,t,r){var n=this.byteLength(),s=r||Math.max(1,n);i(n<=s,"byte array longer than desired length"),i(s>0,"Requested array length <= 0"),this.strip();var o,a,d="le"===t,u=new e(s),l=this.clone();if(d){for(a=0;!l.isZero();a++)o=l.andln(255),l.iushrn(8),u[a]=o;for(;a<s;a++)u[a]=0}else{for(a=0;a<s-n;a++)u[a]=0;for(a=0;!l.isZero();a++)o=l.andln(255),l.iushrn(8),u[s-a-1]=o}return u},Math.clz32?s.prototype._countBits=function(e){return 32-Math.clz32(e)}:s.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},s.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},s.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},s.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},s.prototype.ior=function(e){return i(0==(this.negative|e.negative)),this.iuor(e)},s.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},s.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},s.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},s.prototype.iand=function(e){return i(0==(this.negative|e.negative)),this.iuand(e)},s.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},s.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},s.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;i<r.length;i++)this.words[i]=t.words[i]^r.words[i];if(this!==t)for(;i<t.length;i++)this.words[i]=t.words[i];return this.length=t.length,this.strip()},s.prototype.ixor=function(e){return i(0==(this.negative|e.negative)),this.iuxor(e)},s.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},s.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},s.prototype.inotn=function(e){i("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n<t;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},s.prototype.notn=function(e){return this.clone().inotn(e)},s.prototype.setn=function(e,t){i("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},s.prototype.iadd=function(e){var t,r,i;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,i=e):(r=e,i=this);for(var n=0,s=0;s<i.length;s++)t=(0|r.words[s])+(0|i.words[s])+n,this.words[s]=67108863&t,n=t>>>26;for(;0!==n&&s<r.length;s++)t=(0|r.words[s])+n,this.words[s]=67108863&t,n=t>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this},s.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},s.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,i,n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=e):(r=e,i=this);for(var s=0,o=0;o<i.length;o++)s=(t=(0|r.words[o])-(0|i.words[o])+s)>>26,this.words[o]=67108863&t;for(;0!==s&&o<r.length;o++)s=(t=(0|r.words[o])+s)>>26,this.words[o]=67108863&t;if(0===s&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(e){return this.clone().isub(e)};var f=function(e,t,r){var i,n,s,o=e.words,a=t.words,d=r.words,u=0,l=0|o[0],c=8191&l,p=l>>>13,h=0|o[1],f=8191&h,y=h>>>13,g=0|o[2],m=8191&g,v=g>>>13,b=0|o[3],_=8191&b,w=b>>>13,T=0|o[4],E=8191&T,S=T>>>13,A=0|o[5],R=8191&A,M=A>>>13,I=0|o[6],O=8191&I,x=I>>>13,k=0|o[7],C=8191&k,P=k>>>13,D=0|o[8],N=8191&D,B=D>>>13,q=0|o[9],L=8191&q,j=q>>>13,F=0|a[0],U=8191&F,z=F>>>13,H=0|a[1],G=8191&H,K=H>>>13,W=0|a[2],V=8191&W,$=W>>>13,Z=0|a[3],Y=8191&Z,J=Z>>>13,X=0|a[4],Q=8191&X,ee=X>>>13,te=0|a[5],re=8191&te,ie=te>>>13,ne=0|a[6],se=8191&ne,oe=ne>>>13,ae=0|a[7],de=8191&ae,ue=ae>>>13,le=0|a[8],ce=8191&le,pe=le>>>13,he=0|a[9],fe=8191&he,ye=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(i=Math.imul(c,U))|0)+((8191&(n=(n=Math.imul(c,z))+Math.imul(p,U)|0))<<13)|0;u=((s=Math.imul(p,z))+(n>>>13)|0)+(ge>>>26)|0,ge&=67108863,i=Math.imul(f,U),n=(n=Math.imul(f,z))+Math.imul(y,U)|0,s=Math.imul(y,z);var me=(u+(i=i+Math.imul(c,G)|0)|0)+((8191&(n=(n=n+Math.imul(c,K)|0)+Math.imul(p,G)|0))<<13)|0;u=((s=s+Math.imul(p,K)|0)+(n>>>13)|0)+(me>>>26)|0,me&=67108863,i=Math.imul(m,U),n=(n=Math.imul(m,z))+Math.imul(v,U)|0,s=Math.imul(v,z),i=i+Math.imul(f,G)|0,n=(n=n+Math.imul(f,K)|0)+Math.imul(y,G)|0,s=s+Math.imul(y,K)|0;var ve=(u+(i=i+Math.imul(c,V)|0)|0)+((8191&(n=(n=n+Math.imul(c,$)|0)+Math.imul(p,V)|0))<<13)|0;u=((s=s+Math.imul(p,$)|0)+(n>>>13)|0)+(ve>>>26)|0,ve&=67108863,i=Math.imul(_,U),n=(n=Math.imul(_,z))+Math.imul(w,U)|0,s=Math.imul(w,z),i=i+Math.imul(m,G)|0,n=(n=n+Math.imul(m,K)|0)+Math.imul(v,G)|0,s=s+Math.imul(v,K)|0,i=i+Math.imul(f,V)|0,n=(n=n+Math.imul(f,$)|0)+Math.imul(y,V)|0,s=s+Math.imul(y,$)|0;var be=(u+(i=i+Math.imul(c,Y)|0)|0)+((8191&(n=(n=n+Math.imul(c,J)|0)+Math.imul(p,Y)|0))<<13)|0;u=((s=s+Math.imul(p,J)|0)+(n>>>13)|0)+(be>>>26)|0,be&=67108863,i=Math.imul(E,U),n=(n=Math.imul(E,z))+Math.imul(S,U)|0,s=Math.imul(S,z),i=i+Math.imul(_,G)|0,n=(n=n+Math.imul(_,K)|0)+Math.imul(w,G)|0,s=s+Math.imul(w,K)|0,i=i+Math.imul(m,V)|0,n=(n=n+Math.imul(m,$)|0)+Math.imul(v,V)|0,s=s+Math.imul(v,$)|0,i=i+Math.imul(f,Y)|0,n=(n=n+Math.imul(f,J)|0)+Math.imul(y,Y)|0,s=s+Math.imul(y,J)|0;var _e=(u+(i=i+Math.imul(c,Q)|0)|0)+((8191&(n=(n=n+Math.imul(c,ee)|0)+Math.imul(p,Q)|0))<<13)|0;u=((s=s+Math.imul(p,ee)|0)+(n>>>13)|0)+(_e>>>26)|0,_e&=67108863,i=Math.imul(R,U),n=(n=Math.imul(R,z))+Math.imul(M,U)|0,s=Math.imul(M,z),i=i+Math.imul(E,G)|0,n=(n=n+Math.imul(E,K)|0)+Math.imul(S,G)|0,s=s+Math.imul(S,K)|0,i=i+Math.imul(_,V)|0,n=(n=n+Math.imul(_,$)|0)+Math.imul(w,V)|0,s=s+Math.imul(w,$)|0,i=i+Math.imul(m,Y)|0,n=(n=n+Math.imul(m,J)|0)+Math.imul(v,Y)|0,s=s+Math.imul(v,J)|0,i=i+Math.imul(f,Q)|0,n=(n=n+Math.imul(f,ee)|0)+Math.imul(y,Q)|0,s=s+Math.imul(y,ee)|0;var we=(u+(i=i+Math.imul(c,re)|0)|0)+((8191&(n=(n=n+Math.imul(c,ie)|0)+Math.imul(p,re)|0))<<13)|0;u=((s=s+Math.imul(p,ie)|0)+(n>>>13)|0)+(we>>>26)|0,we&=67108863,i=Math.imul(O,U),n=(n=Math.imul(O,z))+Math.imul(x,U)|0,s=Math.imul(x,z),i=i+Math.imul(R,G)|0,n=(n=n+Math.imul(R,K)|0)+Math.imul(M,G)|0,s=s+Math.imul(M,K)|0,i=i+Math.imul(E,V)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(S,V)|0,s=s+Math.imul(S,$)|0,i=i+Math.imul(_,Y)|0,n=(n=n+Math.imul(_,J)|0)+Math.imul(w,Y)|0,s=s+Math.imul(w,J)|0,i=i+Math.imul(m,Q)|0,n=(n=n+Math.imul(m,ee)|0)+Math.imul(v,Q)|0,s=s+Math.imul(v,ee)|0,i=i+Math.imul(f,re)|0,n=(n=n+Math.imul(f,ie)|0)+Math.imul(y,re)|0,s=s+Math.imul(y,ie)|0;var Te=(u+(i=i+Math.imul(c,se)|0)|0)+((8191&(n=(n=n+Math.imul(c,oe)|0)+Math.imul(p,se)|0))<<13)|0;u=((s=s+Math.imul(p,oe)|0)+(n>>>13)|0)+(Te>>>26)|0,Te&=67108863,i=Math.imul(C,U),n=(n=Math.imul(C,z))+Math.imul(P,U)|0,s=Math.imul(P,z),i=i+Math.imul(O,G)|0,n=(n=n+Math.imul(O,K)|0)+Math.imul(x,G)|0,s=s+Math.imul(x,K)|0,i=i+Math.imul(R,V)|0,n=(n=n+Math.imul(R,$)|0)+Math.imul(M,V)|0,s=s+Math.imul(M,$)|0,i=i+Math.imul(E,Y)|0,n=(n=n+Math.imul(E,J)|0)+Math.imul(S,Y)|0,s=s+Math.imul(S,J)|0,i=i+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,ee)|0)+Math.imul(w,Q)|0,s=s+Math.imul(w,ee)|0,i=i+Math.imul(m,re)|0,n=(n=n+Math.imul(m,ie)|0)+Math.imul(v,re)|0,s=s+Math.imul(v,ie)|0,i=i+Math.imul(f,se)|0,n=(n=n+Math.imul(f,oe)|0)+Math.imul(y,se)|0,s=s+Math.imul(y,oe)|0;var Ee=(u+(i=i+Math.imul(c,de)|0)|0)+((8191&(n=(n=n+Math.imul(c,ue)|0)+Math.imul(p,de)|0))<<13)|0;u=((s=s+Math.imul(p,ue)|0)+(n>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,i=Math.imul(N,U),n=(n=Math.imul(N,z))+Math.imul(B,U)|0,s=Math.imul(B,z),i=i+Math.imul(C,G)|0,n=(n=n+Math.imul(C,K)|0)+Math.imul(P,G)|0,s=s+Math.imul(P,K)|0,i=i+Math.imul(O,V)|0,n=(n=n+Math.imul(O,$)|0)+Math.imul(x,V)|0,s=s+Math.imul(x,$)|0,i=i+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,J)|0)+Math.imul(M,Y)|0,s=s+Math.imul(M,J)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,ee)|0)+Math.imul(S,Q)|0,s=s+Math.imul(S,ee)|0,i=i+Math.imul(_,re)|0,n=(n=n+Math.imul(_,ie)|0)+Math.imul(w,re)|0,s=s+Math.imul(w,ie)|0,i=i+Math.imul(m,se)|0,n=(n=n+Math.imul(m,oe)|0)+Math.imul(v,se)|0,s=s+Math.imul(v,oe)|0,i=i+Math.imul(f,de)|0,n=(n=n+Math.imul(f,ue)|0)+Math.imul(y,de)|0,s=s+Math.imul(y,ue)|0;var Se=(u+(i=i+Math.imul(c,ce)|0)|0)+((8191&(n=(n=n+Math.imul(c,pe)|0)+Math.imul(p,ce)|0))<<13)|0;u=((s=s+Math.imul(p,pe)|0)+(n>>>13)|0)+(Se>>>26)|0,Se&=67108863,i=Math.imul(L,U),n=(n=Math.imul(L,z))+Math.imul(j,U)|0,s=Math.imul(j,z),i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,K)|0)+Math.imul(B,G)|0,s=s+Math.imul(B,K)|0,i=i+Math.imul(C,V)|0,n=(n=n+Math.imul(C,$)|0)+Math.imul(P,V)|0,s=s+Math.imul(P,$)|0,i=i+Math.imul(O,Y)|0,n=(n=n+Math.imul(O,J)|0)+Math.imul(x,Y)|0,s=s+Math.imul(x,J)|0,i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,ee)|0)+Math.imul(M,Q)|0,s=s+Math.imul(M,ee)|0,i=i+Math.imul(E,re)|0,n=(n=n+Math.imul(E,ie)|0)+Math.imul(S,re)|0,s=s+Math.imul(S,ie)|0,i=i+Math.imul(_,se)|0,n=(n=n+Math.imul(_,oe)|0)+Math.imul(w,se)|0,s=s+Math.imul(w,oe)|0,i=i+Math.imul(m,de)|0,n=(n=n+Math.imul(m,ue)|0)+Math.imul(v,de)|0,s=s+Math.imul(v,ue)|0,i=i+Math.imul(f,ce)|0,n=(n=n+Math.imul(f,pe)|0)+Math.imul(y,ce)|0,s=s+Math.imul(y,pe)|0;var Ae=(u+(i=i+Math.imul(c,fe)|0)|0)+((8191&(n=(n=n+Math.imul(c,ye)|0)+Math.imul(p,fe)|0))<<13)|0;u=((s=s+Math.imul(p,ye)|0)+(n>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,i=Math.imul(L,G),n=(n=Math.imul(L,K))+Math.imul(j,G)|0,s=Math.imul(j,K),i=i+Math.imul(N,V)|0,n=(n=n+Math.imul(N,$)|0)+Math.imul(B,V)|0,s=s+Math.imul(B,$)|0,i=i+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,J)|0)+Math.imul(P,Y)|0,s=s+Math.imul(P,J)|0,i=i+Math.imul(O,Q)|0,n=(n=n+Math.imul(O,ee)|0)+Math.imul(x,Q)|0,s=s+Math.imul(x,ee)|0,i=i+Math.imul(R,re)|0,n=(n=n+Math.imul(R,ie)|0)+Math.imul(M,re)|0,s=s+Math.imul(M,ie)|0,i=i+Math.imul(E,se)|0,n=(n=n+Math.imul(E,oe)|0)+Math.imul(S,se)|0,s=s+Math.imul(S,oe)|0,i=i+Math.imul(_,de)|0,n=(n=n+Math.imul(_,ue)|0)+Math.imul(w,de)|0,s=s+Math.imul(w,ue)|0,i=i+Math.imul(m,ce)|0,n=(n=n+Math.imul(m,pe)|0)+Math.imul(v,ce)|0,s=s+Math.imul(v,pe)|0;var Re=(u+(i=i+Math.imul(f,fe)|0)|0)+((8191&(n=(n=n+Math.imul(f,ye)|0)+Math.imul(y,fe)|0))<<13)|0;u=((s=s+Math.imul(y,ye)|0)+(n>>>13)|0)+(Re>>>26)|0,Re&=67108863,i=Math.imul(L,V),n=(n=Math.imul(L,$))+Math.imul(j,V)|0,s=Math.imul(j,$),i=i+Math.imul(N,Y)|0,n=(n=n+Math.imul(N,J)|0)+Math.imul(B,Y)|0,s=s+Math.imul(B,J)|0,i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,ee)|0)+Math.imul(P,Q)|0,s=s+Math.imul(P,ee)|0,i=i+Math.imul(O,re)|0,n=(n=n+Math.imul(O,ie)|0)+Math.imul(x,re)|0,s=s+Math.imul(x,ie)|0,i=i+Math.imul(R,se)|0,n=(n=n+Math.imul(R,oe)|0)+Math.imul(M,se)|0,s=s+Math.imul(M,oe)|0,i=i+Math.imul(E,de)|0,n=(n=n+Math.imul(E,ue)|0)+Math.imul(S,de)|0,s=s+Math.imul(S,ue)|0,i=i+Math.imul(_,ce)|0,n=(n=n+Math.imul(_,pe)|0)+Math.imul(w,ce)|0,s=s+Math.imul(w,pe)|0;var Me=(u+(i=i+Math.imul(m,fe)|0)|0)+((8191&(n=(n=n+Math.imul(m,ye)|0)+Math.imul(v,fe)|0))<<13)|0;u=((s=s+Math.imul(v,ye)|0)+(n>>>13)|0)+(Me>>>26)|0,Me&=67108863,i=Math.imul(L,Y),n=(n=Math.imul(L,J))+Math.imul(j,Y)|0,s=Math.imul(j,J),i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,ee)|0)+Math.imul(B,Q)|0,s=s+Math.imul(B,ee)|0,i=i+Math.imul(C,re)|0,n=(n=n+Math.imul(C,ie)|0)+Math.imul(P,re)|0,s=s+Math.imul(P,ie)|0,i=i+Math.imul(O,se)|0,n=(n=n+Math.imul(O,oe)|0)+Math.imul(x,se)|0,s=s+Math.imul(x,oe)|0,i=i+Math.imul(R,de)|0,n=(n=n+Math.imul(R,ue)|0)+Math.imul(M,de)|0,s=s+Math.imul(M,ue)|0,i=i+Math.imul(E,ce)|0,n=(n=n+Math.imul(E,pe)|0)+Math.imul(S,ce)|0,s=s+Math.imul(S,pe)|0;var Ie=(u+(i=i+Math.imul(_,fe)|0)|0)+((8191&(n=(n=n+Math.imul(_,ye)|0)+Math.imul(w,fe)|0))<<13)|0;u=((s=s+Math.imul(w,ye)|0)+(n>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,i=Math.imul(L,Q),n=(n=Math.imul(L,ee))+Math.imul(j,Q)|0,s=Math.imul(j,ee),i=i+Math.imul(N,re)|0,n=(n=n+Math.imul(N,ie)|0)+Math.imul(B,re)|0,s=s+Math.imul(B,ie)|0,i=i+Math.imul(C,se)|0,n=(n=n+Math.imul(C,oe)|0)+Math.imul(P,se)|0,s=s+Math.imul(P,oe)|0,i=i+Math.imul(O,de)|0,n=(n=n+Math.imul(O,ue)|0)+Math.imul(x,de)|0,s=s+Math.imul(x,ue)|0,i=i+Math.imul(R,ce)|0,n=(n=n+Math.imul(R,pe)|0)+Math.imul(M,ce)|0,s=s+Math.imul(M,pe)|0;var Oe=(u+(i=i+Math.imul(E,fe)|0)|0)+((8191&(n=(n=n+Math.imul(E,ye)|0)+Math.imul(S,fe)|0))<<13)|0;u=((s=s+Math.imul(S,ye)|0)+(n>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,i=Math.imul(L,re),n=(n=Math.imul(L,ie))+Math.imul(j,re)|0,s=Math.imul(j,ie),i=i+Math.imul(N,se)|0,n=(n=n+Math.imul(N,oe)|0)+Math.imul(B,se)|0,s=s+Math.imul(B,oe)|0,i=i+Math.imul(C,de)|0,n=(n=n+Math.imul(C,ue)|0)+Math.imul(P,de)|0,s=s+Math.imul(P,ue)|0,i=i+Math.imul(O,ce)|0,n=(n=n+Math.imul(O,pe)|0)+Math.imul(x,ce)|0,s=s+Math.imul(x,pe)|0;var xe=(u+(i=i+Math.imul(R,fe)|0)|0)+((8191&(n=(n=n+Math.imul(R,ye)|0)+Math.imul(M,fe)|0))<<13)|0;u=((s=s+Math.imul(M,ye)|0)+(n>>>13)|0)+(xe>>>26)|0,xe&=67108863,i=Math.imul(L,se),n=(n=Math.imul(L,oe))+Math.imul(j,se)|0,s=Math.imul(j,oe),i=i+Math.imul(N,de)|0,n=(n=n+Math.imul(N,ue)|0)+Math.imul(B,de)|0,s=s+Math.imul(B,ue)|0,i=i+Math.imul(C,ce)|0,n=(n=n+Math.imul(C,pe)|0)+Math.imul(P,ce)|0,s=s+Math.imul(P,pe)|0;var ke=(u+(i=i+Math.imul(O,fe)|0)|0)+((8191&(n=(n=n+Math.imul(O,ye)|0)+Math.imul(x,fe)|0))<<13)|0;u=((s=s+Math.imul(x,ye)|0)+(n>>>13)|0)+(ke>>>26)|0,ke&=67108863,i=Math.imul(L,de),n=(n=Math.imul(L,ue))+Math.imul(j,de)|0,s=Math.imul(j,ue),i=i+Math.imul(N,ce)|0,n=(n=n+Math.imul(N,pe)|0)+Math.imul(B,ce)|0,s=s+Math.imul(B,pe)|0;var Ce=(u+(i=i+Math.imul(C,fe)|0)|0)+((8191&(n=(n=n+Math.imul(C,ye)|0)+Math.imul(P,fe)|0))<<13)|0;u=((s=s+Math.imul(P,ye)|0)+(n>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,i=Math.imul(L,ce),n=(n=Math.imul(L,pe))+Math.imul(j,ce)|0,s=Math.imul(j,pe);var Pe=(u+(i=i+Math.imul(N,fe)|0)|0)+((8191&(n=(n=n+Math.imul(N,ye)|0)+Math.imul(B,fe)|0))<<13)|0;u=((s=s+Math.imul(B,ye)|0)+(n>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var De=(u+(i=Math.imul(L,fe))|0)+((8191&(n=(n=Math.imul(L,ye))+Math.imul(j,fe)|0))<<13)|0;return u=((s=Math.imul(j,ye))+(n>>>13)|0)+(De>>>26)|0,De&=67108863,d[0]=ge,d[1]=me,d[2]=ve,d[3]=be,d[4]=_e,d[5]=we,d[6]=Te,d[7]=Ee,d[8]=Se,d[9]=Ae,d[10]=Re,d[11]=Me,d[12]=Ie,d[13]=Oe,d[14]=xe,d[15]=ke,d[16]=Ce,d[17]=Pe,d[18]=De,0!==u&&(d[19]=u,r.length++),r};function y(e,t,r){return(new g).mulp(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(f=h),s.prototype.mulTo=function(e,t){var r,i=this.length+e.length;return r=10===this.length&&10===e.length?f(this,e,t):i<63?h(this,e,t):i<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,s=0;s<r.length-1;s++){var o=n;n=0;for(var a=67108863&i,d=Math.min(s,t.length-1),u=Math.max(0,s-e.length+1);u<=d;u++){var l=s-u,c=(0|e.words[l])*(0|t.words[u]),p=67108863&c;a=67108863&(p=p+a|0),n+=(o=(o=o+(c/67108864|0)|0)+(p>>>26)|0)>>>26,o&=67108863}r.words[s]=a,i=o,o=n}return 0!==i?r.words[s]=i:r.length--,r.strip()}(this,e,t):y(this,e,t),r},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=s.prototype._countBits(e)-1,i=0;i<e;i++)t[i]=this.revBin(i,r,e);return t},g.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var i=0,n=0;n<t;n++)i|=(1&e)<<t-n-1,e>>=1;return i},g.prototype.permute=function(e,t,r,i,n,s){for(var o=0;o<s;o++)i[o]=t[e[o]],n[o]=r[e[o]]},g.prototype.transform=function(e,t,r,i,n,s){this.permute(s,e,t,r,i,n);for(var o=1;o<n;o<<=1)for(var a=o<<1,d=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),l=0;l<n;l+=a)for(var c=d,p=u,h=0;h<o;h++){var f=r[l+h],y=i[l+h],g=r[l+h+o],m=i[l+h+o],v=c*g-p*m;m=c*m+p*g,g=v,r[l+h]=f+g,i[l+h]=y+m,r[l+h+o]=f-g,i[l+h+o]=y-m,h!==a&&(v=d*c-u*p,p=d*p+u*c,c=v)}},g.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},g.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=e[i];e[i]=e[r-i-1],e[r-i-1]=n,n=t[i],t[i]=-t[r-i-1],t[r-i-1]=-n}},g.prototype.normalize13b=function(e,t){for(var r=0,i=0;i<t/2;i++){var n=8192*Math.round(e[2*i+1]/t)+Math.round(e[2*i]/t)+r;e[i]=67108863&n,r=n<67108864?0:n/67108864|0}return e},g.prototype.convert13b=function(e,t,r,n){for(var s=0,o=0;o<t;o++)s+=0|e[o],r[2*o]=8191&s,s>>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*t;o<n;++o)r[o]=0;i(0===s),i(0==(-8192&s))},g.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},g.prototype.mulp=function(e,t,r){var i=2*this.guessLen13b(e.length,t.length),n=this.makeRBT(i),s=this.stub(i),o=new Array(i),a=new Array(i),d=new Array(i),u=new Array(i),l=new Array(i),c=new Array(i),p=r.words;p.length=i,this.convert13b(e.words,e.length,o,i),this.convert13b(t.words,t.length,u,i),this.transform(o,s,a,d,i,n),this.transform(u,s,l,c,i,n);for(var h=0;h<i;h++){var f=a[h]*l[h]-d[h]*c[h];d[h]=a[h]*c[h]+d[h]*l[h],a[h]=f}return this.conjugate(a,d,i),this.transform(a,d,p,s,i,n),this.conjugate(p,s,i),this.normalize13b(p,i),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},s.prototype.mul=function(e){var t=new s(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},s.prototype.mulf=function(e){var t=new s(null);return t.words=new Array(this.length+e.length),y(this,e,t)},s.prototype.imul=function(e){return this.clone().mulTo(e,this)},s.prototype.imuln=function(e){i("number"==typeof e),i(e<67108864);for(var t=0,r=0;r<this.length;r++){var n=(0|this.words[r])*e,s=(67108863&n)+(67108863&t);t>>=26,t+=n/67108864|0,t+=s>>>26,this.words[r]=67108863&s}return 0!==t&&(this.words[r]=t,this.length++),this},s.prototype.muln=function(e){return this.clone().imuln(e)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var i=r/26|0,n=r%26;t[r]=(e.words[i]&1<<n)>>>n}return t}(e);if(0===t.length)return new s(1);for(var r=this,i=0;i<t.length&&0===t[i];i++,r=r.sqr());if(++i<t.length)for(var n=r.sqr();i<t.length;i++,n=n.sqr())0!==t[i]&&(r=r.mul(n));return r},s.prototype.iushln=function(e){i("number"==typeof e&&e>=0);var t,r=e%26,n=(e-r)/26,s=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t<this.length;t++){var a=this.words[t]&s,d=(0|this.words[t])-a<<r;this.words[t]=d|o,o=a>>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t<n;t++)this.words[t]=0;this.length+=n}return this.strip()},s.prototype.ishln=function(e){return i(0===this.negative),this.iushln(e)},s.prototype.iushrn=function(e,t,r){var n;i("number"==typeof e&&e>=0),n=t?(t-t%26)/26:0;var s=e%26,o=Math.min((e-s)/26,this.length),a=67108863^67108863>>>s<<s,d=r;if(n-=o,n=Math.max(0,n),d){for(var u=0;u<o;u++)d.words[u]=this.words[u];d.length=o}if(0===o);else if(this.length>o)for(this.length-=o,u=0;u<this.length;u++)this.words[u]=this.words[u+o];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=n);u--){var c=0|this.words[u];this.words[u]=l<<26-s|c>>>s,l=c&a}return d&&0!==l&&(d.words[d.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(e,t,r){return i(0===this.negative),this.iushrn(e,t,r)},s.prototype.shln=function(e){return this.clone().ishln(e)},s.prototype.ushln=function(e){return this.clone().iushln(e)},s.prototype.shrn=function(e){return this.clone().ishrn(e)},s.prototype.ushrn=function(e){return this.clone().iushrn(e)},s.prototype.testn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<<t;return!(this.length<=r)&&!!(this.words[r]&n)},s.prototype.imaskn=function(e){i("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(i(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 n=67108863^67108863>>>t<<t;this.words[this.length-1]&=n}return this.strip()},s.prototype.maskn=function(e){return this.clone().imaskn(e)},s.prototype.iaddn=function(e){return i("number"==typeof e),i(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},s.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},s.prototype.isubn=function(e){if(i("number"==typeof e),i(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},s.prototype.addn=function(e){return this.clone().iaddn(e)},s.prototype.subn=function(e){return this.clone().isubn(e)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(e,t,r){var n,s,o=e.length+r;this._expand(o);var a=0;for(n=0;n<e.length;n++){s=(0|this.words[n+r])+a;var d=(0|e.words[n])*t;a=((s-=67108863&d)>>26)-(d/67108864|0),this.words[n+r]=67108863&s}for(;n<this.length-r;n++)a=(s=(0|this.words[n+r])+a)>>26,this.words[n+r]=67108863&s;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n<this.length;n++)a=(s=-(0|this.words[n])+a)>>26,this.words[n]=67108863&s;return this.negative=1,this.strip()},s.prototype._wordDiv=function(e,t){var r=(this.length,e.length),i=this.clone(),n=e,o=0|n.words[n.length-1];0!==(r=26-this._countBits(o))&&(n=n.ushln(r),i.iushln(r),o=0|n.words[n.length-1]);var a,d=i.length-n.length;if("mod"!==t){(a=new s(null)).length=d+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var l=i.clone()._ishlnsubmul(n,1,d);0===l.negative&&(i=l,a&&(a.words[d]=1));for(var c=d-1;c>=0;c--){var p=67108864*(0|i.words[n.length+c])+(0|i.words[n.length+c-1]);for(p=Math.min(p/o|0,67108863),i._ishlnsubmul(n,p,c);0!==i.negative;)p--,i.negative=0,i._ishlnsubmul(n,1,c),i.isZero()||(i.negative^=1);a&&(a.words[c]=p)}return a&&a.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},s.prototype.divmod=function(e,t,r){return i(!e.isZero()),this.isZero()?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(n=a.div.neg()),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:n,mod:o}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:a.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new s(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new s(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new s(this.modn(e.words[0]))}:this._wordDiv(e,t);var n,o,a},s.prototype.div=function(e){return this.divmod(e,"div",!1).div},s.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},s.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},s.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),s=r.cmp(i);return s<0||1===n&&0===s?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},s.prototype.modn=function(e){i(e<=67108863);for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;return r},s.prototype.idivn=function(e){i(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t;this.words[r]=n/e|0,t=n%e}return this.strip()},s.prototype.divn=function(e){return this.clone().idivn(e)},s.prototype.egcd=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new s(1),o=new s(0),a=new s(0),d=new s(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var l=r.clone(),c=t.clone();!t.isZero();){for(var p=0,h=1;0==(t.words[0]&h)&&p<26;++p,h<<=1);if(p>0)for(t.iushrn(p);p-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(l),o.isub(c)),n.iushrn(1),o.iushrn(1);for(var f=0,y=1;0==(r.words[0]&y)&&f<26;++f,y<<=1);if(f>0)for(r.iushrn(f);f-- >0;)(a.isOdd()||d.isOdd())&&(a.iadd(l),d.isub(c)),a.iushrn(1),d.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(a),o.isub(d)):(r.isub(t),a.isub(n),d.isub(o))}return{a,b:d,gcd:r.iushln(u)}},s.prototype._invmp=function(e){i(0===e.negative),i(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,o=new s(1),a=new s(0),d=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,l=1;0==(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(d),o.iushrn(1);for(var c=0,p=1;0==(r.words[0]&p)&&c<26;++c,p<<=1);if(c>0)for(r.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(d),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(a)):(r.isub(t),a.isub(o))}return(n=0===t.cmpn(1)?o:a).cmpn(0)<0&&n.iadd(e),n},s.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var s=t;t=r,r=s}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},s.prototype.invm=function(e){return this.egcd(e).a.umod(e)},s.prototype.isEven=function(){return 0==(1&this.words[0])},s.prototype.isOdd=function(){return 1==(1&this.words[0])},s.prototype.andln=function(e){return this.words[0]&e},s.prototype.bincn=function(e){i("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var s=n,o=r;0!==s&&o<this.length;o++){var a=0|this.words[o];s=(a+=s)>>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.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),i(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:n<e?-1:1}return 0!==this.negative?0|-t:t},s.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},s.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){i<n?t=-1:i>n&&(t=1);break}}return t},s.prototype.gtn=function(e){return 1===this.cmpn(e)},s.prototype.gt=function(e){return 1===this.cmp(e)},s.prototype.gten=function(e){return this.cmpn(e)>=0},s.prototype.gte=function(e){return this.cmp(e)>=0},s.prototype.ltn=function(e){return-1===this.cmpn(e)},s.prototype.lt=function(e){return-1===this.cmp(e)},s.prototype.lten=function(e){return this.cmpn(e)<=0},s.prototype.lte=function(e){return this.cmp(e)<=0},s.prototype.eqn=function(e){return 0===this.cmpn(e)},s.prototype.eq=function(e){return 0===this.cmp(e)},s.red=function(e){return new E(e)},s.prototype.toRed=function(e){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(e){return this.red=e,this},s.prototype.forceRed=function(e){return i(!this.red,"Already a number in reduction context"),this._forceRed(e)},s.prototype.redAdd=function(e){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},s.prototype.redIAdd=function(e){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},s.prototype.redSub=function(e){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},s.prototype.redISub=function(e){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},s.prototype.redShl=function(e){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},s.prototype.redMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},s.prototype.redIMul=function(e){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(e){return i(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 s(t,16),this.n=this.p.bitLength(),this.k=new s(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 _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function T(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=s._prime(e);this.m=t.p,this.prime=t}else i(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(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 s(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 i=t<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?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)},n(b,v),b.prototype.split=function(e,t){for(var r=4194303,i=Math.min(e.length,9),n=0;n<i;n++)t.words[n]=e.words[n];if(t.length=i,e.length<=9)return e.words[0]=0,void(e.length=1);var s=e.words[9];for(t.words[t.length++]=s&r,n=10;n<e.length;n++){var o=0|e.words[n];e.words[n-10]=(o&r)<<4|s>>>22,s=o}s>>>=22,e.words[n-10]=s,0===s&&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<e.length;r++){var i=0|e.words[r];t+=977*i,e.words[r]=67108863&t,t=64*i+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(_,v),n(w,v),n(T,v),T.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var i=19*(0|e.words[r])+t,n=67108863&i;i>>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},s._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new _;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new T}return m[e]=t,t},E.prototype._verify1=function(e){i(0===e.negative,"red works only with positives"),i(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){i(0==(e.negative|t.negative),"red works only with positives"),i(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(i(t%2==1),3===t){var r=this.m.add(new s(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);i(!n.isZero());var a=new s(1).toRed(this),d=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new s(2*l*l).toRed(this);0!==this.pow(l,u).cmp(d);)l.redIAdd(d);for(var c=this.pow(l,n),p=this.pow(e,n.addn(1).iushrn(1)),h=this.pow(e,n),f=o;0!==h.cmp(a);){for(var y=h,g=0;0!==y.cmp(a);g++)y=y.redSqr();i(g<f);var m=this.pow(c,new s(1).iushln(f-g-1));p=p.redMul(m),c=m.redSqr(),h=h.redMul(c),f=g}return p},E.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},E.prototype.pow=function(e,t){if(t.isZero())return new s(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new s(1).toRed(this),r[1]=e;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],e);var n=r[0],o=0,a=0,d=t.bitLength()%26;for(0===d&&(d=26),i=t.length-1;i>=0;i--){for(var u=t.words[i],l=d-1;l>=0;l--){var c=u>>l&1;n!==r[0]&&(n=this.sqr(n)),0!==c||0!==o?(o<<=1,o|=c,(4===++a||0===i&&0===l)&&(n=this.mul(n,r[o]),a=0,o=0)):a=0}d=26}return n},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},s.mont=function(e){return new S(e)},n(S,E),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new s(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},4940:e=>{"use strict";var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},9110:e=>{"use strict";e.exports=EvalError},9838:e=>{"use strict";e.exports=Error},1155:e=>{"use strict";e.exports=RangeError},4943:e=>{"use strict";e.exports=ReferenceError},5731:e=>{"use strict";e.exports=SyntaxError},3468:e=>{"use strict";e.exports=TypeError},2140:e=>{"use strict";e.exports=URIError},9629:e=>{"use strict";e.exports=Object},3046:e=>{"use strict";function t(e,t){if(null==e)throw new TypeError("Cannot convert first argument to object");for(var r=Object(e),i=1;i<arguments.length;i++){var n=arguments[i];if(null!=n)for(var s=Object.keys(Object(n)),o=0,a=s.length;o<a;o++){var d=s[o],u=Object.getOwnPropertyDescriptor(n,d);void 0!==u&&u.enumerable&&(r[d]=n[d])}}return r}e.exports={assign:t,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:t})}}},46:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var n=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(r,i){function n(r){e.removeListener(t,s),i(r)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",n),r([].slice.call(arguments))}y(e,t,s,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&y(e,"error",t,r)}(e,n,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function d(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function u(e,t,r,i){var n,s,o,u;if(a(r),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),s=e._events),o=s[t]),void 0===o)o=s[t]=r,++e._eventsCount;else if("function"==typeof o?o=s[t]=i?[r,o]:[o,r]:i?o.unshift(r):o.push(r),(n=d(e))>0&&o.length>n&&!o.warned){o.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=o.length,u=l,console&&console.warn&&console.warn(u)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(e,t,r){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},n=l.bind(i);return n.listener=r,i.wrapFn=n,n}function p(e,t,r){var i=e._events;if(void 0===i)return[];var n=i[t];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(n):f(n,n.length)}function h(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function f(e,t){for(var r=new Array(t),i=0;i<t;++i)r[i]=e[i];return r}function y(e,t,r,i){if("function"==typeof e.on)i.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function n(s){i.once&&e.removeEventListener(t,n),r(s)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||n(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||n(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return d(this)},s.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,s=this._events;if(void 0!==s)n=n&&void 0===s.error;else if(!n)return!1;if(n){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var d=s[e];if(void 0===d)return!1;if("function"==typeof d)i(d,this,t);else{var u=d.length,l=f(d,u);for(r=0;r<u;++r)i(l[r],this,t)}return!0},s.prototype.addListener=function(e,t){return u(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return u(this,e,t,!0)},s.prototype.once=function(e,t){return a(t),this.on(e,c(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,c(this,e,t)),this},s.prototype.removeListener=function(e,t){var r,i,n,s,o;if(a(t),void 0===(i=this._events))return this;if(void 0===(r=i[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(n=-1,s=r.length-1;s>=0;s--)if(r[s]===t||r[s].listener===t){o=r[s].listener,n=s;break}if(n<0)return this;0===n?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,n),1===r.length&&(i[e]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,r,i;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var n,s=Object.keys(r);for(i=0;i<s.length;++i)"removeListener"!==(n=s[i])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(i=t.length-1;i>=0;i--)this.removeListener(e,t[i]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h,s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},282:e=>{e.exports=o,o.default=o,o.stable=l,o.stableStringify=l;var t="[...]",r="[Circular]",i=[],n=[];function s(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function o(e,t,r,o){var a;void 0===o&&(o=s()),d(e,"",0,[],void 0,0,o);try{a=0===n.length?JSON.stringify(e,t,r):JSON.stringify(e,p(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==i.length;){var u=i.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return a}function a(e,t,r,s){var o=Object.getOwnPropertyDescriptor(s,r);void 0!==o.get?o.configurable?(Object.defineProperty(s,r,{value:e}),i.push([s,r,t,o])):n.push([t,r,e]):(s[r]=e,i.push([s,r,t]))}function d(e,i,n,s,o,u,l){var c;if(u+=1,"object"==typeof e&&null!==e){for(c=0;c<s.length;c++)if(s[c]===e)return void a(r,e,i,o);if(void 0!==l.depthLimit&&u>l.depthLimit)return void a(t,e,i,o);if(void 0!==l.edgesLimit&&n+1>l.edgesLimit)return void a(t,e,i,o);if(s.push(e),Array.isArray(e))for(c=0;c<e.length;c++)d(e[c],c,c,s,e,u,l);else{var p=Object.keys(e);for(c=0;c<p.length;c++){var h=p[c];d(e[h],h,c,s,e,u,l)}}s.pop()}}function u(e,t){return e<t?-1:e>t?1:0}function l(e,t,r,o){void 0===o&&(o=s());var a,d=c(e,"",0,[],void 0,0,o)||e;try{a=0===n.length?JSON.stringify(d,t,r):JSON.stringify(d,p(t),r)}catch(e){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;0!==i.length;){var u=i.pop();4===u.length?Object.defineProperty(u[0],u[1],u[3]):u[0][u[1]]=u[2]}}return a}function c(e,n,s,o,d,l,p){var h;if(l+=1,"object"==typeof e&&null!==e){for(h=0;h<o.length;h++)if(o[h]===e)return void a(r,e,n,d);try{if("function"==typeof e.toJSON)return}catch(e){return}if(void 0!==p.depthLimit&&l>p.depthLimit)return void a(t,e,n,d);if(void 0!==p.edgesLimit&&s+1>p.edgesLimit)return void a(t,e,n,d);if(o.push(e),Array.isArray(e))for(h=0;h<e.length;h++)c(e[h],h,h,o,e,l,p);else{var f={},y=Object.keys(e).sort(u);for(h=0;h<y.length;h++){var g=y[h];c(e[g],g,h,o,e,l,p),f[g]=e[g]}if(void 0===d)return f;i.push([d,n,e]),d[n]=f}o.pop()}}function p(e){return e=void 0!==e?e:function(e,t){return t},function(t,r){if(n.length>0)for(var i=0;i<n.length;i++){var s=n[i];if(s[1]===t&&s[0]===r){r=s[2],n.splice(i,1);break}}return e.call(this,t,r)}}},705:(e,t,r)=>{"use strict";var i=r(9617),n=Object.prototype.toString,s=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){if(!i(t))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=r),"[object Array]"===n.call(e)?function(e,t,r){for(var i=0,n=e.length;i<n;i++)s.call(e,i)&&(null==r?t(e[i],i,e):t.call(r,e[i],i,e))}(e,t,o):"string"==typeof e?function(e,t,r){for(var i=0,n=e.length;i<n;i++)null==r?t(e.charAt(i),i,e):t.call(r,e.charAt(i),i,e)}(e,t,o):function(e,t,r){for(var i in e)s.call(e,i)&&(null==r?t(e[i],i,e):t.call(r,e[i],i,e))}(e,t,o)}},8794:e=>{"use strict";var t=Object.prototype.toString,r=Math.max,i=function(e,t){for(var r=[],i=0;i<e.length;i+=1)r[i]=e[i];for(var n=0;n<t.length;n+=1)r[n+e.length]=t[n];return r};e.exports=function(e){var n=this;if("function"!=typeof n||"[object Function]"!==t.apply(n))throw new TypeError("Function.prototype.bind called on incompatible "+n);for(var s,o=function(e,t){for(var r=[],i=t||0,n=0;i<e.length;i+=1,n+=1)r[n]=e[i];return r}(arguments,1),a=r(0,n.length-o.length),d=[],u=0;u<a;u++)d[u]="$"+u;if(s=Function("binder","return function ("+function(e,t){for(var r="",i=0;i<e.length;i+=1)r+=e[i],i+1<e.length&&(r+=t);return r}(d,",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof s){var t=n.apply(this,i(o,arguments));return Object(t)===t?t:this}return n.apply(e,i(o,arguments))})),n.prototype){var l=function(){};l.prototype=n.prototype,s.prototype=new l,l.prototype=null}return s}},9138:(e,t,r)=>{"use strict";var i=r(8794);e.exports=Function.prototype.bind||i},528:(e,t,r)=>{"use strict";var i,n=SyntaxError,s=Function,o=TypeError,a=function(e){try{return s('"use strict"; return ('+e+").constructor;")()}catch(e){}},d=Object.getOwnPropertyDescriptor;if(d)try{d({},"")}catch(e){d=null}var u=function(){throw new o},l=d?function(){try{return u}catch(e){try{return d(arguments,"callee").get}catch(e){return u}}}():u,c=r(3558)(),p=r(6869)(),h=Object.getPrototypeOf||(p?function(e){return e.__proto__}:null),f={},y="undefined"!=typeof Uint8Array&&h?h(Uint8Array):i,g={"%AggregateError%":"undefined"==typeof AggregateError?i:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?i:ArrayBuffer,"%ArrayIteratorPrototype%":c&&h?h([][Symbol.iterator]()):i,"%AsyncFromSyncIteratorPrototype%":i,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":"undefined"==typeof Atomics?i:Atomics,"%BigInt%":"undefined"==typeof BigInt?i:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?i:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?i:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?i:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?i:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?i:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?i:FinalizationRegistry,"%Function%":s,"%GeneratorFunction%":f,"%Int8Array%":"undefined"==typeof Int8Array?i:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?i:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?i:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":c&&h?h(h([][Symbol.iterator]())):i,"%JSON%":"object"==typeof JSON?JSON:i,"%Map%":"undefined"==typeof Map?i:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&c&&h?h((new Map)[Symbol.iterator]()):i,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?i:Promise,"%Proxy%":"undefined"==typeof Proxy?i:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?i:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?i:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&c&&h?h((new Set)[Symbol.iterator]()):i,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?i:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":c&&h?h(""[Symbol.iterator]()):i,"%Symbol%":c?Symbol:i,"%SyntaxError%":n,"%ThrowTypeError%":l,"%TypedArray%":y,"%TypeError%":o,"%Uint8Array%":"undefined"==typeof Uint8Array?i:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?i:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?i:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?i:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?i:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?i:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?i:WeakSet};if(h)try{null.error}catch(e){var m=h(h(e));g["%Error.prototype%"]=m}var v=function e(t){var r;if("%AsyncFunction%"===t)r=a("async function () {}");else if("%GeneratorFunction%"===t)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=a("async function* () {}");else if("%AsyncGenerator%"===t){var i=e("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if("%AsyncIteratorPrototype%"===t){var n=e("%AsyncGenerator%");n&&h&&(r=h(n.prototype))}return g[t]=r,r},b={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},_=r(9138),w=r(6740),T=_.call(Function.call,Array.prototype.concat),E=_.call(Function.apply,Array.prototype.splice),S=_.call(Function.call,String.prototype.replace),A=_.call(Function.call,String.prototype.slice),R=_.call(Function.call,RegExp.prototype.exec),M=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,I=/\\(\\)?/g,O=function(e,t){var r,i=e;if(w(b,i)&&(i="%"+(r=b[i])[0]+"%"),w(g,i)){var s=g[i];if(s===f&&(s=v(i)),void 0===s&&!t)throw new o("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:i,value:s}}throw new n("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new o('"allowMissing" argument must be a boolean');if(null===R(/^%?[^%]*%?$/,e))throw new n("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=A(e,0,1),r=A(e,-1);if("%"===t&&"%"!==r)throw new n("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new n("invalid intrinsic syntax, expected opening `%`");var i=[];return S(e,M,(function(e,t,r,n){i[i.length]=r?S(n,I,"$1"):t||e})),i}(e),i=r.length>0?r[0]:"",s=O("%"+i+"%",t),a=s.name,u=s.value,l=!1,c=s.alias;c&&(i=c[0],E(r,T([0,1],c)));for(var p=1,h=!0;p<r.length;p+=1){var f=r[p],y=A(f,0,1),m=A(f,-1);if(('"'===y||"'"===y||"`"===y||'"'===m||"'"===m||"`"===m)&&y!==m)throw new n("property names with quotes must have matching quotes");if("constructor"!==f&&h||(l=!0),w(g,a="%"+(i+="."+f)+"%"))u=g[a];else if(null!=u){if(!(f in u)){if(!t)throw new o("base intrinsic for "+e+" exists, but the property is not available.");return}if(d&&p+1>=r.length){var v=d(u,f);u=(h=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:u[f]}else h=w(u,f),u=u[f];h&&!l&&(g[a]=u)}}return u}},6740:(e,t,r)=>{"use strict";var i=Function.prototype.call,n=Object.prototype.hasOwnProperty,s=r(9138);e.exports=s.call(i,n)},7345:(e,t,r)=>{"use strict";var i=r(9629);e.exports=i.getPrototypeOf||null},7859:e=>{"use strict";e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},6369:(e,t,r)=>{"use strict";var i=r(7859),n=r(7345),s=r(6423);e.exports=i?function(e){return i(e)}:n?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return n(e)}:s?function(e){return s(e)}:null},1292:e=>{"use strict";e.exports=Object.getOwnPropertyDescriptor},9336:(e,t,r)=>{"use strict";var i=r(1292);if(i)try{i([],"length")}catch(e){i=null}e.exports=i},7239:(e,t,r)=>{"use strict";var i=r(528)("%Object.defineProperty%",!0),n=function(){if(i)try{return i({},"a",{value:1}),!0}catch(e){return!1}return!1};n.hasArrayLengthDefineBug=function(){if(!n())return null;try{return 1!==i([],"length",{value:1}).length}catch(e){return!0}},e.exports=n},6869:e=>{"use strict";var t={foo:{}},r=Object;e.exports=function(){return{__proto__:t}.foo===t.foo&&!({__proto__:null}instanceof r)}},3558:(e,t,r)=>{"use strict";var i="undefined"!=typeof Symbol&&Symbol,n=r(2908);e.exports=function(){return"function"==typeof i&&("function"==typeof Symbol&&("symbol"==typeof i("foo")&&("symbol"==typeof Symbol("bar")&&n())))}},2908:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var i=Object.getOwnPropertySymbols(e);if(1!==i.length||i[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var n=Object.getOwnPropertyDescriptor(e,t);if(42!==n.value||!0!==n.enumerable)return!1}return!0}},1913:(e,t,r)=>{"use strict";var i=r(2908);e.exports=function(){return i()&&!!Symbol.toStringTag}},9499:(e,t,r)=>{var i=t;i.utils=r(461),i.common=r(2191),i.sha=r(5746),i.ripemd=r(4169),i.hmac=r(1825),i.sha1=i.sha.sha1,i.sha256=i.sha.sha256,i.sha224=i.sha.sha224,i.sha384=i.sha.sha384,i.sha512=i.sha.sha512,i.ripemd160=i.ripemd.ripemd160},2191:(e,t,r)=>{"use strict";var i=r(461),n=r(7784);function s(){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=s,s.prototype.update=function(e,t){if(e=i.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=i.join32(e,0,e.length-r,this.endian);for(var n=0;n<e.length;n+=this._delta32)this._update(e,n,n+this._delta32)}return this},s.prototype.digest=function(e){return this.update(this._pad()),n(null===this.pending),this._digest(e)},s.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,i=new Array(r+this.padLength);i[0]=128;for(var n=1;n<r;n++)i[n]=0;if(e<<=3,"big"===this.endian){for(var s=8;s<this.padLength;s++)i[n++]=0;i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=e>>>24&255,i[n++]=e>>>16&255,i[n++]=e>>>8&255,i[n++]=255&e}else for(i[n++]=255&e,i[n++]=e>>>8&255,i[n++]=e>>>16&255,i[n++]=e>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,s=8;s<this.padLength;s++)i[n++]=0;return i}},1825:(e,t,r)=>{"use strict";var i=r(461),n=r(7784);function s(e,t,r){if(!(this instanceof s))return new s(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(i.toArray(t,r))}e.exports=s,s.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},s.prototype.update=function(e,t){return this.inner.update(e,t),this},s.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},4169:(e,t,r)=>{"use strict";var i=r(461),n=r(2191),s=i.rotl32,o=i.sum32,a=i.sum32_3,d=i.sum32_4,u=n.BlockHash;function l(){if(!(this instanceof l))return new l;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function c(e,t,r,i){return e<=15?t^r^i:e<=31?t&r|~t&i:e<=47?(t|~r)^i:e<=63?t&i|r&~i:t^(r|~i)}function p(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function h(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}i.inherits(l,u),t.ripemd160=l,l.blockSize=512,l.outSize=160,l.hmacStrength=192,l.padLength=64,l.prototype._update=function(e,t){for(var r=this.h[0],i=this.h[1],n=this.h[2],u=this.h[3],l=this.h[4],v=r,b=i,_=n,w=u,T=l,E=0;E<80;E++){var S=o(s(d(r,c(E,i,n,u),e[f[E]+t],p(E)),g[E]),l);r=l,l=u,u=s(n,10),n=i,i=S,S=o(s(d(v,c(79-E,b,_,w),e[y[E]+t],h(E)),m[E]),T),v=T,T=w,w=s(_,10),_=b,b=S}S=a(this.h[1],n,w),this.h[1]=a(this.h[2],u,T),this.h[2]=a(this.h[3],l,v),this.h[3]=a(this.h[4],r,b),this.h[4]=a(this.h[0],i,_),this.h[0]=S},l.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"little"):i.split32(this.h,"little")};var f=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],y=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],g=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],m=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},5746:(e,t,r)=>{"use strict";t.sha1=r(2986),t.sha224=r(5393),t.sha256=r(536),t.sha384=r(2348),t.sha512=r(2157)},2986:(e,t,r)=>{"use strict";var i=r(461),n=r(2191),s=r(600),o=i.rotl32,a=i.sum32,d=i.sum32_5,u=s.ft_1,l=n.BlockHash,c=[1518500249,1859775393,2400959708,3395469782];function p(){if(!(this instanceof p))return new p;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}i.inherits(p,l),e.exports=p,p.blockSize=512,p.outSize=160,p.hmacStrength=80,p.padLength=64,p.prototype._update=function(e,t){for(var r=this.W,i=0;i<16;i++)r[i]=e[t+i];for(;i<r.length;i++)r[i]=o(r[i-3]^r[i-8]^r[i-14]^r[i-16],1);var n=this.h[0],s=this.h[1],l=this.h[2],p=this.h[3],h=this.h[4];for(i=0;i<r.length;i++){var f=~~(i/20),y=d(o(n,5),u(f,s,l,p),h,r[i],c[f]);h=p,p=l,l=o(s,30),s=n,n=y}this.h[0]=a(this.h[0],n),this.h[1]=a(this.h[1],s),this.h[2]=a(this.h[2],l),this.h[3]=a(this.h[3],p),this.h[4]=a(this.h[4],h)},p.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},5393:(e,t,r)=>{"use strict";var i=r(461),n=r(536);function s(){if(!(this instanceof s))return new s;n.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}i.inherits(s,n),e.exports=s,s.blockSize=512,s.outSize=224,s.hmacStrength=192,s.padLength=64,s.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h.slice(0,7),"big"):i.split32(this.h.slice(0,7),"big")}},536:(e,t,r)=>{"use strict";var i=r(461),n=r(2191),s=r(600),o=r(7784),a=i.sum32,d=i.sum32_4,u=i.sum32_5,l=s.ch32,c=s.maj32,p=s.s0_256,h=s.s1_256,f=s.g0_256,y=s.g1_256,g=n.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;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}i.inherits(v,g),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,i=0;i<16;i++)r[i]=e[t+i];for(;i<r.length;i++)r[i]=d(y(r[i-2]),r[i-7],f(r[i-15]),r[i-16]);var n=this.h[0],s=this.h[1],g=this.h[2],m=this.h[3],v=this.h[4],b=this.h[5],_=this.h[6],w=this.h[7];for(o(this.k.length===r.length),i=0;i<r.length;i++){var T=u(w,h(v),l(v,b,_),this.k[i],r[i]),E=a(p(n),c(n,s,g));w=_,_=b,b=v,v=a(m,T),m=g,g=s,s=n,n=a(T,E)}this.h[0]=a(this.h[0],n),this.h[1]=a(this.h[1],s),this.h[2]=a(this.h[2],g),this.h[3]=a(this.h[3],m),this.h[4]=a(this.h[4],v),this.h[5]=a(this.h[5],b),this.h[6]=a(this.h[6],_),this.h[7]=a(this.h[7],w)},v.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},2348:(e,t,r)=>{"use strict";var i=r(461),n=r(2157);function s(){if(!(this instanceof s))return new s;n.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}i.inherits(s,n),e.exports=s,s.blockSize=1024,s.outSize=384,s.hmacStrength=192,s.padLength=128,s.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h.slice(0,12),"big"):i.split32(this.h.slice(0,12),"big")}},2157:(e,t,r)=>{"use strict";var i=r(461),n=r(2191),s=r(7784),o=i.rotr64_hi,a=i.rotr64_lo,d=i.shr64_hi,u=i.shr64_lo,l=i.sum64,c=i.sum64_hi,p=i.sum64_lo,h=i.sum64_4_hi,f=i.sum64_4_lo,y=i.sum64_5_hi,g=i.sum64_5_lo,m=n.BlockHash,v=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function b(){if(!(this instanceof b))return new b;m.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=v,this.W=new Array(160)}function _(e,t,r,i,n){var s=e&r^~e&n;return s<0&&(s+=4294967296),s}function w(e,t,r,i,n,s){var o=t&i^~t&s;return o<0&&(o+=4294967296),o}function T(e,t,r,i,n){var s=e&r^e&n^r&n;return s<0&&(s+=4294967296),s}function E(e,t,r,i,n,s){var o=t&i^t&s^i&s;return o<0&&(o+=4294967296),o}function S(e,t){var r=o(e,t,28)^o(t,e,2)^o(t,e,7);return r<0&&(r+=4294967296),r}function A(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function R(e,t){var r=o(e,t,14)^o(e,t,18)^o(t,e,9);return r<0&&(r+=4294967296),r}function M(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=4294967296),r}function I(e,t){var r=o(e,t,1)^o(e,t,8)^d(e,t,7);return r<0&&(r+=4294967296),r}function O(e,t){var r=a(e,t,1)^a(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}function x(e,t){var r=o(e,t,19)^o(t,e,29)^d(e,t,6);return r<0&&(r+=4294967296),r}function k(e,t){var r=a(e,t,19)^a(t,e,29)^u(e,t,6);return r<0&&(r+=4294967296),r}i.inherits(b,m),e.exports=b,b.blockSize=1024,b.outSize=512,b.hmacStrength=192,b.padLength=128,b.prototype._prepareBlock=function(e,t){for(var r=this.W,i=0;i<32;i++)r[i]=e[t+i];for(;i<r.length;i+=2){var n=x(r[i-4],r[i-3]),s=k(r[i-4],r[i-3]),o=r[i-14],a=r[i-13],d=I(r[i-30],r[i-29]),u=O(r[i-30],r[i-29]),l=r[i-32],c=r[i-31];r[i]=h(n,s,o,a,d,u,l,c),r[i+1]=f(n,s,o,a,d,u,l,c)}},b.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,i=this.h[0],n=this.h[1],o=this.h[2],a=this.h[3],d=this.h[4],u=this.h[5],h=this.h[6],f=this.h[7],m=this.h[8],v=this.h[9],b=this.h[10],I=this.h[11],O=this.h[12],x=this.h[13],k=this.h[14],C=this.h[15];s(this.k.length===r.length);for(var P=0;P<r.length;P+=2){var D=k,N=C,B=R(m,v),q=M(m,v),L=_(m,v,b,I,O),j=w(m,v,b,I,O,x),F=this.k[P],U=this.k[P+1],z=r[P],H=r[P+1],G=y(D,N,B,q,L,j,F,U,z,H),K=g(D,N,B,q,L,j,F,U,z,H);D=S(i,n),N=A(i,n),B=T(i,n,o,a,d),q=E(i,n,o,a,d,u);var W=c(D,N,B,q),V=p(D,N,B,q);k=O,C=x,O=b,x=I,b=m,I=v,m=c(h,f,G,K),v=p(f,f,G,K),h=d,f=u,d=o,u=a,o=i,a=n,i=c(G,K,W,V),n=p(G,K,W,V)}l(this.h,0,i,n),l(this.h,2,o,a),l(this.h,4,d,u),l(this.h,6,h,f),l(this.h,8,m,v),l(this.h,10,b,I),l(this.h,12,O,x),l(this.h,14,k,C)},b.prototype._digest=function(e){return"hex"===e?i.toHex32(this.h,"big"):i.split32(this.h,"big")}},600:(e,t,r)=>{"use strict";var i=r(461).rotr32;function n(e,t,r){return e&t^~e&r}function s(e,t,r){return e&t^e&r^t&r}function o(e,t,r){return e^t^r}t.ft_1=function(e,t,r,i){return 0===e?n(t,r,i):1===e||3===e?o(t,r,i):2===e?s(t,r,i):void 0},t.ch32=n,t.maj32=s,t.p32=o,t.s0_256=function(e){return i(e,2)^i(e,13)^i(e,22)},t.s1_256=function(e){return i(e,6)^i(e,11)^i(e,25)},t.g0_256=function(e){return i(e,7)^i(e,18)^e>>>3},t.g1_256=function(e){return i(e,17)^i(e,19)^e>>>10}},461:(e,t,r)=>{"use strict";var i=r(7784),n=r(5615);function s(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=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 a(e){return 1===e.length?"0"+e:e}function d(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=n,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),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(var i=0,n=0;n<e.length;n++){var o=e.charCodeAt(n);o<128?r[i++]=o:o<2048?(r[i++]=o>>6|192,r[i++]=63&o|128):s(e,n)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++n)),r[i++]=o>>18|240,r[i++]=o>>12&63|128,r[i++]=o>>6&63|128,r[i++]=63&o|128):(r[i++]=o>>12|224,r[i++]=o>>6&63|128,r[i++]=63&o|128)}else for(n=0;n<e.length;n++)r[n]=0|e[n];return r},t.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=a(e[r].toString(16));return t},t.htonl=o,t.toHex32=function(e,t){for(var r="",i=0;i<e.length;i++){var n=e[i];"little"===t&&(n=o(n)),r+=d(n.toString(16))}return r},t.zero2=a,t.zero8=d,t.join32=function(e,t,r,n){var s=r-t;i(s%4==0);for(var o=new Array(s/4),a=0,d=t;a<o.length;a++,d+=4){var u;u="big"===n?e[d]<<24|e[d+1]<<16|e[d+2]<<8|e[d+3]:e[d+3]<<24|e[d+2]<<16|e[d+1]<<8|e[d],o[a]=u>>>0}return o},t.split32=function(e,t){for(var r=new Array(4*e.length),i=0,n=0;i<e.length;i++,n+=4){var s=e[i];"big"===t?(r[n]=s>>>24,r[n+1]=s>>>16&255,r[n+2]=s>>>8&255,r[n+3]=255&s):(r[n+3]=s>>>24,r[n+2]=s>>>16&255,r[n+1]=s>>>8&255,r[n]=255&s)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},t.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},t.sum64=function(e,t,r,i){var n=e[t],s=i+e[t+1]>>>0,o=(s<i?1:0)+r+n;e[t]=o>>>0,e[t+1]=s},t.sum64_hi=function(e,t,r,i){return(t+i>>>0<t?1:0)+e+r>>>0},t.sum64_lo=function(e,t,r,i){return t+i>>>0},t.sum64_4_hi=function(e,t,r,i,n,s,o,a){var d=0,u=t;return d+=(u=u+i>>>0)<t?1:0,d+=(u=u+s>>>0)<s?1:0,e+r+n+o+(d+=(u=u+a>>>0)<a?1:0)>>>0},t.sum64_4_lo=function(e,t,r,i,n,s,o,a){return t+i+s+a>>>0},t.sum64_5_hi=function(e,t,r,i,n,s,o,a,d,u){var l=0,c=t;return l+=(c=c+i>>>0)<t?1:0,l+=(c=c+s>>>0)<s?1:0,l+=(c=c+a>>>0)<a?1:0,e+r+n+o+d+(l+=(c=c+u>>>0)<u?1:0)>>>0},t.sum64_5_lo=function(e,t,r,i,n,s,o,a,d,u){return t+i+s+a+u>>>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}},8554:(e,t,r)=>{"use strict";var i=Function.prototype.call,n=Object.prototype.hasOwnProperty,s=r(9138);e.exports=s.call(i,n)},4742:(e,t,r)=>{"use strict";var i=r(9499),n=r(9042),s=r(7784);function o(e){if(!(this instanceof o))return new o(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=n.toArray(e.entropy,e.entropyEnc||"hex"),r=n.toArray(e.nonce,e.nonceEnc||"hex"),i=n.toArray(e.pers,e.persEnc||"hex");s(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,i)}e.exports=o,o.prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},o.prototype._hmac=function(){return new i.hmac(this.hash,this.K)},o.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},o.prototype.reseed=function(e,t,r,i){"string"!=typeof t&&(i=r,r=t,t=null),e=n.toArray(e,t),r=n.toArray(r,i),s(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},o.prototype.generate=function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=n.toArray(r,i||"hex"),this._update(r));for(var s=[];s.length<e;)this.V=this._hmac().update(this.V).digest(),s=s.concat(this.V);var o=s.slice(0,e);return this._update(r),this._reseed++,n.encode(o,t)}},9318:(e,t)=>{t.read=function(e,t,r,i,n){var s,o,a=8*n-i-1,d=(1<<a)-1,u=d>>1,l=-7,c=r?n-1:0,p=r?-1:1,h=e[t+c];for(c+=p,s=h&(1<<-l)-1,h>>=-l,l+=a;l>0;s=256*s+e[t+c],c+=p,l-=8);for(o=s&(1<<-l)-1,s>>=-l,l+=i;l>0;o=256*o+e[t+c],c+=p,l-=8);if(0===s)s=1-u;else{if(s===d)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,i),s-=u}return(h?-1:1)*o*Math.pow(2,s-i)},t.write=function(e,t,r,i,n,s){var o,a,d,u=8*s-n-1,l=(1<<u)-1,c=l>>1,p=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,h=i?0:s-1,f=i?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(d=Math.pow(2,-o))<1&&(o--,d*=2),(t+=o+c>=1?p/d:p*Math.pow(2,1-c))*d>=2&&(o++,d/=2),o+c>=l?(a=0,o=l):o+c>=1?(a=(t*d-1)*Math.pow(2,n),o+=c):(a=t*Math.pow(2,c-1)*Math.pow(2,n),o=0));n>=8;e[r+h]=255&a,h+=f,a/=256,n-=8);for(o=o<<n|a,u+=n;u>0;e[r+h]=255&o,h+=f,o/=256,u-=8);e[r+h-f]|=128*y}},2607:(e,t,r)=>{"use strict";var i,n,s=r.g.MutationObserver||r.g.WebKitMutationObserver;if(s){var o=0,a=new s(c),d=r.g.document.createTextNode("");a.observe(d,{characterData:!0}),i=function(){d.data=o=++o%2}}else if(r.g.setImmediate||void 0===r.g.MessageChannel)i="document"in r.g&&"onreadystatechange"in r.g.document.createElement("script")?function(){var e=r.g.document.createElement("script");e.onreadystatechange=function(){c(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},r.g.document.documentElement.appendChild(e)}:function(){setTimeout(c,0)};else{var u=new r.g.MessageChannel;u.port1.onmessage=c,i=function(){u.port2.postMessage(0)}}var l=[];function c(){var e,t;n=!0;for(var r=l.length;r;){for(t=l,l=[],e=-1;++e<r;)t[e]();r=l.length}n=!1}e.exports=function(e){1!==l.push(e)||n||i()}},5615:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},5387:(e,t,r)=>{"use strict";var i=r(1913)(),n=r(9818)("Object.prototype.toString"),s=function(e){return!(i&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===n(e)},o=function(e){return!!s(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==n(e)&&"[object Function]"===n(e.callee)},a=function(){return s(arguments)}();s.isLegacyArguments=o,e.exports=a?s:o},9617:e=>{"use strict";var t,r,i=Function.prototype.toString,n="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof n&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},n((function(){throw 42}),null,t)}catch(e){e!==r&&(n=null)}else n=null;var s=/^\s*class\b/,o=function(e){try{var t=i.call(e);return s.test(t)}catch(e){return!1}},a=function(e){try{return!o(e)&&(i.call(e),!0)}catch(e){return!1}},d=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),c=function(){return!1};if("object"==typeof document){var p=document.all;d.call(p)===d.call(document.all)&&(c=function(e){if((l||!e)&&(void 0===e||"object"==typeof e))try{var t=d.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=n?function(e){if(c(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{n(e,null,t)}catch(e){if(e!==r)return!1}return!o(e)&&a(e)}:function(e){if(c(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(u)return a(e);if(o(e))return!1;var t=d.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&a(e)}},2625:(e,t,r)=>{"use strict";var i,n=Object.prototype.toString,s=Function.prototype.toString,o=/^\s*(?:function)?\*/,a=r(1913)(),d=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(o.test(s.call(e)))return!0;if(!a)return"[object GeneratorFunction]"===n.call(e);if(!d)return!1;if(void 0===i){var t=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(e){}}();i=!!t&&d(t)}return d(e)===i}},8006:e=>{"use strict";e.exports=function(e){return e!=e}},7838:(e,t,r)=>{"use strict";var i=r(8498),n=r(1857),s=r(8006),o=r(1591),a=r(1641),d=i(o(),Number);n(d,{getPolyfill:o,implementation:s,shim:a}),e.exports=d},1591:(e,t,r)=>{"use strict";var i=r(8006);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:i}},1641:(e,t,r)=>{"use strict";var i=r(1857),n=r(1591);e.exports=function(){var e=n();return i(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},5943:(e,t,r)=>{"use strict";var i=r(2730);e.exports=function(e){return!!i(e)}},9196:e=>{var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},7789:(e,t,r)=>{"use strict";var i=r(3681),n=r(831),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";t.encode=function(e){for(var t,r,n,o,a,d,u,l=[],c=0,p=e.length,h=p,f="string"!==i.getTypeOf(e);c<e.length;)h=p-c,f?(t=e[c++],r=c<p?e[c++]:0,n=c<p?e[c++]:0):(t=e.charCodeAt(c++),r=c<p?e.charCodeAt(c++):0,n=c<p?e.charCodeAt(c++):0),o=t>>2,a=(3&t)<<4|r>>4,d=h>1?(15&r)<<2|n>>6:64,u=h>2?63&n:64,l.push(s.charAt(o)+s.charAt(a)+s.charAt(d)+s.charAt(u));return l.join("")},t.decode=function(e){var t,r,i,o,a,d,u=0,l=0,c="data:";if(e.substr(0,5)===c)throw new Error("Invalid base64 input, it looks like a data url.");var p,h=3*(e=e.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(e.charAt(e.length-1)===s.charAt(64)&&h--,e.charAt(e.length-2)===s.charAt(64)&&h--,h%1!=0)throw new Error("Invalid base64 input, bad content length.");for(p=n.uint8array?new Uint8Array(0|h):new Array(0|h);u<e.length;)t=s.indexOf(e.charAt(u++))<<2|(o=s.indexOf(e.charAt(u++)))>>4,r=(15&o)<<4|(a=s.indexOf(e.charAt(u++)))>>2,i=(3&a)<<6|(d=s.indexOf(e.charAt(u++))),p[l++]=t,64!==a&&(p[l++]=r),64!==d&&(p[l++]=i);return p}},9008:(e,t,r)=>{"use strict";var i=r(8989),n=r(1287),s=r(730),o=r(219);function a(e,t,r,i,n){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=i,this.compressedContent=n}a.prototype={getContentWorker:function(){var e=new n(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o("data_length")),t=this;return e.on("end",(function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),e},getCompressedWorker:function(){return new n(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},a.createWorkerFrom=function(e,t,r){return e.pipe(new s).pipe(new o("uncompressedSize")).pipe(t.compressWorker(r)).pipe(new o("compressedSize")).withStreamInfo("compression",t)},e.exports=a},7845:(e,t,r)=>{"use strict";var i=r(4030);t.STORE={magic:"\0\0",compressWorker:function(){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},t.DEFLATE=r(9342)},2539:(e,t,r)=>{"use strict";var i=r(3681);var n=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,t){return void 0!==e&&e.length?"string"!==i.getTypeOf(e)?function(e,t,r,i){var s=n,o=i+r;e^=-1;for(var a=i;a<o;a++)e=e>>>8^s[255&(e^t[a])];return-1^e}(0|t,e,e.length,0):function(e,t,r,i){var s=n,o=i+r;e^=-1;for(var a=i;a<o;a++)e=e>>>8^s[255&(e^t.charCodeAt(a))];return-1^e}(0|t,e,e.length,0):0}},8796:(e,t)=>{"use strict";t.base64=!1,t.binary=!1,t.dir=!1,t.createFolders=!0,t.date=null,t.compression=null,t.compressionOptions=null,t.comment=null,t.unixPermissions=null,t.dosPermissions=null},8989:(e,t,r)=>{"use strict";var i=null;i="undefined"!=typeof Promise?Promise:r(4984),e.exports={Promise:i}},9342:(e,t,r)=>{"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,n=r(1791),s=r(3681),o=r(4030),a=i?"uint8array":"array";function d(e,t){o.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}t.magic="\b\0",s.inherits(d,o),d.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(a,e.data),!1)},d.prototype.flush=function(){o.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},d.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},d.prototype._createPako=function(){this._pako=new n[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},t.compressWorker=function(e){return new d("Deflate",e)},t.uncompressWorker=function(){return new d("Inflate",{})}},3793:(e,t,r)=>{"use strict";var i=r(3681),n=r(4030),s=r(373),o=r(2539),a=r(9366),d=function(e,t){var r,i="";for(r=0;r<t;r++)i+=String.fromCharCode(255&e),e>>>=8;return i},u=function(e,t,r,n,u,l){var c,p,h=e.file,f=e.compression,y=l!==s.utf8encode,g=i.transformTo("string",l(h.name)),m=i.transformTo("string",s.utf8encode(h.name)),v=h.comment,b=i.transformTo("string",l(v)),_=i.transformTo("string",s.utf8encode(v)),w=m.length!==h.name.length,T=_.length!==v.length,E="",S="",A="",R=h.dir,M=h.date,I={crc32:0,compressedSize:0,uncompressedSize:0};t&&!r||(I.crc32=e.crc32,I.compressedSize=e.compressedSize,I.uncompressedSize=e.uncompressedSize);var O=0;t&&(O|=8),y||!w&&!T||(O|=2048);var x,k,C,P=0,D=0;R&&(P|=16),"UNIX"===u?(D=798,P|=(x=h.unixPermissions,k=R,C=x,x||(C=k?16893:33204),(65535&C)<<16)):(D=20,P|=63&(h.dosPermissions||0)),c=M.getUTCHours(),c<<=6,c|=M.getUTCMinutes(),c<<=5,c|=M.getUTCSeconds()/2,p=M.getUTCFullYear()-1980,p<<=4,p|=M.getUTCMonth()+1,p<<=5,p|=M.getUTCDate(),w&&(S=d(1,1)+d(o(g),4)+m,E+="up"+d(S.length,2)+S),T&&(A=d(1,1)+d(o(b),4)+_,E+="uc"+d(A.length,2)+A);var N="";return N+="\n\0",N+=d(O,2),N+=f.magic,N+=d(c,2),N+=d(p,2),N+=d(I.crc32,4),N+=d(I.compressedSize,4),N+=d(I.uncompressedSize,4),N+=d(g.length,2),N+=d(E.length,2),{fileRecord:a.LOCAL_FILE_HEADER+N+g+E,dirRecord:a.CENTRAL_FILE_HEADER+d(D,2)+N+d(b.length,2)+"\0\0\0\0"+d(P,4)+d(n,4)+g+E+b}},l=function(e){return a.DATA_DESCRIPTOR+d(e.crc32,4)+d(e.compressedSize,4)+d(e.uncompressedSize,4)};function c(e,t,r,i){n.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=i,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}i.inherits(c,n),c.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,i=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,n.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-i-1))/r:100}}))},c.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=u(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},c.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,r=u(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),t)this.push({data:l(e),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},c.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var r=this.bytesWritten-e,n=function(e,t,r,n,s){var o=i.transformTo("string",s(n));return a.CENTRAL_DIRECTORY_END+"\0\0\0\0"+d(e,2)+d(e,2)+d(t,4)+d(r,4)+d(o.length,2)+o}(this.dirRecords.length,r,e,this.zipComment,this.encodeFileName);this.push({data:n,meta:{percent:100}})},c.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},c.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",(function(e){t.processChunk(e)})),e.on("end",(function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()})),e.on("error",(function(e){t.error(e)})),this},c.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},c.prototype.error=function(e){var t=this._sources;if(!n.prototype.error.call(this,e))return!1;for(var r=0;r<t.length;r++)try{t[r].error(e)}catch(e){}return!0},c.prototype.lock=function(){n.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()},e.exports=c},2854:(e,t,r)=>{"use strict";var i=r(7845),n=r(3793);t.generateWorker=function(e,t,r){var s=new n(t.streamFiles,r,t.platform,t.encodeFileName),o=0;try{e.forEach((function(e,r){o++;var n=function(e,t){var r=e||t,n=i[r];if(!n)throw new Error(r+" is not a valid compression method !");return n}(r.options.compression,t.compression),a=r.options.compressionOptions||t.compressionOptions||{},d=r.dir,u=r.date;r._compressWorker(n,a).withStreamInfo("file",{name:e,dir:d,date:u,comment:r.comment||"",unixPermissions:r.unixPermissions,dosPermissions:r.dosPermissions}).pipe(s)})),s.entriesCount=o}catch(e){s.error(e)}return s}},1592:(e,t,r)=>{"use strict";function i(){if(!(this instanceof i))return new i;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var e=new i;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}i.prototype=r(7965),i.prototype.loadAsync=r(8322),i.support=r(831),i.defaults=r(8796),i.version="3.10.1",i.loadAsync=function(e,t){return(new i).loadAsync(e,t)},i.external=r(8989),e.exports=i},8322:(e,t,r)=>{"use strict";var i=r(3681),n=r(8989),s=r(373),o=r(5675),a=r(730),d=r(1620);function u(e){return new n.Promise((function(t,r){var i=e.decompressed.getContentWorker().pipe(new a);i.on("error",(function(e){r(e)})).on("end",(function(){i.streamInfo.crc32!==e.decompressed.crc32?r(new Error("Corrupted zip : CRC32 mismatch")):t()})).resume()}))}e.exports=function(e,t){var r=this;return t=i.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:s.utf8decode}),d.isNode&&d.isStream(e)?n.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):i.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then((function(e){var r=new o(t);return r.load(e),r})).then((function(e){var r=[n.Promise.resolve(e)],i=e.files;if(t.checkCRC32)for(var s=0;s<i.length;s++)r.push(u(i[s]));return n.Promise.all(r)})).then((function(e){for(var n=e.shift(),s=n.files,o=0;o<s.length;o++){var a=s[o],d=a.fileNameStr,u=i.resolve(a.fileNameStr);r.file(u,a.decompressed,{binary:!0,optimizedBinaryString:!0,date:a.date,dir:a.dir,comment:a.fileCommentStr.length?a.fileCommentStr:null,unixPermissions:a.unixPermissions,dosPermissions:a.dosPermissions,createFolders:t.createFolders}),a.dir||(r.file(u).unsafeOriginalName=d)}return n.zipComment.length&&(r.comment=n.zipComment),r}))}},3084:(e,t,r)=>{"use strict";var i=r(3681),n=r(4030);function s(e,t){n.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}i.inherits(s,n),s.prototype._bindStream=function(e){var t=this;this._stream=e,e.pause(),e.on("data",(function(e){t.push({data:e,meta:{percent:0}})})).on("error",(function(e){t.isPaused?this.generatedError=e:t.error(e)})).on("end",(function(){t.isPaused?t._upstreamEnded=!0:t.end()}))},s.prototype.pause=function(){return!!n.prototype.pause.call(this)&&(this._stream.pause(),!0)},s.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},e.exports=s},1615:(e,t,r)=>{"use strict";var i=r(6150).Readable;function n(e,t,r){i.call(this,t),this._helper=e;var n=this;e.on("data",(function(e,t){n.push(e)||n._helper.pause(),r&&r(t)})).on("error",(function(e){n.emit("error",e)})).on("end",(function(){n.push(null)}))}r(3681).inherits(n,i),n.prototype._read=function(){this._helper.resume()},e.exports=n},1620:e=>{"use strict";e.exports={isNode:"undefined"!=typeof Buffer,newBufferFrom:function(e,t){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(e,t);if("number"==typeof e)throw new Error('The "data" argument must not be a number');return new Buffer(e,t)},allocBuffer:function(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t},isBuffer:function(e){return Buffer.isBuffer(e)},isStream:function(e){return e&&"function"==typeof e.on&&"function"==typeof e.pause&&"function"==typeof e.resume}}},7965:(e,t,r)=>{"use strict";var i=r(373),n=r(3681),s=r(4030),o=r(7597),a=r(8796),d=r(9008),u=r(7184),l=r(2854),c=r(1620),p=r(3084),h=function(e,t,r){var i,o=n.getTypeOf(t),l=n.extend(r||{},a);l.date=l.date||new Date,null!==l.compression&&(l.compression=l.compression.toUpperCase()),"string"==typeof l.unixPermissions&&(l.unixPermissions=parseInt(l.unixPermissions,8)),l.unixPermissions&&16384&l.unixPermissions&&(l.dir=!0),l.dosPermissions&&16&l.dosPermissions&&(l.dir=!0),l.dir&&(e=y(e)),l.createFolders&&(i=f(e))&&g.call(this,i,!0);var h="string"===o&&!1===l.binary&&!1===l.base64;r&&void 0!==r.binary||(l.binary=!h),(t instanceof d&&0===t.uncompressedSize||l.dir||!t||0===t.length)&&(l.base64=!1,l.binary=!0,t="",l.compression="STORE",o="string");var m=null;m=t instanceof d||t instanceof s?t:c.isNode&&c.isStream(t)?new p(e,t):n.prepareContent(e,t,l.binary,l.optimizedBinaryString,l.base64);var v=new u(e,m,l);this.files[e]=v},f=function(e){"/"===e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return t>0?e.substring(0,t):""},y=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},g=function(e,t){return t=void 0!==t?t:a.createFolders,e=y(e),this.files[e]||h.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function m(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var v={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,r,i;for(t in this.files)i=this.files[t],(r=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(r,i)},filter:function(e){var t=[];return this.forEach((function(r,i){e(r,i)&&t.push(i)})),t},file:function(e,t,r){if(1===arguments.length){if(m(e)){var i=e;return this.filter((function(e,t){return!t.dir&&i.test(e)}))}var n=this.files[this.root+e];return n&&!n.dir?n:null}return e=this.root+e,h.call(this,e,t,r),this},folder:function(e){if(!e)return this;if(m(e))return this.filter((function(t,r){return r.dir&&e.test(t)}));var t=this.root+e,r=g.call(this,t),i=this.clone();return i.root=r.name,i},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var r=this.filter((function(t,r){return r.name.slice(0,e.length)===e})),i=0;i<r.length;i++)delete this.files[r[i].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(e){var t,r={};try{if((r=n.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:i.utf8encode})).type=r.type.toLowerCase(),r.compression=r.compression.toUpperCase(),"binarystring"===r.type&&(r.type="string"),!r.type)throw new Error("No output type specified.");n.checkSupport(r.type),"darwin"!==r.platform&&"freebsd"!==r.platform&&"linux"!==r.platform&&"sunos"!==r.platform||(r.platform="UNIX"),"win32"===r.platform&&(r.platform="DOS");var a=r.comment||this.comment||"";t=l.generateWorker(this,r,a)}catch(e){(t=new s("error")).error(e)}return new o(t,r.type||"string",r.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return(e=e||{}).type||(e.type="nodebuffer"),this.generateInternalStream(e).toNodejsStream(t)}};e.exports=v},6150:(e,t,r)=>{"use strict";e.exports=r(1983)},8408:(e,t,r)=>{"use strict";var i=r(6283);function n(e){i.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=255&e[t]}r(3681).inherits(n,i),n.prototype.byteAt=function(e){return this.data[this.zero+e]},n.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2),n=e.charCodeAt(3),s=this.length-4;s>=0;--s)if(this.data[s]===t&&this.data[s+1]===r&&this.data[s+2]===i&&this.data[s+3]===n)return s-this.zero;return-1},n.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2),n=e.charCodeAt(3),s=this.readData(4);return t===s[0]&&r===s[1]&&i===s[2]&&n===s[3]},n.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},e.exports=n},6283:(e,t,r)=>{"use strict";var i=r(3681);function n(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}n.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(){},readInt:function(e){var t,r=0;for(this.checkOffset(e),t=this.index+e-1;t>=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return i.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},e.exports=n},7525:(e,t,r)=>{"use strict";var i=r(6473);function n(e){i.call(this,e)}r(3681).inherits(n,i),n.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},e.exports=n},4250:(e,t,r)=>{"use strict";var i=r(6283);function n(e){i.call(this,e)}r(3681).inherits(n,i),n.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},n.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},n.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},n.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},e.exports=n},6473:(e,t,r)=>{"use strict";var i=r(8408);function n(e){i.call(this,e)}r(3681).inherits(n,i),n.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},e.exports=n},5408:(e,t,r)=>{"use strict";var i=r(3681),n=r(831),s=r(8408),o=r(4250),a=r(7525),d=r(6473);e.exports=function(e){var t=i.getTypeOf(e);return i.checkSupport(t),"string"!==t||n.uint8array?"nodebuffer"===t?new a(e):n.uint8array?new d(i.transformTo("uint8array",e)):new s(i.transformTo("array",e)):new o(e)}},9366:(e,t)=>{"use strict";t.LOCAL_FILE_HEADER="PK",t.CENTRAL_FILE_HEADER="PK",t.CENTRAL_DIRECTORY_END="PK",t.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",t.ZIP64_CENTRAL_DIRECTORY_END="PK",t.DATA_DESCRIPTOR="PK\b"},8564:(e,t,r)=>{"use strict";var i=r(4030),n=r(3681);function s(e){i.call(this,"ConvertWorker to "+e),this.destType=e}n.inherits(s,i),s.prototype.processChunk=function(e){this.push({data:n.transformTo(this.destType,e.data),meta:e.meta})},e.exports=s},730:(e,t,r)=>{"use strict";var i=r(4030),n=r(2539);function s(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}r(3681).inherits(s,i),s.prototype.processChunk=function(e){this.streamInfo.crc32=n(e.data,this.streamInfo.crc32||0),this.push(e)},e.exports=s},219:(e,t,r)=>{"use strict";var i=r(3681),n=r(4030);function s(e){n.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}i.inherits(s,n),s.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}n.prototype.processChunk.call(this,e)},e.exports=s},1287:(e,t,r)=>{"use strict";var i=r(3681),n=r(4030);function s(e){n.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then((function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=i.getTypeOf(e),t.isPaused||t._tickAndRepeat()}),(function(e){t.error(e)}))}i.inherits(s,n),s.prototype.cleanUp=function(){n.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=s},4030:e=>{"use strict";function t(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}t.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var r=0;r<this._listeners[e].length;r++)this._listeners[e][r].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on("data",(function(e){t.processChunk(e)})),e.on("end",(function(){t.end()})),e.on("error",(function(e){t.error(e)})),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;this.isPaused=!1;var e=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e="Worker "+this.name;return this.previous?this.previous+" -> "+e:e}},e.exports=t},7597:(e,t,r)=>{"use strict";var i=r(3681),n=r(8564),s=r(4030),o=r(7789),a=r(831),d=r(8989),u=null;if(a.nodestream)try{u=r(1615)}catch(e){}function l(e,t){return new d.Promise((function(r,n){var s=[],a=e._internalType,d=e._outputType,u=e._mimeType;e.on("data",(function(e,r){s.push(e),t&&t(r)})).on("error",(function(e){s=[],n(e)})).on("end",(function(){try{var e=function(e,t,r){switch(e){case"blob":return i.newBlob(i.transformTo("arraybuffer",t),r);case"base64":return o.encode(t);default:return i.transformTo(e,t)}}(d,function(e,t){var r,i=0,n=null,s=0;for(r=0;r<t.length;r++)s+=t[r].length;switch(e){case"string":return t.join("");case"array":return Array.prototype.concat.apply([],t);case"uint8array":for(n=new Uint8Array(s),r=0;r<t.length;r++)n.set(t[r],i),i+=t[r].length;return n;case"nodebuffer":return Buffer.concat(t);default:throw new Error("concat : unsupported type '"+e+"'")}}(a,s),u);r(e)}catch(e){n(e)}s=[]})).resume()}))}function c(e,t,r){var o=t;switch(t){case"blob":case"arraybuffer":o="uint8array";break;case"base64":o="string"}try{this._internalType=o,this._outputType=t,this._mimeType=r,i.checkSupport(o),this._worker=e.pipe(new n(o)),e.lock()}catch(e){this._worker=new s("error"),this._worker.error(e)}}c.prototype={accumulate:function(e){return l(this,e)},on:function(e,t){var r=this;return"data"===e?this._worker.on(e,(function(e){t.call(r,e.data,e.meta)})):this._worker.on(e,(function(){i.delay(t,arguments,r)})),this},resume:function(){return i.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(i.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new u(this,{objectMode:"nodebuffer"!==this._outputType},e)}},e.exports=c},831:(e,t,r)=>{"use strict";if(t.base64=!0,t.array=!0,t.string=!0,t.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,t.nodebuffer="undefined"!=typeof Buffer,t.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)t.blob=!1;else{var i=new ArrayBuffer(0);try{t.blob=0===new Blob([i],{type:"application/zip"}).size}catch(e){try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);n.append(i),t.blob=0===n.getBlob("application/zip").size}catch(e){t.blob=!1}}}try{t.nodestream=!!r(6150).Readable}catch(e){t.nodestream=!1}},373:(e,t,r)=>{"use strict";for(var i=r(3681),n=r(831),s=r(1620),o=r(4030),a=new Array(256),d=0;d<256;d++)a[d]=d>=252?6:d>=248?5:d>=240?4:d>=224?3:d>=192?2:1;a[254]=a[254]=1;function u(){o.call(this,"utf-8 decode"),this.leftOver=null}function l(){o.call(this,"utf-8 encode")}t.utf8encode=function(e){return n.nodebuffer?s.newBufferFrom(e,"utf-8"):function(e){var t,r,i,s,o,a=e.length,d=0;for(s=0;s<a;s++)55296==(64512&(r=e.charCodeAt(s)))&&s+1<a&&56320==(64512&(i=e.charCodeAt(s+1)))&&(r=65536+(r-55296<<10)+(i-56320),s++),d+=r<128?1:r<2048?2:r<65536?3:4;for(t=n.uint8array?new Uint8Array(d):new Array(d),o=0,s=0;o<d;s++)55296==(64512&(r=e.charCodeAt(s)))&&s+1<a&&56320==(64512&(i=e.charCodeAt(s+1)))&&(r=65536+(r-55296<<10)+(i-56320),s++),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t}(e)},t.utf8decode=function(e){return n.nodebuffer?i.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,r,n,s,o=e.length,d=new Array(2*o);for(r=0,t=0;t<o;)if((n=e[t++])<128)d[r++]=n;else if((s=a[n])>4)d[r++]=65533,t+=s-1;else{for(n&=2===s?31:3===s?15:7;s>1&&t<o;)n=n<<6|63&e[t++],s--;s>1?d[r++]=65533:n<65536?d[r++]=n:(n-=65536,d[r++]=55296|n>>10&1023,d[r++]=56320|1023&n)}return d.length!==r&&(d.subarray?d=d.subarray(0,r):d.length=r),i.applyFromCharCode(d)}(e=i.transformTo(n.uint8array?"uint8array":"array",e))},i.inherits(u,o),u.prototype.processChunk=function(e){var r=i.transformTo(n.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(n.uint8array){var s=r;(r=new Uint8Array(s.length+this.leftOver.length)).set(this.leftOver,0),r.set(s,this.leftOver.length)}else r=this.leftOver.concat(r);this.leftOver=null}var o=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+a[e[r]]>t?r:t}(r),d=r;o!==r.length&&(n.uint8array?(d=r.subarray(0,o),this.leftOver=r.subarray(o,r.length)):(d=r.slice(0,o),this.leftOver=r.slice(o,r.length))),this.push({data:t.utf8decode(d),meta:e.meta})},u.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:t.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},t.Utf8DecodeWorker=u,i.inherits(l,o),l.prototype.processChunk=function(e){this.push({data:t.utf8encode(e.data),meta:e.meta})},t.Utf8EncodeWorker=l},3681:(e,t,r)=>{"use strict";var i=r(831),n=r(7789),s=r(1620),o=r(8989);function a(e){return e}function d(e,t){for(var r=0;r<e.length;++r)t[r]=255&e.charCodeAt(r);return t}r(766),t.newBlob=function(e,r){t.checkSupport("blob");try{return new Blob([e],{type:r})}catch(t){try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return i.append(e),i.getBlob(r)}catch(e){throw new Error("Bug : can't construct the Blob.")}}};var u={stringifyByChunk:function(e,t,r){var i=[],n=0,s=e.length;if(s<=r)return String.fromCharCode.apply(null,e);for(;n<s;)"array"===t||"nodebuffer"===t?i.push(String.fromCharCode.apply(null,e.slice(n,Math.min(n+r,s)))):i.push(String.fromCharCode.apply(null,e.subarray(n,Math.min(n+r,s)))),n+=r;return i.join("")},stringifyByChar:function(e){for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},applyCanBeUsed:{uint8array:function(){try{return i.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(e){return!1}}(),nodebuffer:function(){try{return i.nodebuffer&&1===String.fromCharCode.apply(null,s.allocBuffer(1)).length}catch(e){return!1}}()}};function l(e){var r=65536,i=t.getTypeOf(e),n=!0;if("uint8array"===i?n=u.applyCanBeUsed.uint8array:"nodebuffer"===i&&(n=u.applyCanBeUsed.nodebuffer),n)for(;r>1;)try{return u.stringifyByChunk(e,i,r)}catch(e){r=Math.floor(r/2)}return u.stringifyByChar(e)}function c(e,t){for(var r=0;r<e.length;r++)t[r]=e[r];return t}t.applyFromCharCode=l;var p={};p.string={string:a,array:function(e){return d(e,new Array(e.length))},arraybuffer:function(e){return p.string.uint8array(e).buffer},uint8array:function(e){return d(e,new Uint8Array(e.length))},nodebuffer:function(e){return d(e,s.allocBuffer(e.length))}},p.array={string:l,array:a,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return s.newBufferFrom(e)}},p.arraybuffer={string:function(e){return l(new Uint8Array(e))},array:function(e){return c(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:a,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return s.newBufferFrom(new Uint8Array(e))}},p.uint8array={string:l,array:function(e){return c(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:a,nodebuffer:function(e){return s.newBufferFrom(e)}},p.nodebuffer={string:l,array:function(e){return c(e,new Array(e.length))},arraybuffer:function(e){return p.nodebuffer.uint8array(e).buffer},uint8array:function(e){return c(e,new Uint8Array(e.length))},nodebuffer:a},t.transformTo=function(e,r){if(r||(r=""),!e)return r;t.checkSupport(e);var i=t.getTypeOf(r);return p[i][e](r)},t.resolve=function(e){for(var t=e.split("/"),r=[],i=0;i<t.length;i++){var n=t[i];"."===n||""===n&&0!==i&&i!==t.length-1||(".."===n?r.pop():r.push(n))}return r.join("/")},t.getTypeOf=function(e){return"string"==typeof e?"string":"[object Array]"===Object.prototype.toString.call(e)?"array":i.nodebuffer&&s.isBuffer(e)?"nodebuffer":i.uint8array&&e instanceof Uint8Array?"uint8array":i.arraybuffer&&e instanceof ArrayBuffer?"arraybuffer":void 0},t.checkSupport=function(e){if(!i[e.toLowerCase()])throw new Error(e+" is not supported by this platform")},t.MAX_VALUE_16BITS=65535,t.MAX_VALUE_32BITS=-1,t.pretty=function(e){var t,r,i="";for(r=0;r<(e||"").length;r++)i+="\\x"+((t=e.charCodeAt(r))<16?"0":"")+t.toString(16).toUpperCase();return i},t.delay=function(e,t,r){setImmediate((function(){e.apply(r||null,t||[])}))},t.inherits=function(e,t){var r=function(){};r.prototype=t.prototype,e.prototype=new r},t.extend=function(){var e,t,r={};for(e=0;e<arguments.length;e++)for(t in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],t)&&void 0===r[t]&&(r[t]=arguments[e][t]);return r},t.prepareContent=function(e,r,s,a,u){return o.Promise.resolve(r).then((function(e){return i.blob&&(e instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(e)))&&"undefined"!=typeof FileReader?new o.Promise((function(t,r){var i=new FileReader;i.onload=function(e){t(e.target.result)},i.onerror=function(e){r(e.target.error)},i.readAsArrayBuffer(e)})):e})).then((function(r){var l,c=t.getTypeOf(r);return c?("arraybuffer"===c?r=t.transformTo("uint8array",r):"string"===c&&(u?r=n.decode(r):s&&!0!==a&&(r=d(l=r,i.uint8array?new Uint8Array(l.length):new Array(l.length)))),r):o.Promise.reject(new Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))}},5675:(e,t,r)=>{"use strict";var i=r(5408),n=r(3681),s=r(9366),o=r(3287),a=r(831);function d(e){this.files=[],this.loadOptions=e}d.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+n.pretty(t)+", expected "+n.pretty(e)+")")}},isSignature:function(e,t){var r=this.reader.index;this.reader.setIndex(e);var i=this.reader.readString(4)===t;return this.reader.setIndex(r),i},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=a.uint8array?"uint8array":"array",r=n.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(r)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e,t,r,i=this.zip64EndOfCentralSize-44;0<i;)e=this.reader.readInt(2),t=this.reader.readInt(4),r=this.reader.readData(t),this.zip64ExtensibleData[e]={id:e,length:t,value:r}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(s.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(s.CENTRAL_FILE_HEADER);)(e=new o({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(s.CENTRAL_DIRECTORY_END);if(e<0)throw!this.isSignature(0,s.LOCAL_FILE_HEADER)?new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html"):new Error("Corrupted zip: can't find end of central directory");this.reader.setIndex(e);var t=e;if(this.checkSignature(s.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===n.MAX_VALUE_16BITS||this.diskWithCentralDirStart===n.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===n.MAX_VALUE_16BITS||this.centralDirRecords===n.MAX_VALUE_16BITS||this.centralDirSize===n.MAX_VALUE_32BITS||this.centralDirOffset===n.MAX_VALUE_32BITS){if(this.zip64=!0,(e=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,s.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var r=this.centralDirOffset+this.centralDirSize;this.zip64&&(r+=20,r+=12+this.zip64EndOfCentralSize);var i=t-r;if(i>0)this.isSignature(t,s.CENTRAL_FILE_HEADER)||(this.reader.zero=i);else if(i<0)throw new Error("Corrupted zip: missing "+Math.abs(i)+" bytes.")},prepareReader:function(e){this.reader=i(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},e.exports=d},3287:(e,t,r)=>{"use strict";var i=r(5408),n=r(3681),s=r(9008),o=r(2539),a=r(373),d=r(7845),u=r(831);function l(e,t){this.options=e,this.loadOptions=t}l.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(e){var t,r;if(e.skip(22),this.fileNameLength=e.readInt(2),r=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(r),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in d)if(Object.prototype.hasOwnProperty.call(d,t)&&d[t].magic===e)return d[t];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+n.pretty(this.compressionMethod)+" unknown (inner file : "+n.transformTo("string",this.fileName)+")");this.decompressed=new s(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===e&&(this.dosPermissions=63&this.externalFileAttributes),3===e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=i(this.extraFields[1].value);this.uncompressedSize===n.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===n.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===n.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===n.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,r,i,n=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4<n;)t=e.readInt(2),r=e.readInt(2),i=e.readData(r),this.extraFields[t]={id:t,length:r,value:i};e.setIndex(n)},handleUTF8:function(){var e=u.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=a.utf8decode(this.fileName),this.fileCommentStr=a.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(null!==t)this.fileNameStr=t;else{var r=n.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(r)}var i=this.findExtraFieldUnicodeComment();if(null!==i)this.fileCommentStr=i;else{var s=n.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(s)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=i(e.value);return 1!==t.readInt(1)||o(this.fileName)!==t.readInt(4)?null:a.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=i(e.value);return 1!==t.readInt(1)||o(this.fileComment)!==t.readInt(4)?null:a.utf8decode(t.readData(e.length-5))}return null}},e.exports=l},7184:(e,t,r)=>{"use strict";var i=r(7597),n=r(1287),s=r(373),o=r(9008),a=r(4030),d=function(e,t,r){this.name=e,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=t,this._dataBinary=r.binary,this.options={compression:r.compression,compressionOptions:r.compressionOptions}};d.prototype={internalStream:function(e){var t=null,r="string";try{if(!e)throw new Error("No output type specified.");var n="string"===(r=e.toLowerCase())||"text"===r;"binarystring"!==r&&"text"!==r||(r="string"),t=this._decompressWorker();var o=!this._dataBinary;o&&!n&&(t=t.pipe(new s.Utf8EncodeWorker)),!o&&n&&(t=t.pipe(new s.Utf8DecodeWorker))}catch(e){(t=new a("error")).error(e)}return new i(t,r,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof o&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var r=this._decompressWorker();return this._dataBinary||(r=r.pipe(new s.Utf8EncodeWorker)),o.createWorkerFrom(r,e,t)},_decompressWorker:function(){return this._data instanceof o?this._data.getContentWorker():this._data instanceof a?this._data:new n(this._data)}};for(var u=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],l=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},c=0;c<u.length;c++)d.prototype[u[c]]=l;e.exports=d},4984:(e,t,r)=>{"use strict";var i=r(2607);function n(){}var s={},o=["REJECTED"],a=["FULFILLED"],d=["PENDING"];function u(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=d,this.queue=[],this.outcome=void 0,e!==n&&h(this,e)}function l(e,t,r){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function c(e,t,r){i((function(){var i;try{i=t(r)}catch(t){return s.reject(e,t)}i===e?s.reject(e,new TypeError("Cannot resolve promise with itself")):s.resolve(e,i)}))}function p(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function h(e,t){var r=!1;function i(t){r||(r=!0,s.reject(e,t))}function n(t){r||(r=!0,s.resolve(e,t))}var o=f((function(){t(n,i)}));"error"===o.status&&i(o.value)}function f(e,t){var r={};try{r.value=e(t),r.status="success"}catch(e){r.status="error",r.value=e}return r}e.exports=u,u.prototype.finally=function(e){if("function"!=typeof e)return this;var t=this.constructor;return this.then((function(r){return t.resolve(e()).then((function(){return r}))}),(function(r){return t.resolve(e()).then((function(){throw r}))}))},u.prototype.catch=function(e){return this.then(null,e)},u.prototype.then=function(e,t){if("function"!=typeof e&&this.state===a||"function"!=typeof t&&this.state===o)return this;var r=new this.constructor(n);this.state!==d?c(r,this.state===a?e:t,this.outcome):this.queue.push(new l(r,e,t));return r},l.prototype.callFulfilled=function(e){s.resolve(this.promise,e)},l.prototype.otherCallFulfilled=function(e){c(this.promise,this.onFulfilled,e)},l.prototype.callRejected=function(e){s.reject(this.promise,e)},l.prototype.otherCallRejected=function(e){c(this.promise,this.onRejected,e)},s.resolve=function(e,t){var r=f(p,t);if("error"===r.status)return s.reject(e,r.value);var i=r.value;if(i)h(e,i);else{e.state=a,e.outcome=t;for(var n=-1,o=e.queue.length;++n<o;)e.queue[n].callFulfilled(t)}return e},s.reject=function(e,t){e.state=o,e.outcome=t;for(var r=-1,i=e.queue.length;++r<i;)e.queue[r].callRejected(t);return e},u.resolve=function(e){if(e instanceof this)return e;return s.resolve(new this(n),e)},u.reject=function(e){var t=new this(n);return s.reject(t,e)},u.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,i=!1;if(!r)return this.resolve([]);var o=new Array(r),a=0,d=-1,u=new this(n);for(;++d<r;)l(e[d],d);return u;function l(e,n){t.resolve(e).then((function(e){o[n]=e,++a!==r||i||(i=!0,s.resolve(u,o))}),(function(e){i||(i=!0,s.reject(u,e))}))}},u.race=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,i=!1;if(!r)return this.resolve([]);var o=-1,a=new this(n);for(;++o<r;)d=e[o],t.resolve(d).then((function(e){i||(i=!0,s.resolve(a,e))}),(function(e){i||(i=!0,s.reject(a,e))}));var d;return a}},5250:function(e,t,r){var i;e=r.nmd(e),function(){var n,s="Expected a function",o="__lodash_hash_undefined__",a="__lodash_placeholder__",d=16,u=32,l=64,c=128,p=256,h=1/0,f=9007199254740991,y=NaN,g=4294967295,m=[["ary",c],["bind",1],["bindKey",2],["curry",8],["curryRight",d],["flip",512],["partial",u],["partialRight",l],["rearg",p]],v="[object Arguments]",b="[object Array]",_="[object Boolean]",w="[object Date]",T="[object Error]",E="[object Function]",S="[object GeneratorFunction]",A="[object Map]",R="[object Number]",M="[object Object]",I="[object Promise]",O="[object RegExp]",x="[object Set]",k="[object String]",C="[object Symbol]",P="[object WeakMap]",D="[object ArrayBuffer]",N="[object DataView]",B="[object Float32Array]",q="[object Float64Array]",L="[object Int8Array]",j="[object Int16Array]",F="[object Int32Array]",U="[object Uint8Array]",z="[object Uint8ClampedArray]",H="[object Uint16Array]",G="[object Uint32Array]",K=/\b__p \+= '';/g,W=/\b(__p \+=) '' \+/g,V=/(__e\(.*?\)|\b__t\)) \+\n'';/g,$=/&(?:amp|lt|gt|quot|#39);/g,Z=/[&<>"']/g,Y=RegExp($.source),J=RegExp(Z.source),X=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,ee=/<%=([\s\S]+?)%>/g,te=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,re=/^\w*$/,ie=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ne=/[\\^$.*+?()[\]{}|]/g,se=RegExp(ne.source),oe=/^\s+/,ae=/\s/,de=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ue=/\{\n\/\* \[wrapped with (.+)\] \*/,le=/,? & /,ce=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,pe=/[()=,{}\[\]\/\s]/,he=/\\(\\)?/g,fe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ye=/\w*$/,ge=/^[-+]0x[0-9a-f]+$/i,me=/^0b[01]+$/i,ve=/^\[object .+?Constructor\]$/,be=/^0o[0-7]+$/i,_e=/^(?:0|[1-9]\d*)$/,we=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Te=/($^)/,Ee=/['\n\r\u2028\u2029\\]/g,Se="\\ud800-\\udfff",Ae="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Re="\\u2700-\\u27bf",Me="a-z\\xdf-\\xf6\\xf8-\\xff",Ie="A-Z\\xc0-\\xd6\\xd8-\\xde",Oe="\\ufe0e\\ufe0f",xe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",ke="['’]",Ce="["+Se+"]",Pe="["+xe+"]",De="["+Ae+"]",Ne="\\d+",Be="["+Re+"]",qe="["+Me+"]",Le="[^"+Se+xe+Ne+Re+Me+Ie+"]",je="\\ud83c[\\udffb-\\udfff]",Fe="[^"+Se+"]",Ue="(?:\\ud83c[\\udde6-\\uddff]){2}",ze="[\\ud800-\\udbff][\\udc00-\\udfff]",He="["+Ie+"]",Ge="\\u200d",Ke="(?:"+qe+"|"+Le+")",We="(?:"+He+"|"+Le+")",Ve="(?:['’](?:d|ll|m|re|s|t|ve))?",$e="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ze="(?:"+De+"|"+je+")"+"?",Ye="["+Oe+"]?",Je=Ye+Ze+("(?:"+Ge+"(?:"+[Fe,Ue,ze].join("|")+")"+Ye+Ze+")*"),Xe="(?:"+[Be,Ue,ze].join("|")+")"+Je,Qe="(?:"+[Fe+De+"?",De,Ue,ze,Ce].join("|")+")",et=RegExp(ke,"g"),tt=RegExp(De,"g"),rt=RegExp(je+"(?="+je+")|"+Qe+Je,"g"),it=RegExp([He+"?"+qe+"+"+Ve+"(?="+[Pe,He,"$"].join("|")+")",We+"+"+$e+"(?="+[Pe,He+Ke,"$"].join("|")+")",He+"?"+Ke+"+"+Ve,He+"+"+$e,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ne,Xe].join("|"),"g"),nt=RegExp("["+Ge+Se+Ae+Oe+"]"),st=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ot=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],at=-1,dt={};dt[B]=dt[q]=dt[L]=dt[j]=dt[F]=dt[U]=dt[z]=dt[H]=dt[G]=!0,dt[v]=dt[b]=dt[D]=dt[_]=dt[N]=dt[w]=dt[T]=dt[E]=dt[A]=dt[R]=dt[M]=dt[O]=dt[x]=dt[k]=dt[P]=!1;var ut={};ut[v]=ut[b]=ut[D]=ut[N]=ut[_]=ut[w]=ut[B]=ut[q]=ut[L]=ut[j]=ut[F]=ut[A]=ut[R]=ut[M]=ut[O]=ut[x]=ut[k]=ut[C]=ut[U]=ut[z]=ut[H]=ut[G]=!0,ut[T]=ut[E]=ut[P]=!1;var lt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ct=parseFloat,pt=parseInt,ht="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,ft="object"==typeof self&&self&&self.Object===Object&&self,yt=ht||ft||Function("return this")(),gt=t&&!t.nodeType&&t,mt=gt&&e&&!e.nodeType&&e,vt=mt&&mt.exports===gt,bt=vt&&ht.process,_t=function(){try{var e=mt&&mt.require&&mt.require("util").types;return e||bt&&bt.binding&&bt.binding("util")}catch(e){}}(),wt=_t&&_t.isArrayBuffer,Tt=_t&&_t.isDate,Et=_t&&_t.isMap,St=_t&&_t.isRegExp,At=_t&&_t.isSet,Rt=_t&&_t.isTypedArray;function Mt(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function It(e,t,r,i){for(var n=-1,s=null==e?0:e.length;++n<s;){var o=e[n];t(i,o,r(o),e)}return i}function Ot(e,t){for(var r=-1,i=null==e?0:e.length;++r<i&&!1!==t(e[r],r,e););return e}function xt(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function kt(e,t){for(var r=-1,i=null==e?0:e.length;++r<i;)if(!t(e[r],r,e))return!1;return!0}function Ct(e,t){for(var r=-1,i=null==e?0:e.length,n=0,s=[];++r<i;){var o=e[r];t(o,r,e)&&(s[n++]=o)}return s}function Pt(e,t){return!!(null==e?0:e.length)&&Ht(e,t,0)>-1}function Dt(e,t,r){for(var i=-1,n=null==e?0:e.length;++i<n;)if(r(t,e[i]))return!0;return!1}function Nt(e,t){for(var r=-1,i=null==e?0:e.length,n=Array(i);++r<i;)n[r]=t(e[r],r,e);return n}function Bt(e,t){for(var r=-1,i=t.length,n=e.length;++r<i;)e[n+r]=t[r];return e}function qt(e,t,r,i){var n=-1,s=null==e?0:e.length;for(i&&s&&(r=e[++n]);++n<s;)r=t(r,e[n],n,e);return r}function Lt(e,t,r,i){var n=null==e?0:e.length;for(i&&n&&(r=e[--n]);n--;)r=t(r,e[n],n,e);return r}function jt(e,t){for(var r=-1,i=null==e?0:e.length;++r<i;)if(t(e[r],r,e))return!0;return!1}var Ft=Vt("length");function Ut(e,t,r){var i;return r(e,(function(e,r,n){if(t(e,r,n))return i=r,!1})),i}function zt(e,t,r,i){for(var n=e.length,s=r+(i?1:-1);i?s--:++s<n;)if(t(e[s],s,e))return s;return-1}function Ht(e,t,r){return t==t?function(e,t,r){var i=r-1,n=e.length;for(;++i<n;)if(e[i]===t)return i;return-1}(e,t,r):zt(e,Kt,r)}function Gt(e,t,r,i){for(var n=r-1,s=e.length;++n<s;)if(i(e[n],t))return n;return-1}function Kt(e){return e!=e}function Wt(e,t){var r=null==e?0:e.length;return r?Yt(e,t)/r:y}function Vt(e){return function(t){return null==t?n:t[e]}}function $t(e){return function(t){return null==e?n:e[t]}}function Zt(e,t,r,i,n){return n(e,(function(e,n,s){r=i?(i=!1,e):t(r,e,n,s)})),r}function Yt(e,t){for(var r,i=-1,s=e.length;++i<s;){var o=t(e[i]);o!==n&&(r=r===n?o:r+o)}return r}function Jt(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}function Xt(e){return e?e.slice(0,yr(e)+1).replace(oe,""):e}function Qt(e){return function(t){return e(t)}}function er(e,t){return Nt(t,(function(t){return e[t]}))}function tr(e,t){return e.has(t)}function rr(e,t){for(var r=-1,i=e.length;++r<i&&Ht(t,e[r],0)>-1;);return r}function ir(e,t){for(var r=e.length;r--&&Ht(t,e[r],0)>-1;);return r}var nr=$t({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),sr=$t({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function or(e){return"\\"+lt[e]}function ar(e){return nt.test(e)}function dr(e){var t=-1,r=Array(e.size);return e.forEach((function(e,i){r[++t]=[i,e]})),r}function ur(e,t){return function(r){return e(t(r))}}function lr(e,t){for(var r=-1,i=e.length,n=0,s=[];++r<i;){var o=e[r];o!==t&&o!==a||(e[r]=a,s[n++]=r)}return s}function cr(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}function pr(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=[e,e]})),r}function hr(e){return ar(e)?function(e){var t=rt.lastIndex=0;for(;rt.test(e);)++t;return t}(e):Ft(e)}function fr(e){return ar(e)?function(e){return e.match(rt)||[]}(e):function(e){return e.split("")}(e)}function yr(e){for(var t=e.length;t--&&ae.test(e.charAt(t)););return t}var gr=$t({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var mr=function e(t){var r,i=(t=null==t?yt:mr.defaults(yt.Object(),t,mr.pick(yt,ot))).Array,ae=t.Date,Se=t.Error,Ae=t.Function,Re=t.Math,Me=t.Object,Ie=t.RegExp,Oe=t.String,xe=t.TypeError,ke=i.prototype,Ce=Ae.prototype,Pe=Me.prototype,De=t["__core-js_shared__"],Ne=Ce.toString,Be=Pe.hasOwnProperty,qe=0,Le=(r=/[^.]+$/.exec(De&&De.keys&&De.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",je=Pe.toString,Fe=Ne.call(Me),Ue=yt._,ze=Ie("^"+Ne.call(Be).replace(ne,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),He=vt?t.Buffer:n,Ge=t.Symbol,Ke=t.Uint8Array,We=He?He.allocUnsafe:n,Ve=ur(Me.getPrototypeOf,Me),$e=Me.create,Ze=Pe.propertyIsEnumerable,Ye=ke.splice,Je=Ge?Ge.isConcatSpreadable:n,Xe=Ge?Ge.iterator:n,Qe=Ge?Ge.toStringTag:n,rt=function(){try{var e=ps(Me,"defineProperty");return e({},"",{}),e}catch(e){}}(),nt=t.clearTimeout!==yt.clearTimeout&&t.clearTimeout,lt=ae&&ae.now!==yt.Date.now&&ae.now,ht=t.setTimeout!==yt.setTimeout&&t.setTimeout,ft=Re.ceil,gt=Re.floor,mt=Me.getOwnPropertySymbols,bt=He?He.isBuffer:n,_t=t.isFinite,Ft=ke.join,$t=ur(Me.keys,Me),vr=Re.max,br=Re.min,_r=ae.now,wr=t.parseInt,Tr=Re.random,Er=ke.reverse,Sr=ps(t,"DataView"),Ar=ps(t,"Map"),Rr=ps(t,"Promise"),Mr=ps(t,"Set"),Ir=ps(t,"WeakMap"),Or=ps(Me,"create"),xr=Ir&&new Ir,kr={},Cr=Ls(Sr),Pr=Ls(Ar),Dr=Ls(Rr),Nr=Ls(Mr),Br=Ls(Ir),qr=Ge?Ge.prototype:n,Lr=qr?qr.valueOf:n,jr=qr?qr.toString:n;function Fr(e){if(ra(e)&&!Ko(e)&&!(e instanceof Gr)){if(e instanceof Hr)return e;if(Be.call(e,"__wrapped__"))return js(e)}return new Hr(e)}var Ur=function(){function e(){}return function(t){if(!ta(t))return{};if($e)return $e(t);e.prototype=t;var r=new e;return e.prototype=n,r}}();function zr(){}function Hr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=n}function Gr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}function Kr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function Wr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function Vr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function $r(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new Vr;++t<r;)this.add(e[t])}function Zr(e){var t=this.__data__=new Wr(e);this.size=t.size}function Yr(e,t){var r=Ko(e),i=!r&&Go(e),n=!r&&!i&&Zo(e),s=!r&&!i&&!n&&la(e),o=r||i||n||s,a=o?Jt(e.length,Oe):[],d=a.length;for(var u in e)!t&&!Be.call(e,u)||o&&("length"==u||n&&("offset"==u||"parent"==u)||s&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||bs(u,d))||a.push(u);return a}function Jr(e){var t=e.length;return t?e[$i(0,t-1)]:n}function Xr(e,t){return Ns(xn(e),ai(t,0,e.length))}function Qr(e){return Ns(xn(e))}function ei(e,t,r){(r!==n&&!Uo(e[t],r)||r===n&&!(t in e))&&si(e,t,r)}function ti(e,t,r){var i=e[t];Be.call(e,t)&&Uo(i,r)&&(r!==n||t in e)||si(e,t,r)}function ri(e,t){for(var r=e.length;r--;)if(Uo(e[r][0],t))return r;return-1}function ii(e,t,r,i){return pi(e,(function(e,n,s){t(i,e,r(e),s)})),i}function ni(e,t){return e&&kn(t,Ca(t),e)}function si(e,t,r){"__proto__"==t&&rt?rt(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function oi(e,t){for(var r=-1,s=t.length,o=i(s),a=null==e;++r<s;)o[r]=a?n:Ma(e,t[r]);return o}function ai(e,t,r){return e==e&&(r!==n&&(e=e<=r?e:r),t!==n&&(e=e>=t?e:t)),e}function di(e,t,r,i,s,o){var a,d=1&t,u=2&t,l=4&t;if(r&&(a=s?r(e,i,s,o):r(e)),a!==n)return a;if(!ta(e))return e;var c=Ko(e);if(c){if(a=function(e){var t=e.length,r=new e.constructor(t);t&&"string"==typeof e[0]&&Be.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!d)return xn(e,a)}else{var p=ys(e),h=p==E||p==S;if(Zo(e))return Sn(e,d);if(p==M||p==v||h&&!s){if(a=u||h?{}:ms(e),!d)return u?function(e,t){return kn(e,fs(e),t)}(e,function(e,t){return e&&kn(t,Pa(t),e)}(a,e)):function(e,t){return kn(e,hs(e),t)}(e,ni(a,e))}else{if(!ut[p])return s?e:{};a=function(e,t,r){var i=e.constructor;switch(t){case D:return An(e);case _:case w:return new i(+e);case N:return function(e,t){var r=t?An(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case B:case q:case L:case j:case F:case U:case z:case H:case G:return Rn(e,r);case A:return new i;case R:case k:return new i(e);case O:return function(e){var t=new e.constructor(e.source,ye.exec(e));return t.lastIndex=e.lastIndex,t}(e);case x:return new i;case C:return n=e,Lr?Me(Lr.call(n)):{}}var n}(e,p,d)}}o||(o=new Zr);var f=o.get(e);if(f)return f;o.set(e,a),aa(e)?e.forEach((function(i){a.add(di(i,t,r,i,e,o))})):ia(e)&&e.forEach((function(i,n){a.set(n,di(i,t,r,n,e,o))}));var y=c?n:(l?u?ss:ns:u?Pa:Ca)(e);return Ot(y||e,(function(i,n){y&&(i=e[n=i]),ti(a,n,di(i,t,r,n,e,o))})),a}function ui(e,t,r){var i=r.length;if(null==e)return!i;for(e=Me(e);i--;){var s=r[i],o=t[s],a=e[s];if(a===n&&!(s in e)||!o(a))return!1}return!0}function li(e,t,r){if("function"!=typeof e)throw new xe(s);return ks((function(){e.apply(n,r)}),t)}function ci(e,t,r,i){var n=-1,s=Pt,o=!0,a=e.length,d=[],u=t.length;if(!a)return d;r&&(t=Nt(t,Qt(r))),i?(s=Dt,o=!1):t.length>=200&&(s=tr,o=!1,t=new $r(t));e:for(;++n<a;){var l=e[n],c=null==r?l:r(l);if(l=i||0!==l?l:0,o&&c==c){for(var p=u;p--;)if(t[p]===c)continue e;d.push(l)}else s(t,c,i)||d.push(l)}return d}Fr.templateSettings={escape:X,evaluate:Q,interpolate:ee,variable:"",imports:{_:Fr}},Fr.prototype=zr.prototype,Fr.prototype.constructor=Fr,Hr.prototype=Ur(zr.prototype),Hr.prototype.constructor=Hr,Gr.prototype=Ur(zr.prototype),Gr.prototype.constructor=Gr,Kr.prototype.clear=function(){this.__data__=Or?Or(null):{},this.size=0},Kr.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Kr.prototype.get=function(e){var t=this.__data__;if(Or){var r=t[e];return r===o?n:r}return Be.call(t,e)?t[e]:n},Kr.prototype.has=function(e){var t=this.__data__;return Or?t[e]!==n:Be.call(t,e)},Kr.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Or&&t===n?o:t,this},Wr.prototype.clear=function(){this.__data__=[],this.size=0},Wr.prototype.delete=function(e){var t=this.__data__,r=ri(t,e);return!(r<0)&&(r==t.length-1?t.pop():Ye.call(t,r,1),--this.size,!0)},Wr.prototype.get=function(e){var t=this.__data__,r=ri(t,e);return r<0?n:t[r][1]},Wr.prototype.has=function(e){return ri(this.__data__,e)>-1},Wr.prototype.set=function(e,t){var r=this.__data__,i=ri(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this},Vr.prototype.clear=function(){this.size=0,this.__data__={hash:new Kr,map:new(Ar||Wr),string:new Kr}},Vr.prototype.delete=function(e){var t=ls(this,e).delete(e);return this.size-=t?1:0,t},Vr.prototype.get=function(e){return ls(this,e).get(e)},Vr.prototype.has=function(e){return ls(this,e).has(e)},Vr.prototype.set=function(e,t){var r=ls(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this},$r.prototype.add=$r.prototype.push=function(e){return this.__data__.set(e,o),this},$r.prototype.has=function(e){return this.__data__.has(e)},Zr.prototype.clear=function(){this.__data__=new Wr,this.size=0},Zr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Zr.prototype.get=function(e){return this.__data__.get(e)},Zr.prototype.has=function(e){return this.__data__.has(e)},Zr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Wr){var i=r.__data__;if(!Ar||i.length<199)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new Vr(i)}return r.set(e,t),this.size=r.size,this};var pi=Dn(_i),hi=Dn(wi,!0);function fi(e,t){var r=!0;return pi(e,(function(e,i,n){return r=!!t(e,i,n)})),r}function yi(e,t,r){for(var i=-1,s=e.length;++i<s;){var o=e[i],a=t(o);if(null!=a&&(d===n?a==a&&!ua(a):r(a,d)))var d=a,u=o}return u}function gi(e,t){var r=[];return pi(e,(function(e,i,n){t(e,i,n)&&r.push(e)})),r}function mi(e,t,r,i,n){var s=-1,o=e.length;for(r||(r=vs),n||(n=[]);++s<o;){var a=e[s];t>0&&r(a)?t>1?mi(a,t-1,r,i,n):Bt(n,a):i||(n[n.length]=a)}return n}var vi=Nn(),bi=Nn(!0);function _i(e,t){return e&&vi(e,t,Ca)}function wi(e,t){return e&&bi(e,t,Ca)}function Ti(e,t){return Ct(t,(function(t){return Xo(e[t])}))}function Ei(e,t){for(var r=0,i=(t=_n(t,e)).length;null!=e&&r<i;)e=e[qs(t[r++])];return r&&r==i?e:n}function Si(e,t,r){var i=t(e);return Ko(e)?i:Bt(i,r(e))}function Ai(e){return null==e?e===n?"[object Undefined]":"[object Null]":Qe&&Qe in Me(e)?function(e){var t=Be.call(e,Qe),r=e[Qe];try{e[Qe]=n;var i=!0}catch(e){}var s=je.call(e);i&&(t?e[Qe]=r:delete e[Qe]);return s}(e):function(e){return je.call(e)}(e)}function Ri(e,t){return e>t}function Mi(e,t){return null!=e&&Be.call(e,t)}function Ii(e,t){return null!=e&&t in Me(e)}function Oi(e,t,r){for(var s=r?Dt:Pt,o=e[0].length,a=e.length,d=a,u=i(a),l=1/0,c=[];d--;){var p=e[d];d&&t&&(p=Nt(p,Qt(t))),l=br(p.length,l),u[d]=!r&&(t||o>=120&&p.length>=120)?new $r(d&&p):n}p=e[0];var h=-1,f=u[0];e:for(;++h<o&&c.length<l;){var y=p[h],g=t?t(y):y;if(y=r||0!==y?y:0,!(f?tr(f,g):s(c,g,r))){for(d=a;--d;){var m=u[d];if(!(m?tr(m,g):s(e[d],g,r)))continue e}f&&f.push(g),c.push(y)}}return c}function xi(e,t,r){var i=null==(e=Is(e,t=_n(t,e)))?e:e[qs(Ys(t))];return null==i?n:Mt(i,e,r)}function ki(e){return ra(e)&&Ai(e)==v}function Ci(e,t,r,i,s){return e===t||(null==e||null==t||!ra(e)&&!ra(t)?e!=e&&t!=t:function(e,t,r,i,s,o){var a=Ko(e),d=Ko(t),u=a?b:ys(e),l=d?b:ys(t),c=(u=u==v?M:u)==M,p=(l=l==v?M:l)==M,h=u==l;if(h&&Zo(e)){if(!Zo(t))return!1;a=!0,c=!1}if(h&&!c)return o||(o=new Zr),a||la(e)?rs(e,t,r,i,s,o):function(e,t,r,i,n,s,o){switch(r){case N:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case D:return!(e.byteLength!=t.byteLength||!s(new Ke(e),new Ke(t)));case _:case w:case R:return Uo(+e,+t);case T:return e.name==t.name&&e.message==t.message;case O:case k:return e==t+"";case A:var a=dr;case x:var d=1&i;if(a||(a=cr),e.size!=t.size&&!d)return!1;var u=o.get(e);if(u)return u==t;i|=2,o.set(e,t);var l=rs(a(e),a(t),i,n,s,o);return o.delete(e),l;case C:if(Lr)return Lr.call(e)==Lr.call(t)}return!1}(e,t,u,r,i,s,o);if(!(1&r)){var f=c&&Be.call(e,"__wrapped__"),y=p&&Be.call(t,"__wrapped__");if(f||y){var g=f?e.value():e,m=y?t.value():t;return o||(o=new Zr),s(g,m,r,i,o)}}if(!h)return!1;return o||(o=new Zr),function(e,t,r,i,s,o){var a=1&r,d=ns(e),u=d.length,l=ns(t),c=l.length;if(u!=c&&!a)return!1;var p=u;for(;p--;){var h=d[p];if(!(a?h in t:Be.call(t,h)))return!1}var f=o.get(e),y=o.get(t);if(f&&y)return f==t&&y==e;var g=!0;o.set(e,t),o.set(t,e);var m=a;for(;++p<u;){var v=e[h=d[p]],b=t[h];if(i)var _=a?i(b,v,h,t,e,o):i(v,b,h,e,t,o);if(!(_===n?v===b||s(v,b,r,i,o):_)){g=!1;break}m||(m="constructor"==h)}if(g&&!m){var w=e.constructor,T=t.constructor;w==T||!("constructor"in e)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof T&&T instanceof T||(g=!1)}return o.delete(e),o.delete(t),g}(e,t,r,i,s,o)}(e,t,r,i,Ci,s))}function Pi(e,t,r,i){var s=r.length,o=s,a=!i;if(null==e)return!o;for(e=Me(e);s--;){var d=r[s];if(a&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++s<o;){var u=(d=r[s])[0],l=e[u],c=d[1];if(a&&d[2]){if(l===n&&!(u in e))return!1}else{var p=new Zr;if(i)var h=i(l,c,u,e,t,p);if(!(h===n?Ci(c,l,3,i,p):h))return!1}}return!0}function Di(e){return!(!ta(e)||(t=e,Le&&Le in t))&&(Xo(e)?ze:ve).test(Ls(e));var t}function Ni(e){return"function"==typeof e?e:null==e?nd:"object"==typeof e?Ko(e)?Ui(e[0],e[1]):Fi(e):hd(e)}function Bi(e){if(!Ss(e))return $t(e);var t=[];for(var r in Me(e))Be.call(e,r)&&"constructor"!=r&&t.push(r);return t}function qi(e){if(!ta(e))return function(e){var t=[];if(null!=e)for(var r in Me(e))t.push(r);return t}(e);var t=Ss(e),r=[];for(var i in e)("constructor"!=i||!t&&Be.call(e,i))&&r.push(i);return r}function Li(e,t){return e<t}function ji(e,t){var r=-1,n=Vo(e)?i(e.length):[];return pi(e,(function(e,i,s){n[++r]=t(e,i,s)})),n}function Fi(e){var t=cs(e);return 1==t.length&&t[0][2]?Rs(t[0][0],t[0][1]):function(r){return r===e||Pi(r,e,t)}}function Ui(e,t){return ws(e)&&As(t)?Rs(qs(e),t):function(r){var i=Ma(r,e);return i===n&&i===t?Ia(r,e):Ci(t,i,3)}}function zi(e,t,r,i,s){e!==t&&vi(t,(function(o,a){if(s||(s=new Zr),ta(o))!function(e,t,r,i,s,o,a){var d=Os(e,r),u=Os(t,r),l=a.get(u);if(l)return void ei(e,r,l);var c=o?o(d,u,r+"",e,t,a):n,p=c===n;if(p){var h=Ko(u),f=!h&&Zo(u),y=!h&&!f&&la(u);c=u,h||f||y?Ko(d)?c=d:$o(d)?c=xn(d):f?(p=!1,c=Sn(u,!0)):y?(p=!1,c=Rn(u,!0)):c=[]:sa(u)||Go(u)?(c=d,Go(d)?c=va(d):ta(d)&&!Xo(d)||(c=ms(u))):p=!1}p&&(a.set(u,c),s(c,u,i,o,a),a.delete(u));ei(e,r,c)}(e,t,a,r,zi,i,s);else{var d=i?i(Os(e,a),o,a+"",e,t,s):n;d===n&&(d=o),ei(e,a,d)}}),Pa)}function Hi(e,t){var r=e.length;if(r)return bs(t+=t<0?r:0,r)?e[t]:n}function Gi(e,t,r){t=t.length?Nt(t,(function(e){return Ko(e)?function(t){return Ei(t,1===e.length?e[0]:e)}:e})):[nd];var i=-1;t=Nt(t,Qt(us()));var n=ji(e,(function(e,r,n){var s=Nt(t,(function(t){return t(e)}));return{criteria:s,index:++i,value:e}}));return function(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}(n,(function(e,t){return function(e,t,r){var i=-1,n=e.criteria,s=t.criteria,o=n.length,a=r.length;for(;++i<o;){var d=Mn(n[i],s[i]);if(d)return i>=a?d:d*("desc"==r[i]?-1:1)}return e.index-t.index}(e,t,r)}))}function Ki(e,t,r){for(var i=-1,n=t.length,s={};++i<n;){var o=t[i],a=Ei(e,o);r(a,o)&&Qi(s,_n(o,e),a)}return s}function Wi(e,t,r,i){var n=i?Gt:Ht,s=-1,o=t.length,a=e;for(e===t&&(t=xn(t)),r&&(a=Nt(e,Qt(r)));++s<o;)for(var d=0,u=t[s],l=r?r(u):u;(d=n(a,l,d,i))>-1;)a!==e&&Ye.call(a,d,1),Ye.call(e,d,1);return e}function Vi(e,t){for(var r=e?t.length:0,i=r-1;r--;){var n=t[r];if(r==i||n!==s){var s=n;bs(n)?Ye.call(e,n,1):pn(e,n)}}return e}function $i(e,t){return e+gt(Tr()*(t-e+1))}function Zi(e,t){var r="";if(!e||t<1||t>f)return r;do{t%2&&(r+=e),(t=gt(t/2))&&(e+=e)}while(t);return r}function Yi(e,t){return Cs(Ms(e,t,nd),e+"")}function Ji(e){return Jr(Ua(e))}function Xi(e,t){var r=Ua(e);return Ns(r,ai(t,0,r.length))}function Qi(e,t,r,i){if(!ta(e))return e;for(var s=-1,o=(t=_n(t,e)).length,a=o-1,d=e;null!=d&&++s<o;){var u=qs(t[s]),l=r;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(s!=a){var c=d[u];(l=i?i(c,u,d):n)===n&&(l=ta(c)?c:bs(t[s+1])?[]:{})}ti(d,u,l),d=d[u]}return e}var en=xr?function(e,t){return xr.set(e,t),e}:nd,tn=rt?function(e,t){return rt(e,"toString",{configurable:!0,enumerable:!1,value:td(t),writable:!0})}:nd;function rn(e){return Ns(Ua(e))}function nn(e,t,r){var n=-1,s=e.length;t<0&&(t=-t>s?0:s+t),(r=r>s?s:r)<0&&(r+=s),s=t>r?0:r-t>>>0,t>>>=0;for(var o=i(s);++n<s;)o[n]=e[n+t];return o}function sn(e,t){var r;return pi(e,(function(e,i,n){return!(r=t(e,i,n))})),!!r}function on(e,t,r){var i=0,n=null==e?i:e.length;if("number"==typeof t&&t==t&&n<=2147483647){for(;i<n;){var s=i+n>>>1,o=e[s];null!==o&&!ua(o)&&(r?o<=t:o<t)?i=s+1:n=s}return n}return an(e,t,nd,r)}function an(e,t,r,i){var s=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=r(t))!=t,d=null===t,u=ua(t),l=t===n;s<o;){var c=gt((s+o)/2),p=r(e[c]),h=p!==n,f=null===p,y=p==p,g=ua(p);if(a)var m=i||y;else m=l?y&&(i||h):d?y&&h&&(i||!f):u?y&&h&&!f&&(i||!g):!f&&!g&&(i?p<=t:p<t);m?s=c+1:o=c}return br(o,4294967294)}function dn(e,t){for(var r=-1,i=e.length,n=0,s=[];++r<i;){var o=e[r],a=t?t(o):o;if(!r||!Uo(a,d)){var d=a;s[n++]=0===o?0:o}}return s}function un(e){return"number"==typeof e?e:ua(e)?y:+e}function ln(e){if("string"==typeof e)return e;if(Ko(e))return Nt(e,ln)+"";if(ua(e))return jr?jr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function cn(e,t,r){var i=-1,n=Pt,s=e.length,o=!0,a=[],d=a;if(r)o=!1,n=Dt;else if(s>=200){var u=t?null:Yn(e);if(u)return cr(u);o=!1,n=tr,d=new $r}else d=t?[]:a;e:for(;++i<s;){var l=e[i],c=t?t(l):l;if(l=r||0!==l?l:0,o&&c==c){for(var p=d.length;p--;)if(d[p]===c)continue e;t&&d.push(c),a.push(l)}else n(d,c,r)||(d!==a&&d.push(c),a.push(l))}return a}function pn(e,t){return null==(e=Is(e,t=_n(t,e)))||delete e[qs(Ys(t))]}function hn(e,t,r,i){return Qi(e,t,r(Ei(e,t)),i)}function fn(e,t,r,i){for(var n=e.length,s=i?n:-1;(i?s--:++s<n)&&t(e[s],s,e););return r?nn(e,i?0:s,i?s+1:n):nn(e,i?s+1:0,i?n:s)}function yn(e,t){var r=e;return r instanceof Gr&&(r=r.value()),qt(t,(function(e,t){return t.func.apply(t.thisArg,Bt([e],t.args))}),r)}function gn(e,t,r){var n=e.length;if(n<2)return n?cn(e[0]):[];for(var s=-1,o=i(n);++s<n;)for(var a=e[s],d=-1;++d<n;)d!=s&&(o[s]=ci(o[s]||a,e[d],t,r));return cn(mi(o,1),t,r)}function mn(e,t,r){for(var i=-1,s=e.length,o=t.length,a={};++i<s;){var d=i<o?t[i]:n;r(a,e[i],d)}return a}function vn(e){return $o(e)?e:[]}function bn(e){return"function"==typeof e?e:nd}function _n(e,t){return Ko(e)?e:ws(e,t)?[e]:Bs(ba(e))}var wn=Yi;function Tn(e,t,r){var i=e.length;return r=r===n?i:r,!t&&r>=i?e:nn(e,t,r)}var En=nt||function(e){return yt.clearTimeout(e)};function Sn(e,t){if(t)return e.slice();var r=e.length,i=We?We(r):new e.constructor(r);return e.copy(i),i}function An(e){var t=new e.constructor(e.byteLength);return new Ke(t).set(new Ke(e)),t}function Rn(e,t){var r=t?An(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Mn(e,t){if(e!==t){var r=e!==n,i=null===e,s=e==e,o=ua(e),a=t!==n,d=null===t,u=t==t,l=ua(t);if(!d&&!l&&!o&&e>t||o&&a&&u&&!d&&!l||i&&a&&u||!r&&u||!s)return 1;if(!i&&!o&&!l&&e<t||l&&r&&s&&!i&&!o||d&&r&&s||!a&&s||!u)return-1}return 0}function In(e,t,r,n){for(var s=-1,o=e.length,a=r.length,d=-1,u=t.length,l=vr(o-a,0),c=i(u+l),p=!n;++d<u;)c[d]=t[d];for(;++s<a;)(p||s<o)&&(c[r[s]]=e[s]);for(;l--;)c[d++]=e[s++];return c}function On(e,t,r,n){for(var s=-1,o=e.length,a=-1,d=r.length,u=-1,l=t.length,c=vr(o-d,0),p=i(c+l),h=!n;++s<c;)p[s]=e[s];for(var f=s;++u<l;)p[f+u]=t[u];for(;++a<d;)(h||s<o)&&(p[f+r[a]]=e[s++]);return p}function xn(e,t){var r=-1,n=e.length;for(t||(t=i(n));++r<n;)t[r]=e[r];return t}function kn(e,t,r,i){var s=!r;r||(r={});for(var o=-1,a=t.length;++o<a;){var d=t[o],u=i?i(r[d],e[d],d,r,e):n;u===n&&(u=e[d]),s?si(r,d,u):ti(r,d,u)}return r}function Cn(e,t){return function(r,i){var n=Ko(r)?It:ii,s=t?t():{};return n(r,e,us(i,2),s)}}function Pn(e){return Yi((function(t,r){var i=-1,s=r.length,o=s>1?r[s-1]:n,a=s>2?r[2]:n;for(o=e.length>3&&"function"==typeof o?(s--,o):n,a&&_s(r[0],r[1],a)&&(o=s<3?n:o,s=1),t=Me(t);++i<s;){var d=r[i];d&&e(t,d,i,o)}return t}))}function Dn(e,t){return function(r,i){if(null==r)return r;if(!Vo(r))return e(r,i);for(var n=r.length,s=t?n:-1,o=Me(r);(t?s--:++s<n)&&!1!==i(o[s],s,o););return r}}function Nn(e){return function(t,r,i){for(var n=-1,s=Me(t),o=i(t),a=o.length;a--;){var d=o[e?a:++n];if(!1===r(s[d],d,s))break}return t}}function Bn(e){return function(t){var r=ar(t=ba(t))?fr(t):n,i=r?r[0]:t.charAt(0),s=r?Tn(r,1).join(""):t.slice(1);return i[e]()+s}}function qn(e){return function(t){return qt(Xa(Ga(t).replace(et,"")),e,"")}}function Ln(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Ur(e.prototype),i=e.apply(r,t);return ta(i)?i:r}}function jn(e){return function(t,r,i){var s=Me(t);if(!Vo(t)){var o=us(r,3);t=Ca(t),r=function(e){return o(s[e],e,s)}}var a=e(t,r,i);return a>-1?s[o?t[a]:a]:n}}function Fn(e){return is((function(t){var r=t.length,i=r,o=Hr.prototype.thru;for(e&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new xe(s);if(o&&!d&&"wrapper"==as(a))var d=new Hr([],!0)}for(i=d?i:r;++i<r;){var u=as(a=t[i]),l="wrapper"==u?os(a):n;d=l&&Ts(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?d[as(l[0])].apply(d,l[3]):1==a.length&&Ts(a)?d[u]():d.thru(a)}return function(){var e=arguments,i=e[0];if(d&&1==e.length&&Ko(i))return d.plant(i).value();for(var n=0,s=r?t[n].apply(this,e):i;++n<r;)s=t[n].call(this,s);return s}}))}function Un(e,t,r,s,o,a,d,u,l,p){var h=t&c,f=1&t,y=2&t,g=24&t,m=512&t,v=y?n:Ln(e);return function c(){for(var b=arguments.length,_=i(b),w=b;w--;)_[w]=arguments[w];if(g)var T=ds(c),E=function(e,t){for(var r=e.length,i=0;r--;)e[r]===t&&++i;return i}(_,T);if(s&&(_=In(_,s,o,g)),a&&(_=On(_,a,d,g)),b-=E,g&&b<p){var S=lr(_,T);return $n(e,t,Un,c.placeholder,r,_,S,u,l,p-b)}var A=f?r:this,R=y?A[e]:e;return b=_.length,u?_=function(e,t){var r=e.length,i=br(t.length,r),s=xn(e);for(;i--;){var o=t[i];e[i]=bs(o,r)?s[o]:n}return e}(_,u):m&&b>1&&_.reverse(),h&&l<b&&(_.length=l),this&&this!==yt&&this instanceof c&&(R=v||Ln(R)),R.apply(A,_)}}function zn(e,t){return function(r,i){return function(e,t,r,i){return _i(e,(function(e,n,s){t(i,r(e),n,s)})),i}(r,e,t(i),{})}}function Hn(e,t){return function(r,i){var s;if(r===n&&i===n)return t;if(r!==n&&(s=r),i!==n){if(s===n)return i;"string"==typeof r||"string"==typeof i?(r=ln(r),i=ln(i)):(r=un(r),i=un(i)),s=e(r,i)}return s}}function Gn(e){return is((function(t){return t=Nt(t,Qt(us())),Yi((function(r){var i=this;return e(t,(function(e){return Mt(e,i,r)}))}))}))}function Kn(e,t){var r=(t=t===n?" ":ln(t)).length;if(r<2)return r?Zi(t,e):t;var i=Zi(t,ft(e/hr(t)));return ar(t)?Tn(fr(i),0,e).join(""):i.slice(0,e)}function Wn(e){return function(t,r,s){return s&&"number"!=typeof s&&_s(t,r,s)&&(r=s=n),t=fa(t),r===n?(r=t,t=0):r=fa(r),function(e,t,r,n){for(var s=-1,o=vr(ft((t-e)/(r||1)),0),a=i(o);o--;)a[n?o:++s]=e,e+=r;return a}(t,r,s=s===n?t<r?1:-1:fa(s),e)}}function Vn(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=ma(t),r=ma(r)),e(t,r)}}function $n(e,t,r,i,s,o,a,d,c,p){var h=8&t;t|=h?u:l,4&(t&=~(h?l:u))||(t&=-4);var f=[e,t,s,h?o:n,h?a:n,h?n:o,h?n:a,d,c,p],y=r.apply(n,f);return Ts(e)&&xs(y,f),y.placeholder=i,Ps(y,e,t)}function Zn(e){var t=Re[e];return function(e,r){if(e=ma(e),(r=null==r?0:br(ya(r),292))&&_t(e)){var i=(ba(e)+"e").split("e");return+((i=(ba(t(i[0]+"e"+(+i[1]+r)))+"e").split("e"))[0]+"e"+(+i[1]-r))}return t(e)}}var Yn=Mr&&1/cr(new Mr([,-0]))[1]==h?function(e){return new Mr(e)}:ud;function Jn(e){return function(t){var r=ys(t);return r==A?dr(t):r==x?pr(t):function(e,t){return Nt(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Xn(e,t,r,o,h,f,y,g){var m=2&t;if(!m&&"function"!=typeof e)throw new xe(s);var v=o?o.length:0;if(v||(t&=-97,o=h=n),y=y===n?y:vr(ya(y),0),g=g===n?g:ya(g),v-=h?h.length:0,t&l){var b=o,_=h;o=h=n}var w=m?n:os(e),T=[e,t,r,o,h,b,_,f,y,g];if(w&&function(e,t){var r=e[1],i=t[1],n=r|i,s=n<131,o=i==c&&8==r||i==c&&r==p&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==r;if(!s&&!o)return e;1&i&&(e[2]=t[2],n|=1&r?0:4);var d=t[3];if(d){var u=e[3];e[3]=u?In(u,d,t[4]):d,e[4]=u?lr(e[3],a):t[4]}(d=t[5])&&(u=e[5],e[5]=u?On(u,d,t[6]):d,e[6]=u?lr(e[5],a):t[6]);(d=t[7])&&(e[7]=d);i&c&&(e[8]=null==e[8]?t[8]:br(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=n}(T,w),e=T[0],t=T[1],r=T[2],o=T[3],h=T[4],!(g=T[9]=T[9]===n?m?0:e.length:vr(T[9]-v,0))&&24&t&&(t&=-25),t&&1!=t)E=8==t||t==d?function(e,t,r){var s=Ln(e);return function o(){for(var a=arguments.length,d=i(a),u=a,l=ds(o);u--;)d[u]=arguments[u];var c=a<3&&d[0]!==l&&d[a-1]!==l?[]:lr(d,l);return(a-=c.length)<r?$n(e,t,Un,o.placeholder,n,d,c,n,n,r-a):Mt(this&&this!==yt&&this instanceof o?s:e,this,d)}}(e,t,g):t!=u&&33!=t||h.length?Un.apply(n,T):function(e,t,r,n){var s=1&t,o=Ln(e);return function t(){for(var a=-1,d=arguments.length,u=-1,l=n.length,c=i(l+d),p=this&&this!==yt&&this instanceof t?o:e;++u<l;)c[u]=n[u];for(;d--;)c[u++]=arguments[++a];return Mt(p,s?r:this,c)}}(e,t,r,o);else var E=function(e,t,r){var i=1&t,n=Ln(e);return function t(){return(this&&this!==yt&&this instanceof t?n:e).apply(i?r:this,arguments)}}(e,t,r);return Ps((w?en:xs)(E,T),e,t)}function Qn(e,t,r,i){return e===n||Uo(e,Pe[r])&&!Be.call(i,r)?t:e}function es(e,t,r,i,s,o){return ta(e)&&ta(t)&&(o.set(t,e),zi(e,t,n,es,o),o.delete(t)),e}function ts(e){return sa(e)?n:e}function rs(e,t,r,i,s,o){var a=1&r,d=e.length,u=t.length;if(d!=u&&!(a&&u>d))return!1;var l=o.get(e),c=o.get(t);if(l&&c)return l==t&&c==e;var p=-1,h=!0,f=2&r?new $r:n;for(o.set(e,t),o.set(t,e);++p<d;){var y=e[p],g=t[p];if(i)var m=a?i(g,y,p,t,e,o):i(y,g,p,e,t,o);if(m!==n){if(m)continue;h=!1;break}if(f){if(!jt(t,(function(e,t){if(!tr(f,t)&&(y===e||s(y,e,r,i,o)))return f.push(t)}))){h=!1;break}}else if(y!==g&&!s(y,g,r,i,o)){h=!1;break}}return o.delete(e),o.delete(t),h}function is(e){return Cs(Ms(e,n,Ks),e+"")}function ns(e){return Si(e,Ca,hs)}function ss(e){return Si(e,Pa,fs)}var os=xr?function(e){return xr.get(e)}:ud;function as(e){for(var t=e.name+"",r=kr[t],i=Be.call(kr,t)?r.length:0;i--;){var n=r[i],s=n.func;if(null==s||s==e)return n.name}return t}function ds(e){return(Be.call(Fr,"placeholder")?Fr:e).placeholder}function us(){var e=Fr.iteratee||sd;return e=e===sd?Ni:e,arguments.length?e(arguments[0],arguments[1]):e}function ls(e,t){var r,i,n=e.__data__;return("string"==(i=typeof(r=t))||"number"==i||"symbol"==i||"boolean"==i?"__proto__"!==r:null===r)?n["string"==typeof t?"string":"hash"]:n.map}function cs(e){for(var t=Ca(e),r=t.length;r--;){var i=t[r],n=e[i];t[r]=[i,n,As(n)]}return t}function ps(e,t){var r=function(e,t){return null==e?n:e[t]}(e,t);return Di(r)?r:n}var hs=mt?function(e){return null==e?[]:(e=Me(e),Ct(mt(e),(function(t){return Ze.call(e,t)})))}:gd,fs=mt?function(e){for(var t=[];e;)Bt(t,hs(e)),e=Ve(e);return t}:gd,ys=Ai;function gs(e,t,r){for(var i=-1,n=(t=_n(t,e)).length,s=!1;++i<n;){var o=qs(t[i]);if(!(s=null!=e&&r(e,o)))break;e=e[o]}return s||++i!=n?s:!!(n=null==e?0:e.length)&&ea(n)&&bs(o,n)&&(Ko(e)||Go(e))}function ms(e){return"function"!=typeof e.constructor||Ss(e)?{}:Ur(Ve(e))}function vs(e){return Ko(e)||Go(e)||!!(Je&&e&&e[Je])}function bs(e,t){var r=typeof e;return!!(t=null==t?f:t)&&("number"==r||"symbol"!=r&&_e.test(e))&&e>-1&&e%1==0&&e<t}function _s(e,t,r){if(!ta(r))return!1;var i=typeof t;return!!("number"==i?Vo(r)&&bs(t,r.length):"string"==i&&t in r)&&Uo(r[t],e)}function ws(e,t){if(Ko(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!ua(e))||(re.test(e)||!te.test(e)||null!=t&&e in Me(t))}function Ts(e){var t=as(e),r=Fr[t];if("function"!=typeof r||!(t in Gr.prototype))return!1;if(e===r)return!0;var i=os(r);return!!i&&e===i[0]}(Sr&&ys(new Sr(new ArrayBuffer(1)))!=N||Ar&&ys(new Ar)!=A||Rr&&ys(Rr.resolve())!=I||Mr&&ys(new Mr)!=x||Ir&&ys(new Ir)!=P)&&(ys=function(e){var t=Ai(e),r=t==M?e.constructor:n,i=r?Ls(r):"";if(i)switch(i){case Cr:return N;case Pr:return A;case Dr:return I;case Nr:return x;case Br:return P}return t});var Es=De?Xo:md;function Ss(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Pe)}function As(e){return e==e&&!ta(e)}function Rs(e,t){return function(r){return null!=r&&(r[e]===t&&(t!==n||e in Me(r)))}}function Ms(e,t,r){return t=vr(t===n?e.length-1:t,0),function(){for(var n=arguments,s=-1,o=vr(n.length-t,0),a=i(o);++s<o;)a[s]=n[t+s];s=-1;for(var d=i(t+1);++s<t;)d[s]=n[s];return d[t]=r(a),Mt(e,this,d)}}function Is(e,t){return t.length<2?e:Ei(e,nn(t,0,-1))}function Os(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var xs=Ds(en),ks=ht||function(e,t){return yt.setTimeout(e,t)},Cs=Ds(tn);function Ps(e,t,r){var i=t+"";return Cs(e,function(e,t){var r=t.length;if(!r)return e;var i=r-1;return t[i]=(r>1?"& ":"")+t[i],t=t.join(r>2?", ":" "),e.replace(de,"{\n/* [wrapped with "+t+"] */\n")}(i,function(e,t){return Ot(m,(function(r){var i="_."+r[0];t&r[1]&&!Pt(e,i)&&e.push(i)})),e.sort()}(function(e){var t=e.match(ue);return t?t[1].split(le):[]}(i),r)))}function Ds(e){var t=0,r=0;return function(){var i=_r(),s=16-(i-r);if(r=i,s>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(n,arguments)}}function Ns(e,t){var r=-1,i=e.length,s=i-1;for(t=t===n?i:t;++r<t;){var o=$i(r,s),a=e[o];e[o]=e[r],e[r]=a}return e.length=t,e}var Bs=function(e){var t=No(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ie,(function(e,r,i,n){t.push(i?n.replace(he,"$1"):r||e)})),t}));function qs(e){if("string"==typeof e||ua(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Ls(e){if(null!=e){try{return Ne.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function js(e){if(e instanceof Gr)return e.clone();var t=new Hr(e.__wrapped__,e.__chain__);return t.__actions__=xn(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Fs=Yi((function(e,t){return $o(e)?ci(e,mi(t,1,$o,!0)):[]})),Us=Yi((function(e,t){var r=Ys(t);return $o(r)&&(r=n),$o(e)?ci(e,mi(t,1,$o,!0),us(r,2)):[]})),zs=Yi((function(e,t){var r=Ys(t);return $o(r)&&(r=n),$o(e)?ci(e,mi(t,1,$o,!0),n,r):[]}));function Hs(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var n=null==r?0:ya(r);return n<0&&(n=vr(i+n,0)),zt(e,us(t,3),n)}function Gs(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var s=i-1;return r!==n&&(s=ya(r),s=r<0?vr(i+s,0):br(s,i-1)),zt(e,us(t,3),s,!0)}function Ks(e){return(null==e?0:e.length)?mi(e,1):[]}function Ws(e){return e&&e.length?e[0]:n}var Vs=Yi((function(e){var t=Nt(e,vn);return t.length&&t[0]===e[0]?Oi(t):[]})),$s=Yi((function(e){var t=Ys(e),r=Nt(e,vn);return t===Ys(r)?t=n:r.pop(),r.length&&r[0]===e[0]?Oi(r,us(t,2)):[]})),Zs=Yi((function(e){var t=Ys(e),r=Nt(e,vn);return(t="function"==typeof t?t:n)&&r.pop(),r.length&&r[0]===e[0]?Oi(r,n,t):[]}));function Ys(e){var t=null==e?0:e.length;return t?e[t-1]:n}var Js=Yi(Xs);function Xs(e,t){return e&&e.length&&t&&t.length?Wi(e,t):e}var Qs=is((function(e,t){var r=null==e?0:e.length,i=oi(e,t);return Vi(e,Nt(t,(function(e){return bs(e,r)?+e:e})).sort(Mn)),i}));function eo(e){return null==e?e:Er.call(e)}var to=Yi((function(e){return cn(mi(e,1,$o,!0))})),ro=Yi((function(e){var t=Ys(e);return $o(t)&&(t=n),cn(mi(e,1,$o,!0),us(t,2))})),io=Yi((function(e){var t=Ys(e);return t="function"==typeof t?t:n,cn(mi(e,1,$o,!0),n,t)}));function no(e){if(!e||!e.length)return[];var t=0;return e=Ct(e,(function(e){if($o(e))return t=vr(e.length,t),!0})),Jt(t,(function(t){return Nt(e,Vt(t))}))}function so(e,t){if(!e||!e.length)return[];var r=no(e);return null==t?r:Nt(r,(function(e){return Mt(t,n,e)}))}var oo=Yi((function(e,t){return $o(e)?ci(e,t):[]})),ao=Yi((function(e){return gn(Ct(e,$o))})),uo=Yi((function(e){var t=Ys(e);return $o(t)&&(t=n),gn(Ct(e,$o),us(t,2))})),lo=Yi((function(e){var t=Ys(e);return t="function"==typeof t?t:n,gn(Ct(e,$o),n,t)})),co=Yi(no);var po=Yi((function(e){var t=e.length,r=t>1?e[t-1]:n;return r="function"==typeof r?(e.pop(),r):n,so(e,r)}));function ho(e){var t=Fr(e);return t.__chain__=!0,t}function fo(e,t){return t(e)}var yo=is((function(e){var t=e.length,r=t?e[0]:0,i=this.__wrapped__,s=function(t){return oi(t,e)};return!(t>1||this.__actions__.length)&&i instanceof Gr&&bs(r)?((i=i.slice(r,+r+(t?1:0))).__actions__.push({func:fo,args:[s],thisArg:n}),new Hr(i,this.__chain__).thru((function(e){return t&&!e.length&&e.push(n),e}))):this.thru(s)}));var go=Cn((function(e,t,r){Be.call(e,r)?++e[r]:si(e,r,1)}));var mo=jn(Hs),vo=jn(Gs);function bo(e,t){return(Ko(e)?Ot:pi)(e,us(t,3))}function _o(e,t){return(Ko(e)?xt:hi)(e,us(t,3))}var wo=Cn((function(e,t,r){Be.call(e,r)?e[r].push(t):si(e,r,[t])}));var To=Yi((function(e,t,r){var n=-1,s="function"==typeof t,o=Vo(e)?i(e.length):[];return pi(e,(function(e){o[++n]=s?Mt(t,e,r):xi(e,t,r)})),o})),Eo=Cn((function(e,t,r){si(e,r,t)}));function So(e,t){return(Ko(e)?Nt:ji)(e,us(t,3))}var Ao=Cn((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]}));var Ro=Yi((function(e,t){if(null==e)return[];var r=t.length;return r>1&&_s(e,t[0],t[1])?t=[]:r>2&&_s(t[0],t[1],t[2])&&(t=[t[0]]),Gi(e,mi(t,1),[])})),Mo=lt||function(){return yt.Date.now()};function Io(e,t,r){return t=r?n:t,t=e&&null==t?e.length:t,Xn(e,c,n,n,n,n,t)}function Oo(e,t){var r;if("function"!=typeof t)throw new xe(s);return e=ya(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=n),r}}var xo=Yi((function(e,t,r){var i=1;if(r.length){var n=lr(r,ds(xo));i|=u}return Xn(e,i,t,r,n)})),ko=Yi((function(e,t,r){var i=3;if(r.length){var n=lr(r,ds(ko));i|=u}return Xn(t,i,e,r,n)}));function Co(e,t,r){var i,o,a,d,u,l,c=0,p=!1,h=!1,f=!0;if("function"!=typeof e)throw new xe(s);function y(t){var r=i,s=o;return i=o=n,c=t,d=e.apply(s,r)}function g(e){var r=e-l;return l===n||r>=t||r<0||h&&e-c>=a}function m(){var e=Mo();if(g(e))return v(e);u=ks(m,function(e){var r=t-(e-l);return h?br(r,a-(e-c)):r}(e))}function v(e){return u=n,f&&i?y(e):(i=o=n,d)}function b(){var e=Mo(),r=g(e);if(i=arguments,o=this,l=e,r){if(u===n)return function(e){return c=e,u=ks(m,t),p?y(e):d}(l);if(h)return En(u),u=ks(m,t),y(l)}return u===n&&(u=ks(m,t)),d}return t=ma(t)||0,ta(r)&&(p=!!r.leading,a=(h="maxWait"in r)?vr(ma(r.maxWait)||0,t):a,f="trailing"in r?!!r.trailing:f),b.cancel=function(){u!==n&&En(u),c=0,i=l=o=u=n},b.flush=function(){return u===n?d:v(Mo())},b}var Po=Yi((function(e,t){return li(e,1,t)})),Do=Yi((function(e,t,r){return li(e,ma(t)||0,r)}));function No(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new xe(s);var r=function(){var i=arguments,n=t?t.apply(this,i):i[0],s=r.cache;if(s.has(n))return s.get(n);var o=e.apply(this,i);return r.cache=s.set(n,o)||s,o};return r.cache=new(No.Cache||Vr),r}function Bo(e){if("function"!=typeof e)throw new xe(s);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}No.Cache=Vr;var qo=wn((function(e,t){var r=(t=1==t.length&&Ko(t[0])?Nt(t[0],Qt(us())):Nt(mi(t,1),Qt(us()))).length;return Yi((function(i){for(var n=-1,s=br(i.length,r);++n<s;)i[n]=t[n].call(this,i[n]);return Mt(e,this,i)}))})),Lo=Yi((function(e,t){var r=lr(t,ds(Lo));return Xn(e,u,n,t,r)})),jo=Yi((function(e,t){var r=lr(t,ds(jo));return Xn(e,l,n,t,r)})),Fo=is((function(e,t){return Xn(e,p,n,n,n,t)}));function Uo(e,t){return e===t||e!=e&&t!=t}var zo=Vn(Ri),Ho=Vn((function(e,t){return e>=t})),Go=ki(function(){return arguments}())?ki:function(e){return ra(e)&&Be.call(e,"callee")&&!Ze.call(e,"callee")},Ko=i.isArray,Wo=wt?Qt(wt):function(e){return ra(e)&&Ai(e)==D};function Vo(e){return null!=e&&ea(e.length)&&!Xo(e)}function $o(e){return ra(e)&&Vo(e)}var Zo=bt||md,Yo=Tt?Qt(Tt):function(e){return ra(e)&&Ai(e)==w};function Jo(e){if(!ra(e))return!1;var t=Ai(e);return t==T||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!sa(e)}function Xo(e){if(!ta(e))return!1;var t=Ai(e);return t==E||t==S||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Qo(e){return"number"==typeof e&&e==ya(e)}function ea(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=f}function ta(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ra(e){return null!=e&&"object"==typeof e}var ia=Et?Qt(Et):function(e){return ra(e)&&ys(e)==A};function na(e){return"number"==typeof e||ra(e)&&Ai(e)==R}function sa(e){if(!ra(e)||Ai(e)!=M)return!1;var t=Ve(e);if(null===t)return!0;var r=Be.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Ne.call(r)==Fe}var oa=St?Qt(St):function(e){return ra(e)&&Ai(e)==O};var aa=At?Qt(At):function(e){return ra(e)&&ys(e)==x};function da(e){return"string"==typeof e||!Ko(e)&&ra(e)&&Ai(e)==k}function ua(e){return"symbol"==typeof e||ra(e)&&Ai(e)==C}var la=Rt?Qt(Rt):function(e){return ra(e)&&ea(e.length)&&!!dt[Ai(e)]};var ca=Vn(Li),pa=Vn((function(e,t){return e<=t}));function ha(e){if(!e)return[];if(Vo(e))return da(e)?fr(e):xn(e);if(Xe&&e[Xe])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Xe]());var t=ys(e);return(t==A?dr:t==x?cr:Ua)(e)}function fa(e){return e?(e=ma(e))===h||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function ya(e){var t=fa(e),r=t%1;return t==t?r?t-r:t:0}function ga(e){return e?ai(ya(e),0,g):0}function ma(e){if("number"==typeof e)return e;if(ua(e))return y;if(ta(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ta(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Xt(e);var r=me.test(e);return r||be.test(e)?pt(e.slice(2),r?2:8):ge.test(e)?y:+e}function va(e){return kn(e,Pa(e))}function ba(e){return null==e?"":ln(e)}var _a=Pn((function(e,t){if(Ss(t)||Vo(t))kn(t,Ca(t),e);else for(var r in t)Be.call(t,r)&&ti(e,r,t[r])})),wa=Pn((function(e,t){kn(t,Pa(t),e)})),Ta=Pn((function(e,t,r,i){kn(t,Pa(t),e,i)})),Ea=Pn((function(e,t,r,i){kn(t,Ca(t),e,i)})),Sa=is(oi);var Aa=Yi((function(e,t){e=Me(e);var r=-1,i=t.length,s=i>2?t[2]:n;for(s&&_s(t[0],t[1],s)&&(i=1);++r<i;)for(var o=t[r],a=Pa(o),d=-1,u=a.length;++d<u;){var l=a[d],c=e[l];(c===n||Uo(c,Pe[l])&&!Be.call(e,l))&&(e[l]=o[l])}return e})),Ra=Yi((function(e){return e.push(n,es),Mt(Na,n,e)}));function Ma(e,t,r){var i=null==e?n:Ei(e,t);return i===n?r:i}function Ia(e,t){return null!=e&&gs(e,t,Ii)}var Oa=zn((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=je.call(t)),e[t]=r}),td(nd)),xa=zn((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=je.call(t)),Be.call(e,t)?e[t].push(r):e[t]=[r]}),us),ka=Yi(xi);function Ca(e){return Vo(e)?Yr(e):Bi(e)}function Pa(e){return Vo(e)?Yr(e,!0):qi(e)}var Da=Pn((function(e,t,r){zi(e,t,r)})),Na=Pn((function(e,t,r,i){zi(e,t,r,i)})),Ba=is((function(e,t){var r={};if(null==e)return r;var i=!1;t=Nt(t,(function(t){return t=_n(t,e),i||(i=t.length>1),t})),kn(e,ss(e),r),i&&(r=di(r,7,ts));for(var n=t.length;n--;)pn(r,t[n]);return r}));var qa=is((function(e,t){return null==e?{}:function(e,t){return Ki(e,t,(function(t,r){return Ia(e,r)}))}(e,t)}));function La(e,t){if(null==e)return{};var r=Nt(ss(e),(function(e){return[e]}));return t=us(t),Ki(e,r,(function(e,r){return t(e,r[0])}))}var ja=Jn(Ca),Fa=Jn(Pa);function Ua(e){return null==e?[]:er(e,Ca(e))}var za=qn((function(e,t,r){return t=t.toLowerCase(),e+(r?Ha(t):t)}));function Ha(e){return Ja(ba(e).toLowerCase())}function Ga(e){return(e=ba(e))&&e.replace(we,nr).replace(tt,"")}var Ka=qn((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),Wa=qn((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Va=Bn("toLowerCase");var $a=qn((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}));var Za=qn((function(e,t,r){return e+(r?" ":"")+Ja(t)}));var Ya=qn((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Ja=Bn("toUpperCase");function Xa(e,t,r){return e=ba(e),(t=r?n:t)===n?function(e){return st.test(e)}(e)?function(e){return e.match(it)||[]}(e):function(e){return e.match(ce)||[]}(e):e.match(t)||[]}var Qa=Yi((function(e,t){try{return Mt(e,n,t)}catch(e){return Jo(e)?e:new Se(e)}})),ed=is((function(e,t){return Ot(t,(function(t){t=qs(t),si(e,t,xo(e[t],e))})),e}));function td(e){return function(){return e}}var rd=Fn(),id=Fn(!0);function nd(e){return e}function sd(e){return Ni("function"==typeof e?e:di(e,1))}var od=Yi((function(e,t){return function(r){return xi(r,e,t)}})),ad=Yi((function(e,t){return function(r){return xi(e,r,t)}}));function dd(e,t,r){var i=Ca(t),n=Ti(t,i);null!=r||ta(t)&&(n.length||!i.length)||(r=t,t=e,e=this,n=Ti(t,Ca(t)));var s=!(ta(r)&&"chain"in r&&!r.chain),o=Xo(e);return Ot(n,(function(r){var i=t[r];e[r]=i,o&&(e.prototype[r]=function(){var t=this.__chain__;if(s||t){var r=e(this.__wrapped__);return(r.__actions__=xn(this.__actions__)).push({func:i,args:arguments,thisArg:e}),r.__chain__=t,r}return i.apply(e,Bt([this.value()],arguments))})})),e}function ud(){}var ld=Gn(Nt),cd=Gn(kt),pd=Gn(jt);function hd(e){return ws(e)?Vt(qs(e)):function(e){return function(t){return Ei(t,e)}}(e)}var fd=Wn(),yd=Wn(!0);function gd(){return[]}function md(){return!1}var vd=Hn((function(e,t){return e+t}),0),bd=Zn("ceil"),_d=Hn((function(e,t){return e/t}),1),wd=Zn("floor");var Td,Ed=Hn((function(e,t){return e*t}),1),Sd=Zn("round"),Ad=Hn((function(e,t){return e-t}),0);return Fr.after=function(e,t){if("function"!=typeof t)throw new xe(s);return e=ya(e),function(){if(--e<1)return t.apply(this,arguments)}},Fr.ary=Io,Fr.assign=_a,Fr.assignIn=wa,Fr.assignInWith=Ta,Fr.assignWith=Ea,Fr.at=Sa,Fr.before=Oo,Fr.bind=xo,Fr.bindAll=ed,Fr.bindKey=ko,Fr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Ko(e)?e:[e]},Fr.chain=ho,Fr.chunk=function(e,t,r){t=(r?_s(e,t,r):t===n)?1:vr(ya(t),0);var s=null==e?0:e.length;if(!s||t<1)return[];for(var o=0,a=0,d=i(ft(s/t));o<s;)d[a++]=nn(e,o,o+=t);return d},Fr.compact=function(e){for(var t=-1,r=null==e?0:e.length,i=0,n=[];++t<r;){var s=e[t];s&&(n[i++]=s)}return n},Fr.concat=function(){var e=arguments.length;if(!e)return[];for(var t=i(e-1),r=arguments[0],n=e;n--;)t[n-1]=arguments[n];return Bt(Ko(r)?xn(r):[r],mi(t,1))},Fr.cond=function(e){var t=null==e?0:e.length,r=us();return e=t?Nt(e,(function(e){if("function"!=typeof e[1])throw new xe(s);return[r(e[0]),e[1]]})):[],Yi((function(r){for(var i=-1;++i<t;){var n=e[i];if(Mt(n[0],this,r))return Mt(n[1],this,r)}}))},Fr.conforms=function(e){return function(e){var t=Ca(e);return function(r){return ui(r,e,t)}}(di(e,1))},Fr.constant=td,Fr.countBy=go,Fr.create=function(e,t){var r=Ur(e);return null==t?r:ni(r,t)},Fr.curry=function e(t,r,i){var s=Xn(t,8,n,n,n,n,n,r=i?n:r);return s.placeholder=e.placeholder,s},Fr.curryRight=function e(t,r,i){var s=Xn(t,d,n,n,n,n,n,r=i?n:r);return s.placeholder=e.placeholder,s},Fr.debounce=Co,Fr.defaults=Aa,Fr.defaultsDeep=Ra,Fr.defer=Po,Fr.delay=Do,Fr.difference=Fs,Fr.differenceBy=Us,Fr.differenceWith=zs,Fr.drop=function(e,t,r){var i=null==e?0:e.length;return i?nn(e,(t=r||t===n?1:ya(t))<0?0:t,i):[]},Fr.dropRight=function(e,t,r){var i=null==e?0:e.length;return i?nn(e,0,(t=i-(t=r||t===n?1:ya(t)))<0?0:t):[]},Fr.dropRightWhile=function(e,t){return e&&e.length?fn(e,us(t,3),!0,!0):[]},Fr.dropWhile=function(e,t){return e&&e.length?fn(e,us(t,3),!0):[]},Fr.fill=function(e,t,r,i){var s=null==e?0:e.length;return s?(r&&"number"!=typeof r&&_s(e,t,r)&&(r=0,i=s),function(e,t,r,i){var s=e.length;for((r=ya(r))<0&&(r=-r>s?0:s+r),(i=i===n||i>s?s:ya(i))<0&&(i+=s),i=r>i?0:ga(i);r<i;)e[r++]=t;return e}(e,t,r,i)):[]},Fr.filter=function(e,t){return(Ko(e)?Ct:gi)(e,us(t,3))},Fr.flatMap=function(e,t){return mi(So(e,t),1)},Fr.flatMapDeep=function(e,t){return mi(So(e,t),h)},Fr.flatMapDepth=function(e,t,r){return r=r===n?1:ya(r),mi(So(e,t),r)},Fr.flatten=Ks,Fr.flattenDeep=function(e){return(null==e?0:e.length)?mi(e,h):[]},Fr.flattenDepth=function(e,t){return(null==e?0:e.length)?mi(e,t=t===n?1:ya(t)):[]},Fr.flip=function(e){return Xn(e,512)},Fr.flow=rd,Fr.flowRight=id,Fr.fromPairs=function(e){for(var t=-1,r=null==e?0:e.length,i={};++t<r;){var n=e[t];i[n[0]]=n[1]}return i},Fr.functions=function(e){return null==e?[]:Ti(e,Ca(e))},Fr.functionsIn=function(e){return null==e?[]:Ti(e,Pa(e))},Fr.groupBy=wo,Fr.initial=function(e){return(null==e?0:e.length)?nn(e,0,-1):[]},Fr.intersection=Vs,Fr.intersectionBy=$s,Fr.intersectionWith=Zs,Fr.invert=Oa,Fr.invertBy=xa,Fr.invokeMap=To,Fr.iteratee=sd,Fr.keyBy=Eo,Fr.keys=Ca,Fr.keysIn=Pa,Fr.map=So,Fr.mapKeys=function(e,t){var r={};return t=us(t,3),_i(e,(function(e,i,n){si(r,t(e,i,n),e)})),r},Fr.mapValues=function(e,t){var r={};return t=us(t,3),_i(e,(function(e,i,n){si(r,i,t(e,i,n))})),r},Fr.matches=function(e){return Fi(di(e,1))},Fr.matchesProperty=function(e,t){return Ui(e,di(t,1))},Fr.memoize=No,Fr.merge=Da,Fr.mergeWith=Na,Fr.method=od,Fr.methodOf=ad,Fr.mixin=dd,Fr.negate=Bo,Fr.nthArg=function(e){return e=ya(e),Yi((function(t){return Hi(t,e)}))},Fr.omit=Ba,Fr.omitBy=function(e,t){return La(e,Bo(us(t)))},Fr.once=function(e){return Oo(2,e)},Fr.orderBy=function(e,t,r,i){return null==e?[]:(Ko(t)||(t=null==t?[]:[t]),Ko(r=i?n:r)||(r=null==r?[]:[r]),Gi(e,t,r))},Fr.over=ld,Fr.overArgs=qo,Fr.overEvery=cd,Fr.overSome=pd,Fr.partial=Lo,Fr.partialRight=jo,Fr.partition=Ao,Fr.pick=qa,Fr.pickBy=La,Fr.property=hd,Fr.propertyOf=function(e){return function(t){return null==e?n:Ei(e,t)}},Fr.pull=Js,Fr.pullAll=Xs,Fr.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?Wi(e,t,us(r,2)):e},Fr.pullAllWith=function(e,t,r){return e&&e.length&&t&&t.length?Wi(e,t,n,r):e},Fr.pullAt=Qs,Fr.range=fd,Fr.rangeRight=yd,Fr.rearg=Fo,Fr.reject=function(e,t){return(Ko(e)?Ct:gi)(e,Bo(us(t,3)))},Fr.remove=function(e,t){var r=[];if(!e||!e.length)return r;var i=-1,n=[],s=e.length;for(t=us(t,3);++i<s;){var o=e[i];t(o,i,e)&&(r.push(o),n.push(i))}return Vi(e,n),r},Fr.rest=function(e,t){if("function"!=typeof e)throw new xe(s);return Yi(e,t=t===n?t:ya(t))},Fr.reverse=eo,Fr.sampleSize=function(e,t,r){return t=(r?_s(e,t,r):t===n)?1:ya(t),(Ko(e)?Xr:Xi)(e,t)},Fr.set=function(e,t,r){return null==e?e:Qi(e,t,r)},Fr.setWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:Qi(e,t,r,i)},Fr.shuffle=function(e){return(Ko(e)?Qr:rn)(e)},Fr.slice=function(e,t,r){var i=null==e?0:e.length;return i?(r&&"number"!=typeof r&&_s(e,t,r)?(t=0,r=i):(t=null==t?0:ya(t),r=r===n?i:ya(r)),nn(e,t,r)):[]},Fr.sortBy=Ro,Fr.sortedUniq=function(e){return e&&e.length?dn(e):[]},Fr.sortedUniqBy=function(e,t){return e&&e.length?dn(e,us(t,2)):[]},Fr.split=function(e,t,r){return r&&"number"!=typeof r&&_s(e,t,r)&&(t=r=n),(r=r===n?g:r>>>0)?(e=ba(e))&&("string"==typeof t||null!=t&&!oa(t))&&!(t=ln(t))&&ar(e)?Tn(fr(e),0,r):e.split(t,r):[]},Fr.spread=function(e,t){if("function"!=typeof e)throw new xe(s);return t=null==t?0:vr(ya(t),0),Yi((function(r){var i=r[t],n=Tn(r,0,t);return i&&Bt(n,i),Mt(e,this,n)}))},Fr.tail=function(e){var t=null==e?0:e.length;return t?nn(e,1,t):[]},Fr.take=function(e,t,r){return e&&e.length?nn(e,0,(t=r||t===n?1:ya(t))<0?0:t):[]},Fr.takeRight=function(e,t,r){var i=null==e?0:e.length;return i?nn(e,(t=i-(t=r||t===n?1:ya(t)))<0?0:t,i):[]},Fr.takeRightWhile=function(e,t){return e&&e.length?fn(e,us(t,3),!1,!0):[]},Fr.takeWhile=function(e,t){return e&&e.length?fn(e,us(t,3)):[]},Fr.tap=function(e,t){return t(e),e},Fr.throttle=function(e,t,r){var i=!0,n=!0;if("function"!=typeof e)throw new xe(s);return ta(r)&&(i="leading"in r?!!r.leading:i,n="trailing"in r?!!r.trailing:n),Co(e,t,{leading:i,maxWait:t,trailing:n})},Fr.thru=fo,Fr.toArray=ha,Fr.toPairs=ja,Fr.toPairsIn=Fa,Fr.toPath=function(e){return Ko(e)?Nt(e,qs):ua(e)?[e]:xn(Bs(ba(e)))},Fr.toPlainObject=va,Fr.transform=function(e,t,r){var i=Ko(e),n=i||Zo(e)||la(e);if(t=us(t,4),null==r){var s=e&&e.constructor;r=n?i?new s:[]:ta(e)&&Xo(s)?Ur(Ve(e)):{}}return(n?Ot:_i)(e,(function(e,i,n){return t(r,e,i,n)})),r},Fr.unary=function(e){return Io(e,1)},Fr.union=to,Fr.unionBy=ro,Fr.unionWith=io,Fr.uniq=function(e){return e&&e.length?cn(e):[]},Fr.uniqBy=function(e,t){return e&&e.length?cn(e,us(t,2)):[]},Fr.uniqWith=function(e,t){return t="function"==typeof t?t:n,e&&e.length?cn(e,n,t):[]},Fr.unset=function(e,t){return null==e||pn(e,t)},Fr.unzip=no,Fr.unzipWith=so,Fr.update=function(e,t,r){return null==e?e:hn(e,t,bn(r))},Fr.updateWith=function(e,t,r,i){return i="function"==typeof i?i:n,null==e?e:hn(e,t,bn(r),i)},Fr.values=Ua,Fr.valuesIn=function(e){return null==e?[]:er(e,Pa(e))},Fr.without=oo,Fr.words=Xa,Fr.wrap=function(e,t){return Lo(bn(t),e)},Fr.xor=ao,Fr.xorBy=uo,Fr.xorWith=lo,Fr.zip=co,Fr.zipObject=function(e,t){return mn(e||[],t||[],ti)},Fr.zipObjectDeep=function(e,t){return mn(e||[],t||[],Qi)},Fr.zipWith=po,Fr.entries=ja,Fr.entriesIn=Fa,Fr.extend=wa,Fr.extendWith=Ta,dd(Fr,Fr),Fr.add=vd,Fr.attempt=Qa,Fr.camelCase=za,Fr.capitalize=Ha,Fr.ceil=bd,Fr.clamp=function(e,t,r){return r===n&&(r=t,t=n),r!==n&&(r=(r=ma(r))==r?r:0),t!==n&&(t=(t=ma(t))==t?t:0),ai(ma(e),t,r)},Fr.clone=function(e){return di(e,4)},Fr.cloneDeep=function(e){return di(e,5)},Fr.cloneDeepWith=function(e,t){return di(e,5,t="function"==typeof t?t:n)},Fr.cloneWith=function(e,t){return di(e,4,t="function"==typeof t?t:n)},Fr.conformsTo=function(e,t){return null==t||ui(e,t,Ca(t))},Fr.deburr=Ga,Fr.defaultTo=function(e,t){return null==e||e!=e?t:e},Fr.divide=_d,Fr.endsWith=function(e,t,r){e=ba(e),t=ln(t);var i=e.length,s=r=r===n?i:ai(ya(r),0,i);return(r-=t.length)>=0&&e.slice(r,s)==t},Fr.eq=Uo,Fr.escape=function(e){return(e=ba(e))&&J.test(e)?e.replace(Z,sr):e},Fr.escapeRegExp=function(e){return(e=ba(e))&&se.test(e)?e.replace(ne,"\\$&"):e},Fr.every=function(e,t,r){var i=Ko(e)?kt:fi;return r&&_s(e,t,r)&&(t=n),i(e,us(t,3))},Fr.find=mo,Fr.findIndex=Hs,Fr.findKey=function(e,t){return Ut(e,us(t,3),_i)},Fr.findLast=vo,Fr.findLastIndex=Gs,Fr.findLastKey=function(e,t){return Ut(e,us(t,3),wi)},Fr.floor=wd,Fr.forEach=bo,Fr.forEachRight=_o,Fr.forIn=function(e,t){return null==e?e:vi(e,us(t,3),Pa)},Fr.forInRight=function(e,t){return null==e?e:bi(e,us(t,3),Pa)},Fr.forOwn=function(e,t){return e&&_i(e,us(t,3))},Fr.forOwnRight=function(e,t){return e&&wi(e,us(t,3))},Fr.get=Ma,Fr.gt=zo,Fr.gte=Ho,Fr.has=function(e,t){return null!=e&&gs(e,t,Mi)},Fr.hasIn=Ia,Fr.head=Ws,Fr.identity=nd,Fr.includes=function(e,t,r,i){e=Vo(e)?e:Ua(e),r=r&&!i?ya(r):0;var n=e.length;return r<0&&(r=vr(n+r,0)),da(e)?r<=n&&e.indexOf(t,r)>-1:!!n&&Ht(e,t,r)>-1},Fr.indexOf=function(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var n=null==r?0:ya(r);return n<0&&(n=vr(i+n,0)),Ht(e,t,n)},Fr.inRange=function(e,t,r){return t=fa(t),r===n?(r=t,t=0):r=fa(r),function(e,t,r){return e>=br(t,r)&&e<vr(t,r)}(e=ma(e),t,r)},Fr.invoke=ka,Fr.isArguments=Go,Fr.isArray=Ko,Fr.isArrayBuffer=Wo,Fr.isArrayLike=Vo,Fr.isArrayLikeObject=$o,Fr.isBoolean=function(e){return!0===e||!1===e||ra(e)&&Ai(e)==_},Fr.isBuffer=Zo,Fr.isDate=Yo,Fr.isElement=function(e){return ra(e)&&1===e.nodeType&&!sa(e)},Fr.isEmpty=function(e){if(null==e)return!0;if(Vo(e)&&(Ko(e)||"string"==typeof e||"function"==typeof e.splice||Zo(e)||la(e)||Go(e)))return!e.length;var t=ys(e);if(t==A||t==x)return!e.size;if(Ss(e))return!Bi(e).length;for(var r in e)if(Be.call(e,r))return!1;return!0},Fr.isEqual=function(e,t){return Ci(e,t)},Fr.isEqualWith=function(e,t,r){var i=(r="function"==typeof r?r:n)?r(e,t):n;return i===n?Ci(e,t,n,r):!!i},Fr.isError=Jo,Fr.isFinite=function(e){return"number"==typeof e&&_t(e)},Fr.isFunction=Xo,Fr.isInteger=Qo,Fr.isLength=ea,Fr.isMap=ia,Fr.isMatch=function(e,t){return e===t||Pi(e,t,cs(t))},Fr.isMatchWith=function(e,t,r){return r="function"==typeof r?r:n,Pi(e,t,cs(t),r)},Fr.isNaN=function(e){return na(e)&&e!=+e},Fr.isNative=function(e){if(Es(e))throw new Se("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Di(e)},Fr.isNil=function(e){return null==e},Fr.isNull=function(e){return null===e},Fr.isNumber=na,Fr.isObject=ta,Fr.isObjectLike=ra,Fr.isPlainObject=sa,Fr.isRegExp=oa,Fr.isSafeInteger=function(e){return Qo(e)&&e>=-9007199254740991&&e<=f},Fr.isSet=aa,Fr.isString=da,Fr.isSymbol=ua,Fr.isTypedArray=la,Fr.isUndefined=function(e){return e===n},Fr.isWeakMap=function(e){return ra(e)&&ys(e)==P},Fr.isWeakSet=function(e){return ra(e)&&"[object WeakSet]"==Ai(e)},Fr.join=function(e,t){return null==e?"":Ft.call(e,t)},Fr.kebabCase=Ka,Fr.last=Ys,Fr.lastIndexOf=function(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var s=i;return r!==n&&(s=(s=ya(r))<0?vr(i+s,0):br(s,i-1)),t==t?function(e,t,r){for(var i=r+1;i--;)if(e[i]===t)return i;return i}(e,t,s):zt(e,Kt,s,!0)},Fr.lowerCase=Wa,Fr.lowerFirst=Va,Fr.lt=ca,Fr.lte=pa,Fr.max=function(e){return e&&e.length?yi(e,nd,Ri):n},Fr.maxBy=function(e,t){return e&&e.length?yi(e,us(t,2),Ri):n},Fr.mean=function(e){return Wt(e,nd)},Fr.meanBy=function(e,t){return Wt(e,us(t,2))},Fr.min=function(e){return e&&e.length?yi(e,nd,Li):n},Fr.minBy=function(e,t){return e&&e.length?yi(e,us(t,2),Li):n},Fr.stubArray=gd,Fr.stubFalse=md,Fr.stubObject=function(){return{}},Fr.stubString=function(){return""},Fr.stubTrue=function(){return!0},Fr.multiply=Ed,Fr.nth=function(e,t){return e&&e.length?Hi(e,ya(t)):n},Fr.noConflict=function(){return yt._===this&&(yt._=Ue),this},Fr.noop=ud,Fr.now=Mo,Fr.pad=function(e,t,r){e=ba(e);var i=(t=ya(t))?hr(e):0;if(!t||i>=t)return e;var n=(t-i)/2;return Kn(gt(n),r)+e+Kn(ft(n),r)},Fr.padEnd=function(e,t,r){e=ba(e);var i=(t=ya(t))?hr(e):0;return t&&i<t?e+Kn(t-i,r):e},Fr.padStart=function(e,t,r){e=ba(e);var i=(t=ya(t))?hr(e):0;return t&&i<t?Kn(t-i,r)+e:e},Fr.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),wr(ba(e).replace(oe,""),t||0)},Fr.random=function(e,t,r){if(r&&"boolean"!=typeof r&&_s(e,t,r)&&(t=r=n),r===n&&("boolean"==typeof t?(r=t,t=n):"boolean"==typeof e&&(r=e,e=n)),e===n&&t===n?(e=0,t=1):(e=fa(e),t===n?(t=e,e=0):t=fa(t)),e>t){var i=e;e=t,t=i}if(r||e%1||t%1){var s=Tr();return br(e+s*(t-e+ct("1e-"+((s+"").length-1))),t)}return $i(e,t)},Fr.reduce=function(e,t,r){var i=Ko(e)?qt:Zt,n=arguments.length<3;return i(e,us(t,4),r,n,pi)},Fr.reduceRight=function(e,t,r){var i=Ko(e)?Lt:Zt,n=arguments.length<3;return i(e,us(t,4),r,n,hi)},Fr.repeat=function(e,t,r){return t=(r?_s(e,t,r):t===n)?1:ya(t),Zi(ba(e),t)},Fr.replace=function(){var e=arguments,t=ba(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Fr.result=function(e,t,r){var i=-1,s=(t=_n(t,e)).length;for(s||(s=1,e=n);++i<s;){var o=null==e?n:e[qs(t[i])];o===n&&(i=s,o=r),e=Xo(o)?o.call(e):o}return e},Fr.round=Sd,Fr.runInContext=e,Fr.sample=function(e){return(Ko(e)?Jr:Ji)(e)},Fr.size=function(e){if(null==e)return 0;if(Vo(e))return da(e)?hr(e):e.length;var t=ys(e);return t==A||t==x?e.size:Bi(e).length},Fr.snakeCase=$a,Fr.some=function(e,t,r){var i=Ko(e)?jt:sn;return r&&_s(e,t,r)&&(t=n),i(e,us(t,3))},Fr.sortedIndex=function(e,t){return on(e,t)},Fr.sortedIndexBy=function(e,t,r){return an(e,t,us(r,2))},Fr.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var i=on(e,t);if(i<r&&Uo(e[i],t))return i}return-1},Fr.sortedLastIndex=function(e,t){return on(e,t,!0)},Fr.sortedLastIndexBy=function(e,t,r){return an(e,t,us(r,2),!0)},Fr.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var r=on(e,t,!0)-1;if(Uo(e[r],t))return r}return-1},Fr.startCase=Za,Fr.startsWith=function(e,t,r){return e=ba(e),r=null==r?0:ai(ya(r),0,e.length),t=ln(t),e.slice(r,r+t.length)==t},Fr.subtract=Ad,Fr.sum=function(e){return e&&e.length?Yt(e,nd):0},Fr.sumBy=function(e,t){return e&&e.length?Yt(e,us(t,2)):0},Fr.template=function(e,t,r){var i=Fr.templateSettings;r&&_s(e,t,r)&&(t=n),e=ba(e),t=Ta({},t,i,Qn);var s,o,a=Ta({},t.imports,i.imports,Qn),d=Ca(a),u=er(a,d),l=0,c=t.interpolate||Te,p="__p += '",h=Ie((t.escape||Te).source+"|"+c.source+"|"+(c===ee?fe:Te).source+"|"+(t.evaluate||Te).source+"|$","g"),f="//# sourceURL="+(Be.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++at+"]")+"\n";e.replace(h,(function(t,r,i,n,a,d){return i||(i=n),p+=e.slice(l,d).replace(Ee,or),r&&(s=!0,p+="' +\n__e("+r+") +\n'"),a&&(o=!0,p+="';\n"+a+";\n__p += '"),i&&(p+="' +\n((__t = ("+i+")) == null ? '' : __t) +\n'"),l=d+t.length,t})),p+="';\n";var y=Be.call(t,"variable")&&t.variable;if(y){if(pe.test(y))throw new Se("Invalid `variable` option passed into `_.template`")}else p="with (obj) {\n"+p+"\n}\n";p=(o?p.replace(K,""):p).replace(W,"$1").replace(V,"$1;"),p="function("+(y||"obj")+") {\n"+(y?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(s?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var g=Qa((function(){return Ae(d,f+"return "+p).apply(n,u)}));if(g.source=p,Jo(g))throw g;return g},Fr.times=function(e,t){if((e=ya(e))<1||e>f)return[];var r=g,i=br(e,g);t=us(t),e-=g;for(var n=Jt(i,t);++r<e;)t(r);return n},Fr.toFinite=fa,Fr.toInteger=ya,Fr.toLength=ga,Fr.toLower=function(e){return ba(e).toLowerCase()},Fr.toNumber=ma,Fr.toSafeInteger=function(e){return e?ai(ya(e),-9007199254740991,f):0===e?e:0},Fr.toString=ba,Fr.toUpper=function(e){return ba(e).toUpperCase()},Fr.trim=function(e,t,r){if((e=ba(e))&&(r||t===n))return Xt(e);if(!e||!(t=ln(t)))return e;var i=fr(e),s=fr(t);return Tn(i,rr(i,s),ir(i,s)+1).join("")},Fr.trimEnd=function(e,t,r){if((e=ba(e))&&(r||t===n))return e.slice(0,yr(e)+1);if(!e||!(t=ln(t)))return e;var i=fr(e);return Tn(i,0,ir(i,fr(t))+1).join("")},Fr.trimStart=function(e,t,r){if((e=ba(e))&&(r||t===n))return e.replace(oe,"");if(!e||!(t=ln(t)))return e;var i=fr(e);return Tn(i,rr(i,fr(t))).join("")},Fr.truncate=function(e,t){var r=30,i="...";if(ta(t)){var s="separator"in t?t.separator:s;r="length"in t?ya(t.length):r,i="omission"in t?ln(t.omission):i}var o=(e=ba(e)).length;if(ar(e)){var a=fr(e);o=a.length}if(r>=o)return e;var d=r-hr(i);if(d<1)return i;var u=a?Tn(a,0,d).join(""):e.slice(0,d);if(s===n)return u+i;if(a&&(d+=u.length-d),oa(s)){if(e.slice(d).search(s)){var l,c=u;for(s.global||(s=Ie(s.source,ba(ye.exec(s))+"g")),s.lastIndex=0;l=s.exec(c);)var p=l.index;u=u.slice(0,p===n?d:p)}}else if(e.indexOf(ln(s),d)!=d){var h=u.lastIndexOf(s);h>-1&&(u=u.slice(0,h))}return u+i},Fr.unescape=function(e){return(e=ba(e))&&Y.test(e)?e.replace($,gr):e},Fr.uniqueId=function(e){var t=++qe;return ba(e)+t},Fr.upperCase=Ya,Fr.upperFirst=Ja,Fr.each=bo,Fr.eachRight=_o,Fr.first=Ws,dd(Fr,(Td={},_i(Fr,(function(e,t){Be.call(Fr.prototype,t)||(Td[t]=e)})),Td),{chain:!1}),Fr.VERSION="4.17.21",Ot(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Fr[e].placeholder=Fr})),Ot(["drop","take"],(function(e,t){Gr.prototype[e]=function(r){r=r===n?1:vr(ya(r),0);var i=this.__filtered__&&!t?new Gr(this):this.clone();return i.__filtered__?i.__takeCount__=br(r,i.__takeCount__):i.__views__.push({size:br(r,g),type:e+(i.__dir__<0?"Right":"")}),i},Gr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Ot(["filter","map","takeWhile"],(function(e,t){var r=t+1,i=1==r||3==r;Gr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:us(e,3),type:r}),t.__filtered__=t.__filtered__||i,t}})),Ot(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Gr.prototype[e]=function(){return this[r](1).value()[0]}})),Ot(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Gr.prototype[e]=function(){return this.__filtered__?new Gr(this):this[r](1)}})),Gr.prototype.compact=function(){return this.filter(nd)},Gr.prototype.find=function(e){return this.filter(e).head()},Gr.prototype.findLast=function(e){return this.reverse().find(e)},Gr.prototype.invokeMap=Yi((function(e,t){return"function"==typeof e?new Gr(this):this.map((function(r){return xi(r,e,t)}))})),Gr.prototype.reject=function(e){return this.filter(Bo(us(e)))},Gr.prototype.slice=function(e,t){e=ya(e);var r=this;return r.__filtered__&&(e>0||t<0)?new Gr(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==n&&(r=(t=ya(t))<0?r.dropRight(-t):r.take(t-e)),r)},Gr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Gr.prototype.toArray=function(){return this.take(g)},_i(Gr.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),s=Fr[i?"take"+("last"==t?"Right":""):t],o=i||/^find/.test(t);s&&(Fr.prototype[t]=function(){var t=this.__wrapped__,a=i?[1]:arguments,d=t instanceof Gr,u=a[0],l=d||Ko(t),c=function(e){var t=s.apply(Fr,Bt([e],a));return i&&p?t[0]:t};l&&r&&"function"==typeof u&&1!=u.length&&(d=l=!1);var p=this.__chain__,h=!!this.__actions__.length,f=o&&!p,y=d&&!h;if(!o&&l){t=y?t:new Gr(this);var g=e.apply(t,a);return g.__actions__.push({func:fo,args:[c],thisArg:n}),new Hr(g,p)}return f&&y?e.apply(this,a):(g=this.thru(c),f?i?g.value()[0]:g.value():g)})})),Ot(["pop","push","shift","sort","splice","unshift"],(function(e){var t=ke[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",i=/^(?:pop|shift)$/.test(e);Fr.prototype[e]=function(){var e=arguments;if(i&&!this.__chain__){var n=this.value();return t.apply(Ko(n)?n:[],e)}return this[r]((function(r){return t.apply(Ko(r)?r:[],e)}))}})),_i(Gr.prototype,(function(e,t){var r=Fr[t];if(r){var i=r.name+"";Be.call(kr,i)||(kr[i]=[]),kr[i].push({name:t,func:r})}})),kr[Un(n,2).name]=[{name:"wrapper",func:n}],Gr.prototype.clone=function(){var e=new Gr(this.__wrapped__);return e.__actions__=xn(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=xn(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=xn(this.__views__),e},Gr.prototype.reverse=function(){if(this.__filtered__){var e=new Gr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Gr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=Ko(e),i=t<0,n=r?e.length:0,s=function(e,t,r){var i=-1,n=r.length;for(;++i<n;){var s=r[i],o=s.size;switch(s.type){case"drop":e+=o;break;case"dropRight":t-=o;break;case"take":t=br(t,e+o);break;case"takeRight":e=vr(e,t-o)}}return{start:e,end:t}}(0,n,this.__views__),o=s.start,a=s.end,d=a-o,u=i?a:o-1,l=this.__iteratees__,c=l.length,p=0,h=br(d,this.__takeCount__);if(!r||!i&&n==d&&h==d)return yn(e,this.__actions__);var f=[];e:for(;d--&&p<h;){for(var y=-1,g=e[u+=t];++y<c;){var m=l[y],v=m.iteratee,b=m.type,_=v(g);if(2==b)g=_;else if(!_){if(1==b)continue e;break e}}f[p++]=g}return f},Fr.prototype.at=yo,Fr.prototype.chain=function(){return ho(this)},Fr.prototype.commit=function(){return new Hr(this.value(),this.__chain__)},Fr.prototype.next=function(){this.__values__===n&&(this.__values__=ha(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?n:this.__values__[this.__index__++]}},Fr.prototype.plant=function(e){for(var t,r=this;r instanceof zr;){var i=js(r);i.__index__=0,i.__values__=n,t?s.__wrapped__=i:t=i;var s=i;r=r.__wrapped__}return s.__wrapped__=e,t},Fr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Gr){var t=e;return this.__actions__.length&&(t=new Gr(this)),(t=t.reverse()).__actions__.push({func:fo,args:[eo],thisArg:n}),new Hr(t,this.__chain__)}return this.thru(eo)},Fr.prototype.toJSON=Fr.prototype.valueOf=Fr.prototype.value=function(){return yn(this.__wrapped__,this.__actions__)},Fr.prototype.first=Fr.prototype.head,Xe&&(Fr.prototype[Xe]=function(){return this}),Fr}();yt._=mr,(i=function(){return mr}.call(t,r,t,e))===n||(e.exports=i)}.call(this)},1219:e=>{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(e){}function r(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function i(e){return!0===(e&&e.__isLong__)}r.prototype.__isLong__,Object.defineProperty(r.prototype,"__isLong__",{value:!0}),r.isLong=i;var n={},s={};function o(e,t){var r,i,o;return t?(o=0<=(e>>>=0)&&e<256)&&(i=s[e])?i:(r=d(e,(0|e)<0?-1:0,!0),o&&(s[e]=r),r):(o=-128<=(e|=0)&&e<128)&&(i=n[e])?i:(r=d(e,e<0?-1:0,!1),o&&(n[e]=r),r)}function a(e,t){if(isNaN(e))return t?m:g;if(t){if(e<0)return m;if(e>=h)return T}else{if(e<=-f)return E;if(e+1>=f)return w}return e<0?a(-e,t).neg():d(e%p|0,e/p|0,t)}function d(e,t,i){return new r(e,t,i)}r.fromInt=o,r.fromNumber=a,r.fromBits=d;var u=Math.pow;function l(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return g;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var i;if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return l(e.substring(1),t,r).neg();for(var n=a(u(r,8)),s=g,o=0;o<e.length;o+=8){var d=Math.min(8,e.length-o),c=parseInt(e.substring(o,o+d),r);if(d<8){var p=a(u(r,d));s=s.mul(p).add(a(c))}else s=(s=s.mul(n)).add(a(c))}return s.unsigned=t,s}function c(e,t){return"number"==typeof e?a(e,t):"string"==typeof e?l(e,t):d(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}r.fromString=l,r.fromValue=c;var p=4294967296,h=p*p,f=h/2,y=o(1<<24),g=o(0);r.ZERO=g;var m=o(0,!0);r.UZERO=m;var v=o(1);r.ONE=v;var b=o(1,!0);r.UONE=b;var _=o(-1);r.NEG_ONE=_;var w=d(-1,2147483647,!1);r.MAX_VALUE=w;var T=d(-1,-1,!0);r.MAX_UNSIGNED_VALUE=T;var E=d(0,-2147483648,!1);r.MIN_VALUE=E;var S=r.prototype;S.toInt=function(){return this.unsigned?this.low>>>0:this.low},S.toNumber=function(){return this.unsigned?(this.high>>>0)*p+(this.low>>>0):this.high*p+(this.low>>>0)},S.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(E)){var t=a(e),r=this.div(t),i=r.mul(t).sub(this);return r.toString(e)+i.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var n=a(u(e,6),this.unsigned),s=this,o="";;){var d=s.div(n),l=(s.sub(d.mul(n)).toInt()>>>0).toString(e);if((s=d).isZero())return l+o;for(;l.length<6;)l="0"+l;o=""+l+o}},S.getHighBits=function(){return this.high},S.getHighBitsUnsigned=function(){return this.high>>>0},S.getLowBits=function(){return this.low},S.getLowBitsUnsigned=function(){return this.low>>>0},S.getNumBitsAbs=function(){if(this.isNegative())return this.eq(E)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},S.isZero=function(){return 0===this.high&&0===this.low},S.eqz=S.isZero,S.isNegative=function(){return!this.unsigned&&this.high<0},S.isPositive=function(){return this.unsigned||this.high>=0},S.isOdd=function(){return 1==(1&this.low)},S.isEven=function(){return 0==(1&this.low)},S.equals=function(e){return i(e)||(e=c(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},S.eq=S.equals,S.notEquals=function(e){return!this.eq(e)},S.neq=S.notEquals,S.ne=S.notEquals,S.lessThan=function(e){return this.comp(e)<0},S.lt=S.lessThan,S.lessThanOrEqual=function(e){return this.comp(e)<=0},S.lte=S.lessThanOrEqual,S.le=S.lessThanOrEqual,S.greaterThan=function(e){return this.comp(e)>0},S.gt=S.greaterThan,S.greaterThanOrEqual=function(e){return this.comp(e)>=0},S.gte=S.greaterThanOrEqual,S.ge=S.greaterThanOrEqual,S.compare=function(e){if(i(e)||(e=c(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},S.comp=S.compare,S.negate=function(){return!this.unsigned&&this.eq(E)?E:this.not().add(v)},S.neg=S.negate,S.add=function(e){i(e)||(e=c(e));var t=this.high>>>16,r=65535&this.high,n=this.low>>>16,s=65535&this.low,o=e.high>>>16,a=65535&e.high,u=e.low>>>16,l=0,p=0,h=0,f=0;return h+=(f+=s+(65535&e.low))>>>16,p+=(h+=n+u)>>>16,l+=(p+=r+a)>>>16,l+=t+o,d((h&=65535)<<16|(f&=65535),(l&=65535)<<16|(p&=65535),this.unsigned)},S.subtract=function(e){return i(e)||(e=c(e)),this.add(e.neg())},S.sub=S.subtract,S.multiply=function(e){if(this.isZero())return g;if(i(e)||(e=c(e)),t)return d(t.mul(this.low,this.high,e.low,e.high),t.get_high(),this.unsigned);if(e.isZero())return g;if(this.eq(E))return e.isOdd()?E:g;if(e.eq(E))return this.isOdd()?E:g;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(y)&&e.lt(y))return a(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,n=65535&this.high,s=this.low>>>16,o=65535&this.low,u=e.high>>>16,l=65535&e.high,p=e.low>>>16,h=65535&e.low,f=0,m=0,v=0,b=0;return v+=(b+=o*h)>>>16,m+=(v+=s*h)>>>16,v&=65535,m+=(v+=o*p)>>>16,f+=(m+=n*h)>>>16,m&=65535,f+=(m+=s*p)>>>16,m&=65535,f+=(m+=o*l)>>>16,f+=r*h+n*p+s*l+o*u,d((v&=65535)<<16|(b&=65535),(f&=65535)<<16|(m&=65535),this.unsigned)},S.mul=S.multiply,S.divide=function(e){if(i(e)||(e=c(e)),e.isZero())throw Error("division by zero");var r,n,s;if(t)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?d((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:g;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return m;if(e.gt(this.shru(1)))return b;s=m}else{if(this.eq(E))return e.eq(v)||e.eq(_)?E:e.eq(E)?v:(r=this.shr(1).div(e).shl(1)).eq(g)?e.isNegative()?v:_:(n=this.sub(e.mul(r)),s=r.add(n.div(e)));if(e.eq(E))return this.unsigned?m:g;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();s=g}for(n=this;n.gte(e);){r=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var o=Math.ceil(Math.log(r)/Math.LN2),l=o<=48?1:u(2,o-48),p=a(r),h=p.mul(e);h.isNegative()||h.gt(n);)h=(p=a(r-=l,this.unsigned)).mul(e);p.isZero()&&(p=v),s=s.add(p),n=n.sub(h)}return s},S.div=S.divide,S.modulo=function(e){return i(e)||(e=c(e)),t?d((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))},S.mod=S.modulo,S.rem=S.modulo,S.not=function(){return d(~this.low,~this.high,this.unsigned)},S.and=function(e){return i(e)||(e=c(e)),d(this.low&e.low,this.high&e.high,this.unsigned)},S.or=function(e){return i(e)||(e=c(e)),d(this.low|e.low,this.high|e.high,this.unsigned)},S.xor=function(e){return i(e)||(e=c(e)),d(this.low^e.low,this.high^e.high,this.unsigned)},S.shiftLeft=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?d(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):d(0,this.low<<e-32,this.unsigned)},S.shl=S.shiftLeft,S.shiftRight=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?d(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):d(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},S.shr=S.shiftRight,S.shiftRightUnsigned=function(e){if(i(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?d(this.low>>>e|t<<32-e,t>>>e,this.unsigned):d(32===e?t:t>>>e-32,0,this.unsigned)},S.shru=S.shiftRightUnsigned,S.shr_u=S.shiftRightUnsigned,S.toSigned=function(){return this.unsigned?d(this.low,this.high,!1):this},S.toUnsigned=function(){return this.unsigned?this:d(this.low,this.high,!0)},S.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},S.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]},S.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,i){return i?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)}},3624:(e,t,r)=>{"use strict";const i=r(222),n=Symbol("max"),s=Symbol("length"),o=Symbol("lengthCalculator"),a=Symbol("allowStale"),d=Symbol("maxAge"),u=Symbol("dispose"),l=Symbol("noDisposeOnSet"),c=Symbol("lruList"),p=Symbol("cache"),h=Symbol("updateAgeOnGet"),f=()=>1;const y=(e,t,r)=>{const i=e[p].get(t);if(i){const t=i.value;if(g(e,t)){if(v(e,i),!e[a])return}else r&&(e[h]&&(i.value.now=Date.now()),e[c].unshiftNode(i));return t.value}},g=(e,t)=>{if(!t||!t.maxAge&&!e[d])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[d]&&r>e[d]},m=e=>{if(e[s]>e[n])for(let t=e[c].tail;e[s]>e[n]&&null!==t;){const r=t.prev;v(e,t),t=r}},v=(e,t)=>{if(t){const r=t.value;e[u]&&e[u](r.key,r.value),e[s]-=r.length,e[p].delete(r.key),e[c].removeNode(t)}};class b{constructor(e,t,r,i,n){this.key=e,this.value=t,this.length=r,this.now=i,this.maxAge=n||0}}const _=(e,t,r,i)=>{let n=r.value;g(e,n)&&(v(e,r),e[a]||(n=void 0)),n&&t.call(i,n.value,n.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[n]=e.max||1/0;const t=e.length||f;if(this[o]="function"!=typeof t?f:t,this[a]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[d]=e.maxAge||0,this[u]=e.dispose,this[l]=e.noDisposeOnSet||!1,this[h]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[n]=e||1/0,m(this)}get max(){return this[n]}set allowStale(e){this[a]=!!e}get allowStale(){return this[a]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[d]=e,m(this)}get maxAge(){return this[d]}set lengthCalculator(e){"function"!=typeof e&&(e=f),e!==this[o]&&(this[o]=e,this[s]=0,this[c].forEach((e=>{e.length=this[o](e.value,e.key),this[s]+=e.length}))),m(this)}get lengthCalculator(){return this[o]}get length(){return this[s]}get itemCount(){return this[c].length}rforEach(e,t){t=t||this;for(let r=this[c].tail;null!==r;){const i=r.prev;_(this,e,r,t),r=i}}forEach(e,t){t=t||this;for(let r=this[c].head;null!==r;){const i=r.next;_(this,e,r,t),r=i}}keys(){return this[c].toArray().map((e=>e.key))}values(){return this[c].toArray().map((e=>e.value))}reset(){this[u]&&this[c]&&this[c].length&&this[c].forEach((e=>this[u](e.key,e.value))),this[p]=new Map,this[c]=new i,this[s]=0}dump(){return this[c].map((e=>!g(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[c]}set(e,t,r){if((r=r||this[d])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const i=r?Date.now():0,a=this[o](t,e);if(this[p].has(e)){if(a>this[n])return v(this,this[p].get(e)),!1;const o=this[p].get(e).value;return this[u]&&(this[l]||this[u](e,o.value)),o.now=i,o.maxAge=r,o.value=t,this[s]+=a-o.length,o.length=a,this.get(e),m(this),!0}const h=new b(e,t,a,i,r);return h.length>this[n]?(this[u]&&this[u](e,t),!1):(this[s]+=h.length,this[c].unshift(h),this[p].set(e,this[c].head),m(this),!0)}has(e){if(!this[p].has(e))return!1;const t=this[p].get(e).value;return!g(this,t)}get(e){return y(this,e,!0)}peek(e){return y(this,e,!1)}pop(){const e=this[c].tail;return e?(v(this,e),e.value):null}del(e){v(this,this[p].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const i=e[r],n=i.e||0;if(0===n)this.set(i.k,i.v);else{const e=n-t;e>0&&this.set(i.k,i.v,e)}}}prune(){this[p].forEach(((e,t)=>y(this,t,!1)))}}},8479:e=>{"use strict";e.exports=Math.abs},8449:e=>{"use strict";e.exports=Math.floor},2422:e=>{"use strict";e.exports=Number.isNaN||function(e){return e!=e}},8129:e=>{"use strict";e.exports=Math.max},2387:e=>{"use strict";e.exports=Math.min},5865:e=>{"use strict";e.exports=Math.pow},1319:e=>{"use strict";e.exports=Math.round},6882:(e,t,r)=>{"use strict";var i=r(2422);e.exports=function(e){return i(e)||0===e?e:e<0?-1:1}},3275:(e,t,r)=>{"use strict";var i=r(5615),n=r(9512),s=r(5636).Buffer,o=new Array(16);function a(){n.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function d(e,t){return e<<t|e>>>32-t}function u(e,t,r,i,n,s,o){return d(e+(t&r|~t&i)+n+s|0,o)+t|0}function l(e,t,r,i,n,s,o){return d(e+(t&i|r&~i)+n+s|0,o)+t|0}function c(e,t,r,i,n,s,o){return d(e+(t^r^i)+n+s|0,o)+t|0}function p(e,t,r,i,n,s,o){return d(e+(r^(t|~i))+n+s|0,o)+t|0}i(a,n),a.prototype._update=function(){for(var e=o,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,i=this._b,n=this._c,s=this._d;r=u(r,i,n,s,e[0],3614090360,7),s=u(s,r,i,n,e[1],3905402710,12),n=u(n,s,r,i,e[2],606105819,17),i=u(i,n,s,r,e[3],3250441966,22),r=u(r,i,n,s,e[4],4118548399,7),s=u(s,r,i,n,e[5],1200080426,12),n=u(n,s,r,i,e[6],2821735955,17),i=u(i,n,s,r,e[7],4249261313,22),r=u(r,i,n,s,e[8],1770035416,7),s=u(s,r,i,n,e[9],2336552879,12),n=u(n,s,r,i,e[10],4294925233,17),i=u(i,n,s,r,e[11],2304563134,22),r=u(r,i,n,s,e[12],1804603682,7),s=u(s,r,i,n,e[13],4254626195,12),n=u(n,s,r,i,e[14],2792965006,17),r=l(r,i=u(i,n,s,r,e[15],1236535329,22),n,s,e[1],4129170786,5),s=l(s,r,i,n,e[6],3225465664,9),n=l(n,s,r,i,e[11],643717713,14),i=l(i,n,s,r,e[0],3921069994,20),r=l(r,i,n,s,e[5],3593408605,5),s=l(s,r,i,n,e[10],38016083,9),n=l(n,s,r,i,e[15],3634488961,14),i=l(i,n,s,r,e[4],3889429448,20),r=l(r,i,n,s,e[9],568446438,5),s=l(s,r,i,n,e[14],3275163606,9),n=l(n,s,r,i,e[3],4107603335,14),i=l(i,n,s,r,e[8],1163531501,20),r=l(r,i,n,s,e[13],2850285829,5),s=l(s,r,i,n,e[2],4243563512,9),n=l(n,s,r,i,e[7],1735328473,14),r=c(r,i=l(i,n,s,r,e[12],2368359562,20),n,s,e[5],4294588738,4),s=c(s,r,i,n,e[8],2272392833,11),n=c(n,s,r,i,e[11],1839030562,16),i=c(i,n,s,r,e[14],4259657740,23),r=c(r,i,n,s,e[1],2763975236,4),s=c(s,r,i,n,e[4],1272893353,11),n=c(n,s,r,i,e[7],4139469664,16),i=c(i,n,s,r,e[10],3200236656,23),r=c(r,i,n,s,e[13],681279174,4),s=c(s,r,i,n,e[0],3936430074,11),n=c(n,s,r,i,e[3],3572445317,16),i=c(i,n,s,r,e[6],76029189,23),r=c(r,i,n,s,e[9],3654602809,4),s=c(s,r,i,n,e[12],3873151461,11),n=c(n,s,r,i,e[15],530742520,16),r=p(r,i=c(i,n,s,r,e[2],3299628645,23),n,s,e[0],4096336452,6),s=p(s,r,i,n,e[7],1126891415,10),n=p(n,s,r,i,e[14],2878612391,15),i=p(i,n,s,r,e[5],4237533241,21),r=p(r,i,n,s,e[12],1700485571,6),s=p(s,r,i,n,e[3],2399980690,10),n=p(n,s,r,i,e[10],4293915773,15),i=p(i,n,s,r,e[1],2240044497,21),r=p(r,i,n,s,e[8],1873313359,6),s=p(s,r,i,n,e[15],4264355552,10),n=p(n,s,r,i,e[6],2734768916,15),i=p(i,n,s,r,e[13],1309151649,21),r=p(r,i,n,s,e[4],4149444226,6),s=p(s,r,i,n,e[11],3174756917,10),n=p(n,s,r,i,e[2],718787259,15),i=p(i,n,s,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+n|0,this._d=this._d+s|0},a.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=s.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=a},9512:(e,t,r)=>{"use strict";var i=r(5636).Buffer,n=r(4156).Transform;function s(e){n.call(this),this._block=i.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(5615)(s,n),s.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},s.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},s.prototype.update=function(e,t){if(function(e,t){if(!i.isBuffer(e)&&"string"!=typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");i.isBuffer(e)||(e=i.from(e,t));for(var r=this._block,n=0;this._blockOffset+e.length-n>=this._blockSize;){for(var s=this._blockOffset;s<this._blockSize;)r[s++]=e[n++];this._update(),this._blockOffset=0}for(;n<e.length;)r[this._blockOffset++]=e[n++];for(var o=0,a=8*e.length;a>0;++o)this._length[o]+=a,(a=this._length[o]/4294967296|0)>0&&(this._length[o]-=4294967296*a);return this},s.prototype._update=function(){throw new Error("_update is not implemented")},s.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},s.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=s},7784:e=>{function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},9042:(e,t)=>{"use strict";var r=t;function i(e){return 1===e.length?"0"+e:e}function n(e){for(var t="",r=0;r<e.length;r++)t+=i(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var i=0;i<e.length;i++)r[i]=0|e[i];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(i=0;i<e.length;i++){var n=e.charCodeAt(i),s=n>>8,o=255&n;s?r.push(s,o):r.push(o)}return r},r.zero2=i,r.toHex=n,r.encode=function(e,t){return"hex"===t?n(e):e}},7250:e=>{var t=1e3,r=60*t,i=60*r,n=24*i,s=7*n,o=365.25*n;function a(e,t,r,i){var n=t>=1.5*r;return Math.round(e/r)+" "+i+(n?"s":"")}e.exports=function(e,d){d=d||{};var u=typeof e;if("string"===u&&e.length>0)return function(e){if((e=String(e)).length>100)return;var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!a)return;var d=parseFloat(a[1]);switch((a[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return d*o;case"weeks":case"week":case"w":return d*s;case"days":case"day":case"d":return d*n;case"hours":case"hour":case"hrs":case"hr":case"h":return d*i;case"minutes":case"minute":case"mins":case"min":case"m":return d*r;case"seconds":case"second":case"secs":case"sec":case"s":return d*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return d;default:return}}(e);if("number"===u&&isFinite(e))return d.long?function(e){var s=Math.abs(e);if(s>=n)return a(e,s,n,"day");if(s>=i)return a(e,s,i,"hour");if(s>=r)return a(e,s,r,"minute");if(s>=t)return a(e,s,t,"second");return e+" ms"}(e):function(e){var s=Math.abs(e);if(s>=n)return Math.round(e/n)+"d";if(s>=i)return Math.round(e/i)+"h";if(s>=r)return Math.round(e/r)+"m";if(s>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},2372:e=>{"use strict";var t=function(e){return e!=e};e.exports=function(e,r){return 0===e&&0===r?1/e==1/r:e===r||!(!t(e)||!t(r))}},5968:(e,t,r)=>{"use strict";var i=r(1857),n=r(8498),s=r(2372),o=r(1937),a=r(5087),d=n(o(),Object);i(d,{getPolyfill:o,implementation:s,shim:a}),e.exports=d},1937:(e,t,r)=>{"use strict";var i=r(2372);e.exports=function(){return"function"==typeof Object.is?Object.is:i}},5087:(e,t,r)=>{"use strict";var i=r(1937),n=r(1857);e.exports=function(){var e=i();return n(Object,{is:e},{is:function(){return Object.is!==e}}),e}},8160:(e,t,r)=>{"use strict";var i;if(!Object.keys){var n=Object.prototype.hasOwnProperty,s=Object.prototype.toString,o=r(968),a=Object.prototype.propertyIsEnumerable,d=!a.call({toString:null},"toString"),u=a.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(e){var t=e.constructor;return t&&t.prototype===e},p={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},h=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!p["$"+e]&&n.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{c(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();i=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===s.call(e),i=o(e),a=t&&"[object String]"===s.call(e),p=[];if(!t&&!r&&!i)throw new TypeError("Object.keys called on a non-object");var f=u&&r;if(a&&e.length>0&&!n.call(e,0))for(var y=0;y<e.length;++y)p.push(String(y));if(i&&e.length>0)for(var g=0;g<e.length;++g)p.push(String(g));else for(var m in e)f&&"prototype"===m||!n.call(e,m)||p.push(String(m));if(d)for(var v=function(e){if("undefined"==typeof window||!h)return c(e);try{return c(e)}catch(e){return!1}}(e),b=0;b<l.length;++b)v&&"constructor"===l[b]||!n.call(e,l[b])||p.push(l[b]);return p}}e.exports=i},9228:(e,t,r)=>{"use strict";var i=Array.prototype.slice,n=r(968),s=Object.keys,o=s?function(e){return s(e)}:r(8160),a=Object.keys;o.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return n(e)?a(i.call(e)):a(e)})}else Object.keys=o;return Object.keys||o},e.exports=o},968:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),i="[object Arguments]"===r;return i||(i="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),i}},1791:(e,t,r)=>{"use strict";var i={};(0,r(1824).assign)(i,r(8940),r(3744),r(7200)),e.exports=i},8940:(e,t,r)=>{"use strict";var i=r(6446),n=r(1824),s=r(5695),o=r(2817),a=r(2495),d=Object.prototype.toString,u=0,l=-1,c=0,p=8;function h(e){if(!(this instanceof h))return new h(e);this.options=n.assign({level:l,method:p,chunkSize:16384,windowBits:15,memLevel:8,strategy:c,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var r=i.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==u)throw new Error(o[r]);if(t.header&&i.deflateSetHeader(this.strm,t.header),t.dictionary){var f;if(f="string"==typeof t.dictionary?s.string2buf(t.dictionary):"[object ArrayBuffer]"===d.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,(r=i.deflateSetDictionary(this.strm,f))!==u)throw new Error(o[r]);this._dict_set=!0}}function f(e,t){var r=new h(t);if(r.push(e,!0),r.err)throw r.msg||o[r.err];return r.result}h.prototype.push=function(e,t){var r,o,a=this.strm,l=this.options.chunkSize;if(this.ended)return!1;o=t===~~t?t:!0===t?4:0,"string"==typeof e?a.input=s.string2buf(e):"[object ArrayBuffer]"===d.call(e)?a.input=new Uint8Array(e):a.input=e,a.next_in=0,a.avail_in=a.input.length;do{if(0===a.avail_out&&(a.output=new n.Buf8(l),a.next_out=0,a.avail_out=l),1!==(r=i.deflate(a,o))&&r!==u)return this.onEnd(r),this.ended=!0,!1;0!==a.avail_out&&(0!==a.avail_in||4!==o&&2!==o)||("string"===this.options.to?this.onData(s.buf2binstring(n.shrinkBuf(a.output,a.next_out))):this.onData(n.shrinkBuf(a.output,a.next_out)))}while((a.avail_in>0||0===a.avail_out)&&1!==r);return 4===o?(r=i.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===u):2!==o||(this.onEnd(u),a.avail_out=0,!0)},h.prototype.onData=function(e){this.chunks.push(e)},h.prototype.onEnd=function(e){e===u&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Deflate=h,t.deflate=f,t.deflateRaw=function(e,t){return(t=t||{}).raw=!0,f(e,t)},t.gzip=function(e,t){return(t=t||{}).gzip=!0,f(e,t)}},3744:(e,t,r)=>{"use strict";var i=r(8142),n=r(1824),s=r(5695),o=r(7200),a=r(2817),d=r(2495),u=r(6153),l=Object.prototype.toString;function c(e){if(!(this instanceof c))return new c(e);this.options=n.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var r=i.inflateInit2(this.strm,t.windowBits);if(r!==o.Z_OK)throw new Error(a[r]);if(this.header=new u,i.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=s.string2buf(t.dictionary):"[object ArrayBuffer]"===l.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=i.inflateSetDictionary(this.strm,t.dictionary))!==o.Z_OK))throw new Error(a[r])}function p(e,t){var r=new c(t);if(r.push(e,!0),r.err)throw r.msg||a[r.err];return r.result}c.prototype.push=function(e,t){var r,a,d,u,c,p=this.strm,h=this.options.chunkSize,f=this.options.dictionary,y=!1;if(this.ended)return!1;a=t===~~t?t:!0===t?o.Z_FINISH:o.Z_NO_FLUSH,"string"==typeof e?p.input=s.binstring2buf(e):"[object ArrayBuffer]"===l.call(e)?p.input=new Uint8Array(e):p.input=e,p.next_in=0,p.avail_in=p.input.length;do{if(0===p.avail_out&&(p.output=new n.Buf8(h),p.next_out=0,p.avail_out=h),(r=i.inflate(p,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&f&&(r=i.inflateSetDictionary(this.strm,f)),r===o.Z_BUF_ERROR&&!0===y&&(r=o.Z_OK,y=!1),r!==o.Z_STREAM_END&&r!==o.Z_OK)return this.onEnd(r),this.ended=!0,!1;p.next_out&&(0!==p.avail_out&&r!==o.Z_STREAM_END&&(0!==p.avail_in||a!==o.Z_FINISH&&a!==o.Z_SYNC_FLUSH)||("string"===this.options.to?(d=s.utf8border(p.output,p.next_out),u=p.next_out-d,c=s.buf2string(p.output,d),p.next_out=u,p.avail_out=h-u,u&&n.arraySet(p.output,p.output,d,u,0),this.onData(c)):this.onData(n.shrinkBuf(p.output,p.next_out)))),0===p.avail_in&&0===p.avail_out&&(y=!0)}while((p.avail_in>0||0===p.avail_out)&&r!==o.Z_STREAM_END);return r===o.Z_STREAM_END&&(a=o.Z_FINISH),a===o.Z_FINISH?(r=i.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===o.Z_OK):a!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),p.avail_out=0,!0)},c.prototype.onData=function(e){this.chunks.push(e)},c.prototype.onEnd=function(e){e===o.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},t.Inflate=c,t.inflate=p,t.inflateRaw=function(e,t){return(t=t||{}).raw=!0,p(e,t)},t.ungzip=p},1824:(e,t)=>{"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)i(r,n)&&(e[n]=r[n])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var n={arraySet:function(e,t,r,i,n){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+i),n);else for(var s=0;s<i;s++)e[n+s]=t[r+s]},flattenChunks:function(e){var t,r,i,n,s,o;for(i=0,t=0,r=e.length;t<r;t++)i+=e[t].length;for(o=new Uint8Array(i),n=0,t=0,r=e.length;t<r;t++)s=e[t],o.set(s,n),n+=s.length;return o}},s={arraySet:function(e,t,r,i,n){for(var s=0;s<i;s++)e[n+s]=t[r+s]},flattenChunks:function(e){return[].concat.apply([],e)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,n)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,s))},t.setTyped(r)},5695:(e,t,r)=>{"use strict";var i=r(1824),n=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch(e){n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){s=!1}for(var o=new i.Buf8(256),a=0;a<256;a++)o[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;function d(e,t){if(t<65534&&(e.subarray&&s||!e.subarray&&n))return String.fromCharCode.apply(null,i.shrinkBuf(e,t));for(var r="",o=0;o<t;o++)r+=String.fromCharCode(e[o]);return r}o[254]=o[254]=1,t.string2buf=function(e){var t,r,n,s,o,a=e.length,d=0;for(s=0;s<a;s++)55296==(64512&(r=e.charCodeAt(s)))&&s+1<a&&56320==(64512&(n=e.charCodeAt(s+1)))&&(r=65536+(r-55296<<10)+(n-56320),s++),d+=r<128?1:r<2048?2:r<65536?3:4;for(t=new i.Buf8(d),o=0,s=0;o<d;s++)55296==(64512&(r=e.charCodeAt(s)))&&s+1<a&&56320==(64512&(n=e.charCodeAt(s+1)))&&(r=65536+(r-55296<<10)+(n-56320),s++),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t},t.buf2binstring=function(e){return d(e,e.length)},t.binstring2buf=function(e){for(var t=new i.Buf8(e.length),r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t},t.buf2string=function(e,t){var r,i,n,s,a=t||e.length,u=new Array(2*a);for(i=0,r=0;r<a;)if((n=e[r++])<128)u[i++]=n;else if((s=o[n])>4)u[i++]=65533,r+=s-1;else{for(n&=2===s?31:3===s?15:7;s>1&&r<a;)n=n<<6|63&e[r++],s--;s>1?u[i++]=65533:n<65536?u[i++]=n:(n-=65536,u[i++]=55296|n>>10&1023,u[i++]=56320|1023&n)}return d(u,i)},t.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+o[e[r]]>t?r:t}},6904:e=>{"use strict";e.exports=function(e,t,r,i){for(var n=65535&e|0,s=e>>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{s=s+(n=n+t[i++]|0)|0}while(--o);n%=65521,s%=65521}return n|s<<16|0}},7200:e=>{"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},2506:e=>{"use strict";var t=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,r,i,n){var s=t,o=n+i;e^=-1;for(var a=n;a<o;a++)e=e>>>8^s[255&(e^r[a])];return-1^e}},6446:(e,t,r)=>{"use strict";var i,n=r(1824),s=r(9708),o=r(6904),a=r(2506),d=r(2817),u=0,l=4,c=0,p=-2,h=-1,f=4,y=2,g=8,m=9,v=286,b=30,_=19,w=2*v+1,T=15,E=3,S=258,A=S+E+1,R=42,M=103,I=113,O=666,x=1,k=2,C=3,P=4;function D(e,t){return e.msg=d[t],t}function N(e){return(e<<1)-(e>4?9:0)}function B(e){for(var t=e.length;--t>=0;)e[t]=0}function q(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(n.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function L(e,t){s._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,q(e.strm)}function j(e,t){e.pending_buf[e.pending++]=t}function F(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function U(e,t){var r,i,n=e.max_chain_length,s=e.strstart,o=e.prev_length,a=e.nice_match,d=e.strstart>e.w_size-A?e.strstart-(e.w_size-A):0,u=e.window,l=e.w_mask,c=e.prev,p=e.strstart+S,h=u[s+o-1],f=u[s+o];e.prev_length>=e.good_match&&(n>>=2),a>e.lookahead&&(a=e.lookahead);do{if(u[(r=t)+o]===f&&u[r+o-1]===h&&u[r]===u[s]&&u[++r]===u[s+1]){s+=2,r++;do{}while(u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&s<p);if(i=S-(p-s),s=p-S,i>o){if(e.match_start=t,o=i,i>=a)break;h=u[s+o-1],f=u[s+o]}}}while((t=c[t&l])>d&&0!=--n);return o<=e.lookahead?o:e.lookahead}function z(e){var t,r,i,s,d,u,l,c,p,h,f=e.w_size;do{if(s=e.window_size-e.lookahead-e.strstart,e.strstart>=f+(f-A)){n.arraySet(e.window,e.window,f,f,0),e.match_start-=f,e.strstart-=f,e.block_start-=f,t=r=e.hash_size;do{i=e.head[--t],e.head[t]=i>=f?i-f:0}while(--r);t=r=f;do{i=e.prev[--t],e.prev[t]=i>=f?i-f:0}while(--r);s+=f}if(0===e.strm.avail_in)break;if(u=e.strm,l=e.window,c=e.strstart+e.lookahead,p=s,h=void 0,(h=u.avail_in)>p&&(h=p),r=0===h?0:(u.avail_in-=h,n.arraySet(l,u.input,u.next_in,h,c),1===u.state.wrap?u.adler=o(u.adler,l,h,c):2===u.state.wrap&&(u.adler=a(u.adler,l,h,c)),u.next_in+=h,u.total_in+=h,h),e.lookahead+=r,e.lookahead+e.insert>=E)for(d=e.strstart-e.insert,e.ins_h=e.window[d],e.ins_h=(e.ins_h<<e.hash_shift^e.window[d+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[d+E-1])&e.hash_mask,e.prev[d&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=d,d++,e.insert--,!(e.lookahead+e.insert<E)););}while(e.lookahead<A&&0!==e.strm.avail_in)}function H(e,t){for(var r,i;;){if(e.lookahead<A){if(z(e),e.lookahead<A&&t===u)return x;if(0===e.lookahead)break}if(r=0,e.lookahead>=E&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+E-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-A&&(e.match_length=U(e,r)),e.match_length>=E)if(i=s._tr_tally(e,e.strstart-e.match_start,e.match_length-E),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=E){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+E-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else i=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(L(e,!1),0===e.strm.avail_out))return x}return e.insert=e.strstart<E-1?e.strstart:E-1,t===l?(L(e,!0),0===e.strm.avail_out?C:P):e.last_lit&&(L(e,!1),0===e.strm.avail_out)?x:k}function G(e,t){for(var r,i,n;;){if(e.lookahead<A){if(z(e),e.lookahead<A&&t===u)return x;if(0===e.lookahead)break}if(r=0,e.lookahead>=E&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+E-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=E-1,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-A&&(e.match_length=U(e,r),e.match_length<=5&&(1===e.strategy||e.match_length===E&&e.strstart-e.match_start>4096)&&(e.match_length=E-1)),e.prev_length>=E&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-E,i=s._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-E),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=n&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+E-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=E-1,e.strstart++,i&&(L(e,!1),0===e.strm.avail_out))return x}else if(e.match_available){if((i=s._tr_tally(e,0,e.window[e.strstart-1]))&&L(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return x}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(i=s._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<E-1?e.strstart:E-1,t===l?(L(e,!0),0===e.strm.avail_out?C:P):e.last_lit&&(L(e,!1),0===e.strm.avail_out)?x:k}function K(e,t,r,i,n){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=i,this.func=n}function W(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=g,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new n.Buf16(2*w),this.dyn_dtree=new n.Buf16(2*(2*b+1)),this.bl_tree=new n.Buf16(2*(2*_+1)),B(this.dyn_ltree),B(this.dyn_dtree),B(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new n.Buf16(T+1),this.heap=new n.Buf16(2*v+1),B(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new n.Buf16(2*v+1),B(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function V(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=y,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?R:I,e.adler=2===t.wrap?0:1,t.last_flush=u,s._tr_init(t),c):D(e,p)}function $(e){var t,r=V(e);return r===c&&((t=e.state).window_size=2*t.w_size,B(t.head),t.max_lazy_match=i[t.level].max_lazy,t.good_match=i[t.level].good_length,t.nice_match=i[t.level].nice_length,t.max_chain_length=i[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=E-1,t.match_available=0,t.ins_h=0),r}function Z(e,t,r,i,s,o){if(!e)return p;var a=1;if(t===h&&(t=6),i<0?(a=0,i=-i):i>15&&(a=2,i-=16),s<1||s>m||r!==g||i<8||i>15||t<0||t>9||o<0||o>f)return D(e,p);8===i&&(i=9);var d=new W;return e.state=d,d.strm=e,d.wrap=a,d.gzhead=null,d.w_bits=i,d.w_size=1<<d.w_bits,d.w_mask=d.w_size-1,d.hash_bits=s+7,d.hash_size=1<<d.hash_bits,d.hash_mask=d.hash_size-1,d.hash_shift=~~((d.hash_bits+E-1)/E),d.window=new n.Buf8(2*d.w_size),d.head=new n.Buf16(d.hash_size),d.prev=new n.Buf16(d.w_size),d.lit_bufsize=1<<s+6,d.pending_buf_size=4*d.lit_bufsize,d.pending_buf=new n.Buf8(d.pending_buf_size),d.d_buf=1*d.lit_bufsize,d.l_buf=3*d.lit_bufsize,d.level=t,d.strategy=o,d.method=r,$(e)}i=[new K(0,0,0,0,(function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(z(e),0===e.lookahead&&t===u)return x;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var i=e.block_start+r;if((0===e.strstart||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,L(e,!1),0===e.strm.avail_out))return x;if(e.strstart-e.block_start>=e.w_size-A&&(L(e,!1),0===e.strm.avail_out))return x}return e.insert=0,t===l?(L(e,!0),0===e.strm.avail_out?C:P):(e.strstart>e.block_start&&(L(e,!1),e.strm.avail_out),x)})),new K(4,4,8,4,H),new K(4,5,16,8,H),new K(4,6,32,32,H),new K(4,4,16,16,G),new K(8,16,32,32,G),new K(8,16,128,128,G),new K(8,32,128,256,G),new K(32,128,258,1024,G),new K(32,258,258,4096,G)],t.deflateInit=function(e,t){return Z(e,t,g,15,8,0)},t.deflateInit2=Z,t.deflateReset=$,t.deflateResetKeep=V,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?p:(e.state.gzhead=t,c):p},t.deflate=function(e,t){var r,n,o,d;if(!e||!e.state||t>5||t<0)return e?D(e,p):p;if(n=e.state,!e.output||!e.input&&0!==e.avail_in||n.status===O&&t!==l)return D(e,0===e.avail_out?-5:p);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===R)if(2===n.wrap)e.adler=0,j(n,31),j(n,139),j(n,8),n.gzhead?(j(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),j(n,255&n.gzhead.time),j(n,n.gzhead.time>>8&255),j(n,n.gzhead.time>>16&255),j(n,n.gzhead.time>>24&255),j(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),j(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(j(n,255&n.gzhead.extra.length),j(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=a(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(j(n,0),j(n,0),j(n,0),j(n,0),j(n,0),j(n,9===n.level?2:n.strategy>=2||n.level<2?4:0),j(n,3),n.status=I);else{var h=g+(n.w_bits-8<<4)<<8;h|=(n.strategy>=2||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(h|=32),h+=31-h%31,n.status=I,F(n,h),0!==n.strstart&&(F(n,e.adler>>>16),F(n,65535&e.adler)),e.adler=1}if(69===n.status)if(n.gzhead.extra){for(o=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>o&&(e.adler=a(e.adler,n.pending_buf,n.pending-o,o)),q(e),o=n.pending,n.pending!==n.pending_buf_size));)j(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(e.adler=a(e.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=a(e.adler,n.pending_buf,n.pending-o,o)),q(e),o=n.pending,n.pending===n.pending_buf_size)){d=1;break}d=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,j(n,d)}while(0!==d);n.gzhead.hcrc&&n.pending>o&&(e.adler=a(e.adler,n.pending_buf,n.pending-o,o)),0===d&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=a(e.adler,n.pending_buf,n.pending-o,o)),q(e),o=n.pending,n.pending===n.pending_buf_size)){d=1;break}d=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,j(n,d)}while(0!==d);n.gzhead.hcrc&&n.pending>o&&(e.adler=a(e.adler,n.pending_buf,n.pending-o,o)),0===d&&(n.status=M)}else n.status=M;if(n.status===M&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&q(e),n.pending+2<=n.pending_buf_size&&(j(n,255&e.adler),j(n,e.adler>>8&255),e.adler=0,n.status=I)):n.status=I),0!==n.pending){if(q(e),0===e.avail_out)return n.last_flush=-1,c}else if(0===e.avail_in&&N(t)<=N(r)&&t!==l)return D(e,-5);if(n.status===O&&0!==e.avail_in)return D(e,-5);if(0!==e.avail_in||0!==n.lookahead||t!==u&&n.status!==O){var f=2===n.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(z(e),0===e.lookahead)){if(t===u)return x;break}if(e.match_length=0,r=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(L(e,!1),0===e.strm.avail_out))return x}return e.insert=0,t===l?(L(e,!0),0===e.strm.avail_out?C:P):e.last_lit&&(L(e,!1),0===e.strm.avail_out)?x:k}(n,t):3===n.strategy?function(e,t){for(var r,i,n,o,a=e.window;;){if(e.lookahead<=S){if(z(e),e.lookahead<=S&&t===u)return x;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=E&&e.strstart>0&&(i=a[n=e.strstart-1])===a[++n]&&i===a[++n]&&i===a[++n]){o=e.strstart+S;do{}while(i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&i===a[++n]&&n<o);e.match_length=S-(o-n),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=E?(r=s._tr_tally(e,1,e.match_length-E),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(L(e,!1),0===e.strm.avail_out))return x}return e.insert=0,t===l?(L(e,!0),0===e.strm.avail_out?C:P):e.last_lit&&(L(e,!1),0===e.strm.avail_out)?x:k}(n,t):i[n.level].func(n,t);if(f!==C&&f!==P||(n.status=O),f===x||f===C)return 0===e.avail_out&&(n.last_flush=-1),c;if(f===k&&(1===t?s._tr_align(n):5!==t&&(s._tr_stored_block(n,0,0,!1),3===t&&(B(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),q(e),0===e.avail_out))return n.last_flush=-1,c}return t!==l?c:n.wrap<=0?1:(2===n.wrap?(j(n,255&e.adler),j(n,e.adler>>8&255),j(n,e.adler>>16&255),j(n,e.adler>>24&255),j(n,255&e.total_in),j(n,e.total_in>>8&255),j(n,e.total_in>>16&255),j(n,e.total_in>>24&255)):(F(n,e.adler>>>16),F(n,65535&e.adler)),q(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?c:1)},t.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==R&&69!==t&&73!==t&&91!==t&&t!==M&&t!==I&&t!==O?D(e,p):(e.state=null,t===I?D(e,-3):c):p},t.deflateSetDictionary=function(e,t){var r,i,s,a,d,u,l,h,f=t.length;if(!e||!e.state)return p;if(2===(a=(r=e.state).wrap)||1===a&&r.status!==R||r.lookahead)return p;for(1===a&&(e.adler=o(e.adler,t,f,0)),r.wrap=0,f>=r.w_size&&(0===a&&(B(r.head),r.strstart=0,r.block_start=0,r.insert=0),h=new n.Buf8(r.w_size),n.arraySet(h,t,f-r.w_size,r.w_size,0),t=h,f=r.w_size),d=e.avail_in,u=e.next_in,l=e.input,e.avail_in=f,e.next_in=0,e.input=t,z(r);r.lookahead>=E;){i=r.strstart,s=r.lookahead-(E-1);do{r.ins_h=(r.ins_h<<r.hash_shift^r.window[i+E-1])&r.hash_mask,r.prev[i&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=i,i++}while(--s);r.strstart=i,r.lookahead=E-1,z(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=E-1,r.match_available=0,e.next_in=u,e.input=l,e.avail_in=d,r.wrap=a,c},t.deflateInfo="pako deflate (from Nodeca project)"},6153:e=>{"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},2128:e=>{"use strict";e.exports=function(e,t){var r,i,n,s,o,a,d,u,l,c,p,h,f,y,g,m,v,b,_,w,T,E,S,A,R;r=e.state,i=e.next_in,A=e.input,n=i+(e.avail_in-5),s=e.next_out,R=e.output,o=s-(t-e.avail_out),a=s+(e.avail_out-257),d=r.dmax,u=r.wsize,l=r.whave,c=r.wnext,p=r.window,h=r.hold,f=r.bits,y=r.lencode,g=r.distcode,m=(1<<r.lenbits)-1,v=(1<<r.distbits)-1;e:do{f<15&&(h+=A[i++]<<f,f+=8,h+=A[i++]<<f,f+=8),b=y[h&m];t:for(;;){if(h>>>=_=b>>>24,f-=_,0===(_=b>>>16&255))R[s++]=65535&b;else{if(!(16&_)){if(0==(64&_)){b=y[(65535&b)+(h&(1<<_)-1)];continue t}if(32&_){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}w=65535&b,(_&=15)&&(f<_&&(h+=A[i++]<<f,f+=8),w+=h&(1<<_)-1,h>>>=_,f-=_),f<15&&(h+=A[i++]<<f,f+=8,h+=A[i++]<<f,f+=8),b=g[h&v];r:for(;;){if(h>>>=_=b>>>24,f-=_,!(16&(_=b>>>16&255))){if(0==(64&_)){b=g[(65535&b)+(h&(1<<_)-1)];continue r}e.msg="invalid distance code",r.mode=30;break e}if(T=65535&b,f<(_&=15)&&(h+=A[i++]<<f,(f+=8)<_&&(h+=A[i++]<<f,f+=8)),(T+=h&(1<<_)-1)>d){e.msg="invalid distance too far back",r.mode=30;break e}if(h>>>=_,f-=_,T>(_=s-o)){if((_=T-_)>l&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(E=0,S=p,0===c){if(E+=u-_,_<w){w-=_;do{R[s++]=p[E++]}while(--_);E=s-T,S=R}}else if(c<_){if(E+=u+c-_,(_-=c)<w){w-=_;do{R[s++]=p[E++]}while(--_);if(E=0,c<w){w-=_=c;do{R[s++]=p[E++]}while(--_);E=s-T,S=R}}}else if(E+=c-_,_<w){w-=_;do{R[s++]=p[E++]}while(--_);E=s-T,S=R}for(;w>2;)R[s++]=S[E++],R[s++]=S[E++],R[s++]=S[E++],w-=3;w&&(R[s++]=S[E++],w>1&&(R[s++]=S[E++]))}else{E=s-T;do{R[s++]=R[E++],R[s++]=R[E++],R[s++]=R[E++],w-=3}while(w>2);w&&(R[s++]=R[E++],w>1&&(R[s++]=R[E++]))}break}}break}}while(i<n&&s<a);i-=w=f>>3,h&=(1<<(f-=w<<3))-1,e.next_in=i,e.next_out=s,e.avail_in=i<n?n-i+5:5-(i-n),e.avail_out=s<a?a-s+257:257-(s-a),r.hold=h,r.bits=f}},8142:(e,t,r)=>{"use strict";var i=r(1824),n=r(6904),s=r(2506),o=r(2128),a=r(9673),d=1,u=2,l=0,c=-2,p=1,h=12,f=30,y=852,g=592;function m(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function v(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function b(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=p,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new i.Buf32(y),t.distcode=t.distdyn=new i.Buf32(g),t.sane=1,t.back=-1,l):c}function _(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,b(e)):c}function w(e,t){var r,i;return e&&e.state?(i=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?c:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=r,i.wbits=t,_(e))):c}function T(e,t){var r,i;return e?(i=new v,e.state=i,i.window=null,(r=w(e,t))!==l&&(e.state=null),r):c}var E,S,A=!0;function R(e){if(A){var t;for(E=new i.Buf32(512),S=new i.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(a(d,e.lens,0,288,E,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;a(u,e.lens,0,32,S,0,e.work,{bits:5}),A=!1}e.lencode=E,e.lenbits=9,e.distcode=S,e.distbits=5}function M(e,t,r,n){var s,o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new i.Buf8(o.wsize)),n>=o.wsize?(i.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((s=o.wsize-o.wnext)>n&&(s=n),i.arraySet(o.window,t,r-n,s,o.wnext),(n-=s)?(i.arraySet(o.window,t,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=s,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=s))),0}t.inflateReset=_,t.inflateReset2=w,t.inflateResetKeep=b,t.inflateInit=function(e){return T(e,15)},t.inflateInit2=T,t.inflate=function(e,t){var r,y,g,v,b,_,w,T,E,S,A,I,O,x,k,C,P,D,N,B,q,L,j,F,U=0,z=new i.Buf8(4),H=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return c;(r=e.state).mode===h&&(r.mode=13),b=e.next_out,g=e.output,w=e.avail_out,v=e.next_in,y=e.input,_=e.avail_in,T=r.hold,E=r.bits,S=_,A=w,L=l;e:for(;;)switch(r.mode){case p:if(0===r.wrap){r.mode=13;break}for(;E<16;){if(0===_)break e;_--,T+=y[v++]<<E,E+=8}if(2&r.wrap&&35615===T){r.check=0,z[0]=255&T,z[1]=T>>>8&255,r.check=s(r.check,z,2,0),T=0,E=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&T)<<8)+(T>>8))%31){e.msg="incorrect header check",r.mode=f;break}if(8!=(15&T)){e.msg="unknown compression method",r.mode=f;break}if(E-=4,q=8+(15&(T>>>=4)),0===r.wbits)r.wbits=q;else if(q>r.wbits){e.msg="invalid window size",r.mode=f;break}r.dmax=1<<q,e.adler=r.check=1,r.mode=512&T?10:h,T=0,E=0;break;case 2:for(;E<16;){if(0===_)break e;_--,T+=y[v++]<<E,E+=8}if(r.flags=T,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=f;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=f;break}r.head&&(r.head.text=T>>8&1),512&r.flags&&(z[0]=255&T,z[1]=T>>>8&255,r.check=s(r.check,z,2,0)),T=0,E=0,r.mode=3;case 3:for(;E<32;){if(0===_)break e;_--,T+=y[v++]<<E,E+=8}r.head&&(r.head.time=T),512&r.flags&&(z[0]=255&T,z[1]=T>>>8&255,z[2]=T>>>16&255,z[3]=T>>>24&255,r.check=s(r.check,z,4,0)),T=0,E=0,r.mode=4;case 4:for(;E<16;){if(0===_)break e;_--,T+=y[v++]<<E,E+=8}r.head&&(r.head.xflags=255&T,r.head.os=T>>8),512&r.flags&&(z[0]=255&T,z[1]=T>>>8&255,r.check=s(r.check,z,2,0)),T=0,E=0,r.mode=5;case 5:if(1024&r.flags){for(;E<16;){if(0===_)break e;_--,T+=y[v++]<<E,E+=8}r.length=T,r.head&&(r.head.extra_len=T),512&r.flags&&(z[0]=255&T,z[1]=T>>>8&255,r.check=s(r.check,z,2,0)),T=0,E=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((I=r.length)>_&&(I=_),I&&(r.head&&(q=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),i.arraySet(r.head.extra,y,v,I,q)),512&r.flags&&(r.check=s(r.check,y,I,v)),_-=I,v+=I,r.length-=I),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===_)break e;I=0;do{q=y[v+I++],r.head&&q&&r.length<65536&&(r.head.name+=String.fromCharCode(q))}while(q&&I<_);if(512&r.flags&&(r.check=s(r.check,y,I,v)),_-=I,v+=I,q)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===_)break e;I=0;do{q=y[v+I++],r.head&&q&&r.length<65536&&(r.head.comment+=String.fromCharCode(q))}while(q&&I<_);if(512&r.flags&&(r.check=s(r.check,y,I,v)),_-=I,v+=I,q)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;E<16;){if(0===_)break e;_--,T+=y[v++]<<E,E+=8}if(T!==(65535&r.check)){e.msg="header crc mismatch",r.mode=f;break}T=0,E=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=h;break;case 10:for(;E<32;){if(0===_)break e;_--,T+=y[v++]<<E,E+=8}e.adler=r.check=m(T),T=0,E=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=b,e.avail_out=w,e.next_in=v,e.avail_in=_,r.hold=T,r.bits=E,2;e.adler=r.check=1,r.mode=h;case h:if(5===t||6===t)break e;case 13:if(r.last){T>>>=7&E,E-=7&E,r.mode=27;break}for(;E<3;){if(0===_)break e;_--,T+=y[v++]<<E,E+=8}switch(r.last=1&T,E-=1,3&(T>>>=1)){case 0:r.mode=14;break;case 1:if(R(r),r.mode=20,6===t){T>>>=2,E-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=f}T>>>=2,E-=2;break;case 14:for(T>>>=7&E,E-=7&E;E<32;){if(0===_)break e;_--,T+=y[v++]<<E,E+=8}if((65535&T)!=(T>>>16^65535)){e.msg="invalid stored block lengths",r.mode=f;break}if(r.length=65535&T,T=0,E=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(I=r.length){if(I>_&&(I=_),I>w&&(I=w),0===I)break e;i.arraySet(g,y,v,I,b),_-=I,v+=I,w-=I,b+=I,r.length-=I;break}r.mode=h;break;case 17:for(;E<14;){if(0===_)break e;_--,T+=y[v++]<<E,E+=8}if(r.nlen=257+(31&T),T>>>=5,E-=5,r.ndist=1+(31&T),T>>>=5,E-=5,r.ncode=4+(15&T),T>>>=4,E-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=f;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;E<3;){if(0===_)break e;_--,T+=y[v++]<<E,E+=8}r.lens[H[r.have++]]=7&T,T>>>=3,E-=3}for(;r.have<19;)r.lens[H[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,j={bits:r.lenbits},L=a(0,r.lens,0,19,r.lencode,0,r.work,j),r.lenbits=j.bits,L){e.msg="invalid code lengths set",r.mode=f;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;C=(U=r.lencode[T&(1<<r.lenbits)-1])>>>16&255,P=65535&U,!((k=U>>>24)<=E);){if(0===_)break e;_--,T+=y[v++]<<E,E+=8}if(P<16)T>>>=k,E-=k,r.lens[r.have++]=P;else{if(16===P){for(F=k+2;E<F;){if(0===_)break e;_--,T+=y[v++]<<E,E+=8}if(T>>>=k,E-=k,0===r.have){e.msg="invalid bit length repeat",r.mode=f;break}q=r.lens[r.have-1],I=3+(3&T),T>>>=2,E-=2}else if(17===P){for(F=k+3;E<F;){if(0===_)break e;_--,T+=y[v++]<<E,E+=8}E-=k,q=0,I=3+(7&(T>>>=k)),T>>>=3,E-=3}else{for(F=k+7;E<F;){if(0===_)break e;_--,T+=y[v++]<<E,E+=8}E-=k,q=0,I=11+(127&(T>>>=k)),T>>>=7,E-=7}if(r.have+I>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=f;break}for(;I--;)r.lens[r.have++]=q}}if(r.mode===f)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=f;break}if(r.lenbits=9,j={bits:r.lenbits},L=a(d,r.lens,0,r.nlen,r.lencode,0,r.work,j),r.lenbits=j.bits,L){e.msg="invalid literal/lengths set",r.mode=f;break}if(r.distbits=6,r.distcode=r.distdyn,j={bits:r.distbits},L=a(u,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,j),r.distbits=j.bits,L){e.msg="invalid distances set",r.mode=f;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(_>=6&&w>=258){e.next_out=b,e.avail_out=w,e.next_in=v,e.avail_in=_,r.hold=T,r.bits=E,o(e,A),b=e.next_out,g=e.output,w=e.avail_out,v=e.next_in,y=e.input,_=e.avail_in,T=r.hold,E=r.bits,r.mode===h&&(r.back=-1);break}for(r.back=0;C=(U=r.lencode[T&(1<<r.lenbits)-1])>>>16&255,P=65535&U,!((k=U>>>24)<=E);){if(0===_)break e;_--,T+=y[v++]<<E,E+=8}if(C&&0==(240&C)){for(D=k,N=C,B=P;C=(U=r.lencode[B+((T&(1<<D+N)-1)>>D)])>>>16&255,P=65535&U,!(D+(k=U>>>24)<=E);){if(0===_)break e;_--,T+=y[v++]<<E,E+=8}T>>>=D,E-=D,r.back+=D}if(T>>>=k,E-=k,r.back+=k,r.length=P,0===C){r.mode=26;break}if(32&C){r.back=-1,r.mode=h;break}if(64&C){e.msg="invalid literal/length code",r.mode=f;break}r.extra=15&C,r.mode=22;case 22:if(r.extra){for(F=r.extra;E<F;){if(0===_)break e;_--,T+=y[v++]<<E,E+=8}r.length+=T&(1<<r.extra)-1,T>>>=r.extra,E-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;C=(U=r.distcode[T&(1<<r.distbits)-1])>>>16&255,P=65535&U,!((k=U>>>24)<=E);){if(0===_)break e;_--,T+=y[v++]<<E,E+=8}if(0==(240&C)){for(D=k,N=C,B=P;C=(U=r.distcode[B+((T&(1<<D+N)-1)>>D)])>>>16&255,P=65535&U,!(D+(k=U>>>24)<=E);){if(0===_)break e;_--,T+=y[v++]<<E,E+=8}T>>>=D,E-=D,r.back+=D}if(T>>>=k,E-=k,r.back+=k,64&C){e.msg="invalid distance code",r.mode=f;break}r.offset=P,r.extra=15&C,r.mode=24;case 24:if(r.extra){for(F=r.extra;E<F;){if(0===_)break e;_--,T+=y[v++]<<E,E+=8}r.offset+=T&(1<<r.extra)-1,T>>>=r.extra,E-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=f;break}r.mode=25;case 25:if(0===w)break e;if(I=A-w,r.offset>I){if((I=r.offset-I)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=f;break}I>r.wnext?(I-=r.wnext,O=r.wsize-I):O=r.wnext-I,I>r.length&&(I=r.length),x=r.window}else x=g,O=b-r.offset,I=r.length;I>w&&(I=w),w-=I,r.length-=I;do{g[b++]=x[O++]}while(--I);0===r.length&&(r.mode=21);break;case 26:if(0===w)break e;g[b++]=r.length,w--,r.mode=21;break;case 27:if(r.wrap){for(;E<32;){if(0===_)break e;_--,T|=y[v++]<<E,E+=8}if(A-=w,e.total_out+=A,r.total+=A,A&&(e.adler=r.check=r.flags?s(r.check,g,A,b-A):n(r.check,g,A,b-A)),A=w,(r.flags?T:m(T))!==r.check){e.msg="incorrect data check",r.mode=f;break}T=0,E=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;E<32;){if(0===_)break e;_--,T+=y[v++]<<E,E+=8}if(T!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=f;break}T=0,E=0}r.mode=29;case 29:L=1;break e;case f:L=-3;break e;case 31:return-4;default:return c}return e.next_out=b,e.avail_out=w,e.next_in=v,e.avail_in=_,r.hold=T,r.bits=E,(r.wsize||A!==e.avail_out&&r.mode<f&&(r.mode<27||4!==t))&&M(e,e.output,e.next_out,A-e.avail_out)?(r.mode=31,-4):(S-=e.avail_in,A-=e.avail_out,e.total_in+=S,e.total_out+=A,r.total+=A,r.wrap&&A&&(e.adler=r.check=r.flags?s(r.check,g,A,e.next_out-A):n(r.check,g,A,e.next_out-A)),e.data_type=r.bits+(r.last?64:0)+(r.mode===h?128:0)+(20===r.mode||15===r.mode?256:0),(0===S&&0===A||4===t)&&L===l&&(L=-5),L)},t.inflateEnd=function(e){if(!e||!e.state)return c;var t=e.state;return t.window&&(t.window=null),e.state=null,l},t.inflateGetHeader=function(e,t){var r;return e&&e.state?0==(2&(r=e.state).wrap)?c:(r.head=t,t.done=!1,l):c},t.inflateSetDictionary=function(e,t){var r,i=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?c:11===r.mode&&n(1,t,i,0)!==r.check?-3:M(e,t,i,i)?(r.mode=31,-4):(r.havedict=1,l):c},t.inflateInfo="pako inflate (from Nodeca project)"},9673:(e,t,r)=>{"use strict";var i=r(1824),n=15,s=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],d=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(e,t,r,u,l,c,p,h){var f,y,g,m,v,b,_,w,T,E=h.bits,S=0,A=0,R=0,M=0,I=0,O=0,x=0,k=0,C=0,P=0,D=null,N=0,B=new i.Buf16(16),q=new i.Buf16(16),L=null,j=0;for(S=0;S<=n;S++)B[S]=0;for(A=0;A<u;A++)B[t[r+A]]++;for(I=E,M=n;M>=1&&0===B[M];M--);if(I>M&&(I=M),0===M)return l[c++]=20971520,l[c++]=20971520,h.bits=1,0;for(R=1;R<M&&0===B[R];R++);for(I<R&&(I=R),k=1,S=1;S<=n;S++)if(k<<=1,(k-=B[S])<0)return-1;if(k>0&&(0===e||1!==M))return-1;for(q[1]=0,S=1;S<n;S++)q[S+1]=q[S]+B[S];for(A=0;A<u;A++)0!==t[r+A]&&(p[q[t[r+A]]++]=A);if(0===e?(D=L=p,b=19):1===e?(D=s,N-=257,L=o,j-=257,b=256):(D=a,L=d,b=-1),P=0,A=0,S=R,v=c,O=I,x=0,g=-1,m=(C=1<<I)-1,1===e&&C>852||2===e&&C>592)return 1;for(;;){_=S-x,p[A]<b?(w=0,T=p[A]):p[A]>b?(w=L[j+p[A]],T=D[N+p[A]]):(w=96,T=0),f=1<<S-x,R=y=1<<O;do{l[v+(P>>x)+(y-=f)]=_<<24|w<<16|T|0}while(0!==y);for(f=1<<S-1;P&f;)f>>=1;if(0!==f?(P&=f-1,P+=f):P=0,A++,0==--B[S]){if(S===M)break;S=t[r+p[A]]}if(S>I&&(P&m)!==g){for(0===x&&(x=I),v+=R,k=1<<(O=S-x);O+x<M&&!((k-=B[O+x])<=0);)O++,k<<=1;if(C+=1<<O,1===e&&C>852||2===e&&C>592)return 1;l[g=P&m]=I<<24|O<<16|v-c|0}}return 0!==P&&(l[v+P]=S-x<<24|64<<16|0),h.bits=I,0}},2817:e=>{"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},9708:(e,t,r)=>{"use strict";var i=r(1824),n=0,s=1;function o(e){for(var t=e.length;--t>=0;)e[t]=0}var a=0,d=29,u=256,l=u+1+d,c=30,p=19,h=2*l+1,f=15,y=16,g=7,m=256,v=16,b=17,_=18,w=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],T=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],E=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],S=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],A=new Array(2*(l+2));o(A);var R=new Array(2*c);o(R);var M=new Array(512);o(M);var I=new Array(256);o(I);var O=new Array(d);o(O);var x,k,C,P=new Array(c);function D(e,t,r,i,n){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=e&&e.length}function N(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function B(e){return e<256?M[e]:M[256+(e>>>7)]}function q(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function L(e,t,r){e.bi_valid>y-r?(e.bi_buf|=t<<e.bi_valid&65535,q(e,e.bi_buf),e.bi_buf=t>>y-e.bi_valid,e.bi_valid+=r-y):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function j(e,t,r){L(e,r[2*t],r[2*t+1])}function F(e,t){var r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1}function U(e,t,r){var i,n,s=new Array(f+1),o=0;for(i=1;i<=f;i++)s[i]=o=o+r[i-1]<<1;for(n=0;n<=t;n++){var a=e[2*n+1];0!==a&&(e[2*n]=F(s[a]++,a))}}function z(e){var t;for(t=0;t<l;t++)e.dyn_ltree[2*t]=0;for(t=0;t<c;t++)e.dyn_dtree[2*t]=0;for(t=0;t<p;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*m]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function H(e){e.bi_valid>8?q(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function G(e,t,r,i){var n=2*t,s=2*r;return e[n]<e[s]||e[n]===e[s]&&i[t]<=i[r]}function K(e,t,r){for(var i=e.heap[r],n=r<<1;n<=e.heap_len&&(n<e.heap_len&&G(t,e.heap[n+1],e.heap[n],e.depth)&&n++,!G(t,i,e.heap[n],e.depth));)e.heap[r]=e.heap[n],r=n,n<<=1;e.heap[r]=i}function W(e,t,r){var i,n,s,o,a=0;if(0!==e.last_lit)do{i=e.pending_buf[e.d_buf+2*a]<<8|e.pending_buf[e.d_buf+2*a+1],n=e.pending_buf[e.l_buf+a],a++,0===i?j(e,n,t):(j(e,(s=I[n])+u+1,t),0!==(o=w[s])&&L(e,n-=O[s],o),j(e,s=B(--i),r),0!==(o=T[s])&&L(e,i-=P[s],o))}while(a<e.last_lit);j(e,m,t)}function V(e,t){var r,i,n,s=t.dyn_tree,o=t.stat_desc.static_tree,a=t.stat_desc.has_stree,d=t.stat_desc.elems,u=-1;for(e.heap_len=0,e.heap_max=h,r=0;r<d;r++)0!==s[2*r]?(e.heap[++e.heap_len]=u=r,e.depth[r]=0):s[2*r+1]=0;for(;e.heap_len<2;)s[2*(n=e.heap[++e.heap_len]=u<2?++u:0)]=1,e.depth[n]=0,e.opt_len--,a&&(e.static_len-=o[2*n+1]);for(t.max_code=u,r=e.heap_len>>1;r>=1;r--)K(e,s,r);n=d;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],K(e,s,1),i=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=i,s[2*n]=s[2*r]+s[2*i],e.depth[n]=(e.depth[r]>=e.depth[i]?e.depth[r]:e.depth[i])+1,s[2*r+1]=s[2*i+1]=n,e.heap[1]=n++,K(e,s,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,i,n,s,o,a,d=t.dyn_tree,u=t.max_code,l=t.stat_desc.static_tree,c=t.stat_desc.has_stree,p=t.stat_desc.extra_bits,y=t.stat_desc.extra_base,g=t.stat_desc.max_length,m=0;for(s=0;s<=f;s++)e.bl_count[s]=0;for(d[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<h;r++)(s=d[2*d[2*(i=e.heap[r])+1]+1]+1)>g&&(s=g,m++),d[2*i+1]=s,i>u||(e.bl_count[s]++,o=0,i>=y&&(o=p[i-y]),a=d[2*i],e.opt_len+=a*(s+o),c&&(e.static_len+=a*(l[2*i+1]+o)));if(0!==m){do{for(s=g-1;0===e.bl_count[s];)s--;e.bl_count[s]--,e.bl_count[s+1]+=2,e.bl_count[g]--,m-=2}while(m>0);for(s=g;0!==s;s--)for(i=e.bl_count[s];0!==i;)(n=e.heap[--r])>u||(d[2*n+1]!==s&&(e.opt_len+=(s-d[2*n+1])*d[2*n],d[2*n+1]=s),i--)}}(e,t),U(s,u,e.bl_count)}function $(e,t,r){var i,n,s=-1,o=t[1],a=0,d=7,u=4;for(0===o&&(d=138,u=3),t[2*(r+1)+1]=65535,i=0;i<=r;i++)n=o,o=t[2*(i+1)+1],++a<d&&n===o||(a<u?e.bl_tree[2*n]+=a:0!==n?(n!==s&&e.bl_tree[2*n]++,e.bl_tree[2*v]++):a<=10?e.bl_tree[2*b]++:e.bl_tree[2*_]++,a=0,s=n,0===o?(d=138,u=3):n===o?(d=6,u=3):(d=7,u=4))}function Z(e,t,r){var i,n,s=-1,o=t[1],a=0,d=7,u=4;for(0===o&&(d=138,u=3),i=0;i<=r;i++)if(n=o,o=t[2*(i+1)+1],!(++a<d&&n===o)){if(a<u)do{j(e,n,e.bl_tree)}while(0!=--a);else 0!==n?(n!==s&&(j(e,n,e.bl_tree),a--),j(e,v,e.bl_tree),L(e,a-3,2)):a<=10?(j(e,b,e.bl_tree),L(e,a-3,3)):(j(e,_,e.bl_tree),L(e,a-11,7));a=0,s=n,0===o?(d=138,u=3):n===o?(d=6,u=3):(d=7,u=4)}}o(P);var Y=!1;function J(e,t,r,n){L(e,(a<<1)+(n?1:0),3),function(e,t,r,n){H(e),n&&(q(e,r),q(e,~r)),i.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}(e,t,r,!0)}t._tr_init=function(e){Y||(!function(){var e,t,r,i,n,s=new Array(f+1);for(r=0,i=0;i<d-1;i++)for(O[i]=r,e=0;e<1<<w[i];e++)I[r++]=i;for(I[r-1]=i,n=0,i=0;i<16;i++)for(P[i]=n,e=0;e<1<<T[i];e++)M[n++]=i;for(n>>=7;i<c;i++)for(P[i]=n<<7,e=0;e<1<<T[i]-7;e++)M[256+n++]=i;for(t=0;t<=f;t++)s[t]=0;for(e=0;e<=143;)A[2*e+1]=8,e++,s[8]++;for(;e<=255;)A[2*e+1]=9,e++,s[9]++;for(;e<=279;)A[2*e+1]=7,e++,s[7]++;for(;e<=287;)A[2*e+1]=8,e++,s[8]++;for(U(A,l+1,s),e=0;e<c;e++)R[2*e+1]=5,R[2*e]=F(e,5);x=new D(A,w,u+1,l,f),k=new D(R,T,0,c,f),C=new D(new Array(0),E,0,p,g)}(),Y=!0),e.l_desc=new N(e.dyn_ltree,x),e.d_desc=new N(e.dyn_dtree,k),e.bl_desc=new N(e.bl_tree,C),e.bi_buf=0,e.bi_valid=0,z(e)},t._tr_stored_block=J,t._tr_flush_block=function(e,t,r,i){var o,a,d=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return n;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return s;for(t=32;t<u;t++)if(0!==e.dyn_ltree[2*t])return s;return n}(e)),V(e,e.l_desc),V(e,e.d_desc),d=function(e){var t;for($(e,e.dyn_ltree,e.l_desc.max_code),$(e,e.dyn_dtree,e.d_desc.max_code),V(e,e.bl_desc),t=p-1;t>=3&&0===e.bl_tree[2*S[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),o=e.opt_len+3+7>>>3,(a=e.static_len+3+7>>>3)<=o&&(o=a)):o=a=r+5,r+4<=o&&-1!==t?J(e,t,r,i):4===e.strategy||a===o?(L(e,2+(i?1:0),3),W(e,A,R)):(L(e,4+(i?1:0),3),function(e,t,r,i){var n;for(L(e,t-257,5),L(e,r-1,5),L(e,i-4,4),n=0;n<i;n++)L(e,e.bl_tree[2*S[n]+1],3);Z(e,e.dyn_ltree,t-1),Z(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,d+1),W(e,e.dyn_ltree,e.dyn_dtree)),z(e),i&&H(e)},t._tr_tally=function(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(I[r]+u+1)]++,e.dyn_dtree[2*B(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){L(e,2,3),j(e,m,A),function(e){16===e.bi_valid?(q(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},2495:e=>{"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},9501:e=>{"use strict";e.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},958:(e,t,r)=>{"use strict";e.exports=r(8054)},5931:(e,t,r)=>{"use strict";var i=t,n=r(8118),s=r(8723);function o(e,t,r,i){if(t.resolvedType)if(t.resolvedType instanceof n){e("switch(d%s){",i);for(var s=t.resolvedType.values,o=Object.keys(s),a=0;a<o.length;++a)t.repeated&&s[o[a]]===t.typeDefault&&e("default:"),e("case%j:",o[a])("case %i:",s[o[a]])("m%s=%j",i,s[o[a]])("break");e("}")}else e('if(typeof d%s!=="object")',i)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",i,r,i);else{var d=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",i,i);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",i,i);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",i,i);break;case"uint64":d=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",i,i,d)('else if(typeof d%s==="string")',i)("m%s=parseInt(d%s,10)",i,i)('else if(typeof d%s==="number")',i)("m%s=d%s",i,i)('else if(typeof d%s==="object")',i)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",i,i,i,d?"true":"");break;case"bytes":e('if(typeof d%s==="string")',i)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",i,i,i)("else if(d%s.length)",i)("m%s=d%s",i,i);break;case"string":e("m%s=String(d%s)",i,i);break;case"bool":e("m%s=Boolean(d%s)",i,i)}}return e}function a(e,t,r,i){if(t.resolvedType)t.resolvedType instanceof n?e("d%s=o.enums===String?types[%i].values[m%s]:m%s",i,r,i,i):e("d%s=types[%i].toObject(m%s,o)",i,r,i);else{var s=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",i,i,i,i);break;case"uint64":s=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',i)("d%s=o.longs===String?String(m%s):m%s",i,i,i)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",i,i,i,i,s?"true":"",i);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",i,i,i,i,i);break;default:e("d%s=m%s",i,i)}}return e}i.fromObject=function(e){var t=e.fieldsArray,r=s.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return r("return new this.ctor");r("var m=new this.ctor");for(var i=0;i<t.length;++i){var a=t[i].resolve(),d=s.safeProp(a.name);a.map?(r("if(d%s){",d)('if(typeof d%s!=="object")',d)("throw TypeError(%j)",a.fullName+": object expected")("m%s={}",d)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",d),o(r,a,i,d+"[ks[i]]")("}")("}")):a.repeated?(r("if(d%s){",d)("if(!Array.isArray(d%s))",d)("throw TypeError(%j)",a.fullName+": array expected")("m%s=[]",d)("for(var i=0;i<d%s.length;++i){",d),o(r,a,i,d+"[i]")("}")("}")):(a.resolvedType instanceof n||r("if(d%s!=null){",d),o(r,a,i,d),a.resolvedType instanceof n||r("}"))}return r("return m")},i.toObject=function(e){var t=e.fieldsArray.slice().sort(s.compareFieldsById);if(!t.length)return s.codegen()("return {}");for(var r=s.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),i=[],o=[],d=[],u=0;u<t.length;++u)t[u].partOf||(t[u].resolve().repeated?i:t[u].map?o:d).push(t[u]);if(i.length){for(r("if(o.arrays||o.defaults){"),u=0;u<i.length;++u)r("d%s=[]",s.safeProp(i[u].name));r("}")}if(o.length){for(r("if(o.objects||o.defaults){"),u=0;u<o.length;++u)r("d%s={}",s.safeProp(o[u].name));r("}")}if(d.length){for(r("if(o.defaults){"),u=0;u<d.length;++u){var l=d[u],c=s.safeProp(l.name);if(l.resolvedType instanceof n)r("d%s=o.enums===String?%j:%j",c,l.resolvedType.valuesById[l.typeDefault],l.typeDefault);else if(l.long)r("if(util.Long){")("var n=new util.Long(%i,%i,%j)",l.typeDefault.low,l.typeDefault.high,l.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",c)("}else")("d%s=o.longs===String?%j:%i",c,l.typeDefault.toString(),l.typeDefault.toNumber());else if(l.bytes){var p="["+Array.prototype.slice.call(l.typeDefault).join(",")+"]";r("if(o.bytes===String)d%s=%j",c,String.fromCharCode.apply(String,l.typeDefault))("else{")("d%s=%s",c,p)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",c,c)("}")}else r("d%s=%j",c,l.typeDefault)}r("}")}var h=!1;for(u=0;u<t.length;++u){l=t[u];var f=e._fieldsArray.indexOf(l);c=s.safeProp(l.name);l.map?(h||(h=!0,r("var ks2")),r("if(m%s&&(ks2=Object.keys(m%s)).length){",c,c)("d%s={}",c)("for(var j=0;j<ks2.length;++j){"),a(r,l,f,c+"[ks2[j]]")("}")):l.repeated?(r("if(m%s&&m%s.length){",c,c)("d%s=[]",c)("for(var j=0;j<m%s.length;++j){",c),a(r,l,f,c+"[j]")("}")):(r("if(m%s!=null&&m.hasOwnProperty(%j)){",c,l.name),a(r,l,f,c),l.partOf&&r("if(o.oneofs)")("d%s=%j",s.safeProp(l.partOf.name),l.name)),r("}")}return r("return d")}},4455:(e,t,r)=>{"use strict";e.exports=function(e){var t=s.codegen(["r","l"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(e.fieldsArray.filter((function(e){return e.map})).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");e.group&&t("if((t&7)===4)")("break");t("switch(t>>>3){");for(var r=0;r<e.fieldsArray.length;++r){var a=e._fieldsArray[r].resolve(),d=a.resolvedType instanceof i?"int32":a.type,u="m"+s.safeProp(a.name);t("case %i:",a.id),a.map?(t("if(%s===util.emptyObject)",u)("%s={}",u)("var c2 = r.uint32()+r.pos"),void 0!==n.defaults[a.keyType]?t("k=%j",n.defaults[a.keyType]):t("k=null"),void 0!==n.defaults[d]?t("value=%j",n.defaults[d]):t("value=null"),t("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",a.keyType)("case 2:"),void 0===n.basic[d]?t("value=types[%i].decode(r,r.uint32())",r):t("value=r.%s()",d),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==n.long[a.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',u):t("%s[k]=value",u)):a.repeated?(t("if(!(%s&&%s.length))",u,u)("%s=[]",u),void 0!==n.packed[d]&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",u,d)("}else"),void 0===n.basic[d]?t(a.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",u,r):t("%s.push(r.%s())",u,d)):void 0===n.basic[d]?t(a.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",u,r):t("%s=r.%s()",u,d),t("break")}for(t("default:")("r.skipType(t&7)")("break")("}")("}"),r=0;r<e._fieldsArray.length;++r){var l=e._fieldsArray[r];l.required&&t("if(!m.hasOwnProperty(%j))",l.name)("throw util.ProtocolError(%j,{instance:m})",o(l))}return t("return m")};var i=r(8118),n=r(5594),s=r(8723);function o(e){return"missing required '"+e.name+"'"}},7471:(e,t,r)=>{"use strict";e.exports=function(e){for(var t,r=s.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),a=e.fieldsArray.slice().sort(s.compareFieldsById),d=0;d<a.length;++d){var u=a[d].resolve(),l=e._fieldsArray.indexOf(u),c=u.resolvedType instanceof i?"int32":u.type,p=n.basic[c];t="m"+s.safeProp(u.name),u.map?(r("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",t,u.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",t)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(u.id<<3|2)>>>0,8|n.mapKey[u.keyType],u.keyType),void 0===p?r("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",l,t):r(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|p,c,t),r("}")("}")):u.repeated?(r("if(%s!=null&&%s.length){",t,t),u.packed&&void 0!==n.packed[c]?r("w.uint32(%i).fork()",(u.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",c,t)("w.ldelim()"):(r("for(var i=0;i<%s.length;++i)",t),void 0===p?o(r,u,l,t+"[i]"):r("w.uint32(%i).%s(%s[i])",(u.id<<3|p)>>>0,c,t)),r("}")):(u.optional&&r("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,u.name),void 0===p?o(r,u,l,t):r("w.uint32(%i).%s(%s)",(u.id<<3|p)>>>0,c,t))}return r("return w")};var i=r(8118),n=r(5594),s=r(8723);function o(e,t,r,i){return t.resolvedType.group?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",r,i,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,i,(t.id<<3|2)>>>0)}},8118:(e,t,r)=>{"use strict";e.exports=o;var i=r(7812);((o.prototype=Object.create(i.prototype)).constructor=o).className="Enum";var n=r(4060),s=r(8723);function o(e,t,r,n,s){if(i.call(this,e,r),t&&"object"!=typeof t)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=n,this.comments=s||{},this.reserved=void 0,t)for(var o=Object.keys(t),a=0;a<o.length;++a)"number"==typeof t[o[a]]&&(this.valuesById[this.values[o[a]]=t[o[a]]]=o[a])}o.fromJSON=function(e,t){var r=new o(e,t.values,t.options,t.comment,t.comments);return r.reserved=t.reserved,r},o.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return s.toObject(["options",this.options,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},o.prototype.add=function(e,t,r){if(!s.isString(e))throw TypeError("name must be a string");if(!s.isInteger(t))throw TypeError("id must be an integer");if(void 0!==this.values[e])throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(void 0!==this.valuesById[t]){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return this.comments[e]=r||null,this},o.prototype.remove=function(e){if(!s.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(null==t)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this},o.prototype.isReservedId=function(e){return n.isReservedId(this.reserved,e)},o.prototype.isReservedName=function(e){return n.isReservedName(this.reserved,e)}},4243:(e,t,r)=>{"use strict";e.exports=u;var i=r(7812);((u.prototype=Object.create(i.prototype)).constructor=u).className="Field";var n,s=r(8118),o=r(5594),a=r(8723),d=/^required|optional|repeated$/;function u(e,t,r,n,s,u,l){if(a.isObject(n)?(l=s,u=n,n=s=void 0):a.isObject(s)&&(l=u,u=s,s=void 0),i.call(this,e,u),!a.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!a.isString(r))throw TypeError("type must be a string");if(void 0!==n&&!d.test(n=n.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==s&&!a.isString(s))throw TypeError("extend must be a string");"proto3_optional"===n&&(n="optional"),this.rule=n&&"optional"!==n?n:void 0,this.type=r,this.id=t,this.extend=s||void 0,this.required="required"===n,this.optional=!this.required,this.repeated="repeated"===n,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!a.Long&&void 0!==o.long[r],this.bytes="bytes"===r,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=l}u.fromJSON=function(e,t){return new u(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(u.prototype,"packed",{get:function(){return null===this._packed&&(this._packed=!1!==this.getOption("packed")),this._packed}}),u.prototype.setOption=function(e,t,r){return"packed"===e&&(this._packed=null),i.prototype.setOption.call(this,e,t,r)},u.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return a.toObject(["rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},u.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=o.defaults[this.type])&&(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof n?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof s&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(!0!==this.options.packed&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof s)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=a.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"==typeof this.typeDefault){var e;a.base64.test(this.typeDefault)?a.base64.decode(this.typeDefault,e=a.newBuffer(a.base64.length(this.typeDefault)),0):a.utf8.write(this.typeDefault,e=a.newBuffer(a.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=a.emptyObject:this.repeated?this.defaultValue=a.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof n&&(this.parent.ctor.prototype[this.name]=this.defaultValue),i.prototype.resolve.call(this)},u.d=function(e,t,r,i){return"function"==typeof t?t=a.decorateType(t).name:t&&"object"==typeof t&&(t=a.decorateEnum(t).name),function(n,s){a.decorateType(n.constructor).add(new u(s,e,t,r,{default:i}))}},u._configure=function(e){n=e}},8054:(e,t,r)=>{"use strict";var i=e.exports=r(5953);i.build="light",i.load=function(e,t,r){return"function"==typeof t?(r=t,t=new i.Root):t||(t=new i.Root),t.load(e,r)},i.loadSync=function(e,t){return t||(t=new i.Root),t.loadSync(e)},i.encoder=r(7471),i.decoder=r(4455),i.verifier=r(3777),i.converter=r(5931),i.ReflectionObject=r(7812),i.Namespace=r(4060),i.Root=r(7207),i.Enum=r(8118),i.Type=r(1311),i.Field=r(4243),i.OneOf=r(7166),i.MapField=r(4341),i.Service=r(3712),i.Method=r(7082),i.Message=r(9348),i.wrappers=r(1359),i.types=r(5594),i.util=r(8723),i.ReflectionObject._configure(i.Root),i.Namespace._configure(i.Type,i.Service,i.Enum),i.Root._configure(i.Type),i.Field._configure(i.Type)},5953:(e,t,r)=>{"use strict";var i=t;function n(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}i.build="minimal",i.Writer=r(3108),i.BufferWriter=r(2533),i.Reader=r(6344),i.BufferReader=r(2777),i.util=r(5099),i.rpc=r(7080),i.roots=r(4738),i.configure=n,n()},4341:(e,t,r)=>{"use strict";e.exports=o;var i=r(4243);((o.prototype=Object.create(i.prototype)).constructor=o).className="MapField";var n=r(5594),s=r(8723);function o(e,t,r,n,o,a){if(i.call(this,e,t,n,void 0,void 0,o,a),!s.isString(r))throw TypeError("keyType must be a string");this.keyType=r,this.resolvedKeyType=null,this.map=!0}o.fromJSON=function(e,t){return new o(e,t.id,t.keyType,t.type,t.options,t.comment)},o.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return s.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},o.prototype.resolve=function(){if(this.resolved)return this;if(void 0===n.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return i.prototype.resolve.call(this)},o.d=function(e,t,r){return"function"==typeof r?r=s.decorateType(r).name:r&&"object"==typeof r&&(r=s.decorateEnum(r).name),function(i,n){s.decorateType(i.constructor).add(new o(n,e,t,r))}}},9348:(e,t,r)=>{"use strict";e.exports=n;var i=r(5099);function n(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}n.create=function(e){return this.$type.create(e)},n.encode=function(e,t){return this.$type.encode(e,t)},n.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},n.decode=function(e){return this.$type.decode(e)},n.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},n.verify=function(e){return this.$type.verify(e)},n.fromObject=function(e){return this.$type.fromObject(e)},n.toObject=function(e,t){return this.$type.toObject(e,t)},n.prototype.toJSON=function(){return this.$type.toObject(this,i.toJSONOptions)}},7082:(e,t,r)=>{"use strict";e.exports=s;var i=r(7812);((s.prototype=Object.create(i.prototype)).constructor=s).className="Method";var n=r(8723);function s(e,t,r,s,o,a,d,u,l){if(n.isObject(o)?(d=o,o=a=void 0):n.isObject(a)&&(d=a,a=void 0),void 0!==t&&!n.isString(t))throw TypeError("type must be a string");if(!n.isString(r))throw TypeError("requestType must be a string");if(!n.isString(s))throw TypeError("responseType must be a string");i.call(this,e,d),this.type=t||"rpc",this.requestType=r,this.requestStream=!!o||void 0,this.responseType=s,this.responseStream=!!a||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=u,this.parsedOptions=l}s.fromJSON=function(e,t){return new s(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},s.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return n.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0,"parsedOptions",this.parsedOptions])},s.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),i.prototype.resolve.call(this))}},4060:(e,t,r)=>{"use strict";e.exports=c;var i=r(7812);((c.prototype=Object.create(i.prototype)).constructor=c).className="Namespace";var n,s,o,a=r(4243),d=r(7166),u=r(8723);function l(e,t){if(e&&e.length){for(var r={},i=0;i<e.length;++i)r[e[i].name]=e[i].toJSON(t);return r}}function c(e,t){i.call(this,e,t),this.nested=void 0,this._nestedArray=null}function p(e){return e._nestedArray=null,e}c.fromJSON=function(e,t){return new c(e,t.options).addJSON(t.nested)},c.arrayToJSON=l,c.isReservedId=function(e,t){if(e)for(var r=0;r<e.length;++r)if("string"!=typeof e[r]&&e[r][0]<=t&&e[r][1]>t)return!0;return!1},c.isReservedName=function(e,t){if(e)for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1},Object.defineProperty(c.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=u.toArray(this.nested))}}),c.prototype.toJSON=function(e){return u.toObject(["options",this.options,"nested",l(this.nestedArray,e)])},c.prototype.addJSON=function(e){if(e)for(var t,r=Object.keys(e),i=0;i<r.length;++i)t=e[r[i]],this.add((void 0!==t.fields?n.fromJSON:void 0!==t.values?o.fromJSON:void 0!==t.methods?s.fromJSON:void 0!==t.id?a.fromJSON:c.fromJSON)(r[i],t));return this},c.prototype.get=function(e){return this.nested&&this.nested[e]||null},c.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof o)return this.nested[e].values;throw Error("no such enum: "+e)},c.prototype.add=function(e){if(!(e instanceof a&&void 0!==e.extend||e instanceof n||e instanceof o||e instanceof s||e instanceof c||e instanceof d))throw TypeError("object must be a valid nested object");if(this.nested){var t=this.get(e.name);if(t){if(!(t instanceof c&&e instanceof c)||t instanceof n||t instanceof s)throw Error("duplicate name '"+e.name+"' in "+this);for(var r=t.nestedArray,i=0;i<r.length;++i)e.add(r[i]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}}else this.nested={};return this.nested[e.name]=e,e.onAdd(this),p(this)},c.prototype.remove=function(e){if(!(e instanceof i))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),p(this)},c.prototype.define=function(e,t){if(u.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&""===e[0])throw Error("path must be relative");for(var r=this;e.length>0;){var i=e.shift();if(r.nested&&r.nested[i]){if(!((r=r.nested[i])instanceof c))throw Error("path conflicts with non-namespace objects")}else r.add(r=new c(i))}return t&&r.addJSON(t),r},c.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t<e.length;)e[t]instanceof c?e[t++].resolveAll():e[t++].resolve();return this.resolve()},c.prototype.lookup=function(e,t,r){if("boolean"==typeof t?(r=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),u.isString(e)&&e.length){if("."===e)return this.root;e=e.split(".")}else if(!e.length)return this;if(""===e[0])return this.root.lookup(e.slice(1),t);var i=this.get(e[0]);if(i){if(1===e.length){if(!t||t.indexOf(i.constructor)>-1)return i}else if(i instanceof c&&(i=i.lookup(e.slice(1),t,!0)))return i}else for(var n=0;n<this.nestedArray.length;++n)if(this._nestedArray[n]instanceof c&&(i=this._nestedArray[n].lookup(e,t,!0)))return i;return null===this.parent||r?null:this.parent.lookup(e,t)},c.prototype.lookupType=function(e){var t=this.lookup(e,[n]);if(!t)throw Error("no such type: "+e);return t},c.prototype.lookupEnum=function(e){var t=this.lookup(e,[o]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},c.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[n,o]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t},c.prototype.lookupService=function(e){var t=this.lookup(e,[s]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},c._configure=function(e,t,r){n=e,s=t,o=r}},7812:(e,t,r)=>{"use strict";e.exports=s,s.className="ReflectionObject";var i,n=r(8723);function s(e,t){if(!n.isString(e))throw TypeError("name must be a string");if(t&&!n.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(s.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),s.prototype.toJSON=function(){throw Error()},s.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof i&&t._handleAdd(this)},s.prototype.onRemove=function(e){var t=e.root;t instanceof i&&t._handleRemove(this),this.parent=null,this.resolved=!1},s.prototype.resolve=function(){return this.resolved||this.root instanceof i&&(this.resolved=!0),this},s.prototype.getOption=function(e){if(this.options)return this.options[e]},s.prototype.setOption=function(e,t,r){return r&&this.options&&void 0!==this.options[e]||((this.options||(this.options={}))[e]=t),this},s.prototype.setParsedOption=function(e,t,r){this.parsedOptions||(this.parsedOptions=[]);var i=this.parsedOptions;if(r){var s=i.find((function(t){return Object.prototype.hasOwnProperty.call(t,e)}));if(s){var o=s[e];n.setProperty(o,r,t)}else(s={})[e]=n.setProperty({},r,t),i.push(s)}else{var a={};a[e]=t,i.push(a)}return this},s.prototype.setOptions=function(e,t){if(e)for(var r=Object.keys(e),i=0;i<r.length;++i)this.setOption(r[i],e[r[i]],t);return this},s.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},s._configure=function(e){i=e}},7166:(e,t,r)=>{"use strict";e.exports=o;var i=r(7812);((o.prototype=Object.create(i.prototype)).constructor=o).className="OneOf";var n=r(4243),s=r(8723);function o(e,t,r,n){if(Array.isArray(t)||(r=t,t=void 0),i.call(this,e,r),void 0!==t&&!Array.isArray(t))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=n}function a(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}o.fromJSON=function(e,t){return new o(e,t.oneof,t.options,t.comment)},o.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return s.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},o.prototype.add=function(e){if(!(e instanceof n))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,a(this),this},o.prototype.remove=function(e){if(!(e instanceof n))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),(t=this.oneof.indexOf(e.name))>-1&&this.oneof.splice(t,1),e.partOf=null,this},o.prototype.onAdd=function(e){i.prototype.onAdd.call(this,e);for(var t=0;t<this.oneof.length;++t){var r=e.get(this.oneof[t]);r&&!r.partOf&&(r.partOf=this,this.fieldsArray.push(r))}a(this)},o.prototype.onRemove=function(e){for(var t,r=0;r<this.fieldsArray.length;++r)(t=this.fieldsArray[r]).parent&&t.parent.remove(t);i.prototype.onRemove.call(this,e)},o.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,r){s.decorateType(t.constructor).add(new o(r,e)),Object.defineProperty(t,r,{get:s.oneOfGetter(e),set:s.oneOfSetter(e)})}}},6344:(e,t,r)=>{"use strict";e.exports=d;var i,n=r(5099),s=n.LongBits,o=n.utf8;function a(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function d(e){this.buf=e,this.pos=0,this.len=e.length}var u,l="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new d(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new d(e);throw Error("illegal buffer")},c=function(){return n.Buffer?function(e){return(d.create=function(e){return n.Buffer.isBuffer(e)?new i(e):l(e)})(e)}:l};function p(){var e=new s(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw a(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 a(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 f(){if(this.pos+8>this.len)throw a(this,8);return new s(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}d.create=c(),d.prototype._slice=n.Array.prototype.subarray||n.Array.prototype.slice,d.prototype.uint32=(u=4294967295,function(){if(u=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return u;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return u}),d.prototype.int32=function(){return 0|this.uint32()},d.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},d.prototype.bool=function(){return 0!==this.uint32()},d.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return h(this.buf,this.pos+=4)},d.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return 0|h(this.buf,this.pos+=4)},d.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var e=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},d.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var e=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},d.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw a(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)},d.prototype.string=function(){var e=this.bytes();return o.read(e,0,e.length)},d.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw a(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw a(this)}while(128&this.buf[this.pos++]);return this},d.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},d._configure=function(e){i=e,d.create=c(),i._configure();var t=n.Long?"toLong":"toNumber";n.merge(d.prototype,{int64:function(){return p.call(this)[t](!1)},uint64:function(){return p.call(this)[t](!0)},sint64:function(){return p.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}},2777:(e,t,r)=>{"use strict";e.exports=s;var i=r(6344);(s.prototype=Object.create(i.prototype)).constructor=s;var n=r(5099);function s(e){i.call(this,e)}s._configure=function(){n.Buffer&&(s.prototype._slice=n.Buffer.prototype.slice)},s.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))},s._configure()},7207:(e,t,r)=>{"use strict";e.exports=c;var i=r(4060);((c.prototype=Object.create(i.prototype)).constructor=c).className="Root";var n,s,o,a=r(4243),d=r(8118),u=r(7166),l=r(8723);function c(e){i.call(this,"",e),this.deferred=[],this.files=[]}function p(){}c.fromJSON=function(e,t){return t||(t=new c),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},c.prototype.resolvePath=l.path.resolve,c.prototype.fetch=l.fetch,c.prototype.load=function e(t,r,i){"function"==typeof r&&(i=r,r=void 0);var n=this;if(!i)return l.asPromise(e,n,t,r);var a=i===p;function d(e,t){if(i){var r=i;if(i=null,a)throw e;r(e,t)}}function u(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var r=e.substring(t);if(r in o)return r}return null}function c(e,t){try{if(l.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),l.isString(t)){s.filename=e;var i,o=s(t,n,r),c=0;if(o.imports)for(;c<o.imports.length;++c)(i=u(o.imports[c])||n.resolvePath(e,o.imports[c]))&&h(i);if(o.weakImports)for(c=0;c<o.weakImports.length;++c)(i=u(o.weakImports[c])||n.resolvePath(e,o.weakImports[c]))&&h(i,!0)}else n.setOptions(t.options).addJSON(t.nested)}catch(e){d(e)}a||f||d(null,n)}function h(e,t){if(!(n.files.indexOf(e)>-1))if(n.files.push(e),e in o)a?c(e,o[e]):(++f,setTimeout((function(){--f,c(e,o[e])})));else if(a){var r;try{r=l.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||d(e))}c(e,r)}else++f,n.fetch(e,(function(r,s){--f,i&&(r?t?f||d(null,n):d(r):c(e,s))}))}var f=0;l.isString(t)&&(t=[t]);for(var y,g=0;g<t.length;++g)(y=n.resolvePath("",t[g]))&&h(y);if(a)return n;f||d(null,n)},c.prototype.loadSync=function(e,t){if(!l.isNode)throw Error("not supported");return this.load(e,t,p)},c.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map((function(e){return"'extend "+e.extend+"' in "+e.parent.fullName})).join(", "));return i.prototype.resolveAll.call(this)};var h=/^[A-Z]/;function f(e,t){var r=t.parent.lookup(t.extend);if(r){var i=new a(t.fullName,t.id,t.type,t.rule,void 0,t.options);return i.declaringField=t,t.extensionField=i,r.add(i),!0}return!1}c.prototype._handleAdd=function(e){if(e instanceof a)void 0===e.extend||e.extensionField||f(0,e)||this.deferred.push(e);else if(e instanceof d)h.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof u)){if(e instanceof n)for(var t=0;t<this.deferred.length;)f(0,this.deferred[t])?this.deferred.splice(t,1):++t;for(var r=0;r<e.nestedArray.length;++r)this._handleAdd(e._nestedArray[r]);h.test(e.name)&&(e.parent[e.name]=e)}},c.prototype._handleRemove=function(e){if(e instanceof a){if(void 0!==e.extend)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}}else if(e instanceof d)h.test(e.name)&&delete e.parent[e.name];else if(e instanceof i){for(var r=0;r<e.nestedArray.length;++r)this._handleRemove(e._nestedArray[r]);h.test(e.name)&&delete e.parent[e.name]}},c._configure=function(e,t,r){n=e,s=t,o=r}},4738:e=>{"use strict";e.exports={}},7080:(e,t,r)=>{"use strict";t.Service=r(1604)},1604:(e,t,r)=>{"use strict";e.exports=n;var i=r(5099);function n(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}(n.prototype=Object.create(i.EventEmitter.prototype)).constructor=n,n.prototype.rpcCall=function e(t,r,n,s,o){if(!s)throw TypeError("request must be specified");var a=this;if(!o)return i.asPromise(e,a,t,r,n,s);if(a.rpcImpl)try{return a.rpcImpl(t,r[a.requestDelimited?"encodeDelimited":"encode"](s).finish(),(function(e,r){if(e)return a.emit("error",e,t),o(e);if(null!==r){if(!(r instanceof n))try{r=n[a.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return a.emit("error",e,t),o(e)}return a.emit("data",r,t),o(null,r)}a.end(!0)}))}catch(e){return a.emit("error",e,t),void setTimeout((function(){o(e)}),0)}else setTimeout((function(){o(Error("already ended"))}),0)},n.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},3712:(e,t,r)=>{"use strict";e.exports=a;var i=r(4060);((a.prototype=Object.create(i.prototype)).constructor=a).className="Service";var n=r(7082),s=r(8723),o=r(7080);function a(e,t){i.call(this,e,t),this.methods={},this._methodsArray=null}function d(e){return e._methodsArray=null,e}a.fromJSON=function(e,t){var r=new a(e,t.options);if(t.methods)for(var i=Object.keys(t.methods),s=0;s<i.length;++s)r.add(n.fromJSON(i[s],t.methods[i[s]]));return t.nested&&r.addJSON(t.nested),r.comment=t.comment,r},a.prototype.toJSON=function(e){var t=i.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return s.toObject(["options",t&&t.options||void 0,"methods",i.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},Object.defineProperty(a.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=s.toArray(this.methods))}}),a.prototype.get=function(e){return this.methods[e]||i.prototype.get.call(this,e)},a.prototype.resolveAll=function(){for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return i.prototype.resolve.call(this)},a.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof n?(this.methods[e.name]=e,e.parent=this,d(this)):i.prototype.add.call(this,e)},a.prototype.remove=function(e){if(e instanceof n){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,d(this)}return i.prototype.remove.call(this,e)},a.prototype.create=function(e,t,r){for(var i,n=new o.Service(e,t,r),a=0;a<this.methodsArray.length;++a){var d=s.lcFirst((i=this._methodsArray[a]).resolve().name).replace(/[^$\w_]/g,"");n[d]=s.codegen(["r","c"],s.isReserved(d)?d+"_":d)("return this.rpcCall(m,q,s,r,c)")({m:i,q:i.resolvedRequestType.ctor,s:i.resolvedResponseType.ctor})}return n}},1311:(e,t,r)=>{"use strict";e.exports=v;var i=r(4060);((v.prototype=Object.create(i.prototype)).constructor=v).className="Type";var n=r(8118),s=r(7166),o=r(4243),a=r(4341),d=r(3712),u=r(9348),l=r(6344),c=r(3108),p=r(8723),h=r(7471),f=r(4455),y=r(3777),g=r(5931),m=r(1359);function v(e,t){i.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function b(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}Object.defineProperties(v.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var r=this.fields[e[t]],i=r.id;if(this._fieldsById[i])throw Error("duplicate id "+i+" in "+this);this._fieldsById[i]=r}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=p.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=p.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=v.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof u||((e.prototype=new u).constructor=e,p.merge(e.prototype,t)),e.$type=e.prototype.$type=this,p.merge(e,u,!0),this._ctor=e;for(var r=0;r<this.fieldsArray.length;++r)this._fieldsArray[r].resolve();var i={};for(r=0;r<this.oneofsArray.length;++r)i[this._oneofsArray[r].resolve().name]={get:p.oneOfGetter(this._oneofsArray[r].oneof),set:p.oneOfSetter(this._oneofsArray[r].oneof)};r&&Object.defineProperties(e.prototype,i)}}}),v.generateConstructor=function(e){for(var t,r=p.codegen(["p"],e.name),i=0;i<e.fieldsArray.length;++i)(t=e._fieldsArray[i]).map?r("this%s={}",p.safeProp(t.name)):t.repeated&&r("this%s=[]",p.safeProp(t.name));return r("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},v.fromJSON=function(e,t){var r=new v(e,t.options);r.extensions=t.extensions,r.reserved=t.reserved;for(var u=Object.keys(t.fields),l=0;l<u.length;++l)r.add((void 0!==t.fields[u[l]].keyType?a.fromJSON:o.fromJSON)(u[l],t.fields[u[l]]));if(t.oneofs)for(u=Object.keys(t.oneofs),l=0;l<u.length;++l)r.add(s.fromJSON(u[l],t.oneofs[u[l]]));if(t.nested)for(u=Object.keys(t.nested),l=0;l<u.length;++l){var c=t.nested[u[l]];r.add((void 0!==c.id?o.fromJSON:void 0!==c.fields?v.fromJSON:void 0!==c.values?n.fromJSON:void 0!==c.methods?d.fromJSON:i.fromJSON)(u[l],c))}return t.extensions&&t.extensions.length&&(r.extensions=t.extensions),t.reserved&&t.reserved.length&&(r.reserved=t.reserved),t.group&&(r.group=!0),t.comment&&(r.comment=t.comment),r},v.prototype.toJSON=function(e){var t=i.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return p.toObject(["options",t&&t.options||void 0,"oneofs",i.arrayToJSON(this.oneofsArray,e),"fields",i.arrayToJSON(this.fieldsArray.filter((function(e){return!e.declaringField})),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},v.prototype.resolveAll=function(){for(var e=this.fieldsArray,t=0;t<e.length;)e[t++].resolve();var r=this.oneofsArray;for(t=0;t<r.length;)r[t++].resolve();return i.prototype.resolveAll.call(this)},v.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},v.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof o&&void 0===e.extend){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),b(this)}return e instanceof s?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),b(this)):i.prototype.add.call(this,e)},v.prototype.remove=function(e){if(e instanceof o&&void 0===e.extend){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),b(this)}if(e instanceof s){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),b(this)}return i.prototype.remove.call(this,e)},v.prototype.isReservedId=function(e){return i.isReservedId(this.reserved,e)},v.prototype.isReservedName=function(e){return i.isReservedName(this.reserved,e)},v.prototype.create=function(e){return new this.ctor(e)},v.prototype.setup=function(){for(var e=this.fullName,t=[],r=0;r<this.fieldsArray.length;++r)t.push(this._fieldsArray[r].resolve().resolvedType);this.encode=h(this)({Writer:c,types:t,util:p}),this.decode=f(this)({Reader:l,types:t,util:p}),this.verify=y(this)({types:t,util:p}),this.fromObject=g.fromObject(this)({types:t,util:p}),this.toObject=g.toObject(this)({types:t,util:p});var i=m[e];if(i){var n=Object.create(this);n.fromObject=this.fromObject,this.fromObject=i.fromObject.bind(n),n.toObject=this.toObject,this.toObject=i.toObject.bind(n)}return this},v.prototype.encode=function(e,t){return this.setup().encode(e,t)},v.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},v.prototype.decode=function(e,t){return this.setup().decode(e,t)},v.prototype.decodeDelimited=function(e){return e instanceof l||(e=l.create(e)),this.decode(e,e.uint32())},v.prototype.verify=function(e){return this.setup().verify(e)},v.prototype.fromObject=function(e){return this.setup().fromObject(e)},v.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},v.d=function(e){return function(t){p.decorateType(t,e)}}},5594:(e,t,r)=>{"use strict";var i=t,n=r(8723),s=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function o(e,t){var r=0,i={};for(t|=0;r<e.length;)i[s[r+t]]=e[r++];return i}i.basic=o([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),i.defaults=o([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",n.emptyArray,null]),i.long=o([0,0,0,1,1],7),i.mapKey=o([0,0,0,5,5,0,0,0,1,1,0,2],2),i.packed=o([1,5,0,0,0,5,5,0,0,0,1,1,0])},8723:(e,t,r)=>{"use strict";var i,n,s=e.exports=r(5099),o=r(4738);s.codegen=r(4132),s.fetch=r(177),s.path=r(1080),s.fs=s.inquire("fs"),s.toArray=function(e){if(e){for(var t=Object.keys(e),r=new Array(t.length),i=0;i<t.length;)r[i]=e[t[i++]];return r}return[]},s.toObject=function(e){for(var t={},r=0;r<e.length;){var i=e[r++],n=e[r++];void 0!==n&&(t[i]=n)}return t};var a=/\\/g,d=/"/g;s.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},s.safeProp=function(e){return!/^[$\w_]+$/.test(e)||s.isReserved(e)?'["'+e.replace(a,"\\\\").replace(d,'\\"')+'"]':"."+e},s.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var u=/_([a-z])/g;s.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(u,(function(e,t){return t.toUpperCase()}))},s.compareFieldsById=function(e,t){return e.id-t.id},s.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(s.decorateRoot.remove(e.$type),e.$type.name=t,s.decorateRoot.add(e.$type)),e.$type;i||(i=r(1311));var n=new i(t||e.name);return s.decorateRoot.add(n),n.ctor=e,Object.defineProperty(e,"$type",{value:n,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:n,enumerable:!1}),n};var l=0;s.decorateEnum=function(e){if(e.$type)return e.$type;n||(n=r(8118));var t=new n("Enum"+l++,e);return s.decorateRoot.add(t),Object.defineProperty(e,"$type",{value:t,enumerable:!1}),t},s.setProperty=function(e,t,r){if("object"!=typeof e)throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return function e(t,r,i){var n=r.shift();if("__proto__"===n)return t;if(r.length>0)t[n]=e(t[n]||{},r,i);else{var s=t[n];s&&(i=[].concat(s).concat(i)),t[n]=i}return t}(e,t=t.split("."),r)},Object.defineProperty(s,"decorateRoot",{get:function(){return o.decorated||(o.decorated=new(r(7207)))}})},5904:(e,t,r)=>{"use strict";e.exports=n;var i=r(5099);function n(e,t){this.lo=e>>>0,this.hi=t>>>0}var s=n.zero=new n(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var o=n.zeroHash="\0\0\0\0\0\0\0\0";n.fromNumber=function(e){if(0===e)return s;var t=e<0;t&&(e=-e);var r=e>>>0,i=(e-r)/4294967296>>>0;return t&&(i=~i>>>0,r=~r>>>0,++r>4294967295&&(r=0,++i>4294967295&&(i=0))),new n(r,i)},n.from=function(e){if("number"==typeof e)return n.fromNumber(e);if(i.isString(e)){if(!i.Long)return n.fromNumber(parseInt(e,10));e=i.Long.fromString(e)}return e.low||e.high?new n(e.low>>>0,e.high>>>0):s},n.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},n.prototype.toLong=function(e){return i.Long?new i.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var a=String.prototype.charCodeAt;n.fromHash=function(e){return e===o?s:new n((a.call(e,0)|a.call(e,1)<<8|a.call(e,2)<<16|a.call(e,3)<<24)>>>0,(a.call(e,4)|a.call(e,5)<<8|a.call(e,6)<<16|a.call(e,7)<<24)>>>0)},n.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)},n.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},n.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},n.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}},5099:function(e,t,r){"use strict";var i=t;function n(e,t,r){for(var i=Object.keys(t),n=0;n<i.length;++n)void 0!==e[i[n]]&&r||(e[i[n]]=t[i[n]]);return e}function s(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),r&&n(this,r)}return(t.prototype=Object.create(Error.prototype)).constructor=t,Object.defineProperty(t.prototype,"name",{get:function(){return e}}),t.prototype.toString=function(){return this.name+": "+this.message},t}i.asPromise=r(3808),i.base64=r(3320),i.EventEmitter=r(2149),i.float=r(1727),i.inquire=r(3768),i.utf8=r(5184),i.pool=r(2461),i.LongBits=r(5904),i.isNode=Boolean(void 0!==r.g&&r.g&&r.g.process&&r.g.process.versions&&r.g.process.versions.node),i.global=i.isNode&&r.g||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},i.isString=function(e){return"string"==typeof e||e instanceof String},i.isObject=function(e){return e&&"object"==typeof e},i.isset=i.isSet=function(e,t){var r=e[t];return!(null==r||!e.hasOwnProperty(t))&&("object"!=typeof r||(Array.isArray(r)?r.length:Object.keys(r).length)>0)},i.Buffer=function(){try{var e=i.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(e){return"number"==typeof e?i.Buffer?i._Buffer_allocUnsafe(e):new i.Array(e):i.Buffer?i._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},i.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(e){return e?i.LongBits.from(e).toHash():i.LongBits.zeroHash},i.longFromHash=function(e,t){var r=i.LongBits.fromHash(e);return i.Long?i.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},i.merge=n,i.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},i.newError=s,i.ProtocolError=s("ProtocolError"),i.oneOfGetter=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=1;return function(){for(var e=Object.keys(this),r=e.length-1;r>-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},i.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i._configure=function(){var e=i.Buffer;e?(i._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,r){return new e(t,r)},i._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):i._Buffer_from=i._Buffer_allocUnsafe=null}},3777:(e,t,r)=>{"use strict";e.exports=function(e){var t=n.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),r=e.oneofsArray,i={};r.length&&t("var p={}");for(var d=0;d<e.fieldsArray.length;++d){var u=e._fieldsArray[d].resolve(),l="m"+n.safeProp(u.name);if(u.optional&&t("if(%s!=null&&m.hasOwnProperty(%j)){",l,u.name),u.map)t("if(!util.isObject(%s))",l)("return%j",s(u,"object"))("var k=Object.keys(%s)",l)("for(var i=0;i<k.length;++i){"),a(t,u,"k[i]"),o(t,u,d,l+"[k[i]]")("}");else if(u.repeated)t("if(!Array.isArray(%s))",l)("return%j",s(u,"array"))("for(var i=0;i<%s.length;++i){",l),o(t,u,d,l+"[i]")("}");else{if(u.partOf){var c=n.safeProp(u.partOf.name);1===i[u.partOf.name]&&t("if(p%s===1)",c)("return%j",u.partOf.name+": multiple values"),i[u.partOf.name]=1,t("p%s=1",c)}o(t,u,d,l)}u.optional&&t("}")}return t("return null")};var i=r(8118),n=r(8723);function s(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function o(e,t,r,n){if(t.resolvedType)if(t.resolvedType instanceof i){e("switch(%s){",n)("default:")("return%j",s(t,"enum value"));for(var o=Object.keys(t.resolvedType.values),a=0;a<o.length;++a)e("case %i:",t.resolvedType.values[o[a]]);e("break")("}")}else e("{")("var e=types[%i].verify(%s);",r,n)("if(e)")("return%j+e",t.name+".")("}");else switch(t.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.isInteger(%s))",n)("return%j",s(t,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",n,n,n,n)("return%j",s(t,"integer|Long"));break;case"float":case"double":e('if(typeof %s!=="number")',n)("return%j",s(t,"number"));break;case"bool":e('if(typeof %s!=="boolean")',n)("return%j",s(t,"boolean"));break;case"string":e("if(!util.isString(%s))",n)("return%j",s(t,"string"));break;case"bytes":e('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',n,n,n)("return%j",s(t,"buffer"))}return e}function a(e,t,r){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",r)("return%j",s(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",r)("return%j",s(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",r)("return%j",s(t,"boolean key"))}return e}},1359:(e,t,r)=>{"use strict";var i=t,n=r(9348);i[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),r=this.lookup(t);if(r){var i="."===e["@type"].charAt(0)?e["@type"].substr(1):e["@type"];return-1===i.indexOf("/")&&(i="/"+i),this.create({type_url:i,value:r.encode(r.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){var r="",i="";if(t&&t.json&&e.type_url&&e.value){i=e.type_url.substring(e.type_url.lastIndexOf("/")+1),r=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var s=this.lookup(i);s&&(e=s.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof n){var o=e.$type.toObject(e,t);return""===r&&(r="type.googleapis.com/"),i=r+("."===e.$type.fullName[0]?e.$type.fullName.substr(1):e.$type.fullName),o["@type"]=i,o}return this.toObject(e,t)}}},3108:(e,t,r)=>{"use strict";e.exports=c;var i,n=r(5099),s=n.LongBits,o=n.base64,a=n.utf8;function d(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function u(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function c(){this.len=0,this.head=new d(u,0,0),this.tail=this.head,this.states=null}var p=function(){return n.Buffer?function(){return(c.create=function(){return new i})()}:function(){return new c}};function h(e,t,r){t[r]=255&e}function f(e,t){this.len=e,this.next=void 0,this.val=t}function y(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function g(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}c.create=p(),c.alloc=function(e){return new n.Array(e)},n.Array!==Array&&(c.alloc=n.pool(c.alloc,n.Array.prototype.subarray)),c.prototype._push=function(e,t,r){return this.tail=this.tail.next=new d(e,t,r),this.len+=t,this},f.prototype=Object.create(d.prototype),f.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},c.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new f((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},c.prototype.int32=function(e){return e<0?this._push(y,10,s.fromNumber(e)):this.uint32(e)},c.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},c.prototype.uint64=function(e){var t=s.from(e);return this._push(y,t.length(),t)},c.prototype.int64=c.prototype.uint64,c.prototype.sint64=function(e){var t=s.from(e).zzEncode();return this._push(y,t.length(),t)},c.prototype.bool=function(e){return this._push(h,1,e?1:0)},c.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},c.prototype.sfixed32=c.prototype.fixed32,c.prototype.fixed64=function(e){var t=s.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},c.prototype.sfixed64=c.prototype.fixed64,c.prototype.float=function(e){return this._push(n.float.writeFloatLE,4,e)},c.prototype.double=function(e){return this._push(n.float.writeDoubleLE,8,e)};var m=n.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var i=0;i<e.length;++i)t[r+i]=e[i]};c.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(h,1,0);if(n.isString(e)){var r=c.alloc(t=o.length(e));o.decode(e,r,0),e=r}return this.uint32(t)._push(m,t,e)},c.prototype.string=function(e){var t=a.length(e);return t?this.uint32(t)._push(a.write,t,e):this._push(h,1,0)},c.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new d(u,0,0),this.len=0,this},c.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 d(u,0,0),this.len=0),this},c.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},c.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},c._configure=function(e){i=e,c.create=p(),i._configure()}},2533:(e,t,r)=>{"use strict";e.exports=s;var i=r(3108);(s.prototype=Object.create(i.prototype)).constructor=s;var n=r(5099);function s(){i.call(this)}function o(e,t,r){e.length<40?n.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}s._configure=function(){s.alloc=n._Buffer_allocUnsafe,s.writeBytesBuffer=n.Buffer&&n.Buffer.prototype instanceof Uint8Array&&"set"===n.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 i=0;i<e.length;)t[r++]=e[i++]}},s.prototype.bytes=function(e){n.isString(e)&&(e=n._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(s.writeBytesBuffer,t,e),this},s.prototype.string=function(e){var t=n.Buffer.byteLength(e);return this.uint32(t),t&&this._push(o,t,e),this},s._configure()},5699:e=>{"use strict";var t={};function r(e,r,i){i||(i=Error);var n=function(e){var t,i;function n(t,i,n){return e.call(this,function(e,t,i){return"string"==typeof r?r:r(e,t,i)}(t,i,n))||this}return i=e,(t=n).prototype=Object.create(i.prototype),t.prototype.constructor=t,t.__proto__=i,n}(i);n.prototype.name=i.name,n.prototype.code=e,t[e]=n}function i(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,s,o,a;if("string"==typeof t&&(s="not ",t.substr(!o||o<0?0:+o,s.length)===s)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))a="The ".concat(e," ").concat(n," ").concat(i(t,"type"));else{var d=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";a='The "'.concat(e,'" ').concat(d," ").concat(n," ").concat(i(t,"type"))}return a+=". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.F=t},1265:(e,t,r)=>{"use strict";var i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=u;var n=r(8199),s=r(5291);r(5615)(u,n);for(var o=i(s.prototype),a=0;a<o.length;a++){var d=o[a];u.prototype[d]||(u.prototype[d]=s.prototype[d])}function u(e){if(!(this instanceof u))return new u(e);n.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",l)))}function l(){this._writableState.ended||process.nextTick(c,this)}function c(e){e.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},4421:(e,t,r)=>{"use strict";e.exports=n;var i=r(9415);function n(e){if(!(this instanceof n))return new n(e);i.call(this,e)}r(5615)(n,i),n.prototype._transform=function(e,t,r){r(null,e)}},8199:(e,t,r)=>{"use strict";var i;e.exports=S,S.ReadableState=E;r(46).EventEmitter;var n=function(e,t){return e.listeners(t).length},s=r(4856),o=r(1048).Buffer,a=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var d,u=r(3951);d=u&&u.debuglog?u.debuglog("stream"):function(){};var l,c,p,h=r(82),f=r(6527),y=r(9952).getHighWaterMark,g=r(5699).F,m=g.ERR_INVALID_ARG_TYPE,v=g.ERR_STREAM_PUSH_AFTER_EOF,b=g.ERR_METHOD_NOT_IMPLEMENTED,_=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(5615)(S,s);var w=f.errorOrDestroy,T=["error","close","destroy","pause","resume"];function E(e,t,n){i=i||r(1265),e=e||{},"boolean"!=typeof n&&(n=t instanceof i),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=y(this,e,"readableHighWaterMark",n),this.buffer=new h,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(l||(l=r(5157).I),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function S(e){if(i=i||r(1265),!(this instanceof S))return new S(e);var t=this instanceof i;this._readableState=new E(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),s.call(this)}function A(e,t,r,i,n){d("readableAddChunk",t);var s,u=e._readableState;if(null===t)u.reading=!1,function(e,t){if(d("onEofChunk"),t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?O(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,x(e)))}(e,u);else if(n||(s=function(e,t){var r;i=t,o.isBuffer(i)||i instanceof a||"string"==typeof t||void 0===t||e.objectMode||(r=new m("chunk",["string","Buffer","Uint8Array"],t));var i;return r}(u,t)),s)w(e,s);else if(u.objectMode||t&&t.length>0)if("string"==typeof t||u.objectMode||Object.getPrototypeOf(t)===o.prototype||(t=function(e){return o.from(e)}(t)),i)u.endEmitted?w(e,new _):R(e,u,t,!0);else if(u.ended)w(e,new v);else{if(u.destroyed)return!1;u.reading=!1,u.decoder&&!r?(t=u.decoder.write(t),u.objectMode||0!==t.length?R(e,u,t,!1):k(e,u)):R(e,u,t,!1)}else i||(u.reading=!1,k(e,u));return!u.ended&&(u.length<u.highWaterMark||0===u.length)}function R(e,t,r,i){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&O(e)),k(e,t)}Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),S.prototype.destroy=f.destroy,S.prototype._undestroy=f.undestroy,S.prototype._destroy=function(e,t){t(e)},S.prototype.push=function(e,t){var r,i=this._readableState;return i.objectMode?r=!0:"string"==typeof e&&((t=t||i.defaultEncoding)!==i.encoding&&(e=o.from(e,t),t=""),r=!0),A(this,e,t,!1,r)},S.prototype.unshift=function(e){return A(this,e,null,!0,!1)},S.prototype.isPaused=function(){return!1===this._readableState.flowing},S.prototype.setEncoding=function(e){l||(l=r(5157).I);var t=new l(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var i=this._readableState.buffer.head,n="";null!==i;)n+=t.write(i.data),i=i.next;return this._readableState.buffer.clear(),""!==n&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var M=1073741824;function I(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=M?e=M:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;d("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(x,e))}function x(e){var t=e._readableState;d("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,B(e)}function k(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(C,e,t))}function C(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(d("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function P(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function D(e){d("readable nexttick read 0"),e.read(0)}function N(e,t){d("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),B(e),t.flowing&&!t.reading&&e.read(0)}function B(e){var t=e._readableState;for(d("flow",t.flowing);t.flowing&&null!==e.read(););}function q(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function L(e){var t=e._readableState;d("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(j,t,e))}function j(e,t){if(d("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function F(e,t){for(var r=0,i=e.length;r<i;r++)if(e[r]===t)return r;return-1}S.prototype.read=function(e){d("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?L(this):O(this),null;if(0===(e=I(e,t))&&t.ended)return 0===t.length&&L(this),null;var i,n=t.needReadable;return d("need readable",n),(0===t.length||t.length-e<t.highWaterMark)&&d("length less than watermark",n=!0),t.ended||t.reading?d("reading or ended",n=!1):n&&(d("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=I(r,t))),null===(i=e>0?q(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&L(this)),null!==i&&this.emit("data",i),i},S.prototype._read=function(e){w(this,new b("_read()"))},S.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,d("pipe count=%d opts=%j",i.pipesCount,t);var s=(!t||!1!==t.end)&&e!==process.stdout&&e!==process.stderr?a:y;function o(t,n){d("onunpipe"),t===r&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,d("cleanup"),e.removeListener("close",h),e.removeListener("finish",f),e.removeListener("drain",u),e.removeListener("error",p),e.removeListener("unpipe",o),r.removeListener("end",a),r.removeListener("end",y),r.removeListener("data",c),l=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}function a(){d("onend"),e.end()}i.endEmitted?process.nextTick(s):r.once("end",s),e.on("unpipe",o);var u=function(e){return function(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&n(e,"data")&&(t.flowing=!0,B(e))}}(r);e.on("drain",u);var l=!1;function c(t){d("ondata");var n=e.write(t);d("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==F(i.pipes,e))&&!l&&(d("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function p(t){d("onerror",t),y(),e.removeListener("error",p),0===n(e,"error")&&w(e,t)}function h(){e.removeListener("finish",f),y()}function f(){d("onfinish"),e.removeListener("close",h),y()}function y(){d("unpipe"),r.unpipe(e)}return r.on("data",c),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",p),e.once("close",h),e.once("finish",f),e.emit("pipe",r),i.flowing||(d("pipe resume"),r.resume()),e},S.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var i=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s<n;s++)i[s].emit("unpipe",this,{hasUnpiped:!1});return this}var o=F(t.pipes,e);return-1===o||(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},S.prototype.on=function(e,t){var r=s.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,d("on readable",i.length,i.reading),i.length?O(this):i.reading||process.nextTick(D,this))),r},S.prototype.addListener=S.prototype.on,S.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);return"readable"===e&&process.nextTick(P,this),r},S.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(P,this),t},S.prototype.resume=function(){var e=this._readableState;return e.flowing||(d("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(N,e,t))}(this,e)),e.paused=!1,this},S.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},S.prototype.wrap=function(e){var t=this,r=this._readableState,i=!1;for(var n in e.on("end",(function(){if(d("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(n){(d("wrapped data"),r.decoder&&(n=r.decoder.write(n)),r.objectMode&&null==n)||(r.objectMode||n&&n.length)&&(t.push(n)||(i=!0,e.pause()))})),e)void 0===this[n]&&"function"==typeof e[n]&&(this[n]=function(t){return function(){return e[t].apply(e,arguments)}}(n));for(var s=0;s<T.length;s++)e.on(T[s],this.emit.bind(this,T[s]));return this._read=function(t){d("wrapped _read",t),i&&(i=!1,e.resume())},this},"function"==typeof Symbol&&(S.prototype[Symbol.asyncIterator]=function(){return void 0===c&&(c=r(534)),c(this)}),Object.defineProperty(S.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(S.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(S.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),S._fromList=q,Object.defineProperty(S.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(S.from=function(e,t){return void 0===p&&(p=r(1260)),p(S,e,t)})},9415:(e,t,r)=>{"use strict";e.exports=l;var i=r(5699).F,n=i.ERR_METHOD_NOT_IMPLEMENTED,s=i.ERR_MULTIPLE_CALLBACK,o=i.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=i.ERR_TRANSFORM_WITH_LENGTH_0,d=r(1265);function u(e,t){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(null===i)return this.emit("error",new s);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),i(e);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function l(e){if(!(this instanceof l))return new l(e);d.call(this,e),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",c)}function c(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?p(this,null,null):this._flush((function(t,r){p(e,t,r)}))}function p(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new a;if(e._transformState.transforming)throw new o;return e.push(null)}r(5615)(l,d),l.prototype.push=function(e,t){return this._transformState.needTransform=!1,d.prototype.push.call(this,e,t)},l.prototype._transform=function(e,t,r){r(new n("_transform()"))},l.prototype._write=function(e,t,r){var i=this._transformState;if(i.writecb=r,i.writechunk=e,i.writeencoding=t,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}},l.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},l.prototype._destroy=function(e,t){d.prototype._destroy.call(this,e,(function(e){t(e)}))}},5291:(e,t,r)=>{"use strict";function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var i=e.entry;e.entry=null;for(;i;){var n=i.callback;t.pendingcb--,n(r),i=i.next}t.corkedRequestsFree.next=e}(t,e)}}var n;e.exports=S,S.WritableState=E;var s={deprecate:r(6732)},o=r(4856),a=r(1048).Buffer,d=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var u,l=r(6527),c=r(9952).getHighWaterMark,p=r(5699).F,h=p.ERR_INVALID_ARG_TYPE,f=p.ERR_METHOD_NOT_IMPLEMENTED,y=p.ERR_MULTIPLE_CALLBACK,g=p.ERR_STREAM_CANNOT_PIPE,m=p.ERR_STREAM_DESTROYED,v=p.ERR_STREAM_NULL_VALUES,b=p.ERR_STREAM_WRITE_AFTER_END,_=p.ERR_UNKNOWN_ENCODING,w=l.errorOrDestroy;function T(){}function E(e,t,s){n=n||r(1265),e=e||{},"boolean"!=typeof s&&(s=t instanceof n),this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=c(this,e,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var o=!1===e.decodeStrings;this.decodeStrings=!o,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,i=r.sync,n=r.writecb;if("function"!=typeof n)throw new y;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,i,n){--t.pendingcb,r?(process.nextTick(n,i),process.nextTick(x,e,t),e._writableState.errorEmitted=!0,w(e,i)):(n(i),e._writableState.errorEmitted=!0,w(e,i),x(e,t))}(e,r,i,t,n);else{var s=I(r)||e.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||M(e,r),i?process.nextTick(R,e,r,s,n):R(e,r,s,n)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function S(e){var t=this instanceof(n=n||r(1265));if(!t&&!u.call(S,this))return new S(e);this._writableState=new E(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),o.call(this)}function A(e,t,r,i,n,s,o){t.writelen=i,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new m("write")):r?e._writev(n,t.onwrite):e._write(n,s,t.onwrite),t.sync=!1}function R(e,t,r,i){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,i(),x(e,t)}function M(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,s=new Array(n),o=t.corkedRequestsFree;o.entry=r;for(var a=0,d=!0;r;)s[a]=r,r.isBuf||(d=!1),r=r.next,a+=1;s.allBuffers=d,A(e,t,!0,t.length,s,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,l=r.encoding,c=r.callback;if(A(e,t,!1,t.objectMode?1:u.length,u,l,c),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function I(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function O(e,t){e._final((function(r){t.pendingcb--,r&&w(e,r),t.prefinished=!0,e.emit("prefinish"),x(e,t)}))}function x(e,t){var r=I(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,process.nextTick(O,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var i=e._readableState;(!i||i.autoDestroy&&i.endEmitted)&&e.destroy()}return r}r(5615)(S,o),E.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(E.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(u=Function.prototype[Symbol.hasInstance],Object.defineProperty(S,Symbol.hasInstance,{value:function(e){return!!u.call(this,e)||this===S&&(e&&e._writableState instanceof E)}})):u=function(e){return e instanceof this},S.prototype.pipe=function(){w(this,new g)},S.prototype.write=function(e,t,r){var i,n=this._writableState,s=!1,o=!n.objectMode&&(i=e,a.isBuffer(i)||i instanceof d);return o&&!a.isBuffer(e)&&(e=function(e){return a.from(e)}(e)),"function"==typeof t&&(r=t,t=null),o?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof r&&(r=T),n.ending?function(e,t){var r=new b;w(e,r),process.nextTick(t,r)}(this,r):(o||function(e,t,r,i){var n;return null===r?n=new v:"string"==typeof r||t.objectMode||(n=new h("chunk",["string","Buffer"],r)),!n||(w(e,n),process.nextTick(i,n),!1)}(this,n,e,r))&&(n.pendingcb++,s=function(e,t,r,i,n,s){if(!r){var o=function(e,t,r){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=a.from(t,r));return t}(t,i,n);i!==o&&(r=!0,n="buffer",i=o)}var d=t.objectMode?1:i.length;t.length+=d;var u=t.length<t.highWaterMark;u||(t.needDrain=!0);if(t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:s,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else A(e,t,!1,d,i,n,s);return u}(this,n,o,e,t,r)),s},S.prototype.cork=function(){this._writableState.corked++},S.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||M(this,e))},S.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(e,t,r){r(new f("_write()"))},S.prototype._writev=null,S.prototype.end=function(e,t,r){var i=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,r){t.ending=!0,x(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,i,r),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),S.prototype.destroy=l.destroy,S.prototype._undestroy=l.undestroy,S.prototype._destroy=function(e,t){t(e)}},534:(e,t,r)=>{"use strict";var i;function n(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s=r(4869),o=Symbol("lastResolve"),a=Symbol("lastReject"),d=Symbol("error"),u=Symbol("ended"),l=Symbol("lastPromise"),c=Symbol("handlePromise"),p=Symbol("stream");function h(e,t){return{value:e,done:t}}function f(e){var t=e[o];if(null!==t){var r=e[p].read();null!==r&&(e[l]=null,e[o]=null,e[a]=null,t(h(r,!1)))}}function y(e){process.nextTick(f,e)}var g=Object.getPrototypeOf((function(){})),m=Object.setPrototypeOf((n(i={get stream(){return this[p]},next:function(){var e=this,t=this[d];if(null!==t)return Promise.reject(t);if(this[u])return Promise.resolve(h(void 0,!0));if(this[p].destroyed)return new Promise((function(t,r){process.nextTick((function(){e[d]?r(e[d]):t(h(void 0,!0))}))}));var r,i=this[l];if(i)r=new Promise(function(e,t){return function(r,i){e.then((function(){t[u]?r(h(void 0,!0)):t[c](r,i)}),i)}}(i,this));else{var n=this[p].read();if(null!==n)return Promise.resolve(h(n,!1));r=new Promise(this[c])}return this[l]=r,r}},Symbol.asyncIterator,(function(){return this})),n(i,"return",(function(){var e=this;return new Promise((function(t,r){e[p].destroy(null,(function(e){e?r(e):t(h(void 0,!0))}))}))})),i),g);e.exports=function(e){var t,r=Object.create(m,(n(t={},p,{value:e,writable:!0}),n(t,o,{value:null,writable:!0}),n(t,a,{value:null,writable:!0}),n(t,d,{value:null,writable:!0}),n(t,u,{value:e._readableState.endEmitted,writable:!0}),n(t,c,{value:function(e,t){var i=r[p].read();i?(r[l]=null,r[o]=null,r[a]=null,e(h(i,!1))):(r[o]=e,r[a]=t)},writable:!0}),t));return r[l]=null,s(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[a];return null!==t&&(r[l]=null,r[o]=null,r[a]=null,t(e)),void(r[d]=e)}var i=r[o];null!==i&&(r[l]=null,r[o]=null,r[a]=null,i(h(void 0,!0))),r[u]=!0})),e.on("readable",y.bind(null,r)),r}},82:(e,t,r)=>{"use strict";function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function n(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach((function(t){s(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function s(e,t,r){return(t=a(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,a(i.key),i)}}function a(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var d=r(1048).Buffer,u=r(3011).inspect,l=u&&u.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r,i;return t=e,(r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return d.alloc(0);for(var t,r,i,n=d.allocUnsafe(e>>>0),s=this.head,o=0;s;)t=s.data,r=n,i=o,d.prototype.copy.call(t,r,i),o+=s.data.length,s=s.next;return n}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,i=t.data;for(e-=i.length;t=t.next;){var n=t.data,s=e>n.length?n.length:e;if(s===n.length?i+=n:i+=n.slice(0,e),0==(e-=s)){s===n.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=n.slice(s));break}++r}return this.length-=r,i}},{key:"_getBuffer",value:function(e){var t=d.allocUnsafe(e),r=this.head,i=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var n=r.data,s=e>n.length?n.length:e;if(n.copy(t,t.length-e,0,s),0==(e-=s)){s===n.length?(++i,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=n.slice(s));break}++i}return this.length-=i,t}},{key:l,value:function(e,t){return u(this,n(n({},t),{},{depth:0,customInspect:!1}))}}])&&o(t.prototype,r),i&&o(t,i),Object.defineProperty(t,"prototype",{writable:!1}),e}()},6527:e=>{"use strict";function t(e,t){i(e,t),r(e)}function r(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,n){var s=this,o=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return o||a?(n?n(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(i,this,e)):process.nextTick(i,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!n&&e?s._writableState?s._writableState.errorEmitted?process.nextTick(r,s):(s._writableState.errorEmitted=!0,process.nextTick(t,s,e)):process.nextTick(t,s,e):n?(process.nextTick(r,s),n(e)):process.nextTick(r,s)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,i=e._writableState;r&&r.autoDestroy||i&&i.autoDestroy?e.destroy(t):e.emit("error",t)}}},4869:(e,t,r)=>{"use strict";var i=r(5699).F.ERR_STREAM_PREMATURE_CLOSE;function n(){}e.exports=function e(t,r,s){if("function"==typeof r)return e(t,null,r);r||(r={}),s=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];e.apply(this,i)}}}(s||n);var o=r.readable||!1!==r.readable&&t.readable,a=r.writable||!1!==r.writable&&t.writable,d=function(){t.writable||l()},u=t._writableState&&t._writableState.finished,l=function(){a=!1,u=!0,o||s.call(t)},c=t._readableState&&t._readableState.endEmitted,p=function(){o=!1,c=!0,a||s.call(t)},h=function(e){s.call(t,e)},f=function(){var e;return o&&!c?(t._readableState&&t._readableState.ended||(e=new i),s.call(t,e)):a&&!u?(t._writableState&&t._writableState.ended||(e=new i),s.call(t,e)):void 0},y=function(){t.req.on("finish",l)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(t)?a&&!t._writableState&&(t.on("end",d),t.on("close",d)):(t.on("complete",l),t.on("abort",f),t.req?y():t.on("request",y)),t.on("end",p),t.on("finish",l),!1!==r.error&&t.on("error",h),t.on("close",f),function(){t.removeListener("complete",l),t.removeListener("abort",f),t.removeListener("request",y),t.req&&t.req.removeListener("finish",l),t.removeListener("end",d),t.removeListener("close",d),t.removeListener("finish",l),t.removeListener("end",p),t.removeListener("error",h),t.removeListener("close",f)}}},1260:e=>{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},6815:(e,t,r)=>{"use strict";var i;var n=r(5699).F,s=n.ERR_MISSING_ARGS,o=n.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function d(e){e()}function u(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var l,c=function(e){return e.length?"function"!=typeof e[e.length-1]?a:e.pop():a}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new s("streams");var p=t.map((function(e,n){var s=n<t.length-1;return function(e,t,n,s){s=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(s);var a=!1;e.on("close",(function(){a=!0})),void 0===i&&(i=r(4869)),i(e,{readable:t,writable:n},(function(e){if(e)return s(e);a=!0,s()}));var d=!1;return function(t){if(!a&&!d)return d=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void s(t||new o("pipe"))}}(e,s,n>0,(function(e){l||(l=e),e&&p.forEach(d),s||(p.forEach(d),c(l))}))}));return t.reduce(u)}},9952:(e,t,r)=>{"use strict";var i=r(5699).F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,n){var s=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,n,r);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new i(n?r:"highWaterMark",s);return Math.floor(s)}return e.objectMode?16:16384}}},4856:(e,t,r)=>{e.exports=r(46).EventEmitter},5157:(e,t,r)=>{"use strict";var i=r(5636).Buffer,n=i.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function s(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(i.isEncoding===n||!n(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=d,this.end=u,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=l,this.end=c,t=3;break;default:return this.write=p,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function d(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function c(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function p(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.I=s,s.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},s.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},s.prototype.text=function(e,t){var r=function(e,t,r){var i=t.length-1;if(i<r)return 0;var n=o(t[i]);if(n>=0)return n>0&&(e.lastNeed=n-1),n;if(--i<r||-2===n)return 0;if(n=o(t[i]),n>=0)return n>0&&(e.lastNeed=n-2),n;if(--i<r||-2===n)return 0;if(n=o(t[i]),n>=0)return n>0&&(2===n?n=0:e.lastNeed=n-3),n;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var i=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)},s.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},4156:(e,t,r)=>{(t=e.exports=r(8199)).Stream=t,t.Readable=t,t.Writable=r(5291),t.Duplex=r(1265),t.Transform=r(9415),t.PassThrough=r(4421),t.finished=r(4869),t.pipeline=r(6815)},5586:(e,t,r)=>{"use strict";var i=r(1048).Buffer,n=r(5615),s=r(5779),o=new Array(16),a=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],d=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],u=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],l=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],c=[0,1518500249,1859775393,2400959708,2840853838],p=[1352829926,1548603684,1836072691,2053994217,0];function h(){s.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function f(e,t){return e<<t|e>>>32-t}function y(e,t,r,i,n,s,o,a){return f(e+(t^r^i)+s+o|0,a)+n|0}function g(e,t,r,i,n,s,o,a){return f(e+(t&r|~t&i)+s+o|0,a)+n|0}function m(e,t,r,i,n,s,o,a){return f(e+((t|~r)^i)+s+o|0,a)+n|0}function v(e,t,r,i,n,s,o,a){return f(e+(t&i|r&~i)+s+o|0,a)+n|0}function b(e,t,r,i,n,s,o,a){return f(e+(t^(r|~i))+s+o|0,a)+n|0}n(h,s),h.prototype._update=function(){for(var e=o,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,i=0|this._b,n=0|this._c,s=0|this._d,h=0|this._e,_=0|this._a,w=0|this._b,T=0|this._c,E=0|this._d,S=0|this._e,A=0;A<80;A+=1){var R,M;A<16?(R=y(r,i,n,s,h,e[a[A]],c[0],u[A]),M=b(_,w,T,E,S,e[d[A]],p[0],l[A])):A<32?(R=g(r,i,n,s,h,e[a[A]],c[1],u[A]),M=v(_,w,T,E,S,e[d[A]],p[1],l[A])):A<48?(R=m(r,i,n,s,h,e[a[A]],c[2],u[A]),M=m(_,w,T,E,S,e[d[A]],p[2],l[A])):A<64?(R=v(r,i,n,s,h,e[a[A]],c[3],u[A]),M=g(_,w,T,E,S,e[d[A]],p[3],l[A])):(R=b(r,i,n,s,h,e[a[A]],c[4],u[A]),M=y(_,w,T,E,S,e[d[A]],p[4],l[A])),r=h,h=s,s=f(n,10),n=i,i=R,_=S,S=E,E=f(T,10),T=w,w=M}var I=this._b+n+E|0;this._b=this._c+s+S|0,this._c=this._d+h+_|0,this._d=this._e+r+w|0,this._e=this._a+i+T|0,this._a=I},h.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=i.alloc?i.alloc(20):new i(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=h},5779:(e,t,r)=>{"use strict";var i=r(5636).Buffer,n=r(4156).Transform;function s(e){n.call(this),this._block=i.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(5615)(s,n),s.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},s.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},s.prototype.update=function(e,t){if(function(e,t){if(!i.isBuffer(e)&&"string"!=typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");i.isBuffer(e)||(e=i.from(e,t));for(var r=this._block,n=0;this._blockOffset+e.length-n>=this._blockSize;){for(var s=this._blockOffset;s<this._blockSize;)r[s++]=e[n++];this._update(),this._blockOffset=0}for(;n<e.length;)r[this._blockOffset++]=e[n++];for(var o=0,a=8*e.length;a>0;++o)this._length[o]+=a,(a=this._length[o]/4294967296|0)>0&&(this._length[o]-=4294967296*a);return this},s.prototype._update=function(){throw new Error("_update is not implemented")},s.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},s.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=s},5636:(e,t,r)=>{var i=r(1048),n=i.Buffer;function s(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=i:(s(i,t),t.Buffer=o),o.prototype=Object.create(n.prototype),s(n,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=n(e);return void 0!==t?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i.SlowBuffer(e)}},1565:(e,t,r)=>{const i=Symbol("SemVer ANY");class n{static get ANY(){return i}constructor(e,t){if(t=s(t),e instanceof n){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),u("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===i?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){const t=this.options.loose?o[a.COMPARATORLOOSE]:o[a.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new l(r[2],this.options.loose):this.semver=i}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===i||e===i)return!0;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}return d(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof n))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new c(e.value,t).test(this.value):""===e.operator?""===e.value||new c(this.value,t).test(e.semver):(!(t=s(t)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(d(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(d(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}e.exports=n;const s=r(3990),{safeRe:o,t:a}=r(2841),d=r(4004),u=r(1361),l=r(4517),c=r(7476)},7476:(e,t,r)=>{class i{constructor(e,t){if(t=s(t),e instanceof i)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new i(e.raw,t);if(e instanceof o)return this.raw=e.value,this.set=[[e]],this.format(),this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!g(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&m(e[0])){this.set=[e];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&f)|(this.options.loose&&y))+":"+e,r=n.get(t);if(r)return r;const i=this.options.loose,s=i?u[l.HYPHENRANGELOOSE]:u[l.HYPHENRANGE];e=e.replace(s,O(this.options.includePrerelease)),a("hyphen replace",e),e=e.replace(u[l.COMPARATORTRIM],c),a("comparator trim",e),e=e.replace(u[l.TILDETRIM],p),a("tilde trim",e),e=e.replace(u[l.CARETTRIM],h),a("caret trim",e);let d=e.split(" ").map((e=>b(e,this.options))).join(" ").split(/\s+/).map((e=>I(e,this.options)));i&&(d=d.filter((e=>(a("loose invalid filter",e,this.options),!!e.match(u[l.COMPARATORLOOSE]))))),a("range list",d);const m=new Map,v=d.map((e=>new o(e,this.options)));for(const e of v){if(g(e))return[e];m.set(e.value,e)}m.size>1&&m.has("")&&m.delete("");const _=[...m.values()];return n.set(t,_),_}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Range is required");return this.set.some((r=>v(r,t)&&e.set.some((e=>v(e,t)&&r.every((r=>e.every((e=>r.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new d(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(x(this.set[t],e,this.options))return!0;return!1}}e.exports=i;const n=new(r(3624))({max:1e3}),s=r(3990),o=r(1565),a=r(1361),d=r(4517),{safeRe:u,t:l,comparatorTrimReplace:c,tildeTrimReplace:p,caretTrimReplace:h}=r(2841),{FLAG_INCLUDE_PRERELEASE:f,FLAG_LOOSE:y}=r(9543),g=e=>"<0.0.0-0"===e.value,m=e=>""===e.value,v=(e,t)=>{let r=!0;const i=e.slice();let n=i.pop();for(;r&&i.length;)r=i.every((e=>n.intersects(e,t))),n=i.pop();return r},b=(e,t)=>(a("comp",e,t),e=E(e,t),a("caret",e),e=w(e,t),a("tildes",e),e=A(e,t),a("xrange",e),e=M(e,t),a("stars",e),e),_=e=>!e||"x"===e.toLowerCase()||"*"===e,w=(e,t)=>e.trim().split(/\s+/).map((e=>T(e,t))).join(" "),T=(e,t)=>{const r=t.loose?u[l.TILDELOOSE]:u[l.TILDE];return e.replace(r,((t,r,i,n,s)=>{let o;return a("tilde",e,t,r,i,n,s),_(r)?o="":_(i)?o=`>=${r}.0.0 <${+r+1}.0.0-0`:_(n)?o=`>=${r}.${i}.0 <${r}.${+i+1}.0-0`:s?(a("replaceTilde pr",s),o=`>=${r}.${i}.${n}-${s} <${r}.${+i+1}.0-0`):o=`>=${r}.${i}.${n} <${r}.${+i+1}.0-0`,a("tilde return",o),o}))},E=(e,t)=>e.trim().split(/\s+/).map((e=>S(e,t))).join(" "),S=(e,t)=>{a("caret",e,t);const r=t.loose?u[l.CARETLOOSE]:u[l.CARET],i=t.includePrerelease?"-0":"";return e.replace(r,((t,r,n,s,o)=>{let d;return a("caret",e,t,r,n,s,o),_(r)?d="":_(n)?d=`>=${r}.0.0${i} <${+r+1}.0.0-0`:_(s)?d="0"===r?`>=${r}.${n}.0${i} <${r}.${+n+1}.0-0`:`>=${r}.${n}.0${i} <${+r+1}.0.0-0`:o?(a("replaceCaret pr",o),d="0"===r?"0"===n?`>=${r}.${n}.${s}-${o} <${r}.${n}.${+s+1}-0`:`>=${r}.${n}.${s}-${o} <${r}.${+n+1}.0-0`:`>=${r}.${n}.${s}-${o} <${+r+1}.0.0-0`):(a("no pr"),d="0"===r?"0"===n?`>=${r}.${n}.${s}${i} <${r}.${n}.${+s+1}-0`:`>=${r}.${n}.${s}${i} <${r}.${+n+1}.0-0`:`>=${r}.${n}.${s} <${+r+1}.0.0-0`),a("caret return",d),d}))},A=(e,t)=>(a("replaceXRanges",e,t),e.split(/\s+/).map((e=>R(e,t))).join(" ")),R=(e,t)=>{e=e.trim();const r=t.loose?u[l.XRANGELOOSE]:u[l.XRANGE];return e.replace(r,((r,i,n,s,o,d)=>{a("xRange",e,r,i,n,s,o,d);const u=_(n),l=u||_(s),c=l||_(o),p=c;return"="===i&&p&&(i=""),d=t.includePrerelease?"-0":"",u?r=">"===i||"<"===i?"<0.0.0-0":"*":i&&p?(l&&(s=0),o=0,">"===i?(i=">=",l?(n=+n+1,s=0,o=0):(s=+s+1,o=0)):"<="===i&&(i="<",l?n=+n+1:s=+s+1),"<"===i&&(d="-0"),r=`${i+n}.${s}.${o}${d}`):l?r=`>=${n}.0.0${d} <${+n+1}.0.0-0`:c&&(r=`>=${n}.${s}.0${d} <${n}.${+s+1}.0-0`),a("xRange return",r),r}))},M=(e,t)=>(a("replaceStars",e,t),e.trim().replace(u[l.STAR],"")),I=(e,t)=>(a("replaceGTE0",e,t),e.trim().replace(u[t.includePrerelease?l.GTE0PRE:l.GTE0],"")),O=e=>(t,r,i,n,s,o,a,d,u,l,c,p,h)=>`${r=_(i)?"":_(n)?`>=${i}.0.0${e?"-0":""}`:_(s)?`>=${i}.${n}.0${e?"-0":""}`:o?`>=${r}`:`>=${r}${e?"-0":""}`} ${d=_(u)?"":_(l)?`<${+u+1}.0.0-0`:_(c)?`<${u}.${+l+1}.0-0`:p?`<=${u}.${l}.${c}-${p}`:e?`<${u}.${l}.${+c+1}-0`:`<=${d}`}`.trim(),x=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(a(e[r].semver),e[r].semver!==o.ANY&&e[r].semver.prerelease.length>0){const i=e[r].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}return!1}return!0}},4517:(e,t,r)=>{const i=r(1361),{MAX_LENGTH:n,MAX_SAFE_INTEGER:s}=r(9543),{safeRe:o,t:a}=r(2841),d=r(3990),{compareIdentifiers:u}=r(3806);class l{constructor(e,t){if(t=d(t),e instanceof l){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>n)throw new TypeError(`version is longer than ${n} characters`);i("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?o[a.LOOSE]:o[a.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>s||this.major<0)throw new TypeError("Invalid major version");if(this.minor>s||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>s||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t<s)return t}return e})):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(i("SemVer.compare",this.version,this.options,e),!(e instanceof l)){if("string"==typeof e&&e===this.version)return 0;e=new l(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof l||(e=new l(e,this.options)),u(this.major,e.major)||u(this.minor,e.minor)||u(this.patch,e.patch)}comparePre(e){if(e instanceof l||(e=new l(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{const r=this.prerelease[t],n=e.prerelease[t];if(i("prerelease compare",t,r,n),void 0===r&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===r)return-1;if(r!==n)return u(r,n)}while(++t)}compareBuild(e){e instanceof l||(e=new l(e,this.options));let t=0;do{const r=this.build[t],n=e.build[t];if(i("prerelease compare",t,r,n),void 0===r&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===r)return-1;if(r!==n)return u(r,n)}while(++t)}inc(e,t,r){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{const e=Number(r)?1:0;if(!t&&!1===r)throw new Error("invalid increment argument: identifier is empty");if(0===this.prerelease.length)this.prerelease=[e];else{let i=this.prerelease.length;for(;--i>=0;)"number"==typeof this.prerelease[i]&&(this.prerelease[i]++,i=-2);if(-1===i){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let i=[t,e];!1===r&&(i=[t]),0===u(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=l},2281:(e,t,r)=>{const i=r(3955);e.exports=(e,t)=>{const r=i(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},4004:(e,t,r)=>{const i=r(8848),n=r(8220),s=r(9761),o=r(2386),a=r(1262),d=r(9639);e.exports=(e,t,r,u)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return i(e,r,u);case"!=":return n(e,r,u);case">":return s(e,r,u);case">=":return o(e,r,u);case"<":return a(e,r,u);case"<=":return d(e,r,u);default:throw new TypeError(`Invalid operator: ${t}`)}}},6783:(e,t,r)=>{const i=r(4517),n=r(3955),{safeRe:s,t:o}=r(2841);e.exports=(e,t)=>{if(e instanceof i)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){const i=t.includePrerelease?s[o.COERCERTLFULL]:s[o.COERCERTL];let n;for(;(n=i.exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&n.index+n[0].length===r.index+r[0].length||(r=n),i.lastIndex=n.index+n[1].length+n[2].length;i.lastIndex=-1}else r=e.match(t.includePrerelease?s[o.COERCEFULL]:s[o.COERCE]);if(null===r)return null;const a=r[2],d=r[3]||"0",u=r[4]||"0",l=t.includePrerelease&&r[5]?`-${r[5]}`:"",c=t.includePrerelease&&r[6]?`+${r[6]}`:"";return n(`${a}.${d}.${u}${l}${c}`,t)}},6106:(e,t,r)=>{const i=r(4517);e.exports=(e,t,r)=>{const n=new i(e,r),s=new i(t,r);return n.compare(s)||n.compareBuild(s)}},2132:(e,t,r)=>{const i=r(7851);e.exports=(e,t)=>i(e,t,!0)},7851:(e,t,r)=>{const i=r(4517);e.exports=(e,t,r)=>new i(e,r).compare(new i(t,r))},3269:(e,t,r)=>{const i=r(3955);e.exports=(e,t)=>{const r=i(e,null,!0),n=i(t,null,!0),s=r.compare(n);if(0===s)return null;const o=s>0,a=o?r:n,d=o?n:r,u=!!a.prerelease.length;if(!!d.prerelease.length&&!u)return d.patch||d.minor?a.patch?"patch":a.minor?"minor":"major":"major";const l=u?"pre":"";return r.major!==n.major?l+"major":r.minor!==n.minor?l+"minor":r.patch!==n.patch?l+"patch":"prerelease"}},8848:(e,t,r)=>{const i=r(7851);e.exports=(e,t,r)=>0===i(e,t,r)},9761:(e,t,r)=>{const i=r(7851);e.exports=(e,t,r)=>i(e,t,r)>0},2386:(e,t,r)=>{const i=r(7851);e.exports=(e,t,r)=>i(e,t,r)>=0},8868:(e,t,r)=>{const i=r(4517);e.exports=(e,t,r,n,s)=>{"string"==typeof r&&(s=n,n=r,r=void 0);try{return new i(e instanceof i?e.version:e,r).inc(t,n,s).version}catch(e){return null}}},1262:(e,t,r)=>{const i=r(7851);e.exports=(e,t,r)=>i(e,t,r)<0},9639:(e,t,r)=>{const i=r(7851);e.exports=(e,t,r)=>i(e,t,r)<=0},6381:(e,t,r)=>{const i=r(4517);e.exports=(e,t)=>new i(e,t).major},1353:(e,t,r)=>{const i=r(4517);e.exports=(e,t)=>new i(e,t).minor},8220:(e,t,r)=>{const i=r(7851);e.exports=(e,t,r)=>0!==i(e,t,r)},3955:(e,t,r)=>{const i=r(4517);e.exports=(e,t,r=!1)=>{if(e instanceof i)return e;try{return new i(e,t)}catch(e){if(!r)return null;throw e}}},6082:(e,t,r)=>{const i=r(4517);e.exports=(e,t)=>new i(e,t).patch},9428:(e,t,r)=>{const i=r(3955);e.exports=(e,t)=>{const r=i(e,t);return r&&r.prerelease.length?r.prerelease:null}},7555:(e,t,r)=>{const i=r(7851);e.exports=(e,t,r)=>i(t,e,r)},3810:(e,t,r)=>{const i=r(6106);e.exports=(e,t)=>e.sort(((e,r)=>i(r,e,t)))},7229:(e,t,r)=>{const i=r(7476);e.exports=(e,t,r)=>{try{t=new i(t,r)}catch(e){return!1}return t.test(e)}},4042:(e,t,r)=>{const i=r(6106);e.exports=(e,t)=>e.sort(((e,r)=>i(e,r,t)))},8474:(e,t,r)=>{const i=r(3955);e.exports=(e,t)=>{const r=i(e,t);return r?r.version:null}},2722:(e,t,r)=>{const i=r(2841),n=r(9543),s=r(4517),o=r(3806),a=r(3955),d=r(8474),u=r(2281),l=r(8868),c=r(3269),p=r(6381),h=r(1353),f=r(6082),y=r(9428),g=r(7851),m=r(7555),v=r(2132),b=r(6106),_=r(4042),w=r(3810),T=r(9761),E=r(1262),S=r(8848),A=r(8220),R=r(2386),M=r(9639),I=r(4004),O=r(6783),x=r(1565),k=r(7476),C=r(7229),P=r(6364),D=r(5039),N=r(5357),B=r(1280),q=r(7403),L=r(8854),j=r(7226),F=r(7183),U=r(8623),z=r(6486),H=r(583);e.exports={parse:a,valid:d,clean:u,inc:l,diff:c,major:p,minor:h,patch:f,prerelease:y,compare:g,rcompare:m,compareLoose:v,compareBuild:b,sort:_,rsort:w,gt:T,lt:E,eq:S,neq:A,gte:R,lte:M,cmp:I,coerce:O,Comparator:x,Range:k,satisfies:C,toComparators:P,maxSatisfying:D,minSatisfying:N,minVersion:B,validRange:q,outside:L,gtr:j,ltr:F,intersects:U,simplifyRange:z,subset:H,SemVer:s,re:i.re,src:i.src,tokens:i.t,SEMVER_SPEC_VERSION:n.SEMVER_SPEC_VERSION,RELEASE_TYPES:n.RELEASE_TYPES,compareIdentifiers:o.compareIdentifiers,rcompareIdentifiers:o.rcompareIdentifiers}},9543:e=>{const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},1361:e=>{const t="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=t},3806:e=>{const t=/^[0-9]+$/,r=(e,r)=>{const i=t.test(e),n=t.test(r);return i&&n&&(e=+e,r=+r),e===r?0:i&&!n?-1:n&&!i?1:e<r?-1:1};e.exports={compareIdentifiers:r,rcompareIdentifiers:(e,t)=>r(t,e)}},3990:e=>{const t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},2841:(e,t,r)=>{const{MAX_SAFE_COMPONENT_LENGTH:i,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:s}=r(9543),o=r(1361),a=(t=e.exports={}).re=[],d=t.safeRe=[],u=t.src=[],l=t.t={};let c=0;const p="[a-zA-Z0-9-]",h=[["\\s",1],["\\d",s],[p,n]],f=(e,t,r)=>{const i=(e=>{for(const[t,r]of h)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),n=c++;o(e,n,t),l[e]=n,u[n]=t,a[n]=new RegExp(t,r?"g":void 0),d[n]=new RegExp(i,r?"g":void 0)};f("NUMERICIDENTIFIER","0|[1-9]\\d*"),f("NUMERICIDENTIFIERLOOSE","\\d+"),f("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${p}*`),f("MAINVERSION",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),f("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),f("PRERELEASEIDENTIFIER",`(?:${u[l.NUMERICIDENTIFIER]}|${u[l.NONNUMERICIDENTIFIER]})`),f("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NUMERICIDENTIFIERLOOSE]}|${u[l.NONNUMERICIDENTIFIER]})`),f("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.PRERELEASEIDENTIFIER]})*))`),f("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),f("BUILDIDENTIFIER",`${p}+`),f("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),f("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),f("FULL",`^${u[l.FULLPLAIN]}$`),f("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),f("LOOSE",`^${u[l.LOOSEPLAIN]}$`),f("GTLT","((?:<|>)?=?)"),f("XRANGEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),f("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),f("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),f("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),f("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}$`),f("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),f("COERCEPLAIN",`(^|[^\\d])(\\d{1,${i}})(?:\\.(\\d{1,${i}}))?(?:\\.(\\d{1,${i}}))?`),f("COERCE",`${u[l.COERCEPLAIN]}(?:$|[^\\d])`),f("COERCEFULL",u[l.COERCEPLAIN]+`(?:${u[l.PRERELEASE]})?`+`(?:${u[l.BUILD]})?(?:$|[^\\d])`),f("COERCERTL",u[l.COERCE],!0),f("COERCERTLFULL",u[l.COERCEFULL],!0),f("LONETILDE","(?:~>?)"),f("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",f("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}$`),f("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),f("LONECARET","(?:\\^)"),f("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",f("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),f("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),f("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),f("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),f("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",f("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),f("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),f("STAR","(<|>)?=?\\s*\\*"),f("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),f("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},7226:(e,t,r)=>{const i=r(8854);e.exports=(e,t,r)=>i(e,t,">",r)},8623:(e,t,r)=>{const i=r(7476);e.exports=(e,t,r)=>(e=new i(e,r),t=new i(t,r),e.intersects(t,r))},7183:(e,t,r)=>{const i=r(8854);e.exports=(e,t,r)=>i(e,t,"<",r)},5039:(e,t,r)=>{const i=r(4517),n=r(7476);e.exports=(e,t,r)=>{let s=null,o=null,a=null;try{a=new n(t,r)}catch(e){return null}return e.forEach((e=>{a.test(e)&&(s&&-1!==o.compare(e)||(s=e,o=new i(s,r)))})),s}},5357:(e,t,r)=>{const i=r(4517),n=r(7476);e.exports=(e,t,r)=>{let s=null,o=null,a=null;try{a=new n(t,r)}catch(e){return null}return e.forEach((e=>{a.test(e)&&(s&&1!==o.compare(e)||(s=e,o=new i(s,r)))})),s}},1280:(e,t,r)=>{const i=r(4517),n=r(7476),s=r(9761);e.exports=(e,t)=>{e=new n(e,t);let r=new i("0.0.0");if(e.test(r))return r;if(r=new i("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t<e.set.length;++t){const n=e.set[t];let o=null;n.forEach((e=>{const t=new i(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":o&&!s(t,o)||(o=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!o||r&&!s(r,o)||(r=o)}return r&&e.test(r)?r:null}},8854:(e,t,r)=>{const i=r(4517),n=r(1565),{ANY:s}=n,o=r(7476),a=r(7229),d=r(9761),u=r(1262),l=r(9639),c=r(2386);e.exports=(e,t,r,p)=>{let h,f,y,g,m;switch(e=new i(e,p),t=new o(t,p),r){case">":h=d,f=l,y=u,g=">",m=">=";break;case"<":h=u,f=c,y=d,g="<",m="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,t,p))return!1;for(let r=0;r<t.set.length;++r){const i=t.set[r];let o=null,a=null;if(i.forEach((e=>{e.semver===s&&(e=new n(">=0.0.0")),o=o||e,a=a||e,h(e.semver,o.semver,p)?o=e:y(e.semver,a.semver,p)&&(a=e)})),o.operator===g||o.operator===m)return!1;if((!a.operator||a.operator===g)&&f(e,a.semver))return!1;if(a.operator===m&&y(e,a.semver))return!1}return!0}},6486:(e,t,r)=>{const i=r(7229),n=r(7851);e.exports=(e,t,r)=>{const s=[];let o=null,a=null;const d=e.sort(((e,t)=>n(e,t,r)));for(const e of d){i(e,t,r)?(a=e,o||(o=e)):(a&&s.push([o,a]),a=null,o=null)}o&&s.push([o,null]);const u=[];for(const[e,t]of s)e===t?u.push(e):t||e!==d[0]?t?e===d[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");const l=u.join(" || "),c="string"==typeof t.raw?t.raw:String(t);return l.length<c.length?l:t}},583:(e,t,r)=>{const i=r(7476),n=r(1565),{ANY:s}=n,o=r(7229),a=r(7851),d=[new n(">=0.0.0-0")],u=[new n(">=0.0.0")],l=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===s){if(1===t.length&&t[0].semver===s)return!0;e=r.includePrerelease?d:u}if(1===t.length&&t[0].semver===s){if(r.includePrerelease)return!0;t=u}const i=new Set;let n,l,h,f,y,g,m;for(const t of e)">"===t.operator||">="===t.operator?n=c(n,t,r):"<"===t.operator||"<="===t.operator?l=p(l,t,r):i.add(t.semver);if(i.size>1)return null;if(n&&l){if(h=a(n.semver,l.semver,r),h>0)return null;if(0===h&&(">="!==n.operator||"<="!==l.operator))return null}for(const e of i){if(n&&!o(e,String(n),r))return null;if(l&&!o(e,String(l),r))return null;for(const i of t)if(!o(e,String(i),r))return!1;return!0}let v=!(!l||r.includePrerelease||!l.semver.prerelease.length)&&l.semver,b=!(!n||r.includePrerelease||!n.semver.prerelease.length)&&n.semver;v&&1===v.prerelease.length&&"<"===l.operator&&0===v.prerelease[0]&&(v=!1);for(const e of t){if(m=m||">"===e.operator||">="===e.operator,g=g||"<"===e.operator||"<="===e.operator,n)if(b&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===b.major&&e.semver.minor===b.minor&&e.semver.patch===b.patch&&(b=!1),">"===e.operator||">="===e.operator){if(f=c(n,e,r),f===e&&f!==n)return!1}else if(">="===n.operator&&!o(n.semver,String(e),r))return!1;if(l)if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),"<"===e.operator||"<="===e.operator){if(y=p(l,e,r),y===e&&y!==l)return!1}else if("<="===l.operator&&!o(l.semver,String(e),r))return!1;if(!e.operator&&(l||n)&&0!==h)return!1}return!(n&&g&&!l&&0!==h)&&(!(l&&m&&!n&&0!==h)&&(!b&&!v))},c=(e,t,r)=>{if(!e)return t;const i=a(e.semver,t.semver,r);return i>0?e:i<0||">"===t.operator&&">="===e.operator?t:e},p=(e,t,r)=>{if(!e)return t;const i=a(e.semver,t.semver,r);return i<0?e:i>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new i(e,r),t=new i(t,r);let n=!1;e:for(const i of e.set){for(const e of t.set){const t=l(i,e,r);if(n=n||null!==t,t)continue e}if(n)return!1}return!0}},6364:(e,t,r)=>{const i=r(7476);e.exports=(e,t)=>new i(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},7403:(e,t,r)=>{const i=r(7476);e.exports=(e,t)=>{try{return new i(e,t).range||"*"}catch(e){return null}}},6108:(e,t,r)=>{"use strict";var i=r(528),n=r(686),s=r(7239)(),o=r(8246),a=i("%TypeError%"),d=i("%Math.floor%");e.exports=function(e,t){if("function"!=typeof e)throw new a("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||d(t)!==t)throw new a("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],i=!0,u=!0;if("length"in e&&o){var l=o(e,"length");l&&!l.configurable&&(i=!1),l&&!l.writable&&(u=!1)}return(i||u||!r)&&(s?n(e,"length",t,!0,!0):n(e,"length",t)),e}},8246:(e,t,r)=>{"use strict";var i=r(528)("%Object.getOwnPropertyDescriptor%",!0);if(i)try{i([],"length")}catch(e){i=null}e.exports=i},766:function(e,t,r){!function(e,t){"use strict";if(!e.setImmediate){var r,i,n,s,o,a=1,d={},u=!1,l=e.document,c=Object.getPrototypeOf&&Object.getPrototypeOf(e);c=c&&c.setTimeout?c:e,"[object process]"==={}.toString.call(e.process)?r=function(e){process.nextTick((function(){h(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}}()?e.MessageChannel?((n=new MessageChannel).port1.onmessage=function(e){h(e.data)},r=function(e){n.port2.postMessage(e)}):l&&"onreadystatechange"in l.createElement("script")?(i=l.documentElement,r=function(e){var t=l.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(h,0,e)}:(s="setImmediate$"+Math.random()+"$",o=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&h(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",o,!1):e.attachEvent("onmessage",o),r=function(t){e.postMessage(s+t,"*")}),c.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),i=0;i<t.length;i++)t[i]=arguments[i+1];var n={callback:e,args:t};return d[a]=n,r(a),a++},c.clearImmediate=p}function p(e){delete d[e]}function h(e){if(u)setTimeout(h,0,e);else{var r=d[e];if(r){u=!0;try{!function(e){var r=e.callback,i=e.args;switch(i.length){case 0:r();break;case 1:r(i[0]);break;case 2:r(i[0],i[1]);break;case 3:r(i[0],i[1],i[2]);break;default:r.apply(t,i)}}(r)}finally{p(e),u=!1}}}}}("undefined"==typeof self?void 0===r.g?this:r.g:self)},1229:(e,t,r)=>{"use strict";var i=r(5636).Buffer,n=r(8764);function s(e,t){this._block=i.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}s.prototype.update=function(e,t){e=n(e,t||"utf8");for(var r=this._block,i=this._blockSize,s=e.length,o=this._len,a=0;a<s;){for(var d=o%i,u=Math.min(s-a,i-d),l=0;l<u;l++)r[d+l]=e[a+l];a+=u,(o+=u)%i==0&&this._update(r)}return this._len+=s,this},s.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(4294967295&r)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var s=this._hash();return e?s.toString(e):s},s.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=s},3229:(e,t,r)=>{"use strict";e.exports=function(t){var r=t.toLowerCase(),i=e.exports[r];if(!i)throw new Error(r+" is not supported (we accept pull requests)");return new i},e.exports.sha=r(3675),e.exports.sha1=r(8980),e.exports.sha224=r(947),e.exports.sha256=r(2826),e.exports.sha384=r(9922),e.exports.sha512=r(3699)},3675:(e,t,r)=>{"use strict";var i=r(5615),n=r(1229),s=r(5636).Buffer,o=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function d(){this.init(),this._w=a,n.call(this,64,56)}function u(e){return e<<30|e>>>2}function l(e,t,r,i){return 0===e?t&r|~t&i:2===e?t&r|t&i|r&i:t^r^i}i(d,n),d.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},d.prototype._update=function(e){for(var t,r=this._w,i=0|this._a,n=0|this._b,s=0|this._c,a=0|this._d,d=0|this._e,c=0;c<16;++c)r[c]=e.readInt32BE(4*c);for(;c<80;++c)r[c]=r[c-3]^r[c-8]^r[c-14]^r[c-16];for(var p=0;p<80;++p){var h=~~(p/20),f=0|((t=i)<<5|t>>>27)+l(h,n,s,a)+d+r[p]+o[h];d=a,a=s,s=u(n),n=i,i=f}this._a=i+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=a+this._d|0,this._e=d+this._e|0},d.prototype._hash=function(){var e=s.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=d},8980:(e,t,r)=>{"use strict";var i=r(5615),n=r(1229),s=r(5636).Buffer,o=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function d(){this.init(),this._w=a,n.call(this,64,56)}function u(e){return e<<5|e>>>27}function l(e){return e<<30|e>>>2}function c(e,t,r,i){return 0===e?t&r|~t&i:2===e?t&r|t&i|r&i:t^r^i}i(d,n),d.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},d.prototype._update=function(e){for(var t,r=this._w,i=0|this._a,n=0|this._b,s=0|this._c,a=0|this._d,d=0|this._e,p=0;p<16;++p)r[p]=e.readInt32BE(4*p);for(;p<80;++p)r[p]=(t=r[p-3]^r[p-8]^r[p-14]^r[p-16])<<1|t>>>31;for(var h=0;h<80;++h){var f=~~(h/20),y=u(i)+c(f,n,s,a)+d+r[h]+o[f]|0;d=a,a=s,s=l(n),n=i,i=y}this._a=i+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=a+this._d|0,this._e=d+this._e|0},d.prototype._hash=function(){var e=s.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=d},947:(e,t,r)=>{"use strict";var i=r(5615),n=r(2826),s=r(1229),o=r(5636).Buffer,a=new Array(64);function d(){this.init(),this._w=a,s.call(this,64,56)}i(d,n),d.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},d.prototype._hash=function(){var e=o.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=d},2826:(e,t,r)=>{"use strict";var i=r(5615),n=r(1229),s=r(5636).Buffer,o=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=new Array(64);function d(){this.init(),this._w=a,n.call(this,64,56)}function u(e,t,r){return r^e&(t^r)}function l(e,t,r){return e&t|r&(e|t)}function c(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function p(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function h(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}i(d,n),d.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},d.prototype._update=function(e){for(var t,r=this._w,i=0|this._a,n=0|this._b,s=0|this._c,a=0|this._d,d=0|this._e,f=0|this._f,y=0|this._g,g=0|this._h,m=0;m<16;++m)r[m]=e.readInt32BE(4*m);for(;m<64;++m)r[m]=0|(((t=r[m-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[m-7]+h(r[m-15])+r[m-16];for(var v=0;v<64;++v){var b=g+p(d)+u(d,f,y)+o[v]+r[v]|0,_=c(i)+l(i,n,s)|0;g=y,y=f,f=d,d=a+b|0,a=s,s=n,n=i,i=b+_|0}this._a=i+this._a|0,this._b=n+this._b|0,this._c=s+this._c|0,this._d=a+this._d|0,this._e=d+this._e|0,this._f=f+this._f|0,this._g=y+this._g|0,this._h=g+this._h|0},d.prototype._hash=function(){var e=s.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=d},9922:(e,t,r)=>{"use strict";var i=r(5615),n=r(3699),s=r(1229),o=r(5636).Buffer,a=new Array(160);function d(){this.init(),this._w=a,s.call(this,128,112)}i(d,n),d.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},d.prototype._hash=function(){var e=o.allocUnsafe(48);function t(t,r,i){e.writeInt32BE(t,i),e.writeInt32BE(r,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=d},3699:(e,t,r)=>{"use strict";var i=r(5615),n=r(1229),s=r(5636).Buffer,o=[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],a=new Array(160);function d(){this.init(),this._w=a,n.call(this,128,112)}function u(e,t,r){return r^e&(t^r)}function l(e,t,r){return e&t|r&(e|t)}function c(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function p(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function h(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function f(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function y(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function g(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function m(e,t){return e>>>0<t>>>0?1:0}i(d,n),d.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},d.prototype._update=function(e){for(var t=this._w,r=0|this._ah,i=0|this._bh,n=0|this._ch,s=0|this._dh,a=0|this._eh,d=0|this._fh,v=0|this._gh,b=0|this._hh,_=0|this._al,w=0|this._bl,T=0|this._cl,E=0|this._dl,S=0|this._el,A=0|this._fl,R=0|this._gl,M=0|this._hl,I=0;I<32;I+=2)t[I]=e.readInt32BE(4*I),t[I+1]=e.readInt32BE(4*I+4);for(;I<160;I+=2){var O=t[I-30],x=t[I-30+1],k=h(O,x),C=f(x,O),P=y(O=t[I-4],x=t[I-4+1]),D=g(x,O),N=t[I-14],B=t[I-14+1],q=t[I-32],L=t[I-32+1],j=C+B|0,F=k+N+m(j,C)|0;F=(F=F+P+m(j=j+D|0,D)|0)+q+m(j=j+L|0,L)|0,t[I]=F,t[I+1]=j}for(var U=0;U<160;U+=2){F=t[U],j=t[U+1];var z=l(r,i,n),H=l(_,w,T),G=c(r,_),K=c(_,r),W=p(a,S),V=p(S,a),$=o[U],Z=o[U+1],Y=u(a,d,v),J=u(S,A,R),X=M+V|0,Q=b+W+m(X,M)|0;Q=(Q=(Q=Q+Y+m(X=X+J|0,J)|0)+$+m(X=X+Z|0,Z)|0)+F+m(X=X+j|0,j)|0;var ee=K+H|0,te=G+z+m(ee,K)|0;b=v,M=R,v=d,R=A,d=a,A=S,a=s+Q+m(S=E+X|0,E)|0,s=n,E=T,n=i,T=w,i=r,w=_,r=Q+te+m(_=X+ee|0,X)|0}this._al=this._al+_|0,this._bl=this._bl+w|0,this._cl=this._cl+T|0,this._dl=this._dl+E|0,this._el=this._el+S|0,this._fl=this._fl+A|0,this._gl=this._gl+R|0,this._hl=this._hl+M|0,this._ah=this._ah+r+m(this._al,_)|0,this._bh=this._bh+i+m(this._bl,w)|0,this._ch=this._ch+n+m(this._cl,T)|0,this._dh=this._dh+s+m(this._dl,E)|0,this._eh=this._eh+a+m(this._el,S)|0,this._fh=this._fh+d+m(this._fl,A)|0,this._gh=this._gh+v+m(this._gl,R)|0,this._hh=this._hh+b+m(this._hl,M)|0},d.prototype._hash=function(){var e=s.allocUnsafe(64);function t(t,r,i){e.writeInt32BE(t,i),e.writeInt32BE(r,i+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=d},1983:(e,t,r)=>{e.exports=n;var i=r(46).EventEmitter;function n(){i.call(this)}r(5615)(n,i),n.Readable=r(8199),n.Writable=r(5291),n.Duplex=r(1265),n.Transform=r(9415),n.PassThrough=r(4421),n.finished=r(4869),n.pipeline=r(6815),n.Stream=n,n.prototype.pipe=function(e,t){var r=this;function n(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function s(){r.readable&&r.resume&&r.resume()}r.on("data",n),e.on("drain",s),e._isStdio||t&&!1===t.end||(r.on("end",a),r.on("close",d));var o=!1;function a(){o||(o=!0,e.end())}function d(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(l(),0===i.listenerCount(this,"error"))throw e}function l(){r.removeListener("data",n),e.removeListener("drain",s),r.removeListener("end",a),r.removeListener("close",d),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",l),r.removeListener("close",l),e.removeListener("close",l)}return r.on("error",u),e.on("error",u),r.on("end",l),r.on("close",l),e.on("close",l),e.emit("pipe",r),e}},6296:(e,t,r)=>{var i=r(1048).Buffer,n=i.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};var s=t.I=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!n(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=a;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=d;break;default:return void(this.write=o)}this.charBuffer=new i(6),this.charReceived=0,this.charLength=0};function o(e){return e.toString(this.encoding)}function a(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function d(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}s.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived<this.charLength)return"";if(e=e.slice(r,e.length),!((n=(t=this.charBuffer.slice(0,this.charLength).toString(this.encoding)).charCodeAt(t.length-1))>=55296&&n<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var i=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,i),i-=this.charReceived);var n;i=(t+=e.toString(this.encoding,0,i)).length-1;if((n=t.charCodeAt(i))>=55296&&n<=56319){var s=this.surrogateSize;return this.charLength+=s,this.charReceived+=s,this.charBuffer.copy(this.charBuffer,s,0,s),e.copy(this.charBuffer,0,0,s),t.substring(0,i)}return t},s.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var r=e[e.length-t];if(1==t&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},s.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,i=this.charBuffer,n=this.encoding;t+=i.slice(0,r).toString(n)}return t}},8764:(e,t,r)=>{"use strict";var i=r(5636).Buffer,n=r(9196),s=r(1279),o=ArrayBuffer.isView||function(e){try{return s(e),!0}catch(e){return!1}},a="undefined"!=typeof Uint8Array,d="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,u=d&&(i.prototype instanceof Uint8Array||i.TYPED_ARRAY_SUPPORT);e.exports=function(e,t){if(e instanceof i)return e;if("string"==typeof e)return i.from(e,t);if(d&&o(e)){if(0===e.byteLength)return i.alloc(0);if(u){var r=i.from(e.buffer,e.byteOffset,e.byteLength);if(r.byteLength===e.byteLength)return r}var s=e instanceof Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),l=i.from(s);if(l.length===e.byteLength)return l}if(a&&e instanceof Uint8Array)return i.from(e);var c=n(e);if(c)for(var p=0;p<e.length;p+=1){var h=e[p];if("number"!=typeof h||h<0||h>255||~~h!==h)throw new RangeError("Array items must be numbers in the range 0-255.")}if(c||i.isBuffer(e)&&e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e))return i.from(e);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}},1279:(e,t,r)=>{"use strict";var i=r(3468),n=r(4607)("TypedArray.prototype.buffer",!0),s=r(6258);e.exports=n||function(e){if(!s(e))throw new i("Not a Typed Array");return e.buffer}},6405:(e,t,r)=>{"use strict";var i=r(8875),n=r(4940),s=r(2284),o=r(2012);e.exports=function(e){var t=s(arguments),r=e.length-(arguments.length-1);return i(t,1+(r>0?r:0),!0)},n?n(e.exports,"apply",{value:o}):e.exports.apply=o},6955:(e,t,r)=>{"use strict";var i=r(4940),n=r(5731),s=r(3468),o=r(4477);e.exports=function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new s("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new s("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new s("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new s("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new s("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new s("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,d=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],c=!!o&&o(e,t);if(i)i(e,t,{configurable:null===u&&c?c.configurable:!u,enumerable:null===a&&c?c.enumerable:!a,value:r,writable:null===d&&c?c.writable:!d});else{if(!l&&(a||d||u))throw new n("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},9067:(e,t,r)=>{"use strict";var i,n=SyntaxError,s=Function,o=TypeError,a=function(e){try{return s('"use strict"; return ('+e+").constructor;")()}catch(e){}},d=Object.getOwnPropertyDescriptor;if(d)try{d({},"")}catch(e){d=null}var u=function(){throw new o},l=d?function(){try{return u}catch(e){try{return d(arguments,"callee").get}catch(e){return u}}}():u,c=r(3558)(),p=r(6869)(),h=Object.getPrototypeOf||(p?function(e){return e.__proto__}:null),f={},y="undefined"!=typeof Uint8Array&&h?h(Uint8Array):i,g={"%AggregateError%":"undefined"==typeof AggregateError?i:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?i:ArrayBuffer,"%ArrayIteratorPrototype%":c&&h?h([][Symbol.iterator]()):i,"%AsyncFromSyncIteratorPrototype%":i,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":"undefined"==typeof Atomics?i:Atomics,"%BigInt%":"undefined"==typeof BigInt?i:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?i:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?i:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?i:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?i:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?i:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?i:FinalizationRegistry,"%Function%":s,"%GeneratorFunction%":f,"%Int8Array%":"undefined"==typeof Int8Array?i:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?i:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?i:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":c&&h?h(h([][Symbol.iterator]())):i,"%JSON%":"object"==typeof JSON?JSON:i,"%Map%":"undefined"==typeof Map?i:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&c&&h?h((new Map)[Symbol.iterator]()):i,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?i:Promise,"%Proxy%":"undefined"==typeof Proxy?i:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?i:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?i:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&c&&h?h((new Set)[Symbol.iterator]()):i,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?i:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":c&&h?h(""[Symbol.iterator]()):i,"%Symbol%":c?Symbol:i,"%SyntaxError%":n,"%ThrowTypeError%":l,"%TypedArray%":y,"%TypeError%":o,"%Uint8Array%":"undefined"==typeof Uint8Array?i:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?i:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?i:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?i:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?i:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?i:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?i:WeakSet};if(h)try{null.error}catch(e){var m=h(h(e));g["%Error.prototype%"]=m}var v=function e(t){var r;if("%AsyncFunction%"===t)r=a("async function () {}");else if("%GeneratorFunction%"===t)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=a("async function* () {}");else if("%AsyncGenerator%"===t){var i=e("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if("%AsyncIteratorPrototype%"===t){var n=e("%AsyncGenerator%");n&&h&&(r=h(n.prototype))}return g[t]=r,r},b={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},_=r(9138),w=r(143),T=_.call(Function.call,Array.prototype.concat),E=_.call(Function.apply,Array.prototype.splice),S=_.call(Function.call,String.prototype.replace),A=_.call(Function.call,String.prototype.slice),R=_.call(Function.call,RegExp.prototype.exec),M=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,I=/\\(\\)?/g,O=function(e,t){var r,i=e;if(w(b,i)&&(i="%"+(r=b[i])[0]+"%"),w(g,i)){var s=g[i];if(s===f&&(s=v(i)),void 0===s&&!t)throw new o("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:i,value:s}}throw new n("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new o('"allowMissing" argument must be a boolean');if(null===R(/^%?[^%]*%?$/,e))throw new n("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=A(e,0,1),r=A(e,-1);if("%"===t&&"%"!==r)throw new n("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new n("invalid intrinsic syntax, expected opening `%`");var i=[];return S(e,M,(function(e,t,r,n){i[i.length]=r?S(n,I,"$1"):t||e})),i}(e),i=r.length>0?r[0]:"",s=O("%"+i+"%",t),a=s.name,u=s.value,l=!1,c=s.alias;c&&(i=c[0],E(r,T([0,1],c)));for(var p=1,h=!0;p<r.length;p+=1){var f=r[p],y=A(f,0,1),m=A(f,-1);if(('"'===y||"'"===y||"`"===y||'"'===m||"'"===m||"`"===m)&&y!==m)throw new n("property names with quotes must have matching quotes");if("constructor"!==f&&h||(l=!0),w(g,a="%"+(i+="."+f)+"%"))u=g[a];else if(null!=u){if(!(f in u)){if(!t)throw new o("base intrinsic for "+e+" exists, but the property is not available.");return}if(d&&p+1>=r.length){var v=d(u,f);u=(h=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:u[f]}else h=w(u,f),u=u[f];h&&!l&&(g[a]=u)}}return u}},4477:(e,t,r)=>{"use strict";var i=r(9067)("%Object.getOwnPropertyDescriptor%",!0);if(i)try{i([],"length")}catch(e){i=null}e.exports=i},143:(e,t,r)=>{"use strict";var i=Function.prototype.call,n=Object.prototype.hasOwnProperty,s=r(9138);e.exports=s.call(i,n)},48:(e,t,r)=>{"use strict";var i=r(9617),n=Object.prototype.toString,s=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){if(!i(t))throw new TypeError("iterator must be a function");var o,a;arguments.length>=3&&(o=r),a=e,"[object Array]"===n.call(a)?function(e,t,r){for(var i=0,n=e.length;i<n;i++)s.call(e,i)&&(null==r?t(e[i],i,e):t.call(r,e[i],i,e))}(e,t,o):"string"==typeof e?function(e,t,r){for(var i=0,n=e.length;i<n;i++)null==r?t(e.charAt(i),i,e):t.call(r,e.charAt(i),i,e)}(e,t,o):function(e,t,r){for(var i in e)s.call(e,i)&&(null==r?t(e[i],i,e):t.call(r,e[i],i,e))}(e,t,o)}},503:(e,t,r)=>{"use strict";var i,n=r(9629),s=r(9838),o=r(9110),a=r(1155),d=r(4943),u=r(5731),l=r(3468),c=r(2140),p=r(8479),h=r(8449),f=r(8129),y=r(2387),g=r(5865),m=r(1319),v=r(6882),b=Function,_=function(e){try{return b('"use strict"; return ('+e+").constructor;")()}catch(e){}},w=r(9336),T=r(4940),E=function(){throw new l},S=w?function(){try{return E}catch(e){try{return w(arguments,"callee").get}catch(e){return E}}}():E,A=r(3717)(),R=r(6369),M=r(7345),I=r(7859),O=r(6095),x=r(4531),k={},C="undefined"!=typeof Uint8Array&&R?R(Uint8Array):i,P={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?i:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?i:ArrayBuffer,"%ArrayIteratorPrototype%":A&&R?R([][Symbol.iterator]()):i,"%AsyncFromSyncIteratorPrototype%":i,"%AsyncFunction%":k,"%AsyncGenerator%":k,"%AsyncGeneratorFunction%":k,"%AsyncIteratorPrototype%":k,"%Atomics%":"undefined"==typeof Atomics?i:Atomics,"%BigInt%":"undefined"==typeof BigInt?i:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?i:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?i:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?i:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":s,"%eval%":eval,"%EvalError%":o,"%Float16Array%":"undefined"==typeof Float16Array?i:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?i:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?i:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?i:FinalizationRegistry,"%Function%":b,"%GeneratorFunction%":k,"%Int8Array%":"undefined"==typeof Int8Array?i:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?i:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?i:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":A&&R?R(R([][Symbol.iterator]())):i,"%JSON%":"object"==typeof JSON?JSON:i,"%Map%":"undefined"==typeof Map?i:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&A&&R?R((new Map)[Symbol.iterator]()):i,"%Math%":Math,"%Number%":Number,"%Object%":n,"%Object.getOwnPropertyDescriptor%":w,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?i:Promise,"%Proxy%":"undefined"==typeof Proxy?i:Proxy,"%RangeError%":a,"%ReferenceError%":d,"%Reflect%":"undefined"==typeof Reflect?i:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?i:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&A&&R?R((new Set)[Symbol.iterator]()):i,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?i:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":A&&R?R(""[Symbol.iterator]()):i,"%Symbol%":A?Symbol:i,"%SyntaxError%":u,"%ThrowTypeError%":S,"%TypedArray%":C,"%TypeError%":l,"%Uint8Array%":"undefined"==typeof Uint8Array?i:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?i:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?i:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?i:Uint32Array,"%URIError%":c,"%WeakMap%":"undefined"==typeof WeakMap?i:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?i:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?i:WeakSet,"%Function.prototype.call%":x,"%Function.prototype.apply%":O,"%Object.defineProperty%":T,"%Object.getPrototypeOf%":M,"%Math.abs%":p,"%Math.floor%":h,"%Math.max%":f,"%Math.min%":y,"%Math.pow%":g,"%Math.round%":m,"%Math.sign%":v,"%Reflect.getPrototypeOf%":I};if(R)try{null.error}catch(e){var D=R(R(e));P["%Error.prototype%"]=D}var N=function e(t){var r;if("%AsyncFunction%"===t)r=_("async function () {}");else if("%GeneratorFunction%"===t)r=_("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=_("async function* () {}");else if("%AsyncGenerator%"===t){var i=e("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if("%AsyncIteratorPrototype%"===t){var n=e("%AsyncGenerator%");n&&R&&(r=R(n.prototype))}return P[t]=r,r},B={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},q=r(9138),L=r(8554),j=q.call(x,Array.prototype.concat),F=q.call(O,Array.prototype.splice),U=q.call(x,String.prototype.replace),z=q.call(x,String.prototype.slice),H=q.call(x,RegExp.prototype.exec),G=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,K=/\\(\\)?/g,W=function(e,t){var r,i=e;if(L(B,i)&&(i="%"+(r=B[i])[0]+"%"),L(P,i)){var n=P[i];if(n===k&&(n=N(i)),void 0===n&&!t)throw new l("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:i,value:n}}throw new u("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new l('"allowMissing" argument must be a boolean');if(null===H(/^%?[^%]*%?$/,e))throw new u("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=z(e,0,1),r=z(e,-1);if("%"===t&&"%"!==r)throw new u("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new u("invalid intrinsic syntax, expected opening `%`");var i=[];return U(e,G,(function(e,t,r,n){i[i.length]=r?U(n,K,"$1"):t||e})),i}(e),i=r.length>0?r[0]:"",n=W("%"+i+"%",t),s=n.name,o=n.value,a=!1,d=n.alias;d&&(i=d[0],F(r,j([0,1],d)));for(var c=1,p=!0;c<r.length;c+=1){var h=r[c],f=z(h,0,1),y=z(h,-1);if(('"'===f||"'"===f||"`"===f||'"'===y||"'"===y||"`"===y)&&f!==y)throw new u("property names with quotes must have matching quotes");if("constructor"!==h&&p||(a=!0),L(P,s="%"+(i+="."+h)+"%"))o=P[s];else if(null!=o){if(!(h in o)){if(!t)throw new l("base intrinsic for "+e+" exists, but the property is not available.");return}if(w&&c+1>=r.length){var g=w(o,h);o=(p=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:o[h]}else p=L(o,h),o=o[h];p&&!a&&(P[s]=o)}}return o}},3717:(e,t,r)=>{"use strict";var i="undefined"!=typeof Symbol&&Symbol,n=r(6135);e.exports=function(){return"function"==typeof i&&("function"==typeof Symbol&&("symbol"==typeof i("foo")&&("symbol"==typeof Symbol("bar")&&n())))}},6135:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var i in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var s=Object.getOwnPropertyDescriptor(e,t);if(42!==s.value||!0!==s.enumerable)return!1}return!0}},9870:(e,t,r)=>{"use strict";var i=r(4940),n=function(){return!!i};n.hasArrayLengthDefineBug=function(){if(!i)return null;try{return 1!==i([],"length",{value:1}).length}catch(e){return!0}},e.exports=n},3766:(e,t,r)=>{"use strict";var i=r(2908);e.exports=function(){return i()&&!!Symbol.toStringTag}},6258:(e,t,r)=>{"use strict";var i=r(1769);e.exports=function(e){return!!i(e)}},8875:(e,t,r)=>{"use strict";var i=r(503),n=r(6955),s=r(9870)(),o=r(2909),a=r(3468),d=i("%Math.floor%");e.exports=function(e,t){if("function"!=typeof e)throw new a("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||d(t)!==t)throw new a("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],i=!0,u=!0;if("length"in e&&o){var l=o(e,"length");l&&!l.configurable&&(i=!1),l&&!l.writable&&(u=!1)}return(i||u||!r)&&(s?n(e,"length",t,!0,!0):n(e,"length",t)),e}},2909:(e,t,r)=>{"use strict";var i=r(8762)("%Object.getOwnPropertyDescriptor%",!0);if(i)try{i([],"length")}catch(e){i=null}e.exports=i},8762:(e,t,r)=>{"use strict";var i,n=SyntaxError,s=Function,o=TypeError,a=function(e){try{return s('"use strict"; return ('+e+").constructor;")()}catch(e){}},d=Object.getOwnPropertyDescriptor;if(d)try{d({},"")}catch(e){d=null}var u=function(){throw new o},l=d?function(){try{return u}catch(e){try{return d(arguments,"callee").get}catch(e){return u}}}():u,c=r(3558)(),p=r(6869)(),h=Object.getPrototypeOf||(p?function(e){return e.__proto__}:null),f={},y="undefined"!=typeof Uint8Array&&h?h(Uint8Array):i,g={"%AggregateError%":"undefined"==typeof AggregateError?i:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?i:ArrayBuffer,"%ArrayIteratorPrototype%":c&&h?h([][Symbol.iterator]()):i,"%AsyncFromSyncIteratorPrototype%":i,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":"undefined"==typeof Atomics?i:Atomics,"%BigInt%":"undefined"==typeof BigInt?i:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?i:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?i:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?i:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?i:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?i:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?i:FinalizationRegistry,"%Function%":s,"%GeneratorFunction%":f,"%Int8Array%":"undefined"==typeof Int8Array?i:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?i:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?i:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":c&&h?h(h([][Symbol.iterator]())):i,"%JSON%":"object"==typeof JSON?JSON:i,"%Map%":"undefined"==typeof Map?i:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&c&&h?h((new Map)[Symbol.iterator]()):i,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?i:Promise,"%Proxy%":"undefined"==typeof Proxy?i:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?i:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?i:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&c&&h?h((new Set)[Symbol.iterator]()):i,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?i:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":c&&h?h(""[Symbol.iterator]()):i,"%Symbol%":c?Symbol:i,"%SyntaxError%":n,"%ThrowTypeError%":l,"%TypedArray%":y,"%TypeError%":o,"%Uint8Array%":"undefined"==typeof Uint8Array?i:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?i:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?i:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?i:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?i:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?i:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?i:WeakSet};if(h)try{null.error}catch(e){var m=h(h(e));g["%Error.prototype%"]=m}var v=function e(t){var r;if("%AsyncFunction%"===t)r=a("async function () {}");else if("%GeneratorFunction%"===t)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=a("async function* () {}");else if("%AsyncGenerator%"===t){var i=e("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if("%AsyncIteratorPrototype%"===t){var n=e("%AsyncGenerator%");n&&h&&(r=h(n.prototype))}return g[t]=r,r},b={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},_=r(9138),w=r(7071),T=_.call(Function.call,Array.prototype.concat),E=_.call(Function.apply,Array.prototype.splice),S=_.call(Function.call,String.prototype.replace),A=_.call(Function.call,String.prototype.slice),R=_.call(Function.call,RegExp.prototype.exec),M=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,I=/\\(\\)?/g,O=function(e,t){var r,i=e;if(w(b,i)&&(i="%"+(r=b[i])[0]+"%"),w(g,i)){var s=g[i];if(s===f&&(s=v(i)),void 0===s&&!t)throw new o("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:i,value:s}}throw new n("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new o("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new o('"allowMissing" argument must be a boolean');if(null===R(/^%?[^%]*%?$/,e))throw new n("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=A(e,0,1),r=A(e,-1);if("%"===t&&"%"!==r)throw new n("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new n("invalid intrinsic syntax, expected opening `%`");var i=[];return S(e,M,(function(e,t,r,n){i[i.length]=r?S(n,I,"$1"):t||e})),i}(e),i=r.length>0?r[0]:"",s=O("%"+i+"%",t),a=s.name,u=s.value,l=!1,c=s.alias;c&&(i=c[0],E(r,T([0,1],c)));for(var p=1,h=!0;p<r.length;p+=1){var f=r[p],y=A(f,0,1),m=A(f,-1);if(('"'===y||"'"===y||"`"===y||'"'===m||"'"===m||"`"===m)&&y!==m)throw new n("property names with quotes must have matching quotes");if("constructor"!==f&&h||(l=!0),w(g,a="%"+(i+="."+f)+"%"))u=g[a];else if(null!=u){if(!(f in u)){if(!t)throw new o("base intrinsic for "+e+" exists, but the property is not available.");return}if(d&&p+1>=r.length){var v=d(u,f);u=(h=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:u[f]}else h=w(u,f),u=u[f];h&&!l&&(g[a]=u)}}return u}},7071:(e,t,r)=>{"use strict";var i=Function.prototype.call,n=Object.prototype.hasOwnProperty,s=r(9138);e.exports=s.call(i,n)},1769:(e,t,r)=>{"use strict";var i=r(48),n=r(9787),s=r(6405),o=r(4607),a=r(9336),d=r(6369),u=o("Object.prototype.toString"),l=r(3766)(),c="undefined"==typeof globalThis?r.g:globalThis,p=n(),h=o("String.prototype.slice"),f=o("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},y={__proto__:null};i(p,l&&a&&d?function(e){var t=new c[e];if(Symbol.toStringTag in t&&d){var r=d(t),i=a(r,Symbol.toStringTag);if(!i&&r){var n=d(r);i=a(n,Symbol.toStringTag)}y["$"+e]=s(i.get)}}:function(e){var t=new c[e],r=t.slice||t.set;r&&(y["$"+e]=s(r))});e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!l){var t=h(u(e),8,-1);return f(p,t)>-1?t:"Object"===t&&function(e){var t=!1;return i(y,(function(r,i){if(!t)try{r(e),t=h(i,1)}catch(e){}})),t}(e)}return a?function(e){var t=!1;return i(y,(function(r,i){if(!t)try{"$"+r(e)===i&&(t=h(i,1))}catch(e){}})),t}(e):null}},6732:(e,t,r)=>{function i(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(i("noDeprecation"))return e;var r=!1;return function(){if(!r){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},5272:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},1531:(e,t,r)=>{"use strict";var i=r(5387),n=r(2625),s=r(2730),o=r(5943);function a(e){return e.call.bind(e)}var d="undefined"!=typeof BigInt,u="undefined"!=typeof Symbol,l=a(Object.prototype.toString),c=a(Number.prototype.valueOf),p=a(String.prototype.valueOf),h=a(Boolean.prototype.valueOf);if(d)var f=a(BigInt.prototype.valueOf);if(u)var y=a(Symbol.prototype.valueOf);function g(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function m(e){return"[object Map]"===l(e)}function v(e){return"[object Set]"===l(e)}function b(e){return"[object WeakMap]"===l(e)}function _(e){return"[object WeakSet]"===l(e)}function w(e){return"[object ArrayBuffer]"===l(e)}function T(e){return"undefined"!=typeof ArrayBuffer&&(w.working?w(e):e instanceof ArrayBuffer)}function E(e){return"[object DataView]"===l(e)}function S(e){return"undefined"!=typeof DataView&&(E.working?E(e):e instanceof DataView)}t.isArgumentsObject=i,t.isGeneratorFunction=n,t.isTypedArray=o,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):o(e)||S(e)},t.isUint8Array=function(e){return"Uint8Array"===s(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===s(e)},t.isUint16Array=function(e){return"Uint16Array"===s(e)},t.isUint32Array=function(e){return"Uint32Array"===s(e)},t.isInt8Array=function(e){return"Int8Array"===s(e)},t.isInt16Array=function(e){return"Int16Array"===s(e)},t.isInt32Array=function(e){return"Int32Array"===s(e)},t.isFloat32Array=function(e){return"Float32Array"===s(e)},t.isFloat64Array=function(e){return"Float64Array"===s(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===s(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===s(e)},m.working="undefined"!=typeof Map&&m(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(m.working?m(e):e instanceof Map)},v.working="undefined"!=typeof Set&&v(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(v.working?v(e):e instanceof Set)},b.working="undefined"!=typeof WeakMap&&b(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(b.working?b(e):e instanceof WeakMap)},_.working="undefined"!=typeof WeakSet&&_(new WeakSet),t.isWeakSet=function(e){return _(e)},w.working="undefined"!=typeof ArrayBuffer&&w(new ArrayBuffer),t.isArrayBuffer=T,E.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&E(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=S;var A="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function R(e){return"[object SharedArrayBuffer]"===l(e)}function M(e){return void 0!==A&&(void 0===R.working&&(R.working=R(new A)),R.working?R(e):e instanceof A)}function I(e){return g(e,c)}function O(e){return g(e,p)}function x(e){return g(e,h)}function k(e){return d&&g(e,f)}function C(e){return u&&g(e,y)}t.isSharedArrayBuffer=M,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===l(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===l(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===l(e)},t.isGeneratorObject=function(e){return"[object Generator]"===l(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===l(e)},t.isNumberObject=I,t.isStringObject=O,t.isBooleanObject=x,t.isBigIntObject=k,t.isSymbolObject=C,t.isBoxedPrimitive=function(e){return I(e)||O(e)||x(e)||k(e)||C(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(T(e)||M(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},9208:(e,t,r)=>{var i=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},i=0;i<t.length;i++)r[t[i]]=Object.getOwnPropertyDescriptor(e,t[i]);return r},n=/%[sdj%]/g;t.format=function(e){if(!v(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(d(arguments[r]));return t.join(" ")}r=1;for(var i=arguments,s=i.length,o=String(e).replace(n,(function(e){if("%%"===e)return"%";if(r>=s)return e;switch(e){case"%s":return String(i[r++]);case"%d":return Number(i[r++]);case"%j":try{return JSON.stringify(i[r++])}catch(e){return"[Circular]"}default:return e}})),a=i[r];r<s;a=i[++r])g(a)||!w(a)?o+=" "+a:o+=" "+d(a);return o},t.deprecate=function(e,r){if("undefined"!=typeof process&&!0===process.noDeprecation)return e;if("undefined"==typeof process)return function(){return t.deprecate(e,r).apply(this,arguments)};var i=!1;return function(){if(!i){if(process.throwDeprecation)throw new Error(r);process.traceDeprecation?console.trace(r):console.error(r),i=!0}return e.apply(this,arguments)}};var s={},o=/^$/;if(process.env.NODE_DEBUG){var a=process.env.NODE_DEBUG;a=a.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),o=new RegExp("^"+a+"$","i")}function d(e,r){var i={seen:[],stylize:l};return arguments.length>=3&&(i.depth=arguments[2]),arguments.length>=4&&(i.colors=arguments[3]),y(r)?i.showHidden=r:r&&t._extend(i,r),b(i.showHidden)&&(i.showHidden=!1),b(i.depth)&&(i.depth=2),b(i.colors)&&(i.colors=!1),b(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=u),c(i,e,i.depth)}function u(e,t){var r=d.styles[t];return r?"["+d.colors[r][0]+"m"+e+"["+d.colors[r][1]+"m":e}function l(e,t){return e}function c(e,r,i){if(e.customInspect&&r&&S(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var n=r.inspect(i,e);return v(n)||(n=c(e,n,i)),n}var s=function(e,t){if(b(t))return e.stylize("undefined","undefined");if(v(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(m(t))return e.stylize(""+t,"number");if(y(t))return e.stylize(""+t,"boolean");if(g(t))return e.stylize("null","null")}(e,r);if(s)return s;var o=Object.keys(r),a=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),E(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return p(r);if(0===o.length){if(S(r)){var d=r.name?": "+r.name:"";return e.stylize("[Function"+d+"]","special")}if(_(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(T(r))return e.stylize(Date.prototype.toString.call(r),"date");if(E(r))return p(r)}var u,l="",w=!1,A=["{","}"];(f(r)&&(w=!0,A=["[","]"]),S(r))&&(l=" [Function"+(r.name?": "+r.name:"")+"]");return _(r)&&(l=" "+RegExp.prototype.toString.call(r)),T(r)&&(l=" "+Date.prototype.toUTCString.call(r)),E(r)&&(l=" "+p(r)),0!==o.length||w&&0!=r.length?i<0?_(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),u=w?function(e,t,r,i,n){for(var s=[],o=0,a=t.length;o<a;++o)I(t,String(o))?s.push(h(e,t,r,i,String(o),!0)):s.push("");return n.forEach((function(n){n.match(/^\d+$/)||s.push(h(e,t,r,i,n,!0))})),s}(e,r,i,a,o):o.map((function(t){return h(e,r,i,a,t,w)})),e.seen.pop(),function(e,t,r){var i=e.reduce((function(e,t){return t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(i>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(u,l,A)):A[0]+l+A[1]}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,i,n,s){var o,a,d;if((d=Object.getOwnPropertyDescriptor(t,n)||{value:t[n]}).get?a=d.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):d.set&&(a=e.stylize("[Setter]","special")),I(i,n)||(o="["+n+"]"),a||(e.seen.indexOf(d.value)<0?(a=g(r)?c(e,d.value,null):c(e,d.value,r-1)).indexOf("\n")>-1&&(a=s?a.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+a.split("\n").map((function(e){return" "+e})).join("\n")):a=e.stylize("[Circular]","special")),b(o)){if(s&&n.match(/^\d+$/))return a;(o=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.slice(1,-1),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+a}function f(e){return Array.isArray(e)}function y(e){return"boolean"==typeof e}function g(e){return null===e}function m(e){return"number"==typeof e}function v(e){return"string"==typeof e}function b(e){return void 0===e}function _(e){return w(e)&&"[object RegExp]"===A(e)}function w(e){return"object"==typeof e&&null!==e}function T(e){return w(e)&&"[object Date]"===A(e)}function E(e){return w(e)&&("[object Error]"===A(e)||e instanceof Error)}function S(e){return"function"==typeof e}function A(e){return Object.prototype.toString.call(e)}function R(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!s[e])if(o.test(e)){var r=process.pid;s[e]=function(){var i=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,i)}}else s[e]=function(){};return s[e]},t.inspect=d,d.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},d.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(1531),t.isArray=f,t.isBoolean=y,t.isNull=g,t.isNullOrUndefined=function(e){return null==e},t.isNumber=m,t.isString=v,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=b,t.isRegExp=_,t.types.isRegExp=_,t.isObject=w,t.isDate=T,t.types.isDate=T,t.isError=E,t.types.isNativeError=E,t.isFunction=S,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(5272);var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;console.log("%s - %s",(e=new Date,r=[R(e.getHours()),R(e.getMinutes()),R(e.getSeconds())].join(":"),[e.getDate(),M[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=r(5615),t._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),i=r.length;i--;)e[r[i]]=t[r[i]];return e};var O="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function x(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(O&&e[O]){var t;if("function"!=typeof(t=e[O]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,O,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,i=new Promise((function(e,i){t=e,r=i})),n=[],s=0;s<arguments.length;s++)n.push(arguments[s]);n.push((function(e,i){e?r(e):t(i)}));try{e.apply(this,n)}catch(e){r(e)}return i}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),O&&Object.defineProperty(t,O,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,i(e))},t.promisify.custom=O,t.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var i=t.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var n=this,s=function(){return i.apply(n,arguments)};e.apply(this,t).then((function(e){process.nextTick(s.bind(null,null,e))}),(function(e){process.nextTick(x.bind(null,e,s))}))}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,i(e)),t}},2730:(e,t,r)=>{"use strict";var i=r(705),n=r(4834),s=r(8498),o=r(9818),a=r(808),d=o("Object.prototype.toString"),u=r(1913)(),l="undefined"==typeof globalThis?r.g:globalThis,c=n(),p=o("String.prototype.slice"),h=Object.getPrototypeOf,f=o("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},y={__proto__:null};i(c,u&&a&&h?function(e){var t=new l[e];if(Symbol.toStringTag in t){var r=h(t),i=a(r,Symbol.toStringTag);if(!i){var n=h(r);i=a(n,Symbol.toStringTag)}y["$"+e]=s(i.get)}}:function(e){var t=new l[e],r=t.slice||t.set;r&&(y["$"+e]=s(r))});e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!u){var t=p(d(e),8,-1);return f(c,t)>-1?t:"Object"===t&&function(e){var t=!1;return i(y,(function(r,i){if(!t)try{r(e),t=p(i,1)}catch(e){}})),t}(e)}return a?function(e){var t=!1;return i(y,(function(r,i){if(!t)try{"$"+r(e)===i&&(t=p(i,1))}catch(e){}})),t}(e):null}},808:(e,t,r)=>{"use strict";var i=r(528)("%Object.getOwnPropertyDescriptor%",!0);if(i)try{i([],"length")}catch(e){i=null}e.exports=i},7047:e=>{"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},222:(e,t,r)=>{"use strict";function i(e){var t=this;if(t instanceof i||(t=new i),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var r=0,n=arguments.length;r<n;r++)t.push(arguments[r]);return t}function n(e,t,r){var i=t===e.head?new a(r,null,t,e):new a(r,t,t.next,e);return null===i.next&&(e.tail=i),null===i.prev&&(e.head=i),e.length++,i}function s(e,t){e.tail=new a(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function o(e,t){e.head=new a(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function a(e,t,r,i){if(!(this instanceof a))return new a(e,t,r,i);this.list=i,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}e.exports=i,i.Node=a,i.create=i,i.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t},i.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},i.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},i.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)s(this,arguments[e]);return this.length},i.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)o(this,arguments[e]);return this.length},i.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},i.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},i.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,i=0;null!==r;i++)e.call(t,r.value,i,this),r=r.next},i.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,i=this.length-1;null!==r;i--)e.call(t,r.value,i,this),r=r.prev},i.prototype.get=function(e){for(var t=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)return r.value},i.prototype.getReverse=function(e){for(var t=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)return r.value},i.prototype.map=function(e,t){t=t||this;for(var r=new i,n=this.head;null!==n;)r.push(e.call(t,n.value,this)),n=n.next;return r},i.prototype.mapReverse=function(e,t){t=t||this;for(var r=new i,n=this.tail;null!==n;)r.push(e.call(t,n.value,this)),n=n.prev;return r},i.prototype.reduce=function(e,t){var r,i=this.head;if(arguments.length>1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");i=this.head.next,r=this.head.value}for(var n=0;null!==i;n++)r=e(r,i.value,n),i=i.next;return r},i.prototype.reduceReverse=function(e,t){var r,i=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");i=this.tail.prev,r=this.tail.value}for(var n=this.length-1;null!==i;n--)r=e(r,i.value,n),i=i.prev;return r},i.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},i.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},i.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new i;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var n=0,s=this.head;null!==s&&n<e;n++)s=s.next;for(;null!==s&&n<t;n++,s=s.next)r.push(s.value);return r},i.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new i;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var n=this.length,s=this.tail;null!==s&&n>t;n--)s=s.prev;for(;null!==s&&n>e;n--,s=s.prev)r.push(s.value);return r},i.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var i=0,s=this.head;null!==s&&i<e;i++)s=s.next;var o=[];for(i=0;s&&i<t;i++)o.push(s.value),s=this.removeNode(s);null===s&&(s=this.tail),s!==this.head&&s!==this.tail&&(s=s.prev);for(i=0;i<r.length;i++)s=n(this,s,r[i]);return o},i.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;null!==r;r=r.prev){var i=r.prev;r.prev=r.next,r.next=i}return this.head=t,this.tail=e,this};try{r(7047)(i)}catch(e){}},1629:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function i(e){if("boolean"!=typeof e)throw new Error(`Expected boolean, not ${e}`)}function n(e,...t){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw new Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function s(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function o(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function a(e,t){n(e);const r=t.outputLen;if(e.length<r)throw new Error(`digestInto() expects output buffer of length at least ${r}`)}Object.defineProperty(t,"__esModule",{value:!0}),t.output=t.exists=t.hash=t.bytes=t.bool=t.number=void 0,t.number=r,t.bool=i,t.bytes=n,t.hash=s,t.exists=o,t.output=a;const d={number:r,bool:i,bytes:n,hash:s,exists:o,output:a};t.default=d},3070:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BLAKE2=t.SIGMA=void 0;const i=r(1629),n=r(3599);t.SIGMA=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]);class s extends n.Hash{constructor(e,t,r={},s,o,a){if(super(),this.blockLen=e,this.outputLen=t,this.length=0,this.pos=0,this.finished=!1,this.destroyed=!1,(0,i.number)(e),(0,i.number)(t),(0,i.number)(s),t<0||t>s)throw new Error("outputLen bigger than keyLen");if(void 0!==r.key&&(r.key.length<1||r.key.length>s))throw new Error(`key must be up 1..${s} byte long or undefined`);if(void 0!==r.salt&&r.salt.length!==o)throw new Error(`salt must be ${o} byte long or undefined`);if(void 0!==r.personalization&&r.personalization.length!==a)throw new Error(`personalization must be ${a} byte long or undefined`);this.buffer32=(0,n.u32)(this.buffer=new Uint8Array(e))}update(e){(0,i.exists)(this);const{blockLen:t,buffer:r,buffer32:s}=this,o=(e=(0,n.toBytes)(e)).length,a=e.byteOffset,d=e.buffer;for(let i=0;i<o;){this.pos===t&&(this.compress(s,0,!1),this.pos=0);const n=Math.min(t-this.pos,o-i),u=a+i;if(n!==t||u%4||!(i+n<o))r.set(e.subarray(i,i+n),this.pos),this.pos+=n,this.length+=n,i+=n;else{const e=new Uint32Array(d,u,Math.floor((o-i)/4));for(let r=0;i+t<o;r+=s.length,i+=t)this.length+=t,this.compress(e,r,!1)}}return this}digestInto(e){(0,i.exists)(this),(0,i.output)(e,this);const{pos:t,buffer32:r}=this;this.finished=!0,this.buffer.subarray(t).fill(0),this.compress(r,0,!0);const s=(0,n.u32)(e);this.get().forEach(((e,t)=>s[t]=e))}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){const{buffer:t,length:r,finished:i,destroyed:n,outputLen:s,pos:o}=this;return e||(e=new this.constructor({dkLen:s})),e.set(...this.get()),e.length=r,e.finished=i,e.destroyed=n,e.outputLen=s,e.buffer.set(t),e.pos=o,e}}t.BLAKE2=s},9659:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHA2=void 0;const i=r(1629),n=r(3599);class s extends n.Hash{constructor(e,t,r,i){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,n.createView)(this.buffer)}update(e){(0,i.exists)(this);const{view:t,buffer:r,blockLen:s}=this,o=(e=(0,n.toBytes)(e)).length;for(let i=0;i<o;){const a=Math.min(s-this.pos,o-i);if(a!==s)r.set(e.subarray(i,i+a),this.pos),this.pos+=a,i+=a,this.pos===s&&(this.process(t,0),this.pos=0);else{const t=(0,n.createView)(e);for(;s<=o-i;i+=s)this.process(t,i)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,i.exists)(this),(0,i.output)(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:s,isLE:o}=this;let{pos:a}=this;t[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>s-a&&(this.process(r,0),a=0);for(let e=a;e<s;e++)t[e]=0;!function(e,t,r,i){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,i);const n=BigInt(32),s=BigInt(4294967295),o=Number(r>>n&s),a=Number(r&s),d=i?4:0,u=i?0:4;e.setUint32(t+d,o,i),e.setUint32(t+u,a,i)}(r,s-8,BigInt(8*this.length),o),this.process(r,0);const d=(0,n.createView)(e),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=u/4,c=this.get();if(l>c.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<l;e++)d.setUint32(4*e,c[e],o)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:i,finished:n,destroyed:s,pos:o}=this;return e.length=i,e.pos=o,e.finished=n,e.destroyed=s,i%t&&e.buffer.set(r),e}}t.SHA2=s},4614:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.add5L=t.add5H=t.add4H=t.add4L=t.add3H=t.add3L=t.add=t.rotlBL=t.rotlBH=t.rotlSL=t.rotlSH=t.rotr32L=t.rotr32H=t.rotrBL=t.rotrBH=t.rotrSL=t.rotrSH=t.shrSL=t.shrSH=t.toBig=t.split=t.fromBig=void 0;const r=BigInt(2**32-1),i=BigInt(32);function n(e,t=!1){return t?{h:Number(e&r),l:Number(e>>i&r)}:{h:0|Number(e>>i&r),l:0|Number(e&r)}}function s(e,t=!1){let r=new Uint32Array(e.length),i=new Uint32Array(e.length);for(let s=0;s<e.length;s++){const{h:o,l:a}=n(e[s],t);[r[s],i[s]]=[o,a]}return[r,i]}t.fromBig=n,t.split=s;const o=(e,t)=>BigInt(e>>>0)<<i|BigInt(t>>>0);t.toBig=o;const a=(e,t,r)=>e>>>r;t.shrSH=a;const d=(e,t,r)=>e<<32-r|t>>>r;t.shrSL=d;const u=(e,t,r)=>e>>>r|t<<32-r;t.rotrSH=u;const l=(e,t,r)=>e<<32-r|t>>>r;t.rotrSL=l;const c=(e,t,r)=>e<<64-r|t>>>r-32;t.rotrBH=c;const p=(e,t,r)=>e>>>r-32|t<<64-r;t.rotrBL=p;const h=(e,t)=>t;t.rotr32H=h;const f=(e,t)=>e;t.rotr32L=f;const y=(e,t,r)=>e<<r|t>>>32-r;t.rotlSH=y;const g=(e,t,r)=>t<<r|e>>>32-r;t.rotlSL=g;const m=(e,t,r)=>t<<r-32|e>>>64-r;t.rotlBH=m;const v=(e,t,r)=>e<<r-32|t>>>64-r;function b(e,t,r,i){const n=(t>>>0)+(i>>>0);return{h:e+r+(n/2**32|0)|0,l:0|n}}t.rotlBL=v,t.add=b;const _=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);t.add3L=_;const w=(e,t,r,i)=>t+r+i+(e/2**32|0)|0;t.add3H=w;const T=(e,t,r,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(i>>>0);t.add4L=T;const E=(e,t,r,i,n)=>t+r+i+n+(e/2**32|0)|0;t.add4H=E;const S=(e,t,r,i,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(i>>>0)+(n>>>0);t.add5L=S;const A=(e,t,r,i,n,s)=>t+r+i+n+s+(e/2**32|0)|0;t.add5H=A;const R={fromBig:n,split:s,toBig:o,shrSH:a,shrSL:d,rotrSH:u,rotrSL:l,rotrBH:c,rotrBL:p,rotr32H:h,rotr32L:f,rotlSH:y,rotlSL:g,rotlBH:m,rotlBL:v,add:b,add3L:_,add3H:w,add4L:T,add4H:E,add5H:A,add5L:S};t.default=R},311:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.blake2b=void 0;const i=r(3070),n=r(4614),s=r(3599),o=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),a=new Uint32Array(32);function d(e,t,r,i,s,o){const d=s[o],u=s[o+1];let l=a[2*e],c=a[2*e+1],p=a[2*t],h=a[2*t+1],f=a[2*r],y=a[2*r+1],g=a[2*i],m=a[2*i+1],v=n.default.add3L(l,p,d);c=n.default.add3H(v,c,h,u),l=0|v,({Dh:m,Dl:g}={Dh:m^c,Dl:g^l}),({Dh:m,Dl:g}={Dh:n.default.rotr32H(m,g),Dl:n.default.rotr32L(m,g)}),({h:y,l:f}=n.default.add(y,f,m,g)),({Bh:h,Bl:p}={Bh:h^y,Bl:p^f}),({Bh:h,Bl:p}={Bh:n.default.rotrSH(h,p,24),Bl:n.default.rotrSL(h,p,24)}),a[2*e]=l,a[2*e+1]=c,a[2*t]=p,a[2*t+1]=h,a[2*r]=f,a[2*r+1]=y,a[2*i]=g,a[2*i+1]=m}function u(e,t,r,i,s,o){const d=s[o],u=s[o+1];let l=a[2*e],c=a[2*e+1],p=a[2*t],h=a[2*t+1],f=a[2*r],y=a[2*r+1],g=a[2*i],m=a[2*i+1],v=n.default.add3L(l,p,d);c=n.default.add3H(v,c,h,u),l=0|v,({Dh:m,Dl:g}={Dh:m^c,Dl:g^l}),({Dh:m,Dl:g}={Dh:n.default.rotrSH(m,g,16),Dl:n.default.rotrSL(m,g,16)}),({h:y,l:f}=n.default.add(y,f,m,g)),({Bh:h,Bl:p}={Bh:h^y,Bl:p^f}),({Bh:h,Bl:p}={Bh:n.default.rotrBH(h,p,63),Bl:n.default.rotrBL(h,p,63)}),a[2*e]=l,a[2*e+1]=c,a[2*t]=p,a[2*t+1]=h,a[2*r]=f,a[2*r+1]=y,a[2*i]=g,a[2*i+1]=m}class l extends i.BLAKE2{constructor(e={}){super(128,void 0===e.dkLen?64:e.dkLen,e,64,16,16),this.v0l=0|o[0],this.v0h=0|o[1],this.v1l=0|o[2],this.v1h=0|o[3],this.v2l=0|o[4],this.v2h=0|o[5],this.v3l=0|o[6],this.v3h=0|o[7],this.v4l=0|o[8],this.v4h=0|o[9],this.v5l=0|o[10],this.v5h=0|o[11],this.v6l=0|o[12],this.v6h=0|o[13],this.v7l=0|o[14],this.v7h=0|o[15];const t=e.key?e.key.length:0;if(this.v0l^=this.outputLen|t<<8|65536|1<<24,e.salt){const t=(0,s.u32)((0,s.toBytes)(e.salt));this.v4l^=t[0],this.v4h^=t[1],this.v5l^=t[2],this.v5h^=t[3]}if(e.personalization){const t=(0,s.u32)((0,s.toBytes)(e.personalization));this.v6l^=t[0],this.v6h^=t[1],this.v7l^=t[2],this.v7h^=t[3]}if(e.key){const t=new Uint8Array(this.blockLen);t.set((0,s.toBytes)(e.key)),this.update(t)}}get(){let{v0l:e,v0h:t,v1l:r,v1h:i,v2l:n,v2h:s,v3l:o,v3h:a,v4l:d,v4h:u,v5l:l,v5h:c,v6l:p,v6h:h,v7l:f,v7h:y}=this;return[e,t,r,i,n,s,o,a,d,u,l,c,p,h,f,y]}set(e,t,r,i,n,s,o,a,d,u,l,c,p,h,f,y){this.v0l=0|e,this.v0h=0|t,this.v1l=0|r,this.v1h=0|i,this.v2l=0|n,this.v2h=0|s,this.v3l=0|o,this.v3h=0|a,this.v4l=0|d,this.v4h=0|u,this.v5l=0|l,this.v5h=0|c,this.v6l=0|p,this.v6h=0|h,this.v7l=0|f,this.v7h=0|y}compress(e,t,r){this.get().forEach(((e,t)=>a[t]=e)),a.set(o,16);let{h:s,l}=n.default.fromBig(BigInt(this.length));a[24]=o[8]^l,a[25]=o[9]^s,r&&(a[28]=~a[28],a[29]=~a[29]);let c=0;const p=i.SIGMA;for(let r=0;r<12;r++)d(0,4,8,12,e,t+2*p[c++]),u(0,4,8,12,e,t+2*p[c++]),d(1,5,9,13,e,t+2*p[c++]),u(1,5,9,13,e,t+2*p[c++]),d(2,6,10,14,e,t+2*p[c++]),u(2,6,10,14,e,t+2*p[c++]),d(3,7,11,15,e,t+2*p[c++]),u(3,7,11,15,e,t+2*p[c++]),d(0,5,10,15,e,t+2*p[c++]),u(0,5,10,15,e,t+2*p[c++]),d(1,6,11,12,e,t+2*p[c++]),u(1,6,11,12,e,t+2*p[c++]),d(2,7,8,13,e,t+2*p[c++]),u(2,7,8,13,e,t+2*p[c++]),d(3,4,9,14,e,t+2*p[c++]),u(3,4,9,14,e,t+2*p[c++]);this.v0l^=a[0]^a[16],this.v0h^=a[1]^a[17],this.v1l^=a[2]^a[18],this.v1h^=a[3]^a[19],this.v2l^=a[4]^a[20],this.v2h^=a[5]^a[21],this.v3l^=a[6]^a[22],this.v3h^=a[7]^a[23],this.v4l^=a[8]^a[24],this.v4h^=a[9]^a[25],this.v5l^=a[10]^a[26],this.v5h^=a[11]^a[27],this.v6l^=a[12]^a[28],this.v6h^=a[13]^a[29],this.v7l^=a[14]^a[30],this.v7h^=a[15]^a[31],a.fill(0)}destroy(){this.destroyed=!0,this.buffer32.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}t.blake2b=(0,s.wrapConstructorWithOpts)((e=>new l(e)))},4368:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.blake2s=t.compress=t.IV=void 0;const i=r(3070),n=r(4614),s=r(3599);function o(e,t,r,i,n){return e=e+t+n|0,r=r+(i=(0,s.rotr)(i^e,16))|0,{a:e,b:t=(0,s.rotr)(t^r,12),c:r,d:i}}function a(e,t,r,i,n){return e=e+t+n|0,r=r+(i=(0,s.rotr)(i^e,8))|0,{a:e,b:t=(0,s.rotr)(t^r,7),c:r,d:i}}function d(e,t,r,i,n,s,d,u,l,c,p,h,f,y,g,m,v,b,_,w){let T=0;for(let E=0;E<i;E++)({a:n,b:l,c:f,d:v}=o(n,l,f,v,r[t+e[T++]])),({a:n,b:l,c:f,d:v}=a(n,l,f,v,r[t+e[T++]])),({a:s,b:c,c:y,d:b}=o(s,c,y,b,r[t+e[T++]])),({a:s,b:c,c:y,d:b}=a(s,c,y,b,r[t+e[T++]])),({a:d,b:p,c:g,d:_}=o(d,p,g,_,r[t+e[T++]])),({a:d,b:p,c:g,d:_}=a(d,p,g,_,r[t+e[T++]])),({a:u,b:h,c:m,d:w}=o(u,h,m,w,r[t+e[T++]])),({a:u,b:h,c:m,d:w}=a(u,h,m,w,r[t+e[T++]])),({a:n,b:c,c:g,d:w}=o(n,c,g,w,r[t+e[T++]])),({a:n,b:c,c:g,d:w}=a(n,c,g,w,r[t+e[T++]])),({a:s,b:p,c:m,d:v}=o(s,p,m,v,r[t+e[T++]])),({a:s,b:p,c:m,d:v}=a(s,p,m,v,r[t+e[T++]])),({a:d,b:h,c:f,d:b}=o(d,h,f,b,r[t+e[T++]])),({a:d,b:h,c:f,d:b}=a(d,h,f,b,r[t+e[T++]])),({a:u,b:l,c:y,d:_}=o(u,l,y,_,r[t+e[T++]])),({a:u,b:l,c:y,d:_}=a(u,l,y,_,r[t+e[T++]]));return{v0:n,v1:s,v2:d,v3:u,v4:l,v5:c,v6:p,v7:h,v8:f,v9:y,v10:g,v11:m,v12:v,v13:b,v14:_,v15:w}}t.IV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),t.compress=d;class u extends i.BLAKE2{constructor(e={}){super(64,void 0===e.dkLen?32:e.dkLen,e,32,8,8),this.v0=0|t.IV[0],this.v1=0|t.IV[1],this.v2=0|t.IV[2],this.v3=0|t.IV[3],this.v4=0|t.IV[4],this.v5=0|t.IV[5],this.v6=0|t.IV[6],this.v7=0|t.IV[7];const r=e.key?e.key.length:0;if(this.v0^=this.outputLen|r<<8|65536|1<<24,e.salt){const t=(0,s.u32)((0,s.toBytes)(e.salt));this.v4^=t[0],this.v5^=t[1]}if(e.personalization){const t=(0,s.u32)((0,s.toBytes)(e.personalization));this.v6^=t[0],this.v7^=t[1]}if(e.key){const t=new Uint8Array(this.blockLen);t.set((0,s.toBytes)(e.key)),this.update(t)}}get(){const{v0:e,v1:t,v2:r,v3:i,v4:n,v5:s,v6:o,v7:a}=this;return[e,t,r,i,n,s,o,a]}set(e,t,r,i,n,s,o,a){this.v0=0|e,this.v1=0|t,this.v2=0|r,this.v3=0|i,this.v4=0|n,this.v5=0|s,this.v6=0|o,this.v7=0|a}compress(e,r,s){const{h:o,l:a}=(0,n.fromBig)(BigInt(this.length)),{v0:u,v1:l,v2:c,v3:p,v4:h,v5:f,v6:y,v7:g,v8:m,v9:v,v10:b,v11:_,v12:w,v13:T,v14:E,v15:S}=d(i.SIGMA,r,e,10,this.v0,this.v1,this.v2,this.v3,this.v4,this.v5,this.v6,this.v7,t.IV[0],t.IV[1],t.IV[2],t.IV[3],a^t.IV[4],o^t.IV[5],s?~t.IV[6]:t.IV[6],t.IV[7]);this.v0^=u^m,this.v1^=l^v,this.v2^=c^b,this.v3^=p^_,this.v4^=h^w,this.v5^=f^T,this.v6^=y^E,this.v7^=g^S}destroy(){this.destroyed=!0,this.buffer32.fill(0),this.set(0,0,0,0,0,0,0,0)}}t.blake2s=(0,s.wrapConstructorWithOpts)((e=>new u(e)))},9217:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},3063:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha224=t.sha256=void 0;const i=r(9659),n=r(3599),s=(e,t,r)=>e&t^e&r^t&r,o=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]),a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),d=new Uint32Array(64);class u extends i.SHA2{constructor(){super(64,32,8,!1),this.A=0|a[0],this.B=0|a[1],this.C=0|a[2],this.D=0|a[3],this.E=0|a[4],this.F=0|a[5],this.G=0|a[6],this.H=0|a[7]}get(){const{A:e,B:t,C:r,D:i,E:n,F:s,G:o,H:a}=this;return[e,t,r,i,n,s,o,a]}set(e,t,r,i,n,s,o,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|i,this.E=0|n,this.F=0|s,this.G=0|o,this.H=0|a}process(e,t){for(let r=0;r<16;r++,t+=4)d[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=d[e-15],r=d[e-2],i=(0,n.rotr)(t,7)^(0,n.rotr)(t,18)^t>>>3,s=(0,n.rotr)(r,17)^(0,n.rotr)(r,19)^r>>>10;d[e]=s+d[e-7]+i+d[e-16]|0}let{A:r,B:i,C:a,D:u,E:l,F:c,G:p,H:h}=this;for(let e=0;e<64;e++){const t=h+((0,n.rotr)(l,6)^(0,n.rotr)(l,11)^(0,n.rotr)(l,25))+((f=l)&c^~f&p)+o[e]+d[e]|0,y=((0,n.rotr)(r,2)^(0,n.rotr)(r,13)^(0,n.rotr)(r,22))+s(r,i,a)|0;h=p,p=c,c=l,l=u+t|0,u=a,a=i,i=r,r=t+y|0}var f;r=r+this.A|0,i=i+this.B|0,a=a+this.C|0,u=u+this.D|0,l=l+this.E|0,c=c+this.F|0,p=p+this.G|0,h=h+this.H|0,this.set(r,i,a,u,l,c,p,h)}roundClean(){d.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class l extends u{constructor(){super(),this.A=-1056596264,this.B=914150663,this.C=812702999,this.D=-150054599,this.E=-4191439,this.F=1750603025,this.G=1694076839,this.H=-1090891868,this.outputLen=28}}t.sha256=(0,n.wrapConstructor)((()=>new u)),t.sha224=(0,n.wrapConstructor)((()=>new l))},6899:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shake256=t.shake128=t.keccak_512=t.keccak_384=t.keccak_256=t.keccak_224=t.sha3_512=t.sha3_384=t.sha3_256=t.sha3_224=t.Keccak=t.keccakP=void 0;const i=r(1629),n=r(4614),s=r(3599),[o,a,d]=[[],[],[]],u=BigInt(0),l=BigInt(1),c=BigInt(2),p=BigInt(7),h=BigInt(256),f=BigInt(113);for(let e=0,t=l,r=1,i=0;e<24;e++){[r,i]=[i,(2*r+3*i)%5],o.push(2*(5*i+r)),a.push((e+1)*(e+2)/2%64);let n=u;for(let e=0;e<7;e++)t=(t<<l^(t>>p)*f)%h,t&c&&(n^=l<<(l<<BigInt(e))-l);d.push(n)}const[y,g]=(0,n.split)(d,!0),m=(e,t,r)=>r>32?(0,n.rotlBH)(e,t,r):(0,n.rotlSH)(e,t,r),v=(e,t,r)=>r>32?(0,n.rotlBL)(e,t,r):(0,n.rotlSL)(e,t,r);function b(e,t=24){const r=new Uint32Array(10);for(let i=24-t;i<24;i++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){const i=(t+8)%10,n=(t+2)%10,s=r[n],o=r[n+1],a=m(s,o,1)^r[i],d=v(s,o,1)^r[i+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=d}let t=e[2],n=e[3];for(let r=0;r<24;r++){const i=a[r],s=m(t,n,i),d=v(t,n,i),u=o[r];t=e[u],n=e[u+1],e[u]=s,e[u+1]=d}for(let t=0;t<50;t+=10){for(let i=0;i<10;i++)r[i]=e[t+i];for(let i=0;i<10;i++)e[t+i]^=~r[(i+2)%10]&r[(i+4)%10]}e[0]^=y[i],e[1]^=g[i]}r.fill(0)}t.keccakP=b;class _ extends s.Hash{constructor(e,t,r,n=!1,o=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,i.number)(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,s.u32)(this.state)}keccak(){b(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){(0,i.exists)(this);const{blockLen:t,state:r}=this,n=(e=(0,s.toBytes)(e)).length;for(let i=0;i<n;){const s=Math.min(t-this.pos,n-i);for(let t=0;t<s;t++)r[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:i}=this;e[r]^=t,0!=(128&t)&&r===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){(0,i.exists)(this,!1),(0,i.bytes)(e),this.finish();const t=this.state,{blockLen:r}=this;for(let i=0,n=e.length;i<n;){this.posOut>=r&&this.keccak();const s=Math.min(r-this.posOut,n-i);e.set(t.subarray(this.posOut,this.posOut+s),i),this.posOut+=s,i+=s}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,i.number)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,i.output)(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:i,rounds:n,enableXOF:s}=this;return e||(e=new _(t,r,i,s,n)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=n,e.suffix=r,e.outputLen=i,e.enableXOF=s,e.destroyed=this.destroyed,e}}t.Keccak=_;const w=(e,t,r)=>(0,s.wrapConstructor)((()=>new _(t,e,r)));t.sha3_224=w(6,144,28),t.sha3_256=w(6,136,32),t.sha3_384=w(6,104,48),t.sha3_512=w(6,72,64),t.keccak_224=w(1,144,28),t.keccak_256=w(1,136,32),t.keccak_384=w(1,104,48),t.keccak_512=w(1,72,64);const T=(e,t,r)=>(0,s.wrapXOFConstructorWithOpts)(((i={})=>new _(t,e,void 0===i.dkLen?r:i.dkLen,!0)));t.shake128=T(31,168,16),t.shake256=T(31,136,32)},3599:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;const i=r(9217),n=e=>e instanceof Uint8Array;t.u8=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength);t.u32=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4));t.createView=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);if(t.rotr=(e,t)=>e<<32-t|e>>>t,t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],!t.isLE)throw new Error("Non little-endian hardware is not supported");const s=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));t.bytesToHex=function(e){if(!n(e))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=s[e[r]];return t},t.hexToBytes=function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);const t=e.length;if(t%2)throw new Error("padded hex string expected, got unpadded hex of length "+t);const r=new Uint8Array(t/2);for(let t=0;t<r.length;t++){const i=2*t,n=e.slice(i,i+2),s=Number.parseInt(n,16);if(Number.isNaN(s)||s<0)throw new Error("Invalid byte sequence");r[t]=s}return r};function o(e){if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array((new TextEncoder).encode(e))}function a(e){if("string"==typeof e&&(e=o(e)),!n(e))throw new Error("expected Uint8Array, got "+typeof e);return e}t.nextTick=async()=>{},t.asyncLoop=async function(e,r,i){let n=Date.now();for(let s=0;s<e;s++){i(s);const e=Date.now()-n;e>=0&&e<r||(await(0,t.nextTick)(),n+=e)}},t.utf8ToBytes=o,t.toBytes=a,t.concatBytes=function(...e){const t=new Uint8Array(e.reduce(((e,t)=>e+t.length),0));let r=0;return e.forEach((e=>{if(!n(e))throw new Error("Uint8Array expected");t.set(e,r),r+=e.length})),t};t.Hash=class{clone(){return this._cloneInto()}};const d={}.toString;t.checkOpts=function(e,t){if(void 0!==t&&"[object Object]"!==d.call(t))throw new Error("Options should be object or undefined");return Object.assign(e,t)},t.wrapConstructor=function(e){const t=t=>e().update(a(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(a(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.wrapXOFConstructorWithOpts=function(e){const t=(t,r)=>e(r).update(a(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t},t.randomBytes=function(e=32){if(i.crypto&&"function"==typeof i.crypto.getRandomValues)return i.crypto.getRandomValues(new Uint8Array(e));throw new Error("crypto.getRandomValues must be defined")}},8540:(e,t,r)=>{"use strict";var i=r(5636).Buffer;e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<e.length;n++){var s=e.charAt(n),o=s.charCodeAt(0);if(255!==t[o])throw new TypeError(s+" is ambiguous");t[o]=n}var a=e.length,d=e.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function c(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return i.alloc(0);for(var r=0,n=0,s=0;e[r]===d;)n++,r++;for(var o=(e.length-r)*u+1>>>0,l=new Uint8Array(o);r<e.length;){var c=e.charCodeAt(r);if(c>255)return;var p=t[c];if(255===p)return;for(var h=0,f=o-1;(0!==p||h<s)&&-1!==f;f--,h++)p+=a*l[f]>>>0,l[f]=p%256>>>0,p=p/256>>>0;if(0!==p)throw new Error("Non-zero carry");s=h,r++}for(var y=o-s;y!==o&&0===l[y];)y++;var g=i.allocUnsafe(n+(o-y));g.fill(0,0,n);for(var m=n;y!==o;)g[m++]=l[y++];return g}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=i.from(t)),!i.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var r=0,n=0,s=0,o=t.length;s!==o&&0===t[s];)s++,r++;for(var u=(o-s)*l+1>>>0,c=new Uint8Array(u);s!==o;){for(var p=t[s],h=0,f=u-1;(0!==p||h<n)&&-1!==f;f--,h++)p+=256*c[f]>>>0,c[f]=p%a>>>0,p=p/a>>>0;if(0!==p)throw new Error("Non-zero carry");n=h,s++}for(var y=u-n;y!==u&&0===c[y];)y++;for(var g=d.repeat(r);y<u;++y)g+=e.charAt(c[y]);return g},decodeUnsafe:c,decode:function(e){var t=c(e);if(t)return t;throw new Error("Non-base"+a+" character")}}}},7170:function(e,t,r){var i;!function(n){"use strict";var s,o=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,a=Math.ceil,d=Math.floor,u="[BigNumber Error] ",l=u+"Number primitive has more than 15 significant digits: ",c=1e14,p=14,h=9007199254740991,f=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],y=1e7,g=1e9;function m(e){var t=0|e;return e>0||e===t?t:t-1}function v(e){for(var t,r,i=1,n=e.length,s=e[0]+"";i<n;){for(t=e[i++]+"",r=p-t.length;r--;t="0"+t);s+=t}for(n=s.length;48===s.charCodeAt(--n););return s.slice(0,n+1||1)}function b(e,t){var r,i,n=e.c,s=t.c,o=e.s,a=t.s,d=e.e,u=t.e;if(!o||!a)return null;if(r=n&&!n[0],i=s&&!s[0],r||i)return r?i?0:-a:o;if(o!=a)return o;if(r=o<0,i=d==u,!n||!s)return i?0:!n^r?1:-1;if(!i)return d>u^r?1:-1;for(a=(d=n.length)<(u=s.length)?d:u,o=0;o<a;o++)if(n[o]!=s[o])return n[o]>s[o]^r?1:-1;return d==u?0:d>u^r?1:-1}function _(e,t,r,i){if(e<t||e>r||e!==d(e))throw Error(u+(i||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function w(e){var t=e.c.length-1;return m(e.e/p)==t&&e.c[t]%2!=0}function T(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function E(e,t,r){var i,n;if(t<0){for(n=r+".";++t;n+=r);e=n+e}else if(++t>(i=e.length)){for(n=r,t-=i;--t;n+=r);e+=n}else t<i&&(e=e.slice(0,t)+"."+e.slice(t));return e}s=function e(t){var r,i,n,s,S,A,R,M,I,O,x=G.prototype={constructor:G,toString:null,valueOf:null},k=new G(1),C=20,P=4,D=-7,N=21,B=-1e7,q=1e7,L=!1,j=1,F=0,U={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},z="0123456789abcdefghijklmnopqrstuvwxyz",H=!0;function G(e,t){var r,s,a,u,c,f,y,g,m=this;if(!(m instanceof G))return new G(e,t);if(null==t){if(e&&!0===e._isBigNumber)return m.s=e.s,void(!e.c||e.e>q?m.c=m.e=null:e.e<B?m.c=[m.e=0]:(m.e=e.e,m.c=e.c.slice()));if((f="number"==typeof e)&&0*e==0){if(m.s=1/e<0?(e=-e,-1):1,e===~~e){for(u=0,c=e;c>=10;c/=10,u++);return void(u>q?m.c=m.e=null:(m.e=u,m.c=[e]))}g=String(e)}else{if(!o.test(g=String(e)))return n(m,g,f);m.s=45==g.charCodeAt(0)?(g=g.slice(1),-1):1}(u=g.indexOf("."))>-1&&(g=g.replace(".","")),(c=g.search(/e/i))>0?(u<0&&(u=c),u+=+g.slice(c+1),g=g.substring(0,c)):u<0&&(u=g.length)}else{if(_(t,2,z.length,"Base"),10==t&&H)return $(m=new G(e),C+m.e+1,P);if(g=String(e),f="number"==typeof e){if(0*e!=0)return n(m,g,f,t);if(m.s=1/e<0?(g=g.slice(1),-1):1,G.DEBUG&&g.replace(/^0\.0*|\./,"").length>15)throw Error(l+e)}else m.s=45===g.charCodeAt(0)?(g=g.slice(1),-1):1;for(r=z.slice(0,t),u=c=0,y=g.length;c<y;c++)if(r.indexOf(s=g.charAt(c))<0){if("."==s){if(c>u){u=y;continue}}else if(!a&&(g==g.toUpperCase()&&(g=g.toLowerCase())||g==g.toLowerCase()&&(g=g.toUpperCase()))){a=!0,c=-1,u=0;continue}return n(m,String(e),f,t)}f=!1,(u=(g=i(g,t,10,m.s)).indexOf("."))>-1?g=g.replace(".",""):u=g.length}for(c=0;48===g.charCodeAt(c);c++);for(y=g.length;48===g.charCodeAt(--y););if(g=g.slice(c,++y)){if(y-=c,f&&G.DEBUG&&y>15&&(e>h||e!==d(e)))throw Error(l+m.s*e);if((u=u-c-1)>q)m.c=m.e=null;else if(u<B)m.c=[m.e=0];else{if(m.e=u,m.c=[],c=(u+1)%p,u<0&&(c+=p),c<y){for(c&&m.c.push(+g.slice(0,c)),y-=p;c<y;)m.c.push(+g.slice(c,c+=p));c=p-(g=g.slice(c)).length}else c-=y;for(;c--;g+="0");m.c.push(+g)}}else m.c=[m.e=0]}function K(e,t,r,i){var n,s,o,a,d;if(null==r?r=P:_(r,0,8),!e.c)return e.toString();if(n=e.c[0],o=e.e,null==t)d=v(e.c),d=1==i||2==i&&(o<=D||o>=N)?T(d,o):E(d,o,"0");else if(s=(e=$(new G(e),t,r)).e,a=(d=v(e.c)).length,1==i||2==i&&(t<=s||s<=D)){for(;a<t;d+="0",a++);d=T(d,s)}else if(t-=o,d=E(d,s,"0"),s+1>a){if(--t>0)for(d+=".";t--;d+="0");}else if((t+=s-a)>0)for(s+1==a&&(d+=".");t--;d+="0");return e.s<0&&n?"-"+d:d}function W(e,t){for(var r,i=1,n=new G(e[0]);i<e.length;i++){if(!(r=new G(e[i])).s){n=r;break}t.call(n,r)&&(n=r)}return n}function V(e,t,r){for(var i=1,n=t.length;!t[--n];t.pop());for(n=t[0];n>=10;n/=10,i++);return(r=i+r*p-1)>q?e.c=e.e=null:r<B?e.c=[e.e=0]:(e.e=r,e.c=t),e}function $(e,t,r,i){var n,s,o,u,l,h,y,g=e.c,m=f;if(g){e:{for(n=1,u=g[0];u>=10;u/=10,n++);if((s=t-n)<0)s+=p,o=t,y=(l=g[h=0])/m[n-o-1]%10|0;else if((h=a((s+1)/p))>=g.length){if(!i)break e;for(;g.length<=h;g.push(0));l=y=0,n=1,o=(s%=p)-p+1}else{for(l=u=g[h],n=1;u>=10;u/=10,n++);y=(o=(s%=p)-p+n)<0?0:l/m[n-o-1]%10|0}if(i=i||t<0||null!=g[h+1]||(o<0?l:l%m[n-o-1]),i=r<4?(y||i)&&(0==r||r==(e.s<0?3:2)):y>5||5==y&&(4==r||i||6==r&&(s>0?o>0?l/m[n-o]:0:g[h-1])%10&1||r==(e.s<0?8:7)),t<1||!g[0])return g.length=0,i?(t-=e.e+1,g[0]=m[(p-t%p)%p],e.e=-t||0):g[0]=e.e=0,e;if(0==s?(g.length=h,u=1,h--):(g.length=h+1,u=m[p-s],g[h]=o>0?d(l/m[n-o]%m[o])*u:0),i)for(;;){if(0==h){for(s=1,o=g[0];o>=10;o/=10,s++);for(o=g[0]+=u,u=1;o>=10;o/=10,u++);s!=u&&(e.e++,g[0]==c&&(g[0]=1));break}if(g[h]+=u,g[h]!=c)break;g[h--]=0,u=1}for(s=g.length;0===g[--s];g.pop());}e.e>q?e.c=e.e=null:e.e<B&&(e.c=[e.e=0])}return e}function Z(e){var t,r=e.e;return null===r?e.toString():(t=v(e.c),t=r<=D||r>=N?T(t,r):E(t,r,"0"),e.s<0?"-"+t:t)}return G.clone=e,G.ROUND_UP=0,G.ROUND_DOWN=1,G.ROUND_CEIL=2,G.ROUND_FLOOR=3,G.ROUND_HALF_UP=4,G.ROUND_HALF_DOWN=5,G.ROUND_HALF_EVEN=6,G.ROUND_HALF_CEIL=7,G.ROUND_HALF_FLOOR=8,G.EUCLID=9,G.config=G.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(u+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(_(r=e[t],0,g,t),C=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(_(r=e[t],0,8,t),P=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(_(r[0],-g,0,t),_(r[1],0,g,t),D=r[0],N=r[1]):(_(r,-g,g,t),D=-(N=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)_(r[0],-g,-1,t),_(r[1],1,g,t),B=r[0],q=r[1];else{if(_(r,-g,g,t),!r)throw Error(u+t+" cannot be zero: "+r);B=-(q=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(u+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw L=!r,Error(u+"crypto unavailable");L=r}else L=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(_(r=e[t],0,9,t),j=r),e.hasOwnProperty(t="POW_PRECISION")&&(_(r=e[t],0,g,t),F=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(u+t+" not an object: "+r);U=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(u+t+" invalid: "+r);H="0123456789"==r.slice(0,10),z=r}}return{DECIMAL_PLACES:C,ROUNDING_MODE:P,EXPONENTIAL_AT:[D,N],RANGE:[B,q],CRYPTO:L,MODULO_MODE:j,POW_PRECISION:F,FORMAT:U,ALPHABET:z}},G.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!G.DEBUG)return!0;var t,r,i=e.c,n=e.e,s=e.s;e:if("[object Array]"=={}.toString.call(i)){if((1===s||-1===s)&&n>=-g&&n<=g&&n===d(n)){if(0===i[0]){if(0===n&&1===i.length)return!0;break e}if((t=(n+1)%p)<1&&(t+=p),String(i[0]).length==t){for(t=0;t<i.length;t++)if((r=i[t])<0||r>=c||r!==d(r))break e;if(0!==r)return!0}}}else if(null===i&&null===n&&(null===s||1===s||-1===s))return!0;throw Error(u+"Invalid BigNumber: "+e)},G.maximum=G.max=function(){return W(arguments,x.lt)},G.minimum=G.min=function(){return W(arguments,x.gt)},G.random=(s=9007199254740992,S=Math.random()*s&2097151?function(){return d(Math.random()*s)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,i,n,s,o=0,l=[],c=new G(k);if(null==e?e=C:_(e,0,g),n=a(e/p),L)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(n*=2));o<n;)(s=131072*t[o]+(t[o+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[o]=r[0],t[o+1]=r[1]):(l.push(s%1e14),o+=2);o=n/2}else{if(!crypto.randomBytes)throw L=!1,Error(u+"crypto unavailable");for(t=crypto.randomBytes(n*=7);o<n;)(s=281474976710656*(31&t[o])+1099511627776*t[o+1]+4294967296*t[o+2]+16777216*t[o+3]+(t[o+4]<<16)+(t[o+5]<<8)+t[o+6])>=9e15?crypto.randomBytes(7).copy(t,o):(l.push(s%1e14),o+=7);o=n/7}if(!L)for(;o<n;)(s=S())<9e15&&(l[o++]=s%1e14);for(n=l[--o],e%=p,n&&e&&(s=f[p-e],l[o]=d(n/s)*s);0===l[o];l.pop(),o--);if(o<0)l=[i=0];else{for(i=-1;0===l[0];l.splice(0,1),i-=p);for(o=1,s=l[0];s>=10;s/=10,o++);o<p&&(i-=p-o)}return c.e=i,c.c=l,c}),G.sum=function(){for(var e=1,t=arguments,r=new G(t[0]);e<t.length;)r=r.plus(t[e++]);return r},i=function(){var e="0123456789";function t(e,t,r,i){for(var n,s,o=[0],a=0,d=e.length;a<d;){for(s=o.length;s--;o[s]*=t);for(o[0]+=i.indexOf(e.charAt(a++)),n=0;n<o.length;n++)o[n]>r-1&&(null==o[n+1]&&(o[n+1]=0),o[n+1]+=o[n]/r|0,o[n]%=r)}return o.reverse()}return function(i,n,s,o,a){var d,u,l,c,p,h,f,y,g=i.indexOf("."),m=C,b=P;for(g>=0&&(c=F,F=0,i=i.replace(".",""),h=(y=new G(n)).pow(i.length-g),F=c,y.c=t(E(v(h.c),h.e,"0"),10,s,e),y.e=y.c.length),l=c=(f=t(i,n,s,a?(d=z,e):(d=e,z))).length;0==f[--c];f.pop());if(!f[0])return d.charAt(0);if(g<0?--l:(h.c=f,h.e=l,h.s=o,f=(h=r(h,y,m,b,s)).c,p=h.r,l=h.e),g=f[u=l+m+1],c=s/2,p=p||u<0||null!=f[u+1],p=b<4?(null!=g||p)&&(0==b||b==(h.s<0?3:2)):g>c||g==c&&(4==b||p||6==b&&1&f[u-1]||b==(h.s<0?8:7)),u<1||!f[0])i=p?E(d.charAt(1),-m,d.charAt(0)):d.charAt(0);else{if(f.length=u,p)for(--s;++f[--u]>s;)f[u]=0,u||(++l,f=[1].concat(f));for(c=f.length;!f[--c];);for(g=0,i="";g<=c;i+=d.charAt(f[g++]));i=E(i,l,d.charAt(0))}return i}}(),r=function(){function e(e,t,r){var i,n,s,o,a=0,d=e.length,u=t%y,l=t/y|0;for(e=e.slice();d--;)a=((n=u*(s=e[d]%y)+(i=l*s+(o=e[d]/y|0)*u)%y*y+a)/r|0)+(i/y|0)+l*o,e[d]=n%r;return a&&(e=[a].concat(e)),e}function t(e,t,r,i){var n,s;if(r!=i)s=r>i?1:-1;else for(n=s=0;n<r;n++)if(e[n]!=t[n]){s=e[n]>t[n]?1:-1;break}return s}function r(e,t,r,i){for(var n=0;r--;)e[r]-=n,n=e[r]<t[r]?1:0,e[r]=n*i+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(i,n,s,o,a){var u,l,h,f,y,g,v,b,_,w,T,E,S,A,R,M,I,O=i.s==n.s?1:-1,x=i.c,k=n.c;if(!(x&&x[0]&&k&&k[0]))return new G(i.s&&n.s&&(x?!k||x[0]!=k[0]:k)?x&&0==x[0]||!k?0*O:O/0:NaN);for(_=(b=new G(O)).c=[],O=s+(l=i.e-n.e)+1,a||(a=c,l=m(i.e/p)-m(n.e/p),O=O/p|0),h=0;k[h]==(x[h]||0);h++);if(k[h]>(x[h]||0)&&l--,O<0)_.push(1),f=!0;else{for(A=x.length,M=k.length,h=0,O+=2,(y=d(a/(k[0]+1)))>1&&(k=e(k,y,a),x=e(x,y,a),M=k.length,A=x.length),S=M,T=(w=x.slice(0,M)).length;T<M;w[T++]=0);I=k.slice(),I=[0].concat(I),R=k[0],k[1]>=a/2&&R++;do{if(y=0,(u=t(k,w,M,T))<0){if(E=w[0],M!=T&&(E=E*a+(w[1]||0)),(y=d(E/R))>1)for(y>=a&&(y=a-1),v=(g=e(k,y,a)).length,T=w.length;1==t(g,w,v,T);)y--,r(g,M<v?I:k,v,a),v=g.length,u=1;else 0==y&&(u=y=1),v=(g=k.slice()).length;if(v<T&&(g=[0].concat(g)),r(w,g,T,a),T=w.length,-1==u)for(;t(k,w,M,T)<1;)y++,r(w,M<T?I:k,T,a),T=w.length}else 0===u&&(y++,w=[0]);_[h++]=y,w[0]?w[T++]=x[S]||0:(w=[x[S]],T=1)}while((S++<A||null!=w[0])&&O--);f=null!=w[0],_[0]||_.splice(0,1)}if(a==c){for(h=1,O=_[0];O>=10;O/=10,h++);$(b,s+(b.e=h+l*p-1)+1,o,f)}else b.e=l,b.r=+f;return b}}(),A=/^(-?)0([xbo])(?=\w[\w.]*$)/i,R=/^([^.]+)\.$/,M=/^\.([^.]+)$/,I=/^-?(Infinity|NaN)$/,O=/^\s*\+(?=[\w.])|^\s+|\s+$/g,n=function(e,t,r,i){var n,s=r?t:t.replace(O,"");if(I.test(s))e.s=isNaN(s)?null:s<0?-1:1;else{if(!r&&(s=s.replace(A,(function(e,t,r){return n="x"==(r=r.toLowerCase())?16:"b"==r?2:8,i&&i!=n?e:t})),i&&(n=i,s=s.replace(R,"$1").replace(M,"0.$1")),t!=s))return new G(s,n);if(G.DEBUG)throw Error(u+"Not a"+(i?" base "+i:"")+" number: "+t);e.s=null}e.c=e.e=null},x.absoluteValue=x.abs=function(){var e=new G(this);return e.s<0&&(e.s=1),e},x.comparedTo=function(e,t){return b(this,new G(e,t))},x.decimalPlaces=x.dp=function(e,t){var r,i,n,s=this;if(null!=e)return _(e,0,g),null==t?t=P:_(t,0,8),$(new G(s),e+s.e+1,t);if(!(r=s.c))return null;if(i=((n=r.length-1)-m(this.e/p))*p,n=r[n])for(;n%10==0;n/=10,i--);return i<0&&(i=0),i},x.dividedBy=x.div=function(e,t){return r(this,new G(e,t),C,P)},x.dividedToIntegerBy=x.idiv=function(e,t){return r(this,new G(e,t),0,1)},x.exponentiatedBy=x.pow=function(e,t){var r,i,n,s,o,l,c,h,f=this;if((e=new G(e)).c&&!e.isInteger())throw Error(u+"Exponent not an integer: "+Z(e));if(null!=t&&(t=new G(t)),o=e.e>14,!f.c||!f.c[0]||1==f.c[0]&&!f.e&&1==f.c.length||!e.c||!e.c[0])return h=new G(Math.pow(+Z(f),o?2-w(e):+Z(e))),t?h.mod(t):h;if(l=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new G(NaN);(i=!l&&f.isInteger()&&t.isInteger())&&(f=f.mod(t))}else{if(e.e>9&&(f.e>0||f.e<-1||(0==f.e?f.c[0]>1||o&&f.c[1]>=24e7:f.c[0]<8e13||o&&f.c[0]<=9999975e7)))return s=f.s<0&&w(e)?-0:0,f.e>-1&&(s=1/s),new G(l?1/s:s);F&&(s=a(F/p+2))}for(o?(r=new G(.5),l&&(e.s=1),c=w(e)):c=(n=Math.abs(+Z(e)))%2,h=new G(k);;){if(c){if(!(h=h.times(f)).c)break;s?h.c.length>s&&(h.c.length=s):i&&(h=h.mod(t))}if(n){if(0===(n=d(n/2)))break;c=n%2}else if($(e=e.times(r),e.e+1,1),e.e>14)c=w(e);else{if(0===(n=+Z(e)))break;c=n%2}f=f.times(f),s?f.c&&f.c.length>s&&(f.c.length=s):i&&(f=f.mod(t))}return i?h:(l&&(h=k.div(h)),t?h.mod(t):s?$(h,F,P,undefined):h)},x.integerValue=function(e){var t=new G(this);return null==e?e=P:_(e,0,8),$(t,t.e+1,e)},x.isEqualTo=x.eq=function(e,t){return 0===b(this,new G(e,t))},x.isFinite=function(){return!!this.c},x.isGreaterThan=x.gt=function(e,t){return b(this,new G(e,t))>0},x.isGreaterThanOrEqualTo=x.gte=function(e,t){return 1===(t=b(this,new G(e,t)))||0===t},x.isInteger=function(){return!!this.c&&m(this.e/p)>this.c.length-2},x.isLessThan=x.lt=function(e,t){return b(this,new G(e,t))<0},x.isLessThanOrEqualTo=x.lte=function(e,t){return-1===(t=b(this,new G(e,t)))||0===t},x.isNaN=function(){return!this.s},x.isNegative=function(){return this.s<0},x.isPositive=function(){return this.s>0},x.isZero=function(){return!!this.c&&0==this.c[0]},x.minus=function(e,t){var r,i,n,s,o=this,a=o.s;if(t=(e=new G(e,t)).s,!a||!t)return new G(NaN);if(a!=t)return e.s=-t,o.plus(e);var d=o.e/p,u=e.e/p,l=o.c,h=e.c;if(!d||!u){if(!l||!h)return l?(e.s=-t,e):new G(h?o:NaN);if(!l[0]||!h[0])return h[0]?(e.s=-t,e):new G(l[0]?o:3==P?-0:0)}if(d=m(d),u=m(u),l=l.slice(),a=d-u){for((s=a<0)?(a=-a,n=l):(u=d,n=h),n.reverse(),t=a;t--;n.push(0));n.reverse()}else for(i=(s=(a=l.length)<(t=h.length))?a:t,a=t=0;t<i;t++)if(l[t]!=h[t]){s=l[t]<h[t];break}if(s&&(n=l,l=h,h=n,e.s=-e.s),(t=(i=h.length)-(r=l.length))>0)for(;t--;l[r++]=0);for(t=c-1;i>a;){if(l[--i]<h[i]){for(r=i;r&&!l[--r];l[r]=t);--l[r],l[i]+=c}l[i]-=h[i]}for(;0==l[0];l.splice(0,1),--u);return l[0]?V(e,l,u):(e.s=3==P?-1:1,e.c=[e.e=0],e)},x.modulo=x.mod=function(e,t){var i,n,s=this;return e=new G(e,t),!s.c||!e.s||e.c&&!e.c[0]?new G(NaN):!e.c||s.c&&!s.c[0]?new G(s):(9==j?(n=e.s,e.s=1,i=r(s,e,0,3),e.s=n,i.s*=n):i=r(s,e,0,j),(e=s.minus(i.times(e))).c[0]||1!=j||(e.s=s.s),e)},x.multipliedBy=x.times=function(e,t){var r,i,n,s,o,a,d,u,l,h,f,g,v,b,_,w=this,T=w.c,E=(e=new G(e,t)).c;if(!(T&&E&&T[0]&&E[0]))return!w.s||!e.s||T&&!T[0]&&!E||E&&!E[0]&&!T?e.c=e.e=e.s=null:(e.s*=w.s,T&&E?(e.c=[0],e.e=0):e.c=e.e=null),e;for(i=m(w.e/p)+m(e.e/p),e.s*=w.s,(d=T.length)<(h=E.length)&&(v=T,T=E,E=v,n=d,d=h,h=n),n=d+h,v=[];n--;v.push(0));for(b=c,_=y,n=h;--n>=0;){for(r=0,f=E[n]%_,g=E[n]/_|0,s=n+(o=d);s>n;)r=((u=f*(u=T[--o]%_)+(a=g*u+(l=T[o]/_|0)*f)%_*_+v[s]+r)/b|0)+(a/_|0)+g*l,v[s--]=u%b;v[s]=r}return r?++i:v.splice(0,1),V(e,v,i)},x.negated=function(){var e=new G(this);return e.s=-e.s||null,e},x.plus=function(e,t){var r,i=this,n=i.s;if(t=(e=new G(e,t)).s,!n||!t)return new G(NaN);if(n!=t)return e.s=-t,i.minus(e);var s=i.e/p,o=e.e/p,a=i.c,d=e.c;if(!s||!o){if(!a||!d)return new G(n/0);if(!a[0]||!d[0])return d[0]?e:new G(a[0]?i:0*n)}if(s=m(s),o=m(o),a=a.slice(),n=s-o){for(n>0?(o=s,r=d):(n=-n,r=a),r.reverse();n--;r.push(0));r.reverse()}for((n=a.length)-(t=d.length)<0&&(r=d,d=a,a=r,t=n),n=0;t;)n=(a[--t]=a[t]+d[t]+n)/c|0,a[t]=c===a[t]?0:a[t]%c;return n&&(a=[n].concat(a),++o),V(e,a,o)},x.precision=x.sd=function(e,t){var r,i,n,s=this;if(null!=e&&e!==!!e)return _(e,1,g),null==t?t=P:_(t,0,8),$(new G(s),e,t);if(!(r=s.c))return null;if(i=(n=r.length-1)*p+1,n=r[n]){for(;n%10==0;n/=10,i--);for(n=r[0];n>=10;n/=10,i++);}return e&&s.e+1>i&&(i=s.e+1),i},x.shiftedBy=function(e){return _(e,-9007199254740991,h),this.times("1e"+e)},x.squareRoot=x.sqrt=function(){var e,t,i,n,s,o=this,a=o.c,d=o.s,u=o.e,l=C+4,c=new G("0.5");if(1!==d||!a||!a[0])return new G(!d||d<0&&(!a||a[0])?NaN:a?o:1/0);if(0==(d=Math.sqrt(+Z(o)))||d==1/0?(((t=v(a)).length+u)%2==0&&(t+="0"),d=Math.sqrt(+t),u=m((u+1)/2)-(u<0||u%2),i=new G(t=d==1/0?"5e"+u:(t=d.toExponential()).slice(0,t.indexOf("e")+1)+u)):i=new G(d+""),i.c[0])for((d=(u=i.e)+l)<3&&(d=0);;)if(s=i,i=c.times(s.plus(r(o,s,l,1))),v(s.c).slice(0,d)===(t=v(i.c)).slice(0,d)){if(i.e<u&&--d,"9999"!=(t=t.slice(d-3,d+1))&&(n||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||($(i,i.e+C+2,1),e=!i.times(i).eq(o));break}if(!n&&($(s,s.e+C+2,0),s.times(s).eq(o))){i=s;break}l+=4,d+=4,n=1}return $(i,i.e+C+1,P,e)},x.toExponential=function(e,t){return null!=e&&(_(e,0,g),e++),K(this,e,t,1)},x.toFixed=function(e,t){return null!=e&&(_(e,0,g),e=e+this.e+1),K(this,e,t)},x.toFormat=function(e,t,r){var i,n=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=U;else if("object"!=typeof r)throw Error(u+"Argument not an object: "+r);if(i=n.toFixed(e,t),n.c){var s,o=i.split("."),a=+r.groupSize,d=+r.secondaryGroupSize,l=r.groupSeparator||"",c=o[0],p=o[1],h=n.s<0,f=h?c.slice(1):c,y=f.length;if(d&&(s=a,a=d,d=s,y-=s),a>0&&y>0){for(s=y%a||a,c=f.substr(0,s);s<y;s+=a)c+=l+f.substr(s,a);d>0&&(c+=l+f.slice(s)),h&&(c="-"+c)}i=p?c+(r.decimalSeparator||"")+((d=+r.fractionGroupSize)?p.replace(new RegExp("\\d{"+d+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):p):c}return(r.prefix||"")+i+(r.suffix||"")},x.toFraction=function(e){var t,i,n,s,o,a,d,l,c,h,y,g,m=this,b=m.c;if(null!=e&&(!(d=new G(e)).isInteger()&&(d.c||1!==d.s)||d.lt(k)))throw Error(u+"Argument "+(d.isInteger()?"out of range: ":"not an integer: ")+Z(d));if(!b)return new G(m);for(t=new G(k),c=i=new G(k),n=l=new G(k),g=v(b),o=t.e=g.length-m.e-1,t.c[0]=f[(a=o%p)<0?p+a:a],e=!e||d.comparedTo(t)>0?o>0?t:c:d,a=q,q=1/0,d=new G(g),l.c[0]=0;h=r(d,t,0,1),1!=(s=i.plus(h.times(n))).comparedTo(e);)i=n,n=s,c=l.plus(h.times(s=c)),l=s,t=d.minus(h.times(s=t)),d=s;return s=r(e.minus(i),n,0,1),l=l.plus(s.times(c)),i=i.plus(s.times(n)),l.s=c.s=m.s,y=r(c,n,o*=2,P).minus(m).abs().comparedTo(r(l,i,o,P).minus(m).abs())<1?[c,n]:[l,i],q=a,y},x.toNumber=function(){return+Z(this)},x.toPrecision=function(e,t){return null!=e&&_(e,1,g),K(this,e,t,2)},x.toString=function(e){var t,r=this,n=r.s,s=r.e;return null===s?n?(t="Infinity",n<0&&(t="-"+t)):t="NaN":(null==e?t=s<=D||s>=N?T(v(r.c),s):E(v(r.c),s,"0"):10===e&&H?t=E(v((r=$(new G(r),C+s+1,P)).c),r.e,"0"):(_(e,2,z.length,"Base"),t=i(E(v(r.c),s,"0"),10,e,n,!0)),n<0&&r.c[0]&&(t="-"+t)),t},x.valueOf=x.toJSON=function(){return Z(this)},x._isBigNumber=!0,null!=t&&G.set(t),G}(),s.default=s.BigNumber=s,void 0===(i=function(){return s}.call(t,r,t,e))||(e.exports=i)}()},9394:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.isValidXAddress=t.decodeXAddress=t.xAddressToClassicAddress=t.encodeXAddress=t.classicAddressToXAddress=t.isValidClassicAddress=t.decodeAccountPublic=t.encodeAccountPublic=t.decodeNodePublic=t.encodeNodePublic=t.decodeAccountID=t.encodeAccountID=t.decodeSeed=t.encodeSeed=t.codec=void 0;const o=s(r(6093)),a=r(7987);Object.defineProperty(t,"codec",{enumerable:!0,get:function(){return a.codec}}),Object.defineProperty(t,"encodeSeed",{enumerable:!0,get:function(){return a.encodeSeed}}),Object.defineProperty(t,"decodeSeed",{enumerable:!0,get:function(){return a.decodeSeed}}),Object.defineProperty(t,"encodeAccountID",{enumerable:!0,get:function(){return a.encodeAccountID}}),Object.defineProperty(t,"decodeAccountID",{enumerable:!0,get:function(){return a.decodeAccountID}}),Object.defineProperty(t,"encodeNodePublic",{enumerable:!0,get:function(){return a.encodeNodePublic}}),Object.defineProperty(t,"decodeNodePublic",{enumerable:!0,get:function(){return a.decodeNodePublic}}),Object.defineProperty(t,"encodeAccountPublic",{enumerable:!0,get:function(){return a.encodeAccountPublic}}),Object.defineProperty(t,"decodeAccountPublic",{enumerable:!0,get:function(){return a.decodeAccountPublic}}),Object.defineProperty(t,"isValidClassicAddress",{enumerable:!0,get:function(){return a.isValidClassicAddress}});const d={main:Buffer.from([5,68]),test:Buffer.from([4,147])},u=4294967295;function l(e,t,r){if(20!==e.length)throw new Error("Account ID must be 20 bytes");if(t>u)throw new Error("Invalid tag");const i=t||0,n=!1===t||null==t?0:1,s=Buffer.concat([r?d.test:d.main,e,Buffer.from([n,255&i,i>>8&255,i>>16&255,i>>24&255,0,0,0,0])]);return a.codec.encodeChecked(s)}function c(e){const t=a.codec.decodeChecked(e),r=function(e){const t=e.slice(0,2);if(d.main.equals(t))return!1;if(d.test.equals(t))return!0;throw new Error("Invalid X-address: bad prefix")}(t);return{accountId:t.slice(2,22),tag:function(e){const t=e[22];if(t>=2)throw new Error("Unsupported X-address");if(1===t)return e[23]+256*e[24]+65536*e[25]+16777216*e[26];return o.strictEqual(t,0,"flag must be zero to indicate no tag"),o.ok(Buffer.from("0000000000000000","hex").equals(e.slice(23,31)),"remaining bytes must be zero"),!1}(t),test:r}}t.classicAddressToXAddress=function(e,t,r){return l((0,a.decodeAccountID)(e),t,r)},t.encodeXAddress=l,t.xAddressToClassicAddress=function(e){const{accountId:t,tag:r,test:i}=c(e);return{classicAddress:(0,a.encodeAccountID)(t),tag:r,test:i}},t.decodeXAddress=c,t.isValidXAddress=function(e){try{c(e)}catch(e){return!1}return!0}},9587:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatArgs=t.seqEqual=void 0,t.seqEqual=function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0},t.concatArgs=function(...e){const t=[];return e.forEach((e=>{if("number"!=typeof e)for(const r of e)t.push(r);else t.push(e)})),t}},7987:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isValidClassicAddress=t.decodeAccountPublic=t.encodeAccountPublic=t.encodeNodePublic=t.decodeNodePublic=t.decodeAddress=t.decodeAccountID=t.encodeAddress=t.encodeAccountID=t.decodeSeed=t.encodeSeed=t.codec=void 0;const i=r(8540),n=r(3257),s=r(9587);const o=0,a=[1,225,75],d={sha256:e=>n("sha256").update(Buffer.from(e)).digest(),alphabet:"rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz"},u=new class{constructor(e){this._sha256=e.sha256,this._alphabet=e.alphabet,this._codec=i(this._alphabet)}encode(e,t){const r=t.versions;return this._encodeVersioned(e,r,t.expectedLength)}decode(e,t){var r;const i=t.versions,n=t.versionTypes,o=this.decodeChecked(e);if(i.length>1&&!t.expectedLength)throw new Error("expectedLength is required because there are >= 2 possible versions");const a="number"==typeof i[0]?1:i[0].length,d=null!==(r=t.expectedLength)&&void 0!==r?r:o.length-a,u=o.slice(0,-d),l=o.slice(-d);for(let e=0;e<i.length;e++){const t=Array.isArray(i[e])?i[e]:[i[e]];if((0,s.seqEqual)(u,t))return{version:t,bytes:l,type:n?n[e]:null}}throw new Error("version_invalid: version bytes do not match any of the provided version(s)")}encodeChecked(e){const t=this._sha256(this._sha256(e)).slice(0,4);return this._encodeRaw(Buffer.from((0,s.concatArgs)(e,t)))}decodeChecked(e){const t=this._decodeRaw(e);if(t.length<5)throw new Error("invalid_input_size: decoded data must have length >= 5");if(!this._verifyCheckSum(t))throw new Error("checksum_invalid");return t.slice(0,-4)}_encodeVersioned(e,t,r){if(r&&e.length!==r)throw new Error("unexpected_payload_length: bytes.length does not match expectedLength. Ensure that the bytes are a Buffer.");return this.encodeChecked(Buffer.from((0,s.concatArgs)(t,e)))}_encodeRaw(e){return this._codec.encode(e)}_decodeRaw(e){return this._codec.decode(e)}_verifyCheckSum(e){const t=this._sha256(this._sha256(e.slice(0,-4))).slice(0,4),r=e.slice(-4);return(0,s.seqEqual)(t,r)}}(d);function l(e){const t={versions:[o],expectedLength:20};return u.encode(e,t)}function c(e){const t={versions:[o],expectedLength:20};return u.decode(e,t).bytes}t.codec=u,t.encodeSeed=function(e,t){if(16!==e.length)throw new Error("entropy must have length 16");const r={expectedLength:16,versions:"ed25519"===t?a:[33]};return u.encode(e,r)},t.decodeSeed=function(e,t={versionTypes:["ed25519","secp256k1"],versions:[a,33],expectedLength:16}){return u.decode(e,t)},t.encodeAccountID=l,t.encodeAddress=l,t.decodeAccountID=c,t.decodeAddress=c,t.decodeNodePublic=function(e){const t={versions:[28],expectedLength:33};return u.decode(e,t).bytes},t.encodeNodePublic=function(e){const t={versions:[28],expectedLength:33};return u.encode(e,t)},t.encodeAccountPublic=function(e){const t={versions:[35],expectedLength:33};return u.encode(e,t)},t.decodeAccountPublic=function(e){const t={versions:[35],expectedLength:33};return u.decode(e,t).bytes},t.isValidClassicAddress=function(e){try{c(e)}catch(e){return!1}return!0}},9333:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0});const o=s(r(9499)),a=r(2823);t.default=class{constructor(){this.hash=o.sha512()}add(e){return this.hash.update(e),this}addU32(e){return this.add([e>>>24&255,e>>>16&255,e>>>8&255,255&e])}finish(){return this.hash.digest()}first256(){return this.finish().slice(0,32)}first256BN(){return new a(this.first256())}}},5503:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.decodeSeed=t.deriveNodeAddress=t.deriveAddress=t.verify=t.sign=t.deriveKeypair=t.generateSeed=void 0;const o=s(r(6093)),a=r(7048),d=s(r(9499)),u=s(r(3360)),l=s(r(9394)),c=r(6827),p=s(r(445)),h=u.eddsa("ed25519"),f=u.ec("secp256k1"),{hexToBytes:y}=p,{bytesToHex:g}=p;function m(e){return d.sha512().update(e).digest().slice(0,32)}t.generateSeed=function(e={}){o.ok(!e.entropy||e.entropy.length>=16,"entropy too short");const t=e.entropy?e.entropy.slice(0,16):a(16),r="ed25519"===e.algorithm?"ed25519":"secp256k1";return l.encodeSeed(Buffer.from(t),r)};const v={deriveKeypair(e,t){const r="00"+(0,c.derivePrivateKey)(e,t).toString(16,64).toUpperCase(),i=g(f.keyFromPrivate(r.slice(2)).getPublic().encodeCompressed());return{privateKey:r,publicKey:i}},sign:(e,t)=>g(f.sign(m(e),y(t),{canonical:!0}).toDER()),verify:(e,t,r)=>f.verify(m(e),t,y(r))},b={deriveKeypair(e){const t=m(e);return{privateKey:"ED"+g(t),publicKey:"ED"+g(h.keyFromSecret(t).pubBytes())}},sign:(e,t)=>(o.ok(Array.isArray(e),"message must be array of octets"),g(h.sign(e,y(t).slice(1)).toBytes())),verify:(e,t,r)=>h.verify(e,y(t),y(r).slice(1))};function _(e){return{"ecdsa-secp256k1":v,ed25519:b}[e]}function w(e){const t=y(e);return 33===t.length&&237===t[0]?"ed25519":"ecdsa-secp256k1"}function T(e){return l.encodeAccountID(p.computePublicKeyHash(e))}t.deriveKeypair=function(e,t){const r=l.decodeSeed(e),i=_("ed25519"===r.type?"ed25519":"ecdsa-secp256k1"),n=i.deriveKeypair(r.bytes,t),s=m("This test message should verify."),o=i.sign(s,n.privateKey);if(!0!==i.verify(s,o,n.publicKey))throw new Error("derived keypair did not generate verifiable signature");return n},t.sign=function(e,t){return _(w(t)).sign(y(e),t)},t.verify=function(e,t,r){return _(w(r)).verify(y(e),t,r)},t.deriveAddress=function(e){return T(Buffer.from(y(e)))},t.deriveNodeAddress=function(e){const t=l.decodeNodePublic(e);return T((0,c.accountPublicFromPublicGenerator)(t))};const{decodeSeed:E}=l;t.decodeSeed=E},6827:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return n(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.accountPublicFromPublicGenerator=t.derivePrivateKey=void 0;const a=s(r(3360)),d=o(r(9333)),u=a.ec("secp256k1");function l(e,t){const r=u.curve.n;for(let i=0;i<=4294967295;i++){const n=(new d.default).add(e);void 0!==t&&n.addU32(t),n.addU32(i);const s=n.first256BN();if(s.cmpn(0)>0&&s.cmp(r)<0)return s}throw new Error("impossible unicorn ;)")}t.derivePrivateKey=function(e,t={}){const r=t.validator,i=u.curve.n,n=l(e);if(r)return n;const s=u.g.mul(n),o=t.accountIndex||0;return l(s.encodeCompressed(),o).add(n).mod(i)},t.accountPublicFromPublicGenerator=function(e){const t=u.curve.decodePoint(e),r=l(e,0),i=u.g.mul(r);return t.add(i).encodeCompressed()}},445:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return n(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.computePublicKeyHash=t.hexToBytes=t.bytesToHex=void 0;const o=s(r(6093)),a=s(r(9499)),d=r(2823);t.bytesToHex=function(e){return Array.from(e,(e=>{const t=e.toString(16).toUpperCase();return t.length>1?t:`0${t}`})).join("")},t.hexToBytes=function(e){return o.ok(e.length%2==0),0===e.length?[]:new d(e,16).toArray(null,e.length/2)},t.computePublicKeyHash=function(e){const t=a.sha256().update(e).digest(),r=a.ripemd160().update(t).digest();return Buffer.from(r)}},8379:()=>{},3553:()=>{},2661:()=>{},3011:()=>{},3951:()=>{},4834:(e,t,r)=>{"use strict";var i=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],n="undefined"==typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t<i.length;t++)"function"==typeof n[i[t]]&&(e[e.length]=i[t]);return e}},7764:(e,t,r)=>{"use strict";function i(e,t){return function(){return e.apply(t,arguments)}}const{toString:n}=Object.prototype,{getPrototypeOf:s}=Object,{iterator:o,toStringTag:a}=Symbol,d=(u=Object.create(null),e=>{const t=n.call(e);return u[t]||(u[t]=t.slice(8,-1).toLowerCase())});var u;const l=e=>(e=e.toLowerCase(),t=>d(t)===e),c=e=>t=>typeof t===e,{isArray:p}=Array,h=c("undefined");function f(e){return null!==e&&!h(e)&&null!==e.constructor&&!h(e.constructor)&&m(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const y=l("ArrayBuffer");const g=c("string"),m=c("function"),v=c("number"),b=e=>null!==e&&"object"==typeof e,_=e=>{if("object"!==d(e))return!1;const t=s(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||a in e||o in e)},w=l("Date"),T=l("File"),E=l("Blob"),S=l("FileList"),A=l("URLSearchParams"),[R,M,I,O]=["ReadableStream","Request","Response","Headers"].map(l);function x(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let i,n;if("object"!=typeof e&&(e=[e]),p(e))for(i=0,n=e.length;i<n;i++)t.call(null,e[i],i,e);else{if(f(e))return;const n=r?Object.getOwnPropertyNames(e):Object.keys(e),s=n.length;let o;for(i=0;i<s;i++)o=n[i],t.call(null,e[o],o,e)}}function k(e,t){if(f(e))return null;t=t.toLowerCase();const r=Object.keys(e);let i,n=r.length;for(;n-- >0;)if(i=r[n],t===i.toLowerCase())return i;return null}const C="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:r.g,P=e=>!h(e)&&e!==C;const D=(N="undefined"!=typeof Uint8Array&&s(Uint8Array),e=>N&&e instanceof N);var N;const B=l("HTMLFormElement"),q=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),L=l("RegExp"),j=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),i={};x(r,((r,n)=>{let s;!1!==(s=t(r,n,e))&&(i[n]=s||r)})),Object.defineProperties(e,i)};const F=l("AsyncFunction"),U=(z="function"==typeof setImmediate,H=m(C.postMessage),z?setImmediate:H?(G=`axios@${Math.random()}`,K=[],C.addEventListener("message",(({source:e,data:t})=>{e===C&&t===G&&K.length&&K.shift()()}),!1),e=>{K.push(e),C.postMessage(G,"*")}):e=>setTimeout(e));var z,H,G,K;const W="undefined"!=typeof queueMicrotask?queueMicrotask.bind(C):"undefined"!=typeof process&&process.nextTick||U;var V={isArray:p,isArrayBuffer:y,isBuffer:f,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||m(e.append)&&("formdata"===(t=d(e))||"object"===t&&m(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&y(e.buffer),t},isString:g,isNumber:v,isBoolean:e=>!0===e||!1===e,isObject:b,isPlainObject:_,isEmptyObject:e=>{if(!b(e)||f(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:R,isRequest:M,isResponse:I,isHeaders:O,isUndefined:h,isDate:w,isFile:T,isBlob:E,isRegExp:L,isFunction:m,isStream:e=>b(e)&&m(e.pipe),isURLSearchParams:A,isTypedArray:D,isFileList:S,forEach:x,merge:function e(){const{caseless:t,skipUndefined:r}=P(this)&&this||{},i={},n=(n,s)=>{const o=t&&k(i,s)||s;_(i[o])&&_(n)?i[o]=e(i[o],n):_(n)?i[o]=e({},n):p(n)?i[o]=n.slice():r&&h(n)||(i[o]=n)};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&x(arguments[e],n);return i},extend:(e,t,r,{allOwnKeys:n}={})=>(x(t,((t,n)=>{r&&m(t)?e[n]=i(t,r):e[n]=t}),{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,i)=>{e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,i)=>{let n,o,a;const d={};if(t=t||{},null==e)return t;do{for(n=Object.getOwnPropertyNames(e),o=n.length;o-- >0;)a=n[o],i&&!i(a,e,t)||d[a]||(t[a]=e[a],d[a]=!0);e=!1!==r&&s(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:d,kindOfTest:l,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const i=e.indexOf(t,r);return-1!==i&&i===r},toArray:e=>{if(!e)return null;if(p(e))return e;let t=e.length;if(!v(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[o]).call(e);let i;for(;(i=r.next())&&!i.done;){const r=i.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const i=[];for(;null!==(r=e.exec(t));)i.push(r);return i},isHTMLForm:B,hasOwnProperty:q,hasOwnProp:q,reduceDescriptors:j,freezeMethods:e=>{j(e,((t,r)=>{if(m(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const i=e[r];m(i)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},i=e=>{e.forEach((e=>{r[e]=!0}))};return p(e)?i(e):i(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:k,global:C,isContextDefined:P,isSpecCompliantForm:function(e){return!!(e&&m(e.append)&&"FormData"===e[a]&&e[o])},toJSONObject:e=>{const t=new Array(10),r=(e,i)=>{if(b(e)){if(t.indexOf(e)>=0)return;if(f(e))return e;if(!("toJSON"in e)){t[i]=e;const n=p(e)?[]:{};return x(e,((e,t)=>{const s=r(e,i+1);!h(s)&&(n[t]=s)})),t[i]=void 0,n}}return e};return r(e,0)},isAsyncFn:F,isThenable:e=>e&&(b(e)||m(e))&&m(e.then)&&m(e.catch),setImmediate:U,asap:W,isIterable:e=>null!=e&&m(e[o])};function $(e,t,r,i,n){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),i&&(this.request=i),n&&(this.response=n,this.status=n.status?n.status:null)}V.inherits($,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:V.toJSONObject(this.config),code:this.code,status:this.status}}});const Z=$.prototype,Y={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Y[e]={value:e}})),Object.defineProperties($,Y),Object.defineProperty(Z,"isAxiosError",{value:!0}),$.from=(e,t,r,i,n,s)=>{const o=Object.create(Z);V.toFlatObject(e,o,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e));const a=e&&e.message?e.message:"Error",d=null==t&&e?e.code:t;return $.call(o,a,d,r,i,n),e&&null==o.cause&&Object.defineProperty(o,"cause",{value:e,configurable:!0}),o.name=e&&e.name||"Error",s&&Object.assign(o,s),o};function J(e){return V.isPlainObject(e)||V.isArray(e)}function X(e){return V.endsWith(e,"[]")?e.slice(0,-2):e}function Q(e,t,r){return e?e.concat(t).map((function(e,t){return e=X(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}const ee=V.toFlatObject(V,{},null,(function(e){return/^is[A-Z]/.test(e)}));function te(e,t,r){if(!V.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const i=(r=V.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!V.isUndefined(t[e])}))).metaTokens,n=r.visitor||u,s=r.dots,o=r.indexes,a=(r.Blob||"undefined"!=typeof Blob&&Blob)&&V.isSpecCompliantForm(t);if(!V.isFunction(n))throw new TypeError("visitor must be a function");function d(e){if(null===e)return"";if(V.isDate(e))return e.toISOString();if(V.isBoolean(e))return e.toString();if(!a&&V.isBlob(e))throw new $("Blob is not supported. Use a Buffer instead.");return V.isArrayBuffer(e)||V.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,r,n){let a=e;if(e&&!n&&"object"==typeof e)if(V.endsWith(r,"{}"))r=i?r:r.slice(0,-2),e=JSON.stringify(e);else if(V.isArray(e)&&function(e){return V.isArray(e)&&!e.some(J)}(e)||(V.isFileList(e)||V.endsWith(r,"[]"))&&(a=V.toArray(e)))return r=X(r),a.forEach((function(e,i){!V.isUndefined(e)&&null!==e&&t.append(!0===o?Q([r],i,s):null===o?r:r+"[]",d(e))})),!1;return!!J(e)||(t.append(Q(n,r,s),d(e)),!1)}const l=[],c=Object.assign(ee,{defaultVisitor:u,convertValue:d,isVisitable:J});if(!V.isObject(e))throw new TypeError("data must be an object");return function e(r,i){if(!V.isUndefined(r)){if(-1!==l.indexOf(r))throw Error("Circular reference detected in "+i.join("."));l.push(r),V.forEach(r,(function(r,s){!0===(!(V.isUndefined(r)||null===r)&&n.call(t,r,V.isString(s)?s.trim():s,i,c))&&e(r,i?i.concat(s):[s])})),l.pop()}}(e),t}function re(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function ie(e,t){this._pairs=[],e&&te(e,this,t)}const ne=ie.prototype;function se(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function oe(e,t,r){if(!t)return e;const i=r&&r.encode||se;V.isFunction(r)&&(r={serialize:r});const n=r&&r.serialize;let s;if(s=n?n(t,r):V.isURLSearchParams(t)?t.toString():new ie(t,r).toString(i),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}ne.append=function(e,t){this._pairs.push([e,t])},ne.toString=function(e){const t=e?function(t){return e.call(this,t,re)}:re;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var ae=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){V.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},de={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ue={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ie,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const le="undefined"!=typeof window&&"undefined"!=typeof document,ce="object"==typeof navigator&&navigator||void 0,pe=le&&(!ce||["ReactNative","NativeScript","NS"].indexOf(ce.product)<0),he="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,fe=le&&window.location.href||"http://localhost";var ye={...Object.freeze({__proto__:null,hasBrowserEnv:le,hasStandardBrowserWebWorkerEnv:he,hasStandardBrowserEnv:pe,navigator:ce,origin:fe}),...ue};function ge(e){function t(e,r,i,n){let s=e[n++];if("__proto__"===s)return!0;const o=Number.isFinite(+s),a=n>=e.length;if(s=!s&&V.isArray(i)?i.length:s,a)return V.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!o;i[s]&&V.isObject(i[s])||(i[s]=[]);return t(e,r,i[s],n)&&V.isArray(i[s])&&(i[s]=function(e){const t={},r=Object.keys(e);let i;const n=r.length;let s;for(i=0;i<n;i++)s=r[i],t[s]=e[s];return t}(i[s])),!o}if(V.isFormData(e)&&V.isFunction(e.entries)){const r={};return V.forEachEntry(e,((e,i)=>{t(function(e){return V.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),i,r,0)})),r}return null}const me={transitional:de,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",i=r.indexOf("application/json")>-1,n=V.isObject(e);n&&V.isHTMLForm(e)&&(e=new FormData(e));if(V.isFormData(e))return i?JSON.stringify(ge(e)):e;if(V.isArrayBuffer(e)||V.isBuffer(e)||V.isStream(e)||V.isFile(e)||V.isBlob(e)||V.isReadableStream(e))return e;if(V.isArrayBufferView(e))return e.buffer;if(V.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(n){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return te(e,new ye.classes.URLSearchParams,{visitor:function(e,t,r,i){return ye.isNode&&V.isBuffer(e)?(this.append(t,e.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((s=V.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return te(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return n||i?(t.setContentType("application/json",!1),function(e,t,r){if(V.isString(e))try{return(t||JSON.parse)(e),V.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||me.transitional,r=t&&t.forcedJSONParsing,i="json"===this.responseType;if(V.isResponse(e)||V.isReadableStream(e))return e;if(e&&V.isString(e)&&(r&&!this.responseType||i)){const r=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e,this.parseReviver)}catch(e){if(r){if("SyntaxError"===e.name)throw $.from(e,$.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ye.classes.FormData,Blob:ye.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};V.forEach(["delete","get","head","post","put","patch"],(e=>{me.headers[e]={}}));var ve=me;const be=V.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const _e=Symbol("internals");function we(e){return e&&String(e).trim().toLowerCase()}function Te(e){return!1===e||null==e?e:V.isArray(e)?e.map(Te):String(e)}function Ee(e,t,r,i,n){return V.isFunction(i)?i.call(this,t,r):(n&&(t=r),V.isString(t)?V.isString(i)?-1!==t.indexOf(i):V.isRegExp(i)?i.test(t):void 0:void 0)}class Se{constructor(e){e&&this.set(e)}set(e,t,r){const i=this;function n(e,t,r){const n=we(t);if(!n)throw new Error("header name must be a non-empty string");const s=V.findKey(i,n);(!s||void 0===i[s]||!0===r||void 0===r&&!1!==i[s])&&(i[s||t]=Te(e))}const s=(e,t)=>V.forEach(e,((e,r)=>n(e,r,t)));if(V.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(V.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let r,i,n;return e&&e.split("\n").forEach((function(e){n=e.indexOf(":"),r=e.substring(0,n).trim().toLowerCase(),i=e.substring(n+1).trim(),!r||t[r]&&be[r]||("set-cookie"===r?t[r]?t[r].push(i):t[r]=[i]:t[r]=t[r]?t[r]+", "+i:i)})),t})(e),t);else if(V.isObject(e)&&V.isIterable(e)){let r,i,n={};for(const t of e){if(!V.isArray(t))throw TypeError("Object iterator must return a key-value pair");n[i=t[0]]=(r=n[i])?V.isArray(r)?[...r,t[1]]:[r,t[1]]:t[1]}s(n,t)}else null!=e&&n(t,e,r);return this}get(e,t){if(e=we(e)){const r=V.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let i;for(;i=r.exec(e);)t[i[1]]=i[2];return t}(e);if(V.isFunction(t))return t.call(this,e,r);if(V.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=we(e)){const r=V.findKey(this,e);return!(!r||void 0===this[r]||t&&!Ee(0,this[r],r,t))}return!1}delete(e,t){const r=this;let i=!1;function n(e){if(e=we(e)){const n=V.findKey(r,e);!n||t&&!Ee(0,r[n],n,t)||(delete r[n],i=!0)}}return V.isArray(e)?e.forEach(n):n(e),i}clear(e){const t=Object.keys(this);let r=t.length,i=!1;for(;r--;){const n=t[r];e&&!Ee(0,this[n],n,e,!0)||(delete this[n],i=!0)}return i}normalize(e){const t=this,r={};return V.forEach(this,((i,n)=>{const s=V.findKey(r,n);if(s)return t[s]=Te(i),void delete t[n];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(n):String(n).trim();o!==n&&delete t[n],t[o]=Te(i),r[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return V.forEach(this,((r,i)=>{null!=r&&!1!==r&&(t[i]=e&&V.isArray(r)?r.join(", "):r)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach((e=>r.set(e))),r}static accessor(e){const t=(this[_e]=this[_e]={accessors:{}}).accessors,r=this.prototype;function i(e){const i=we(e);t[i]||(!function(e,t){const r=V.toCamelCase(" "+t);["get","set","has"].forEach((i=>{Object.defineProperty(e,i+r,{value:function(e,r,n){return this[i].call(this,t,e,r,n)},configurable:!0})}))}(r,e),t[i]=!0)}return V.isArray(e)?e.forEach(i):i(e),this}}Se.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),V.reduceDescriptors(Se.prototype,(({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}})),V.freezeMethods(Se);var Ae=Se;function Re(e,t){const r=this||ve,i=t||r,n=Ae.from(i.headers);let s=i.data;return V.forEach(e,(function(e){s=e.call(r,s,n.normalize(),t?t.status:void 0)})),n.normalize(),s}function Me(e){return!(!e||!e.__CANCEL__)}function Ie(e,t,r){$.call(this,null==e?"canceled":e,$.ERR_CANCELED,t,r),this.name="CanceledError"}function Oe(e,t,r){const i=r.config.validateStatus;r.status&&i&&!i(r.status)?t(new $("Request failed with status code "+r.status,[$.ERR_BAD_REQUEST,$.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}V.inherits(Ie,$,{__CANCEL__:!0});const xe=(e,t,r=3)=>{let i=0;const n=function(e,t){e=e||10;const r=new Array(e),i=new Array(e);let n,s=0,o=0;return t=void 0!==t?t:1e3,function(a){const d=Date.now(),u=i[o];n||(n=d),r[s]=a,i[s]=d;let l=o,c=0;for(;l!==s;)c+=r[l++],l%=e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),d-n<t)return;const p=u&&d-u;return p?Math.round(1e3*c/p):void 0}}(50,250);return function(e,t){let r,i,n=0,s=1e3/t;const o=(t,s=Date.now())=>{n=s,r=null,i&&(clearTimeout(i),i=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-n;a>=s?o(e,t):(r=e,i||(i=setTimeout((()=>{i=null,o(r)}),s-a)))},()=>r&&o(r)]}((r=>{const s=r.loaded,o=r.lengthComputable?r.total:void 0,a=s-i,d=n(a);i=s;e({loaded:s,total:o,progress:o?s/o:void 0,bytes:a,rate:d||void 0,estimated:d&&o&&s<=o?(o-s)/d:void 0,event:r,lengthComputable:null!=o,[t?"download":"upload"]:!0})}),r)},ke=(e,t)=>{const r=null!=e;return[i=>t[0]({lengthComputable:r,total:e,loaded:i}),t[1]]},Ce=e=>(...t)=>V.asap((()=>e(...t)));var Pe=ye.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,ye.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(ye.origin),ye.navigator&&/(msie|trident)/i.test(ye.navigator.userAgent)):()=>!0,De=ye.hasStandardBrowserEnv?{write(e,t,r,i,n,s){const o=[e+"="+encodeURIComponent(t)];V.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),V.isString(i)&&o.push("path="+i),V.isString(n)&&o.push("domain="+n),!0===s&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Ne(e,t,r){let i=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(i||0==r)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const Be=e=>e instanceof Ae?{...e}:e;function qe(e,t){t=t||{};const r={};function i(e,t,r,i){return V.isPlainObject(e)&&V.isPlainObject(t)?V.merge.call({caseless:i},e,t):V.isPlainObject(t)?V.merge({},t):V.isArray(t)?t.slice():t}function n(e,t,r,n){return V.isUndefined(t)?V.isUndefined(e)?void 0:i(void 0,e,0,n):i(e,t,0,n)}function s(e,t){if(!V.isUndefined(t))return i(void 0,t)}function o(e,t){return V.isUndefined(t)?V.isUndefined(e)?void 0:i(void 0,e):i(void 0,t)}function a(r,n,s){return s in t?i(r,n):s in e?i(void 0,r):void 0}const d={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(e,t,r)=>n(Be(e),Be(t),0,!0)};return V.forEach(Object.keys({...e,...t}),(function(i){const s=d[i]||n,o=s(e[i],t[i],i);V.isUndefined(o)&&s!==a||(r[i]=o)})),r}var Le=e=>{const t=qe({},e);let{data:r,withXSRFToken:i,xsrfHeaderName:n,xsrfCookieName:s,headers:o,auth:a}=t;if(t.headers=o=Ae.from(o),t.url=oe(Ne(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),V.isFormData(r))if(ye.hasStandardBrowserEnv||ye.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(V.isFunction(r.getHeaders)){const e=r.getHeaders(),t=["content-type","content-length"];Object.entries(e).forEach((([e,r])=>{t.includes(e.toLowerCase())&&o.set(e,r)}))}if(ye.hasStandardBrowserEnv&&(i&&V.isFunction(i)&&(i=i(t)),i||!1!==i&&Pe(t.url))){const e=n&&s&&De.read(s);e&&o.set(n,e)}return t};var je="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){const i=Le(e);let n=i.data;const s=Ae.from(i.headers).normalize();let o,a,d,u,l,{responseType:c,onUploadProgress:p,onDownloadProgress:h}=i;function f(){u&&u(),l&&l(),i.cancelToken&&i.cancelToken.unsubscribe(o),i.signal&&i.signal.removeEventListener("abort",o)}let y=new XMLHttpRequest;function g(){if(!y)return;const i=Ae.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders());Oe((function(e){t(e),f()}),(function(e){r(e),f()}),{data:c&&"text"!==c&&"json"!==c?y.response:y.responseText,status:y.status,statusText:y.statusText,headers:i,config:e,request:y}),y=null}y.open(i.method.toUpperCase(),i.url,!0),y.timeout=i.timeout,"onloadend"in y?y.onloadend=g:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(g)},y.onabort=function(){y&&(r(new $("Request aborted",$.ECONNABORTED,e,y)),y=null)},y.onerror=function(t){const i=new $(t&&t.message?t.message:"Network Error",$.ERR_NETWORK,e,y);i.event=t||null,r(i),y=null},y.ontimeout=function(){let t=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const n=i.transitional||de;i.timeoutErrorMessage&&(t=i.timeoutErrorMessage),r(new $(t,n.clarifyTimeoutError?$.ETIMEDOUT:$.ECONNABORTED,e,y)),y=null},void 0===n&&s.setContentType(null),"setRequestHeader"in y&&V.forEach(s.toJSON(),(function(e,t){y.setRequestHeader(t,e)})),V.isUndefined(i.withCredentials)||(y.withCredentials=!!i.withCredentials),c&&"json"!==c&&(y.responseType=i.responseType),h&&([d,l]=xe(h,!0),y.addEventListener("progress",d)),p&&y.upload&&([a,u]=xe(p),y.upload.addEventListener("progress",a),y.upload.addEventListener("loadend",u)),(i.cancelToken||i.signal)&&(o=t=>{y&&(r(!t||t.type?new Ie(null,e,y):t),y.abort(),y=null)},i.cancelToken&&i.cancelToken.subscribe(o),i.signal&&(i.signal.aborted?o():i.signal.addEventListener("abort",o)));const m=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(i.url);m&&-1===ye.protocols.indexOf(m)?r(new $("Unsupported protocol "+m+":",$.ERR_BAD_REQUEST,e)):y.send(n||null)}))};var Fe=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let r,i=new AbortController;const n=function(e){if(!r){r=!0,o();const t=e instanceof Error?e:this.reason;i.abort(t instanceof $?t:new Ie(t instanceof Error?t.message:t))}};let s=t&&setTimeout((()=>{s=null,n(new $(`timeout ${t} of ms exceeded`,$.ETIMEDOUT))}),t);const o=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(n):e.removeEventListener("abort",n)})),e=null)};e.forEach((e=>e.addEventListener("abort",n)));const{signal:a}=i;return a.unsubscribe=()=>V.asap(o),a}};const Ue=function*(e,t){let r=e.byteLength;if(!t||r<t)return void(yield e);let i,n=0;for(;n<r;)i=n+t,yield e.slice(n,i),n=i},ze=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:r}=await t.read();if(e)break;yield r}}finally{await t.cancel()}},He=(e,t,r,i)=>{const n=async function*(e,t){for await(const r of ze(e))yield*Ue(r,t)}(e,t);let s,o=0,a=e=>{s||(s=!0,i&&i(e))};return new ReadableStream({async pull(e){try{const{done:t,value:i}=await n.next();if(t)return a(),void e.close();let s=i.byteLength;if(r){let e=o+=s;r(e)}e.enqueue(new Uint8Array(i))}catch(e){throw a(e),e}},cancel:e=>(a(e),n.return())},{highWaterMark:2})},{isFunction:Ge}=V,Ke=(({Request:e,Response:t})=>({Request:e,Response:t}))(V.global),{ReadableStream:We,TextEncoder:Ve}=V.global,$e=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},Ze=e=>{e=V.merge.call({skipUndefined:!0},Ke,e);const{fetch:t,Request:r,Response:i}=e,n=t?Ge(t):"function"==typeof fetch,s=Ge(r),o=Ge(i);if(!n)return!1;const a=n&&Ge(We),d=n&&("function"==typeof Ve?(u=new Ve,e=>u.encode(e)):async e=>new Uint8Array(await new r(e).arrayBuffer()));var u;const l=s&&a&&$e((()=>{let e=!1;const t=new r(ye.origin,{body:new We,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),c=o&&a&&$e((()=>V.isReadableStream(new i("").body))),p={stream:c&&(e=>e.body)};n&&["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!p[e]&&(p[e]=(t,r)=>{let i=t&&t[e];if(i)return i.call(t);throw new $(`Response type '${e}' is not supported`,$.ERR_NOT_SUPPORT,r)})}));const h=async(e,t)=>{const i=V.toFiniteNumber(e.getContentLength());return null==i?(async e=>{if(null==e)return 0;if(V.isBlob(e))return e.size;if(V.isSpecCompliantForm(e)){const t=new r(ye.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return V.isArrayBufferView(e)||V.isArrayBuffer(e)?e.byteLength:(V.isURLSearchParams(e)&&(e+=""),V.isString(e)?(await d(e)).byteLength:void 0)})(t):i};return async e=>{let{url:n,method:o,data:a,signal:d,cancelToken:u,timeout:f,onDownloadProgress:y,onUploadProgress:g,responseType:m,headers:v,withCredentials:b="same-origin",fetchOptions:_}=Le(e),w=t||fetch;m=m?(m+"").toLowerCase():"text";let T=Fe([d,u&&u.toAbortSignal()],f),E=null;const S=T&&T.unsubscribe&&(()=>{T.unsubscribe()});let A;try{if(g&&l&&"get"!==o&&"head"!==o&&0!==(A=await h(v,a))){let e,t=new r(n,{method:"POST",body:a,duplex:"half"});if(V.isFormData(a)&&(e=t.headers.get("content-type"))&&v.setContentType(e),t.body){const[e,r]=ke(A,xe(Ce(g)));a=He(t.body,65536,e,r)}}V.isString(b)||(b=b?"include":"omit");const t=s&&"credentials"in r.prototype,d={..._,signal:T,method:o.toUpperCase(),headers:v.normalize().toJSON(),body:a,duplex:"half",credentials:t?b:void 0};E=s&&new r(n,d);let u=await(s?w(E,_):w(n,d));const f=c&&("stream"===m||"response"===m);if(c&&(y||f&&S)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=u[t]}));const t=V.toFiniteNumber(u.headers.get("content-length")),[r,n]=y&&ke(t,xe(Ce(y),!0))||[];u=new i(He(u.body,65536,r,(()=>{n&&n(),S&&S()})),e)}m=m||"text";let R=await p[V.findKey(p,m)||"text"](u,e);return!f&&S&&S(),await new Promise(((t,r)=>{Oe(t,r,{data:R,headers:Ae.from(u.headers),status:u.status,statusText:u.statusText,config:e,request:E})}))}catch(t){if(S&&S(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new $("Network Error",$.ERR_NETWORK,e,E),{cause:t.cause||t});throw $.from(t,t&&t.code,e,E)}}},Ye=new Map,Je=e=>{let t=e?e.env:{};const{fetch:r,Request:i,Response:n}=t,s=[i,n,r];let o,a,d=s.length,u=Ye;for(;d--;)o=s[d],a=u.get(o),void 0===a&&u.set(o,a=d?new Map:Ze(t)),u=a;return a};Je();const Xe={http:null,xhr:je,fetch:{get:Je}};V.forEach(Xe,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const Qe=e=>`- ${e}`,et=e=>V.isFunction(e)||null===e||!1===e;var tt=(e,t)=>{e=V.isArray(e)?e:[e];const{length:r}=e;let i,n;const s={};for(let o=0;o<r;o++){let r;if(i=e[o],n=i,!et(i)&&(n=Xe[(r=String(i)).toLowerCase()],void 0===n))throw new $(`Unknown adapter '${r}'`);if(n&&(V.isFunction(n)||(n=n.get(t))))break;s[r||"#"+o]=n}if(!n){const e=Object.entries(s).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new $("There is no suitable adapter to dispatch the request "+(r?e.length>1?"since :\n"+e.map(Qe).join("\n"):" "+Qe(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return n};function rt(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ie(null,e)}function it(e){rt(e),e.headers=Ae.from(e.headers),e.data=Re.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return tt(e.adapter||ve.adapter,e)(e).then((function(t){return rt(e),t.data=Re.call(e,e.transformResponse,t),t.headers=Ae.from(t.headers),t}),(function(t){return Me(t)||(rt(e),t&&t.response&&(t.response.data=Re.call(e,e.transformResponse,t.response),t.response.headers=Ae.from(t.response.headers))),Promise.reject(t)}))}const nt="1.12.2",st={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{st[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const ot={};st.transitional=function(e,t,r){function i(e,t){return"[Axios v"+nt+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,n,s)=>{if(!1===e)throw new $(i(n," has been removed"+(t?" in "+t:"")),$.ERR_DEPRECATED);return t&&!ot[n]&&(ot[n]=!0,console.warn(i(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,s)}},st.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};var at={assertOptions:function(e,t,r){if("object"!=typeof e)throw new $("options must be an object",$.ERR_BAD_OPTION_VALUE);const i=Object.keys(e);let n=i.length;for(;n-- >0;){const s=i[n],o=t[s];if(o){const t=e[s],r=void 0===t||o(t,s,e);if(!0!==r)throw new $("option "+s+" must be "+r,$.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new $("Unknown option "+s,$.ERR_BAD_OPTION)}},validators:st};const dt=at.validators;class ut{constructor(e){this.defaults=e||{},this.interceptors={request:new ae,response:new ae}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const r=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=qe(this.defaults,t);const{transitional:r,paramsSerializer:i,headers:n}=t;void 0!==r&&at.assertOptions(r,{silentJSONParsing:dt.transitional(dt.boolean),forcedJSONParsing:dt.transitional(dt.boolean),clarifyTimeoutError:dt.transitional(dt.boolean)},!1),null!=i&&(V.isFunction(i)?t.paramsSerializer={serialize:i}:at.assertOptions(i,{encode:dt.function,serialize:dt.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),at.assertOptions(t,{baseUrl:dt.spelling("baseURL"),withXsrfToken:dt.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=n&&V.merge(n.common,n[t.method]);n&&V.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete n[e]})),t.headers=Ae.concat(s,n);const o=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,o.unshift(e.fulfilled,e.rejected))}));const d=[];let u;this.interceptors.response.forEach((function(e){d.push(e.fulfilled,e.rejected)}));let l,c=0;if(!a){const e=[it.bind(this),void 0];for(e.unshift(...o),e.push(...d),l=e.length,u=Promise.resolve(t);c<l;)u=u.then(e[c++],e[c++]);return u}l=o.length;let p=t;for(;c<l;){const e=o[c++],t=o[c++];try{p=e(p)}catch(e){t.call(this,e);break}}try{u=it.call(this,p)}catch(e){return Promise.reject(e)}for(c=0,l=d.length;c<l;)u=u.then(d[c++],d[c++]);return u}getUri(e){return oe(Ne((e=qe(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}}V.forEach(["delete","get","head","options"],(function(e){ut.prototype[e]=function(t,r){return this.request(qe(r||{},{method:e,url:t,data:(r||{}).data}))}})),V.forEach(["post","put","patch"],(function(e){function t(t){return function(r,i,n){return this.request(qe(n||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:i}))}}ut.prototype[e]=t(),ut.prototype[e+"Form"]=t(!0)}));var lt=ut;class ct{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const r=this;this.promise.then((e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const i=new Promise((e=>{r.subscribe(e),t=e})).then(e);return i.cancel=function(){r.unsubscribe(t)},i},e((function(e,i,n){r.reason||(r.reason=new Ie(e,i,n),t(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new ct((function(t){e=t})),cancel:e}}}var pt=ct;const ht={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(ht).forEach((([e,t])=>{ht[t]=e}));var ft=ht;const yt=function e(t){const r=new lt(t),n=i(lt.prototype.request,r);return V.extend(n,lt.prototype,r,{allOwnKeys:!0}),V.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(qe(t,r))},n}(ve);yt.Axios=lt,yt.CanceledError=Ie,yt.CancelToken=pt,yt.isCancel=Me,yt.VERSION=nt,yt.toFormData=te,yt.AxiosError=$,yt.Cancel=yt.CanceledError,yt.all=function(e){return Promise.all(e)},yt.spread=function(e){return function(t){return e.apply(null,t)}},yt.isAxiosError=function(e){return V.isObject(e)&&!0===e.isAxiosError},yt.mergeConfig=qe,yt.AxiosHeaders=Ae,yt.formToJSON=e=>ge(V.isHTMLForm(e)?new FormData(e):e),yt.getAdapter=tt,yt.HttpStatusCode=ft,yt.default=yt,e.exports=yt},9787:(e,t,r)=>{"use strict";var i=r(9501),n="undefined"==typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t<i.length;t++)"function"==typeof n[i[t]]&&(e[e.length]=i[t]);return e}},183:e=>{"use strict";e.exports={rE:"6.5.4"}},5698:e=>{"use strict";e.exports=JSON.parse('{"name":"@ukeyfe/hardware-core","version":"1.1.24","description":"Core processes and APIs for communicating with UKey hardware devices.","author":"UKey","homepage":"https://github.com/UKeyHQ/hardware-js-sdk#readme","license":"ISC","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/bestyourwallet/hardware-js-sdk"},"publishConfig":{"access":"public"},"scripts":{"dev":"rimraf dist && rollup -c ../../build/rollup.config.js -w","build":"rimraf dist && rollup -c ../../build/rollup.config.js","lint":"eslint .","lint:fix":"eslint . --fix","test":"jest"},"bugs":{"url":"https://github.com/UKeyHQ/hardware-js-sdk/issues"},"dependencies":{"@ukeyfe/hardware-shared":"1.1.24","@ukeyfe/hardware-transport":"1.1.24","axios":"1.12.2","bignumber.js":"^9.0.2","bytebuffer":"^5.0.1","jszip":"^3.10.1","parse-uri":"^1.0.7","semver":"^7.3.7"},"peerDependencies":{"@noble/hashes":"^1.1.3","ripple-keypairs":"^1.3.1"},"devDependencies":{"@noble/hashes":"^1.1.3","@types/parse-uri":"^1.0.0","@types/semver":"^7.3.9","@types/w3c-web-usb":"^1.0.10","@types/web-bluetooth":"^0.0.21","ripple-keypairs":"^1.3.1"}}')}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var __webpack_exports__={};return(()=>{"use strict";__webpack_require__.d(__webpack_exports__,{default:()=>Ze});var e=__webpack_require__(46),t=__webpack_require__.n(e),r=__webpack_require__(4362),i=__webpack_require__(8492);let n,s,o=(0,i.createDeferred)(),a=0;const d=async e=>{o=(0,i.createDeferred)();const t=document.getElementById("ukey-connect");t?n=t:(n=document.createElement("iframe"),n.frameBorder="0",n.width="0px",n.height="0px",n.style.position="absolute",n.style.display="none",n.style.border="0px",n.style.width="0px",n.style.height="0px",n.id="ukey-connect",n.allow="usb");const r=`${e.iframeSrc}`;n.setAttribute("src",r),s=(e=>{if("string"!=typeof e)return"unknown";if(0===e.indexOf("file://"))return"file://";const t=e.match(/^.+\:\/\/[^\/]+/);return Array.isArray(t)&&t.length>0?t[0]:"unknown"})(n.src),a=window.setTimeout((()=>{o.reject(i.ERRORS.TypedError(i.HardwareErrorCode.IframeTimeout))}),1e4);const d=()=>{var t;n?(null===(t=n.contentWindow)||void 0===t||t.postMessage({type:"iframe-init",payload:{settings:{...e}}},s),n.onload=null):o.reject(i.ERRORS.TypedError(i.HardwareErrorCode.IframeBlocked))};n.attachEvent?n.attachEvent("onload",d):n.onload=d,document.body&&document.body.appendChild(n);try{await o.promise}catch(e){throw n&&(n.parentNode&&n.parentNode.removeChild(n),n=null),e}finally{window.clearTimeout(a),a=0}},u={iframeName:"onekey-iframe",hostName:"onekey-host",channel:"onekey-js-sdk",scope:"$hardware_sdk"};const l=function(e){return null==e};const c="object"==typeof global&&global&&global.Object===Object&&global;var p="object"==typeof self&&self&&self.Object===Object&&self;const h=(c||p||Function("return this")()).Symbol;var f=Object.prototype,y=f.hasOwnProperty,g=f.toString,m=h?h.toStringTag:void 0;const v=function(e){var t=y.call(e,m),r=e[m];try{e[m]=void 0;var i=!0}catch(e){}var n=g.call(e);return i&&(t?e[m]=r:delete e[m]),n};var b=Object.prototype.toString;const _=function(e){return b.call(e)};var w=h?h.toStringTag:void 0;const T=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":w&&w in Object(e)?v(e):_(e)};const E=function(e,t){return function(r){return e(t(r))}}(Object.getPrototypeOf,Object);const S=function(e){return null!=e&&"object"==typeof e};var A=Function.prototype,R=Object.prototype,M=A.toString,I=R.hasOwnProperty,O=M.call(Object);const x=function(e){if(!S(e)||"[object Object]"!=T(e))return!1;var t=E(e);if(null===t)return!0;var r=I.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&M.call(r)==O};const k=Array.isArray;const C=function(e){return"string"==typeof e||!k(e)&&S(e)&&"[object String]"==T(e)};var P=__webpack_require__(5747),D=__webpack_require__.n(P);function N(e,t,r){try{Reflect.apply(e,t,r)}catch(e){setTimeout((()=>{throw e}))}}class B extends(D()){emit(e,...t){return super.emit(e,...t)}addListener(e,t){return super.addListener(e,t),this}on(e,t){return super.on(e,t),this}once(e,t){return super.once(e,t),this}removeListener(e,t){return super.removeListener(e,t),this}off(e,t){return super.off(e,t),this}removeAllListeners(e){return super.removeAllListeners(e),this}setMaxListeners(e){return super.setMaxListeners(e),this}getMaxListeners(){return super.getMaxListeners()}listeners(e){return super.listeners(e)}rawListeners(e){return super.rawListeners(e)}listenerCount(e){return super.listenerCount(e)}prependListener(e,t){return super.prependListener(e,t),this}prependOnceListener(e,t){return super.prependOnceListener(e,t),this}eventNames(){return super.eventNames()}}class q extends B{emit(e,...t){let r="error"===e;const i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){let e;if(t.length>0&&([e]=t),e instanceof Error)throw e;const r=new Error("Unhandled error."+(e?` (${e.message})`:""));throw r.context=e,r}const n=i[e];if(void 0===n)return!1;if("function"==typeof n)N(n,this,t);else{const e=n.length,r=function(e){const t=e.length,r=new Array(t);for(let i=0;i<t;i+=1)r[i]=e[i];return r}(n);for(let i=0;i<e;i+=1)N(r[i],this,t)}return!0}}const L="$$ONEKEY_DEBUG_LOGGER";var j=__webpack_require__(7250),F=__webpack_require__.n(j),U=function(e,t,r,i){return new(r||(r=Promise))((function(n,s){function o(e){try{d(i.next(e))}catch(e){s(e)}}function a(e){try{d(i.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}d((i=i.apply(e,t||[])).next())}))};const z=function(e){return U(this,void 0,void 0,(function*(){function t(e){let i,n,s,o=null;function a(...e){if(!a.enabled)return;const r=a,n=Number(new Date),s=n-(i||n);r.diff=s,r.prev=i,r.curr=n,i=n,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let o=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((i,n)=>{if("%%"===i)return"%";o++;const s=t.formatters[n];if("function"==typeof s){const t=e[o];i=s.call(r,t),e.splice(o,1),o--}return i})),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(n!==t.namespaces&&(n=t.namespaces,s=t.enabled(e)),s),set:e=>{o=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,r){const i=t(this.namespace+(void 0===r?":":r)+e);return i.log=this.log,i}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(i),...t.skips.map(i).map((e=>`-${e}`))].join(",");return t.enable(""),e},t.enable=function(e){return U(this,void 0,void 0,(function*(){let r;yield t.save(e),t.namespaces=e,t.names=[],t.skips=[];const i=("string"==typeof e?e:"").split(/[\s,]+/),n=i.length;for(r=0;r<n;r++)i[r]&&("-"===(e=i[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp(`^${e.substr(1)}$`)):t.names.push(new RegExp(`^${e}$`)))}))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,i;for(r=0,i=t.skips.length;r<i;r++)if(t.skips[r].test(e))return!1;for(r=0,i=t.names.length;r<i;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=F(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={j(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: ${e.message}`}}},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]};const n=yield t.load();return yield t.enable(n),t}))};var H=function(e,t,r,i){return new(r||(r=Promise))((function(n,s){function o(e){try{d(i.next(e))}catch(e){s(e)}}function a(e){try{d(i.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}d((i=i.apply(e,t||[])).next())}))};const G=L,K={};K.formatArgs=function(e){if(e[0]=`${(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")}+${K.humanize(this.diff)}`,!this.useColors)return;const t=`color: ${this.color}`;e.splice(1,0,t,"color: inherit");let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(r+=1,"%c"===e&&(i=r))})),e.splice(i,0,t)},K.save=function(e){return H(this,void 0,void 0,(function*(){try{e?yield K.storage.setItem(G,e):l(e)?yield K.storage.removeItem(G):yield K.storage.setItem(G,"")}catch(e){console.error("debug logger storage error",e)}}))},K.load=function(){return H(this,void 0,void 0,(function*(){let e;try{e=yield K.storage.getItem(G)}catch(e){console.error("debug logger storage error",e)}return!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG),e}))},K.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},K.storage=function(){try{return void 0!==__webpack_require__.g&&__webpack_require__.g.$$onekeyAppStorage?__webpack_require__.g.$$onekeyAppStorage:"undefined"!=typeof window&&window.localStorage?window.localStorage:(console.warn("debugLogger init warning, neither `global.$$onekeyAppStorage` nor `window.localStorage` found."),{getItem(){return H(this,void 0,void 0,(function*(){return""}))},setItem(){return H(this,void 0,void 0,(function*(){}))},removeItem(){return H(this,void 0,void 0,(function*(){}))}})}catch(e){console.error("debug logger storage error",e)}}(),K.humanize=F(),K.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),K.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],K.log=(...e)=>{console.debug?console.debug(...e):console.log&&console.log(...e)};const W=K;var V=function(e,t,r,i){return new(r||(r=Promise))((function(n,s){function o(e){try{d(i.next(e))}catch(e){s(e)}}function a(e){try{d(i.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}d((i=i.apply(e,t||[])).next())}))};const $=function(){return V(this,void 0,void 0,(function*(){return z(W)}))};function Z(...e){"undefined"!=typeof localStorage&&localStorage.getItem(L)&&console.error(...e)}const Y={_isFakeLogger:!0,log:(...e)=>{},warn:(...e)=>{},error:(...e)=>{},debug:(...e)=>{},info:(...e)=>{},trace:(...e)=>{}};var J;!function(e){e.jsBridge="jsBridge",e.providerBase="providerBase",e.extInjected="extInjected",e.extContentScripts="extContentScripts",e.webview="webview",e.desktopInjected="desktopInjected",e.ethereum="ethereum"}(J||(J={}));class X extends q{constructor(){super(),this.jsBridge=(...e)=>null,this.providerBase=(...e)=>null,this.extInjected=(...e)=>null,this.extContentScripts=(...e)=>null,this.webview=(...e)=>null,this.desktopInjected=(...e)=>null,this.ethereum=(...e)=>null,this.isFaked=!0,this._debug={enable(e){}},this._externalLogger=Y,this._createExternalLog=e=>(...t)=>{var r,i;return this.once("debugReady",(()=>{var r;this.isFaked||null===(r=this[e])||void 0===r||r.call(this,...t)})),null===(i=null===(r=this._externalLogger)||void 0===r?void 0:r.log)||void 0===i?void 0:i.call(r,`${e} >>> `,...t)},this.initExternalLogInstances(),this.setMaxListeners(9999)}initExternalLogInstances(){Object.keys(J).forEach((e=>{this[e]=this._createExternalLog(e)}))}isDebugReady(){return this._debug&&"function"==typeof this._debug}_attachExternalLogger(e){e&&(this._externalLogger=e)}_createDebugInstance(e){}}new X;const Q=new class extends X{constructor(){super(),this.isFaked=!1,this._debugInstanceCreatedMap={},$().then((e=>{this._debug=e,this.isFaked=!1,this.initDebugInstances(),this.emit("debugReady")}))}initDebugInstances(){this.isDebugReady()&&Object.keys(J).forEach((e=>{this[e]=this._debug(e)}))}_createDebugInstance(e){if(!this._debugInstanceCreatedMap[e]&&(this._debugInstanceCreatedMap[e]=!0,e&&this._debug&&"function"==typeof this._debug)){const t=this._debug(e),r=this[e];this[e]=(...e)=>{t(...e),r&&"function"==typeof r&&r(...e)}}}};var ee=__webpack_require__(282),te=__webpack_require__.n(ee);class re extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw new Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==r&&(this.data=r)}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),e}toString(){return te()(this.serialize(),ne,2)}}class ie extends re{constructor(e,t,r){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}}function ne(e,t){if("[Circular]"!==t)return t}const se={invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},oe={userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,requestTimeout:4500},ae={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Web3 provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4500:{standard:"",message:"The request by this Web3 provider is timeout."}},de=se.internal,ue="Unspecified error message. This is a bug, please report it.",le=(ce(de),"Unspecified server error.");function ce(e,t=ue){if(Number.isInteger(e)){const t=e.toString();if(he(ae,t))return ae[t].message;if(pe(e))return le}return t}function pe(e){return e>=-32099&&e<=-32e3}function he(e,t){return Object.prototype.hasOwnProperty.call(e,t)}const fe={userRejectedRequest:e=>ye(oe.userRejectedRequest,e),unauthorized:e=>ye(oe.unauthorized,e),unsupportedMethod:e=>ye(oe.unsupportedMethod,e),disconnected:e=>ye(oe.disconnected,e),chainDisconnected:e=>ye(oe.chainDisconnected,e),requestTimeout:e=>ye(oe.requestTimeout,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Web3 Provider custom errors must provide single object argument.");const{code:t,message:r,data:i}=e;if(!r||"string"!=typeof r)throw new Error('"message" must be a nonempty string');return new ie(t,r,i)}};function ye(e,t){const[r,i]=ge(t);return new ie(e,r||ce(e),i)}function ge(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}var me,ve;!function(e){e.RESPONSE="RESPONSE",e.REQUEST="REQUEST"}(me||(me={})),function(e){e.btc="btc",e.ethereum="ethereum",e.conflux="conflux",e.tron="tron",e.solana="solana",e.sollet="sollet",e.near="near",e.aptos="aptos",e.martian="martian",e.algo="algo",e.sui="sui",e.cardano="cardano",e.alephium="alephium",e.cosmos="cosmos",e.polkadot="polkadot",e.scdo="scdo",e.ton="ton",e.webln="webln",e.nostr="nostr",e.bfc="bfc",e.neo="neo",e.$private="$private",e.$hardware_sdk="$hardware_sdk",e.$walletConnect="$walletConnect"}(ve||(ve={}));const be="2.2.47";var _e=function(e,t,r,i){return new(r||(r=Promise))((function(n,s){function o(e){try{d(i.next(e))}catch(e){s(e)}}function a(e){try{d(i.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,a)}d((i=i.apply(e,t||[])).next())}))};console.log;const we="undefined"!=typeof window?window:__webpack_require__.g,Te="message",Ee="error";class Se extends q{constructor(e={}){var t,r;super(),this._requestPayloadCache={},this.isExtUi=!1,this.isInjected=!1,this.sendAsString=!0,this.globalOnMessageEnabled=!0,this.providersHub={},this.globalOnMessage=e=>_e(this,void 0,void 0,(function*(){try{if(this.config.receiveHandler&&this.globalOnMessageEnabled){const t=yield this.config.receiveHandler(e,this);e.id&&this.response({id:e.id,scope:e.scope,remoteId:e.remoteId,data:t,peerOrigin:e.origin})}}catch(t){e.id&&e.type===me.REQUEST&&this.responseError({id:e.id,scope:e.scope,remoteId:e.remoteId,error:t,peerOrigin:e.origin}),this.emit(Ee,t)}})),this.version=be,this.remoteInfo={origin:"",remoteId:""},this.callbacksExpireTimeout=6e5,this.debugLogger=Q,this.callbacks=[],this.callbackId=1,this.config=e,this.callbacksExpireTimeout=null!==(t=e.timeout)&&void 0!==t?t:this.callbacksExpireTimeout,this.debugLogger=e.debugLogger||Q,this.sendAsString=null!==(r=e.sendAsString)&&void 0!==r?r:this.sendAsString,this.config.receiveHandler&&this.on(Te,this.globalOnMessage),this.on(Ee,(e=>{Z("JsBridge ERROR: ",e,{code:null==e?void 0:e.code})})),this.rejectExpiredCallbacks()}attachProviderInstance(e){var t;const r=e.providerName;r&&(this.providersHub[r]=null!==(t=this.providersHub[r])&&void 0!==t?t:[],this.providersHub[r].push(e))}createCallbackId(){return this.callbackId+=1,this.callbackId}createPayload(e,{resolve:t,reject:r}){const{id:i,type:n}=e;if(t&&r&&i&&n===me.REQUEST){if(this.callbacks[i])throw new Error(`JsBridge ERROR: callback exists, id=${i}`);this.callbacks[i]={id:i,resolve:t,reject:r,created:Date.now()}}if(e.error){const t=e.error;e.error=function(e){return{constructorName:e.constructorName,name:e.name,message:e.message,stack:e.stack,code:e.code,data:e.data,key:e.key,info:e.info,className:e.className,autoToast:e.autoToast,requestId:e.requestId,reconnect:e.reconnect,payload:e.payload}}(t)}return null==e||delete e.resolve,null==e||delete e.reject,e}send({type:e,data:t,error:r,id:i,remoteId:n,sync:s=!1,scope:o,peerOrigin:a}){const d=(d,u)=>{var l,c,p;let h=i;s||e!==me.REQUEST||(h=this.createCallbackId());try{const i=this.createPayload({id:h,data:t,error:r,type:e,origin:(null===(l=null==we?void 0:we.location)||void 0===l?void 0:l.origin)||"",peerOrigin:a,remoteId:n,scope:o},{resolve:d,reject:u});let s=i;this.sendAsString&&(s=JSON.stringify(i)),(null===(c=this.debugLogger.jsBridge)||void 0===c?void 0:c.enabled)&&i&&i.id&&i.type===me.REQUEST&&(this._requestPayloadCache[i.id]=i,i.id%100==0&&(this._requestPayloadCache={})),this.debugLogger.jsBridge("send",i,"\r\n ------\x3e ",i.data,"\r\n ------\x3e ",null===(p=i.data)||void 0===p?void 0:p.result),this.sendPayload(s)}catch(e){h?this.rejectCallback(h,e):this.emit(Ee,e)}};if(!s)return new Promise(d);d()}rejectCallback(e,t){this.processCallback({method:"reject",id:e,error:t})}resolveCallback(e,t){this.processCallback({method:"resolve",id:e,data:t})}processCallback({method:e,id:t,data:r,error:i}){const n=this.callbacks[t];n&&("reject"===e&&(n.reject&&n.reject(i),this.emit(Ee,i)),"resolve"===e&&n.resolve&&n.resolve(r),this.clearCallbackCache(t))}rejectExpiredCallbacks(){if(!this.callbacksExpireTimeout)return;const e=Date.now(),t=this.callbacks.length;for(let r=0;r<t;r++){const t=this.callbacks[r];if(t&&t.created&&e-t.created>this.callbacksExpireTimeout){const e=fe.requestTimeout();this.rejectCallback(r,e)}}setTimeout((()=>{this.rejectExpiredCallbacks()}),this.callbacksExpireTimeout)}clearCallbackCache(e){delete this.callbacks[e]}receive(e="",t){var r,i,n,s,o;let a={data:null};if(l(e)||""===e)throw new Error("JsBridge ERROR: receive() payload is empty");if(x(e)&&(a=e),C(e))try{a=JSON.parse(e)}catch(h){throw this.emit(Ee,h),new Error("JsBridge ERROR: JSON.parse payloadReceived failed")}if(a.origin=null==t?void 0:t.origin,a.internal=Boolean(null==t?void 0:t.internal),(null==t?void 0:t.internal)&&this.isExtUi&&function(e){const t=e;return Boolean(t.name)&&["onekey-provider-eth","onekey-provider-cfx","publicConfig"].includes(t.name)}(a))return;if(!a.origin&&!this.isInjected)throw Z(null===(r=null==this?void 0:this.constructor)||void 0===r?void 0:r.name,"[payload.origin] is missing.",this),new Error("JsBridge ERROR: receive message [payload.origin] is required.");if(!a.internal&&!a.scope)throw new Error("JsBridge ERROR: receive message [payload.scope] is required for non-internal method call.");const d=null!==(n=this._requestPayloadCache[null!==(i=null==a?void 0:a.id)&&void 0!==i?i:""])&&void 0!==n?n:null;this.debugLogger.jsBridge("receive",a,{sender:t},"\r\n -----\x3e ",null!==(o=null===(s=a.data)||void 0===s?void 0:s.result)&&void 0!==o?o:a.data,"\r\n <----- ",null==d?void 0:d.data);const{type:u,id:c,data:p,error:h,origin:f,remoteId:y}=a;if(this.remoteInfo={origin:f,remoteId:y},u===me.RESPONSE){if(null==c)throw new Error("JsBridge ERROR: parameter [id] is required in JsBridge.receive() when REQUEST type message");if(this.callbacks[c])try{if(h){const e=function(e){if(e instanceof Error)return e;const t=e,r=new Error(t.message),i=Object.keys(t);for(const e of i)r[e]=t[e];return r}(h);this.rejectCallback(c,e)}else this.resolveCallback(c,p)}catch(e){this.emit(Ee,e)}}else{if(u!==me.REQUEST)throw new Error(`JsBridge ERROR: payload type not support yet (type=${u||"undefined"})`);{const e=Object.assign(Object.assign({},a),{created:Date.now()});this.emit(Te,e)}}}requestSync({data:e,scope:t,remoteId:r}){this.send({id:void 0,type:me.REQUEST,scope:t,data:e,remoteId:r,sync:!0})}request(e){const{data:t,remoteId:r,scope:i}=e;return void 0===t&&console.warn("JsBridge ERROR: data required. Call like `bridge.request({ data: {...} });`"),this.send({type:me.REQUEST,data:t,remoteId:r,sync:!1,scope:i})}response({id:e,data:t,remoteId:r,scope:i,peerOrigin:n}){this.send({type:me.RESPONSE,data:t,id:e,remoteId:r,scope:i,sync:!0,peerOrigin:n})}responseError({id:e,error:t,scope:r,remoteId:i,peerOrigin:n}){this.send({type:me.RESPONSE,error:t,id:e,remoteId:i,scope:r,sync:!0,peerOrigin:n})}}var Ae;!function(e){e[e.DEBUG=0]="DEBUG",e[e.LOG=1]="LOG",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR"}(Ae||(Ae={}));new class{constructor(e=null){this.module=e;const t=function(){if("undefined"==typeof localStorage)return;const e=localStorage.getItem(L);if(null!==e)try{const t=parseInt(e,10);if(t in Ae)return t}catch(e){return}}();this.level=null!=t?t:Ae.DEBUG,this.level=null!=t?t:Ae.ERROR}shouldLog(e){return e>=this.level}formatMessage(...e){return this.module?[`[${this.module}]:`,...e]:e}debug(...e){this.shouldLog(Ae.DEBUG)&&console.debug(...this.formatMessage(...e))}log(...e){this.shouldLog(Ae.LOG)&&console.log(...this.formatMessage(...e))}warn(...e){this.shouldLog(Ae.WARN)&&console.warn(...this.formatMessage(...e))}error(...e){this.shouldLog(Ae.ERROR)&&console.error(...this.formatMessage(...e))}};let Re=!1;class Me extends Se{constructor(e){var t;super(e),this.sendAsString=!1,this.isInjected=!0,this.bridgeConfig=e,this.targetOrigin=null!==(t=e.targetOrigin)&&void 0!==t?t:window.location.origin,function(e={}){Re||(Re=!0,window.addEventListener("message",(t=>{var r,i,n;const s=t.data,o=null===(r=e.bridge)||void 0===r?void 0:r.bridgeConfig;if(o&&s.channel===o.channel&&s.frameName===o.remoteFrameName){const t=s.payload,r=null!==(i=e.bridge)&&void 0!==i?i:null===(n=null===window||void 0===window?void 0:window.$onekey)||void 0===n?void 0:n.jsBridge;r&&r.receive(t)}}),!1))}({debugLogger:this.debugLogger,bridge:this,origin:this.targetOrigin})}sendPayload(e){const t={channel:this.bridgeConfig.channel,frameName:this.bridgeConfig.selfFrameName,payload:e,direction:""};this.bridgeConfig.remoteFrame.postMessage(t,this.targetOrigin)}}var Ie;!function(e){e.btc="unisat",e.sui="suiWallet",e.polkadot="polkadot-js"}(Ie||(Ie={}));var Oe=__webpack_require__(5250);let xe,ke;const Ce=(0,r.tZ)(r.d3.SendMessage),Pe=()=>{Re=!1},De=async(e,t=!0)=>{const n=t?ke:xe;try{const t=r.Qk.has((0,Oe.get)(e,"type"))?e.type:void 0;"LOG_EVENT"!==e.event&&(t?Ce.debug("request: ",t):Ce.debug("request: ",e));const i=await(null==n?void 0:n.request({scope:u.scope,data:{...e}}));return"LOG_EVENT"!==e.event&&(t?Ce.debug("request result: ",t):Ce.debug("request result: ",i)),i}catch(e){throw Ce.error(e),i.ERRORS.CreateErrorByMessage(e.message)}},Ne=new(t()),Be=(0,r.tZ)(r.d3.Connect);let qe=(0,r.h1)();const Le=async e=>{switch(e.event){case r.y2:if(e.type===r.P3.INIT_BRIDGE)return o.resolve(),Promise.resolve({success:!0,payload:"JSBridge Handshake Success"});Ne.emit(e.event,e),Ne.emit(e.type,e.payload);break;case r.i3:case r.zi:Ne.emit(e.event,e);break;case r._4:[r.db.CONNECT,r.db.DISCONNECT,r.db.FEATURES,r.db.SUPPORT_FEATURES].includes(e.type)&&Ne.emit(e.type,e.payload);break;case r.P3.CALLBACK:{const{callbackId:t,data:i,error:n}=e.payload;(0,r.bm)(t,i,n);break}default:Be.warn("No need to be captured message",e.event)}};function je(e){const t=(e=>{const t=(e=>{if("string"!=typeof e)return;const[,,t]=e.match(/^(https?):\/\/([^:/]+)?/i)??[];if(t){const e=t.split(".");return e.length>2?e.slice(e.length-2,e.length).join("."):t}})(e);return r.qX.find((r=>r.origin===e||r.origin===t))})(e.parentOrigin??"")||(e.extension,!0);if(!t)throw i.ERRORS.TypedError(i.HardwareErrorCode.IframeDistrust,JSON.stringify(e))}const Fe=()=>{je(qe),Ne.removeAllListeners(),(()=>{if(n&&n.parentNode)try{n.parentNode.removeChild(n)}catch(e){}n=null,a=0})(),qe=(0,r.h1)(),window.removeEventListener("message",Ge)},Ue=e=>{if(!n)throw i.ERRORS.TypedError(i.HardwareErrorCode.IFrameNotInitialized);const{type:t,payload:s}=e;De({event:r.y2,type:t,payload:s})},ze=e=>{De({event:r.P3.CANCEL,type:r.P3.CANCEL,payload:{connectId:e}})};let He=null;const Ge=e=>{var t,i,o;e.origin===s&&(ke&&He===(null===(t=n)||void 0===t?void 0:t.contentWindow)||(Pe(),(e=>{const t=new Me(e);e.isHost?ke=t:xe=t})({isHost:!0,remoteFrame:null===(i=n)||void 0===i?void 0:i.contentWindow,remoteFrameName:u.iframeName,selfFrameName:u.hostName,channel:u.channel,targetOrigin:s,receiveHandler:async e=>{const t=(0,r.vY)(e);"LOG_EVENT"!==t.event&&(["DEVICE_EVENT","FIRMWARE_EVENT"].includes(t.event)||Be.debug("Host Bridge Receive message: ",t));const i=await Le(t);return"LOG_EVENT"!==t.event&&(["DEVICE_EVENT","FIRMWARE_EVENT"].includes(t.event)||Be.debug("Host Bridge response: ",t)),i}}),He=null===(o=n)||void 0===o?void 0:o.contentWindow))},Ke=async e=>{if(n)throw i.ERRORS.TypedError(i.HardwareErrorCode.IFrameAleradyInitialized);qe=(0,r.h1)({...qe,...e}),je(qe),(0,r.sp)(!!e.debug),(0,r.ao)(Le),Be.debug("init"),window.addEventListener("message",Ge),window.addEventListener("unload",Fe);try{return await d({...qe,version:"1.1.24"}),!0}catch(e){return console.log("init error: ",e),!1}},We=async e=>{if(Be.debug("call : ",e),!n&&!a){qe=(0,r.h1)(qe),je(qe),Be.debug("Try to recreate iframe if it's initialize failed: ",qe);try{if(!await Ke(qe))return Be.debug("Recreate iframe failed"),(0,r.Gy)(i.ERRORS.TypedError(i.HardwareErrorCode.IFrameLoadFail));Be.debug("Recreate iframe success")}catch(e){return Be.debug("Recreate iframe failed: ",e),(0,r.Gy)(e)}}if(a)return(0,r.Gy)(i.ERRORS.TypedError(i.HardwareErrorCode.IFrameLoadFail));try{const t=await De({event:r.P3.CALL,type:r.P3.CALL,payload:e});return t||(0,r.Gy)(i.ERRORS.TypedError(i.HardwareErrorCode.CallMethodNotResponse))}catch(e){Be.error("__call error: ",e);let t=e;return t instanceof i.HardwareError||(t=i.ERRORS.CreateErrorByMessage(e.message)),(0,r.Gy)(t)}},Ve=async e=>{if(n)throw i.ERRORS.TypedError(i.HardwareErrorCode.IFrameAleradyInitialized);return je(qe),Be.debug("updateSettings API Called =>: old settings: ",qe),qe=(0,r.h1)({...qe,...e}),Be.debug("updateSettings API Called =>: new settings: ",qe),Promise.resolve(!0)},$e=async e=>{if(n){return await De({event:r.P3.SWITCH_TRANSPORT,type:r.P3.SWITCH_TRANSPORT,payload:{env:e}})}throw i.ERRORS.TypedError(i.HardwareErrorCode.IFrameNotInitialized)},Ze={HardwareSDKLowLevel:(0,r.NH)({eventEmitter:Ne,init:Ke,call:We,cancel:ze,dispose:Fe,addHardwareGlobalEventListener:e=>{[r.y2,r.i3,r.zi,r.db.CONNECT,r.db.DISCONNECT,r.db.FEATURES,r.db.SUPPORT_FEATURES,r.Pr.FIRMWARE_PROGRESS,r.Pr.FIRMWARE_TIP,r.Pr.PREVIOUS_ADDRESS_RESULT].forEach((t=>{Ne.on(t,(r=>{let i=r;r.event||r.type||(i={...r,event:t,type:t}),null==e||e(i)}))}))},uiResponse:Ue,updateSettings:Ve,switchTransport:$e}),HardwareSDKTopLevel:(0,r.O3)(),HardwareWebSdk:(0,r.Ay)({eventEmitter:Ne,init:Ke,call:We,cancel:ze,dispose:Fe,uiResponse:Ue,updateSettings:Ve,switchTransport:$e})}})(),__webpack_exports__=__webpack_exports__.default,__webpack_exports__})()));