zen-code 4.9.2 → 4.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/dist/app.js +94 -128
  2. package/dist/chunk-075hks9v.js +1 -0
  3. package/dist/chunk-0fj768k4.js +112 -0
  4. package/dist/chunk-19mf2aa7.js +1 -0
  5. package/dist/chunk-1mq2jmfy.js +2 -0
  6. package/dist/chunk-1v863afn.js +278 -0
  7. package/dist/chunk-1vn8d8b8.js +1 -0
  8. package/dist/{chunk-hfypkhky.js → chunk-1w19w1bm.js} +1 -1
  9. package/dist/chunk-3dnayvgx.js +224 -0
  10. package/dist/chunk-4hg13vwj.js +1 -0
  11. package/dist/chunk-4scrkcqv.js +1 -0
  12. package/dist/chunk-54cdhhqm.js +1 -0
  13. package/dist/chunk-5m4yb9av.js +91 -0
  14. package/dist/chunk-5yd4ntp6.js +8 -0
  15. package/dist/{chunk-dxec2q4t.js → chunk-6scjjkn3.js} +1 -1
  16. package/dist/{chunk-hmemx3cw.js → chunk-7jatn15w.js} +2 -2
  17. package/dist/{chunk-0pss3s5r.js → chunk-7w9y11hj.js} +1 -1
  18. package/dist/chunk-7yzv6385.js +1 -0
  19. package/dist/{chunk-ce53j63y.js → chunk-875hayaj.js} +3 -3
  20. package/dist/chunk-8bs8r50r.js +1 -0
  21. package/dist/{chunk-x552nspp.js → chunk-8waww0j9.js} +2 -2
  22. package/dist/chunk-8ysg0rga.js +1 -0
  23. package/dist/chunk-9czhw5k6.js +4 -0
  24. package/dist/chunk-9tgp14v7.js +16 -0
  25. package/dist/{chunk-yndex7hs.js → chunk-a239dn0b.js} +1 -1
  26. package/dist/chunk-arv4h3h1.js +2 -0
  27. package/dist/chunk-b2551zfb.js +2 -0
  28. package/dist/chunk-b9emn03n.js +1 -0
  29. package/dist/chunk-bm7578sn.js +1 -0
  30. package/dist/{chunk-62zh99t6.js → chunk-bytq4kd1.js} +3 -125
  31. package/dist/chunk-c2wfgbj6.js +1 -0
  32. package/dist/{chunk-0zk0m93z.js → chunk-cef4vbtb.js} +1 -1
  33. package/dist/{chunk-hsev32dg.js → chunk-cnzhxgn5.js} +2 -2
  34. package/dist/chunk-d2770b2z.js +1 -0
  35. package/dist/chunk-d72063sm.js +2 -0
  36. package/dist/{chunk-6nfpdtn6.js → chunk-d988tv30.js} +1 -1
  37. package/dist/{chunk-55nx49pj.js → chunk-dx9k6sdd.js} +3 -3
  38. package/dist/chunk-e6ggkg36.js +2 -0
  39. package/dist/{chunk-x90r4sje.js → chunk-fjqtrakn.js} +1 -1
  40. package/dist/chunk-gbfpab0j.js +1 -0
  41. package/dist/chunk-gkvx829z.js +1 -0
  42. package/dist/{chunk-94jawhw7.js → chunk-gwf8b14k.js} +1 -1
  43. package/dist/chunk-gz7fz9fg.js +1 -0
  44. package/dist/{chunk-48vkm1yn.js → chunk-h0q3dvnv.js} +2 -2
  45. package/dist/chunk-h0qb9jk1.js +1 -0
  46. package/dist/chunk-h9y136h8.js +1 -0
  47. package/dist/chunk-hrcxdj3c.js +54 -0
  48. package/dist/chunk-hz9yw7cs.js +166 -0
  49. package/dist/{chunk-98wjxsna.js → chunk-j4y5rjne.js} +1 -1
  50. package/dist/chunk-k12y05c3.js +3 -0
  51. package/dist/{chunk-fkrydbn4.js → chunk-k6fxqssr.js} +3 -3
  52. package/dist/{chunk-vfwbx331.js → chunk-kmxdq21k.js} +2 -2
  53. package/dist/chunk-mcb8rewr.js +213 -0
  54. package/dist/{chunk-9k64296h.js → chunk-mm9w91rj.js} +1 -1
  55. package/dist/chunk-mv0xzmq8.js +2 -0
  56. package/dist/{chunk-rztre6k0.js → chunk-n849zsd3.js} +1 -1
  57. package/dist/chunk-nm253hhf.js +81 -0
  58. package/dist/{chunk-gyhxdxb4.js → chunk-prg6489q.js} +1 -1
  59. package/dist/{chunk-pwrscdkf.js → chunk-pxdgy0vr.js} +1 -1
  60. package/dist/{chunk-frhhpxxy.js → chunk-qhzm2qw9.js} +2 -2
  61. package/dist/{chunk-8f2zh5h6.js → chunk-qmxtys9q.js} +2 -2
  62. package/dist/chunk-r0cfe5c1.js +294 -0
  63. package/dist/chunk-rtjytfhh.js +1 -0
  64. package/dist/chunk-s7ttf0pm.js +2 -0
  65. package/dist/{chunk-k38fjqj7.js → chunk-t01t72t2.js} +2 -2
  66. package/dist/{chunk-fw3nrwpf.js → chunk-t0f66x64.js} +1 -1
  67. package/dist/chunk-tn356gwf.js +93 -0
  68. package/dist/chunk-vd8kwzra.js +41 -0
  69. package/dist/chunk-vhn13anh.js +233 -0
  70. package/dist/chunk-vnewbtjy.js +1 -0
  71. package/dist/{chunk-hfegb4pr.js → chunk-wbm7rn9w.js} +2 -2
  72. package/dist/chunk-wd3gkd45.js +3 -0
  73. package/dist/chunk-whdf0vbb.js +1 -0
  74. package/dist/{chunk-r019959h.js → chunk-ws232ksq.js} +2 -2
  75. package/dist/{chunk-rt5mpgbg.js → chunk-yerf10k7.js} +2 -2
  76. package/dist/{chunk-pndhbee8.js → chunk-yzv3n8mw.js} +2 -2
  77. package/dist/chunk-z3e4c424.js +2 -0
  78. package/dist/{chunk-jb4yt88g.js → chunk-znw7fpep.js} +2 -2
  79. package/dist/chunk-zq2g4rfd.js +1 -0
  80. package/dist/cli.js +1 -1
  81. package/dist/nonInteractive.js +314 -4
  82. package/dist/zen-keyboard.js +1 -1
  83. package/package.json +37 -37
  84. package/dist/chunk-0sxrk9sx.js +0 -1
  85. package/dist/chunk-178yjjsx.js +0 -1
  86. package/dist/chunk-1p9xzvpt.js +0 -3
  87. package/dist/chunk-2eh0sv3s.js +0 -2
  88. package/dist/chunk-43xrz4wp.js +0 -2
  89. package/dist/chunk-48ce2wt0.js +0 -1
  90. package/dist/chunk-578m1dhj.js +0 -2
  91. package/dist/chunk-5dsevrtz.js +0 -91
  92. package/dist/chunk-66890qd3.js +0 -2
  93. package/dist/chunk-738m8242.js +0 -53
  94. package/dist/chunk-8ty2zfve.js +0 -3
  95. package/dist/chunk-9b7nj74j.js +0 -1
  96. package/dist/chunk-9x562s6p.js +0 -1
  97. package/dist/chunk-a90fm6gz.js +0 -278
  98. package/dist/chunk-ac5t2ywn.js +0 -100
  99. package/dist/chunk-ad2hbq42.js +0 -1
  100. package/dist/chunk-afhxxkmv.js +0 -16
  101. package/dist/chunk-b4vvgbav.js +0 -1
  102. package/dist/chunk-b9pcntkv.js +0 -253
  103. package/dist/chunk-c7y5efa0.js +0 -1
  104. package/dist/chunk-cbjnwrt7.js +0 -2
  105. package/dist/chunk-dcs1r9as.js +0 -2
  106. package/dist/chunk-dcwnpdtk.js +0 -9
  107. package/dist/chunk-e3tyc24s.js +0 -310
  108. package/dist/chunk-e8hp8d68.js +0 -81
  109. package/dist/chunk-h1enhch1.js +0 -2
  110. package/dist/chunk-hcnx1j2z.js +0 -1
  111. package/dist/chunk-hra0748z.js +0 -2
  112. package/dist/chunk-hyf24r36.js +0 -2
  113. package/dist/chunk-jjcmm167.js +0 -1
  114. package/dist/chunk-jrepjpft.js +0 -2
  115. package/dist/chunk-kym9tb01.js +0 -1
  116. package/dist/chunk-mt1g6g89.js +0 -1
  117. package/dist/chunk-p0vzbr7s.js +0 -585
  118. package/dist/chunk-r10bn684.js +0 -1
  119. package/dist/chunk-r3pe49q4.js +0 -8
  120. package/dist/chunk-r4tq44hr.js +0 -1
  121. package/dist/chunk-rjrnaka2.js +0 -1
  122. package/dist/chunk-s77qbhtz.js +0 -3
  123. package/dist/chunk-t7rwtc17.js +0 -1
  124. package/dist/chunk-v8g52kan.js +0 -1
  125. package/dist/chunk-vd6c87cm.js +0 -2
  126. package/dist/chunk-vh9zd1v3.js +0 -5
  127. package/dist/chunk-w2hbsa9j.js +0 -86
  128. package/dist/chunk-wabmqprd.js +0 -184
  129. package/dist/chunk-wpy5r9ma.js +0 -40
  130. package/dist/chunk-yqwxbcc7.js +0 -31
  131. package/dist/chunk-z8n7y37k.js +0 -1
  132. package/dist/chunk-zr7sx9hd.js +0 -1
  133. package/dist/chunk-zxqmghzf.js +0 -1
