vendor: 5,103 bytes, lines 1-6
1import X from"./__vite-browser-external-BIHI7g3E.js";import{g as Jt}from"./vendor-react-DTF1y61S.js";var et={},me={},vt;function Sr(){if(vt)return me;vt=1,me.byteLength=l,me.toByteArray=y,me.fromByteArray=O;for(var i=[],r=[],n=typeof Uint8Array<"u"?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,u=o.length;f<u;++f)i[f]=o[f],r[o.charCodeAt(f)]=f;r[45]=62,r[95]=63;function h(E){var b=E.length;if(b%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var S=E.indexOf("=");S===-1&&(S=b);var B=S===b?0:4-S%4;return[S,B]}function l(E){var b=h(E),S=b[0],B=b[1];return(S+B)*3/4-B}function g(E,b,S){return(b+S)*3/4-S}function y(E){var b,S=h(E),B=S[0],R=S[1],I=new n(g(E,B,R)),M=0,_=R>0?B-4:B,p;for(p=0;p<_;p+=4)b=r[E.charCodeAt(p)]<<18|r[E.charCodeAt(p+1)]<<12|r[E.charCodeAt(p+2)]<<6|r[E.charCodeAt(p+3)],I[M++]=b>>16&255,I[M++]=b>>8&255,I[M++]=b&255;return R===2&&(b=r[E.charCodeAt(p)]<<2|r[E.charCodeAt(p+1)]>>4,I[M++]=b&255),R===1&&(b=r[E.charCodeAt(p)]<<10|r[E.charCodeAt(p+1)]<<4|r[E.charCodeAt(p+2)]>>2,I[M++]=b>>8&255,I[M++]=b&255),I}function x(E){return i[E>>18&63]+i[E>>12&63]+i[E>>6&63]+i[E&63]}function w(E,b,S){for(var B,R=[],I=b;I<S;I+=3)B=(E[I]<<16&16711680)+(E[I+1]<<8&65280)+(E[I+2]&255),R.push(x(B));return R.join("")}function O(E){for(var b,S=E.length,B=S%3,R=[],I=16383,M=0,_=S-B;M<_;M+=I)R.push(w(E,M,M+I>_?_:M+I));return B===1?(b=E[S-1],R.push(i[b>>2]+i[b<<4&63]+"==")):B===2&&(b=(E[S-2]<<8)+E[S-1],R.push(i[b>>10]+i[b>>4&63]+i[b<<2&63]+"=")),R.join("")}return me}var Fe={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var gt;function br(){return gt||(gt=1,Fe.read=function(i,r,n,o,f){var u,h,l=f*8-o-1,g=(1<<l)-1,y=g>>1,x=-7,w=n?f-1:0,O=n?-1:1,E=i[r+w];for(w+=O,u=E&(1<<-x)-1,E>>=-x,x+=l;x>0;u=u*256+i[r+w],w+=O,x-=8);for(h=u&(1<<-x)-1,u>>=-x,x+=o;x>0;h=h*256+i[r+w],w+=O,x-=8);if(u===0)u=1-y;else{if(u===g)return h?NaN:(E?-1:1)*(1/0);h=h+Math.pow(2,o),u=u-y}return(E?-1:1)*h*Math.pow(2,u-o)},Fe.write=function(i,r,n,o,f,u){var h,l,g,y=u*8-f-1,x=(1<<y)-1,w=x>>1,O=f===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=o?0:u-1,b=o?1:-1,S=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(l=isNaN(r)?1:0,h=x):(h=Math.floor(Math.log(r)/Math.LN2),r*(g=Math.pow(2,-h))<1&&(h--,g*=2),h+w>=1?r+=O/g:r+=O*Math.pow(2,1-w),r*g>=2&&(h++,g/=2),h+w>=x?(l=0,h=x):h+w>=1?(l=(r*g-1)*Math.pow(2,f),h=h+w):(l=r*Math.pow(2,w-1)*Math.pow(2,f),h=0));f>=8;i[n+E]=l&255,E+=b,l/=256,f-=8);for(h=h<<f|l,y+=f;y>0;i[n+E]=h&255,E+=b,h/=256,y-=8);i[n+E-b]|=S*128}),Fe}/*! 2 * The buffer module from node.js, for the browser. 3 * 4 * @author Feross Aboukhadijeh <https://feross.org> 5 * @license MIT 6 */var wt;function kr(){return wt||(wt=1,function(i){var r=Sr(),n=br(),o=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;i.Buffer=l,i.SlowBuffer=I,i.INSPECT_MAX_BYTES=50;var f=2147483647;i.kMaxLength=f,l.TYPED_ARRAY_SUPPORT=u(),!l.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&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.");function u(){try{var s=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(s,e),s.foo()===42}catch{return!1}}Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}});function h(s){if(s>f)throw new RangeError('The value "'+s+'" is invalid for option "size"');var e=new Uint8Array(s);return Object.setPrototypeOf(e,l.prototype),e}function l(s,e,t){if(typeof s=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return w(s)}return g(s,e,t)}l.poolSize=8192;function g(s,e,t){if(typeof s=="string")return O(s,e);if(ArrayBuffer.isView(s))return b(s);if(s==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof s);if(Q(s,ArrayBuffer)||s&&Q(s.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Q(s,SharedArrayBuffer)||s&&Q(s.buffer,SharedArrayBuffer)))return S(s,e,t);if(typeof s=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var a=s.valueOf&&s.valueOf();if(a!=null&&a!==s)return l.from(a,e,t);var c=B(s);if(c)return c;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof s[Symbol.toPrimitive]=="function")return l.from(s[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof s)}l.from=function(s,e,t){return g(s,e,t)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array);function y(s){if(typeof s!="number")throw new TypeError('"size" argument must be of type number');
vendor: 4,633 bytes, line 6
6if(s<0)throw new RangeError('The value "'+s+'" is invalid for option "size"')}function x(s,e,t){return y(s),s<=0?h(s):e!==void 0?typeof t=="string"?h(s).fill(e,t):h(s).fill(e):h(s)}l.alloc=function(s,e,t){return x(s,e,t)};function w(s){return y(s),h(s<0?0:R(s)|0)}l.allocUnsafe=function(s){return w(s)},l.allocUnsafeSlow=function(s){return w(s)};function O(s,e){if((typeof e!="string"||e==="")&&(e="utf8"),!l.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var t=M(s,e)|0,a=h(t),c=a.write(s,e);return c!==t&&(a=a.slice(0,c)),a}function E(s){for(var e=s.length<0?0:R(s.length)|0,t=h(e),a=0;a<e;a+=1)t[a]=s[a]&255;return t}function b(s){if(Q(s,Uint8Array)){var e=new Uint8Array(s);return S(e.buffer,e.byteOffset,e.byteLength)}return E(s)}function S(s,e,t){if(e<0||s.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(s.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');var a;return e===void 0&&t===void 0?a=new Uint8Array(s):t===void 0?a=new Uint8Array(s,e):a=new Uint8Array(s,e,t),Object.setPrototypeOf(a,l.prototype),a}function B(s){if(l.isBuffer(s)){var e=R(s.length)|0,t=h(e);return t.length===0||s.copy(t,0,0,e),t}if(s.length!==void 0)return typeof s.length!="number"||Qe(s.length)?h(0):E(s);if(s.type==="Buffer"&&Array.isArray(s.data))return E(s.data)}function R(s){if(s>=f)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+f.toString(16)+" bytes");return s|0}function I(s){return+s!=s&&(s=0),l.alloc(+s)}l.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==l.prototype},l.compare=function(e,t){if(Q(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),Q(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var a=e.length,c=t.length,d=0,m=Math.min(a,c);d<m;++d)if(e[d]!==t[d]){a=e[d],c=t[d];break}return a<c?-1:c<a?1:0},l.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}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return l.alloc(0);var a;if(t===void 0)for(t=0,a=0;a<e.length;++a)t+=e[a].length;var c=l.allocUnsafe(t),d=0;for(a=0;a<e.length;++a){var m=e[a];if(Q(m,Uint8Array))d+m.length>c.length?l.from(m).copy(c,d):Uint8Array.prototype.set.call(c,m,d);else if(l.isBuffer(m))m.copy(c,d);else throw new TypeError('"list" argument must be an Array of Buffers');d+=m.length}return c};function M(s,e){if(l.isBuffer(s))return s.length;if(ArrayBuffer.isView(s)||Q(s,ArrayBuffer))return s.byteLength;if(typeof s!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof s);var t=s.length,a=arguments.length>2&&arguments[2]===!0;if(!a&&t===0)return 0;for(var c=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return Je(s).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return _t(s).length;default:if(c)return a?-1:Je(s).length;e=(""+e).toLowerCase(),c=!0}}l.byteLength=M;function _(s,e,t){var a=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(s||(s="utf8");;)switch(s){case"hex":return de(this,e,t);case"utf8":case"utf-8":return G(this,e,t);case"ascii":return Xe(this,e,t);case"latin1":case"binary":return Le(this,e,t);case"base64":return F(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ze(this,e,t);default:if(a)throw new TypeError("Unknown encoding: "+s);s=(s+"").toLowerCase(),a=!0}}l.prototype._isBuffer=!0;function p(s,e,t){var a=s[e];s[e]=s[t],s[t]=a}l.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)p(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)p(this,t,t+3),p(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)p(this,t,t+7),p(this,t+1,t+6),p(this,t+2,t+5),p(this,t+3,t+4);return this},l.prototype.toString=function(){var e=this.length;return e===0?"":arguments.length===0?G(this,0,e):_.apply(this,arguments)}
vendor: 11,794 bytes, line 6
6,l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:l.compare(this,e)===0},l.prototype.inspect=function(){var e="",t=i.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},o&&(l.prototype[o]=l.prototype.inspect),l.prototype.compare=function(e,t,a,c,d){if(Q(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),a===void 0&&(a=e?e.length:0),c===void 0&&(c=0),d===void 0&&(d=this.length),t<0||a>e.length||c<0||d>this.length)throw new RangeError("out of range index");if(c>=d&&t>=a)return 0;if(c>=d)return-1;if(t>=a)return 1;if(t>>>=0,a>>>=0,c>>>=0,d>>>=0,this===e)return 0;for(var m=d-c,N=a-t,P=Math.min(m,N),D=this.slice(c,d),z=e.slice(t,a),$=0;$<P;++$)if(D[$]!==z[$]){m=D[$],N=z[$];break}return m<N?-1:N<m?1:0};function v(s,e,t,a,c){if(s.length===0)return-1;if(typeof t=="string"?(a=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,Qe(t)&&(t=c?0:s.length-1),t<0&&(t=s.length+t),t>=s.length){if(c)return-1;t=s.length-1}else if(t<0)if(c)t=0;else return-1;if(typeof e=="string"&&(e=l.from(e,a)),l.isBuffer(e))return e.length===0?-1:k(s,e,t,a,c);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?c?Uint8Array.prototype.indexOf.call(s,e,t):Uint8Array.prototype.lastIndexOf.call(s,e,t):k(s,[e],t,a,c);throw new TypeError("val must be string, number or Buffer")}function k(s,e,t,a,c){var d=1,m=s.length,N=e.length;if(a!==void 0&&(a=String(a).toLowerCase(),a==="ucs2"||a==="ucs-2"||a==="utf16le"||a==="utf-16le")){if(s.length<2||e.length<2)return-1;d=2,m/=2,N/=2,t/=2}function P(mt,yt){return d===1?mt[yt]:mt.readUInt16BE(yt*d)}var D;if(c){var z=-1;for(D=t;D<m;D++)if(P(s,D)===P(e,z===-1?0:D-z)){if(z===-1&&(z=D),D-z+1===N)return z*d}else z!==-1&&(D-=D-z),z=-1}else for(t+N>m&&(t=m-N),D=t;D>=0;D--){for(var $=!0,Oe=0;Oe<N;Oe++)if(P(s,D+Oe)!==P(e,Oe)){$=!1;break}if($)return D}return-1}l.prototype.includes=function(e,t,a){return this.indexOf(e,t,a)!==-1},l.prototype.indexOf=function(e,t,a){return v(this,e,t,a,!0)},l.prototype.lastIndexOf=function(e,t,a){return v(this,e,t,a,!1)};function L(s,e,t,a){t=Number(t)||0;var c=s.length-t;a?(a=Number(a),a>c&&(a=c)):a=c;var d=e.length;a>d/2&&(a=d/2);for(var m=0;m<a;++m){var N=parseInt(e.substr(m*2,2),16);if(Qe(N))return m;s[t+m]=N}return m}function A(s,e,t,a){return Be(Je(e,s.length-t),s,t,a)}function C(s,e,t,a){return Be(wr(e),s,t,a)}function T(s,e,t,a){return Be(_t(e),s,t,a)}function U(s,e,t,a){return Be(Er(e,s.length-t),s,t,a)}l.prototype.write=function(e,t,a,c){if(t===void 0)c="utf8",a=this.length,t=0;else if(a===void 0&&typeof t=="string")c=t,a=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(a)?(a=a>>>0,c===void 0&&(c="utf8")):(c=a,a=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var d=this.length-t;if((a===void 0||a>d)&&(a=d),e.length>0&&(a<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");c||(c="utf8");for(var m=!1;;)switch(c){case"hex":return L(this,e,t,a);case"utf8":case"utf-8":return A(this,e,t,a);case"ascii":case"latin1":case"binary":return C(this,e,t,a);case"base64":return T(this,e,t,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,e,t,a);default:if(m)throw new TypeError("Unknown encoding: "+c);c=(""+c).toLowerCase(),m=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function F(s,e,t){return e===0&&t===s.length?r.fromByteArray(s):r.fromByteArray(s.slice(e,t))}function G(s,e,t){t=Math.min(s.length,t);for(var a=[],c=e;c<t;){var d=s[c],m=null,N=d>239?4:d>223?3:d>191?2:1;if(c+N<=t){var P,D,z,$;switch(N){case 1:d<128&&(m=d);break;case 2:P=s[c+1],(P&192)===128&&($=(d&31)<<6|P&63,$>127&&(m=$));break;case 3:P=s[c+1],D=s[c+2],(P&192)===128&&(D&192)===128&&($=(d&15)<<12|(P&63)<<6|D&63,$>2047&&($<55296||$>57343)&&(m=$));break;case 4:P=s[c+1],D=s[c+2],z=s[c+3],(P&192)===128&&(D&192)===128&&(z&192)===128&&($=(d&15)<<18|(P&63)<<12|(D&63)<<6|z&63,$>65535&&$<1114112&&(m=$))}}m===null?(m=65533,N=1):m>65535&&(m-=65536,a.push(m>>>10&1023|55296),m=56320|m&1023),a.push(m),c+=N}return V(a)}var re=4096;function V(s){var e=s.length;if(e<=re)return String.fromCharCode.apply(String,s);for(var t="",a=0;a<e;)t+=String.fromCharCode.apply(String,s.slice(a,a+=re));return t}function Xe(s,e,t){var a="";t=Math.min(s.length,t);for(var c=e;c<t;++c)a+=String.fromCharCode(s[c]&127);return a}function Le(s,e,t){var a="";t=Math.min(s.length,t);for(var c=e;c<t;++c)a+=String.fromCharCode(s[c]);return a}function de(s,e,t){var a=s.length;(!e||e<0)&&(e=0),(!t||t<0||t>a)&&(t=a);for(var c="",d=e;d<t;++d)c+=xr[s[d]];return c}function Ze(s,e,t){for(var a=s.slice(e,t),c="",d=0;d<a.length-1;d+=2)c+=String.fromCharCode(a[d]+a[d+1]*256);return c}l.prototype.slice=function(e,t){var a=this.length;e=~~e,t=t===void 0?a:~~t,e<0?(e+=a,e<0&&(e=0)):e>a&&(e=a),t<0?(t+=a,t<0&&(t=0)):t>a&&(t=a),t<e&&(t=e);var c=this.subarray(e,t);return Object.setPrototypeOf(c,l.prototype),c};function j(s,e,t){if(s%1!==0||s<0)throw new RangeError("offset is not uint");if(s+e>t)throw new RangeError("Trying to access beyond buffer length")}l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,a){e=e>>>0,t=t>>>0,a||j(e,t,this.length);for(var c=this[e],d=1,m=0;++m<t&&(d*=256);)c+=this[e+m]*d;return c},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,a){e=e>>>0,t=t>>>0,a||j(e,t,this.length);for(var c=this[e+--t],d=1;t>0&&(d*=256);)c+=this[e+--t]*d;return c},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e=e>>>0,t||j(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||j(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||j(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||j(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||j(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,a){e=e>>>0,t=t>>>0,a||j(e,t,this.length);for(var c=this[e],d=1,m=0;++m<t&&(d*=256);)c+=this[e+m]*d;return d*=128,c>=d&&(c-=Math.pow(2,8*t)),c},l.prototype.readIntBE=function(e,t,a){e=e>>>0,t=t>>>0,a||j(e,t,this.length);for(var c=t,d=1,m=this[e+--c];c>0&&(d*=256);)m+=this[e+--c]*d;return d*=128,m>=d&&(m-=Math.pow(2,8*t)),m},l.prototype.readInt8=function(e,t){return e=e>>>0,t||j(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},l.prototype.readInt16LE=function(e,t){e=e>>>0,t||j(e,2,this.length);var a=this[e]|this[e+1]<<8;return a&32768?a|4294901760:a},l.prototype.readInt16BE=function(e,t){e=e>>>0,t||j(e,2,this.length);var a=this[e+1]|this[e]<<8;return a&32768?a|4294901760:a},l.prototype.readInt32LE=function(e,t){return e=e>>>0,t||j(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e=e>>>0,t||j(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return e=e>>>0,t||j(e,4,this.length),n.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e=e>>>0,t||j(e,4,this.length),n.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||j(e,8,this.length),n.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||j(e,8,this.length),n.read(this,e,!1,52,8)};function Y(s,e,t,a,c,d){if(!l.isBuffer(s))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>c||e<d)throw new RangeError('"value" argument is out of bounds');if(t+a>s.length)throw new RangeError("Index out of range")}l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,a,c){if(e=+e,t=t>>>0,a=a>>>0,!c){var d=Math.pow(2,8*a)-1;Y(this,e,t,a,d,0)}var m=1,N=0;for(this[t]=e&255;++N<a&&(m*=256);)this[t+N]=e/m&255;return t+a},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,a,c){if(e=+e,t=t>>>0,a=a>>>0,!c){var d=Math.pow(2,8*a)-1;Y(this,e,t,a,d,0)}var m=a-1,N=1;for(this[t+m]=e&255;--m>=0&&(N*=256);)this[t+m]=e/N&255;return t+a},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,a){return e=+e,t=t>>>0,a||Y(this,e,t,1,255,0),this[t]=e&255,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,a){return e=+e,t=t>>>0,a||Y(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,a){return e=+e,t=t>>>0,a||Y(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,a){return e=+e,t=t>>>0,a||Y(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,a){return e=+e,t=t>>>0,a||Y(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},l.prototype.writeIntLE=function(e,t,a,c){if(e=+e,t=t>>>0,!c){var d=Math.pow(2,8*a-1);Y(this,e,t,a,d-1,-d)}var m=0,N=1,P=0;for(this[t]=e&255;++m<a&&(N*=256);)e<0&&P===0&&this[t+m-1]!==0&&(P=1),this[t+m]=(e/N>>0)-P&255;return t+a},l.prototype.writeIntBE=function(e,t,a,c){if(e=+e,t=t>>>0,!c){var d=Math.pow(2,8*a-1);Y(this,e,t,a,d-1,-d)}var m=a-1,N=1,P=0;for(this[t+m]=e&255;--m>=0&&(N*=256);)e<0&&P===0&&this[t+m+1]!==0&&(P=1),this[t+m]=(e/N>>0)-P&255;return t+a},l.prototype.writeInt8=function(e,t,a){return e=+e,t=t>>>0,a||Y(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},l.prototype.writeInt16LE=function(e,t,a){return e=+e,t=t>>>0,a||Y(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,a){return e=+e,t=t>>>0,a||Y(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},l.prototype.writeInt32LE=function(e,t,a){return e=+e,t=t>>>0,a||Y(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,a){return e=+e,t=t>>>0,a||Y(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]=e&255,t+4};function Te(s,e,t,a,c,d){if(t+a>s.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function Ce(s,e,t,a,c){return e=+e,t=t>>>0,c||Te(s,e,t,4),n.write(s,e,t,a,23,4),t+4}l.prototype.writeFloatLE=function(e,t,a){return Ce(this,e,t,!0,a)},l.prototype.writeFloatBE=function(e,t,a){return Ce(this,e,t,!1,a)};function _e(s,e,t,a,c){return e=+e,t=t>>>0,c||Te(s,e,t,8),n.write(s,e,t,a,52,8),t+8}l.prototype.writeDoubleLE=function(e,t,a){return _e(this,e,t,!0,a)},l.prototype.writeDoubleBE=function(e,t,a){return _e(this,e,t,!1,a)},l.prototype.copy=function(e,t,a,c){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(a||(a=0),!c&&c!==0&&(c=this.length),t>=e.length&&(t=e.length),t||(t=0),c>0&&c<a&&(c=a),c===a||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(a<0||a>=this.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("sourceEnd out of bounds");c>this.length&&(c=this.length),e.length-t<c-a&&(c=e.length-t+a);var d=c-a;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,a,c):Uint8Array.prototype.set.call(e,this.subarray(a,c),t),d},l.prototype.fill=function(e,t,a,c){if(typeof e=="string"){if(typeof t=="string"?(c=t,t=0,a=this.length):typeof a=="str
6ing"&&(c=a,a=this.length),c!==void 0&&typeof c!="string")throw new TypeError("encoding must be a string");if(typeof c=="string"&&!l.isEncoding(c))throw new TypeError("Unknown encoding: "+c);if(e.length===1){var d=e.charCodeAt(0);(c==="utf8"&&d<128||c==="latin1")&&(e=d)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length<t||this.length<a)throw new RangeError("Out of range index");if(a<=t)return this;t=t>>>0,a=a===void 0?this.length:a>>>0,e||(e=0);var m;if(typeof e=="number")for(m=t;m<a;++m)this[m]=e;else{var N=l.isBuffer(e)?e:l.from(e,c),P=N.length;if(P===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(m=0;m<a-t;++m)this[m+t]=N[m%P]}return this};var vr=/[^+/0-9A-Za-z-_]/g;function gr(s){if(s=s.split("=")[0],s=s.trim().replace(vr,""),s.length<2)return"";for(;s.length%4!==0;)s=s+"=";return s}function Je(s,e){e=e||1/0;for(var t,a=s.length,c=null,d=[],m=0;m<a;++m){if(t=s.charCodeAt(m),t>55295&&t<57344){if(!c){if(t>56319){(e-=3)>-1&&d.push(239,191,189);continue}else if(m+1===a){(e-=3)>-1&&d.push(239,191,189);continue}c=t;continue}if(t<56320){(e-=3)>-1&&d.push(239,191,189),c=t;continue}t=(c-55296<<10|t-56320)+65536}else c&&(e-=3)>-1&&d.push(239,191,189);if(c=null,t<128){if((e-=1)<0)break;d.push(t)}else if(t<2048){if((e-=2)<0)break;d.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;d.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;d.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return d}function wr(s){for(var e=[],t=0;t<s.length;++t)e.push(s.charCodeAt(t)&255);return e}function Er(s,e){for(var t,a,c,d=[],m=0;m<s.length&&!((e-=2)<0);++m)t=s.charCodeAt(m),a=t>>8,c=t%256,d.push(c),d.push(a);return d}function _t(s){return r.toByteArray(gr(s))}function Be(s,e,t,a){for(var c=0;c<a&&!(c+t>=e.length||c>=s.length);++c)e[c+t]=s[c];return c}function Q(s,e){return s instanceof e||s!=null&&s.constructor!=null&&s.constructor.name!=null&&s.constructor.name===e.name}function Qe(s){return s!==s}var xr=function(){for(var s="0123456789abcdef",e=new Array(256),t=0;t<16;++t)for(var a=t*16,c=0;c<16;++c)e[a+c]=s[t]+s[c];return e}()}(et)),et}var Lr=kr();const Tr=Jt(Lr);var Ue={exports:{}},Et;function Cr(){if(Et)return Ue.exports;Et=1;var i=typeof Reflect=="object"?Reflect:null,r=i&&typeof i.apply=="function"?i.apply:function(p,v,k){return Function.prototype.apply.call(p,v,k)},n;i&&typeof i.ownKeys=="function"?n=i.ownKeys:Object.getOwnPropertySymbols?n=function(p){return Object.getOwnPropertyNames(p).concat(Object.getOwnPropertySymbols(p))}:n=function(p){return Object.getOwnPropertyNames(p)};function o(_){console&&console.warn&&console.warn(_)}var f=Number.isNaN||function(p){return p!==p};function u(){u.init.call(this)}Ue.exports=u,Ue.exports.once=R,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var h=10;function l(_){if(typeof _!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof _)}Object.defineProperty(u,"defaultMaxListeners",{enumerable:!0,get:function(){return h},set:function(_){if(typeof _!="number"||_<0||f(_))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+_+".");h=_}}),u.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},u.prototype.setMaxListeners=function(p){if(typeof p!="number"||p<0||f(p))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+p+".");return this._maxListeners=p,this};function g(_){return _._maxListeners===void 0?u.defaultMaxListeners:_._maxListeners}u.prototype.getMaxListeners=function(){return g(this)},u.prototype.emit=function(p){for(var v=[],k=1;k<arguments.length;k++)v.push(arguments[k]);var L=p==="error",A=this._events;if(A!==void 0)L=L&&A.error===void 0;else if(!L)return!1;if(L){var C;if(v.length>0&&(C=v[0]),C instanceof Error)throw C;var T=new Error("Unhandled error."+(C?" ("+C.message+")":""));throw T.context=C,T}var U=A[p];if(U===void 0)return!1;if(typeof U=="function")r(U,this,v);else for(var F=U.length,G=b(U,F),k=0;k<F;++k)r(G[k],this,v);return!0};function y(_,p,v,k){var L,A,C;if(l(v),A=_._events,A===void 0?(A=_._events=Object.create(null),_._eventsCount=0):(A.newListener!==void 0&&(_.emit("newListener",p,v.listener?v.listener:v),A=_._events),C=A[p]),C===void 0)C=A[p]=v,++_._eventsCount;else if(typeof C=="function"?C=A[p]=k?[v,C]:[C,v]:k?C.unshift(v):C.push(v),L=g(_),L>0&&C.length>L&&!C.warned){C.warned=!0;var T=new Error("Possible EventEmitter memory leak detected. "+C.length+" "+String(p)+" listeners added. Use emitter.setMaxListeners() to increase limit");T.name="MaxListenersExceededWarning",T.emitter=_,T.type=p,T.count=C.length,o(T)}return _}u.prototype.addListener=function(p,v){return y(this,p,v,!1)},u.prototype.on=u.prototype.addListener,u.prototype.prependListener=function(p,v){return y(this,p,v,!0)};function x(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function w(_,p,v){var k={fired:!1,wrapFn:void 0,target:_,type:p,listener:v},L=x.bind(k);return L.listener=v,k.wrapFn=L,L}u.prototype.once=function(p,v){return l(v),this.on(p,w(this,p,v)),this},u.prototype.prependOnceListener=function(p,v){return l(v),this.prependListener(p,w(this,p,v)),this},u.prototype.removeListener=function(p,v){var k,L,A,C,T;if(l(v),L=this._events,L===void 0)return this;if(k=L[p],k===void 0)return this;if(k===v||k.listener===v)--this._eventsCount===0?this._events=Object.create(null):(delete L[p],L.removeListener&&this.emit
vendor: 2,903 bytes, line 6
6("removeListener",p,k.listener||v));else if(typeof k!="function"){for(A=-1,C=k.length-1;C>=0;C--)if(k[C]===v||k[C].listener===v){T=k[C].listener,A=C;break}if(A<0)return this;A===0?k.shift():S(k,A),k.length===1&&(L[p]=k[0]),L.removeListener!==void 0&&this.emit("removeListener",p,T||v)}return this},u.prototype.off=u.prototype.removeListener,u.prototype.removeAllListeners=function(p){var v,k,L;if(k=this._events,k===void 0)return this;if(k.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):k[p]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete k[p]),this;if(arguments.length===0){var A=Object.keys(k),C;for(L=0;L<A.length;++L)C=A[L],C!=="removeListener"&&this.removeAllListeners(C);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(v=k[p],typeof v=="function")this.removeListener(p,v);else if(v!==void 0)for(L=v.length-1;L>=0;L--)this.removeListener(p,v[L]);return this};function O(_,p,v){var k=_._events;if(k===void 0)return[];var L=k[p];return L===void 0?[]:typeof L=="function"?v?[L.listener||L]:[L]:v?B(L):b(L,L.length)}u.prototype.listeners=function(p){return O(this,p,!0)},u.prototype.rawListeners=function(p){return O(this,p,!1)},u.listenerCount=function(_,p){return typeof _.listenerCount=="function"?_.listenerCount(p):E.call(_,p)},u.prototype.listenerCount=E;function E(_){var p=this._events;if(p!==void 0){var v=p[_];if(typeof v=="function")return 1;if(v!==void 0)return v.length}return 0}u.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]};function b(_,p){for(var v=new Array(p),k=0;k<p;++k)v[k]=_[k];return v}function S(_,p){for(;p+1<_.length;p++)_[p]=_[p+1];_.pop()}function B(_){for(var p=new Array(_.length),v=0;v<p.length;++v)p[v]=_[v].listener||_[v];return p}function R(_,p){return new Promise(function(v,k){function L(C){_.removeListener(p,A),k(C)}function A(){typeof _.removeListener=="function"&&_.removeListener("error",L),v([].slice.call(arguments))}M(_,p,A,{once:!0}),p!=="error"&&I(_,L,{once:!0})})}function I(_,p,v){typeof _.on=="function"&&M(_,"error",p,v)}function M(_,p,v,k){if(typeof _.on=="function")k.once?_.once(p,v):_.on(p,v);else if(typeof _.addEventListener=="function")_.addEventListener(p,function L(A){k.once&&_.removeEventListener(p,L),v(A)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof _)}return Ue.exports}var Br=Cr();const Qt=Jt(Br);var te={};function be(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function Or(i){if(i.__esModule)return i;var r=i.default;if(typeof r=="function"){var n=function o(){return this instanceof o?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};n.prototype=r.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}
6),Object.keys(i).forEach(function(o){var f=Object.getOwnPropertyDescriptor(i,o);Object.defineProperty(n,o,f.get?f:{enumerable:!0,get:function(){return i[o]}})}),n}const{Duplex:Fr}=X;function xt(i){i.emit("close")}function Ur(){!this.destroyed&&this._writableState.finished&&this.destroy()}function er(i){this.removeListener("error",er),this.destroy(),this.listenerCount("error")===0&&this.emit("error",i)}function Nr(i,r){let n=!0;const o=new Fr({...r,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return i.on("message",function(u,h){const l=!h&&o._readableState.objectMode?u.toString():u;o.push(l)||i.pause()}),i.once("error",function(u){o.destroyed||(n=!1,o.destroy(u))}),i.once("close",function(){o.destroyed||o.push(null)}),o._destroy=function(f,u){if(i.readyState===i.CLOSED){u(f),process.nextTick(xt,o);return}let h=!1;i.once("error",function(g){h=!0,u(g)}),i.once("close",function(){h||u(f),process.nextTick(xt,o)}),n&&i.terminate()},o._final=function(f){if(i.readyState===i.CONNECTING){i.once("open",function(){o._final(f)});return}i._socket!==null&&(i._socket._writableState.finished?(f(),o._readableState.endEmitted&&o.destroy()):(i._socket.once("finish",function(){f()}),i.close()))},o._read=function(){i.isPaused&&i.resume()},o._write=function(f,u,h){if(i.readyState===i.CONNECTING){i.once("open",function(){o._write(f,u,h)});return}i.send(f,h)},o.on("end",Ur),o.on("error",er),o}var Ar=Nr;const li=be(Ar);var We={exports:{}},le={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}},Ne={exports:{}},Ae={exports:{}};function Ir(i){throw new Error('Could not dynamically require "'+i+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var tt,St;function Rr(){if(St)return tt;St=1;var i=X,r=X,n=X,o=typeof __webpack_require__=="function"?__non_webpack_require__:Ir,f=process.config&&process.config.variables||{},u=!!te.PREBUILDS_ONLY,h=process.versions.modules,l=A()?"electron":L()?"node-webkit":"node",g=te.npm_config_arch||n.arch(),y=te.npm_config_platform||n.platform(),x=te.LIBC||(C(y)?"musl":"glibc"),w=te.ARM_VERSION||(g==="arm64"?"8":f.arm_version)||"",O=(process.versions.uv||"").split(".")[0];tt=E;function E(T){return o(E.resolve(T))}E.resolve=E.path=function(T){T=r.resolve(T||".");try{var U=o(r.join(T,"package.json")).name.toUpperCase().replace(/-/g,"_");te[U+"_PREBUILD"]&&(T=te[U+"_PREBUILD"])}catch{}if(!u){var F=S(r.join(T,"build/Release"),B);if(F)return F;var G=S(r.join(T,"build/Debug"),B);if(G)return G}var re=Le(T);if(re)return re;var V=Le(r.dirname(process.execPath));if(V)return V;var Xe=["platform="+y,"arch="+g,"runtime="+l,"abi="+h,"uv="+O,w?"armv="+w:"","libc="+x,"node="+process.versions.node,process.versions.electron?"electron="+process.versions.electron:"",typeof __webpack_require__=="function"?"webpack=true":""].filter(Boolean).join(" ");throw new Error("No native build was found for "+Xe+` 7 loaded from: `+T+` 8`);function Le(de){var Ze=b(r.join(de,"prebuilds")).map(R),j=Ze.filter(I(y,g)).sort(M)[0];if(j){var Y=r.join(de,"prebuilds",j.name),Te=b(Y).map(_),Ce=Te.filter(p(l,h)),_e=Ce.sort(k(l))[0];if(_e)return r.join(Y,_e.file)}}};function b(T){try{return i.readdirSync(T)}catch{return[]}}function S(T,U){var F=b(T).filter(U);return F[0]&&r.join(T,F[0])}function B(T){return/\.node$/.test(T)}function R(T){var U=T.split("-");if(U.length===2){var F=U[0],G=U[1].split("+");if(F&&G.length&&G.every(Boolean))return{name:T,platform:F,architectures:G}}}function I(T,U){return function(F){return F==null||F.platform!==T?!1:F.architectures.includes(U)}}function M(T,U){return T.architectures.length-U.architectures.length}function _(T){var U=T.split("."),F=U.pop(),G={file:T,specificity:0};if(F==="node"){for(var re=0;re<U.length;re++){var V=U[re];if(V==="node"||V==="electron"||V==="node-webkit")G.runtime=V;else if(V==="napi")G.napi=!0;else if(V.slice(0,3)==="abi")G.abi=V.slice(3);else if(V.slice(0,2)==="uv")G.uv=V.slice(2);else if(V.slice(0,4)==="armv")G.armv=V.slice(4);else if(V==="glibc"||V==="musl")G.libc=V;else continue;G.specificity++}return G}}function p(T,U){return function(F){return!(F==null||F.runtime!==T&&!v(F)||F.abi!==U&&!F.napi||F.uv&&F.uv!==O||F.armv&&F.armv!==w||F.libc&&F.libc!==x)}}function v(T){return T.runtime==="node"&&T.napi}function k(T){return function(U,F){return U.runtime!==F.runtime?U.runtime===T?-1:1:U.abi!==F.abi?U.abi?-1:1:U.specificity!==F.specificity?U.specificity>F.specificity?-1:1:0}}function L(){return!!(process.versions&&process.versions.nw)}function A(){return process.versions&&process.versions.electron||te.ELECTRON_RUN_AS_NODE?!0:typeof window<"u"&&window.process&&window.process.type==="renderer"}function C(T){return T==="linux"&&i.existsSync("/etc/alpine-release")}return E.parseTags=_,E.matchTags=p,E.compareTags=k,E.parseTuple=R,E.matchTuple=I,E.compareTuples=M,tt}var bt;function Mr(){return bt||(bt=1,typeof process.addon=="function"?Ae.exports=process.addon.bind(process):Ae.exports=Rr()),Ae.exports}var rt,kt;function Pr(){return kt||(kt=1,rt={mask:(n,o,f,u,h)=>{for(var l=0;l<h;l++)f[u+l]=n[l]^o[l&3]},unmask:(n,o)=>{const f=n.length;for(var u=0;u<f;u++)n[u]^=o[u&3]}}),rt}var Lt;function Dr(){if(Lt)return Ne.exports;Lt=1;try{Ne.exports=Mr()(__dirname)}catch{Ne.exports=Pr()}return Ne.exports}var $r,Wr;const{EMPTY_BUFFER:jr}=le,ct=Buffer[Symbol.species];function Gr(i,r){if(i.length===0)return jr;if(i.length===1)return i[0];const n=Buffer.allocUnsafe(r);let o=0;for(let f=0;f<i.length;f++){const u=i[f];n.set(u,o),o+=u.length}return o<r?new ct(n.buffer,n.byteOffset,o):n}function tr(i,r,n,o,f){for(let u=0;u<f;u++)n[o+u]=i[u]^r[u&3]}function rr(i,r){for(let n=0;n<i.length;n++)i[n]^=r[n&3]}function Vr(i){return i.length===i.buffer.byteLength?i.buffer:i.buffer.slice(i.byteOffset,i.byteOffset+i.length)}function ht(i){if(ht.readOnly=!0,Buffer.isBuffer(i))return i;let r;return i instanceof ArrayBuffer?r=new ct(i):ArrayBuffer.isView(i)?r=new ct(i.buffer,i.byteOffset,i.byteLength):(r=Buffer.from(i),ht.readOnly=!1),r}We.exports={concat:Gr,mask:tr,toArrayBuffer:Vr,toBuffer:ht,unmask:rr};if(!te.WS_NO_BUFFER_UTIL)try{const i=Dr();Wr=We.exports.mask=function(r,n,o,f,u){u<48?tr(r,n,o,f,u):i.mask(r,n,o,f,u)},$r=We.exports.unmask=function(r,n){r.length<32?rr(r,n):i.unmask(r,n)}}catch{}var qe=We.exports;const Tt=Symbol("kDone"),nt=Symbol("kRun");let qr=class{constructor(r){this[Tt]=()=>{this.pending--,this[nt]()},this.concurrency=r||1/0,this.jobs=[],this.pending=0}add(r){this.jobs.push(r),this[nt]()}[nt](){if(this.pending!==this.concurrency&&this.jobs.length){const r=this.jobs.shift();this.pending++,r(this[Tt])}}};var Hr=qr;
vendor: 4,506 bytes, line 8
8const ye=X,Ct=qe,Yr=Hr,{kStatusCode:nr}=le,zr=Buffer[Symbol.species],Kr=Buffer.from([0,0,255,255]),je=Symbol("permessage-deflate"),ne=Symbol("total-length"),xe=Symbol("callback"),se=Symbol("buffers"),De=Symbol("error");let Ie,Xr=class{constructor(r,n,o){if(this._maxPayload=o|0,this._options=r||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!n,this._deflate=null,this._inflate=null,this.params=null,!Ie){const f=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Ie=new Yr(f)}}static get extensionName(){return"permessage-deflate"}offer(){const r={};return this._options.serverNoContextTakeover&&(r.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(r.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(r.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?r.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(r.client_max_window_bits=!0),r}accept(r){return r=this.normalizeParams(r),this.params=this._isServer?this.acceptAsServer(r):this.acceptAsClient(r),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){const r=this._deflate[xe];this._deflate.close(),this._deflate=null,r&&r(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(r){const n=this._options,o=r.find(f=>!(n.serverNoContextTakeover===!1&&f.server_no_context_takeover||f.server_max_window_bits&&(n.serverMaxWindowBits===!1||typeof n.serverMaxWindowBits=="number"&&n.serverMaxWindowBits>f.server_max_window_bits)||typeof n.clientMaxWindowBits=="number"&&!f.client_max_window_bits));if(!o)throw new Error("None of the extension offers can be accepted");return n.serverNoContextTakeover&&(o.server_no_context_takeover=!0),n.clientNoContextTakeover&&(o.client_no_context_takeover=!0),typeof n.serverMaxWindowBits=="number"&&(o.server_max_window_bits=n.serverMaxWindowBits),typeof n.clientMaxWindowBits=="number"?o.client_max_window_bits=n.clientMaxWindowBits:(o.client_max_window_bits===!0||n.clientMaxWindowBits===!1)&&delete o.client_max_window_bits,o}acceptAsClient(r){const n=r[0];if(this._options.clientNoContextTakeover===!1&&n.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!n.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(n.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&n.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return n}normalizeParams(r){return r.forEach(n=>{Object.keys(n).forEach(o=>{let f=n[o];if(f.length>1)throw new Error(`Parameter "${o}" must have only a single value`);if(f=f[0],o==="client_max_window_bits"){if(f!==!0){const u=+f;if(!Number.isInteger(u)||u<8||u>15)throw new TypeError(`Invalid value for parameter "${o}": ${f}`);f=u}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${o}": ${f}`)}else if(o==="server_max_window_bits"){const u=+f;if(!Number.isInteger(u)||u<8||u>15)throw new TypeError(`Invalid value for parameter "${o}": ${f}`);f=u}else if(o==="client_no_context_takeover"||o==="server_no_context_takeover"){if(f!==!0)throw new TypeError(`Invalid value for parameter "${o}": ${f}`)}else throw new Error(`Unknown parameter "${o}"`);n[o]=f})}),r}decompress(r,n,o){Ie.add(f=>{this._decompress(r,n,(u,h)=>{f(),o(u,h)})})}compress(r,n,o){Ie.add(f=>{this._compress(r,n,(u,h)=>{f(),o(u,h)})})}_decompress(r,n,o){const f=this._isServer?"client":"server";if(!this._inflate){const u=`${f}_max_window_bits`,h=typeof this.params[u]!="number"?ye.Z_DEFAULT_WINDOWBITS:this.params[u];this._inflate=ye.createInflateRaw({...this._options.zlibInflateOptions,windowBits:h}),this._inflate[je]=this,this._inflate[ne]=0,this._inflate[se]=[],this._inflate.on("error",Jr),this._inflate.on("data",ir)}this._inflate[xe]=o,this._inflate.write(r),n&&this._inflate.write(Kr),this._inflate.flush(()=>{const u=this._inflate[De];if(u){this._inflate.close(),this._inflate=null,o(u);return}const h=Ct.concat(this._inflate[se],this._inflate[ne]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[ne]=0,this._inflate[se]=[],n&&this.params[`${f}_no_context_takeover`]&&this._inflate.reset()),o(null,h)})}
8_compress(r,n,o){const f=this._isServer?"server":"client";if(!this._deflate){const u=`${f}_max_window_bits`,h=typeof this.params[u]!="number"?ye.Z_DEFAULT_WINDOWBITS:this.params[u];this._deflate=ye.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:h}),this._deflate[ne]=0,this._deflate[se]=[],this._deflate.on("data",Zr)}this._deflate[xe]=o,this._deflate.write(r),this._deflate.flush(ye.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let u=Ct.concat(this._deflate[se],this._deflate[ne]);n&&(u=new zr(u.buffer,u.byteOffset,u.length-4)),this._deflate[xe]=null,this._deflate[ne]=0,this._deflate[se]=[],n&&this.params[`${f}_no_context_takeover`]&&this._deflate.reset(),o(null,u)})}};var He=Xr;function Zr(i){this[se].push(i),this[ne]+=i.length}function ir(i){if(this[ne]+=i.length,this[je]._maxPayload<1||this[ne]<=this[je]._maxPayload){this[se].push(i);return}this[De]=new RangeError("Max payload size exceeded"),this[De].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[De][nr]=1009,this.removeListener("data",ir),this.reset()}function Jr(i){this[je]._inflate=null,i[nr]=1007,this[xe](i)}var Ge={exports:{}};const Qr={},en=Object.freeze(Object.defineProperty({__proto__:null,default:Qr},Symbol.toStringTag,{value:"Module"})),tn=Or(en);var Bt;const{isUtf8:Ot}=Tr,rn=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function nn(i){return i>=1e3&&i<=1014&&i!==1004&&i!==1005&&i!==1006||i>=3e3&&i<=4999}function pt(i){const r=i.length;let n=0;for(;n<r;)if(!(i[n]&128))n++;else if((i[n]&224)===192){if(n+1===r||(i[n+1]&192)!==128||(i[n]&254)===192)return!1;n+=2}else if((i[n]&240)===224){if(n+2>=r||(i[n+1]&192)!==128||(i[n+2]&192)!==128||i[n]===224&&(i[n+1]&224)===128||i[n]===237&&(i[n+1]&224)===160)return!1;n+=3}else if((i[n]&248)===240){if(n+3>=r||(i[n+1]&192)!==128||(i[n+2]&192)!==128||(i[n+3]&192)!==128||i[n]===240&&(i[n+1]&240)===128||i[n]===244&&i[n+1]>143||i[n]>244)return!1;n+=4}else return!1;return!0}Ge.exports={isValidStatusCode:nn,isValidUTF8:pt,tokenChars:rn};if(Ot)Bt=Ge.exports.isValidUTF8=function(i){return i.length<24?pt(i):Ot(i)};else if(!te.WS_NO_UTF_8_VALIDATE)try{const i=tn;Bt=Ge.exports.isValidUTF8=function(r){return r.length<32?pt(r):i(r)}}catch{}var Ye=Ge.exports;const{Writable:sn}=X,Ft=He,{BINARY_TYPES:on,EMPTY_BUFFER:Ut,kStatusCode:an,kWebSocket:fn}=le,{concat:it,toArrayBuffer:un,unmask:ln}=qe,{isValidStatusCode:cn,isValidUTF8:Nt}=Ye,Re=Buffer[Symbol.species],ve=0,At=1,It=2,Rt=3,st=4,hn=5;let pn=class extends sn{constructor(r={}){super(),this._binaryType=r.binaryType||on[0],this._extensions=r.extensions||{},this._isServer=!!r.isServer,this._maxPayload=r.maxPayload|0,this._skipUTF8Validation=!!r.skipUTF8Validation,this[fn]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._state=ve,this._loop=!1}_write(r,n,o){if(this._opcode===8&&this._state==ve)return o();this._bufferedBytes+=r.length,this._buffers.push(r),this.startLoop(o)}consume(r){if(this._bufferedBytes-=r,r===this._buffers[0].length)return this._buffers.shift();if(r<this._buffers[0].length){const o=this._buffers[0];return this._buffers[0]=new Re(o.buffer,o.byteOffset+r,o.length-r),new Re(o.buffer,o.byteOffset,r)}const n=Buffer.allocUnsafe(r);do{const o=this._buffers[0],f=n.length-r;r>=o.length?n.set(this._buffers.shift(),f):(n.set(new Uint8Array(o.buffer,o.byteOffset,r),f),this._buffers[0]=new Re(o.buffer,o.byteOffset+r,o.length-r)),r-=o.length}while(r>0);return n}startLoop(r){let n;this._loop=!0;do switch(this._state){case ve:n=this.getInfo();break;case At:n=this.getPayloadLength16();break;case It:n=this.getPayloadLength64();break;case Rt:this.getMask();break;case st:n=this.getData(r);break;default:this._loop=!1;return}while(this._loop);r(n)}getInfo(){if(this._bufferedBytes<2){this._loop=!1;return}const r=this.consume(2);if(r[0]&48)return this._loop=!1,H(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ER
8R_UNEXPECTED_RSV_2_3");const n=(r[0]&64)===64;if(n&&!this._extensions[Ft.extensionName])return this._loop=!1,H(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._fin=(r[0]&128)===128,this._opcode=r[0]&15,this._payloadLength=r[1]&127,this._opcode===0){if(n)return this._loop=!1,H(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(!this._fragmented)return this._loop=!1,H(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented)return this._loop=!1,H(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin)return this._loop=!1,H(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");if(n)return this._loop=!1,H(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1)return this._loop=!1,H(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH")}else return this._loop=!1,H(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(r[1]&128)===128,this._isServer){if(!this._masked)return this._loop=!1,H(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK")}else if(this._masked)return this._loop=!1,H(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");if(this._payloadLength===126)this._state=At;else if(this._payloadLength===127)this._state=It;else return this.haveLength()}getPayloadLength16(){if(this._bufferedBytes<2){this._loop=!1;return}return this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength()}getPayloadLength64(){if(this._bufferedBytes<8){this._loop=!1;return}const r=this.consume(8),n=r.readUInt32BE(0);return n>Math.pow(2,21)-1?(this._loop=!1,H(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH")):(this._payloadLength=n*Math.pow(2,32)+r.readUInt32BE(4),this.haveLength())}haveLength(){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0))return this._loop=!1,H(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");this._masked?this._state=Rt:this._state=st}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=st}getData(r){let n=Ut;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}n=this.consume(this._payloadLength),this._masked&&this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3]&&ln(n,this._mask)}if(this._opcode>7)return this.controlMessage(n);if(this._compressed){this._state=hn,this.decompress(n,r);return}return n.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(n)),this.dataMessage()}decompress(r,n){this._extensions[Ft.extensionName].decompress(r,this._fin,(f,u)=>{if(f)return n(f);if(u.length){if(this._messageLength+=u.length,this._messageLength>this._maxPayload&&this._maxPayload>0)return n(H(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"));this._fragments.push(u)}const h=this.dataMessage();if(h)return n(h);this.startLoop(n)})}dataMessage(){if(this._fin){const r=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let o;this._binaryType==="nodebuffer"?o=it(n,r):this._binaryType==="arraybuffer"?o=un(it(n,r)):o=n,this.emit("message",o,!0)}else{const o=it(n,r);if(!this._skipUTF8Validation&&!Nt(o))return this._loop=!1,H(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("message",o,!1)}}this._state=ve}controlMessage(r){if(this._opcode===8)if(this._loop=!1,r.length===0)this.emit("conclude",1005,Ut),this.end();else{const n=r.readUInt16BE(0);if(!cn(n))return H(RangeError,`invalid status code ${n}
8`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");const o=new Re(r.buffer,r.byteOffset+2,r.length-2);if(!this._skipUTF8Validation&&!Nt(o))return H(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");this.emit("conclude",n,o),this.end()}else this._opcode===9?this.emit("ping",r):this.emit("pong",r);this._state=ve}};var sr=pn;function H(i,r,n,o,f){const u=new i(n?`Invalid WebSocket frame: ${r}`:r);return Error.captureStackTrace(u,H),u.code=f,u[an]=o,u}const di=be(sr),{randomFillSync:dn}=X,Mt=He,{EMPTY_BUFFER:_n}=le,{isValidStatusCode:mn}=Ye,{mask:Pt,toBuffer:he}=qe,J=Symbol("kByteLength"),yn=Buffer.alloc(4);let vn=class fe{constructor(r,n,o){this._extensions=n||{},o&&(this._generateMask=o,this._maskBuffer=Buffer.alloc(4)),this._socket=r,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(r,n){let o,f=!1,u=2,h=!1;n.mask&&(o=n.maskBuffer||yn,n.generateMask?n.generateMask(o):dn(o,0,4),h=(o[0]|o[1]|o[2]|o[3])===0,u=6);let l;typeof r=="string"?(!n.mask||h)&&n[J]!==void 0?l=n[J]:(r=Buffer.from(r),l=r.length):(l=r.length,f=n.mask&&n.readOnly&&!h);let g=l;l>=65536?(u+=8,g=127):l>125&&(u+=2,g=126);const y=Buffer.allocUnsafe(f?l+u:u);return y[0]=n.fin?n.opcode|128:n.opcode,n.rsv1&&(y[0]|=64),y[1]=g,g===126?y.writeUInt16BE(l,2):g===127&&(y[2]=y[3]=0,y.writeUIntBE(l,4,6)),n.mask?(y[1]|=128,y[u-4]=o[0],y[u-3]=o[1],y[u-2]=o[2],y[u-1]=o[3],h?[y,r]:f?(Pt(r,o,y,u,l),[y]):(Pt(r,o,r,0,l),[y,r])):[y,r]}close(r,n,o,f){let u;if(r===void 0)u=_n;else{if(typeof r!="number"||!mn(r))throw new TypeError("First argument must be a valid error code number");if(n===void 0||!n.length)u=Buffer.allocUnsafe(2),u.writeUInt16BE(r,0);else{const l=Buffer.byteLength(n);if(l>123)throw new RangeError("The message must not be greater than 123 bytes");u=Buffer.allocUnsafe(2+l),u.writeUInt16BE(r,0),typeof n=="string"?u.write(n,2):u.set(n,2)}}const h={[J]:u.length,fin:!0,generateMask:this._generateMask,mask:o,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._deflating?this.enqueue([this.dispatch,u,!1,h,f]):this.sendFrame(fe.frame(u,h),f)}ping(r,n,o){let f,u;if(typeof r=="string"?(f=Buffer.byteLength(r),u=!1):(r=he(r),f=r.length,u=he.readOnly),f>125)throw new RangeError("The data size must not be greater than 125 bytes");const h={[J]:f,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:9,readOnly:u,rsv1:!1};this._deflating?this.enqueue([this.dispatch,r,!1,h,o]):this.sendFrame(fe.frame(r,h),o)}pong(r,n,o){let f,u;if(typeof r=="string"?(f=Buffer.byteLength(r),u=!1):(r=he(r),f=r.length,u=he.readOnly),f>125)throw new RangeError("The data size must not be greater than 125 bytes");const h={[J]:f,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:10,readOnly:u,rsv1:!1};this._deflating?this.enqueue([this.dispatch,r,!1,h,o]):this.sendFrame(fe.frame(r,h),o)}send(r,n,o){const f=this._extensions[Mt.extensionName];let u=n.binary?2:1,h=n.compress,l,g;if(typeof r=="string"?(l=Buffer.byteLength(r),g=!1):(r=he(r),l=r.length,g=he.readOnly),this._firstFragment?(this._firstFragment=!1,h&&f&&f.params[f._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(h=l>=f._threshold),this._compress=h):(h=!1,u=0),n.fin&&(this._firstFragment=!0),f){const y={[J]:l,fin:n.fin,generateMask:this._generateMask,mask:n.mask,maskBuffer:this._maskBuffer,opcode:u,readOnly:g,rsv1:h};this._deflating?this.enqueue([this.dispatch,r,this._compress,y,o]):this.dispatch(r,this._compress,y,o)}else this.sendFrame(fe.frame(r,{[J]:l,fin:n.fin,generateMask:this._generateMask,mask:n.mask,maskBuffer:this._maskBuffer,opcode:u,readOnly:g,rsv1:!1}),o)}dispatch(r,n,o,f){if(!n){this.sendFrame(fe.frame(r,o),f);return}const u=this._extensions[Mt.extensionName];this._bufferedBytes+=o[J],this._deflating=!0,u.compress(r,o.fin,(h,l)=>{if(this._socket.destroyed){const g=new Error("The socket was closed while data was being compressed");typeof f=="function"&&f(g);for(let y=0;y<this._queue.length;y++){const x=this._queue[y],w=x[x.length-1];typeof w=="function"&&w(g)}return}this._bufferedBytes-=o[J],this._deflating=!1,o.readOnly=!1,this.sendFrame(fe.frame(l,o),f),this.dequeue()})}dequeue(){for(;!this._deflating&&this._queue.length;){const r=this._queue.shift();this._bufferedBytes-=r[3][J],Reflect.apply(r[0],this,r.slice(1))}}enqueue(r){this._bufferedBytes+=r[3][J],this._queue.push(r)}sendFrame(r,n){r.length===2?(this._socket.cork(),this._socket.write(r[0]),this._socket.write(r[1],n),this._socket.uncork()):this._socket.write(r[0],n)}};var or=vn;const _i=be(or),{kForOnEventAttribute:ge,kListener:ot}=le,Dt=Symbol("kCode"),$t=Symbol("kData"),Wt=Symbol("kError"),jt=Symbol("kMessage"),Gt=Symbol("kReason"),pe=Symbol("kTarget"),Vt=Symbol("kType"),qt=Symbol("kWasClean");class ce{constructor(r){this[pe]=null,this[Vt]=r}get target(){return this[pe]}get type(){return this[Vt]}}Object.defineProperty(ce.prototype,"target",{enumerable:!0});Object.defineProperty(ce.prototype,"type",{enumerable:!0});class ke extends ce{constructor(r,n={}){super(r),this[Dt]=n.code===void 0?0:n.code,this[Gt]=n.reason===void 0?"":n.reason,this[qt]=n.wasClean===void 0?!1:n.wasClean}get code(){return this[Dt]}get reason(){return this[Gt]}get wasClean(){return this[qt]}}Object.defineProperty(ke.prototype,"code",{enumerable:!0});Object.defineProperty(ke.prototype,"reason",{enumerable:!0});Object.defineProperty(ke.prototype,"wasClean",{enumerable:!0});class ze extends ce{constructor(r,n={}){super(r),this[Wt]=n.error===void 0?null:n.error,this[jt]=n.message===void 0?"":n.message}get error(){return this[Wt]}get message(){return this[jt]}}Object.defineProperty(ze.prototype,"error",{enumerable:!0});Object.defineProperty(ze.prototype,"message",{enumerable:!0});class dt extends ce{constructor(r,n={}){super(r),this[$t]=n.data===void 0?null:n.data}get data(){return this[$t]}}Object.defineProperty(dt.prototype,"data",{enumerable:!0});const gn={addEventListener(i,r,n={}){for(const f of this.listeners(i))if(!n[ge]&&f[ot]===r&&!f[ge])return;let o;if(i==="message")o=function(u,h){const l=new dt("message",{data:h?u:u.toString()});l[pe]=this,Me(r,this,l)};
vendor: 4,227 bytes, line 8
8else if(i==="close")o=function(u,h){const l=new ke("close",{code:u,reason:h.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});l[pe]=this,Me(r,this,l)};else if(i==="error")o=function(u){const h=new ze("error",{error:u,message:u.message});h[pe]=this,Me(r,this,h)};else if(i==="open")o=function(){const u=new ce("open");u[pe]=this,Me(r,this,u)};else return;o[ge]=!!n[ge],o[ot]=r,n.once?this.once(i,o):this.on(i,o)},removeEventListener(i,r){for(const n of this.listeners(i))if(n[ot]===r&&!n[ge]){this.removeListener(i,n);break}}};var wn={CloseEvent:ke,ErrorEvent:ze,Event:ce,EventTarget:gn,MessageEvent:dt};function Me(i,r,n){typeof i=="object"&&i.handleEvent?i.handleEvent.call(i,n):i.call(r,n)}const{tokenChars:we}=Ye;function ee(i,r,n){i[r]===void 0?i[r]=[n]:i[r].push(n)}function En(i){const r=Object.create(null);let n=Object.create(null),o=!1,f=!1,u=!1,h,l,g=-1,y=-1,x=-1,w=0;for(;w<i.length;w++)if(y=i.charCodeAt(w),h===void 0)if(x===-1&&we[y]===1)g===-1&&(g=w);else if(w!==0&&(y===32||y===9))x===-1&&g!==-1&&(x=w);else if(y===59||y===44){if(g===-1)throw new SyntaxError(`Unexpected character at index ${w}`);x===-1&&(x=w);const E=i.slice(g,x);y===44?(ee(r,E,n),n=Object.create(null)):h=E,g=x=-1}else throw new SyntaxError(`Unexpected character at index ${w}`);else if(l===void 0)if(x===-1&&we[y]===1)g===-1&&(g=w);else if(y===32||y===9)x===-1&&g!==-1&&(x=w);else if(y===59||y===44){if(g===-1)throw new SyntaxError(`Unexpected character at index ${w}`);x===-1&&(x=w),ee(n,i.slice(g,x),!0),y===44&&(ee(r,h,n),n=Object.create(null),h=void 0),g=x=-1}else if(y===61&&g!==-1&&x===-1)l=i.slice(g,w),g=x=-1;else throw new SyntaxError(`Unexpected character at index ${w}`);else if(f){if(we[y]!==1)throw new SyntaxError(`Unexpected character at index ${w}`);g===-1?g=w:o||(o=!0),f=!1}else if(u)if(we[y]===1)g===-1&&(g=w);else if(y===34&&g!==-1)u=!1,x=w;else if(y===92)f=!0;else throw new SyntaxError(`Unexpected character at index ${w}`);else if(y===34&&i.charCodeAt(w-1)===61)u=!0;else if(x===-1&&we[y]===1)g===-1&&(g=w);else if(g!==-1&&(y===32||y===9))x===-1&&(x=w);else if(y===59||y===44){if(g===-1)throw new SyntaxError(`Unexpected character at index ${w}`);x===-1&&(x=w);let E=i.slice(g,x);o&&(E=E.replace(/\\/g,""),o=!1),ee(n,l,E),y===44&&(ee(r,h,n),n=Object.create(null),h=void 0),l=void 0,g=x=-1}else throw new SyntaxError(`Unexpected character at index ${w}`);if(g===-1||u||y===32||y===9)throw new SyntaxError("Unexpected end of input");x===-1&&(x=w);const O=i.slice(g,x);return h===void 0?ee(r,O,n):(l===void 0?ee(n,O,!0):o?ee(n,l,O.replace(/\\/g,"")):ee(n,l,O),ee(r,h,n)),r}function xn(i){return Object.keys(i).map(r=>{let n=i[r];return Array.isArray(n)||(n=[n]),n.map(o=>[r].concat(Object.keys(o).map(f=>{let u=o[f];return Array.isArray(u)||(u=[u]),u.map(h=>h===!0?f:`${f}=${h}`).join("; ")})).join("; ")).join(", ")}).join(", ")}var ar={format:xn,parse:En};const Sn=Qt,bn=X,kn=X,fr=X,Ln=X,{randomBytes:Tn,createHash:Cn}=X,{URL:at}=X,oe=He,Bn=sr,On=or,{BINARY_TYPES:Ht,EMPTY_BUFFER:Pe,GUID:Fn,kForOnEventAttribute:ft,kListener:Un,kStatusCode:Nn,kWebSocket:K,NOOP:ur}=le,{EventTarget:{addEventListener:An,removeEventListener:In}}=wn,{format:Rn,parse:Mn}=ar,{toBuffer:Pn}=qe,Dn=30*1e3,lr=Symbol("kAborted"),ut=[8,13],ie=["CONNECTING","OPEN","CLOSING","CLOSED"],$n=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;let q=class W extends Sn{constructor(r,n,o){super(),this._binaryType=Ht[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Pe,this._closeTimer=null,this._extensions={},this._paused=!1,this._protocol="",this._readyState=W.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,r!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,n===void 0?n=[]:Array.isArray(n)||(typeof n=="object"&&n!==null?(o=n,n=[]):n=[n]),hr(this,r,n,o)):this._isServer=!0}get binaryType(){return this._binaryType}set binaryType(r){Ht.includes(r)&&(this._binaryType=r,this._receiver&&(this._receiver._binaryType=r))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}
8get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(r,n,o){const f=new Bn({binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:o.maxPayload,skipUTF8Validation:o.skipUTF8Validation});this._sender=new On(r,this._extensions,o.generateMask),this._receiver=f,this._socket=r,f[K]=this,r[K]=this,f.on("conclude",Gn),f.on("drain",Vn),f.on("error",qn),f.on("message",Hn),f.on("ping",Yn),f.on("pong",zn),r.setTimeout(0),r.setNoDelay(),n.length>0&&r.unshift(n),r.on("close",dr),r.on("data",Ke),r.on("end",_r),r.on("error",mr),this._readyState=W.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=W.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[oe.extensionName]&&this._extensions[oe.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=W.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(r,n){if(this.readyState!==W.CLOSED){if(this.readyState===W.CONNECTING){Z(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===W.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=W.CLOSING,this._sender.close(r,n,!this._isServer,o=>{o||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),Dn)}}pause(){this.readyState===W.CONNECTING||this.readyState===W.CLOSED||(this._paused=!0,this._socket.pause())}ping(r,n,o){if(this.readyState===W.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"?(o=r,r=n=void 0):typeof n=="function"&&(o=n,n=void 0),typeof r=="number"&&(r=r.toString()),this.readyState!==W.OPEN){lt(this,r,o);return}n===void 0&&(n=!this._isServer),this._sender.ping(r||Pe,n,o)}pong(r,n,o){if(this.readyState===W.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof r=="function"?(o=r,r=n=void 0):typeof n=="function"&&(o=n,n=void 0),typeof r=="number"&&(r=r.toString()),this.readyState!==W.OPEN){lt(this,r,o);return}n===void 0&&(n=!this._isServer),this._sender.pong(r||Pe,n,o)}resume(){this.readyState===W.CONNECTING||this.readyState===W.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(r,n,o){if(this.readyState===W.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof n=="function"&&(o=n,n={}),typeof r=="number"&&(r=r.toString()),this.readyState!==W.OPEN){lt(this,r,o);return}const f={binary:typeof r!="string",mask:!this._isServer,compress:!0,fin:!0,...n};this._extensions[oe.extensionName]||(f.compress=!1),this._sender.send(r||Pe,f,o)}terminate(){if(this.readyState!==W.CLOSED){if(this.readyState===W.CONNECTING){Z(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=W.CLOSING,this._socket.destroy())}}};Object.defineProperty(q,"CONNECTING",{enumerable:!0,value:ie.indexOf("CONNECTING")});Object.defineProperty(q.prototype,"CONNECTING",{enumerable:!0,value:ie.indexOf("CONNECTING")});Object.defineProperty(q,"OPEN",{enumerable:!0,value:ie.indexOf("OPEN")});Object.defineProperty(q.prototype,"OPEN",{enumerable:!0,value:ie.indexOf("OPEN")});Object.defineProperty(q,"CLOSING",{enumerable:!0,value:ie.indexOf("CLOSING")});Object.defineProperty(q.prototype,"CLOSING",{enumerable:!0,value:ie.indexOf("CLOSING")});Object.defineProperty(q,"CLOSED",{enumerable:!0,value:ie.indexOf("CLOSED")});Object.defineProperty(q.prototype,"CLOSED",{enumerable:!0,value:ie.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(i=>{Object.defineProperty(q.prototype,i,{enumerable:!0})});["open","error","close","message"].forEach(i=>{Object.defineProperty(q.prototype,`on${i}`,{enumerable:!0,get(){for(const r of this.listeners(i))if(r[ft])return r[Un];return null},set(r){for(const n of this.listeners(i))if(n[ft]){this.removeListener(i,n);break}typeof r=="function"&&this.addEventListener(i,r,{[ft]:!0})}})});q.prototype.addEventListener=An;q.prototype.removeEventListener=In;var cr=q;function hr(i,r,n,o){const f={protocolVersion:ut[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...o,createConnection:void 0,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(!ut.includes(f.protocolVersion))throw new RangeError(`Unsupported protocol version: ${f.protocolVersion} (supported versions: ${ut.join(", ")})`);let u;if(r instanceof at)u=r,i._url=r.href;else{try{u=new at(r)}catch{throw new SyntaxError(`Invalid URL: ${r}`)}i._url=r}const h=u.protocol==="wss:",l=u.protocol==="ws+unix:";let g;if(u.protocol!=="ws:"&&!h&&!l?g=`The URL's protocol must be one of "ws:", "wss:", or "ws+unix:"`:l&&!u.pathname?g="The URL's pathname is empty":u.hash&&(g="The URL contains a fragment identifier"),g){const S=new SyntaxError(g);if(i._redirects===0)throw S;$e(i,S);return}const y=h?443:80,x=Tn(16).toString("base64"),w=h?bn.request:kn.request,O=new Set;let E;if(f.createConnection=h?jn:Wn,f.defaultPort=f.defaultPort||y,f.port=u.port||y,f.host=u.hostname.startsWith("[")?u.hostname.slice(1,-1):u.hostname,f.headers={...f.headers,"Sec-WebSocket-Version":f.protocolVersion,"Sec-WebSocket-Key":x,Connection:"Upgrade",
8Upgrade:"websocket"},f.path=u.pathname+u.search,f.timeout=f.handshakeTimeout,f.perMessageDeflate&&(E=new oe(f.perMessageDeflate!==!0?f.perMessageDeflate:{},!1,f.maxPayload),f.headers["Sec-WebSocket-Extensions"]=Rn({[oe.extensionName]:E.offer()})),n.length){for(const S of n){if(typeof S!="string"||!$n.test(S)||O.has(S))throw new SyntaxError("An invalid or duplicated subprotocol was specified");O.add(S)}f.headers["Sec-WebSocket-Protocol"]=n.join(",")}if(f.origin&&(f.protocolVersion<13?f.headers["Sec-WebSocket-Origin"]=f.origin:f.headers.Origin=f.origin),(u.username||u.password)&&(f.auth=`${u.username}:${u.password}`),l){const S=f.path.split(":");f.socketPath=S[0],f.path=S[1]}let b;if(f.followRedirects){if(i._redirects===0){i._originalIpc=l,i._originalSecure=h,i._originalHostOrSocketPath=l?f.socketPath:u.host;const S=o&&o.headers;if(o={...o,headers:{}},S)for(const[B,R]of Object.entries(S))o.headers[B.toLowerCase()]=R}else if(i.listenerCount("redirect")===0){const S=l?i._originalIpc?f.socketPath===i._originalHostOrSocketPath:!1:i._originalIpc?!1:u.host===i._originalHostOrSocketPath;(!S||i._originalSecure&&!h)&&(delete f.headers.authorization,delete f.headers.cookie,S||delete f.headers.host,f.auth=void 0)}f.auth&&!o.headers.authorization&&(o.headers.authorization="Basic "+Buffer.from(f.auth).toString("base64")),b=i._req=w(f),i._redirects&&i.emit("redirect",i.url,b)}else b=i._req=w(f);f.timeout&&b.on("timeout",()=>{Z(i,b,"Opening handshake has timed out")}),b.on("error",S=>{b===null||b[lr]||(b=i._req=null,$e(i,S))}),b.on("response",S=>{const B=S.headers.location,R=S.statusCode;if(B&&f.followRedirects&&R>=300&&R<400){if(++i._redirects>f.maxRedirects){Z(i,b,"Maximum redirects exceeded");return}b.abort();let I;try{I=new at(B,r)}catch{const _=new SyntaxError(`Invalid URL: ${B}`);$e(i,_);return}hr(i,I,n,o)}else i.emit("unexpected-response",b,S)||Z(i,b,`Unexpected server response: ${S.statusCode}`)}),b.on("upgrade",(S,B,R)=>{if(i.emit("upgrade",S),i.readyState!==q.CONNECTING)return;if(b=i._req=null,S.headers.upgrade.toLowerCase()!=="websocket"){Z(i,B,"Invalid Upgrade header");return}const I=Cn("sha1").update(x+Fn).digest("base64");if(S.headers["sec-websocket-accept"]!==I){Z(i,B,"Invalid Sec-WebSocket-Accept header");return}const M=S.headers["sec-websocket-protocol"];let _;if(M!==void 0?O.size?O.has(M)||(_="Server sent an invalid subprotocol"):_="Server sent a subprotocol but none was requested":O.size&&(_="Server sent no subprotocol"),_){Z(i,B,_);return}M&&(i._protocol=M);const p=S.headers["sec-websocket-extensions"];if(p!==void 0){if(!E){Z(i,B,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let v;try{v=Mn(p)}catch{Z(i,B,"Invalid Sec-WebSocket-Extensions header");return}const k=Object.keys(v);if(k.length!==1||k[0]!==oe.extensionName){Z(i,B,"Server indicated an extension that was not requested");return}try{E.accept(v[oe.extensionName])}catch{Z(i,B,"Invalid Sec-WebSocket-Extensions header");return}i._extensions[oe.extensionName]=E}i.setSocket(B,R,{generateMask:f.generateMask,maxPayload:f.maxPayload,skipUTF8Validation:f.skipUTF8Validation})}),f.finishRequest?f.finishRequest(b,i):b.end()}function $e(i,r){i._readyState=q.CLOSING,i.emit("error",r),i.emitClose()}function Wn(i){return i.path=i.socketPath,fr.connect(i)}function jn(i){return i.path=void 0,!i.servername&&i.servername!==""&&(i.servername=fr.isIP(i.host)?"":i.host),Ln.connect(i)}function Z(i,r,n){i._readyState=q.CLOSING;const o=new Error(n);Error.captureStackTrace(o,Z),r.setHeader?(r[lr]=!0,r.abort(),r.socket&&!r.socket.destroyed&&r.socket.destroy(),process.nextTick($e,i,o)):(r.destroy(o),r.once("error",i.emit.bind(i,"error")),r.once("close",i.emitClose.bind(i)))}function lt(i,r,n){if(r){const o=Pn(r).length;i._socket?i._sender._bufferedBytes+=o:i._bufferedAmount+=o}if(n){const o=new Error(`WebSocket is not open: readyState ${i.readyState} (${ie[i.readyState]})`);process.nextTick(n,o)}}function Gn(i,r){const n=this[K];n._closeFrameReceived=!0,n._closeMessage=r,n._closeCode=i,n._socket[K]!==void 0&&(n._socket.removeListener("data",Ke),process.nextTick(pr,n._socket),i===1005?n.close():n.close(i,r))}function Vn(){const i=this[K];i.isPaused||i._socket.resume()}function qn(i){const r=this[K];r._socket[K]!==void 0&&(r._socket.removeListener("data",Ke),process.nextTick(pr,r._socket),r.close(i[Nn])),r.emit("error",i)}function Yt(){this[K].emitClose()}function Hn(i,r){this[K].emit("message",i,r)}function Yn(i){const r=this[K];r.pong(i,!r._isServer,ur),r.emit("ping",i)}function zn(i){this[K].emit("pong",i)}function pr(i){i.resume()}function dr(){const i=this[K];this.removeListener("close",dr),this.removeListener("data",Ke),this.removeListener("end",_r),i._readyState=q.CLOSING;let r;!this._readableState.endEmitted&&!i._closeFrameReceived&&!i._receiver._writableState.errorEmitted&&(r=i._socket.read())!==null&&i._receiver.write(r),i._receiver.end(),this[K]=void 0,clearTimeout(i._closeTimer),i._receiver._writableState.finished||i._receiver._writableState.errorEmitted?i.emitClose():(i._receiver.on("error",Yt),i._receiver.on("finish",Yt))}function Ke(i){this[K]._receiver.write(i)||this.pause()}function _r(){const i=this[K];i._readyState=q.CLOSING,i._receiver.end(),this.end()}function mr(){const i=this[K];this.removeListener("error",mr),this.on("error",ur),i&&(i._readyState=q.CLOSING,this.destroy())}const mi=be(cr),{tokenChars:Kn}=Ye;function Xn(i){const r=new Set;let n=-1,o=-1,f=0;for(f;f<i.length;f++){const h=i.charCodeAt(f);if(o===-1&&Kn[h]===1)n===-1&&(n=f);else if(f!==0&&(h===32||h===9))o===-1&&n!==-1&&(o=f);else if(h===44){if(n===-1)throw new SyntaxError(`Unexpected character at index ${f}`);o===-1&&(o=f);const l=i.slice(n,o);if(r.has(l))throw new SyntaxError(`The "${l}" subprotocol is duplicated`);r.add(l),n=o=-1}else throw new SyntaxError(`Unexpected character at index ${f}`)}if(n===-1||o!==-1)throw new SyntaxError("Unexpected end of input");const u=i.slice(n,f);if(r.has(u))throw new SyntaxError(`The "${u}" subprotocol is duplicated`);return r.add(u),r}var Zn={parse:Xn};const Jn=Qt,Ve=X,{createHash:Qn}=X,zt=ar,ae=He,ei=Zn,ti=cr,{GUID:ri,kWebSocket:ni}=le,ii=/^[+/0-9A-Za-z]{22}==$/,Kt=0,Xt=1,yr=2;class si extends Jn{constructor(r,n){if(super(),r={maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:ti,...r},r.port==null&&!r.server&&!r.noServer||r.port!=null&&(r.server||r.n
8oServer)||r.server&&r.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(r.port!=null?(this._server=Ve.createServer((o,f)=>{const u=Ve.STATUS_CODES[426];f.writeHead(426,{"Content-Length":u.length,"Content-Type":"text/plain"}),f.end(u)}),this._server.listen(r.port,r.host,r.backlog,n)):r.server&&(this._server=r.server),this._server){const o=this.emit.bind(this,"connection");this._removeListeners=ai(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(f,u,h)=>{this.handleUpgrade(f,u,h,o)}})}r.perMessageDeflate===!0&&(r.perMessageDeflate={}),r.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=r,this._state=Kt}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(r){if(this._state===yr){r&&this.once("close",()=>{r(new Error("The server is not running"))}),process.nextTick(Ee,this);return}if(r&&this.once("close",r),this._state!==Xt)if(this._state=Xt,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients?this.clients.size?this._shouldEmitClose=!0:process.nextTick(Ee,this):process.nextTick(Ee,this);else{const n=this._server;this._removeListeners(),this._removeListeners=this._server=null,n.close(()=>{Ee(this)})}}shouldHandle(r){if(this.options.path){const n=r.url.indexOf("?");if((n!==-1?r.url.slice(0,n):r.url)!==this.options.path)return!1}return!0}handleUpgrade(r,n,o,f){n.on("error",Zt);const u=r.headers["sec-websocket-key"],h=+r.headers["sec-websocket-version"];if(r.method!=="GET"){ue(this,r,n,405,"Invalid HTTP method");return}if(r.headers.upgrade.toLowerCase()!=="websocket"){ue(this,r,n,400,"Invalid Upgrade header");return}if(!u||!ii.test(u)){ue(this,r,n,400,"Missing or invalid Sec-WebSocket-Key header");return}if(h!==8&&h!==13){ue(this,r,n,400,"Missing or invalid Sec-WebSocket-Version header");return}if(!this.shouldHandle(r)){Se(n,400);return}const l=r.headers["sec-websocket-protocol"];let g=new Set;if(l!==void 0)try{g=ei.parse(l)}catch{ue(this,r,n,400,"Invalid Sec-WebSocket-Protocol header");return}const y=r.headers["sec-websocket-extensions"],x={};if(this.options.perMessageDeflate&&y!==void 0){const w=new ae(this.options.perMessageDeflate,!0,this.options.maxPayload);try{const O=zt.parse(y);O[ae.extensionName]&&(w.accept(O[ae.extensionName]),x[ae.extensionName]=w)}catch{ue(this,r,n,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){const w={origin:r.headers[`${h===8?"sec-websocket-origin":"origin"}`],secure:!!(r.socket.authorized||r.socket.encrypted),req:r};if(this.options.verifyClient.length===2){this.options.verifyClient(w,(O,E,b,S)=>{if(!O)return Se(n,E||401,b,S);this.completeUpgrade(x,u,g,r,n,o,f)});return}if(!this.options.verifyClient(w))return Se(n,401)}this.completeUpgrade(x,u,g,r,n,o,f)}completeUpgrade(r,n,o,f,u,h,l){if(!u.readable||!u.writable)return u.destroy();if(u[ni])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Kt)return Se(u,503);const y=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${Qn("sha1").update(n+ri).digest("base64")}`],x=new this.options.WebSocket(null);if(o.size){const w=this.options.handleProtocols?this.options.handleProtocols(o,f):o.values().next().value;w&&(y.push(`Sec-WebSocket-Protocol: ${w}`),x._protocol=w)}if(r[ae.extensionName]){const w=r[ae.extensionName].params,O=zt.format({[ae.extensionName]:[w]});y.push(`Sec-WebSocket-Extensions: ${O}`),x._extensions=r}this.emit("headers",y,f),u.write(y.concat(`\r 9`).join(`\r 10`)),u.removeListener("error",Zt),x.setSocket(u,h,{maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(x),x.on("close",()=>{this.clients.delete(x),this._shouldEmitClose&&!this.clients.size&&process.nextTick(Ee,this)})),l(x,f)}}var oi=si;function ai(i,r){for(const n of Object.keys(r))i.on(n,r[n]);return function(){for(const o of Object.keys(r))i.removeListener(o,r[o])}}function Ee(i){i._state=yr,i.emit("close")}function Zt(){this.destroy()}function Se(i,r,n,o){n=n||Ve.STATUS_CODES[r],o={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(n),...o},i.once("finish",i.destroy),i.end(`HTTP/1.1 ${r} ${Ve.STATUS_CODES[r]}\r 11`+Object.keys(o).map(f=>`${f}: ${o[f]}`).join(`\r 12`)+`\r 13\r 14`+n)}function ue(i,r,n,o,f){if(i.listenerCount("wsClientError")){const u=new Error(f);Error.captureStackTrace(u,ue),i.emit("wsClientError",u,n,r)}else Se(n,o,f)}const yi=be(oi);export{di as Receiver,_i as Sender,mi as WebSocket,yi as WebSocketServer,li as createWebSocketStream,mi as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.