11 lines
1.2 MiB
JavaScript
Raw Permalink Normal View History

2026-03-10 06:14:12 +00:00
import './sourcemap-register.cjs';import{createRequire as e}from"module";var t={3311:function(e,t){var r=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,s){function fulfilled(e){try{step(n.next(e))}catch(e){s(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){s(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.ClientStreamingCall=void 0;class ClientStreamingCall{constructor(e,t,r,n,s,i,o){this.method=e;this.requestHeaders=t;this.requests=r;this.headers=n;this.response=s;this.status=i;this.trailers=o}then(e,t){return this.promiseFinished().then((t=>e?Promise.resolve(e(t)):t),(e=>t?Promise.resolve(t(e)):Promise.reject(e)))}promiseFinished(){return r(this,void 0,void 0,(function*(){let[e,t,r,n]=yield Promise.all([this.headers,this.response,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,headers:e,response:t,status:r,trailers:n}}))}}t.ClientStreamingCall=ClientStreamingCall},9499:(e,t)=>{Object.defineProperty(t,"__esModule",{value:true});t.Deferred=t.DeferredState=void 0;var r;(function(e){e[e["PENDING"]=0]="PENDING";e[e["REJECTED"]=1]="REJECTED";e[e["RESOLVED"]=2]="RESOLVED"})(r=t.DeferredState||(t.DeferredState={}));class Deferred{constructor(e=true){this._state=r.PENDING;this._promise=new Promise(((e,t)=>{this._resolve=e;this._reject=t}));if(e){this._promise.catch((e=>{}))}}get state(){return this._state}get promise(){return this._promise}resolve(e){if(this.state!==r.PENDING)throw new Error(`cannot resolve ${r[this.state].toLowerCase()}`);this._resolve(e);this._state=r.RESOLVED}reject(e){if(this.state!==r.PENDING)throw new Error(`cannot reject ${r[this.state].toLowerCase()}`);this._reject(e);this._state=r.REJECTED}resolvePending(e){if(this._state===r.PENDING)this.resolve(e)}rejectPending(e){if(this._state===r.PENDING)this.reject(e)}}t.Deferred=Deferred},800:function(e,t){var r=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r((function(t){t(e)}))}return new(r||(r=Promise))((function(r,s){function fulfilled(e){try{step(n.next(e))}catch(e){s(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){s(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});t.DuplexStreamingCall=void 0;class DuplexStreamingCall{constructor(e,t,r,n,s,i,o){this.method=e;this.requestHeaders=t;this.requests=r;this.headers=n;this.responses=s;this.status=i;this.trailers=o}then(e,t){return this.promiseFinished().then((t=>e?Promise.resolve(e(t)):t),(e=>t?Promise.resolve(t(e)):Promise.reject(e)))}promiseFinished(){return r(this,void 0,void 0,(function*(){let[e,t,r]=yield Promise.all([this.headers,this.status,this.trailers]);return{method:this.method,requestHeaders:this.requestHeaders,headers:e,status:t,trailers:r}}))}}t.DuplexStreamingCall=DuplexStreamingCall},6762:(e,t,r)=>{var n;n={value:true};var s=r(2554);Object.defineProperty(t,"C0",{enumerable:true,get:function(){return s.ServiceType}});var i=r(3402);n={enumerable:true,get:function(){return i.readMethodOptions}};n={enumerable:true,get:function(){return i.readMethodOption}};n={enumerable:true,get:function(){return i.readServiceOption}};var o=r(422);n={enumerable:true,get:function(){return o.RpcError}};var a=r(3474);n={enumerable:true,get:function(){return a.mergeRpcOptions}};var c=r(6407);n={enumerable:true,get:function(){return c.RpcOutputStreamController}};var l=r(5435);n={enumerable:true,get:function(){return l.TestTransport}};var A=r(9499);n={enumerable:true,get:function(){return A.Deferred}};n={enumerable:true,get:function(){return A.DeferredState}};var u=r(800);n={enumerable:true,get:function(){return u.DuplexStreamingCall}};var d=r(3311);n={enumerable:true,get:function(){return d.ClientStreamingCall}};var m=r(2715);n={enumerable:true,get:function(){return m.ServerStreamingCall}}
/*!
* Tmp
*
* Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
*
* MIT Licensed
2026-03-10 06:14:12 +00:00
*/const s=r(9896);const i=r(857);const o=r(6928);const a=r(6982);const c={fs:s.constants,os:i.constants};const l="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",A=/XXXXXX/,u=3,d=(c.O_CREAT||c.fs.O_CREAT)|(c.O_EXCL||c.fs.O_EXCL)|(c.O_RDWR||c.fs.O_RDWR),m=i.platform()==="win32",p=c.EBADF||c.os.errno.EBADF,g=c.ENOENT||c.os.errno.ENOENT,h=448,f=384,y="exit",C=[],E=s.rmdirSync.bind(s);let I=false;function rimraf(e,t){return s.rm(e,{recursive:true},t)}function FN_RIMRAF_SYNC(e){return s.rmSync(e,{recursive:true})}function tmpName(e,t){const r=_parseArguments(e,t),n=r[0],i=r[1];_assertAndSanitizeOptions(n,(function(e,t){if(e)return i(e);let r=t.tries;(function _getUniqueName(){try{const e=_generateTmpName(t);s.stat(e,(function(t){if(!t){if(r-- >0)return _getUniqueName();return i(new Error("Could not get a unique tmp filename, max tries reached "+e))}i(null,e)}))}catch(e){i(e)}})()}))}function tmpNameSync(e){const t=_parseArguments(e),r=t[0];const n=_assertAndSanitizeOptionsSync(r);let i=n.tries;do{const e=_generateTmpName(n);try{s.statSync(e)}catch(t){return e}}while(i-- >0);throw new Error("Could not get a unique tmp filename, max tries reached")}function file(e,t){const r=_parseArguments(e,t),n=r[0],i=r[1];tmpName(n,(function _tmpNameCreated(e,t){if(e)return i(e);s.open(t,d,n.mode||f,(function _fileCreated(e,r){if(e)return i(e);if(n.discardDescriptor){return s.close(r,(function _discardCallback(e){return i(e,t,undefined,_prepareTmpFileRemoveCallback(t,-1,n,false))}))}else{const e=n.discardDescriptor||n.detachDescriptor;i(null,t,r,_prepareTmpFileRemoveCallback(t,e?-1:r,n,false))}}))}))}function fileSync(e){const t=_parseArguments(e),r=t[0];const n=r.discardDescriptor||r.detachDescriptor;const i=tmpNameSync(r);let o=s.openSync(i,d,r.mode||f);if(r.discardDescriptor){s.closeSync(o);o=undefined}return{name:i,fd:o,removeCallback:_prepareTmpFileRemoveCallback(i,n?-1:o,r,true)}}function dir(e,t){const r=_parseArguments(e,t),n=r[0],i=r[1];tmpName(n,(function _tmpNameCreated(e,t){if(e)return i(e);s.mkdir(t,n.mode||h,(function _dirCreated(e){if(e)return i(e);i(null,t,_prepareTmpDirRemoveCallback(t,n,false))}))}))}function dirSync(e){const t=_parseArguments(e),r=t[0];const n=tmpNameSync(r);s.mkdirSync(n,r.mode||h);return{name:n,removeCallback:_prepareTmpDirRemoveCallback(n,r,true)}}function _removeFileAsync(e,t){const _handler=function(e){if(e&&!_isENOENT(e)){return t(e)}t()};if(0<=e[0])s.close(e[0],(function(){s.unlink(e[1],_handler)}));else s.unlink(e[1],_handler)}function _removeFileSync(e){let t=null;try{if(0<=e[0])s.closeSync(e[0])}catch(e){if(!_isEBADF(e)&&!_isENOENT(e))throw e}finally{try{s.unlinkSync(e[1])}catch(e){if(!_isENOENT(e))t=e}}if(t!==null){throw t}}function _prepareTmpFileRemoveCallback(e,t,r,n){const s=_prepareRemoveCallback(_removeFileSync,[t,e],n);const i=_prepareRemoveCallback(_removeFileAsync,[t,e],n,s);if(!r.keep)C.unshift(s);return n?s:i}function _prepareTmpDirRemoveCallback(e,t,r){const n=t.unsafeCleanup?rimraf:s.rmdir.bind(s);const i=t.unsafeCleanup?FN_RIMRAF_SYNC:E;const o=_prepareRemoveCallback(i,e,r);const a=_prepareRemoveCallback(n,e,r,o);if(!t.keep)C.unshift(o);return r?o:a}function _prepareRemoveCallback(e,t,r,n){let s=false;return function _cleanupCallback(i){if(!s){const o=n||_cleanupCallback;const a=C.indexOf(o);if(a>=0)C.splice(a,1);s=true;if(r||e===E||e===FN_RIMRAF_SYNC){return e(t)}else{return e(t,i||function(){})}}}}function _garbageCollector(){if(!I)return;while(C.length){try{C[0]()}catch(e){}}}function _randomChars(e){let t=[],r=null;try{r=a.randomBytes(e)}catch(t){r=a.pseudoRandomBytes(e)}for(let n=0;n<e;n++){t.push(l[r[n]%l.length])}return t.join("")}function _isUndefined(e){return typeof e==="undefined"}function _parseArguments(e,t){if(typeof e==="function"){return[{},e]}if(_isUndefined(e)){return[{},t]}const r={};for(const t of Object.getOwnPropertyNames(e)){r[t]=e[t]}return[r,t]}function _resolvePath(e,t,r){const n=o.isAbsolute(e)?e:o.join(t,e);s.stat(n,(function(e){if(e){s.realpath(o.dirname(n),(function(e,t){if(e)return r(e);r(null,o.join(t,o.basename(n)))}))}else{s.real
/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */;const escape=e=>e.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22");const normalizeLinefeeds=e=>e.replace(/\r?\n|\r/g,"\r\n");const n=[];const s=new Uint8Array([13,10]);A=0;let i=false;for(const[t,o]of e){if(typeof o==="string"){const e=Q.encode(r+`; name="${escape(normalizeLinefeeds(t))}"`+`\r\n\r\n${normalizeLinefeeds(o)}\r\n`);n.push(e);A+=e.byteLength}else{const e=Q.encode(`${r}; name="${escape(normalizeLinefeeds(t))}"`+(o.name?`; filename="${escape(o.name)}"`:"")+"\r\n"+`Content-Type: ${o.type||"application/octet-stream"}\r\n\r\n`);n.push(e,o,s);if(typeof o.size==="number"){A+=e.byteLength+o.size+s.byteLength}else{i=true}}}const o=Q.encode(`--${t}--\r\n`);n.push(o);A+=o.byteLength;if(i){A=null}l=e;c=async function*(){for(const e of n){if(e.stream){yield*e.stream()}else{yield e}}};u=`multipart/form-data; boundary=${t}`}else if(i(e)){l=e;A=e.size;if(e.type){u=e.type}}else if(typeof e[Symbol.asyncIterator]==="function"){if(t){throw new TypeError("keepalive")}if(n.isDisturbed(e)||e.locked){throw new TypeError("Response body object should not be disturbed or locked")}r=e instanceof ReadableStream?e:s(e)}if(typeof l==="string"||n.isBuffer(l)){A=Buffer.byteLength(l)}if(c!=null){let t;r=new ReadableStream({async start(){t=c(e)[Symbol.asyncIterator]()},async pull(e){const{value:n,done:s}=await t.next();if(s){queueMicrotask((()=>{e.close();e.byobRequest?.respond(0)}))}else{if(!f(r)){const t=new Uint8Array(n);if(t.byteLength){e.enqueue(t)}}}return e.desiredSize>0},async cancel(e){await t.return()},type:"bytes"})}const d={stream:r,source:l,length:A};return[d,u]}function safelyExtractBody(e,t=false){if(e instanceof ReadableStream){h(!n.isDisturbed(e),"The body has already been consumed.");h(!e.locked,"The stream is locked.")}return extractBody(e,t)}function cloneBody(e,t){const[r,n]=t.stream.tee();t.stream=r;return{stream:n,length:t.length,source:t.source}}function throwIfAborted(e){if(e.aborted){throw new DOMException("The operation was aborted.","AbortError")}}function bodyMixinMethods(e){const t={blob(){return consumeBody(this,(e=>{let t=bodyMimeType(this);if(t===null){t=""}else if(t){t=E(t)}return new g([e],{type:t})}),e)},arrayBuffer(){return consumeBody(this,(e=>new Uint8Array(e).buffer),e)},text(){return consumeBody(this,u,e)},json(){return consumeBody(this,parseJSONFromBytes,e)},formData(){return consumeBody(this,(e=>{const t=bodyMimeType(this);if(t!==null){switch(t.essence){case"multipart/form-data":{const r=I(e,t);if(r==="failure"){throw new TypeError("Failed to parse body as FormData.")}const n=new d;n[m]=r;return n}case"application/x-www-form-urlencoded":{const t=new URLSearchParams(e.toString());const r=new d;for(const[e,n]of t){r.append(e,n)}return r}}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')}),e)},bytes(){return consumeBody(this,(e=>new Uint8Array(e)),e)}};return t}function mixinBody(e){Object.assign(e.prototype,bodyMixinMethods(e))}async function consumeBody(e,t,r){p.brandCheck(e,r);if(bodyUnusable(e)){throw new TypeError("Body is unusable: Body has already been read")}throwIfAborted(e[m]);const n=c();const errorSteps=e=>n.reject(e);const successSteps=e=>{try{n.resolve(t(e))}catch(e){errorSteps(e)}};if(e[m].body==null){successSteps(Buffer.allocUnsafe(0));return n.promise}await l(e[m].body,successSteps,errorSteps);return n.promise}function bodyUnusable(e){const t=e[m].body;return t!=null&&(t.stream.locked||n.isDisturbed(t.stream))}function parseJSONFromBytes(e){return JSON.parse(u(e))}function bodyMimeType(e){const t=e[m].headersList;const r=A(t);if(r==="failure"){return null}return r}e.exports={extractBody:extractBody,safelyExtractBody:safelyExtractBody,cloneBody:cloneBody,mixinBody:mixinBody,streamRegistry:S,hasFinalizationRegistry:b,bodyUnusable:bodyUnusable}},4495:e=>{const t=["GET","HEAD","POST"];const r=new Set(t);const n=[101,204,205,304];const s=[301,302,303,307,308];const i=new Set(s);const o=["1","7","9","11","13","15","17","19","
/*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */a[o-4]=r[0];a[o-3]=r[1];a[o-2]=r[2];a[o-1]=r[3];a[1]=i;if(i===126){a.writeUInt16BE(s,2)}else if(i===127){a[2]=a[3]=0;a.writeUIntBE(s,4,6)}a[1]|=128;for(let e=0;e<s;++e){a[o+e]=t[e]^r[e&3]}return a}}e.exports={WebsocketFrameSend:WebsocketFrameSend}},9469:(e,t,r)=>{const{createInflateRaw:n,Z_DEFAULT_WINDOWBITS:s}=r(8522);const{isValidClientWindowBits:i}=r(8625);const o=Buffer.from([0,0,255,255]);const a=Symbol("kBuffer");const c=Symbol("kLength");class PerMessageDeflate{#j;#m={};constructor(e){this.#m.serverNoContextTakeover=e.has("server_no_context_takeover");this.#m.serverMaxWindowBits=e.get("server_max_window_bits")}decompress(e,t,r){if(!this.#j){let e=s;if(this.#m.serverMaxWindowBits){if(!i(this.#m.serverMaxWindowBits)){r(new Error("Invalid server_max_window_bits"));return}e=Number.parseInt(this.#m.serverMaxWindowBits)}this.#j=n({windowBits:e});this.#j[a]=[];this.#j[c]=0;this.#j.on("data",(e=>{this.#j[a].push(e);this.#j[c]+=e.length}));this.#j.on("error",(e=>{this.#j=null;r(e)}))}this.#j.write(e);if(t){this.#j.write(o)}this.#j.flush((()=>{const e=Buffer.concat(this.#j[a],this.#j[c]);this.#j[a].length=0;this.#j[c]=0;r(null,e)}))}}e.exports={PerMessageDeflate:PerMessageDeflate}},1652:(e,t,r)=>{const{Writable:n}=r(7075);const s=r(4589);const{parserStates:i,opcodes:o,states:a,emptyBuffer:c,sentCloseFrameState:l}=r(736);const{kReadyState:A,kSentClose:u,kResponse:d,kReceivedClose:m}=r(1216);const{channels:p}=r(2414);const{isValidStatusCode:g,isValidOpcode:h,failWebsocketConnection:f,websocketMessageReceived:y,utf8Decode:C,isControlFrame:E,isTextBinaryFrame:I,isContinuationFrame:B}=r(8625);const{WebsocketFrameSend:Q}=r(3264);const{closeWebSocketConnection:b}=r(6897);const{PerMessageDeflate:S}=r(9469);class ByteParser extends n{#K=[];#X=0;#Z=false;#E=i.INFO;#ee={};#te=[];#re;constructor(e,t){super();this.ws=e;this.#re=t==null?new Map:t;if(this.#re.has("permessage-deflate")){this.#re.set("permessage-deflate",new S(t))}}_write(e,t,r){this.#K.push(e);this.#X+=e.length;this.#Z=true;this.run(r)}run(e){while(this.#Z){if(this.#E===i.INFO){if(this.#X<2){return e()}const t=this.consume(2);const r=(t[0]&128)!==0;const n=t[0]&15;const s=(t[1]&128)===128;const a=!r&&n!==o.CONTINUATION;const c=t[1]&127;const l=t[0]&64;const A=t[0]&32;const u=t[0]&16;if(!h(n)){f(this.ws,"Invalid opcode received");return e()}if(s){f(this.ws,"Frame cannot be masked");return e()}if(l!==0&&!this.#re.has("permessage-deflate")){f(this.ws,"Expected RSV1 to be clear.");return}if(A!==0||u!==0){f(this.ws,"RSV1, RSV2, RSV3 must be clear");return}if(a&&!I(n)){f(this.ws,"Invalid frame type was fragmented.");return}if(I(n)&&this.#te.length>0){f(this.ws,"Expected continuation frame");return}if(this.#ee.fragmented&&a){f(this.ws,"Fragmented frame exceeded 125 bytes.");return}if((c>125||a)&&E(n)){f(this.ws,"Control frame either too large or fragmented");return}if(B(n)&&this.#te.length===0&&!this.#ee.compressed){f(this.ws,"Unexpected continuation frame");return}if(c<=125){this.#ee.payloadLength=c;this.#E=i.READ_DATA}else if(c===126){this.#E=i.PAYLOADLENGTH_16}else if(c===127){this.#E=i.PAYLOADLENGTH_64}if(I(n)){this.#ee.binaryType=n;this.#ee.compressed=l!==0}this.#ee.opcode=n;this.#ee.masked=s;this.#ee.fin=r;this.#ee.fragmented=a}else if(this.#E===i.PAYLOADLENGTH_16){if(this.#X<2){return e()}const t=this.consume(2);this.#ee.payloadLength=t.readUInt16BE(0);this.#E=i.READ_DATA}else if(this.#E===i.PAYLOADLENGTH_64){if(this.#X<8){return e()}const t=this.consume(8);const r=t.readUInt32BE(0);if(r>2**31-1){f(this.ws,"Received payload length > 2^31 bytes.");return}const n=t.readUInt32BE(4);this.#ee.payloadLength=(r<<8)+n;this.#E=i.READ_DATA}else if(this.#E===i.READ_DATA){if(this.#X<this.#ee.payloadLength){return e()}const t=this.consume(this.#ee.payloadLength);if(E(this.#ee.opcode)){this.#Z=this.parseControlFrame(t);this.#E=i.INFO}else{if(!this.#ee.compressed){this.#te.push(t);if(!this.#ee.fragmented&&this.#ee.fin){const e=Buffer.concat(this.#te);y(this.ws,this.#ee.binaryType,e);this.#te.length=0}this.#E=i.INFO}else{this
//# sourceMappingURL=index.js.map