@@ -1,4 +1,4 @@
1
- import{pq as W8,qq as E1,tq as o5}from"./chunk-dcs1r9as.js";var Y4=E1((sY,X6)=>{var J6=["nodebuffer","arraybuffer","fragments"],K6=typeof Blob<"u";if(K6)J6.push("blob");X6.exports={BINARY_TYPES:J6,CLOSE_TIMEOUT:30000,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:K6,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var _3=E1((oY,$7)=>{var{EMPTY_BUFFER:qI}=Y4(),gJ=Buffer[Symbol.species];function UI(G,H){if(G.length===0)return qI;if(G.length===1)return G[0];let R=Buffer.allocUnsafe(H),P=0;for(let D=0;D<G.length;D++){let M=G[D];R.set(M,P),P+=M.length}if(P<H)return new gJ(R.buffer,R.byteOffset,P);return R}function Z6(G,H,R,P,D){for(let M=0;M<D;M++)R[P+M]=G[M]^H[M&3]}function $6(G,H){for(let R=0;R<G.length;R++)G[R]^=H[R&3]}function LI(G){if(G.length===G.buffer.byteLength)return G.buffer;return G.buffer.slice(G.byteOffset,G.byteOffset+G.length)}function hJ(G){if(hJ.readOnly=!0,Buffer.isBuffer(G))return G;let H;if(G instanceof ArrayBuffer)H=new gJ(G);else if(ArrayBuffer.isView(G))H=new gJ(G.buffer,G.byteOffset,G.byteLength);else H=Buffer.from(G),hJ.readOnly=!1;return H}$7.exports={concat:UI,mask:Z6,toArrayBuffer:LI,toBuffer:hJ,unmask:$6};if(!process.env.WS_NO_BUFFER_UTIL)try{let G=(()=>{throw new Error("Cannot require module "+"bufferutil");})();$7.exports.mask=function(H,R,P,D,M){if(M<48)Z6(H,R,P,D,M);else G.mask(H,R,P,D,M)},$7.exports.unmask=function(H,R){if(H.length<32)$6(H,R);else G.unmask(H,R)}}catch(G){}});var z6=E1((tY,I6)=>{var Q6=Symbol("kDone"),mJ=Symbol("kRun");class G6{constructor(G){this[Q6]=()=>{this.pending--,this[mJ]()},this.concurrency=G||1/0,this.jobs=[],this.pending=0}add(G){this.jobs.push(G),this[mJ]()}[mJ](){if(this.pending===this.concurrency)return;if(this.jobs.length){let G=this.jobs.shift();this.pending++,G(this[Q6])}}}I6.exports=G6});var N3=E1((eY,H6)=>{var H3=o5("zlib"),j6=_3(),WI=z6(),{kStatusCode:Y6}=Y4(),EI=Buffer[Symbol.species],yI=Buffer.from([0,0,255,255]),G7=Symbol("permessage-deflate"),V4=Symbol("total-length"),T8=Symbol("callback"),U4=Symbol("buffers"),x8=Symbol("error"),Q7;class V6{constructor(G,H,R){if(this._maxPayload=R|0,this._options=G||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!H,this._deflate=null,this._inflate=null,this.params=null,!Q7){let P=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Q7=new WI(P)}}static get extensionName(){return"permessage-deflate"}offer(){let G={};if(this._options.serverNoContextTakeover)G.server_no_context_takeover=!0;if(this._options.clientNoContextTakeover)G.client_no_context_takeover=!0;if(this._options.serverMaxWindowBits)G.server_max_window_bits=this._options.serverMaxWindowBits;if(this._options.clientMaxWindowBits)G.client_max_window_bits=this._options.clientMaxWindowBits;else if(this._options.clientMaxWindowBits==null)G.client_max_window_bits=!0;return G}accept(G){return G=this.normalizeParams(G),this.params=this._isServer?this.acceptAsServer(G):this.acceptAsClient(G),this.params}cleanup(){if(this._inflate)this._inflate.close(),this._inflate=null;if(this._deflate){let G=this._deflate[T8];if(this._deflate.close(),this._deflate=null,G)G(Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(G){let H=this._options,R=G.find((P)=>{if(H.serverNoContextTakeover===!1&&P.server_no_context_takeover||P.server_max_window_bits&&(H.serverMaxWindowBits===!1||typeof H.serverMaxWindowBits==="number"&&H.serverMaxWindowBits>P.server_max_window_bits)||typeof H.clientMaxWindowBits==="number"&&!P.client_max_window_bits)return!1;return!0});if(!R)throw Error("None of the extension offers can be accepted");if(H.serverNoContextTakeover)R.server_no_context_takeover=!0;if(H.clientNoContextTakeover)R.client_no_context_takeover=!0;if(typeof H.serverMaxWindowBits==="number")R.server_max_window_bits=H.serverMaxWindowBits;if(typeof H.clientMaxWindowBits==="number")R.client_max_window_bits=H.clientMaxWindowBits;else if(R.client_max_window_bits===!0||H.clientMaxWindowBits===!1)delete R.client_max_window_bits;return R}acceptAsClient(G){let H=G[0];if(this._options.clientNoContextTakeover===!1&&H.client_no_context_takeover)throw Error('Unexpected parameter "client_no_context_takeover"');if(!H.client_max_window_bits){if(typeof this._options.clientMaxWindowBits==="number")H.client_max_window_bits=this._options.clientMaxWindowBits}else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits==="number"&&H.client_max_window_bits>this._options.clientMaxWindowBits)throw Error('Unexpected or invalid parameter "client_max_window_bits"');return H}normalizeParams(G){return G.forEach((H)=>{Object.keys(H).forEach((R)=>{let P=H[R];if(P.length>1)throw Error(`Parameter "${R}" must have only a single value`);if(P=P[0],R==="client_max_window_bits"){if(P!==!0){let D=+P;if(!Number.isInteger(D)||D<8||D>15)throw TypeError(`Invalid value for parameter "${R}": ${P}`);P=D}else if(!this._isServer)throw TypeError(`Invalid value for parameter "${R}": ${P}`)}else if(R==="server_max_window_bits"){let D=+P;if(!Number.isInteger(D)||D<8||D>15)throw TypeError(`Invalid value for parameter "${R}": ${P}`);P=D}else if(R==="client_no_context_takeover"||R==="server_no_context_takeover"){if(P!==!0)throw TypeError(`Invalid value for parameter "${R}": ${P}`)}else throw Error(`Unknown parameter "${R}"`);H[R]=P})}),G}decompress(G,H,R){Q7.add((P)=>{this._decompress(G,H,(D,M)=>{P(),R(D,M)})})}compress(G,H,R){Q7.add((P)=>{this._compress(G,H,(D,M)=>{P(),R(D,M)})})}_decompress(G,H,R){let P=this._isServer?"client":"server";if(!this._inflate){let D=`${P}_max_window_bits`,M=typeof this.params[D]!=="number"?H3.Z_DEFAULT_WINDOWBITS:this.params[D];this._inflate=H3.createInflateRaw({...this._options.zlibInflateOptions,windowBits:M}),this._inflate[G7]=this,this._inflate[V4]=0,this._inflate[U4]=[],this._inflate.on("error",vI),this._inflate.on("data",_6)}if(this._inflate[T8]=R,this._inflate.write(G),H)this._inflate.write(yI);this._inflate.flush(()=>{let D=this._inflate[x8];if(D){this._inflate.close(),this._inflate=null,R(D);return}let M=j6.concat(this._inflate[U4],this._inflate[V4]);if(this._inflate._readableState.endEmitted)this._inflate.close(),this._inflate=null;else if(this._inflate[V4]=0,this._inflate[U4]=[],H&&this.params[`${P}_no_context_takeover`])this._inflate.reset();R(null,M)})}_compress(G,H,R){let P=this._isServer?"server":"client";if(!this._deflate){let D=`${P}_max_window_bits`,M=typeof this.params[D]!=="number"?H3.Z_DEFAULT_WINDOWBITS:this.params[D];this._deflate=H3.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:M}),this._deflate[V4]=0,this._deflate[U4]=[],this._deflate.on("data",SI)}this._deflate[T8]=R,this._deflate.write(G),this._deflate.flush(H3.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let D=j6.concat(this._deflate[U4],this._deflate[V4]);if(H)D=new EI(D.buffer,D.byteOffset,D.length-4);if(this._deflate[T8]=null,this._deflate[V4]=0,this._deflate[U4]=[],H&&this.params[`${P}_no_context_takeover`])this._deflate.reset();R(null,D)})}}H6.exports=V6;function SI(G){this[U4].push(G),this[V4]+=G.length}function _6(G){if(this[V4]+=G.length,this[G7]._maxPayload<1||this[V4]<=this[G7]._maxPayload){this[U4].push(G);return}this[x8]=RangeError("Max payload size exceeded"),this[x8].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[x8][Y6]=1009,this.removeListener("data",_6),this.reset()}function vI(G){if(this[G7]._inflate=null,this[x8]){this[T8](this[x8]);return}G[Y6]=1007,this[T8](G)}});var B8=E1((JV,I7)=>{var{isUtf8:N6}=o5("buffer"),{hasBlob:wI}=Y4(),gI=[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 hI(G){return G>=1000&&G<=1014&&G!==1004&&G!==1005&&G!==1006||G>=3000&&G<=4999}function fJ(G){let H=G.length,R=0;while(R<H)if((G[R]&128)===0)R++;else if((G[R]&224)===192){if(R+1===H||(G[R+1]&192)!==128||(G[R]&254)===192)return!1;R+=2}else if((G[R]&240)===224){if(R+2>=H||(G[R+1]&192)!==128||(G[R+2]&192)!==128||G[R]===224&&(G[R+1]&224)===128||G[R]===237&&(G[R+1]&224)===160)return!1;R+=3}else if((G[R]&248)===240){if(R+3>=H||(G[R+1]&192)!==128||(G[R+2]&192)!==128||(G[R+3]&192)!==128||G[R]===240&&(G[R+1]&240)===128||G[R]===244&&G[R+1]>143||G[R]>244)return!1;R+=4}else return!1;return!0}function mI(G){return wI&&typeof G==="object"&&typeof G.arrayBuffer==="function"&&typeof G.type==="string"&&typeof G.stream==="function"&&(G[Symbol.toStringTag]==="Blob"||G[Symbol.toStringTag]==="File")}I7.exports={isBlob:mI,isValidStatusCode:hI,isValidUTF8:fJ,tokenChars:gI};if(N6)I7.exports.isValidUTF8=function(G){return G.length<24?fJ(G):N6(G)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let G=(()=>{throw new Error("Cannot require module "+"utf-8-validate");})();I7.exports.isValidUTF8=function(H){return H.length<32?fJ(H):G(H)}}catch(G){}});var lJ=E1((KV,O6)=>{var{Writable:fI}=o5("stream"),R6=N3(),{BINARY_TYPES:uI,EMPTY_BUFFER:A6,kStatusCode:lI,kWebSocket:pI}=Y4(),{concat:uJ,toArrayBuffer:kI,unmask:bI}=_3(),{isValidStatusCode:iI,isValidUTF8:F6}=B8(),z7=Buffer[Symbol.species];class D6 extends fI{constructor(G={}){super();this._allowSynchronousEvents=G.allowSynchronousEvents!==void 0?G.allowSynchronousEvents:!0,this._binaryType=G.binaryType||uI[0],this._extensions=G.extensions||{},this._isServer=!!G.isServer,this._maxPayload=G.maxPayload|0,this._skipUTF8Validation=!!G.skipUTF8Validation,this[pI]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=0}_write(G,H,R){if(this._opcode===8&&this._state==0)return R();this._bufferedBytes+=G.length,this._buffers.push(G),this.startLoop(R)}consume(G){if(this._bufferedBytes-=G,G===this._buffers[0].length)return this._buffers.shift();if(G<this._buffers[0].length){let R=this._buffers[0];return this._buffers[0]=new z7(R.buffer,R.byteOffset+G,R.length-G),new z7(R.buffer,R.byteOffset,G)}let H=Buffer.allocUnsafe(G);do{let R=this._buffers[0],P=H.length-G;if(G>=R.length)H.set(this._buffers.shift(),P);else H.set(new Uint8Array(R.buffer,R.byteOffset,G),P),this._buffers[0]=new z7(R.buffer,R.byteOffset+G,R.length-G);G-=R.length}while(G>0);return H}startLoop(G){this._loop=!0;do switch(this._state){case 0:this.getInfo(G);break;case 1:this.getPayloadLength16(G);break;case 2:this.getPayloadLength64(G);break;case 3:this.getMask();break;case 4:this.getData(G);break;case 5:case 6:this._loop=!1;return}while(this._loop);if(!this._errored)G()}getInfo(G){if(this._bufferedBytes<2){this._loop=!1;return}let H=this.consume(2);if((H[0]&48)!==0){let P=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");G(P);return}let R=(H[0]&64)===64;if(R&&!this._extensions[R6.extensionName]){let P=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");G(P);return}if(this._fin=(H[0]&128)===128,this._opcode=H[0]&15,this._payloadLength=H[1]&127,this._opcode===0){if(R){let P=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");G(P);return}if(!this._fragmented){let P=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");G(P);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let P=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");G(P);return}this._compressed=R}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let P=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");G(P);return}if(R){let P=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");G(P);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let P=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");G(P);return}}else{let P=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");G(P);return}if(!this._fin&&!this._fragmented)this._fragmented=this._opcode;if(this._masked=(H[1]&128)===128,this._isServer){if(!this._masked){let P=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");G(P);return}}else if(this._masked){let P=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");G(P);return}if(this._payloadLength===126)this._state=1;else if(this._payloadLength===127)this._state=2;else this.haveLength(G)}getPayloadLength16(G){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(G)}getPayloadLength64(G){if(this._bufferedBytes<8){this._loop=!1;return}let H=this.consume(8),R=H.readUInt32BE(0);if(R>Math.pow(2,21)-1){let P=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");G(P);return}this._payloadLength=R*Math.pow(2,32)+H.readUInt32BE(4),this.haveLength(G)}haveLength(G){if(this._payloadLength&&this._opcode<8){if(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0){let H=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");G(H);return}}if(this._masked)this._state=3;else this._state=4}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=4}getData(G){let H=A6;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}if(H=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0)bI(H,this._mask)}if(this._opcode>7){this.controlMessage(H,G);return}if(this._compressed){this._state=5,this.decompress(H,G);return}if(H.length)this._messageLength=this._totalPayloadLength,this._fragments.push(H);this.dataMessage(G)}decompress(G,H){this._extensions[R6.extensionName].decompress(G,this._fin,(P,D)=>{if(P)return H(P);if(D.length){if(this._messageLength+=D.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let M=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");H(M);return}this._fragments.push(D)}if(this.dataMessage(H),this._state===0)this.startLoop(H)})}dataMessage(G){if(!this._fin){this._state=0;return}let H=this._messageLength,R=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let P;if(this._binaryType==="nodebuffer")P=uJ(R,H);else if(this._binaryType==="arraybuffer")P=kI(uJ(R,H));else if(this._binaryType==="blob")P=new Blob(R);else P=R;if(this._allowSynchronousEvents)this.emit("message",P,!0),this._state=0;else this._state=6,setImmediate(()=>{this.emit("message",P,!0),this._state=0,this.startLoop(G)})}else{let P=uJ(R,H);if(!this._skipUTF8Validation&&!F6(P)){let D=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");G(D);return}if(this._state===5||this._allowSynchronousEvents)this.emit("message",P,!1),this._state=0;else this._state=6,setImmediate(()=>{this.emit("message",P,!1),this._state=0,this.startLoop(G)})}}controlMessage(G,H){if(this._opcode===8){if(G.length===0)this._loop=!1,this.emit("conclude",1005,A6),this.end();else{let R=G.readUInt16BE(0);if(!iI(R)){let D=this.createError(RangeError,`invalid status code ${R}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");H(D);return}let P=new z7(G.buffer,G.byteOffset+2,G.length-2);if(!this._skipUTF8Validation&&!F6(P)){let D=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");H(D);return}this._loop=!1,this.emit("conclude",R,P),this.end()}this._state=0;return}if(this._allowSynchronousEvents)this.emit(this._opcode===9?"ping":"pong",G),this._state=0;else this._state=6,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",G),this._state=0,this.startLoop(H)})}createError(G,H,R,P,D){this._loop=!1,this._errored=!0;let M=new G(R?`Invalid WebSocket frame: ${H}`:H);return Error.captureStackTrace(M,this.createError),M.code=D,M[lI]=P,M}}O6.exports=D6});var kJ=E1((ZV,T6)=>{var{Duplex:XV}=o5("stream"),{randomFillSync:dI}=o5("crypto"),M6=N3(),{EMPTY_BUFFER:cI,kWebSocket:nI,NOOP:rI}=Y4(),{isBlob:C8,isValidStatusCode:aI}=B8(),{mask:P6,toBuffer:n4}=_3(),k1=Symbol("kByteLength"),sI=Buffer.alloc(4),r4,q8=8192,c1=0,oI=1,tI=2;class L4{constructor(G,H,R){if(this._extensions=H||{},R)this._generateMask=R,this._maskBuffer=Buffer.alloc(4);this._socket=G,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=c1,this.onerror=rI,this[nI]=void 0}static frame(G,H){let R,P=!1,D=2,M=!1;if(H.mask){if(R=H.maskBuffer||sI,H.generateMask)H.generateMask(R);else{if(q8===8192){if(r4===void 0)r4=Buffer.alloc(8192);dI(r4,0,8192),q8=0}R[0]=r4[q8++],R[1]=r4[q8++],R[2]=r4[q8++],R[3]=r4[q8++]}M=(R[0]|R[1]|R[2]|R[3])===0,D=6}let p;if(typeof G==="string")if((!H.mask||M)&&H[k1]!==void 0)p=H[k1];else G=Buffer.from(G),p=G.length;else p=G.length,P=H.mask&&H.readOnly&&!M;let f=p;if(p>=65536)D+=8,f=127;else if(p>125)D+=2,f=126;let u=Buffer.allocUnsafe(P?p+D:D);if(u[0]=H.fin?H.opcode|128:H.opcode,H.rsv1)u[0]|=64;if(u[1]=f,f===126)u.writeUInt16BE(p,2);else if(f===127)u[2]=u[3]=0,u.writeUIntBE(p,4,6);if(!H.mask)return[u,G];if(u[1]|=128,u[D-4]=R[0],u[D-3]=R[1],u[D-2]=R[2],u[D-1]=R[3],M)return[u,G];if(P)return P6(G,R,u,D,p),[u];return P6(G,R,G,0,p),[u,G]}close(G,H,R,P){let D;if(G===void 0)D=cI;else if(typeof G!=="number"||!aI(G))throw TypeError("First argument must be a valid error code number");else if(H===void 0||!H.length)D=Buffer.allocUnsafe(2),D.writeUInt16BE(G,0);else{let p=Buffer.byteLength(H);if(p>123)throw RangeError("The message must not be greater than 123 bytes");if(D=Buffer.allocUnsafe(2+p),D.writeUInt16BE(G,0),typeof H==="string")D.write(H,2);else D.set(H,2)}let M={[k1]:D.length,fin:!0,generateMask:this._generateMask,mask:R,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};if(this._state!==c1)this.enqueue([this.dispatch,D,!1,M,P]);else this.sendFrame(L4.frame(D,M),P)}ping(G,H,R){let P,D;if(typeof G==="string")P=Buffer.byteLength(G),D=!1;else if(C8(G))P=G.size,D=!1;else G=n4(G),P=G.length,D=n4.readOnly;if(P>125)throw RangeError("The data size must not be greater than 125 bytes");let M={[k1]:P,fin:!0,generateMask:this._generateMask,mask:H,maskBuffer:this._maskBuffer,opcode:9,readOnly:D,rsv1:!1};if(C8(G))if(this._state!==c1)this.enqueue([this.getBlobData,G,!1,M,R]);else this.getBlobData(G,!1,M,R);else if(this._state!==c1)this.enqueue([this.dispatch,G,!1,M,R]);else this.sendFrame(L4.frame(G,M),R)}pong(G,H,R){let P,D;if(typeof G==="string")P=Buffer.byteLength(G),D=!1;else if(C8(G))P=G.size,D=!1;else G=n4(G),P=G.length,D=n4.readOnly;if(P>125)throw RangeError("The data size must not be greater than 125 bytes");let M={[k1]:P,fin:!0,generateMask:this._generateMask,mask:H,maskBuffer:this._maskBuffer,opcode:10,readOnly:D,rsv1:!1};if(C8(G))if(this._state!==c1)this.enqueue([this.getBlobData,G,!1,M,R]);else this.getBlobData(G,!1,M,R);else if(this._state!==c1)this.enqueue([this.dispatch,G,!1,M,R]);else this.sendFrame(L4.frame(G,M),R)}send(G,H,R){let P=this._extensions[M6.extensionName],D=H.binary?2:1,M=H.compress,p,f;if(typeof G==="string")p=Buffer.byteLength(G),f=!1;else if(C8(G))p=G.size,f=!1;else G=n4(G),p=G.length,f=n4.readOnly;if(this._firstFragment){if(this._firstFragment=!1,M&&P&&P.params[P._isServer?"server_no_context_takeover":"client_no_context_takeover"])M=p>=P._threshold;this._compress=M}else M=!1,D=0;if(H.fin)this._firstFragment=!0;let u={[k1]:p,fin:H.fin,generateMask:this._generateMask,mask:H.mask,maskBuffer:this._maskBuffer,opcode:D,readOnly:f,rsv1:M};if(C8(G))if(this._state!==c1)this.enqueue([this.getBlobData,G,this._compress,u,R]);else this.getBlobData(G,this._compress,u,R);else if(this._state!==c1)this.enqueue([this.dispatch,G,this._compress,u,R]);else this.dispatch(G,this._compress,u,R)}getBlobData(G,H,R,P){this._bufferedBytes+=R[k1],this._state=tI,G.arrayBuffer().then((D)=>{if(this._socket.destroyed){let p=Error("The socket was closed while the blob was being read");process.nextTick(pJ,this,p,P);return}this._bufferedBytes-=R[k1];let M=n4(D);if(!H)this._state=c1,this.sendFrame(L4.frame(M,R),P),this.dequeue();else this.dispatch(M,H,R,P)}).catch((D)=>{process.nextTick(eI,this,D,P)})}dispatch(G,H,R,P){if(!H){this.sendFrame(L4.frame(G,R),P);return}let D=this._extensions[M6.extensionName];this._bufferedBytes+=R[k1],this._state=oI,D.compress(G,R.fin,(M,p)=>{if(this._socket.destroyed){let f=Error("The socket was closed while data was being compressed");pJ(this,f,P);return}this._bufferedBytes-=R[k1],this._state=c1,R.readOnly=!1,this.sendFrame(L4.frame(p,R),P),this.dequeue()})}dequeue(){while(this._state===c1&&this._queue.length){let G=this._queue.shift();this._bufferedBytes-=G[3][k1],Reflect.apply(G[0],this,G.slice(1))}}enqueue(G){this._bufferedBytes+=G[3][k1],this._queue.push(G)}sendFrame(G,H){if(G.length===2)this._socket.cork(),this._socket.write(G[0]),this._socket.write(G[1],H),this._socket.uncork();else this._socket.write(G[0],H)}}T6.exports=L4;function pJ(G,H,R){if(typeof R==="function")R(H);for(let P=0;P<G._queue.length;P++){let D=G._queue[P],M=D[D.length-1];if(typeof M==="function")M(H)}}function eI(G,H,R){pJ(G,H,R),G.onerror(H)}});var y6=E1(($V,E6)=>{var{kForOnEventAttribute:R3,kListener:bJ}=Y4(),x6=Symbol("kCode"),B6=Symbol("kData"),C6=Symbol("kError"),q6=Symbol("kMessage"),U6=Symbol("kReason"),U8=Symbol("kTarget"),L6=Symbol("kType"),W6=Symbol("kWasClean");class W4{constructor(G){this[U8]=null,this[L6]=G}get target(){return this[U8]}get type(){return this[L6]}}Object.defineProperty(W4.prototype,"target",{enumerable:!0});Object.defineProperty(W4.prototype,"type",{enumerable:!0});class L8 extends W4{constructor(G,H={}){super(G);this[x6]=H.code===void 0?0:H.code,this[U6]=H.reason===void 0?"":H.reason,this[W6]=H.wasClean===void 0?!1:H.wasClean}get code(){return this[x6]}get reason(){return this[U6]}get wasClean(){return this[W6]}}Object.defineProperty(L8.prototype,"code",{enumerable:!0});Object.defineProperty(L8.prototype,"reason",{enumerable:!0});Object.defineProperty(L8.prototype,"wasClean",{enumerable:!0});class A3 extends W4{constructor(G,H={}){super(G);this[C6]=H.error===void 0?null:H.error,this[q6]=H.message===void 0?"":H.message}get error(){return this[C6]}get message(){return this[q6]}}Object.defineProperty(A3.prototype,"error",{enumerable:!0});Object.defineProperty(A3.prototype,"message",{enumerable:!0});class Y7 extends W4{constructor(G,H={}){super(G);this[B6]=H.data===void 0?null:H.data}get data(){return this[B6]}}Object.defineProperty(Y7.prototype,"data",{enumerable:!0});var Jz={addEventListener(G,H,R={}){for(let D of this.listeners(G))if(!R[R3]&&D[bJ]===H&&!D[R3])return;let P;if(G==="message")P=function(M,p){let f=new Y7("message",{data:p?M:M.toString()});f[U8]=this,j7(H,this,f)};else if(G==="close")P=function(M,p){let f=new L8("close",{code:M,reason:p.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});f[U8]=this,j7(H,this,f)};else if(G==="error")P=function(M){let p=new A3("error",{error:M,message:M.message});p[U8]=this,j7(H,this,p)};else if(G==="open")P=function(){let M=new W4("open");M[U8]=this,j7(H,this,M)};else return;if(P[R3]=!!R[R3],P[bJ]=H,R.once)this.once(G,P);else this.on(G,P)},removeEventListener(G,H){for(let R of this.listeners(G))if(R[bJ]===H&&!R[R3]){this.removeListener(G,R);break}}};E6.exports={CloseEvent:L8,ErrorEvent:A3,Event:W4,EventTarget:Jz,MessageEvent:Y7};function j7(G,H,R){if(typeof G==="object"&&G.handleEvent)G.handleEvent.call(G,R);else G.call(H,R)}});var iJ=E1((QV,S6)=>{var{tokenChars:F3}=B8();function X4(G,H,R){if(G[H]===void 0)G[H]=[R];else G[H].push(R)}function Kz(G){let H=Object.create(null),R=Object.create(null),P=!1,D=!1,M=!1,p,f,u=-1,V0=-1,R0=-1,Z0=0;for(;Z0<G.length;Z0++)if(V0=G.charCodeAt(Z0),p===void 0)if(R0===-1&&F3[V0]===1){if(u===-1)u=Z0}else if(Z0!==0&&(V0===32||V0===9)){if(R0===-1&&u!==-1)R0=Z0}else if(V0===59||V0===44){if(u===-1)throw SyntaxError(`Unexpected character at index ${Z0}`);if(R0===-1)R0=Z0;let h=G.slice(u,R0);if(V0===44)X4(H,h,R),R=Object.create(null);else p=h;u=R0=-1}else throw SyntaxError(`Unexpected character at index ${Z0}`);else if(f===void 0)if(R0===-1&&F3[V0]===1){if(u===-1)u=Z0}else if(V0===32||V0===9){if(R0===-1&&u!==-1)R0=Z0}else if(V0===59||V0===44){if(u===-1)throw SyntaxError(`Unexpected character at index ${Z0}`);if(R0===-1)R0=Z0;if(X4(R,G.slice(u,R0),!0),V0===44)X4(H,p,R),R=Object.create(null),p=void 0;u=R0=-1}else if(V0===61&&u!==-1&&R0===-1)f=G.slice(u,Z0),u=R0=-1;else throw SyntaxError(`Unexpected character at index ${Z0}`);else if(D){if(F3[V0]!==1)throw SyntaxError(`Unexpected character at index ${Z0}`);if(u===-1)u=Z0;else if(!P)P=!0;D=!1}else if(M)if(F3[V0]===1){if(u===-1)u=Z0}else if(V0===34&&u!==-1)M=!1,R0=Z0;else if(V0===92)D=!0;else throw SyntaxError(`Unexpected character at index ${Z0}`);else if(V0===34&&G.charCodeAt(Z0-1)===61)M=!0;else if(R0===-1&&F3[V0]===1){if(u===-1)u=Z0}else if(u!==-1&&(V0===32||V0===9)){if(R0===-1)R0=Z0}else if(V0===59||V0===44){if(u===-1)throw SyntaxError(`Unexpected character at index ${Z0}`);if(R0===-1)R0=Z0;let h=G.slice(u,R0);if(P)h=h.replace(/\\/g,""),P=!1;if(X4(R,f,h),V0===44)X4(H,p,R),R=Object.create(null),p=void 0;f=void 0,u=R0=-1}else throw SyntaxError(`Unexpected character at index ${Z0}`);if(u===-1||M||V0===32||V0===9)throw SyntaxError("Unexpected end of input");if(R0===-1)R0=Z0;let U=G.slice(u,R0);if(p===void 0)X4(H,U,R);else{if(f===void 0)X4(R,U,!0);else if(P)X4(R,f,U.replace(/\\/g,""));else X4(R,f,U);X4(H,p,R)}return H}function Xz(G){return Object.keys(G).map((H)=>{let R=G[H];if(!Array.isArray(R))R=[R];return R.map((P)=>{return[H].concat(Object.keys(P).map((D)=>{let M=P[D];if(!Array.isArray(M))M=[M];return M.map((p)=>p===!0?D:`${D}=${p}`).join("; ")})).join("; ")}).join(", ")}).join(", ")}S6.exports={format:Xz,parse:Kz}});var N7=E1((zV,i6)=>{var Zz=o5("events"),$z=o5("https"),Qz=o5("http"),g6=o5("net"),Gz=o5("tls"),{randomBytes:Iz,createHash:zz}=o5("crypto"),{Duplex:GV,Readable:IV}=o5("stream"),{URL:dJ}=o5("url"),E4=N3(),jz=lJ(),Yz=kJ(),{isBlob:Vz}=B8(),{BINARY_TYPES:v6,CLOSE_TIMEOUT:_z,EMPTY_BUFFER:V7,GUID:Hz,kForOnEventAttribute:cJ,kListener:Nz,kStatusCode:Rz,kWebSocket:Y1,NOOP:h6}=Y4(),{EventTarget:{addEventListener:Az,removeEventListener:Fz}}=y6(),{format:Dz,parse:Oz}=iJ(),{toBuffer:Mz}=_3(),m6=Symbol("kAborted"),nJ=[8,13],_4=["CONNECTING","OPEN","CLOSING","CLOSED"],Pz=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;class a0 extends Zz{constructor(G,H,R){super();if(this._binaryType=v6[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=V7,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=a0.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,G!==null){if(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,H===void 0)H=[];else if(!Array.isArray(H))if(typeof H==="object"&&H!==null)R=H,H=[];else H=[H];f6(this,G,H,R)}else this._autoPong=R.autoPong,this._closeTimeout=R.closeTimeout,this._isServer=!0}get binaryType(){return this._binaryType}set binaryType(G){if(!v6.includes(G))return;if(this._binaryType=G,this._receiver)this._receiver._binaryType=G}get bufferedAmount(){if(!this._socket)return this._bufferedAmount;return this._socket._writableState.length+this._sender._bufferedBytes}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(G,H,R){let P=new jz({allowSynchronousEvents:R.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:R.maxPayload,skipUTF8Validation:R.skipUTF8Validation}),D=new Yz(G,this._extensions,R.generateMask);if(this._receiver=P,this._sender=D,this._socket=G,P[Y1]=this,D[Y1]=this,G[Y1]=this,P.on("conclude",Bz),P.on("drain",Cz),P.on("error",qz),P.on("message",Uz),P.on("ping",Lz),P.on("pong",Wz),D.onerror=Ez,G.setTimeout)G.setTimeout(0);if(G.setNoDelay)G.setNoDelay();if(H.length>0)G.unshift(H);G.on("close",p6),G.on("data",H7),G.on("end",k6),G.on("error",b6),this._readyState=a0.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=a0.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}if(this._extensions[E4.extensionName])this._extensions[E4.extensionName].cleanup();this._receiver.removeAllListeners(),this._readyState=a0.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(G,H){if(this.readyState===a0.CLOSED)return;if(this.readyState===a0.CONNECTING){v1(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===a0.CLOSING){if(this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted))this._socket.end();return}this._readyState=a0.CLOSING,this._sender.close(G,H,!this._isServer,(R)=>{if(R)return;if(this._closeFrameSent=!0,this._closeFrameReceived||this._receiver._writableState.errorEmitted)this._socket.end()}),l6(this)}pause(){if(this.readyState===a0.CONNECTING||this.readyState===a0.CLOSED)return;this._paused=!0,this._socket.pause()}ping(G,H,R){if(this.readyState===a0.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof G==="function")R=G,G=H=void 0;else if(typeof H==="function")R=H,H=void 0;if(typeof G==="number")G=G.toString();if(this.readyState!==a0.OPEN){rJ(this,G,R);return}if(H===void 0)H=!this._isServer;this._sender.ping(G||V7,H,R)}pong(G,H,R){if(this.readyState===a0.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof G==="function")R=G,G=H=void 0;else if(typeof H==="function")R=H,H=void 0;if(typeof G==="number")G=G.toString();if(this.readyState!==a0.OPEN){rJ(this,G,R);return}if(H===void 0)H=!this._isServer;this._sender.pong(G||V7,H,R)}resume(){if(this.readyState===a0.CONNECTING||this.readyState===a0.CLOSED)return;if(this._paused=!1,!this._receiver._writableState.needDrain)this._socket.resume()}send(G,H,R){if(this.readyState===a0.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof H==="function")R=H,H={};if(typeof G==="number")G=G.toString();if(this.readyState!==a0.OPEN){rJ(this,G,R);return}let P={binary:typeof G!=="string",mask:!this._isServer,compress:!0,fin:!0,...H};if(!this._extensions[E4.extensionName])P.compress=!1;this._sender.send(G||V7,P,R)}terminate(){if(this.readyState===a0.CLOSED)return;if(this.readyState===a0.CONNECTING){v1(this,this._req,"WebSocket was closed before the connection was established");return}if(this._socket)this._readyState=a0.CLOSING,this._socket.destroy()}}Object.defineProperty(a0,"CONNECTING",{enumerable:!0,value:_4.indexOf("CONNECTING")});Object.defineProperty(a0.prototype,"CONNECTING",{enumerable:!0,value:_4.indexOf("CONNECTING")});Object.defineProperty(a0,"OPEN",{enumerable:!0,value:_4.indexOf("OPEN")});Object.defineProperty(a0.prototype,"OPEN",{enumerable:!0,value:_4.indexOf("OPEN")});Object.defineProperty(a0,"CLOSING",{enumerable:!0,value:_4.indexOf("CLOSING")});Object.defineProperty(a0.prototype,"CLOSING",{enumerable:!0,value:_4.indexOf("CLOSING")});Object.defineProperty(a0,"CLOSED",{enumerable:!0,value:_4.indexOf("CLOSED")});Object.defineProperty(a0.prototype,"CLOSED",{enumerable:!0,value:_4.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach((G)=>{Object.defineProperty(a0.prototype,G,{enumerable:!0})});["open","error","close","message"].forEach((G)=>{Object.defineProperty(a0.prototype,`on${G}`,{enumerable:!0,get(){for(let H of this.listeners(G))if(H[cJ])return H[Nz];return null},set(H){for(let R of this.listeners(G))if(R[cJ]){this.removeListener(G,R);break}if(typeof H!=="function")return;this.addEventListener(G,H,{[cJ]:!0})}})});a0.prototype.addEventListener=Az;a0.prototype.removeEventListener=Fz;i6.exports=a0;function f6(G,H,R,P){let D={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:_z,protocolVersion:nJ[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...P,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(G._autoPong=D.autoPong,G._closeTimeout=D.closeTimeout,!nJ.includes(D.protocolVersion))throw RangeError(`Unsupported protocol version: ${D.protocolVersion} (supported versions: ${nJ.join(", ")})`);let M;if(H instanceof dJ)M=H;else try{M=new dJ(H)}catch(y){throw SyntaxError(`Invalid URL: ${H}`)}if(M.protocol==="http:")M.protocol="ws:";else if(M.protocol==="https:")M.protocol="wss:";G._url=M.href;let p=M.protocol==="wss:",f=M.protocol==="ws+unix:",u;if(M.protocol!=="ws:"&&!p&&!f)u=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`;else if(f&&!M.pathname)u="The URL's pathname is empty";else if(M.hash)u="The URL contains a fragment identifier";if(u){let y=SyntaxError(u);if(G._redirects===0)throw y;else{_7(G,y);return}}let V0=p?443:80,R0=Iz(16).toString("base64"),Z0=p?$z.request:Qz.request,U=new Set,h;if(D.createConnection=D.createConnection||(p?xz:Tz),D.defaultPort=D.defaultPort||V0,D.port=M.port||V0,D.host=M.hostname.startsWith("[")?M.hostname.slice(1,-1):M.hostname,D.headers={...D.headers,"Sec-WebSocket-Version":D.protocolVersion,"Sec-WebSocket-Key":R0,Connection:"Upgrade",Upgrade:"websocket"},D.path=M.pathname+M.search,D.timeout=D.handshakeTimeout,D.perMessageDeflate)h=new E4(D.perMessageDeflate!==!0?D.perMessageDeflate:{},!1,D.maxPayload),D.headers["Sec-WebSocket-Extensions"]=Dz({[E4.extensionName]:h.offer()});if(R.length){for(let y of R){if(typeof y!=="string"||!Pz.test(y)||U.has(y))throw SyntaxError("An invalid or duplicated subprotocol was specified");U.add(y)}D.headers["Sec-WebSocket-Protocol"]=R.join(",")}if(D.origin)if(D.protocolVersion<13)D.headers["Sec-WebSocket-Origin"]=D.origin;else D.headers.Origin=D.origin;if(M.username||M.password)D.auth=`${M.username}:${M.password}`;if(f){let y=D.path.split(":");D.socketPath=y[0],D.path=y[1]}let g;if(D.followRedirects){if(G._redirects===0){G._originalIpc=f,G._originalSecure=p,G._originalHostOrSocketPath=f?D.socketPath:M.host;let y=P&&P.headers;if(P={...P,headers:{}},y)for(let[r,F0]of Object.entries(y))P.headers[r.toLowerCase()]=F0}else if(G.listenerCount("redirect")===0){let y=f?G._originalIpc?D.socketPath===G._originalHostOrSocketPath:!1:G._originalIpc?!1:M.host===G._originalHostOrSocketPath;if(!y||G._originalSecure&&!p){if(delete D.headers.authorization,delete D.headers.cookie,!y)delete D.headers.host;D.auth=void 0}}if(D.auth&&!P.headers.authorization)P.headers.authorization="Basic "+Buffer.from(D.auth).toString("base64");if(g=G._req=Z0(D),G._redirects)G.emit("redirect",G.url,g)}else g=G._req=Z0(D);if(D.timeout)g.on("timeout",()=>{v1(G,g,"Opening handshake has timed out")});if(g.on("error",(y)=>{if(g===null||g[m6])return;g=G._req=null,_7(G,y)}),g.on("response",(y)=>{let r=y.headers.location,F0=y.statusCode;if(r&&D.followRedirects&&F0>=300&&F0<400){if(++G._redirects>D.maxRedirects){v1(G,g,"Maximum redirects exceeded");return}g.abort();let v0;try{v0=new dJ(r,H)}catch($0){let A0=SyntaxError(`Invalid URL: ${r}`);_7(G,A0);return}f6(G,v0,R,P)}else if(!G.emit("unexpected-response",g,y))v1(G,g,`Unexpected server response: ${y.statusCode}`)}),g.on("upgrade",(y,r,F0)=>{if(G.emit("upgrade",y),G.readyState!==a0.CONNECTING)return;g=G._req=null;let v0=y.headers.upgrade;if(v0===void 0||v0.toLowerCase()!=="websocket"){v1(G,r,"Invalid Upgrade header");return}let $0=zz("sha1").update(R0+Hz).digest("base64");if(y.headers["sec-websocket-accept"]!==$0){v1(G,r,"Invalid Sec-WebSocket-Accept header");return}let A0=y.headers["sec-websocket-protocol"],Q0;if(A0!==void 0){if(!U.size)Q0="Server sent a subprotocol but none was requested";else if(!U.has(A0))Q0="Server sent an invalid subprotocol"}else if(U.size)Q0="Server sent no subprotocol";if(Q0){v1(G,r,Q0);return}if(A0)G._protocol=A0;let H0=y.headers["sec-websocket-extensions"];if(H0!==void 0){if(!h){v1(G,r,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let I0;try{I0=Oz(H0)}catch(F5){v1(G,r,"Invalid Sec-WebSocket-Extensions header");return}let L0=Object.keys(I0);if(L0.length!==1||L0[0]!==E4.extensionName){v1(G,r,"Server indicated an extension that was not requested");return}try{h.accept(I0[E4.extensionName])}catch(F5){v1(G,r,"Invalid Sec-WebSocket-Extensions header");return}G._extensions[E4.extensionName]=h}G.setSocket(r,F0,{allowSynchronousEvents:D.allowSynchronousEvents,generateMask:D.generateMask,maxPayload:D.maxPayload,skipUTF8Validation:D.skipUTF8Validation})}),D.finishRequest)D.finishRequest(g,G);else g.end()}function _7(G,H){G._readyState=a0.CLOSING,G._errorEmitted=!0,G.emit("error",H),G.emitClose()}function Tz(G){return G.path=G.socketPath,g6.connect(G)}function xz(G){if(G.path=void 0,!G.servername&&G.servername!=="")G.servername=g6.isIP(G.host)?"":G.host;return Gz.connect(G)}function v1(G,H,R){G._readyState=a0.CLOSING;let P=Error(R);if(Error.captureStackTrace(P,v1),H.setHeader){if(H[m6]=!0,H.abort(),H.socket&&!H.socket.destroyed)H.socket.destroy();process.nextTick(_7,G,P)}else H.destroy(P),H.once("error",G.emit.bind(G,"error")),H.once("close",G.emitClose.bind(G))}function rJ(G,H,R){if(H){let P=Vz(H)?H.size:Mz(H).length;if(G._socket)G._sender._bufferedBytes+=P;else G._bufferedAmount+=P}if(R){let P=Error(`WebSocket is not open: readyState ${G.readyState} (${_4[G.readyState]})`);process.nextTick(R,P)}}function Bz(G,H){let R=this[Y1];if(R._closeFrameReceived=!0,R._closeMessage=H,R._closeCode=G,R._socket[Y1]===void 0)return;if(R._socket.removeListener("data",H7),process.nextTick(u6,R._socket),G===1005)R.close();else R.close(G,H)}function Cz(){let G=this[Y1];if(!G.isPaused)G._socket.resume()}function qz(G){let H=this[Y1];if(H._socket[Y1]!==void 0)H._socket.removeListener("data",H7),process.nextTick(u6,H._socket),H.close(G[Rz]);if(!H._errorEmitted)H._errorEmitted=!0,H.emit("error",G)}function w6(){this[Y1].emitClose()}function Uz(G,H){this[Y1].emit("message",G,H)}function Lz(G){let H=this[Y1];if(H._autoPong)H.pong(G,!this._isServer,h6);H.emit("ping",G)}function Wz(G){this[Y1].emit("pong",G)}function u6(G){G.resume()}function Ez(G){let H=this[Y1];if(H.readyState===a0.CLOSED)return;if(H.readyState===a0.OPEN)H._readyState=a0.CLOSING,l6(H);if(this._socket.end(),!H._errorEmitted)H._errorEmitted=!0,H.emit("error",G)}function l6(G){G._closeTimer=setTimeout(G._socket.destroy.bind(G._socket),G._closeTimeout)}function p6(){let G=this[Y1];if(this.removeListener("close",p6),this.removeListener("data",H7),this.removeListener("end",k6),G._readyState=a0.CLOSING,!this._readableState.endEmitted&&!G._closeFrameReceived&&!G._receiver._writableState.errorEmitted&&this._readableState.length!==0){let H=this.read(this._readableState.length);G._receiver.write(H)}if(G._receiver.end(),this[Y1]=void 0,clearTimeout(G._closeTimer),G._receiver._writableState.finished||G._receiver._writableState.errorEmitted)G.emitClose();else G._receiver.on("error",w6),G._receiver.on("finish",w6)}function H7(G){if(!this[Y1]._receiver.write(G))this.pause()}function k6(){let G=this[Y1];G._readyState=a0.CLOSING,G._receiver.end(),this.end()}function b6(){let G=this[Y1];if(this.removeListener("error",b6),this.on("error",h6),G)G._readyState=a0.CLOSING,this.destroy()}});var r6=E1((YV,n6)=>{var jV=N7(),{Duplex:yz}=o5("stream");function d6(G){G.emit("close")}function Sz(){if(!this.destroyed&&this._writableState.finished)this.destroy()}function c6(G){if(this.removeListener("error",c6),this.destroy(),this.listenerCount("error")===0)this.emit("error",G)}function vz(G,H){let R=!0,P=new yz({...H,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return G.on("message",function(M,p){let f=!p&&P._readableState.objectMode?M.toString():M;if(!P.push(f))G.pause()}),G.once("error",function(M){if(P.destroyed)return;R=!1,P.destroy(M)}),G.once("close",function(){if(P.destroyed)return;P.push(null)}),P._destroy=function(D,M){if(G.readyState===G.CLOSED){M(D),process.nextTick(d6,P);return}let p=!1;if(G.once("error",function(u){p=!0,M(u)}),G.once("close",function(){if(!p)M(D);process.nextTick(d6,P)}),R)G.terminate()},P._final=function(D){if(G.readyState===G.CONNECTING){G.once("open",function(){P._final(D)});return}if(G._socket===null)return;if(G._socket._writableState.finished){if(D(),P._readableState.endEmitted)P.destroy()}else G._socket.once("finish",function(){D()}),G.close()},P._read=function(){if(G.isPaused)G.resume()},P._write=function(D,M,p){if(G.readyState===G.CONNECTING){G.once("open",function(){P._write(D,M,p)});return}G.send(D,p)},P.on("end",Sz),P.on("error",c6),P}n6.exports=vz});var s6=E1((VV,a6)=>{var{tokenChars:wz}=B8();function gz(G){let H=new Set,R=-1,P=-1,D=0;for(D;D<G.length;D++){let p=G.charCodeAt(D);if(P===-1&&wz[p]===1){if(R===-1)R=D}else if(D!==0&&(p===32||p===9)){if(P===-1&&R!==-1)P=D}else if(p===44){if(R===-1)throw SyntaxError(`Unexpected character at index ${D}`);if(P===-1)P=D;let f=G.slice(R,P);if(H.has(f))throw SyntaxError(`The "${f}" subprotocol is duplicated`);H.add(f),R=P=-1}else throw SyntaxError(`Unexpected character at index ${D}`)}if(R===-1||P!==-1)throw SyntaxError("Unexpected end of input");let M=G.slice(R,D);if(H.has(M))throw SyntaxError(`The "${M}" subprotocol is duplicated`);return H.add(M),H}a6.exports={parse:gz}});var K$=E1((HV,J$)=>{var hz=o5("events"),R7=o5("http"),{Duplex:_V}=o5("stream"),{createHash:mz}=o5("crypto"),o6=iJ(),a4=N3(),fz=s6(),uz=N7(),{CLOSE_TIMEOUT:lz,GUID:pz,kWebSocket:kz}=Y4(),bz=/^[+/0-9A-Za-z]{22}==$/;class e6 extends hz{constructor(G,H){super();if(G={allowSynchronousEvents:!0,autoPong:!0,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:lz,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:uz,...G},G.port==null&&!G.server&&!G.noServer||G.port!=null&&(G.server||G.noServer)||G.server&&G.noServer)throw TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(G.port!=null)this._server=R7.createServer((R,P)=>{let D=R7.STATUS_CODES[426];P.writeHead(426,{"Content-Length":D.length,"Content-Type":"text/plain"}),P.end(D)}),this._server.listen(G.port,G.host,G.backlog,H);else if(G.server)this._server=G.server;if(this._server){let R=this.emit.bind(this,"connection");this._removeListeners=iz(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(P,D,M)=>{this.handleUpgrade(P,D,M,R)}})}if(G.perMessageDeflate===!0)G.perMessageDeflate={};if(G.clientTracking)this.clients=new Set,this._shouldEmitClose=!1;this.options=G,this._state=0}address(){if(this.options.noServer)throw Error('The server is operating in "noServer" mode');if(!this._server)return null;return this._server.address()}close(G){if(this._state===2){if(G)this.once("close",()=>{G(Error("The server is not running"))});process.nextTick(D3,this);return}if(G)this.once("close",G);if(this._state===1)return;if(this._state=1,this.options.noServer||this.options.server){if(this._server)this._removeListeners(),this._removeListeners=this._server=null;if(this.clients)if(!this.clients.size)process.nextTick(D3,this);else this._shouldEmitClose=!0;else process.nextTick(D3,this)}else{let H=this._server;this._removeListeners(),this._removeListeners=this._server=null,H.close(()=>{D3(this)})}}shouldHandle(G){if(this.options.path){let H=G.url.indexOf("?");if((H!==-1?G.url.slice(0,H):G.url)!==this.options.path)return!1}return!0}handleUpgrade(G,H,R,P){H.on("error",t6);let D=G.headers["sec-websocket-key"],M=G.headers.upgrade,p=+G.headers["sec-websocket-version"];if(G.method!=="GET"){s4(this,G,H,405,"Invalid HTTP method");return}if(M===void 0||M.toLowerCase()!=="websocket"){s4(this,G,H,400,"Invalid Upgrade header");return}if(D===void 0||!bz.test(D)){s4(this,G,H,400,"Missing or invalid Sec-WebSocket-Key header");return}if(p!==13&&p!==8){s4(this,G,H,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(G)){O3(H,400);return}let f=G.headers["sec-websocket-protocol"],u=new Set;if(f!==void 0)try{u=fz.parse(f)}catch(Z0){s4(this,G,H,400,"Invalid Sec-WebSocket-Protocol header");return}let V0=G.headers["sec-websocket-extensions"],R0={};if(this.options.perMessageDeflate&&V0!==void 0){let Z0=new a4(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let U=o6.parse(V0);if(U[a4.extensionName])Z0.accept(U[a4.extensionName]),R0[a4.extensionName]=Z0}catch(U){s4(this,G,H,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let Z0={origin:G.headers[`${p===8?"sec-websocket-origin":"origin"}`],secure:!!(G.socket.authorized||G.socket.encrypted),req:G};if(this.options.verifyClient.length===2){this.options.verifyClient(Z0,(U,h,g,y)=>{if(!U)return O3(H,h||401,g,y);this.completeUpgrade(R0,D,u,G,H,R,P)});return}if(!this.options.verifyClient(Z0))return O3(H,401)}this.completeUpgrade(R0,D,u,G,H,R,P)}completeUpgrade(G,H,R,P,D,M,p){if(!D.readable||!D.writable)return D.destroy();if(D[kz])throw Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>0)return O3(D,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${mz("sha1").update(H+pz).digest("base64")}`],V0=new this.options.WebSocket(null,void 0,this.options);if(R.size){let R0=this.options.handleProtocols?this.options.handleProtocols(R,P):R.values().next().value;if(R0)u.push(`Sec-WebSocket-Protocol: ${R0}`),V0._protocol=R0}if(G[a4.extensionName]){let R0=G[a4.extensionName].params,Z0=o6.format({[a4.extensionName]:[R0]});u.push(`Sec-WebSocket-Extensions: ${Z0}`),V0._extensions=G}if(this.emit("headers",u,P),D.write(u.concat(`\r
1
+ import{Fl as W8,Hl as E1,Kl as o5}from"./chunk-z3e4c424.js";var Y4=E1((sY,X6)=>{var J6=["nodebuffer","arraybuffer","fragments"],K6=typeof Blob<"u";if(K6)J6.push("blob");X6.exports={BINARY_TYPES:J6,CLOSE_TIMEOUT:30000,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:K6,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var _3=E1((oY,$7)=>{var{EMPTY_BUFFER:qI}=Y4(),gJ=Buffer[Symbol.species];function UI(G,H){if(G.length===0)return qI;if(G.length===1)return G[0];let R=Buffer.allocUnsafe(H),P=0;for(let D=0;D<G.length;D++){let M=G[D];R.set(M,P),P+=M.length}if(P<H)return new gJ(R.buffer,R.byteOffset,P);return R}function Z6(G,H,R,P,D){for(let M=0;M<D;M++)R[P+M]=G[M]^H[M&3]}function $6(G,H){for(let R=0;R<G.length;R++)G[R]^=H[R&3]}function LI(G){if(G.length===G.buffer.byteLength)return G.buffer;return G.buffer.slice(G.byteOffset,G.byteOffset+G.length)}function hJ(G){if(hJ.readOnly=!0,Buffer.isBuffer(G))return G;let H;if(G instanceof ArrayBuffer)H=new gJ(G);else if(ArrayBuffer.isView(G))H=new gJ(G.buffer,G.byteOffset,G.byteLength);else H=Buffer.from(G),hJ.readOnly=!1;return H}$7.exports={concat:UI,mask:Z6,toArrayBuffer:LI,toBuffer:hJ,unmask:$6};if(!process.env.WS_NO_BUFFER_UTIL)try{let G=(()=>{throw new Error("Cannot require module "+"bufferutil");})();$7.exports.mask=function(H,R,P,D,M){if(M<48)Z6(H,R,P,D,M);else G.mask(H,R,P,D,M)},$7.exports.unmask=function(H,R){if(H.length<32)$6(H,R);else G.unmask(H,R)}}catch(G){}});var z6=E1((tY,I6)=>{var Q6=Symbol("kDone"),mJ=Symbol("kRun");class G6{constructor(G){this[Q6]=()=>{this.pending--,this[mJ]()},this.concurrency=G||1/0,this.jobs=[],this.pending=0}add(G){this.jobs.push(G),this[mJ]()}[mJ](){if(this.pending===this.concurrency)return;if(this.jobs.length){let G=this.jobs.shift();this.pending++,G(this[Q6])}}}I6.exports=G6});var N3=E1((eY,H6)=>{var H3=o5("zlib"),j6=_3(),WI=z6(),{kStatusCode:Y6}=Y4(),EI=Buffer[Symbol.species],yI=Buffer.from([0,0,255,255]),G7=Symbol("permessage-deflate"),V4=Symbol("total-length"),T8=Symbol("callback"),U4=Symbol("buffers"),x8=Symbol("error"),Q7;class V6{constructor(G,H,R){if(this._maxPayload=R|0,this._options=G||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!H,this._deflate=null,this._inflate=null,this.params=null,!Q7){let P=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Q7=new WI(P)}}static get extensionName(){return"permessage-deflate"}offer(){let G={};if(this._options.serverNoContextTakeover)G.server_no_context_takeover=!0;if(this._options.clientNoContextTakeover)G.client_no_context_takeover=!0;if(this._options.serverMaxWindowBits)G.server_max_window_bits=this._options.serverMaxWindowBits;if(this._options.clientMaxWindowBits)G.client_max_window_bits=this._options.clientMaxWindowBits;else if(this._options.clientMaxWindowBits==null)G.client_max_window_bits=!0;return G}accept(G){return G=this.normalizeParams(G),this.params=this._isServer?this.acceptAsServer(G):this.acceptAsClient(G),this.params}cleanup(){if(this._inflate)this._inflate.close(),this._inflate=null;if(this._deflate){let G=this._deflate[T8];if(this._deflate.close(),this._deflate=null,G)G(Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(G){let H=this._options,R=G.find((P)=>{if(H.serverNoContextTakeover===!1&&P.server_no_context_takeover||P.server_max_window_bits&&(H.serverMaxWindowBits===!1||typeof H.serverMaxWindowBits==="number"&&H.serverMaxWindowBits>P.server_max_window_bits)||typeof H.clientMaxWindowBits==="number"&&!P.client_max_window_bits)return!1;return!0});if(!R)throw Error("None of the extension offers can be accepted");if(H.serverNoContextTakeover)R.server_no_context_takeover=!0;if(H.clientNoContextTakeover)R.client_no_context_takeover=!0;if(typeof H.serverMaxWindowBits==="number")R.server_max_window_bits=H.serverMaxWindowBits;if(typeof H.clientMaxWindowBits==="number")R.client_max_window_bits=H.clientMaxWindowBits;else if(R.client_max_window_bits===!0||H.clientMaxWindowBits===!1)delete R.client_max_window_bits;return R}acceptAsClient(G){let H=G[0];if(this._options.clientNoContextTakeover===!1&&H.client_no_context_takeover)throw Error('Unexpected parameter "client_no_context_takeover"');if(!H.client_max_window_bits){if(typeof this._options.clientMaxWindowBits==="number")H.client_max_window_bits=this._options.clientMaxWindowBits}else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits==="number"&&H.client_max_window_bits>this._options.clientMaxWindowBits)throw Error('Unexpected or invalid parameter "client_max_window_bits"');return H}normalizeParams(G){return G.forEach((H)=>{Object.keys(H).forEach((R)=>{let P=H[R];if(P.length>1)throw Error(`Parameter "${R}" must have only a single value`);if(P=P[0],R==="client_max_window_bits"){if(P!==!0){let D=+P;if(!Number.isInteger(D)||D<8||D>15)throw TypeError(`Invalid value for parameter "${R}": ${P}`);P=D}else if(!this._isServer)throw TypeError(`Invalid value for parameter "${R}": ${P}`)}else if(R==="server_max_window_bits"){let D=+P;if(!Number.isInteger(D)||D<8||D>15)throw TypeError(`Invalid value for parameter "${R}": ${P}`);P=D}else if(R==="client_no_context_takeover"||R==="server_no_context_takeover"){if(P!==!0)throw TypeError(`Invalid value for parameter "${R}": ${P}`)}else throw Error(`Unknown parameter "${R}"`);H[R]=P})}),G}decompress(G,H,R){Q7.add((P)=>{this._decompress(G,H,(D,M)=>{P(),R(D,M)})})}compress(G,H,R){Q7.add((P)=>{this._compress(G,H,(D,M)=>{P(),R(D,M)})})}_decompress(G,H,R){let P=this._isServer?"client":"server";if(!this._inflate){let D=`${P}_max_window_bits`,M=typeof this.params[D]!=="number"?H3.Z_DEFAULT_WINDOWBITS:this.params[D];this._inflate=H3.createInflateRaw({...this._options.zlibInflateOptions,windowBits:M}),this._inflate[G7]=this,this._inflate[V4]=0,this._inflate[U4]=[],this._inflate.on("error",vI),this._inflate.on("data",_6)}if(this._inflate[T8]=R,this._inflate.write(G),H)this._inflate.write(yI);this._inflate.flush(()=>{let D=this._inflate[x8];if(D){this._inflate.close(),this._inflate=null,R(D);return}let M=j6.concat(this._inflate[U4],this._inflate[V4]);if(this._inflate._readableState.endEmitted)this._inflate.close(),this._inflate=null;else if(this._inflate[V4]=0,this._inflate[U4]=[],H&&this.params[`${P}_no_context_takeover`])this._inflate.reset();R(null,M)})}_compress(G,H,R){let P=this._isServer?"server":"client";if(!this._deflate){let D=`${P}_max_window_bits`,M=typeof this.params[D]!=="number"?H3.Z_DEFAULT_WINDOWBITS:this.params[D];this._deflate=H3.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:M}),this._deflate[V4]=0,this._deflate[U4]=[],this._deflate.on("data",SI)}this._deflate[T8]=R,this._deflate.write(G),this._deflate.flush(H3.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let D=j6.concat(this._deflate[U4],this._deflate[V4]);if(H)D=new EI(D.buffer,D.byteOffset,D.length-4);if(this._deflate[T8]=null,this._deflate[V4]=0,this._deflate[U4]=[],H&&this.params[`${P}_no_context_takeover`])this._deflate.reset();R(null,D)})}}H6.exports=V6;function SI(G){this[U4].push(G),this[V4]+=G.length}function _6(G){if(this[V4]+=G.length,this[G7]._maxPayload<1||this[V4]<=this[G7]._maxPayload){this[U4].push(G);return}this[x8]=RangeError("Max payload size exceeded"),this[x8].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[x8][Y6]=1009,this.removeListener("data",_6),this.reset()}function vI(G){if(this[G7]._inflate=null,this[x8]){this[T8](this[x8]);return}G[Y6]=1007,this[T8](G)}});var B8=E1((JV,I7)=>{var{isUtf8:N6}=o5("buffer"),{hasBlob:wI}=Y4(),gI=[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 hI(G){return G>=1000&&G<=1014&&G!==1004&&G!==1005&&G!==1006||G>=3000&&G<=4999}function fJ(G){let H=G.length,R=0;while(R<H)if((G[R]&128)===0)R++;else if((G[R]&224)===192){if(R+1===H||(G[R+1]&192)!==128||(G[R]&254)===192)return!1;R+=2}else if((G[R]&240)===224){if(R+2>=H||(G[R+1]&192)!==128||(G[R+2]&192)!==128||G[R]===224&&(G[R+1]&224)===128||G[R]===237&&(G[R+1]&224)===160)return!1;R+=3}else if((G[R]&248)===240){if(R+3>=H||(G[R+1]&192)!==128||(G[R+2]&192)!==128||(G[R+3]&192)!==128||G[R]===240&&(G[R+1]&240)===128||G[R]===244&&G[R+1]>143||G[R]>244)return!1;R+=4}else return!1;return!0}function mI(G){return wI&&typeof G==="object"&&typeof G.arrayBuffer==="function"&&typeof G.type==="string"&&typeof G.stream==="function"&&(G[Symbol.toStringTag]==="Blob"||G[Symbol.toStringTag]==="File")}I7.exports={isBlob:mI,isValidStatusCode:hI,isValidUTF8:fJ,tokenChars:gI};if(N6)I7.exports.isValidUTF8=function(G){return G.length<24?fJ(G):N6(G)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let G=(()=>{throw new Error("Cannot require module "+"utf-8-validate");})();I7.exports.isValidUTF8=function(H){return H.length<32?fJ(H):G(H)}}catch(G){}});var lJ=E1((KV,O6)=>{var{Writable:fI}=o5("stream"),R6=N3(),{BINARY_TYPES:uI,EMPTY_BUFFER:A6,kStatusCode:lI,kWebSocket:pI}=Y4(),{concat:uJ,toArrayBuffer:kI,unmask:bI}=_3(),{isValidStatusCode:iI,isValidUTF8:F6}=B8(),z7=Buffer[Symbol.species];class D6 extends fI{constructor(G={}){super();this._allowSynchronousEvents=G.allowSynchronousEvents!==void 0?G.allowSynchronousEvents:!0,this._binaryType=G.binaryType||uI[0],this._extensions=G.extensions||{},this._isServer=!!G.isServer,this._maxPayload=G.maxPayload|0,this._skipUTF8Validation=!!G.skipUTF8Validation,this[pI]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=0}_write(G,H,R){if(this._opcode===8&&this._state==0)return R();this._bufferedBytes+=G.length,this._buffers.push(G),this.startLoop(R)}consume(G){if(this._bufferedBytes-=G,G===this._buffers[0].length)return this._buffers.shift();if(G<this._buffers[0].length){let R=this._buffers[0];return this._buffers[0]=new z7(R.buffer,R.byteOffset+G,R.length-G),new z7(R.buffer,R.byteOffset,G)}let H=Buffer.allocUnsafe(G);do{let R=this._buffers[0],P=H.length-G;if(G>=R.length)H.set(this._buffers.shift(),P);else H.set(new Uint8Array(R.buffer,R.byteOffset,G),P),this._buffers[0]=new z7(R.buffer,R.byteOffset+G,R.length-G);G-=R.length}while(G>0);return H}startLoop(G){this._loop=!0;do switch(this._state){case 0:this.getInfo(G);break;case 1:this.getPayloadLength16(G);break;case 2:this.getPayloadLength64(G);break;case 3:this.getMask();break;case 4:this.getData(G);break;case 5:case 6:this._loop=!1;return}while(this._loop);if(!this._errored)G()}getInfo(G){if(this._bufferedBytes<2){this._loop=!1;return}let H=this.consume(2);if((H[0]&48)!==0){let P=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");G(P);return}let R=(H[0]&64)===64;if(R&&!this._extensions[R6.extensionName]){let P=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");G(P);return}if(this._fin=(H[0]&128)===128,this._opcode=H[0]&15,this._payloadLength=H[1]&127,this._opcode===0){if(R){let P=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");G(P);return}if(!this._fragmented){let P=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");G(P);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let P=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");G(P);return}this._compressed=R}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let P=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");G(P);return}if(R){let P=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");G(P);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let P=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");G(P);return}}else{let P=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");G(P);return}if(!this._fin&&!this._fragmented)this._fragmented=this._opcode;if(this._masked=(H[1]&128)===128,this._isServer){if(!this._masked){let P=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");G(P);return}}else if(this._masked){let P=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");G(P);return}if(this._payloadLength===126)this._state=1;else if(this._payloadLength===127)this._state=2;else this.haveLength(G)}getPayloadLength16(G){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(G)}getPayloadLength64(G){if(this._bufferedBytes<8){this._loop=!1;return}let H=this.consume(8),R=H.readUInt32BE(0);if(R>Math.pow(2,21)-1){let P=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");G(P);return}this._payloadLength=R*Math.pow(2,32)+H.readUInt32BE(4),this.haveLength(G)}haveLength(G){if(this._payloadLength&&this._opcode<8){if(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0){let H=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");G(H);return}}if(this._masked)this._state=3;else this._state=4}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=4}getData(G){let H=A6;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}if(H=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0)bI(H,this._mask)}if(this._opcode>7){this.controlMessage(H,G);return}if(this._compressed){this._state=5,this.decompress(H,G);return}if(H.length)this._messageLength=this._totalPayloadLength,this._fragments.push(H);this.dataMessage(G)}decompress(G,H){this._extensions[R6.extensionName].decompress(G,this._fin,(P,D)=>{if(P)return H(P);if(D.length){if(this._messageLength+=D.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let M=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");H(M);return}this._fragments.push(D)}if(this.dataMessage(H),this._state===0)this.startLoop(H)})}dataMessage(G){if(!this._fin){this._state=0;return}let H=this._messageLength,R=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let P;if(this._binaryType==="nodebuffer")P=uJ(R,H);else if(this._binaryType==="arraybuffer")P=kI(uJ(R,H));else if(this._binaryType==="blob")P=new Blob(R);else P=R;if(this._allowSynchronousEvents)this.emit("message",P,!0),this._state=0;else this._state=6,setImmediate(()=>{this.emit("message",P,!0),this._state=0,this.startLoop(G)})}else{let P=uJ(R,H);if(!this._skipUTF8Validation&&!F6(P)){let D=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");G(D);return}if(this._state===5||this._allowSynchronousEvents)this.emit("message",P,!1),this._state=0;else this._state=6,setImmediate(()=>{this.emit("message",P,!1),this._state=0,this.startLoop(G)})}}controlMessage(G,H){if(this._opcode===8){if(G.length===0)this._loop=!1,this.emit("conclude",1005,A6),this.end();else{let R=G.readUInt16BE(0);if(!iI(R)){let D=this.createError(RangeError,`invalid status code ${R}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");H(D);return}let P=new z7(G.buffer,G.byteOffset+2,G.length-2);if(!this._skipUTF8Validation&&!F6(P)){let D=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");H(D);return}this._loop=!1,this.emit("conclude",R,P),this.end()}this._state=0;return}if(this._allowSynchronousEvents)this.emit(this._opcode===9?"ping":"pong",G),this._state=0;else this._state=6,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",G),this._state=0,this.startLoop(H)})}createError(G,H,R,P,D){this._loop=!1,this._errored=!0;let M=new G(R?`Invalid WebSocket frame: ${H}`:H);return Error.captureStackTrace(M,this.createError),M.code=D,M[lI]=P,M}}O6.exports=D6});var kJ=E1((ZV,T6)=>{var{Duplex:XV}=o5("stream"),{randomFillSync:dI}=o5("crypto"),M6=N3(),{EMPTY_BUFFER:cI,kWebSocket:nI,NOOP:rI}=Y4(),{isBlob:C8,isValidStatusCode:aI}=B8(),{mask:P6,toBuffer:n4}=_3(),k1=Symbol("kByteLength"),sI=Buffer.alloc(4),r4,q8=8192,c1=0,oI=1,tI=2;class L4{constructor(G,H,R){if(this._extensions=H||{},R)this._generateMask=R,this._maskBuffer=Buffer.alloc(4);this._socket=G,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=c1,this.onerror=rI,this[nI]=void 0}static frame(G,H){let R,P=!1,D=2,M=!1;if(H.mask){if(R=H.maskBuffer||sI,H.generateMask)H.generateMask(R);else{if(q8===8192){if(r4===void 0)r4=Buffer.alloc(8192);dI(r4,0,8192),q8=0}R[0]=r4[q8++],R[1]=r4[q8++],R[2]=r4[q8++],R[3]=r4[q8++]}M=(R[0]|R[1]|R[2]|R[3])===0,D=6}let p;if(typeof G==="string")if((!H.mask||M)&&H[k1]!==void 0)p=H[k1];else G=Buffer.from(G),p=G.length;else p=G.length,P=H.mask&&H.readOnly&&!M;let f=p;if(p>=65536)D+=8,f=127;else if(p>125)D+=2,f=126;let u=Buffer.allocUnsafe(P?p+D:D);if(u[0]=H.fin?H.opcode|128:H.opcode,H.rsv1)u[0]|=64;if(u[1]=f,f===126)u.writeUInt16BE(p,2);else if(f===127)u[2]=u[3]=0,u.writeUIntBE(p,4,6);if(!H.mask)return[u,G];if(u[1]|=128,u[D-4]=R[0],u[D-3]=R[1],u[D-2]=R[2],u[D-1]=R[3],M)return[u,G];if(P)return P6(G,R,u,D,p),[u];return P6(G,R,G,0,p),[u,G]}close(G,H,R,P){let D;if(G===void 0)D=cI;else if(typeof G!=="number"||!aI(G))throw TypeError("First argument must be a valid error code number");else if(H===void 0||!H.length)D=Buffer.allocUnsafe(2),D.writeUInt16BE(G,0);else{let p=Buffer.byteLength(H);if(p>123)throw RangeError("The message must not be greater than 123 bytes");if(D=Buffer.allocUnsafe(2+p),D.writeUInt16BE(G,0),typeof H==="string")D.write(H,2);else D.set(H,2)}let M={[k1]:D.length,fin:!0,generateMask:this._generateMask,mask:R,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};if(this._state!==c1)this.enqueue([this.dispatch,D,!1,M,P]);else this.sendFrame(L4.frame(D,M),P)}ping(G,H,R){let P,D;if(typeof G==="string")P=Buffer.byteLength(G),D=!1;else if(C8(G))P=G.size,D=!1;else G=n4(G),P=G.length,D=n4.readOnly;if(P>125)throw RangeError("The data size must not be greater than 125 bytes");let M={[k1]:P,fin:!0,generateMask:this._generateMask,mask:H,maskBuffer:this._maskBuffer,opcode:9,readOnly:D,rsv1:!1};if(C8(G))if(this._state!==c1)this.enqueue([this.getBlobData,G,!1,M,R]);else this.getBlobData(G,!1,M,R);else if(this._state!==c1)this.enqueue([this.dispatch,G,!1,M,R]);else this.sendFrame(L4.frame(G,M),R)}pong(G,H,R){let P,D;if(typeof G==="string")P=Buffer.byteLength(G),D=!1;else if(C8(G))P=G.size,D=!1;else G=n4(G),P=G.length,D=n4.readOnly;if(P>125)throw RangeError("The data size must not be greater than 125 bytes");let M={[k1]:P,fin:!0,generateMask:this._generateMask,mask:H,maskBuffer:this._maskBuffer,opcode:10,readOnly:D,rsv1:!1};if(C8(G))if(this._state!==c1)this.enqueue([this.getBlobData,G,!1,M,R]);else this.getBlobData(G,!1,M,R);else if(this._state!==c1)this.enqueue([this.dispatch,G,!1,M,R]);else this.sendFrame(L4.frame(G,M),R)}send(G,H,R){let P=this._extensions[M6.extensionName],D=H.binary?2:1,M=H.compress,p,f;if(typeof G==="string")p=Buffer.byteLength(G),f=!1;else if(C8(G))p=G.size,f=!1;else G=n4(G),p=G.length,f=n4.readOnly;if(this._firstFragment){if(this._firstFragment=!1,M&&P&&P.params[P._isServer?"server_no_context_takeover":"client_no_context_takeover"])M=p>=P._threshold;this._compress=M}else M=!1,D=0;if(H.fin)this._firstFragment=!0;let u={[k1]:p,fin:H.fin,generateMask:this._generateMask,mask:H.mask,maskBuffer:this._maskBuffer,opcode:D,readOnly:f,rsv1:M};if(C8(G))if(this._state!==c1)this.enqueue([this.getBlobData,G,this._compress,u,R]);else this.getBlobData(G,this._compress,u,R);else if(this._state!==c1)this.enqueue([this.dispatch,G,this._compress,u,R]);else this.dispatch(G,this._compress,u,R)}getBlobData(G,H,R,P){this._bufferedBytes+=R[k1],this._state=tI,G.arrayBuffer().then((D)=>{if(this._socket.destroyed){let p=Error("The socket was closed while the blob was being read");process.nextTick(pJ,this,p,P);return}this._bufferedBytes-=R[k1];let M=n4(D);if(!H)this._state=c1,this.sendFrame(L4.frame(M,R),P),this.dequeue();else this.dispatch(M,H,R,P)}).catch((D)=>{process.nextTick(eI,this,D,P)})}dispatch(G,H,R,P){if(!H){this.sendFrame(L4.frame(G,R),P);return}let D=this._extensions[M6.extensionName];this._bufferedBytes+=R[k1],this._state=oI,D.compress(G,R.fin,(M,p)=>{if(this._socket.destroyed){let f=Error("The socket was closed while data was being compressed");pJ(this,f,P);return}this._bufferedBytes-=R[k1],this._state=c1,R.readOnly=!1,this.sendFrame(L4.frame(p,R),P),this.dequeue()})}dequeue(){while(this._state===c1&&this._queue.length){let G=this._queue.shift();this._bufferedBytes-=G[3][k1],Reflect.apply(G[0],this,G.slice(1))}}enqueue(G){this._bufferedBytes+=G[3][k1],this._queue.push(G)}sendFrame(G,H){if(G.length===2)this._socket.cork(),this._socket.write(G[0]),this._socket.write(G[1],H),this._socket.uncork();else this._socket.write(G[0],H)}}T6.exports=L4;function pJ(G,H,R){if(typeof R==="function")R(H);for(let P=0;P<G._queue.length;P++){let D=G._queue[P],M=D[D.length-1];if(typeof M==="function")M(H)}}function eI(G,H,R){pJ(G,H,R),G.onerror(H)}});var y6=E1(($V,E6)=>{var{kForOnEventAttribute:R3,kListener:bJ}=Y4(),x6=Symbol("kCode"),B6=Symbol("kData"),C6=Symbol("kError"),q6=Symbol("kMessage"),U6=Symbol("kReason"),U8=Symbol("kTarget"),L6=Symbol("kType"),W6=Symbol("kWasClean");class W4{constructor(G){this[U8]=null,this[L6]=G}get target(){return this[U8]}get type(){return this[L6]}}Object.defineProperty(W4.prototype,"target",{enumerable:!0});Object.defineProperty(W4.prototype,"type",{enumerable:!0});class L8 extends W4{constructor(G,H={}){super(G);this[x6]=H.code===void 0?0:H.code,this[U6]=H.reason===void 0?"":H.reason,this[W6]=H.wasClean===void 0?!1:H.wasClean}get code(){return this[x6]}get reason(){return this[U6]}get wasClean(){return this[W6]}}Object.defineProperty(L8.prototype,"code",{enumerable:!0});Object.defineProperty(L8.prototype,"reason",{enumerable:!0});Object.defineProperty(L8.prototype,"wasClean",{enumerable:!0});class A3 extends W4{constructor(G,H={}){super(G);this[C6]=H.error===void 0?null:H.error,this[q6]=H.message===void 0?"":H.message}get error(){return this[C6]}get message(){return this[q6]}}Object.defineProperty(A3.prototype,"error",{enumerable:!0});Object.defineProperty(A3.prototype,"message",{enumerable:!0});class Y7 extends W4{constructor(G,H={}){super(G);this[B6]=H.data===void 0?null:H.data}get data(){return this[B6]}}Object.defineProperty(Y7.prototype,"data",{enumerable:!0});var Jz={addEventListener(G,H,R={}){for(let D of this.listeners(G))if(!R[R3]&&D[bJ]===H&&!D[R3])return;let P;if(G==="message")P=function(M,p){let f=new Y7("message",{data:p?M:M.toString()});f[U8]=this,j7(H,this,f)};else if(G==="close")P=function(M,p){let f=new L8("close",{code:M,reason:p.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});f[U8]=this,j7(H,this,f)};else if(G==="error")P=function(M){let p=new A3("error",{error:M,message:M.message});p[U8]=this,j7(H,this,p)};else if(G==="open")P=function(){let M=new W4("open");M[U8]=this,j7(H,this,M)};else return;if(P[R3]=!!R[R3],P[bJ]=H,R.once)this.once(G,P);else this.on(G,P)},removeEventListener(G,H){for(let R of this.listeners(G))if(R[bJ]===H&&!R[R3]){this.removeListener(G,R);break}}};E6.exports={CloseEvent:L8,ErrorEvent:A3,Event:W4,EventTarget:Jz,MessageEvent:Y7};function j7(G,H,R){if(typeof G==="object"&&G.handleEvent)G.handleEvent.call(G,R);else G.call(H,R)}});var iJ=E1((QV,S6)=>{var{tokenChars:F3}=B8();function X4(G,H,R){if(G[H]===void 0)G[H]=[R];else G[H].push(R)}function Kz(G){let H=Object.create(null),R=Object.create(null),P=!1,D=!1,M=!1,p,f,u=-1,V0=-1,R0=-1,Z0=0;for(;Z0<G.length;Z0++)if(V0=G.charCodeAt(Z0),p===void 0)if(R0===-1&&F3[V0]===1){if(u===-1)u=Z0}else if(Z0!==0&&(V0===32||V0===9)){if(R0===-1&&u!==-1)R0=Z0}else if(V0===59||V0===44){if(u===-1)throw SyntaxError(`Unexpected character at index ${Z0}`);if(R0===-1)R0=Z0;let h=G.slice(u,R0);if(V0===44)X4(H,h,R),R=Object.create(null);else p=h;u=R0=-1}else throw SyntaxError(`Unexpected character at index ${Z0}`);else if(f===void 0)if(R0===-1&&F3[V0]===1){if(u===-1)u=Z0}else if(V0===32||V0===9){if(R0===-1&&u!==-1)R0=Z0}else if(V0===59||V0===44){if(u===-1)throw SyntaxError(`Unexpected character at index ${Z0}`);if(R0===-1)R0=Z0;if(X4(R,G.slice(u,R0),!0),V0===44)X4(H,p,R),R=Object.create(null),p=void 0;u=R0=-1}else if(V0===61&&u!==-1&&R0===-1)f=G.slice(u,Z0),u=R0=-1;else throw SyntaxError(`Unexpected character at index ${Z0}`);else if(D){if(F3[V0]!==1)throw SyntaxError(`Unexpected character at index ${Z0}`);if(u===-1)u=Z0;else if(!P)P=!0;D=!1}else if(M)if(F3[V0]===1){if(u===-1)u=Z0}else if(V0===34&&u!==-1)M=!1,R0=Z0;else if(V0===92)D=!0;else throw SyntaxError(`Unexpected character at index ${Z0}`);else if(V0===34&&G.charCodeAt(Z0-1)===61)M=!0;else if(R0===-1&&F3[V0]===1){if(u===-1)u=Z0}else if(u!==-1&&(V0===32||V0===9)){if(R0===-1)R0=Z0}else if(V0===59||V0===44){if(u===-1)throw SyntaxError(`Unexpected character at index ${Z0}`);if(R0===-1)R0=Z0;let h=G.slice(u,R0);if(P)h=h.replace(/\\/g,""),P=!1;if(X4(R,f,h),V0===44)X4(H,p,R),R=Object.create(null),p=void 0;f=void 0,u=R0=-1}else throw SyntaxError(`Unexpected character at index ${Z0}`);if(u===-1||M||V0===32||V0===9)throw SyntaxError("Unexpected end of input");if(R0===-1)R0=Z0;let U=G.slice(u,R0);if(p===void 0)X4(H,U,R);else{if(f===void 0)X4(R,U,!0);else if(P)X4(R,f,U.replace(/\\/g,""));else X4(R,f,U);X4(H,p,R)}return H}function Xz(G){return Object.keys(G).map((H)=>{let R=G[H];if(!Array.isArray(R))R=[R];return R.map((P)=>{return[H].concat(Object.keys(P).map((D)=>{let M=P[D];if(!Array.isArray(M))M=[M];return M.map((p)=>p===!0?D:`${D}=${p}`).join("; ")})).join("; ")}).join(", ")}).join(", ")}S6.exports={format:Xz,parse:Kz}});var N7=E1((zV,i6)=>{var Zz=o5("events"),$z=o5("https"),Qz=o5("http"),g6=o5("net"),Gz=o5("tls"),{randomBytes:Iz,createHash:zz}=o5("crypto"),{Duplex:GV,Readable:IV}=o5("stream"),{URL:dJ}=o5("url"),E4=N3(),jz=lJ(),Yz=kJ(),{isBlob:Vz}=B8(),{BINARY_TYPES:v6,CLOSE_TIMEOUT:_z,EMPTY_BUFFER:V7,GUID:Hz,kForOnEventAttribute:cJ,kListener:Nz,kStatusCode:Rz,kWebSocket:Y1,NOOP:h6}=Y4(),{EventTarget:{addEventListener:Az,removeEventListener:Fz}}=y6(),{format:Dz,parse:Oz}=iJ(),{toBuffer:Mz}=_3(),m6=Symbol("kAborted"),nJ=[8,13],_4=["CONNECTING","OPEN","CLOSING","CLOSED"],Pz=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;class a0 extends Zz{constructor(G,H,R){super();if(this._binaryType=v6[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=V7,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=a0.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,G!==null){if(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,H===void 0)H=[];else if(!Array.isArray(H))if(typeof H==="object"&&H!==null)R=H,H=[];else H=[H];f6(this,G,H,R)}else this._autoPong=R.autoPong,this._closeTimeout=R.closeTimeout,this._isServer=!0}get binaryType(){return this._binaryType}set binaryType(G){if(!v6.includes(G))return;if(this._binaryType=G,this._receiver)this._receiver._binaryType=G}get bufferedAmount(){if(!this._socket)return this._bufferedAmount;return this._socket._writableState.length+this._sender._bufferedBytes}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(G,H,R){let P=new jz({allowSynchronousEvents:R.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:R.maxPayload,skipUTF8Validation:R.skipUTF8Validation}),D=new Yz(G,this._extensions,R.generateMask);if(this._receiver=P,this._sender=D,this._socket=G,P[Y1]=this,D[Y1]=this,G[Y1]=this,P.on("conclude",Bz),P.on("drain",Cz),P.on("error",qz),P.on("message",Uz),P.on("ping",Lz),P.on("pong",Wz),D.onerror=Ez,G.setTimeout)G.setTimeout(0);if(G.setNoDelay)G.setNoDelay();if(H.length>0)G.unshift(H);G.on("close",p6),G.on("data",H7),G.on("end",k6),G.on("error",b6),this._readyState=a0.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=a0.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}if(this._extensions[E4.extensionName])this._extensions[E4.extensionName].cleanup();this._receiver.removeAllListeners(),this._readyState=a0.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(G,H){if(this.readyState===a0.CLOSED)return;if(this.readyState===a0.CONNECTING){v1(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===a0.CLOSING){if(this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted))this._socket.end();return}this._readyState=a0.CLOSING,this._sender.close(G,H,!this._isServer,(R)=>{if(R)return;if(this._closeFrameSent=!0,this._closeFrameReceived||this._receiver._writableState.errorEmitted)this._socket.end()}),l6(this)}pause(){if(this.readyState===a0.CONNECTING||this.readyState===a0.CLOSED)return;this._paused=!0,this._socket.pause()}ping(G,H,R){if(this.readyState===a0.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof G==="function")R=G,G=H=void 0;else if(typeof H==="function")R=H,H=void 0;if(typeof G==="number")G=G.toString();if(this.readyState!==a0.OPEN){rJ(this,G,R);return}if(H===void 0)H=!this._isServer;this._sender.ping(G||V7,H,R)}pong(G,H,R){if(this.readyState===a0.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof G==="function")R=G,G=H=void 0;else if(typeof H==="function")R=H,H=void 0;if(typeof G==="number")G=G.toString();if(this.readyState!==a0.OPEN){rJ(this,G,R);return}if(H===void 0)H=!this._isServer;this._sender.pong(G||V7,H,R)}resume(){if(this.readyState===a0.CONNECTING||this.readyState===a0.CLOSED)return;if(this._paused=!1,!this._receiver._writableState.needDrain)this._socket.resume()}send(G,H,R){if(this.readyState===a0.CONNECTING)throw Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof H==="function")R=H,H={};if(typeof G==="number")G=G.toString();if(this.readyState!==a0.OPEN){rJ(this,G,R);return}let P={binary:typeof G!=="string",mask:!this._isServer,compress:!0,fin:!0,...H};if(!this._extensions[E4.extensionName])P.compress=!1;this._sender.send(G||V7,P,R)}terminate(){if(this.readyState===a0.CLOSED)return;if(this.readyState===a0.CONNECTING){v1(this,this._req,"WebSocket was closed before the connection was established");return}if(this._socket)this._readyState=a0.CLOSING,this._socket.destroy()}}Object.defineProperty(a0,"CONNECTING",{enumerable:!0,value:_4.indexOf("CONNECTING")});Object.defineProperty(a0.prototype,"CONNECTING",{enumerable:!0,value:_4.indexOf("CONNECTING")});Object.defineProperty(a0,"OPEN",{enumerable:!0,value:_4.indexOf("OPEN")});Object.defineProperty(a0.prototype,"OPEN",{enumerable:!0,value:_4.indexOf("OPEN")});Object.defineProperty(a0,"CLOSING",{enumerable:!0,value:_4.indexOf("CLOSING")});Object.defineProperty(a0.prototype,"CLOSING",{enumerable:!0,value:_4.indexOf("CLOSING")});Object.defineProperty(a0,"CLOSED",{enumerable:!0,value:_4.indexOf("CLOSED")});Object.defineProperty(a0.prototype,"CLOSED",{enumerable:!0,value:_4.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach((G)=>{Object.defineProperty(a0.prototype,G,{enumerable:!0})});["open","error","close","message"].forEach((G)=>{Object.defineProperty(a0.prototype,`on${G}`,{enumerable:!0,get(){for(let H of this.listeners(G))if(H[cJ])return H[Nz];return null},set(H){for(let R of this.listeners(G))if(R[cJ]){this.removeListener(G,R);break}if(typeof H!=="function")return;this.addEventListener(G,H,{[cJ]:!0})}})});a0.prototype.addEventListener=Az;a0.prototype.removeEventListener=Fz;i6.exports=a0;function f6(G,H,R,P){let D={allowSynchronousEvents:!0,autoPong:!0,closeTimeout:_z,protocolVersion:nJ[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...P,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(G._autoPong=D.autoPong,G._closeTimeout=D.closeTimeout,!nJ.includes(D.protocolVersion))throw RangeError(`Unsupported protocol version: ${D.protocolVersion} (supported versions: ${nJ.join(", ")})`);let M;if(H instanceof dJ)M=H;else try{M=new dJ(H)}catch(y){throw SyntaxError(`Invalid URL: ${H}`)}if(M.protocol==="http:")M.protocol="ws:";else if(M.protocol==="https:")M.protocol="wss:";G._url=M.href;let p=M.protocol==="wss:",f=M.protocol==="ws+unix:",u;if(M.protocol!=="ws:"&&!p&&!f)u=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`;else if(f&&!M.pathname)u="The URL's pathname is empty";else if(M.hash)u="The URL contains a fragment identifier";if(u){let y=SyntaxError(u);if(G._redirects===0)throw y;else{_7(G,y);return}}let V0=p?443:80,R0=Iz(16).toString("base64"),Z0=p?$z.request:Qz.request,U=new Set,h;if(D.createConnection=D.createConnection||(p?xz:Tz),D.defaultPort=D.defaultPort||V0,D.port=M.port||V0,D.host=M.hostname.startsWith("[")?M.hostname.slice(1,-1):M.hostname,D.headers={...D.headers,"Sec-WebSocket-Version":D.protocolVersion,"Sec-WebSocket-Key":R0,Connection:"Upgrade",Upgrade:"websocket"},D.path=M.pathname+M.search,D.timeout=D.handshakeTimeout,D.perMessageDeflate)h=new E4(D.perMessageDeflate!==!0?D.perMessageDeflate:{},!1,D.maxPayload),D.headers["Sec-WebSocket-Extensions"]=Dz({[E4.extensionName]:h.offer()});if(R.length){for(let y of R){if(typeof y!=="string"||!Pz.test(y)||U.has(y))throw SyntaxError("An invalid or duplicated subprotocol was specified");U.add(y)}D.headers["Sec-WebSocket-Protocol"]=R.join(",")}if(D.origin)if(D.protocolVersion<13)D.headers["Sec-WebSocket-Origin"]=D.origin;else D.headers.Origin=D.origin;if(M.username||M.password)D.auth=`${M.username}:${M.password}`;if(f){let y=D.path.split(":");D.socketPath=y[0],D.path=y[1]}let g;if(D.followRedirects){if(G._redirects===0){G._originalIpc=f,G._originalSecure=p,G._originalHostOrSocketPath=f?D.socketPath:M.host;let y=P&&P.headers;if(P={...P,headers:{}},y)for(let[r,F0]of Object.entries(y))P.headers[r.toLowerCase()]=F0}else if(G.listenerCount("redirect")===0){let y=f?G._originalIpc?D.socketPath===G._originalHostOrSocketPath:!1:G._originalIpc?!1:M.host===G._originalHostOrSocketPath;if(!y||G._originalSecure&&!p){if(delete D.headers.authorization,delete D.headers.cookie,!y)delete D.headers.host;D.auth=void 0}}if(D.auth&&!P.headers.authorization)P.headers.authorization="Basic "+Buffer.from(D.auth).toString("base64");if(g=G._req=Z0(D),G._redirects)G.emit("redirect",G.url,g)}else g=G._req=Z0(D);if(D.timeout)g.on("timeout",()=>{v1(G,g,"Opening handshake has timed out")});if(g.on("error",(y)=>{if(g===null||g[m6])return;g=G._req=null,_7(G,y)}),g.on("response",(y)=>{let r=y.headers.location,F0=y.statusCode;if(r&&D.followRedirects&&F0>=300&&F0<400){if(++G._redirects>D.maxRedirects){v1(G,g,"Maximum redirects exceeded");return}g.abort();let v0;try{v0=new dJ(r,H)}catch($0){let A0=SyntaxError(`Invalid URL: ${r}`);_7(G,A0);return}f6(G,v0,R,P)}else if(!G.emit("unexpected-response",g,y))v1(G,g,`Unexpected server response: ${y.statusCode}`)}),g.on("upgrade",(y,r,F0)=>{if(G.emit("upgrade",y),G.readyState!==a0.CONNECTING)return;g=G._req=null;let v0=y.headers.upgrade;if(v0===void 0||v0.toLowerCase()!=="websocket"){v1(G,r,"Invalid Upgrade header");return}let $0=zz("sha1").update(R0+Hz).digest("base64");if(y.headers["sec-websocket-accept"]!==$0){v1(G,r,"Invalid Sec-WebSocket-Accept header");return}let A0=y.headers["sec-websocket-protocol"],Q0;if(A0!==void 0){if(!U.size)Q0="Server sent a subprotocol but none was requested";else if(!U.has(A0))Q0="Server sent an invalid subprotocol"}else if(U.size)Q0="Server sent no subprotocol";if(Q0){v1(G,r,Q0);return}if(A0)G._protocol=A0;let H0=y.headers["sec-websocket-extensions"];if(H0!==void 0){if(!h){v1(G,r,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let I0;try{I0=Oz(H0)}catch(F5){v1(G,r,"Invalid Sec-WebSocket-Extensions header");return}let L0=Object.keys(I0);if(L0.length!==1||L0[0]!==E4.extensionName){v1(G,r,"Server indicated an extension that was not requested");return}try{h.accept(I0[E4.extensionName])}catch(F5){v1(G,r,"Invalid Sec-WebSocket-Extensions header");return}G._extensions[E4.extensionName]=h}G.setSocket(r,F0,{allowSynchronousEvents:D.allowSynchronousEvents,generateMask:D.generateMask,maxPayload:D.maxPayload,skipUTF8Validation:D.skipUTF8Validation})}),D.finishRequest)D.finishRequest(g,G);else g.end()}function _7(G,H){G._readyState=a0.CLOSING,G._errorEmitted=!0,G.emit("error",H),G.emitClose()}function Tz(G){return G.path=G.socketPath,g6.connect(G)}function xz(G){if(G.path=void 0,!G.servername&&G.servername!=="")G.servername=g6.isIP(G.host)?"":G.host;return Gz.connect(G)}function v1(G,H,R){G._readyState=a0.CLOSING;let P=Error(R);if(Error.captureStackTrace(P,v1),H.setHeader){if(H[m6]=!0,H.abort(),H.socket&&!H.socket.destroyed)H.socket.destroy();process.nextTick(_7,G,P)}else H.destroy(P),H.once("error",G.emit.bind(G,"error")),H.once("close",G.emitClose.bind(G))}function rJ(G,H,R){if(H){let P=Vz(H)?H.size:Mz(H).length;if(G._socket)G._sender._bufferedBytes+=P;else G._bufferedAmount+=P}if(R){let P=Error(`WebSocket is not open: readyState ${G.readyState} (${_4[G.readyState]})`);process.nextTick(R,P)}}function Bz(G,H){let R=this[Y1];if(R._closeFrameReceived=!0,R._closeMessage=H,R._closeCode=G,R._socket[Y1]===void 0)return;if(R._socket.removeListener("data",H7),process.nextTick(u6,R._socket),G===1005)R.close();else R.close(G,H)}function Cz(){let G=this[Y1];if(!G.isPaused)G._socket.resume()}function qz(G){let H=this[Y1];if(H._socket[Y1]!==void 0)H._socket.removeListener("data",H7),process.nextTick(u6,H._socket),H.close(G[Rz]);if(!H._errorEmitted)H._errorEmitted=!0,H.emit("error",G)}function w6(){this[Y1].emitClose()}function Uz(G,H){this[Y1].emit("message",G,H)}function Lz(G){let H=this[Y1];if(H._autoPong)H.pong(G,!this._isServer,h6);H.emit("ping",G)}function Wz(G){this[Y1].emit("pong",G)}function u6(G){G.resume()}function Ez(G){let H=this[Y1];if(H.readyState===a0.CLOSED)return;if(H.readyState===a0.OPEN)H._readyState=a0.CLOSING,l6(H);if(this._socket.end(),!H._errorEmitted)H._errorEmitted=!0,H.emit("error",G)}function l6(G){G._closeTimer=setTimeout(G._socket.destroy.bind(G._socket),G._closeTimeout)}function p6(){let G=this[Y1];if(this.removeListener("close",p6),this.removeListener("data",H7),this.removeListener("end",k6),G._readyState=a0.CLOSING,!this._readableState.endEmitted&&!G._closeFrameReceived&&!G._receiver._writableState.errorEmitted&&this._readableState.length!==0){let H=this.read(this._readableState.length);G._receiver.write(H)}if(G._receiver.end(),this[Y1]=void 0,clearTimeout(G._closeTimer),G._receiver._writableState.finished||G._receiver._writableState.errorEmitted)G.emitClose();else G._receiver.on("error",w6),G._receiver.on("finish",w6)}function H7(G){if(!this[Y1]._receiver.write(G))this.pause()}function k6(){let G=this[Y1];G._readyState=a0.CLOSING,G._receiver.end(),this.end()}function b6(){let G=this[Y1];if(this.removeListener("error",b6),this.on("error",h6),G)G._readyState=a0.CLOSING,this.destroy()}});var r6=E1((YV,n6)=>{var jV=N7(),{Duplex:yz}=o5("stream");function d6(G){G.emit("close")}function Sz(){if(!this.destroyed&&this._writableState.finished)this.destroy()}function c6(G){if(this.removeListener("error",c6),this.destroy(),this.listenerCount("error")===0)this.emit("error",G)}function vz(G,H){let R=!0,P=new yz({...H,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return G.on("message",function(M,p){let f=!p&&P._readableState.objectMode?M.toString():M;if(!P.push(f))G.pause()}),G.once("error",function(M){if(P.destroyed)return;R=!1,P.destroy(M)}),G.once("close",function(){if(P.destroyed)return;P.push(null)}),P._destroy=function(D,M){if(G.readyState===G.CLOSED){M(D),process.nextTick(d6,P);return}let p=!1;if(G.once("error",function(u){p=!0,M(u)}),G.once("close",function(){if(!p)M(D);process.nextTick(d6,P)}),R)G.terminate()},P._final=function(D){if(G.readyState===G.CONNECTING){G.once("open",function(){P._final(D)});return}if(G._socket===null)return;if(G._socket._writableState.finished){if(D(),P._readableState.endEmitted)P.destroy()}else G._socket.once("finish",function(){D()}),G.close()},P._read=function(){if(G.isPaused)G.resume()},P._write=function(D,M,p){if(G.readyState===G.CONNECTING){G.once("open",function(){P._write(D,M,p)});return}G.send(D,p)},P.on("end",Sz),P.on("error",c6),P}n6.exports=vz});var s6=E1((VV,a6)=>{var{tokenChars:wz}=B8();function gz(G){let H=new Set,R=-1,P=-1,D=0;for(D;D<G.length;D++){let p=G.charCodeAt(D);if(P===-1&&wz[p]===1){if(R===-1)R=D}else if(D!==0&&(p===32||p===9)){if(P===-1&&R!==-1)P=D}else if(p===44){if(R===-1)throw SyntaxError(`Unexpected character at index ${D}`);if(P===-1)P=D;let f=G.slice(R,P);if(H.has(f))throw SyntaxError(`The "${f}" subprotocol is duplicated`);H.add(f),R=P=-1}else throw SyntaxError(`Unexpected character at index ${D}`)}if(R===-1||P!==-1)throw SyntaxError("Unexpected end of input");let M=G.slice(R,D);if(H.has(M))throw SyntaxError(`The "${M}" subprotocol is duplicated`);return H.add(M),H}a6.exports={parse:gz}});var K$=E1((HV,J$)=>{var hz=o5("events"),R7=o5("http"),{Duplex:_V}=o5("stream"),{createHash:mz}=o5("crypto"),o6=iJ(),a4=N3(),fz=s6(),uz=N7(),{CLOSE_TIMEOUT:lz,GUID:pz,kWebSocket:kz}=Y4(),bz=/^[+/0-9A-Za-z]{22}==$/;class e6 extends hz{constructor(G,H){super();if(G={allowSynchronousEvents:!0,autoPong:!0,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,closeTimeout:lz,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:uz,...G},G.port==null&&!G.server&&!G.noServer||G.port!=null&&(G.server||G.noServer)||G.server&&G.noServer)throw TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(G.port!=null)this._server=R7.createServer((R,P)=>{let D=R7.STATUS_CODES[426];P.writeHead(426,{"Content-Length":D.length,"Content-Type":"text/plain"}),P.end(D)}),this._server.listen(G.port,G.host,G.backlog,H);else if(G.server)this._server=G.server;if(this._server){let R=this.emit.bind(this,"connection");this._removeListeners=iz(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(P,D,M)=>{this.handleUpgrade(P,D,M,R)}})}if(G.perMessageDeflate===!0)G.perMessageDeflate={};if(G.clientTracking)this.clients=new Set,this._shouldEmitClose=!1;this.options=G,this._state=0}address(){if(this.options.noServer)throw Error('The server is operating in "noServer" mode');if(!this._server)return null;return this._server.address()}close(G){if(this._state===2){if(G)this.once("close",()=>{G(Error("The server is not running"))});process.nextTick(D3,this);return}if(G)this.once("close",G);if(this._state===1)return;if(this._state=1,this.options.noServer||this.options.server){if(this._server)this._removeListeners(),this._removeListeners=this._server=null;if(this.clients)if(!this.clients.size)process.nextTick(D3,this);else this._shouldEmitClose=!0;else process.nextTick(D3,this)}else{let H=this._server;this._removeListeners(),this._removeListeners=this._server=null,H.close(()=>{D3(this)})}}shouldHandle(G){if(this.options.path){let H=G.url.indexOf("?");if((H!==-1?G.url.slice(0,H):G.url)!==this.options.path)return!1}return!0}handleUpgrade(G,H,R,P){H.on("error",t6);let D=G.headers["sec-websocket-key"],M=G.headers.upgrade,p=+G.headers["sec-websocket-version"];if(G.method!=="GET"){s4(this,G,H,405,"Invalid HTTP method");return}if(M===void 0||M.toLowerCase()!=="websocket"){s4(this,G,H,400,"Invalid Upgrade header");return}if(D===void 0||!bz.test(D)){s4(this,G,H,400,"Missing or invalid Sec-WebSocket-Key header");return}if(p!==13&&p!==8){s4(this,G,H,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(G)){O3(H,400);return}let f=G.headers["sec-websocket-protocol"],u=new Set;if(f!==void 0)try{u=fz.parse(f)}catch(Z0){s4(this,G,H,400,"Invalid Sec-WebSocket-Protocol header");return}let V0=G.headers["sec-websocket-extensions"],R0={};if(this.options.perMessageDeflate&&V0!==void 0){let Z0=new a4(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let U=o6.parse(V0);if(U[a4.extensionName])Z0.accept(U[a4.extensionName]),R0[a4.extensionName]=Z0}catch(U){s4(this,G,H,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let Z0={origin:G.headers[`${p===8?"sec-websocket-origin":"origin"}`],secure:!!(G.socket.authorized||G.socket.encrypted),req:G};if(this.options.verifyClient.length===2){this.options.verifyClient(Z0,(U,h,g,y)=>{if(!U)return O3(H,h||401,g,y);this.completeUpgrade(R0,D,u,G,H,R,P)});return}if(!this.options.verifyClient(Z0))return O3(H,401)}this.completeUpgrade(R0,D,u,G,H,R,P)}completeUpgrade(G,H,R,P,D,M,p){if(!D.readable||!D.writable)return D.destroy();if(D[kz])throw Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>0)return O3(D,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${mz("sha1").update(H+pz).digest("base64")}`],V0=new this.options.WebSocket(null,void 0,this.options);if(R.size){let R0=this.options.handleProtocols?this.options.handleProtocols(R,P):R.values().next().value;if(R0)u.push(`Sec-WebSocket-Protocol: ${R0}`),V0._protocol=R0}if(G[a4.extensionName]){let R0=G[a4.extensionName].params,Z0=o6.format({[a4.extensionName]:[R0]});u.push(`Sec-WebSocket-Extensions: ${Z0}`),V0._extensions=G}if(this.emit("headers",u,P),D.write(u.concat(`\r
2
2
  `).join(`\r
3
3
  `)),D.removeListener("error",t6),V0.setSocket(D,M,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients)this.clients.add(V0),V0.on("close",()=>{if(this.clients.delete(V0),this._shouldEmitClose&&!this.clients.size)process.nextTick(D3,this)});p(V0,P)}}J$.exports=e6;function iz(G,H){for(let R of Object.keys(H))G.on(R,H[R]);return function(){for(let P of Object.keys(H))G.removeListener(P,H[P])}}function D3(G){G._state=2,G.emit("close")}function t6(){this.destroy()}function O3(G,H,R,P){R=R||R7.STATUS_CODES[H],P={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(R),...P},G.once("finish",G.destroy),G.end(`HTTP/1.1 ${H} ${R7.STATUS_CODES[H]}\r
4
4
  `+Object.keys(P).map((D)=>`${D}: ${P[D]}`).join(`\r
@@ -0,0 +1,3 @@
1
+ import{wl as We}from"./chunk-qhzm2qw9.js";import{Dl as Oh,El as Mh,xl as ou}from"./chunk-arv4h3h1.js";import{Fl as Vh,Gl as Ch,Hl as L,Kl as _}from"./chunk-z3e4c424.js";var wu=L((qu)=>{(function(){var u=function(e,h,r){var f,q;q="";while(e.length>0)if(f=e.match(h),f)q+=e.slice(0,f.index),q+=r(f),e=e.slice(f.index+f[0].length);else q+=e,e="";return q};qu.split=function(e){var h,r;if(e==null)e="";if(r=[],h="",u(e,/\s*(?:([^\s\\\'\"]+)|'((?:[^\'\\]|\\.)*)'|"((?:[^\"\\]|\\.)*)"|(\\.?)|(\S))(\s|$)?/,function(f){var q,w,E,M,O,V,F;if(M=f[0],F=f[1],V=f[2],q=f[3],w=f[4],E=f[5],O=f[6],E!=null)throw Error("Unmatched quote");if(h+=F||(V||q||w).replace(/\\(?=.)/,""),O!=null)return r.push(h),h=""}),h)r.push(h);return r},qu.escape=function(e){if(e==null)e="";if(e==null)return"''";return e.replace(/([^A-Za-z0-9_\-.,:\/@\n])/g,"\\$1").replace(/\n/g,`'
2
+ '`)}}).call(qu)});var yu=L((Th,Eu)=>{var _u=_("fs"),k;function nu(){try{return _u.statSync("/.dockerenv"),!0}catch(u){return!1}}function tu(){try{return _u.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch(u){return!1}}Eu.exports=()=>{if(k===void 0)k=nu()||tu();return k}});var Mu=L((zh,b)=>{var su=_("os"),pu=_("fs"),Cu=yu(),Ou=()=>{if(process.platform!=="linux")return!1;if(su.release().toLowerCase().includes("microsoft")){if(Cu())return!1;return!0}try{return pu.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!Cu():!1}catch(u){return!1}};if(process.env.__IS_WSL_TEST__)b.exports=Ou;else b.exports=Ou()});var K=L((Me,y)=>{var ue=wu(),g=_("child_process"),a=ou(),ee=Mu(),he=_("path"),fe=_("url"),X=_("os"),l=_("fs"),re=_("net");function ju(u){return JSON.parse(JSON.stringify(u))}Me.clone=ju;var qe=function(u){if(typeof u==="string")return u.replace(/(["$`\\])/g,"\\$1");else return u},we=function(u,e){return u.indexOf(e)!==-1},Lu={u:"urgency",urgency:"urgency",t:"expire-time",time:"expire-time",timeout:"expire-time",e:"expire-time",expire:"expire-time","expire-time":"expire-time",i:"icon",icon:"icon",c:"category",category:"category",subtitle:"category",h:"hint",hint:"hint",a:"app-name","app-name":"app-name"};Me.command=function(u,e,h){if(u=ue.escape(u),process.env.DEBUG&&process.env.DEBUG.indexOf("notifier")!==-1)console.info("node-notifier debug info (command):"),console.info("[notifier path]",u),console.info("[notifier options]",e.join(" "));return g.exec(u+" "+e.join(" "),function(r,f,q){if(r)return h(r);h(q,f)})};Me.fileCommand=function(u,e,h){if(process.env.DEBUG&&process.env.DEBUG.indexOf("notifier")!==-1)console.info("node-notifier debug info (fileCommand):"),console.info("[notifier path]",u),console.info("[notifier options]",e.join(" "));return g.execFile(u,e,function(r,f,q){if(r)return h(r,f);h(q,f)})};Me.fileCommandJson=function(u,e,h){if(process.env.DEBUG&&process.env.DEBUG.indexOf("notifier")!==-1)console.info("node-notifier debug info (fileCommandJson):"),console.info("[notifier path]",u),console.info("[notifier options]",e.join(" "));return g.execFile(u,e,function(r,f,q){if(r)return h(r,f);if(!f)return h(r,{});try{let w=JSON.parse(f);h(!q?null:q,w)}catch(w){h(w,f)}})};Me.immediateFileCommand=function(u,e,h){if(process.env.DEBUG&&process.env.DEBUG.indexOf("notifier")!==-1)console.info("node-notifier debug info (notifier):"),console.info("[notifier path]",u);_e(u,function(r,f){if(!f)return h(Error("Notifier ("+u+") not found on system."));g.execFile(u,e),h()})};function _e(u,e){return l.stat(u,function(h,r){if(!h)return e(h,r.isFile());if(he.extname(u))return e(h,!1);return l.stat(u+".exe",function(f,q){if(f)return e(f,!1);e(f,q.isFile())})})}var m=function(u){if(u.appIcon)u.icon=u.appIcon,delete u.appIcon;return u},N=function(u){if(u.text)u.message=u.text,delete u.text;return u},Yu=function(u){if(u.i)u.icon=u.i,delete u.i;return u};Me.mapToNotifySend=function(u){if(u=m(u),u=N(u),u.timeout===!1)delete u.timeout;if(u.wait===!0)u["expire-time"]=5;for(let e in u){if(e==="message"||e==="title")continue;if(u.hasOwnProperty(e)&&Lu[e]!==e)u[Lu[e]]=u[e],delete u[e]}if(typeof u["expire-time"]>"u")u["expire-time"]=1e4;else if(typeof u["expire-time"]==="number")u["expire-time"]=u["expire-time"]*1000;return u};Me.mapToGrowl=function(u){if(u=m(u),u=Yu(u),u=N(u),u.icon&&!Buffer.isBuffer(u.icon))try{u.icon=l.readFileSync(u.icon)}catch(e){}return u};Me.mapToMac=function(u){if(u=Yu(u),u=N(u),u.icon)u.appIcon=u.icon,delete u.icon;if(u.sound===!0)u.sound="Bottle";if(u.sound===!1)delete u.sound;if(u.sound&&u.sound.indexOf("Notification.")===0)u.sound="Bottle";if(u.wait===!0){if(!u.timeout)u.timeout=5;delete u.wait}if(!u.wait&&!u.timeout)if(u.timeout===!1)delete u.timeout;else u.timeout=10;return u.json=!0,u};function i(u){return Object.prototype.toString.call(u)==="[object Array]"}Me.isArray=i;function Ee(){}Me.actionJackerDecorator=function(u,e,h,r){if(e=ju(e),h=h||Ee,typeof h!=="function")throw TypeError("The second argument must be a function callback. You have passed "+typeof h);return function(f,q){let w=q,E={};if(w&&typeof w==="object")E=w,w=w.activationType;if(w){if(w=w.toLowerCase().trim(),w.match(/^activate|clicked$/))w="activate";if(w.match(/^timedout$/))w="timeout"}if(h.apply(u,[f,w,E]),!r||!w)return;let M=r(w);if(!M)return;u.emit(M,u,e,E)}};Me.constructArgumentList=function(u,e){let h=[];e=e||{};let r=e.initial||[],f=e.keyExtra||"",q=e.allowedArguments||[],w=e.noEscape!==void 0,E=e.allowedArguments!==void 0,M=!!e.explicitTrue,O=!!e.keepNewlines,V=e.wrapper===void 0?'"':e.wrapper,F=function U($){if(i($))return Ju($.map(U).join(","));if(!w)$=qe($);if(typeof $==="string"&&!O)$=Ju($);return V+$+V};r.forEach(function(U){h.push(F(U))});for(let U in u)if(u.hasOwnProperty(U)&&(!E||we(q,U)))if(M&&u[U]===!0)h.push("-"+f+U);else if(M&&u[U]===!1)continue;else h.push("-"+f+U,F(u[U]));return h};function Ju(u){let e=process.platform==="win32"?"\\r\\n":"\\n";return u.replace(/\r?\n/g,e)}var ye=["t","m","b","tb","p","id","s","silent","appID","pid","pipeName","close","install"],Ce="Notification.",Uu="Notification.Default";Me.mapToWin8=function(u){if(u=m(u),u=N(u),u.icon){if(/^file:\/+/.test(u.icon))u.p=new fe.URL(u.icon).pathname.replace(/^\/(\w:\/)/,"$1").replace(/\//g,"\\");else u.p=u.icon;delete u.icon}if(u.message)u.m=u.message.replace(/\x1b/g,""),delete u.message;if(u.title)u.t=u.title,delete u.title;if(u.appName)u.appID=u.appName,delete u.appName;if(typeof u.remove<"u")u.close=u.remove,delete u.remove;if(u.quiet||u.silent)u.silent=u.quiet||u.silent,delete u.quiet;if(typeof u.sound<"u")u.s=u.sound,delete u.sound;if(u.s===!1)u.silent=!0,delete u.s;if(u.s&&u.silent)delete u.s;if(u.s===!0)u.s=Uu;if(u.s&&u.s.indexOf(Ce)!==0)u.s=Uu;if(u.actions&&i(u.actions))u.b=u.actions.join(";"),delete u.actions;for(let e in u)if(u.hasOwnProperty(e)&&ye.indexOf(e)===-1)delete u[e];return u};Me.mapToNotifu=function(u){if(u=m(u),u=N(u),u.icon)u.i=u.icon,delete u.icon;if(u.message)u.m=u.message,delete u.message;if(u.title)u.p=u.title,delete u.title;if(u.time)u.d=u.time,delete u.time;if(u.q!==!1)u.q=!0;else delete u.q;if(u.quiet===!1)delete u.q,delete u.quiet;if(u.sound)delete u.q,delete u.sound;if(u.t)u.d=u.t,delete u.t;if(u.type)u.t=Oe(u.type),delete u.type;return u};Me.isMac=function(){return X.type()==="Darwin"};Me.isMountainLion=function(){return X.type()==="Darwin"&&a.satisfies(n(X.release()),">=12.0.0")};Me.isWin8=function(){return X.type()==="Windows_NT"&&a.satisfies(n(X.release()),">=6.2.9200")};Me.isWSL=function(){return ee};Me.isLessThanWin8=function(){return X.type()==="Windows_NT"&&a.satisfies(n(X.release()),"<6.2.9200")};function n(u){if(u.split(".").length===2)u+=".0";return u}function Oe(u){if(typeof u==="string"||u instanceof String){if(u.toLowerCase()==="info")return"info";if(u.toLowerCase()==="warn")return"warn";if(u.toLowerCase()==="error")return"error"}return"info"}Me.createNamedPipe=(u)=>{let e=Buffer.alloc(1024);return new Promise((h)=>{u.instance=re.createServer((r)=>{r.on("data",(f)=>{e.write(f.toString())}),r.on("end",()=>{u.instance.close()})}),u.instance.listen(u.namedPipe,()=>{h(e)})})}});var Hu=L((Bh,Zu)=>{var $u=_("os"),Te=We(),Q=K(),Ku=_("events").EventEmitter,ze=_("util"),v;Zu.exports=A;function A(u){if(u=Q.clone(u||{}),!(this instanceof A))return new A(u);this.options=u,Ku.call(this)}ze.inherits(A,Ku);function Be(){}function ce(u,e){if(u=Q.clone(u||{}),e=e||Be,typeof e!=="function")throw TypeError("The second argument must be a function callback. You have passed "+typeof e);if(typeof u==="string")u={title:"node-notifier",message:u};if(!u.message)return e(Error("Message is required.")),this;if($u.type()!=="Linux"&&!$u.type().match(/BSD$/))return e(Error("Only supported on Linux and *BSD systems")),this;if(v===!1)return e(Error("notify-send must be installed on the system.")),this;if(v||!!this.options.suppressOsdCheck)return Xu(u,e),this;try{v=!!Te.sync("notify-send"),Xu(u,e)}catch(h){return v=!1,e(h)}return this}Object.defineProperty(A.prototype,"notify",{get:function(){if(!this._notify)this._notify=ce.bind(this);return this._notify}});var De=["urgency","expire-time","icon","category","hint","app-name"];function Xu(u,e){u=Q.mapToNotifySend(u),u.title=u.title||"Node Notification:";let h=[u.title,u.message];delete u.title,delete u.message;let r=Q.constructArgumentList(u,{initial:h,keyExtra:"-",allowedArguments:De});Q.command("notify-send",r,e)}});var t=L((ch,Ru)=>{var ge=_("net");Ru.exports=function(u,e){if(typeof e>"u")e=u,u={};let h=u.port||23053,r=u.host||"localhost",f=ge.connect(h,r);f.setTimeout(100),f.once("connect",function(){f.end(),e(null,!0)}),f.once("error",function(){f.end(),e(null,!1)})}});var Nu=L((Dh,Fu)=>{var me=_("net"),ve=_("crypto"),Vu=_("util").format,xe=_("fs"),J=`\r
3
+ `;function Z(u,e){e=e||{},this.type=u,this.host=e.host||"localhost",this.port=e.port||23053,this.request="GNTP/1.0 "+u+" NONE"+J,this.resources=[],this.attempts=0,this.maxAttempts=5}Z.prototype.parseResp=function(u){var e={},h,r;return u=u.slice(0,u.indexOf(J+J)).split(J),h=u[0],r=u.slice(1),e.state=h.match(/-(OK|ERROR|CALLBACK)/)[0].slice(1),r.forEach(function(f){f=f.split(": "),e[f[0]]=f[1]}),e};Z.prototype.retry=function(){var u=this,e=arguments;setTimeout(function(){u.send.apply(u,e)},750)};Z.prototype.addResource=function(u){var e=ve.createHash("md5").update(u).digest("hex"),h="Identifier: "+e+J+"Length: "+u.length+J+J;return this.resources.push({header:h,file:u}),"x-growl-resource://"+e};Z.prototype.add=function(u,e){if(e===void 0)return;if(/-Icon/.test(u)&&!/^https?:\/\//.test(e)){if(/\.(png|gif|jpe?g)$/.test(e))e=this.addResource(xe.readFileSync(e));else if(e instanceof Buffer)e=this.addResource(e)}this.request+=u+": "+e+J};Z.prototype.newline=function(){this.request+=J};Z.prototype.send=function(u){var e=this,h=me.connect(this.port,this.host),r="";u=u||function(){},this.attempts+=1,h.on("connect",function(){h.write(e.request),e.resources.forEach(function(f){h.write(f.header),h.write(f.file),h.write(J+J)})}),h.on("data",function(f){if(r+=f.toString(),r.slice(r.length-4)!==J+J)return;if(r=e.parseResp(r),r.state==="ERROR"||r.state==="CALLBACK")h.end();else r=""}),h.on("end",function(){if(["200","401","402"].indexOf(r["Error-Code"])>=0)if(e.attempts<=e.maxAttempts)e.retry(u);else{var f='GNTP request to "%s:%d" failed with error code %s (%s)';u(Error(Vu(f,e.host,e.port,r["Error-Code"],r["Error-Description"])))}else u(void 0,r)}),h.on("error",function(){u(Error(Vu('Error while sending GNTP request to "%s:%d"',e.host,e.port))),h.destroy()})};Fu.exports=Z});var Su=L((gh,Au)=>{var Qu=Nu();function S(){this.appname="Growly",this.notifications=void 0,this.labels=void 0,this.count=0,this.registered=!1,this.host=void 0,this.port=void 0}S.prototype.getLabels=function(){return this.notifications.map(function(u){return u.label})};S.prototype.setHost=function(u,e){this.host=u,this.port=e};S.prototype.register=function(u,e,h,r){var f;if(typeof e==="object")h=e,e=void 0;if(h===void 0||!h.length)h=[{label:"default",dispname:"Default Notification",enabled:!0}];if(typeof arguments[arguments.length-1]==="function")r=arguments[arguments.length-1];else r=function(){};this.appname=u,this.notifications=h,this.labels=this.getLabels(),this.registered=!0,f=new Qu("REGISTER",{host:this.host,port:this.port}),f.add("Application-Name",u),f.add("Application-Icon",e),f.add("Notifications-Count",h.length),f.newline(),h.forEach(function(q){if(q.enabled===void 0)q.enabled=!0;f.add("Notification-Name",q.label),f.add("Notification-Display-Name",q.dispname),f.add("Notification-Enabled",q.enabled?"True":"False"),f.add("Notification-Icon",q.icon),f.newline()}),f.send(r)};S.prototype.notify=function(u,e,h){var r=this,f;if(!this.registered){this.register(this.appname,function(q){if(q)console.log(q);r.notify.call(r,u,e,h)});return}if(e=e||{},typeof e==="function")h=e,e={};f=new Qu("NOTIFY",{host:this.host,port:this.port}),f.add("Application-Name",this.appname),f.add("Notification-Name",e.label||this.labels[0]),f.add("Notification-ID",++this.count),f.add("Notification-Title",e.title),f.add("Notification-Text",u),f.add("Notification-Sticky",e.sticky?"True":"False"),f.add("Notification-Priority",e.priority),f.add("Notification-Icon",e.icon),f.add("Notification-Coalescing-ID",e.coalescingId||void 0),f.add("Notification-Callback-Context",h?"context":void 0),f.add("Notification-Callback-Context-Type",h?"string":void 0),f.add("Notification-Callback-Target",void 0),f.newline(),f.send(function(q,w){if(h&&q)h(q);else if(h&&w.state==="CALLBACK")h(void 0,w["Notification-Callback-Result"].toLowerCase())})};Au.exports=new S});var P=L((mh,Wu)=>{var Pe=t(),x=K(),G=Su(),Iu=_("events").EventEmitter,de=_("util");Wu.exports=I;var Gu;function I(u){if(u=x.clone(u||{}),!(this instanceof I))return new I(u);G.appname=u.name||"Node",this.options=u,Iu.call(this)}de.inherits(I,Iu);function ke(u,e){if(G.setHost(this.options.host,this.options.port),u=x.clone(u||{}),typeof u==="string")u={title:"node-notifier",message:u};if(e=x.actionJackerDecorator(this,u,e,function(h){if(h==="click")return"click";if(h==="timedout")return"timeout";return!1}),u=x.mapToGrowl(u),!u.message)return e(Error("Message is required.")),this;if(u.title=u.title||"Node Notification:",Gu||!!u.wait){let h=u.wait?e:be;if(G.notify(u.message,u,h),!u.wait)e();return this}return Pe(G,function(h,r){if(Gu=r,!r)return e(Error("Couldn't connect to growl (might be used as a fallback). Make sure it is running"));G.notify(u.message,u),e()}),this}Object.defineProperty(I.prototype,"notify",{get:function(){if(!this._notify)this._notify=ke.bind(this);return this._notify}});function be(){}});var cu=L((vh,Bu)=>{var __dirname="/Users/konghayao/code/ai/code-graph/node_modules/.bun/node-notifier@10.0.1/node_modules/node-notifier/notifiers",H=K(),le=P(),ae=_("path"),ie=ae.join(__dirname,"../vendor/mac.noindex/terminal-notifier.app/Contents/MacOS/terminal-notifier"),zu=_("events").EventEmitter,ne=_("util"),te="You need Mac OS X 10.8 or above to use NotificationCenter, or use Growl fallback with constructor option {withFallback: true}.";Bu.exports=W;function W(u){if(u=H.clone(u||{}),!(this instanceof W))return new W(u);this.options=u,zu.call(this)}ne.inherits(W,zu);var Tu=null;function se(){}function pe(u,e){let h,r=oe();if(u=H.clone(u||{}),Tu=r,typeof u==="string")u={title:"node-notifier",message:u};if(e=e||se,typeof e!=="function")throw TypeError("The second argument must be a function callback. You have passed "+typeof fn);let f=H.actionJackerDecorator(this,u,e,function(w){if(Tu!==r)return!1;if(w==="activate")return"click";if(w==="timeout")return"timeout";if(w==="replied")return"replied";return!1});if(u=H.mapToMac(u),!u.message&&!u.group&&!u.list&&!u.remove)return e(Error("Message, group, remove or list property is required.")),this;let q=H.constructArgumentList(u);if(H.isMountainLion())return H.fileCommandJson(this.options.customPath||ie,q,f),this;if(h||!!this.options.withFallback)return h=h||new le(this.options),h.notify(u,e);return e(Error(te)),this}Object.defineProperty(W.prototype,"notify",{get:function(){if(!this._notify)this._notify=pe.bind(this);return this._notify}});function oe(){return{_ref:"val"}}});var s=L((xh,vu)=>{var __dirname="/Users/konghayao/code/ai/code-graph/node_modules/.bun/node-notifier@10.0.1/node_modules/node-notifier/notifiers",uh=_("path"),eh=uh.resolve(__dirname,"../vendor/notifu/notifu"),hh=t(),Y=K(),fh=p(),Du=P(),rh=_("os"),mu=_("events").EventEmitter,qh=_("util"),d;vu.exports=T;function T(u){if(u=Y.clone(u||{}),!(this instanceof T))return new T(u);this.options=u,mu.call(this)}qh.inherits(T,mu);function wh(){}function _h(u,e){let h,r=this.options;if(u=Y.clone(u||{}),e=e||wh,typeof u==="string")u={title:"node-notifier",message:u};let f=Y.actionJackerDecorator(this,u,e,function(q){if(q==="activate")return"click";if(q==="timeout")return"timeout";return!1});if(!!this.options.withFallback&&Y.isWin8())return h=h||new fh(r),h.notify(u,e);if(!!this.options.withFallback&&(!Y.isLessThanWin8()||d===!0))return h=h||new Du(r),h.notify(u,e);if(!this.options.withFallback||d===!1)return gu(u,r,f),this;return hh(r,function(q,w){if(d=w,d)return h=h||new Du(r),h.notify(u,e);gu(u,r,f)}),this}Object.defineProperty(T.prototype,"notify",{get:function(){if(!this._notify)this._notify=_h.bind(this);return this._notify}});var Eh=["t","d","p","m","i","e","q","w","xp"];function gu(u,e,h){let r=rh.arch()==="x64";u=u||{},u=Y.mapToNotifu(u),u.p=u.p||"Node Notification:";let f=eh+(r?"64":"")+".exe",q=e.customPath||f;if(!u.m)return h(Error("Message is required.")),this;let w=Y.constructArgumentList(u,{wrapper:"",noEscape:!0,explicitTrue:!0,allowedArguments:Eh});if(u.wait)return Y.fileCommand(q,w,function(E,M){let O=yh(E.code);if(O==="error")return h(E,M);return h(null,O)});Y.immediateFileCommand(q,w,h)}function yh(u){switch(u){case 2:return"timeout";case 3:case 6:case 7:return"activate";case 4:return"close";default:return"error"}}});var p=L((Ph,Pu)=>{var __dirname="/Users/konghayao/code/ai/code-graph/node_modules/.bun/node-notifier@10.0.1/node_modules/node-notifier/notifiers",Lh=_("path"),Jh=Lh.resolve(__dirname,"../vendor/snoreToast/snoretoast"),j=K(),Uh=s(),jh=_("os"),{v4:Yh}=(Mh(),Ch(Oh)),xu=_("events").EventEmitter,$h=_("util"),o;Pu.exports=z;function z(u){if(u=j.clone(u||{}),!(this instanceof z))return new z(u);this.options=u,xu.call(this)}$h.inherits(z,xu);function Xh(){}function Kh(u){if(!u)return{};return u.split(";").reduce((e,h)=>{let r=h.split("=");if(r&&r.length===2)e[r[0]]=r[1];return e},{})}function Zh(){return`${j.isWSL()?"/tmp/":"\\\\.\\pipe\\"}notifierPipe-${Yh()}`}function Hh(u,e){u=j.clone(u||{}),e=e||Xh;let h=jh.arch()==="x64",r,f={namedPipe:Zh()};if(typeof u==="string")u={title:"node-notifier",message:u};if(typeof e!=="function")throw TypeError("The second argument must be a function callback. You have passed "+typeof fn);let q=(E,M)=>{let O=Kh(r&&r.toString("utf16le"));if(O.action==="buttonClicked"&&O.button)O.activationType=O.button;else if(O.action)O.activationType=O.action;if(E&&E.code===-1)M(E,O);M(null,O),f.instance&&f.instance.close()},w=(E)=>q(E,j.actionJackerDecorator(this,u,e,(M)=>M==="activate"?"click":M||!1));if(u.title=u.title||"Node Notification:",typeof u.message>"u"&&typeof u.close>"u")return e(Error("Message or ID to close is required.")),this;if(!j.isWin8()&&!j.isWSL()&&!!this.options.withFallback)return o=o||new Uh(this.options),o.notify(u,e);return j.createNamedPipe(f).then((E)=>{r=E,u.pipeName=f.namedPipe;let M=u.customPath||this.options.customPath||Jh+"-x"+(h?"64":"86")+".exe";u=j.mapToWin8(u);let O=j.constructArgumentList(u,{explicitTrue:!0,wrapper:"",keepNewlines:!0,noEscape:!0});j.fileCommand(M,O,w)}),this}Object.defineProperty(z.prototype,"notify",{get:function(){if(!this._notify)this._notify=Hh.bind(this);return this._notify}})});var bu=L((dh,C)=>{var du=_("os"),ku=K(),B=Hu(),uu=cu(),c=p(),eu=P(),hu=s(),R={withFallback:!0},Rh=ku.isWSL()?"WSL":du.type();switch(Rh){case"Linux":C.exports=new B(R),C.exports.Notification=B;break;case"Darwin":C.exports=new uu(R),C.exports.Notification=uu;break;case"Windows_NT":if(ku.isLessThanWin8())C.exports=new hu(R),C.exports.Notification=hu;else C.exports=new c(R),C.exports.Notification=c;break;case"WSL":C.exports=new c(R),C.exports.Notification=c;break;default:if(du.type().match(/BSD$/))C.exports=new B(R),C.exports.Notification=B;else C.exports=new eu(R),C.exports.Notification=eu}C.exports.NotifySend=B;C.exports.NotificationCenter=uu;C.exports.WindowsToaster=c;C.exports.WindowsBalloon=hu;C.exports.Growl=eu});import ru from"node:path";import lu from"node:os";import D from"node:fs";function au(u){let e=u.replace(/^~/,lu.homedir()),h=ru.resolve(e),r=ru.dirname(h);if(!D.existsSync(r))D.mkdirSync(r,{recursive:!0});return h}function iu(u,e){if(!D.existsSync(u)){process.env.DATABASE_INIT="true";return}let h=process.env.SQLITE_MAX_SIZE_MB?parseInt(process.env.SQLITE_MAX_SIZE_MB,10)*1024*1024:void 0,r=e??h??314572800,q=D.statSync(u).size,w=q/1048576;if(q>r){let E=r/1048576;console.trace(`⚠️ Database file is large: ${w.toFixed(2)}MB (limit: ${E.toFixed(2)}MB)`),console.trace(` Path: ${u}`),console.trace(" Set SQLITE_MAX_SIZE_MB to adjust limit")}}function Ah(u){let e=au(u);return process.env.SQLITE_DATABASE_URI=e,iu(e),e}var fu=Vh(bu(),1);function kh(u){if(typeof u==="string")fu.default.notify({title:"Notification",message:u});else fu.default.notify({title:u.title||"Notification",message:u.message,icon:u.icon,sound:u.sound??!0})}var lh={path:process.cwd()};export{Ah as ve,kh as we,lh as xe};
@@ -1,4 +1,4 @@
1
- import{ri as h}from"./chunk-cbjnwrt7.js";import{pq as yw,qq as d,tq as t}from"./chunk-dcs1r9as.js";var G0=d((n1)=>{n1.isInteger=($)=>{if(typeof $==="number")return Number.isInteger($);if(typeof $==="string"&&$.trim()!=="")return Number.isInteger(Number($));return!1};n1.find=($,w)=>$.nodes.find((q)=>q.type===w);n1.exceedsLimit=($,w,q=1,J)=>{if(J===!1)return!1;if(!n1.isInteger($)||!n1.isInteger(w))return!1;return(Number(w)-Number($))/Number(q)>=J};n1.escapeNode=($,w=0,q)=>{let J=$.nodes[w];if(!J)return;if(q&&J.type===q||J.type==="open"||J.type==="close"){if(J.escaped!==!0)J.value="\\"+J.value,J.escaped=!0}};n1.encloseBrace=($)=>{if($.type!=="brace")return!1;if($.commas>>0+$.ranges>>0===0)return $.invalid=!0,!0;return!1};n1.isInvalidBrace=($)=>{if($.type!=="brace")return!1;if($.invalid===!0||$.dollar)return!0;if($.commas>>0+$.ranges>>0===0)return $.invalid=!0,!0;if($.open!==!0||$.close!==!0)return $.invalid=!0,!0;return!1};n1.isOpenOrClose=($)=>{if($.type==="open"||$.type==="close")return!0;return $.open===!0||$.close===!0};n1.reduce=($)=>$.reduce((w,q)=>{if(q.type==="text")w.push(q.value);if(q.type==="range")q.type="text";return w},[]);n1.flatten=(...$)=>{let w=[],q=(J)=>{for(let f=0;f<J.length;f++){let Z=J[f];if(Array.isArray(Z)){q(Z);continue}if(Z!==void 0)w.push(Z)}return w};return q($),w}});var M0=d((jw,v0)=>{var d0=G0();v0.exports=($,w={})=>{let q=(J,f={})=>{let Z=w.escapeInvalid&&d0.isInvalidBrace(f),V=J.invalid===!0&&w.escapeInvalid===!0,F="";if(J.value){if((Z||V)&&d0.isOpenOrClose(J))return"\\"+J.value;return J.value}if(J.value)return J.value;if(J.nodes)for(let N of J.nodes)F+=q(N);return F};return q($)}});var l0=d((zw,m0)=>{/*!
1
+ import{vl as h}from"./chunk-vd8kwzra.js";import{Fl as yw,Hl as d,Kl as t}from"./chunk-z3e4c424.js";var G0=d((n1)=>{n1.isInteger=($)=>{if(typeof $==="number")return Number.isInteger($);if(typeof $==="string"&&$.trim()!=="")return Number.isInteger(Number($));return!1};n1.find=($,w)=>$.nodes.find((q)=>q.type===w);n1.exceedsLimit=($,w,q=1,J)=>{if(J===!1)return!1;if(!n1.isInteger($)||!n1.isInteger(w))return!1;return(Number(w)-Number($))/Number(q)>=J};n1.escapeNode=($,w=0,q)=>{let J=$.nodes[w];if(!J)return;if(q&&J.type===q||J.type==="open"||J.type==="close"){if(J.escaped!==!0)J.value="\\"+J.value,J.escaped=!0}};n1.encloseBrace=($)=>{if($.type!=="brace")return!1;if($.commas>>0+$.ranges>>0===0)return $.invalid=!0,!0;return!1};n1.isInvalidBrace=($)=>{if($.type!=="brace")return!1;if($.invalid===!0||$.dollar)return!0;if($.commas>>0+$.ranges>>0===0)return $.invalid=!0,!0;if($.open!==!0||$.close!==!0)return $.invalid=!0,!0;return!1};n1.isOpenOrClose=($)=>{if($.type==="open"||$.type==="close")return!0;return $.open===!0||$.close===!0};n1.reduce=($)=>$.reduce((w,q)=>{if(q.type==="text")w.push(q.value);if(q.type==="range")q.type="text";return w},[]);n1.flatten=(...$)=>{let w=[],q=(J)=>{for(let f=0;f<J.length;f++){let Z=J[f];if(Array.isArray(Z)){q(Z);continue}if(Z!==void 0)w.push(Z)}return w};return q($),w}});var M0=d((jw,v0)=>{var d0=G0();v0.exports=($,w={})=>{let q=(J,f={})=>{let Z=w.escapeInvalid&&d0.isInvalidBrace(f),V=J.invalid===!0&&w.escapeInvalid===!0,F="";if(J.value){if((Z||V)&&d0.isOpenOrClose(J))return"\\"+J.value;return J.value}if(J.value)return J.value;if(J.nodes)for(let N of J.nodes)F+=q(N);return F};return q($)}});var l0=d((zw,m0)=>{/*!
2
2
  * is-number <https://github.com/jonschlinkert/is-number>
3
3
  *
4
4
  * Copyright (c) 2014-present, Jon Schlinkert.
@@ -14,5 +14,5 @@ import{ri as h}from"./chunk-cbjnwrt7.js";import{pq as yw,qq as d,tq as t}from"./
14
14
  * Copyright (c) 2014-present, Jon Schlinkert.
15
15
  * Licensed under the MIT License.
16
16
  */var F$=t("util"),t0=e0(),o0=($)=>$!==null&&typeof $==="object"&&!Array.isArray($),U$=($)=>{return(w)=>$===!0?Number(w):String(w)},L0=($)=>{return typeof $==="number"||typeof $==="string"&&$!==""},Y0=($)=>Number.isInteger(+$),O0=($)=>{let w=`${$}`,q=-1;if(w[0]==="-")w=w.slice(1);if(w==="0")return!1;while(w[++q]==="0");return q>0},X$=($,w,q)=>{if(typeof $==="string"||typeof w==="string")return!0;return q.stringify===!0},Q$=($,w,q)=>{if(w>0){let J=$[0]==="-"?"-":"";if(J)$=$.slice(1);$=J+$.padStart(J?w-1:w,"0")}if(q===!1)return String($);return $},K0=($,w)=>{let q=$[0]==="-"?"-":"";if(q)$=$.slice(1),w--;while($.length<w)$="0"+$;return q?"-"+$:$},B$=($,w,q)=>{$.negatives.sort((F,N)=>F<N?-1:F>N?1:0),$.positives.sort((F,N)=>F<N?-1:F>N?1:0);let J=w.capture?"":"?:",f="",Z="",V;if($.positives.length)f=$.positives.map((F)=>K0(String(F),q)).join("|");if($.negatives.length)Z=`-(${J}${$.negatives.map((F)=>K0(String(F),q)).join("|")})`;if(f&&Z)V=`${f}|${Z}`;else V=f||Z;if(w.wrap)return`(${J}${V})`;return V},$1=($,w,q,J)=>{if(q)return t0($,w,{wrap:!1,...J});let f=String.fromCharCode($);if($===w)return f;let Z=String.fromCharCode(w);return`[${f}-${Z}]`},w1=($,w,q)=>{if(Array.isArray($)){let J=q.wrap===!0,f=q.capture?"":"?:";return J?`(${f}${$.join("|")})`:$.join("|")}return t0($,w,q)},q1=(...$)=>{return RangeError("Invalid range arguments: "+F$.inspect(...$))},J1=($,w,q)=>{if(q.strictRanges===!0)throw q1([$,w]);return[]},N$=($,w)=>{if(w.strictRanges===!0)throw TypeError(`Expected step "${$}" to be a number`);return[]},G$=($,w,q=1,J={})=>{let f=Number($),Z=Number(w);if(!Number.isInteger(f)||!Number.isInteger(Z)){if(J.strictRanges===!0)throw q1([$,w]);return[]}if(f===0)f=0;if(Z===0)Z=0;let V=f>Z,F=String($),N=String(w),K=String(q);q=Math.max(Math.abs(q),1);let B=O0(F)||O0(N)||O0(K),j=B?Math.max(F.length,N.length,K.length):0,X=B===!1&&X$($,w,J)===!1,H=J.transform||U$(X);if(J.toRegex&&q===1)return $1(K0($,j),K0(w,j),!0,J);let y={negatives:[],positives:[]},M=(u)=>y[u<0?"negatives":"positives"].push(Math.abs(u)),L=[],A=0;while(V?f>=Z:f<=Z){if(J.toRegex===!0&&q>1)M(f);else L.push(Q$(H(f,A),j,X));f=V?f-q:f+q,A++}if(J.toRegex===!0)return q>1?B$(y,J,j):w1(L,null,{wrap:!1,...J});return L},M$=($,w,q=1,J={})=>{if(!Y0($)&&$.length>1||!Y0(w)&&w.length>1)return J1($,w,J);let f=J.transform||((X)=>String.fromCharCode(X)),Z=`${$}`.charCodeAt(0),V=`${w}`.charCodeAt(0),F=Z>V,N=Math.min(Z,V),K=Math.max(Z,V);if(J.toRegex&&q===1)return $1(N,K,!1,J);let B=[],j=0;while(F?Z>=V:Z<=V)B.push(f(Z,j)),Z=F?Z-q:Z+q,j++;if(J.toRegex===!0)return w1(B,null,{wrap:!1,options:J});return B},y0=($,w,q,J={})=>{if(w==null&&L0($))return[$];if(!L0($)||!L0(w))return J1($,w,J);if(typeof q==="function")return y0($,w,1,{transform:q});if(o0(q))return y0($,w,0,q);let f={...J};if(f.capture===!0)f.wrap=!0;if(q=q||f.step||1,!Y0(q)){if(q!=null&&!o0(q))return N$(q,f);return y0($,w,1,q)}if(Y0($)&&Y0(w))return G$($,w,q,f);return M$($,w,Math.max(Math.abs(q),1),f)};f1.exports=y0});var Y1=d((Dw,Z1)=>{var y$=E0(),V1=G0(),K$=($,w={})=>{let q=(J,f={})=>{let Z=V1.isInvalidBrace(f),V=J.invalid===!0&&w.escapeInvalid===!0,F=Z===!0||V===!0,N=w.escapeInvalid===!0?"\\":"",K="";if(J.isOpen===!0)return N+J.value;if(J.isClose===!0)return console.log("node.isClose",N,J.value),N+J.value;if(J.type==="open")return F?N+J.value:"(";if(J.type==="close")return F?N+J.value:")";if(J.type==="comma")return J.prev.type==="comma"?"":F?J.value:"|";if(J.value)return J.value;if(J.nodes&&J.ranges>0){let B=V1.reduce(J.nodes),j=y$(...B,{...w,wrap:!1,toRegex:!0,strictZeros:!0});if(j.length!==0)return B.length>1&&j.length>1?`(${j})`:j}if(J.nodes)for(let B of J.nodes)K+=q(B,J);return K};return q($)};Z1.exports=K$});var U1=d((Hw,F1)=>{var j$=E0(),W1=M0(),V0=G0(),J0=($="",w="",q=!1)=>{let J=[];if($=[].concat($),w=[].concat(w),!w.length)return $;if(!$.length)return q?V0.flatten(w).map((f)=>`{${f}}`):w;for(let f of $)if(Array.isArray(f))for(let Z of f)J.push(J0(Z,w,q));else for(let Z of w){if(q===!0&&typeof Z==="string")Z=`{${Z}}`;J.push(Array.isArray(Z)?J0(f,Z,q):f+Z)}return V0.flatten(J)},z$=($,w={})=>{let q=w.rangeLimit===void 0?1000:w.rangeLimit,J=(f,Z={})=>{f.queue=[];let V=Z,F=Z.queue;while(V.type!=="brace"&&V.type!=="root"&&V.parent)V=V.parent,F=V.queue;if(f.invalid||f.dollar){F.push(J0(F.pop(),W1(f,w)));return}if(f.type==="brace"&&f.invalid!==!0&&f.nodes.length===2){F.push(J0(F.pop(),["{}"]));return}if(f.nodes&&f.ranges>0){let j=V0.reduce(f.nodes);if(V0.exceedsLimit(...j,w.step,q))throw RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let X=j$(...j,w);if(X.length===0)X=W1(f,w);F.push(J0(F.pop(),X)),f.nodes=[];return}let N=V0.encloseBrace(f),K=f.queue,B=f;while(B.type!=="brace"&&B.type!=="root"&&B.parent)B=B.parent,K=B.queue;for(let j=0;j<f.nodes.length;j++){let X=f.nodes[j];if(X.type==="comma"&&f.type==="brace"){if(j===1)K.push("");K.push("");continue}if(X.type==="close"){F.push(J0(F.pop(),K,N));continue}if(X.value&&X.type!=="open"){K.push(J0(K.pop(),X.value));continue}if(X.nodes)J(X,f)}return K};return V0.flatten(J($))};F1.exports=z$});var Q1=d((Pw,X1)=>{X1.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
17
- `,CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var y1=d((Lw,M1)=>{var I$=M0(),{MAX_LENGTH:B1,CHAR_BACKSLASH:R0,CHAR_BACKTICK:C$,CHAR_COMMA:D$,CHAR_DOT:H$,CHAR_LEFT_PARENTHESES:P$,CHAR_RIGHT_PARENTHESES:L$,CHAR_LEFT_CURLY_BRACE:O$,CHAR_RIGHT_CURLY_BRACE:E$,CHAR_LEFT_SQUARE_BRACKET:N1,CHAR_RIGHT_SQUARE_BRACKET:G1,CHAR_DOUBLE_QUOTE:R$,CHAR_SINGLE_QUOTE:_$,CHAR_NO_BREAK_SPACE:T$,CHAR_ZERO_WIDTH_NOBREAK_SPACE:A$}=Q1(),S$=($,w={})=>{if(typeof $!=="string")throw TypeError("Expected a string");let q=w||{},J=typeof q.maxLength==="number"?Math.min(B1,q.maxLength):B1;if($.length>J)throw SyntaxError(`Input length (${$.length}), exceeds max characters (${J})`);let f={type:"root",input:$,nodes:[]},Z=[f],V=f,F=f,N=0,K=$.length,B=0,j=0,X,H=()=>$[B++],y=(M)=>{if(M.type==="text"&&F.type==="dot")F.type="text";if(F&&F.type==="text"&&M.type==="text"){F.value+=M.value;return}return V.nodes.push(M),M.parent=V,M.prev=F,F=M,M};y({type:"bos"});while(B<K){if(V=Z[Z.length-1],X=H(),X===A$||X===T$)continue;if(X===R0){y({type:"text",value:(w.keepEscaping?X:"")+H()});continue}if(X===G1){y({type:"text",value:"\\"+X});continue}if(X===N1){N++;let M;while(B<K&&(M=H())){if(X+=M,M===N1){N++;continue}if(M===R0){X+=H();continue}if(M===G1){if(N--,N===0)break}}y({type:"text",value:X});continue}if(X===P$){V=y({type:"paren",nodes:[]}),Z.push(V),y({type:"text",value:X});continue}if(X===L$){if(V.type!=="paren"){y({type:"text",value:X});continue}V=Z.pop(),y({type:"text",value:X}),V=Z[Z.length-1];continue}if(X===R$||X===_$||X===C$){let M=X,L;if(w.keepQuotes!==!0)X="";while(B<K&&(L=H())){if(L===R0){X+=L+H();continue}if(L===M){if(w.keepQuotes===!0)X+=L;break}X+=L}y({type:"text",value:X});continue}if(X===O$){j++;let L={type:"brace",open:!0,close:!1,dollar:F.value&&F.value.slice(-1)==="$"||V.dollar===!0,depth:j,commas:0,ranges:0,nodes:[]};V=y(L),Z.push(V),y({type:"open",value:X});continue}if(X===E$){if(V.type!=="brace"){y({type:"text",value:X});continue}let M="close";V=Z.pop(),V.close=!0,y({type:M,value:X}),j--,V=Z[Z.length-1];continue}if(X===D$&&j>0){if(V.ranges>0){V.ranges=0;let M=V.nodes.shift();V.nodes=[M,{type:"text",value:I$(V)}]}y({type:"comma",value:X}),V.commas++;continue}if(X===H$&&j>0&&V.commas===0){let M=V.nodes;if(j===0||M.length===0){y({type:"text",value:X});continue}if(F.type==="dot"){if(V.range=[],F.value+=X,F.type="range",V.nodes.length!==3&&V.nodes.length!==5){V.invalid=!0,V.ranges=0,F.type="text";continue}V.ranges++,V.args=[];continue}if(F.type==="range"){M.pop();let L=M[M.length-1];L.value+=F.value+X,F=L,V.ranges--;continue}y({type:"dot",value:X});continue}y({type:"text",value:X})}do if(V=Z.pop(),V.type!=="root"){V.nodes.forEach((A)=>{if(!A.nodes){if(A.type==="open")A.isOpen=!0;if(A.type==="close")A.isClose=!0;if(!A.nodes)A.type="text";A.invalid=!0}});let M=Z[Z.length-1],L=M.nodes.indexOf(V);M.nodes.splice(L,1,...V.nodes)}while(Z.length>0);return y({type:"eos"}),f};M1.exports=S$});var z1=d((Ow,j1)=>{var K1=M0(),x$=Y1(),g$=U1(),h$=y1(),r=($,w={})=>{let q=[];if(Array.isArray($))for(let J of $){let f=r.create(J,w);if(Array.isArray(f))q.push(...f);else q.push(f)}else q=[].concat(r.create($,w));if(w&&w.expand===!0&&w.nodupes===!0)q=[...new Set(q)];return q};r.parse=($,w={})=>h$($,w);r.stringify=($,w={})=>{if(typeof $==="string")return K1(r.parse($,w),w);return K1($,w)};r.compile=($,w={})=>{if(typeof $==="string")$=r.parse($,w);return x$($,w)};r.expand=($,w={})=>{if(typeof $==="string")$=r.parse($,w);let q=g$($,w);if(w.noempty===!0)q=q.filter(Boolean);if(w.nodupes===!0)q=[...new Set(q)];return q};r.create=($,w={})=>{if($===""||$.length<3)return[$];return w.expand!==!0?r.compile($,w):r.expand($,w)};j1.exports=r});var W0=d((Ew,C1)=>{var k$=t("path"),I1={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:"[^/]",END_ANCHOR:"(?:\\/|$)",DOTS_SLASH:"\\.{1,2}(?:\\/|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|\\/)\\.{1,2}(?:\\/|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:\\/|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:\\/|$))",QMARK_NO_DOT:"[^.\\/]",STAR:"[^/]*?",START_ANCHOR:"(?:^|\\/)"},b$={...I1,SLASH_LITERAL:"[\\\\/]",QMARK:"[^\\\\/]",STAR:"[^\\\\/]*?",DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)"},d$={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};C1.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:d$,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:k$.sep,extglobChars($){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${$.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars($){return $===!0?b$:I1}}});var F0=d((i$)=>{var v$=t("path"),m$=process.platform==="win32",{REGEX_BACKSLASH:l$,REGEX_REMOVE_BACKSLASH:u$,REGEX_SPECIAL_CHARS:c$,REGEX_SPECIAL_CHARS_GLOBAL:r$}=W0();i$.isObject=($)=>$!==null&&typeof $==="object"&&!Array.isArray($);i$.hasRegexChars=($)=>c$.test($);i$.isRegexChar=($)=>$.length===1&&i$.hasRegexChars($);i$.escapeRegex=($)=>$.replace(r$,"\\$1");i$.toPosixSlashes=($)=>$.replace(l$,"/");i$.removeBackslashes=($)=>{return $.replace(u$,(w)=>{return w==="\\"?"":w})};i$.supportsLookbehinds=()=>{let $=process.version.slice(1).split(".").map(Number);if($.length===3&&$[0]>=9||$[0]===8&&$[1]>=10)return!0;return!1};i$.isWindows=($)=>{if($&&typeof $.windows==="boolean")return $.windows;return m$===!0||v$.sep==="\\"};i$.escapeLast=($,w,q)=>{let J=$.lastIndexOf(w,q);if(J===-1)return $;if($[J-1]==="\\")return i$.escapeLast($,w,J-1);return`${$.slice(0,J)}\\${$.slice(J)}`};i$.removePrefix=($,w={})=>{let q=$;if(q.startsWith("./"))q=q.slice(2),w.prefix="./";return q};i$.wrapOutput=($,w={},q={})=>{let J=q.contains?"":"^",f=q.contains?"":"$",Z=`${J}(?:${$})${f}`;if(w.negated===!0)Z=`(?:^(?!${Z}).*$)`;return Z}});var A1=d((_w,T1)=>{var P1=F0(),{CHAR_ASTERISK:_0,CHAR_AT:qw,CHAR_BACKWARD_SLASH:U0,CHAR_COMMA:Jw,CHAR_DOT:T0,CHAR_EXCLAMATION_MARK:A0,CHAR_FORWARD_SLASH:_1,CHAR_LEFT_CURLY_BRACE:S0,CHAR_LEFT_PARENTHESES:x0,CHAR_LEFT_SQUARE_BRACKET:fw,CHAR_PLUS:Vw,CHAR_QUESTION_MARK:L1,CHAR_RIGHT_CURLY_BRACE:Zw,CHAR_RIGHT_PARENTHESES:O1,CHAR_RIGHT_SQUARE_BRACKET:Yw}=W0(),E1=($)=>{return $===_1||$===U0},R1=($)=>{if($.isPrefix!==!0)$.depth=$.isGlobstar?1/0:1},Ww=($,w)=>{let q=w||{},J=$.length-1,f=q.parts===!0||q.scanToEnd===!0,Z=[],V=[],F=[],N=$,K=-1,B=0,j=0,X=!1,H=!1,y=!1,M=!1,L=!1,A=!1,u=!1,S=!1,n=!1,b=!1,e=0,v,z,P={value:"",depth:0,isGlob:!1},k=()=>K>=J,U=()=>N.charCodeAt(K+1),_=()=>{return v=z,N.charCodeAt(++K)};while(K<J){z=_();let m;if(z===U0){if(u=P.backslashes=!0,z=_(),z===S0)A=!0;continue}if(A===!0||z===S0){e++;while(k()!==!0&&(z=_())){if(z===U0){u=P.backslashes=!0,_();continue}if(z===S0){e++;continue}if(A!==!0&&z===T0&&(z=_())===T0){if(X=P.isBrace=!0,y=P.isGlob=!0,b=!0,f===!0)continue;break}if(A!==!0&&z===Jw){if(X=P.isBrace=!0,y=P.isGlob=!0,b=!0,f===!0)continue;break}if(z===Zw){if(e--,e===0){A=!1,X=P.isBrace=!0,b=!0;break}}}if(f===!0)continue;break}if(z===_1){if(Z.push(K),V.push(P),P={value:"",depth:0,isGlob:!1},b===!0)continue;if(v===T0&&K===B+1){B+=2;continue}j=K+1;continue}if(q.noext!==!0){if((z===Vw||z===qw||z===_0||z===L1||z===A0)===!0&&U()===x0){if(y=P.isGlob=!0,M=P.isExtglob=!0,b=!0,z===A0&&K===B)n=!0;if(f===!0){while(k()!==!0&&(z=_())){if(z===U0){u=P.backslashes=!0,z=_();continue}if(z===O1){y=P.isGlob=!0,b=!0;break}}continue}break}}if(z===_0){if(v===_0)L=P.isGlobstar=!0;if(y=P.isGlob=!0,b=!0,f===!0)continue;break}if(z===L1){if(y=P.isGlob=!0,b=!0,f===!0)continue;break}if(z===fw){while(k()!==!0&&(m=_())){if(m===U0){u=P.backslashes=!0,_();continue}if(m===Yw){H=P.isBracket=!0,y=P.isGlob=!0,b=!0;break}}if(f===!0)continue;break}if(q.nonegate!==!0&&z===A0&&K===B){S=P.negated=!0,B++;continue}if(q.noparen!==!0&&z===x0){if(y=P.isGlob=!0,f===!0){while(k()!==!0&&(z=_())){if(z===x0){u=P.backslashes=!0,z=_();continue}if(z===O1){b=!0;break}}continue}break}if(y===!0){if(b=!0,f===!0)continue;break}}if(q.noext===!0)M=!1,y=!1;let O=N,o="",Y="";if(B>0)o=N.slice(0,B),N=N.slice(B),j-=B;if(O&&y===!0&&j>0)O=N.slice(0,j),Y=N.slice(j);else if(y===!0)O="",Y=N;else O=N;if(O&&O!==""&&O!=="/"&&O!==N){if(E1(O.charCodeAt(O.length-1)))O=O.slice(0,-1)}if(q.unescape===!0){if(Y)Y=P1.removeBackslashes(Y);if(O&&u===!0)O=P1.removeBackslashes(O)}let W={prefix:o,input:$,start:B,base:O,glob:Y,isBrace:X,isBracket:H,isGlob:y,isExtglob:M,isGlobstar:L,negated:S,negatedExtglob:n};if(q.tokens===!0){if(W.maxDepth=0,!E1(z))V.push(P);W.tokens=V}if(q.parts===!0||q.tokens===!0){let m;for(let D=0;D<Z.length;D++){let p=m?m+1:B,a=Z[D],c=$.slice(p,a);if(q.tokens){if(D===0&&B!==0)V[D].isPrefix=!0,V[D].value=o;else V[D].value=c;R1(V[D]),W.maxDepth+=V[D].depth}if(D!==0||c!=="")F.push(c);m=a}if(m&&m+1<$.length){let D=$.slice(m+1);if(F.push(D),q.tokens)V[V.length-1].value=D,R1(V[V.length-1]),W.maxDepth+=V[V.length-1].depth}W.slashes=Z,W.parts=F}return W};T1.exports=Ww});var g1=d((Tw,x1)=>{var j0=W0(),i=F0(),{MAX_LENGTH:z0,POSIX_REGEX_SOURCE:Fw,REGEX_NON_SPECIAL_CHARS:Uw,REGEX_SPECIAL_CHARS_BACKREF:Xw,REPLACEMENTS:S1}=j0,Qw=($,w)=>{if(typeof w.expandRange==="function")return w.expandRange(...$,w);$.sort();let q=`[${$.join("-")}]`;try{new RegExp(q)}catch(J){return $.map((f)=>i.escapeRegex(f)).join("..")}return q},Z0=($,w)=>{return`Missing ${$}: "${w}" - use "\\\\${w}" to match literal characters`},g0=($,w)=>{if(typeof $!=="string")throw TypeError("Expected a string");$=S1[$]||$;let q={...w},J=typeof q.maxLength==="number"?Math.min(z0,q.maxLength):z0,f=$.length;if(f>J)throw SyntaxError(`Input length: ${f}, exceeds maximum allowed length: ${J}`);let Z={type:"bos",value:"",output:q.prepend||""},V=[Z],F=q.capture?"":"?:",N=i.isWindows(w),K=j0.globChars(N),B=j0.extglobChars(K),{DOT_LITERAL:j,PLUS_LITERAL:X,SLASH_LITERAL:H,ONE_CHAR:y,DOTS_SLASH:M,NO_DOT:L,NO_DOT_SLASH:A,NO_DOTS_SLASH:u,QMARK:S,QMARK_NO_DOT:n,STAR:b,START_ANCHOR:e}=K,v=(G)=>{return`(${F}(?:(?!${e}${G.dot?M:j}).)*?)`},z=q.dot?"":L,P=q.dot?S:n,k=q.bash===!0?v(q):b;if(q.capture)k=`(${k})`;if(typeof q.noext==="boolean")q.noextglob=q.noext;let U={input:$,index:-1,start:0,dot:q.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:V};$=i.removePrefix($,U),f=$.length;let _=[],O=[],o=[],Y=Z,W,m=()=>U.index===f-1,D=U.peek=(G=1)=>$[U.index+G],p=U.advance=()=>$[++U.index]||"",a=()=>$.slice(U.index+1),c=(G="",E=0)=>{U.consumed+=G,U.index+=E},X0=(G)=>{U.output+=G.output!=null?G.output:G.value,c(G.value)},r1=()=>{let G=1;while(D()==="!"&&(D(2)!=="("||D(3)==="?"))p(),U.start++,G++;if(G%2===0)return!1;return U.negated=!0,U.start++,!0},Q0=(G)=>{U[G]++,o.push(G)},w0=(G)=>{U[G]--,o.pop()},C=(G)=>{if(Y.type==="globstar"){let E=U.braces>0&&(G.type==="comma"||G.type==="brace"),Q=G.extglob===!0||_.length&&(G.type==="pipe"||G.type==="paren");if(G.type!=="slash"&&G.type!=="paren"&&!E&&!Q)U.output=U.output.slice(0,-Y.output.length),Y.type="star",Y.value="*",Y.output=k,U.output+=Y.output}if(_.length&&G.type!=="paren")_[_.length-1].inner+=G.value;if(G.value||G.output)X0(G);if(Y&&Y.type==="text"&&G.type==="text"){Y.value+=G.value,Y.output=(Y.output||"")+G.value;return}G.prev=Y,V.push(G),Y=G},B0=(G,E)=>{let Q={...B[E],conditions:1,inner:""};Q.prev=Y,Q.parens=U.parens,Q.output=U.output;let I=(q.capture?"(":"")+Q.open;Q0("parens"),C({type:G,value:E,output:U.output?"":y}),C({type:"paren",extglob:!0,value:p(),output:I}),_.push(Q)},i1=(G)=>{let E=G.close+(q.capture?")":""),Q;if(G.type==="negate"){let I=k;if(G.inner&&G.inner.length>1&&G.inner.includes("/"))I=v(q);if(I!==k||m()||/^\)+$/.test(a()))E=G.close=`)$))${I}`;if(G.inner.includes("*")&&(Q=a())&&/^\.[^\\/.]+$/.test(Q)){let T=g0(Q,{...w,fastpaths:!1}).output;E=G.close=`)${T})${I})`}if(G.prev.type==="bos")U.negatedExtglob=!0}C({type:"paren",extglob:!0,value:W,output:E}),w0("parens")};if(q.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test($)){let G=!1,E=$.replace(Xw,(Q,I,T,l,g,D0)=>{if(l==="\\")return G=!0,Q;if(l==="?"){if(I)return I+l+(g?S.repeat(g.length):"");if(D0===0)return P+(g?S.repeat(g.length):"");return S.repeat(T.length)}if(l===".")return j.repeat(T.length);if(l==="*"){if(I)return I+l+(g?k:"");return k}return I?Q:`\\${Q}`});if(G===!0)if(q.unescape===!0)E=E.replace(/\\/g,"");else E=E.replace(/\\+/g,(Q)=>{return Q.length%2===0?"\\\\":Q?"\\":""});if(E===$&&q.contains===!0)return U.output=$,U;return U.output=i.wrapOutput(E,U,w),U}while(!m()){if(W=p(),W==="\x00")continue;if(W==="\\"){let Q=D();if(Q==="/"&&q.bash!==!0)continue;if(Q==="."||Q===";")continue;if(!Q){W+="\\",C({type:"text",value:W});continue}let I=/^\\+/.exec(a()),T=0;if(I&&I[0].length>2){if(T=I[0].length,U.index+=T,T%2!==0)W+="\\"}if(q.unescape===!0)W=p();else W+=p();if(U.brackets===0){C({type:"text",value:W});continue}}if(U.brackets>0&&(W!=="]"||Y.value==="["||Y.value==="[^")){if(q.posix!==!1&&W===":"){let Q=Y.value.slice(1);if(Q.includes("[")){if(Y.posix=!0,Q.includes(":")){let I=Y.value.lastIndexOf("["),T=Y.value.slice(0,I),l=Y.value.slice(I+2),g=Fw[l];if(g){if(Y.value=T+g,U.backtrack=!0,p(),!Z.output&&V.indexOf(Y)===1)Z.output=y;continue}}}}if(W==="["&&D()!==":"||W==="-"&&D()==="]")W=`\\${W}`;if(W==="]"&&(Y.value==="["||Y.value==="[^"))W=`\\${W}`;if(q.posix===!0&&W==="!"&&Y.value==="[")W="^";Y.value+=W,X0({value:W});continue}if(U.quotes===1&&W!=='"'){W=i.escapeRegex(W),Y.value+=W,X0({value:W});continue}if(W==='"'){if(U.quotes=U.quotes===1?0:1,q.keepQuotes===!0)C({type:"text",value:W});continue}if(W==="("){Q0("parens"),C({type:"paren",value:W});continue}if(W===")"){if(U.parens===0&&q.strictBrackets===!0)throw SyntaxError(Z0("opening","("));let Q=_[_.length-1];if(Q&&U.parens===Q.parens+1){i1(_.pop());continue}C({type:"paren",value:W,output:U.parens?")":"\\)"}),w0("parens");continue}if(W==="["){if(q.nobracket===!0||!a().includes("]")){if(q.nobracket!==!0&&q.strictBrackets===!0)throw SyntaxError(Z0("closing","]"));W=`\\${W}`}else Q0("brackets");C({type:"bracket",value:W});continue}if(W==="]"){if(q.nobracket===!0||Y&&Y.type==="bracket"&&Y.value.length===1){C({type:"text",value:W,output:`\\${W}`});continue}if(U.brackets===0){if(q.strictBrackets===!0)throw SyntaxError(Z0("opening","["));C({type:"text",value:W,output:`\\${W}`});continue}w0("brackets");let Q=Y.value.slice(1);if(Y.posix!==!0&&Q[0]==="^"&&!Q.includes("/"))W=`/${W}`;if(Y.value+=W,X0({value:W}),q.literalBrackets===!1||i.hasRegexChars(Q))continue;let I=i.escapeRegex(Y.value);if(U.output=U.output.slice(0,-Y.value.length),q.literalBrackets===!0){U.output+=I,Y.value=I;continue}Y.value=`(${F}${I}|${Y.value})`,U.output+=Y.value;continue}if(W==="{"&&q.nobrace!==!0){Q0("braces");let Q={type:"brace",value:W,output:"(",outputIndex:U.output.length,tokensIndex:U.tokens.length};O.push(Q),C(Q);continue}if(W==="}"){let Q=O[O.length-1];if(q.nobrace===!0||!Q){C({type:"text",value:W,output:W});continue}let I=")";if(Q.dots===!0){let T=V.slice(),l=[];for(let g=T.length-1;g>=0;g--){if(V.pop(),T[g].type==="brace")break;if(T[g].type!=="dots")l.unshift(T[g].value)}I=Qw(l,q),U.backtrack=!0}if(Q.comma!==!0&&Q.dots!==!0){let T=U.output.slice(0,Q.outputIndex),l=U.tokens.slice(Q.tokensIndex);Q.value=Q.output="\\{",W=I="\\}",U.output=T;for(let g of l)U.output+=g.output||g.value}C({type:"brace",value:W,output:I}),w0("braces"),O.pop();continue}if(W==="|"){if(_.length>0)_[_.length-1].conditions++;C({type:"text",value:W});continue}if(W===","){let Q=W,I=O[O.length-1];if(I&&o[o.length-1]==="braces")I.comma=!0,Q="|";C({type:"comma",value:W,output:Q});continue}if(W==="/"){if(Y.type==="dot"&&U.index===U.start+1){U.start=U.index+1,U.consumed="",U.output="",V.pop(),Y=Z;continue}C({type:"slash",value:W,output:H});continue}if(W==="."){if(U.braces>0&&Y.type==="dot"){if(Y.value===".")Y.output=j;let Q=O[O.length-1];Y.type="dots",Y.output+=W,Y.value+=W,Q.dots=!0;continue}if(U.braces+U.parens===0&&Y.type!=="bos"&&Y.type!=="slash"){C({type:"text",value:W,output:j});continue}C({type:"dot",value:W,output:j});continue}if(W==="?"){if(!(Y&&Y.value==="(")&&q.noextglob!==!0&&D()==="("&&D(2)!=="?"){B0("qmark",W);continue}if(Y&&Y.type==="paren"){let I=D(),T=W;if(I==="<"&&!i.supportsLookbehinds())throw Error("Node.js v10 or higher is required for regex lookbehinds");if(Y.value==="("&&!/[!=<:]/.test(I)||I==="<"&&!/<([!=]|\w+>)/.test(a()))T=`\\${W}`;C({type:"text",value:W,output:T});continue}if(q.dot!==!0&&(Y.type==="slash"||Y.type==="bos")){C({type:"qmark",value:W,output:n});continue}C({type:"qmark",value:W,output:S});continue}if(W==="!"){if(q.noextglob!==!0&&D()==="("){if(D(2)!=="?"||!/[!=<:]/.test(D(3))){B0("negate",W);continue}}if(q.nonegate!==!0&&U.index===0){r1();continue}}if(W==="+"){if(q.noextglob!==!0&&D()==="("&&D(2)!=="?"){B0("plus",W);continue}if(Y&&Y.value==="("||q.regex===!1){C({type:"plus",value:W,output:X});continue}if(Y&&(Y.type==="bracket"||Y.type==="paren"||Y.type==="brace")||U.parens>0){C({type:"plus",value:W});continue}C({type:"plus",value:X});continue}if(W==="@"){if(q.noextglob!==!0&&D()==="("&&D(2)!=="?"){C({type:"at",extglob:!0,value:W,output:""});continue}C({type:"text",value:W});continue}if(W!=="*"){if(W==="$"||W==="^")W=`\\${W}`;let Q=Uw.exec(a());if(Q)W+=Q[0],U.index+=Q[0].length;C({type:"text",value:W});continue}if(Y&&(Y.type==="globstar"||Y.star===!0)){Y.type="star",Y.star=!0,Y.value+=W,Y.output=k,U.backtrack=!0,U.globstar=!0,c(W);continue}let G=a();if(q.noextglob!==!0&&/^\([^?]/.test(G)){B0("star",W);continue}if(Y.type==="star"){if(q.noglobstar===!0){c(W);continue}let Q=Y.prev,I=Q.prev,T=Q.type==="slash"||Q.type==="bos",l=I&&(I.type==="star"||I.type==="globstar");if(q.bash===!0&&(!T||G[0]&&G[0]!=="/")){C({type:"star",value:W,output:""});continue}let g=U.braces>0&&(Q.type==="comma"||Q.type==="brace"),D0=_.length&&(Q.type==="pipe"||Q.type==="paren");if(!T&&Q.type!=="paren"&&!g&&!D0){C({type:"star",value:W,output:""});continue}while(G.slice(0,3)==="/**"){let N0=$[U.index+4];if(N0&&N0!=="/")break;G=G.slice(3),c("/**",3)}if(Q.type==="bos"&&m()){Y.type="globstar",Y.value+=W,Y.output=v(q),U.output=Y.output,U.globstar=!0,c(W);continue}if(Q.type==="slash"&&Q.prev.type!=="bos"&&!l&&m()){U.output=U.output.slice(0,-(Q.output+Y.output).length),Q.output=`(?:${Q.output}`,Y.type="globstar",Y.output=v(q)+(q.strictSlashes?")":"|$)"),Y.value+=W,U.globstar=!0,U.output+=Q.output+Y.output,c(W);continue}if(Q.type==="slash"&&Q.prev.type!=="bos"&&G[0]==="/"){let N0=G[1]!==void 0?"|$":"";U.output=U.output.slice(0,-(Q.output+Y.output).length),Q.output=`(?:${Q.output}`,Y.type="globstar",Y.output=`${v(q)}${H}|${H}${N0})`,Y.value+=W,U.output+=Q.output+Y.output,U.globstar=!0,c(W+p()),C({type:"slash",value:"/",output:""});continue}if(Q.type==="bos"&&G[0]==="/"){Y.type="globstar",Y.value+=W,Y.output=`(?:^|${H}|${v(q)}${H})`,U.output=Y.output,U.globstar=!0,c(W+p()),C({type:"slash",value:"/",output:""});continue}U.output=U.output.slice(0,-Y.output.length),Y.type="globstar",Y.output=v(q),Y.value+=W,U.output+=Y.output,U.globstar=!0,c(W);continue}let E={type:"star",value:W,output:k};if(q.bash===!0){if(E.output=".*?",Y.type==="bos"||Y.type==="slash")E.output=z+E.output;C(E);continue}if(Y&&(Y.type==="bracket"||Y.type==="paren")&&q.regex===!0){E.output=W,C(E);continue}if(U.index===U.start||Y.type==="slash"||Y.type==="dot"){if(Y.type==="dot")U.output+=A,Y.output+=A;else if(q.dot===!0)U.output+=u,Y.output+=u;else U.output+=z,Y.output+=z;if(D()!=="*")U.output+=y,Y.output+=y}C(E)}while(U.brackets>0){if(q.strictBrackets===!0)throw SyntaxError(Z0("closing","]"));U.output=i.escapeLast(U.output,"["),w0("brackets")}while(U.parens>0){if(q.strictBrackets===!0)throw SyntaxError(Z0("closing",")"));U.output=i.escapeLast(U.output,"("),w0("parens")}while(U.braces>0){if(q.strictBrackets===!0)throw SyntaxError(Z0("closing","}"));U.output=i.escapeLast(U.output,"{"),w0("braces")}if(q.strictSlashes!==!0&&(Y.type==="star"||Y.type==="bracket"))C({type:"maybe_slash",value:"",output:`${H}?`});if(U.backtrack===!0){U.output="";for(let G of U.tokens)if(U.output+=G.output!=null?G.output:G.value,G.suffix)U.output+=G.suffix}return U};g0.fastpaths=($,w)=>{let q={...w},J=typeof q.maxLength==="number"?Math.min(z0,q.maxLength):z0,f=$.length;if(f>J)throw SyntaxError(`Input length: ${f}, exceeds maximum allowed length: ${J}`);$=S1[$]||$;let Z=i.isWindows(w),{DOT_LITERAL:V,SLASH_LITERAL:F,ONE_CHAR:N,DOTS_SLASH:K,NO_DOT:B,NO_DOTS:j,NO_DOTS_SLASH:X,STAR:H,START_ANCHOR:y}=j0.globChars(Z),M=q.dot?j:B,L=q.dot?X:B,A=q.capture?"":"?:",u={negated:!1,prefix:""},S=q.bash===!0?".*?":H;if(q.capture)S=`(${S})`;let n=(z)=>{if(z.noglobstar===!0)return S;return`(${A}(?:(?!${y}${z.dot?K:V}).)*?)`},b=(z)=>{switch(z){case"*":return`${M}${N}${S}`;case".*":return`${V}${N}${S}`;case"*.*":return`${M}${S}${V}${N}${S}`;case"*/*":return`${M}${S}${F}${N}${L}${S}`;case"**":return M+n(q);case"**/*":return`(?:${M}${n(q)}${F})?${L}${N}${S}`;case"**/*.*":return`(?:${M}${n(q)}${F})?${L}${S}${V}${N}${S}`;case"**/.*":return`(?:${M}${n(q)}${F})?${V}${N}${S}`;default:{let P=/^(.*?)\.(\w+)$/.exec(z);if(!P)return;let k=b(P[1]);if(!k)return;return k+V+P[2]}}},e=i.removePrefix($,u),v=b(e);if(v&&q.strictSlashes!==!0)v+=`${F}?`;return v};x1.exports=g0});var k1=d((Aw,h1)=>{var Bw=t("path"),Nw=A1(),h0=g1(),k0=F0(),Gw=W0(),Mw=($)=>$&&typeof $==="object"&&!Array.isArray($),x=($,w,q=!1)=>{if(Array.isArray($)){let B=$.map((X)=>x(X,w,q));return(X)=>{for(let H of B){let y=H(X);if(y)return y}return!1}}let J=Mw($)&&$.tokens&&$.input;if($===""||typeof $!=="string"&&!J)throw TypeError("Expected pattern to be a non-empty string");let f=w||{},Z=k0.isWindows(w),V=J?x.compileRe($,w):x.makeRe($,w,!1,!0),F=V.state;delete V.state;let N=()=>!1;if(f.ignore){let B={...w,ignore:null,onMatch:null,onResult:null};N=x(f.ignore,B,q)}let K=(B,j=!1)=>{let{isMatch:X,match:H,output:y}=x.test(B,V,w,{glob:$,posix:Z}),M={glob:$,state:F,regex:V,posix:Z,input:B,output:y,match:H,isMatch:X};if(typeof f.onResult==="function")f.onResult(M);if(X===!1)return M.isMatch=!1,j?M:!1;if(N(B)){if(typeof f.onIgnore==="function")f.onIgnore(M);return M.isMatch=!1,j?M:!1}if(typeof f.onMatch==="function")f.onMatch(M);return j?M:!0};if(q)K.state=F;return K};x.test=($,w,q,{glob:J,posix:f}={})=>{if(typeof $!=="string")throw TypeError("Expected input to be a string");if($==="")return{isMatch:!1,output:""};let Z=q||{},V=Z.format||(f?k0.toPosixSlashes:null),F=$===J,N=F&&V?V($):$;if(F===!1)N=V?V($):$,F=N===J;if(F===!1||Z.capture===!0)if(Z.matchBase===!0||Z.basename===!0)F=x.matchBase($,w,q,f);else F=w.exec(N);return{isMatch:Boolean(F),match:F,output:N}};x.matchBase=($,w,q,J=k0.isWindows(q))=>{return(w instanceof RegExp?w:x.makeRe(w,q)).test(Bw.basename($))};x.isMatch=($,w,q)=>x(w,q)($);x.parse=($,w)=>{if(Array.isArray($))return $.map((q)=>x.parse(q,w));return h0($,{...w,fastpaths:!1})};x.scan=($,w)=>Nw($,w);x.compileRe=($,w,q=!1,J=!1)=>{if(q===!0)return $.output;let f=w||{},Z=f.contains?"":"^",V=f.contains?"":"$",F=`${Z}(?:${$.output})${V}`;if($&&$.negated===!0)F=`^(?!${F}).*$`;let N=x.toRegex(F,w);if(J===!0)N.state=$;return N};x.makeRe=($,w={},q=!1,J=!1)=>{if(!$||typeof $!=="string")throw TypeError("Expected a non-empty string");let f={negated:!1,fastpaths:!0};if(w.fastpaths!==!1&&($[0]==="."||$[0]==="*"))f.output=h0.fastpaths($,w);if(!f.output)f=h0($,w);return x.compileRe(f,w,q,J)};x.toRegex=($,w)=>{try{let q=w||{};return new RegExp($,q.flags||(q.nocase?"i":""))}catch(q){if(w&&w.debug===!0)throw q;return/$^/}};x.constants=Gw;h1.exports=x});var u1=d((Sw,l1)=>{var d1=t("util"),v1=z1(),s=k1(),b0=F0(),b1=($)=>$===""||$==="./",m1=($)=>{let w=$.indexOf("{");return w>-1&&$.indexOf("}",w)>-1},R=($,w,q)=>{w=[].concat(w),$=[].concat($);let J=new Set,f=new Set,Z=new Set,V=0,F=(B)=>{if(Z.add(B.output),q&&q.onResult)q.onResult(B)};for(let B=0;B<w.length;B++){let j=s(String(w[B]),{...q,onResult:F},!0),X=j.state.negated||j.state.negatedExtglob;if(X)V++;for(let H of $){let y=j(H,!0);if(!(X?!y.isMatch:y.isMatch))continue;if(X)J.add(y.output);else J.delete(y.output),f.add(y.output)}}let K=(V===w.length?[...Z]:[...f]).filter((B)=>!J.has(B));if(q&&K.length===0){if(q.failglob===!0)throw Error(`No matches found for "${w.join(", ")}"`);if(q.nonull===!0||q.nullglob===!0)return q.unescape?w.map((B)=>B.replace(/\\/g,"")):w}return K};R.match=R;R.matcher=($,w)=>s($,w);R.isMatch=($,w,q)=>s(w,q)($);R.any=R.isMatch;R.not=($,w,q={})=>{w=[].concat(w).map(String);let J=new Set,f=[],V=new Set(R($,w,{...q,onResult:(F)=>{if(q.onResult)q.onResult(F);f.push(F.output)}}));for(let F of f)if(!V.has(F))J.add(F);return[...J]};R.contains=($,w,q)=>{if(typeof $!=="string")throw TypeError(`Expected a string: "${d1.inspect($)}"`);if(Array.isArray(w))return w.some((J)=>R.contains($,J,q));if(typeof w==="string"){if(b1($)||b1(w))return!1;if($.includes(w)||$.startsWith("./")&&$.slice(2).includes(w))return!0}return R.isMatch($,w,{...q,contains:!0})};R.matchKeys=($,w,q)=>{if(!b0.isObject($))throw TypeError("Expected the first argument to be an object");let J=R(Object.keys($),w,q),f={};for(let Z of J)f[Z]=$[Z];return f};R.some=($,w,q)=>{let J=[].concat($);for(let f of[].concat(w)){let Z=s(String(f),q);if(J.some((V)=>Z(V)))return!0}return!1};R.every=($,w,q)=>{let J=[].concat($);for(let f of[].concat(w)){let Z=s(String(f),q);if(!J.every((V)=>Z(V)))return!1}return!0};R.all=($,w,q)=>{if(typeof $!=="string")throw TypeError(`Expected a string: "${d1.inspect($)}"`);return[].concat(w).every((J)=>s(J,q)($))};R.capture=($,w,q)=>{let J=b0.isWindows(q),Z=s.makeRe(String($),{...q,capture:!0}).exec(J?b0.toPosixSlashes(w):w);if(Z)return Z.slice(1).map((V)=>V===void 0?"":V)};R.makeRe=(...$)=>s.makeRe(...$);R.scan=(...$)=>s.scan(...$);R.parse=($,w)=>{let q=[];for(let J of[].concat($||[]))for(let f of v1(String(J),w))q.push(s.parse(f,w));return q};R.braces=($,w)=>{if(typeof $!=="string")throw TypeError("Expected a string");if(w&&w.nobrace===!0||!m1($))return[$];return v1($,w)};R.braceExpand=($,w)=>{if(typeof $!=="string")throw TypeError("Expected a string");return R.braces($,{...w,expand:!0})};R.hasBraces=m1;l1.exports=R});var c1=yw(u1(),1);var I0;((J)=>{J.ALLOW="allow";J.ASK="ask";J.DENY="deny"})(I0||={});var gw=h.object({tool:h.string(),specifier:h.string().optional(),action:h.nativeEnum(I0)}),hw=h.object({allow:h.array(h.string()).optional(),ask:h.array(h.string()).optional(),deny:h.array(h.string()).optional(),defaultMode:h.nativeEnum(I0).optional()}),kw=h.object({name:h.string(),args:h.record(h.string(),h.any())});class f0{rules;defaultMode;patternCache=new Map;constructor($){this.rules=$.rules,this.defaultMode=$.defaultMode||"ask",this.rules.sort((w,q)=>{let J={deny:0,ask:1,allow:2},f=J[w.action]-J[q.action];if(f!==0)return f;let Z=w.specifier==null?1:0,V=q.specifier==null?1:0;return Z-V})}checkPermission($){for(let w of this.rules)if(this.matchRule(w,$))return{allowed:w.action==="allow"||w.action==="ask",requiresApproval:w.action==="ask",matchedRule:w,reason:this.getReason(w)};return{allowed:this.defaultMode==="allow"||this.defaultMode==="ask",requiresApproval:this.defaultMode==="ask",reason:`No matching rule, using default mode: ${this.defaultMode}`}}matchRule($,w){if($.tool!==w.name)return!1;if(!$.specifier)return!0;let q=this.argsToString(w.args);if(w.name==="Bash")return this.matchBashCommand($.specifier,q);if($.specifier.endsWith(" ")&&!/[*?[\\]/.test($.specifier))return q.startsWith($.specifier);return this.matchGlob($.specifier,q)}matchBashCommand($,w){if(/[;&|]/.test(w))return!1;let J=/[<>()]/;if(J.test(w)){let f=w.split(J)[0].trim();return this.matchBashPattern($,f)}return this.matchBashPattern($,w)}matchBashPattern($,w){if($.endsWith(" "))return w.startsWith($);return this.matchGlob($,w)}matchGlob($,w){try{let q=$.replace(/^\.\//,""),J=w.replace(/^\.\//,""),f=`${$}::${w}`,Z=this.patternCache.get(f);if(Z!==void 0)return Z;let V=c1.default.isMatch(J,q,{nocase:!1,dot:!0});return this.cacheResult(f,V),V}catch(q){return w===$}}cacheResult($,w){if(this.patternCache.size>1000){let q=this.patternCache.keys().next().value;if(q)this.patternCache.delete(q)}this.patternCache.set($,w)}argsToString($){if(typeof $==="object"&&$!==null){if("command"in $&&$.command)return String($.command);if("file_path"in $&&$.file_path)return String($.file_path);return Object.values($).flat().join(" ")}return String($)}getReason($){let w=$.action.toUpperCase(),q=$.tool,J=$.specifier?`(${$.specifier})`:"";return`${w} rule matched: ${q}${J}`}static parseRule($,w){let q=$.match(/^(\w+)(?:\((.*)\))?$/);if(!q)throw Error(`Invalid permission rule format: ${$}`);let[,J,f]=q;return{tool:J,specifier:f,action:w}}static fromConfig($){let w=[];for(let q of $.allow||[])w.push(f0.parseRule(q,"allow"));for(let q of $.ask||[])w.push(f0.parseRule(q,"ask"));for(let q of $.deny||[])w.push(f0.parseRule(q,"deny"));return new f0({rules:w,defaultMode:$.defaultMode||"ask"})}clearCache(){this.patternCache.clear()}getCacheSize(){return this.patternCache.size}}class $0{configStore;toolNameMapper={};constructor($){this.configStore=$}static instance=null;static getInstance($){if(!$0.instance){if(!$)throw Error("PermissionStore not initialized. Provide configStore on first call.");$0.instance=new $0($)}return $0.instance}static resetInstance(){$0.instance=null}async getPermissions(){let $=await this.configStore.getConfig();if($.permissions)return f0.fromConfig($.permissions);return}async checkBashPermission($,w){return(await this.getPermissions())?.checkPermission({name:"Bash",args:{command:$,cwd:w}})}async checkReadPermission($){return(await this.getPermissions())?.checkPermission({name:"Read",args:{file_path:$}})}async checkWritePermission($){return(await this.getPermissions())?.checkPermission({name:"Write",args:{file_path:$}})}}class C0{configStore;skillStore;pluginStore;remoteStore;permissionStore;_initialized=!1;constructor($,w,q,J){this.configStore=$,this.skillStore=w,this.pluginStore=q,this.remoteStore=J,this.permissionStore=$0.getInstance($)}async initialize(){if(this._initialized)return;if("initialize"in this.configStore&&typeof this.configStore.initialize==="function")await this.configStore.initialize();if("initialize"in this.skillStore&&typeof this.skillStore.initialize==="function")await this.skillStore.initialize();if("initialize"in this.pluginStore&&typeof this.pluginStore.initialize==="function")await this.pluginStore.initialize();this._initialized=!0}async ensureInitialized(){if(!this._initialized)throw Error("ConfigManager not initialized. Call await manager.initialize() first.")}async getConfig(){return await this.ensureInitialized(),await this.configStore.getConfig()}async updateConfig($){return await this.ensureInitialized(),await this.configStore.updateConfig($)}async listSkills(){return await this.ensureInitialized(),await this.skillStore.listSkills()}async getSkill($){return await this.ensureInitialized(),await this.skillStore.getSkill($)}async saveSkill($,w){return await this.ensureInitialized(),await this.skillStore.saveSkill($,w)}async deleteSkill($){return await this.ensureInitialized(),await this.skillStore.deleteSkill($)}async syncSkillsFromRemote(){if(await this.ensureInitialized(),!this.remoteStore)throw Error("Remote store not configured");return await this.skillStore.syncFromRemote(this.remoteStore)}async listPlugins(){return await this.ensureInitialized(),await this.pluginStore.listPlugins()}async getPluginConfig($){return await this.ensureInitialized(),await this.pluginStore.getPluginConfig($)}async updatePluginConfig($,w){return await this.ensureInitialized(),await this.pluginStore.updatePluginConfig($,w)}async installPlugin($,w){return await this.ensureInitialized(),await this.pluginStore.installPlugin($,w)}async uninstallPlugin($){return await this.ensureInitialized(),await this.pluginStore.uninstallPlugin($)}async checkBashPermission($,w){return await this.ensureInitialized(),await this.permissionStore.checkBashPermission($,w)}async checkReadPermission($){return await this.ensureInitialized(),await this.permissionStore.checkReadPermission($)}async checkWritePermission($){return await this.ensureInitialized(),await this.permissionStore.checkWritePermission($)}async getPermissionMatcher(){return await this.ensureInitialized(),await this.permissionStore.getPermissions()}getConfigPath(){return this.configStore?.dbPath}}async function ow(){let{FileSystemConfigStore:$}=await import("./chunk-t7rwtc17.js"),{FileSystemSkillStore:w}=await import("./chunk-r4tq44hr.js"),{FileSystemPluginStore:q}=await import("./chunk-zr7sx9hd.js"),J=new $,f=new w,Z=new q,V=new C0(J,f,Z);return await V.initialize(),V}async function tw($){let{configStore:w,skillStore:q,pluginStore:J,remoteStore:f}=$,Z=new C0(w,q,J,f);return await Z.initialize(),Z}
18
- export{C0 as Of,ow as Pf,tw as Qf};
17
+ `,CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var y1=d((Lw,M1)=>{var I$=M0(),{MAX_LENGTH:B1,CHAR_BACKSLASH:R0,CHAR_BACKTICK:C$,CHAR_COMMA:D$,CHAR_DOT:H$,CHAR_LEFT_PARENTHESES:P$,CHAR_RIGHT_PARENTHESES:L$,CHAR_LEFT_CURLY_BRACE:O$,CHAR_RIGHT_CURLY_BRACE:E$,CHAR_LEFT_SQUARE_BRACKET:N1,CHAR_RIGHT_SQUARE_BRACKET:G1,CHAR_DOUBLE_QUOTE:R$,CHAR_SINGLE_QUOTE:_$,CHAR_NO_BREAK_SPACE:T$,CHAR_ZERO_WIDTH_NOBREAK_SPACE:A$}=Q1(),S$=($,w={})=>{if(typeof $!=="string")throw TypeError("Expected a string");let q=w||{},J=typeof q.maxLength==="number"?Math.min(B1,q.maxLength):B1;if($.length>J)throw SyntaxError(`Input length (${$.length}), exceeds max characters (${J})`);let f={type:"root",input:$,nodes:[]},Z=[f],V=f,F=f,N=0,K=$.length,B=0,j=0,X,H=()=>$[B++],y=(M)=>{if(M.type==="text"&&F.type==="dot")F.type="text";if(F&&F.type==="text"&&M.type==="text"){F.value+=M.value;return}return V.nodes.push(M),M.parent=V,M.prev=F,F=M,M};y({type:"bos"});while(B<K){if(V=Z[Z.length-1],X=H(),X===A$||X===T$)continue;if(X===R0){y({type:"text",value:(w.keepEscaping?X:"")+H()});continue}if(X===G1){y({type:"text",value:"\\"+X});continue}if(X===N1){N++;let M;while(B<K&&(M=H())){if(X+=M,M===N1){N++;continue}if(M===R0){X+=H();continue}if(M===G1){if(N--,N===0)break}}y({type:"text",value:X});continue}if(X===P$){V=y({type:"paren",nodes:[]}),Z.push(V),y({type:"text",value:X});continue}if(X===L$){if(V.type!=="paren"){y({type:"text",value:X});continue}V=Z.pop(),y({type:"text",value:X}),V=Z[Z.length-1];continue}if(X===R$||X===_$||X===C$){let M=X,L;if(w.keepQuotes!==!0)X="";while(B<K&&(L=H())){if(L===R0){X+=L+H();continue}if(L===M){if(w.keepQuotes===!0)X+=L;break}X+=L}y({type:"text",value:X});continue}if(X===O$){j++;let L={type:"brace",open:!0,close:!1,dollar:F.value&&F.value.slice(-1)==="$"||V.dollar===!0,depth:j,commas:0,ranges:0,nodes:[]};V=y(L),Z.push(V),y({type:"open",value:X});continue}if(X===E$){if(V.type!=="brace"){y({type:"text",value:X});continue}let M="close";V=Z.pop(),V.close=!0,y({type:M,value:X}),j--,V=Z[Z.length-1];continue}if(X===D$&&j>0){if(V.ranges>0){V.ranges=0;let M=V.nodes.shift();V.nodes=[M,{type:"text",value:I$(V)}]}y({type:"comma",value:X}),V.commas++;continue}if(X===H$&&j>0&&V.commas===0){let M=V.nodes;if(j===0||M.length===0){y({type:"text",value:X});continue}if(F.type==="dot"){if(V.range=[],F.value+=X,F.type="range",V.nodes.length!==3&&V.nodes.length!==5){V.invalid=!0,V.ranges=0,F.type="text";continue}V.ranges++,V.args=[];continue}if(F.type==="range"){M.pop();let L=M[M.length-1];L.value+=F.value+X,F=L,V.ranges--;continue}y({type:"dot",value:X});continue}y({type:"text",value:X})}do if(V=Z.pop(),V.type!=="root"){V.nodes.forEach((A)=>{if(!A.nodes){if(A.type==="open")A.isOpen=!0;if(A.type==="close")A.isClose=!0;if(!A.nodes)A.type="text";A.invalid=!0}});let M=Z[Z.length-1],L=M.nodes.indexOf(V);M.nodes.splice(L,1,...V.nodes)}while(Z.length>0);return y({type:"eos"}),f};M1.exports=S$});var z1=d((Ow,j1)=>{var K1=M0(),x$=Y1(),g$=U1(),h$=y1(),r=($,w={})=>{let q=[];if(Array.isArray($))for(let J of $){let f=r.create(J,w);if(Array.isArray(f))q.push(...f);else q.push(f)}else q=[].concat(r.create($,w));if(w&&w.expand===!0&&w.nodupes===!0)q=[...new Set(q)];return q};r.parse=($,w={})=>h$($,w);r.stringify=($,w={})=>{if(typeof $==="string")return K1(r.parse($,w),w);return K1($,w)};r.compile=($,w={})=>{if(typeof $==="string")$=r.parse($,w);return x$($,w)};r.expand=($,w={})=>{if(typeof $==="string")$=r.parse($,w);let q=g$($,w);if(w.noempty===!0)q=q.filter(Boolean);if(w.nodupes===!0)q=[...new Set(q)];return q};r.create=($,w={})=>{if($===""||$.length<3)return[$];return w.expand!==!0?r.compile($,w):r.expand($,w)};j1.exports=r});var W0=d((Ew,C1)=>{var k$=t("path"),I1={DOT_LITERAL:"\\.",PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:"\\/",ONE_CHAR:"(?=.)",QMARK:"[^/]",END_ANCHOR:"(?:\\/|$)",DOTS_SLASH:"\\.{1,2}(?:\\/|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|\\/)\\.{1,2}(?:\\/|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:\\/|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:\\/|$))",QMARK_NO_DOT:"[^.\\/]",STAR:"[^/]*?",START_ANCHOR:"(?:^|\\/)"},b$={...I1,SLASH_LITERAL:"[\\\\/]",QMARK:"[^\\\\/]",STAR:"[^\\\\/]*?",DOTS_SLASH:"\\.{1,2}(?:[\\\\/]|$)",NO_DOT:"(?!\\.)",NO_DOTS:"(?!(?:^|[\\\\/])\\.{1,2}(?:[\\\\/]|$))",NO_DOT_SLASH:"(?!\\.{0,1}(?:[\\\\/]|$))",NO_DOTS_SLASH:"(?!\\.{1,2}(?:[\\\\/]|$))",QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)"},d$={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};C1.exports={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:d$,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:k$.sep,extglobChars($){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${$.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars($){return $===!0?b$:I1}}});var F0=d((i$)=>{var v$=t("path"),m$=process.platform==="win32",{REGEX_BACKSLASH:l$,REGEX_REMOVE_BACKSLASH:u$,REGEX_SPECIAL_CHARS:c$,REGEX_SPECIAL_CHARS_GLOBAL:r$}=W0();i$.isObject=($)=>$!==null&&typeof $==="object"&&!Array.isArray($);i$.hasRegexChars=($)=>c$.test($);i$.isRegexChar=($)=>$.length===1&&i$.hasRegexChars($);i$.escapeRegex=($)=>$.replace(r$,"\\$1");i$.toPosixSlashes=($)=>$.replace(l$,"/");i$.removeBackslashes=($)=>{return $.replace(u$,(w)=>{return w==="\\"?"":w})};i$.supportsLookbehinds=()=>{let $=process.version.slice(1).split(".").map(Number);if($.length===3&&$[0]>=9||$[0]===8&&$[1]>=10)return!0;return!1};i$.isWindows=($)=>{if($&&typeof $.windows==="boolean")return $.windows;return m$===!0||v$.sep==="\\"};i$.escapeLast=($,w,q)=>{let J=$.lastIndexOf(w,q);if(J===-1)return $;if($[J-1]==="\\")return i$.escapeLast($,w,J-1);return`${$.slice(0,J)}\\${$.slice(J)}`};i$.removePrefix=($,w={})=>{let q=$;if(q.startsWith("./"))q=q.slice(2),w.prefix="./";return q};i$.wrapOutput=($,w={},q={})=>{let J=q.contains?"":"^",f=q.contains?"":"$",Z=`${J}(?:${$})${f}`;if(w.negated===!0)Z=`(?:^(?!${Z}).*$)`;return Z}});var A1=d((_w,T1)=>{var P1=F0(),{CHAR_ASTERISK:_0,CHAR_AT:qw,CHAR_BACKWARD_SLASH:U0,CHAR_COMMA:Jw,CHAR_DOT:T0,CHAR_EXCLAMATION_MARK:A0,CHAR_FORWARD_SLASH:_1,CHAR_LEFT_CURLY_BRACE:S0,CHAR_LEFT_PARENTHESES:x0,CHAR_LEFT_SQUARE_BRACKET:fw,CHAR_PLUS:Vw,CHAR_QUESTION_MARK:L1,CHAR_RIGHT_CURLY_BRACE:Zw,CHAR_RIGHT_PARENTHESES:O1,CHAR_RIGHT_SQUARE_BRACKET:Yw}=W0(),E1=($)=>{return $===_1||$===U0},R1=($)=>{if($.isPrefix!==!0)$.depth=$.isGlobstar?1/0:1},Ww=($,w)=>{let q=w||{},J=$.length-1,f=q.parts===!0||q.scanToEnd===!0,Z=[],V=[],F=[],N=$,K=-1,B=0,j=0,X=!1,H=!1,y=!1,M=!1,L=!1,A=!1,u=!1,S=!1,n=!1,b=!1,e=0,v,z,P={value:"",depth:0,isGlob:!1},k=()=>K>=J,U=()=>N.charCodeAt(K+1),_=()=>{return v=z,N.charCodeAt(++K)};while(K<J){z=_();let m;if(z===U0){if(u=P.backslashes=!0,z=_(),z===S0)A=!0;continue}if(A===!0||z===S0){e++;while(k()!==!0&&(z=_())){if(z===U0){u=P.backslashes=!0,_();continue}if(z===S0){e++;continue}if(A!==!0&&z===T0&&(z=_())===T0){if(X=P.isBrace=!0,y=P.isGlob=!0,b=!0,f===!0)continue;break}if(A!==!0&&z===Jw){if(X=P.isBrace=!0,y=P.isGlob=!0,b=!0,f===!0)continue;break}if(z===Zw){if(e--,e===0){A=!1,X=P.isBrace=!0,b=!0;break}}}if(f===!0)continue;break}if(z===_1){if(Z.push(K),V.push(P),P={value:"",depth:0,isGlob:!1},b===!0)continue;if(v===T0&&K===B+1){B+=2;continue}j=K+1;continue}if(q.noext!==!0){if((z===Vw||z===qw||z===_0||z===L1||z===A0)===!0&&U()===x0){if(y=P.isGlob=!0,M=P.isExtglob=!0,b=!0,z===A0&&K===B)n=!0;if(f===!0){while(k()!==!0&&(z=_())){if(z===U0){u=P.backslashes=!0,z=_();continue}if(z===O1){y=P.isGlob=!0,b=!0;break}}continue}break}}if(z===_0){if(v===_0)L=P.isGlobstar=!0;if(y=P.isGlob=!0,b=!0,f===!0)continue;break}if(z===L1){if(y=P.isGlob=!0,b=!0,f===!0)continue;break}if(z===fw){while(k()!==!0&&(m=_())){if(m===U0){u=P.backslashes=!0,_();continue}if(m===Yw){H=P.isBracket=!0,y=P.isGlob=!0,b=!0;break}}if(f===!0)continue;break}if(q.nonegate!==!0&&z===A0&&K===B){S=P.negated=!0,B++;continue}if(q.noparen!==!0&&z===x0){if(y=P.isGlob=!0,f===!0){while(k()!==!0&&(z=_())){if(z===x0){u=P.backslashes=!0,z=_();continue}if(z===O1){b=!0;break}}continue}break}if(y===!0){if(b=!0,f===!0)continue;break}}if(q.noext===!0)M=!1,y=!1;let O=N,o="",Y="";if(B>0)o=N.slice(0,B),N=N.slice(B),j-=B;if(O&&y===!0&&j>0)O=N.slice(0,j),Y=N.slice(j);else if(y===!0)O="",Y=N;else O=N;if(O&&O!==""&&O!=="/"&&O!==N){if(E1(O.charCodeAt(O.length-1)))O=O.slice(0,-1)}if(q.unescape===!0){if(Y)Y=P1.removeBackslashes(Y);if(O&&u===!0)O=P1.removeBackslashes(O)}let W={prefix:o,input:$,start:B,base:O,glob:Y,isBrace:X,isBracket:H,isGlob:y,isExtglob:M,isGlobstar:L,negated:S,negatedExtglob:n};if(q.tokens===!0){if(W.maxDepth=0,!E1(z))V.push(P);W.tokens=V}if(q.parts===!0||q.tokens===!0){let m;for(let D=0;D<Z.length;D++){let p=m?m+1:B,a=Z[D],c=$.slice(p,a);if(q.tokens){if(D===0&&B!==0)V[D].isPrefix=!0,V[D].value=o;else V[D].value=c;R1(V[D]),W.maxDepth+=V[D].depth}if(D!==0||c!=="")F.push(c);m=a}if(m&&m+1<$.length){let D=$.slice(m+1);if(F.push(D),q.tokens)V[V.length-1].value=D,R1(V[V.length-1]),W.maxDepth+=V[V.length-1].depth}W.slashes=Z,W.parts=F}return W};T1.exports=Ww});var g1=d((Tw,x1)=>{var j0=W0(),i=F0(),{MAX_LENGTH:z0,POSIX_REGEX_SOURCE:Fw,REGEX_NON_SPECIAL_CHARS:Uw,REGEX_SPECIAL_CHARS_BACKREF:Xw,REPLACEMENTS:S1}=j0,Qw=($,w)=>{if(typeof w.expandRange==="function")return w.expandRange(...$,w);$.sort();let q=`[${$.join("-")}]`;try{new RegExp(q)}catch(J){return $.map((f)=>i.escapeRegex(f)).join("..")}return q},Z0=($,w)=>{return`Missing ${$}: "${w}" - use "\\\\${w}" to match literal characters`},g0=($,w)=>{if(typeof $!=="string")throw TypeError("Expected a string");$=S1[$]||$;let q={...w},J=typeof q.maxLength==="number"?Math.min(z0,q.maxLength):z0,f=$.length;if(f>J)throw SyntaxError(`Input length: ${f}, exceeds maximum allowed length: ${J}`);let Z={type:"bos",value:"",output:q.prepend||""},V=[Z],F=q.capture?"":"?:",N=i.isWindows(w),K=j0.globChars(N),B=j0.extglobChars(K),{DOT_LITERAL:j,PLUS_LITERAL:X,SLASH_LITERAL:H,ONE_CHAR:y,DOTS_SLASH:M,NO_DOT:L,NO_DOT_SLASH:A,NO_DOTS_SLASH:u,QMARK:S,QMARK_NO_DOT:n,STAR:b,START_ANCHOR:e}=K,v=(G)=>{return`(${F}(?:(?!${e}${G.dot?M:j}).)*?)`},z=q.dot?"":L,P=q.dot?S:n,k=q.bash===!0?v(q):b;if(q.capture)k=`(${k})`;if(typeof q.noext==="boolean")q.noextglob=q.noext;let U={input:$,index:-1,start:0,dot:q.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:V};$=i.removePrefix($,U),f=$.length;let _=[],O=[],o=[],Y=Z,W,m=()=>U.index===f-1,D=U.peek=(G=1)=>$[U.index+G],p=U.advance=()=>$[++U.index]||"",a=()=>$.slice(U.index+1),c=(G="",E=0)=>{U.consumed+=G,U.index+=E},X0=(G)=>{U.output+=G.output!=null?G.output:G.value,c(G.value)},r1=()=>{let G=1;while(D()==="!"&&(D(2)!=="("||D(3)==="?"))p(),U.start++,G++;if(G%2===0)return!1;return U.negated=!0,U.start++,!0},Q0=(G)=>{U[G]++,o.push(G)},w0=(G)=>{U[G]--,o.pop()},C=(G)=>{if(Y.type==="globstar"){let E=U.braces>0&&(G.type==="comma"||G.type==="brace"),Q=G.extglob===!0||_.length&&(G.type==="pipe"||G.type==="paren");if(G.type!=="slash"&&G.type!=="paren"&&!E&&!Q)U.output=U.output.slice(0,-Y.output.length),Y.type="star",Y.value="*",Y.output=k,U.output+=Y.output}if(_.length&&G.type!=="paren")_[_.length-1].inner+=G.value;if(G.value||G.output)X0(G);if(Y&&Y.type==="text"&&G.type==="text"){Y.value+=G.value,Y.output=(Y.output||"")+G.value;return}G.prev=Y,V.push(G),Y=G},B0=(G,E)=>{let Q={...B[E],conditions:1,inner:""};Q.prev=Y,Q.parens=U.parens,Q.output=U.output;let I=(q.capture?"(":"")+Q.open;Q0("parens"),C({type:G,value:E,output:U.output?"":y}),C({type:"paren",extglob:!0,value:p(),output:I}),_.push(Q)},i1=(G)=>{let E=G.close+(q.capture?")":""),Q;if(G.type==="negate"){let I=k;if(G.inner&&G.inner.length>1&&G.inner.includes("/"))I=v(q);if(I!==k||m()||/^\)+$/.test(a()))E=G.close=`)$))${I}`;if(G.inner.includes("*")&&(Q=a())&&/^\.[^\\/.]+$/.test(Q)){let T=g0(Q,{...w,fastpaths:!1}).output;E=G.close=`)${T})${I})`}if(G.prev.type==="bos")U.negatedExtglob=!0}C({type:"paren",extglob:!0,value:W,output:E}),w0("parens")};if(q.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test($)){let G=!1,E=$.replace(Xw,(Q,I,T,l,g,D0)=>{if(l==="\\")return G=!0,Q;if(l==="?"){if(I)return I+l+(g?S.repeat(g.length):"");if(D0===0)return P+(g?S.repeat(g.length):"");return S.repeat(T.length)}if(l===".")return j.repeat(T.length);if(l==="*"){if(I)return I+l+(g?k:"");return k}return I?Q:`\\${Q}`});if(G===!0)if(q.unescape===!0)E=E.replace(/\\/g,"");else E=E.replace(/\\+/g,(Q)=>{return Q.length%2===0?"\\\\":Q?"\\":""});if(E===$&&q.contains===!0)return U.output=$,U;return U.output=i.wrapOutput(E,U,w),U}while(!m()){if(W=p(),W==="\x00")continue;if(W==="\\"){let Q=D();if(Q==="/"&&q.bash!==!0)continue;if(Q==="."||Q===";")continue;if(!Q){W+="\\",C({type:"text",value:W});continue}let I=/^\\+/.exec(a()),T=0;if(I&&I[0].length>2){if(T=I[0].length,U.index+=T,T%2!==0)W+="\\"}if(q.unescape===!0)W=p();else W+=p();if(U.brackets===0){C({type:"text",value:W});continue}}if(U.brackets>0&&(W!=="]"||Y.value==="["||Y.value==="[^")){if(q.posix!==!1&&W===":"){let Q=Y.value.slice(1);if(Q.includes("[")){if(Y.posix=!0,Q.includes(":")){let I=Y.value.lastIndexOf("["),T=Y.value.slice(0,I),l=Y.value.slice(I+2),g=Fw[l];if(g){if(Y.value=T+g,U.backtrack=!0,p(),!Z.output&&V.indexOf(Y)===1)Z.output=y;continue}}}}if(W==="["&&D()!==":"||W==="-"&&D()==="]")W=`\\${W}`;if(W==="]"&&(Y.value==="["||Y.value==="[^"))W=`\\${W}`;if(q.posix===!0&&W==="!"&&Y.value==="[")W="^";Y.value+=W,X0({value:W});continue}if(U.quotes===1&&W!=='"'){W=i.escapeRegex(W),Y.value+=W,X0({value:W});continue}if(W==='"'){if(U.quotes=U.quotes===1?0:1,q.keepQuotes===!0)C({type:"text",value:W});continue}if(W==="("){Q0("parens"),C({type:"paren",value:W});continue}if(W===")"){if(U.parens===0&&q.strictBrackets===!0)throw SyntaxError(Z0("opening","("));let Q=_[_.length-1];if(Q&&U.parens===Q.parens+1){i1(_.pop());continue}C({type:"paren",value:W,output:U.parens?")":"\\)"}),w0("parens");continue}if(W==="["){if(q.nobracket===!0||!a().includes("]")){if(q.nobracket!==!0&&q.strictBrackets===!0)throw SyntaxError(Z0("closing","]"));W=`\\${W}`}else Q0("brackets");C({type:"bracket",value:W});continue}if(W==="]"){if(q.nobracket===!0||Y&&Y.type==="bracket"&&Y.value.length===1){C({type:"text",value:W,output:`\\${W}`});continue}if(U.brackets===0){if(q.strictBrackets===!0)throw SyntaxError(Z0("opening","["));C({type:"text",value:W,output:`\\${W}`});continue}w0("brackets");let Q=Y.value.slice(1);if(Y.posix!==!0&&Q[0]==="^"&&!Q.includes("/"))W=`/${W}`;if(Y.value+=W,X0({value:W}),q.literalBrackets===!1||i.hasRegexChars(Q))continue;let I=i.escapeRegex(Y.value);if(U.output=U.output.slice(0,-Y.value.length),q.literalBrackets===!0){U.output+=I,Y.value=I;continue}Y.value=`(${F}${I}|${Y.value})`,U.output+=Y.value;continue}if(W==="{"&&q.nobrace!==!0){Q0("braces");let Q={type:"brace",value:W,output:"(",outputIndex:U.output.length,tokensIndex:U.tokens.length};O.push(Q),C(Q);continue}if(W==="}"){let Q=O[O.length-1];if(q.nobrace===!0||!Q){C({type:"text",value:W,output:W});continue}let I=")";if(Q.dots===!0){let T=V.slice(),l=[];for(let g=T.length-1;g>=0;g--){if(V.pop(),T[g].type==="brace")break;if(T[g].type!=="dots")l.unshift(T[g].value)}I=Qw(l,q),U.backtrack=!0}if(Q.comma!==!0&&Q.dots!==!0){let T=U.output.slice(0,Q.outputIndex),l=U.tokens.slice(Q.tokensIndex);Q.value=Q.output="\\{",W=I="\\}",U.output=T;for(let g of l)U.output+=g.output||g.value}C({type:"brace",value:W,output:I}),w0("braces"),O.pop();continue}if(W==="|"){if(_.length>0)_[_.length-1].conditions++;C({type:"text",value:W});continue}if(W===","){let Q=W,I=O[O.length-1];if(I&&o[o.length-1]==="braces")I.comma=!0,Q="|";C({type:"comma",value:W,output:Q});continue}if(W==="/"){if(Y.type==="dot"&&U.index===U.start+1){U.start=U.index+1,U.consumed="",U.output="",V.pop(),Y=Z;continue}C({type:"slash",value:W,output:H});continue}if(W==="."){if(U.braces>0&&Y.type==="dot"){if(Y.value===".")Y.output=j;let Q=O[O.length-1];Y.type="dots",Y.output+=W,Y.value+=W,Q.dots=!0;continue}if(U.braces+U.parens===0&&Y.type!=="bos"&&Y.type!=="slash"){C({type:"text",value:W,output:j});continue}C({type:"dot",value:W,output:j});continue}if(W==="?"){if(!(Y&&Y.value==="(")&&q.noextglob!==!0&&D()==="("&&D(2)!=="?"){B0("qmark",W);continue}if(Y&&Y.type==="paren"){let I=D(),T=W;if(I==="<"&&!i.supportsLookbehinds())throw Error("Node.js v10 or higher is required for regex lookbehinds");if(Y.value==="("&&!/[!=<:]/.test(I)||I==="<"&&!/<([!=]|\w+>)/.test(a()))T=`\\${W}`;C({type:"text",value:W,output:T});continue}if(q.dot!==!0&&(Y.type==="slash"||Y.type==="bos")){C({type:"qmark",value:W,output:n});continue}C({type:"qmark",value:W,output:S});continue}if(W==="!"){if(q.noextglob!==!0&&D()==="("){if(D(2)!=="?"||!/[!=<:]/.test(D(3))){B0("negate",W);continue}}if(q.nonegate!==!0&&U.index===0){r1();continue}}if(W==="+"){if(q.noextglob!==!0&&D()==="("&&D(2)!=="?"){B0("plus",W);continue}if(Y&&Y.value==="("||q.regex===!1){C({type:"plus",value:W,output:X});continue}if(Y&&(Y.type==="bracket"||Y.type==="paren"||Y.type==="brace")||U.parens>0){C({type:"plus",value:W});continue}C({type:"plus",value:X});continue}if(W==="@"){if(q.noextglob!==!0&&D()==="("&&D(2)!=="?"){C({type:"at",extglob:!0,value:W,output:""});continue}C({type:"text",value:W});continue}if(W!=="*"){if(W==="$"||W==="^")W=`\\${W}`;let Q=Uw.exec(a());if(Q)W+=Q[0],U.index+=Q[0].length;C({type:"text",value:W});continue}if(Y&&(Y.type==="globstar"||Y.star===!0)){Y.type="star",Y.star=!0,Y.value+=W,Y.output=k,U.backtrack=!0,U.globstar=!0,c(W);continue}let G=a();if(q.noextglob!==!0&&/^\([^?]/.test(G)){B0("star",W);continue}if(Y.type==="star"){if(q.noglobstar===!0){c(W);continue}let Q=Y.prev,I=Q.prev,T=Q.type==="slash"||Q.type==="bos",l=I&&(I.type==="star"||I.type==="globstar");if(q.bash===!0&&(!T||G[0]&&G[0]!=="/")){C({type:"star",value:W,output:""});continue}let g=U.braces>0&&(Q.type==="comma"||Q.type==="brace"),D0=_.length&&(Q.type==="pipe"||Q.type==="paren");if(!T&&Q.type!=="paren"&&!g&&!D0){C({type:"star",value:W,output:""});continue}while(G.slice(0,3)==="/**"){let N0=$[U.index+4];if(N0&&N0!=="/")break;G=G.slice(3),c("/**",3)}if(Q.type==="bos"&&m()){Y.type="globstar",Y.value+=W,Y.output=v(q),U.output=Y.output,U.globstar=!0,c(W);continue}if(Q.type==="slash"&&Q.prev.type!=="bos"&&!l&&m()){U.output=U.output.slice(0,-(Q.output+Y.output).length),Q.output=`(?:${Q.output}`,Y.type="globstar",Y.output=v(q)+(q.strictSlashes?")":"|$)"),Y.value+=W,U.globstar=!0,U.output+=Q.output+Y.output,c(W);continue}if(Q.type==="slash"&&Q.prev.type!=="bos"&&G[0]==="/"){let N0=G[1]!==void 0?"|$":"";U.output=U.output.slice(0,-(Q.output+Y.output).length),Q.output=`(?:${Q.output}`,Y.type="globstar",Y.output=`${v(q)}${H}|${H}${N0})`,Y.value+=W,U.output+=Q.output+Y.output,U.globstar=!0,c(W+p()),C({type:"slash",value:"/",output:""});continue}if(Q.type==="bos"&&G[0]==="/"){Y.type="globstar",Y.value+=W,Y.output=`(?:^|${H}|${v(q)}${H})`,U.output=Y.output,U.globstar=!0,c(W+p()),C({type:"slash",value:"/",output:""});continue}U.output=U.output.slice(0,-Y.output.length),Y.type="globstar",Y.output=v(q),Y.value+=W,U.output+=Y.output,U.globstar=!0,c(W);continue}let E={type:"star",value:W,output:k};if(q.bash===!0){if(E.output=".*?",Y.type==="bos"||Y.type==="slash")E.output=z+E.output;C(E);continue}if(Y&&(Y.type==="bracket"||Y.type==="paren")&&q.regex===!0){E.output=W,C(E);continue}if(U.index===U.start||Y.type==="slash"||Y.type==="dot"){if(Y.type==="dot")U.output+=A,Y.output+=A;else if(q.dot===!0)U.output+=u,Y.output+=u;else U.output+=z,Y.output+=z;if(D()!=="*")U.output+=y,Y.output+=y}C(E)}while(U.brackets>0){if(q.strictBrackets===!0)throw SyntaxError(Z0("closing","]"));U.output=i.escapeLast(U.output,"["),w0("brackets")}while(U.parens>0){if(q.strictBrackets===!0)throw SyntaxError(Z0("closing",")"));U.output=i.escapeLast(U.output,"("),w0("parens")}while(U.braces>0){if(q.strictBrackets===!0)throw SyntaxError(Z0("closing","}"));U.output=i.escapeLast(U.output,"{"),w0("braces")}if(q.strictSlashes!==!0&&(Y.type==="star"||Y.type==="bracket"))C({type:"maybe_slash",value:"",output:`${H}?`});if(U.backtrack===!0){U.output="";for(let G of U.tokens)if(U.output+=G.output!=null?G.output:G.value,G.suffix)U.output+=G.suffix}return U};g0.fastpaths=($,w)=>{let q={...w},J=typeof q.maxLength==="number"?Math.min(z0,q.maxLength):z0,f=$.length;if(f>J)throw SyntaxError(`Input length: ${f}, exceeds maximum allowed length: ${J}`);$=S1[$]||$;let Z=i.isWindows(w),{DOT_LITERAL:V,SLASH_LITERAL:F,ONE_CHAR:N,DOTS_SLASH:K,NO_DOT:B,NO_DOTS:j,NO_DOTS_SLASH:X,STAR:H,START_ANCHOR:y}=j0.globChars(Z),M=q.dot?j:B,L=q.dot?X:B,A=q.capture?"":"?:",u={negated:!1,prefix:""},S=q.bash===!0?".*?":H;if(q.capture)S=`(${S})`;let n=(z)=>{if(z.noglobstar===!0)return S;return`(${A}(?:(?!${y}${z.dot?K:V}).)*?)`},b=(z)=>{switch(z){case"*":return`${M}${N}${S}`;case".*":return`${V}${N}${S}`;case"*.*":return`${M}${S}${V}${N}${S}`;case"*/*":return`${M}${S}${F}${N}${L}${S}`;case"**":return M+n(q);case"**/*":return`(?:${M}${n(q)}${F})?${L}${N}${S}`;case"**/*.*":return`(?:${M}${n(q)}${F})?${L}${S}${V}${N}${S}`;case"**/.*":return`(?:${M}${n(q)}${F})?${V}${N}${S}`;default:{let P=/^(.*?)\.(\w+)$/.exec(z);if(!P)return;let k=b(P[1]);if(!k)return;return k+V+P[2]}}},e=i.removePrefix($,u),v=b(e);if(v&&q.strictSlashes!==!0)v+=`${F}?`;return v};x1.exports=g0});var k1=d((Aw,h1)=>{var Bw=t("path"),Nw=A1(),h0=g1(),k0=F0(),Gw=W0(),Mw=($)=>$&&typeof $==="object"&&!Array.isArray($),x=($,w,q=!1)=>{if(Array.isArray($)){let B=$.map((X)=>x(X,w,q));return(X)=>{for(let H of B){let y=H(X);if(y)return y}return!1}}let J=Mw($)&&$.tokens&&$.input;if($===""||typeof $!=="string"&&!J)throw TypeError("Expected pattern to be a non-empty string");let f=w||{},Z=k0.isWindows(w),V=J?x.compileRe($,w):x.makeRe($,w,!1,!0),F=V.state;delete V.state;let N=()=>!1;if(f.ignore){let B={...w,ignore:null,onMatch:null,onResult:null};N=x(f.ignore,B,q)}let K=(B,j=!1)=>{let{isMatch:X,match:H,output:y}=x.test(B,V,w,{glob:$,posix:Z}),M={glob:$,state:F,regex:V,posix:Z,input:B,output:y,match:H,isMatch:X};if(typeof f.onResult==="function")f.onResult(M);if(X===!1)return M.isMatch=!1,j?M:!1;if(N(B)){if(typeof f.onIgnore==="function")f.onIgnore(M);return M.isMatch=!1,j?M:!1}if(typeof f.onMatch==="function")f.onMatch(M);return j?M:!0};if(q)K.state=F;return K};x.test=($,w,q,{glob:J,posix:f}={})=>{if(typeof $!=="string")throw TypeError("Expected input to be a string");if($==="")return{isMatch:!1,output:""};let Z=q||{},V=Z.format||(f?k0.toPosixSlashes:null),F=$===J,N=F&&V?V($):$;if(F===!1)N=V?V($):$,F=N===J;if(F===!1||Z.capture===!0)if(Z.matchBase===!0||Z.basename===!0)F=x.matchBase($,w,q,f);else F=w.exec(N);return{isMatch:Boolean(F),match:F,output:N}};x.matchBase=($,w,q,J=k0.isWindows(q))=>{return(w instanceof RegExp?w:x.makeRe(w,q)).test(Bw.basename($))};x.isMatch=($,w,q)=>x(w,q)($);x.parse=($,w)=>{if(Array.isArray($))return $.map((q)=>x.parse(q,w));return h0($,{...w,fastpaths:!1})};x.scan=($,w)=>Nw($,w);x.compileRe=($,w,q=!1,J=!1)=>{if(q===!0)return $.output;let f=w||{},Z=f.contains?"":"^",V=f.contains?"":"$",F=`${Z}(?:${$.output})${V}`;if($&&$.negated===!0)F=`^(?!${F}).*$`;let N=x.toRegex(F,w);if(J===!0)N.state=$;return N};x.makeRe=($,w={},q=!1,J=!1)=>{if(!$||typeof $!=="string")throw TypeError("Expected a non-empty string");let f={negated:!1,fastpaths:!0};if(w.fastpaths!==!1&&($[0]==="."||$[0]==="*"))f.output=h0.fastpaths($,w);if(!f.output)f=h0($,w);return x.compileRe(f,w,q,J)};x.toRegex=($,w)=>{try{let q=w||{};return new RegExp($,q.flags||(q.nocase?"i":""))}catch(q){if(w&&w.debug===!0)throw q;return/$^/}};x.constants=Gw;h1.exports=x});var u1=d((Sw,l1)=>{var d1=t("util"),v1=z1(),s=k1(),b0=F0(),b1=($)=>$===""||$==="./",m1=($)=>{let w=$.indexOf("{");return w>-1&&$.indexOf("}",w)>-1},R=($,w,q)=>{w=[].concat(w),$=[].concat($);let J=new Set,f=new Set,Z=new Set,V=0,F=(B)=>{if(Z.add(B.output),q&&q.onResult)q.onResult(B)};for(let B=0;B<w.length;B++){let j=s(String(w[B]),{...q,onResult:F},!0),X=j.state.negated||j.state.negatedExtglob;if(X)V++;for(let H of $){let y=j(H,!0);if(!(X?!y.isMatch:y.isMatch))continue;if(X)J.add(y.output);else J.delete(y.output),f.add(y.output)}}let K=(V===w.length?[...Z]:[...f]).filter((B)=>!J.has(B));if(q&&K.length===0){if(q.failglob===!0)throw Error(`No matches found for "${w.join(", ")}"`);if(q.nonull===!0||q.nullglob===!0)return q.unescape?w.map((B)=>B.replace(/\\/g,"")):w}return K};R.match=R;R.matcher=($,w)=>s($,w);R.isMatch=($,w,q)=>s(w,q)($);R.any=R.isMatch;R.not=($,w,q={})=>{w=[].concat(w).map(String);let J=new Set,f=[],V=new Set(R($,w,{...q,onResult:(F)=>{if(q.onResult)q.onResult(F);f.push(F.output)}}));for(let F of f)if(!V.has(F))J.add(F);return[...J]};R.contains=($,w,q)=>{if(typeof $!=="string")throw TypeError(`Expected a string: "${d1.inspect($)}"`);if(Array.isArray(w))return w.some((J)=>R.contains($,J,q));if(typeof w==="string"){if(b1($)||b1(w))return!1;if($.includes(w)||$.startsWith("./")&&$.slice(2).includes(w))return!0}return R.isMatch($,w,{...q,contains:!0})};R.matchKeys=($,w,q)=>{if(!b0.isObject($))throw TypeError("Expected the first argument to be an object");let J=R(Object.keys($),w,q),f={};for(let Z of J)f[Z]=$[Z];return f};R.some=($,w,q)=>{let J=[].concat($);for(let f of[].concat(w)){let Z=s(String(f),q);if(J.some((V)=>Z(V)))return!0}return!1};R.every=($,w,q)=>{let J=[].concat($);for(let f of[].concat(w)){let Z=s(String(f),q);if(!J.every((V)=>Z(V)))return!1}return!0};R.all=($,w,q)=>{if(typeof $!=="string")throw TypeError(`Expected a string: "${d1.inspect($)}"`);return[].concat(w).every((J)=>s(J,q)($))};R.capture=($,w,q)=>{let J=b0.isWindows(q),Z=s.makeRe(String($),{...q,capture:!0}).exec(J?b0.toPosixSlashes(w):w);if(Z)return Z.slice(1).map((V)=>V===void 0?"":V)};R.makeRe=(...$)=>s.makeRe(...$);R.scan=(...$)=>s.scan(...$);R.parse=($,w)=>{let q=[];for(let J of[].concat($||[]))for(let f of v1(String(J),w))q.push(s.parse(f,w));return q};R.braces=($,w)=>{if(typeof $!=="string")throw TypeError("Expected a string");if(w&&w.nobrace===!0||!m1($))return[$];return v1($,w)};R.braceExpand=($,w)=>{if(typeof $!=="string")throw TypeError("Expected a string");return R.braces($,{...w,expand:!0})};R.hasBraces=m1;l1.exports=R});var c1=yw(u1(),1);var I0;((J)=>{J.ALLOW="allow";J.ASK="ask";J.DENY="deny"})(I0||={});var gw=h.object({tool:h.string(),specifier:h.string().optional(),action:h.nativeEnum(I0)}),hw=h.object({allow:h.array(h.string()).optional(),ask:h.array(h.string()).optional(),deny:h.array(h.string()).optional(),defaultMode:h.nativeEnum(I0).optional()}),kw=h.object({name:h.string(),args:h.record(h.string(),h.any())});class f0{rules;defaultMode;patternCache=new Map;constructor($){this.rules=$.rules,this.defaultMode=$.defaultMode||"ask",this.rules.sort((w,q)=>{let J={deny:0,ask:1,allow:2},f=J[w.action]-J[q.action];if(f!==0)return f;let Z=w.specifier==null?1:0,V=q.specifier==null?1:0;return Z-V})}checkPermission($){for(let w of this.rules)if(this.matchRule(w,$))return{allowed:w.action==="allow"||w.action==="ask",requiresApproval:w.action==="ask",matchedRule:w,reason:this.getReason(w)};return{allowed:this.defaultMode==="allow"||this.defaultMode==="ask",requiresApproval:this.defaultMode==="ask",reason:`No matching rule, using default mode: ${this.defaultMode}`}}matchRule($,w){if($.tool!==w.name)return!1;if(!$.specifier)return!0;let q=this.argsToString(w.args);if(w.name==="Bash")return this.matchBashCommand($.specifier,q);if($.specifier.endsWith(" ")&&!/[*?[\\]/.test($.specifier))return q.startsWith($.specifier);return this.matchGlob($.specifier,q)}matchBashCommand($,w){if(/[;&|]/.test(w))return!1;let J=/[<>()]/;if(J.test(w)){let f=w.split(J)[0].trim();return this.matchBashPattern($,f)}return this.matchBashPattern($,w)}matchBashPattern($,w){if($.endsWith(" "))return w.startsWith($);return this.matchGlob($,w)}matchGlob($,w){try{let q=$.replace(/^\.\//,""),J=w.replace(/^\.\//,""),f=`${$}::${w}`,Z=this.patternCache.get(f);if(Z!==void 0)return Z;let V=c1.default.isMatch(J,q,{nocase:!1,dot:!0});return this.cacheResult(f,V),V}catch(q){return w===$}}cacheResult($,w){if(this.patternCache.size>1000){let q=this.patternCache.keys().next().value;if(q)this.patternCache.delete(q)}this.patternCache.set($,w)}argsToString($){if(typeof $==="object"&&$!==null){if("command"in $&&$.command)return String($.command);if("file_path"in $&&$.file_path)return String($.file_path);return Object.values($).flat().join(" ")}return String($)}getReason($){let w=$.action.toUpperCase(),q=$.tool,J=$.specifier?`(${$.specifier})`:"";return`${w} rule matched: ${q}${J}`}static parseRule($,w){let q=$.match(/^(\w+)(?:\((.*)\))?$/);if(!q)throw Error(`Invalid permission rule format: ${$}`);let[,J,f]=q;return{tool:J,specifier:f,action:w}}static fromConfig($){let w=[];for(let q of $.allow||[])w.push(f0.parseRule(q,"allow"));for(let q of $.ask||[])w.push(f0.parseRule(q,"ask"));for(let q of $.deny||[])w.push(f0.parseRule(q,"deny"));return new f0({rules:w,defaultMode:$.defaultMode||"ask"})}clearCache(){this.patternCache.clear()}getCacheSize(){return this.patternCache.size}}class $0{configStore;toolNameMapper={};constructor($){this.configStore=$}static instance=null;static getInstance($){if(!$0.instance){if(!$)throw Error("PermissionStore not initialized. Provide configStore on first call.");$0.instance=new $0($)}return $0.instance}static resetInstance(){$0.instance=null}async getPermissions(){let $=await this.configStore.getConfig();if($.permissions)return f0.fromConfig($.permissions);return}async checkBashPermission($,w){return(await this.getPermissions())?.checkPermission({name:"Bash",args:{command:$,cwd:w}})}async checkReadPermission($){return(await this.getPermissions())?.checkPermission({name:"Read",args:{file_path:$}})}async checkWritePermission($){return(await this.getPermissions())?.checkPermission({name:"Write",args:{file_path:$}})}}class C0{configStore;skillStore;pluginStore;remoteStore;permissionStore;_initialized=!1;constructor($,w,q,J){this.configStore=$,this.skillStore=w,this.pluginStore=q,this.remoteStore=J,this.permissionStore=$0.getInstance($)}async initialize(){if(this._initialized)return;if("initialize"in this.configStore&&typeof this.configStore.initialize==="function")await this.configStore.initialize();if("initialize"in this.skillStore&&typeof this.skillStore.initialize==="function")await this.skillStore.initialize();if("initialize"in this.pluginStore&&typeof this.pluginStore.initialize==="function")await this.pluginStore.initialize();this._initialized=!0}async ensureInitialized(){if(!this._initialized)throw Error("ConfigManager not initialized. Call await manager.initialize() first.")}async getConfig(){return await this.ensureInitialized(),await this.configStore.getConfig()}async updateConfig($){return await this.ensureInitialized(),await this.configStore.updateConfig($)}async listSkills(){return await this.ensureInitialized(),await this.skillStore.listSkills()}async getSkill($){return await this.ensureInitialized(),await this.skillStore.getSkill($)}async saveSkill($,w){return await this.ensureInitialized(),await this.skillStore.saveSkill($,w)}async deleteSkill($){return await this.ensureInitialized(),await this.skillStore.deleteSkill($)}async syncSkillsFromRemote(){if(await this.ensureInitialized(),!this.remoteStore)throw Error("Remote store not configured");return await this.skillStore.syncFromRemote(this.remoteStore)}async listPlugins(){return await this.ensureInitialized(),await this.pluginStore.listPlugins()}async getPluginConfig($){return await this.ensureInitialized(),await this.pluginStore.getPluginConfig($)}async updatePluginConfig($,w){return await this.ensureInitialized(),await this.pluginStore.updatePluginConfig($,w)}async installPlugin($,w){return await this.ensureInitialized(),await this.pluginStore.installPlugin($,w)}async uninstallPlugin($){return await this.ensureInitialized(),await this.pluginStore.uninstallPlugin($)}async checkBashPermission($,w){return await this.ensureInitialized(),await this.permissionStore.checkBashPermission($,w)}async checkReadPermission($){return await this.ensureInitialized(),await this.permissionStore.checkReadPermission($)}async checkWritePermission($){return await this.ensureInitialized(),await this.permissionStore.checkWritePermission($)}async getPermissionMatcher(){return await this.ensureInitialized(),await this.permissionStore.getPermissions()}getConfigPath(){return this.configStore?.dbPath}}async function ow(){let{FileSystemConfigStore:$}=await import("./chunk-b9emn03n.js"),{FileSystemSkillStore:w}=await import("./chunk-gkvx829z.js"),{FileSystemPluginStore:q}=await import("./chunk-h0qb9jk1.js"),J=new $,f=new w,Z=new q,V=new C0(J,f,Z);return await V.initialize(),V}async function tw($){let{configStore:w,skillStore:q,pluginStore:J,remoteStore:f}=$,Z=new C0(w,q,J,f);return await Z.initialize(),Z}
18
+ export{ow as kf,tw as lf};
@@ -1,2 +1,2 @@
1
- import{ye as JJ}from"./chunk-a90fm6gz.js";import{pq as g,qq as y}from"./chunk-dcs1r9as.js";var C=y((XJ,E)=>{var f="Expected a function",w=NaN,V="[object Symbol]",S=/^\s+|\s+$/g,v=/^[-+]0x[0-9a-f]+$/i,p=/^0b[01]+$/i,d=/^0o[0-7]+$/i,c=parseInt,r=typeof global=="object"&&global&&global.Object===Object&&global,u=typeof self=="object"&&self&&self.Object===Object&&self,o=r||u||Function("return this")(),s=Object.prototype,n=s.toString,l=Math.max,i=Math.min,N=function(){return o.Date.now()};function a(J,Z,$){var Y,j,G,B,Q,P,q=0,F=!1,U=!1,W=!0;if(typeof J!="function")throw TypeError(f);if(Z=I(Z)||0,L($))F=!!$.leading,U="maxWait"in $,G=U?l(I($.maxWait)||0,Z):G,W="trailing"in $?!!$.trailing:W;function _(K){var H=Y,A=j;return Y=j=void 0,q=K,B=J.apply(A,H),B}function h(K){return q=K,Q=setTimeout(D,Z),F?_(K):B}function b(K){var H=K-P,A=K-q,R=Z-H;return U?i(R,G-A):R}function T(K){var H=K-P,A=K-q;return P===void 0||H>=Z||H<0||U&&A>=G}function D(){var K=N();if(T(K))return z(K);Q=setTimeout(D,b(K))}function z(K){if(Q=void 0,W&&Y)return _(K);return Y=j=void 0,B}function m(){if(Q!==void 0)clearTimeout(Q);q=0,Y=P=j=Q=void 0}function k(){return Q===void 0?B:z(N())}function O(){var K=N(),H=T(K);if(Y=arguments,j=this,P=K,H){if(Q===void 0)return h(P);if(U)return Q=setTimeout(D,Z),_(P)}if(Q===void 0)Q=setTimeout(D,Z);return B}return O.cancel=m,O.flush=k,O}function L(J){var Z=typeof J;return!!J&&(Z=="object"||Z=="function")}function t(J){return!!J&&typeof J=="object"}function e(J){return typeof J=="symbol"||t(J)&&n.call(J)==V}function I(J){if(typeof J=="number")return J;if(e(J))return w;if(L(J)){var Z=typeof J.valueOf=="function"?J.valueOf():J;J=L(Z)?Z+"":Z}if(typeof J!="string")return J===0?J:+J;J=J.replace(S,"");var $=p.test(J);return $||d.test(J)?c(J.slice(2),$?2:8):v.test(J)?w:+J}E.exports=a});var X=g(JJ(),1),M=g(C(),1);function YJ(J=!1){if(typeof J!=="boolean")throw Error("defaultValue must be `true` or `false`");let[Z,$]=X.useState(J),Y=X.useCallback(()=>{$(!0)},[]),j=X.useCallback(()=>{$(!1)},[]),G=X.useCallback(()=>{$((B)=>!B)},[]);return{value:Z,setValue:$,setTrue:Y,setFalse:j,toggle:G}}var x=typeof window<"u"?X.useLayoutEffect:X.useEffect;function KJ(J,Z){let $=X.useRef(J);x(()=>{$.current=J},[J]),X.useEffect(()=>{if(Z===null)return;let Y=setInterval(()=>{$.current()},Z);return()=>{clearInterval(Y)}},[Z])}function QJ(J){let Z=X.useRef(()=>{throw Error("Cannot call an event handler while rendering.")});return x(()=>{Z.current=J},[J]),X.useCallback((...$)=>{var Y;return(Y=Z.current)==null?void 0:Y.call(Z,...$)},[Z])}function ZJ(J){let Z=X.useRef(J);Z.current=J,X.useEffect(()=>()=>{Z.current()},[])}function $J(J,Z=500,$){let Y=X.useRef();ZJ(()=>{if(Y.current)Y.current.cancel()});let j=X.useMemo(()=>{let G=M.default(J,Z,$),B=(...Q)=>{return G(...Q)};return B.cancel=()=>{G.cancel()},B.isPending=()=>{return!!Y.current},B.flush=()=>{return G.flush()},B},[J,Z,$]);return X.useEffect(()=>{Y.current=M.default(J,Z,$)},[J,Z,$]),j}function jJ(J,Z,$){let Y=($==null?void 0:$.equalityFn)??((q,F)=>q===F),j=J instanceof Function?J():J,[G,B]=X.useState(j),Q=X.useRef(j),P=$J(B,Z,$);if(!Y(Q.current,j))P(j),Q.current=j;return[G,P]}function BJ(){let J=X.useRef(!1);return X.useEffect(()=>{return J.current=!0,()=>{J.current=!1}},[]),X.useCallback(()=>J.current,[])}function GJ(J,Z){let $=X.useRef(J);x(()=>{$.current=J},[J]),X.useEffect(()=>{if(!Z&&Z!==0)return;let Y=setTimeout(()=>{$.current()},Z);return()=>{clearTimeout(Y)}},[Z])}
2
- export{YJ as B,KJ as C,QJ as D,ZJ as E,jJ as F,BJ as G,GJ as H};
1
+ import{ye as JJ}from"./chunk-1v863afn.js";import{Fl as g,Hl as y}from"./chunk-z3e4c424.js";var C=y((XJ,E)=>{var f="Expected a function",w=NaN,V="[object Symbol]",S=/^\s+|\s+$/g,v=/^[-+]0x[0-9a-f]+$/i,p=/^0b[01]+$/i,d=/^0o[0-7]+$/i,c=parseInt,r=typeof global=="object"&&global&&global.Object===Object&&global,u=typeof self=="object"&&self&&self.Object===Object&&self,o=r||u||Function("return this")(),s=Object.prototype,n=s.toString,l=Math.max,i=Math.min,N=function(){return o.Date.now()};function a(J,Z,$){var Y,j,G,B,Q,P,q=0,F=!1,U=!1,W=!0;if(typeof J!="function")throw TypeError(f);if(Z=I(Z)||0,L($))F=!!$.leading,U="maxWait"in $,G=U?l(I($.maxWait)||0,Z):G,W="trailing"in $?!!$.trailing:W;function _(K){var H=Y,A=j;return Y=j=void 0,q=K,B=J.apply(A,H),B}function h(K){return q=K,Q=setTimeout(D,Z),F?_(K):B}function b(K){var H=K-P,A=K-q,R=Z-H;return U?i(R,G-A):R}function T(K){var H=K-P,A=K-q;return P===void 0||H>=Z||H<0||U&&A>=G}function D(){var K=N();if(T(K))return z(K);Q=setTimeout(D,b(K))}function z(K){if(Q=void 0,W&&Y)return _(K);return Y=j=void 0,B}function m(){if(Q!==void 0)clearTimeout(Q);q=0,Y=P=j=Q=void 0}function k(){return Q===void 0?B:z(N())}function O(){var K=N(),H=T(K);if(Y=arguments,j=this,P=K,H){if(Q===void 0)return h(P);if(U)return Q=setTimeout(D,Z),_(P)}if(Q===void 0)Q=setTimeout(D,Z);return B}return O.cancel=m,O.flush=k,O}function L(J){var Z=typeof J;return!!J&&(Z=="object"||Z=="function")}function t(J){return!!J&&typeof J=="object"}function e(J){return typeof J=="symbol"||t(J)&&n.call(J)==V}function I(J){if(typeof J=="number")return J;if(e(J))return w;if(L(J)){var Z=typeof J.valueOf=="function"?J.valueOf():J;J=L(Z)?Z+"":Z}if(typeof J!="string")return J===0?J:+J;J=J.replace(S,"");var $=p.test(J);return $||d.test(J)?c(J.slice(2),$?2:8):v.test(J)?w:+J}E.exports=a});var X=g(JJ(),1),M=g(C(),1);function YJ(J=!1){if(typeof J!=="boolean")throw Error("defaultValue must be `true` or `false`");let[Z,$]=X.useState(J),Y=X.useCallback(()=>{$(!0)},[]),j=X.useCallback(()=>{$(!1)},[]),G=X.useCallback(()=>{$((B)=>!B)},[]);return{value:Z,setValue:$,setTrue:Y,setFalse:j,toggle:G}}var x=typeof window<"u"?X.useLayoutEffect:X.useEffect;function KJ(J,Z){let $=X.useRef(J);x(()=>{$.current=J},[J]),X.useEffect(()=>{if(Z===null)return;let Y=setInterval(()=>{$.current()},Z);return()=>{clearInterval(Y)}},[Z])}function QJ(J){let Z=X.useRef(()=>{throw Error("Cannot call an event handler while rendering.")});return x(()=>{Z.current=J},[J]),X.useCallback((...$)=>{var Y;return(Y=Z.current)==null?void 0:Y.call(Z,...$)},[Z])}function ZJ(J){let Z=X.useRef(J);Z.current=J,X.useEffect(()=>()=>{Z.current()},[])}function $J(J,Z=500,$){let Y=X.useRef();ZJ(()=>{if(Y.current)Y.current.cancel()});let j=X.useMemo(()=>{let G=M.default(J,Z,$),B=(...Q)=>{return G(...Q)};return B.cancel=()=>{G.cancel()},B.isPending=()=>{return!!Y.current},B.flush=()=>{return G.flush()},B},[J,Z,$]);return X.useEffect(()=>{Y.current=M.default(J,Z,$)},[J,Z,$]),j}function jJ(J,Z,$){let Y=($==null?void 0:$.equalityFn)??((q,F)=>q===F),j=J instanceof Function?J():J,[G,B]=X.useState(j),Q=X.useRef(j),P=$J(B,Z,$);if(!Y(Q.current,j))P(j),Q.current=j;return[G,P]}function BJ(){let J=X.useRef(!1);return X.useEffect(()=>{return J.current=!0,()=>{J.current=!1}},[]),X.useCallback(()=>J.current,[])}function GJ(J,Z){let $=X.useRef(J);x(()=>{$.current=J},[J]),X.useEffect(()=>{if(!Z&&Z!==0)return;let Y=setTimeout(()=>{$.current()},Z);return()=>{clearTimeout(Y)}},[Z])}
2
+ export{YJ as L,KJ as M,QJ as N,ZJ as O,jJ as P,BJ as Q,GJ as R};