lensmcp 1.21.5 → 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundled/bridge.js +7 -7
- package/bundled/capture-runner.js +28 -28
- package/bundled/cluster-app.js +4 -4
- package/bundled/dashboard.js +44 -37
- package/bundled/main.js +27 -27
- package/lib/cli.js +26 -16
- package/lib/hook-memory.js +1 -1
- package/lib/process-identity.d.ts +24 -0
- package/lib/process-identity.js +1 -0
- package/package.json +4 -4
- package/plugin/.claude-plugin/plugin.json +1 -1
- package/plugins/lensmcp/.codex-plugin/plugin.json +1 -1
package/bundled/bridge.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";var Nt=Object.defineProperty;var f=(e,s)=>Nt(e,"name",{value:s,configurable:!0});import{createRequire as Lt}from"module";const ue=Lt(import.meta.url);var Pt=Object.create,Ae=Object.defineProperty,Bt=Object.getOwnPropertyDescriptor,It=Object.getOwnPropertyNames,Rt=Object.getPrototypeOf,Ut=Object.prototype.hasOwnProperty,c=f((e,s)=>Ae(e,"name",{value:s,configurable:!0}),"o"),q=(e=>typeof ue<"u"?ue:typeof Proxy<"u"?new Proxy(e,{get:f((s,r)=>(typeof ue<"u"?ue:s)[r],"get")}):e)(function(e){if(typeof ue<"u")return ue.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),X=f((e,s)=>()=>(s||e((s={exports:{}}).exports,s),s.exports),"E"),$t=f((e,s,r,n)=>{if(s&&typeof s=="object"||typeof s=="function")for(let u of It(s))!Ut.call(e,u)&&u!==r&&Ae(e,u,{get:f(()=>s[u],"get"),enumerable:!(n=Bt(s,u))||n.enumerable});return e},"Lr"),se=f((e,s,r)=>(r=e!=null?Pt(Rt(e)):{},$t(s||!e||!e.__esModule?Ae(r,"default",{value:e,enumerable:!0}):r,e)),"D"),ie=X((e,s)=>{"use strict";var r=["nodebuffer","arraybuffer","fragments"],n=typeof Blob<"u";n&&r.push("blob"),s.exports={BINARY_TYPES:r,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:n,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:c(()=>{},"NOOP")}}),Te=X((e,s)=>{"use strict";var{EMPTY_BUFFER:r}=ie(),n=Buffer[Symbol.species];function u(p,v){if(p.length===0)return r;if(p.length===1)return p[0];let k=Buffer.allocUnsafe(v),w=0;for(let N=0;N<p.length;N++){let E=p[N];k.set(E,w),w+=E.length}return w<v?new n(k.buffer,k.byteOffset,w):k}f(u,"Ar"),c(u,"concat");function y(p,v,k,w,N){for(let E=0;E<N;E++)k[w+E]=p[E]^v[E&3]}f(y,"_t"),c(y,"_mask");function m(p,v){for(let k=0;k<p.length;k++)p[k]^=v[k&3]}f(m,"gt"),c(m,"_unmask");function x(p){return p.length===p.buffer.byteLength?p.buffer:p.buffer.slice(p.byteOffset,p.byteOffset+p.length)}f(x,"Rr"),c(x,"toArrayBuffer");function o(p){if(o.readOnly=!0,Buffer.isBuffer(p))return p;let v;return p instanceof ArrayBuffer?v=new n(p):ArrayBuffer.isView(p)?v=new n(p.buffer,p.byteOffset,p.byteLength):(v=Buffer.from(p),o.readOnly=!1),v}if(f(o,"Pe"),c(o,"toBuffer"),s.exports={concat:u,mask:y,toArrayBuffer:x,toBuffer:o,unmask:m},!process.env.WS_NO_BUFFER_UTIL)try{let p=q("bufferutil");s.exports.mask=function(v,k,w,N,E){E<48?y(v,k,w,N,E):p.mask(v,k,w,N,E)},s.exports.unmask=function(v,k){v.length<32?m(v,k):p.unmask(v,k)}}catch{}}),Mt=X((e,s)=>{"use strict";var r=Symbol("kDone"),n=Symbol("kRun"),u=class{static{f(this,"Ue")}static{c(this,"Limiter")}constructor(y){this[r]=()=>{this.pending--,this[n]()},this.concurrency=y||1/0,this.jobs=[],this.pending=0}add(y){this.jobs.push(y),this[n]()}[n](){if(this.pending!==this.concurrency&&this.jobs.length){let y=this.jobs.shift();this.pending++,y(this[r])}}};s.exports=u}),Se=X((e,s)=>{"use strict";var r=q("zlib"),n=Te(),u=Mt(),{kStatusCode:y}=ie(),m=Buffer[Symbol.species],x=Buffer.from([0,0,255,255]),o=Symbol("permessage-deflate"),p=Symbol("total-length"),v=Symbol("callback"),k=Symbol("buffers"),w=Symbol("error"),N,E=class{static{f(this,"$e")}static{c(this,"PerMessageDeflate")}constructor(d){if(this._options=d||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!N){let b=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;N=new u(b)}}static get extensionName(){return"permessage-deflate"}offer(){let d={};return this._options.serverNoContextTakeover&&(d.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(d.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(d.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?d.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(d.client_max_window_bits=!0),d}accept(d){return d=this.normalizeParams(d),this.params=this._isServer?this.acceptAsServer(d):this.acceptAsClient(d),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let d=this._deflate[v];this._deflate.close(),this._deflate=null,d&&d(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(d){let b=this._options,T=d.find(P=>!(b.serverNoContextTakeover===!1&&P.server_no_context_takeover||P.server_max_window_bits&&(b.serverMaxWindowBits===!1||typeof b.serverMaxWindowBits=="number"&&b.serverMaxWindowBits>P.server_max_window_bits)||typeof b.clientMaxWindowBits=="number"&&!P.client_max_window_bits));if(!T)throw new Error("None of the extension offers can be accepted");return b.serverNoContextTakeover&&(T.server_no_context_takeover=!0),b.clientNoContextTakeover&&(T.client_no_context_takeover=!0),typeof b.serverMaxWindowBits=="number"&&(T.server_max_window_bits=b.serverMaxWindowBits),typeof b.clientMaxWindowBits=="number"?T.client_max_window_bits=b.clientMaxWindowBits:(T.client_max_window_bits===!0||b.clientMaxWindowBits===!1)&&delete T.client_max_window_bits,T}acceptAsClient(d){let b=d[0];if(this._options.clientNoContextTakeover===!1&&b.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!b.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(b.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&b.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return b}normalizeParams(d){return d.forEach(b=>{Object.keys(b).forEach(T=>{let P=b[T];if(P.length>1)throw new Error(`Parameter "${T}" must have only a single value`);if(P=P[0],T==="client_max_window_bits"){if(P!==!0){let a=+P;if(!Number.isInteger(a)||a<8||a>15)throw new TypeError(`Invalid value for parameter "${T}": ${P}`);P=a}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${T}": ${P}`)}else if(T==="server_max_window_bits"){let a=+P;if(!Number.isInteger(a)||a<8||a>15)throw new TypeError(`Invalid value for parameter "${T}": ${P}`);P=a}else if(T==="client_no_context_takeover"||T==="server_no_context_takeover"){if(P!==!0)throw new TypeError(`Invalid value for parameter "${T}": ${P}`)}else throw new Error(`Unknown parameter "${T}"`);b[T]=P})}),d}decompress(d,b,T){N.add(P=>{this._decompress(d,b,(a,i)=>{P(),T(a,i)})})}compress(d,b,T){N.add(P=>{this._compress(d,b,(a,i)=>{P(),T(a,i)})})}_decompress(d,b,T){let P=this._isServer?"client":"server";if(!this._inflate){let a=`${P}_max_window_bits`,i=typeof this.params[a]!="number"?r.Z_DEFAULT_WINDOWBITS:this.params[a];this._inflate=r.createInflateRaw({...this._options.zlibInflateOptions,windowBits:i}),this._inflate[o]=this,this._inflate[p]=0,this._inflate[k]=[],this._inflate.on("error",I),this._inflate.on("data",B)}this._inflate[v]=T,this._inflate.write(d),b&&this._inflate.write(x),this._inflate.flush(()=>{let a=this._inflate[w];if(a){this._inflate.close(),this._inflate=null,T(a);return}let i=n.concat(this._inflate[k],this._inflate[p]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[p]=0,this._inflate[k]=[],b&&this.params[`${P}_no_context_takeover`]&&this._inflate.reset()),T(null,i)})}_compress(d,b,T){let P=this._isServer?"server":"client";if(!this._deflate){let a=`${P}_max_window_bits`,i=typeof this.params[a]!="number"?r.Z_DEFAULT_WINDOWBITS:this.params[a];this._deflate=r.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:i}),this._deflate[p]=0,this._deflate[k]=[],this._deflate.on("data",R)}this._deflate[v]=T,this._deflate.write(d),this._deflate.flush(r.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let a=n.concat(this._deflate[k],this._deflate[p]);b&&(a=new m(a.buffer,a.byteOffset,a.length-4)),this._deflate[v]=null,this._deflate[p]=0,this._deflate[k]=[],b&&this.params[`${P}_no_context_takeover`]&&this._deflate.reset(),T(null,a)})}};s.exports=E;function R(d){this[k].push(d),this[p]+=d.length}f(R,"Dr"),c(R,"deflateOnData");function B(d){if(this[p]+=d.length,this[o]._maxPayload<1||this[p]<=this[o]._maxPayload){this[k].push(d);return}this[w]=new RangeError("Max payload size exceeded"),this[w].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[w][y]=1009,this.removeListener("data",B),this.reset()}f(B,"wt"),c(B,"inflateOnData");function I(d){if(this[o]._inflate=null,this[w]){this[v](this[w]);return}d[y]=1007,this[v](d)}f(I,"Ur"),c(I,"inflateOnError")}),Ee=X((e,s)=>{"use strict";var{isUtf8:r}=q("buffer"),{hasBlob:n}=ie(),u=[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 y(o){return o>=1e3&&o<=1014&&o!==1004&&o!==1005&&o!==1006||o>=3e3&&o<=4999}f(y,"Wr"),c(y,"isValidStatusCode");function m(o){let p=o.length,v=0;for(;v<p;)if((o[v]&128)===0)v++;else if((o[v]&224)===192){if(v+1===p||(o[v+1]&192)!==128||(o[v]&254)===192)return!1;v+=2}else if((o[v]&240)===224){if(v+2>=p||(o[v+1]&192)!==128||(o[v+2]&192)!==128||o[v]===224&&(o[v+1]&224)===128||o[v]===237&&(o[v+1]&224)===160)return!1;v+=3}else if((o[v]&248)===240){if(v+3>=p||(o[v+1]&192)!==128||(o[v+2]&192)!==128||(o[v+3]&192)!==128||o[v]===240&&(o[v+1]&240)===128||o[v]===244&&o[v+1]>143||o[v]>244)return!1;v+=4}else return!1;return!0}f(m,"Fe"),c(m,"_isValidUTF8");function x(o){return n&&typeof o=="object"&&typeof o.arrayBuffer=="function"&&typeof o.type=="string"&&typeof o.stream=="function"&&(o[Symbol.toStringTag]==="Blob"||o[Symbol.toStringTag]==="File")}if(f(x,"qr"),c(x,"isBlob"),s.exports={isBlob:x,isValidStatusCode:y,isValidUTF8:m,tokenChars:u},r)s.exports.isValidUTF8=function(o){return o.length<24?m(o):r(o)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let o=q("utf-8-validate");s.exports.isValidUTF8=function(p){return p.length<32?m(p):o(p)}}catch{}}),nt=X((e,s)=>{"use strict";var{Writable:r}=q("stream"),n=Se(),{BINARY_TYPES:u,EMPTY_BUFFER:y,kStatusCode:m,kWebSocket:x}=ie(),{concat:o,toArrayBuffer:p,unmask:v}=Te(),{isValidStatusCode:k,isValidUTF8:w}=Ee(),N=Buffer[Symbol.species],E=0,R=1,B=2,I=3,d=4,b=5,T=6,P=class extends r{static{f(this,"je")}static{c(this,"Receiver")}constructor(a={}){super(),this._allowSynchronousEvents=a.allowSynchronousEvents!==void 0?a.allowSynchronousEvents:!0,this._binaryType=a.binaryType||u[0],this._extensions=a.extensions||{},this._isServer=!!a.isServer,this._maxBufferedChunks=a.maxBufferedChunks|0,this._maxFragments=a.maxFragments|0,this._maxPayload=a.maxPayload|0,this._skipUTF8Validation=!!a.skipUTF8Validation,this[x]=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._errored=!1,this._loop=!1,this._state=E}_write(a,i,_){if(this._opcode===8&&this._state==E)return _();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){_(this.createError(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=a.length,this._buffers.push(a),this.startLoop(_)}consume(a){if(this._bufferedBytes-=a,a===this._buffers[0].length)return this._buffers.shift();if(a<this._buffers[0].length){let _=this._buffers[0];return this._buffers[0]=new N(_.buffer,_.byteOffset+a,_.length-a),new N(_.buffer,_.byteOffset,a)}let i=Buffer.allocUnsafe(a);do{let _=this._buffers[0],t=i.length-a;a>=_.length?i.set(this._buffers.shift(),t):(i.set(new Uint8Array(_.buffer,_.byteOffset,a),t),this._buffers[0]=new N(_.buffer,_.byteOffset+a,_.length-a)),a-=_.length}while(a>0);return i}startLoop(a){this._loop=!0;do switch(this._state){case E:this.getInfo(a);break;case R:this.getPayloadLength16(a);break;case B:this.getPayloadLength64(a);break;case I:this.getMask();break;case d:this.getData(a);break;case b:case T:this._loop=!1;return}while(this._loop);this._errored||a()}getInfo(a){if(this._bufferedBytes<2){this._loop=!1;return}let i=this.consume(2);if((i[0]&48)!==0){let t=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");a(t);return}let _=(i[0]&64)===64;if(_&&!this._extensions[n.extensionName]){let t=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");a(t);return}if(this._fin=(i[0]&128)===128,this._opcode=i[0]&15,this._payloadLength=i[1]&127,this._opcode===0){if(_){let t=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");a(t);return}if(!this._fragmented){let t=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");a(t);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let t=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");a(t);return}this._compressed=_}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let t=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");a(t);return}if(_){let t=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");a(t);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let t=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");a(t);return}}else{let t=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");a(t);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(i[1]&128)===128,this._isServer){if(!this._masked){let t=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");a(t);return}}else if(this._masked){let t=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");a(t);return}this._payloadLength===126?this._state=R:this._payloadLength===127?this._state=B:this.haveLength(a)}getPayloadLength16(a){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(a)}getPayloadLength64(a){if(this._bufferedBytes<8){this._loop=!1;return}let i=this.consume(8),_=i.readUInt32BE(0);if(_>Math.pow(2,21)-1){let t=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");a(t);return}this._payloadLength=_*Math.pow(2,32)+i.readUInt32BE(4),this.haveLength(a)}haveLength(a){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let i=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");a(i);return}this._masked?this._state=I:this._state=d}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=d}getData(a){let i=y;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}i=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&v(i,this._mask)}if(this._opcode>7){this.controlMessage(i,a);return}if(this._compressed){this._state=b,this.decompress(i,a);return}if(i.length){if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){let _=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");a(_);return}this._messageLength=this._totalPayloadLength,this._fragments.push(i)}this.dataMessage(a)}decompress(a,i){this._extensions[n.extensionName].decompress(a,this._fin,(_,t)=>{if(_)return i(_);if(t.length){if(this._messageLength+=t.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let S=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");i(S);return}if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){let S=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");i(S);return}this._fragments.push(t)}this.dataMessage(i),this._state===E&&this.startLoop(i)})}dataMessage(a){if(!this._fin){this._state=E;return}let i=this._messageLength,_=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let t;this._binaryType==="nodebuffer"?t=o(_,i):this._binaryType==="arraybuffer"?t=p(o(_,i)):this._binaryType==="blob"?t=new Blob(_):t=_,this._allowSynchronousEvents?(this.emit("message",t,!0),this._state=E):(this._state=T,setImmediate(()=>{this.emit("message",t,!0),this._state=E,this.startLoop(a)}))}else{let t=o(_,i);if(!this._skipUTF8Validation&&!w(t)){let S=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");a(S);return}this._state===b||this._allowSynchronousEvents?(this.emit("message",t,!1),this._state=E):(this._state=T,setImmediate(()=>{this.emit("message",t,!1),this._state=E,this.startLoop(a)}))}}controlMessage(a,i){if(this._opcode===8){if(a.length===0)this._loop=!1,this.emit("conclude",1005,y),this.end();else{let _=a.readUInt16BE(0);if(!k(_)){let S=this.createError(RangeError,`invalid status code ${_}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");i(S);return}let t=new N(a.buffer,a.byteOffset+2,a.length-2);if(!this._skipUTF8Validation&&!w(t)){let S=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");i(S);return}this._loop=!1,this.emit("conclude",_,t),this.end()}this._state=E;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",a),this._state=E):(this._state=T,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",a),this._state=E,this.startLoop(i)}))}createError(a,i,_,t,S){this._loop=!1,this._errored=!0;let g=new a(_?`Invalid WebSocket frame: ${i}`:i);return Error.captureStackTrace(g,this.createError),g.code=S,g[m]=t,g}};s.exports=P}),ot=X((e,s)=>{"use strict";var{Duplex:r}=q("stream"),{randomFillSync:n}=q("crypto"),{types:{isUint8Array:u}}=q("util"),y=Se(),{EMPTY_BUFFER:m,kWebSocket:x,NOOP:o}=ie(),{isBlob:p,isValidStatusCode:v}=Ee(),{mask:k,toBuffer:w}=Te(),N=Symbol("kByteLength"),E=Buffer.alloc(4),R=8*1024,B,I=R,d=0,b=1,T=2,P=class ae{static{f(this,"e")}static{c(this,"Sender")}constructor(t,S,g){this._extensions=S||{},g&&(this._generateMask=g,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=d,this.onerror=o,this[x]=void 0}static frame(t,S){let g,U=!1,L=2,A=!1;S.mask&&(g=S.maskBuffer||E,S.generateMask?S.generateMask(g):(I===R&&(B===void 0&&(B=Buffer.alloc(R)),n(B,0,R),I=0),g[0]=B[I++],g[1]=B[I++],g[2]=B[I++],g[3]=B[I++]),A=(g[0]|g[1]|g[2]|g[3])===0,L=6);let M;typeof t=="string"?(!S.mask||A)&&S[N]!==void 0?M=S[N]:(t=Buffer.from(t),M=t.length):(M=t.length,U=S.mask&&S.readOnly&&!A);let F=M;M>=65536?(L+=8,F=127):M>125&&(L+=2,F=126);let D=Buffer.allocUnsafe(U?M+L:L);return D[0]=S.fin?S.opcode|128:S.opcode,S.rsv1&&(D[0]|=64),D[1]=F,F===126?D.writeUInt16BE(M,2):F===127&&(D[2]=D[3]=0,D.writeUIntBE(M,4,6)),S.mask?(D[1]|=128,D[L-4]=g[0],D[L-3]=g[1],D[L-2]=g[2],D[L-1]=g[3],A?[D,t]:U?(k(t,g,D,L,M),[D]):(k(t,g,t,0,M),[D,t])):[D,t]}close(t,S,g,U){let L;if(t===void 0)L=m;else{if(typeof t!="number"||!v(t))throw new TypeError("First argument must be a valid error code number");if(S===void 0||!S.length)L=Buffer.allocUnsafe(2),L.writeUInt16BE(t,0);else{let M=Buffer.byteLength(S);if(M>123)throw new RangeError("The message must not be greater than 123 bytes");if(L=Buffer.allocUnsafe(2+M),L.writeUInt16BE(t,0),typeof S=="string")L.write(S,2);else if(u(S))L.set(S,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let A={[N]:L.length,fin:!0,generateMask:this._generateMask,mask:g,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==d?this.enqueue([this.dispatch,L,!1,A,U]):this.sendFrame(ae.frame(L,A),U)}ping(t,S,g){let U,L;if(typeof t=="string"?(U=Buffer.byteLength(t),L=!1):p(t)?(U=t.size,L=!1):(t=w(t),U=t.length,L=w.readOnly),U>125)throw new RangeError("The data size must not be greater than 125 bytes");let A={[N]:U,fin:!0,generateMask:this._generateMask,mask:S,maskBuffer:this._maskBuffer,opcode:9,readOnly:L,rsv1:!1};p(t)?this._state!==d?this.enqueue([this.getBlobData,t,!1,A,g]):this.getBlobData(t,!1,A,g):this._state!==d?this.enqueue([this.dispatch,t,!1,A,g]):this.sendFrame(ae.frame(t,A),g)}pong(t,S,g){let U,L;if(typeof t=="string"?(U=Buffer.byteLength(t),L=!1):p(t)?(U=t.size,L=!1):(t=w(t),U=t.length,L=w.readOnly),U>125)throw new RangeError("The data size must not be greater than 125 bytes");let A={[N]:U,fin:!0,generateMask:this._generateMask,mask:S,maskBuffer:this._maskBuffer,opcode:10,readOnly:L,rsv1:!1};p(t)?this._state!==d?this.enqueue([this.getBlobData,t,!1,A,g]):this.getBlobData(t,!1,A,g):this._state!==d?this.enqueue([this.dispatch,t,!1,A,g]):this.sendFrame(ae.frame(t,A),g)}send(t,S,g){let U=this._extensions[y.extensionName],L=S.binary?2:1,A=S.compress,M,F;typeof t=="string"?(M=Buffer.byteLength(t),F=!1):p(t)?(M=t.size,F=!1):(t=w(t),M=t.length,F=w.readOnly),this._firstFragment?(this._firstFragment=!1,A&&U&&U.params[U._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(A=M>=U._threshold),this._compress=A):(A=!1,L=0),S.fin&&(this._firstFragment=!0);let D={[N]:M,fin:S.fin,generateMask:this._generateMask,mask:S.mask,maskBuffer:this._maskBuffer,opcode:L,readOnly:F,rsv1:A};p(t)?this._state!==d?this.enqueue([this.getBlobData,t,this._compress,D,g]):this.getBlobData(t,this._compress,D,g):this._state!==d?this.enqueue([this.dispatch,t,this._compress,D,g]):this.dispatch(t,this._compress,D,g)}getBlobData(t,S,g,U){this._bufferedBytes+=g[N],this._state=T,t.arrayBuffer().then(L=>{if(this._socket.destroyed){let M=new Error("The socket was closed while the blob was being read");process.nextTick(a,this,M,U);return}this._bufferedBytes-=g[N];let A=w(L);S?this.dispatch(A,S,g,U):(this._state=d,this.sendFrame(ae.frame(A,g),U),this.dequeue())}).catch(L=>{process.nextTick(i,this,L,U)})}dispatch(t,S,g,U){if(!S){this.sendFrame(ae.frame(t,g),U);return}let L=this._extensions[y.extensionName];this._bufferedBytes+=g[N],this._state=b,L.compress(t,g.fin,(A,M)=>{if(this._socket.destroyed){let F=new Error("The socket was closed while data was being compressed");a(this,F,U);return}this._bufferedBytes-=g[N],this._state=d,g.readOnly=!1,this.sendFrame(ae.frame(M,g),U),this.dequeue()})}dequeue(){for(;this._state===d&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][N],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][N],this._queue.push(t)}sendFrame(t,S){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],S),this._socket.uncork()):this._socket.write(t[0],S)}};s.exports=P;function a(_,t,S){typeof S=="function"&&S(t);for(let g=0;g<_._queue.length;g++){let U=_._queue[g],L=U[U.length-1];typeof L=="function"&&L(t)}}f(a,"ze"),c(a,"callCallbacks");function i(_,t,S){a(_,t,S),_.onerror(t)}f(i,"is"),c(i,"onError")}),At=X((e,s)=>{"use strict";var{kForOnEventAttribute:r,kListener:n}=ie(),u=Symbol("kCode"),y=Symbol("kData"),m=Symbol("kError"),x=Symbol("kMessage"),o=Symbol("kReason"),p=Symbol("kTarget"),v=Symbol("kType"),k=Symbol("kWasClean"),w=class{static{f(this,"M")}static{c(this,"Event")}constructor(d){this[p]=null,this[v]=d}get target(){return this[p]}get type(){return this[v]}};Object.defineProperty(w.prototype,"target",{enumerable:!0}),Object.defineProperty(w.prototype,"type",{enumerable:!0});var N=class extends w{static{f(this,"q")}static{c(this,"CloseEvent")}constructor(d,b={}){super(d),this[u]=b.code===void 0?0:b.code,this[o]=b.reason===void 0?"":b.reason,this[k]=b.wasClean===void 0?!1:b.wasClean}get code(){return this[u]}get reason(){return this[o]}get wasClean(){return this[k]}};Object.defineProperty(N.prototype,"code",{enumerable:!0}),Object.defineProperty(N.prototype,"reason",{enumerable:!0}),Object.defineProperty(N.prototype,"wasClean",{enumerable:!0});var E=class extends w{static{f(this,"ne")}static{c(this,"ErrorEvent")}constructor(d,b={}){super(d),this[m]=b.error===void 0?null:b.error,this[x]=b.message===void 0?"":b.message}get error(){return this[m]}get message(){return this[x]}};Object.defineProperty(E.prototype,"error",{enumerable:!0}),Object.defineProperty(E.prototype,"message",{enumerable:!0});var R=class extends w{static{f(this,"fe")}static{c(this,"MessageEvent")}constructor(d,b={}){super(d),this[y]=b.data===void 0?null:b.data}get data(){return this[y]}};Object.defineProperty(R.prototype,"data",{enumerable:!0});var B={addEventListener(d,b,T={}){for(let a of this.listeners(d))if(!T[r]&&a[n]===b&&!a[r])return;let P;if(d==="message")P=c(function(a,i){let _=new R("message",{data:i?a:a.toString()});_[p]=this,I(b,this,_)},"onMessage");else if(d==="close")P=c(function(a,i){let _=new N("close",{code:a,reason:i.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});_[p]=this,I(b,this,_)},"onClose");else if(d==="error")P=c(function(a){let i=new E("error",{error:a,message:a.message});i[p]=this,I(b,this,i)},"onError");else if(d==="open")P=c(function(){let a=new w("open");a[p]=this,I(b,this,a)},"onOpen");else return;P[r]=!!T[r],P[n]=b,T.once?this.once(d,P):this.on(d,P)},removeEventListener(d,b){for(let T of this.listeners(d))if(T[n]===b&&!T[r]){this.removeListener(d,T);break}}};s.exports={CloseEvent:N,ErrorEvent:E,Event:w,EventTarget:B,MessageEvent:R};function I(d,b,T){typeof d=="object"&&d.handleEvent?d.handleEvent.call(d,T):d.call(b,T)}f(I,"be"),c(I,"callListener")}),Fe=X((e,s)=>{"use strict";var{tokenChars:r}=Ee();function n(m,x,o){m[x]===void 0?m[x]=[o]:m[x].push(o)}f(n,"L"),c(n,"push");function u(m){let x=Object.create(null),o=Object.create(null),p=!1,v=!1,k=!1,w,N,E=-1,R=-1,B=-1,I=0;for(;I<m.length;I++)if(R=m.charCodeAt(I),w===void 0)if(B===-1&&r[R]===1)E===-1&&(E=I);else if(I!==0&&(R===32||R===9))B===-1&&E!==-1&&(B=I);else if(R===59||R===44){if(E===-1)throw new SyntaxError(`Unexpected character at index ${I}`);B===-1&&(B=I);let b=m.slice(E,B);R===44?(n(x,b,o),o=Object.create(null)):w=b,E=B=-1}else throw new SyntaxError(`Unexpected character at index ${I}`);else if(N===void 0)if(B===-1&&r[R]===1)E===-1&&(E=I);else if(R===32||R===9)B===-1&&E!==-1&&(B=I);else if(R===59||R===44){if(E===-1)throw new SyntaxError(`Unexpected character at index ${I}`);B===-1&&(B=I),n(o,m.slice(E,B),!0),R===44&&(n(x,w,o),o=Object.create(null),w=void 0),E=B=-1}else if(R===61&&E!==-1&&B===-1)N=m.slice(E,I),E=B=-1;else throw new SyntaxError(`Unexpected character at index ${I}`);else if(v){if(r[R]!==1)throw new SyntaxError(`Unexpected character at index ${I}`);E===-1?E=I:p||(p=!0),v=!1}else if(k)if(r[R]===1)E===-1&&(E=I);else if(R===34&&E!==-1)k=!1,B=I;else if(R===92)v=!0;else throw new SyntaxError(`Unexpected character at index ${I}`);else if(R===34&&m.charCodeAt(I-1)===61)k=!0;else if(B===-1&&r[R]===1)E===-1&&(E=I);else if(E!==-1&&(R===32||R===9))B===-1&&(B=I);else if(R===59||R===44){if(E===-1)throw new SyntaxError(`Unexpected character at index ${I}`);B===-1&&(B=I);let b=m.slice(E,B);p&&(b=b.replace(/\\/g,""),p=!1),n(o,N,b),R===44&&(n(x,w,o),o=Object.create(null),w=void 0),N=void 0,E=B=-1}else throw new SyntaxError(`Unexpected character at index ${I}`);if(E===-1||k||R===32||R===9)throw new SyntaxError("Unexpected end of input");B===-1&&(B=I);let d=m.slice(E,B);return w===void 0?n(x,d,o):(N===void 0?n(o,d,!0):p?n(o,N,d.replace(/\\/g,"")):n(o,N,d),n(x,w,o)),x}f(u,"as"),c(u,"parse");function y(m){return Object.keys(m).map(x=>{let o=m[x];return Array.isArray(o)||(o=[o]),o.map(p=>[x].concat(Object.keys(p).map(v=>{let k=p[v];return Array.isArray(k)||(k=[k]),k.map(w=>w===!0?v:`${v}=${w}`).join("; ")})).join("; ")).join(", ")}).join(", ")}f(y,"cs"),c(y,"format"),s.exports={format:y,parse:u}}),De=X((e,s)=>{"use strict";var r=q("events"),n=q("https"),u=q("http"),y=q("net"),m=q("tls"),{randomBytes:x,createHash:o}=q("crypto"),{Duplex:p,Readable:v}=q("stream"),{URL:k}=q("url"),w=Se(),N=nt(),E=ot(),{isBlob:R}=Ee(),{BINARY_TYPES:B,CLOSE_TIMEOUT:I,EMPTY_BUFFER:d,GUID:b,kForOnEventAttribute:T,kListener:P,kStatusCode:a,kWebSocket:i,NOOP:_}=ie(),{EventTarget:{addEventListener:t,removeEventListener:S}}=At(),{format:g,parse:U}=Fe(),{toBuffer:L}=Te(),A=Symbol("kAborted"),M=[8,13],F=["CONNECTING","OPEN","CLOSING","CLOSED"],D=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,j=class G extends r{static{f(this,"e")}static{c(this,"WebSocket")}constructor(h,C,$){super(),this._binaryType=B[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=d,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=G.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,h!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,C===void 0?C=[]:Array.isArray(C)||(typeof C=="object"&&C!==null?($=C,C=[]):C=[C]),re(this,h,C,$)):(this._autoPong=$.autoPong,this._closeTimeout=$.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(h){B.includes(h)&&(this._binaryType=h,this._receiver&&(this._receiver._binaryType=h))}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}get 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(h,C,$){let O=new N({allowSynchronousEvents:$.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:$.maxBufferedChunks,maxFragments:$.maxFragments,maxPayload:$.maxPayload,skipUTF8Validation:$.skipUTF8Validation}),V=new E(h,this._extensions,$.generateMask);this._receiver=O,this._sender=V,this._socket=h,O[i]=this,V[i]=this,h[i]=this,O.on("conclude",He),O.on("drain",Ye),O.on("error",Xe),O.on("message",Je),O.on("ping",Ze),O.on("pong",Ke),V.onerror=Qe,h.setTimeout&&h.setTimeout(0),h.setNoDelay&&h.setNoDelay(),C.length>0&&h.unshift(C),h.on("close",Ie),h.on("data",_e),h.on("end",Re),h.on("error",Ue),this._readyState=G.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=G.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[w.extensionName]&&this._extensions[w.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=G.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(h,C){if(this.readyState!==G.CLOSED){if(this.readyState===G.CONNECTING){H(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===G.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=G.CLOSING,this._sender.close(h,C,!this._isServer,$=>{$||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),Be(this)}}pause(){this.readyState===G.CONNECTING||this.readyState===G.CLOSED||(this._paused=!0,this._socket.pause())}ping(h,C,$){if(this.readyState===G.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof h=="function"?($=h,h=C=void 0):typeof C=="function"&&($=C,C=void 0),typeof h=="number"&&(h=h.toString()),this.readyState!==G.OPEN){xe(this,h,$);return}C===void 0&&(C=!this._isServer),this._sender.ping(h||d,C,$)}pong(h,C,$){if(this.readyState===G.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof h=="function"?($=h,h=C=void 0):typeof C=="function"&&($=C,C=void 0),typeof h=="number"&&(h=h.toString()),this.readyState!==G.OPEN){xe(this,h,$);return}C===void 0&&(C=!this._isServer),this._sender.pong(h||d,C,$)}resume(){this.readyState===G.CONNECTING||this.readyState===G.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(h,C,$){if(this.readyState===G.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof C=="function"&&($=C,C={}),typeof h=="number"&&(h=h.toString()),this.readyState!==G.OPEN){xe(this,h,$);return}let O={binary:typeof h!="string",mask:!this._isServer,compress:!0,fin:!0,...C};this._extensions[w.extensionName]||(O.compress=!1),this._sender.send(h||d,O,$)}terminate(){if(this.readyState!==G.CLOSED){if(this.readyState===G.CONNECTING){H(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=G.CLOSING,this._socket.destroy())}}};Object.defineProperty(j,"CONNECTING",{enumerable:!0,value:F.indexOf("CONNECTING")}),Object.defineProperty(j.prototype,"CONNECTING",{enumerable:!0,value:F.indexOf("CONNECTING")}),Object.defineProperty(j,"OPEN",{enumerable:!0,value:F.indexOf("OPEN")}),Object.defineProperty(j.prototype,"OPEN",{enumerable:!0,value:F.indexOf("OPEN")}),Object.defineProperty(j,"CLOSING",{enumerable:!0,value:F.indexOf("CLOSING")}),Object.defineProperty(j.prototype,"CLOSING",{enumerable:!0,value:F.indexOf("CLOSING")}),Object.defineProperty(j,"CLOSED",{enumerable:!0,value:F.indexOf("CLOSED")}),Object.defineProperty(j.prototype,"CLOSED",{enumerable:!0,value:F.indexOf("CLOSED")}),["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(l=>{Object.defineProperty(j.prototype,l,{enumerable:!0})}),["open","error","close","message"].forEach(l=>{Object.defineProperty(j.prototype,`on${l}`,{enumerable:!0,get(){for(let h of this.listeners(l))if(h[T])return h[P];return null},set(h){for(let C of this.listeners(l))if(C[T]){this.removeListener(l,C);break}typeof h=="function"&&this.addEventListener(l,h,{[T]:!0})}})}),j.prototype.addEventListener=t,j.prototype.removeEventListener=S,s.exports=j;function re(l,h,C,$){let O={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:I,protocolVersion:M[1],maxBufferedChunks:1048576,maxFragments:131072,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...$,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(l._autoPong=O.autoPong,l._closeTimeout=O.closeTimeout,!M.includes(O.protocolVersion))throw new RangeError(`Unsupported protocol version: ${O.protocolVersion} (supported versions: ${M.join(", ")})`);let V;if(h instanceof k)V=h;else try{V=new k(h)}catch{throw new SyntaxError(`Invalid URL: ${h}`)}V.protocol==="http:"?V.protocol="ws:":V.protocol==="https:"&&(V.protocol="wss:"),l._url=V.href;let le=V.protocol==="wss:",ce=V.protocol==="ws+unix:",me;if(V.protocol!=="ws:"&&!le&&!ce?me=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:ce&&!V.pathname?me="The URL's pathname is empty":V.hash&&(me="The URL contains a fragment identifier"),me){let W=new SyntaxError(me);if(l._redirects===0)throw W;ne(l,W);return}let et=le?443:80,tt=x(16).toString("base64"),rt=le?n.request:u.request,ge=new Set,ye;if(O.createConnection=O.createConnection||(le?we:ke),O.defaultPort=O.defaultPort||et,O.port=V.port||et,O.host=V.hostname.startsWith("[")?V.hostname.slice(1,-1):V.hostname,O.headers={...O.headers,"Sec-WebSocket-Version":O.protocolVersion,"Sec-WebSocket-Key":tt,Connection:"Upgrade",Upgrade:"websocket"},O.path=V.pathname+V.search,O.timeout=O.handshakeTimeout,O.perMessageDeflate&&(ye=new w({...O.perMessageDeflate,isServer:!1,maxPayload:O.maxPayload}),O.headers["Sec-WebSocket-Extensions"]=g({[w.extensionName]:ye.offer()})),C.length){for(let W of C){if(typeof W!="string"||!D.test(W)||ge.has(W))throw new SyntaxError("An invalid or duplicated subprotocol was specified");ge.add(W)}O.headers["Sec-WebSocket-Protocol"]=C.join(",")}if(O.origin&&(O.protocolVersion<13?O.headers["Sec-WebSocket-Origin"]=O.origin:O.headers.Origin=O.origin),(V.username||V.password)&&(O.auth=`${V.username}:${V.password}`),ce){let W=O.path.split(":");O.socketPath=W[0],O.path=W[1]}let z;if(O.followRedirects){if(l._redirects===0){l._originalIpc=ce,l._originalSecure=le,l._originalHostOrSocketPath=ce?O.socketPath:V.host;let W=$&&$.headers;if($={...$,headers:{}},W)for(let[Y,he]of Object.entries(W))$.headers[Y.toLowerCase()]=he}else if(l.listenerCount("redirect")===0){let W=ce?l._originalIpc?O.socketPath===l._originalHostOrSocketPath:!1:l._originalIpc?!1:V.host===l._originalHostOrSocketPath;(!W||l._originalSecure&&!le)&&(delete O.headers.authorization,delete O.headers.cookie,W||delete O.headers.host,O.auth=void 0)}O.auth&&!$.headers.authorization&&($.headers.authorization="Basic "+Buffer.from(O.auth).toString("base64")),z=l._req=rt(O),l._redirects&&l.emit("redirect",l.url,z)}else z=l._req=rt(O);O.timeout&&z.on("timeout",()=>{H(l,z,"Opening handshake has timed out")}),z.on("error",W=>{z===null||z[A]||(z=l._req=null,ne(l,W))}),z.on("response",W=>{let Y=W.headers.location,he=W.statusCode;if(Y&&O.followRedirects&&he>=300&&he<400){if(++l._redirects>O.maxRedirects){H(l,z,"Maximum redirects exceeded");return}z.abort();let ve;try{ve=new k(Y,h)}catch{let $e=new SyntaxError(`Invalid URL: ${Y}`);ne(l,$e);return}re(l,ve,C,$)}else l.emit("unexpected-response",z,W)||H(l,z,`Unexpected server response: ${W.statusCode}`)}),z.on("upgrade",(W,Y,he)=>{if(l.emit("upgrade",W),l.readyState!==j.CONNECTING)return;z=l._req=null;let ve=W.headers.upgrade;if(ve===void 0||ve.toLowerCase()!=="websocket"){H(l,Y,"Invalid Upgrade header");return}let $e=o("sha1").update(tt+b).digest("base64");if(W.headers["sec-websocket-accept"]!==$e){H(l,Y,"Invalid Sec-WebSocket-Accept header");return}let Oe=W.headers["sec-websocket-protocol"],be;if(Oe!==void 0?ge.size?ge.has(Oe)||(be="Server sent an invalid subprotocol"):be="Server sent a subprotocol but none was requested":ge.size&&(be="Server sent no subprotocol"),be){H(l,Y,be);return}Oe&&(l._protocol=Oe);let st=W.headers["sec-websocket-extensions"];if(st!==void 0){if(!ye){H(l,Y,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let Me;try{Me=U(st)}catch{H(l,Y,"Invalid Sec-WebSocket-Extensions header");return}let it=Object.keys(Me);if(it.length!==1||it[0]!==w.extensionName){H(l,Y,"Server indicated an extension that was not requested");return}try{ye.accept(Me[w.extensionName])}catch{H(l,Y,"Invalid Sec-WebSocket-Extensions header");return}l._extensions[w.extensionName]=ye}l.setSocket(Y,he,{allowSynchronousEvents:O.allowSynchronousEvents,generateMask:O.generateMask,maxBufferedChunks:O.maxBufferedChunks,maxFragments:O.maxFragments,maxPayload:O.maxPayload,skipUTF8Validation:O.skipUTF8Validation})}),O.finishRequest?O.finishRequest(z,l):z.end()}f(re,"Zt"),c(re,"initAsClient");function ne(l,h){l._readyState=j.CLOSING,l._errorEmitted=!0,l.emit("error",h),l.emitClose()}f(ne,"Te"),c(ne,"emitErrorAndClose");function ke(l){return l.path=l.socketPath,y.connect(l)}f(ke,"Cs"),c(ke,"netConnect");function we(l){return l.path=void 0,!l.servername&&l.servername!==""&&(l.servername=y.isIP(l.host)?"":l.host),m.connect(l)}f(we,"vs"),c(we,"tlsConnect");function H(l,h,C){l._readyState=j.CLOSING;let $=new Error(C);Error.captureStackTrace($,H),h.setHeader?(h[A]=!0,h.abort(),h.socket&&!h.socket.destroyed&&h.socket.destroy(),process.nextTick(ne,l,$)):(h.destroy($),h.once("error",l.emit.bind(l,"error")),h.once("close",l.emitClose.bind(l)))}f(H,"b"),c(H,"abortHandshake");function xe(l,h,C){if(h){let $=R(h)?h.size:L(h).length;l._socket?l._sender._bufferedBytes+=$:l._bufferedAmount+=$}if(C){let $=new Error(`WebSocket is not open: readyState ${l.readyState} (${F[l.readyState]})`);process.nextTick(C,$)}}f(xe,"Qe"),c(xe,"sendAfterClose");function He(l,h){let C=this[i];C._closeFrameReceived=!0,C._closeMessage=h,C._closeCode=l,C._socket[i]!==void 0&&(C._socket.removeListener("data",_e),process.nextTick(Pe,C._socket),l===1005?C.close():C.close(l,h))}f(He,"Ls"),c(He,"receiverOnConclude");function Ye(){let l=this[i];l.isPaused||l._socket.resume()}f(Ye,"Is"),c(Ye,"receiverOnDrain");function Xe(l){let h=this[i];h._socket[i]!==void 0&&(h._socket.removeListener("data",_e),process.nextTick(Pe,h._socket),h.close(l[a])),h._errorEmitted||(h._errorEmitted=!0,h.emit("error",l))}f(Xe,"As"),c(Xe,"receiverOnError");function Le(){this[i].emitClose()}f(Le,"zt"),c(Le,"receiverOnFinish");function Je(l,h){this[i].emit("message",l,h)}f(Je,"Rs"),c(Je,"receiverOnMessage");function Ze(l){let h=this[i];h._autoPong&&h.pong(l,!this._isServer,_),h.emit("ping",l)}f(Ze,"Ms"),c(Ze,"receiverOnPing");function Ke(l){this[i].emit("pong",l)}f(Ke,"Bs"),c(Ke,"receiverOnPong");function Pe(l){l.resume()}f(Pe,"Kt"),c(Pe,"resume");function Qe(l){let h=this[i];h.readyState!==j.CLOSED&&(h.readyState===j.OPEN&&(h._readyState=j.CLOSING,Be(h)),this._socket.end(),h._errorEmitted||(h._errorEmitted=!0,h.emit("error",l)))}f(Qe,"Ps"),c(Qe,"senderOnError");function Be(l){l._closeTimer=setTimeout(l._socket.destroy.bind(l._socket),l._closeTimeout)}f(Be,"Qt"),c(Be,"setCloseTimer");function Ie(){let l=this[i];if(this.removeListener("close",Ie),this.removeListener("data",_e),this.removeListener("end",Re),l._readyState=j.CLOSING,!this._readableState.endEmitted&&!l._closeFrameReceived&&!l._receiver._writableState.errorEmitted&&this._readableState.length!==0){let h=this.read(this._readableState.length);l._receiver.write(h)}l._receiver.end(),this[i]=void 0,clearTimeout(l._closeTimer),l._receiver._writableState.finished||l._receiver._writableState.errorEmitted?l.emitClose():(l._receiver.on("error",Le),l._receiver.on("finish",Le))}f(Ie,"er"),c(Ie,"socketOnClose");function _e(l){this[i]._receiver.write(l)||this.pause()}f(_e,"Ne"),c(_e,"socketOnData");function Re(){let l=this[i];l._readyState=j.CLOSING,l._receiver.end(),this.end()}f(Re,"tr"),c(Re,"socketOnEnd");function Ue(){let l=this[i];this.removeListener("error",Ue),this.on("error",_),l&&(l._readyState=j.CLOSING,this.destroy())}f(Ue,"rr"),c(Ue,"socketOnError")}),Ft=X((e,s)=>{"use strict";var r=De(),{Duplex:n}=q("stream");function u(o){o.emit("close")}f(u,"nr"),c(u,"emitClose");function y(){!this.destroyed&&this._writableState.finished&&this.destroy()}f(y,"Us"),c(y,"duplexOnEnd");function m(o){this.removeListener("error",m),this.destroy(),this.listenerCount("error")===0&&this.emit("error",o)}f(m,"ir"),c(m,"duplexOnError");function x(o,p){let v=!0,k=new n({...p,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return o.on("message",c(function(w,N){let E=!N&&k._readableState.objectMode?w.toString():w;k.push(E)||o.pause()},"message")),o.once("error",c(function(w){k.destroyed||(v=!1,k.destroy(w))},"error")),o.once("close",c(function(){k.destroyed||k.push(null)},"close")),k._destroy=function(w,N){if(o.readyState===o.CLOSED){N(w),process.nextTick(u,k);return}let E=!1;o.once("error",c(function(R){E=!0,N(R)},"error")),o.once("close",c(function(){E||N(w),process.nextTick(u,k)},"close")),v&&o.terminate()},k._final=function(w){if(o.readyState===o.CONNECTING){o.once("open",c(function(){k._final(w)},"open"));return}o._socket!==null&&(o._socket._writableState.finished?(w(),k._readableState.endEmitted&&k.destroy()):(o._socket.once("finish",c(function(){w()},"finish")),o.close()))},k._read=function(){o.isPaused&&o.resume()},k._write=function(w,N,E){if(o.readyState===o.CONNECTING){o.once("open",c(function(){k._write(w,N,E)},"open"));return}o.send(w,E)},k.on("end",y),k.on("error",m),k}f(x,"$s"),c(x,"createWebSocketStream"),s.exports=x}),at=X((e,s)=>{"use strict";var{tokenChars:r}=Ee();function n(u){let y=new Set,m=-1,x=-1,o=0;for(o;o<u.length;o++){let v=u.charCodeAt(o);if(x===-1&&r[v]===1)m===-1&&(m=o);else if(o!==0&&(v===32||v===9))x===-1&&m!==-1&&(x=o);else if(v===44){if(m===-1)throw new SyntaxError(`Unexpected character at index ${o}`);x===-1&&(x=o);let k=u.slice(m,x);if(y.has(k))throw new SyntaxError(`The "${k}" subprotocol is duplicated`);y.add(k),m=x=-1}else throw new SyntaxError(`Unexpected character at index ${o}`)}if(m===-1||x!==-1)throw new SyntaxError("Unexpected end of input");let p=u.slice(m,o);if(y.has(p))throw new SyntaxError(`The "${p}" subprotocol is duplicated`);return y.add(p),y}f(n,"Ws"),c(n,"parse"),s.exports={parse:n}}),Dt=X((e,s)=>{"use strict";var r=q("events"),n=q("http"),{Duplex:u}=q("stream"),{createHash:y}=q("crypto"),m=Fe(),x=Se(),o=at(),p=De(),{CLOSE_TIMEOUT:v,GUID:k,kWebSocket:w}=ie(),N=/^[+/0-9A-Za-z]{22}==$/,E=0,R=1,B=2,I=class extends r{static{f(this,"tt")}static{c(this,"WebSocketServer")}constructor(i,_){if(super(),i={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:1024*1024,maxFragments:128*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:v,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:p,...i},i.port==null&&!i.server&&!i.noServer||i.port!=null&&(i.server||i.noServer)||i.server&&i.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(i.port!=null?(this._server=n.createServer((t,S)=>{let g=n.STATUS_CODES[426];S.writeHead(426,{"Content-Length":g.length,"Content-Type":"text/plain"}),S.end(g)}),this._server.listen(i.port,i.host,i.backlog,_)):i.server&&(this._server=i.server),this._server){let t=this.emit.bind(this,"connection");this._removeListeners=d(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:c((S,g,U)=>{this.handleUpgrade(S,g,U,t)},"upgrade")})}i.perMessageDeflate===!0&&(i.perMessageDeflate={}),i.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=i,this._state=E}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(i){if(this._state===B){i&&this.once("close",()=>{i(new Error("The server is not running"))}),process.nextTick(b,this);return}if(i&&this.once("close",i),this._state!==R)if(this._state=R,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(b,this):process.nextTick(b,this);else{let _=this._server;this._removeListeners(),this._removeListeners=this._server=null,_.close(()=>{b(this)})}}shouldHandle(i){if(this.options.path){let _=i.url.indexOf("?");if((_!==-1?i.url.slice(0,_):i.url)!==this.options.path)return!1}return!0}handleUpgrade(i,_,t,S){_.on("error",T);let g=i.headers["sec-websocket-key"],U=i.headers.upgrade,L=+i.headers["sec-websocket-version"];if(i.method!=="GET"){a(this,i,_,405,"Invalid HTTP method");return}if(U===void 0||U.toLowerCase()!=="websocket"){a(this,i,_,400,"Invalid Upgrade header");return}if(g===void 0||!N.test(g)){a(this,i,_,400,"Missing or invalid Sec-WebSocket-Key header");return}if(L!==13&&L!==8){a(this,i,_,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(i)){P(_,400);return}let A=i.headers["sec-websocket-protocol"],M=new Set;if(A!==void 0)try{M=o.parse(A)}catch{a(this,i,_,400,"Invalid Sec-WebSocket-Protocol header");return}let F=i.headers["sec-websocket-extensions"],D={};if(this.options.perMessageDeflate&&F!==void 0){let j=new x({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let re=m.parse(F);re[x.extensionName]&&(j.accept(re[x.extensionName]),D[x.extensionName]=j)}catch{a(this,i,_,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let j={origin:i.headers[`${L===8?"sec-websocket-origin":"origin"}`],secure:!!(i.socket.authorized||i.socket.encrypted),req:i};if(this.options.verifyClient.length===2){this.options.verifyClient(j,(re,ne,ke,we)=>{if(!re)return P(_,ne||401,ke,we);this.completeUpgrade(D,g,M,i,_,t,S)});return}if(!this.options.verifyClient(j))return P(_,401)}this.completeUpgrade(D,g,M,i,_,t,S)}completeUpgrade(i,_,t,S,g,U,L){if(!g.readable||!g.writable)return g.destroy();if(g[w])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>E)return P(g,503);let A=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${y("sha1").update(_+k).digest("base64")}`],M=new this.options.WebSocket(null,void 0,this.options);if(t.size){let F=this.options.handleProtocols?this.options.handleProtocols(t,S):t.values().next().value;F&&(A.push(`Sec-WebSocket-Protocol: ${F}`),M._protocol=F)}if(i[x.extensionName]){let F=i[x.extensionName].params,D=m.format({[x.extensionName]:[F]});A.push(`Sec-WebSocket-Extensions: ${D}`),M._extensions=i}this.emit("headers",A,S),g.write(A.concat(`\r
|
|
1
|
+
"use strict";var Lt=Object.defineProperty;var f=(e,s)=>Lt(e,"name",{value:s,configurable:!0});import{createRequire as Bt}from"module";const ue=Bt(import.meta.url);var It=Object.create,Ae=Object.defineProperty,Rt=Object.getOwnPropertyDescriptor,$t=Object.getOwnPropertyNames,Ut=Object.getPrototypeOf,Mt=Object.prototype.hasOwnProperty,c=f((e,s)=>Ae(e,"name",{value:s,configurable:!0}),"o"),q=(e=>typeof ue<"u"?ue:typeof Proxy<"u"?new Proxy(e,{get:f((s,t)=>(typeof ue<"u"?ue:s)[t],"get")}):e)(function(e){if(typeof ue<"u")return ue.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')}),X=f((e,s)=>()=>(s||e((s={exports:{}}).exports,s),s.exports),"x"),At=f((e,s,t,n)=>{if(s&&typeof s=="object"||typeof s=="function")for(let u of $t(s))!Mt.call(e,u)&&u!==t&&Ae(e,u,{get:f(()=>s[u],"get"),enumerable:!(n=Rt(s,u))||n.enumerable});return e},"Ar"),se=f((e,s,t)=>(t=e!=null?It(Ut(e)):{},At(s||!e||!e.__esModule?Ae(t,"default",{value:e,enumerable:!0}):t,e)),"D"),ie=X((e,s)=>{"use strict";var t=["nodebuffer","arraybuffer","fragments"],n=typeof Blob<"u";n&&t.push("blob"),s.exports={BINARY_TYPES:t,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:n,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:c(()=>{},"NOOP")}}),Ce=X((e,s)=>{"use strict";var{EMPTY_BUFFER:t}=ie(),n=Buffer[Symbol.species];function u(p,y){if(p.length===0)return t;if(p.length===1)return p[0];let k=Buffer.allocUnsafe(y),w=0;for(let N=0;N<p.length;N++){let E=p[N];k.set(E,w),w+=E.length}return w<y?new n(k.buffer,k.byteOffset,w):k}f(u,"Br"),c(u,"concat");function b(p,y,k,w,N){for(let E=0;E<N;E++)k[w+E]=p[E]^y[E&3]}f(b,"mt"),c(b,"_mask");function m(p,y){for(let k=0;k<p.length;k++)p[k]^=y[k&3]}f(m,"_t"),c(m,"_unmask");function x(p){return p.length===p.buffer.byteLength?p.buffer:p.buffer.slice(p.byteOffset,p.byteOffset+p.length)}f(x,"Ir"),c(x,"toArrayBuffer");function o(p){if(o.readOnly=!0,Buffer.isBuffer(p))return p;let y;return p instanceof ArrayBuffer?y=new n(p):ArrayBuffer.isView(p)?y=new n(p.buffer,p.byteOffset,p.byteLength):(y=Buffer.from(p),o.readOnly=!1),y}if(f(o,"Pe"),c(o,"toBuffer"),s.exports={concat:u,mask:b,toArrayBuffer:x,toBuffer:o,unmask:m},!process.env.WS_NO_BUFFER_UTIL)try{let p=q("bufferutil");s.exports.mask=function(y,k,w,N,E){E<48?b(y,k,w,N,E):p.mask(y,k,w,N,E)},s.exports.unmask=function(y,k){y.length<32?m(y,k):p.unmask(y,k)}}catch{}}),Ft=X((e,s)=>{"use strict";var t=Symbol("kDone"),n=Symbol("kRun"),u=class{static{f(this,"Ue")}static{c(this,"Limiter")}constructor(b){this[t]=()=>{this.pending--,this[n]()},this.concurrency=b||1/0,this.jobs=[],this.pending=0}add(b){this.jobs.push(b),this[n]()}[n](){if(this.pending!==this.concurrency&&this.jobs.length){let b=this.jobs.shift();this.pending++,b(this[t])}}};s.exports=u}),Se=X((e,s)=>{"use strict";var t=q("zlib"),n=Ce(),u=Ft(),{kStatusCode:b}=ie(),m=Buffer[Symbol.species],x=Buffer.from([0,0,255,255]),o=Symbol("permessage-deflate"),p=Symbol("total-length"),y=Symbol("callback"),k=Symbol("buffers"),w=Symbol("error"),N,E=class{static{f(this,"$e")}static{c(this,"PerMessageDeflate")}constructor(d){if(this._options=d||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._maxPayload=this._options.maxPayload|0,this._isServer=!!this._options.isServer,this._deflate=null,this._inflate=null,this.params=null,!N){let v=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;N=new u(v)}}static get extensionName(){return"permessage-deflate"}offer(){let d={};return this._options.serverNoContextTakeover&&(d.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(d.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(d.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?d.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(d.client_max_window_bits=!0),d}accept(d){return d=this.normalizeParams(d),this.params=this._isServer?this.acceptAsServer(d):this.acceptAsClient(d),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let d=this._deflate[y];this._deflate.close(),this._deflate=null,d&&d(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(d){let v=this._options,C=d.find(L=>!(v.serverNoContextTakeover===!1&&L.server_no_context_takeover||L.server_max_window_bits&&(v.serverMaxWindowBits===!1||typeof v.serverMaxWindowBits=="number"&&v.serverMaxWindowBits>L.server_max_window_bits)||typeof v.clientMaxWindowBits=="number"&&!L.client_max_window_bits));if(!C)throw new Error("None of the extension offers can be accepted");return v.serverNoContextTakeover&&(C.server_no_context_takeover=!0),v.clientNoContextTakeover&&(C.client_no_context_takeover=!0),typeof v.serverMaxWindowBits=="number"&&(C.server_max_window_bits=v.serverMaxWindowBits),typeof v.clientMaxWindowBits=="number"?C.client_max_window_bits=v.clientMaxWindowBits:(C.client_max_window_bits===!0||v.clientMaxWindowBits===!1)&&delete C.client_max_window_bits,C}acceptAsClient(d){let v=d[0];if(this._options.clientNoContextTakeover===!1&&v.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!v.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(v.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&v.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return v}normalizeParams(d){return d.forEach(v=>{Object.keys(v).forEach(C=>{let L=v[C];if(L.length>1)throw new Error(`Parameter "${C}" must have only a single value`);if(L=L[0],C==="client_max_window_bits"){if(L!==!0){let a=+L;if(!Number.isInteger(a)||a<8||a>15)throw new TypeError(`Invalid value for parameter "${C}": ${L}`);L=a}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${C}": ${L}`)}else if(C==="server_max_window_bits"){let a=+L;if(!Number.isInteger(a)||a<8||a>15)throw new TypeError(`Invalid value for parameter "${C}": ${L}`);L=a}else if(C==="client_no_context_takeover"||C==="server_no_context_takeover"){if(L!==!0)throw new TypeError(`Invalid value for parameter "${C}": ${L}`)}else throw new Error(`Unknown parameter "${C}"`);v[C]=L})}),d}decompress(d,v,C){N.add(L=>{this._decompress(d,v,(a,i)=>{L(),C(a,i)})})}compress(d,v,C){N.add(L=>{this._compress(d,v,(a,i)=>{L(),C(a,i)})})}_decompress(d,v,C){let L=this._isServer?"client":"server";if(!this._inflate){let a=`${L}_max_window_bits`,i=typeof this.params[a]!="number"?t.Z_DEFAULT_WINDOWBITS:this.params[a];this._inflate=t.createInflateRaw({...this._options.zlibInflateOptions,windowBits:i}),this._inflate[o]=this,this._inflate[p]=0,this._inflate[k]=[],this._inflate.on("error",I),this._inflate.on("data",B)}this._inflate[y]=C,this._inflate.write(d),v&&this._inflate.write(x),this._inflate.flush(()=>{let a=this._inflate[w];if(a){this._inflate.close(),this._inflate=null,C(a);return}let i=n.concat(this._inflate[k],this._inflate[p]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[p]=0,this._inflate[k]=[],v&&this.params[`${L}_no_context_takeover`]&&this._inflate.reset()),C(null,i)})}_compress(d,v,C){let L=this._isServer?"server":"client";if(!this._deflate){let a=`${L}_max_window_bits`,i=typeof this.params[a]!="number"?t.Z_DEFAULT_WINDOWBITS:this.params[a];this._deflate=t.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:i}),this._deflate[p]=0,this._deflate[k]=[],this._deflate.on("data",R)}this._deflate[y]=C,this._deflate.write(d),this._deflate.flush(t.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let a=n.concat(this._deflate[k],this._deflate[p]);v&&(a=new m(a.buffer,a.byteOffset,a.length-4)),this._deflate[y]=null,this._deflate[p]=0,this._deflate[k]=[],v&&this.params[`${L}_no_context_takeover`]&&this._deflate.reset(),C(null,a)})}};s.exports=E;function R(d){this[k].push(d),this[p]+=d.length}f(R,"Ur"),c(R,"deflateOnData");function B(d){if(this[p]+=d.length,this[o]._maxPayload<1||this[p]<=this[o]._maxPayload){this[k].push(d);return}this[w]=new RangeError("Max payload size exceeded"),this[w].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[w][b]=1009,this.removeListener("data",B),this.reset()}f(B,"bt"),c(B,"inflateOnData");function I(d){if(this[o]._inflate=null,this[w]){this[y](this[w]);return}d[b]=1007,this[y](d)}f(I,"$r"),c(I,"inflateOnError")}),Ee=X((e,s)=>{"use strict";var{isUtf8:t}=q("buffer"),{hasBlob:n}=ie(),u=[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 b(o){return o>=1e3&&o<=1014&&o!==1004&&o!==1005&&o!==1006||o>=3e3&&o<=4999}f(b,"qr"),c(b,"isValidStatusCode");function m(o){let p=o.length,y=0;for(;y<p;)if((o[y]&128)===0)y++;else if((o[y]&224)===192){if(y+1===p||(o[y+1]&192)!==128||(o[y]&254)===192)return!1;y+=2}else if((o[y]&240)===224){if(y+2>=p||(o[y+1]&192)!==128||(o[y+2]&192)!==128||o[y]===224&&(o[y+1]&224)===128||o[y]===237&&(o[y+1]&224)===160)return!1;y+=3}else if((o[y]&248)===240){if(y+3>=p||(o[y+1]&192)!==128||(o[y+2]&192)!==128||(o[y+3]&192)!==128||o[y]===240&&(o[y+1]&240)===128||o[y]===244&&o[y+1]>143||o[y]>244)return!1;y+=4}else return!1;return!0}f(m,"Fe"),c(m,"_isValidUTF8");function x(o){return n&&typeof o=="object"&&typeof o.arrayBuffer=="function"&&typeof o.type=="string"&&typeof o.stream=="function"&&(o[Symbol.toStringTag]==="Blob"||o[Symbol.toStringTag]==="File")}if(f(x,"Vr"),c(x,"isBlob"),s.exports={isBlob:x,isValidStatusCode:b,isValidUTF8:m,tokenChars:u},t)s.exports.isValidUTF8=function(o){return o.length<24?m(o):t(o)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let o=q("utf-8-validate");s.exports.isValidUTF8=function(p){return p.length<32?m(p):o(p)}}catch{}}),nt=X((e,s)=>{"use strict";var{Writable:t}=q("stream"),n=Se(),{BINARY_TYPES:u,EMPTY_BUFFER:b,kStatusCode:m,kWebSocket:x}=ie(),{concat:o,toArrayBuffer:p,unmask:y}=Ce(),{isValidStatusCode:k,isValidUTF8:w}=Ee(),N=Buffer[Symbol.species],E=0,R=1,B=2,I=3,d=4,v=5,C=6,L=class extends t{static{f(this,"je")}static{c(this,"Receiver")}constructor(a={}){super(),this._allowSynchronousEvents=a.allowSynchronousEvents!==void 0?a.allowSynchronousEvents:!0,this._binaryType=a.binaryType||u[0],this._extensions=a.extensions||{},this._isServer=!!a.isServer,this._maxBufferedChunks=a.maxBufferedChunks|0,this._maxFragments=a.maxFragments|0,this._maxPayload=a.maxPayload|0,this._skipUTF8Validation=!!a.skipUTF8Validation,this[x]=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._errored=!1,this._loop=!1,this._state=E}_write(a,i,_){if(this._opcode===8&&this._state==E)return _();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){_(this.createError(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=a.length,this._buffers.push(a),this.startLoop(_)}consume(a){if(this._bufferedBytes-=a,a===this._buffers[0].length)return this._buffers.shift();if(a<this._buffers[0].length){let _=this._buffers[0];return this._buffers[0]=new N(_.buffer,_.byteOffset+a,_.length-a),new N(_.buffer,_.byteOffset,a)}let i=Buffer.allocUnsafe(a);do{let _=this._buffers[0],r=i.length-a;a>=_.length?i.set(this._buffers.shift(),r):(i.set(new Uint8Array(_.buffer,_.byteOffset,a),r),this._buffers[0]=new N(_.buffer,_.byteOffset+a,_.length-a)),a-=_.length}while(a>0);return i}startLoop(a){this._loop=!0;do switch(this._state){case E:this.getInfo(a);break;case R:this.getPayloadLength16(a);break;case B:this.getPayloadLength64(a);break;case I:this.getMask();break;case d:this.getData(a);break;case v:case C:this._loop=!1;return}while(this._loop);this._errored||a()}getInfo(a){if(this._bufferedBytes<2){this._loop=!1;return}let i=this.consume(2);if((i[0]&48)!==0){let r=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");a(r);return}let _=(i[0]&64)===64;if(_&&!this._extensions[n.extensionName]){let r=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");a(r);return}if(this._fin=(i[0]&128)===128,this._opcode=i[0]&15,this._payloadLength=i[1]&127,this._opcode===0){if(_){let r=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");a(r);return}if(!this._fragmented){let r=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");a(r);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let r=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");a(r);return}this._compressed=_}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let r=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");a(r);return}if(_){let r=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");a(r);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let r=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");a(r);return}}else{let r=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");a(r);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(i[1]&128)===128,this._isServer){if(!this._masked){let r=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");a(r);return}}else if(this._masked){let r=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");a(r);return}this._payloadLength===126?this._state=R:this._payloadLength===127?this._state=B:this.haveLength(a)}getPayloadLength16(a){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(a)}getPayloadLength64(a){if(this._bufferedBytes<8){this._loop=!1;return}let i=this.consume(8),_=i.readUInt32BE(0);if(_>Math.pow(2,21)-1){let r=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");a(r);return}this._payloadLength=_*Math.pow(2,32)+i.readUInt32BE(4),this.haveLength(a)}haveLength(a){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let i=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");a(i);return}this._masked?this._state=I:this._state=d}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=d}getData(a){let i=b;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}i=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&y(i,this._mask)}if(this._opcode>7){this.controlMessage(i,a);return}if(this._compressed){this._state=v,this.decompress(i,a);return}if(i.length){if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){let _=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");a(_);return}this._messageLength=this._totalPayloadLength,this._fragments.push(i)}this.dataMessage(a)}decompress(a,i){this._extensions[n.extensionName].decompress(a,this._fin,(_,r)=>{if(_)return i(_);if(r.length){if(this._messageLength+=r.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let S=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");i(S);return}if(this._maxFragments>0&&this._fragments.length>=this._maxFragments){let S=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");i(S);return}this._fragments.push(r)}this.dataMessage(i),this._state===E&&this.startLoop(i)})}dataMessage(a){if(!this._fin){this._state=E;return}let i=this._messageLength,_=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let r;this._binaryType==="nodebuffer"?r=o(_,i):this._binaryType==="arraybuffer"?r=p(o(_,i)):this._binaryType==="blob"?r=new Blob(_):r=_,this._allowSynchronousEvents?(this.emit("message",r,!0),this._state=E):(this._state=C,setImmediate(()=>{this.emit("message",r,!0),this._state=E,this.startLoop(a)}))}else{let r=o(_,i);if(!this._skipUTF8Validation&&!w(r)){let S=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");a(S);return}this._state===v||this._allowSynchronousEvents?(this.emit("message",r,!1),this._state=E):(this._state=C,setImmediate(()=>{this.emit("message",r,!1),this._state=E,this.startLoop(a)}))}}controlMessage(a,i){if(this._opcode===8){if(a.length===0)this._loop=!1,this.emit("conclude",1005,b),this.end();else{let _=a.readUInt16BE(0);if(!k(_)){let S=this.createError(RangeError,`invalid status code ${_}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");i(S);return}let r=new N(a.buffer,a.byteOffset+2,a.length-2);if(!this._skipUTF8Validation&&!w(r)){let S=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");i(S);return}this._loop=!1,this.emit("conclude",_,r),this.end()}this._state=E;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",a),this._state=E):(this._state=C,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",a),this._state=E,this.startLoop(i)}))}createError(a,i,_,r,S){this._loop=!1,this._errored=!0;let g=new a(_?`Invalid WebSocket frame: ${i}`:i);return Error.captureStackTrace(g,this.createError),g.code=S,g[m]=r,g}};s.exports=L}),ot=X((e,s)=>{"use strict";var{Duplex:t}=q("stream"),{randomFillSync:n}=q("crypto"),{types:{isUint8Array:u}}=q("util"),b=Se(),{EMPTY_BUFFER:m,kWebSocket:x,NOOP:o}=ie(),{isBlob:p,isValidStatusCode:y}=Ee(),{mask:k,toBuffer:w}=Ce(),N=Symbol("kByteLength"),E=Buffer.alloc(4),R=8*1024,B,I=R,d=0,v=1,C=2,L=class ae{static{f(this,"e")}static{c(this,"Sender")}constructor(r,S,g){this._extensions=S||{},g&&(this._generateMask=g,this._maskBuffer=Buffer.alloc(4)),this._socket=r,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=d,this.onerror=o,this[x]=void 0}static frame(r,S){let g,$=!1,P=2,A=!1;S.mask&&(g=S.maskBuffer||E,S.generateMask?S.generateMask(g):(I===R&&(B===void 0&&(B=Buffer.alloc(R)),n(B,0,R),I=0),g[0]=B[I++],g[1]=B[I++],g[2]=B[I++],g[3]=B[I++]),A=(g[0]|g[1]|g[2]|g[3])===0,P=6);let M;typeof r=="string"?(!S.mask||A)&&S[N]!==void 0?M=S[N]:(r=Buffer.from(r),M=r.length):(M=r.length,$=S.mask&&S.readOnly&&!A);let F=M;M>=65536?(P+=8,F=127):M>125&&(P+=2,F=126);let D=Buffer.allocUnsafe($?M+P:P);return D[0]=S.fin?S.opcode|128:S.opcode,S.rsv1&&(D[0]|=64),D[1]=F,F===126?D.writeUInt16BE(M,2):F===127&&(D[2]=D[3]=0,D.writeUIntBE(M,4,6)),S.mask?(D[1]|=128,D[P-4]=g[0],D[P-3]=g[1],D[P-2]=g[2],D[P-1]=g[3],A?[D,r]:$?(k(r,g,D,P,M),[D]):(k(r,g,r,0,M),[D,r])):[D,r]}close(r,S,g,$){let P;if(r===void 0)P=m;else{if(typeof r!="number"||!y(r))throw new TypeError("First argument must be a valid error code number");if(S===void 0||!S.length)P=Buffer.allocUnsafe(2),P.writeUInt16BE(r,0);else{let M=Buffer.byteLength(S);if(M>123)throw new RangeError("The message must not be greater than 123 bytes");if(P=Buffer.allocUnsafe(2+M),P.writeUInt16BE(r,0),typeof S=="string")P.write(S,2);else if(u(S))P.set(S,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let A={[N]:P.length,fin:!0,generateMask:this._generateMask,mask:g,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==d?this.enqueue([this.dispatch,P,!1,A,$]):this.sendFrame(ae.frame(P,A),$)}ping(r,S,g){let $,P;if(typeof r=="string"?($=Buffer.byteLength(r),P=!1):p(r)?($=r.size,P=!1):(r=w(r),$=r.length,P=w.readOnly),$>125)throw new RangeError("The data size must not be greater than 125 bytes");let A={[N]:$,fin:!0,generateMask:this._generateMask,mask:S,maskBuffer:this._maskBuffer,opcode:9,readOnly:P,rsv1:!1};p(r)?this._state!==d?this.enqueue([this.getBlobData,r,!1,A,g]):this.getBlobData(r,!1,A,g):this._state!==d?this.enqueue([this.dispatch,r,!1,A,g]):this.sendFrame(ae.frame(r,A),g)}pong(r,S,g){let $,P;if(typeof r=="string"?($=Buffer.byteLength(r),P=!1):p(r)?($=r.size,P=!1):(r=w(r),$=r.length,P=w.readOnly),$>125)throw new RangeError("The data size must not be greater than 125 bytes");let A={[N]:$,fin:!0,generateMask:this._generateMask,mask:S,maskBuffer:this._maskBuffer,opcode:10,readOnly:P,rsv1:!1};p(r)?this._state!==d?this.enqueue([this.getBlobData,r,!1,A,g]):this.getBlobData(r,!1,A,g):this._state!==d?this.enqueue([this.dispatch,r,!1,A,g]):this.sendFrame(ae.frame(r,A),g)}send(r,S,g){let $=this._extensions[b.extensionName],P=S.binary?2:1,A=S.compress,M,F;typeof r=="string"?(M=Buffer.byteLength(r),F=!1):p(r)?(M=r.size,F=!1):(r=w(r),M=r.length,F=w.readOnly),this._firstFragment?(this._firstFragment=!1,A&&$&&$.params[$._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(A=M>=$._threshold),this._compress=A):(A=!1,P=0),S.fin&&(this._firstFragment=!0);let D={[N]:M,fin:S.fin,generateMask:this._generateMask,mask:S.mask,maskBuffer:this._maskBuffer,opcode:P,readOnly:F,rsv1:A};p(r)?this._state!==d?this.enqueue([this.getBlobData,r,this._compress,D,g]):this.getBlobData(r,this._compress,D,g):this._state!==d?this.enqueue([this.dispatch,r,this._compress,D,g]):this.dispatch(r,this._compress,D,g)}getBlobData(r,S,g,$){this._bufferedBytes+=g[N],this._state=C,r.arrayBuffer().then(P=>{if(this._socket.destroyed){let M=new Error("The socket was closed while the blob was being read");process.nextTick(a,this,M,$);return}this._bufferedBytes-=g[N];let A=w(P);S?this.dispatch(A,S,g,$):(this._state=d,this.sendFrame(ae.frame(A,g),$),this.dequeue())}).catch(P=>{process.nextTick(i,this,P,$)})}dispatch(r,S,g,$){if(!S){this.sendFrame(ae.frame(r,g),$);return}let P=this._extensions[b.extensionName];this._bufferedBytes+=g[N],this._state=v,P.compress(r,g.fin,(A,M)=>{if(this._socket.destroyed){let F=new Error("The socket was closed while data was being compressed");a(this,F,$);return}this._bufferedBytes-=g[N],this._state=d,g.readOnly=!1,this.sendFrame(ae.frame(M,g),$),this.dequeue()})}dequeue(){for(;this._state===d&&this._queue.length;){let r=this._queue.shift();this._bufferedBytes-=r[3][N],Reflect.apply(r[0],this,r.slice(1))}}enqueue(r){this._bufferedBytes+=r[3][N],this._queue.push(r)}sendFrame(r,S){r.length===2?(this._socket.cork(),this._socket.write(r[0]),this._socket.write(r[1],S),this._socket.uncork()):this._socket.write(r[0],S)}};s.exports=L;function a(_,r,S){typeof S=="function"&&S(r);for(let g=0;g<_._queue.length;g++){let $=_._queue[g],P=$[$.length-1];typeof P=="function"&&P(r)}}f(a,"ze"),c(a,"callCallbacks");function i(_,r,S){a(_,r,S),_.onerror(r)}f(i,"os"),c(i,"onError")}),Dt=X((e,s)=>{"use strict";var{kForOnEventAttribute:t,kListener:n}=ie(),u=Symbol("kCode"),b=Symbol("kData"),m=Symbol("kError"),x=Symbol("kMessage"),o=Symbol("kReason"),p=Symbol("kTarget"),y=Symbol("kType"),k=Symbol("kWasClean"),w=class{static{f(this,"I")}static{c(this,"Event")}constructor(d){this[p]=null,this[y]=d}get target(){return this[p]}get type(){return this[y]}};Object.defineProperty(w.prototype,"target",{enumerable:!0}),Object.defineProperty(w.prototype,"type",{enumerable:!0});var N=class extends w{static{f(this,"V")}static{c(this,"CloseEvent")}constructor(d,v={}){super(d),this[u]=v.code===void 0?0:v.code,this[o]=v.reason===void 0?"":v.reason,this[k]=v.wasClean===void 0?!1:v.wasClean}get code(){return this[u]}get reason(){return this[o]}get wasClean(){return this[k]}};Object.defineProperty(N.prototype,"code",{enumerable:!0}),Object.defineProperty(N.prototype,"reason",{enumerable:!0}),Object.defineProperty(N.prototype,"wasClean",{enumerable:!0});var E=class extends w{static{f(this,"ne")}static{c(this,"ErrorEvent")}constructor(d,v={}){super(d),this[m]=v.error===void 0?null:v.error,this[x]=v.message===void 0?"":v.message}get error(){return this[m]}get message(){return this[x]}};Object.defineProperty(E.prototype,"error",{enumerable:!0}),Object.defineProperty(E.prototype,"message",{enumerable:!0});var R=class extends w{static{f(this,"fe")}static{c(this,"MessageEvent")}constructor(d,v={}){super(d),this[b]=v.data===void 0?null:v.data}get data(){return this[b]}};Object.defineProperty(R.prototype,"data",{enumerable:!0});var B={addEventListener(d,v,C={}){for(let a of this.listeners(d))if(!C[t]&&a[n]===v&&!a[t])return;let L;if(d==="message")L=c(function(a,i){let _=new R("message",{data:i?a:a.toString()});_[p]=this,I(v,this,_)},"onMessage");else if(d==="close")L=c(function(a,i){let _=new N("close",{code:a,reason:i.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});_[p]=this,I(v,this,_)},"onClose");else if(d==="error")L=c(function(a){let i=new E("error",{error:a,message:a.message});i[p]=this,I(v,this,i)},"onError");else if(d==="open")L=c(function(){let a=new w("open");a[p]=this,I(v,this,a)},"onOpen");else return;L[t]=!!C[t],L[n]=v,C.once?this.once(d,L):this.on(d,L)},removeEventListener(d,v){for(let C of this.listeners(d))if(C[n]===v&&!C[t]){this.removeListener(d,C);break}}};s.exports={CloseEvent:N,ErrorEvent:E,Event:w,EventTarget:B,MessageEvent:R};function I(d,v,C){typeof d=="object"&&d.handleEvent?d.handleEvent.call(d,C):d.call(v,C)}f(I,"be"),c(I,"callListener")}),Fe=X((e,s)=>{"use strict";var{tokenChars:t}=Ee();function n(m,x,o){m[x]===void 0?m[x]=[o]:m[x].push(o)}f(n,"A"),c(n,"push");function u(m){let x=Object.create(null),o=Object.create(null),p=!1,y=!1,k=!1,w,N,E=-1,R=-1,B=-1,I=0;for(;I<m.length;I++)if(R=m.charCodeAt(I),w===void 0)if(B===-1&&t[R]===1)E===-1&&(E=I);else if(I!==0&&(R===32||R===9))B===-1&&E!==-1&&(B=I);else if(R===59||R===44){if(E===-1)throw new SyntaxError(`Unexpected character at index ${I}`);B===-1&&(B=I);let v=m.slice(E,B);R===44?(n(x,v,o),o=Object.create(null)):w=v,E=B=-1}else throw new SyntaxError(`Unexpected character at index ${I}`);else if(N===void 0)if(B===-1&&t[R]===1)E===-1&&(E=I);else if(R===32||R===9)B===-1&&E!==-1&&(B=I);else if(R===59||R===44){if(E===-1)throw new SyntaxError(`Unexpected character at index ${I}`);B===-1&&(B=I),n(o,m.slice(E,B),!0),R===44&&(n(x,w,o),o=Object.create(null),w=void 0),E=B=-1}else if(R===61&&E!==-1&&B===-1)N=m.slice(E,I),E=B=-1;else throw new SyntaxError(`Unexpected character at index ${I}`);else if(y){if(t[R]!==1)throw new SyntaxError(`Unexpected character at index ${I}`);E===-1?E=I:p||(p=!0),y=!1}else if(k)if(t[R]===1)E===-1&&(E=I);else if(R===34&&E!==-1)k=!1,B=I;else if(R===92)y=!0;else throw new SyntaxError(`Unexpected character at index ${I}`);else if(R===34&&m.charCodeAt(I-1)===61)k=!0;else if(B===-1&&t[R]===1)E===-1&&(E=I);else if(E!==-1&&(R===32||R===9))B===-1&&(B=I);else if(R===59||R===44){if(E===-1)throw new SyntaxError(`Unexpected character at index ${I}`);B===-1&&(B=I);let v=m.slice(E,B);p&&(v=v.replace(/\\/g,""),p=!1),n(o,N,v),R===44&&(n(x,w,o),o=Object.create(null),w=void 0),N=void 0,E=B=-1}else throw new SyntaxError(`Unexpected character at index ${I}`);if(E===-1||k||R===32||R===9)throw new SyntaxError("Unexpected end of input");B===-1&&(B=I);let d=m.slice(E,B);return w===void 0?n(x,d,o):(N===void 0?n(o,d,!0):p?n(o,N,d.replace(/\\/g,"")):n(o,N,d),n(x,w,o)),x}f(u,"cs"),c(u,"parse");function b(m){return Object.keys(m).map(x=>{let o=m[x];return Array.isArray(o)||(o=[o]),o.map(p=>[x].concat(Object.keys(p).map(y=>{let k=p[y];return Array.isArray(k)||(k=[k]),k.map(w=>w===!0?y:`${y}=${w}`).join("; ")})).join("; ")).join(", ")}).join(", ")}f(b,"ls"),c(b,"format"),s.exports={format:b,parse:u}}),De=X((e,s)=>{"use strict";var t=q("events"),n=q("https"),u=q("http"),b=q("net"),m=q("tls"),{randomBytes:x,createHash:o}=q("crypto"),{Duplex:p,Readable:y}=q("stream"),{URL:k}=q("url"),w=Se(),N=nt(),E=ot(),{isBlob:R}=Ee(),{BINARY_TYPES:B,CLOSE_TIMEOUT:I,EMPTY_BUFFER:d,GUID:v,kForOnEventAttribute:C,kListener:L,kStatusCode:a,kWebSocket:i,NOOP:_}=ie(),{EventTarget:{addEventListener:r,removeEventListener:S}}=Dt(),{format:g,parse:$}=Fe(),{toBuffer:P}=Ce(),A=Symbol("kAborted"),M=[8,13],F=["CONNECTING","OPEN","CLOSING","CLOSED"],D=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,j=class G extends t{static{f(this,"e")}static{c(this,"WebSocket")}constructor(h,T,U){super(),this._binaryType=B[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=d,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=G.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,h!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,T===void 0?T=[]:Array.isArray(T)||(typeof T=="object"&&T!==null?(U=T,T=[]):T=[T]),re(this,h,T,U)):(this._autoPong=U.autoPong,this._closeTimeout=U.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(h){B.includes(h)&&(this._binaryType=h,this._receiver&&(this._receiver._binaryType=h))}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}get 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(h,T,U){let O=new N({allowSynchronousEvents:U.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:U.maxBufferedChunks,maxFragments:U.maxFragments,maxPayload:U.maxPayload,skipUTF8Validation:U.skipUTF8Validation}),V=new E(h,this._extensions,U.generateMask);this._receiver=O,this._sender=V,this._socket=h,O[i]=this,V[i]=this,h[i]=this,O.on("conclude",He),O.on("drain",Ye),O.on("error",Xe),O.on("message",Je),O.on("ping",Ze),O.on("pong",Ke),V.onerror=Qe,h.setTimeout&&h.setTimeout(0),h.setNoDelay&&h.setNoDelay(),T.length>0&&h.unshift(T),h.on("close",Ie),h.on("data",_e),h.on("end",Re),h.on("error",$e),this._readyState=G.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=G.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[w.extensionName]&&this._extensions[w.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=G.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(h,T){if(this.readyState!==G.CLOSED){if(this.readyState===G.CONNECTING){H(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===G.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=G.CLOSING,this._sender.close(h,T,!this._isServer,U=>{U||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),Be(this)}}pause(){this.readyState===G.CONNECTING||this.readyState===G.CLOSED||(this._paused=!0,this._socket.pause())}ping(h,T,U){if(this.readyState===G.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof h=="function"?(U=h,h=T=void 0):typeof T=="function"&&(U=T,T=void 0),typeof h=="number"&&(h=h.toString()),this.readyState!==G.OPEN){xe(this,h,U);return}T===void 0&&(T=!this._isServer),this._sender.ping(h||d,T,U)}pong(h,T,U){if(this.readyState===G.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof h=="function"?(U=h,h=T=void 0):typeof T=="function"&&(U=T,T=void 0),typeof h=="number"&&(h=h.toString()),this.readyState!==G.OPEN){xe(this,h,U);return}T===void 0&&(T=!this._isServer),this._sender.pong(h||d,T,U)}resume(){this.readyState===G.CONNECTING||this.readyState===G.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(h,T,U){if(this.readyState===G.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof T=="function"&&(U=T,T={}),typeof h=="number"&&(h=h.toString()),this.readyState!==G.OPEN){xe(this,h,U);return}let O={binary:typeof h!="string",mask:!this._isServer,compress:!0,fin:!0,...T};this._extensions[w.extensionName]||(O.compress=!1),this._sender.send(h||d,O,U)}terminate(){if(this.readyState!==G.CLOSED){if(this.readyState===G.CONNECTING){H(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=G.CLOSING,this._socket.destroy())}}};Object.defineProperty(j,"CONNECTING",{enumerable:!0,value:F.indexOf("CONNECTING")}),Object.defineProperty(j.prototype,"CONNECTING",{enumerable:!0,value:F.indexOf("CONNECTING")}),Object.defineProperty(j,"OPEN",{enumerable:!0,value:F.indexOf("OPEN")}),Object.defineProperty(j.prototype,"OPEN",{enumerable:!0,value:F.indexOf("OPEN")}),Object.defineProperty(j,"CLOSING",{enumerable:!0,value:F.indexOf("CLOSING")}),Object.defineProperty(j.prototype,"CLOSING",{enumerable:!0,value:F.indexOf("CLOSING")}),Object.defineProperty(j,"CLOSED",{enumerable:!0,value:F.indexOf("CLOSED")}),Object.defineProperty(j.prototype,"CLOSED",{enumerable:!0,value:F.indexOf("CLOSED")}),["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(l=>{Object.defineProperty(j.prototype,l,{enumerable:!0})}),["open","error","close","message"].forEach(l=>{Object.defineProperty(j.prototype,`on${l}`,{enumerable:!0,get(){for(let h of this.listeners(l))if(h[C])return h[L];return null},set(h){for(let T of this.listeners(l))if(T[C]){this.removeListener(l,T);break}typeof h=="function"&&this.addEventListener(l,h,{[C]:!0})}})}),j.prototype.addEventListener=r,j.prototype.removeEventListener=S,s.exports=j;function re(l,h,T,U){let O={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:I,protocolVersion:M[1],maxBufferedChunks:1048576,maxFragments:131072,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...U,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(l._autoPong=O.autoPong,l._closeTimeout=O.closeTimeout,!M.includes(O.protocolVersion))throw new RangeError(`Unsupported protocol version: ${O.protocolVersion} (supported versions: ${M.join(", ")})`);let V;if(h instanceof k)V=h;else try{V=new k(h)}catch{throw new SyntaxError(`Invalid URL: ${h}`)}V.protocol==="http:"?V.protocol="ws:":V.protocol==="https:"&&(V.protocol="wss:"),l._url=V.href;let le=V.protocol==="wss:",ce=V.protocol==="ws+unix:",me;if(V.protocol!=="ws:"&&!le&&!ce?me=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:ce&&!V.pathname?me="The URL's pathname is empty":V.hash&&(me="The URL contains a fragment identifier"),me){let W=new SyntaxError(me);if(l._redirects===0)throw W;ne(l,W);return}let et=le?443:80,tt=x(16).toString("base64"),rt=le?n.request:u.request,ge=new Set,ye;if(O.createConnection=O.createConnection||(le?we:ke),O.defaultPort=O.defaultPort||et,O.port=V.port||et,O.host=V.hostname.startsWith("[")?V.hostname.slice(1,-1):V.hostname,O.headers={...O.headers,"Sec-WebSocket-Version":O.protocolVersion,"Sec-WebSocket-Key":tt,Connection:"Upgrade",Upgrade:"websocket"},O.path=V.pathname+V.search,O.timeout=O.handshakeTimeout,O.perMessageDeflate&&(ye=new w({...O.perMessageDeflate,isServer:!1,maxPayload:O.maxPayload}),O.headers["Sec-WebSocket-Extensions"]=g({[w.extensionName]:ye.offer()})),T.length){for(let W of T){if(typeof W!="string"||!D.test(W)||ge.has(W))throw new SyntaxError("An invalid or duplicated subprotocol was specified");ge.add(W)}O.headers["Sec-WebSocket-Protocol"]=T.join(",")}if(O.origin&&(O.protocolVersion<13?O.headers["Sec-WebSocket-Origin"]=O.origin:O.headers.Origin=O.origin),(V.username||V.password)&&(O.auth=`${V.username}:${V.password}`),ce){let W=O.path.split(":");O.socketPath=W[0],O.path=W[1]}let z;if(O.followRedirects){if(l._redirects===0){l._originalIpc=ce,l._originalSecure=le,l._originalHostOrSocketPath=ce?O.socketPath:V.host;let W=U&&U.headers;if(U={...U,headers:{}},W)for(let[Y,he]of Object.entries(W))U.headers[Y.toLowerCase()]=he}else if(l.listenerCount("redirect")===0){let W=ce?l._originalIpc?O.socketPath===l._originalHostOrSocketPath:!1:l._originalIpc?!1:V.host===l._originalHostOrSocketPath;(!W||l._originalSecure&&!le)&&(delete O.headers.authorization,delete O.headers.cookie,W||delete O.headers.host,O.auth=void 0)}O.auth&&!U.headers.authorization&&(U.headers.authorization="Basic "+Buffer.from(O.auth).toString("base64")),z=l._req=rt(O),l._redirects&&l.emit("redirect",l.url,z)}else z=l._req=rt(O);O.timeout&&z.on("timeout",()=>{H(l,z,"Opening handshake has timed out")}),z.on("error",W=>{z===null||z[A]||(z=l._req=null,ne(l,W))}),z.on("response",W=>{let Y=W.headers.location,he=W.statusCode;if(Y&&O.followRedirects&&he>=300&&he<400){if(++l._redirects>O.maxRedirects){H(l,z,"Maximum redirects exceeded");return}z.abort();let ve;try{ve=new k(Y,h)}catch{let Ue=new SyntaxError(`Invalid URL: ${Y}`);ne(l,Ue);return}re(l,ve,T,U)}else l.emit("unexpected-response",z,W)||H(l,z,`Unexpected server response: ${W.statusCode}`)}),z.on("upgrade",(W,Y,he)=>{if(l.emit("upgrade",W),l.readyState!==j.CONNECTING)return;z=l._req=null;let ve=W.headers.upgrade;if(ve===void 0||ve.toLowerCase()!=="websocket"){H(l,Y,"Invalid Upgrade header");return}let Ue=o("sha1").update(tt+v).digest("base64");if(W.headers["sec-websocket-accept"]!==Ue){H(l,Y,"Invalid Sec-WebSocket-Accept header");return}let Oe=W.headers["sec-websocket-protocol"],be;if(Oe!==void 0?ge.size?ge.has(Oe)||(be="Server sent an invalid subprotocol"):be="Server sent a subprotocol but none was requested":ge.size&&(be="Server sent no subprotocol"),be){H(l,Y,be);return}Oe&&(l._protocol=Oe);let st=W.headers["sec-websocket-extensions"];if(st!==void 0){if(!ye){H(l,Y,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let Me;try{Me=$(st)}catch{H(l,Y,"Invalid Sec-WebSocket-Extensions header");return}let it=Object.keys(Me);if(it.length!==1||it[0]!==w.extensionName){H(l,Y,"Server indicated an extension that was not requested");return}try{ye.accept(Me[w.extensionName])}catch{H(l,Y,"Invalid Sec-WebSocket-Extensions header");return}l._extensions[w.extensionName]=ye}l.setSocket(Y,he,{allowSynchronousEvents:O.allowSynchronousEvents,generateMask:O.generateMask,maxBufferedChunks:O.maxBufferedChunks,maxFragments:O.maxFragments,maxPayload:O.maxPayload,skipUTF8Validation:O.skipUTF8Validation})}),O.finishRequest?O.finishRequest(z,l):z.end()}f(re,"Jt"),c(re,"initAsClient");function ne(l,h){l._readyState=j.CLOSING,l._errorEmitted=!0,l.emit("error",h),l.emitClose()}f(ne,"Te"),c(ne,"emitErrorAndClose");function ke(l){return l.path=l.socketPath,b.connect(l)}f(ke,"Ls"),c(ke,"netConnect");function we(l){return l.path=void 0,!l.servername&&l.servername!==""&&(l.servername=b.isIP(l.host)?"":l.host),m.connect(l)}f(we,"vs"),c(we,"tlsConnect");function H(l,h,T){l._readyState=j.CLOSING;let U=new Error(T);Error.captureStackTrace(U,H),h.setHeader?(h[A]=!0,h.abort(),h.socket&&!h.socket.destroyed&&h.socket.destroy(),process.nextTick(ne,l,U)):(h.destroy(U),h.once("error",l.emit.bind(l,"error")),h.once("close",l.emitClose.bind(l)))}f(H,"b"),c(H,"abortHandshake");function xe(l,h,T){if(h){let U=R(h)?h.size:P(h).length;l._socket?l._sender._bufferedBytes+=U:l._bufferedAmount+=U}if(T){let U=new Error(`WebSocket is not open: readyState ${l.readyState} (${F[l.readyState]})`);process.nextTick(T,U)}}f(xe,"Qe"),c(xe,"sendAfterClose");function He(l,h){let T=this[i];T._closeFrameReceived=!0,T._closeMessage=h,T._closeCode=l,T._socket[i]!==void 0&&(T._socket.removeListener("data",_e),process.nextTick(Le,T._socket),l===1005?T.close():T.close(l,h))}f(He,"As"),c(He,"receiverOnConclude");function Ye(){let l=this[i];l.isPaused||l._socket.resume()}f(Ye,"Rs"),c(Ye,"receiverOnDrain");function Xe(l){let h=this[i];h._socket[i]!==void 0&&(h._socket.removeListener("data",_e),process.nextTick(Le,h._socket),h.close(l[a])),h._errorEmitted||(h._errorEmitted=!0,h.emit("error",l))}f(Xe,"Bs"),c(Xe,"receiverOnError");function Pe(){this[i].emitClose()}f(Pe,"Ht"),c(Pe,"receiverOnFinish");function Je(l,h){this[i].emit("message",l,h)}f(Je,"Is"),c(Je,"receiverOnMessage");function Ze(l){let h=this[i];h._autoPong&&h.pong(l,!this._isServer,_),h.emit("ping",l)}f(Ze,"Ms"),c(Ze,"receiverOnPing");function Ke(l){this[i].emit("pong",l)}f(Ke,"Ps"),c(Ke,"receiverOnPong");function Le(l){l.resume()}f(Le,"Kt"),c(Le,"resume");function Qe(l){let h=this[i];h.readyState!==j.CLOSED&&(h.readyState===j.OPEN&&(h._readyState=j.CLOSING,Be(h)),this._socket.end(),h._errorEmitted||(h._errorEmitted=!0,h.emit("error",l)))}f(Qe,"Ds"),c(Qe,"senderOnError");function Be(l){l._closeTimer=setTimeout(l._socket.destroy.bind(l._socket),l._closeTimeout)}f(Be,"Zt"),c(Be,"setCloseTimer");function Ie(){let l=this[i];if(this.removeListener("close",Ie),this.removeListener("data",_e),this.removeListener("end",Re),l._readyState=j.CLOSING,!this._readableState.endEmitted&&!l._closeFrameReceived&&!l._receiver._writableState.errorEmitted&&this._readableState.length!==0){let h=this.read(this._readableState.length);l._receiver.write(h)}l._receiver.end(),this[i]=void 0,clearTimeout(l._closeTimer),l._receiver._writableState.finished||l._receiver._writableState.errorEmitted?l.emitClose():(l._receiver.on("error",Pe),l._receiver.on("finish",Pe))}f(Ie,"Qt"),c(Ie,"socketOnClose");function _e(l){this[i]._receiver.write(l)||this.pause()}f(_e,"Ne"),c(_e,"socketOnData");function Re(){let l=this[i];l._readyState=j.CLOSING,l._receiver.end(),this.end()}f(Re,"er"),c(Re,"socketOnEnd");function $e(){let l=this[i];this.removeListener("error",$e),this.on("error",_),l&&(l._readyState=j.CLOSING,this.destroy())}f($e,"tr"),c($e,"socketOnError")}),Wt=X((e,s)=>{"use strict";var t=De(),{Duplex:n}=q("stream");function u(o){o.emit("close")}f(u,"sr"),c(u,"emitClose");function b(){!this.destroyed&&this._writableState.finished&&this.destroy()}f(b,"$s"),c(b,"duplexOnEnd");function m(o){this.removeListener("error",m),this.destroy(),this.listenerCount("error")===0&&this.emit("error",o)}f(m,"nr"),c(m,"duplexOnError");function x(o,p){let y=!0,k=new n({...p,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return o.on("message",c(function(w,N){let E=!N&&k._readableState.objectMode?w.toString():w;k.push(E)||o.pause()},"message")),o.once("error",c(function(w){k.destroyed||(y=!1,k.destroy(w))},"error")),o.once("close",c(function(){k.destroyed||k.push(null)},"close")),k._destroy=function(w,N){if(o.readyState===o.CLOSED){N(w),process.nextTick(u,k);return}let E=!1;o.once("error",c(function(R){E=!0,N(R)},"error")),o.once("close",c(function(){E||N(w),process.nextTick(u,k)},"close")),y&&o.terminate()},k._final=function(w){if(o.readyState===o.CONNECTING){o.once("open",c(function(){k._final(w)},"open"));return}o._socket!==null&&(o._socket._writableState.finished?(w(),k._readableState.endEmitted&&k.destroy()):(o._socket.once("finish",c(function(){w()},"finish")),o.close()))},k._read=function(){o.isPaused&&o.resume()},k._write=function(w,N,E){if(o.readyState===o.CONNECTING){o.once("open",c(function(){k._write(w,N,E)},"open"));return}o.send(w,E)},k.on("end",b),k.on("error",m),k}f(x,"Fs"),c(x,"createWebSocketStream"),s.exports=x}),at=X((e,s)=>{"use strict";var{tokenChars:t}=Ee();function n(u){let b=new Set,m=-1,x=-1,o=0;for(o;o<u.length;o++){let y=u.charCodeAt(o);if(x===-1&&t[y]===1)m===-1&&(m=o);else if(o!==0&&(y===32||y===9))x===-1&&m!==-1&&(x=o);else if(y===44){if(m===-1)throw new SyntaxError(`Unexpected character at index ${o}`);x===-1&&(x=o);let k=u.slice(m,x);if(b.has(k))throw new SyntaxError(`The "${k}" subprotocol is duplicated`);b.add(k),m=x=-1}else throw new SyntaxError(`Unexpected character at index ${o}`)}if(m===-1||x!==-1)throw new SyntaxError("Unexpected end of input");let p=u.slice(m,o);if(b.has(p))throw new SyntaxError(`The "${p}" subprotocol is duplicated`);return b.add(p),b}f(n,"qs"),c(n,"parse"),s.exports={parse:n}}),jt=X((e,s)=>{"use strict";var t=q("events"),n=q("http"),{Duplex:u}=q("stream"),{createHash:b}=q("crypto"),m=Fe(),x=Se(),o=at(),p=De(),{CLOSE_TIMEOUT:y,GUID:k,kWebSocket:w}=ie(),N=/^[+/0-9A-Za-z]{22}==$/,E=0,R=1,B=2,I=class extends t{static{f(this,"tt")}static{c(this,"WebSocketServer")}constructor(i,_){if(super(),i={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:1024*1024,maxFragments:128*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:y,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:p,...i},i.port==null&&!i.server&&!i.noServer||i.port!=null&&(i.server||i.noServer)||i.server&&i.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(i.port!=null?(this._server=n.createServer((r,S)=>{let g=n.STATUS_CODES[426];S.writeHead(426,{"Content-Length":g.length,"Content-Type":"text/plain"}),S.end(g)}),this._server.listen(i.port,i.host,i.backlog,_)):i.server&&(this._server=i.server),this._server){let r=this.emit.bind(this,"connection");this._removeListeners=d(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:c((S,g,$)=>{this.handleUpgrade(S,g,$,r)},"upgrade")})}i.perMessageDeflate===!0&&(i.perMessageDeflate={}),i.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=i,this._state=E}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(i){if(this._state===B){i&&this.once("close",()=>{i(new Error("The server is not running"))}),process.nextTick(v,this);return}if(i&&this.once("close",i),this._state!==R)if(this._state=R,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(v,this):process.nextTick(v,this);else{let _=this._server;this._removeListeners(),this._removeListeners=this._server=null,_.close(()=>{v(this)})}}shouldHandle(i){if(this.options.path){let _=i.url.indexOf("?");if((_!==-1?i.url.slice(0,_):i.url)!==this.options.path)return!1}return!0}handleUpgrade(i,_,r,S){_.on("error",C);let g=i.headers["sec-websocket-key"],$=i.headers.upgrade,P=+i.headers["sec-websocket-version"];if(i.method!=="GET"){a(this,i,_,405,"Invalid HTTP method");return}if($===void 0||$.toLowerCase()!=="websocket"){a(this,i,_,400,"Invalid Upgrade header");return}if(g===void 0||!N.test(g)){a(this,i,_,400,"Missing or invalid Sec-WebSocket-Key header");return}if(P!==13&&P!==8){a(this,i,_,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(i)){L(_,400);return}let A=i.headers["sec-websocket-protocol"],M=new Set;if(A!==void 0)try{M=o.parse(A)}catch{a(this,i,_,400,"Invalid Sec-WebSocket-Protocol header");return}let F=i.headers["sec-websocket-extensions"],D={};if(this.options.perMessageDeflate&&F!==void 0){let j=new x({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let re=m.parse(F);re[x.extensionName]&&(j.accept(re[x.extensionName]),D[x.extensionName]=j)}catch{a(this,i,_,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let j={origin:i.headers[`${P===8?"sec-websocket-origin":"origin"}`],secure:!!(i.socket.authorized||i.socket.encrypted),req:i};if(this.options.verifyClient.length===2){this.options.verifyClient(j,(re,ne,ke,we)=>{if(!re)return L(_,ne||401,ke,we);this.completeUpgrade(D,g,M,i,_,r,S)});return}if(!this.options.verifyClient(j))return L(_,401)}this.completeUpgrade(D,g,M,i,_,r,S)}completeUpgrade(i,_,r,S,g,$,P){if(!g.readable||!g.writable)return g.destroy();if(g[w])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>E)return L(g,503);let A=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${b("sha1").update(_+k).digest("base64")}`],M=new this.options.WebSocket(null,void 0,this.options);if(r.size){let F=this.options.handleProtocols?this.options.handleProtocols(r,S):r.values().next().value;F&&(A.push(`Sec-WebSocket-Protocol: ${F}`),M._protocol=F)}if(i[x.extensionName]){let F=i[x.extensionName].params,D=m.format({[x.extensionName]:[F]});A.push(`Sec-WebSocket-Extensions: ${D}`),M._extensions=i}this.emit("headers",A,S),g.write(A.concat(`\r
|
|
2
2
|
`).join(`\r
|
|
3
|
-
`)),g.removeListener("error",
|
|
3
|
+
`)),g.removeListener("error",C),M.setSocket(g,$,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxBufferedChunks:this.options.maxBufferedChunks,maxFragments:this.options.maxFragments,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(M),M.on("close",()=>{this.clients.delete(M),this._shouldEmitClose&&!this.clients.size&&process.nextTick(v,this)})),P(M,S)}};s.exports=I;function d(i,_){for(let r of Object.keys(_))i.on(r,_[r]);return c(function(){for(let r of Object.keys(_))i.removeListener(r,_[r])},"removeListeners")}f(d,"Ks"),c(d,"addListeners");function v(i){i._state=B,i.emit("close")}f(v,"de"),c(v,"emitClose");function C(){this.destroy()}f(C,"ur"),c(C,"socketOnError");function L(i,_,r,S){r=r||n.STATUS_CODES[_],S={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(r),...S},i.once("finish",i.destroy),i.end(`HTTP/1.1 ${_} ${n.STATUS_CODES[_]}\r
|
|
4
4
|
`+Object.keys(S).map(g=>`${g}: ${S[g]}`).join(`\r
|
|
5
5
|
`)+`\r
|
|
6
6
|
\r
|
|
7
|
-
`+
|
|
8
|
-
`;dt(e,
|
|
9
|
-
`);s.length>1e4;)s.shift();if(
|
|
10
|
-
`)[0]??e.reason;return{id:J(),sessionId:s,timestamp:e.at,source:"client-runtime",category:"runtime",severity:"error",context:{sessionId:s,...
|
|
11
|
-
`).slice(0,2);for(let
|
|
7
|
+
`+r)}f(L,"he"),c(L,"abortHandshake");function a(i,_,r,S,g,$){if(i.listenerCount("wsClientError")){let P=new Error(g);Error.captureStackTrace(P,a),i.emit("wsClientError",P,r,_)}else L(r,S,g,$)}f(a,"G"),c(a,"abortHandshakeOrEmitwsClientError")}),lt="127.0.0.1",Vt="LENSMCP_WS_HOST",ct="LENSMCP_WS_PORT",Gt="LENSMCP_SESSION_ID";import{createServer as qt}from"node:net";var _r=se(Wt(),1),mr=se(Fe(),1),gr=se(Se(),1),yr=se(nt(),1),vr=se(ot(),1),br=se(at(),1),Sr=se(De(),1),zt=se(jt(),1);import{connect as Ht}from"node:net";import{createSocket as Yt}from"node:dgram";import{appendFileSync as Xt,renameSync as ht,statSync as Jt,unlinkSync as Zt}from"node:fs";var Kt=(()=>{let e=Number(process.env.LENSMCP_EVENT_MAX_BYTES);return Number.isFinite(e)&&e>0?e:50*1024*1024})(),ut=(()=>{let e=Number(process.env.LENSMCP_EVENT_MAX_FILES);return Number.isFinite(e)&&e>=1&&e<=20?Math.floor(e):5})(),Qt=1024*1024,We=0;function dt(e,s){if(We+=s,!(We<Qt)){We=0;try{if(Jt(e).size<=Kt)return}catch{return}try{Zt(`${e}.${ut}`)}catch{}for(let t=ut-1;t>=1;t--)try{ht(`${e}.${t}`,`${e}.${t+1}`)}catch{}try{ht(e,`${e}.1`)}catch{}}}f(dt,"hn"),c(dt,"rotateIfLarge");var Te=(()=>{let e=process.env.LENSMCP_EVENT_MAX_EPS;if(e==="off")return 1/0;let s=Number(e);return e!==void 0&&e!==""&&Number.isFinite(s)?s<=0?1/0:s:5})(),ft=Math.max(30,Te===1/0?0:Te*4),oe=new Map;function pt(e){if(Te===1/0)return 0;let s=Date.now(),t=oe.get(e);if(!t){if(oe.size>=2048){for(let[n,u]of oe)s-u.lastSeenAt>6e4&&oe.delete(n);oe.size>=2048&&oe.clear()}t={tokens:ft,lastRefillAt:s,suppressed:0,lastSeenAt:s},oe.set(e,t)}if(t.lastSeenAt=s,t.tokens=Math.min(ft,t.tokens+(s-t.lastRefillAt)/1e3*Te),t.lastRefillAt=s,t.tokens>=1){t.tokens-=1;let n=t.suppressed;return t.suppressed=0,n}return t.suppressed+=1,-1}f(pt,"pn"),c(pt,"floodAdmit");var ee;function _t(){if(ee!==void 0)return ee;let e=process.env.LENSMCP_EVENT_FILE;if(e)return ee=c(n=>{try{let u=pt(n.fingerprint);if(u<0)return;let b=JSON.stringify(u>0?{...n,raw:{...n.raw??{},floodSuppressed:u}}:n)+`
|
|
8
|
+
`;dt(e,b.length),Xt(e,b)}catch{}},"cachedEnvSink"),ee;let s=process.env.LENSMCP_UDS;if(s)return ee=mt(s),ee;let t=process.env.LENSMCP_IPC_SOCKET;if(t){let[n,u]=t.split(":"),b=Number(u);if(n&&Number.isFinite(b)){let m=Yt("udp4");return m.unref(),ee=c(x=>{try{let o=Buffer.from(JSON.stringify(x));m.send(o,b,n,()=>{})}catch{}},"cachedEnvSink"),ee}}return ee=null,null}f(_t,"yr"),c(_t,"resolveEnvSink");function mt(e){let s=[],t=null,n=!1,u=c(()=>{if(!(!t||!t.writable))for(;s.length>0;)t.write(s.shift())},"flush"),b=c(()=>{if(n||t)return;n=!0;let m=Ht(e);m.on("connect",()=>{n=!1,t=m,u()}),m.on("drain",u),m.on("error",()=>{n=!1,t=null}),m.on("close",()=>{t=null}),m.unref()},"open");return b(),m=>{for(s.push(JSON.stringify(m)+`
|
|
9
|
+
`);s.length>1e4;)s.shift();if(t&&t.writable){u();return}if(t){try{t.destroy()}catch{}t=null}b()}}f(mt,"mn"),c(mt,"udsEnvSink");var gt="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function yt(e,s){let t="",n=e;for(let u=s-1;u>=0;u--){let b=n%32;t=gt[b]+t,n=(n-b)/32}return t}f(yt,"_n"),c(yt,"encodeTime");function vt(e){let s=new Uint8Array(e);globalThis.crypto.getRandomValues(s);let t="";for(let n=0;n<e;n++)t+=gt[(s[n]??0)&31];return t}f(vt,"gn"),c(vt,"encodeRandom");function J(e=Date.now()){return yt(e,10)+vt(16)}f(J,"O"),c(J,"ulid");var de="REDACTED",er=["token","secret","password","passwd","apikey","credential","assertion","signature"],tr=new Set(["key","auth","authorization","jwt","code","sig","pwd","pass","session","sid","bearer","otp","cookie","set-cookie"]),rr=/^(?:(?:prompt|completion|total|input|output|cache|cached|cacheread|cachewrite|reasoning|thinking|max|min|remaining|used|billed)tokens|tokens?(?:count|used|limit|remaining))$/;function je(e){let s=e.toLowerCase();if(rr.test(s.replace(/[-_.]+/g,"")))return!1;if(er.some(t=>s.includes(t)))return!0;for(let t of s.split(/[-_.]+/))if(t&&tr.has(t))return!0;return!1}f(je,"nt"),c(je,"isSecretParam");var sr=/^([a-z][a-z0-9+.-]*:\/\/)[^/?#@\s]*@/i,ir=/([?&#])([^=&#\s]+)=([^&#\s]*)/g;function Ve(e){return e&&e.replace(sr,`$1${de}@`).replace(ir,(s,t,n)=>je(n)?`${t}${n}=${de}`:s)}f(Ve,"it"),c(Ve,"redactUrlParams");function fe(e){return e&&Ne(Ve(e),1024)}f(fe,"X"),c(fe,"redactUrl");var nr=/\beyJ[A-Za-z0-9_-]{6,}\.[A-Za-z0-9_-]{4,}\.[A-Za-z0-9_-]*/g,or=/\b(bearer|basic)\s+[A-Za-z0-9._~+/=-]{8,}/gi,ar=/\b(authorization|x-api-key|api-key|cookie|set-cookie|proxy-authorization)\b(\s*[:=]\s*)(["']?)((?:(?:bearer|basic)\s+)?[^\s"',;]{4,})\3/gi;function Z(e){return Ve(e).replace(ar,(s,t,n,u)=>`${t}${n}${u}${de}${u}`).replace(nr,de).replace(or,(s,t)=>`${t} ${de}`)}f(Z,"w"),c(Z,"redactText");function Ne(e,s){return e.length<=s?e:`${e.slice(0,s)}\u2026[lensmcp truncated: ${e.length-s} more chars]`}f(Ne,"ve"),c(Ne,"clip");function Q(e,s=4096){if(e!==void 0)return Ne(Z(e),s)}f(Q,"N"),c(Q,"safeText");function te(e){return Ne(Z(e),300)}f(te,"L"),c(te,"safeTitle");var lr=6,cr=64;function pe(e,s=0,t=lr){if(typeof e=="string")return Z(e);if(e===null||typeof e!="object"||s>=t)return e;if(Array.isArray(e)){let b=!1,m=e.map((x,o)=>{if(o>=cr)return x;let p=pe(x,s+1,t);return p!==x&&(b=!0),p});return b?m:e}let n=!1,u={};for(let[b,m]of Object.entries(e)){let x=je(b)&&m!==void 0&&m!==null?de:pe(m,s+1,t);x!==m&&(n=!0),u[b]=x}return n?u:e}f(pe,"F"),c(pe,"redactDeep");function bt(e){let s=2166136261;for(let t=0;t<e.length;t++)s^=e.charCodeAt(t),s=Math.imul(s,16777619);return(s>>>0).toString(16).padStart(8,"0")}f(bt,"vn"),c(bt,"fnv1a32");function K(e){let s=[e.kind,e.identity,e.file??"",e.detail??""];return`${e.kind}:${bt(s.join("|"))}`}f(K,"v"),c(K,"fingerprint");var hr="pending";function St(e,s=hr){let t=e.tabId?{tabId:e.tabId}:{};switch(e.kind){case"error":{let n=!e.stack&&!e.source&&(!e.message||e.message==="Script error."),u=e.name&&e.name!=="Error"?`${e.name}: `:"",b=n?"Uncaught cross-origin script error (no detail available \u2014 add crossorigin to the script tag)":e.message?`${u}${e.message}`:`Uncaught ${e.name??"error"}`;return{id:J(),sessionId:s,timestamp:e.at,source:"client-runtime",category:"runtime",severity:"error",context:{sessionId:s,...t},fingerprint:K({kind:"runtime",identity:`error:${kt(e.stack)}`,file:e.source,detail:e.message??e.name}),title:te(b),message:Q(e.stack??e.message),location:e.source?{file:fe(e.source),line:e.lineno,column:e.colno}:void 0,raw:{...e,...e.message?{message:Z(e.message)}:{},...e.stack?{stack:Q(e.stack)}:{},...e.source?{source:fe(e.source)}:{}}}}case"resource-error":{let n=e.url?fe(e.url):void 0;return{id:J(),sessionId:s,timestamp:e.at,source:"client-runtime",category:"runtime",severity:"error",context:{sessionId:s,...t},fingerprint:K({kind:"runtime",identity:`resource-error:${e.tagName}:${Ge(e.url??"")}`}),title:te(`Failed to load <${e.tagName}>${n?` ${n}`:""}`),...n?{relatedUrls:[n]}:{},raw:{...e,...n?{url:n}:{}}}}case"unhandledrejection":{let n=e.name&&e.name!=="Error"?`${e.name}: `:"",u=e.reason.split(`
|
|
10
|
+
`)[0]??e.reason;return{id:J(),sessionId:s,timestamp:e.at,source:"client-runtime",category:"runtime",severity:"error",context:{sessionId:s,...t},fingerprint:K({kind:"runtime",identity:`unhandledrejection:${e.reason.slice(0,80)}`}),title:te(`Unhandled promise rejection: ${n}${u}`),message:Q(e.stack??e.reason),raw:{...e,reason:Z(e.reason),...e.stack?{stack:Q(e.stack)}:{}}}}case"console":{let n=e.level==="error"?"error":e.level==="warn"?"warning":"info",u=pe(e.args),b=u.map(wt).join(" ");return{id:J(),sessionId:s,timestamp:e.at,source:"client-runtime",category:"runtime",severity:n,context:{sessionId:s,...t},fingerprint:K({kind:"runtime",identity:`console:${e.level}:${b.slice(0,80)}`}),title:`console.${e.level}`,message:Q(b),raw:{...e,args:u}}}case"fetch":{let n=e.error!==void 0||e.status!==void 0&&e.status>=400,u=fe(e.url),b=e.status!==void 0?` \u2192 ${e.status}${e.statusText?` ${e.statusText}`:""}`:"";return{id:J(),sessionId:s,timestamp:e.at,source:"client-runtime",category:"network",severity:n?"error":"info",context:{sessionId:s,...t},fingerprint:K({kind:"network",identity:`${e.method}:${Ge(e.url)}:${e.status??"err"}`}),title:te(`${e.method} ${u}${b}`),message:Q(e.error),relatedUrls:[u],raw:{...e,url:u}}}case"route":return{id:J(),sessionId:s,timestamp:e.at,source:"client-runtime",category:"runtime",severity:"info",context:{sessionId:s,url:e.url,...t},fingerprint:K({kind:"runtime",identity:`route:${e.url}`}),title:`Route \u2192 ${e.url}`,raw:e};case"ready":return{id:J(),sessionId:s,timestamp:e.at,source:"client-runtime",category:"runtime",severity:"info",context:{sessionId:s,url:e.url,...t},fingerprint:K({kind:"runtime",identity:"client-ready"}),title:"Client runtime ready",message:e.reloadCause?`${e.userAgent} \u2014 after a Vite full reload${e.reloadCause.triggeredBy?` triggered by ${Q(Z(e.reloadCause.triggeredBy))}`:""}`:e.userAgent,raw:e};case"hmr":{let n=e.triggeredBy?Z(e.triggeredBy):void 0,u=e.path?Z(e.path):void 0,b=e.event==="full-reload"?`full-reload:${n??u??"?"}`:e.event==="invalidate"?`invalidate:${u??"?"}`:e.event,m=e.event==="full-reload"?`Vite full reload${n?` \u2014 ${te(n)} could not hot-update`:u?` \u2014 ${te(u)}`:""}`:e.event==="update"?`Vite HMR update (${e.count??e.updates?.length??0} module${(e.count??e.updates?.length??0)===1?"":"s"})`:e.event==="invalidate"?`Vite HMR invalidate \u2014 ${te(u??"?")}`:e.event==="ws-disconnect"?"Vite HMR socket lost \u2014 the page will poll and reload":"Vite HMR socket connected";return{id:J(),sessionId:s,timestamp:e.at,source:"client-runtime",category:"build",severity:e.event==="full-reload"||e.event==="ws-disconnect"?"warning":"info",context:{sessionId:s,...t},fingerprint:K({kind:"hmr",identity:b}),title:m,...e.message?{message:Q(Z(e.message))}:{},...n||u?{location:{file:n??u??""}}:{},...e.updates?.length?{relatedFiles:e.updates.map(x=>Z(x))}:{},raw:{...e,...n?{triggeredBy:n}:{},...u?{path:u}:{}}}}case"gone":return{id:J(),sessionId:s,timestamp:e.at,source:"client-runtime",category:"runtime",severity:"info",context:{sessionId:s,...t},fingerprint:K({kind:"runtime",identity:"client-gone"}),title:"Client runtime gone",raw:e};case"publish":{if(!xt(e.source))return;let n=Et(e.category,e.raw),u=n&&n.status!==void 0&&n.status>=400?"error":e.severity??"info",b=c(x=>n&&n.url!==n.redactedUrl?x.split(n.url).join(n.redactedUrl):x,"scrub"),m=b(e.title);return{id:J(),sessionId:s,timestamp:e.at,source:e.source,category:e.category,severity:u,context:{...t,...e.context??{},sessionId:s},fingerprint:e.fingerprint?b(e.fingerprint):K({kind:"publish",identity:m}),title:te(m),message:Q(e.message),...n?{relatedUrls:[n.redactedUrl]}:{},raw:n?{...pe(e.raw),url:n.redactedUrl}:pe(e.raw)}}}}f(St,"xr"),c(St,"envelopeToEvent");function Et(e,s){if(e!=="network"||!s||typeof s!="object")return;let t=s;if(!(typeof t.url!="string"||t.url.length===0))return{url:t.url,redactedUrl:fe(t.url),...typeof t.status=="number"?{status:t.status}:{}}}f(Et,"Rn"),c(Et,"networkDetails");function kt(e){if(!e)return"unknown";let s=e.split(`
|
|
11
|
+
`).slice(0,2);for(let t of s){let n=t.match(/at\s+(\S+)/);if(n&&n[1])return n[1]}return"unknown"}f(kt,"Bn"),c(kt,"normaliseStackTopFrame");function Ge(e){try{return`${new URL(e,"http://x").pathname}`}catch{return e}}f(Ge,"Er"),c(Ge,"normaliseUrl");function wt(e){if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}f(wt,"In"),c(wt,"stringify");var ur=new Set(["react","valtio","memory","client-runtime"]);function xt(e){return typeof e=="string"&&ur.has(e)}f(xt,"Pn"),c(xt,"isBrowserPublishableSource");function Ot(e){let s;return t=>{if(e.bus){e.bus.publish(t);return}if(e.sink){e.sink(t);return}if(s===void 0&&(s=_t()),s){s(t);return}(t.severity==="error"||t.severity==="fatal")&&console.debug(`[lensmcp-bridge] ${t.severity}: ${t.title}`)}}f(Ot,"Fn"),c(Ot,"makePublisher");function qe(e,s,t){let n;try{n=JSON.parse(e)}catch{return}if(!(!n||typeof n!="object"||!("kind"in n))){if(n.kind==="batch"){if(!Array.isArray(n.events))return;for(let u of n.events.slice(0,1024))!u||typeof u!="object"||!("kind"in u)||u.kind!=="batch"&&ze(u,s,t);return}ze(n,s,t)}}f(qe,"br"),c(qe,"handleClientEnvelope");function ze(e,s,t){let n;try{n=St(e,t)}catch{return}if(n)try{s(n)}catch{}}f(ze,"wr"),c(ze,"mapAndPublish");function Ct(e){try{let s=JSON.parse(e);return typeof s?.tabId=="string"&&s.tabId?s.tabId:void 0}catch{return}}f(Ct,"Wn"),c(Ct,"readTabId");async function Tt(e={}){let s=e.host??lt,t=e.port??5747,n=t===0?await Nt():t,u=Ot(e),b=new zt.default({host:s,port:n,maxPayload:1048576});return b.on("connection",m=>{let x;m.on("message",o=>{let p=o.toString();x??=Ct(p),qe(p,u,e.sessionId)}),m.on("close",()=>{x&&qe(JSON.stringify({kind:"gone",at:Date.now(),tabId:x}),u,e.sessionId)})}),await new Promise((m,x)=>{let o=c(y=>{b.off("listening",p),x(y)},"onError"),p=c(()=>{b.off("error",o),m()},"onListening");b.once("error",o),b.once("listening",p)}),{port:n,host:s,close:c(()=>new Promise(m=>{b.close(()=>m())}),"close")}}f(Tt,"kr"),c(Tt,"createBridgeServer");function Nt(){return new Promise((e,s)=>{let t=qt();t.unref(),t.on("error",s),t.listen(0,()=>{let n=t.address();if(!n){t.close(),s(new Error("Could not allocate free port"));return}let u=n.port;t.close(()=>e(u))})})}f(Nt,"qn"),c(Nt,"findFreePort");async function Pt(){let e=process.env[Vt]??lt,s=process.env[ct],t=s!==void 0&&s!==""?Number(s):5747;(!Number.isFinite(t)||t<0)&&(console.error(`[lensmcp-bridge] invalid ${ct}=${s}`),process.exit(2));let n=process.env[Gt],u;try{u=await Tt({host:e,port:t,sessionId:n})}catch(x){console.error(`[lensmcp-bridge] failed to listen on ws://${e}:${t} \u2014 ${x.message}`),process.exit(1)}console.log(`[lensmcp-bridge] listening on ws://${u.host}:${u.port}`);let b=!1,m=c(()=>{b||(b=!0,u.close().then(()=>process.exit(0)))},"shutdown");process.on("SIGINT",m),process.on("SIGTERM",m)}f(Pt,"Vn"),c(Pt,"main"),Pt();
|