openpond 0.2.29 → 0.2.30
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/dist/app-server.js +1 -1
- package/dist/chunks/{app-server-runtime-SL7IFG2M.js → app-server-runtime-SNSNFJW7.js} +1 -1
- package/dist/chunks/{chunk-JPERN6WI.js → chunk-DDRIX3EP.js} +1 -1
- package/dist/chunks/{chunk-O2IWIXBH.js → chunk-GHGVF2KG.js} +1 -1
- package/dist/chunks/{chunk-7GN6B4NP.js → chunk-HMADUZ5P.js} +1 -1
- package/dist/chunks/{chunk-LYCKR4HT.js → chunk-N6HBB2EA.js} +3 -3
- package/dist/chunks/{cli-DBIRAAYU.js → cli-DCFZ4GT6.js} +1 -1
- package/dist/chunks/{src-MBP4EHYL.js → src-G3GYZMCL.js} +1 -1
- package/dist/chunks/{workspaces-ERYPHR26.js → workspaces-5PQMYPBV.js} +1 -1
- package/dist/cli.js +1 -1
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{i as a,j as b,k as c}from"./chunk-
|
|
2
|
+
import{i as a,j as b,k as c}from"./chunk-DDRIX3EP.js";import"./chunk-3YSCXFE6.js";import"./chunk-HMADUZ5P.js";import"./chunk-P57W2CB2.js";import"./chunk-MAMUNDBZ.js";import"./chunk-L3KS6MOV.js";import"./chunk-TOIG2PMH.js";import"./chunk-6MI4KKWF.js";import"./chunk-ETH4SZO6.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import"./chunk-J2S7BOZU.js";import"./chunk-2LSP2AAN.js";import"./chunk-6FA3GG5B.js";import"./chunk-F4WS5QIT.js";import"./chunk-ES2ISFJC.js";import"./chunk-H7IWJN7L.js";import"./chunk-FTQLQJQV.js";export{a as resolveWebLaunchMessages,c as runOpenPondAppServerCli,b as runOpenPondServerCli};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
3
|
-
import{a as tC,b as nC,c as rC,d as H,e as oC,f as ho,g as W,h as Mu,j as aC}from"./chunk-JPERN6WI.js";import{$ as Rx,$a as bT,$b as xu,$c as XA,A as W_,Aa as nT,Ab as FT,Ac as MA,B as z_,Ba as rT,Bb as UT,Bc as bh,C as V_,Ca as As,Cb as zT,Cc as jA,D as X_,Da as Cs,Db as VT,Dc as Sh,E as cx,Ea as oT,Eb as _u,Ec as HA,F as dx,Fa as aT,Fb as JT,Fc as OA,G as lx,Ga as sT,Gb as GT,Gc as DA,H as ux,Ha as iT,Hb as KT,Hc as BA,I as px,Ia as cT,Ib as YT,Ic as $A,J as mx,Ja as dT,Jb as XT,Jc as go,K as pu,Ka as lT,Kb as hh,Kc as jr,L as fx,La as po,Lb as QT,Lc as Ih,M as mu,Ma as uT,Mb as ZT,Mc as LA,N as gx,Na as pT,Nb as eA,Nc as NA,O as hx,Oa as fh,Ob as tA,Oc as Cu,P as wx,Pa as mT,Pb as nA,Pc as js,Q as Ps,Qa as _c,Qb as rA,Qc as FA,R as fu,Ra as fT,Rb as oA,Rc as Eu,S as Sc,Sa as Es,Sb as aA,Sc as UA,T as dh,Ta as gT,Tb as sA,Tc as qA,U as ra,Ua as hT,Ub as iA,Uc as WA,V as yx,Va as wT,Vb as cA,Vc as zA,W as vx,Wa as yT,Wb as dA,Wc as VA,X as kx,Xa as ae,Xb as lA,Xc as JA,Y as bx,Ya as vT,Yb as uA,Yc as GA,Z as Sx,Za as kT,Zb as pA,Zc as KA,_ as Ix,_a as Su,_b as mA,_c as YA,a as ES,aa as gu,ab as ST,ac as fA,ad as QA,b as MS,ba as hu,bb as IT,bc as oa,bd as ZA,c as jS,ca as _s,cb as RT,cc as Tu,d as HS,da as wu,db as PT,dc as gA,dd as eC,e as OS,ea as Px,eb as Iu,ec as fo,f as Pl,fa as _x,fb as _T,fc as Au,g as US,ga as xx,gb as mo,gc as hA,h as qS,ha as yu,hb as Ae,hc as wA,i as WS,ia as Tx,ib as xT,ic as wh,j as zS,ja as Ax,jb as pe,jc as yh,k as VS,ka as Cx,kb as TT,kc as yA,l as jg,la as Ex,lb as AT,lc as vA,m as KS,ma as Mx,mb as CT,mc as kA,n as YS,na as vu,nb as ET,nc as bA,o as XS,oa as jx,ob as MT,oc as vh,p as QS,pa as Hx,pb as jT,pc as SA,q as ZS,qa as Ox,qb as HT,qc as kh,r as eI,ra as Dx,rb as OT,rc as IA,s as Yo,sa as Bx,sb as DT,sc as RA,t as tI,ta as Rc,tb as BT,tc as PA,u as nI,ua as Xx,ub as $T,uc as _A,v as Tl,va as Qx,vb as Ms,vc as xA,w as rI,wa as Zx,wb as $n,wc as TA,x as oI,xa as eT,xb as He,xc as AA,y as gq,ya as tT,yb as LT,yc as CA,z as q_,za as Pc,zb as NT,zc as EA}from"./chunk-LYCKR4HT.js";import{A as Wx,C as ku,F as bu,G as ur,H as zx,I as lh,J as Vx,K as uh,N as Jx,O as ph,P as Gx,Q as Kx,R as Yx,S as mh,T as Ts,b as lr,d as $x,e as Lx,h as Nx,m as xs,n as Fx,p as Ux,q as qx,s as Ic}from"./chunk-O2IWIXBH.js";import{a as dt,b as J_,c as G_,f as K_,s as Y_,u as gh,v as qT,w as Ru,x as Pu,y as WT}from"./chunk-3YSCXFE6.js";import{a as F_,b as du,d as ie,e as ct,f as Rs,g as ne,i as U_}from"./chunk-7GN6B4NP.js";import{a as cn,b as Q_,c as Z_,d as lu,e as uu,g as ex,h as tx,i as nx,j as rx,k as ox,l as ax,m as sx,n as ix}from"./chunk-P57W2CB2.js";import{$ as OR,$b as FP,$c as Be,A as RR,Aa as We,Ab as hc,Ac as Zl,Ad as ta,B as Fl,Ba as Vl,Bb as RP,Bd as I_,C as PR,Ca as zR,Cc as oh,Cd as Mr,D as Wg,Da as Kg,Db as PP,Dc as o_,Dd as R_,E as _R,Eb as _P,Ec as a_,Ed as P_,F as xR,Fa as VR,Fb as xP,Fd as __,G as nt,Gd as lo,H as TR,Ha as JR,Hb as ys,Hc as eu,Hd as Ss,I as vt,Ib as TP,Ic as s_,Id as ou,J as fc,Ja as Jl,Jc as ah,Jd as x_,K as AR,Ka as GR,Kb as wc,Kc as cr,Kd as T_,L as CR,Lb as Xl,Lc as i_,Ld as A_,Ma as KR,Mb as AP,Mc as c_,Md as kc,N as ER,Na as YR,Nb as Qg,Nc as sh,Nd as Is,Oa as XR,Ob as CP,Oc as vc,Od as au,P as MR,Pa as QR,Pb as EP,Pc as d_,Pd as C_,Q as jR,Qa as ZR,Qb as Zg,Qc as tu,Qd as su,R as Bn,Ra as eP,Rb as MP,Rc as l_,Rd as uo,Sa as tP,Sb as jP,Sc as u_,Sd as E_,Ta as nP,Tb as HP,Tc as vs,Td as M_,Ua as rP,Ub as OP,Uc as p_,Ud as j_,Va as co,Vb as DP,Vc as ks,Vd as iu,W as HR,Wb as BP,Wc as m_,Wd as H_,Xa as oP,Xb as $P,Xc as f_,Xd as bc,Y as Ul,Ya as aP,Yb as eh,Yc as ih,Yd as O_,Z as zg,Za as sP,Zb as LP,Zc as nu,Zd as D_,_ as ql,_a as iP,_b as NP,_c as g_,ab as cP,ac as UP,ad as ru,ba as Vg,bb as Gl,bc as th,bd as h_,c as uR,ca as DR,cb as dP,cc as qP,cd as w_,da as Nt,db as lP,dc as WP,dd as y_,ea as Qo,eb as uP,ec as zP,ed as ch,fa as Zo,fb as pP,fc as VP,fd as v_,ga as Jg,gb as mP,gc as JP,gd as k_,ge as cu,ha as BR,hb as fP,hc as GP,hd as b_,he as B_,ia as $R,ib as gP,ic as KP,ie as $_,ja as LR,jb as hP,jc as YP,jd as bs,je as dr,ka as NR,kb as wP,kc as XP,kd as S_,ke as L_,l as pR,la as FR,lb as yP,lc as QP,le as na,m as mR,ma as UR,mb as vP,mc as nh,me as N_,n as fR,na as Wl,nb as kP,nc as ea,ob as bP,oc as ZP,pa as zl,pb as Yg,pc as e_,q as gR,qb as Kl,qc as t_,r as hR,rb as SP,s as wR,sb as ir,sc as Ql,t as yR,tb as Er,tc as n_,u as vR,ub as Xg,v as qg,vb as Yl,vc as r_,w as kR,wa as qR,wb as IP,wc as yc,x as bR,xb as Ft,xc as rh,y as SR,ya as WR,yb as gc,z as IR,za as Gg}from"./chunk-MAMUNDBZ.js";import{a as hI,c as ZI,h as eR}from"./chunk-XLF7VRKY.js";import{b as DS,c as BS}from"./chunk-L3KS6MOV.js";import"./chunk-XEOEKFG6.js";import{A as pc,B as Ng,C as Nl,D as oR,E as aR,I as sR,J as iR,N as ws,O as mc,P as cR,Q as dR,R as lR,T as Fg,V as Ug,i as tR,t as nR,u as rR,v as Kt,w as Ll,z as Cr}from"./chunk-TOIG2PMH.js";import"./chunk-6MI4KKWF.js";import{A as Hg,Aa as _I,Ac as Dl,B as sI,Bc as Bl,C as iI,Ca as ms,Cb as OI,Cc as $l,D as cI,Dc as JI,E as Cl,Eb as DI,Ec as Lg,F as dI,Fa as xI,Fb as BI,Fc as GI,G as lI,H as uI,Ha as TI,Hc as KI,I as pI,Ic as YI,Jc as XI,Kc as io,Lc as QI,Mc as sr,Nb as $I,Pa as Dn,Q as mI,Qa as AI,Qb as LI,R as fI,Ra as Ml,Sa as sn,V as gI,Va as CI,Vb as NI,_a as EI,_b as gs,a as $S,ab as Dg,b as LS,bb as je,c as kn,cb as Xo,db as Ze,f as NS,fa as wI,fc as $g,g as Rl,gc as FI,h as FS,hb as MI,jc as UI,kb as uc,kc as Hl,lb as jI,m as _l,ma as yI,mb as jl,mc as Ol,na as vI,nc as qI,o as JS,oa as kI,ob as HI,pa as bI,pb as Bg,pc as WI,qa as SI,qb as fs,ra as El,sa as Og,ta as II,u as xl,ua as RI,v as GS,va as PI,w as aI,x as Al,xc as hs,yc as zI,zc as VI}from"./chunk-ETH4SZO6.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import{D as ps,E as dc,F as Il,d as Sl,m as AS,n as so,o as Je,p as CS}from"./chunk-JPCPNW6T.js";import"./chunk-J2S7BOZU.js";import{$a as bl,$b as xS,Da as fq,Ea as kS,Fa as Eg,Ga as Mg,Ia as bS,Lb as Ge,Mb as Gt,Pa as SS,S as vl,Sb as _S,Ta as IS,Ua as RS,a as an,bc as TS,hb as PS,qa as wS,ra as kl,ta as yS,wa as vS}from"./chunk-2LSP2AAN.js";import{a as lc}from"./chunk-6FA3GG5B.js";import{A as Et,B as Jo,C as Gb,D as cc,E as Tr,F as fl,G as Kb,Ga as ao,H as gl,I as Yb,Ia as Go,J as ds,L as Xb,M as Qb,N as Zb,Na as iS,O as eS,Oa as cS,P as tS,Pa as dS,Qa as lS,Ta as uS,Va as Ag,W as Tg,Wa as Cg,Xa as pS,ca as nS,f as ll,ga as oo,ia as rS,ib as wl,jb as mS,k as is,ka as oS,l as cs,la as aS,m as _g,ma as sS,n as ul,nb as fS,o as it,ob as gS,p as xg,q as pl,qb as Ko,rb as hS,sb as yl,t as Ve,u as Se,v as O,w as Vb,y as Jb,z as ml}from"./chunk-F4WS5QIT.js";import{a as Vo,b as _}from"./chunk-ES2ISFJC.js";import{a as qb,c as zo,f as Wb,h as dl,i as zb,p as ls,q as hl,r as Ar,s as us}from"./chunk-H7IWJN7L.js";import{a,b as Pe,c as Te,e as On}from"./chunk-FTQLQJQV.js";var Wr=Te((Zme,_j)=>{"use strict";var Rj=["nodebuffer","arraybuffer","fragments"],Pj=typeof Blob<"u";Pj&&Rj.push("blob");_j.exports={BINARY_TYPES:Rj,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:Pj,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:a(()=>{},"NOOP")}});var Xc=Te((tfe,_p)=>{"use strict";var{EMPTY_BUFFER:R6}=Wr(),Xw=Buffer[Symbol.species];function P6(e,t){if(e.length===0)return R6;if(e.length===1)return e[0];let n=Buffer.allocUnsafe(t),r=0;for(let o=0;o<e.length;o++){let s=e[o];n.set(s,r),r+=s.length}return r<t?new Xw(n.buffer,n.byteOffset,r):n}a(P6,"concat");function xj(e,t,n,r,o){for(let s=0;s<o;s++)n[r+s]=e[s]^t[s&3]}a(xj,"_mask");function Tj(e,t){for(let n=0;n<e.length;n++)e[n]^=t[n&3]}a(Tj,"_unmask");function _6(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}a(_6,"toArrayBuffer");function Qw(e){if(Qw.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new Xw(e):ArrayBuffer.isView(e)?t=new Xw(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),Qw.readOnly=!1),t}a(Qw,"toBuffer");_p.exports={concat:P6,mask:xj,toArrayBuffer:_6,toBuffer:Qw,unmask:Tj};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=Pe("bufferutil");_p.exports.mask=function(t,n,r,o,s){s<48?xj(t,n,r,o,s):e.mask(t,n,r,o,s)},_p.exports.unmask=function(t,n){t.length<32?Tj(t,n):e.unmask(t,n)}}catch{}});var Ej=Te((rfe,Cj)=>{"use strict";var Aj=Symbol("kDone"),Zw=Symbol("kRun"),ey=class{static{a(this,"Limiter")}constructor(t){this[Aj]=()=>{this.pending--,this[Zw]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[Zw]()}[Zw](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[Aj])}}};Cj.exports=ey});var li=Te((afe,Oj)=>{"use strict";var Qc=Pe("zlib"),Mj=Xc(),x6=Ej(),{kStatusCode:jj}=Wr(),T6=Buffer[Symbol.species],A6=Buffer.from([0,0,255,255]),Tp=Symbol("permessage-deflate"),zr=Symbol("total-length"),ci=Symbol("callback"),Co=Symbol("buffers"),di=Symbol("error"),xp,ty=class{static{a(this,"PerMessageDeflate")}constructor(t){if(this._options=t||{},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,!xp){let n=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;xp=new x6(n)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[ci];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let n=this._options,r=t.find(o=>!(n.serverNoContextTakeover===!1&&o.server_no_context_takeover||o.server_max_window_bits&&(n.serverMaxWindowBits===!1||typeof n.serverMaxWindowBits=="number"&&n.serverMaxWindowBits>o.server_max_window_bits)||typeof n.clientMaxWindowBits=="number"&&!o.client_max_window_bits));if(!r)throw new Error("None of the extension offers can be accepted");return n.serverNoContextTakeover&&(r.server_no_context_takeover=!0),n.clientNoContextTakeover&&(r.client_no_context_takeover=!0),typeof n.serverMaxWindowBits=="number"&&(r.server_max_window_bits=n.serverMaxWindowBits),typeof n.clientMaxWindowBits=="number"?r.client_max_window_bits=n.clientMaxWindowBits:(r.client_max_window_bits===!0||n.clientMaxWindowBits===!1)&&delete r.client_max_window_bits,r}acceptAsClient(t){let n=t[0];if(this._options.clientNoContextTakeover===!1&&n.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!n.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(n.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&n.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return n}normalizeParams(t){return t.forEach(n=>{Object.keys(n).forEach(r=>{let o=n[r];if(o.length>1)throw new Error(`Parameter "${r}" must have only a single value`);if(o=o[0],r==="client_max_window_bits"){if(o!==!0){let s=+o;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${r}": ${o}`);o=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${r}": ${o}`)}else if(r==="server_max_window_bits"){let s=+o;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${r}": ${o}`);o=s}else if(r==="client_no_context_takeover"||r==="server_no_context_takeover"){if(o!==!0)throw new TypeError(`Invalid value for parameter "${r}": ${o}`)}else throw new Error(`Unknown parameter "${r}"`);n[r]=o})}),t}decompress(t,n,r){xp.add(o=>{this._decompress(t,n,(s,i)=>{o(),r(s,i)})})}compress(t,n,r){xp.add(o=>{this._compress(t,n,(s,i)=>{o(),r(s,i)})})}_decompress(t,n,r){let o=this._isServer?"client":"server";if(!this._inflate){let s=`${o}_max_window_bits`,i=typeof this.params[s]!="number"?Qc.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=Qc.createInflateRaw({...this._options.zlibInflateOptions,windowBits:i}),this._inflate[Tp]=this,this._inflate[zr]=0,this._inflate[Co]=[],this._inflate.on("error",E6),this._inflate.on("data",Hj)}this._inflate[ci]=r,this._inflate.write(t),n&&this._inflate.write(A6),this._inflate.flush(()=>{let s=this._inflate[di];if(s){this._inflate.close(),this._inflate=null,r(s);return}let i=Mj.concat(this._inflate[Co],this._inflate[zr]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[zr]=0,this._inflate[Co]=[],n&&this.params[`${o}_no_context_takeover`]&&this._inflate.reset()),r(null,i)})}_compress(t,n,r){let o=this._isServer?"server":"client";if(!this._deflate){let s=`${o}_max_window_bits`,i=typeof this.params[s]!="number"?Qc.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=Qc.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:i}),this._deflate[zr]=0,this._deflate[Co]=[],this._deflate.on("data",C6)}this._deflate[ci]=r,this._deflate.write(t),this._deflate.flush(Qc.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=Mj.concat(this._deflate[Co],this._deflate[zr]);n&&(s=new T6(s.buffer,s.byteOffset,s.length-4)),this._deflate[ci]=null,this._deflate[zr]=0,this._deflate[Co]=[],n&&this.params[`${o}_no_context_takeover`]&&this._deflate.reset(),r(null,s)})}};Oj.exports=ty;function C6(e){this[Co].push(e),this[zr]+=e.length}a(C6,"deflateOnData");function Hj(e){if(this[zr]+=e.length,this[Tp]._maxPayload<1||this[zr]<=this[Tp]._maxPayload){this[Co].push(e);return}this[di]=new RangeError("Max payload size exceeded"),this[di].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[di][jj]=1009,this.removeListener("data",Hj),this.reset()}a(Hj,"inflateOnData");function E6(e){if(this[Tp]._inflate=null,this[di]){this[ci](this[di]);return}e[jj]=1007,this[ci](e)}a(E6,"inflateOnError")});var ui=Te((ife,Ap)=>{"use strict";var{isUtf8:Dj}=Pe("buffer"),{hasBlob:M6}=Wr(),j6=[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 H6(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}a(H6,"isValidStatusCode");function ny(e){let t=e.length,n=0;for(;n<t;)if((e[n]&128)===0)n++;else if((e[n]&224)===192){if(n+1===t||(e[n+1]&192)!==128||(e[n]&254)===192)return!1;n+=2}else if((e[n]&240)===224){if(n+2>=t||(e[n+1]&192)!==128||(e[n+2]&192)!==128||e[n]===224&&(e[n+1]&224)===128||e[n]===237&&(e[n+1]&224)===160)return!1;n+=3}else if((e[n]&248)===240){if(n+3>=t||(e[n+1]&192)!==128||(e[n+2]&192)!==128||(e[n+3]&192)!==128||e[n]===240&&(e[n+1]&240)===128||e[n]===244&&e[n+1]>143||e[n]>244)return!1;n+=4}else return!1;return!0}a(ny,"_isValidUTF8");function O6(e){return M6&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&(e[Symbol.toStringTag]==="Blob"||e[Symbol.toStringTag]==="File")}a(O6,"isBlob");Ap.exports={isBlob:O6,isValidStatusCode:H6,isValidUTF8:ny,tokenChars:j6};if(Dj)Ap.exports.isValidUTF8=function(e){return e.length<24?ny(e):Dj(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=Pe("utf-8-validate");Ap.exports.isValidUTF8=function(t){return t.length<32?ny(t):e(t)}}catch{}});var iy=Te((dfe,qj)=>{"use strict";var{Writable:D6}=Pe("stream"),Bj=li(),{BINARY_TYPES:B6,EMPTY_BUFFER:$j,kStatusCode:$6,kWebSocket:L6}=Wr(),{concat:ry,toArrayBuffer:N6,unmask:F6}=Xc(),{isValidStatusCode:U6,isValidUTF8:Lj}=ui(),Cp=Buffer[Symbol.species],xn=0,Nj=1,Fj=2,Uj=3,oy=4,ay=5,Ep=6,sy=class extends D6{static{a(this,"Receiver")}constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||B6[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxBufferedChunks=t.maxBufferedChunks|0,this._maxFragments=t.maxFragments|0,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[L6]=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._numFragments=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=xn}_write(t,n,r){if(this._opcode===8&&this._state==xn)return r();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){r(this.createError(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(r)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let r=this._buffers[0];return this._buffers[0]=new Cp(r.buffer,r.byteOffset+t,r.length-t),new Cp(r.buffer,r.byteOffset,t)}let n=Buffer.allocUnsafe(t);do{let r=this._buffers[0],o=n.length-t;t>=r.length?n.set(this._buffers.shift(),o):(n.set(new Uint8Array(r.buffer,r.byteOffset,t),o),this._buffers[0]=new Cp(r.buffer,r.byteOffset+t,r.length-t)),t-=r.length}while(t>0);return n}startLoop(t){this._loop=!0;do switch(this._state){case xn:this.getInfo(t);break;case Nj:this.getPayloadLength16(t);break;case Fj:this.getPayloadLength64(t);break;case Uj:this.getMask();break;case oy:this.getData(t);break;case ay:case Ep:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let n=this.consume(2);if((n[0]&48)!==0){let o=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(o);return}let r=(n[0]&64)===64;if(r&&!this._extensions[Bj.extensionName]){let o=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(o);return}if(this._fin=(n[0]&128)===128,this._opcode=n[0]&15,this._payloadLength=n[1]&127,this._opcode===0){if(r){let o=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(o);return}if(!this._fragmented){let o=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(o);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let o=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(o);return}this._compressed=r}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let o=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(o);return}if(r){let o=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(o);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let o=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(o);return}}else{let o=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(o);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(n[1]&128)===128,this._isServer){if(!this._masked){let o=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(o);return}}else if(this._masked){let o=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(o);return}this._payloadLength===126?this._state=Nj:this._payloadLength===127?this._state=Fj:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let n=this.consume(8),r=n.readUInt32BE(0);if(r>Math.pow(2,21)-1){let o=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(o);return}this._payloadLength=r*Math.pow(2,32)+n.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let n=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(n);return}this._masked?this._state=Uj:this._state=oy}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=oy}getData(t){let n=$j;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}n=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&F6(n,this._mask)}if(this._opcode>7){this.controlMessage(n,t);return}if(this._maxFragments>0&&++this._numFragments>this._maxFragments){let r=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");t(r);return}if(this._compressed){this._state=ay,this.decompress(n,t);return}n.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(n)),this.dataMessage(t)}decompress(t,n){this._extensions[Bj.extensionName].decompress(t,this._fin,(o,s)=>{if(o)return n(o);if(s.length){if(this._messageLength+=s.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let i=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");n(i);return}this._fragments.push(s)}this.dataMessage(n),this._state===xn&&this.startLoop(n)})}dataMessage(t){if(!this._fin){this._state=xn;return}let n=this._messageLength,r=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._numFragments=0,this._fragments=[],this._opcode===2){let o;this._binaryType==="nodebuffer"?o=ry(r,n):this._binaryType==="arraybuffer"?o=N6(ry(r,n)):this._binaryType==="blob"?o=new Blob(r):o=r,this._allowSynchronousEvents?(this.emit("message",o,!0),this._state=xn):(this._state=Ep,setImmediate(()=>{this.emit("message",o,!0),this._state=xn,this.startLoop(t)}))}else{let o=ry(r,n);if(!this._skipUTF8Validation&&!Lj(o)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(s);return}this._state===ay||this._allowSynchronousEvents?(this.emit("message",o,!1),this._state=xn):(this._state=Ep,setImmediate(()=>{this.emit("message",o,!1),this._state=xn,this.startLoop(t)}))}}controlMessage(t,n){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,$j),this.end();else{let r=t.readUInt16BE(0);if(!U6(r)){let s=this.createError(RangeError,`invalid status code ${r}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");n(s);return}let o=new Cp(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!Lj(o)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");n(s);return}this._loop=!1,this.emit("conclude",r,o),this.end()}this._state=xn;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=xn):(this._state=Ep,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=xn,this.startLoop(n)}))}createError(t,n,r,o,s){this._loop=!1,this._errored=!0;let i=new t(r?`Invalid WebSocket frame: ${n}`:n);return Error.captureStackTrace(i,this.createError),i.code=s,i[$6]=o,i}};qj.exports=sy});var ly=Te((pfe,Vj)=>{"use strict";var{Duplex:ufe}=Pe("stream"),{randomFillSync:q6}=Pe("crypto"),{types:{isUint8Array:W6}}=Pe("util"),Wj=li(),{EMPTY_BUFFER:z6,kWebSocket:V6,NOOP:J6}=Wr(),{isBlob:pi,isValidStatusCode:G6}=ui(),{mask:zj,toBuffer:ha}=Xc(),Tn=Symbol("kByteLength"),K6=Buffer.alloc(4),Mp=8*1024,wa,mi=Mp,Un=0,Y6=1,X6=2,cy=class e{static{a(this,"Sender")}constructor(t,n,r){this._extensions=n||{},r&&(this._generateMask=r,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=Un,this.onerror=J6,this[V6]=void 0}static frame(t,n){let r,o=!1,s=2,i=!1;n.mask&&(r=n.maskBuffer||K6,n.generateMask?n.generateMask(r):(mi===Mp&&(wa===void 0&&(wa=Buffer.alloc(Mp)),q6(wa,0,Mp),mi=0),r[0]=wa[mi++],r[1]=wa[mi++],r[2]=wa[mi++],r[3]=wa[mi++]),i=(r[0]|r[1]|r[2]|r[3])===0,s=6);let c;typeof t=="string"?(!n.mask||i)&&n[Tn]!==void 0?c=n[Tn]:(t=Buffer.from(t),c=t.length):(c=t.length,o=n.mask&&n.readOnly&&!i);let d=c;c>=65536?(s+=8,d=127):c>125&&(s+=2,d=126);let l=Buffer.allocUnsafe(o?c+s:s);return l[0]=n.fin?n.opcode|128:n.opcode,n.rsv1&&(l[0]|=64),l[1]=d,d===126?l.writeUInt16BE(c,2):d===127&&(l[2]=l[3]=0,l.writeUIntBE(c,4,6)),n.mask?(l[1]|=128,l[s-4]=r[0],l[s-3]=r[1],l[s-2]=r[2],l[s-1]=r[3],i?[l,t]:o?(zj(t,r,l,s,c),[l]):(zj(t,r,t,0,c),[l,t])):[l,t]}close(t,n,r,o){let s;if(t===void 0)s=z6;else{if(typeof t!="number"||!G6(t))throw new TypeError("First argument must be a valid error code number");if(n===void 0||!n.length)s=Buffer.allocUnsafe(2),s.writeUInt16BE(t,0);else{let c=Buffer.byteLength(n);if(c>123)throw new RangeError("The message must not be greater than 123 bytes");if(s=Buffer.allocUnsafe(2+c),s.writeUInt16BE(t,0),typeof n=="string")s.write(n,2);else if(W6(n))s.set(n,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let i={[Tn]:s.length,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Un?this.enqueue([this.dispatch,s,!1,i,o]):this.sendFrame(e.frame(s,i),o)}ping(t,n,r){let o,s;if(typeof t=="string"?(o=Buffer.byteLength(t),s=!1):pi(t)?(o=t.size,s=!1):(t=ha(t),o=t.length,s=ha.readOnly),o>125)throw new RangeError("The data size must not be greater than 125 bytes");let i={[Tn]:o,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};pi(t)?this._state!==Un?this.enqueue([this.getBlobData,t,!1,i,r]):this.getBlobData(t,!1,i,r):this._state!==Un?this.enqueue([this.dispatch,t,!1,i,r]):this.sendFrame(e.frame(t,i),r)}pong(t,n,r){let o,s;if(typeof t=="string"?(o=Buffer.byteLength(t),s=!1):pi(t)?(o=t.size,s=!1):(t=ha(t),o=t.length,s=ha.readOnly),o>125)throw new RangeError("The data size must not be greater than 125 bytes");let i={[Tn]:o,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};pi(t)?this._state!==Un?this.enqueue([this.getBlobData,t,!1,i,r]):this.getBlobData(t,!1,i,r):this._state!==Un?this.enqueue([this.dispatch,t,!1,i,r]):this.sendFrame(e.frame(t,i),r)}send(t,n,r){let o=this._extensions[Wj.extensionName],s=n.binary?2:1,i=n.compress,c,d;typeof t=="string"?(c=Buffer.byteLength(t),d=!1):pi(t)?(c=t.size,d=!1):(t=ha(t),c=t.length,d=ha.readOnly),this._firstFragment?(this._firstFragment=!1,i&&o&&o.params[o._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(i=c>=o._threshold),this._compress=i):(i=!1,s=0),n.fin&&(this._firstFragment=!0);let l={[Tn]:c,fin:n.fin,generateMask:this._generateMask,mask:n.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:d,rsv1:i};pi(t)?this._state!==Un?this.enqueue([this.getBlobData,t,this._compress,l,r]):this.getBlobData(t,this._compress,l,r):this._state!==Un?this.enqueue([this.dispatch,t,this._compress,l,r]):this.dispatch(t,this._compress,l,r)}getBlobData(t,n,r,o){this._bufferedBytes+=r[Tn],this._state=X6,t.arrayBuffer().then(s=>{if(this._socket.destroyed){let c=new Error("The socket was closed while the blob was being read");process.nextTick(dy,this,c,o);return}this._bufferedBytes-=r[Tn];let i=ha(s);n?this.dispatch(i,n,r,o):(this._state=Un,this.sendFrame(e.frame(i,r),o),this.dequeue())}).catch(s=>{process.nextTick(Q6,this,s,o)})}dispatch(t,n,r,o){if(!n){this.sendFrame(e.frame(t,r),o);return}let s=this._extensions[Wj.extensionName];this._bufferedBytes+=r[Tn],this._state=Y6,s.compress(t,r.fin,(i,c)=>{if(this._socket.destroyed){let d=new Error("The socket was closed while data was being compressed");dy(this,d,o);return}this._bufferedBytes-=r[Tn],this._state=Un,r.readOnly=!1,this.sendFrame(e.frame(c,r),o),this.dequeue()})}dequeue(){for(;this._state===Un&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][Tn],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][Tn],this._queue.push(t)}sendFrame(t,n){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],n),this._socket.uncork()):this._socket.write(t[0],n)}};Vj.exports=cy;function dy(e,t,n){typeof n=="function"&&n(t);for(let r=0;r<e._queue.length;r++){let o=e._queue[r],s=o[o.length-1];typeof s=="function"&&s(t)}}a(dy,"callCallbacks");function Q6(e,t,n){dy(e,t,n),e.onerror(t)}a(Q6,"onError")});var tH=Te((ffe,eH)=>{"use strict";var{kForOnEventAttribute:Zc,kListener:uy}=Wr(),Jj=Symbol("kCode"),Gj=Symbol("kData"),Kj=Symbol("kError"),Yj=Symbol("kMessage"),Xj=Symbol("kReason"),fi=Symbol("kTarget"),Qj=Symbol("kType"),Zj=Symbol("kWasClean"),Vr=class{static{a(this,"Event")}constructor(t){this[fi]=null,this[Qj]=t}get target(){return this[fi]}get type(){return this[Qj]}};Object.defineProperty(Vr.prototype,"target",{enumerable:!0});Object.defineProperty(Vr.prototype,"type",{enumerable:!0});var ya=class extends Vr{static{a(this,"CloseEvent")}constructor(t,n={}){super(t),this[Jj]=n.code===void 0?0:n.code,this[Xj]=n.reason===void 0?"":n.reason,this[Zj]=n.wasClean===void 0?!1:n.wasClean}get code(){return this[Jj]}get reason(){return this[Xj]}get wasClean(){return this[Zj]}};Object.defineProperty(ya.prototype,"code",{enumerable:!0});Object.defineProperty(ya.prototype,"reason",{enumerable:!0});Object.defineProperty(ya.prototype,"wasClean",{enumerable:!0});var gi=class extends Vr{static{a(this,"ErrorEvent")}constructor(t,n={}){super(t),this[Kj]=n.error===void 0?null:n.error,this[Yj]=n.message===void 0?"":n.message}get error(){return this[Kj]}get message(){return this[Yj]}};Object.defineProperty(gi.prototype,"error",{enumerable:!0});Object.defineProperty(gi.prototype,"message",{enumerable:!0});var ed=class extends Vr{static{a(this,"MessageEvent")}constructor(t,n={}){super(t),this[Gj]=n.data===void 0?null:n.data}get data(){return this[Gj]}};Object.defineProperty(ed.prototype,"data",{enumerable:!0});var Z6={addEventListener(e,t,n={}){for(let o of this.listeners(e))if(!n[Zc]&&o[uy]===t&&!o[Zc])return;let r;if(e==="message")r=a(function(s,i){let c=new ed("message",{data:i?s:s.toString()});c[fi]=this,jp(t,this,c)},"onMessage");else if(e==="close")r=a(function(s,i){let c=new ya("close",{code:s,reason:i.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});c[fi]=this,jp(t,this,c)},"onClose");else if(e==="error")r=a(function(s){let i=new gi("error",{error:s,message:s.message});i[fi]=this,jp(t,this,i)},"onError");else if(e==="open")r=a(function(){let s=new Vr("open");s[fi]=this,jp(t,this,s)},"onOpen");else return;r[Zc]=!!n[Zc],r[uy]=t,n.once?this.once(e,r):this.on(e,r)},removeEventListener(e,t){for(let n of this.listeners(e))if(n[uy]===t&&!n[Zc]){this.removeListener(e,n);break}}};eH.exports={CloseEvent:ya,ErrorEvent:gi,Event:Vr,EventTarget:Z6,MessageEvent:ed};function jp(e,t,n){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,n):e.call(t,n)}a(jp,"callListener")});var Hp=Te((hfe,nH)=>{"use strict";var{tokenChars:td}=ui();function wr(e,t,n){e[t]===void 0?e[t]=[n]:e[t].push(n)}a(wr,"push");function e5(e){let t=Object.create(null),n=Object.create(null),r=!1,o=!1,s=!1,i,c,d=-1,l=-1,u=-1,p=0;for(;p<e.length;p++)if(l=e.charCodeAt(p),i===void 0)if(u===-1&&td[l]===1)d===-1&&(d=p);else if(p!==0&&(l===32||l===9))u===-1&&d!==-1&&(u=p);else if(l===59||l===44){if(d===-1)throw new SyntaxError(`Unexpected character at index ${p}`);u===-1&&(u=p);let f=e.slice(d,u);l===44?(wr(t,f,n),n=Object.create(null)):i=f,d=u=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);else if(c===void 0)if(u===-1&&td[l]===1)d===-1&&(d=p);else if(l===32||l===9)u===-1&&d!==-1&&(u=p);else if(l===59||l===44){if(d===-1)throw new SyntaxError(`Unexpected character at index ${p}`);u===-1&&(u=p),wr(n,e.slice(d,u),!0),l===44&&(wr(t,i,n),n=Object.create(null),i=void 0),d=u=-1}else if(l===61&&d!==-1&&u===-1)c=e.slice(d,p),d=u=-1;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(o){if(td[l]!==1)throw new SyntaxError(`Unexpected character at index ${p}`);d===-1?d=p:r||(r=!0),o=!1}else if(s)if(td[l]===1)d===-1&&(d=p);else if(l===34&&d!==-1)s=!1,u=p;else if(l===92)o=!0;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(l===34&&e.charCodeAt(p-1)===61)s=!0;else if(u===-1&&td[l]===1)d===-1&&(d=p);else if(d!==-1&&(l===32||l===9))u===-1&&(u=p);else if(l===59||l===44){if(d===-1)throw new SyntaxError(`Unexpected character at index ${p}`);u===-1&&(u=p);let f=e.slice(d,u);r&&(f=f.replace(/\\/g,""),r=!1),wr(n,c,f),l===44&&(wr(t,i,n),n=Object.create(null),i=void 0),c=void 0,d=u=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);if(d===-1||s||l===32||l===9)throw new SyntaxError("Unexpected end of input");u===-1&&(u=p);let m=e.slice(d,u);return i===void 0?wr(t,m,n):(c===void 0?wr(n,m,!0):r?wr(n,c,m.replace(/\\/g,"")):wr(n,c,m),wr(t,i,n)),t}a(e5,"parse");function t5(e){return Object.keys(e).map(t=>{let n=e[t];return Array.isArray(n)||(n=[n]),n.map(r=>[t].concat(Object.keys(r).map(o=>{let s=r[o];return Array.isArray(s)||(s=[s]),s.map(i=>i===!0?o:`${o}=${i}`).join("; ")})).join("; ")).join(", ")}).join(", ")}a(t5,"format");nH.exports={format:t5,parse:e5}});var $p=Te((kfe,fH)=>{"use strict";var n5=Pe("events"),r5=Pe("https"),o5=Pe("http"),aH=Pe("net"),a5=Pe("tls"),{randomBytes:s5,createHash:i5}=Pe("crypto"),{Duplex:yfe,Readable:vfe}=Pe("stream"),{URL:py}=Pe("url"),Eo=li(),c5=iy(),d5=ly(),{isBlob:l5}=ui(),{BINARY_TYPES:rH,CLOSE_TIMEOUT:u5,EMPTY_BUFFER:Op,GUID:p5,kForOnEventAttribute:my,kListener:m5,kStatusCode:f5,kWebSocket:mt,NOOP:sH}=Wr(),{EventTarget:{addEventListener:g5,removeEventListener:h5}}=tH(),{format:w5,parse:y5}=Hp(),{toBuffer:v5}=Xc(),iH=Symbol("kAborted"),fy=[8,13],Jr=["CONNECTING","OPEN","CLOSING","CLOSED"],k5=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,ze=class e extends n5{static{a(this,"WebSocket")}constructor(t,n,r){super(),this._binaryType=rH[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Op,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,n===void 0?n=[]:Array.isArray(n)||(typeof n=="object"&&n!==null?(r=n,n=[]):n=[n]),cH(this,t,n,r)):(this._autoPong=r.autoPong,this._closeTimeout=r.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){rH.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}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(t,n,r){let o=new c5({allowSynchronousEvents:r.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:r.maxBufferedChunks,maxFragments:r.maxFragments,maxPayload:r.maxPayload,skipUTF8Validation:r.skipUTF8Validation}),s=new d5(t,this._extensions,r.generateMask);this._receiver=o,this._sender=s,this._socket=t,o[mt]=this,s[mt]=this,t[mt]=this,o.on("conclude",I5),o.on("drain",R5),o.on("error",P5),o.on("message",_5),o.on("ping",x5),o.on("pong",T5),s.onerror=A5,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),n.length>0&&t.unshift(n),t.on("close",uH),t.on("data",Bp),t.on("end",pH),t.on("error",mH),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Eo.extensionName]&&this._extensions[Eo.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,n){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){pn(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,n,!this._isServer,r=>{r||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),lH(this)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,n,r){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(r=t,t=n=void 0):typeof n=="function"&&(r=n,n=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){gy(this,t,r);return}n===void 0&&(n=!this._isServer),this._sender.ping(t||Op,n,r)}pong(t,n,r){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(r=t,t=n=void 0):typeof n=="function"&&(r=n,n=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){gy(this,t,r);return}n===void 0&&(n=!this._isServer),this._sender.pong(t||Op,n,r)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,n,r){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof n=="function"&&(r=n,n={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){gy(this,t,r);return}let o={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...n};this._extensions[Eo.extensionName]||(o.compress=!1),this._sender.send(t||Op,o,r)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){pn(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(ze,"CONNECTING",{enumerable:!0,value:Jr.indexOf("CONNECTING")});Object.defineProperty(ze.prototype,"CONNECTING",{enumerable:!0,value:Jr.indexOf("CONNECTING")});Object.defineProperty(ze,"OPEN",{enumerable:!0,value:Jr.indexOf("OPEN")});Object.defineProperty(ze.prototype,"OPEN",{enumerable:!0,value:Jr.indexOf("OPEN")});Object.defineProperty(ze,"CLOSING",{enumerable:!0,value:Jr.indexOf("CLOSING")});Object.defineProperty(ze.prototype,"CLOSING",{enumerable:!0,value:Jr.indexOf("CLOSING")});Object.defineProperty(ze,"CLOSED",{enumerable:!0,value:Jr.indexOf("CLOSED")});Object.defineProperty(ze.prototype,"CLOSED",{enumerable:!0,value:Jr.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(e=>{Object.defineProperty(ze.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(ze.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[my])return t[m5];return null},set(t){for(let n of this.listeners(e))if(n[my]){this.removeListener(e,n);break}typeof t=="function"&&this.addEventListener(e,t,{[my]:!0})}})});ze.prototype.addEventListener=g5;ze.prototype.removeEventListener=h5;fH.exports=ze;function cH(e,t,n,r){let o={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:u5,protocolVersion:fy[1],maxBufferedChunks:262144,maxFragments:16384,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...r,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(e._autoPong=o.autoPong,e._closeTimeout=o.closeTimeout,!fy.includes(o.protocolVersion))throw new RangeError(`Unsupported protocol version: ${o.protocolVersion} (supported versions: ${fy.join(", ")})`);let s;if(t instanceof py)s=t;else try{s=new py(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),e._url=s.href;let i=s.protocol==="wss:",c=s.protocol==="ws+unix:",d;if(s.protocol!=="ws:"&&!i&&!c?d=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:c&&!s.pathname?d="The URL's pathname is empty":s.hash&&(d="The URL contains a fragment identifier"),d){let h=new SyntaxError(d);if(e._redirects===0)throw h;Dp(e,h);return}let l=i?443:80,u=s5(16).toString("base64"),p=i?r5.request:o5.request,m=new Set,f;if(o.createConnection=o.createConnection||(i?S5:b5),o.defaultPort=o.defaultPort||l,o.port=s.port||l,o.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,o.headers={...o.headers,"Sec-WebSocket-Version":o.protocolVersion,"Sec-WebSocket-Key":u,Connection:"Upgrade",Upgrade:"websocket"},o.path=s.pathname+s.search,o.timeout=o.handshakeTimeout,o.perMessageDeflate&&(f=new Eo({...o.perMessageDeflate,isServer:!1,maxPayload:o.maxPayload}),o.headers["Sec-WebSocket-Extensions"]=w5({[Eo.extensionName]:f.offer()})),n.length){for(let h of n){if(typeof h!="string"||!k5.test(h)||m.has(h))throw new SyntaxError("An invalid or duplicated subprotocol was specified");m.add(h)}o.headers["Sec-WebSocket-Protocol"]=n.join(",")}if(o.origin&&(o.protocolVersion<13?o.headers["Sec-WebSocket-Origin"]=o.origin:o.headers.Origin=o.origin),(s.username||s.password)&&(o.auth=`${s.username}:${s.password}`),c){let h=o.path.split(":");o.socketPath=h[0],o.path=h[1]}let w;if(o.followRedirects){if(e._redirects===0){e._originalIpc=c,e._originalSecure=i,e._originalHostOrSocketPath=c?o.socketPath:s.host;let h=r&&r.headers;if(r={...r,headers:{}},h)for(let[v,g]of Object.entries(h))r.headers[v.toLowerCase()]=g}else if(e.listenerCount("redirect")===0){let h=c?e._originalIpc?o.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:s.host===e._originalHostOrSocketPath;(!h||e._originalSecure&&!i)&&(delete o.headers.authorization,delete o.headers.cookie,h||delete o.headers.host,o.auth=void 0)}o.auth&&!r.headers.authorization&&(r.headers.authorization="Basic "+Buffer.from(o.auth).toString("base64")),w=e._req=p(o),e._redirects&&e.emit("redirect",e.url,w)}else w=e._req=p(o);o.timeout&&w.on("timeout",()=>{pn(e,w,"Opening handshake has timed out")}),w.on("error",h=>{w===null||w[iH]||(w=e._req=null,Dp(e,h))}),w.on("response",h=>{let v=h.headers.location,g=h.statusCode;if(v&&o.followRedirects&&g>=300&&g<400){if(++e._redirects>o.maxRedirects){pn(e,w,"Maximum redirects exceeded");return}w.abort();let S;try{S=new py(v,t)}catch{let k=new SyntaxError(`Invalid URL: ${v}`);Dp(e,k);return}cH(e,S,n,r)}else e.emit("unexpected-response",w,h)||pn(e,w,`Unexpected server response: ${h.statusCode}`)}),w.on("upgrade",(h,v,g)=>{if(e.emit("upgrade",h),e.readyState!==ze.CONNECTING)return;w=e._req=null;let S=h.headers.upgrade;if(S===void 0||S.toLowerCase()!=="websocket"){pn(e,v,"Invalid Upgrade header");return}let R=i5("sha1").update(u+p5).digest("base64");if(h.headers["sec-websocket-accept"]!==R){pn(e,v,"Invalid Sec-WebSocket-Accept header");return}let k=h.headers["sec-websocket-protocol"],y;if(k!==void 0?m.size?m.has(k)||(y="Server sent an invalid subprotocol"):y="Server sent a subprotocol but none was requested":m.size&&(y="Server sent no subprotocol"),y){pn(e,v,y);return}k&&(e._protocol=k);let T=h.headers["sec-websocket-extensions"];if(T!==void 0){if(!f){pn(e,v,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let C;try{C=y5(T)}catch{pn(e,v,"Invalid Sec-WebSocket-Extensions header");return}let b=Object.keys(C);if(b.length!==1||b[0]!==Eo.extensionName){pn(e,v,"Server indicated an extension that was not requested");return}try{f.accept(C[Eo.extensionName])}catch{pn(e,v,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[Eo.extensionName]=f}e.setSocket(v,g,{allowSynchronousEvents:o.allowSynchronousEvents,generateMask:o.generateMask,maxBufferedChunks:o.maxBufferedChunks,maxFragments:o.maxFragments,maxPayload:o.maxPayload,skipUTF8Validation:o.skipUTF8Validation})}),o.finishRequest?o.finishRequest(w,e):w.end()}a(cH,"initAsClient");function Dp(e,t){e._readyState=ze.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}a(Dp,"emitErrorAndClose");function b5(e){return e.path=e.socketPath,aH.connect(e)}a(b5,"netConnect");function S5(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=aH.isIP(e.host)?"":e.host),a5.connect(e)}a(S5,"tlsConnect");function pn(e,t,n){e._readyState=ze.CLOSING;let r=new Error(n);Error.captureStackTrace(r,pn),t.setHeader?(t[iH]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(Dp,e,r)):(t.destroy(r),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}a(pn,"abortHandshake");function gy(e,t,n){if(t){let r=l5(t)?t.size:v5(t).length;e._socket?e._sender._bufferedBytes+=r:e._bufferedAmount+=r}if(n){let r=new Error(`WebSocket is not open: readyState ${e.readyState} (${Jr[e.readyState]})`);process.nextTick(n,r)}}a(gy,"sendAfterClose");function I5(e,t){let n=this[mt];n._closeFrameReceived=!0,n._closeMessage=t,n._closeCode=e,n._socket[mt]!==void 0&&(n._socket.removeListener("data",Bp),process.nextTick(dH,n._socket),e===1005?n.close():n.close(e,t))}a(I5,"receiverOnConclude");function R5(){let e=this[mt];e.isPaused||e._socket.resume()}a(R5,"receiverOnDrain");function P5(e){let t=this[mt];t._socket[mt]!==void 0&&(t._socket.removeListener("data",Bp),process.nextTick(dH,t._socket),t.close(e[f5])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e))}a(P5,"receiverOnError");function oH(){this[mt].emitClose()}a(oH,"receiverOnFinish");function _5(e,t){this[mt].emit("message",e,t)}a(_5,"receiverOnMessage");function x5(e){let t=this[mt];t._autoPong&&t.pong(e,!this._isServer,sH),t.emit("ping",e)}a(x5,"receiverOnPing");function T5(e){this[mt].emit("pong",e)}a(T5,"receiverOnPong");function dH(e){e.resume()}a(dH,"resume");function A5(e){let t=this[mt];t.readyState!==ze.CLOSED&&(t.readyState===ze.OPEN&&(t._readyState=ze.CLOSING,lH(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e)))}a(A5,"senderOnError");function lH(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),e._closeTimeout)}a(lH,"setCloseTimer");function uH(){let e=this[mt];if(this.removeListener("close",uH),this.removeListener("data",Bp),this.removeListener("end",pH),e._readyState=ze.CLOSING,!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&this._readableState.length!==0){let t=this.read(this._readableState.length);e._receiver.write(t)}e._receiver.end(),this[mt]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",oH),e._receiver.on("finish",oH))}a(uH,"socketOnClose");function Bp(e){this[mt]._receiver.write(e)||this.pause()}a(Bp,"socketOnData");function pH(){let e=this[mt];e._readyState=ze.CLOSING,e._receiver.end(),this.end()}a(pH,"socketOnEnd");function mH(){let e=this[mt];this.removeListener("error",mH),this.on("error",sH),e&&(e._readyState=ze.CLOSING,this.destroy())}a(mH,"socketOnError")});var yH=Te((Ife,wH)=>{"use strict";var Sfe=$p(),{Duplex:C5}=Pe("stream");function gH(e){e.emit("close")}a(gH,"emitClose");function E5(){!this.destroyed&&this._writableState.finished&&this.destroy()}a(E5,"duplexOnEnd");function hH(e){this.removeListener("error",hH),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}a(hH,"duplexOnError");function M5(e,t){let n=!0,r=new C5({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",a(function(s,i){let c=!i&&r._readableState.objectMode?s.toString():s;r.push(c)||e.pause()},"message")),e.once("error",a(function(s){r.destroyed||(n=!1,r.destroy(s))},"error")),e.once("close",a(function(){r.destroyed||r.push(null)},"close")),r._destroy=function(o,s){if(e.readyState===e.CLOSED){s(o),process.nextTick(gH,r);return}let i=!1;e.once("error",a(function(d){i=!0,s(d)},"error")),e.once("close",a(function(){i||s(o),process.nextTick(gH,r)},"close")),n&&e.terminate()},r._final=function(o){if(e.readyState===e.CONNECTING){e.once("open",a(function(){r._final(o)},"open"));return}e._socket!==null&&(e._socket._writableState.finished?(o(),r._readableState.endEmitted&&r.destroy()):(e._socket.once("finish",a(function(){o()},"finish")),e.close()))},r._read=function(){e.isPaused&&e.resume()},r._write=function(o,s,i){if(e.readyState===e.CONNECTING){e.once("open",a(function(){r._write(o,s,i)},"open"));return}e.send(o,i)},r.on("end",E5),r.on("error",hH),r}a(M5,"createWebSocketStream");wH.exports=M5});var hy=Te((Pfe,vH)=>{"use strict";var{tokenChars:j5}=ui();function H5(e){let t=new Set,n=-1,r=-1,o=0;for(o;o<e.length;o++){let i=e.charCodeAt(o);if(r===-1&&j5[i]===1)n===-1&&(n=o);else if(o!==0&&(i===32||i===9))r===-1&&n!==-1&&(r=o);else if(i===44){if(n===-1)throw new SyntaxError(`Unexpected character at index ${o}`);r===-1&&(r=o);let c=e.slice(n,r);if(t.has(c))throw new SyntaxError(`The "${c}" subprotocol is duplicated`);t.add(c),n=r=-1}else throw new SyntaxError(`Unexpected character at index ${o}`)}if(n===-1||r!==-1)throw new SyntaxError("Unexpected end of input");let s=e.slice(n,o);if(t.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);return t.add(s),t}a(H5,"parse");vH.exports={parse:H5}});var _H=Te((Tfe,PH)=>{"use strict";var O5=Pe("events"),Lp=Pe("http"),{Duplex:xfe}=Pe("stream"),{createHash:D5}=Pe("crypto"),kH=Hp(),va=li(),B5=hy(),$5=$p(),{CLOSE_TIMEOUT:L5,GUID:N5,kWebSocket:F5}=Wr(),U5=/^[+/0-9A-Za-z]{22}==$/,bH=0,SH=1,RH=2,wy=class extends O5{static{a(this,"WebSocketServer")}constructor(t,n){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:256*1024,maxFragments:16*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:L5,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:$5,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=Lp.createServer((r,o)=>{let s=Lp.STATUS_CODES[426];o.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),o.end(s)}),this._server.listen(t.port,t.host,t.backlog,n)):t.server&&(this._server=t.server),this._server){let r=this.emit.bind(this,"connection");this._removeListeners=q5(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:a((o,s,i)=>{this.handleUpgrade(o,s,i,r)},"upgrade")})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=bH}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===RH){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(nd,this);return}if(t&&this.once("close",t),this._state!==SH)if(this._state=SH,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(nd,this):process.nextTick(nd,this);else{let n=this._server;this._removeListeners(),this._removeListeners=this._server=null,n.close(()=>{nd(this)})}}shouldHandle(t){if(this.options.path){let n=t.url.indexOf("?");if((n!==-1?t.url.slice(0,n):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,n,r,o){n.on("error",IH);let s=t.headers["sec-websocket-key"],i=t.headers.upgrade,c=+t.headers["sec-websocket-version"];if(t.method!=="GET"){ka(this,t,n,405,"Invalid HTTP method");return}if(i===void 0||i.toLowerCase()!=="websocket"){ka(this,t,n,400,"Invalid Upgrade header");return}if(s===void 0||!U5.test(s)){ka(this,t,n,400,"Missing or invalid Sec-WebSocket-Key header");return}if(c!==13&&c!==8){ka(this,t,n,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){rd(n,400);return}let d=t.headers["sec-websocket-protocol"],l=new Set;if(d!==void 0)try{l=B5.parse(d)}catch{ka(this,t,n,400,"Invalid Sec-WebSocket-Protocol header");return}let u=t.headers["sec-websocket-extensions"],p={};if(this.options.perMessageDeflate&&u!==void 0){let m=new va({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let f=kH.parse(u);f[va.extensionName]&&(m.accept(f[va.extensionName]),p[va.extensionName]=m)}catch{ka(this,t,n,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let m={origin:t.headers[`${c===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(m,(f,w,h,v)=>{if(!f)return rd(n,w||401,h,v);this.completeUpgrade(p,s,l,t,n,r,o)});return}if(!this.options.verifyClient(m))return rd(n,401)}this.completeUpgrade(p,s,l,t,n,r,o)}completeUpgrade(t,n,r,o,s,i,c){if(!s.readable||!s.writable)return s.destroy();if(s[F5])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>bH)return rd(s,503);let l=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${D5("sha1").update(n+N5).digest("base64")}`],u=new this.options.WebSocket(null,void 0,this.options);if(r.size){let p=this.options.handleProtocols?this.options.handleProtocols(r,o):r.values().next().value;p&&(l.push(`Sec-WebSocket-Protocol: ${p}`),u._protocol=p)}if(t[va.extensionName]){let p=t[va.extensionName].params,m=kH.format({[va.extensionName]:[p]});l.push(`Sec-WebSocket-Extensions: ${m}`),u._extensions=t}this.emit("headers",l,o),s.write(l.concat(`\r
|
|
3
|
+
import{a as tC,b as nC,c as rC,d as H,e as oC,f as ho,g as W,h as Mu,j as aC}from"./chunk-DDRIX3EP.js";import{$ as Rx,$a as bT,$b as xu,$c as XA,A as W_,Aa as nT,Ab as FT,Ac as MA,B as z_,Ba as rT,Bb as UT,Bc as bh,C as V_,Ca as As,Cb as zT,Cc as jA,D as X_,Da as Cs,Db as VT,Dc as Sh,E as cx,Ea as oT,Eb as _u,Ec as HA,F as dx,Fa as aT,Fb as JT,Fc as OA,G as lx,Ga as sT,Gb as GT,Gc as DA,H as ux,Ha as iT,Hb as KT,Hc as BA,I as px,Ia as cT,Ib as YT,Ic as $A,J as mx,Ja as dT,Jb as XT,Jc as go,K as pu,Ka as lT,Kb as hh,Kc as jr,L as fx,La as po,Lb as QT,Lc as Ih,M as mu,Ma as uT,Mb as ZT,Mc as LA,N as gx,Na as pT,Nb as eA,Nc as NA,O as hx,Oa as fh,Ob as tA,Oc as Cu,P as wx,Pa as mT,Pb as nA,Pc as js,Q as Ps,Qa as _c,Qb as rA,Qc as FA,R as fu,Ra as fT,Rb as oA,Rc as Eu,S as Sc,Sa as Es,Sb as aA,Sc as UA,T as dh,Ta as gT,Tb as sA,Tc as qA,U as ra,Ua as hT,Ub as iA,Uc as WA,V as yx,Va as wT,Vb as cA,Vc as zA,W as vx,Wa as yT,Wb as dA,Wc as VA,X as kx,Xa as ae,Xb as lA,Xc as JA,Y as bx,Ya as vT,Yb as uA,Yc as GA,Z as Sx,Za as kT,Zb as pA,Zc as KA,_ as Ix,_a as Su,_b as mA,_c as YA,a as ES,aa as gu,ab as ST,ac as fA,ad as QA,b as MS,ba as hu,bb as IT,bc as oa,bd as ZA,c as jS,ca as _s,cb as RT,cc as Tu,d as HS,da as wu,db as PT,dc as gA,dd as eC,e as OS,ea as Px,eb as Iu,ec as fo,f as Pl,fa as _x,fb as _T,fc as Au,g as US,ga as xx,gb as mo,gc as hA,h as qS,ha as yu,hb as Ae,hc as wA,i as WS,ia as Tx,ib as xT,ic as wh,j as zS,ja as Ax,jb as pe,jc as yh,k as VS,ka as Cx,kb as TT,kc as yA,l as jg,la as Ex,lb as AT,lc as vA,m as KS,ma as Mx,mb as CT,mc as kA,n as YS,na as vu,nb as ET,nc as bA,o as XS,oa as jx,ob as MT,oc as vh,p as QS,pa as Hx,pb as jT,pc as SA,q as ZS,qa as Ox,qb as HT,qc as kh,r as eI,ra as Dx,rb as OT,rc as IA,s as Yo,sa as Bx,sb as DT,sc as RA,t as tI,ta as Rc,tb as BT,tc as PA,u as nI,ua as Xx,ub as $T,uc as _A,v as Tl,va as Qx,vb as Ms,vc as xA,w as rI,wa as Zx,wb as $n,wc as TA,x as oI,xa as eT,xb as He,xc as AA,y as gq,ya as tT,yb as LT,yc as CA,z as q_,za as Pc,zb as NT,zc as EA}from"./chunk-N6HBB2EA.js";import{A as Wx,C as ku,F as bu,G as ur,H as zx,I as lh,J as Vx,K as uh,N as Jx,O as ph,P as Gx,Q as Kx,R as Yx,S as mh,T as Ts,b as lr,d as $x,e as Lx,h as Nx,m as xs,n as Fx,p as Ux,q as qx,s as Ic}from"./chunk-GHGVF2KG.js";import{a as dt,b as J_,c as G_,f as K_,s as Y_,u as gh,v as qT,w as Ru,x as Pu,y as WT}from"./chunk-3YSCXFE6.js";import{a as F_,b as du,d as ie,e as ct,f as Rs,g as ne,i as U_}from"./chunk-HMADUZ5P.js";import{a as cn,b as Q_,c as Z_,d as lu,e as uu,g as ex,h as tx,i as nx,j as rx,k as ox,l as ax,m as sx,n as ix}from"./chunk-P57W2CB2.js";import{$ as OR,$b as FP,$c as Be,A as RR,Aa as We,Ab as hc,Ac as Zl,Ad as ta,B as Fl,Ba as Vl,Bb as RP,Bd as I_,C as PR,Ca as zR,Cc as oh,Cd as Mr,D as Wg,Da as Kg,Db as PP,Dc as o_,Dd as R_,E as _R,Eb as _P,Ec as a_,Ed as P_,F as xR,Fa as VR,Fb as xP,Fd as __,G as nt,Gd as lo,H as TR,Ha as JR,Hb as ys,Hc as eu,Hd as Ss,I as vt,Ib as TP,Ic as s_,Id as ou,J as fc,Ja as Jl,Jc as ah,Jd as x_,K as AR,Ka as GR,Kb as wc,Kc as cr,Kd as T_,L as CR,Lb as Xl,Lc as i_,Ld as A_,Ma as KR,Mb as AP,Mc as c_,Md as kc,N as ER,Na as YR,Nb as Qg,Nc as sh,Nd as Is,Oa as XR,Ob as CP,Oc as vc,Od as au,P as MR,Pa as QR,Pb as EP,Pc as d_,Pd as C_,Q as jR,Qa as ZR,Qb as Zg,Qc as tu,Qd as su,R as Bn,Ra as eP,Rb as MP,Rc as l_,Rd as uo,Sa as tP,Sb as jP,Sc as u_,Sd as E_,Ta as nP,Tb as HP,Tc as vs,Td as M_,Ua as rP,Ub as OP,Uc as p_,Ud as j_,Va as co,Vb as DP,Vc as ks,Vd as iu,W as HR,Wb as BP,Wc as m_,Wd as H_,Xa as oP,Xb as $P,Xc as f_,Xd as bc,Y as Ul,Ya as aP,Yb as eh,Yc as ih,Yd as O_,Z as zg,Za as sP,Zb as LP,Zc as nu,Zd as D_,_ as ql,_a as iP,_b as NP,_c as g_,ab as cP,ac as UP,ad as ru,ba as Vg,bb as Gl,bc as th,bd as h_,c as uR,ca as DR,cb as dP,cc as qP,cd as w_,da as Nt,db as lP,dc as WP,dd as y_,ea as Qo,eb as uP,ec as zP,ed as ch,fa as Zo,fb as pP,fc as VP,fd as v_,ga as Jg,gb as mP,gc as JP,gd as k_,ge as cu,ha as BR,hb as fP,hc as GP,hd as b_,he as B_,ia as $R,ib as gP,ic as KP,ie as $_,ja as LR,jb as hP,jc as YP,jd as bs,je as dr,ka as NR,kb as wP,kc as XP,kd as S_,ke as L_,l as pR,la as FR,lb as yP,lc as QP,le as na,m as mR,ma as UR,mb as vP,mc as nh,me as N_,n as fR,na as Wl,nb as kP,nc as ea,ob as bP,oc as ZP,pa as zl,pb as Yg,pc as e_,q as gR,qb as Kl,qc as t_,r as hR,rb as SP,s as wR,sb as ir,sc as Ql,t as yR,tb as Er,tc as n_,u as vR,ub as Xg,v as qg,vb as Yl,vc as r_,w as kR,wa as qR,wb as IP,wc as yc,x as bR,xb as Ft,xc as rh,y as SR,ya as WR,yb as gc,z as IR,za as Gg}from"./chunk-MAMUNDBZ.js";import{a as hI,c as ZI,h as eR}from"./chunk-XLF7VRKY.js";import{b as DS,c as BS}from"./chunk-L3KS6MOV.js";import"./chunk-XEOEKFG6.js";import{A as pc,B as Ng,C as Nl,D as oR,E as aR,I as sR,J as iR,N as ws,O as mc,P as cR,Q as dR,R as lR,T as Fg,V as Ug,i as tR,t as nR,u as rR,v as Kt,w as Ll,z as Cr}from"./chunk-TOIG2PMH.js";import"./chunk-6MI4KKWF.js";import{A as Hg,Aa as _I,Ac as Dl,B as sI,Bc as Bl,C as iI,Ca as ms,Cb as OI,Cc as $l,D as cI,Dc as JI,E as Cl,Eb as DI,Ec as Lg,F as dI,Fa as xI,Fb as BI,Fc as GI,G as lI,H as uI,Ha as TI,Hc as KI,I as pI,Ic as YI,Jc as XI,Kc as io,Lc as QI,Mc as sr,Nb as $I,Pa as Dn,Q as mI,Qa as AI,Qb as LI,R as fI,Ra as Ml,Sa as sn,V as gI,Va as CI,Vb as NI,_a as EI,_b as gs,a as $S,ab as Dg,b as LS,bb as je,c as kn,cb as Xo,db as Ze,f as NS,fa as wI,fc as $g,g as Rl,gc as FI,h as FS,hb as MI,jc as UI,kb as uc,kc as Hl,lb as jI,m as _l,ma as yI,mb as jl,mc as Ol,na as vI,nc as qI,o as JS,oa as kI,ob as HI,pa as bI,pb as Bg,pc as WI,qa as SI,qb as fs,ra as El,sa as Og,ta as II,u as xl,ua as RI,v as GS,va as PI,w as aI,x as Al,xc as hs,yc as zI,zc as VI}from"./chunk-ETH4SZO6.js";import"./chunk-SDO4FC4Q.js";import"./chunk-IR3YJWPW.js";import{D as ps,E as dc,F as Il,d as Sl,m as AS,n as so,o as Je,p as CS}from"./chunk-JPCPNW6T.js";import"./chunk-J2S7BOZU.js";import{$a as bl,$b as xS,Da as fq,Ea as kS,Fa as Eg,Ga as Mg,Ia as bS,Lb as Ge,Mb as Gt,Pa as SS,S as vl,Sb as _S,Ta as IS,Ua as RS,a as an,bc as TS,hb as PS,qa as wS,ra as kl,ta as yS,wa as vS}from"./chunk-2LSP2AAN.js";import{a as lc}from"./chunk-6FA3GG5B.js";import{A as Et,B as Jo,C as Gb,D as cc,E as Tr,F as fl,G as Kb,Ga as ao,H as gl,I as Yb,Ia as Go,J as ds,L as Xb,M as Qb,N as Zb,Na as iS,O as eS,Oa as cS,P as tS,Pa as dS,Qa as lS,Ta as uS,Va as Ag,W as Tg,Wa as Cg,Xa as pS,ca as nS,f as ll,ga as oo,ia as rS,ib as wl,jb as mS,k as is,ka as oS,l as cs,la as aS,m as _g,ma as sS,n as ul,nb as fS,o as it,ob as gS,p as xg,q as pl,qb as Ko,rb as hS,sb as yl,t as Ve,u as Se,v as O,w as Vb,y as Jb,z as ml}from"./chunk-F4WS5QIT.js";import{a as Vo,b as _}from"./chunk-ES2ISFJC.js";import{a as qb,c as zo,f as Wb,h as dl,i as zb,p as ls,q as hl,r as Ar,s as us}from"./chunk-H7IWJN7L.js";import{a,b as Pe,c as Te,e as On}from"./chunk-FTQLQJQV.js";var Wr=Te((Zme,_j)=>{"use strict";var Rj=["nodebuffer","arraybuffer","fragments"],Pj=typeof Blob<"u";Pj&&Rj.push("blob");_j.exports={BINARY_TYPES:Rj,CLOSE_TIMEOUT:3e4,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:Pj,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:a(()=>{},"NOOP")}});var Xc=Te((tfe,_p)=>{"use strict";var{EMPTY_BUFFER:R6}=Wr(),Xw=Buffer[Symbol.species];function P6(e,t){if(e.length===0)return R6;if(e.length===1)return e[0];let n=Buffer.allocUnsafe(t),r=0;for(let o=0;o<e.length;o++){let s=e[o];n.set(s,r),r+=s.length}return r<t?new Xw(n.buffer,n.byteOffset,r):n}a(P6,"concat");function xj(e,t,n,r,o){for(let s=0;s<o;s++)n[r+s]=e[s]^t[s&3]}a(xj,"_mask");function Tj(e,t){for(let n=0;n<e.length;n++)e[n]^=t[n&3]}a(Tj,"_unmask");function _6(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)}a(_6,"toArrayBuffer");function Qw(e){if(Qw.readOnly=!0,Buffer.isBuffer(e))return e;let t;return e instanceof ArrayBuffer?t=new Xw(e):ArrayBuffer.isView(e)?t=new Xw(e.buffer,e.byteOffset,e.byteLength):(t=Buffer.from(e),Qw.readOnly=!1),t}a(Qw,"toBuffer");_p.exports={concat:P6,mask:xj,toArrayBuffer:_6,toBuffer:Qw,unmask:Tj};if(!process.env.WS_NO_BUFFER_UTIL)try{let e=Pe("bufferutil");_p.exports.mask=function(t,n,r,o,s){s<48?xj(t,n,r,o,s):e.mask(t,n,r,o,s)},_p.exports.unmask=function(t,n){t.length<32?Tj(t,n):e.unmask(t,n)}}catch{}});var Ej=Te((rfe,Cj)=>{"use strict";var Aj=Symbol("kDone"),Zw=Symbol("kRun"),ey=class{static{a(this,"Limiter")}constructor(t){this[Aj]=()=>{this.pending--,this[Zw]()},this.concurrency=t||1/0,this.jobs=[],this.pending=0}add(t){this.jobs.push(t),this[Zw]()}[Zw](){if(this.pending!==this.concurrency&&this.jobs.length){let t=this.jobs.shift();this.pending++,t(this[Aj])}}};Cj.exports=ey});var li=Te((afe,Oj)=>{"use strict";var Qc=Pe("zlib"),Mj=Xc(),x6=Ej(),{kStatusCode:jj}=Wr(),T6=Buffer[Symbol.species],A6=Buffer.from([0,0,255,255]),Tp=Symbol("permessage-deflate"),zr=Symbol("total-length"),ci=Symbol("callback"),Co=Symbol("buffers"),di=Symbol("error"),xp,ty=class{static{a(this,"PerMessageDeflate")}constructor(t){if(this._options=t||{},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,!xp){let n=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;xp=new x6(n)}}static get extensionName(){return"permessage-deflate"}offer(){let t={};return this._options.serverNoContextTakeover&&(t.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(t.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(t.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?t.client_max_window_bits=this._options.clientMaxWindowBits:this._options.clientMaxWindowBits==null&&(t.client_max_window_bits=!0),t}accept(t){return t=this.normalizeParams(t),this.params=this._isServer?this.acceptAsServer(t):this.acceptAsClient(t),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){let t=this._deflate[ci];this._deflate.close(),this._deflate=null,t&&t(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(t){let n=this._options,r=t.find(o=>!(n.serverNoContextTakeover===!1&&o.server_no_context_takeover||o.server_max_window_bits&&(n.serverMaxWindowBits===!1||typeof n.serverMaxWindowBits=="number"&&n.serverMaxWindowBits>o.server_max_window_bits)||typeof n.clientMaxWindowBits=="number"&&!o.client_max_window_bits));if(!r)throw new Error("None of the extension offers can be accepted");return n.serverNoContextTakeover&&(r.server_no_context_takeover=!0),n.clientNoContextTakeover&&(r.client_no_context_takeover=!0),typeof n.serverMaxWindowBits=="number"&&(r.server_max_window_bits=n.serverMaxWindowBits),typeof n.clientMaxWindowBits=="number"?r.client_max_window_bits=n.clientMaxWindowBits:(r.client_max_window_bits===!0||n.clientMaxWindowBits===!1)&&delete r.client_max_window_bits,r}acceptAsClient(t){let n=t[0];if(this._options.clientNoContextTakeover===!1&&n.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!n.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(n.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&n.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return n}normalizeParams(t){return t.forEach(n=>{Object.keys(n).forEach(r=>{let o=n[r];if(o.length>1)throw new Error(`Parameter "${r}" must have only a single value`);if(o=o[0],r==="client_max_window_bits"){if(o!==!0){let s=+o;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${r}": ${o}`);o=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${r}": ${o}`)}else if(r==="server_max_window_bits"){let s=+o;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${r}": ${o}`);o=s}else if(r==="client_no_context_takeover"||r==="server_no_context_takeover"){if(o!==!0)throw new TypeError(`Invalid value for parameter "${r}": ${o}`)}else throw new Error(`Unknown parameter "${r}"`);n[r]=o})}),t}decompress(t,n,r){xp.add(o=>{this._decompress(t,n,(s,i)=>{o(),r(s,i)})})}compress(t,n,r){xp.add(o=>{this._compress(t,n,(s,i)=>{o(),r(s,i)})})}_decompress(t,n,r){let o=this._isServer?"client":"server";if(!this._inflate){let s=`${o}_max_window_bits`,i=typeof this.params[s]!="number"?Qc.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=Qc.createInflateRaw({...this._options.zlibInflateOptions,windowBits:i}),this._inflate[Tp]=this,this._inflate[zr]=0,this._inflate[Co]=[],this._inflate.on("error",E6),this._inflate.on("data",Hj)}this._inflate[ci]=r,this._inflate.write(t),n&&this._inflate.write(A6),this._inflate.flush(()=>{let s=this._inflate[di];if(s){this._inflate.close(),this._inflate=null,r(s);return}let i=Mj.concat(this._inflate[Co],this._inflate[zr]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[zr]=0,this._inflate[Co]=[],n&&this.params[`${o}_no_context_takeover`]&&this._inflate.reset()),r(null,i)})}_compress(t,n,r){let o=this._isServer?"server":"client";if(!this._deflate){let s=`${o}_max_window_bits`,i=typeof this.params[s]!="number"?Qc.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=Qc.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:i}),this._deflate[zr]=0,this._deflate[Co]=[],this._deflate.on("data",C6)}this._deflate[ci]=r,this._deflate.write(t),this._deflate.flush(Qc.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=Mj.concat(this._deflate[Co],this._deflate[zr]);n&&(s=new T6(s.buffer,s.byteOffset,s.length-4)),this._deflate[ci]=null,this._deflate[zr]=0,this._deflate[Co]=[],n&&this.params[`${o}_no_context_takeover`]&&this._deflate.reset(),r(null,s)})}};Oj.exports=ty;function C6(e){this[Co].push(e),this[zr]+=e.length}a(C6,"deflateOnData");function Hj(e){if(this[zr]+=e.length,this[Tp]._maxPayload<1||this[zr]<=this[Tp]._maxPayload){this[Co].push(e);return}this[di]=new RangeError("Max payload size exceeded"),this[di].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[di][jj]=1009,this.removeListener("data",Hj),this.reset()}a(Hj,"inflateOnData");function E6(e){if(this[Tp]._inflate=null,this[di]){this[ci](this[di]);return}e[jj]=1007,this[ci](e)}a(E6,"inflateOnError")});var ui=Te((ife,Ap)=>{"use strict";var{isUtf8:Dj}=Pe("buffer"),{hasBlob:M6}=Wr(),j6=[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 H6(e){return e>=1e3&&e<=1014&&e!==1004&&e!==1005&&e!==1006||e>=3e3&&e<=4999}a(H6,"isValidStatusCode");function ny(e){let t=e.length,n=0;for(;n<t;)if((e[n]&128)===0)n++;else if((e[n]&224)===192){if(n+1===t||(e[n+1]&192)!==128||(e[n]&254)===192)return!1;n+=2}else if((e[n]&240)===224){if(n+2>=t||(e[n+1]&192)!==128||(e[n+2]&192)!==128||e[n]===224&&(e[n+1]&224)===128||e[n]===237&&(e[n+1]&224)===160)return!1;n+=3}else if((e[n]&248)===240){if(n+3>=t||(e[n+1]&192)!==128||(e[n+2]&192)!==128||(e[n+3]&192)!==128||e[n]===240&&(e[n+1]&240)===128||e[n]===244&&e[n+1]>143||e[n]>244)return!1;n+=4}else return!1;return!0}a(ny,"_isValidUTF8");function O6(e){return M6&&typeof e=="object"&&typeof e.arrayBuffer=="function"&&typeof e.type=="string"&&typeof e.stream=="function"&&(e[Symbol.toStringTag]==="Blob"||e[Symbol.toStringTag]==="File")}a(O6,"isBlob");Ap.exports={isBlob:O6,isValidStatusCode:H6,isValidUTF8:ny,tokenChars:j6};if(Dj)Ap.exports.isValidUTF8=function(e){return e.length<24?ny(e):Dj(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let e=Pe("utf-8-validate");Ap.exports.isValidUTF8=function(t){return t.length<32?ny(t):e(t)}}catch{}});var iy=Te((dfe,qj)=>{"use strict";var{Writable:D6}=Pe("stream"),Bj=li(),{BINARY_TYPES:B6,EMPTY_BUFFER:$j,kStatusCode:$6,kWebSocket:L6}=Wr(),{concat:ry,toArrayBuffer:N6,unmask:F6}=Xc(),{isValidStatusCode:U6,isValidUTF8:Lj}=ui(),Cp=Buffer[Symbol.species],xn=0,Nj=1,Fj=2,Uj=3,oy=4,ay=5,Ep=6,sy=class extends D6{static{a(this,"Receiver")}constructor(t={}){super(),this._allowSynchronousEvents=t.allowSynchronousEvents!==void 0?t.allowSynchronousEvents:!0,this._binaryType=t.binaryType||B6[0],this._extensions=t.extensions||{},this._isServer=!!t.isServer,this._maxBufferedChunks=t.maxBufferedChunks|0,this._maxFragments=t.maxFragments|0,this._maxPayload=t.maxPayload|0,this._skipUTF8Validation=!!t.skipUTF8Validation,this[L6]=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._numFragments=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=xn}_write(t,n,r){if(this._opcode===8&&this._state==xn)return r();if(this._maxBufferedChunks>0&&this._buffers.length>=this._maxBufferedChunks){r(this.createError(RangeError,"Too many buffered chunks",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS"));return}this._bufferedBytes+=t.length,this._buffers.push(t),this.startLoop(r)}consume(t){if(this._bufferedBytes-=t,t===this._buffers[0].length)return this._buffers.shift();if(t<this._buffers[0].length){let r=this._buffers[0];return this._buffers[0]=new Cp(r.buffer,r.byteOffset+t,r.length-t),new Cp(r.buffer,r.byteOffset,t)}let n=Buffer.allocUnsafe(t);do{let r=this._buffers[0],o=n.length-t;t>=r.length?n.set(this._buffers.shift(),o):(n.set(new Uint8Array(r.buffer,r.byteOffset,t),o),this._buffers[0]=new Cp(r.buffer,r.byteOffset+t,r.length-t)),t-=r.length}while(t>0);return n}startLoop(t){this._loop=!0;do switch(this._state){case xn:this.getInfo(t);break;case Nj:this.getPayloadLength16(t);break;case Fj:this.getPayloadLength64(t);break;case Uj:this.getMask();break;case oy:this.getData(t);break;case ay:case Ep:this._loop=!1;return}while(this._loop);this._errored||t()}getInfo(t){if(this._bufferedBytes<2){this._loop=!1;return}let n=this.consume(2);if((n[0]&48)!==0){let o=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");t(o);return}let r=(n[0]&64)===64;if(r&&!this._extensions[Bj.extensionName]){let o=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(o);return}if(this._fin=(n[0]&128)===128,this._opcode=n[0]&15,this._payloadLength=n[1]&127,this._opcode===0){if(r){let o=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(o);return}if(!this._fragmented){let o=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");t(o);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let o=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(o);return}this._compressed=r}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let o=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");t(o);return}if(r){let o=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");t(o);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let o=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");t(o);return}}else{let o=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");t(o);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(n[1]&128)===128,this._isServer){if(!this._masked){let o=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");t(o);return}}else if(this._masked){let o=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");t(o);return}this._payloadLength===126?this._state=Nj:this._payloadLength===127?this._state=Fj:this.haveLength(t)}getPayloadLength16(t){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(t)}getPayloadLength64(t){if(this._bufferedBytes<8){this._loop=!1;return}let n=this.consume(8),r=n.readUInt32BE(0);if(r>Math.pow(2,21)-1){let o=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");t(o);return}this._payloadLength=r*Math.pow(2,32)+n.readUInt32BE(4),this.haveLength(t)}haveLength(t){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){let n=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(n);return}this._masked?this._state=Uj:this._state=oy}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=oy}getData(t){let n=$j;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}n=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&F6(n,this._mask)}if(this._opcode>7){this.controlMessage(n,t);return}if(this._maxFragments>0&&++this._numFragments>this._maxFragments){let r=this.createError(RangeError,"Too many message fragments",!1,1008,"WS_ERR_TOO_MANY_BUFFERED_PARTS");t(r);return}if(this._compressed){this._state=ay,this.decompress(n,t);return}n.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(n)),this.dataMessage(t)}decompress(t,n){this._extensions[Bj.extensionName].decompress(t,this._fin,(o,s)=>{if(o)return n(o);if(s.length){if(this._messageLength+=s.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let i=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");n(i);return}this._fragments.push(s)}this.dataMessage(n),this._state===xn&&this.startLoop(n)})}dataMessage(t){if(!this._fin){this._state=xn;return}let n=this._messageLength,r=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._numFragments=0,this._fragments=[],this._opcode===2){let o;this._binaryType==="nodebuffer"?o=ry(r,n):this._binaryType==="arraybuffer"?o=N6(ry(r,n)):this._binaryType==="blob"?o=new Blob(r):o=r,this._allowSynchronousEvents?(this.emit("message",o,!0),this._state=xn):(this._state=Ep,setImmediate(()=>{this.emit("message",o,!0),this._state=xn,this.startLoop(t)}))}else{let o=ry(r,n);if(!this._skipUTF8Validation&&!Lj(o)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(s);return}this._state===ay||this._allowSynchronousEvents?(this.emit("message",o,!1),this._state=xn):(this._state=Ep,setImmediate(()=>{this.emit("message",o,!1),this._state=xn,this.startLoop(t)}))}}controlMessage(t,n){if(this._opcode===8){if(t.length===0)this._loop=!1,this.emit("conclude",1005,$j),this.end();else{let r=t.readUInt16BE(0);if(!U6(r)){let s=this.createError(RangeError,`invalid status code ${r}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");n(s);return}let o=new Cp(t.buffer,t.byteOffset+2,t.length-2);if(!this._skipUTF8Validation&&!Lj(o)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");n(s);return}this._loop=!1,this.emit("conclude",r,o),this.end()}this._state=xn;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",t),this._state=xn):(this._state=Ep,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",t),this._state=xn,this.startLoop(n)}))}createError(t,n,r,o,s){this._loop=!1,this._errored=!0;let i=new t(r?`Invalid WebSocket frame: ${n}`:n);return Error.captureStackTrace(i,this.createError),i.code=s,i[$6]=o,i}};qj.exports=sy});var ly=Te((pfe,Vj)=>{"use strict";var{Duplex:ufe}=Pe("stream"),{randomFillSync:q6}=Pe("crypto"),{types:{isUint8Array:W6}}=Pe("util"),Wj=li(),{EMPTY_BUFFER:z6,kWebSocket:V6,NOOP:J6}=Wr(),{isBlob:pi,isValidStatusCode:G6}=ui(),{mask:zj,toBuffer:ha}=Xc(),Tn=Symbol("kByteLength"),K6=Buffer.alloc(4),Mp=8*1024,wa,mi=Mp,Un=0,Y6=1,X6=2,cy=class e{static{a(this,"Sender")}constructor(t,n,r){this._extensions=n||{},r&&(this._generateMask=r,this._maskBuffer=Buffer.alloc(4)),this._socket=t,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=Un,this.onerror=J6,this[V6]=void 0}static frame(t,n){let r,o=!1,s=2,i=!1;n.mask&&(r=n.maskBuffer||K6,n.generateMask?n.generateMask(r):(mi===Mp&&(wa===void 0&&(wa=Buffer.alloc(Mp)),q6(wa,0,Mp),mi=0),r[0]=wa[mi++],r[1]=wa[mi++],r[2]=wa[mi++],r[3]=wa[mi++]),i=(r[0]|r[1]|r[2]|r[3])===0,s=6);let c;typeof t=="string"?(!n.mask||i)&&n[Tn]!==void 0?c=n[Tn]:(t=Buffer.from(t),c=t.length):(c=t.length,o=n.mask&&n.readOnly&&!i);let d=c;c>=65536?(s+=8,d=127):c>125&&(s+=2,d=126);let l=Buffer.allocUnsafe(o?c+s:s);return l[0]=n.fin?n.opcode|128:n.opcode,n.rsv1&&(l[0]|=64),l[1]=d,d===126?l.writeUInt16BE(c,2):d===127&&(l[2]=l[3]=0,l.writeUIntBE(c,4,6)),n.mask?(l[1]|=128,l[s-4]=r[0],l[s-3]=r[1],l[s-2]=r[2],l[s-1]=r[3],i?[l,t]:o?(zj(t,r,l,s,c),[l]):(zj(t,r,t,0,c),[l,t])):[l,t]}close(t,n,r,o){let s;if(t===void 0)s=z6;else{if(typeof t!="number"||!G6(t))throw new TypeError("First argument must be a valid error code number");if(n===void 0||!n.length)s=Buffer.allocUnsafe(2),s.writeUInt16BE(t,0);else{let c=Buffer.byteLength(n);if(c>123)throw new RangeError("The message must not be greater than 123 bytes");if(s=Buffer.allocUnsafe(2+c),s.writeUInt16BE(t,0),typeof n=="string")s.write(n,2);else if(W6(n))s.set(n,2);else throw new TypeError("Second argument must be a string or a Uint8Array")}}let i={[Tn]:s.length,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Un?this.enqueue([this.dispatch,s,!1,i,o]):this.sendFrame(e.frame(s,i),o)}ping(t,n,r){let o,s;if(typeof t=="string"?(o=Buffer.byteLength(t),s=!1):pi(t)?(o=t.size,s=!1):(t=ha(t),o=t.length,s=ha.readOnly),o>125)throw new RangeError("The data size must not be greater than 125 bytes");let i={[Tn]:o,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};pi(t)?this._state!==Un?this.enqueue([this.getBlobData,t,!1,i,r]):this.getBlobData(t,!1,i,r):this._state!==Un?this.enqueue([this.dispatch,t,!1,i,r]):this.sendFrame(e.frame(t,i),r)}pong(t,n,r){let o,s;if(typeof t=="string"?(o=Buffer.byteLength(t),s=!1):pi(t)?(o=t.size,s=!1):(t=ha(t),o=t.length,s=ha.readOnly),o>125)throw new RangeError("The data size must not be greater than 125 bytes");let i={[Tn]:o,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};pi(t)?this._state!==Un?this.enqueue([this.getBlobData,t,!1,i,r]):this.getBlobData(t,!1,i,r):this._state!==Un?this.enqueue([this.dispatch,t,!1,i,r]):this.sendFrame(e.frame(t,i),r)}send(t,n,r){let o=this._extensions[Wj.extensionName],s=n.binary?2:1,i=n.compress,c,d;typeof t=="string"?(c=Buffer.byteLength(t),d=!1):pi(t)?(c=t.size,d=!1):(t=ha(t),c=t.length,d=ha.readOnly),this._firstFragment?(this._firstFragment=!1,i&&o&&o.params[o._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(i=c>=o._threshold),this._compress=i):(i=!1,s=0),n.fin&&(this._firstFragment=!0);let l={[Tn]:c,fin:n.fin,generateMask:this._generateMask,mask:n.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:d,rsv1:i};pi(t)?this._state!==Un?this.enqueue([this.getBlobData,t,this._compress,l,r]):this.getBlobData(t,this._compress,l,r):this._state!==Un?this.enqueue([this.dispatch,t,this._compress,l,r]):this.dispatch(t,this._compress,l,r)}getBlobData(t,n,r,o){this._bufferedBytes+=r[Tn],this._state=X6,t.arrayBuffer().then(s=>{if(this._socket.destroyed){let c=new Error("The socket was closed while the blob was being read");process.nextTick(dy,this,c,o);return}this._bufferedBytes-=r[Tn];let i=ha(s);n?this.dispatch(i,n,r,o):(this._state=Un,this.sendFrame(e.frame(i,r),o),this.dequeue())}).catch(s=>{process.nextTick(Q6,this,s,o)})}dispatch(t,n,r,o){if(!n){this.sendFrame(e.frame(t,r),o);return}let s=this._extensions[Wj.extensionName];this._bufferedBytes+=r[Tn],this._state=Y6,s.compress(t,r.fin,(i,c)=>{if(this._socket.destroyed){let d=new Error("The socket was closed while data was being compressed");dy(this,d,o);return}this._bufferedBytes-=r[Tn],this._state=Un,r.readOnly=!1,this.sendFrame(e.frame(c,r),o),this.dequeue()})}dequeue(){for(;this._state===Un&&this._queue.length;){let t=this._queue.shift();this._bufferedBytes-=t[3][Tn],Reflect.apply(t[0],this,t.slice(1))}}enqueue(t){this._bufferedBytes+=t[3][Tn],this._queue.push(t)}sendFrame(t,n){t.length===2?(this._socket.cork(),this._socket.write(t[0]),this._socket.write(t[1],n),this._socket.uncork()):this._socket.write(t[0],n)}};Vj.exports=cy;function dy(e,t,n){typeof n=="function"&&n(t);for(let r=0;r<e._queue.length;r++){let o=e._queue[r],s=o[o.length-1];typeof s=="function"&&s(t)}}a(dy,"callCallbacks");function Q6(e,t,n){dy(e,t,n),e.onerror(t)}a(Q6,"onError")});var tH=Te((ffe,eH)=>{"use strict";var{kForOnEventAttribute:Zc,kListener:uy}=Wr(),Jj=Symbol("kCode"),Gj=Symbol("kData"),Kj=Symbol("kError"),Yj=Symbol("kMessage"),Xj=Symbol("kReason"),fi=Symbol("kTarget"),Qj=Symbol("kType"),Zj=Symbol("kWasClean"),Vr=class{static{a(this,"Event")}constructor(t){this[fi]=null,this[Qj]=t}get target(){return this[fi]}get type(){return this[Qj]}};Object.defineProperty(Vr.prototype,"target",{enumerable:!0});Object.defineProperty(Vr.prototype,"type",{enumerable:!0});var ya=class extends Vr{static{a(this,"CloseEvent")}constructor(t,n={}){super(t),this[Jj]=n.code===void 0?0:n.code,this[Xj]=n.reason===void 0?"":n.reason,this[Zj]=n.wasClean===void 0?!1:n.wasClean}get code(){return this[Jj]}get reason(){return this[Xj]}get wasClean(){return this[Zj]}};Object.defineProperty(ya.prototype,"code",{enumerable:!0});Object.defineProperty(ya.prototype,"reason",{enumerable:!0});Object.defineProperty(ya.prototype,"wasClean",{enumerable:!0});var gi=class extends Vr{static{a(this,"ErrorEvent")}constructor(t,n={}){super(t),this[Kj]=n.error===void 0?null:n.error,this[Yj]=n.message===void 0?"":n.message}get error(){return this[Kj]}get message(){return this[Yj]}};Object.defineProperty(gi.prototype,"error",{enumerable:!0});Object.defineProperty(gi.prototype,"message",{enumerable:!0});var ed=class extends Vr{static{a(this,"MessageEvent")}constructor(t,n={}){super(t),this[Gj]=n.data===void 0?null:n.data}get data(){return this[Gj]}};Object.defineProperty(ed.prototype,"data",{enumerable:!0});var Z6={addEventListener(e,t,n={}){for(let o of this.listeners(e))if(!n[Zc]&&o[uy]===t&&!o[Zc])return;let r;if(e==="message")r=a(function(s,i){let c=new ed("message",{data:i?s:s.toString()});c[fi]=this,jp(t,this,c)},"onMessage");else if(e==="close")r=a(function(s,i){let c=new ya("close",{code:s,reason:i.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});c[fi]=this,jp(t,this,c)},"onClose");else if(e==="error")r=a(function(s){let i=new gi("error",{error:s,message:s.message});i[fi]=this,jp(t,this,i)},"onError");else if(e==="open")r=a(function(){let s=new Vr("open");s[fi]=this,jp(t,this,s)},"onOpen");else return;r[Zc]=!!n[Zc],r[uy]=t,n.once?this.once(e,r):this.on(e,r)},removeEventListener(e,t){for(let n of this.listeners(e))if(n[uy]===t&&!n[Zc]){this.removeListener(e,n);break}}};eH.exports={CloseEvent:ya,ErrorEvent:gi,Event:Vr,EventTarget:Z6,MessageEvent:ed};function jp(e,t,n){typeof e=="object"&&e.handleEvent?e.handleEvent.call(e,n):e.call(t,n)}a(jp,"callListener")});var Hp=Te((hfe,nH)=>{"use strict";var{tokenChars:td}=ui();function wr(e,t,n){e[t]===void 0?e[t]=[n]:e[t].push(n)}a(wr,"push");function e5(e){let t=Object.create(null),n=Object.create(null),r=!1,o=!1,s=!1,i,c,d=-1,l=-1,u=-1,p=0;for(;p<e.length;p++)if(l=e.charCodeAt(p),i===void 0)if(u===-1&&td[l]===1)d===-1&&(d=p);else if(p!==0&&(l===32||l===9))u===-1&&d!==-1&&(u=p);else if(l===59||l===44){if(d===-1)throw new SyntaxError(`Unexpected character at index ${p}`);u===-1&&(u=p);let f=e.slice(d,u);l===44?(wr(t,f,n),n=Object.create(null)):i=f,d=u=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);else if(c===void 0)if(u===-1&&td[l]===1)d===-1&&(d=p);else if(l===32||l===9)u===-1&&d!==-1&&(u=p);else if(l===59||l===44){if(d===-1)throw new SyntaxError(`Unexpected character at index ${p}`);u===-1&&(u=p),wr(n,e.slice(d,u),!0),l===44&&(wr(t,i,n),n=Object.create(null),i=void 0),d=u=-1}else if(l===61&&d!==-1&&u===-1)c=e.slice(d,p),d=u=-1;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(o){if(td[l]!==1)throw new SyntaxError(`Unexpected character at index ${p}`);d===-1?d=p:r||(r=!0),o=!1}else if(s)if(td[l]===1)d===-1&&(d=p);else if(l===34&&d!==-1)s=!1,u=p;else if(l===92)o=!0;else throw new SyntaxError(`Unexpected character at index ${p}`);else if(l===34&&e.charCodeAt(p-1)===61)s=!0;else if(u===-1&&td[l]===1)d===-1&&(d=p);else if(d!==-1&&(l===32||l===9))u===-1&&(u=p);else if(l===59||l===44){if(d===-1)throw new SyntaxError(`Unexpected character at index ${p}`);u===-1&&(u=p);let f=e.slice(d,u);r&&(f=f.replace(/\\/g,""),r=!1),wr(n,c,f),l===44&&(wr(t,i,n),n=Object.create(null),i=void 0),c=void 0,d=u=-1}else throw new SyntaxError(`Unexpected character at index ${p}`);if(d===-1||s||l===32||l===9)throw new SyntaxError("Unexpected end of input");u===-1&&(u=p);let m=e.slice(d,u);return i===void 0?wr(t,m,n):(c===void 0?wr(n,m,!0):r?wr(n,c,m.replace(/\\/g,"")):wr(n,c,m),wr(t,i,n)),t}a(e5,"parse");function t5(e){return Object.keys(e).map(t=>{let n=e[t];return Array.isArray(n)||(n=[n]),n.map(r=>[t].concat(Object.keys(r).map(o=>{let s=r[o];return Array.isArray(s)||(s=[s]),s.map(i=>i===!0?o:`${o}=${i}`).join("; ")})).join("; ")).join(", ")}).join(", ")}a(t5,"format");nH.exports={format:t5,parse:e5}});var $p=Te((kfe,fH)=>{"use strict";var n5=Pe("events"),r5=Pe("https"),o5=Pe("http"),aH=Pe("net"),a5=Pe("tls"),{randomBytes:s5,createHash:i5}=Pe("crypto"),{Duplex:yfe,Readable:vfe}=Pe("stream"),{URL:py}=Pe("url"),Eo=li(),c5=iy(),d5=ly(),{isBlob:l5}=ui(),{BINARY_TYPES:rH,CLOSE_TIMEOUT:u5,EMPTY_BUFFER:Op,GUID:p5,kForOnEventAttribute:my,kListener:m5,kStatusCode:f5,kWebSocket:mt,NOOP:sH}=Wr(),{EventTarget:{addEventListener:g5,removeEventListener:h5}}=tH(),{format:w5,parse:y5}=Hp(),{toBuffer:v5}=Xc(),iH=Symbol("kAborted"),fy=[8,13],Jr=["CONNECTING","OPEN","CLOSING","CLOSED"],k5=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,ze=class e extends n5{static{a(this,"WebSocket")}constructor(t,n,r){super(),this._binaryType=rH[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Op,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,t!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,n===void 0?n=[]:Array.isArray(n)||(typeof n=="object"&&n!==null?(r=n,n=[]):n=[n]),cH(this,t,n,r)):(this._autoPong=r.autoPong,this._closeTimeout=r.closeTimeout,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(t){rH.includes(t)&&(this._binaryType=t,this._receiver&&(this._receiver._binaryType=t))}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(t,n,r){let o=new c5({allowSynchronousEvents:r.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxBufferedChunks:r.maxBufferedChunks,maxFragments:r.maxFragments,maxPayload:r.maxPayload,skipUTF8Validation:r.skipUTF8Validation}),s=new d5(t,this._extensions,r.generateMask);this._receiver=o,this._sender=s,this._socket=t,o[mt]=this,s[mt]=this,t[mt]=this,o.on("conclude",I5),o.on("drain",R5),o.on("error",P5),o.on("message",_5),o.on("ping",x5),o.on("pong",T5),s.onerror=A5,t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),n.length>0&&t.unshift(n),t.on("close",uH),t.on("data",Bp),t.on("end",pH),t.on("error",mH),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Eo.extensionName]&&this._extensions[Eo.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,n){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){pn(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===e.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=e.CLOSING,this._sender.close(t,n,!this._isServer,r=>{r||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),lH(this)}}pause(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!0,this._socket.pause())}ping(t,n,r){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(r=t,t=n=void 0):typeof n=="function"&&(r=n,n=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){gy(this,t,r);return}n===void 0&&(n=!this._isServer),this._sender.ping(t||Op,n,r)}pong(t,n,r){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"?(r=t,t=n=void 0):typeof n=="function"&&(r=n,n=void 0),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){gy(this,t,r);return}n===void 0&&(n=!this._isServer),this._sender.pong(t||Op,n,r)}resume(){this.readyState===e.CONNECTING||this.readyState===e.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,n,r){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof n=="function"&&(r=n,n={}),typeof t=="number"&&(t=t.toString()),this.readyState!==e.OPEN){gy(this,t,r);return}let o={binary:typeof t!="string",mask:!this._isServer,compress:!0,fin:!0,...n};this._extensions[Eo.extensionName]||(o.compress=!1),this._sender.send(t||Op,o,r)}terminate(){if(this.readyState!==e.CLOSED){if(this.readyState===e.CONNECTING){pn(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=e.CLOSING,this._socket.destroy())}}};Object.defineProperty(ze,"CONNECTING",{enumerable:!0,value:Jr.indexOf("CONNECTING")});Object.defineProperty(ze.prototype,"CONNECTING",{enumerable:!0,value:Jr.indexOf("CONNECTING")});Object.defineProperty(ze,"OPEN",{enumerable:!0,value:Jr.indexOf("OPEN")});Object.defineProperty(ze.prototype,"OPEN",{enumerable:!0,value:Jr.indexOf("OPEN")});Object.defineProperty(ze,"CLOSING",{enumerable:!0,value:Jr.indexOf("CLOSING")});Object.defineProperty(ze.prototype,"CLOSING",{enumerable:!0,value:Jr.indexOf("CLOSING")});Object.defineProperty(ze,"CLOSED",{enumerable:!0,value:Jr.indexOf("CLOSED")});Object.defineProperty(ze.prototype,"CLOSED",{enumerable:!0,value:Jr.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(e=>{Object.defineProperty(ze.prototype,e,{enumerable:!0})});["open","error","close","message"].forEach(e=>{Object.defineProperty(ze.prototype,`on${e}`,{enumerable:!0,get(){for(let t of this.listeners(e))if(t[my])return t[m5];return null},set(t){for(let n of this.listeners(e))if(n[my]){this.removeListener(e,n);break}typeof t=="function"&&this.addEventListener(e,t,{[my]:!0})}})});ze.prototype.addEventListener=g5;ze.prototype.removeEventListener=h5;fH.exports=ze;function cH(e,t,n,r){let o={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:u5,protocolVersion:fy[1],maxBufferedChunks:262144,maxFragments:16384,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...r,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(e._autoPong=o.autoPong,e._closeTimeout=o.closeTimeout,!fy.includes(o.protocolVersion))throw new RangeError(`Unsupported protocol version: ${o.protocolVersion} (supported versions: ${fy.join(", ")})`);let s;if(t instanceof py)s=t;else try{s=new py(t)}catch{throw new SyntaxError(`Invalid URL: ${t}`)}s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),e._url=s.href;let i=s.protocol==="wss:",c=s.protocol==="ws+unix:",d;if(s.protocol!=="ws:"&&!i&&!c?d=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:c&&!s.pathname?d="The URL's pathname is empty":s.hash&&(d="The URL contains a fragment identifier"),d){let h=new SyntaxError(d);if(e._redirects===0)throw h;Dp(e,h);return}let l=i?443:80,u=s5(16).toString("base64"),p=i?r5.request:o5.request,m=new Set,f;if(o.createConnection=o.createConnection||(i?S5:b5),o.defaultPort=o.defaultPort||l,o.port=s.port||l,o.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,o.headers={...o.headers,"Sec-WebSocket-Version":o.protocolVersion,"Sec-WebSocket-Key":u,Connection:"Upgrade",Upgrade:"websocket"},o.path=s.pathname+s.search,o.timeout=o.handshakeTimeout,o.perMessageDeflate&&(f=new Eo({...o.perMessageDeflate,isServer:!1,maxPayload:o.maxPayload}),o.headers["Sec-WebSocket-Extensions"]=w5({[Eo.extensionName]:f.offer()})),n.length){for(let h of n){if(typeof h!="string"||!k5.test(h)||m.has(h))throw new SyntaxError("An invalid or duplicated subprotocol was specified");m.add(h)}o.headers["Sec-WebSocket-Protocol"]=n.join(",")}if(o.origin&&(o.protocolVersion<13?o.headers["Sec-WebSocket-Origin"]=o.origin:o.headers.Origin=o.origin),(s.username||s.password)&&(o.auth=`${s.username}:${s.password}`),c){let h=o.path.split(":");o.socketPath=h[0],o.path=h[1]}let w;if(o.followRedirects){if(e._redirects===0){e._originalIpc=c,e._originalSecure=i,e._originalHostOrSocketPath=c?o.socketPath:s.host;let h=r&&r.headers;if(r={...r,headers:{}},h)for(let[v,g]of Object.entries(h))r.headers[v.toLowerCase()]=g}else if(e.listenerCount("redirect")===0){let h=c?e._originalIpc?o.socketPath===e._originalHostOrSocketPath:!1:e._originalIpc?!1:s.host===e._originalHostOrSocketPath;(!h||e._originalSecure&&!i)&&(delete o.headers.authorization,delete o.headers.cookie,h||delete o.headers.host,o.auth=void 0)}o.auth&&!r.headers.authorization&&(r.headers.authorization="Basic "+Buffer.from(o.auth).toString("base64")),w=e._req=p(o),e._redirects&&e.emit("redirect",e.url,w)}else w=e._req=p(o);o.timeout&&w.on("timeout",()=>{pn(e,w,"Opening handshake has timed out")}),w.on("error",h=>{w===null||w[iH]||(w=e._req=null,Dp(e,h))}),w.on("response",h=>{let v=h.headers.location,g=h.statusCode;if(v&&o.followRedirects&&g>=300&&g<400){if(++e._redirects>o.maxRedirects){pn(e,w,"Maximum redirects exceeded");return}w.abort();let S;try{S=new py(v,t)}catch{let k=new SyntaxError(`Invalid URL: ${v}`);Dp(e,k);return}cH(e,S,n,r)}else e.emit("unexpected-response",w,h)||pn(e,w,`Unexpected server response: ${h.statusCode}`)}),w.on("upgrade",(h,v,g)=>{if(e.emit("upgrade",h),e.readyState!==ze.CONNECTING)return;w=e._req=null;let S=h.headers.upgrade;if(S===void 0||S.toLowerCase()!=="websocket"){pn(e,v,"Invalid Upgrade header");return}let R=i5("sha1").update(u+p5).digest("base64");if(h.headers["sec-websocket-accept"]!==R){pn(e,v,"Invalid Sec-WebSocket-Accept header");return}let k=h.headers["sec-websocket-protocol"],y;if(k!==void 0?m.size?m.has(k)||(y="Server sent an invalid subprotocol"):y="Server sent a subprotocol but none was requested":m.size&&(y="Server sent no subprotocol"),y){pn(e,v,y);return}k&&(e._protocol=k);let T=h.headers["sec-websocket-extensions"];if(T!==void 0){if(!f){pn(e,v,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let C;try{C=y5(T)}catch{pn(e,v,"Invalid Sec-WebSocket-Extensions header");return}let b=Object.keys(C);if(b.length!==1||b[0]!==Eo.extensionName){pn(e,v,"Server indicated an extension that was not requested");return}try{f.accept(C[Eo.extensionName])}catch{pn(e,v,"Invalid Sec-WebSocket-Extensions header");return}e._extensions[Eo.extensionName]=f}e.setSocket(v,g,{allowSynchronousEvents:o.allowSynchronousEvents,generateMask:o.generateMask,maxBufferedChunks:o.maxBufferedChunks,maxFragments:o.maxFragments,maxPayload:o.maxPayload,skipUTF8Validation:o.skipUTF8Validation})}),o.finishRequest?o.finishRequest(w,e):w.end()}a(cH,"initAsClient");function Dp(e,t){e._readyState=ze.CLOSING,e._errorEmitted=!0,e.emit("error",t),e.emitClose()}a(Dp,"emitErrorAndClose");function b5(e){return e.path=e.socketPath,aH.connect(e)}a(b5,"netConnect");function S5(e){return e.path=void 0,!e.servername&&e.servername!==""&&(e.servername=aH.isIP(e.host)?"":e.host),a5.connect(e)}a(S5,"tlsConnect");function pn(e,t,n){e._readyState=ze.CLOSING;let r=new Error(n);Error.captureStackTrace(r,pn),t.setHeader?(t[iH]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(Dp,e,r)):(t.destroy(r),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}a(pn,"abortHandshake");function gy(e,t,n){if(t){let r=l5(t)?t.size:v5(t).length;e._socket?e._sender._bufferedBytes+=r:e._bufferedAmount+=r}if(n){let r=new Error(`WebSocket is not open: readyState ${e.readyState} (${Jr[e.readyState]})`);process.nextTick(n,r)}}a(gy,"sendAfterClose");function I5(e,t){let n=this[mt];n._closeFrameReceived=!0,n._closeMessage=t,n._closeCode=e,n._socket[mt]!==void 0&&(n._socket.removeListener("data",Bp),process.nextTick(dH,n._socket),e===1005?n.close():n.close(e,t))}a(I5,"receiverOnConclude");function R5(){let e=this[mt];e.isPaused||e._socket.resume()}a(R5,"receiverOnDrain");function P5(e){let t=this[mt];t._socket[mt]!==void 0&&(t._socket.removeListener("data",Bp),process.nextTick(dH,t._socket),t.close(e[f5])),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e))}a(P5,"receiverOnError");function oH(){this[mt].emitClose()}a(oH,"receiverOnFinish");function _5(e,t){this[mt].emit("message",e,t)}a(_5,"receiverOnMessage");function x5(e){let t=this[mt];t._autoPong&&t.pong(e,!this._isServer,sH),t.emit("ping",e)}a(x5,"receiverOnPing");function T5(e){this[mt].emit("pong",e)}a(T5,"receiverOnPong");function dH(e){e.resume()}a(dH,"resume");function A5(e){let t=this[mt];t.readyState!==ze.CLOSED&&(t.readyState===ze.OPEN&&(t._readyState=ze.CLOSING,lH(t)),this._socket.end(),t._errorEmitted||(t._errorEmitted=!0,t.emit("error",e)))}a(A5,"senderOnError");function lH(e){e._closeTimer=setTimeout(e._socket.destroy.bind(e._socket),e._closeTimeout)}a(lH,"setCloseTimer");function uH(){let e=this[mt];if(this.removeListener("close",uH),this.removeListener("data",Bp),this.removeListener("end",pH),e._readyState=ze.CLOSING,!this._readableState.endEmitted&&!e._closeFrameReceived&&!e._receiver._writableState.errorEmitted&&this._readableState.length!==0){let t=this.read(this._readableState.length);e._receiver.write(t)}e._receiver.end(),this[mt]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",oH),e._receiver.on("finish",oH))}a(uH,"socketOnClose");function Bp(e){this[mt]._receiver.write(e)||this.pause()}a(Bp,"socketOnData");function pH(){let e=this[mt];e._readyState=ze.CLOSING,e._receiver.end(),this.end()}a(pH,"socketOnEnd");function mH(){let e=this[mt];this.removeListener("error",mH),this.on("error",sH),e&&(e._readyState=ze.CLOSING,this.destroy())}a(mH,"socketOnError")});var yH=Te((Ife,wH)=>{"use strict";var Sfe=$p(),{Duplex:C5}=Pe("stream");function gH(e){e.emit("close")}a(gH,"emitClose");function E5(){!this.destroyed&&this._writableState.finished&&this.destroy()}a(E5,"duplexOnEnd");function hH(e){this.removeListener("error",hH),this.destroy(),this.listenerCount("error")===0&&this.emit("error",e)}a(hH,"duplexOnError");function M5(e,t){let n=!0,r=new C5({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",a(function(s,i){let c=!i&&r._readableState.objectMode?s.toString():s;r.push(c)||e.pause()},"message")),e.once("error",a(function(s){r.destroyed||(n=!1,r.destroy(s))},"error")),e.once("close",a(function(){r.destroyed||r.push(null)},"close")),r._destroy=function(o,s){if(e.readyState===e.CLOSED){s(o),process.nextTick(gH,r);return}let i=!1;e.once("error",a(function(d){i=!0,s(d)},"error")),e.once("close",a(function(){i||s(o),process.nextTick(gH,r)},"close")),n&&e.terminate()},r._final=function(o){if(e.readyState===e.CONNECTING){e.once("open",a(function(){r._final(o)},"open"));return}e._socket!==null&&(e._socket._writableState.finished?(o(),r._readableState.endEmitted&&r.destroy()):(e._socket.once("finish",a(function(){o()},"finish")),e.close()))},r._read=function(){e.isPaused&&e.resume()},r._write=function(o,s,i){if(e.readyState===e.CONNECTING){e.once("open",a(function(){r._write(o,s,i)},"open"));return}e.send(o,i)},r.on("end",E5),r.on("error",hH),r}a(M5,"createWebSocketStream");wH.exports=M5});var hy=Te((Pfe,vH)=>{"use strict";var{tokenChars:j5}=ui();function H5(e){let t=new Set,n=-1,r=-1,o=0;for(o;o<e.length;o++){let i=e.charCodeAt(o);if(r===-1&&j5[i]===1)n===-1&&(n=o);else if(o!==0&&(i===32||i===9))r===-1&&n!==-1&&(r=o);else if(i===44){if(n===-1)throw new SyntaxError(`Unexpected character at index ${o}`);r===-1&&(r=o);let c=e.slice(n,r);if(t.has(c))throw new SyntaxError(`The "${c}" subprotocol is duplicated`);t.add(c),n=r=-1}else throw new SyntaxError(`Unexpected character at index ${o}`)}if(n===-1||r!==-1)throw new SyntaxError("Unexpected end of input");let s=e.slice(n,o);if(t.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);return t.add(s),t}a(H5,"parse");vH.exports={parse:H5}});var _H=Te((Tfe,PH)=>{"use strict";var O5=Pe("events"),Lp=Pe("http"),{Duplex:xfe}=Pe("stream"),{createHash:D5}=Pe("crypto"),kH=Hp(),va=li(),B5=hy(),$5=$p(),{CLOSE_TIMEOUT:L5,GUID:N5,kWebSocket:F5}=Wr(),U5=/^[+/0-9A-Za-z]{22}==$/,bH=0,SH=1,RH=2,wy=class extends O5{static{a(this,"WebSocketServer")}constructor(t,n){if(super(),t={allowSynchronousEvents:!0,autoPong:!0,maxBufferedChunks:256*1024,maxFragments:16*1024,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:L5,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:$5,...t},t.port==null&&!t.server&&!t.noServer||t.port!=null&&(t.server||t.noServer)||t.server&&t.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(t.port!=null?(this._server=Lp.createServer((r,o)=>{let s=Lp.STATUS_CODES[426];o.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),o.end(s)}),this._server.listen(t.port,t.host,t.backlog,n)):t.server&&(this._server=t.server),this._server){let r=this.emit.bind(this,"connection");this._removeListeners=q5(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:a((o,s,i)=>{this.handleUpgrade(o,s,i,r)},"upgrade")})}t.perMessageDeflate===!0&&(t.perMessageDeflate={}),t.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=t,this._state=bH}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(t){if(this._state===RH){t&&this.once("close",()=>{t(new Error("The server is not running"))}),process.nextTick(nd,this);return}if(t&&this.once("close",t),this._state!==SH)if(this._state=SH,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(nd,this):process.nextTick(nd,this);else{let n=this._server;this._removeListeners(),this._removeListeners=this._server=null,n.close(()=>{nd(this)})}}shouldHandle(t){if(this.options.path){let n=t.url.indexOf("?");if((n!==-1?t.url.slice(0,n):t.url)!==this.options.path)return!1}return!0}handleUpgrade(t,n,r,o){n.on("error",IH);let s=t.headers["sec-websocket-key"],i=t.headers.upgrade,c=+t.headers["sec-websocket-version"];if(t.method!=="GET"){ka(this,t,n,405,"Invalid HTTP method");return}if(i===void 0||i.toLowerCase()!=="websocket"){ka(this,t,n,400,"Invalid Upgrade header");return}if(s===void 0||!U5.test(s)){ka(this,t,n,400,"Missing or invalid Sec-WebSocket-Key header");return}if(c!==13&&c!==8){ka(this,t,n,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(t)){rd(n,400);return}let d=t.headers["sec-websocket-protocol"],l=new Set;if(d!==void 0)try{l=B5.parse(d)}catch{ka(this,t,n,400,"Invalid Sec-WebSocket-Protocol header");return}let u=t.headers["sec-websocket-extensions"],p={};if(this.options.perMessageDeflate&&u!==void 0){let m=new va({...this.options.perMessageDeflate,isServer:!0,maxPayload:this.options.maxPayload});try{let f=kH.parse(u);f[va.extensionName]&&(m.accept(f[va.extensionName]),p[va.extensionName]=m)}catch{ka(this,t,n,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let m={origin:t.headers[`${c===8?"sec-websocket-origin":"origin"}`],secure:!!(t.socket.authorized||t.socket.encrypted),req:t};if(this.options.verifyClient.length===2){this.options.verifyClient(m,(f,w,h,v)=>{if(!f)return rd(n,w||401,h,v);this.completeUpgrade(p,s,l,t,n,r,o)});return}if(!this.options.verifyClient(m))return rd(n,401)}this.completeUpgrade(p,s,l,t,n,r,o)}completeUpgrade(t,n,r,o,s,i,c){if(!s.readable||!s.writable)return s.destroy();if(s[F5])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>bH)return rd(s,503);let l=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${D5("sha1").update(n+N5).digest("base64")}`],u=new this.options.WebSocket(null,void 0,this.options);if(r.size){let p=this.options.handleProtocols?this.options.handleProtocols(r,o):r.values().next().value;p&&(l.push(`Sec-WebSocket-Protocol: ${p}`),u._protocol=p)}if(t[va.extensionName]){let p=t[va.extensionName].params,m=kH.format({[va.extensionName]:[p]});l.push(`Sec-WebSocket-Extensions: ${m}`),u._extensions=t}this.emit("headers",l,o),s.write(l.concat(`\r
|
|
4
4
|
`).join(`\r
|
|
5
5
|
`)),s.removeListener("error",IH),u.setSocket(s,i,{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(u),u.on("close",()=>{this.clients.delete(u),this._shouldEmitClose&&!this.clients.size&&process.nextTick(nd,this)})),c(u,o)}};PH.exports=wy;function q5(e,t){for(let n of Object.keys(t))e.on(n,t[n]);return a(function(){for(let r of Object.keys(t))e.removeListener(r,t[r])},"removeListeners")}a(q5,"addListeners");function nd(e){e._state=RH,e.emit("close")}a(nd,"emitClose");function IH(){this.destroy()}a(IH,"socketOnError");function rd(e,t,n,r){n=n||Lp.STATUS_CODES[t],r={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(n),...r},e.once("finish",e.destroy),e.end(`HTTP/1.1 ${t} ${Lp.STATUS_CODES[t]}\r
|
|
6
6
|
`+Object.keys(r).map(o=>`${o}: ${r[o]}`).join(`\r
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
2
|
-
import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-
|
|
2
|
+
import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-GHGVF2KG.js";import"./chunk-HMADUZ5P.js";import"./chunk-FTQLQJQV.js";export{a as MACOS_GIT_MISSING_DEVELOPER_TOOLS_ERROR,C as appWorkspacePaths,B as assertSafeBranchName,d as checkWorkspaceGitAvailability,J as checkoutBranch,K as checkoutBranchAtPath,M as clearWorkspaceDiffCacheForTests,D as cloneWorkspace,H as createAndCheckoutBranch,I as createAndCheckoutBranchAtPath,A as expectedRemoteUrl,t as isGeneratedWorkspacePath,i as isGitRepo,c as isMacOSGitDeveloperToolsMissing,u as isVisibleGitWorkspaceFile,r as isWorkspaceDirectory,E as lastFetchAt,z as listPlainWorkspaceFiles,P as loadGitCommitDiffAtPath,N as loadWorkspaceDiff,O as loadWorkspaceDiffAtPath,Q as loadWorkspaceFile,T as loadWorkspaceFileAtPath,R as loadWorkspaceImageFile,S as loadWorkspaceImageFileAtPath,F as loadWorkspaceState,G as loadWorkspaceStateAtPath,n as localVideoContentType,L as mapWorkspaceDiffEntriesWithConcurrency,s as normalizeWorkspaceFilePath,w as parseBranchStatusLine,x as parseNumstat,v as parseStatusLine,h as pathExists,p as readLocalImageFile,q as readLocalVideoFile,l as readWorkspaceDocumentPreview,k as readWorkspaceFile,o as readWorkspaceImageFile,g as redactRemoteUrl,b as runWorkspaceCommand,f as sourceFromRemote,e as startMacOSCommandLineToolsInstall,j as truncatePatch,y as uniqueSortedPaths,m as workspaceImageContentType};
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __openpondCreateRequire } from "node:module"; var require = __openpondCreateRequire(import.meta.url);
|
|
3
|
-
import{a as m,b as l}from"./chunks/chunk-BSHAIAXY.js";import"./chunks/chunk-XWPC3AN4.js";import"./chunks/chunk-GLUWATL5.js";import{b as u}from"./chunks/chunk-WVUPFGU7.js";import{a as c,j as d}from"./chunks/chunk-JKMPJFMN.js";import{f as s}from"./chunks/chunk-3M53YXEI.js";import{a as i}from"./chunks/chunk-FTQLQJQV.js";function f(e){return!e.command&&s(e.options.version)?"version":s(e.options.checkUpdate)?"check-update":!e.command&&s(e.options.help)?"help":!e.command&&s(e.options.tui)?"tui":e.command?"command":"ui"}i(f,"resolveCliTopLevelAction");async function v(e=process.argv.slice(2)){if(await C(e))return;let{command:r,options:o,rest:t}=u(e);typeof o.home=="string"&&(process.env.OPENPOND_HOME=(await import("./chunks/dist-5C6RYTQQ.js")).resolveOpenPondHome({home:o.home}));let n=f({command:r,options:o});if(n==="version"){console.log(c());return}if(n==="check-update"){await(await import("./chunks/core-commands-QQNCA4WQ.js")).runCheckUpdate();return}if(n==="help"){(await import("./chunks/help-DZBHIKVE.js")).printHelp();return}let a=m(o),p=l(o);if(a&&(process.env.OPENPOND_ACCOUNT=a),p&&(process.env.OPENPOND_BASE_URL=p),n==="tui"){await(await import("./chunks/app-layer-GLXYIT4B.js")).runOpenPondTerminalCommand(o,t);return}if(n==="ui"){await(await import("./chunks/app-layer-GLXYIT4B.js")).runOpenPondServerCommand("web",o,t);return}await d({command:r,options:o,rest:t})||((await import("./chunks/help-DZBHIKVE.js")).printHelp(),process.exit(1))}i(v,"runOpenPondCli");async function C(e){if(e[0]==="__app-server"){process.argv=[process.execPath,"openpond-app-server",...e.slice(1)];let[{createOpenPondAppServer:r},{runOpenPondAppServerCli:o}]=await Promise.all([import("./chunks/app-server-runtime-
|
|
3
|
+
import{a as m,b as l}from"./chunks/chunk-BSHAIAXY.js";import"./chunks/chunk-XWPC3AN4.js";import"./chunks/chunk-GLUWATL5.js";import{b as u}from"./chunks/chunk-WVUPFGU7.js";import{a as c,j as d}from"./chunks/chunk-JKMPJFMN.js";import{f as s}from"./chunks/chunk-3M53YXEI.js";import{a as i}from"./chunks/chunk-FTQLQJQV.js";function f(e){return!e.command&&s(e.options.version)?"version":s(e.options.checkUpdate)?"check-update":!e.command&&s(e.options.help)?"help":!e.command&&s(e.options.tui)?"tui":e.command?"command":"ui"}i(f,"resolveCliTopLevelAction");async function v(e=process.argv.slice(2)){if(await C(e))return;let{command:r,options:o,rest:t}=u(e);typeof o.home=="string"&&(process.env.OPENPOND_HOME=(await import("./chunks/dist-5C6RYTQQ.js")).resolveOpenPondHome({home:o.home}));let n=f({command:r,options:o});if(n==="version"){console.log(c());return}if(n==="check-update"){await(await import("./chunks/core-commands-QQNCA4WQ.js")).runCheckUpdate();return}if(n==="help"){(await import("./chunks/help-DZBHIKVE.js")).printHelp();return}let a=m(o),p=l(o);if(a&&(process.env.OPENPOND_ACCOUNT=a),p&&(process.env.OPENPOND_BASE_URL=p),n==="tui"){await(await import("./chunks/app-layer-GLXYIT4B.js")).runOpenPondTerminalCommand(o,t);return}if(n==="ui"){await(await import("./chunks/app-layer-GLXYIT4B.js")).runOpenPondServerCommand("web",o,t);return}await d({command:r,options:o,rest:t})||((await import("./chunks/help-DZBHIKVE.js")).printHelp(),process.exit(1))}i(v,"runOpenPondCli");async function C(e){if(e[0]==="__app-server"){process.argv=[process.execPath,"openpond-app-server",...e.slice(1)];let[{createOpenPondAppServer:r},{runOpenPondAppServerCli:o}]=await Promise.all([import("./chunks/app-server-runtime-SNSNFJW7.js"),import("./chunks/cli-DCFZ4GT6.js")]);return await o(r),!0}if(e[0]==="__server"){process.argv=[process.execPath,"openpond-server",...e.slice(1)];let[{createOpenPondServer:r},{runOpenPondServerCli:o}]=await Promise.all([import("./chunks/src-G3GYZMCL.js"),import("./chunks/cli-DCFZ4GT6.js")]),{createOpenPondAppServer:t}=await import("./chunks/app-server-runtime-SNSNFJW7.js");return await o({createOpenPondServer:r,createOpenPondAppServer:t}),!0}return e[0]==="__terminal"?(await(await import("./chunks/src-4L62URN6.js")).runOpenPondTerminalCli(e.slice(1)),!0):!1}i(C,"runEmbeddedCompanion");v().catch(e=>{let r=e instanceof Error?e.message:String(e),o=e.issue;if(process.argv.includes("--json")&&!(e instanceof Error&&e.name==="OpenPondChildProcessExitError"))console.log(JSON.stringify({error:o??{code:"CLI_ERROR",message:r}}));else if(o&&typeof o=="object"){let n=o;console.error(`${n.code}: ${n.message}
|
|
4
4
|
${n.path}
|
|
5
5
|
${n.action}`)}else console.error(r);let t=typeof e.exitCode=="number"?e.exitCode:1;process.exit(t)});export{v as runOpenPondCli};
|