!function(e){var n={};function t(l){if(n[l])return n[l].exports;var r=n[l]={i:l,l:!1,exports:{}};return e[l].call(r.exports,r,r.exports,t),r.l=!0,r.exports}t.m=e,t.c=n,t.d=function(e,n,l){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:l})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var l=Object.create(null);if(t.r(l),Object.defineProperty(l,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var r in e)t.d(l,r,function(n){return e[n]}.bind(null,r));return l},t.n=function(e){var n=e&&e.__esModule?function n(){return e.default}:function n(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=149)}([function(e,n){var t=e.exports={},l,r;function a(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function o(e){if(l===setTimeout)return setTimeout(e,0);if((l===a||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(n){try{return l.call(null,e,0)}catch(n){return l.call(this,e,0)}}}function s(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(n){try{return r.call(null,e)}catch(n){return r.call(this,e)}}}!function(){try{l="function"==typeof setTimeout?setTimeout:a}catch(e){l=a}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var u=[],c=!1,p,h=-1;function f(){c&&p&&(c=!1,p.length?u=p.concat(u):h=-1,u.length&&d())}function d(){if(!c){var e=o(f);c=!0;for(var n=u.length;n;){for(p=u,u=[];++h1)for(var t=1;t=a)return e;switch(e){case"%s":return String(l[t++]);case"%d":return Number(l[t++]);case"%j":try{return JSON.stringify(l[t++])}catch(e){return"[Circular]"}default:return e}}),s=l[t];t=3&&(l.depth=arguments[2]),arguments.length>=4&&(l.colors=arguments[3]),y(t)?l.showHidden=t:t&&n._extend(l,t),j(l.showHidden)&&(l.showHidden=!1),j(l.depth)&&(l.depth=2),j(l.colors)&&(l.colors=!1),j(l.customInspect)&&(l.customInspect=!0),l.colors&&(l.stylize=s),p(l,e,l.depth)}function s(e,n){var t=o.styles[n];return t?"["+o.colors[t][0]+"m"+e+"["+o.colors[t][1]+"m":e}function u(e,n){return e}function c(e){var n={};return e.forEach(function(e,t){n[e]=!0}),n}function p(e,t,l){if(e.customInspect&&t&&F(t.inspect)&&t.inspect!==n.inspect&&(!t.constructor||t.constructor.prototype!==t)){var r=t.inspect(l,e);return x(r)||(r=p(e,r,l)),r}var a=h(e,t);if(a)return a;var i=Object.keys(t),o=c(i);if(e.showHidden&&(i=Object.getOwnPropertyNames(t)),T(t)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return f(t);if(0===i.length){if(F(t)){var s=t.name?": "+t.name:"";return e.stylize("[Function"+s+"]","special")}if(S(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(A(t))return e.stylize(Date.prototype.toString.call(t),"date");if(T(t))return f(t)}var u="",y=!1,b=["{","}"],w;if(v(t)&&(y=!0,b=["[","]"]),F(t)){var k=t.name?": "+t.name:"";u=" [Function"+k+"]"}return S(t)&&(u=" "+RegExp.prototype.toString.call(t)),A(t)&&(u=" "+Date.prototype.toUTCString.call(t)),T(t)&&(u=" "+f(t)),0!==i.length||y&&0!=t.length?l<0?S(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),w=y?d(e,t,l,o,i):i.map(function(n){return m(e,t,l,o,n,y)}),e.seen.pop(),g(w,u,b)):b[0]+u+b[1]}function h(e,n){if(j(n))return e.stylize("undefined","undefined");if(x(n)){var t="'"+JSON.stringify(n).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(t,"string")}return k(n)?e.stylize(""+n,"number"):y(n)?e.stylize(""+n,"boolean"):b(n)?e.stylize("null","null"):void 0}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,n,t,l,r){for(var a=[],i=0,o=n.length;i-1&&(o=a?o.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+o.split("\n").map(function(e){return" "+e}).join("\n"))):o=e.stylize("[Circular]","special")),j(i)){if(a&&r.match(/^\d+$/))return o;i=JSON.stringify(""+r),i.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(i=i.substr(1,i.length-2),i=e.stylize(i,"name")):(i=i.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),i=e.stylize(i,"string"))}return i+": "+o}function g(e,n,t){var l=0,r=e.reduce(function(e,n){return l++,n.indexOf("\n")>=0&&l++,e+n.replace(/\u001b\[\d\d?m/g,"").length+1},0);return r>60?t[0]+(""===n?"":n+"\n ")+" "+e.join(",\n ")+" "+t[1]:t[0]+n+" "+e.join(", ")+" "+t[1]}function v(e){return Array.isArray(e)}function y(e){return"boolean"==typeof e}function b(e){return null===e}function w(e){return null==e}function k(e){return"number"==typeof e}function x(e){return"string"==typeof e}function _(e){return"symbol"==typeof e}function j(e){return void 0===e}function S(e){return E(e)&&"[object RegExp]"===C(e)}function E(e){return"object"==typeof e&&null!==e}function A(e){return E(e)&&"[object Date]"===C(e)}function T(e){return E(e)&&("[object Error]"===C(e)||e instanceof Error)}function F(e){return"function"==typeof e}function P(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function C(e){return Object.prototype.toString.call(e)}function O(e){return e<10?"0"+e.toString(10):e.toString(10)}n.debuglog=function(t){if(j(i)&&(i=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!a[t])if(new RegExp("\\b"+t+"\\b","i").test(i)){var l=e.pid;a[t]=function(){var e=n.format.apply(n,arguments);console.error("%s %d: %s",t,l,e)}}else a[t]=function(){};return a[t]},n.inspect=o,o.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]},o.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=v,n.isBoolean=y,n.isNull=b,n.isNullOrUndefined=w,n.isNumber=k,n.isString=x,n.isSymbol=_,n.isUndefined=j,n.isRegExp=S,n.isObject=E,n.isDate=A,n.isError=T,n.isFunction=F,n.isPrimitive=P,n.isBuffer=t(211);var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function z(){var e=new Date,n=[O(e.getHours()),O(e.getMinutes()),O(e.getSeconds())].join(":");return[e.getDate(),R[e.getMonth()],n].join(" ")}function D(e,n){return Object.prototype.hasOwnProperty.call(e,n)}n.log=function(){console.log("%s - %s",z(),n.format.apply(n,arguments))},n.inherits=t(212),n._extend=function(e,n){if(!n||!E(n))return e;for(var t=Object.keys(n),l=t.length;l--;)e[t[l]]=n[t[l]];return e};var I="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function B(e,n){if(!e){var t=new Error("Promise was rejected with a falsy value");t.reason=e,e=t}return n(e)}function q(n){if("function"!=typeof n)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],l=0;l=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var l=r(e);return n&&0!==n.length?"string"==typeof t?l.fill(n,t):l.fill(n):l.fill(0),l}),!a.kStringMaxLength)try{a.kStringMaxLength=n.binding("buffer").kStringMaxLength}catch(e){}a.constants||(a.constants={MAX_LENGTH:a.kMaxLength},a.kStringMaxLength&&(a.constants.MAX_STRING_LENGTH=a.kStringMaxLength)),e.exports=a}).call(this,t(0))},function(e,n,t){"use strict";(function(e){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ var l=t(155),r=t(156),a=t(59);function i(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}function o(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,n){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function b(e){return+e!=e&&(e=0),u.alloc(+e)}function w(e,n){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var t=e.length;if(0===t)return 0;for(var l=!1;;)switch(n){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return J(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*t;case"hex":return t>>>1;case"base64":return X(e).length;default:if(l)return J(e).length;n=(""+n).toLowerCase(),l=!0}}function k(e,n,t){var l=!1;if((void 0===n||n<0)&&(n=0),n>this.length)return"";if((void 0===t||t>this.length)&&(t=this.length),t<=0)return"";if(t>>>=0,n>>>=0,t<=n)return"";for(e||(e="utf8");;)switch(e){case"hex":return B(this,n,t);case"utf8":case"utf-8":return O(this,n,t);case"ascii":return D(this,n,t);case"latin1":case"binary":return I(this,n,t);case"base64":return C(this,n,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return q(this,n,t);default:if(l)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),l=!0}}function x(e,n,t){var l=e[n];e[n]=e[t],e[t]=l}function _(e,n,t,l,r){if(0===e.length)return-1;if("string"==typeof t?(l=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,isNaN(t)&&(t=r?0:e.length-1),t<0&&(t=e.length+t),t>=e.length){if(r)return-1;t=e.length-1}else if(t<0){if(!r)return-1;t=0}if("string"==typeof n&&(n=u.from(n,l)),u.isBuffer(n))return 0===n.length?-1:j(e,n,t,l,r);if("number"==typeof n)return n&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,n,t):Uint8Array.prototype.lastIndexOf.call(e,n,t):j(e,[n],t,l,r);throw new TypeError("val must be string, number or Buffer")}function j(e,n,t,l,r){var a=1,i=e.length,o=n.length,s;if(void 0!==l&&(l=String(l).toLowerCase(),"ucs2"===l||"ucs-2"===l||"utf16le"===l||"utf-16le"===l)){if(e.length<2||n.length<2)return-1;a=2,i/=2,o/=2,t/=2}function u(e,n){return 1===a?e[n]:e.readUInt16BE(n*a)}if(r){var c=-1;for(s=t;si&&(t=i-o),s=t;s>=0;s--){for(var p=!0,h=0;hr&&(l=r)):l=r;var a=n.length;if(a%2!=0)throw new TypeError("Invalid hex string");l>a/2&&(l=a/2);for(var i=0;i239?4:a>223?3:a>191?2:1,s,u,c,p;if(r+o<=t)switch(o){case 1:a<128&&(i=a);break;case 2:s=e[r+1],128==(192&s)&&(p=(31&a)<<6|63&s,p>127&&(i=p));break;case 3:s=e[r+1],u=e[r+2],128==(192&s)&&128==(192&u)&&(p=(15&a)<<12|(63&s)<<6|63&u,p>2047&&(p<55296||p>57343)&&(i=p));break;case 4:s=e[r+1],u=e[r+2],c=e[r+3],128==(192&s)&&128==(192&u)&&128==(192&c)&&(p=(15&a)<<18|(63&s)<<12|(63&u)<<6|63&c,p>65535&&p<1114112&&(i=p))}null===i?(i=65533,o=1):i>65535&&(i-=65536,l.push(i>>>10&1023|55296),i=56320|1023&i),l.push(i),r+=o}return z(l)}n.Buffer=u,n.SlowBuffer=b,n.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:i(),n.kMaxLength=o(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,n,t){return c(null,e,n,t)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,n,t){return h(null,e,n,t)},u.allocUnsafe=function(e){return f(null,e)},u.allocUnsafeSlow=function(e){return f(null,e)},u.isBuffer=function e(n){return!(null==n||!n._isBuffer)},u.compare=function e(n,t){if(!u.isBuffer(n)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(n===t)return 0;for(var l=n.length,r=t.length,a=0,i=Math.min(l,r);a0&&(t=this.toString("hex",0,l).match(/.{2}/g).join(" "),this.length>l&&(t+=" ... ")),""},u.prototype.compare=function e(n,t,l,r,a){if(!u.isBuffer(n))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===l&&(l=n?n.length:0),void 0===r&&(r=0),void 0===a&&(a=this.length),t<0||l>n.length||r<0||a>this.length)throw new RangeError("out of range index");if(r>=a&&t>=l)return 0;if(r>=a)return-1;if(t>=l)return 1;if(t>>>=0,l>>>=0,r>>>=0,a>>>=0,this===n)return 0;for(var i=a-r,o=l-t,s=Math.min(i,o),c=this.slice(r,a),p=n.slice(t,l),h=0;ha)&&(l=a),n.length>0&&(l<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return S(this,n,t,l);case"utf8":case"utf-8":return E(this,n,t,l);case"ascii":return A(this,n,t,l);case"latin1":case"binary":return T(this,n,t,l);case"base64":return F(this,n,t,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,n,t,l);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},u.prototype.toJSON=function e(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var R=4096;function z(e){var n=e.length;if(n<=R)return String.fromCharCode.apply(String,e);for(var t="",l=0;ll)&&(t=l);for(var r="",a=n;at)throw new RangeError("Trying to access beyond buffer length")}function N(e,n,t,l,r,a){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>r||ne.length)throw new RangeError("Index out of range")}function U(e,n,t,l){n<0&&(n=65535+n+1);for(var r=0,a=Math.min(e.length-t,2);r>>8*(l?r:1-r)}function M(e,n,t,l){n<0&&(n=4294967295+n+1);for(var r=0,a=Math.min(e.length-t,4);r>>8*(l?r:3-r)&255}function H(e,n,t,l,r,a){if(t+l>e.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function K(e,n,t,l,a){return a||H(e,n,t,4,3.4028234663852886e38,-3.4028234663852886e38),r.write(e,n,t,l,23,4),t+4}function $(e,n,t,l,a){return a||H(e,n,t,8,1.7976931348623157e308,-1.7976931348623157e308),r.write(e,n,t,l,52,8),t+8}u.prototype.slice=function e(n,t){var l=this.length,r;if(n=~~n,t=void 0===t?l:~~t,n<0?(n+=l,n<0&&(n=0)):n>l&&(n=l),t<0?(t+=l,t<0&&(t=0)):t>l&&(t=l),t0&&(a*=256);)r+=this[n+--t]*a;return r},u.prototype.readUInt8=function e(n,t){return t||L(n,1,this.length),this[n]},u.prototype.readUInt16LE=function e(n,t){return t||L(n,2,this.length),this[n]|this[n+1]<<8},u.prototype.readUInt16BE=function e(n,t){return t||L(n,2,this.length),this[n]<<8|this[n+1]},u.prototype.readUInt32LE=function e(n,t){return t||L(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+16777216*this[n+3]},u.prototype.readUInt32BE=function e(n,t){return t||L(n,4,this.length),16777216*this[n]+(this[n+1]<<16|this[n+2]<<8|this[n+3])},u.prototype.readIntLE=function e(n,t,l){n|=0,t|=0,l||L(n,t,this.length);for(var r=this[n],a=1,i=0;++i=a&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function e(n,t,l){n|=0,t|=0,l||L(n,t,this.length);for(var r=t,a=1,i=this[n+--r];r>0&&(a*=256);)i+=this[n+--r]*a;return a*=128,i>=a&&(i-=Math.pow(2,8*t)),i},u.prototype.readInt8=function e(n,t){return t||L(n,1,this.length),128&this[n]?-1*(255-this[n]+1):this[n]},u.prototype.readInt16LE=function e(n,t){t||L(n,2,this.length);var l=this[n]|this[n+1]<<8;return 32768&l?4294901760|l:l},u.prototype.readInt16BE=function e(n,t){t||L(n,2,this.length);var l=this[n+1]|this[n]<<8;return 32768&l?4294901760|l:l},u.prototype.readInt32LE=function e(n,t){return t||L(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},u.prototype.readInt32BE=function e(n,t){return t||L(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},u.prototype.readFloatLE=function e(n,t){return t||L(n,4,this.length),r.read(this,n,!0,23,4)},u.prototype.readFloatBE=function e(n,t){return t||L(n,4,this.length),r.read(this,n,!1,23,4)},u.prototype.readDoubleLE=function e(n,t){return t||L(n,8,this.length),r.read(this,n,!0,52,8)},u.prototype.readDoubleBE=function e(n,t){return t||L(n,8,this.length),r.read(this,n,!1,52,8)},u.prototype.writeUIntLE=function e(n,t,l,r){if(n=+n,t|=0,l|=0,!r){var a=Math.pow(2,8*l)-1;N(this,n,t,l,a,0)}var i=1,o=0;for(this[t]=255&n;++o=0&&(o*=256);)this[t+i]=n/o&255;return t+l},u.prototype.writeUInt8=function e(n,t,l){return n=+n,t|=0,l||N(this,n,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(n=Math.floor(n)),this[t]=255&n,t+1},u.prototype.writeUInt16LE=function e(n,t,l){return n=+n,t|=0,l||N(this,n,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&n,this[t+1]=n>>>8):U(this,n,t,!0),t+2},u.prototype.writeUInt16BE=function e(n,t,l){return n=+n,t|=0,l||N(this,n,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=n>>>8,this[t+1]=255&n):U(this,n,t,!1),t+2},u.prototype.writeUInt32LE=function e(n,t,l){return n=+n,t|=0,l||N(this,n,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=n>>>24,this[t+2]=n>>>16,this[t+1]=n>>>8,this[t]=255&n):M(this,n,t,!0),t+4},u.prototype.writeUInt32BE=function e(n,t,l){return n=+n,t|=0,l||N(this,n,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=n>>>24,this[t+1]=n>>>16,this[t+2]=n>>>8,this[t+3]=255&n):M(this,n,t,!1),t+4},u.prototype.writeIntLE=function e(n,t,l,r){if(n=+n,t|=0,!r){var a=Math.pow(2,8*l-1);N(this,n,t,l,a-1,-a)}var i=0,o=1,s=0;for(this[t]=255&n;++i>0)-s&255;return t+l},u.prototype.writeIntBE=function e(n,t,l,r){if(n=+n,t|=0,!r){var a=Math.pow(2,8*l-1);N(this,n,t,l,a-1,-a)}var i=l-1,o=1,s=0;for(this[t+i]=255&n;--i>=0&&(o*=256);)n<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(n/o>>0)-s&255;return t+l},u.prototype.writeInt8=function e(n,t,l){return n=+n,t|=0,l||N(this,n,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(n=Math.floor(n)),n<0&&(n=255+n+1),this[t]=255&n,t+1},u.prototype.writeInt16LE=function e(n,t,l){return n=+n,t|=0,l||N(this,n,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&n,this[t+1]=n>>>8):U(this,n,t,!0),t+2},u.prototype.writeInt16BE=function e(n,t,l){return n=+n,t|=0,l||N(this,n,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=n>>>8,this[t+1]=255&n):U(this,n,t,!1),t+2},u.prototype.writeInt32LE=function e(n,t,l){return n=+n,t|=0,l||N(this,n,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&n,this[t+1]=n>>>8,this[t+2]=n>>>16,this[t+3]=n>>>24):M(this,n,t,!0),t+4},u.prototype.writeInt32BE=function e(n,t,l){return n=+n,t|=0,l||N(this,n,t,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),u.TYPED_ARRAY_SUPPORT?(this[t]=n>>>24,this[t+1]=n>>>16,this[t+2]=n>>>8,this[t+3]=255&n):M(this,n,t,!1),t+4},u.prototype.writeFloatLE=function e(n,t,l){return K(this,n,t,!0,l)},u.prototype.writeFloatBE=function e(n,t,l){return K(this,n,t,!1,l)},u.prototype.writeDoubleLE=function e(n,t,l){return $(this,n,t,!0,l)},u.prototype.writeDoubleBE=function e(n,t,l){return $(this,n,t,!1,l)},u.prototype.copy=function e(n,t,l,r){if(l||(l=0),r||0===r||(r=this.length),t>=n.length&&(t=n.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),n.length-t=0;--i)n[i+t]=this[i+l];else if(a<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,l=void 0===l?this.length:l>>>0,n||(n=0),"number"==typeof n)for(i=t;i55295&&t<57344){if(!r){if(t>56319){(n-=3)>-1&&a.push(239,191,189);continue}if(i+1===l){(n-=3)>-1&&a.push(239,191,189);continue}r=t;continue}if(t<56320){(n-=3)>-1&&a.push(239,191,189),r=t;continue}t=65536+(r-55296<<10|t-56320)}else r&&(n-=3)>-1&&a.push(239,191,189);if(r=null,t<128){if((n-=1)<0)break;a.push(t)}else if(t<2048){if((n-=2)<0)break;a.push(t>>6|192,63&t|128)}else if(t<65536){if((n-=3)<0)break;a.push(t>>12|224,t>>6&63|128,63&t|128)}else{if(!(t<1114112))throw new Error("Invalid code point");if((n-=4)<0)break;a.push(t>>18|240,t>>12&63|128,t>>6&63|128,63&t|128)}}return a}function Q(e){for(var n=[],t=0;t>8,r=t%256,a.push(r),a.push(l);return a}function X(e){return l.toByteArray(W(e))}function ee(e,n,t,l){for(var r=0;r=n.length||r>=e.length);++r)n[r+t]=e[r];return r}function ne(e){return e!=e}}).call(this,t(9))},function(e,n,t){"use strict";var l=t(46),r=t(150);function a(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}n.parse=k,n.resolve=_,n.resolveObject=j,n.format=x,n.Url=a;var i=/^([a-z0-9.+-]+:)/i,o=/:[0-9]*$/,s=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,u=["<",">",'"',"`"," ","\r","\n","\t"],c=["{","}","|","\\","^","`"].concat(u),p=["'"].concat(c),h=["%","/","?",";","#"].concat(p),f=["/","?","#"],d=255,m=/^[+a-z0-9A-Z_-]{0,63}$/,g=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,v={javascript:!0,"javascript:":!0},y={javascript:!0,"javascript:":!0},b={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},w=t(48);function k(e,n,t){if(e&&r.isObject(e)&&e instanceof a)return e;var l=new a;return l.parse(e,n,t),l}function x(e){return r.isString(e)&&(e=k(e)),e instanceof a?e.format():a.prototype.format.call(e)}function _(e,n){return k(e,!1,!0).resolve(n)}function j(e,n){return e?k(e,!1,!0).resolveObject(n):n}a.prototype.parse=function(e,n,t){if(!r.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var a=e.indexOf("?"),o=-1!==a&&a127?z+="x":z+=R[D];if(!z.match(m)){var B=C.slice(0,E),q=C.slice(E+1),L=R.match(g);L&&(B.push(L[1]),q.unshift(L[2])),q.length&&(d="/"+q.join(".")+d),this.hostname=B.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),P||(this.hostname=l.toASCII(this.hostname));var N=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+N,this.href+=this.host,P&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==d[0]&&(d="/"+d))}if(!v[_])for(var E=0,O=p.length;E0)&&t.host.split("@");S&&(t.auth=S.shift(),t.host=t.hostname=S.shift())}return t.search=e.search,t.query=e.query,r.isNull(t.pathname)&&r.isNull(t.search)||(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.href=t.format(),t}if(!_.length)return t.pathname=null,t.search?t.path="/"+t.search:t.path=null,t.href=t.format(),t;for(var E=_.slice(-1)[0],A=(t.host||e.host||_.length>1)&&("."===E||".."===E)||""===E,T=0,F=_.length;F>=0;F--)E=_[F],"."===E?_.splice(F,1):".."===E?(_.splice(F,1),T++):T&&(_.splice(F,1),T--);if(!k&&!x)for(;T--;T)_.unshift("..");!k||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),A&&"/"!==_.join("/").substr(-1)&&_.push("");var P=""===_[0]||_[0]&&"/"===_[0].charAt(0);if(j){t.hostname=t.host=P?"":_.length?_.shift():"";var S=!!(t.host&&t.host.indexOf("@")>0)&&t.host.split("@");S&&(t.auth=S.shift(),t.host=t.hostname=S.shift())}return k=k||t.host&&_.length,k&&!P&&_.unshift(""),_.length?t.pathname=_.join("/"):(t.pathname=null,t.path=null),r.isNull(t.pathname)&&r.isNull(t.search)||(t.path=(t.pathname?t.pathname:"")+(t.search?t.search:"")),t.auth=e.auth||t.auth,t.slashes=t.slashes||e.slashes,t.href=t.format(),t},a.prototype.parseHost=function(){var e=this.host,n=o.exec(e);n&&(n=n[0],":"!==n&&(this.port=n.substr(1)),e=e.substr(0,e.length-n.length)),e&&(this.hostname=e)}},function(e,n,t){(function(n){e.exports=g;var l=t(2),r=t(11),a=t(1),i=t(39),o=t(17),s=t(77).DiffieHellman,u=t(14),c=t(8),p=t(10),h;try{h=t(126)}catch(e){}var f=u.InvalidAlgorithmError,d=u.KeyParseError,m={};function g(e){l.object(e,"options"),l.arrayOfObject(e.parts,"options.parts"),l.string(e.type,"options.type"),l.optionalString(e.comment,"options.comment");var n=r.info[e.type];if("object"!=typeof n)throw new f(e.type);for(var t={},a=0,i;a1024&&(e="sha256"),"ed25519"===this.type&&(e="sha512"),"ecdsa"===this.type&&(e=this.size<=256?"sha256":this.size<=384?"sha384":"sha512"),e},g.prototype.createVerify=function(e){if(void 0===e&&(e=this.defaultHashAlgorithm()),l.string(e,"hash algorithm"),"ed25519"===this.type&&void 0!==h)return new h.Verifier(this,e);if("curve25519"===this.type)throw new Error("Curve25519 keys are not suitable for signing or verification");var t,r,i;try{r=e.toUpperCase(),t=a.createVerify(r)}catch(e){i=e}(void 0===t||i instanceof Error&&i.message.match(/Unknown message digest/))&&(r="RSA-",r+=e.toUpperCase(),t=a.createVerify(r)),l.ok(t,"failed to create verifier");var s=t.verify.bind(t),u=this.toBuffer("pkcs8"),c=this.curve,p=this;return t.verify=function(t,l){if(o.isSignature(t,[2,0]))return t.type===p.type&&((!t.hashAlgorithm||t.hashAlgorithm===e)&&((!t.curve||"ecdsa"!==p.type||t.curve===c)&&s(u,t.toBuffer("asn1"))));if("string"==typeof t||n.isBuffer(t))return s(u,t,l);throw o.isSignature(t,[1,0])?new Error("signature was created by too old a version of sshpk and cannot be verified"):new TypeError("signature must be a string, Buffer, or Signature object")},t},g.prototype.createDiffieHellman=function(){if("rsa"===this.type)throw new Error("RSA keys do not support Diffie-Hellman");return new s(this)},g.prototype.createDH=g.prototype.createDiffieHellman,g.parse=function(e,n,t){"string"!=typeof e&&l.buffer(e,"data"),void 0===n&&(n="auto"),l.string(n,"format"),"string"==typeof t&&(t={filename:t}),l.optionalObject(t,"options"),void 0===t&&(t={}),l.optionalString(t.filename,"options.filename"),void 0===t.filename&&(t.filename="(unnamed)"),l.object(m[n],"formats[format]");try{var r=m[n].read(e,t);return r instanceof p&&(r=r.toPublic()),r.comment||(r.comment=t.filename),r}catch(e){if("KeyEncryptedError"===e.name)throw e;throw new d(t.filename,n,e)}},g.isKey=function(e,n){return c.isCompatible(e,g,n)},g.prototype._sshpkApiVersion=[1,7],g._oldVersionDetect=function(e){return l.func(e.toBuffer),l.func(e.fingerprint),e.createDH?[1,4]:e.defaultHashAlgorithm?[1,3]:e.formats.auto?[1,2]:e.formats.pkcs1?[1,1]:[1,0]}}).call(this,t(5).Buffer)},function(e,n,t){e.exports={bufferSplit:k,addRSAMissing:O,calculateDSAPublic:F,calculateED25519Public:P,calculateX25519Public:C,mpNormalize:S,mpDenormalize:E,ecNormalize:x,countZeros:w,assertCompatible:m,isCompatible:d,opensslKeyDeriv:y,opensshCipherInfo:z,publicFromPrivateECDSA:R,zeroPadToLength:A,writeBitString:j,readBitString:_,pbkdf2:b};var l=t(2),r=t(4).Buffer,a=t(10),i=t(7),o=t(1),s=t(11),u=t(18),c=t(55),p=t(40).BigInteger,h=t(41),f=3;function d(e,n,t){if(null===e||"object"!=typeof e)return!1;if(void 0===t&&(t=n.prototype._sshpkApiVersion),e instanceof n&&n.prototype._sshpkApiVersion[0]==t[0])return!0;for(var l=Object.getPrototypeOf(e),r=0;l.constructor.name!==n.name;)if(l=Object.getPrototypeOf(l),!l||++r>f)return!1;if(l.constructor.name!==n.name)return!1;var a=l._sshpkApiVersion;return void 0===a&&(a=n._oldVersionDetect(e)),!(a[0]!=t[0]||a[1]=t[1],r+" must be compatible with "+n.name+" klass version "+t[0]+"."+t[1])}}var g={"des-ede3-cbc":{key:24,iv:8},"aes-128-cbc":{key:16,iv:16},"aes-256-cbc":{key:32,iv:16}},v=8;function y(e,n,t,a){l.buffer(n,"salt"),l.buffer(t,"passphrase"),l.number(a,"iteration count");var i=g[e],s,u,c;l.object(i,"supported cipher"),n=n.slice(0,v);for(var p=r.alloc(0);p.length=n.length){var o=i+1;t.push(e.slice(r,o-a)),r=o,a=0}return r<=e.length&&t.push(e.slice(r,e.length)),t}function x(e,n){if(l.buffer(e),0===e[0]&&4===e[1])return n?e:e.slice(1);if(4===e[0]){if(!n)return e}else{for(;0===e[0];)e=e.slice(1);if(2===e[0]||3===e[0])throw new Error("Compressed elliptic curve points are not supported");if(4!==e[0])throw new Error("Not a valid elliptic curve point");if(!n)return e}var t=r.alloc(e.length+1);return t[0]=0,e.copy(t,1),t}function _(e,n){void 0===n&&(n=u.Ber.BitString);var t=e.readString(n,!0);return l.strictEqual(t[0],0,"bit strings with unused bits are not supported (0x"+t[0].toString(16)+")"),t.slice(1)}function j(e,n,t){void 0===t&&(t=u.Ber.BitString);var l=r.alloc(n.length+1);l[0]=0,n.copy(l,1),e.writeBuffer(l,t)}function S(e){for(l.buffer(e);e.length>1&&0===e[0]&&0==(128&e[1]);)e=e.slice(1);if(128==(128&e[0])){var n=r.alloc(e.length+1);n[0]=0,e.copy(n,1),e=n}return e}function E(e){for(l.buffer(e);e.length>1&&0===e[0];)e=e.slice(1);return e}function A(e,n){for(l.buffer(e),l.number(n);e.length>n;)l.equal(e[0],0),e=e.slice(1);for(;e.length=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function a(n){if(n[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+n[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const t="color: "+this.color;n.splice(1,0,t,"color: inherit");let l=0,r=0;n[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(l++,"%c"===e&&(r=l))}),n.splice(r,0,t)}function i(...e){return"object"==typeof console&&console.log&&console.log(...e)}function o(e){try{e?n.storage.setItem("debug",e):n.storage.removeItem("debug")}catch(e){}}function s(){let e;try{e=n.storage.getItem("debug")}catch(e){}return!e&&void 0!==l&&"env"in l&&(e=l.env.DEBUG),e}function u(){try{return localStorage}catch(e){}}n.log=i,n.formatArgs=a,n.save=o,n.load=s,n.useColors=r,n.storage=u(),n.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"],e.exports=t(153)(n);const{formatters:c}=e.exports;c.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,t(0))},function(e,n,t){e.exports=f;var l=t(2),r=t(4).Buffer,a=t(11),i=t(1),o=t(14),s=t(8),u=t(18),c=t(42),p=o.InvalidAlgorithmError,h=o.SignatureParseError;function f(e){l.object(e,"options"),l.arrayOfObject(e.parts,"options.parts"),l.string(e.type,"options.type");for(var n={},t=0;t20&&0===a[0]&&(a=a.slice(1)),i=this.part.s.data,i.length>20&&0===i[0]&&(i=i.slice(1)),this.hashAlgorithm&&"sha1"!==this.hashAlgorithm||a.length+i.length!==40)throw new Error("OpenSSH only supports DSA signatures with SHA1 hash");return n.writeBuffer(r.concat([a,i])),n.toBuffer()}if("ssh"===e&&"ecdsa"===this.type){var p=new c({}),h;a=this.part.r.data,p.writeBuffer(a),p.writePart(this.part.s),n=new c({}),0===a[0]&&(a=a.slice(1));var f=8*a.length;return 256===f?h="nistp256":384===f?h="nistp384":528===f&&(h="nistp521"),n.writeString("ecdsa-sha2-"+h),n.writeBuffer(p.toBuffer()),n.toBuffer()}throw new Error("Invalid signature format");default:throw new Error("Invalid signature data")}},f.prototype.toString=function(e){return l.optionalString(e,"format"),this.toBuffer(e).toString("base64")},f.parse=function(e,n,t){"string"==typeof e&&(e=r.from(e,"base64")),l.buffer(e,"data"),l.string(t,"format"),l.string(n,"type");var a={};a.type=n.toLowerCase(),a.parts=[];try{switch(l.ok(e.length>0,"signature must not be empty"),a.type){case"rsa":case"ed25519":return d(e,n,t,a);case"dsa":case"ecdsa":return"asn1"===t?m(e,n,t,a):"dsa"===a.type?g(e,n,t,a):v(e,n,t,a);default:throw new p(n)}}catch(e){if(e instanceof p)throw e;throw new h(n,t,e)}},f.isSignature=function(e,n){return s.isCompatible(e,f,n)},f.prototype._sshpkApiVersion=[2,1],f._oldVersionDetect=function(e){return l.func(e.toBuffer),e.hasOwnProperty("hashAlgorithm")?[2,0]:[1,0]}},function(e,n,t){var l=t(250);e.exports={Ber:l,BerReader:l.Reader,BerWriter:l.Writer}},function(e,n,t){"use strict";var l="object"==typeof Reflect?Reflect:null,r=l&&"function"==typeof l.apply?l.apply:function e(n,t,l){return Function.prototype.apply.call(n,t,l)},a;function i(e){console&&console.warn&&console.warn(e)}a=l&&"function"==typeof l.ownKeys?l.ownKeys:Object.getOwnPropertySymbols?function e(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:function e(n){return Object.getOwnPropertyNames(n)};var o=Number.isNaN||function e(n){return n!=n};function s(){s.init.call(this)}e.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function c(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function p(e,n,t,l){var r,a,o;if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);if(a=e._events,void 0===a?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",n,t.listener?t.listener:t),a=e._events),o=a[n]),void 0===o)o=a[n]=t,++e._eventsCount;else if("function"==typeof o?o=a[n]=l?[t,o]:[o,t]:l?o.unshift(t):o.push(t),r=c(e),r>0&&o.length>r&&!o.warned){o.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(n)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=n,s.count=o.length,i(s)}return e}function h(){for(var e=[],n=0;n0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var u=i[n];if(void 0===u)return!1;if("function"==typeof u)r(u,this,t);else for(var c=u.length,p=g(u,c),l=0;l=0;i--)if(l[i]===t||l[i].listener===t){o=l[i].listener,a=i;break}if(a<0)return this;0===a?l.shift():v(l,a),1===l.length&&(r[n]=l[0]),void 0!==r.removeListener&&this.emit("removeListener",n,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function e(n){var t,l,r;if(l=this._events,void 0===l)return this;if(void 0===l.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==l[n]&&(0==--this._eventsCount?this._events=Object.create(null):delete l[n]),this;if(0===arguments.length){var a=Object.keys(l),i;for(r=0;r=0;r--)this.removeListener(n,t[r]);return this},s.prototype.listeners=function e(n){return d(this,n,!0)},s.prototype.rawListeners=function e(n){return d(this,n,!1)},s.listenerCount=function(e,n){return"function"==typeof e.listenerCount?e.listenerCount(n):m.call(e,n)},s.prototype.listenerCount=m,s.prototype.eventNames=function e(){return this._eventsCount>0?a(this._events):[]}},function(e,n,t){"use strict";(function(n){function t(e,t,l,r){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var a=arguments.length,i,o;switch(a){case 0:case 1:return n.nextTick(e);case 2:return n.nextTick(function n(){e.call(null,t)});case 3:return n.nextTick(function n(){e.call(null,t,l)});case 4:return n.nextTick(function n(){e.call(null,t,l,r)});default:for(i=new Array(a-1),o=0;o * @license MIT */function r(e,n){if(e===n)return 0;for(var t=e.length,l=n.length,r=0,a=Math.min(t,l);r=0;p--)if(o[p]!==u[p])return!1;for(p=o.length-1;p>=0;p--)if(c=o[p],!w(e[c],n[c],t,l))return!1;return!0}function _(e,n,t){w(e,n,!0)&&y(e,n,t,"notDeepStrictEqual",_)}function j(e,n){if(!e||!n)return!1;if("[object RegExp]"==Object.prototype.toString.call(n))return n.test(e);try{if(e instanceof n)return!0}catch(e){}return!Error.isPrototypeOf(n)&&!0===n.call({},e)}function S(e){var n;try{e()}catch(e){n=e}return n}function E(e,n,t,l){var r;if("function"!=typeof n)throw new TypeError('"block" argument must be a function');"string"==typeof t&&(l=t,t=null),r=S(n),l=(t&&t.name?" ("+t.name+").":".")+(l?" "+l:"."),e&&!r&&y(r,t,"Missing expected exception"+l);var a="string"==typeof l,o=!e&&i.isError(r),s=!e&&r&&!t;if((o&&a&&j(r,t)||s)&&y(r,t,"Got unwanted exception"+l),e&&r&&t&&!j(r,t)||!e&&r)throw r}function A(e,n){e||y(e,!0,n,"==",A)}h.AssertionError=function e(n){this.name="AssertionError",this.actual=n.actual,this.expected=n.expected,this.operator=n.operator,n.message?(this.message=n.message,this.generatedMessage=!1):(this.message=v(this),this.generatedMessage=!0);var t=n.stackStartFunction||y;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var l=new Error;if(l.stack){var r=l.stack,a=d(t),i=r.indexOf("\n"+a);if(i>=0){var o=r.indexOf("\n",i+1);r=r.substring(o+1)}this.stack=r}}},i.inherits(h.AssertionError,Error),h.fail=y,h.ok=b,h.equal=function e(n,t,l){n!=t&&y(n,t,l,"==",h.equal)},h.notEqual=function e(n,t,l){n==t&&y(n,t,l,"!=",h.notEqual)},h.deepEqual=function e(n,t,l){w(n,t,!1)||y(n,t,l,"deepEqual",h.deepEqual)},h.deepStrictEqual=function e(n,t,l){w(n,t,!0)||y(n,t,l,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function e(n,t,l){w(n,t,!1)&&y(n,t,l,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=_,h.strictEqual=function e(n,t,l){n!==t&&y(n,t,l,"===",h.strictEqual)},h.notStrictEqual=function e(n,t,l){n===t&&y(n,t,l,"!==",h.notStrictEqual)},h.throws=function(e,n,t){E(!0,e,n,t)},h.doesNotThrow=function(e,n,t){E(!1,e,n,t)},h.ifError=function(e){if(e)throw e},h.strict=l(A,h,{equal:h.strictEqual,deepEqual:h.deepStrictEqual,notEqual:h.notStrictEqual,notDeepEqual:h.notDeepStrictEqual}),h.strict.strict=h.strict;var T=Object.keys||function(e){var n=[];for(var t in e)o.call(e,t)&&n.push(t);return n}}).call(this,t(9))},function(e,n,t){e.exports={read:x,write:_};var l=t(2),r=t(18),a=t(1),i=t(4).Buffer,o=t(11),s=t(8),u=t(7),c=t(10),p=t(78),h=t(43),f=t(56),d=t(23),m=t(14),g="1.2.840.113549.1.5.13",v="1.2.840.113549.1.5.12",y={"1.2.840.113549.3.7":"3des-cbc","2.16.840.1.101.3.4.1.2":"aes128-cbc","2.16.840.1.101.3.4.1.42":"aes256-cbc"},b={};Object.keys(y).forEach(function(e){b[y[e]]=e});var w={"1.2.840.113549.2.7":"sha1","1.2.840.113549.2.9":"sha256","1.2.840.113549.2.11":"sha512"},k={};function x(e,n,t){var o=e;"string"!=typeof e&&(l.buffer(e,"buf"),e=e.toString("ascii"));for(var u=e.trim().split(/[\r\n]+/g),c,b=-1,k;!c&&b0;)k=u[--x].match(/[-]+[ ]*END ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/);l.ok(k,"invalid PEM footer"),l.equal(c[2],k[2]);var _=c[2].toLowerCase(),j;c[1]&&(l.equal(c[1],k[1],"PEM header and footer mismatch"),j=c[1].trim()),u=u.slice(b,x+1);for(var S={},E,A,T;u=u.slice(1),c=u[0].match(/^([A-Za-z0-9-]+): (.+)$/),c;)S[c[1].toLowerCase()]=c[2];if(u=u.slice(0,-1).join(""),e=i.from(u,"base64"),S["proc-type"]){var F=S["proc-type"].split(",");if("4"===F[0]&&"ENCRYPTED"===F[1]){if("string"==typeof n.passphrase&&(n.passphrase=i.from(n.passphrase,"utf-8")),!i.isBuffer(n.passphrase))throw new m.KeyEncryptedError(n.filename,"PEM");F=S["dek-info"].split(","),l.ok(2===F.length),E=F[0].toLowerCase(),T=i.from(F[1],"hex"),A=s.opensslKeyDeriv(E,T,n.passphrase,1).key}}if(j&&"encrypted"===j.toLowerCase()){var P=new r.BerReader(e),C;P.readSequence(),P.readSequence(),C=P.offset+P.length;var O=P.readOID();if(O!==g)throw new Error("Unsupported PEM/PKCS8 encryption scheme: "+O);P.readSequence(),P.readSequence();var R=P.offset+P.length,z=P.readOID();if(z!==v)throw new Error("Unsupported PBES2 KDF: "+z);P.readSequence();var D=P.readString(r.Ber.OctetString,!0),I=P.readInt(),B="sha1";if(P.offsetf.length&&(y=f.length),g+=m.write(f.slice(v,y),g),m[g++]=10,v=y}return g+=m.write("-----END "+o+"-----\n",g),m.slice(0,g)}Object.keys(w).forEach(function(e){k[w[e]]=e})},function(e,n,t){e.exports={read:h.bind(void 0,!1,void 0),readType:h.bind(void 0,!1),write:f,readPartial:h.bind(void 0,!0),readInternal:h,keyTypeToAlg:p,algToKeyType:c};var l=t(2),r=t(4).Buffer,a=t(11),i=t(8),o=t(7),s=t(10),u=t(42);function c(e){if(l.string(e),"ssh-dss"===e)return"dsa";if("ssh-rsa"===e)return"rsa";if("ssh-ed25519"===e)return"ed25519";if("ssh-curve25519"===e)return"curve25519";if(e.match(/^ecdsa-sha2-/))return"ecdsa";throw new Error("Unknown algorithm "+e)}function p(e){if(l.object(e),"dsa"===e.type)return"ssh-dss";if("rsa"===e.type)return"ssh-rsa";if("ed25519"===e.type)return"ssh-ed25519";if("curve25519"===e.type)return"ssh-curve25519";if("ecdsa"===e.type)return"ecdsa-sha2-"+e.part.curve.data.toString();throw new Error("Unknown key type "+e.type)}function h(e,n,t,p){"string"==typeof t&&(t=r.from(t)),l.buffer(t,"buf");var h={},f=h.parts=[],d=new u({buffer:t}),m=d.readString();l.ok(!d.atEnd(),"key must have at least one part"),h.type=c(m);var g=a.info[h.type].parts.length;for(n&&"private"===n&&(g=a.privInfo[h.type].parts.length);!d.atEnd()&&f.length=1,"key must have at least one part"),l.ok(e||d.atEnd(),"leftover bytes at end of key");var v=o,y=a.info[h.type];if("private"!==n&&y.parts.length===f.length||(y=a.privInfo[h.type],v=s),l.strictEqual(y.parts.length,f.length),"ecdsa"===h.type){var b=/^ecdsa-sha2-(.+)$/.exec(m);l.ok(null!==b),l.strictEqual(b[1],f[0].data.toString())}for(var w=!0,k=0;k!e.status)}static p_connectedNames(e){const n=this._connected().map(e=>e.name);if(!e)return new Promise((e,t)=>e(n));e(null,n)}static async p_connectedNamesParm(){return(await this.p_connectedNames()).map(e=>"transport="+e).join("&")}static statuses({connected:e}){const n=f._transports.map(e=>({name:e.name,status:e.status,info:e.info}));return e?n.filter(e=>!e.status):n}static p_statuses(e){const n=this.statuses({connected:!1});if(!e)return new Promise((e,t)=>e(n));e(null,n)}static validFor(e,n,t){return"string"==typeof e&&(e=[e]),e&&e[0]||["store","newlisturls","newdatabase","newtable","seed"].includes(n)?e&&e.length>0?[].concat(...e.map(e=>"string"==typeof e?l.parse(e):e).map(e=>this._transports.filter(l=>l.validFor(e,n,t)).map(n=>[e,n]))):this._transports.filter(e=>e.validFor(void 0,n,t)).map(e=>[void 0,e]):(console.error("Transports.validFor called with invalid arguments: urls=",e,"func=",n),[])}static async p_urlsValidFor(e,n,t){return this.validFor(e,n,t).map(e=>e[0])}static http(){return f._connected().find(e=>"HTTP"===e.name)}static wolk(){return f._connected().find(e=>"WOLK"===e.name)}static ipfs(){return f._connected().find(e=>"IPFS"===e.name)}static webtorrent(){return f._connected().find(e=>"WEBTORRENT"===e.name)}static gun(){return f._connected().find(e=>"GUN"===e.name)}static async p_resolveNames(e){return this.mirror?Array.isArray(e)?this.gatewayUrls(e):this.gatewayUrl(url):this.namingcb?await this.namingcb(e):e}static resolveNamesWith(e){this.namingcb=e}static togglePaused(e,n){const t=this._transports.find(n=>n.name===e);t?t.togglePaused(e=>n(null,e.status)):n(void 0)}static async _p_rawstore(e,n){let t=[],l=await Promise.all(e.map(async function(e){try{i("Storing %d bytes to %s",n.length,e.name);let l=await e.p_rawstore(n);return i("Storing %d bytes to %s succeeded: %s",n.length,e.name,l),l}catch(l){return i("Storing %d bytes to %s failed: %s",n.length,e.name,l.message),void t.push(l)}}));if(l=l.filter(e=>!!e),!l.length)throw i("Storing %d bytes failed on all transports",n.length),new r.TransportError(t.map(e=>e.message).join(", "));return l}static async p_rawstore(e){let n=this.validFor(void 0,"store").map(([e,n])=>n);if(!n.length)throw i("Storing %d bytes failed: no transports available",e.length),new r.TransportError("Transports.p_rawstore: Cant find transport for store");return this._p_rawstore(n,e)}static async p_rawfetch(e,n={}){if(!e.length)throw new r.TransportError("Transports.p_rawfetch given an empty list of urls");let t=await this.p_resolveNames(e);if(!t.length)throw new r.TransportError("Transports.p_rawfetch none of the urls resolved: "+e);let l=this.validFor(t,"fetch",{noCache:n.noCache});if(!l.length)throw new r.TransportError("Transports.p_rawfetch cant find any transport for urls: "+t);let a=[],o=[];for(const[e,t]of l)try{i("Fetching %s via %s",e.href,t.name);let l=await t.p_rawfetch(e,n);return i("Fetching %s via %s succeeded %d bytes",e.href,t.name,l.length),n.relay&&o.length&&(i("Fetching attempting relay of %d bytes from %s to %o",l.length,e.href,o.map(e=>e.name)),this._p_rawstore(o,l).then(e=>i("Fetching relayed %d bytes to %o",l.length,e))),l}catch(n){o.push(t),a.push(n),i("Fetching %s via %s failed: %s",e.href,t.name,n.message)}throw i("Fetching %o failed on all transports",e),new r.TransportError(a.map(e=>e.message).join(", "))}static fetch(e,n={},t){"function"==typeof n&&(t=n,n={});const l=this.p_rawfetch(e,n);if(!t)return l;l.then(e=>{try{t(null,e)}catch(e){i("Uncaught error in fetch %O",e)}}).catch(e=>t(e))}static seed({directoryPath:e,fileRelativePath:n,ipfsHash:t,urlToFile:l,torrentRelativePath:r},a){if(!a)return new Promise((e,n)=>{try{o.call(this,(t,l)=>{t?n(t):e(l)})}catch(e){n(e)}});try{o.call(this,a)}catch(e){a(e)}function o(a){let o=this.validFor(void 0,"seed").map(([e,n])=>n);if(o.length){const i={};u(o,(a,o)=>a.seed({directoryPath:e,torrentRelativePath:r,fileRelativePath:n,ipfsHash:t,urlToFile:l},(e,n)=>{i[a.name]=e?{err:e.message}:n,o(null)}),e=>a(null,i))}else i("Seeding: no transports available"),a(null)}}static async p_rawlist(e){e=await this.p_resolveNames(e);let n=this.validFor(e,"list");if(!n.length)throw new r.TransportError('Transports.p_rawlist: Cant find transport to "list" urls:'+e.join(","));let t=[],l=await Promise.all(n.map(async function([e,n]){try{i("Listing %s via %s",e,n.name);let l=await n.p_rawlist(e);return i("Listing %s via %s retrieved %d items",e,n.name,l.length),l}catch(l){return i("Listing %s via %s failed: %s",e,n.name,l.message),t.push(l),[]}}));if(t.length>=n.length)throw i("Listing %o failed on all transports",e),new r.TransportError(t.map(e=>e.message).join(", "));let a={};return[].concat(...l).filter(e=>!a[e.signature]&&(a[e.signature]=!0))}static async p_rawadd(e,n){e=await this.p_resolveNames(e);let t=this.validFor(e,"add");if(!t.length)throw i("Adding to %o failed: no transports available",e),new r.TransportError("Transports.p_rawstore: Cant find transport for urls:"+e.join(","));let l=[];if(await Promise.all(t.map(async function([e,t]){try{return i("Adding to %s via %s",e,t.name),await t.p_rawadd(e,n),void i("Adding to %s via %s succeeded",e,t.name)}catch(n){return i("Adding to %s via %s failed: %s",e,t.name,n.message),void l.push(n)}})),l.length>=t.length)throw i("Adding to %o failed on all transports",e),new r.TransportError(l.map(e=>e.message).join(", "))}static listmonitor(e,n,t={}){this.validFor(e,"listmonitor").map(([e,l])=>{l.listmonitor(e,n,t),i("Monitoring list %s via %s",e,l.name)})}static async p_newlisturls(e){let n=await Promise.all(this.validFor(void 0,"newlisturls").map(([n,t])=>t.p_newlisturls(e)));return[n.map(e=>e[0]),n.map(e=>e[1])]}static async p_f_createReadStream(e,{wanturl:n=!1,preferredTransports:t=[]}={}){let l=this.validFor(e,"createReadStream",{});if(!l.length)throw i("Opening stream from %o failed: no transports available",e),new r.TransportError("Transports.p_createReadStream cant find any transport for urls: "+e);let a=[];l.sort((e,n)=>(t.indexOf(e[1].name)+1||999+Math.random())-(t.indexOf(n[1].name)+1||999+Math.random()));for(const[e,t]of l)try{i("Opening stream from %s via %s",e.href,t.name);let l=await t.p_f_createReadStream(e,{wanturl:n});return i("Opening stream from %s via %s succeeded",e.href,t.name),l}catch(n){a.push(n),i("Opening stream from %s via %s failed: %s",e.href,t.name,n.message)}throw i("Opening stream from %o failed on all transports",e),new r.TransportError(a.map(e=>e.message).join(", "))}static createReadStream(e,n,t){"function"==typeof n&&(t=n,n={start:0}),DwebTransports.p_f_createReadStream(e,{preferredTransports:n.preferredTransports||[]}).then(e=>{let l=e(n);if(!t)return l;t(null,l)}).catch(e=>{e instanceof r.TransportError?console.warn("Transports.createReadStream caught",e.message):console.error("Transports.createReadStream caught",e),t?t(e):reject(e)})}static async p_get(e,n){let t=this.validFor(e,"get"),l=Array.isArray(n)?`${n.length} keys`:n;if(!t.length)throw i("Getting %s from %o failed: no transports available",l,e),new r.TransportError("Transports.p_get cant find any transport to get keys from urls: "+e);let a=[];for(const[e,r]of t)try{i("Getting %s from %s via %s",l,e.href,r.name);let t=await r.p_get(e,n);return i("Getting %s from %s via %s succeeded length=%d",l,e.href,r.name,t.length),t}catch(n){a.push(n),i("Getting %s from %s via %s failed: %s",l,e.href,r.name,n.message)}throw i("Getting %s from %o failed on all transports",l,e),new r.TransportError(a.map(e=>e.message).join(", "))}static async p_set(e,n,t){e=await this.p_resolveNames(e);let l="object"==typeof n?`${n.length} keys`:n,a=this.validFor(e,"set");if(!a.length)throw i("Setting %s on %o failed: no transports available",l,e),new r.TransportError("Transports.p_set cant find any transport for urls: "+e);let o=[],s=!1;if(await Promise.all(a.map(async function([e,r]){try{i("Setting %s on %s via %s",l,e.href,r.name),await r.p_set(e,n,t),i("Setting %s on %s via %s succeeded",l,e.href,r.name),s=!0}catch(n){i("Setting %s on %s via %s failed: %s",l,e.href,r.name,n.message),o.push(n)}})),!s)throw i("Setting %s on %o failed on all transports",l,e),new r.TransportError(o.map(e=>e.message).join(", "))}static async p_delete(e,n){e=await this.p_resolveNames(e);let t=Array.isArray(n)?`${n.length} keys`:n,l=this.validFor(e,"set");if(!l.length)throw i("Deleting %s on %o failed: no transports available",t,e),new r.TransportError("Transports.p_set cant find any transport for urls: "+e);let a=[],o=!1;if(await Promise.all(l.map(async function([e,l]){try{i("Deleting %s on %s via %s",t,e.href,l.name),await l.p_delete(e,n),i("Deleting %s on %s via %s succeeded",t,e.href,l.name),o=!0}catch(n){i("Deleting %s on %s via %s failed: %s",t,e.href,l.name,n.message),a.push(n)}})),!o)throw i("Deleting %s on %o failed on all transports",t,e),new r.TransportError(a.map(e=>e.message).join(", "))}static async p_keys(e){e=await this.p_resolveNames(e);let n=this.validFor(e,"keys");if(!n.length)throw i("Getting all keys on %o failed: no transports available",e),new r.TransportError("Transports.p_keys cant find any transport for urls: "+e);let t=[];for(const[e,l]of n)try{i("Getting all keys on %s via %s",e.href,l.name);let n=await l.p_keys(e);return i("Getting all keys on %s via %s succeeded with %d keys",e.href,l.name,n.length),n}catch(n){t.push(n),i("Getting all keys on %s via %s failed: %s",e.href,l.name,n.message)}throw i("Getting all keys on %o failed on all transports",e),new r.TransportError(t.map(e=>e.message).join(", "))}static async p_getall(e){e=await this.p_resolveNames(e);let n=this.validFor(e,"getall");if(!n.length)throw i("Getting all values on %o failed: no transports available",e),new r.TransportError("Transports.p_getall cant find any transport for urls: "+e);let t=[];for(const[e,l]of n)try{i("Getting all values on %s via %s",e.href,l.name);let n=await l.p_getall(e);return i("Getting all values on %s via %s succeeded with %d values",e.href,l.name,n.length),n}catch(n){t.push(n),i("Getting all values on %s via %s failed: %s",e.href,l.name,n.message)}throw i("Getting all keys on %o failed on all transports",e),new r.TransportError(t.map(e=>e.message).join(", "))}static async p_newdatabase(e){let n=await Promise.all(this.validFor(void 0,"newdatabase").map(([n,t])=>t.p_newdatabase(e)));return{privateurls:n.map(e=>e.privateurl),publicurls:n.map(e=>e.publicurl)}}static async p_newtable(e,n){let t=await Promise.all(this.validFor(void 0,"newtable").map(([t,l])=>l.p_newtable(e,n)));return{privateurls:t.map(e=>e.privateurl),publicurls:t.map(e=>e.publicurl)}}static async p_connection(e){e=await this.p_resolveNames(e),await Promise.all(this.validFor(e,"connection").map(([e,n])=>n.p_connection(e)))}static monitor(e,n,{current:t=!1}={}){this.validFor(e,"monitor").map(([e,l])=>{i("Monitoring table %s via %s",e,l.name),l.monitor(e,n,{current:t})})}static addtransport(e){f._transports.push(e)}static setup0(e,n,t){let l={http:{urlbase:"http://localhost:4244"}};return e.map(e=>{let t=this._transportclasses["LOCAL"===e?"HTTP":e];return t?(i("Setting up connection to %s with options %o",e,n),t.setup0("LOCAL"===e?l:n)):void i("Connection to %s unavailable",e)}).filter(e=>!!e)}static p_setup1(e,n){const t=Promise.all(this._transports.filter(e=>!this._optionspaused.includes(e.name)).map(n=>(i("Connection stage 1 to %s",n.name),n.p_setup1(e))));if(!n)return t;t.catch(e=>n(e)).then(e=>n(null,e))}static p_setup2(e,n){const t=Promise.all(this._transports.filter(e=>!this._optionspaused.includes(e.name)).map(n=>(i("Connection stage 2 to %s",n.name),n.p_setup2(e))));if(!n)return t;t.catch(e=>n(e)).then(e=>n(null,e))}static p_stop(e,n){if(!n)return new Promise((e,n)=>{try{t.call(this,(t,l)=>{t?n(t):e(l)})}catch(e){n(e)}});try{t.call(this,n)}catch(e){n(e)}function t(n){c(this._connected(),(n,t)=>{i("Stopping %s",n.name),n.stop(e,t)},n)}}static async refreshstatus(e){let n=["transportstatus0","transportstatus1","transportstatus2","transportstatus3","transportstatus4"],t=e.statuselement;t&&(t.classList.remove(...n),t.classList.add(n[e.status])),f.statuscb&&f.statuscb(e)}static _tabbrevs(e){let n=e.transports;return n&&n.length||(n=e.defaulttransports||[]),n.length||(n=["HTTP","IPFS","WEBTORRENT","WOLK"]),n=n.map(e=>e.toUpperCase()),n}static loadIntoHtmlPage(e){const n="https://cdn.jsdelivr.net/npm";this._tabbrevs(e).forEach(e=>{this._transportclasses[e].scripts.map(t=>{i("Loading %s %s",e,t),document.write('