514 lines
4.4 MiB
JavaScript
514 lines
4.4 MiB
JavaScript
|
|
(function() {
|
|||
|
|
process.emitWarning = () => {};
|
|||
|
|
"use strict";var v4t=Object.create;var fR=Object.defineProperty;var y4t=Object.getOwnPropertyDescriptor;var x4t=Object.getOwnPropertyNames;var E4t=Object.getPrototypeOf,I4t=Object.prototype.hasOwnProperty;var As=(e,t)=>()=>(e&&(t=e(e=0)),t);var A=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),fp=(e,t)=>{for(var i in t)fR(e,i,{get:t[i],enumerable:!0})},gCe=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of x4t(t))!I4t.call(e,r)&&r!==i&&fR(e,r,{get:()=>t[r],enumerable:!(n=y4t(t,r))||n.enumerable});return e};var Ze=(e,t,i)=>(i=e!=null?v4t(E4t(e)):{},gCe(t||!e||!e.__esModule?fR(i,"default",{value:e,enumerable:!0}):i,e)),bCe=e=>gCe(fR({},"__esModule",{value:!0}),e);var _r=A(bR=>{"use strict";Object.defineProperty(bR,"__esModule",{value:!0});bR.oxmysql=void 0;var vCe=[];function Xy(e,t){if(!e)throw new TypeError(t)}var sm=(e,t,i,n)=>{if(typeof e=="number"&&(e=vCe[e],Xy(typeof e=="string","First argument received invalid query store reference")),n?Xy(typeof e=="object",`First argument expected object, recieved ${typeof e}`):Xy(typeof e=="string",`First argument expected string, received ${typeof e}`),t){let r=typeof t;Xy(r==="object"||r==="function",`Second argument expected object or function, received ${r}`),!i&&r==="function"&&(i=t,t=void 0)}return i!==void 0&&Xy(typeof i=="function",`Third argument expected function, received ${typeof i}`),[e,t,i]},gR=global.exports.oxmysql,yCe=(0,globalThis.GetCurrentResourceName)();function am(e,t,i){return new Promise((n,r)=>{gR[e](t,i,(s,a)=>{if(a)return r(a);n(s)},yCe,!0)})}bR.oxmysql={store(e){return Xy(typeof e!="string",`Query expects a string, received ${typeof e}`),vCe.push(e)},ready(e){setImmediate(async()=>{for(;(0,globalThis.GetResourceState)("oxmysql")!=="started";)await new Promise(t=>setTimeout(t,50,null));e()})},async query(e,t,i){[e,t,i]=sm(e,t,i);let n=await am("query",e,t);return i?i(n):n},async single(e,t,i){[e,t,i]=sm(e,t,i);let n=await am("single",e,t);return i?i(n):n},async scalar(e,t,i){[e,t,i]=sm(e,t,i);let n=await am("scalar",e,t);return i?i(n):n},async update(e,t,i){[e,t,i]=sm(e,t,i);let n=await am("update",e,t);return i?i(n):n},async insert(e,t,i){[e,t,i]=sm(e,t,i);let n=await am("insert",e,t);return i?i(n):n},async prepare(e,t,i){[e,t,i]=sm(e,t,i);let n=await am("prepare",e,t);return i?i(n):n},async rawExecute(e,t,i){[e,t,i]=sm(e,t,i);let n=await am("rawExecute",e,t);return i?i(n):n},async transaction(e,t,i){[e,t,i]=sm(e,t,i,!0);let n=await am("transaction",e,t);return i?i(n):n},isReady(){return gR.isReady()},async awaitConnection(){return await gR.awaitConnection()},async startTransaction(e){return gR.startTransaction(e,yCe)}}});var DCe=A((Qyn,SCe)=>{"use strict";var kCe=require("stream").Stream,l8t=require("util");SCe.exports=wu;function wu(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}l8t.inherits(wu,kCe);wu.create=function(e,t){var i=new this;t=t||{};for(var n in t)i[n]=t[n];i.source=e;var r=e.emit;return e.emit=function(){return i._handleEmit(arguments),r.apply(e,arguments)},e.on("error",function(){}),i.pauseStream&&e.pause(),i};Object.defineProperty(wu.prototype,"readable",{configurable:!0,enumerable:!0,get:function(){return this.source.readable}});wu.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};wu.prototype.resume=function(){this._released||this.release(),this.source.resume()};wu.prototype.pause=function(){this.source.pause()};wu.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};wu.prototype.pipe=function(){var e=kCe.prototype.pipe.apply(this,arguments);return this.resume(),e};wu.prototype._handleEmit=function(e){if(this._released){this.emit.apply(this,e);return}e[0]==="data"&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e)};wu.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.
|
|||
|
|
`;fi.DEFAULT_CONTENT_TYPE="application/octet-stream";fi.prototype.append=function(e,t,i){i=i||{},typeof i=="string"&&(i={filename:i});var n=P$.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var r=this._multiPartHeader(e,t,i),s=this._multiPartFooter();n(r),n(t),n(s),this._trackLength(r,t,i)};fi.prototype._trackLength=function(e,t,i){var n=0;i.knownLength!=null?n+=Number(i.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+fi.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&om(t,"httpVersion"))&&!(t instanceof GVt))&&(i.knownLength||this._valuesToMeasure.push(t))};fi.prototype._lengthRetriever=function(e,t){om(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):jVt.stat(e.path,function(i,n){if(i){t(i);return}var r=n.size-(e.start?e.start:0);t(null,r)}):om(e,"httpVersion")?t(null,Number(e.headers["content-length"])):om(e,"httpModule")?(e.on("response",function(i){e.pause(),t(null,Number(i.headers["content-length"]))}),e.resume()):t("Unknown stream")};fi.prototype._multiPartHeader=function(e,t,i){if(typeof i.header=="string")return i.header;var n=this._getContentDisposition(t,i),r=this._getContentType(t,i),s="",a={"Content-Disposition":["form-data",'name="'+e+'"'].concat(n||[]),"Content-Type":[].concat(r||[])};typeof i.header=="object"&&q$(a,i.header);var o;for(var c in a)if(om(a,c)){if(o=a[c],o==null)continue;Array.isArray(o)||(o=[o]),o.length&&(s+=c+": "+o.join("; ")+fi.LINE_BREAK)}return"--"+this.getBoundary()+fi.LINE_BREAK+s+fi.LINE_BREAK};fi.prototype._getContentDisposition=function(e,t){var i;if(typeof t.filepath=="string"?i=L$.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?i=L$.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&om(e,"httpVersion")&&(i=L$.basename(e.client._httpMessage.path||"")),i)return'filename="'+i+'"'};fi.prototype._getContentType=function(e,t){var i=t.contentType;return!i&&e&&e.name&&(i=F$.lookup(e.name)),!i&&e&&e.path&&(i=F$.lookup(e.path)),!i&&e&&e.readable&&om(e,"httpVersion")&&(i=e.headers["content-type"]),!i&&(t.filepath||t.filename)&&(i=F$.lookup(t.filepath||t.filename)),!i&&e&&typeof e=="object"&&(i=fi.DEFAULT_CONTENT_TYPE),i};fi.prototype._multiPartFooter=function(){return function(e){var t=fi.LINE_BREAK,i=this._streams.length===0;i&&(t+=this._lastBoundary()),e(t)}.bind(this)};fi.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+fi.LINE_BREAK};fi.prototype.getHeaders=function(e){var t,i={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)om(e,t)&&(i[t.toLowerCase()]=e[t]);return i};fi.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};fi.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};fi.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),i=0,n=this._streams.length;i<n;i++)typeof this._streams[i]!="function"&&(Buffer.isBuffer(this._streams[i])?e=Buffer.concat([e,this._streams[i]]):e=Buffer.concat([e,Buffer.from(this._streams[i])]),(typeof this._streams[i]!="string"||this._streams[i].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(fi.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};fi.prototype._generateBoundary=function(){this._boundary="--------------------------"+VVt.randomBytes(12).toString("hex")};fi.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};fi.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};fi.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this.
|
|||
|
|
`).join(`
|
|||
|
|
`+s),e.push(r+"m+"+OR.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=M$t()+t+" "+e[0]}function M$t(){return fs.inspectOpts.hideDate?"":new Date().toISOString()+" "}function U$t(...e){return process.stderr.write(PR.formatWithOptions(fs.inspectOpts,...e)+`
|
|||
|
|
`)}function N$t(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function L$t(){return process.env.DEBUG}function F$t(e){e.inspectOpts={};let t=Object.keys(fs.inspectOpts);for(let i=0;i<t.length;i++)e.inspectOpts[t[i]]=fs.inspectOpts[t[i]]}OR.exports=eH()(fs);var{formatters:Kwe}=OR.exports;Kwe.o=function(e){return this.inspectOpts.colors=this.useColors,PR.inspect(e,this.inspectOpts).split(`
|
|||
|
|
`).map(t=>t.trim()).join(" ")};Kwe.O=function(e){return this.inspectOpts.colors=this.useColors,PR.inspect(e,this.inspectOpts)}});var rH=A((SEn,nH)=>{"use strict";typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?nH.exports=Ywe():nH.exports=Xwe()});var tBe=A((DEn,eBe)=>{"use strict";var nB;eBe.exports=function(){if(!nB){try{nB=rH()("follow-redirects")}catch{}typeof nB!="function"&&(nB=function(){})}nB.apply(null,arguments)}});var aBe=A((REn,fH)=>{"use strict";var sB=require("url"),rB=sB.URL,q$t=require("http"),P$t=require("https"),lH=require("stream").Writable,uH=require("assert"),iBe=tBe();(function(){var t=typeof process<"u",i=typeof window<"u"&&typeof document<"u",n=Tg(Error.captureStackTrace);!t&&(i||!n)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var pH=!1;try{uH(new rB(""))}catch(e){pH=e.code==="ERR_INVALID_URL"}var O$t=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],dH=["abort","aborted","connect","error","socket","timeout"],AH=Object.create(null);dH.forEach(function(e){AH[e]=function(t,i,n){this._redirectable.emit(e,t,i,n)}});var aH=aB("ERR_INVALID_URL","Invalid URL",TypeError),oH=aB("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),j$t=aB("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",oH),G$t=aB("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),V$t=aB("ERR_STREAM_WRITE_AFTER_END","write after end"),$$t=lH.prototype.destroy||rBe;function _o(e,t){lH.call(this),this._sanitizeOptions(e),this._options=e,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],t&&this.on("response",t);var i=this;this._onNativeResponse=function(n){try{i._processResponse(n)}catch(r){i.emit("error",r instanceof oH?r:new oH({cause:r}))}},this._performRequest()}_o.prototype=Object.create(lH.prototype);_o.prototype.abort=function(){mH(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};_o.prototype.destroy=function(e){return mH(this._currentRequest,e),$$t.call(this,e),this};_o.prototype.write=function(e,t,i){if(this._ending)throw new V$t;if(!Rg(e)&&!z$t(e))throw new TypeError("data should be a string, Buffer or Uint8Array");if(Tg(t)&&(i=t,t=null),e.length===0){i&&i();return}this._requestBodyLength+e.length<=this._options.maxBodyLength?(this._requestBodyLength+=e.length,this._requestBodyBuffers.push({data:e,encoding:t}),this._currentRequest.write(e,t,i)):(this.emit("error",new G$t),this.abort())};_o.prototype.end=function(e,t,i){if(Tg(e)?(i=e,e=t=null):Tg(t)&&(i=t,t=null),!e)this._ended=this._ending=!0,this._currentRequest.end(null,null,i);else{var n=this,r=this._currentRequest;this.write(e,t,function(){n._ended=!0,r.end(null,null,i)}),this._ending=!0}};_o.prototype.setHeader=function(e,t){this._options.headers[e]=t,this._currentRequest.setHeader(e,t)};_o.prototype.removeHeader=function(e){delete this._options.headers[e],this._currentRequest.removeHeader(e)};_o.prototype.setTimeout=function(e,t){var i=this;function n(a){a.setTimeout(e),a.removeListener("timeout",a.destroy),a.addListener("timeout",a.destroy)}function r(a){i._timeout&&clearTimeout(i._timeout),i._timeout=setTimeout(function(){i.emit("timeout"),s()},e),n(a)}function s(){i._timeout&&(clearTimeout(i._timeout),i._timeout=null),i.removeListener("abort",s),i.removeListener("error",s),i.removeListener("response",s),i.removeListener("close",s),t&&i.removeListener("timeout",t),i.socket||i._currentRequest.removeListener("socket",r)}return t&&this.on("timeout",t),this.socket?r(this.socket):this._currentRequest.once("socket",r),this.on("socket",n),this.on("abort",s),this.on("error",s),this.on("response",s),this.on("close",s),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(e){_o.prototype[e]=function(t,i){return this._currentRequest[e](t,i)}});["aborted","connection","socket"].forEach(function(e){Object.defineProperty(_o.prototype,e,{get:function(){return this._currentRequest[e]}})});
|
|||
|
|
`).join(`\r
|
|||
|
|
`)),s.removeListener("error",lSe),d.setSocket(s,a,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(d),d.on("close",()=>{this.clients.delete(d),this._shouldEmitClose&&!this.clients.size&&process.nextTick(i_,this)})),o(d,r)}};pSe.exports=zY;function KYt(e,t){for(let i of Object.keys(t))e.on(i,t[i]);return function(){for(let n of Object.keys(t))e.removeListener(n,t[n])}}function i_(e){e._state=uSe,e.emit("close")}function lSe(){this.destroy()}function n_(e,t,i,n){i=i||AM.STATUS_CODES[t],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(i),...n},e.once("finish",e.destroy),e.end(`HTTP/1.1 ${t} ${AM.STATUS_CODES[t]}\r
|
|||
|
|
`+Object.keys(n).map(r=>`${r}: ${n[r]}`).join(`\r
|
|||
|
|
`)+`\r
|
|||
|
|
\r
|
|||
|
|
`+i)}function Wg(e,t,i,n,r,s){if(e.listenerCount("wsClientError")){let a=new Error(r);Error.captureStackTrace(a,Wg),e.emit("wsClientError",a,i,t)}else n_(i,n,r,s)}});var XSe=A((KSe,c_)=>{"use strict";(function(e,t){typeof define=="function"&&define.amd?define([],t):typeof require=="function"&&typeof c_=="object"&&c_&&c_.exports?c_.exports=t():(e.dcodeIO=e.dcodeIO||{}).Long=t()})(KSe,function(){"use strict";function e(Q,w,W){this.low=Q|0,this.high=w|0,this.unsigned=!!W}e.prototype.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1});function t(Q){return(Q&&Q.__isLong__)===!0}e.isLong=t;var i={},n={};function r(Q,w){var W,te,x;return w?(Q>>>=0,(x=0<=Q&&Q<256)&&(te=n[Q],te)?te:(W=a(Q,(Q|0)<0?-1:0,!0),x&&(n[Q]=W),W)):(Q|=0,(x=-128<=Q&&Q<128)&&(te=i[Q],te)?te:(W=a(Q,Q<0?-1:0,!1),x&&(i[Q]=W),W))}e.fromInt=r;function s(Q,w){if(isNaN(Q)||!isFinite(Q))return w?b:g;if(w){if(Q<0)return b;if(Q>=h)return j}else{if(Q<=-m)return Y;if(Q+1>=m)return T}return Q<0?s(-Q,w).neg():a(Q%p|0,Q/p|0,w)}e.fromNumber=s;function a(Q,w,W){return new e(Q,w,W)}e.fromBits=a;var o=Math.pow;function c(Q,w,W){if(Q.length===0)throw Error("empty string");if(Q==="NaN"||Q==="Infinity"||Q==="+Infinity"||Q==="-Infinity")return g;if(typeof w=="number"?(W=w,w=!1):w=!!w,W=W||10,W<2||36<W)throw RangeError("radix");var te;if((te=Q.indexOf("-"))>0)throw Error("interior hyphen");if(te===0)return c(Q.substring(1),w,W).neg();for(var x=s(o(W,8)),B=g,k=0;k<Q.length;k+=8){var P=Math.min(8,Q.length-k),U=parseInt(Q.substring(k,k+P),W);if(P<8){var ie=s(o(W,P));B=B.mul(ie).add(s(U))}else B=B.mul(x),B=B.add(s(U))}return B.unsigned=w,B}e.fromString=c;function u(Q){return Q instanceof e?Q:typeof Q=="number"?s(Q):typeof Q=="string"?c(Q):a(Q.low,Q.high,Q.unsigned)}e.fromValue=u;var d=65536,l=1<<24,p=d*d,h=p*p,m=h/2,f=r(l),g=r(0);e.ZERO=g;var b=r(0,!0);e.UZERO=b;var v=r(1);e.ONE=v;var y=r(1,!0);e.UONE=y;var I=r(-1);e.NEG_ONE=I;var T=a(-1,2147483647,!1);e.MAX_VALUE=T;var j=a(-1,-1,!0);e.MAX_UNSIGNED_VALUE=j;var Y=a(0,-2147483648,!1);e.MIN_VALUE=Y;var G=e.prototype;return G.toInt=function(){return this.unsigned?this.low>>>0:this.low},G.toNumber=function(){return this.unsigned?(this.high>>>0)*p+(this.low>>>0):this.high*p+(this.low>>>0)},G.toString=function(w){if(w=w||10,w<2||36<w)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(Y)){var W=s(w),te=this.div(W),x=te.mul(W).sub(this);return te.toString(w)+x.toInt().toString(w)}else return"-"+this.neg().toString(w);for(var B=s(o(w,6),this.unsigned),k=this,P="";;){var U=k.div(B),ie=k.sub(U.mul(B)).toInt()>>>0,V=ie.toString(w);if(k=U,k.isZero())return V+P;for(;V.length<6;)V="0"+V;P=""+V+P}},G.getHighBits=function(){return this.high},G.getHighBitsUnsigned=function(){return this.high>>>0},G.getLowBits=function(){return this.low},G.getLowBitsUnsigned=function(){return this.low>>>0},G.getNumBitsAbs=function(){if(this.isNegative())return this.eq(Y)?64:this.neg().getNumBitsAbs();for(var w=this.high!=0?this.high:this.low,W=31;W>0&&(w&1<<W)==0;W--);return this.high!=0?W+33:W+1},G.isZero=function(){return this.high===0&&this.low===0},G.isNegative=function(){return!this.unsigned&&this.high<0},G.isPositive=function(){return this.unsigned||this.high>=0},G.isOdd=function(){return(this.low&1)===1},G.isEven=function(){return(this.low&1)===0},G.equals=function(w){return t(w)||(w=u(w)),this.unsigned!==w.unsigned&&this.high>>>31===1&&w.high>>>31===1?!1:this.high===w.high&&this.low===w.low},G.eq=G.equals,G.notEquals=function(w){return!this.eq(w)},G.neq=G.notEquals,G.lessThan=function(w){return this.comp(w)<0},G.lt=G.lessThan,G.lessThanOrEqual=function(w){return this.comp(w)<=0},G.lte=G.lessThanOrEqual,G.greaterThan=function(w){return this.comp(w)>0},G.gt=G.greaterThan,G.greaterThanOrEqual=function(w){return this.comp(w)>=0},G.gte=G.greaterThanOrEqual,G.compare=function(w){if(t(w)||(w=u(w)),this.eq(w))return 0;var W=this.isNegative(),te=w.isNegative();return W&&!te?-1:!W&&te?1:this.unsigned?w.high>>>0>this.high>>>0||w.high===this.high&&w.low>>>0>this.low>>>0?-1:1:this.sub(w).isNegat
|
|||
|
|
-------------------------------------------------------------------
|
|||
|
|
`+this.toDebug(!0))},s.remaining=function(){return this.limit-this.offset},s.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},s.resize=function(l){if(!this.noAssert){if(typeof l!="number"||l%1!==0)throw TypeError("Illegal capacity: "+l+" (not an integer)");if(l|=0,l<0)throw RangeError("Illegal capacity: 0 <= "+l)}if(this.buffer.length<l){var p=new t(l);this.buffer.copy(p),this.buffer=p}return this},s.reverse=function(l,p){if(typeof l>"u"&&(l=this.offset),typeof p>"u"&&(p=this.limit),!this.noAssert){if(typeof l!="number"||l%1!==0)throw TypeError("Illegal begin: Not an integer");if(l>>>=0,typeof p!="number"||p%1!==0)throw TypeError("Illegal end: Not an integer");if(p>>>=0,l<0||l>p||p>this.buffer.length)throw RangeError("Illegal range: 0 <= "+l+" <= "+p+" <= "+this.buffer.length)}return l===p?this:(Array.prototype.reverse.call(this.buffer.slice(l,p)),this)},s.skip=function(l){if(!this.noAssert){if(typeof l!="number"||l%1!==0)throw TypeError("Illegal length: "+l+" (not an integer)");l|=0}var p=this.offset+l;if(!this.noAssert&&(p<0||p>this.buffer.length))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+l+" <= "+this.buffer.length);return this.offset=p,this},s.slice=function(l,p){if(typeof l>"u"&&(l=this.offset),typeof p>"u"&&(p=this.limit),!this.noAssert){if(typeof l!="number"||l%1!==0)throw TypeError("Illegal begin: Not an integer");if(l>>>=0,typeof p!="number"||p%1!==0)throw TypeError("Illegal end: Not an integer");if(p>>>=0,l<0||l>p||p>this.buffer.length)throw RangeError("Illegal range: 0 <= "+l+" <= "+p+" <= "+this.buffer.length)}var h=this.clone();return h.offset=l,h.limit=p,h},s.toBuffer=function(l){var p=this.offset,h=this.limit;if(!this.noAssert){if(typeof p!="number"||p%1!==0)throw TypeError("Illegal offset: Not an integer");if(p>>>=0,typeof h!="number"||h%1!==0)throw TypeError("Illegal limit: Not an integer");if(h>>>=0,p<0||p>h||h>this.buffer.length)throw RangeError("Illegal range: 0 <= "+p+" <= "+h+" <= "+this.buffer.length)}if(l){var m=new t(h-p);return this.buffer.copy(m,0,p,h),m}else return p===0&&h===this.buffer.length?this.buffer:this.buffer.slice(p,h)},s.toArrayBuffer=function(){var l=this.offset,p=this.limit;if(!this.noAssert){if(typeof l!="number"||l%1!==0)throw TypeError("Illegal offset: Not an integer");if(l>>>=0,typeof p!="number"||p%1!==0)throw TypeError("Illegal limit: Not an integer");if(p>>>=0,l<0||l>p||p>this.buffer.length)throw RangeError("Illegal range: 0 <= "+l+" <= "+p+" <= "+this.buffer.length)}var h=new ArrayBuffer(p-l);if(n)n(h,0,this.buffer,l,p);else for(var m=new Uint8Array(h),f=l;f<p;++f)m[f-l]=this.buffer[f];return h},s.toString=function(l,p,h){if(typeof l>"u")return"ByteBufferNB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch(typeof l=="number"&&(l="utf8",p=l,h=p),l){case"utf8":return this.toUTF8(p,h);case"base64":return this.toBase64(p,h);case"hex":return this.toHex(p,h);case"binary":return this.toBinary(p,h);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+l)}},s.toBase64=function(l,p){if(typeof l>"u"&&(l=this.offset),typeof p>"u"&&(p=this.limit),l=l|0,p=p|0,l<0||p>this.capacity||l>p)throw RangeError("begin, end");return this.buffer.toString("base64",l,p)},r.fromBase64=function(l,p){return r.wrap(new t(l,"base64"),p)},r.btoa=function(l){return r.fromBinary(l).toBase64()},r.atob=function(l){return r.fromBase64(l).toBinary()},s.toBinary=function(l,p){if(typeof l>"u"&&(l=this.offset),typeof p>"u"&&(p=this.limit),l|=0,p|=0,l<0||p>this.capacity()||l>p)throw RangeError("begin, end");return this.buffer.toString("binary",l,p)},r.fromBinary=function(l,p){return r.wrap(new t(l,"binary"),p)},s.toDebug=function(l){for(var p=-1,h=this.buffer.length,m,f="",g="",b="";p<h;){if(p!==-1&&(m=this.buffer[p],m<16?f+="0"+m.toString(16).toUpperCase():f+=m.toString(16).toUpperCase(),l&&(g+=m>32&&m<127?String.fromCharCode(m):".")),++p,l&&p>0&&p%16===0&&p!==h){for(;f.length<51;)f+=" ";b+=f+g+`
|
|||
|
|
`,f=g=""}p===this.offset&&p===this.limit?f+=p===this.markedOffset?"!":"|":p===this.offset?f+=p===this.markedOffset?"[":"<":p===this.limit?f+=p===this.markedOffset?"]":">":f+=p===this.markedOffset?"'":l||p!==0&&p!==h?" ":""}if(l&&f!==" "){for(;f.length<51;)f+=" ";b+=f+g+`
|
|||
|
|
`}return l?b:f},r.fromDebug=function(l,p,h){for(var m=l.length,f=new r((m+1)/3|0,p,h),g=0,b=0,v,y,I=!1,T=!1,j=!1,Y=!1,G=!1;g<m;){switch(v=l.charAt(g++)){case"!":if(!h){if(T||j||Y){G=!0;break}T=j=Y=!0}f.offset=f.markedOffset=f.limit=b,I=!1;break;case"|":if(!h){if(T||Y){G=!0;break}T=Y=!0}f.offset=f.limit=b,I=!1;break;case"[":if(!h){if(T||j){G=!0;break}T=j=!0}f.offset=f.markedOffset=b,I=!1;break;case"<":if(!h){if(T){G=!0;break}T=!0}f.offset=b,I=!1;break;case"]":if(!h){if(Y||j){G=!0;break}Y=j=!0}f.limit=f.markedOffset=b,I=!1;break;case">":if(!h){if(Y){G=!0;break}Y=!0}f.limit=b,I=!1;break;case"'":if(!h){if(j){G=!0;break}j=!0}f.markedOffset=b,I=!1;break;case" ":I=!1;break;default:if(!h&&I){G=!0;break}if(y=parseInt(v+l.charAt(g++),16),!h&&(isNaN(y)||y<0||y>255))throw TypeError("Illegal str: Not a debug encoded string");f.buffer[b++]=y,I=!0}if(G)throw TypeError("Illegal str: Invalid symbol at "+g)}if(!h){if(!T||!Y)throw TypeError("Illegal str: Missing offset or limit");if(b<f.buffer.length)throw TypeError("Illegal str: Not a debug encoded string (is it hex?) "+b+" < "+m)}return f},s.toHex=function(l,p){if(l=typeof l>"u"?this.offset:l,p=typeof p>"u"?this.limit:p,!this.noAssert){if(typeof l!="number"||l%1!==0)throw TypeError("Illegal begin: Not an integer");if(l>>>=0,typeof p!="number"||p%1!==0)throw TypeError("Illegal end: Not an integer");if(p>>>=0,l<0||l>p||p>this.buffer.length)throw RangeError("Illegal range: 0 <= "+l+" <= "+p+" <= "+this.buffer.length)}return this.buffer.toString("hex",l,p)},r.fromHex=function(l,p,h){if(!h){if(typeof l!="string")throw TypeError("Illegal str: Not a string");if(l.length%2!==0)throw TypeError("Illegal str: Length not a multiple of 2")}var m=new r(0,p,!0);return m.buffer=new t(l,"hex"),m.limit=m.buffer.length,m};var d=(function(){"use strict";var l={};return l.MAX_CODEPOINT=1114111,l.encodeUTF8=function(p,h){var m=null;for(typeof p=="number"&&(m=p,p=function(){return null});m!==null||(m=p())!==null;)m<128?h(m&127):m<2048?(h(m>>6&31|192),h(m&63|128)):m<65536?(h(m>>12&15|224),h(m>>6&63|128),h(m&63|128)):(h(m>>18&7|240),h(m>>12&63|128),h(m>>6&63|128),h(m&63|128)),m=null},l.decodeUTF8=function(p,h){for(var m,f,g,b,v=function(y){y=y.slice(0,y.indexOf(null));var I=Error(y.toString());throw I.name="TruncatedError",I.bytes=y,I};(m=p())!==null;)if((m&128)===0)h(m);else if((m&224)===192)(f=p())===null&&v([m,f]),h((m&31)<<6|f&63);else if((m&240)===224)((f=p())===null||(g=p())===null)&&v([m,f,g]),h((m&15)<<12|(f&63)<<6|g&63);else if((m&248)===240)((f=p())===null||(g=p())===null||(b=p())===null)&&v([m,f,g,b]),h((m&7)<<18|(f&63)<<12|(g&63)<<6|b&63);else throw RangeError("Illegal starting byte: "+m)},l.UTF16toUTF8=function(p,h){for(var m,f=null;(m=f!==null?f:p())!==null;){if(m>=55296&&m<=57343&&(f=p())!==null&&f>=56320&&f<=57343){h((m-55296)*1024+f-56320+65536),f=null;continue}h(m)}f!==null&&h(f)},l.UTF8toUTF16=function(p,h){var m=null;for(typeof p=="number"&&(m=p,p=function(){return null});m!==null||(m=p())!==null;)m<=65535?h(m):(m-=65536,h((m>>10)+55296),h(m%1024+56320)),m=null},l.encodeUTF16toUTF8=function(p,h){l.UTF16toUTF8(p,function(m){l.encodeUTF8(m,h)})},l.decodeUTF8toUTF16=function(p,h){l.decodeUTF8(p,function(m){l.UTF8toUTF16(m,h)})},l.calculateCodePoint=function(p){return p<128?1:p<2048?2:p<65536?3:4},l.calculateUTF8=function(p){for(var h,m=0;(h=p())!==null;)m+=h<128?1:h<2048?2:h<65536?3:4;return m},l.calculateUTF16asUTF8=function(p){var h=0,m=0;return l.UTF16toUTF8(p,function(f){++h,m+=f<128?1:f<2048?2:f<65536?3:4}),[h,m]},l})();return s.toUTF8=function(l,p){if(typeof l>"u"&&(l=this.offset),typeof p>"u"&&(p=this.limit),!this.noAssert){if(typeof l!="number"||l%1!==0)throw TypeError("Illegal begin: Not an integer");if(l>>>=0,typeof p!="number"||p%1!==0)throw TypeError("Illegal end: Not an integer");if(p>>>=0,l<0||l>p||p>this.buffer.length)throw RangeError("Illegal range: 0 <= "+l+" <= "+p+" <= "+this.buffer.length)}return this.buffer.toString("utf8",l,p)},r.fromUTF8=function(l,p,h){if(!h&&typeof l!="string")throw TypeError("Illegal str: Not a string");var m=new r(0,p,h);return m.buffer=new t(l,"utf8"
|
|||
|
|
`&&++this.line,++this.index===this.source.length)return null;if(this.source.charAt(this.index)==="/")if(++this.index,this.source.charAt(this.index)==="/"){for(;this.source.charAt(++this.index)!==`
|
|||
|
|
`;)if(this.index==this.source.length)return null;++this.index,++this.line,h=!0}else if((f=this.source.charAt(this.index))==="*"){do{if(f===`
|
|||
|
|
`&&++this.line,++this.index===this.source.length)return null;m=f,f=this.source.charAt(this.index)}while(m!=="*"||f!=="/");++this.index,h=!0}else return"/"}while(h);if(this.index===this.source.length)return null;var g=this.index;r.DELIM.lastIndex=0;var b=r.DELIM.test(this.source.charAt(g++));if(!b)for(;g<this.source.length&&!r.DELIM.test(this.source.charAt(g));)++g;var v=this.source.substring(this.index,this.index=g);return(v==='"'||v==="'")&&(this._stringOpen=v),v},o.peek=function(){if(this.stack.length===0){var h=this.next();if(h===null)return null;this.stack.push(h)}return this.stack[0]},o.skip=function(h){var m=this.next();if(m!==h)throw Error("illegal '"+m+"', '"+h+"' expected")},o.omit=function(h){return this.peek()===h?(this.next(),!0):!1},o.toString=function(){return"Tokenizer ("+this.index+"/"+this.source.length+" at line "+this.line+")"},s.Tokenizer=a;var c=function(h){this.tn=new a(h),this.proto3=!1},u=c.prototype;u.parse=function(){var h={name:"[ROOT]",package:null,messages:[],enums:[],imports:[],options:{},services:[]},m,f=!0,g;try{for(;m=this.tn.next();)switch(m){case"package":if(!f||h.package!==null)throw Error("unexpected 'package'");if(m=this.tn.next(),!r.TYPEREF.test(m))throw Error("illegal package name: "+m);this.tn.skip(";"),h.package=m;break;case"import":if(!f)throw Error("unexpected 'import'");m=this.tn.peek(),(m==="public"||(g=m==="weak"))&&this.tn.next(),m=this._readString(),this.tn.skip(";"),g||h.imports.push(m);break;case"syntax":if(!f)throw Error("unexpected 'syntax'");this.tn.skip("="),(h.syntax=this._readString())==="proto3"&&(this.proto3=!0),this.tn.skip(";");break;case"message":this._parseMessage(h,null),f=!1;break;case"enum":this._parseEnum(h),f=!1;break;case"option":this._parseOption(h);break;case"service":this._parseService(h);break;case"extend":this._parseExtend(h);break;default:throw Error("unexpected '"+m+"'")}}catch(b){throw b.message="Parse error at line "+this.tn.line+": "+b.message,b}return delete h.name,h},c.parse=function(h){return new c(h).parse()};function d(h,m){var f=-1,g=1;if(h.charAt(0)=="-"&&(g=-1,h=h.substring(1)),r.NUMBER_DEC.test(h))f=parseInt(h);else if(r.NUMBER_HEX.test(h))f=parseInt(h.substring(2),16);else if(r.NUMBER_OCT.test(h))f=parseInt(h.substring(1),8);else throw Error("illegal id value: "+(g<0?"-":"")+h);if(f=g*f|0,!m&&f<0)throw Error("illegal id value: "+(g<0?"-":"")+h);return f}function l(h){var m=1;if(h.charAt(0)=="-"&&(m=-1,h=h.substring(1)),r.NUMBER_DEC.test(h))return m*parseInt(h,10);if(r.NUMBER_HEX.test(h))return m*parseInt(h.substring(2),16);if(r.NUMBER_OCT.test(h))return m*parseInt(h.substring(1),8);if(h==="inf")return m*(1/0);if(h==="nan")return NaN;if(r.NUMBER_FLT.test(h))return m*parseFloat(h);throw Error("illegal number value: "+(m<0?"-":"")+h)}u._readString=function(){var h="",m,f;do{if(f=this.tn.next(),f!=="'"&&f!=='"')throw Error("illegal string delimiter: "+f);h+=this.tn.next(),this.tn.skip(f),m=this.tn.peek()}while(m==='"'||m==='"');return h},u._readValue=function(h){var m=this.tn.peek(),f;if(m==='"'||m==="'")return this._readString();if(this.tn.next(),r.NUMBER.test(m))return l(m);if(r.BOOL.test(m))return m.toLowerCase()==="true";if(h&&r.TYPEREF.test(m))return m;throw Error("illegal value: "+m)},u._parseOption=function(h,m){var f=this.tn.next(),g=!1;if(f==="("&&(g=!0,f=this.tn.next()),!r.TYPEREF.test(f))throw Error("illegal option name: "+f);var b=f;g&&(this.tn.skip(")"),b="("+b+")",f=this.tn.peek(),r.FQTYPEREF.test(f)&&(b+=f,this.tn.next())),this.tn.skip("="),this._parseOptionValue(h,b),m||this.tn.skip(";")};function p(h,m,f){typeof h[m]>"u"?h[m]=f:(Array.isArray(h[m])||(h[m]=[h[m]]),h[m].push(f))}return u._parseOptionValue=function(h,m){var f=this.tn.peek();if(f!=="{")p(h.options,m,this._readValue(!0));else for(this.tn.skip("{");(f=this.tn.next())!=="}";){if(!r.NAME.test(f))throw Error("illegal option name: "+m+"."+f);this.tn.omit(":")?p(h.options,m+"."+f,this._readValue(!0)):this._parseOptionValue(h,m+"."+f)}},u._parseService=function(h){var m=this.tn.next();if(!r.NAME.test(m))throw Error("illegal service name at line "+this.tn.line+": "+
|
|||
|
|
`).join(`
|
|||
|
|
`+s),e.push(r+"m+"+gU.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=oKt()+t+" "+e[0]}function oKt(){return vs.inspectOpts.hideDate?"":new Date().toISOString()+" "}function cKt(...e){return process.stderr.write(fU.formatWithOptions(vs.inspectOpts,...e)+`
|
|||
|
|
`)}function lKt(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function uKt(){return process.env.DEBUG}function pKt(e){e.inspectOpts={};let t=Object.keys(vs.inspectOpts);for(let i=0;i<t.length;i++)e.inspectOpts[t[i]]=vs.inspectOpts[t[i]]}gU.exports=i9()(vs);var{formatters:EMe}=gU.exports;EMe.o=function(e){return this.inspectOpts.colors=this.useColors,fU.inspect(e,this.inspectOpts).split(`
|
|||
|
|
`).map(t=>t.trim()).join(" ")};EMe.O=function(e){return this.inspectOpts.colors=this.useColors,fU.inspect(e,this.inspectOpts)}});var CMe=A((NDn,n9)=>{"use strict";typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?n9.exports=xMe():n9.exports=IMe()});var j_=A((LDn,wMe)=>{"use strict";wMe.exports=dKt;function dKt(e){if(!Array.isArray(e))throw new TypeError("Middleware stack must be an array!");for(let t of e)if(typeof t!="function")throw new TypeError("Middleware must be composed of functions!");return function(t,i){let n=-1;return r(0);function r(s){if(s<=n)return Promise.reject(new Error("next() called multiple times"));n=s;let a=e[s];if(s===e.length&&(a=i),!a)return Promise.resolve();try{return Promise.resolve(a(t,r.bind(null,s+1)))}catch(o){return Promise.reject(o)}}}}});var yU=A((FDn,kMe)=>{"use strict";var AKt=require("path").relative;kMe.exports=bKt;var hKt=process.cwd();function _Me(e,t){for(var i=e.split(/[ ,]+/),n=String(t).toLowerCase(),r=0;r<i.length;r++){var s=i[r];if(s&&(s==="*"||s.toLowerCase()===n))return!0}return!1}function mKt(e,t,i){var n=Object.getOwnPropertyDescriptor(e,t),r=n.value;return n.get=function(){return r},n.writable&&(n.set=function(a){return r=a}),delete n.value,delete n.writable,Object.defineProperty(e,t,n),n}function fKt(e){for(var t="",i=0;i<e;i++)t+=", arg"+i;return t.substr(2)}function gKt(e){var t=this.name+": "+this.namespace;this.message&&(t+=" deprecated "+this.message);for(var i=0;i<e.length;i++)t+=`
|
|||
|
|
at `+e[i].toString();return t}function bKt(e){if(!e)throw new TypeError("argument namespace is required");var t=vU(),i=hE(t[1]),n=i[0];function r(s){bU.call(r,s)}return r._file=n,r._ignored=yKt(e),r._namespace=e,r._traced=xKt(e),r._warned=Object.create(null),r.function=wKt,r.property=BKt,r}function vKt(e,t){var i=typeof e.listenerCount!="function"?e.listeners(t).length:e.listenerCount(t);return i>0}function yKt(e){if(process.noDeprecation)return!0;var t=process.env.NO_DEPRECATION||"";return _Me(t,e)}function xKt(e){if(process.traceDeprecation)return!0;var t=process.env.TRACE_DEPRECATION||"";return _Me(t,e)}function bU(e,t){var i=vKt(process,"deprecation");if(!(!i&&this._ignored)){var n,r,s,a,o=0,c=!1,u=vU(),d=this._file;for(t?(a=t,s=hE(u[1]),s.name=a.name,d=s[0]):(o=2,a=hE(u[o]),s=a);o<u.length;o++)if(n=hE(u[o]),r=n[0],r===d)c=!0;else if(r===this._file)d=this._file;else if(c)break;var l=n?a.join(":")+"__"+n.join(":"):void 0;if(!(l!==void 0&&l in this._warned)){this._warned[l]=!0;var p=e;if(p||(p=s===a||!s.name?BMe(a):BMe(s)),i){var h=QMe(this._namespace,p,u.slice(o));process.emit("deprecation",h);return}var m=process.stderr.isTTY?IKt:EKt,f=m.call(this,p,n,u.slice(o));process.stderr.write(f+`
|
|||
|
|
`,"utf8")}}}function hE(e){var t=e.getFileName()||"<anonymous>",i=e.getLineNumber(),n=e.getColumnNumber();e.isEval()&&(t=e.getEvalOrigin()+", "+t);var r=[t,i,n];return r.callSite=e,r.name=e.getFunctionName(),r}function BMe(e){var t=e.callSite,i=e.name;i||(i="<anonymous@"+r9(e)+">");var n=t.getThis(),r=n&&t.getTypeName();return r==="Object"&&(r=void 0),r==="Function"&&(r=n.name||r),r&&t.getMethodName()?r+"."+i:i}function EKt(e,t,i){var n=new Date().toUTCString(),r=n+" "+this._namespace+" deprecated "+e;if(this._traced){for(var s=0;s<i.length;s++)r+=`
|
|||
|
|
at `+i[s].toString();return r}return t&&(r+=" at "+r9(t)),r}function IKt(e,t,i){var n="\x1B[36;1m"+this._namespace+"\x1B[22;39m \x1B[33;1mdeprecated\x1B[22;39m \x1B[0m"+e+"\x1B[39m";if(this._traced){for(var r=0;r<i.length;r++)n+=`
|
|||
|
|
\x1B[36mat `+i[r].toString()+"\x1B[39m";return n}return t&&(n+=" \x1B[36m"+r9(t)+"\x1B[39m"),n}function r9(e){return AKt(hKt,e[0])+":"+e[1]+":"+e[2]}function vU(){var e=Error.stackTraceLimit,t={},i=Error.prepareStackTrace;Error.prepareStackTrace=CKt,Error.stackTraceLimit=Math.max(10,e),Error.captureStackTrace(t);var n=t.stack.slice(1);return Error.prepareStackTrace=i,Error.stackTraceLimit=e,n}function CKt(e,t){return t}function wKt(e,t){if(typeof e!="function")throw new TypeError("argument fn must be a function");var i=fKt(e.length),n=vU(),r=hE(n[1]);r.name=e.name;var s=new Function("fn","log","deprecate","message","site",`"use strict"
|
|||
|
|
return function (`+i+`) {log.call(deprecate, message, site)
|
|||
|
|
return fn.apply(this, arguments)
|
|||
|
|
}`)(e,bU,this,t,r);return s}function BKt(e,t,i){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("argument obj must be object");var n=Object.getOwnPropertyDescriptor(e,t);if(!n)throw new TypeError("must call property on owner object");if(!n.configurable)throw new TypeError("property must be configurable");var r=this,s=vU(),a=hE(s[1]);a.name=t,"value"in n&&(n=mKt(e,t,i));var o=n.get,c=n.set;typeof o=="function"&&(n.get=function(){return bU.call(r,i,a),o.apply(this,arguments)}),typeof c=="function"&&(n.set=function(){return bU.call(r,i,a),c.apply(this,arguments)}),Object.defineProperty(e,t,n)}function QMe(e,t,i){var n=new Error,r;return Object.defineProperty(n,"constructor",{value:QMe}),Object.defineProperty(n,"message",{configurable:!0,enumerable:!1,value:t,writable:!0}),Object.defineProperty(n,"name",{enumerable:!1,configurable:!0,value:"DeprecationError",writable:!0}),Object.defineProperty(n,"namespace",{configurable:!0,enumerable:!1,value:e,writable:!0}),Object.defineProperty(n,"stack",{configurable:!0,enumerable:!1,get:function(){return r!==void 0?r:r=gKt.call(this,i)},set:function(a){r=a}}),n}});var xU=A((qDn,SMe)=>{"use strict";SMe.exports=Object.setPrototypeOf||({__proto__:[]}instanceof Array?_Kt:QKt);function _Kt(e,t){return e.__proto__=t,e}function QKt(e,t){for(var i in t)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=t[i]);return e}});var DMe=A((PDn,kKt)=>{kKt.exports={"100":"Continue","101":"Switching Protocols","102":"Processing","103":"Early Hints","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I'm a Teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Too Early","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"}});var MMe=A((ODn,TMe)=>{"use strict";var s9=DMe();TMe.exports=Tu;Tu.message=s9;Tu.code=SKt(s9);Tu.codes=DKt(s9);Tu.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0};Tu.empty={204:!0,205:!0,304:!0};Tu.retry={502:!0,503:!0,504:!0};function SKt(e){var t={};return Object.keys(e).forEach(function(n){var r=e[n],s=Number(n);t[r.toLowerCase()]=s}),t}function DKt(e){return Object.keys(e).map(function(i){return Number(i)})}function RKt(e){var t=e.toLowerCase();if(!Object.prototype.hasOwnProperty.call(Tu.code,t))throw new Error('invalid status message: "'+e+'"');return Tu.code[t]}function RMe(e){if(!Object.prototype.hasOwnProperty.call(Tu.message,e))throw new Error("invalid status code: "+e);return Tu.message[e]}function Tu(e){if(typeof e=="number")return RMe(e);if(typeof e!="string")throw new TypeError("code must be a number or string");var t=parseInt(e,10);return isNaN(t)?RKt(e):RMe(t)}});var UMe=A((jDn,a9)=>{"use strict";typeof Object.create=="function"?a9.exports=function(t,i){i&&(t.super_=i,t.prototype=Object.create(i.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:a9.exports=function(t
|
|||
|
|
\v\f\r\x1B !"#$\u066A&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~\x7F\xB0\xB7\u2219\u221A\u2592\u2500\u2502\u253C\u2524\u252C\u251C\u2534\u2510\u250C\u2514\u2518\u03B2\u221E\u03C6\xB1\xBD\xBC\u2248\xAB\xBB\uFEF7\uFEF8\uFFFD\uFFFD\uFEFB\uFEFC\uFFFD\xA0\xAD\uFE82\xA3\xA4\uFE84\uFFFD\uFFFD\uFE8E\uFE8F\uFE95\uFE99\u060C\uFE9D\uFEA1\uFEA5\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669\uFED1\u061B\uFEB1\uFEB5\uFEB9\u061F\xA2\uFE80\uFE81\uFE83\uFE85\uFECA\uFE8B\uFE8D\uFE91\uFE93\uFE97\uFE9B\uFE9F\uFEA3\uFEA7\uFEA9\uFEAB\uFEAD\uFEAF\uFEB3\uFEB7\uFEBB\uFEBF\uFEC1\uFEC5\uFECB\uFECF\xA6\xAC\xF7\xD7\uFEC9\u0640\uFED3\uFED7\uFEDB\uFEDF\uFEE3\uFEE7\uFEEB\uFEED\uFEEF\uFEF3\uFEBD\uFECC\uFECE\uFECD\uFEE1\uFE7D\u0651\uFEE5\uFEE9\uFEEC\uFEF0\uFEF2\uFED0\uFED5\uFEF5\uFEF6\uFEDD\uFED9\uFEF1\u25A0\uFFFD`},ibm864:"cp864",csibm864:"cp864",cp865:{type:"_sbcs",chars:"\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xF8\xA3\xD8\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xA4\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0"},ibm865:"cp865",csibm865:"cp865",cp866:{type:"_sbcs",chars:"\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F\u0401\u0451\u0404\u0454\u0407\u0457\u040E\u045E\xB0\u2219\xB7\u221A\u2116\xA4\u25A0\xA0"},ibm866:"cp866",csibm866:"cp866",cp869:{type:"_sbcs",chars:"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0386\uFFFD\xB7\xAC\xA6\u2018\u2019\u0388\u2015\u0389\u038A\u03AA\u038C\uFFFD\uFFFD\u038E\u03AB\xA9\u038F\xB2\xB3\u03AC\xA3\u03AD\u03AE\u03AF\u03CA\u0390\u03CC\u03CD\u0391\u0392\u0393\u0394\u0395\u0396\u0397\xBD\u0398\u0399\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u039A\u039B\u039C\u039D\u2563\u2551\u2557\u255D\u039E\u039F\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u03A0\u03A1\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u03A3\u03A4\u03A5\u03A6\u03A7\u03A8\u03A9\u03B1\u03B2\u03B3\u2518\u250C\u2588\u2584\u03B4\u03B5\u2580\u03B6\u03B7\u03B8\u03B9\u03BA\u03BB\u03BC\u03BD\u03BE\u03BF\u03C0\u03C1\u03C3\u03C2\u03C4\u0384\xAD\xB1\u03C5\u03C6\u03C7\xA7\u03C8\u0385\xB0\xA8\u03C9\u03CB\u03B0\u03CE\u25A0\xA0"},ibm869:"cp869",csibm869:"cp869",cp922:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\u203E\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\xC0\xC1\xC2\xC3\xC4\xC5\xC6\xC7\xC8\xC9\xCA\xCB\xCC\xCD\xCE\xCF\u0160\xD1\xD2\xD3\xD4\xD5\xD6\xD7\xD8\xD9\xDA\xDB\xDC\xDD\u017D\xDF\xE0\xE1\xE2\xE3\xE4\xE5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\u0161\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\u017E\xFF"},ibm922:"cp922",csibm922:"cp922",cp1046:{type:"_sbcs",chars:"\uFE88\xD7\xF7\uF8F6\uF8F5\uF8F4\uF8F7\uFE71\x88\u25A0\u2502\u2500\u2510\u250C\u2514\u2518\uFE79\uFE7B\uFE7D\uFE7F\uFE77\uFE8A\uFEF0\uFEF3\uFEF2\uFECE\uFECF\uFED0\uFEF6\uFEF8\uFEFA\uFEFC\xA0\uF8FA\uF8F9\uF8F8\xA4\uF8FB\uFE8B\uFE91\uFE9
|
|||
|
|
\v\f\r\u1EE8\u1EF0\u1EF2\u1EF6\u1EF8\xDD\u1EF4\x1B !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~\x7F\xC0\u1EA2\xC3\xC1\u1EA0\u1EB6\u1EAC\xC8\u1EBA\u1EBC\xC9\u1EB8\u1EC6\xCC\u1EC8\u0128\xCD\u1ECA\xD2\u1ECE\xD5\xD3\u1ECC\u1ED8\u1EDC\u1EDE\u1EE0\u1EDA\u1EE2\xD9\u1EE6\u0168\xA0\u0102\xC2\xCA\xD4\u01A0\u01AF\u0110\u0103\xE2\xEA\xF4\u01A1\u01B0\u0111\u1EB0\u0300\u0309\u0303\u0301\u0323\xE0\u1EA3\xE3\xE1\u1EA1\u1EB2\u1EB1\u1EB3\u1EB5\u1EAF\u1EB4\u1EAE\u1EA6\u1EA8\u1EAA\u1EA4\u1EC0\u1EB7\u1EA7\u1EA9\u1EAB\u1EA5\u1EAD\xE8\u1EC2\u1EBB\u1EBD\xE9\u1EB9\u1EC1\u1EC3\u1EC5\u1EBF\u1EC7\xEC\u1EC9\u1EC4\u1EBE\u1ED2\u0129\xED\u1ECB\xF2\u1ED4\u1ECF\xF5\xF3\u1ECD\u1ED3\u1ED5\u1ED7\u1ED1\u1ED9\u1EDD\u1EDF\u1EE1\u1EDB\u1EE3\xF9\u1ED6\u1EE7\u0169\xFA\u1EE5\u1EEB\u1EED\u1EEF\u1EE9\u1EF1\u1EF3\u1EF7\u1EF9\xFD\u1EF5\u1ED0`},georgianacademy:{type:"_sbcs",chars:"\x80\x81\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\u0160\u2039\u0152\x8D\x8E\x8F\x90\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\u0161\u203A\u0153\x9D\x9E\u0178\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\u10D0\u10D1\u10D2\u10D3\u10D4\u10D5\u10D6\u10D7\u10D8\u10D9\u10DA\u10DB\u10DC\u10DD\u10DE\u10DF\u10E0\u10E1\u10E2\u10E3\u10E4\u10E5\u10E6\u10E7\u10E8\u10E9\u10EA\u10EB\u10EC\u10ED\u10EE\u10EF\u10F0\u10F1\u10F2\u10F3\u10F4\u10F5\u10F6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"},georgianps:{type:"_sbcs",chars:"\x80\x81\u201A\u0192\u201E\u2026\u2020\u2021\u02C6\u2030\u0160\u2039\u0152\x8D\x8E\x8F\x90\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u02DC\u2122\u0161\u203A\u0153\x9D\x9E\u0178\xA0\xA1\xA2\xA3\xA4\xA5\xA6\xA7\xA8\xA9\xAA\xAB\xAC\xAD\xAE\xAF\xB0\xB1\xB2\xB3\xB4\xB5\xB6\xB7\xB8\xB9\xBA\xBB\xBC\xBD\xBE\xBF\u10D0\u10D1\u10D2\u10D3\u10D4\u10D5\u10D6\u10F1\u10D7\u10D8\u10D9\u10DA\u10DB\u10DC\u10F2\u10DD\u10DE\u10DF\u10E0\u10E1\u10E2\u10F3\u10E3\u10E4\u10E5\u10E6\u10E7\u10E8\u10E9\u10EA\u10EB\u10EC\u10ED\u10EE\u10F4\u10EF\u10F0\u10F5\xE6\xE7\xE8\xE9\xEA\xEB\xEC\xED\xEE\xEF\xF0\xF1\xF2\xF3\xF4\xF5\xF6\xF7\xF8\xF9\xFA\xFB\xFC\xFD\xFE\xFF"},pt154:{type:"_sbcs",chars:"\u0496\u0492\u04EE\u0493\u201E\u2026\u04B6\u04AE\u04B2\u04AF\u04A0\u04E2\u04A2\u049A\u04BA\u04B8\u0497\u2018\u2019\u201C\u201D\u2022\u2013\u2014\u04B3\u04B7\u04A1\u04E3\u04A3\u049B\u04BB\u04B9\xA0\u040E\u045E\u0408\u04E8\u0498\u04B0\xA7\u0401\xA9\u04D8\xAB\xAC\u04EF\xAE\u049C\xB0\u04B1\u0406\u0456\u0499\u04E9\xB6\xB7\u0451\u2116\u04D9\xBB\u0458\u04AA\u04AB\u049D\u0410\u0411\u0412\u0413\u0414\u0415\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042A\u042B\u042C\u042D\u042E\u042F\u0430\u0431\u0432\u0433\u0434\u0435\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044A\u044B\u044C\u044D\u044E\u044F"},viscii:{type:"_sbcs",chars:`\0\u1EB2\u1EB4\u1EAA\x07\b
|
|||
|
|
\v\f\r\u1EF6\u1EF8\x1B\u1EF4 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}~\x7F\u1EA0\u1EAE\u1EB0\u1EB6\u1EA4\u1EA6\u1EA8\u1EAC\u1EBC\u1EB8\u1EBE\u1EC0\u1EC2\u1EC4\u1EC6\u1ED0\u1ED2\u1ED4\u1ED6\u1ED8\u1EE2\u1EDA\u1EDC\u1EDE\u1ECA\u1ECE\u1ECC\u1EC8\u1EE6\u0168\u1EE4\u1EF2\xD5\u1EAF\u1EB1\u1EB7\u1EA5\u1EA7\u1EA9\u1EAD\u1EBD\u1EB9\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u1ED1\u1ED3\u1ED5\u1ED7\u1EE0\u01A0\u1ED9\u1EDD\u1EDF\u1ECB\u1EF0\u1EE8\u1EEA\u1EEC\u01A1\u1EDB\u01AF\xC0\xC1\xC2\xC3\u1EA2\u0102\u1EB3\u1EB5\xC8\xC9\xCA\u1EBA\xCC\xCD\u0128\u1EF3\u0110\u1EE9\xD2\xD3\xD4\u1EA1\u1EF7\u1EEB\u1EED\xD9\xDA\u1EF9\u1EF5\xDD\u1EE1\u01B0\xE0\xE1\xE2\xE3\u1EA3\u0103\u1EEF\u1EAB\xE8\xE9\xEA\u1EBB\xEC\xED\u0129\u1EC9\u0111\u1EF1\xF2\xF3\xF4\xF5\u1ECF\u1ECD\u1EE5\xF9\xFA\u0169\u1EE7\xFD\u1EE3\u1EEE`},iso646cn:{type:"_sbcs",chars:`\0\x07\b
|
|||
|
|
\v\f\r\x1B !"#\xA5%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_\`abcdefghijklmnopqrstuvwxyz{|}\u203E\x7F\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD`},iso646jp:{type:"_sbcs",chars:`\0\x07\b
|
|||
|
|
\v\f\r\x1B !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\xA5]^_\`abcdefghijklmnopqrstuvwxyz{|}\u203E\x7F\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD`},hproman8:{type:"_sbcs",chars:"\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8A\x8B\x8C\x8D\x8E\x8F\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9A\x9B\x9C\x9D\x9E\x9F\xA0\xC0\xC2\xC8\xCA\xCB\xCE\xCF\xB4\u02CB\u02C6\xA8\u02DC\xD9\xDB\u20A4\xAF\xDD\xFD\xB0\xC7\xE7\xD1\xF1\xA1\xBF\xA4\xA3\xA5\xA7\u0192\xA2\xE2\xEA\xF4\xFB\xE1\xE9\xF3\xFA\xE0\xE8\xF2\xF9\xE4\xEB\xF6\xFC\xC5\xEE\xD8\xC6\xE5\xED\xF8\xE6\xC4\xEC\xD6\xDC\xC9\xEF\xDF\xD4\xC1\xC3\xE3\xD0\xF0\xCD\xCC\xD3\xD2\xD5\xF5\u0160\u0161\xDA\u0178\xFF\xDE\xFE\xB7\xB5\xB6\xBE\u2014\xBC\xBD\xAA\xBA\xAB\u25A0\xBB\xB1\uFFFD"},macintosh:{type:"_sbcs",chars:"\xC4\xC5\xC7\xC9\xD1\xD6\xDC\xE1\xE0\xE2\xE4\xE3\xE5\xE7\xE9\xE8\xEA\xEB\xED\xEC\xEE\xEF\xF1\xF3\xF2\xF4\xF6\xF5\xFA\xF9\xFB\xFC\u2020\xB0\xA2\xA3\xA7\u2022\xB6\xDF\xAE\xA9\u2122\xB4\xA8\u2260\xC6\xD8\u221E\xB1\u2264\u2265\xA5\xB5\u2202\u2211\u220F\u03C0\u222B\xAA\xBA\u2126\xE6\xF8\xBF\xA1\xAC\u221A\u0192\u2248\u2206\xAB\xBB\u2026\xA0\xC0\xC3\xD5\u0152\u0153\u2013\u2014\u201C\u201D\u2018\u2019\xF7\u25CA\xFF\u0178\u2044\xA4\u2039\u203A\uFB01\uFB02\u2021\xB7\u201A\u201E\u2030\xC2\xCA\xC1\xCB\xC8\xCD\xCE\xCF\xCC\xD3\xD4\uFFFD\xD2\xDA\xDB\xD9\u0131\u02C6\u02DC\xAF\u02D8\u02D9\u02DA\xB8\u02DD\u02DB\u02C7"},ascii:{type:"_sbcs",chars:"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD"},tis620:{type:"_sbcs",chars:"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\u0E01\u0E02\u0E03\u0E04\u0E05\u0E06\u0E07\u0E08\u0E09\u0E0A\u0E0B\u0E0C\u0E0D\u0E0E\u0E0F\u0E10\u0E11\u0E12\u0E13\u0E14\u0E15\u0E16\u0E17\u0E18\u0E19\u0E1A\u0E1B\u0E1C\u0E1D\u0E1E\u0E1F\u0E20\u0E21\u0E22\u0E23\u0E24\u0E25\u0E26\u0E27\u0E28\u0E29\u0E2A\u0E2B\u0E2C\u0E2D\u0E2E\u0E2F\u0E30\u0E31\u0E32\u0E33\u0E34\u0E35\u0E36\u0E37\u0E38\u0E39\u0E3A\uFFFD\uFFFD\uFFFD\uFFFD\u0E3F\u0E40\u0E41\u0E42\u0E43\u0E44\u0E45\u0E46\u0E47\u0E48\u0E49\u0E4A\u0E4B\u0E4C\u0E4D\u0E4E\u0E4F\u0E50\u0E51\u0E52\u0E53\u0E54\u0E55\u0E56\u0E57\u0E58\u0E59\u0E5A\u0E5B\uFFFD\uFFFD\uFFFD\uFFFD"}}});var MUe=A(TUe=>{"use strict";var EE=ab().Buffer;TUe._dbcs=SA;var Uo=-1,RUe=-2,Ql=-10,Np=-1e3,xE=new Array(256),H_=-1;for(LU=0;LU<256;LU++)xE[LU]=Uo;var LU;function SA(e,t){if(this.encodingName=e.encodingName,!e)throw new Error("DBCS codec is called without the data.");if(!e.table)throw new Error("Encoding '"+this.encodingName+"' has no data.");var i=e.table();this.decodeTables=[]
|
|||
|
|
`)>=0)return!1;return!0}function Dei(e,t){var i;if(e.indent===" ")i=" ";else if(typeof e.indent=="number"&&e.indent>0)i=Lp.call(Array(e.indent+1)," ");else return null;return{base:i,prev:Lp.call(Array(t+1),i)}}function nJ(e,t){if(e.length===0)return"";var i=`
|
|||
|
|
`+t.prev+t.base;return i+Lp.call(e,","+i)+`
|
|||
|
|
`+t.prev}function HU(e,t){var i=iJ(e),n=[];if(i){n.length=e.length;for(var r=0;r<e.length;r++)n[r]=DA(e,r)?t(e[r],e):""}var s=typeof Z9=="function"?Z9(e):[],a;if(CE){a={};for(var o=0;o<s.length;o++)a["$"+s[o]]=s[o]}for(var c in e)DA(e,c)&&(i&&String(Number(c))===c&&c<e.length||CE&&a["$"+c]instanceof Symbol||(INe.call(/[^\w$]/,c)?n.push(t(c,e)+": "+t(e[c],e)):n.push(c+": "+t(e[c],e))));if(typeof Z9=="function")for(var u=0;u<s.length;u++)CNe.call(e,s[u])&&n.push("["+t(s[u])+"]: "+t(e[s[u]],e));return n}});var RNe=A((S1n,DNe)=>{"use strict";var Rei=Z_(),Tei=iA(),WU=function(e,t,i){for(var n=e,r;(r=n.next)!=null;n=r)if(r.key===t)return n.next=r.next,i||(r.next=e.next,e.next=r),r},Mei=function(e,t){if(e){var i=WU(e,t);return i&&i.value}},Uei=function(e,t,i){var n=WU(e,t);n?n.value=i:e.next={key:t,next:e.next,value:i}},Nei=function(e,t){return e?!!WU(e,t):!1},Lei=function(e,t){if(e)return WU(e,t,!0)};DNe.exports=function(){var t,i={assert:function(n){if(!i.has(n))throw new Tei("Side channel does not contain "+Rei(n))},delete:function(n){var r=t&&t.next,s=Lei(t,n);return s&&r&&r===s&&(t=void 0),!!s},get:function(n){return Mei(t,n)},has:function(n){return Nei(t,n)},set:function(n,r){t||(t={next:void 0}),Uei(t,n,r)}};return i}});var wE=A((D1n,UNe)=>{"use strict";var TNe=Xw(),MNe=R$(),Fei=MNe([TNe("%String.prototype.indexOf%")]);UNe.exports=function(t,i){var n=TNe(t,!!i);return typeof n=="function"&&Fei(t,".prototype.")>-1?MNe([n]):n}});var oJ=A((R1n,LNe)=>{"use strict";var qei=Xw(),K_=wE(),Pei=Z_(),Oei=iA(),NNe=qei("%Map%",!0),jei=K_("Map.prototype.get",!0),Gei=K_("Map.prototype.set",!0),Vei=K_("Map.prototype.has",!0),$ei=K_("Map.prototype.delete",!0),Hei=K_("Map.prototype.size",!0);LNe.exports=!!NNe&&function(){var t,i={assert:function(n){if(!i.has(n))throw new Oei("Side channel does not contain "+Pei(n))},delete:function(n){if(t){var r=$ei(t,n);return Hei(t)===0&&(t=void 0),r}return!1},get:function(n){if(t)return jei(t,n)},has:function(n){return t?Vei(t,n):!1},set:function(n,r){t||(t=new NNe),Gei(t,n,r)}};return i}});var qNe=A((T1n,FNe)=>{"use strict";var Yei=Xw(),ZU=wE(),zei=Z_(),JU=oJ(),Wei=iA(),BE=Yei("%WeakMap%",!0),Jei=ZU("WeakMap.prototype.get",!0),Zei=ZU("WeakMap.prototype.set",!0),Kei=ZU("WeakMap.prototype.has",!0),Xei=ZU("WeakMap.prototype.delete",!0);FNe.exports=BE?function(){var t,i,n={assert:function(r){if(!n.has(r))throw new Wei("Side channel does not contain "+zei(r))},delete:function(r){if(BE&&r&&(typeof r=="object"||typeof r=="function")){if(t)return Xei(t,r)}else if(JU&&i)return i.delete(r);return!1},get:function(r){return BE&&r&&(typeof r=="object"||typeof r=="function")&&t?Jei(t,r):i&&i.get(r)},has:function(r){return BE&&r&&(typeof r=="object"||typeof r=="function")&&t?Kei(t,r):!!i&&i.has(r)},set:function(r,s){BE&&r&&(typeof r=="object"||typeof r=="function")?(t||(t=new BE),Zei(t,r,s)):JU&&(i||(i=JU()),i.set(r,s))}};return n}:JU});var ONe=A((M1n,PNe)=>{"use strict";var eti=iA(),tti=Z_(),iti=RNe(),nti=oJ(),rti=qNe(),sti=rti||nti||iti;PNe.exports=function(){var t,i={assert:function(n){if(!i.has(n))throw new eti("Side channel does not contain "+tti(n))},delete:function(n){return!!t&&t.delete(n)},get:function(n){return t&&t.get(n)},has:function(n){return!!t&&t.has(n)},set:function(n,r){t||(t=sti()),t.set(n,r)}};return i}});var KU=A((U1n,jNe)=>{"use strict";var ati=String.prototype.replace,oti=/%20/g,cJ={RFC1738:"RFC1738",RFC3986:"RFC3986"};jNe.exports={default:cJ.RFC3986,formatters:{RFC1738:function(e){return ati.call(e,oti,"+")},RFC3986:function(e){return String(e)}},RFC1738:cJ.RFC1738,RFC3986:cJ.RFC3986}});var pJ=A((N1n,VNe)=>{"use strict";var cti=KU(),lJ=Object.prototype.hasOwnProperty,pb=Array.isArray,Fp=(function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e})(),lti=function(t){for(;t.length>1;){var i=t.pop(),n=i.obj[i.prop];if(pb(n)){for(var r=[],s=0;s<n.length;++s)typeof n[s]<"u"&&r.push(n[s]);i.obj[i.prop]=r}}},GNe=function(t,i){for(var n=i&&i.plainObjects?{__proto__:null}:{},r=0;r<t.length;++r)typeof t[r]<"u"&&(n[r]=t[r]);return n},uti=function e(t,i,n){i
|
|||
|
|
--`,0),this.boundary.write(e,4),this.lookbehind=new dLe(this.boundary.length+8),this.state=bi.START,this.boundaryChars={};for(var t=0;t<this.boundary.length;t++)this.boundaryChars[this.boundary[t]]=!0};Ab.prototype.write=function(e){var t=this,i=0,n=e.length,r=this.index,s=this.index,a=this.state,o=this.flags,c=this.lookbehind,u=this.boundary,d=this.boundaryChars,l=this.boundary.length,p=l-1,h=e.length,m,f,g=function(I){t[I+"Mark"]=i},b=function(I){delete t[I+"Mark"]},v=function(I,T,j,Y){if(!(j!==void 0&&j===Y)){var G="on"+I.substr(0,1).toUpperCase()+I.substr(1);G in t&&t[G](T,j,Y)}},y=function(I,T){var j=I+"Mark";j in t&&(T?(v(I,e,t[j],i),delete t[j]):(v(I,e,t[j],e.length),t[j]=0))};for(i=0;i<n;i++)switch(m=e[i],a){case bi.PARSER_UNINITIALIZED:return i;case bi.START:s=0,a=bi.START_BOUNDARY;case bi.START_BOUNDARY:if(s==u.length-2){if(m==tQ)o|=km.LAST_BOUNDARY;else if(m!=tN)return i;s++;break}else if(s-1==u.length-2){if(o&km.LAST_BOUNDARY&&m==tQ)v("end"),a=bi.END,o=0;else if(!(o&km.LAST_BOUNDARY)&&m==eN)s=0,v("partBegin"),a=bi.HEADER_FIELD_START;else return i;break}m!=u[s+2]&&(s=-2),m==u[s+2]&&s++;break;case bi.HEADER_FIELD_START:a=bi.HEADER_FIELD,g("headerField"),s=0;case bi.HEADER_FIELD:if(m==tN){b("headerField"),a=bi.HEADERS_ALMOST_DONE;break}if(s++,m==tQ)break;if(m==Kti){if(s==1)return i;y("headerField",!0),a=bi.HEADER_VALUE_START;break}if(f=tii(m),f<Xti||f>eii)return i;break;case bi.HEADER_VALUE_START:if(m==Zti)break;g("headerValue"),a=bi.HEADER_VALUE;case bi.HEADER_VALUE:m==tN&&(y("headerValue",!0),v("headerEnd"),a=bi.HEADER_VALUE_ALMOST_DONE);break;case bi.HEADER_VALUE_ALMOST_DONE:if(m!=eN)return i;a=bi.HEADER_FIELD_START;break;case bi.HEADERS_ALMOST_DONE:if(m!=eN)return i;v("headersEnd"),a=bi.PART_DATA_START;break;case bi.PART_DATA_START:a=bi.PART_DATA,g("partData");case bi.PART_DATA:if(r=s,s===0){for(i+=p;i<h&&!(e[i]in d);)i+=l;i-=p,m=e[i]}if(s<u.length)u[s]==m?(s===0&&y("partData",!0),s++):s=0;else if(s==u.length)s++,m==tN?o|=km.PART_BOUNDARY:m==tQ?o|=km.LAST_BOUNDARY:s=0;else if(s-1==u.length)if(o&km.PART_BOUNDARY){if(s=0,m==eN){o&=~km.PART_BOUNDARY,v("partEnd"),v("partBegin"),a=bi.HEADER_FIELD_START;break}}else o&km.LAST_BOUNDARY&&m==tQ?(v("partEnd"),v("end"),a=bi.END,o=0):s=0;s>0?c[s-1]=m:r>0&&(v("partData",c,0,r),r=0,g("partData"),i--);break;case bi.END:break;default:return i}return y("headerField"),y("headerValue"),y("partData"),this.index=s,this.state=a,this.flags=o,n};Ab.prototype.end=function(){var e=function(t,i){var n="on"+i.substr(0,1).toUpperCase()+i.substr(1);n in t&&t[n]()};if(this.state==bi.HEADER_FIELD_START&&this.index===0||this.state==bi.PART_DATA&&this.index==this.boundary.length)e(this,"partEnd"),e(this,"end");else if(this.state!=bi.END)return new Error("MultipartParser.end(): stream ended unexpectedly: "+this.explain())};Ab.prototype.explain=function(){return"state = "+Ab.stateToString(this.state)}});var fLe=A(mLe=>{"use strict";global.GENTLY&&(require=GENTLY.hijack(require));var iii=require("querystring");function bJ(e){this.maxKeys=e,this.buffer=""}mLe.QuerystringParser=bJ;bJ.prototype.write=function(e){return this.buffer+=e.toString("ascii"),e.length};bJ.prototype.end=function(){var e=iii.parse(this.buffer,"&","=",{maxKeys:this.maxKeys});for(var t in e)this.onField(t,e[t]);this.buffer="",this.onEnd()}});var vLe=A(bLe=>{"use strict";var gLe=require("events").EventEmitter,nii=require("util");function QE(e){if(!(this instanceof QE))return new QE(e);gLe.call(this)}nii.inherits(QE,gLe);bLe.OctetParser=QE;QE.prototype.write=function(e){return this.emit("data",e),e.length};QE.prototype.end=function(){this.emit("end")}});var xLe=A(yLe=>{"use strict";global.GENTLY&&(require=GENTLY.hijack(require));var rii=require("buffer").Buffer;function vJ(e){this.parent=e,this.chunks=[],this.bytesWritten=0}yLe.JSONParser=vJ;vJ.prototype.write=function(e){return this.bytesWritten+=e.length,this.chunks.push(e),e.length};vJ.prototype.end=function(){try{var e=JSON.parse(rii.concat(this.chunks));for(var t in e)this.onField(t,e[t])}catch(i){this.parent.emit("error",i)}this.data=null,this.onEnd()}});var _Le=A(BLe=>{"
|
|||
|
|
local key = KEYS[1]
|
|||
|
|
local now = tonumber(ARGV[1])
|
|||
|
|
local duration = tonumber(ARGV[2])
|
|||
|
|
local max = tonumber(ARGV[3])
|
|||
|
|
local peek = ARGV[4] == '1'
|
|||
|
|
local start = now - duration
|
|||
|
|
|
|||
|
|
-- Check if the key exists
|
|||
|
|
local exists = redis.call('EXISTS', key)
|
|||
|
|
|
|||
|
|
local count = 0
|
|||
|
|
local oldest = now
|
|||
|
|
|
|||
|
|
if exists == 1 then
|
|||
|
|
-- Remove expired entries based on the current duration
|
|||
|
|
redis.call('ZREMRANGEBYSCORE', key, 0, start)
|
|||
|
|
|
|||
|
|
-- Get count
|
|||
|
|
count = redis.call('ZCARD', key)
|
|||
|
|
|
|||
|
|
-- Get oldest timestamp if we have entries
|
|||
|
|
if count > 0 then
|
|||
|
|
local oldest_result = redis.call('ZRANGE', key, 0, 0)
|
|||
|
|
oldest = tonumber(oldest_result[1])
|
|||
|
|
end
|
|||
|
|
end
|
|||
|
|
|
|||
|
|
-- Calculate remaining (before adding current request if not peeking)
|
|||
|
|
local remaining = max - count
|
|||
|
|
|
|||
|
|
-- Early return if already at limit
|
|||
|
|
if remaining <= 0 then
|
|||
|
|
local resetMicro = oldest + duration
|
|||
|
|
return {0, math.floor(resetMicro / 1000), max}
|
|||
|
|
end
|
|||
|
|
|
|||
|
|
-- If not peeking, add current request with current timestamp
|
|||
|
|
if not peek then
|
|||
|
|
redis.call('ZADD', key, now, now)
|
|||
|
|
end
|
|||
|
|
|
|||
|
|
-- Calculate reset time and handle trimming if needed
|
|||
|
|
local resetMicro
|
|||
|
|
|
|||
|
|
-- Only perform trim if we're at or over max and not peeking
|
|||
|
|
if not peek and count >= max then
|
|||
|
|
-- Get the entry at position -max for reset time calculation
|
|||
|
|
local oldest_in_range_result = redis.call('ZRANGE', key, -max, -max)
|
|||
|
|
local oldestInRange = oldest
|
|||
|
|
|
|||
|
|
if #oldest_in_range_result > 0 then
|
|||
|
|
oldestInRange = tonumber(oldest_in_range_result[1])
|
|||
|
|
end
|
|||
|
|
|
|||
|
|
-- Trim the set
|
|||
|
|
redis.call('ZREMRANGEBYRANK', key, 0, -(max + 1))
|
|||
|
|
|
|||
|
|
-- Calculate reset time based on the entry at position -max
|
|||
|
|
resetMicro = oldestInRange + duration
|
|||
|
|
else
|
|||
|
|
-- We're under the limit or peeking, use the oldest entry for reset time
|
|||
|
|
resetMicro = oldest + duration
|
|||
|
|
end
|
|||
|
|
|
|||
|
|
-- Set expiration using the provided duration (only if not peeking)
|
|||
|
|
if not peek then
|
|||
|
|
redis.call('PEXPIRE', key, duration)
|
|||
|
|
end
|
|||
|
|
|
|||
|
|
return {remaining, math.floor(resetMicro / 1000), max}
|
|||
|
|
`},IJ=class{constructor({id:t,db:i,max:n=2500,duration:r=36e5,namespace:s="limit"}){iN(i,"db required"),this.db=i,this.id=t,this.max=n,this.duration=r,this.namespace=s,this.db.ratelimiter||this.db.defineCommand("ratelimiter",FLe)}async get({id:t=this.id,max:i=this.max,duration:n=this.duration,peek:r=!1}={}){iN(t,"id required"),iN(i,"max required"),iN(n,"duration required");let s=await this.db.ratelimiter(`${this.namespace}:${t}`,vii.now(),n,i,r?"1":"0");return{remaining:s[0],reset:Math.floor(s[1]),total:s[2]}}};CJ.exports=IJ;CJ.exports.defineCommand={ratelimiter:FLe}});var OLe=A((eRn,PLe)=>{"use strict";PLe.exports=qLe()});var VLe=A((iRn,GLe)=>{"use strict";var jLe=require("node:assert"),yii=Date.now()*1e3,xii=process.hrtime();function Eii(){let e=process.hrtime(xii);return yii+e[0]*1e6+Math.round(e[1]*.001)}GLe.exports=class{constructor({id:t,db:i,max:n,duration:r,namespace:s="limit"}){this.id=t,jLe(this.id,".id required"),this.db=i||new Map,jLe(this.db instanceof Map,"for memory driver, .db must be Map instance"),this.max=n,this.duration=r,this.key=`${s}:${this.id}`}async get(){let{id:t,db:i,duration:n,key:r,max:s}=this,a=i.get(r),o=Eii(),c=o+n*1e3,u=a!==void 0&&a.reset*1e6<o;if(!i.has(r)||u){let p={id:t,reset:c/1e6,remaining:s,total:s};return i.set(r,p),p}return a.remaining=a.remaining>0?a.remaining-1:0,a}}});var HLe=A((nRn,$Le)=>{"use strict";var Iii=require("node:util"),Cii=Iii.debuglog("koa-ratelimit"),wii=LR(),Bii=OLe(),_ii=VLe();$Le.exports=function(t={}){t={...{driver:"redis",duration:36e5,max:2500,id:a=>a.ip,headers:{remaining:"X-RateLimit-Remaining",reset:"X-RateLimit-Reset",total:"X-RateLimit-Limit"},onLimited:void 0},...t};let{remaining:n="X-RateLimit-Remaining",reset:r="X-RateLimit-Reset",total:s="X-RateLimit-Limit"}=t.headers;return async function(o,c){let u=t.id(o),{driver:d}=t,l=typeof t.whitelist=="function"&&await t.whitelist(o);if(typeof t.blacklist=="function"&&await t.blacklist(o)&&o.throw(403,"Forbidden"),u===!1||l)return await c();let h;if(d==="memory")h=new _ii({...t,id:u});else if(d==="redis")h=new Bii({...t,id:u});else throw new Error(`invalid driver. Expecting memory or redis, got ${d}`);let m=await h.get(),f=m.remaining>0?m.remaining-1:0,g=t.disableHeader||!1,b={};if(g||(b={[n]:f,[r]:m.reset,[s]:m.total},o.set(b)),Cii("remaining %s/%s %s",n,m.total,u),m.remaining)return await c();let v=m.reset*1e3-Date.now()|0,y=m.reset-Date.now()/1e3|0,I=t.errorMessage||`Rate limit exceeded, retry in ${wii(v,{long:!0})}.`;o.body=I,o.set("Retry-After",y),o.state.rateLimit={after:y,headers:b,id:u,message:I},o.status=t.status||429,t.onLimited&&t.onLimited(o),t.throw&&(b["Retry-After"]=y,o.throw(o.status,o.body,{headers:b}))}}});var YLe=A((rRn,sN)=>{"use strict";var{Readable:Qii,Writable:kii}=require("stream"),Sii=require("http"),Dii=(e,[t,i])=>({...e,[t]:i}),nN=class extends Qii{constructor(t,i){super(),this.headers=Object.entries(t.headers).map(([n,r])=>[n.toLowerCase(),r]).reduce(Dii,{}),this.httpVersion="1.1",this.httpVersionMajor=1,this.httpVersionMinor=1,this.method=t.method,this.rawHeaders=Object.entries(this.headers).flatMap(n=>n),this.rawTrailers=[],this.setTimeout=(n,r)=>(global.setTimeout(r,n),this),this.trailers={},this.url=t.path,this.aborted=!1;try{let n=t.address.split(":");if(n.length!=2||!n[0].length||!n[1].length)throw new Error("Invalid IP:PORT");this.connection={remoteAddress:n[0],remotePort:n[1]}}catch(n){console.error(`requestHandler parsing ip:port error: ${n.message}`),this.connection={remoteAddress:"0.0.0.0",remotePort:0}}this.socket=this.connection,t.setDataHandler(n=>{n instanceof ArrayBuffer||ArrayBuffer.isView(n)?this.push(Buffer.from(n)):this.push(n,"utf8"),this.push(null)},"binary")}_read(t){}destroy(t){}},rN=class extends kii{constructor(t,i){super(),this.cfxReq=t,this.cfxRes=i,this.connection={remoteAddress:t.address,remotePort:0,writable:!0,on(...n){}},this.socket=this.connection,this.finished=!1,this.headersSent=!1,this.sendDate=!0,this.statusCode=200,this.statusMessage="OK",this.headers={}}addTrailers(t){}end(t,i,n){this.finished||(typeof t=="function"?(n=t,t=null):typeof i
|
|||
|
|
at `+callSiteToString(e[i]);return t}function depd(e){if(!e)throw new TypeError("argument namespace is required");var t=getStack(),i=callSiteLocation(t[1]),n=i[0];function r(s){log.call(r,s)}return r._file=n,r._ignored=isignored(e),r._namespace=e,r._traced=istraced(e),r._warned=Object.create(null),r.function=wrapfunction,r.property=wrapproperty,r}function isignored(e){if(process.noDeprecation)return!0;var t=process.env.NO_DEPRECATION||"";return containsNamespace(t,e)}function istraced(e){if(process.traceDeprecation)return!0;var t=process.env.TRACE_DEPRECATION||"";return containsNamespace(t,e)}function log(e,t){var i=eventListenerCount(process,"deprecation")!==0;if(!(!i&&this._ignored)){var n,r,s,a,o=0,c=!1,u=getStack(),d=this._file;for(t?(a=t,s=callSiteLocation(u[1]),s.name=a.name,d=s[0]):(o=2,a=callSiteLocation(u[o]),s=a);o<u.length;o++)if(n=callSiteLocation(u[o]),r=n[0],r===d)c=!0;else if(r===this._file)d=this._file;else if(c)break;var l=n?a.join(":")+"__"+n.join(":"):void 0;if(!(l!==void 0&&l in this._warned)){this._warned[l]=!0;var p=e;if(p||(p=s===a||!s.name?defaultMessage(a):defaultMessage(s)),i){var h=DeprecationError(this._namespace,p,u.slice(o));process.emit("deprecation",h);return}var m=process.stderr.isTTY?formatColor:formatPlain,f=m.call(this,p,n,u.slice(o));process.stderr.write(f+`
|
|||
|
|
`,"utf8")}}}function callSiteLocation(e){var t=e.getFileName()||"<anonymous>",i=e.getLineNumber(),n=e.getColumnNumber();e.isEval()&&(t=e.getEvalOrigin()+", "+t);var r=[t,i,n];return r.callSite=e,r.name=e.getFunctionName(),r}function defaultMessage(e){var t=e.callSite,i=e.name;i||(i="<anonymous@"+formatLocation(e)+">");var n=t.getThis(),r=n&&t.getTypeName();return r==="Object"&&(r=void 0),r==="Function"&&(r=n.name||r),r&&t.getMethodName()?r+"."+i:i}function formatPlain(e,t,i){var n=new Date().toUTCString(),r=n+" "+this._namespace+" deprecated "+e;if(this._traced){for(var s=0;s<i.length;s++)r+=`
|
|||
|
|
at `+callSiteToString(i[s]);return r}return t&&(r+=" at "+formatLocation(t)),r}function formatColor(e,t,i){var n="\x1B[36;1m"+this._namespace+"\x1B[22;39m \x1B[33;1mdeprecated\x1B[22;39m \x1B[0m"+e+"\x1B[39m";if(this._traced){for(var r=0;r<i.length;r++)n+=`
|
|||
|
|
\x1B[36mat `+callSiteToString(i[r])+"\x1B[39m";return n}return t&&(n+=" \x1B[36m"+formatLocation(t)+"\x1B[39m"),n}function formatLocation(e){return relative(basePath,e[0])+":"+e[1]+":"+e[2]}function getStack(){var e=Error.stackTraceLimit,t={},i=Error.prepareStackTrace;Error.prepareStackTrace=prepareObjectStackTrace,Error.stackTraceLimit=Math.max(10,e),Error.captureStackTrace(t);var n=t.stack.slice(1);return Error.prepareStackTrace=i,Error.stackTraceLimit=e,n}function prepareObjectStackTrace(e,t){return t}function wrapfunction(fn,message){if(typeof fn!="function")throw new TypeError("argument fn must be a function");var args=createArgumentsString(fn.length),deprecate=this,stack=getStack(),site=callSiteLocation(stack[1]);site.name=fn.name;var deprecatedfn=eval("(function ("+args+`) {
|
|||
|
|
"use strict"
|
|||
|
|
log.call(deprecate, message, site)
|
|||
|
|
return fn.apply(this, arguments)
|
|||
|
|
})`);return deprecatedfn}function wrapproperty(e,t,i){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("argument obj must be object");var n=Object.getOwnPropertyDescriptor(e,t);if(!n)throw new TypeError("must call property on owner object");if(!n.configurable)throw new TypeError("property must be configurable");var r=this,s=getStack(),a=callSiteLocation(s[1]);a.name=t,"value"in n&&(n=convertDataDescriptorToAccessor(e,t,i));var o=n.get,c=n.set;typeof o=="function"&&(n.get=function(){return log.call(r,i,a),o.apply(this,arguments)}),typeof c=="function"&&(n.set=function(){return log.call(r,i,a),c.apply(this,arguments)}),Object.defineProperty(e,t,n)}function DeprecationError(e,t,i){var n=new Error,r;return Object.defineProperty(n,"constructor",{value:DeprecationError}),Object.defineProperty(n,"message",{configurable:!0,enumerable:!1,value:t,writable:!0}),Object.defineProperty(n,"name",{enumerable:!1,configurable:!0,value:"DeprecationError",writable:!0}),Object.defineProperty(n,"namespace",{configurable:!0,enumerable:!1,value:e,writable:!0}),Object.defineProperty(n,"stack",{configurable:!0,enumerable:!1,get:function(){return r!==void 0?r:r=createStackString.call(this,i)},set:function(a){r=a}}),n}});var JFe=A((BRn,FJ)=>{"use strict";typeof Object.create=="function"?FJ.exports=function(t,i){i&&(t.super_=i,t.prototype=Object.create(i.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:FJ.exports=function(t,i){if(i){t.super_=i;var n=function(){};n.prototype=i.prototype,t.prototype=new n,t.prototype.constructor=t}}});var ZFe=A((_Rn,PJ)=>{"use strict";try{if(qJ=require("util"),typeof qJ.inherits!="function")throw"";PJ.exports=qJ.inherits}catch{PJ.exports=JFe()}var qJ});var GJ=A((QRn,fb)=>{"use strict";var OJ=WFe()("http-errors"),KFe=xU(),SE=kE(),jJ=ZFe(),dri=EU();fb.exports=pN;fb.exports.HttpError=Ari();fb.exports.isHttpError=mri(fb.exports.HttpError);gri(fb.exports,SE.codes,fb.exports.HttpError);function XFe(e){return+(String(e).charAt(0)+"00")}function pN(){for(var e,t,i=500,n={},r=0;r<arguments.length;r++){var s=arguments[r];if(s instanceof Error){e=s,i=e.status||e.statusCode||i;continue}switch(typeof s){case"string":t=s;break;case"number":i=s,r!==0&&OJ("non-first-argument status code; replace with createError("+s+", ...)");break;case"object":n=s;break}}typeof i=="number"&&(i<400||i>=600)&&OJ("non-error status code; use only 4xx or 5xx status codes"),(typeof i!="number"||!SE[i]&&(i<400||i>=600))&&(i=500);var a=pN[i]||pN[XFe(i)];e||(e=a?new a(t):new Error(t||SE[i]),Error.captureStackTrace(e,pN)),(!a||!(e instanceof a)||e.status!==i)&&(e.expose=i<500,e.status=e.statusCode=i);for(var o in n)o!=="status"&&o!=="statusCode"&&(e[o]=n[o]);return e}function Ari(){function e(){throw new TypeError("cannot construct abstract class")}return jJ(e,Error),e}function hri(e,t,i){var n=t2e(t);function r(s){var a=s??SE[i],o=new Error(a);return Error.captureStackTrace(o,r),KFe(o,r.prototype),Object.defineProperty(o,"message",{enumerable:!0,configurable:!0,value:a,writable:!0}),Object.defineProperty(o,"name",{enumerable:!1,configurable:!0,value:n,writable:!0}),o}return jJ(r,e),e2e(r,n),r.prototype.status=i,r.prototype.statusCode=i,r.prototype.expose=!0,r}function mri(e){return function(i){return!i||typeof i!="object"?!1:i instanceof e?!0:i instanceof Error&&typeof i.expose=="boolean"&&typeof i.statusCode=="number"&&i.status===i.statusCode}}function fri(e,t,i){var n=t2e(t);function r(s){var a=s??SE[i],o=new Error(a);return Error.captureStackTrace(o,r),KFe(o,r.prototype),Object.defineProperty(o,"message",{enumerable:!0,configurable:!0,value:a,writable:!0}),Object.defineProperty(o,"name",{enumerable:!1,configurable:!0,value:n,writable:!0}),o}return jJ(r,e),e2e(r,n),r.prototype.status=i,r.prototype.statusCode=i,r.prototype.expose=!1,r}function e2e(e,t){var i=Object.getOwnPropertyDescriptor(e,"name");i&&i.configurable&&(i.value=t,Object.defineProperty(e,"name",i))}function gri(e,t,i){t.forEach(function(r){var s,a=dri(SE[r]);switch(XFe(r)){case 400:s=hri(i,a,r);break;case 500:s=fri(i,a,r);break}s&&(e[r]=s,e[a]
|
|||
|
|
at `+callSiteToString(e[i]);return t}function depd(e){if(!e)throw new TypeError("argument namespace is required");var t=getStack(),i=callSiteLocation(t[1]),n=i[0];function r(s){log.call(r,s)}return r._file=n,r._ignored=isignored(e),r._namespace=e,r._traced=istraced(e),r._warned=Object.create(null),r.function=wrapfunction,r.property=wrapproperty,r}function isignored(e){if(process.noDeprecation)return!0;var t=process.env.NO_DEPRECATION||"";return containsNamespace(t,e)}function istraced(e){if(process.traceDeprecation)return!0;var t=process.env.TRACE_DEPRECATION||"";return containsNamespace(t,e)}function log(e,t){var i=eventListenerCount(process,"deprecation")!==0;if(!(!i&&this._ignored)){var n,r,s,a,o=0,c=!1,u=getStack(),d=this._file;for(t?(a=t,s=callSiteLocation(u[1]),s.name=a.name,d=s[0]):(o=2,a=callSiteLocation(u[o]),s=a);o<u.length;o++)if(n=callSiteLocation(u[o]),r=n[0],r===d)c=!0;else if(r===this._file)d=this._file;else if(c)break;var l=n?a.join(":")+"__"+n.join(":"):void 0;if(!(l!==void 0&&l in this._warned)){this._warned[l]=!0;var p=e;if(p||(p=s===a||!s.name?defaultMessage(a):defaultMessage(s)),i){var h=DeprecationError(this._namespace,p,u.slice(o));process.emit("deprecation",h);return}var m=process.stderr.isTTY?formatColor:formatPlain,f=m.call(this,p,n,u.slice(o));process.stderr.write(f+`
|
|||
|
|
`,"utf8")}}}function callSiteLocation(e){var t=e.getFileName()||"<anonymous>",i=e.getLineNumber(),n=e.getColumnNumber();e.isEval()&&(t=e.getEvalOrigin()+", "+t);var r=[t,i,n];return r.callSite=e,r.name=e.getFunctionName(),r}function defaultMessage(e){var t=e.callSite,i=e.name;i||(i="<anonymous@"+formatLocation(e)+">");var n=t.getThis(),r=n&&t.getTypeName();return r==="Object"&&(r=void 0),r==="Function"&&(r=n.name||r),r&&t.getMethodName()?r+"."+i:i}function formatPlain(e,t,i){var n=new Date().toUTCString(),r=n+" "+this._namespace+" deprecated "+e;if(this._traced){for(var s=0;s<i.length;s++)r+=`
|
|||
|
|
at `+callSiteToString(i[s]);return r}return t&&(r+=" at "+formatLocation(t)),r}function formatColor(e,t,i){var n="\x1B[36;1m"+this._namespace+"\x1B[22;39m \x1B[33;1mdeprecated\x1B[22;39m \x1B[0m"+e+"\x1B[39m";if(this._traced){for(var r=0;r<i.length;r++)n+=`
|
|||
|
|
\x1B[36mat `+callSiteToString(i[r])+"\x1B[39m";return n}return t&&(n+=" \x1B[36m"+formatLocation(t)+"\x1B[39m"),n}function formatLocation(e){return relative(basePath,e[0])+":"+e[1]+":"+e[2]}function getStack(){var e=Error.stackTraceLimit,t={},i=Error.prepareStackTrace;Error.prepareStackTrace=prepareObjectStackTrace,Error.stackTraceLimit=Math.max(10,e),Error.captureStackTrace(t);var n=t.stack.slice(1);return Error.prepareStackTrace=i,Error.stackTraceLimit=e,n}function prepareObjectStackTrace(e,t){return t}function wrapfunction(fn,message){if(typeof fn!="function")throw new TypeError("argument fn must be a function");var args=createArgumentsString(fn.length),deprecate=this,stack=getStack(),site=callSiteLocation(stack[1]);site.name=fn.name;var deprecatedfn=eval("(function ("+args+`) {
|
|||
|
|
"use strict"
|
|||
|
|
log.call(deprecate, message, site)
|
|||
|
|
return fn.apply(this, arguments)
|
|||
|
|
})`);return deprecatedfn}function wrapproperty(e,t,i){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("argument obj must be object");var n=Object.getOwnPropertyDescriptor(e,t);if(!n)throw new TypeError("must call property on owner object");if(!n.configurable)throw new TypeError("property must be configurable");var r=this,s=getStack(),a=callSiteLocation(s[1]);a.name=t,"value"in n&&(n=convertDataDescriptorToAccessor(e,t,i));var o=n.get,c=n.set;typeof o=="function"&&(n.get=function(){return log.call(r,i,a),o.apply(this,arguments)}),typeof c=="function"&&(n.set=function(){return log.call(r,i,a),c.apply(this,arguments)}),Object.defineProperty(e,t,n)}function DeprecationError(e,t,i){var n=new Error,r;return Object.defineProperty(n,"constructor",{value:DeprecationError}),Object.defineProperty(n,"message",{configurable:!0,enumerable:!1,value:t,writable:!0}),Object.defineProperty(n,"name",{enumerable:!1,configurable:!0,value:"DeprecationError",writable:!0}),Object.defineProperty(n,"namespace",{configurable:!0,enumerable:!1,value:e,writable:!0}),Object.defineProperty(n,"stack",{configurable:!0,enumerable:!1,get:function(){return r!==void 0?r:r=createStackString.call(this,i)},set:function(a){r=a}}),n}});var c2e=A((RRn,HJ)=>{"use strict";typeof Object.create=="function"?HJ.exports=function(t,i){i&&(t.super_=i,t.prototype=Object.create(i.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:HJ.exports=function(t,i){if(i){t.super_=i;var n=function(){};n.prototype=i.prototype,t.prototype=new n,t.prototype.constructor=t}}});var l2e=A((TRn,zJ)=>{"use strict";try{if(YJ=require("util"),typeof YJ.inherits!="function")throw"";zJ.exports=YJ.inherits}catch{zJ.exports=c2e()}var YJ});var h2e=A((MRn,gb)=>{"use strict";var WJ=o2e()("http-errors"),u2e=xU(),DE=kE(),JJ=l2e(),Cri=EU();gb.exports=dN;gb.exports.HttpError=wri();gb.exports.isHttpError=_ri(gb.exports.HttpError);kri(gb.exports,DE.codes,gb.exports.HttpError);function p2e(e){return+(String(e).charAt(0)+"00")}function dN(){for(var e,t,i=500,n={},r=0;r<arguments.length;r++){var s=arguments[r];if(s instanceof Error){e=s,i=e.status||e.statusCode||i;continue}switch(typeof s){case"string":t=s;break;case"number":i=s,r!==0&&WJ("non-first-argument status code; replace with createError("+s+", ...)");break;case"object":n=s;break}}typeof i=="number"&&(i<400||i>=600)&&WJ("non-error status code; use only 4xx or 5xx status codes"),(typeof i!="number"||!DE[i]&&(i<400||i>=600))&&(i=500);var a=dN[i]||dN[p2e(i)];e||(e=a?new a(t):new Error(t||DE[i]),Error.captureStackTrace(e,dN)),(!a||!(e instanceof a)||e.status!==i)&&(e.expose=i<500,e.status=e.statusCode=i);for(var o in n)o!=="status"&&o!=="statusCode"&&(e[o]=n[o]);return e}function wri(){function e(){throw new TypeError("cannot construct abstract class")}return JJ(e,Error),e}function Bri(e,t,i){var n=A2e(t);function r(s){var a=s??DE[i],o=new Error(a);return Error.captureStackTrace(o,r),u2e(o,r.prototype),Object.defineProperty(o,"message",{enumerable:!0,configurable:!0,value:a,writable:!0}),Object.defineProperty(o,"name",{enumerable:!1,configurable:!0,value:n,writable:!0}),o}return JJ(r,e),d2e(r,n),r.prototype.status=i,r.prototype.statusCode=i,r.prototype.expose=!0,r}function _ri(e){return function(i){return!i||typeof i!="object"?!1:i instanceof e?!0:i instanceof Error&&typeof i.expose=="boolean"&&typeof i.statusCode=="number"&&i.status===i.statusCode}}function Qri(e,t,i){var n=A2e(t);function r(s){var a=s??DE[i],o=new Error(a);return Error.captureStackTrace(o,r),u2e(o,r.prototype),Object.defineProperty(o,"message",{enumerable:!0,configurable:!0,value:a,writable:!0}),Object.defineProperty(o,"name",{enumerable:!1,configurable:!0,value:n,writable:!0}),o}return JJ(r,e),d2e(r,n),r.prototype.status=i,r.prototype.statusCode=i,r.prototype.expose=!1,r}function d2e(e,t){var i=Object.getOwnPropertyDescriptor(e,"name");i&&i.configurable&&(i.value=t,Object.defineProperty(e,"name",i))}function kri(e,t,i){t.forEach(function(r){var s,a=Cri(DE[r]);switch(p2e(r)){case 400:s=Bri(i,a,r);break;case 500:s=Qri(i,a,r);break}s&&(e[r]=s,e[a
|
|||
|
|
${n.replace(/^/gm," ")}
|
|||
|
|
`)}static get default(){return qqe}createAsyncCtxStorageMiddleware(){let t=this;return async function(n,r){await t.ctxStorage.run(n,async()=>await r())}}};function vai(e){if(e.respond===!1||!e.writable)return;let t=e.res,i=e.body,n=e.status;if(pai.empty[n])return e.body=null,t.end();if(e.method==="HEAD"){if(!t.headersSent&&!e.response.has("Content-Length")){let{length:r}=e.response;Number.isInteger(r)&&(e.length=r)}return t.end()}if(i==null)return e.response._explicitNullBody?(e.response.remove("Content-Type"),e.response.remove("Transfer-Encoding"),t.end()):(e.req.httpVersionMajor>=2?i=String(n):i=e.message||String(n),t.headersSent||(e.type="text",e.length=Buffer.byteLength(i)),t.end(i));if(Buffer.isBuffer(i)||typeof i=="string")return t.end(i);if(i instanceof Aai)return i.pipe(t);i=JSON.stringify(i),t.headersSent||(e.length=Buffer.byteLength(i)),t.end(i)}g7.exports.HttpError=bai});var Oqe=A((rTn,yai)=>{yai.exports={"100":"Continue","101":"Switching Protocols","102":"Processing","103":"Early Hints","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I'm a Teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Too Early","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"}});var wN=A((sTn,Gqe)=>{"use strict";var b7=Oqe();Gqe.exports=Mu;Mu.message=b7;Mu.code=xai(b7);Mu.codes=Eai(b7);Mu.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0};Mu.empty={204:!0,205:!0,304:!0};Mu.retry={502:!0,503:!0,504:!0};function xai(e){var t={};return Object.keys(e).forEach(function(n){var r=e[n],s=Number(n);t[r.toLowerCase()]=s}),t}function Eai(e){return Object.keys(e).map(function(i){return Number(i)})}function Iai(e){var t=e.toLowerCase();if(!Object.prototype.hasOwnProperty.call(Mu.code,t))throw new Error('invalid status message: "'+e+'"');return Mu.code[t]}function jqe(e){if(!Object.prototype.hasOwnProperty.call(Mu.message,e))throw new Error("invalid status code: "+e);return Mu.message[e]}function Mu(e){if(typeof e=="number")return jqe(e);if(typeof e!="string")throw new TypeError("code must be a number or string");var t=parseInt(e,10);return isNaN(t)?Iai(e):jqe(t)}});var Hqe=A((aTn,$qe)=>{"use strict";var Vqe=require("url").URLSearchParams;$qe.exports={stringify:e=>{let t=new Vqe,i=(n,r,s)=>{let a=typeof r=="string"||typeof r=="number"?r:"";s.append(n,a)};for(let[n,r]of Object.entries(e))if(Array.isArray(r)){let s=r.length;for(let a=0;a<s;a++)i(n,r[a],t)}else i(n,r,t);return t.toString()},parse:e=>{let t=new Vqe(e),i={};for(let n of t.keys()){let r=t.getAll(n);i[n]=r.length<=1?r[0]:r}return i}}});var Yqe=A((oTn,Cai)=>{Cai.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!
|
|||
|
|
${n.replace(/^/gm," ")}
|
|||
|
|
`)}static get default(){return UPe}};function Ooi(e){if(e.respond===!1)return;let t=e.res;if(!e.writable)return t.end();let i=e.body,n=e.status;if(Moi.empty[n])return e.body=null,t.end();if(e.method==="HEAD"){if(!t.headersSent&&!e.response.has("Content-Length")){let{length:s}=e.response;Number.isInteger(s)&&(e.length=s)}return t.end()}if(i==null)return e.response._explicitNullBody?(e.response.remove("Content-Type"),e.response.remove("Transfer-Encoding"),e.length=0,t.end()):(e.req.httpVersionMajor>=2?i=String(n):i=e.message||String(n),t.headersSent||(e.type="text",e.length=Buffer.byteLength(i)),t.end(i));if(Buffer.isBuffer(i)||typeof i=="string")return t.end(i);let r=null;if(i instanceof Blob?r=UN.Readable.from(i.stream()):i instanceof ReadableStream?r=UN.Readable.from(i):i instanceof Response?r=UN.Readable.from(i?.body||""):qoi(i)&&(r=i),r)return UN.pipeline(r,t,s=>{s&&e.app.listenerCount("error")&&e.onerror(s)});i=JSON.stringify(i),t.headersSent||(e.length=Buffer.byteLength(i)),t.end(i)}_7.exports.HttpError=Uoi});var zi=A((kTn,tOe)=>{"use strict";var LN=Object.defineProperty,Woi=Object.getOwnPropertyDescriptor,Joi=Object.getOwnPropertyNames,Zoi=Object.prototype.hasOwnProperty,MA=(e,t)=>LN(e,"name",{value:t,configurable:!0}),Koi=(e,t)=>{for(var i in t)LN(e,i,{get:t[i],enumerable:!0})},Xoi=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Joi(t))!Zoi.call(e,r)&&r!==i&&LN(e,r,{get:()=>t[r],enumerable:!(n=Woi(t,r))||n.enumerable});return e},eci=e=>Xoi(LN({},"__esModule",{value:!0}),e),$Pe={};Koi($Pe,{GatewayRateLimitError:()=>tci,calculateShardId:()=>zPe,getUserAgentAppendix:()=>JPe,isEquatable:()=>XPe,isJSONEncodable:()=>KPe,lazy:()=>HPe,polyfillDispose:()=>ZPe,range:()=>YPe,shouldUseGlobalFetchAndWebSocket:()=>WPe,version:()=>ici});tOe.exports=eci($Pe);function HPe(e){let t;return()=>t??=e()}MA(HPe,"lazy");function*YPe(e){let t,i=0,n=1;typeof e=="number"?t=e:(i=e.start,t=e.end,n=e.step??1);for(let r=i;r<t;r+=n)yield r}MA(YPe,"range");function zPe(e,t){return Number(BigInt(e)>>22n)%t}MA(zPe,"calculateShardId");function WPe(){return typeof globalThis.process>"u"?"fetch"in globalThis&&"WebSocket"in globalThis:"versions"in globalThis.process?"deno"in globalThis.process.versions||"bun"in globalThis.process.versions:!1}MA(WPe,"shouldUseGlobalFetchAndWebSocket");function JPe(){if(typeof globalThis.EdgeRuntime<"u")return"Vercel-Edge-Functions";if(typeof globalThis.R2<"u"&&typeof globalThis.WebSocketPair<"u")return"Cloudflare-Workers";if(typeof globalThis.Netlify<"u")return"Netlify-Edge-Functions";if(typeof globalThis.process!="object")return typeof globalThis.navigator=="object"?globalThis.navigator.userAgent:"UnknownEnvironment";if("versions"in globalThis.process){if("deno"in globalThis.process.versions)return`Deno/${globalThis.process.versions.deno}`;if("bun"in globalThis.process.versions)return`Bun/${globalThis.process.versions.bun}`;if("node"in globalThis.process.versions)return`Node.js/${globalThis.process.versions.node}`}return"UnknownEnvironment"}MA(JPe,"getUserAgentAppendix");function ZPe(){Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose")}MA(ZPe,"polyfillDispose");function KPe(e){return e!==null&&typeof e=="object"&&"toJSON"in e}MA(KPe,"isJSONEncodable");function XPe(e){return e!==null&&typeof e=="object"&&"equals"in e}MA(XPe,"isEquatable");var tci=class eOe extends Error{constructor(t,i){super(`Request with opcode ${t.opcode} was rate limited. Retry after ${t.retry_after} seconds.`),this.data=t,this.payload=i}static{MA(this,"GatewayRateLimitError")}name=eOe.name},ici="1.2.0"});var R7={};fp(R7,{__addDisposableResource:()=>BOe,__assign:()=>FN,__asyncDelegator:()=>bOe,__asyncGenerator:()=>gOe,__asyncValues:()=>vOe,__await:()=>UE,__awaiter:()=>pOe,__classPrivateFieldGet:()=>IOe,__classPrivateFieldIn:()=>wOe,__classPrivateFieldSet:()=>COe,__createBinding:()=>PN,__decorate:()=>rOe,__disposeResources:()=>_Oe,__esDecorate:()=>aOe,__exportStar:()=>AOe,__extends:()=>iOe,__generator:()=>dOe,__importDefault:()=>EOe,__importStar:()=>xOe,__makeTemplateObject:()=>yOe,_
|
|||
|
|
`)||e.includes("\r")||e.includes("\0"))===!1}function Qui(e,t){let{headersList:i}=t,n=(i.get("referrer-policy",!0)??"").split(","),r="";if(n.length>0)for(let s=n.length;s!==0;s--){let a=n[s-1].trim();if(dui.has(a)){r=a;break}}r!==""&&(e.referrerPolicy=r)}function kui(){return"allowed"}function Sui(){return"success"}function Dui(){return"success"}function Rui(e){let t=null;t=e.mode,e.headersList.set("sec-fetch-mode",t,!0)}function Tui(e){let t=e.origin;if(!(t==="client"||t===void 0)){if(e.responseTainting==="cors"||e.mode==="websocket")e.headersList.append("origin",t,!0);else if(e.method!=="GET"&&e.method!=="HEAD"){switch(e.referrerPolicy){case"no-referrer":t=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":e.origin&&QZ(e.origin)&&!QZ(fQ(e))&&(t=null);break;case"same-origin":cL(e,fQ(e))||(t=null);break;default:}e.headersList.append("origin",t,!0)}}}function $E(e,t){return e}function Mui(e,t,i){return!e?.startTime||e.startTime<t?{domainLookupStartTime:t,domainLookupEndTime:t,connectionStartTime:t,connectionEndTime:t,secureConnectionStartTime:t,ALPNNegotiatedProtocol:e?.ALPNNegotiatedProtocol}:{domainLookupStartTime:$E(e.domainLookupStartTime,i),domainLookupEndTime:$E(e.domainLookupEndTime,i),connectionStartTime:$E(e.connectionStartTime,i),connectionEndTime:$E(e.connectionEndTime,i),secureConnectionStartTime:$E(e.secureConnectionStartTime,i),ALPNNegotiatedProtocol:e.ALPNNegotiatedProtocol}}function Uui(e){return $E(gui.now(),e)}function Nui(e){return{startTime:e.startTime??0,redirectStartTime:0,redirectEndTime:0,postRedirectStartTime:e.startTime??0,finalServiceWorkerStartTime:0,finalNetworkResponseStartTime:0,finalNetworkRequestStartTime:0,endTime:0,encodedBodySize:0,decodedBodySize:0,finalConnectionTimingInfo:null}}function tGe(){return{referrerPolicy:"strict-origin-when-cross-origin"}}function Lui(e){return{referrerPolicy:e.referrerPolicy}}function Fui(e){let t=e.referrerPolicy;Ib(t);let i=null;if(e.referrer==="client"){let o=Wje();if(!o||o.origin==="null")return"no-referrer";i=new URL(o)}else e.referrer instanceof URL&&(i=e.referrer);let n=_Z(i),r=_Z(i,!0);n.toString().length>4096&&(n=r);let s=cL(e,n),a=mQ(n)&&!mQ(e.url);switch(t){case"origin":return r??_Z(i,!0);case"unsafe-url":return n;case"same-origin":return s?r:"no-referrer";case"origin-when-cross-origin":return s?n:r;case"strict-origin-when-cross-origin":{let o=fQ(e);return cL(n,o)?n:mQ(n)&&!mQ(o)?"no-referrer":r}case"strict-origin":case"no-referrer-when-downgrade":default:return a?"no-referrer":r}}function _Z(e,t){return Ib(e instanceof URL),e=new URL(e),e.protocol==="file:"||e.protocol==="about:"||e.protocol==="blank:"?"no-referrer":(e.username="",e.password="",e.hash="",t&&(e.pathname="",e.search=""),e)}function mQ(e){if(!(e instanceof URL))return!1;if(e.href==="about:blank"||e.href==="about:srcdoc"||e.protocol==="data:"||e.protocol==="file:")return!0;return t(e.origin);function t(i){if(i==null||i==="null")return!1;let n=new URL(i);return!!(n.protocol==="https:"||n.protocol==="wss:"||/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(n.hostname)||n.hostname==="localhost"||n.hostname.includes("localhost.")||n.hostname.endsWith(".localhost"))}}function qui(e,t){if(oL===void 0)return!0;let i=iGe(t);if(i==="no metadata"||i.length===0)return!0;let n=Oui(i),r=jui(i,n);for(let s of r){let a=s.algo,o=s.hash,c=oL.createHash(a).update(e).digest("base64");if(c[c.length-1]==="="&&(c[c.length-2]==="="?c=c.slice(0,-2):c=c.slice(0,-1)),Gui(c,o))return!0}return!1}var Pui=/(?<algo>sha256|sha384|sha512)-((?<hash>[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i;function iGe(e){let t=[],i=!0;for(let n of e.split(" ")){i=!1;let r=Pui.exec(n);if(r===null||r.groups===void 0||r.groups.algo===void 0)continue;let s=r.groups.algo.toLowerCase();Zje.includes(s)&&t.push(r.groups)}return i===!0?"no metadata":t}function Oui(e){let t=e[0].algo;if(t[3]==="5")return t;for(let i=1;i<e.length;++i){let n=e[i];if(n.algo[3]==="5"){t="sha512";break}else{if(t[3]==="3")continue;n.algo[3]==="3"&&(t="sha384")}}return t}function jui(e,
|
|||
|
|
`);function Bpi(e){for(let t=0;t<e.length;++t)if((e.charCodeAt(t)&-128)!==0)return!1;return!0}function _pi(e){let t=e.length;if(t<27||t>70)return!1;for(let i=0;i<t;++i){let n=e.charCodeAt(i);if(!(n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122||n===39||n===45||n===95))return!1}return!0}function Qpi(e,t){uL(t!=="failure"&&t.essence==="multipart/form-data");let i=t.parameters.get("boundary");if(i===void 0)return"failure";let n=Buffer.from(`--${i}`,"utf8"),r=[],s={position:0};for(;e[s.position]===13&&e[s.position+1]===10;)s.position+=2;let a=e.length;for(;e[a-1]===10&&e[a-2]===13;)a-=2;for(a!==e.length&&(e=e.subarray(0,a));;){if(e.subarray(s.position,s.position+n.length).equals(n))s.position+=n.length;else return"failure";if(s.position===e.length-2&&pL(e,Cpi,s)||s.position===e.length-4&&pL(e,wpi,s))return r;if(e[s.position]!==13||e[s.position+1]!==10)return"failure";s.position+=2;let o=kpi(e,s);if(o==="failure")return"failure";let{name:c,filename:u,contentType:d,encoding:l}=o;s.position+=2;let p;{let m=e.indexOf(n.subarray(2),s.position);if(m===-1)return"failure";p=e.subarray(s.position,m-4),s.position+=p.length,l==="base64"&&(p=Buffer.from(p.toString(),"base64"))}if(e[s.position]!==13||e[s.position+1]!==10)return"failure";s.position+=2;let h;u!==null?(d??="text/plain",Bpi(d)||(d=""),h=new Epi([p],u,{type:d})):h=gpi(Buffer.from(p)),uL(mGe(c)),uL(typeof h=="string"&&mGe(h)||vpi(h)),r.push(ypi(c,h,u))}}function kpi(e,t){let i=null,n=null,r=null,s=null;for(;;){if(e[t.position]===13&&e[t.position+1]===10)return i===null?"failure":{name:i,filename:n,contentType:r,encoding:s};let a=YE(o=>o!==10&&o!==13&&o!==58,e,t);if(a=UZ(a,!0,!0,o=>o===9||o===32),!bpi.test(a.toString())||e[t.position]!==58)return"failure";switch(t.position++,YE(o=>o===32||o===9,e,t),fpi(a)){case"content-disposition":{if(i=n=null,!pL(e,Ipi,t)||(t.position+=17,i=bGe(e,t),i===null))return"failure";if(pL(e,gGe,t)){let o=t.position+gGe.length;if(e[o]===42&&(t.position+=1,o+=1),e[o]!==61||e[o+1]!==34||(t.position+=12,n=bGe(e,t),n===null))return"failure"}break}case"content-type":{let o=YE(c=>c!==10&&c!==13,e,t);o=UZ(o,!1,!0,c=>c===9||c===32),r=fGe(o);break}case"content-transfer-encoding":{let o=YE(c=>c!==10&&c!==13,e,t);o=UZ(o,!1,!0,c=>c===9||c===32),s=fGe(o);break}default:YE(o=>o!==10&&o!==13,e,t)}if(e[t.position]!==13&&e[t.position+1]!==10)return"failure";t.position+=2}}function bGe(e,t){uL(e[t.position-1]===34);let i=YE(n=>n!==10&&n!==13&&n!==34,e,t);return e[t.position]!==34?null:(t.position++,i=new TextDecoder().decode(i).replace(/%0A/ig,`
|
|||
|
|
`).replace(/%0D/ig,"\r").replace(/%22/g,'"'),i)}function YE(e,t,i){let n=i.position;for(;n<t.length&&e(t[n]);)++n;return t.subarray(i.position,i.position=n)}function UZ(e,t,i,n){let r=0,s=e.length-1;if(t)for(;r<e.length&&n(e[r]);)r++;if(i)for(;s>0&&n(e[s]);)s--;return r===0&&s===e.length-1?e:e.subarray(r,s+1)}function pL(e,t,i){if(e.length<t.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[i.position+n])return!1;return!0}vGe.exports={multipartFormDataParser:Qpi,validateBoundary:_pi}});var JE=A((nMn,QGe)=>{"use strict";var vQ=ni(),{ReadableStreamFrom:Spi,isBlobLike:xGe,isReadableStreamLike:Dpi,readableStreamClose:Rpi,createDeferredPromise:Tpi,fullyReadBody:Mpi,extractMimeType:Upi,utf8DecodeBytes:CGe}=Qc(),{FormData:EGe}=bQ(),{kState:WE}=Tm(),{webidl:Npi}=Fs(),{Blob:Lpi}=require("node:buffer"),NZ=require("node:assert"),{isErrored:wGe,isDisturbed:Fpi}=require("node:stream"),{isArrayBuffer:qpi}=require("node:util/types"),{serializeAMimeType:Ppi}=Fo(),{multipartFormDataParser:Opi}=yGe(),LZ;try{let e=require("node:crypto");LZ=t=>e.randomInt(0,t)}catch{LZ=e=>Math.floor(Math.random(e))}var dL=new TextEncoder;function jpi(){}var FZ=globalThis.FinalizationRegistry&&process.version.indexOf("v18")!==0,qZ;FZ&&(qZ=new FinalizationRegistry(e=>{let t=e.deref();t&&!t.locked&&!Fpi(t)&&!wGe(t)&&t.cancel("Response object has been garbage collected").catch(jpi)}));function BGe(e,t=!1){let i=null;e instanceof ReadableStream?i=e:xGe(e)?i=e.stream():i=new ReadableStream({async pull(c){let u=typeof r=="string"?dL.encode(r):r;u.byteLength&&c.enqueue(u),queueMicrotask(()=>Rpi(c))},start(){},type:"bytes"}),NZ(Dpi(i));let n=null,r=null,s=null,a=null;if(typeof e=="string")r=e,a="text/plain;charset=UTF-8";else if(e instanceof URLSearchParams)r=e.toString(),a="application/x-www-form-urlencoded;charset=UTF-8";else if(qpi(e))r=new Uint8Array(e.slice());else if(ArrayBuffer.isView(e))r=new Uint8Array(e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength));else if(vQ.isFormDataLike(e)){let c=`----formdata-undici-0${`${LZ(1e11)}`.padStart(11,"0")}`,u=`--${c}\r
|
|||
|
|
Content-Disposition: form-data`;let d=g=>g.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),l=g=>g.replace(/\r?\n|\r/g,`\r
|
|||
|
|
`),p=[],h=new Uint8Array([13,10]);s=0;let m=!1;for(let[g,b]of e)if(typeof b=="string"){let v=dL.encode(u+`; name="${d(l(g))}"\r
|
|||
|
|
\r
|
|||
|
|
${l(b)}\r
|
|||
|
|
`);p.push(v),s+=v.byteLength}else{let v=dL.encode(`${u}; name="${d(l(g))}"`+(b.name?`; filename="${d(b.name)}"`:"")+`\r
|
|||
|
|
Content-Type: ${b.type||"application/octet-stream"}\r
|
|||
|
|
\r
|
|||
|
|
`);p.push(v,b,h),typeof b.size=="number"?s+=v.byteLength+b.size+h.byteLength:m=!0}let f=dL.encode(`--${c}--\r
|
|||
|
|
`);p.push(f),s+=f.byteLength,m&&(s=null),r=e,n=async function*(){for(let g of p)g.stream?yield*g.stream():yield g},a=`multipart/form-data; boundary=${c}`}else if(xGe(e))r=e,s=e.size,e.type&&(a=e.type);else if(typeof e[Symbol.asyncIterator]=="function"){if(t)throw new TypeError("keepalive");if(vQ.isDisturbed(e)||e.locked)throw new TypeError("Response body object should not be disturbed or locked");i=e instanceof ReadableStream?e:Spi(e)}if((typeof r=="string"||vQ.isBuffer(r))&&(s=Buffer.byteLength(r)),n!=null){let c;i=new ReadableStream({async start(){c=n(e)[Symbol.asyncIterator]()},async pull(u){let{value:d,done:l}=await c.next();if(l)queueMicrotask(()=>{u.close(),u.byobRequest?.respond(0)});else if(!wGe(i)){let p=new Uint8Array(d);p.byteLength&&u.enqueue(p)}return u.desiredSize>0},async cancel(u){await c.return()},type:"bytes"})}return[{stream:i,source:r,length:s},a]}function Gpi(e,t=!1){return e instanceof ReadableStream&&(NZ(!vQ.isDisturbed(e),"The body has already been consumed."),NZ(!e.locked,"The stream is locked.")),BGe(e,t)}function Vpi(e,t){let[i,n]=t.stream.tee();return FZ&&qZ.register(e,new WeakRef(i)),t.stream=i,{stream:n,length:t.length,source:t.source}}function $pi(e){if(e.aborted)throw new DOMException("The operation was aborted.","AbortError")}function Hpi(e){return{blob(){return zE(this,i=>{let n=IGe(this);return n===null?n="":n&&(n=Ppi(n)),new Lpi([i],{type:n})},e)},arrayBuffer(){return zE(this,i=>new Uint8Array(i).buffer,e)},text(){return zE(this,CGe,e)},json(){return zE(this,zpi,e)},formData(){return zE(this,i=>{let n=IGe(this);if(n!==null)switch(n.essence){case"multipart/form-data":{let r=Opi(i,n);if(r==="failure")throw new TypeError("Failed to parse body as FormData.");let s=new EGe;return s[WE]=r,s}case"application/x-www-form-urlencoded":{let r=new URLSearchParams(i.toString()),s=new EGe;for(let[a,o]of r)s.append(a,o);return s}}throw new TypeError('Content-Type was not one of "multipart/form-data" or "application/x-www-form-urlencoded".')},e)},bytes(){return zE(this,i=>new Uint8Array(i),e)}}}function Ypi(e){Object.assign(e.prototype,Hpi(e))}async function zE(e,t,i){if(Npi.brandCheck(e,i),_Ge(e))throw new TypeError("Body is unusable: Body has already been read");$pi(e[WE]);let n=Tpi(),r=a=>n.reject(a),s=a=>{try{n.resolve(t(a))}catch(o){r(o)}};return e[WE].body==null?(s(Buffer.allocUnsafe(0)),n.promise):(await Mpi(e[WE].body,s,r),n.promise)}function _Ge(e){let t=e[WE].body;return t!=null&&(t.stream.locked||vQ.isDisturbed(t.stream))}function zpi(e){return JSON.parse(CGe(e))}function IGe(e){let t=e[WE].headersList,i=Upi(t);return i==="failure"?null:i}QGe.exports={extractBody:BGe,safelyExtractBody:Gpi,cloneBody:Vpi,mixinBody:Ypi,streamRegistry:qZ,hasFinalizationRegistry:FZ,bodyUnusable:_Ge}});var qGe=A((rMn,FGe)=>{"use strict";var vt=require("node:assert"),Dt=ni(),{channels:kGe}=LE(),PZ=vZ(),{RequestContentLengthMismatchError:Cb,ResponseContentLengthMismatchError:Wpi,RequestAbortedError:UGe,HeadersTimeoutError:Jpi,HeadersOverflowError:Zpi,SocketError:bL,InformationalError:ZE,BodyTimeoutError:Kpi,HTTPParserError:Xpi,ResponseExceededMaxSizeError:edi}=Fi(),{kUrl:NGe,kReset:qo,kClient:VZ,kParser:vr,kBlocking:EQ,kRunning:pa,kPending:tdi,kSize:SGe,kWriting:Um,kQueue:Uu,kNoRef:yQ,kKeepAliveDefaultTimeout:idi,kHostHeader:ndi,kPendingIdx:rdi,kRunningIdx:Sl,kError:Dl,kPipelining:fL,kSocket:KE,kKeepAliveTimeoutValue:vL,kMaxHeadersSize:OZ,kKeepAliveMaxTimeout:sdi,kKeepAliveTimeoutThreshold:adi,kHeadersTimeout:odi,kBodyTimeout:cdi,kStrictContentLength:$Z,kMaxRequests:DGe,kCounter:ldi,kMaxResponseSize:udi,kOnError:pdi,kResume:Mm,kHTTPContext:LGe}=Vn(),$p=_je(),ddi=Buffer.alloc(0),AL=Buffer[Symbol.species],hL=Dt.addListener,Adi=Dt.removeAllListeners,jZ;async function hdi(){let e=process.env.JEST_WORKER_ID?EZ():void 0,t;try{t=await WebAssembly.compile(Sje())}catch{t=await WebAssembly.compile(e||EZ())}return await WebAssembly.instantiate(t,{env:{wasm_on_url:(i,n,r)=>0,wasm_on_status:(i,n,r)=>{vt(ss.ptr===i);let s=n-Yp+Hp.byteOffset;return ss.onStatus(new AL(Hp.buffer,s,r))||0},wasm_on_message_begin:i=>(vt(ss.ptr===i),ss
|
|||
|
|
`;if(typeof r=="string"?f+=`host: ${r}\r
|
|||
|
|
`:f+=e[ndi],s?f+=`connection: upgrade\r
|
|||
|
|
upgrade: ${s}\r
|
|||
|
|
`:e[fL]&&!h[qo]?f+=`connection: keep-alive\r
|
|||
|
|
`:f+=`connection: close\r
|
|||
|
|
`,Array.isArray(u))for(let g=0;g<u.length;g+=2){let b=u[g+0],v=u[g+1];if(Array.isArray(v))for(let y=0;y<v.length;y++)f+=`${b}: ${v[y]}\r
|
|||
|
|
`;else f+=`${b}: ${v}\r
|
|||
|
|
`}return kGe.sendHeaders.hasSubscribers&&kGe.sendHeaders.publish({request:t,headers:f,socket:h}),!c||p===0?TGe(m,null,e,t,h,d,f,l):Dt.isBuffer(c)?TGe(m,c,e,t,h,d,f,l):Dt.isBlobLike(c)?typeof c.stream=="function"?MGe(m,c.stream(),e,t,h,d,f,l):xdi(m,c,e,t,h,d,f,l):Dt.isStream(c)?ydi(m,c,e,t,h,d,f,l):Dt.isIterable(c)?MGe(m,c,e,t,h,d,f,l):vt(!1),!0}function ydi(e,t,i,n,r,s,a,o){vt(s!==0||i[pa]===0,"stream body cannot be pipelined");let c=!1,u=new yL({abort:e,socket:r,request:n,contentLength:s,client:i,expectsPayload:o,header:a}),d=function(m){if(!c)try{!u.write(m)&&this.pause&&this.pause()}catch(f){Dt.destroy(this,f)}},l=function(){c||t.resume&&t.resume()},p=function(){if(queueMicrotask(()=>{t.removeListener("error",h)}),!c){let m=new UGe;queueMicrotask(()=>h(m))}},h=function(m){if(!c){if(c=!0,vt(r.destroyed||r[Um]&&i[pa]<=1),r.off("drain",l).off("error",h),t.removeListener("data",d).removeListener("end",h).removeListener("close",p),!m)try{u.end()}catch(f){m=f}u.destroy(m),m&&(m.code!=="UND_ERR_INFO"||m.message!=="reset")?Dt.destroy(t,m):Dt.destroy(t)}};t.on("data",d).on("end",h).on("error",h).on("close",p),t.resume&&t.resume(),r.on("drain",l).on("error",h),t.errorEmitted??t.errored?setImmediate(()=>h(t.errored)):(t.endEmitted??t.readableEnded)&&setImmediate(()=>h(null)),(t.closeEmitted??t.closed)&&setImmediate(p)}function TGe(e,t,i,n,r,s,a,o){try{t?Dt.isBuffer(t)&&(vt(s===t.byteLength,"buffer body must have content length"),r.cork(),r.write(`${a}content-length: ${s}\r
|
|||
|
|
\r
|
|||
|
|
`,"latin1"),r.write(t),r.uncork(),n.onBodySent(t),!o&&n.reset!==!1&&(r[qo]=!0)):s===0?r.write(`${a}content-length: 0\r
|
|||
|
|
\r
|
|||
|
|
`,"latin1"):(vt(s===null,"no body must not have content length"),r.write(`${a}\r
|
|||
|
|
`,"latin1")),n.onRequestSent(),i[Mm]()}catch(c){e(c)}}async function xdi(e,t,i,n,r,s,a,o){vt(s===t.size,"blob body must have content length");try{if(s!=null&&s!==t.size)throw new Cb;let c=Buffer.from(await t.arrayBuffer());r.cork(),r.write(`${a}content-length: ${s}\r
|
|||
|
|
\r
|
|||
|
|
`,"latin1"),r.write(c),r.uncork(),n.onBodySent(c),n.onRequestSent(),!o&&n.reset!==!1&&(r[qo]=!0),i[Mm]()}catch(c){e(c)}}async function MGe(e,t,i,n,r,s,a,o){vt(s!==0||i[pa]===0,"iterator body cannot be pipelined");let c=null;function u(){if(c){let p=c;c=null,p()}}let d=()=>new Promise((p,h)=>{vt(c===null),r[Dl]?h(r[Dl]):c=p});r.on("close",u).on("drain",u);let l=new yL({abort:e,socket:r,request:n,contentLength:s,client:i,expectsPayload:o,header:a});try{for await(let p of t){if(r[Dl])throw r[Dl];l.write(p)||await d()}l.end()}catch(p){l.destroy(p)}finally{r.off("close",u).off("drain",u)}}var yL=class{constructor({abort:t,socket:i,request:n,contentLength:r,client:s,expectsPayload:a,header:o}){this.socket=i,this.request=n,this.contentLength=r,this.client=s,this.bytesWritten=0,this.expectsPayload=a,this.header=o,this.abort=t,i[Um]=!0}write(t){let{socket:i,request:n,contentLength:r,client:s,bytesWritten:a,expectsPayload:o,header:c}=this;if(i[Dl])throw i[Dl];if(i.destroyed)return!1;let u=Buffer.byteLength(t);if(!u)return!0;if(r!==null&&a+u>r){if(s[$Z])throw new Cb;process.emitWarning(new Cb)}i.cork(),a===0&&(!o&&n.reset!==!1&&(i[qo]=!0),r===null?i.write(`${c}transfer-encoding: chunked\r
|
|||
|
|
`,"latin1"):i.write(`${c}content-length: ${r}\r
|
|||
|
|
\r
|
|||
|
|
`,"latin1")),r===null&&i.write(`\r
|
|||
|
|
${u.toString(16)}\r
|
|||
|
|
`,"latin1"),this.bytesWritten+=u;let d=i.write(t);return i.uncork(),n.onBodySent(t),d||i[vr].timeout&&i[vr].timeoutType===XE&&i[vr].timeout.refresh&&i[vr].timeout.refresh(),d}end(){let{socket:t,contentLength:i,client:n,bytesWritten:r,expectsPayload:s,header:a,request:o}=this;if(o.onRequestSent(),t[Um]=!1,t[Dl])throw t[Dl];if(!t.destroyed){if(r===0?s?t.write(`${a}content-length: 0\r
|
|||
|
|
\r
|
|||
|
|
`,"latin1"):t.write(`${a}\r
|
|||
|
|
`,"latin1"):i===null&&t.write(`\r
|
|||
|
|
0\r
|
|||
|
|
\r
|
|||
|
|
`,"latin1"),i!==null&&r!==i){if(n[$Z])throw new Cb;process.emitWarning(new Cb)}t[vr].timeout&&t[vr].timeoutType===XE&&t[vr].timeout.refresh&&t[vr].timeout.refresh(),n[Mm]()}}destroy(t){let{socket:i,client:n,abort:r}=this;i[Um]=!1,t&&(vt(n[pa]<=1,"pipeline should only contain this request"),r(t))}};FGe.exports=fdi});var YGe=A((sMn,HGe)=>{"use strict";var Rl=require("node:assert"),{pipeline:Edi}=require("node:stream"),ci=ni(),{RequestContentLengthMismatchError:WZ,RequestAbortedError:PGe,SocketError:IQ,InformationalError:JZ}=Fi(),{kUrl:xL,kReset:IL,kClient:eI,kRunning:CL,kPending:Idi,kQueue:Nm,kPendingIdx:ZZ,kRunningIdx:Nu,kError:Fu,kSocket:Es,kStrictContentLength:Cdi,kOnError:KZ,kMaxConcurrentStreams:$Ge,kHTTP2Session:Lu,kResume:Lm,kSize:wdi,kHTTPContext:Bdi}=Vn(),PA=Symbol("open streams"),OGe,jGe=!1,EL;try{EL=require("node:http2")}catch{EL={constants:{}}}var{constants:{HTTP2_HEADER_AUTHORITY:_di,HTTP2_HEADER_METHOD:Qdi,HTTP2_HEADER_PATH:kdi,HTTP2_HEADER_SCHEME:Sdi,HTTP2_HEADER_CONTENT_LENGTH:Ddi,HTTP2_HEADER_EXPECT:Rdi,HTTP2_HEADER_STATUS:Tdi}}=EL;function Mdi(e){let t=[];for(let[i,n]of Object.entries(e))if(Array.isArray(n))for(let r of n)t.push(Buffer.from(i),Buffer.from(r));else t.push(Buffer.from(i),Buffer.from(n));return t}async function Udi(e,t){e[Es]=t,jGe||(jGe=!0,process.emitWarning("H2 support is experimental, expect them to change at any time.",{code:"UNDICI-H2"}));let i=EL.connect(e[xL],{createConnection:()=>t,peerMaxConcurrentStreams:e[$Ge]});i[PA]=0,i[eI]=e,i[Es]=t,ci.addListener(i,"error",Ldi),ci.addListener(i,"frameError",Fdi),ci.addListener(i,"end",qdi),ci.addListener(i,"goaway",Pdi),ci.addListener(i,"close",function(){let{[eI]:r}=this,{[Es]:s}=r,a=this[Es][Fu]||this[Fu]||new IQ("closed",ci.getSocketInfo(s));if(r[Lu]=null,r.destroyed){Rl(r[Idi]===0);let o=r[Nm].splice(r[Nu]);for(let c=0;c<o.length;c++){let u=o[c];ci.errorRequest(r,u,a)}}}),i.unref(),e[Lu]=i,t[Lu]=i,ci.addListener(t,"error",function(r){Rl(r.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[Fu]=r,this[eI][KZ](r)}),ci.addListener(t,"end",function(){ci.destroy(this,new IQ("other side closed",ci.getSocketInfo(this)))}),ci.addListener(t,"close",function(){let r=this[Fu]||new IQ("closed",ci.getSocketInfo(this));e[Es]=null,this[Lu]!=null&&this[Lu].destroy(r),e[ZZ]=e[Nu],Rl(e[CL]===0),e.emit("disconnect",e[xL],[e],r),e[Lm]()});let n=!1;return t.on("close",()=>{n=!0}),{version:"h2",defaultPipelining:1/0,write(...r){return jdi(e,...r)},resume(){Ndi(e)},destroy(r,s){n?queueMicrotask(s):t.destroy(r).on("close",s)},get destroyed(){return t.destroyed},busy(){return!1}}}function Ndi(e){let t=e[Es];t?.destroyed===!1&&(e[wdi]===0&&e[$Ge]===0?(t.unref(),e[Lu].unref()):(t.ref(),e[Lu].ref()))}function Ldi(e){Rl(e.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[Es][Fu]=e,this[eI][KZ](e)}function Fdi(e,t,i){if(i===0){let n=new JZ(`HTTP/2: "frameError" received - type ${e}, code ${t}`);this[Es][Fu]=n,this[eI][KZ](n)}}function qdi(){let e=new IQ("other side closed",ci.getSocketInfo(this[Es]));this.destroy(e),ci.destroy(this[Es],e)}function Pdi(e){let t=this[Fu]||new IQ(`HTTP/2: "GOAWAY" frame received with code ${e}`,ci.getSocketInfo(this)),i=this[eI];if(i[Es]=null,i[Bdi]=null,this[Lu]!=null&&(this[Lu].destroy(t),this[Lu]=null),ci.destroy(this[Es],t),i[Nu]<i[Nm].length){let n=i[Nm][i[Nu]];i[Nm][i[Nu]++]=null,ci.errorRequest(i,n,t),i[ZZ]=i[Nu]}Rl(i[CL]===0),i.emit("disconnect",i[xL],[i],t),i[Lm]()}function Odi(e){return e!=="GET"&&e!=="HEAD"&&e!=="OPTIONS"&&e!=="TRACE"&&e!=="CONNECT"}function jdi(e,t){let i=e[Lu],{method:n,path:r,host:s,upgrade:a,expectContinue:o,signal:c,headers:u}=t,{body:d}=t;if(a)return ci.errorRequest(e,t,new Error("Upgrade not supported for H2")),!1;let l={};for(let I=0;I<u.length;I+=2){let T=u[I+0],j=u[I+1];if(Array.isArray(j))for(let Y=0;Y<j.length;Y++)l[T]?l[T]+=`,${j[Y]}`:l[T]=j[Y];else l[T]=j}let p,{hostname:h,port:m}=e[xL];l[_di]=s||`${h}${m?`:${m}`:""}`,l[Qdi]=n;let f=I=>{t.aborted||t.completed||(I=I||new PGe,ci.errorRequest(e,t,I),p!=null&&ci.destroy(p,I),ci.destroy(d,I),e[Nm][e[Nu]++]=null,e[Lm]())};try{t.onConnect(f)}catch(I){ci.errorRequest
|
|||
|
|
`,this[hAi]=c??3e5,this[AAi]=r??3e5,this[mAi]=v??!0,this[fAi]=I,this[iK]=j,this[qm]=null,this[xAi]=G>-1?G:-1,this[IAi]=W??100,this[Dr]=null,this[qu]=[],this[jA]=0,this[Pu]=0,this[_Q]=x=>rK(this,x),this[EAi]=x=>s4e(this,x)}get pipelining(){return this[QL]}set pipelining(t){this[QL]=t,this[_Q](!0)}get[SQ](){return this[qu].length-this[Pu]}get[kQ](){return this[Pu]-this[jA]}get[QQ](){return this[qu].length-this[jA]}get[aAi](){return!!this[Dr]&&!this[iI]&&!this[Dr].destroyed}get[tK](){return!!(this[Dr]?.busy(null)||this[QQ]>=(r4e(this)||1)||this[SQ]>0)}[sAi](t){a4e(this),this.once("connect",t)}[yAi](t,i){let n=t.origin||this[Wp].origin,r=new Xdi(n,t,i);return this[qu].push(r),this[Bb]||(wb.bodyLength(r.body)==null&&wb.isIterable(r.body)?(this[Bb]=1,queueMicrotask(()=>rK(this))):this[_Q](!0)),this[Bb]&&this[Pm]!==2&&this[tK]&&(this[Pm]=2),this[Pm]<2}async[bAi](){return new Promise(t=>{this[QQ]?this[qm]=t:t(null)})}async[vAi](t){return new Promise(i=>{let n=this[qu].splice(this[Pu]);for(let s=0;s<n.length;s++){let a=n[s];wb.errorRequest(this,a,t)}let r=()=>{this[qm]&&(this[qm](),this[qm]=null),i(null)};this[Dr]?(this[Dr].destroy(t,r),this[Dr]=null):queueMicrotask(r),this[_Q]()})}},BAi=_L();function s4e(e,t){if(e[kQ]===0&&t.code!=="UND_ERR_INFO"&&t.code!=="UND_ERR_SOCKET"){OA(e[Pu]===e[jA]);let i=e[qu].splice(e[jA]);for(let n=0;n<i.length;n++){let r=i[n];wb.errorRequest(e,r,t)}OA(e[QQ]===0)}}async function a4e(e){OA(!e[iI]),OA(!e[Dr]);let{host:t,hostname:i,protocol:n,port:r}=e[Wp];if(i[0]==="["){let s=i.indexOf("]");OA(s!==-1);let a=i.substring(1,s);OA(n4e.isIP(a)),i=a}e[iI]=!0,tI.beforeConnect.hasSubscribers&&tI.beforeConnect.publish({connectParams:{host:t,hostname:i,protocol:n,port:r,version:e[Dr]?.version,servername:e[Fm],localAddress:e[BQ]},connector:e[wQ]});try{let s=await new Promise((a,o)=>{e[wQ]({host:t,hostname:i,protocol:n,port:r,servername:e[Fm],localAddress:e[BQ]},(c,u)=>{c?o(c):a(u)})});if(e.destroyed){wb.destroy(s.on("error",t4e),new iAi);return}OA(s);try{e[Dr]=s.alpnProtocol==="h2"?await wAi(e,s):await CAi(e,s)}catch(a){throw s.destroy().on("error",t4e),a}e[iI]=!1,s[gAi]=0,s[iK]=e[iK],s[rAi]=e,s[cAi]=null,tI.connected.hasSubscribers&&tI.connected.publish({connectParams:{host:t,hostname:i,protocol:n,port:r,version:e[Dr]?.version,servername:e[Fm],localAddress:e[BQ]},connector:e[wQ],socket:s}),e.emit("connect",e[Wp],[e])}catch(s){if(e.destroyed)return;if(e[iI]=!1,tI.connectError.hasSubscribers&&tI.connectError.publish({connectParams:{host:t,hostname:i,protocol:n,port:r,version:e[Dr]?.version,servername:e[Fm],localAddress:e[BQ]},connector:e[wQ],error:s}),s.code==="ERR_TLS_CERT_ALTNAME_INVALID")for(OA(e[kQ]===0);e[SQ]>0&&e[qu][e[Pu]].servername===e[Fm];){let a=e[qu][e[Pu]++];wb.errorRequest(e,a,s)}else s4e(e,s);e.emit("connectionError",e[Wp],[e],s)}e[_Q]()}function i4e(e){e[Pm]=0,e.emit("drain",e[Wp],[e])}function rK(e,t){e[Bb]!==2&&(e[Bb]=2,_Ai(e,t),e[Bb]=0,e[jA]>256&&(e[qu].splice(0,e[jA]),e[Pu]-=e[jA],e[jA]=0))}function _Ai(e,t){for(;;){if(e.destroyed){OA(e[SQ]===0);return}if(e[qm]&&!e[QQ]){e[qm](),e[qm]=null;return}if(e[Dr]&&e[Dr].resume(),e[tK])e[Pm]=2;else if(e[Pm]===2){t?(e[Pm]=1,queueMicrotask(()=>i4e(e))):i4e(e);continue}if(e[SQ]===0||e[kQ]>=(r4e(e)||1))return;let i=e[qu][e[Pu]];if(e[Wp].protocol==="https:"&&e[Fm]!==i.servername){if(e[kQ]>0)return;e[Fm]=i.servername,e[Dr]?.destroy(new tAi("servername changed"),()=>{e[Dr]=null,rK(e)})}if(e[iI])return;if(!e[Dr]){a4e(e);return}if(e[Dr].destroyed||e[Dr].busy(i))return;!i.aborted&&e[Dr].write(i)?e[Pu]++:e[qu].splice(e[Pu],1)}}o4e.exports=nK});var sK=A((uMn,c4e)=>{"use strict";var kL=class{constructor(){this.bottom=0,this.top=0,this.list=new Array(2048),this.next=null}isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&2047)===this.bottom}push(t){this.list[this.top]=t,this.top=this.top+1&2047}shift(){let t=this.list[this.bottom];return t===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&2047,t)}};c4e.exports=class{constructor(){this.head=this.tail=new kL}isEmpty(){return this.head.isEmpty()}push(t){this.head.isFull()&&(this.head
|
|||
|
|
${n.count} ${n.noun} ${n.is} pending:
|
|||
|
|
|
|||
|
|
${t.format(i)}
|
|||
|
|
`.trim())}};bVe.exports=uX});var zL=A((PMn,IVe)=>{"use strict";var yVe=Symbol.for("undici.globalDispatcher.1"),{InvalidArgumentError:bfi}=Fi(),vfi=rI();EVe()===void 0&&xVe(new vfi);function xVe(e){if(!e||typeof e.dispatch!="function")throw new bfi("Argument agent must implement Agent");Object.defineProperty(globalThis,yVe,{value:e,writable:!0,enumerable:!1,configurable:!1})}function EVe(){return globalThis[yVe]}IVe.exports={setGlobalDispatcher:xVe,getGlobalDispatcher:EVe}});var WL=A((jMn,CVe)=>{"use strict";CVe.exports=class{#e;constructor(t){if(typeof t!="object"||t===null)throw new TypeError("handler must be an object");this.#e=t}onConnect(...t){return this.#e.onConnect?.(...t)}onError(...t){return this.#e.onError?.(...t)}onUpgrade(...t){return this.#e.onUpgrade?.(...t)}onResponseStarted(...t){return this.#e.onResponseStarted?.(...t)}onHeaders(...t){return this.#e.onHeaders?.(...t)}onData(...t){return this.#e.onData?.(...t)}onComplete(...t){return this.#e.onComplete?.(...t)}onBodySent(...t){return this.#e.onBodySent?.(...t)}}});var BVe=A((GMn,wVe)=>{"use strict";var yfi=BL();wVe.exports=e=>{let t=e?.maxRedirections;return i=>function(r,s){let{maxRedirections:a=t,...o}=r;if(!a)return i(r,s);let c=new yfi(i,a,r,s);return i(o,c)}}});var QVe=A((VMn,_Ve)=>{"use strict";var xfi=FL();_Ve.exports=e=>t=>function(n,r){return t(n,new xfi({...n,retryOptions:{...e,...n.retryOptions}},{handler:r,dispatch:t}))}});var SVe=A(($Mn,kVe)=>{"use strict";var Efi=ni(),{InvalidArgumentError:Ifi,RequestAbortedError:Cfi}=Fi(),wfi=WL(),pX=class extends wfi{#e=1024*1024;#t=null;#n=!1;#i=!1;#r=0;#s=null;#a=null;constructor({maxSize:t},i){if(super(i),t!=null&&(!Number.isFinite(t)||t<1))throw new Ifi("maxSize must be a number greater than 0");this.#e=t??this.#e,this.#a=i}onConnect(t){this.#t=t,this.#a.onConnect(this.#o.bind(this))}#o(t){this.#i=!0,this.#s=t}onHeaders(t,i,n,r){let a=Efi.parseHeaders(i)["content-length"];if(a!=null&&a>this.#e)throw new Cfi(`Response size (${a}) larger than maxSize (${this.#e})`);return this.#i?!0:this.#a.onHeaders(t,i,n,r)}onError(t){this.#n||(t=this.#s??t,this.#a.onError(t))}onData(t){return this.#r=this.#r+t.length,this.#r>=this.#e&&(this.#n=!0,this.#i?this.#a.onError(this.#s):this.#a.onComplete([])),!0}onComplete(t){if(!this.#n){if(this.#i){this.#a.onError(this.reason);return}this.#a.onComplete(t)}}};function Bfi({maxSize:e}={maxSize:1024*1024}){return t=>function(n,r){let{dumpMaxSize:s=e}=n,a=new pX({maxSize:s},r);return t(n,a)}}kVe.exports=Bfi});var TVe=A((HMn,RVe)=>{"use strict";var{isIP:_fi}=require("node:net"),{lookup:Qfi}=require("node:dns"),kfi=WL(),{InvalidArgumentError:AI,InformationalError:Sfi}=Fi(),DVe=Math.pow(2,31)-1,dX=class{#e=0;#t=0;#n=new Map;dualStack=!0;affinity=null;lookup=null;pick=null;constructor(t){this.#e=t.maxTTL,this.#t=t.maxItems,this.dualStack=t.dualStack,this.affinity=t.affinity,this.lookup=t.lookup??this.#i,this.pick=t.pick??this.#r}get full(){return this.#n.size===this.#t}runLookup(t,i,n){let r=this.#n.get(t.hostname);if(r==null&&this.full){n(null,t.origin);return}let s={affinity:this.affinity,dualStack:this.dualStack,lookup:this.lookup,pick:this.pick,...i.dns,maxTTL:this.#e,maxItems:this.#t};if(r==null)this.lookup(t,s,(a,o)=>{if(a||o==null||o.length===0){n(a??new Sfi("No DNS entries found"));return}this.setRecords(t,o);let c=this.#n.get(t.hostname),u=this.pick(t,c,s.affinity),d;typeof u.port=="number"?d=`:${u.port}`:t.port!==""?d=`:${t.port}`:d="",n(null,`${t.protocol}//${u.family===6?`[${u.address}]`:u.address}${d}`)});else{let a=this.pick(t,r,s.affinity);if(a==null){this.#n.delete(t.hostname),this.runLookup(t,i,n);return}let o;typeof a.port=="number"?o=`:${a.port}`:t.port!==""?o=`:${t.port}`:o="",n(null,`${t.protocol}//${a.family===6?`[${a.address}]`:a.address}${o}`)}}#i(t,i,n){Qfi(t.hostname,{all:!0,family:this.dualStack===!1?this.affinity:0,order:"ipv4first"},(r,s)=>{if(r)return n(r);let a=new Map;for(let o of s)a.set(`${o.address}:${o.family}`,o);n(null,a.values())})}#r(t,i,n){let r=null,{records:s,offset:a}=i,o;if(this.dualStack?(n==null&&(a==null||a===DVe?(i.offset=0,n=4):(i
|
|||
|
|
${s}`;break;case"retry":u6e(s)&&(i[r]=s);break;case"id":p6e(s)&&(i[r]=s);break;case"event":s.length>0&&(i[r]=s);break}}processEvent(t){t.retry&&u6e(t.retry)&&(this.state.reconnectionTime=parseInt(t.retry,10)),t.id&&p6e(t.id)&&(this.state.lastEventId=t.id),t.data!==void 0&&this.push({type:t.event||"message",options:{data:t.data,lastEventId:this.state.lastEventId,origin:this.state.origin}})}clearEvent(){this.event={data:void 0,event:void 0,id:void 0,retry:void 0}}};d6e.exports={EventSourceStream:KX}});var x6e=A((IUn,y6e)=>{"use strict";var{pipeline:Pyi}=require("node:stream"),{fetching:Oyi}=zQ(),{makeRequest:jyi}=fI(),{webidl:YA}=Fs(),{EventSourceStream:Gyi}=A6e(),{parseMIMEType:Vyi}=Fo(),{createFastMessageEvent:$yi}=EI(),{isNetworkError:h6e}=HQ(),{delay:Hyi}=JX(),{kEnumerableProperty:Ob}=ni(),{environmentSettingsObject:m6e}=Qc(),f6e=!1,g6e=3e3,ak=0,b6e=1,ok=2,Yyi="anonymous",zyi="use-credentials",_I=class e extends EventTarget{#e={open:null,error:null,message:null};#t=null;#n=!1;#i=ak;#r=null;#s=null;#a;#o;constructor(t,i={}){super(),YA.util.markAsUncloneable(this);let n="EventSource constructor";YA.argumentLengthCheck(arguments,1,n),f6e||(f6e=!0,process.emitWarning("EventSource is experimental, expect them to change at any time.",{code:"UNDICI-ES"})),t=YA.converters.USVString(t,n,"url"),i=YA.converters.EventSourceInitDict(i,n,"eventSourceInitDict"),this.#a=i.dispatcher,this.#o={lastEventId:"",reconnectionTime:g6e};let r=m6e,s;try{s=new URL(t,r.settingsObject.baseUrl),this.#o.origin=s.origin}catch(c){throw new DOMException(c,"SyntaxError")}this.#t=s.href;let a=Yyi;i.withCredentials&&(a=zyi,this.#n=!0);let o={redirect:"follow",keepalive:!0,mode:"cors",credentials:a==="anonymous"?"same-origin":"omit",referrer:"no-referrer"};o.client=m6e.settingsObject,o.headersList=[["accept",{name:"accept",value:"text/event-stream"}]],o.cache="no-store",o.initiator="other",o.urlList=[new URL(this.#t)],this.#r=jyi(o),this.#c()}get readyState(){return this.#i}get url(){return this.#t}get withCredentials(){return this.#n}#c(){if(this.#i===ok)return;this.#i=ak;let t={request:this.#r,dispatcher:this.#a},i=n=>{h6e(n)&&(this.dispatchEvent(new Event("error")),this.close()),this.#l()};t.processResponseEndOfBody=i,t.processResponse=n=>{if(h6e(n))if(n.aborted){this.close(),this.dispatchEvent(new Event("error"));return}else{this.#l();return}let r=n.headersList.get("content-type",!0),s=r!==null?Vyi(r):"failure",a=s!=="failure"&&s.essence==="text/event-stream";if(n.status!==200||a===!1){this.close(),this.dispatchEvent(new Event("error"));return}this.#i=b6e,this.dispatchEvent(new Event("open")),this.#o.origin=n.urlList[n.urlList.length-1].origin;let o=new Gyi({eventSourceSettings:this.#o,push:c=>{this.dispatchEvent($yi(c.type,c.options))}});Pyi(n.body.stream,o,c=>{c?.aborted===!1&&(this.close(),this.dispatchEvent(new Event("error")))})},this.#s=Oyi(t)}async#l(){this.#i!==ok&&(this.#i=ak,this.dispatchEvent(new Event("error")),await Hyi(this.#o.reconnectionTime),this.#i===ak&&(this.#o.lastEventId.length&&this.#r.headersList.set("last-event-id",this.#o.lastEventId,!0),this.#c()))}close(){YA.brandCheck(this,e),this.#i!==ok&&(this.#i=ok,this.#s.abort(),this.#r=null)}get onopen(){return this.#e.open}set onopen(t){this.#e.open&&this.removeEventListener("open",this.#e.open),typeof t=="function"?(this.#e.open=t,this.addEventListener("open",t)):this.#e.open=null}get onmessage(){return this.#e.message}set onmessage(t){this.#e.message&&this.removeEventListener("message",this.#e.message),typeof t=="function"?(this.#e.message=t,this.addEventListener("message",t)):this.#e.message=null}get onerror(){return this.#e.error}set onerror(t){this.#e.error&&this.removeEventListener("error",this.#e.error),typeof t=="function"?(this.#e.error=t,this.addEventListener("error",t)):this.#e.error=null}},v6e={CONNECTING:{__proto__:null,configurable:!1,enumerable:!0,value:ak,writable:!1},OPEN:{__proto__:null,configurable:!1,enumerable:!0,value:b6e,writable:!1},CLOSED:{__proto__:null,configurable:!1,enumerable:!0,value:ok,writable:!1}};Object.defineProperties(_I,v6e);Object.definePropert
|
|||
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var X,ve=!0,fe=!1;return{s:S(function(){R=R.call(E)},"s"),n:S(function(){var Fe=R.next();return ve=Fe.done,Fe},"n"),e:S(function(Fe){fe=!0,X=Fe},"e"),f:S(function(){try{ve||R.return==null||R.return()}finally{if(fe)throw X}},"f")}}S(c,"o");function u(E,_){(_==null||_>E.length)&&(_=E.length);for(var R=0,$=Array(_);R<_;R++)$[R]=E[R];return $}S(u,"a");function d(E,_){var R=Object.keys(E);if(Object.getOwnPropertySymbols){var $=Object.getOwnPropertySymbols(E);_&&($=$.filter(function(ee){return Object.getOwnPropertyDescriptor(E,ee).enumerable})),R.push.apply(R,$)}return R}S(d,"i");function l(E){for(var _=1;_<arguments.length;_++){var R=arguments[_]!=null?arguments[_]:{};_%2?d(Object(R),!0).forEach(function($){p(E,$,R[$])}):Object.getOwnPropertyDescriptors?Object.defineProperties(E,Object.getOwnPropertyDescriptors(R)):d(Object(R)).forEach(function($){Object.defineProperty(E,$,Object.getOwnPropertyDescriptor(R,$))})}return E}S(l,"c");function p(E,_,R){return(_=(function($){var ee=(function(X){if(o(X)!="object"||!X)return X;var ve=X[Symbol.toPrimitive];if(ve!==void 0){var fe=ve.call(X,"string");if(o(fe)!="object")return fe;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(X)})($);return o(ee)=="symbol"?ee:ee+""})(_))in E?Object.defineProperty(E,_,{value:R,enumerable:!0,configurable:!0,writable:!0}):E[_]=R,E}S(p,"u");var h,m,f,g=a(425),b=g.AggregateError,v=g.AggregateErrorPrototype,y=g.Array,I=g.ArrayBuffer,T=g.ArrayBufferPrototype,j=g.ArrayIsArray,Y=g.ArrayPrototype,G=g.ArrayPrototypeFilter,Q=g.ArrayPrototypeForEach,w=g.ArrayPrototypeIncludes,W=g.ArrayPrototypeIndexOf,te=g.ArrayPrototypeJoin,x=g.ArrayPrototypeMap,B=g.ArrayPrototypePop,k=g.ArrayPrototypePush,P=g.ArrayPrototypePushApply,U=g.ArrayPrototypeSlice,ie=g.ArrayPrototypeSort,V=g.ArrayPrototypeSplice,K=g.ArrayPrototypeUnshift,Z=g.BigIntPrototypeValueOf,Ce=g.Boolean,Ee=g.BooleanPrototype,Oe=g.BooleanPrototypeValueOf,bt=g.DataView,ri=g.DataViewPrototype,si=g.Date,Zn=g.DatePrototype,mc=g.DatePrototypeGetTime,xn=g.DatePrototypeToISOString,J=g.DatePrototypeToString,lt=g.Error,Xe=g.ErrorPrototype,xt=g.ErrorPrototypeToString,Gt=g.Function,ii=g.FunctionPrototype,Kr=g.FunctionPrototypeBind,ye=g.FunctionPrototypeCall,M=g.FunctionPrototypeSymbolHasInstance,N=g.FunctionPrototypeToString,z=g.JSONStringify,Se=g.Map,Je=g.MapPrototype,Ct=g.MapPrototypeEntries,At=g.MapPrototypeGetSize,ct=g.MathFloor,je=g.MathMax,rt=g.MathMin,hi=g.MathRound,Bi=g.MathSqrt,fc=g.MathTrunc,En=g.Number,bo=g.NumberIsFinite,vo=g.NumberIsNaN,zd=g.NumberParseFloat,Jh=g.NumberParseInt,gc=g.NumberPrototype,Kn=g.NumberPrototypeToString,jy=g.NumberPrototypeValueOf,bu=g.Object,ml=g.ObjectAssign,pr=g.ObjectDefineProperty,Fr=g.ObjectGetOwnPropertyDescriptor,Zh=g.ObjectGetOwnPropertyNames,Fw=g.ObjectGetOwnPropertySymbols,vu=g.ObjectGetPrototypeOf,fl=g.ObjectIs,dp=g.ObjectKeys,yo=g.ObjectPrototype,Nn=g.ObjectPrototypeHasOwnProperty,yu=g.ObjectPrototypePropertyIsEnumerable,Ua=g.ObjectSeal,Gy=g.ObjectSetPrototypeOf,Vy=g.Promise,Ojt=g.PromisePrototype,jjt=g.RangeError,Gjt=g.RangeErrorPrototype,Vjt=g.ReflectApply,$jt=g.ReflectOwnKeys,Kh=g.RegExp,Hjt=g.RegExpPrototype,Xh=g.RegExpPrototypeExec,$y=g.RegExpPrototypeSymbolReplace,_Ie=g.RegExpPrototypeSymbolSplit,Yjt=g.RegExpPrototypeToString,QIe=g.SafeMap,kIe=g.SafeSet,zjt=g.SafeStringIterator,Wjt=g.Set,Jjt=g.SetPrototype,Zjt=g.SetPrototypeGetSize,Kjt=g.SetPrototypeValues,xg=g.String,Xjt=g.StringPrototype,qw=g.StringPrototypeCharCodeAt,eGt=g.StringPrototypeCodePointAt,SIe=g.StringPrototypeEndsWith,Ap=g.StringPrototypeIncludes,em=g.StringPrototypeIndexOf,tGt=g.StringPrototypeLastIndexOf,iGt=g.StringPrototypeNormalize,nGt=g.StringPrototypePadEnd,OV=g.StringPrototypePadStart,Hy=g.StringPrototypeRepeat,rGt=g.StringPrototypeReplace,DIe=g.StringPrototypeReplaceAll,_i=g.StringPrototypeSlice,jV=g.StringPrototypeSplit,RIe=g.StringPrototypeStartsWith,sGt=g.StringPrototypeToLowerCase,aGt=g.StringPrototypeTrim,oGt=g.StringPrototypeValueOf,cGt=g.SymbolIterator,TIe=g.SymbolPrototypeT
|
|||
|
|
`});return $!==""&&ee.push($),ee},"Cr")}var rR,s4t=/^[a-zA-Z_][a-zA-Z_0-9]*$/,a4t=/^(0|[1-9][0-9]*)$/,o4t=/^ {4}at (?:[^/\\(]+ \(|)node:(.+):\d+:\d+\)?$/,c4t=/^(\s+[^(]*?)\s*{/,l4t=/(\/\/.*?\n)|(\/\*(.|\n)*?\*\/)/g,sR=["\\x00","\\x01","\\x02","\\x03","\\x04","\\x05","\\x06","\\x07","\\b","\\t","\\n","\\x0B","\\f","\\r","\\x0E","\\x0F","\\x10","\\x11","\\x12","\\x13","\\x14","\\x15","\\x16","\\x17","\\x18","\\x19","\\x1A","\\x1B","\\x1C","\\x1D","\\x1E","\\x1F","","","","","","","","\\'","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\x7F","\\x80","\\x81","\\x82","\\x83","\\x84","\\x85","\\x86","\\x87","\\x88","\\x89","\\x8A","\\x8B","\\x8C","\\x8D","\\x8E","\\x8F","\\x90","\\x91","\\x92","\\x93","\\x94","\\x95","\\x96","\\x97","\\x98","\\x99","\\x9A","\\x9B","\\x9C","\\x9D","\\x9E","\\x9F"],u4t=new Kh("[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/\\#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/\\#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))","g");function Ms(E,_){var R={budget:{},indentationLvl:0,seen:[],currentDepth:0,stylize:Yy,showHidden:ps.showHidden,depth:ps.depth,colors:ps.colors,customInspect:ps.customInspect,showProxy:ps.showProxy,maxArrayLength:ps.maxArrayLength,maxStringLength:ps.maxStringLength,breakLength:ps.breakLength,compact:ps.compact,sorted:ps.sorted,getters:ps.getters,numericSeparator:ps.numericSeparator};if(arguments.length>1){if(arguments.length>2&&(arguments[2]!==void 0&&(R.depth=arguments[2]),arguments.length>3&&arguments[3]!==void 0&&(R.colors=arguments[3])),typeof _=="boolean")R.showHidden=_;else if(_)for(var $=dp(_),ee=0;ee<$.length;++ee){var X=$[ee];Nn(ps,X)||X==="stylize"?R[X]=_[X]:R.userOptions===void 0&&(R.userOptions=_)}}return R.colors&&(R.stylize=ZV),R.maxArrayLength===null&&(R.maxArrayLength=1/0),R.maxStringLength===null&&(R.maxStringLength=1/0),Xr(R,E,0)}S(Ms,"Jr"),Ms.custom=FIe,pr(Ms,"defaultOptions",{__proto__:null,get:S(function(){return ps},"get"),set:S(function(E){return jIe(E,"options"),ml(ps,E)},"set")});var ia=39,na=49;function bc(E,_){pr(Ms.colors,_,{__proto__:null,get:S(function(){return this[E]},"get"),set:S(function(R){this[E]=R},"set"),configurable:!0,enumerable:!1})}S(bc,"Xr");function aR(E,_){return _===-1?'"'.concat(E,'"'):_===-2?"`".concat(E,"`"):"'".concat(E,"'")}S(aR,"tn");function JV(E){var _=qw(E);return sR.length>_?sR[_]:"\\u".concat(Kn(_,16))}S(JV,"en");function oR(E){var _=$V,R=nR,$=39;if(Ap(E,"'")&&(Ap(E,'"')?Ap(E,"`")||Ap(E,"${")||($=-2):$=-1,$!==39&&(_=HV,R=YV)),E.length<5e3&&Xh(_,E)===null)return aR(E,$);if(E.length>100)return aR(E=$y(R,E,JV),$);for(var ee="",X=0,ve=0;ve<E.length;ve++){var fe=qw(E,ve);if(fe===$||fe===92||fe<32||fe>126&&fe<160)ee+=X===ve?sR[fe]:"".concat(_i(E,X,ve)).concat(sR[fe]),X=ve+1;else if(fe>=55296&&fe<=57343){if(fe<=56319&&ve+1<E.length){var Fe=qw(E,ve+1);if(Fe>=56320&&Fe<=57343){ve++;continue}}ee+="".concat(_i(E,X,ve),"\\u").concat(Kn(fe,16)),X=ve+1}}return X!==E.length&&(ee+=_i(E,X)),aR(ee,$)}S(oR,"rn");function ZV(E,_){var R=Ms.styles[_];if(R!==void 0){var $=Ms.colors[R];if($!==void 0)return"\x1B[".concat($[0],"m").concat(E,"\x1B[").concat($[1],"m")}return E}S(ZV,"nn");function Yy(E){return E}S(Yy,"on");function $Ie(){return[]}S($Ie,"an");function HIe(E,_){try{return E instanceof _}catch{return!1}}S(HIe,"cn"),Ms.colors={__proto__:null,reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],blink:[5,25],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],doubleunderline:[21,24],black:[30,ia],red:[31,ia],green:[32,ia],yellow:[33,ia],blue:[34,ia],magenta:[35,ia],cyan:[36,ia],white:[37,ia],bgBlack:[40,na],bgRed:[41,na],bgGreen:[42,na],bgYellow:[43,na],bgBlue:[44,na],bgMagenta:[45,na],bgCyan:[46,na],bgWhite:[47,na],framed:[51,54],overlined:[53,55],gray:[90,ia],redBright:[91,ia],greenBright:[92,ia],yellowBright:[93,ia],blueBright:[94,ia],magent
|
|||
|
|
`,`
|
|||
|
|
`.concat(Hy(" ",E.indentationLvl)))}}if(E.seen.includes(_)){var Vt=1;return E.circular===void 0?(E.circular=new QIe,E.circular.set(_,Vt)):(Vt=E.circular.get(_))===void 0&&(Vt=E.circular.size+1,E.circular.set(_,Vt)),E.stylize("[Circular *".concat(Vt,"]"),"special")}return(function(le,ue,Qt,xo){var St,Mi;le.showHidden&&(Qt<=le.depth||le.depth===null)&&(Mi=[]);var Mt=KV(ue,le,Qt,Mi);Mi!==void 0&&Mi.length===0&&(Mi=void 0);var mi=ue[MIe];(typeof mi!="string"||mi!==""&&(le.showHidden?Nn:yu)(ue,MIe))&&(mi="");var Ii,ra,dr="",Na=$Ie,Wd=!0,im=0,Wy=le.showHidden?CGt:wGt,hp=0;if(cGt in ue||Mt===null)if(Wd=!1,j(ue)){var Jy=Mt!=="Array"||mi!==""?Us(Mt,mi,"Array","(".concat(ue.length,")")):"";if(St=UIe(ue,Wy),Ii=["".concat(Jy,"["),"]"],ue.length===0&&St.length===0&&Mi===void 0)return"".concat(Ii[0],"]");hp=2,Na=ZIe}else if(VGt(ue)){var Cg=Zjt(ue),Zy=Us(Mt,mi,"Set","(".concat(Cg,")"));if(St=zy(ue,le.showHidden),Na=Kr(XIe,null,Mt!==null?ue:Kjt(ue)),Cg===0&&St.length===0&&Mi===void 0)return"".concat(Zy,"{}");Ii=["".concat(Zy,"{"),"}"]}else if(OGt(ue)){var wg=At(ue),Jd=Us(Mt,mi,"Map","(".concat(wg,")"));if(St=zy(ue,le.showHidden),Na=Kr(eCe,null,Mt!==null?ue:Ct(ue)),wg===0&&St.length===0&&Mi===void 0)return"".concat(Jd,"{}");Ii=["".concat(Jd,"{"),"}"]}else if(JGt(ue)){St=UIe(ue,Wy);var AR=ue,nm="";Mt===null&&(nm=mGt(ue),AR=new g[nm](ue));var Eo=hGt(ue),m$=Us(Mt,mi,nm,"(".concat(Eo,")"));if(Ii=["".concat(m$,"["),"]"],ue.length===0&&St.length===0&&!le.showHidden)return"".concat(Ii[0],"]");Na=Kr(KIe,null,AR,Eo),hp=2}else jGt(ue)?(St=zy(ue,le.showHidden),Ii=e$("Map",mi),Na=Kr(o$,null,Ii)):$Gt(ue)?(St=zy(ue,le.showHidden),Ii=e$("Set",mi),Na=Kr(o$,null,Ii)):Wd=!0;if(Wd){if(St=zy(ue,le.showHidden),Ii=["{","}"],typeof ue=="function"){if(dr=(function(ln,qr,gl,Ar){var ds=N(qr);if(RIe(ds,"class")&&ds[ds.length-1]==="}"){var bl=_i(ds,5,-1),In=em(bl,"{");if(In!==-1&&(!Ap(_i(bl,0,In),"(")||Xh(c4t,$y(l4t,bl))!==null))return(function(Zd,rm,Ky){var mR=Nn(Zd,"name")&&Zd.name||"(anonymous)",Kd="class ".concat(mR);if(rm!=="Function"&&rm!==null&&(Kd+=" [".concat(rm,"]")),Ky!==""&&rm!==Ky&&(Kd+=" [".concat(Ky,"]")),rm!==null){var Bg=vu(Zd).name;Bg&&(Kd+=" extends ".concat(Bg))}else Kd+=" extends [null prototype]";return"[".concat(Kd,"]")})(qr,gl,Ar)}var sa="Function";MGt(qr)&&(sa="Generator".concat(sa)),TGt(qr)&&(sa="Async".concat(sa));var xu="[".concat(sa);return gl===null&&(xu+=" (null prototype)"),qr.name===""?xu+=" (anonymous)":xu+=": ".concat(typeof qr.name=="string"?qr.name:Xr(ln,qr.name)),xu+="]",gl!==sa&&gl!==null&&(xu+=" ".concat(gl)),Ar!==""&&gl!==Ar&&(xu+=" [".concat(Ar,"]")),xu})(le,ue,Mt,mi),St.length===0&&Mi===void 0)return le.stylize(dr,"special")}else if(Mt==="Object"){if(LGt(ue)?Ii[0]="[Arguments] {":mi!==""&&(Ii[0]="".concat(Us(Mt,mi,"Object"),"{")),St.length===0&&Mi===void 0)return"".concat(Ii[0],"}")}else if(zGt(ue)){dr=Yjt(Mt!==null?ue:new Kh(ue));var hR=Us(Mt,mi,"RegExp");if(hR!=="RegExp "&&(dr="".concat(hR).concat(dr)),St.length===0&&Mi===void 0||Qt>le.depth&&le.depth!==null)return le.stylize(dr,"regexp")}else if(WGt(ue)){dr=vo(mc(ue))?J(ue):xn(ue);var oCe=Us(Mt,mi,"Date");if(oCe!=="Date "&&(dr="".concat(oCe).concat(dr)),St.length===0&&Mi===void 0)return le.stylize(dr,"date")}else if(qIe(ue)){if(dr=(function(ln,qr,gl,Ar,ds){var bl=ln.name!=null?ln.name:"Error",In=i$(Ar,ln);(function(Xn,Eu,Io,eA){if(!Xn.showHidden&&Eu.length!==0)for(var La=0,mp=["name","message","stack"];La<mp.length;La++){var tA=mp[La],Iu=W(Eu,tA);Iu===-1||typeof Io[tA]=="string"&&!Ap(eA,Io[tA])||V(Eu,Iu,1)}})(Ar,ds,ln,In),!("cause"in ln)||ds.length!==0&&w(ds,"cause")||k(ds,"cause"),!j(ln.errors)||ds.length!==0&&w(ds,"errors")||k(ds,"errors"),In=(function(Xn,Eu,Io,eA){var La=Io.length;if(typeof Io!="string"&&(Xn=rGt(Xn,"".concat(Io),"".concat(Io," [").concat(_i(Us(Eu,eA,"Error"),0,-1),"]"))),Eu===null||SIe(Io,"Error")&&RIe(Xn,Io)&&(Xn.length===La||Xn[La]===":"||Xn[La]===`
|
|||
|
|
`)){var mp="Error";if(Eu===null){var tA=Xh(/^([A-Z][a-z_ A-Z0-9[\]()-]+)(?::|\n {4}at)/,Xn)||Xh(/^([a-z_A-Z0-9-]*Error)$/,Xn);La=(mp=tA?.[1]||"").length,mp=mp||"Error"}var Iu=_i(Us(Eu,eA,mp),0,-1);Io!==Iu&&(Xn=Ap(Iu,Io)?La===0?"".concat(Iu,": ").concat(Xn):"".concat(Iu).concat(_i(Xn,La)):"".concat(Iu," [").concat(Io,"]").concat(_i(Xn,La)))}return Xn})(In,qr,bl,gl);var sa=ln.message&&em(In,ln.message)||-1;sa!==-1&&(sa+=ln.message.length);var xu=em(In,`
|
|||
|
|
at`,sa);if(xu===-1)In="[".concat(In,"]");else{var Zd=_i(In,0,xu),rm=(function(Xn,Eu,Io){var eA,La=jV(Io,`
|
|||
|
|
`);try{eA=Eu.cause}catch{}if(eA!=null&&qIe(eA)){var mp=i$(Xn,eA),tA=em(mp,`
|
|||
|
|
at`);if(tA!==-1){var Iu=t$(La,jV(_i(mp,tA+1),`
|
|||
|
|
`)),mCe=Iu.len,g4t=Iu.offset;if(mCe>0){var fCe=mCe-2,b4t=" ... ".concat(fCe," lines matching cause stack trace ...");La.splice(g4t+1,fCe,Xn.stylize(b4t,"undefined"))}}}return La})(Ar,ln,_i(In,xu+1));if(Ar.colors){var Ky,mR,Kd=(function(){var Xn;try{Xn=process.cwd()}catch{return}return Xn})(),Bg=c(rm);try{for(Bg.s();!(mR=Bg.n()).done;){var Xd=mR.value,hCe=Xh(o4t,Xd);if(hCe!==null&&t4t.exists(hCe[1]))Zd+=`
|
|||
|
|
`.concat(Ar.stylize(Xd,"undefined"));else{if(Zd+=`
|
|||
|
|
`,Xd=YIe(Ar,Xd),Kd!==void 0){var b$=n$(Ar,Xd,Kd);b$===Xd&&(b$=n$(Ar,Xd,Ky=Ky||GIe(Kd))),Xd=b$}Zd+=Xd}}}catch(Xn){Bg.e(Xn)}finally{Bg.f()}}else Zd+=`
|
|||
|
|
`.concat(te(rm,`
|
|||
|
|
`));In=Zd}if(Ar.indentationLvl!==0){var f4t=Hy(" ",Ar.indentationLvl);In=DIe(In,`
|
|||
|
|
`,`
|
|||
|
|
`.concat(f4t))}return In})(ue,Mt,mi,le,St),St.length===0&&Mi===void 0)return dr}else if(UGt(ue)){var cCe=Us(Mt,mi,NGt(ue)?"ArrayBuffer":"SharedArrayBuffer");if(xo===void 0)Na=JIe;else if(St.length===0&&Mi===void 0)return cCe+"{ byteLength: ".concat(jw(le.stylize,ue.byteLength,!1)," }");Ii[0]="".concat(cCe,"{"),K(St,"byteLength")}else if(qGt(ue))Ii[0]="".concat(Us(Mt,mi,"DataView"),"{"),K(St,"byteLength","byteOffset","buffer");else if(GGt(ue))Ii[0]="".concat(Us(Mt,mi,"Promise"),"{"),Na=nCe;else if(YGt(ue))Ii[0]="".concat(Us(Mt,mi,"WeakSet"),"{"),Na=le.showHidden?tCe:a$;else if(HGt(ue))Ii[0]="".concat(Us(Mt,mi,"WeakMap"),"{"),Na=le.showHidden?iCe:a$;else if(PIe(ue))Ii[0]="".concat(Us(Mt,mi,"Module"),"{"),Na=zIe.bind(null,St);else if(FGt(ue)){if(dr=(function(ln,qr,gl,Ar,ds){var bl,In;KGt(ln)?(bl=jy,In="Number"):ZGt(ln)?(bl=oGt,In="String",gl.splice(0,ln.length)):XGt(ln)?(bl=Oe,In="Boolean"):e4t(ln)?(bl=Z,In="BigInt"):(bl=lGt,In="Symbol");var sa="[".concat(In);return In!==Ar&&(sa+=Ar===null?" (null prototype)":" (".concat(Ar,")")),sa+=": ".concat(uR(Yy,bl(ln),qr),"]"),ds!==""&&ds!==Ar&&(sa+=" [".concat(ds,"]")),gl.length!==0||qr.stylize===Yy?sa:qr.stylize(sa,sGt(In))})(ue,le,St,Mt,mi),St.length===0&&Mi===void 0)return dr}else if(!(function(ln){return m=m||a(802),typeof ln.href=="string"&&ln instanceof m.URL})(ue)||Qt>le.depth&&le.depth!==null){if(St.length===0&&Mi===void 0){if(PGt(ue)){var h4t=kGt(ue).toString(16);return le.stylize("[External: ".concat(h4t,"]"),"special")}return"".concat(Ow(ue,Mt,mi),"{}")}Ii[0]="".concat(Ow(ue,Mt,mi),"{")}else if(St=(function(ln){return f=f||Fw(new m.URL("http://user:pass@localhost:8080/?foo=bar#baz")),ln.filter(function(qr){return f[qr]===-1})})(St),dr=ue.href,St.length===0&&Mi===void 0)return dr}if(Qt>le.depth&&le.depth!==null){var f$=_i(Ow(ue,Mt,mi),0,-1);return Mt!==null&&(f$="[".concat(f$,"]")),le.stylize(f$,"special")}Qt+=1,le.seen.push(ue),le.currentDepth=Qt;var m4t=le.indentationLvl;try{for(ra=Na(le,ue,Qt),im=0;im<St.length;im++)k(ra,Ig(le,ue,Qt,St[im],hp));Mi!==void 0&&P(ra,Mi)}catch(ln){if(!RGt(ln))throw ln;return(function(qr,gl,Ar,ds){return qr.seen.pop(),qr.indentationLvl=ds,qr.stylize("[".concat(Ar,": Inspection interrupted ")+"prematurely. Maximum call stack size exceeded.]","special")})(le,0,_i(Ow(ue,Mt,mi),0,-1),m4t)}if(le.circular!==void 0){var lCe=le.circular.get(ue);if(lCe!==void 0){var g$=le.stylize("<ref *".concat(lCe,">"),"special");le.compact!==!0?dr=dr===""?g$:"".concat(g$," ").concat(dr):Ii[0]="".concat(g$," ").concat(Ii[0])}}if(le.seen.pop(),le.sorted){var uCe=le.sorted===!0?void 0:le.sorted;if(hp===0)ie(ra,uCe);else if(St.length>1){var pCe=ie(U(ra,ra.length-St.length),uCe);K(pCe,ra,ra.length-St.length,St.length),Vjt(V,null,pCe)}}var dCe=pR(le,ra,dr,Ii,hp,Qt,ue),ACe=(le.budget[le.indentationLvl]||0)+dCe.length;return le.budget[le.indentationLvl]=ACe,ACe>Math.pow(2,27)&&(le.depth=-1),dCe})(E,_,R,$)}S(Xr,"gn");function e$(E,_){return _!=="".concat(E," Iterator")&&(_!==""&&(_+="] ["),_+="".concat(E," Iterator")),["[".concat(_,"] {"),"}"]}S(e$,"vn");function t$(E,_){for(var R=0;R<E.length-3;R++){var $=W(_,E[R]);if($!==-1){var ee=_.length-$;if(ee>3){for(var X=1,ve=rt(E.length-R,ee);ve>X&&E[R+X]===_[$+X];)X++;if(X>3)return{len:X,offset:R}}}}return{len:0,offset:0}}S(t$,"hn");function i$(E,_){if(_.stack){if(typeof _.stack=="string")return _.stack;E.seen.push(_),E.indentationLvl+=4;var R=Xr(E,_.stack);return E.indentationLvl-=4,E.seen.pop(),"".concat(xt(_),`
|
|||
|
|
`).concat(R)}return xt(_)}S(i$,"dn");function YIe(E,_){for(var R="",$=0,ee=0;;){var X=em(_,"node_modules",ee);if(X===-1)break;var ve=_[X-1],fe=_[X+12];if(fe!=="/"&&fe!=="\\"||ve!=="/"&&ve!=="\\")ee=X+1;else{var Fe=X+13;R+=_i(_,$,Fe);var at=em(_,ve,Fe);_[Fe]==="@"&&(at=em(_,ve,at+1));var et=_i(_,Fe,at);R+=E.stylize(et,"module"),$=at,ee=at}}return $!==0&&(_=R+_i(_,$)),_}S(YIe,"bn");function n$(E,_,R){var $=em(_,R),ee="",X=R.length;if($!==-1){_i(_,$-7,$)==="file://"&&(X+=7,$-=7);var ve=_[$-1]==="("?$-1:$,fe=ve!==$&&SIe(_,")")?-1:_.length,Fe=$+X+1,at=_i(_,ve,Fe);ee+=_i(_,0,ve),ee+=E.stylize(at,"undefined"),ee+=_i(_,Fe,fe),fe===-1&&(ee+=E.stylize(")","undefined"))}else ee+=_;return ee}S(n$,"mn");function cR(E){var _="",R=E.length;iR(R!==0);for(var $=E[0]==="-"?1:0;R>=$+4;R-=3)_="_".concat(_i(E,R-3,R)).concat(_);return R===E.length?E:"".concat(_i(E,0,R)).concat(_)}S(cR,"Sn");var Eg=S(function(E){return"... ".concat(E," more item").concat(E>1?"s":"")},"Pn");function jw(E,_,R){if(!R)return fl(_,-0)?E("-0","number"):E("".concat(_),"number");var $=fc(_),ee=xg($);return $===_?!bo(_)||Ap(ee,"e")?E(ee,"number"):E("".concat(cR(ee)),"number"):vo(_)?E(ee,"number"):E("".concat(cR(ee),".").concat((function(X){for(var ve="",fe=0;fe<X.length-3;fe+=3)ve+="".concat(_i(X,fe,fe+3),"_");return fe===0?X:"".concat(ve).concat(_i(X,fe))})(_i(xg(_),ee.length+1))),"number")}S(jw,"xn");function lR(E,_,R){var $=xg(_);return E("".concat(R?cR($):$,"n"),"bigint")}S(lR,"wn");function uR(E,_,R){if(typeof _=="string"){var $="";if(_.length>R.maxStringLength){var ee=_.length-R.maxStringLength;_=_i(_,0,R.maxStringLength),$="... ".concat(ee," more character").concat(ee>1?"s":"")}return R.compact!==!0&&_.length>16&&_.length>R.breakLength-R.indentationLvl-4?te(x(zV(_),function(X){return E(oR(X),"string")}),` +
|
|||
|
|
`.concat(Hy(" ",R.indentationLvl+2)))+$:E(oR(_),"string")+$}return typeof _=="number"?jw(E,_,R.numericSeparator):typeof _=="bigint"?lR(E,_,R.numericSeparator):typeof _=="boolean"?E("".concat(_),"boolean"):_===void 0?E("undefined","undefined"):E(TIe(_),"symbol")}S(uR,"An");function zIe(E,_,R,$){for(var ee=new y(E.length),X=0;X<E.length;X++)try{ee[X]=Ig(_,R,$,E[X],0)}catch(Fe){iR(OIe(Fe)&&Fe.name==="ReferenceError");var ve=p({},E[X],"");ee[X]=Ig(_,ve,$,E[X],0);var fe=tGt(ee[X]," ");ee[X]=_i(ee[X],0,fe+1)+_.stylize("<uninitialized>","special")}return E.length=0,ee}S(zIe,"On");function WIe(E,_,R,$,ee,X){for(var ve=dp(_),fe=X;X<ve.length&&ee.length<$;X++){var Fe=ve[X],at=+Fe;if(at>Math.pow(2,32)-2)break;if("".concat(fe)!==Fe){if(Xh(a4t,Fe)===null)break;var et=at-fe,Vt=et>1?"s":"",le="<".concat(et," empty item").concat(Vt,">");if(k(ee,E.stylize(le,"undefined")),fe=at,ee.length===$)break}k(ee,Ig(E,_,R,Fe,1)),fe++}var ue=_.length-fe;if(ee.length!==$){if(ue>0){var Qt=ue>1?"s":"",xo="<".concat(ue," empty item").concat(Qt,">");k(ee,E.stylize(xo,"undefined"))}}else ue>0&&k(ee,Eg(ue));return ee}S(WIe,"_n");function JIe(E,_){var R;try{R=new fGt(_)}catch{return[E.stylize("(detached)","special")]}h===void 0&&(h=IGt(a(883).h.prototype.hexSlice));var $=aGt($y(/(.{2})/g,h(R,0,rt(E.maxArrayLength,R.length)),"$1 ")),ee=R.length-E.maxArrayLength;return ee>0&&($+=" ... ".concat(ee," more byte").concat(ee>1?"s":"")),["".concat(E.stylize("[Uint8Contents]","special"),": <").concat($,">")]}S(JIe,"jn");function ZIe(E,_,R){for(var $=_.length,ee=rt(je(0,E.maxArrayLength),$),X=$-ee,ve=[],fe=0;fe<ee;fe++){if(!Nn(_,fe))return WIe(E,_,R,ee,ve,fe);k(ve,Ig(E,_,R,fe,1))}return X>0&&k(ve,Eg(X)),ve}S(ZIe,"En");function KIe(E,_,R,$,ee){for(var X=rt(je(0,R.maxArrayLength),_),ve=E.length-X,fe=new y(X),Fe=E.length>0&&typeof E[0]=="number"?jw:lR,at=0;at<X;++at)fe[at]=Fe(R.stylize,E[at],R.numericSeparator);if(ve>0&&(fe[X]=Eg(ve)),R.showHidden){R.indentationLvl+=2;for(var et=0,Vt=["BYTES_PER_ELEMENT","length","byteLength","byteOffset","buffer"];et<Vt.length;et++){var le=Vt[et],ue=Xr(R,E[le],ee,!0);k(fe,"[".concat(le,"]: ").concat(ue))}R.indentationLvl-=2}return fe}S(KIe,"kn");function XIe(E,_,R,$){var ee=E.size,X=rt(je(0,_.maxArrayLength),ee),ve=ee-X,fe=[];_.indentationLvl+=2;var Fe,at=0,et=c(E);try{for(et.s();!(Fe=et.n()).done;){var Vt=Fe.value;if(at>=X)break;k(fe,Xr(_,Vt,$)),at++}}catch(le){et.e(le)}finally{et.f()}return ve>0&&k(fe,Eg(ve)),_.indentationLvl-=2,fe}S(XIe,"In");function eCe(E,_,R,$){var ee=E.size,X=rt(je(0,_.maxArrayLength),ee),ve=ee-X,fe=[];_.indentationLvl+=2;var Fe,at=0,et=c(E);try{for(et.s();!(Fe=et.n()).done;){var Vt=Fe.value,le=Vt[0],ue=Vt[1];if(at>=X)break;k(fe,"".concat(Xr(_,le,$)," => ").concat(Xr(_,ue,$))),at++}}catch(Qt){et.e(Qt)}finally{et.f()}return ve>0&&k(fe,Eg(ve)),_.indentationLvl-=2,fe}S(eCe,"Rn");function r$(E,_,R,$){var ee=je(E.maxArrayLength,0),X=rt(ee,R.length),ve=new y(X);E.indentationLvl+=2;for(var fe=0;fe<X;fe++)ve[fe]=Xr(E,R[fe],_);E.indentationLvl-=2,$!==0||E.sorted||ie(ve);var Fe=R.length-X;return Fe>0&&k(ve,Eg(Fe)),ve}S(r$,"Ln");function s$(E,_,R,$){var ee=je(E.maxArrayLength,0),X=R.length/2,ve=X-ee,fe=rt(ee,X),Fe=new y(fe),at=0;if(E.indentationLvl+=2,$===0){for(;at<fe;at++){var et=2*at;Fe[at]="".concat(Xr(E,R[et],_)," => ").concat(Xr(E,R[et+1],_))}E.sorted||ie(Fe)}else for(;at<fe;at++){var Vt=2*at,le=[Xr(E,R[Vt],_),Xr(E,R[Vt+1],_)];Fe[at]=pR(E,le,"",["[","]"],2,_)}return E.indentationLvl-=2,ve>0&&k(Fe,Eg(ve)),Fe}S(s$,"Tn");function a$(E){return[E.stylize("<items unknown>","special")]}S(a$,"Bn");function tCe(E,_,R){return r$(E,R,GV(_),0)}S(tCe,"zn");function iCe(E,_,R){return s$(E,R,GV(_),0)}S(iCe,"Mn");function o$(E,_,R,$){var ee=GV(R,!0),X=ee[0];return ee[1]?(E[0]=$y(/ Iterator] {$/,E[0]," Entries] {"),s$(_,$,X,2)):r$(_,$,X,1)}S(o$,"Cn");function nCe(E,_,R){var $,ee=QGt(_),X=ee[0],ve=ee[1];if(X===BGt)$=[E.stylize("<pending>","special")];else{E.indentationLvl+=2;var fe=Xr(E,ve,R);E.indentationLvl-=2,$=[X===_Gt?"".concat(E.stylize("<rejected>","special")," ").concat(fe):fe]}return $}S(nCe,"Dn");function Ig(E,_,R,$,ee,X){v
|
|||
|
|
`.concat(Hy(" ",E.indentationLvl))),E.indentationLvl-=et}else if(X.get!==void 0){var Vt=X.set!==void 0?"Getter/Setter":"Getter",le=E.stylize,ue="special";if(E.getters&&(E.getters===!0||E.getters==="get"&&X.set===void 0||E.getters==="set"&&X.set!==void 0))try{var Qt=ye(X.get,Fe);if(E.indentationLvl+=2,Qt===null)fe="".concat(le("[".concat(Vt,":"),ue)," ").concat(le("null","null")).concat(le("]",ue));else if(o(Qt)==="object")fe="".concat(le("[".concat(Vt,"]"),ue)," ").concat(Xr(E,Qt,R));else{var xo=uR(le,Qt,E);fe="".concat(le("[".concat(Vt,":"),ue)," ").concat(xo).concat(le("]",ue))}E.indentationLvl-=2}catch(Mt){var St="<Inspection threw (".concat(Mt.message,")>");fe="".concat(le("[".concat(Vt,":"),ue)," ").concat(St).concat(le("]",ue))}else fe=E.stylize("[".concat(Vt,"]"),ue)}else fe=X.set!==void 0?E.stylize("[Setter]","special"):E.stylize("undefined","undefined");if(ee===1)return fe;if(o($)==="symbol"){var Mi=$y(nR,TIe($),JV);ve=E.stylize(Mi,"symbol")}else ve=Xh(s4t,$)!==null?$==="__proto__"?"['__proto__']":E.stylize($,"name"):E.stylize(oR($),"string");return X.enumerable===!1&&(ve="[".concat(ve,"]")),"".concat(ve,":").concat(at).concat(fe)}S(Ig,"Nn");function c$(E,_,R,$){var ee=_.length+R;if(ee+_.length>E.breakLength)return!1;for(var X=0;X<_.length;X++)if(E.colors?ee+=DGt(_[X]).length:ee+=_[X].length,ee>E.breakLength)return!1;return $===""||!Ap($,`
|
|||
|
|
`)}S(c$,"Fn");function pR(E,_,R,$,ee,X,ve){if(E.compact!==!0){if(typeof E.compact=="number"&&E.compact>=1){var fe=_.length;if(ee===2&&fe>6&&(_=(function(le,ue,Qt){var xo=0,St=0,Mi=0,Mt=ue.length;le.maxArrayLength<ue.length&&Mt--;for(var mi=new y(Mt);Mi<Mt;Mi++){var Ii=rR(ue[Mi],le.colors);mi[Mi]=Ii,xo+=Ii+2,St<Ii&&(St=Ii)}var ra=St+2;if(3*ra+le.indentationLvl<le.breakLength&&(xo/ra>5||St<=6)){var dr=Bi(ra-xo/ue.length),Na=je(ra-3-dr,1),Wd=rt(hi(Bi(2.5*Na*Mt)/Na),ct((le.breakLength-le.indentationLvl)/ra),4*le.compact,15);if(Wd<=1)return ue;for(var im=[],Wy=[],hp=0;hp<Wd;hp++){for(var Jy=0,Cg=hp;Cg<ue.length;Cg+=Wd)mi[Cg]>Jy&&(Jy=mi[Cg]);Jy+=2,Wy[hp]=Jy}var Zy=OV;if(Qt!==void 0){for(var wg=0;wg<ue.length;wg++)if(typeof Qt[wg]!="number"&&typeof Qt[wg]!="bigint"){Zy=nGt;break}}for(var Jd=0;Jd<Mt;Jd+=Wd){for(var AR=rt(Jd+Wd,Mt),nm="",Eo=Jd;Eo<AR-1;Eo++){var m$=Wy[Eo-Jd]+ue[Eo].length-mi[Eo];nm+=Zy("".concat(ue[Eo],", "),m$," ")}if(Zy===OV){var hR=Wy[Eo-Jd]+ue[Eo].length-mi[Eo]-2;nm+=OV(ue[Eo],hR," ")}else nm+=ue[Eo];k(im,nm)}le.maxArrayLength<ue.length&&k(im,ue[Mt]),ue=im}return ue})(E,_,ve)),E.currentDepth-X<E.compact&&fe===_.length&&c$(E,_,_.length+E.indentationLvl+$[0].length+R.length+10,R)){var Fe=tR(_,", ");if(!Ap(Fe,`
|
|||
|
|
`))return"".concat(R?"".concat(R," "):"").concat($[0]," ").concat(Fe)+" ".concat($[1])}}var at=`
|
|||
|
|
`.concat(Hy(" ",E.indentationLvl));return"".concat(R?"".concat(R," "):"").concat($[0]).concat(at," ")+"".concat(tR(_,",".concat(at," "))).concat(at).concat($[1])}if(c$(E,_,0,R))return"".concat($[0]).concat(R?" ".concat(R):""," ").concat(tR(_,", ")," ")+$[1];var et=Hy(" ",E.indentationLvl),Vt=R===""&&$[0].length===1?" ":"".concat(R?" ".concat(R):"",`
|
|||
|
|
`).concat(et," ");return"".concat($[0]).concat(Vt).concat(tR(_,`,
|
|||
|
|
`.concat(et," "))," ").concat($[1])}S(pR,"Wn");function rCe(E){var _=NIe(E,!1);if(_!==void 0){if(_===null)return!0;E=_}var R=Nn,$=Nn;if(typeof E.toString!="function"){if(typeof E[Pw]!="function")return!0;if(Nn(E,Pw))return!1;R=l$}else{if(Nn(E,"toString"))return!1;if(typeof E[Pw]!="function")$=l$;else if(Nn(E,Pw))return!1}var ee=E;do ee=vu(ee);while(!R(ee,"toString")&&!$(ee,Pw));var X=Fr(ee,"constructor");return X!==void 0&&typeof X.value=="function"&&WV.has(X.value.name)}S(rCe,"Hn");function l$(){return!1}S(l$,"Un");var u$,sCe=S(function(E){return jV(E.message,`
|
|||
|
|
`,1)[0]},"Vn");function aCe(E){try{return z(E)}catch(R){if(!u$)try{var _={};_.a=_,z(_)}catch($){u$=sCe($)}if(R.name==="TypeError"&&sCe(R)===u$)return"[Circular]";throw R}}S(aCe,"Zn");function Gw(E,_){var R;return jw(Yy,E,(R=_?.numericSeparator)!==null&&R!==void 0?R:ps.numericSeparator)}S(Gw,"$n");function dR(E,_){var R;return lR(Yy,E,(R=_?.numericSeparator)!==null&&R!==void 0?R:ps.numericSeparator)}S(dR,"Yn");function p$(E,_){var R=_[0],$=0,ee="",X="";if(typeof R=="string"){if(_.length===1)return R;for(var ve,fe=0,Fe=0;Fe<R.length-1;Fe++)if(qw(R,Fe)===37){var at=qw(R,++Fe);if($+1!==_.length){switch(at){case 115:var et=_[++$];ve=typeof et=="number"?Gw(et,E):typeof et=="bigint"?dR(et,E):o(et)==="object"&&et!==null&&rCe(et)?Ms(et,l(l({},E),{},{compact:3,colors:!1,depth:0})):xg(et);break;case 106:ve=aCe(_[++$]);break;case 100:var Vt=_[++$];ve=typeof Vt=="bigint"?dR(Vt,E):o(Vt)==="symbol"?"NaN":Gw(En(Vt),E);break;case 79:ve=Ms(_[++$],E);break;case 111:ve=Ms(_[++$],l(l({},E),{},{showHidden:!0,showProxy:!0,depth:4}));break;case 105:var le=_[++$];ve=typeof le=="bigint"?dR(le,E):o(le)==="symbol"?"NaN":Gw(Jh(le),E);break;case 102:var ue=_[++$];ve=o(ue)==="symbol"?"NaN":Gw(zd(ue),E);break;case 99:$+=1,ve="";break;case 37:ee+=_i(R,fe,Fe),fe=Fe+1;continue;default:continue}fe!==Fe-1&&(ee+=_i(R,fe,Fe-1)),ee+=ve,fe=Fe+1}else at===37&&(ee+=_i(R,fe,Fe),fe=Fe+1)}fe!==0&&($++,X=" ",fe<R.length&&(ee+=_i(R,fe)))}for(;$<_.length;){var Qt=_[$];ee+=X,ee+=typeof Qt!="string"?Ms(Qt,E):Qt,X=" ",$++}return ee}S(p$,"qn");function d$(E){return E<=31||E>=127&&E<=159||E>=768&&E<=879||E>=8203&&E<=8207||E>=8400&&E<=8447||E>=65024&&E<=65039||E>=65056&&E<=65071||E>=917760&&E<=917999}if(S(d$,"Jn"),EGt("config").hasIntl)iR(!1);else{rR=S(function(E){var _=0;(!(arguments.length>1&&arguments[1]!==void 0)||arguments[1])&&(E=A$(E)),E=iGt(E,"NFC");var R,$=c(new zjt(E));try{for($.s();!(R=$.n()).done;){var ee=R.value,X=eGt(ee,0);d4t(X)?_+=2:d$(X)||_++}}catch(ve){$.e(ve)}finally{$.f()}return _},"Hr");var d4t=S(function(E){return E>=4352&&(E<=4447||E===9001||E===9002||E>=11904&&E<=12871&&E!==12351||E>=12880&&E<=19903||E>=19968&&E<=42182||E>=43360&&E<=43388||E>=44032&&E<=55203||E>=63744&&E<=64255||E>=65040&&E<=65049||E>=65072&&E<=65131||E>=65281&&E<=65376||E>=65504&&E<=65510||E>=110592&&E<=110593||E>=127488&&E<=127569||E>=127744&&E<=128591||E>=131072&&E<=262141)},"Kn")}function A$(E){return i4t(E,"str"),$y(u4t,E,"")}S(A$,"Qn");var A4t={34:""",38:"&",39:"'",60:"<",62:">",160:" "};function h$(E){return E.replace(/[\u0000-\u002F\u003A-\u0040\u005B-\u0060\u007B-\u00FF]/g,function(_){var R=xg(_.charCodeAt(0));return A4t[R]||"&#"+R+";"})}S(h$,"to"),r.exports={identicalSequenceRange:t$,inspect:Ms,inspectDefaultOptions:ps,format:S(function(){for(var E=arguments.length,_=new Array(E),R=0;R<E;R++)_[R]=arguments[R];return p$(void 0,_)},"format"),formatWithOptions:S(function(E){jIe(E,"inspectOptions",n4t);for(var _=arguments.length,R=new Array(_>1?_-1:0),$=1;$<_;$++)R[$-1]=arguments[$];return p$(E,R)},"formatWithOptions"),getStringWidth:rR,stripVTControlCharacters:A$,isZeroWidthCodePoint:d$,stylizeWithColor:ZV,stylizeWithHTML:S(function(E,_){var R=Ms.styles[_];return R!==void 0?'<span style="color:'.concat(R,';">').concat(h$(E),"</span>"):h$(E)},"stylizeWithHTML"),Proxy:SGt}},116:(r,s,a)=>{function o(h){return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},o(h)}S(o,"n");var c=a(425).ArrayIsArray,u=a(924),d=u.hideStackFrames,l=u.codes.ERR_INVALID_ARG_TYPE,p=d(function(h,m){var f=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;if(f===0){if(h===null||c(h))throw new l(m,"Object",h);if(o(h)!=="object")throw new l(m,"Object",h)}else{if(!(1&f)&&h===null)throw new l(m,"Object",h);if(!(2&f)&&c(h))throw new l(m,"Object",h);var g=!(4&f),b=o(h);if(b!=="object"&&(g||b!=="function"))throw new l(m,"Object",h)}});r.exports={kValidateObjectNone:0,kValidateObjectAllowNullable:1,kValidateObjectAllowArray:2,kVali
|
|||
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}S(c,"o");function u(Q,w){var W=typeof Symbol<"u"&&Q[Symbol.iterator]||Q["@@iterator"];if(!W){if(Array.isArray(Q)||(W=d(Q))||w&&Q&&typeof Q.length=="number"){W&&(Q=W);var te=0,x=S(function(){},"o");return{s:x,n:S(function(){return te>=Q.length?{done:!0}:{done:!1,value:Q[te++]}},"n"),e:S(function(U){throw U},"e"),f:x}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|||
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var B,k=!0,P=!1;return{s:S(function(){W=W.call(Q)},"s"),n:S(function(){var U=W.next();return k=U.done,U},"n"),e:S(function(U){P=!0,B=U},"e"),f:S(function(){try{k||W.return==null||W.return()}finally{if(P)throw B}},"f")}}S(u,"a");function d(Q,w){if(Q){if(typeof Q=="string")return l(Q,w);var W={}.toString.call(Q).slice(8,-1);return W==="Object"&&Q.constructor&&(W=Q.constructor.name),W==="Map"||W==="Set"?Array.from(Q):W==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(W)?l(Q,w):void 0}}S(d,"i");function l(Q,w){(w==null||w>Q.length)&&(w=Q.length);for(var W=0,te=Array(w);W<w;W++)te[W]=Q[W];return te}S(l,"c");var p=a(425),h=p.BigInt,m=p.Error,f=p.NumberParseInt,g=p.ObjectEntries,b=p.ObjectGetOwnPropertyDescriptor,v=p.ObjectGetOwnPropertyDescriptors,y=p.ObjectGetOwnPropertySymbols,I=p.ObjectPrototypeToString,T=p.Symbol,j=a(569),Y=T("kPending"),G=T("kRejected");r.exports={constants:{kPending:Y,kRejected:G,ALL_PROPERTIES:0,ONLY_ENUMERABLE:2},getOwnNonIndexProperties:S(function(Q){var w,W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,te=v(Q),x=[],B=u(g(te));try{for(B.s();!(w=B.n()).done;){var k=c(w.value,2),P=k[0],U=k[1];if(!/^(0|[1-9][0-9]*)$/.test(P)||f(P,10)>=Math.pow(2,32)-1){if(W===2&&!U.enumerable)continue;x.push(P)}}}catch(Ce){B.e(Ce)}finally{B.f()}var ie,V=u(y(Q));try{for(V.s();!(ie=V.n()).done;){var K=ie.value,Z=b(Q,K);(W!==2||Z.enumerable)&&x.push(K)}}catch(Ce){V.e(Ce)}finally{V.f()}return x},"getOwnNonIndexProperties"),getPromiseDetails:S(function(){return[Y,void 0]},"getPromiseDetails"),getProxyDetails:j.getProxyDetails,Proxy:j.Proxy,previewEntries:S(function(Q){return[[],!1]},"previewEntries"),getConstructorName:S(function(Q){var w;if(!Q||o(Q)!=="object")throw new m("Invalid object");if((w=Q.constructor)!==null&&w!==void 0&&w.name)return Q.constructor.name;var W=I(Q).match(/^\[object ([^\]]+)\]/);return W?W[1]:"Object"},"getConstructorName"),getExternalValue:S(function(){return h(0)},"getExternalValue")}},229:(r,s,a)=>{var o;function c(){return o=o??a(924).codes.ERR_INTERNAL_ASSERTION}S(c,"o");function u(d,l){if(!d)throw new(c())(l)}S(u,"a"),u.fail=function(d){throw new(c())(d)},r.exports=u},370:(r,s,a)=>{var o=a(425),c=o.StringPrototypeCharCodeAt,u=o.StringPrototypeLastIndexOf,d=o.StringPrototypeSlice,l=a(22),p=l.CHAR_DOT,h=l.CHAR_FORWARD_SLASH,m=a(116).validateString;function f(b){return b===h}S(f,"s");function g(b,v,y,I){for(var T="",j=0,Y=-1,G=0,Q=0,w=0;w<=b.length;++w){if(w<b.length)Q=c(b,w);else{if(I(Q))break;Q=h}if(I(Q)){if(!(Y===w-1||G===1))if(G===2){if(T.length<2||j!==2||c(T,T.length-1)!==p||c(T,T.length-2)!==p){if(T.length>2){var W=u(T,y);W===-1?(T="",j=0):j=(T=d(T,0,W)).length-1-u(T,y),Y=w,G=0;continue}if(T.length!==0){T="",j=0,Y=w,G=0;continue}}v&&(T+=T.length>0?"".concat(y,".."):"..",j=2)}else T.length>0?T+="".concat(y).concat(d(b,Y+1,w)):T=d(b,Y+1,w),j=w-Y-1;Y=w,G=0}else Q===p&&G!==-1?++G:G=-1}return T}S(g,"y"),r.exports={isPosixPathSeparator:f,normalizeString:g,resolve:S(function(){if((arguments.length===0||arguments.length===1&&((arguments.length<=0?void 0:arguments[0])===""||(arguments.length<=0?void 0:arguments[0])==="."))&&c("/",0)===h)return"/";for(var b="",v=!1,y=arguments.length-1;y>=0&&!v;y--){var I=y<0||arguments.length<=y?void 0:arguments[y];m(I,"paths[".concat(y,"]")),I.length!==0&&(b="".concat(I,"/").concat(b),v=c(I,0)===h)}return v||(b="".concat("/","/").concat(b),v=c("/",0)===h),b=g(b,!v,"/",f),v?"/".concat(b):b.length>0?b:"."},"resolve")}},425:r=>{function s(){var M,N,z=typeof Symbol=="function"?Symbol:{},Se=z.iterator||"@@iterator",Je=z.toStringTag||"@@toStringTag";function Ct(En,bo,vo,zd){var Jh=bo&&bo.prototype instanceof ct?bo:ct,gc=Object.create(Jh.prototype);return a(gc,"_invoke",(function(Kn,jy,bu){var ml,pr,Fr,Zh=0,Fw=bu||[],vu=!1,fl={p:0,n:0,v:M,a:dp,f:dp.bind(M,4),d:S(function(yo,Nn){return ml=yo,pr=0,Fr=M,fl.n=Nn,At},"d")};function dp(yo,Nn){for(pr=yo,Fr=Nn,N=0;!vu&&Zh&&!yu&&N<Fw.length;N++){var yu,Ua=Fw[N],Gy=fl.p,Vy=Ua[2];yo>3?(yu=Vy===Nn)&&(Fr=Ua[(pr=Ua[4])?5:(pr=3,3
|
|||
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Ct,At=!0,ct=!1;return{s:S(function(){z=z.call(M)},"s"),n:S(function(){var je=z.next();return At=je.done,je},"n"),e:S(function(je){ct=!0,Ct=je},"e"),f:S(function(){try{At||z.return==null||z.return()}finally{if(ct)throw Ct}},"f")}}S(y,"v");function I(M,N){(N==null||N>M.length)&&(N=M.length);for(var z=0,Se=Array(N);z<N;z++)Se[z]=M[z];return Se}S(I,"h");function T(M){return T=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(N){return typeof N}:function(N){return N&&typeof Symbol=="function"&&N.constructor===Symbol&&N!==Symbol.prototype?"symbol":typeof N},T(M)}S(T,"d");function j(M){return function(){return new Y(M.apply(this,arguments))}}S(j,"b");function Y(M){var N,z;function Se(Ct,At){try{var ct=M[Ct](At),je=ct.value,rt=je instanceof G;Promise.resolve(rt?je.v:je).then(function(hi){if(rt){var Bi=Ct==="return"?"return":"next";if(!je.k||hi.done)return Se(Bi,hi);hi=M[Bi](hi).value}Je(ct.done?"return":"normal",hi)},function(hi){Se("throw",hi)})}catch(hi){Je("throw",hi)}}S(Se,"n");function Je(Ct,At){switch(Ct){case"return":N.resolve({value:At,done:!0});break;case"throw":N.reject(At);break;default:N.resolve({value:At,done:!1})}(N=N.next)?Se(N.key,N.arg):z=null}S(Je,"o"),this._invoke=function(Ct,At){return new Promise(function(ct,je){var rt={key:Ct,arg:At,resolve:ct,reject:je,next:null};z?z=z.next=rt:(N=z=rt,Se(Ct,At))})},typeof M.return!="function"&&(this.return=void 0)}S(Y,"m");function G(M,N){this.v=M,this.k=N}S(G,"S"),Y.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Y.prototype.next=function(M){return this._invoke("next",M)},Y.prototype.throw=function(M){return this._invoke("throw",M)},Y.prototype.return=function(M){return this._invoke("return",M)};var Q={__proto__:null},w=Reflect.defineProperty,W=Reflect.getOwnPropertyDescriptor,te=Reflect.ownKeys,x=Function.prototype,B=x.apply,k=x.bind,P=x.call,U=k.bind(P);Q.uncurryThis=U;var ie=k.bind(B);Q.applyBind=ie;var V=["ArrayOf","ArrayPrototypePush","ArrayPrototypeUnshift","MathHypot","MathMax","MathMin","StringFromCharCode","StringFromCodePoint","StringPrototypeConcat","TypedArrayOf"];function K(M){return T(M)==="symbol"?"Symbol".concat(M.description[7].toUpperCase()).concat(M.description.slice(8)):"".concat(M[0].toUpperCase()).concat(M.slice(1))}S(K,"L");function Z(M,N,z,Se){var Je=Se.enumerable,Ct=Se.get,At=Se.set;w(M,"".concat(N,"Get").concat(z),{__proto__:null,value:U(Ct),enumerable:Je}),At!==void 0&&w(M,"".concat(N,"Set").concat(z),{__proto__:null,value:U(At),enumerable:Je})}S(Z,"T");function Ce(M,N,z){var Se,Je=y(te(M));try{for(Je.s();!(Se=Je.n()).done;){var Ct=Se.value,At=K(Ct),ct=W(M,Ct);if("get"in ct)Z(N,z,At,ct);else{var je="".concat(z).concat(At);w(N,je,g({__proto__:null},ct)),V.includes(je)&&w(N,"".concat(je,"Apply"),{__proto__:null,value:ie(ct.value,M)})}}}catch(rt){Je.e(rt)}finally{Je.f()}}S(Ce,"B");function Ee(M,N,z){var Se,Je=y(te(M));try{for(Je.s();!(Se=Je.n()).done;){var Ct=Se.value,At=K(Ct),ct=W(M,Ct);if("get"in ct)Z(N,z,At,ct);else{var je=ct.value;typeof je=="function"&&(ct.value=U(je));var rt="".concat(z).concat(At);w(N,rt,g({__proto__:null},ct)),V.includes(rt)&&w(N,"".concat(rt,"Apply"),{__proto__:null,value:ie(je)})}}}catch(hi){Je.e(hi)}finally{Je.f()}}S(Ee,"z"),["Proxy","globalThis"].forEach(function(M){Q[M]=globalThis[M]}),[decodeURI,decodeURIComponent,encodeURI,encodeURIComponent].forEach(function(M){Q[M.name]=M}),[escape,eval,unescape].forEach(function(M){Q[M.name]=M}),["Atomics","JSON","Math","Proxy","Reflect"].forEach(function(M){Ce(globalThis[M],Q,M)}),["AggregateError","Array","ArrayBuffer","BigInt","BigInt64Array","BigUint64Array","Boolean","DataView","Date","Error","EvalError","FinalizationRegistry","Float32Array","Float64Array","Function","Int16Array","Int32Array","Int8Array","Map","Number","Object","RangeError","ReferenceError","RegExp","Set","String","Symbol","SyntaxError","TypeError","URIError","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray","WeakMap","WeakRef","WeakSet"]
|
|||
|
|
`)&&(j=d(j,g,"%0A")),u(j,"\r")&&(j=d(j,b,"%0D")),u(j," ")&&(j=d(j,v,"%09")),j})(T),I},"pathToFileURL"),URL:l}},883:(r,s,a)=>{function o(p){return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},o(p)}S(o,"n");function c(p,h){for(var m=0;m<h.length;m++){var f=h[m];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(p,u(f.key),f)}}S(c,"o");function u(p){var h=(function(m){if(o(m)!="object"||!m)return m;var f=m[Symbol.toPrimitive];if(f!==void 0){var g=f.call(m,"string");if(o(g)!="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(m)})(p);return o(h)=="symbol"?h:h+""}S(u,"a");var d=a(425).ArrayPrototypeMap,l=(function(){return p=S(function m(){(function(f,g){if(!(f instanceof g))throw new TypeError("Cannot call a class as a function")})(this,m)},"t"),h=[{key:"hexSlice",value:S(function(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,f=arguments.length>1?arguments[1]:void 0;return d(this.slice(m,f),function(g){return("00"+g.toString(16)).slice(-2)}).join("")},"value")}],h&&c(p.prototype,h),Object.defineProperty(p,"prototype",{writable:!1}),p;var p,h})();s.h=l},923:(r,s,a)=>{var o=a(425),c=o.ArrayPrototypeJoin,u=o.Error,d=o.StringPrototypeReplace,l=o.SymbolFor,p=/\u001b\[\d\d?m/g;r.exports={customInspectSymbol:l("nodejs.util.inspect.custom"),isError:S(function(h){return h instanceof u},"isError"),join:c,removeColors:S(function(h){return d(h,p,"")},"removeColors")}},924:(r,s,a)=>{function o(ye,M){(M==null||M>ye.length)&&(M=ye.length);for(var N=0,z=Array(M);N<M;N++)z[N]=ye[N];return z}S(o,"n");function c(ye){return c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(M){return typeof M}:function(M){return M&&typeof Symbol=="function"&&M.constructor===Symbol&&M!==Symbol.prototype?"symbol":typeof M},c(ye)}S(c,"o");function u(ye,M){for(var N=0;N<M.length;N++){var z=M[N];z.enumerable=z.enumerable||!1,z.configurable=!0,"value"in z&&(z.writable=!0),Object.defineProperty(ye,d(z.key),z)}}S(u,"a");function d(ye){var M=(function(N){if(c(N)!="object"||!N)return N;var z=N[Symbol.toPrimitive];if(z!==void 0){var Se=z.call(N,"string");if(c(Se)!="object")return Se;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(N)})(ye);return c(M)=="symbol"?M:M+""}S(d,"i");function l(){try{var ye=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(l=S(function(){return!!ye},"c"))()}S(l,"c");function p(ye){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(M){return M.__proto__||Object.getPrototypeOf(M)},p(ye)}S(p,"u");function h(ye,M){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(N,z){return N.__proto__=z,N},h(ye,M)}S(h,"l");var m,f,g=a(425),b=g.ArrayIsArray,v=g.ArrayPrototypeIncludes,y=g.ArrayPrototypeIndexOf,I=g.ArrayPrototypeJoin,T=g.ArrayPrototypePush,j=g.ArrayPrototypeSlice,Y=g.ArrayPrototypeSplice,G=g.Error,Q=g.ErrorCaptureStackTrace,w=g.JSONStringify,W=g.ObjectDefineProperty,te=g.ReflectApply,x=g.RegExpPrototypeExec,B=g.SafeMap,k=g.SafeWeakMap,P=g.String,U=g.StringPrototypeEndsWith,ie=g.StringPrototypeIncludes,V=g.StringPrototypeIndexOf,K=g.StringPrototypeSlice,Z=g.StringPrototypeToLowerCase,Ce=g.Symbol,Ee=g.TypeError,Oe=Ce("kIsNodeError"),bt=new B,ri={},si=/^[A-Z][a-zA-Z0-9]*$/,Zn=["string","function","number","object","Function","Object","boolean","bigint","symbol"],mc=new k,xn=a(229),J=null;function lt(ye,M){var N=(function(z){function Se(){var ct,je,rt,hi;(function(bo,vo){if(!(bo instanceof vo))throw new TypeError("Cannot call a class as a function")})(this,Se),ct=(function(bo,vo,zd){return vo=p(vo),(function(Jh,gc){if(gc&&(c(gc)=="object"||typeof gc=="function"))return gc;if(gc!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(Kn){if(Kn===void 0)throw new ReferenceError("this hasn't been initialised - s
|
|||
|
|
Please open an issue with this stack trace at https://github.com/nodejs/node/issues
|
|||
|
|
`;return ye===void 0?M:"".concat(ye,`
|
|||
|
|
`).concat(M)},G),Xe("ERR_INVALID_ARG_TYPE",function(ye,M,N){xn(typeof ye=="string","'name' must be a string"),b(M)||(M=[M]);var z="The ";if(U(ye," argument"))z+="".concat(ye," ");else{var Se=ie(ye,".")?"property":"argument";z+='"'.concat(ye,'" ').concat(Se," ")}z+="must be ";var Je,Ct=[],At=[],ct=[],je=(function(Bi,fc){var En=typeof Symbol<"u"&&Bi[Symbol.iterator]||Bi["@@iterator"];if(!En){if(Array.isArray(Bi)||(En=(function(Kn,jy){if(Kn){if(typeof Kn=="string")return o(Kn,jy);var bu={}.toString.call(Kn).slice(8,-1);return bu==="Object"&&Kn.constructor&&(bu=Kn.constructor.name),bu==="Map"||bu==="Set"?Array.from(Kn):bu==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(bu)?o(Kn,jy):void 0}})(Bi))||fc&&Bi&&typeof Bi.length=="number"){En&&(Bi=En);var bo=0,vo=S(function(){},"a");return{s:vo,n:S(function(){return bo>=Bi.length?{done:!0}:{done:!1,value:Bi[bo++]}},"n"),e:S(function(Kn){throw Kn},"e"),f:vo}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|||
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var zd,Jh=!0,gc=!1;return{s:S(function(){En=En.call(Bi)},"s"),n:S(function(){var Kn=En.next();return Jh=Kn.done,Kn},"n"),e:S(function(Kn){gc=!0,zd=Kn},"e"),f:S(function(){try{Jh||En.return==null||En.return()}finally{if(gc)throw zd}},"f")}})(M);try{for(je.s();!(Je=je.n()).done;){var rt=Je.value;xn(typeof rt=="string","All expected entries have to be of type string"),v(Zn,rt)?T(Ct,Z(rt)):x(si,rt)!==null?T(At,rt):(xn(rt!=="object",'The value "object" should be written as "Object"'),T(ct,rt))}}catch(Bi){je.e(Bi)}finally{je.f()}if(At.length>0){var hi=y(Ct,"object");hi!==-1&&(Y(Ct,hi,1),T(At,"Object"))}return Ct.length>0&&(z+="".concat(Ct.length>1?"one of type":"of type"," ").concat(Kr(Ct,"or")),(At.length>0||ct.length>0)&&(z+=" or ")),At.length>0&&(z+="an instance of ".concat(Kr(At,"or")),ct.length>0&&(z+=" or ")),ct.length>0&&(ct.length>1?z+="one of ".concat(Kr(ct,"or")):(Z(ct[0])!==ct[0]&&(z+="an "),z+="".concat(ct[0]))),z+". Received ".concat(ii(N))},Ee)}},n={};return S(function r(s){var a=n[s];if(a!==void 0)return a.exports;var o=n[s]={exports:{}};return i[s](o,o.exports,r),o.exports},"r")(33)})())}}),vYe={};dEi(vYe,{AbortError:()=>hk,AsyncEventEmitter:()=>vEi});kYe.exports=hEi(vYe);Aee();Aee();var fEi=AEi(mEi(),1),{inspect:gEi,format:pNn,formatWithOptions:dNn,stripVTControlCharacters:ANn,stylizeWithColor:hNn,stylizeWithHTML:mNn,Proxy:fNn}=fEi.default;function FI(e){if(typeof e!="function")throw new TypeError(`The listener argument must be a function. Received ${typeof e}`)}S(FI,"validateListener");function lee(e){if(e&&!(e instanceof AbortSignal))throw new TypeError(`The signal option must be an AbortSignal. Received ${e}`)}S(lee,"validateAbortSignal");function yYe(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}S(yYe,"spliceOne");function e2(e){switch(e.length){case 2:return[e[0],e[1]];case 3:return[e[0],e[1],e[2]];case 4:return[e[0],e[1],e[2],e[3]];case 5:return[e[0],e[1],e[2],e[3],e[4]];case 6:return[e[0],e[1],e[2],e[3],e[4],e[5]]}return e.slice()}S(e2,"arrayClone");function xYe(e,t){for(let i=0;i<e.length-3;i++){let n=t.indexOf(e[i]);if(n!==-1){let r=t.length-n;if(r>3){let s=1,a=Math.min(e.length-i,r);for(;a>s&&e[i+s]===t[n+s];)s++;if(s>3)return[s,i]}}}return[0,0]}S(xYe,"identicalSequenceRange");function EYe(e,t){let i="";try{let{name:c}=this.constructor;c!=="AsyncEventEmitter"&&(i=` on ${c} instance`)}catch{}let n=`
|
|||
|
|
Emitted 'error' event${i} at:
|
|||
|
|
`,r=e.stack.split(`
|
|||
|
|
`).slice(1),s=t.stack.split(`
|
|||
|
|
`).slice(1),{0:a,1:o}=xYe(s,r);return a>0&&s.splice(o+1,a-2," [... lines matching original stack trace ...]"),e.stack+n+s.join(`
|
|||
|
|
`)}S(EYe,"enhanceStackTrace");var bEi=Symbol.for("async-event-emitter.ts-brand"),t2=Symbol.for("async-event-emitter.ts-capture-promise-rejections"),IYe;IYe=t2;var CYe=class wYe{constructor(){this._events={__proto__:null},this._eventCount=0,this._maxListeners=10,this._internalPromiseMap=new Map,this._wrapperId=0n,this[IYe]=!0}addListener(t,i){FI(i);let n=this._wrapListener(t,i,!1);return this._addListener(t,n,!1),this}on(t,i){return this.addListener(t,i)}once(t,i){FI(i);let n=this._wrapListener(t,i,!0);return this._addListener(t,n,!1),this}removeListener(t,i){FI(i);let n=this._events,r=n[t];if(r===void 0)return this;if(r===i||r.listener===i)--this._eventCount===0?this._events={__proto__:null}:(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener??r));else if(typeof r!="function"){let s=-1;for(let a=r.length-1;a>=0;a--)if(r[a]===i||r[a].listener===i){s=a;break}if(s<0)return this;s===0?r.shift():yYe(r,s),r.length===0&&(delete n[t],--this._eventCount),n.removeListener!==void 0&&this.emit("removeListener",t,i)}return this}off(t,i){return this.removeListener(t,i)}removeAllListeners(t){let i=this._events;if(i.removeListener===void 0)return t?i[t]!==void 0&&(--this._eventCount===0?this._events={__proto__:null}:delete i[t]):(this._events={__proto__:null},this._eventCount=0),this;if(!t){for(let r of Reflect.ownKeys(i))r!=="removeListener"&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events={__proto__:null},this._eventCount=0,this}let n=i[t];if(typeof n=="function")this.removeListener(t,n);else if(n!==void 0)for(let r=n.length-1;r>=0;r--)this.removeListener(t,n[r]);return this}setMaxListeners(t){if(typeof t!="number"||t<0||Number.isNaN(t))throw new RangeError(`Expected to get a non-negative number for "setMaxListeners", got ${t} instead`);return this._maxListeners=t,this}getMaxListeners(){return this._maxListeners}listeners(t){let i=this._events[t];if(i===void 0)return[];if(typeof i=="function")return[i.listener??i];let n=e2(i);for(let r=0;r<n.length;++r){let s=n[r].listener;typeof s=="function"&&(n[r]=s)}return n}rawListeners(t){let i=this._events[t];return i===void 0?[]:typeof i=="function"?[i]:e2(i)}emit(t,...i){let n=t==="error",r=this._events;if(r!==void 0)n=n&&r.error===void 0;else if(!n)return!1;if(n){let a;if(i.length>0&&(a=i[0]),a instanceof Error){try{let u={};Error.captureStackTrace(u,wYe.prototype.emit),Object.defineProperty(a,"stack",{value:EYe.call(this,a,u),configurable:!0})}catch{}throw a}let o;try{o=gEi(a)}catch{o=String(a)}let c=new Error(`Unhandled 'error' event emitted, received ${o}`);throw c.context=a,c}let s=r[t];if(s===void 0)return!1;if(typeof s=="function"){let a=s.apply(this,i);a!=null&&pee(this,a)}else{let a=s.length,o=e2(s);for(let c=0;c<a;++c){let u=o[c].apply(this,i);u!=null&&pee(this,u)}}return!0}listenerCount(t){let i=this._events;if(i===void 0)return 0;let n=i[t];return typeof n=="function"?1:n?.length??0}prependListener(t,i){FI(i);let n=this._wrapListener(t,i,!1);return this._addListener(t,n,!0),this}prependOnceListener(t,i){FI(i);let n=this._wrapListener(t,i,!0);return this._addListener(t,n,!0),this}eventNames(){return this._eventCount>0?Reflect.ownKeys(this._events):[]}async waitForAllListenersToComplete(){let t=[...this._internalPromiseMap.values()];return t.length===0?!1:(await Promise.all(t),!0)}_addListener(t,i,n){this._events.newListener!==void 0&&this.emit("newListener",t,i.listener??i);let r=this._events[t];r===void 0?(r=this._events[t]=i,++this._eventCount):typeof r=="function"?r=this._events[t]=n?[i,r]:[r,i]:n?r.unshift(i):r.push(i);let s=Reflect.get(r,"_hasWarnedAboutMaxListeners");if(this._maxListeners>0&&r.length>this._maxListeners&&!s){Reflect.set(r,"_hasWarnedAboutMaxListeners",!0);let a=[`Possible AsyncEventEmitter memory leak detected. ${r.length} ${String(t)} listeners added to ${this.constructor.name}.`,"Use emitter.setMaxListeners() to increase the limit."].join(" ");console.warn(a)}}_wrapListener(t,i,n){if(!n)return i;let r={fired:!1,wrapFn:void 0,eventEmitter:this,eventName:t,listener:i},a=BYe.bind(r);return a.listener=
|
|||
|
|
Must be one of: ${t.join(", ")}`);if(r&&!bee.includes(r))throw new RangeError(`Invalid size provided: ${r}
|
|||
|
|
Must be one of: ${bee.join(", ")}`);let a=new URL(`${i}${e}.${n}`);return s!==void 0&&a.searchParams.set("animated",String(s)),r&&a.searchParams.set("size",String(r)),a.toString()}};function hze(e){return Reflect.has(e,"_errors")}rn(hze,"isErrorGroupWrapper");function mze(e){return typeof Reflect.get(e,"message")=="string"}rn(mze,"isErrorResponse");var fze=class Eee extends Error{constructor(t,i,n,r,s,a){super(Eee.getMessage(t)),this.rawError=t,this.code=i,this.status=n,this.method=r,this.url=s,this.requestBody={files:a.files,json:a.body}}static{rn(this,"DiscordAPIError")}requestBody;get name(){return`${Eee.name}[${this.code}]`}static getMessage(t){let i="";return"code"in t?(t.errors&&(i=[...this.flattenDiscordError(t.errors)].join(`
|
|||
|
|
`)),t.message&&i?`${t.message}
|
|||
|
|
${i}`:t.message||i||"Unknown Error"):t.error_description??"No Description"}static*flattenDiscordError(t,i=""){if(mze(t))return yield`${i.length?`${i}[${t.code}]`:`${t.code}`}: ${t.message}`.trim();for(let[n,r]of Object.entries(t)){let s=n.startsWith("_")?i:i?Number.isNaN(Number(n))?`${i}.${n}`:`${i}[${n}]`:n;if(typeof r=="string")yield r;else if(hze(r))for(let a of r._errors)yield*this.flattenDiscordError(a,s);else yield*this.flattenDiscordError(r,s)}}},gze=class bze extends Error{constructor(t,i,n,r,s){super(i),this.status=t,this.method=n,this.url=r,this.requestBody={files:s.files,json:s.body}}static{rn(this,"HTTPError")}requestBody;name=bze.name},i2=cYe(),ZEi=gYe(),KEi=PI(),XEi=gee(),n2=0,r2=null;function Iee(e){(!r2||r2<Date.now())&&(r2=Date.now()+1e3*60*10,n2=0),n2++,e.options.invalidRequestWarningInterval>0&&n2%e.options.invalidRequestWarningInterval===0&&e.emit("invalidRequestWarning",{count:n2,remainingTime:r2-Date.now()})}rn(Iee,"incrementInvalidCount");async function Cee(e,t,i,n,r,s){let a=new AbortController,o=setTimeout(()=>a.abort(),e.options.timeout);r.signal&&(r.signal.aborted?a.abort():r.signal.addEventListener("abort",()=>a.abort()));let c;try{c=await e.options.makeRequest(i,{...n,signal:a.signal})}catch(u){if(!(u instanceof Error))throw u;if(lze(u)&&s!==e.options.retries)return null;throw u}finally{clearTimeout(o)}return e.listenerCount("response")&&e.emit("response",{method:n.method??"get",path:t.original,route:t.bucketRoute,options:n,data:r,retries:s},c instanceof Response?c.clone():{...c}),c}rn(Cee,"makeNetworkRequest");async function wee(e,t,i,n,r,s){let a=t.status;if(a>=500&&a<600){if(s!==e.options.retries)return null;throw new gze(a,t.statusText,i,n,r)}else{if(a>=400&&a<500){a===401&&r.auth&&e.setToken(null);let o=await o2(t);throw new fze(o,"code"in o?o.code:o.error,a,i,n,r)}return t}}rn(wee,"handleErrors");var eIi=class{constructor(e,t,i){this.manager=e,this.hash=t,this.majorParameter=i,this.id=`${t}:${i}`}static{rn(this,"BurstHandler")}id;inactive=!1;debug(e){this.manager.emit("restDebug",`[REST ${this.id}] ${e}`)}async queueRequest(e,t,i,n){return this.runRequest(e,t,i,n)}async runRequest(e,t,i,n,r=0){let s=i.method??"get",a=await Cee(this.manager,e,t,i,n,r);if(a===null)return this.runRequest(e,t,i,n,++r);let o=a.status,c=0,u=a.headers.get("Retry-After"),d=GI(this.manager.options.offset,e.bucketRoute);if(u&&(c=Number(u)*1e3+d),(o===401||o===403||o===429)&&Iee(this.manager),o>=200&&o<300)return a;if(o===429){let l=a.headers.has("X-RateLimit-Global"),p=a.headers.get("X-RateLimit-Scope")??"user";return await s2(this.manager,{global:l,method:s,url:t,route:e.bucketRoute,majorParameter:this.majorParameter,hash:this.hash,limit:Number.POSITIVE_INFINITY,timeToReset:c,retryAfter:c,sublimitTimeout:0,scope:p}),this.debug(["Encountered unexpected 429 rate limit",` Global : ${l}`,` Method : ${s}`,` URL : ${t}`,` Bucket : ${e.bucketRoute}`,` Major parameter: ${e.majorParameter}`,` Hash : ${this.hash}`,` Limit : ${Number.POSITIVE_INFINITY}`,` Retry After : ${c}ms`," Sublimit : None",` Scope : ${p}`].join(`
|
|||
|
|
`)),await fk(c),this.runRequest(e,t,i,n,r)}else{let l=await wee(this.manager,a,s,t,n,r);return l===null?this.runRequest(e,t,i,n,++r):l}}},$Ye=$b(),tIi=class{constructor(e,t,i){this.manager=e,this.hash=t,this.majorParameter=i,this.id=`${t}:${i}`}static{rn(this,"SequentialHandler")}id;reset=-1;remaining=1;limit=Number.POSITIVE_INFINITY;#e=new $Ye.AsyncQueue;#t=null;#n=null;#i=!1;get inactive(){return this.#e.remaining===0&&(this.#t===null||this.#t.remaining===0)&&!this.limited}get globalLimited(){return this.manager.globalRemaining<=0&&Date.now()<this.manager.globalReset}get localLimited(){return this.remaining<=0&&Date.now()<this.reset}get limited(){return this.globalLimited||this.localLimited}getTimeToReset(e){let t=GI(this.manager.options.offset,e.bucketRoute);return this.reset+t-Date.now()}debug(e){this.manager.emit("restDebug",`[REST ${this.id}] ${e}`)}async globalDelayFor(e){await fk(e),this.manager.globalDelay=null}async queueRequest(e,t,i,n){let r=this.#e,s=0;if(this.#t&&xee(e.bucketRoute,n.body,i.method)&&(r=this.#t,s=1),await r.wait({signal:n.signal}),s===0)if(this.#t&&xee(e.bucketRoute,n.body,i.method)){r=this.#t;let a=r.wait();this.#e.shift(),await a}else this.#n&&await this.#n.promise;try{return await this.runRequest(e,t,i,n)}finally{r.shift(),this.#i&&(this.#i=!1,this.#t?.shift()),this.#t?.remaining===0&&(this.#n?.resolve(),this.#t=null)}}async runRequest(e,t,i,n,r=0){for(;this.limited;){let b=this.globalLimited,v,y,I;if(b){let j=GI(this.manager.options.offset,e.bucketRoute);v=this.manager.options.globalRequestsPerSecond,y=this.manager.globalReset+j-Date.now(),this.manager.globalDelay||(this.manager.globalDelay=this.globalDelayFor(y)),I=this.manager.globalDelay}else v=this.limit,y=this.getTimeToReset(e),I=fk(y);let T={global:b,method:i.method??"get",url:t,route:e.bucketRoute,majorParameter:this.majorParameter,hash:this.hash,limit:v,timeToReset:y,retryAfter:y,sublimitTimeout:0,scope:"user"};this.manager.emit("rateLimited",T),await s2(this.manager,T),b?this.debug(`Global rate limit hit, blocking all requests for ${y}ms`):this.debug(`Waiting ${y}ms for rate limit to pass`),await I}(!this.manager.globalReset||this.manager.globalReset<Date.now())&&(this.manager.globalReset=Date.now()+1e3,this.manager.globalRemaining=this.manager.options.globalRequestsPerSecond),this.manager.globalRemaining--;let s=i.method??"get",a=await Cee(this.manager,e,t,i,n,r);if(a===null)return this.runRequest(e,t,i,n,++r);let o=a.status,c=0,u=a.headers.get("X-RateLimit-Limit"),d=a.headers.get("X-RateLimit-Remaining"),l=a.headers.get("X-RateLimit-Reset-After"),p=a.headers.get("X-RateLimit-Bucket"),h=a.headers.get("Retry-After"),m=a.headers.get("X-RateLimit-Scope")??"user",f=GI(this.manager.options.offset,e.bucketRoute);if(this.limit=u?Number(u):Number.POSITIVE_INFINITY,this.remaining=d?Number(d):1,this.reset=l?Number(l)*1e3+Date.now()+f:Date.now(),h&&(c=Number(h)*1e3+f),p&&p!==this.hash)this.debug(["Received bucket hash update",` Old Hash : ${this.hash}`,` New Hash : ${p}`].join(`
|
|||
|
|
`)),this.manager.hashes.set(`${s}:${e.bucketRoute}`,{value:p,lastAccess:Date.now()});else if(p){let b=this.manager.hashes.get(`${s}:${e.bucketRoute}`);b&&(b.lastAccess=Date.now())}let g=null;if(c>0&&(a.headers.has("X-RateLimit-Global")?(this.manager.globalRemaining=0,this.manager.globalReset=Date.now()+c):this.localLimited||(g=c)),(o===401||o===403||o===429)&&Iee(this.manager),a.ok)return a;if(o===429){let b=this.globalLimited,v,y;if(b){let I=GI(this.manager.options.offset,e.bucketRoute);v=this.manager.options.globalRequestsPerSecond,y=this.manager.globalReset+I-Date.now()}else v=this.limit,y=this.getTimeToReset(e);if(await s2(this.manager,{global:b,method:s,url:t,route:e.bucketRoute,majorParameter:this.majorParameter,hash:this.hash,limit:v,timeToReset:y,retryAfter:c,sublimitTimeout:g??0,scope:m}),this.debug(["Encountered unexpected 429 rate limit",` Global : ${b.toString()}`,` Method : ${s}`,` URL : ${t}`,` Bucket : ${e.bucketRoute}`,` Major parameter: ${e.majorParameter}`,` Hash : ${this.hash}`,` Limit : ${v}`,` Retry After : ${c}ms`,` Sublimit : ${g?`${g}ms`:"None"}`,` Scope : ${m}`].join(`
|
|||
|
|
`)),g){let I=!this.#t;I&&(this.#t=new $Ye.AsyncQueue,this.#t.wait(),this.#e.shift()),this.#n?.resolve(),this.#n=null,await fk(g);let T,j=new Promise(Y=>T=Y);this.#n={promise:j,resolve:T},I&&(await this.#e.wait(),this.#i=!0)}return this.runRequest(e,t,i,n,r)}else{let b=await wee(this.manager,a,s,t,n,r);return b===null?this.runRequest(e,t,i,n,++r):b}}},iIi=class vze extends KEi.AsyncEventEmitter{static{rn(this,"REST")}agent=null;cdn;globalRemaining;globalDelay=null;globalReset=-1;hashes=new i2.Collection;handlers=new i2.Collection;#e=null;hashTimer;handlerTimer;options;constructor(t={}){super(),this.cdn=new Aze(t.cdn??VI.cdn,t.mediaProxy??VI.mediaProxy),this.options={...VI,...t},this.globalRemaining=Math.max(1,this.options.globalRequestsPerSecond),this.agent=t.agent??null,this.setupSweepers()}setupSweepers(){let t=rn(i=>{if(i>144e5)throw new Error("Cannot set an interval greater than 4 hours")},"validateMaxInterval");this.options.hashSweepInterval!==0&&this.options.hashSweepInterval!==Number.POSITIVE_INFINITY&&(t(this.options.hashSweepInterval),this.hashTimer=setInterval(()=>{let i=new i2.Collection,n=Date.now();this.hashes.sweep((r,s)=>{if(r.lastAccess===-1)return!1;let a=Math.floor(n-r.lastAccess)>this.options.hashLifetime;return a&&(i.set(s,r),this.emit("restDebug",`Hash ${r.value} for ${s} swept due to lifetime being exceeded`)),a}),this.emit("hashSweep",i)},this.options.hashSweepInterval),this.hashTimer.unref?.()),this.options.handlerSweepInterval!==0&&this.options.handlerSweepInterval!==Number.POSITIVE_INFINITY&&(t(this.options.handlerSweepInterval),this.handlerTimer=setInterval(()=>{let i=new i2.Collection;this.handlers.sweep((n,r)=>{let{inactive:s}=n;return s&&(i.set(r,n),this.emit("restDebug",`Handler ${n.id} for ${r} swept due to being inactive`)),s}),this.emit("handlerSweep",i)},this.options.handlerSweepInterval),this.handlerTimer.unref?.())}async get(t,i={}){return this.request({...i,fullRoute:t,method:"GET"})}async delete(t,i={}){return this.request({...i,fullRoute:t,method:"DELETE"})}async post(t,i={}){return this.request({...i,fullRoute:t,method:"POST"})}async put(t,i={}){return this.request({...i,fullRoute:t,method:"PUT"})}async patch(t,i={}){return this.request({...i,fullRoute:t,method:"PATCH"})}async request(t){let i=await this.queueRequest(t);return o2(i)}setAgent(t){return this.agent=t,this}setToken(t){return this.#e=t,this}async queueRequest(t){let i=vze.generateRouteData(t.fullRoute,t.method),n=this.hashes.get(`${t.method}:${i.bucketRoute}`)??{value:`Global(${t.method}:${i.bucketRoute})`,lastAccess:-1},r=this.handlers.get(`${n.value}:${i.majorParameter}`)??this.createHandler(n.value,i.majorParameter),{url:s,fetchOptions:a}=await this.resolveRequest(t);return r.queueRequest(i,s,a,{body:t.body,files:t.files,auth:t.auth!==!1,signal:t.signal})}createHandler(t,i){let n=i===vee?new eIi(this,t,i):new tIi(this,t,i);return this.handlers.set(n.id,n),n}async resolveRequest(t){let{options:i}=this,n="";if(t.query){let d=t.query.toString();d!==""&&(n=`?${d}`)}let r={...this.options.headers,"User-Agent":`${KYe} ${i.userAgentAppendix}`.trim()};if(t.auth!==!1){if(!this.#e)throw new Error("Expected token to be set for this request, but none was present");r.Authorization=`${t.authPrefix??this.options.authPrefix} ${this.#e}`}t.reason?.length&&(r["X-Audit-Log-Reason"]=encodeURIComponent(t.reason));let s=`${i.api}${t.versioned===!1?"":`/v${i.version}`}${t.fullRoute}${n}`,a,o={};if(t.files?.length){let d=new FormData;for(let[l,p]of t.files.entries()){let h=p.key??`files[${l}]`;if(pze(p.data)){let m=p.contentType;if(!m){let[f]=(0,XEi.filetypeinfo)(p.data);f&&(m=nze[f.mime]??f.mime??"application/octet-stream")}d.append(h,new Blob([p.data],{type:m}),p.name)}else d.append(h,new Blob([`${p.data}`],{type:p.contentType}),p.name)}if(t.body!=null)if(t.appendToFormData)for(let[l,p]of Object.entries(t.body))d.append(l,p);else d.append("payload_json",JSON.stringify(t.body));a=d}else t.body!=null&&(t.passThroughBody?a=t.body:(a=JSON.stringify(t.body),o={"Content-Type":"application/json"}));let c=t.method.toUpperCase(),u={body:["GET","H
|
|||
|
|
${e}
|
|||
|
|
\`\`\``:`\`\`\`${e}
|
|||
|
|
${t}
|
|||
|
|
\`\`\``}Ft(cWe,"codeBlock");function lWe(e){return`\`${e}\``}Ft(lWe,"inlineCode");function uWe(e){return`_${e}_`}Ft(uWe,"italic");function pWe(e){return`**${e}**`}Ft(pWe,"bold");function dWe(e){return Zee(e)}Ft(dWe,"underscore");function Zee(e){return`__${e}__`}Ft(Zee,"underline");function AWe(e){return`~~${e}~~`}Ft(AWe,"strikethrough");function hWe(e){return`> ${e}`}Ft(hWe,"quote");function mWe(e){return`>>> ${e}`}Ft(mWe,"blockQuote");function fWe(e){return`<${e}>`}Ft(fWe,"hideLinkEmbed");function gWe(e,t,i){return i?`[${e}](${t} "${i}")`:`[${e}](${t})`}Ft(gWe,"hyperlink");function bWe(e){return`||${e}||`}Ft(bWe,"spoiler");function vWe(e){return`<@${e}>`}Ft(vWe,"userMention");function yWe(e){return`<#${e}>`}Ft(yWe,"channelMention");function xWe(e){return`<@&${e}>`}Ft(xWe,"roleMention");function EWe(e){return`<id:linked-roles:${e}>`}Ft(EWe,"linkedRoleMention");function IWe(e,t,i,n){return n!==void 0?`</${e} ${t} ${i}:${n}>`:i!==void 0?`</${e} ${t}:${i}>`:`</${e}:${t}>`}Ft(IWe,"chatInputApplicationCommandMention");function CWe(e,t){let i=typeof e=="string"?{id:e,animated:t??!1}:e,{id:n,animated:r,name:s}=i;return`<${r?"a":""}:${s??"emoji"}:${n}>`}Ft(CWe,"formatEmoji");function g2(e,t){return`https://discord.com/channels/${t??"@me"}/${e}`}Ft(g2,"channelLink");function wWe(e,t,i){return`${i===void 0?g2(e):g2(e,i)}/${t}`}Ft(wWe,"messageLink");var BWe=(e=>(e[e.One=1]="One",e[e.Two=2]="Two",e[e.Three=3]="Three",e))(BWe||{});function _We(e,t){switch(t){case 3:return`### ${e}`;case 2:return`## ${e}`;default:return`# ${e}`}}Ft(_We,"heading");function v2(e,t,i=0){return Array.isArray(e)?e.map(n=>v2(n,t,i+1)).join(`
|
|||
|
|
`):`${" ".repeat(i-1)}${t?`${t}.`:"-"} ${e}`}Ft(v2,"listCallback");function QWe(e,t=1){return v2(e,Math.max(t,1))}Ft(QWe,"orderedList");function kWe(e){return v2(e)}Ft(kWe,"unorderedList");function SWe(e){return`-# ${e}`}Ft(SWe,"subtext");function DWe(e,t){return typeof e!="number"&&(e=Math.floor((e?.getTime()??Date.now())/1e3)),typeof t=="string"?`<t:${e}:${t}>`:`<t:${e}>`}Ft(DWe,"time");function RWe(e,t){let i=`https://discord.com/application-directory/${e}/store`;return t?`${i}/${t}`:i}Ft(RWe,"applicationDirectory");function TWe(e,t){if(t){let i=new URLSearchParams(Object.fromEntries(Object.entries(t).map(([n,r])=>[n.toLowerCase(),r])));return`<${e}?${i.toString()}>`}return`<${e}>`}Ft(TWe,"email");function MWe(e){if(!e.startsWith("+"))throw new Error('Phone number must start with a "+" sign.');return`<${e}>`}Ft(MWe,"phoneNumber");var ECi={ShortTime:"t",MediumTime:"T",LongTime:"T",ShortDate:"d",LongDate:"D",LongDateShortTime:"f",ShortDateTime:"f",FullDateShortTime:"F",LongDateTime:"F",ShortDateShortTime:"s",ShortDateMediumTime:"S",RelativeTime:"R"},UWe=(e=>(e.Shrug="\xAF\\_(\u30C4)_/\xAF",e.Tableflip="(\u256F\xB0\u25A1\xB0)\u256F\uFE35 \u253B\u2501\u253B",e.Unflip="\u252C\u2500\u252C\u30CE( \xBA _ \xBA\u30CE)",e))(UWe||{}),NWe=(e=>(e.Browse="<id:browse>",e.Customize="<id:customize>",e.Guide="<id:guide>",e.LinkedRoles="<id:linked-roles>",e))(NWe||{}),ICi="0.6.2"});var Nt=A((GNn,FWe)=>{"use strict";var{flatten:CCi}=Pt(),Kee=class{constructor(t){Object.defineProperty(this,"client",{value:t})}_clone(){return Object.assign(Object.create(this),this)}_patch(t){return t}_update(t){let i=this._clone();return this._patch(t),i}toJSON(...t){return CCi(this,...t)}valueOf(){return this.id}};FWe.exports=Kee});var vk=A((VNn,qWe)=>{"use strict";var{ChannelFlags:wCi}=ge(),BCi=fa(),Xee=class extends BCi{static Flags=wCi};qWe.exports=Xee});var $u=A(ga=>{"use strict";var{ChannelType:Ha,MessageType:Pi,ComponentType:yk,ImageFormat:y2,StickerFormatType:x2}=ge();ga.MaxBulkDeletableMessageAge=12096e5;ga.SweeperKeys=["autoModerationRules","applicationCommands","bans","emojis","entitlements","invites","guildMembers","messages","presences","reactions","stageInstances","stickers","threadMembers","threads","users","voiceStates"];ga.NonSystemMessageTypes=[Pi.Default,Pi.Reply,Pi.ChatInputCommand,Pi.ContextMenuCommand];ga.GuildTextBasedChannelTypes=[Ha.GuildText,Ha.GuildAnnouncement,Ha.AnnouncementThread,Ha.PublicThread,Ha.PrivateThread,Ha.GuildVoice,Ha.GuildStageVoice];ga.TextBasedChannelTypes=[...ga.GuildTextBasedChannelTypes,Ha.DM,Ha.GroupDM];ga.SendableChannels=[...ga.GuildTextBasedChannelTypes,Ha.DM];ga.ThreadChannelTypes=[Ha.AnnouncementThread,Ha.PublicThread,Ha.PrivateThread];ga.VoiceBasedChannelTypes=[Ha.GuildVoice,Ha.GuildStageVoice];ga.SelectMenuTypes=[yk.StringSelect,yk.UserSelect,yk.RoleSelect,yk.MentionableSelect,yk.ChannelSelect];ga.UndeletableMessageTypes=[Pi.RecipientAdd,Pi.RecipientRemove,Pi.Call,Pi.ChannelNameChange,Pi.ChannelIconChange,Pi.ThreadStarterMessage];ga.DeletableMessageTypes=[Pi.AutoModerationAction,Pi.ChannelFollowAdd,Pi.ChannelPinnedMessage,Pi.ChatInputCommand,Pi.ContextMenuCommand,Pi.Default,Pi.GuildBoost,Pi.GuildBoostTier1,Pi.GuildBoostTier2,Pi.GuildBoostTier3,Pi.GuildInviteReminder,Pi.InteractionPremiumUpsell,Pi.Reply,Pi.RoleSubscriptionPurchase,Pi.StageEnd,Pi.StageRaiseHand,Pi.StageSpeaker,Pi.StageStart,Pi.StageTopic,Pi.ThreadCreated,Pi.UserJoin];ga.StickerFormatExtensionMap={[x2.PNG]:y2.PNG,[x2.APNG]:y2.PNG,[x2.Lottie]:y2.Lottie,[x2.GIF]:y2.GIF};ga.HolographicStyle={Primary:11127295,Secondary:16759788,Tertiary:16761760}});var ef=A(GWe=>{"use strict";var{channelLink:PWe,channelMention:_Ci}=WA(),{DiscordSnowflake:QCi}=pn(),{ChannelType:OWe,Routes:kCi}=ge(),SCi=Nt(),jWe=vk(),{ThreadChannelTypes:DCi}=$u(),ete=class extends SCi{constructor(t,i,n=!0){super(t),this.type=i.type,i&&n&&this._patch(i)}_patch(t){"flags"in t?this.flags=new jWe(t.flags).freeze():this.flags??=new jWe().freeze(),this.id=t.id}get createdTimestamp(){return QCi.timestampFrom(this.id)}get createdAt(){return new Date(this.createdTimestamp)}get url(){re
|
|||
|
|
`)>=0&&f++,g+b.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?m[0]+(h===""?"":h+`
|
|||
|
|
`)+" "+p.join(`,
|
|||
|
|
`)+" "+m[1]:m[0]+h+" "+p.join(", ")+" "+m[1]})(c,u,l)):l[0]+u+l[1]}F(Hk,"ae");function tq(e){return"["+Error.prototype.toString.call(e)+"]"}F(tq,"ce");function iq(e,t,i,n,r,s){var a,o,c;if((c=Object.getOwnPropertyDescriptor(t,r)||{value:t[r]}).get?o=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(o=e.stylize("[Setter]","special")),cne(n,r)||(a="["+r+"]"),o||(e.seen.indexOf(c.value)<0?(o=Wk(i)?Hk(e,c.value,null):Hk(e,c.value,i-1)).indexOf(`
|
|||
|
|
`)>-1&&(o=s?o.split(`
|
|||
|
|
`).map(function(u){return" "+u}).join(`
|
|||
|
|
`).substr(2):`
|
|||
|
|
`+o.split(`
|
|||
|
|
`).map(function(u){return" "+u}).join(`
|
|||
|
|
`)):o=e.stylize("[Circular]","special")),of(a)){if(s&&r.match(/^\d+$/))return o;(a=JSON.stringify(""+r)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+o}F(iq,"se");function ane(e){return Array.isArray(e)}F(ane,"pe");function cq(e){return typeof e=="boolean"}F(cq,"ye");function Wk(e){return e===null}F(Wk,"le");function one(e){return typeof e=="number"}F(one,"de");function Yk(e){return typeof e=="string"}F(Yk,"ge");function of(e){return e===void 0}F(of,"be");function rC(e){return Xb(e)&&lq(e)==="[object RegExp]"}F(rC,"me");function Xb(e){return typeof e=="object"&&e!==null}F(Xb,"he");function zk(e){return Xb(e)&&lq(e)==="[object Date]"}F(zk,"je");function sC(e){return Xb(e)&&(lq(e)==="[object Error]"||e instanceof Error)}F(sC,"Ae");function jk(e){return typeof e=="function"}F(jk,"we");function lq(e){return Object.prototype.toString.call(e)}F(lq,"ve");function nq(e){return e<10?"0"+e.toString(10):e.toString(10)}F(nq,"Oe");pe.debuglog=function(e){if(e=e.toUpperCase(),!Z2[e])if(yKe.test(e)){var t=rd.pid;Z2[e]=function(){var i=pe.format.apply(pe,arguments);console.error("%s %d: %s",e,t,i)}}else Z2[e]=function(){};return Z2[e]},pe.inspect=th,th.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},th.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},pe.types=oi,pe.isArray=ane,pe.isBoolean=cq,pe.isNull=Wk,pe.isNullOrUndefined=function(e){return e==null},pe.isNumber=one,pe.isString=Yk,pe.isSymbol=function(e){return typeof e=="symbol"},pe.isUndefined=of,pe.isRegExp=rC,pe.types.isRegExp=rC,pe.isObject=Xb,pe.isDate=zk,pe.types.isDate=zk,pe.isError=sC,pe.types.isNativeError=sC,pe.isFunction=jk,pe.isPrimitive=function(e){return e===null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||typeof e=="symbol"||e===void 0},pe.isBuffer=bKe;var zSi=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function IKe(){var e=new Date,t=[nq(e.getHours()),nq(e.getMinutes()),nq(e.getSeconds())].join(":");return[e.getDate(),zSi[e.getMonth()],t].join(" ")}F(IKe,"Be");function cne(e,t){return Object.prototype.hasOwnProperty.call(e,t)}F(cne,"ke");pe.log=function(){console.log("%s - %s",IKe(),pe.format.apply(pe,arguments))},pe.inherits=NSi,pe._extend=function(e,t){if(!t||!Xb(t))return e;for(var i=Object.keys(t),n=i.length;n--;)e[i[n]]=t[i[n]];return e};var Jb=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;function CKe(e,t){if(!e){var i=new Error("Promise was rejected with a falsy value");i.reason=e,e=i}return t(e)}F(CKe,"De");pe.promisify=function(e){if(typeof e!="function")throw new TypeError('The "original" argument must be of type Function');if(Jb&&e[Jb]){var t;if(typeof(t=e[Jb])!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,Jb,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var i,n,r=new Promise(function(o,c){i=o,n=c}),s=[],a=0;a<arguments.length;a++)s.push(arguments[a]);s.push(function(o,c){o?n(o):i(c)});try{e.apply(this||Ok,s)}catch(o){n(o)}return r}return F(t,"t"),Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Jb&&Object.defineProperty(t,Jb,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,uKe(e))},pe.promisify.custom=Jb,pe.callbackify=function(e){if(typeof e!="function")throw new TypeError('The "original" argument must be of type Function');function t(){for(var i=[],n=0;n<arguments.length;n++)i.push(arguments[n]);var r=i.pop();if(typeof r!="function")throw new TypeError("The last argument must be of type Function");var s=this||Ok,a=F(function(){return r.apply(s,arguments)},"o");e.apply(this||Ok,i).then(function(o){rd.nextTick(a.bind(null,null,o))},function(o){rd.nextTick(CKe.bind(null,o,a))})}return F(t,"t"),O
|
|||
|
|
${this.stack.slice(this.stack.indexOf(`
|
|||
|
|
`))}`}};F(BKe,"BaseError");var uf=BKe,_Ke=class extends uf{constructor(t,i,n){super(i),this.constraint=t,this.given=n}toJSON(){return{name:this.name,constraint:this.constraint,given:this.given,message:this.message}}};F(_Ke,"BaseConstraintError");var QKe=_Ke,kKe=class extends QKe{constructor(t,i,n,r){super(t,i,n),this.expected=r}toJSON(){return{name:this.name,constraint:this.constraint,given:this.given,expected:this.expected,message:this.message}}[Pc](t,i){let n=i.stylize(this.constraint,"string");if(t<0)return i.stylize(`[ExpectedConstraintError: ${n}]`,"special");let r={...i,depth:i.depth===null?null:i.depth-1},s=`
|
|||
|
|
${i.stylize("|","undefined")} `,a=oC(this.given,r).replace(/\n/g,s),o=`${i.stylize("ExpectedConstraintError","special")} > ${n}`,c=i.stylize(this.message,"regexp"),u=`
|
|||
|
|
${i.stylize("Expected: ","string")}${i.stylize(this.expected,"boolean")}`,d=`
|
|||
|
|
${i.stylize("Received:","regexp")}${s}${a}`;return`${o}
|
|||
|
|
${c}
|
|||
|
|
${u}
|
|||
|
|
${d}`}};F(kKe,"ExpectedConstraintError");var ui=kKe,SKe=class Pie{constructor(t,i,n){this.success=t,t?this.value=i:this.error=n}isOk(){return this.success}isErr(){return!this.success}unwrap(){if(this.isOk())return this.value;throw this.error}static ok(t){return new Pie(!0,t)}static err(t){return new Pie(!1,void 0,t)}};F(SKe,"Result");var ne=SKe;function DKe(e,t,i,n){return{run(r,s){if(!s)return ne.err(new ui("s.object(T.when)",n?.message??"Validator has no parent",s,"Validator to have a parent"));let a=Array.isArray(e),o=a?e.map(u=>cKe.default(s,u)):cKe.default(s,e),c=RKe(t,o,a)?t.then:t.otherwise;return c?c(i).run(r):ne.ok(r)}}}F(DKe,"whenConstraint");function RKe(e,t,i){return e.is===void 0?i?!t.some(n=>!n):!!t:typeof e.is=="function"?e.is(t):t===e.is}F(RKe,"resolveBooleanIs");var TKe=!0;function MKe(e){TKe=e}F(MKe,"setGlobalValidationEnabled");function lne(){return TKe}F(lne,"getGlobalValidationEnabled");function aq(e){return typeof e=="function"?e():e}F(aq,"getValue");var UKe=class{constructor(t={},i=[]){this.constraints=[],this.isValidationEnabled=null,this.constraints=i,this.validatorOptions=t}setParent(t){return this.parent=t,this}optional(t=this.validatorOptions){return new Kb([new Yo(void 0,t),this.clone()],t)}nullable(t=this.validatorOptions){return new Kb([new Yo(null,t),this.clone()],t)}nullish(t=this.validatorOptions){return new Kb([new qc(t),this.clone()],t)}array(t=this.validatorOptions){return new ZKe(this.clone(),t)}set(t=this.validatorOptions){return new YXe(this.clone(),t)}or(...t){return new Kb([this.clone(),...t],this.validatorOptions)}transform(t,i=this.validatorOptions){return this.addConstraint({run:n=>ne.ok(t(n))},i)}reshape(t,i=this.validatorOptions){return this.addConstraint({run:t},i)}default(t,i=this.validatorOptions){return new jie(this.clone(),t,i)}when(t,i,n){return this.addConstraint(DKe(t,i,this,n))}describe(t){let i=this.clone();return i.description=t,i}run(t){let i=this.handle(t);if(i.isErr())return i;for(let n of this.constraints)if(i=n.run(i.value,this.parent),i.isErr())break;return i}parse(t){return this.shouldRunConstraints?this.constraints.reduce((i,n)=>n.run(i).unwrap(),this.handle(t).unwrap()):this.handle(t).unwrap()}is(t){return this.run(t).isOk()}setValidationEnabled(t){let i=this.clone();return i.isValidationEnabled=t,i}getValidationEnabled(){return aq(this.isValidationEnabled)}get shouldRunConstraints(){return aq(this.isValidationEnabled)??lne()}clone(){let t=Reflect.construct(this.constructor,[this.validatorOptions,this.constraints]);return t.isValidationEnabled=this.isValidationEnabled,t}addConstraint(t,i=this.validatorOptions){let n=this.clone();return n.validatorOptions=i,n.constraints=n.constraints.concat(t),n}};F(UKe,"BaseValidator");var Tr=UKe;function NKe(e){return e.length<2?!0:BSi.default(e,wSi.default).length===e.length}F(NKe,"isUnique");function pf(e,t){return e<t}F(pf,"lessThan");function df(e,t){return e<=t}F(df,"lessThanOrEqual");function Af(e,t){return e>t}F(Af,"greaterThan");function hf(e,t){return e>=t}F(hf,"greaterThanOrEqual");function mf(e,t){return e===t}F(mf,"equal");function ff(e,t){return e!==t}F(ff,"notEqual");function ev(e,t,i,n,r){return{run(s){return e(s.length,n)?ne.ok(s):ne.err(new ui(t,r?.message??"Invalid Array length",s,i))}}}F(ev,"arrayLengthComparator");function LKe(e,t){let i=`expected.length < ${e}`;return ev(pf,"s.array(T).lengthLessThan()",i,e,t)}F(LKe,"arrayLengthLessThan");function FKe(e,t){let i=`expected.length <= ${e}`;return ev(df,"s.array(T).lengthLessThanOrEqual()",i,e,t)}F(FKe,"arrayLengthLessThanOrEqual");function qKe(e,t){let i=`expected.length > ${e}`;return ev(Af,"s.array(T).lengthGreaterThan()",i,e,t)}F(qKe,"arrayLengthGreaterThan");function PKe(e,t){let i=`expected.length >= ${e}`;return ev(hf,"s.array(T).lengthGreaterThanOrEqual()",i,e,t)}F(PKe,"arrayLengthGreaterThanOrEqual");function OKe(e,t){let i=`expected.length === ${e}`;return ev(mf,"s.array(T).lengthEqual()",i,e,t)}F(OKe,"arrayLengthEqual");function jKe(e,t){let i=`expected.length !== ${e}`;return ev(ff,"s.array(T).lengthNotEqual()",i,e,t)}F(jKe,"arrayLengthNot
|
|||
|
|
${i.stylize("|","undefined")} `,s=`${i.stylize("CombinedPropertyError","special")} (${i.stylize(this.errors.length.toString(),"number")})`,a=i.stylize(this.message,"regexp"),o=this.errors.map(([c,u])=>{let d=zKe.formatProperty(c,i),l=u[Pc](t-1,n).replace(/\n/g,r);return` input${d}${r}${l}`}).join(`
|
|||
|
|
|
|||
|
|
`);return`${s}
|
|||
|
|
${a}
|
|||
|
|
|
|||
|
|
${o}`}static formatProperty(t,i){return typeof t=="string"?i.stylize(`.${t}`,"symbol"):typeof t=="number"?`[${i.stylize(t.toString(),"number")}]`:`[${i.stylize("Symbol","symbol")}(${t.description})]`}};F(YKe,"CombinedPropertyError");var cf=YKe,WKe=class extends uf{constructor(t,i,n){super(i),this.validator=t,this.given=n}toJSON(){return{name:this.name,message:"Unknown validation error occurred.",validator:this.validator,given:this.given}}[Pc](t,i){let n=i.stylize(this.validator,"string");if(t<0)return i.stylize(`[ValidationError: ${n}]`,"special");let r={...i,depth:i.depth===null?null:i.depth-1,compact:!0},s=`
|
|||
|
|
${i.stylize("|","undefined")} `,a=oC(this.given,r).replace(/\n/g,s),o=`${i.stylize("ValidationError","special")} > ${n}`,c=i.stylize(this.message,"regexp"),u=`
|
|||
|
|
${i.stylize("Received:","regexp")}${s}${a}`;return`${o}
|
|||
|
|
${c}
|
|||
|
|
${u}`}};F(WKe,"ValidationError");var ar=WKe,JKe=class extends Tr{constructor(t,i={},n=[]){super(i,n),this.validator=t}lengthLessThan(t,i=this.validatorOptions){return this.addConstraint(LKe(t,i))}lengthLessThanOrEqual(t,i=this.validatorOptions){return this.addConstraint(FKe(t,i))}lengthGreaterThan(t,i=this.validatorOptions){return this.addConstraint(qKe(t,i))}lengthGreaterThanOrEqual(t,i=this.validatorOptions){return this.addConstraint(PKe(t,i))}lengthEqual(t,i=this.validatorOptions){return this.addConstraint(OKe(t,i))}lengthNotEqual(t,i=this.validatorOptions){return this.addConstraint(jKe(t,i))}lengthRange(t,i,n=this.validatorOptions){return this.addConstraint(GKe(t,i,n))}lengthRangeInclusive(t,i,n=this.validatorOptions){return this.addConstraint(VKe(t,i,n))}lengthRangeExclusive(t,i,n=this.validatorOptions){return this.addConstraint($Ke(t,i,n))}unique(t=this.validatorOptions){return this.addConstraint(HKe(t))}clone(){return Reflect.construct(this.constructor,[this.validator,this.validatorOptions,this.constraints])}handle(t){if(!Array.isArray(t))return ne.err(new ar("s.array(T)",this.validatorOptions.message??"Expected an array",t));if(!this.shouldRunConstraints)return ne.ok(t);let i=[],n=[];for(let r=0;r<t.length;r++){let s=this.validator.run(t[r]);s.isOk()?n.push(s.value):i.push([r,s.error])}return i.length===0?ne.ok(n):ne.err(new cf(i,this.validatorOptions))}};F(JKe,"ArrayValidator");var ZKe=JKe;function tv(e,t,i,n,r){return{run(s){return e(s,n)?ne.ok(s):ne.err(new ui(t,r?.message??"Invalid bigint value",s,i))}}}F(tv,"bigintComparator");function KKe(e,t){let i=`expected < ${e}n`;return tv(pf,"s.bigint().lessThan()",i,e,t)}F(KKe,"bigintLessThan");function XKe(e,t){let i=`expected <= ${e}n`;return tv(df,"s.bigint().lessThanOrEqual()",i,e,t)}F(XKe,"bigintLessThanOrEqual");function eXe(e,t){let i=`expected > ${e}n`;return tv(Af,"s.bigint().greaterThan()",i,e,t)}F(eXe,"bigintGreaterThan");function tXe(e,t){let i=`expected >= ${e}n`;return tv(hf,"s.bigint().greaterThanOrEqual()",i,e,t)}F(tXe,"bigintGreaterThanOrEqual");function iXe(e,t){let i=`expected === ${e}n`;return tv(mf,"s.bigint().equal()",i,e,t)}F(iXe,"bigintEqual");function nXe(e,t){let i=`expected !== ${e}n`;return tv(ff,"s.bigint().notEqual()",i,e,t)}F(nXe,"bigintNotEqual");function rXe(e,t){let i=`expected % ${e}n === 0n`;return{run(n){return n%e===0n?ne.ok(n):ne.err(new ui("s.bigint().divisibleBy()",t?.message??"BigInt is not divisible",n,i))}}}F(rXe,"bigintDivisibleBy");var sXe=class extends Tr{lessThan(t,i=this.validatorOptions){return this.addConstraint(KKe(t,i))}lessThanOrEqual(t,i=this.validatorOptions){return this.addConstraint(XKe(t,i))}greaterThan(t,i=this.validatorOptions){return this.addConstraint(eXe(t,i))}greaterThanOrEqual(t,i=this.validatorOptions){return this.addConstraint(tXe(t,i))}equal(t,i=this.validatorOptions){return this.addConstraint(iXe(t,i))}notEqual(t,i=this.validatorOptions){return this.addConstraint(nXe(t,i))}positive(t=this.validatorOptions){return this.greaterThanOrEqual(0n,t)}negative(t=this.validatorOptions){return this.lessThan(0n,t)}divisibleBy(t,i=this.validatorOptions){return this.addConstraint(rXe(t,i))}abs(t=this.validatorOptions){return this.transform(i=>i<0?-i:i,t)}intN(t,i=this.validatorOptions){return this.transform(n=>BigInt.asIntN(t,n),i)}uintN(t,i=this.validatorOptions){return this.transform(n=>BigInt.asUintN(t,n),i)}handle(t){return typeof t=="bigint"?ne.ok(t):ne.err(new ar("s.bigint()",this.validatorOptions.message??"Expected a bigint primitive",t))}};F(sXe,"BigIntValidator");var WSi=sXe;function aXe(e){return{run(t){return t?ne.ok(t):ne.err(new ui("s.boolean().true()",e?.message??"Invalid boolean value",t,"true"))}}}F(aXe,"booleanTrue");function oXe(e){return{run(t){return t?ne.err(new ui("s.boolean().false()",e?.message??"Invalid boolean value",t,"false")):ne.ok(t)}}}F(oXe,"booleanFalse");var cXe=class extends Tr{true(t=this.validatorOptions){return this.addConstraint(aXe(t))}false(t=this.validatorOptions){return this.addConstraint(oXe(t))}equal(t,i=this.validatorOptions){return t?this.true(i):this.false(i)}notEq
|
|||
|
|
${i.stylize("|","undefined")} `,a=oC(this.expected,r).replace(/\n/g,s),o=oC(this.given,r).replace(/\n/g,s),c=`${i.stylize("ExpectedValidationError","special")} > ${n}`,u=i.stylize(this.message,"regexp"),d=`
|
|||
|
|
${i.stylize("Expected:","string")}${s}${a}`,l=`
|
|||
|
|
${i.stylize("Received:","regexp")}${s}${o}`;return`${c}
|
|||
|
|
${u}
|
|||
|
|
${d}
|
|||
|
|
${l}`}};F(bXe,"ExpectedValidationError");var une=bXe,vXe=class extends Tr{constructor(t,i={},n=[]){super(i,n),this.expected=t}handle(t){return t instanceof this.expected?ne.ok(t):ne.err(new une("s.instance(V)",this.validatorOptions.message??"Expected",t,this.expected))}clone(){return Reflect.construct(this.constructor,[this.expected,this.validatorOptions,this.constraints])}};F(vXe,"InstanceValidator");var KSi=vXe,yXe=class extends Tr{constructor(t,i={},n=[]){super(i,n),this.expected=t}handle(t){return Object.is(t,this.expected)?ne.ok(t):ne.err(new une("s.literal(V)",this.validatorOptions.message??"Expected values to be equals",t,this.expected))}clone(){return Reflect.construct(this.constructor,[this.expected,this.validatorOptions,this.constraints])}};F(yXe,"LiteralValidator");var Yo=yXe,xXe=class extends Tr{handle(t){return ne.err(new ar("s.never()",this.validatorOptions.message??"Expected a value to not be passed",t))}};F(xXe,"NeverValidator");var XSi=xXe,EXe=class extends Tr{handle(t){return t==null?ne.ok(t):ne.err(new ar("s.nullish()",this.validatorOptions.message??"Expected undefined or null",t))}};F(EXe,"NullishValidator");var qc=EXe;function nv(e,t,i,n,r){return{run(s){return e(s,n)?ne.ok(s):ne.err(new ui(t,r?.message??"Invalid number value",s,i))}}}F(nv,"numberComparator");function IXe(e,t){let i=`expected < ${e}`;return nv(pf,"s.number().lessThan()",i,e,t)}F(IXe,"numberLessThan");function CXe(e,t){let i=`expected <= ${e}`;return nv(df,"s.number().lessThanOrEqual()",i,e,t)}F(CXe,"numberLessThanOrEqual");function wXe(e,t){let i=`expected > ${e}`;return nv(Af,"s.number().greaterThan()",i,e,t)}F(wXe,"numberGreaterThan");function BXe(e,t){let i=`expected >= ${e}`;return nv(hf,"s.number().greaterThanOrEqual()",i,e,t)}F(BXe,"numberGreaterThanOrEqual");function _Xe(e,t){let i=`expected === ${e}`;return nv(mf,"s.number().equal()",i,e,t)}F(_Xe,"numberEqual");function QXe(e,t){let i=`expected !== ${e}`;return nv(ff,"s.number().notEqual()",i,e,t)}F(QXe,"numberNotEqual");function kXe(e){return{run(t){return Number.isInteger(t)?ne.ok(t):ne.err(new ui("s.number().int()",e?.message??"Given value is not an integer",t,"Number.isInteger(expected) to be true"))}}}F(kXe,"numberInt");function SXe(e){return{run(t){return Number.isSafeInteger(t)?ne.ok(t):ne.err(new ui("s.number().safeInt()",e?.message??"Given value is not a safe integer",t,"Number.isSafeInteger(expected) to be true"))}}}F(SXe,"numberSafeInt");function DXe(e){return{run(t){return Number.isFinite(t)?ne.ok(t):ne.err(new ui("s.number().finite()",e?.message??"Given value is not finite",t,"Number.isFinite(expected) to be true"))}}}F(DXe,"numberFinite");function RXe(e){return{run(t){return Number.isNaN(t)?ne.ok(t):ne.err(new ui("s.number().equal(NaN)",e?.message??"Invalid number value",t,"expected === NaN"))}}}F(RXe,"numberNaN");function TXe(e){return{run(t){return Number.isNaN(t)?ne.err(new ui("s.number().notEqual(NaN)",e?.message??"Invalid number value",t,"expected !== NaN")):ne.ok(t)}}}F(TXe,"numberNotNaN");function MXe(e,t){let i=`expected % ${e} === 0`;return{run(n){return n%e===0?ne.ok(n):ne.err(new ui("s.number().divisibleBy()",t?.message??"Number is not divisible",n,i))}}}F(MXe,"numberDivisibleBy");var UXe=class extends Tr{lessThan(t,i=this.validatorOptions){return this.addConstraint(IXe(t,i))}lessThanOrEqual(t,i=this.validatorOptions){return this.addConstraint(CXe(t,i))}greaterThan(t,i=this.validatorOptions){return this.addConstraint(wXe(t,i))}greaterThanOrEqual(t,i=this.validatorOptions){return this.addConstraint(BXe(t,i))}equal(t,i=this.validatorOptions){return Number.isNaN(t)?this.addConstraint(RXe(i)):this.addConstraint(_Xe(t,i))}notEqual(t,i=this.validatorOptions){return Number.isNaN(t)?this.addConstraint(TXe(i)):this.addConstraint(QXe(t,i))}int(t=this.validatorOptions){return this.addConstraint(kXe(t))}safeInt(t=this.validatorOptions){return this.addConstraint(SXe(t))}finite(t=this.validatorOptions){return this.addConstraint(DXe(t))}positive(t=this.validatorOptions){return this.greaterThanOrEqual(0,t)}negative(t=this.validatorOptions){return this.lessThan(0,t)}
|
|||
|
|
${s}`}};F(NXe,"MissingPropertyError");var Oie=NXe,LXe=class extends uf{constructor(t,i,n){super(n?.message??"Received unexpected property"),this.property=t,this.value=i}toJSON(){return{name:this.name,message:this.message,property:this.property,value:this.value}}[Pc](t,i){let n=i.stylize(this.property.toString(),"string");if(t<0)return i.stylize(`[UnknownPropertyError: ${n}]`,"special");let r={...i,depth:i.depth===null?null:i.depth-1,compact:!0},s=`
|
|||
|
|
${i.stylize("|","undefined")} `,a=oC(this.value,r).replace(/\n/g,s),o=`${i.stylize("UnknownPropertyError","special")} > ${n}`,c=i.stylize(this.message,"regexp"),u=`
|
|||
|
|
${i.stylize("Received:","regexp")}${s}${a}`;return`${o}
|
|||
|
|
${c}
|
|||
|
|
${u}`}};F(LXe,"UnknownPropertyError");var FXe=LXe,qXe=class extends Tr{constructor(t,i,n={},r=[]){super(n,r),this.validator=t,this.defaultValue=i}default(t,i=this.validatorOptions){let n=this.clone();return n.validatorOptions=i,n.defaultValue=t,n}handle(t){return typeof t>"u"?ne.ok(aq(this.defaultValue)):this.validator.handle(t)}clone(){return Reflect.construct(this.constructor,[this.validator,this.defaultValue,this.validatorOptions,this.constraints])}};F(qXe,"DefaultValidator");var jie=qXe,PXe=class extends uf{constructor(t,i){super(i?.message??"Received one or more errors"),this.errors=t}[Pc](t,i){if(t<0)return i.stylize("[CombinedError]","special");let n={...i,depth:i.depth===null?null:i.depth-1,compact:!0},r=`
|
|||
|
|
${i.stylize("|","undefined")} `,s=`${i.stylize("CombinedError","special")} (${i.stylize(this.errors.length.toString(),"number")})`,a=i.stylize(this.message,"regexp"),o=this.errors.map((c,u)=>{let d=i.stylize((u+1).toString(),"number"),l=c[Pc](t-1,n).replace(/\n/g,r);return` ${d} ${l}`}).join(`
|
|||
|
|
|
|||
|
|
`);return`${s}
|
|||
|
|
${a}
|
|||
|
|
|
|||
|
|
${o}`}};F(PXe,"CombinedError");var pne=PXe,OXe=class Fc extends Tr{constructor(t,i,n=[]){super(i,n),this.validators=t}optional(t=this.validatorOptions){if(this.validators.length===0)return new Fc([new Yo(void 0,t)],this.validatorOptions,this.constraints);let[i]=this.validators;if(i instanceof Yo){if(i.expected===void 0)return this.clone();if(i.expected===null)return new Fc([new qc(t),...this.validators.slice(1)],this.validatorOptions,this.constraints)}else if(i instanceof qc)return this.clone();return new Fc([new Yo(void 0,t),...this.validators],this.validatorOptions)}required(t=this.validatorOptions){if(this.validators.length===0)return this.clone();let[i]=this.validators;if(i instanceof Yo){if(i.expected===void 0)return new Fc(this.validators.slice(1),this.validatorOptions,this.constraints)}else if(i instanceof qc)return new Fc([new Yo(null,t),...this.validators.slice(1)],this.validatorOptions,this.constraints);return this.clone()}nullable(t=this.validatorOptions){if(this.validators.length===0)return new Fc([new Yo(null,t)],this.validatorOptions,this.constraints);let[i]=this.validators;if(i instanceof Yo){if(i.expected===null)return this.clone();if(i.expected===void 0)return new Fc([new qc(t),...this.validators.slice(1)],this.validatorOptions,this.constraints)}else if(i instanceof qc)return this.clone();return new Fc([new Yo(null,t),...this.validators],this.validatorOptions)}nullish(t=this.validatorOptions){if(this.validators.length===0)return new Fc([new qc(t)],t,this.constraints);let[i]=this.validators;if(i instanceof Yo){if(i.expected===null||i.expected===void 0)return new Fc([new qc(t),...this.validators.slice(1)],t,this.constraints)}else if(i instanceof qc)return this.clone();return new Fc([new qc(t),...this.validators],t)}or(...t){return new Fc([...this.validators,...t],this.validatorOptions)}clone(){return Reflect.construct(this.constructor,[this.validators,this.validatorOptions,this.constraints])}handle(t){let i=[];for(let n of this.validators){let r=n.run(t);if(r.isOk())return r;i.push(r.error)}return ne.err(new pne(i,this.validatorOptions))}};F(OXe,"UnionValidator");var Kb=OXe,jXe=class GXe extends Tr{constructor(t,i=0,n={},r=[]){switch(super(n,r),this.keys=[],this.requiredKeys=new Map,this.possiblyUndefinedKeys=new Map,this.possiblyUndefinedKeysWithDefaults=new Map,this.shape=t,this.strategy=i,this.strategy){case 0:this.handleStrategy=a=>this.handleIgnoreStrategy(a);break;case 1:{this.handleStrategy=a=>this.handleStrictStrategy(a);break}case 2:this.handleStrategy=a=>this.handlePassthroughStrategy(a);break}let s=Object.entries(t);this.keys=s.map(([a])=>a);for(let[a,o]of s)if(o instanceof Kb){let[c]=o.validators;c instanceof qc?this.possiblyUndefinedKeys.set(a,o):c instanceof Yo?c.expected===void 0?this.possiblyUndefinedKeys.set(a,o):this.requiredKeys.set(a,o):o instanceof jie?this.possiblyUndefinedKeysWithDefaults.set(a,o):this.requiredKeys.set(a,o)}else o instanceof qc?this.possiblyUndefinedKeys.set(a,o):o instanceof Yo?o.expected===void 0?this.possiblyUndefinedKeys.set(a,o):this.requiredKeys.set(a,o):o instanceof jie?this.possiblyUndefinedKeysWithDefaults.set(a,o):this.requiredKeys.set(a,o)}strict(t=this.validatorOptions){return Reflect.construct(this.constructor,[this.shape,1,t,this.constraints])}ignore(t=this.validatorOptions){return Reflect.construct(this.constructor,[this.shape,0,t,this.constraints])}passthrough(t=this.validatorOptions){return Reflect.construct(this.constructor,[this.shape,2,t,this.constraints])}partial(t=this.validatorOptions){let i=Object.fromEntries(this.keys.map(n=>[n,this.shape[n].optional(t)]));return Reflect.construct(this.constructor,[i,this.strategy,t,this.constraints])}required(t=this.validatorOptions){let i=Object.fromEntries(this.keys.map(n=>{let r=this.shape[n];return r instanceof Kb&&(r=r.required(t)),[n,r]}));return Reflect.construct(this.constructor,[i,this.strategy,t,this.constraints])}extend(t,i=this.validatorOptions){let n={...this.shape,...t instanceof GXe?t.shape:t};return Reflect.construct(this.constructor,[n,this.strategy,i,this.constraints])}pick(t,i=this.valida
|
|||
|
|
${s} `,o=oC(this.given,r).replace(/\n/g,a),c=`${i.stylize("MultiplePossibilitiesConstraintError","special")} > ${n}`,u=i.stylize(this.message,"regexp"),d=`
|
|||
|
|
${s} - `,l=`
|
|||
|
|
${i.stylize("Expected any of the following:","string")}${d}${this.expected.map(h=>i.stylize(h,"boolean")).join(d)}`,p=`
|
|||
|
|
${i.stylize("Received:","regexp")}${a}${o}`;return`${c}
|
|||
|
|
${u}
|
|||
|
|
${l}
|
|||
|
|
${p}`}};F(KXe,"MultiplePossibilitiesConstraintError");var hne=KXe;function XXe(...e){switch(e.length){case 0:return()=>null;case 1:return e[0];case 2:{let[t,i]=e;return(...n)=>t(...n)||i(...n)}default:return(...t)=>{for(let i of e){let n=i(...t);if(n)return n}return null}}}F(XXe,"combinedErrorFn");function eet(e,t){let i=[];return e?.allowedProtocols?.length&&i.push(tet(e.allowedProtocols,t)),e?.allowedDomains?.length&&i.push(iet(e.allowedDomains,t)),XXe(...i)}F(eet,"createUrlValidators");function tet(e,t){return(i,n)=>e.includes(n.protocol)?null:new hne("s.string().url()",t?.message??"Invalid URL protocol",i,e)}F(tet,"allowedProtocolsFn");function iet(e,t){return(i,n)=>e.includes(n.hostname)?null:new hne("s.string().url()",t?.message??"Invalid URL domain",i,e)}F(iet,"allowedDomainsFn");function rv(e,t,i,n,r){return{run(s){return e(s.length,n)?ne.ok(s):ne.err(new ui(t,r?.message??"Invalid string length",s,i))}}}F(rv,"stringLengthComparator");function net(e,t){let i=`expected.length < ${e}`;return rv(pf,"s.string().lengthLessThan()",i,e,t)}F(net,"stringLengthLessThan");function ret(e,t){let i=`expected.length <= ${e}`;return rv(df,"s.string().lengthLessThanOrEqual()",i,e,t)}F(ret,"stringLengthLessThanOrEqual");function set(e,t){let i=`expected.length > ${e}`;return rv(Af,"s.string().lengthGreaterThan()",i,e,t)}F(set,"stringLengthGreaterThan");function aet(e,t){let i=`expected.length >= ${e}`;return rv(hf,"s.string().lengthGreaterThanOrEqual()",i,e,t)}F(aet,"stringLengthGreaterThanOrEqual");function oet(e,t){let i=`expected.length === ${e}`;return rv(mf,"s.string().lengthEqual()",i,e,t)}F(oet,"stringLengthEqual");function cet(e,t){let i=`expected.length !== ${e}`;return rv(ff,"s.string().lengthNotEqual()",i,e,t)}F(cet,"stringLengthNotEqual");function uet(e){return{run(t){return zXe(t)?ne.ok(t):ne.err(new ui("s.string().email()",e?.message??"Invalid email address",t,"expected to be an email address"))}}}F(uet,"stringEmail");function mne(e,t,i,n){return{run(r){return i.test(r)?ne.ok(r):ne.err(new ui(e,n?.message??"Invalid string format",r,t))}}}F(mne,"stringRegexValidator");function Gie(e,t){let i=eet(e,t);return{run(n){let r;try{r=new URL(n)}catch{return ne.err(new ui("s.string().url()",t?.message??"Invalid URL",n,"expected to match a URL"))}let s=i(n,r);return s===null?ne.ok(n):ne.err(s)}}}F(Gie,"stringUrl");function pet(e,t){let i=e?`v${e}`:"",n=e===4?dne:e===6?Ane:JXe,r=`s.string().ip${i}()`,s=`Invalid IP${i} address`,a=`expected to be an IP${i} address`;return{run(o){return n(o)?ne.ok(o):ne.err(new ui(r,t?.message??s,o,a))}}}F(pet,"stringIp");function det(e,t){return mne("s.string().regex()",`expected ${e}.test(expected) to be true`,e,t)}F(det,"stringRegex");function Vie({version:e=4,nullable:t=!1}={},i){e??(e="1-5");let n=new RegExp(`^(?:[0-9A-F]{8}-[0-9A-F]{4}-[${e}][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}${t?"|00000000-0000-0000-0000-000000000000":""})$`,"i"),r=`expected to match UUID${typeof e=="number"?`v${e}`:` in range of ${e}`}`;return mne("s.string().uuid()",r,n,i)}F(Vie,"stringUuid");function Aet(e){return{run(t){let i=Date.parse(t);return Number.isNaN(i)?ne.err(new ui("s.string().date()",e?.message??"Invalid date string",t,"expected to be a valid date string (in the ISO 8601 or ECMA-262 format)")):ne.ok(t)}}}F(Aet,"stringDate");function het(e){return{run(t){return ZXe(t)?ne.ok(t):ne.err(new ui("s.string().phone()",e?.message??"Invalid phone number",t,"expected to be a phone number"))}}}F(het,"stringPhone");var met=class extends Tr{lengthLessThan(t,i=this.validatorOptions){return this.addConstraint(net(t,i))}lengthLessThanOrEqual(t,i=this.validatorOptions){return this.addConstraint(ret(t,i))}lengthGreaterThan(t,i=this.validatorOptions){return this.addConstraint(set(t,i))}lengthGreaterThanOrEqual(t,i=this.validatorOptions){return this.addConstraint(aet(t,i))}lengthEqual(t,i=this.validatorOptions){return this.addConstraint(oet(t,i))}lengthNotEqual(t,i=this.validatorOptions){return this.addConstraint(cet(t,i))}email(t=this.validatorOptions){return this.addConstraint(uet(t))}url(t,i=this.validatorOptions){retur
|
|||
|
|
${i.stylize("|","undefined")} `,s=this.enumKeys.map(u=>{let d=this.enumMappings.get(u);return`${i.stylize(u,"string")} or ${i.stylize(d.toString(),typeof d=="number"?"number":"string")}`}).join(r),a=`${i.stylize("UnknownEnumValueError","special")} > ${n}`,o=i.stylize(this.message,"regexp"),c=`${r}${s}`;return`${a}
|
|||
|
|
${o}
|
|||
|
|
${c}`}};F(vet,"UnknownEnumValueError");var yet=vet,xet=class extends Tr{constructor(t,i={}){super(i),this.hasNumericElements=!1,this.enumMapping=new Map,this.enumShape=t,this.enumKeys=Object.keys(t).filter(n=>typeof t[t[n]]!="number");for(let n of this.enumKeys){let r=t[n];this.enumMapping.set(n,r),this.enumMapping.set(r,r),typeof r=="number"&&(this.hasNumericElements=!0,this.enumMapping.set(`${r}`,r))}}handle(t){let i=typeof t;if(i==="number"){if(!this.hasNumericElements)return ne.err(new ar("s.nativeEnum(T)",this.validatorOptions.message??"Expected the value to be a string",t))}else if(i!=="string")return ne.err(new ar("s.nativeEnum(T)",this.validatorOptions.message??"Expected the value to be a string or number",t));let n=t,r=this.enumMapping.get(n);return typeof r>"u"?ne.err(new yet(n,this.enumKeys,this.enumMapping,this.validatorOptions)):ne.ok(r)}clone(){return Reflect.construct(this.constructor,[this.enumShape,this.validatorOptions])}};F(xet,"NativeEnumValidator");var pDi=xet;function sv(e,t,i,n,r){return{run(s){return e(s.byteLength,n)?ne.ok(s):ne.err(new ui(t,r?.message??"Invalid Typed Array byte length",s,i))}}}F(sv,"typedArrayByteLengthComparator");function Eet(e,t){let i=`expected.byteLength < ${e}`;return sv(pf,"s.typedArray(T).byteLengthLessThan()",i,e,t)}F(Eet,"typedArrayByteLengthLessThan");function Iet(e,t){let i=`expected.byteLength <= ${e}`;return sv(df,"s.typedArray(T).byteLengthLessThanOrEqual()",i,e,t)}F(Iet,"typedArrayByteLengthLessThanOrEqual");function Cet(e,t){let i=`expected.byteLength > ${e}`;return sv(Af,"s.typedArray(T).byteLengthGreaterThan()",i,e,t)}F(Cet,"typedArrayByteLengthGreaterThan");function wet(e,t){let i=`expected.byteLength >= ${e}`;return sv(hf,"s.typedArray(T).byteLengthGreaterThanOrEqual()",i,e,t)}F(wet,"typedArrayByteLengthGreaterThanOrEqual");function Bet(e,t){let i=`expected.byteLength === ${e}`;return sv(mf,"s.typedArray(T).byteLengthEqual()",i,e,t)}F(Bet,"typedArrayByteLengthEqual");function _et(e,t){let i=`expected.byteLength !== ${e}`;return sv(ff,"s.typedArray(T).byteLengthNotEqual()",i,e,t)}F(_et,"typedArrayByteLengthNotEqual");function Qet(e,t,i){let n=`expected.byteLength >= ${e} && expected.byteLength < ${t}`;return{run(r){return r.byteLength>=e&&r.byteLength<t?ne.ok(r):ne.err(new ui("s.typedArray(T).byteLengthRange()",i?.message??"Invalid Typed Array byte length",r,n))}}}F(Qet,"typedArrayByteLengthRange");function ket(e,t,i){let n=`expected.byteLength >= ${e} && expected.byteLength <= ${t}`;return{run(r){return r.byteLength>=e&&r.byteLength<=t?ne.ok(r):ne.err(new ui("s.typedArray(T).byteLengthRangeInclusive()",i?.message??"Invalid Typed Array byte length",r,n))}}}F(ket,"typedArrayByteLengthRangeInclusive");function Det(e,t,i){let n=`expected.byteLength > ${e} && expected.byteLength < ${t}`;return{run(r){return r.byteLength>e&&r.byteLength<t?ne.ok(r):ne.err(new ui("s.typedArray(T).byteLengthRangeExclusive()",i?.message??"Invalid Typed Array byte length",r,n))}}}F(Det,"typedArrayByteLengthRangeExclusive");function av(e,t,i,n,r){return{run(s){return e(s.length,n)?ne.ok(s):ne.err(new ui(t,r?.message??"Invalid Typed Array length",s,i))}}}F(av,"typedArrayLengthComparator");function Ret(e,t){let i=`expected.length < ${e}`;return av(pf,"s.typedArray(T).lengthLessThan()",i,e,t)}F(Ret,"typedArrayLengthLessThan");function Tet(e,t){let i=`expected.length <= ${e}`;return av(df,"s.typedArray(T).lengthLessThanOrEqual()",i,e,t)}F(Tet,"typedArrayLengthLessThanOrEqual");function Met(e,t){let i=`expected.length > ${e}`;return av(Af,"s.typedArray(T).lengthGreaterThan()",i,e,t)}F(Met,"typedArrayLengthGreaterThan");function Uet(e,t){let i=`expected.length >= ${e}`;return av(hf,"s.typedArray(T).lengthGreaterThanOrEqual()",i,e,t)}F(Uet,"typedArrayLengthGreaterThanOrEqual");function Net(e,t){let i=`expected.length === ${e}`;return av(mf,"s.typedArray(T).lengthEqual()",i,e,t)}F(Net,"typedArrayLengthEqual");function Let(e,t){let i=`expected.length !== ${e}`;return av(ff,"s.typedArray(T).lengthNotEqual()",i,e,t)}F(Let,"typedArrayLengthNotEqual");function Fet(e,t,i){let n=`expected.length >= $
|
|||
|
|
${e}
|
|||
|
|
\`\`\``:`\`\`\`${e}
|
|||
|
|
${t}
|
|||
|
|
\`\`\``}Kt(Vet,"codeBlock");function $et(e){return`\`${e}\``}Kt($et,"inlineCode");function Het(e){return`_${e}_`}Kt(Het,"italic");function Yet(e){return`**${e}**`}Kt(Yet,"bold");function zet(e){return Qne(e)}Kt(zet,"underscore");function Qne(e){return`__${e}__`}Kt(Qne,"underline");function Wet(e){return`~~${e}~~`}Kt(Wet,"strikethrough");function Jet(e){return`> ${e}`}Kt(Jet,"quote");function Zet(e){return`>>> ${e}`}Kt(Zet,"blockQuote");function Ket(e){return`<${e}>`}Kt(Ket,"hideLinkEmbed");function Xet(e,t,i){return i?`[${e}](${t} "${i}")`:`[${e}](${t})`}Kt(Xet,"hyperlink");function ett(e){return`||${e}||`}Kt(ett,"spoiler");function ttt(e){return`<@${e}>`}Kt(ttt,"userMention");function itt(e){return`<#${e}>`}Kt(itt,"channelMention");function ntt(e){return`<@&${e}>`}Kt(ntt,"roleMention");function rtt(e,t,i,n){return n!==void 0?`</${e} ${t} ${i}:${n}>`:i!==void 0?`</${e} ${t}:${i}>`:`</${e}:${t}>`}Kt(rtt,"chatInputApplicationCommandMention");function stt(e,t){let i=typeof e=="string"?{id:e,animated:t??!1}:e,{id:n,animated:r,name:s}=i;return`<${r?"a":""}:${s??"_"}:${n}>`}Kt(stt,"formatEmoji");function pq(e,t){return`https://discord.com/channels/${t??"@me"}/${e}`}Kt(pq,"channelLink");function att(e,t,i){return`${i===void 0?pq(e):pq(e,i)}/${t}`}Kt(att,"messageLink");var ott=(e=>(e[e.One=1]="One",e[e.Two=2]="Two",e[e.Three=3]="Three",e))(ott||{});function ctt(e,t){switch(t){case 3:return`### ${e}`;case 2:return`## ${e}`;default:return`# ${e}`}}Kt(ctt,"heading");function Aq(e,t,i=0){return Array.isArray(e)?e.map(n=>Aq(n,t,i+1)).join(`
|
|||
|
|
`):`${" ".repeat(i-1)}${t?`${t}.`:"-"} ${e}`}Kt(Aq,"listCallback");function ltt(e,t=1){return Aq(e,Math.max(t,1))}Kt(ltt,"orderedList");function utt(e){return Aq(e)}Kt(utt,"unorderedList");function ptt(e){return`-# ${e}`}Kt(ptt,"subtext");function dtt(e,t){return typeof e!="number"&&(e=Math.floor((e?.getTime()??Date.now())/1e3)),typeof t=="string"?`<t:${e}:${t}>`:`<t:${e}>`}Kt(dtt,"time");function Att(e,t){let i=`https://discord.com/application-directory/${e}/store`;return t?`${i}/${t}`:i}Kt(Att,"applicationDirectory");var CDi={ShortTime:"t",LongTime:"T",ShortDate:"d",LongDate:"D",ShortDateTime:"f",LongDateTime:"F",RelativeTime:"R"},htt=(e=>(e.Shrug="\xAF\\_(\u30C4)_/\xAF",e.Tableflip="(\u256F\xB0\u25A1\xB0)\u256F\uFE35 \u253B\u2501\u253B",e.Unflip="\u252C\u2500\u252C\u30CE( \xBA _ \xBA\u30CE)",e))(htt||{}),mtt=(e=>(e.Browse="<id:browse>",e.Customize="<id:customize>",e.Guide="<id:guide>",e))(mtt||{}),wDi="0.6.1"});var Itt=A(Wo=>{"use strict";Object.defineProperty(Wo,"__esModule",{value:!0});Wo.VoiceChannelEffectSendAnimationType=Wo.GatewayDispatchEvents=Wo.GatewayIntentBits=Wo.GatewayCloseCodes=Wo.GatewayOpcodes=Wo.GatewayVersion=void 0;Wo.GatewayVersion="10";var btt;(function(e){e[e.Dispatch=0]="Dispatch",e[e.Heartbeat=1]="Heartbeat",e[e.Identify=2]="Identify",e[e.PresenceUpdate=3]="PresenceUpdate",e[e.VoiceStateUpdate=4]="VoiceStateUpdate",e[e.Resume=6]="Resume",e[e.Reconnect=7]="Reconnect",e[e.RequestGuildMembers=8]="RequestGuildMembers",e[e.InvalidSession=9]="InvalidSession",e[e.Hello=10]="Hello",e[e.HeartbeatAck=11]="HeartbeatAck",e[e.RequestSoundboardSounds=31]="RequestSoundboardSounds"})(btt||(Wo.GatewayOpcodes=btt={}));var vtt;(function(e){e[e.UnknownError=4e3]="UnknownError",e[e.UnknownOpcode=4001]="UnknownOpcode",e[e.DecodeError=4002]="DecodeError",e[e.NotAuthenticated=4003]="NotAuthenticated",e[e.AuthenticationFailed=4004]="AuthenticationFailed",e[e.AlreadyAuthenticated=4005]="AlreadyAuthenticated",e[e.InvalidSeq=4007]="InvalidSeq",e[e.RateLimited=4008]="RateLimited",e[e.SessionTimedOut=4009]="SessionTimedOut",e[e.InvalidShard=4010]="InvalidShard",e[e.ShardingRequired=4011]="ShardingRequired",e[e.InvalidAPIVersion=4012]="InvalidAPIVersion",e[e.InvalidIntents=4013]="InvalidIntents",e[e.DisallowedIntents=4014]="DisallowedIntents"})(vtt||(Wo.GatewayCloseCodes=vtt={}));var ytt;(function(e){e[e.Guilds=1]="Guilds",e[e.GuildMembers=2]="GuildMembers",e[e.GuildModeration=4]="GuildModeration",e[e.GuildBans=4]="GuildBans",e[e.GuildExpressions=8]="GuildExpressions",e[e.GuildEmojisAndStickers=8]="GuildEmojisAndStickers",e[e.GuildIntegrations=16]="GuildIntegrations",e[e.GuildWebhooks=32]="GuildWebhooks",e[e.GuildInvites=64]="GuildInvites",e[e.GuildVoiceStates=128]="GuildVoiceStates",e[e.GuildPresences=256]="GuildPresences",e[e.GuildMessages=512]="GuildMessages",e[e.GuildMessageReactions=1024]="GuildMessageReactions",e[e.GuildMessageTyping=2048]="GuildMessageTyping",e[e.DirectMessages=4096]="DirectMessages",e[e.DirectMessageReactions=8192]="DirectMessageReactions",e[e.DirectMessageTyping=16384]="DirectMessageTyping",e[e.MessageContent=32768]="MessageContent",e[e.GuildScheduledEvents=65536]="GuildScheduledEvents",e[e.AutoModerationConfiguration=1048576]="AutoModerationConfiguration",e[e.AutoModerationExecution=2097152]="AutoModerationExecution",e[e.GuildMessagePolls=16777216]="GuildMessagePolls",e[e.DirectMessagePolls=33554432]="DirectMessagePolls"})(ytt||(Wo.GatewayIntentBits=ytt={}));var xtt;(function(e){e.ApplicationCommandPermissionsUpdate="APPLICATION_COMMAND_PERMISSIONS_UPDATE",e.AutoModerationActionExecution="AUTO_MODERATION_ACTION_EXECUTION",e.AutoModerationRuleCreate="AUTO_MODERATION_RULE_CREATE",e.AutoModerationRuleDelete="AUTO_MODERATION_RULE_DELETE",e.AutoModerationRuleUpdate="AUTO_MODERATION_RULE_UPDATE",e.ChannelCreate="CHANNEL_CREATE",e.ChannelDelete="CHANNEL_DELETE",e.ChannelPinsUpdate="CHANNEL_PINS_UPDATE",e.ChannelUpdate="CHANNEL_UPDATE",e.EntitlementCreate="ENTITLEMENT_CREATE",e.EntitlementDelete="ENTITLEMENT_DELETE",e.EntitlementUpdate="ENTITLEMENT_UPDATE",e.GuildAuditLogEntryCreate="GUILD_AUDIT_LOG_ENTR
|
|||
|
|
`).join(`\r
|
|||
|
|
`)),s.removeListener("error",fdt),d.setSocket(s,a,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(d),d.on("close",()=>{this.clients.delete(d),this._shouldEmitClose&&!this.clients.size&&process.nextTick(GS,this)})),o(d,r)}};bdt.exports=Lle;function sGi(e,t){for(let i of Object.keys(t))e.on(i,t[i]);return function(){for(let n of Object.keys(t))e.removeListener(n,t[n])}}function GS(e){e._state=gdt,e.emit("close")}function fdt(){this.destroy()}function VS(e,t,i,n){i=i||oO.STATUS_CODES[t],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(i),...n},e.once("finish",e.destroy),e.end(`HTTP/1.1 ${t} ${oO.STATUS_CODES[t]}\r
|
|||
|
|
`+Object.keys(n).map(r=>`${r}: ${n[r]}`).join(`\r
|
|||
|
|
`)+`\r
|
|||
|
|
\r
|
|||
|
|
`+i)}function Qv(e,t,i,n,r,s){if(e.listenerCount("wsClientError")){let a=new Error(r);Error.captureStackTrace(a,Qv),e.emit("wsClientError",a,i,t)}else VS(i,n,r,s)}});var xdt=A((l4n,ydt)=>{"use strict";var dh=aO();dh.createWebSocketStream=udt();dh.Server=vdt();dh.Receiver=_le();dh.Sender=Sle();dh.WebSocket=dh;dh.WebSocketServer=dh.Server;ydt.exports=dh});var Gle=A((u4n,jdt)=>{"use strict";var aGi=Object.create,HS=Object.defineProperty,oGi=Object.getOwnPropertyDescriptor,cGi=Object.getOwnPropertyNames,lGi=Object.getPrototypeOf,uGi=Object.prototype.hasOwnProperty,tc=(e,t)=>HS(e,"name",{value:t,configurable:!0}),pGi=(e,t)=>{for(var i in t)HS(e,i,{get:t[i],enumerable:!0})},Bdt=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of cGi(t))!uGi.call(e,r)&&r!==i&&HS(e,r,{get:()=>t[r],enumerable:!(n=oGi(t,r))||n.enumerable});return e},dGi=(e,t,i)=>(i=e!=null?aGi(lGi(e)):{},Bdt(t||!e||!e.__esModule?HS(i,"default",{value:e,enumerable:!0}):i,e)),AGi=e=>Bdt(HS({},"__esModule",{value:!0}),e),_dt={};pGi(_dt,{CloseCodes:()=>Pdt,CompressionMethod:()=>Ndt,DefaultDeviceProperty:()=>qle,DefaultWebSocketManagerOptions:()=>Ldt,Encoding:()=>Udt,ImportantGatewayOpcodes:()=>Ple,KnownNetworkErrorCodes:()=>Fdt,SimpleContextFetchingStrategy:()=>Qdt,SimpleIdentifyThrottler:()=>Mdt,SimpleShardingStrategy:()=>Odt,WebSocketManager:()=>LGi,WebSocketShard:()=>jle,WebSocketShardDestroyRecovery:()=>Ole,WebSocketShardEvents:()=>AO,WebSocketShardStatus:()=>qdt,WorkerBootstrapper:()=>TGi,WorkerContextFetchingStrategy:()=>Ddt,WorkerReceivePayloadOp:()=>Sdt,WorkerSendPayloadOp:()=>kdt,WorkerShardingStrategy:()=>fGi,getInitialSendRateLimitState:()=>$S,managerToFetchingStrategyOptions:()=>dO,version:()=>FGi});jdt.exports=AGi(_dt);async function dO(e){let{buildIdentifyThrottler:t,buildStrategy:i,retrieveSessionInfo:n,updateSessionInfo:r,shardCount:s,shardIds:a,rest:o,...c}=e.options;return{...c,gatewayInformation:await e.fetchGatewayInformation(),shardCount:await e.getShardCount()}}tc(dO,"managerToFetchingStrategyOptions");var Qdt=class uO{constructor(t,i){this.manager=t,this.options=i}static{tc(this,"SimpleContextFetchingStrategy")}static throttlerCache=new WeakMap;static async ensureThrottler(t){let i=uO.throttlerCache.get(t);if(i)return i;let n=await t.options.buildIdentifyThrottler(t);return uO.throttlerCache.set(t,n),n}async retrieveSessionInfo(t){return this.manager.options.retrieveSessionInfo(t)}updateSessionInfo(t,i){return this.manager.options.updateSessionInfo(t,i)}async waitForIdentify(t,i){await(await uO.ensureThrottler(this.manager)).waitForIdentify(t,i)}},PC=require("worker_threads"),Edt=Rf(),hGi=require("events"),cO=require("path"),mGi=require("worker_threads"),OC=Rf(),kdt=(e=>(e[e.Connect=0]="Connect",e[e.Destroy=1]="Destroy",e[e.Send=2]="Send",e[e.SessionInfoResponse=3]="SessionInfoResponse",e[e.ShardIdentifyResponse=4]="ShardIdentifyResponse",e[e.FetchStatus=5]="FetchStatus",e))(kdt||{}),Sdt=(e=>(e[e.Connected=0]="Connected",e[e.Destroyed=1]="Destroyed",e[e.Event=2]="Event",e[e.RetrieveSessionInfo=3]="RetrieveSessionInfo",e[e.UpdateSessionInfo=4]="UpdateSessionInfo",e[e.WaitForIdentify=5]="WaitForIdentify",e[e.FetchStatusResponse=6]="FetchStatusResponse",e[e.WorkerReady=7]="WorkerReady",e[e.CancelIdentify=8]="CancelIdentify",e))(Sdt||{}),fGi=class{static{tc(this,"WorkerShardingStrategy")}manager;options;#e=[];#t=new OC.Collection;connectPromises=new OC.Collection;destroyPromises=new OC.Collection;fetchStatusPromises=new OC.Collection;waitForIdentifyControllers=new OC.Collection;throttler;constructor(e,t){this.manager=e,this.options=t}async spawn(e){let t=this.options.shardsPerWorker==="all"?e.length:this.options.shardsPerWorker,i=await dO(this.manager),n=Math.ceil(e.length/t),r=[];for(let s=0;s<n;s++){let a=e.slice(s*t,(s+1)*t),o={...i,shardIds:a};r.push(this.setupWorker(o))}await Promise.all(r)}async connect(){let e=[];for(let[t,i]of this.#t.entries()){let n={op:0,shardId:t},r=new Promise(s=>this.connectPromises.set(t,s));i.postMessage(n),e.push(r)}await Promise.all(e)}async destroy(e={}){let t=[];for(let[i,n]of this.#t.entries
|
|||
|
|
`)})}},Odt=class{static{tc(this,"SimpleShardingStrategy")}manager;shards=new gGi.Collection;constructor(e){this.manager=e}async spawn(e){let t=await dO(this.manager);for(let i of e){let n=new Qdt(this.manager,t),r=new jle(n,i);for(let s of Object.values(AO))r.on(s,a=>this.manager.emit(s,{...a,shardId:i}));this.shards.set(i,r)}}async connect(){let e=[];for(let t of this.shards.values())e.push(t.connect());await Promise.all(e)}async destroy(e){let t=[];for(let i of this.shards.values())t.push(i.destroy(e));await Promise.all(t),this.shards.clear()}async send(e,t){let i=this.shards.get(e);if(!i)throw new RangeError(`Shard ${e} not found`);return i.send(t)}async fetchStatus(){return this.shards.mapValues(e=>e.status)}},Nf=require("worker_threads"),RGi=Rf(),TGi=class{static{tc(this,"WorkerBootstrapper")}data=Nf.workerData;shards=new RGi.Collection;constructor(){if(Nf.isMainThread)throw new Error("Expected WorkerBootstrap to not be used within the main thread")}async connect(e){let t=this.shards.get(e);if(!t)throw new RangeError(`Shard ${e} does not exist`);await t.connect()}async destroy(e,t){let i=this.shards.get(e);if(!i)throw new RangeError(`Shard ${e} does not exist`);await i.destroy(t)}setupThreadEvents(){Nf.parentPort.on("messageerror",e=>{throw e}).on("message",async e=>{switch(e.op){case 0:{await this.connect(e.shardId);let t={op:0,shardId:e.shardId};Nf.parentPort.postMessage(t);break}case 1:{await this.destroy(e.shardId,e.options);let t={op:1,shardId:e.shardId};Nf.parentPort.postMessage(t);break}case 2:{let t=this.shards.get(e.shardId);if(!t)throw new RangeError(`Shard ${e.shardId} does not exist`);await t.send(e.payload);break}case 3:break;case 4:break;case 5:{let t=this.shards.get(e.shardId);if(!t)throw new Error(`Shard ${e.shardId} does not exist`);let i={op:6,status:t.status,nonce:e.nonce};Nf.parentPort.postMessage(i);break}}})}async bootstrap(e={}){for(let i of this.data.shardIds){let n=new jle(new Ddt(this.data),i);for(let r of e.forwardEvents??Object.values(AO))n.on(r,s=>{let a={op:2,event:r,data:s,shardId:i};Nf.parentPort.postMessage(a)});await e.shardCallback?.(n),this.shards.set(i,n)}this.setupThreadEvents();let t={op:7};Nf.parentPort.postMessage(t)}},wdt=NS(),MGi=NS(),UGi=PI(),NGi=ge();(0,MGi.polyfillDispose)();var LGi=class extends UGi.AsyncEventEmitter{static{tc(this,"WebSocketManager")}options;gatewayInformation=null;shardIds=null;strategy;constructor(e){super(),this.options={...Ldt,...e},this.strategy=this.options.buildStrategy(this)}async fetchGatewayInformation(e=!1){if(this.gatewayInformation){if(this.gatewayInformation.expiresAt<=Date.now())this.gatewayInformation=null;else if(!e)return this.gatewayInformation.data}let t=await this.options.rest.get(NGi.Routes.gatewayBot());return this.gatewayInformation={data:t,expiresAt:Date.now()+(t.session_start_limit.reset_after||5e3)},this.gatewayInformation.data}async updateShardCount(e){await this.strategy.destroy({reason:"User is adjusting their shards"}),this.options.shardCount=e;let t=await this.getShardIds(!0);return await this.strategy.spawn(t),this}async getShardCount(){if(this.options.shardCount)return this.options.shardCount;let e=await this.getShardIds();return Math.max(...e)+1}async getShardIds(e=!1){if(this.shardIds&&!e)return this.shardIds;let t;if(this.options.shardIds)if(Array.isArray(this.options.shardIds))t=this.options.shardIds;else{let{start:i,end:n}=this.options.shardIds;t=[...(0,wdt.range)({start:i,end:n+1})]}else{let i=await this.fetchGatewayInformation();t=[...(0,wdt.range)(this.options.shardCount??i.shards)]}return this.shardIds=t,t}async connect(){let e=await this.getShardCount();await this.updateShardCount(e);let t=await this.getShardIds(),i=await this.fetchGatewayInformation();if(i.session_start_limit.remaining<t.length)throw new Error(`Not enough sessions remaining to spawn ${t.length} shards; only ${i.session_start_limit.remaining} remaining; resets at ${new Date(Date.now()+i.session_start_limit.reset_after).toISOString()}`);await this.strategy.connect()}destroy(e){return this.strategy.destroy(e)}send(e,t){return this.strategy.se
|
|||
|
|
`)}`)}async connect(){let t=new I4i(C4i.TokenInvalid),{shards:i,shardCount:n,intents:r,ws:s}=this.client.options;if(this._ws&&this._ws.options.token!==this.client.token&&(await this._ws.destroy({code:Zle.Normal,reason:"Login with differing token requested"}),this._ws=null),!this._ws){let l={intents:r.bitfield,rest:this.client.rest,token:this.client.token,largeThreshold:s.large_threshold,version:s.version,shardIds:i==="auto"?null:i,shardCount:i==="auto"?null:n,initialPresence:s.presence,retrieveSessionInfo:p=>this.shards.get(p).sessionInfo,updateSessionInfo:(p,h)=>{this.shards.get(p).sessionInfo=h},compression:Vmt?x4i.ZlibStream:null};s.buildIdentifyThrottler&&(l.buildIdentifyThrottler=s.buildIdentifyThrottler),s.buildStrategy&&(l.buildStrategy=s.buildStrategy),this._ws=new y4i(l),this.attachEvents()}let{url:a,shards:o,session_start_limit:c}=await this._ws.fetchGatewayInformation().catch(l=>{throw l.status===401?t:l}),{total:u,remaining:d}=c;this.debug(["Fetched Gateway Information",`URL: ${a}`,`Recommended Shards: ${o}`]),this.debug(["Session Limit Information",`Total: ${u}`,`Remaining: ${d}`]),this.gateway=`${a}/`,this.client.options.shardCount=await this._ws.getShardCount(),this.client.options.shards=await this._ws.getShardIds(),this.totalShards=this.client.options.shards.length;for(let l of this.client.options.shards)if(!this.shards.has(l)){let p=new E4i(this,l);this.shards.set(l,p),p.on(YS.AllReady,h=>{this.client.emit(kv.ShardReady,p.id,h),this.checkShardsReady()}),p.status=Xl.Connecting}await this._ws.connect(),this.shards.forEach(l=>{l.listenerCount(YS.InvalidSession)>0&&!jmt&&(Jle.emitWarning("The WebSocketShard#invalidSession event is deprecated and will never emit.","DeprecationWarning"),jmt=!0),l.listenerCount(YS.Destroyed)>0&&!Gmt&&(Jle.emitWarning("The WebSocketShard#destroyed event is deprecated and will never emit.","DeprecationWarning"),Gmt=!0)})}attachEvents(){this._ws.on(Lf.Debug,({message:t,shardId:i})=>this.debug([t],i)),this._ws.on(Lf.Dispatch,({data:t,shardId:i})=>{this.client.emit(kv.Raw,t,i),this.emit(t.t,t.d,i);let n=this.shards.get(i);this.handlePacket(t,n),n.status===Xl.WaitingForGuilds&&B4i.includes(t.t)&&n.gotGuild(t.d.id)}),this._ws.on(Lf.Ready,({data:t,shardId:i})=>{this.shards.get(i).onReadyPacket(t)}),this._ws.on(Lf.Closed,({code:t,shardId:i})=>{let n=this.shards.get(i);if(n.emit(YS.Close,{code:t,reason:Omt,wasClean:!0}),_4i.includes(t)){n.status=Xl.Disconnected,this.client.emit(kv.ShardDisconnect,{code:t,reason:Omt,wasClean:!0},i),this.debug([`Shard not recoverable: ${t} (${Sv[t]??Zle[t]})`],i);return}this.shards.get(i).status=Xl.Connecting,this.client.emit(kv.ShardReconnecting,i)}),this._ws.on(Lf.Hello,({shardId:t})=>{let i=this.shards.get(t);i.sessionInfo?(i.closeSequence=i.sessionInfo.sequence,i.status=Xl.Resuming):i.status=Xl.Identifying}),this._ws.on(Lf.Resumed,({shardId:t})=>{let i=this.shards.get(t);i.status=Xl.Ready,i.emit(YS.Resumed)}),this._ws.on(Lf.HeartbeatComplete,({heartbeatAt:t,latency:i,shardId:n})=>{this.debug([`Heartbeat acknowledged, latency of ${i}ms.`],n);let r=this.shards.get(n);r.lastPingTimestamp=t,r.ping=i}),this._ws.on(Lf.Error,({error:t,shardId:i})=>{this.client.emit(kv.ShardError,t,i)})}broadcast(t){for(let i of this.shards.keys())this._ws.send(i,t)}async destroy(){this.destroyed||(this.debug([Object.assign(new Error,{name:"Manager was destroyed:"}).stack]),this.destroyed=!0,await this._ws?.destroy({code:Zle.Normal,reason:"Manager was destroyed"}))}handlePacket(t,i){if(t&&this.status!==Xl.Ready&&!w4i.includes(t.t))return this.packetQueue.push({packet:t,shard:i}),!1;if(this.packetQueue.length){let n=this.packetQueue.shift();b4i(()=>{this.handlePacket(n.packet,n.shard)}).unref()}return t&&qmt[t.t]&&qmt[t.t](this.client,t,i),!0}checkShardsReady(){this.status!==Xl.Ready&&(this.shards.size!==this.totalShards||this.shards.some(t=>t.status!==Xl.Ready)||this.triggerClientReady())}triggerClientReady(){this.status=Xl.Ready,this.client.readyTimestamp=Date.now(),this.client.emit("ready",this.client)&&!Pmt&&(Pmt=!0,Jle.emitWarning("The ready event has been renamed to cli
|
|||
|
|
\r
|
|||
|
|
`),R6i=/\r\n/g,T6i=/^([^:]+):[ \t]?([\x00-\xFF]+)?$/;function l0(e){qEt.call(this),e=e||{};let t=this;this.nread=0,this.maxed=!1,this.npairs=0,this.maxHeaderPairs=FEt(e,"maxHeaderPairs",2e3),this.maxHeaderSize=FEt(e,"maxHeaderSize",80*1024),this.buffer="",this.header={},this.finished=!1,this.ss=new S6i(D6i),this.ss.on("info",function(i,n,r,s){n&&!t.maxed&&(t.nread+s-r>=t.maxHeaderSize?(s=t.maxHeaderSize-t.nread+r,t.nread=t.maxHeaderSize,t.maxed=!0):t.nread+=s-r,t.buffer+=n.toString("binary",r,s)),i&&t._finish()})}k6i(l0,qEt);l0.prototype.push=function(e){let t=this.ss.push(e);if(this.finished)return t};l0.prototype.reset=function(){this.finished=!1,this.buffer="",this.header={},this.ss.reset()};l0.prototype._finish=function(){this.buffer&&this._parseHeader(),this.ss.matches=this.ss.maxMatches;let e=this.header;this.header={},this.buffer="",this.finished=!0,this.nread=this.npairs=0,this.maxed=!1,this.emit("header",e)};l0.prototype._parseHeader=function(){if(this.npairs===this.maxHeaderPairs)return;let e=this.buffer.split(R6i),t=e.length,i,n;for(var r=0;r<t;++r){if(e[r].length===0)continue;if((e[r][0]===" "||e[r][0]===" ")&&n){this.header[n][this.header[n].length-1]+=e[r];continue}let s=e[r].indexOf(":");if(s===-1||s===0)return;if(i=T6i.exec(e[r]),n=i[1].toLowerCase(),this.header[n]=this.header[n]||[],this.header[n].push(i[2]||""),++this.npairs===this.maxHeaderPairs)break}};PEt.exports=l0});var Ide=A((bHn,GEt)=>{"use strict";var Ede=require("node:stream").Writable,M6i=require("node:util").inherits,U6i=yde(),jEt=NEt(),N6i=OEt(),L6i=45,F6i=Buffer.from("-"),q6i=Buffer.from(`\r
|
|||
|
|
`),P6i=function(){};function ep(e){if(!(this instanceof ep))return new ep(e);if(Ede.call(this,e),!e||!e.headerFirst&&typeof e.boundary!="string")throw new TypeError("Boundary required");typeof e.boundary=="string"?this.setBoundary(e.boundary):this._bparser=void 0,this._headerFirst=e.headerFirst,this._dashes=0,this._parts=0,this._finished=!1,this._realFinish=!1,this._isPreamble=!0,this._justMatched=!1,this._firstWrite=!0,this._inHeader=!0,this._part=void 0,this._cb=void 0,this._ignoreData=!1,this._partOpts={highWaterMark:e.partHwm},this._pause=!1;let t=this;this._hparser=new N6i(e),this._hparser.on("header",function(i){t._inHeader=!1,t._part.emit("header",i)})}M6i(ep,Ede);ep.prototype.emit=function(e){if(e==="finish"&&!this._realFinish){if(!this._finished){let t=this;process.nextTick(function(){if(t.emit("error",new Error("Unexpected end of multipart data")),t._part&&!t._ignoreData){let i=t._isPreamble?"Preamble":"Part";t._part.emit("error",new Error(i+" terminated early due to unexpected end of multipart data")),t._part.push(null),process.nextTick(function(){t._realFinish=!0,t.emit("finish"),t._realFinish=!1});return}t._realFinish=!0,t.emit("finish"),t._realFinish=!1})}}else Ede.prototype.emit.apply(this,arguments)};ep.prototype._write=function(e,t,i){if(!this._hparser&&!this._bparser)return i();if(this._headerFirst&&this._isPreamble){this._part||(this._part=new jEt(this._partOpts),this.listenerCount("preamble")!==0?this.emit("preamble",this._part):this._ignore());let n=this._hparser.push(e);if(!this._inHeader&&n!==void 0&&n<e.length)e=e.slice(n);else return i()}this._firstWrite&&(this._bparser.push(q6i),this._firstWrite=!1),this._bparser.push(e),this._pause?this._cb=i:i()};ep.prototype.reset=function(){this._part=void 0,this._bparser=void 0,this._hparser=void 0};ep.prototype.setBoundary=function(e){let t=this;this._bparser=new U6i(`\r
|
|||
|
|
--`+e),this._bparser.on("info",function(i,n,r,s){t._oninfo(i,n,r,s)})};ep.prototype._ignore=function(){this._part&&!this._ignoreData&&(this._ignoreData=!0,this._part.on("error",P6i),this._part.resume())};ep.prototype._oninfo=function(e,t,i,n){let r,s=this,a=0,o,c=!0;if(!this._part&&this._justMatched&&t){for(;this._dashes<2&&i+a<n;)if(t[i+a]===L6i)++a,++this._dashes;else{this._dashes&&(r=F6i),this._dashes=0;break}if(this._dashes===2&&(i+a<n&&this.listenerCount("trailer")!==0&&this.emit("trailer",t.slice(i+a,n)),this.reset(),this._finished=!0,s._parts===0&&(s._realFinish=!0,s.emit("finish"),s._realFinish=!1)),this._dashes)return}this._justMatched&&(this._justMatched=!1),this._part||(this._part=new jEt(this._partOpts),this._part._read=function(u){s._unpause()},this._isPreamble&&this.listenerCount("preamble")!==0?this.emit("preamble",this._part):this._isPreamble!==!0&&this.listenerCount("part")!==0?this.emit("part",this._part):this._ignore(),this._isPreamble||(this._inHeader=!0)),t&&i<n&&!this._ignoreData&&(this._isPreamble||!this._inHeader?(r&&(c=this._part.push(r)),c=this._part.push(t.slice(i,n)),c||(this._pause=!0)):!this._isPreamble&&this._inHeader&&(r&&this._hparser.push(r),o=this._hparser.push(t.slice(i,n)),!this._inHeader&&o!==void 0&&o<n&&this._oninfo(!1,t,i+o,n))),e&&(this._hparser.reset(),this._isPreamble?this._isPreamble=!1:i!==n&&(++this._parts,this._part.on("end",function(){--s._parts===0&&(s._finished?(s._realFinish=!0,s.emit("finish"),s._realFinish=!1):s._unpause())})),this._part.push(null),this._part=void 0,this._ignoreData=!1,this._justMatched=!0,this._dashes=0)};ep.prototype._unpause=function(){if(this._pause&&(this._pause=!1,this._cb)){let e=this._cb;this._cb=void 0,e()}};GEt.exports=ep});var JO=A((Cde,HEt)=>{"use strict";var VEt=new TextDecoder("utf-8"),$Et=new Map([["utf-8",VEt],["utf8",VEt]]);function O6i(e){let t;for(;;)switch(e){case"utf-8":case"utf8":return aD.utf8;case"latin1":case"ascii":case"us-ascii":case"iso-8859-1":case"iso8859-1":case"iso88591":case"iso_8859-1":case"windows-1252":case"iso_8859-1:1987":case"cp1252":case"x-cp1252":return aD.latin1;case"utf16le":case"utf-16le":case"ucs2":case"ucs-2":return aD.utf16le;case"base64":return aD.base64;default:if(t===void 0){t=!0,e=e.toLowerCase();continue}return aD.other.bind(e)}}var aD={utf8:(e,t)=>e.length===0?"":(typeof e=="string"&&(e=Buffer.from(e,t)),e.utf8Slice(0,e.length)),latin1:(e,t)=>e.length===0?"":typeof e=="string"?e:e.latin1Slice(0,e.length),utf16le:(e,t)=>e.length===0?"":(typeof e=="string"&&(e=Buffer.from(e,t)),e.ucs2Slice(0,e.length)),base64:(e,t)=>e.length===0?"":(typeof e=="string"&&(e=Buffer.from(e,t)),e.base64Slice(0,e.length)),other:(e,t)=>{if(e.length===0)return"";if(typeof e=="string"&&(e=Buffer.from(e,t)),$Et.has(Cde.toString()))try{return $Et.get(Cde).decode(e)}catch{}return typeof e=="string"?e:e.toString()}};function j6i(e,t,i){return e&&O6i(i)(e,t)}HEt.exports=j6i});var Bde=A((vHn,ZEt)=>{"use strict";var ZO=JO(),YEt=/%[a-fA-F0-9][a-fA-F0-9]/g,G6i={"%00":"\0","%01":"","%02":"","%03":"","%04":"","%05":"","%06":"","%07":"\x07","%08":"\b","%09":" ","%0a":`
|
|||
|
|
`,"%0A":`
|
|||
|
|
`,"%0b":"\v","%0B":"\v","%0c":"\f","%0C":"\f","%0d":"\r","%0D":"\r","%0e":"","%0E":"","%0f":"","%0F":"","%10":"","%11":"","%12":"","%13":"","%14":"","%15":"","%16":"","%17":"","%18":"","%19":"","%1a":"","%1A":"","%1b":"\x1B","%1B":"\x1B","%1c":"","%1C":"","%1d":"","%1D":"","%1e":"","%1E":"","%1f":"","%1F":"","%20":" ","%21":"!","%22":'"',"%23":"#","%24":"$","%25":"%","%26":"&","%27":"'","%28":"(","%29":")","%2a":"*","%2A":"*","%2b":"+","%2B":"+","%2c":",","%2C":",","%2d":"-","%2D":"-","%2e":".","%2E":".","%2f":"/","%2F":"/","%30":"0","%31":"1","%32":"2","%33":"3","%34":"4","%35":"5","%36":"6","%37":"7","%38":"8","%39":"9","%3a":":","%3A":":","%3b":";","%3B":";","%3c":"<","%3C":"<","%3d":"=","%3D":"=","%3e":">","%3E":">","%3f":"?","%3F":"?","%40":"@","%41":"A","%42":"B","%43":"C","%44":"D","%45":"E","%46":"F","%47":"G","%48":"H","%49":"I","%4a":"J","%4A":"J","%4b":"K","%4B":"K","%4c":"L","%4C":"L","%4d":"M","%4D":"M","%4e":"N","%4E":"N","%4f":"O","%4F":"O","%50":"P","%51":"Q","%52":"R","%53":"S","%54":"T","%55":"U","%56":"V","%57":"W","%58":"X","%59":"Y","%5a":"Z","%5A":"Z","%5b":"[","%5B":"[","%5c":"\\","%5C":"\\","%5d":"]","%5D":"]","%5e":"^","%5E":"^","%5f":"_","%5F":"_","%60":"`","%61":"a","%62":"b","%63":"c","%64":"d","%65":"e","%66":"f","%67":"g","%68":"h","%69":"i","%6a":"j","%6A":"j","%6b":"k","%6B":"k","%6c":"l","%6C":"l","%6d":"m","%6D":"m","%6e":"n","%6E":"n","%6f":"o","%6F":"o","%70":"p","%71":"q","%72":"r","%73":"s","%74":"t","%75":"u","%76":"v","%77":"w","%78":"x","%79":"y","%7a":"z","%7A":"z","%7b":"{","%7B":"{","%7c":"|","%7C":"|","%7d":"}","%7D":"}","%7e":"~","%7E":"~","%7f":"\x7F","%7F":"\x7F","%80":"\x80","%81":"\x81","%82":"\x82","%83":"\x83","%84":"\x84","%85":"\x85","%86":"\x86","%87":"\x87","%88":"\x88","%89":"\x89","%8a":"\x8A","%8A":"\x8A","%8b":"\x8B","%8B":"\x8B","%8c":"\x8C","%8C":"\x8C","%8d":"\x8D","%8D":"\x8D","%8e":"\x8E","%8E":"\x8E","%8f":"\x8F","%8F":"\x8F","%90":"\x90","%91":"\x91","%92":"\x92","%93":"\x93","%94":"\x94","%95":"\x95","%96":"\x96","%97":"\x97","%98":"\x98","%99":"\x99","%9a":"\x9A","%9A":"\x9A","%9b":"\x9B","%9B":"\x9B","%9c":"\x9C","%9C":"\x9C","%9d":"\x9D","%9D":"\x9D","%9e":"\x9E","%9E":"\x9E","%9f":"\x9F","%9F":"\x9F","%a0":"\xA0","%A0":"\xA0","%a1":"\xA1","%A1":"\xA1","%a2":"\xA2","%A2":"\xA2","%a3":"\xA3","%A3":"\xA3","%a4":"\xA4","%A4":"\xA4","%a5":"\xA5","%A5":"\xA5","%a6":"\xA6","%A6":"\xA6","%a7":"\xA7","%A7":"\xA7","%a8":"\xA8","%A8":"\xA8","%a9":"\xA9","%A9":"\xA9","%aa":"\xAA","%Aa":"\xAA","%aA":"\xAA","%AA":"\xAA","%ab":"\xAB","%Ab":"\xAB","%aB":"\xAB","%AB":"\xAB","%ac":"\xAC","%Ac":"\xAC","%aC":"\xAC","%AC":"\xAC","%ad":"\xAD","%Ad":"\xAD","%aD":"\xAD","%AD":"\xAD","%ae":"\xAE","%Ae":"\xAE","%aE":"\xAE","%AE":"\xAE","%af":"\xAF","%Af":"\xAF","%aF":"\xAF","%AF":"\xAF","%b0":"\xB0","%B0":"\xB0","%b1":"\xB1","%B1":"\xB1","%b2":"\xB2","%B2":"\xB2","%b3":"\xB3","%B3":"\xB3","%b4":"\xB4","%B4":"\xB4","%b5":"\xB5","%B5":"\xB5","%b6":"\xB6","%B6":"\xB6","%b7":"\xB7","%B7":"\xB7","%b8":"\xB8","%B8":"\xB8","%b9":"\xB9","%B9":"\xB9","%ba":"\xBA","%Ba":"\xBA","%bA":"\xBA","%BA":"\xBA","%bb":"\xBB","%Bb":"\xBB","%bB":"\xBB","%BB":"\xBB","%bc":"\xBC","%Bc":"\xBC","%bC":"\xBC","%BC":"\xBC","%bd":"\xBD","%Bd":"\xBD","%bD":"\xBD","%BD":"\xBD","%be":"\xBE","%Be":"\xBE","%bE":"\xBE","%BE":"\xBE","%bf":"\xBF","%Bf":"\xBF","%bF":"\xBF","%BF":"\xBF","%c0":"\xC0","%C0":"\xC0","%c1":"\xC1","%C1":"\xC1","%c2":"\xC2","%C2":"\xC2","%c3":"\xC3","%C3":"\xC3","%c4":"\xC4","%C4":"\xC4","%c5":"\xC5","%C5":"\xC5","%c6":"\xC6","%C6":"\xC6","%c7":"\xC7","%C7":"\xC7","%c8":"\xC8","%C8":"\xC8","%c9":"\xC9","%C9":"\xC9","%ca":"\xCA","%Ca":"\xCA","%cA":"\xCA","%CA":"\xCA","%cb":"\xCB","%Cb":"\xCB","%cB":"\xCB","%CB":"\xCB","%cc":"\xCC","%Cc":"\xCC","%cC":"\xCC","%CC":"\xCC","%cd":"\xCD","%Cd":"\xCD","%cD":"\xCD","%CD":"\xCD","%ce":"\xCE","%Ce":"\xCE","%cE":"\xCE","%CE":"\xCE","%cf":"\xCF","%Cf":"\xCF","%cF":"\xCF","%CF":"\xCF","%d0":"\xD0","%D0":"\xD0","%d1":"\xD1","%D1":"\xD1","%d2":"\xD2","%D2":"\xD2","%d3":"\xD3","%D3":"\xD3","%d4":"\xD4","%D4":"\xD4","%d5":"\xD5","%
|
|||
|
|
`))}function j5i(e,t){let{headersList:i}=t,n=(i.get("referrer-policy")??"").split(","),r="";if(n.length>0)for(let s=n.length;s!==0;s--){let a=n[s-1].trim();if(Q5i.has(a)){r=a;break}}r!==""&&(e.referrerPolicy=r)}function G5i(){return"allowed"}function V5i(){return"success"}function $5i(){return"success"}function H5i(e){let t=null;t=e.mode,e.headersList.set("sec-fetch-mode",t)}function Y5i(e){let t=e.origin;if(e.responseTainting==="cors"||e.mode==="websocket")t&&e.headersList.append("origin",t);else if(e.method!=="GET"&&e.method!=="HEAD"){switch(e.referrerPolicy){case"no-referrer":t=null;break;case"no-referrer-when-downgrade":case"strict-origin":case"strict-origin-when-cross-origin":e.origin&&Mde(e.origin)&&!Mde(lD(e))&&(t=null);break;case"same-origin":ij(e,lD(e))||(t=null);break;default:}t&&e.headersList.append("origin",t)}}function z5i(e){return D5i.now()}function W5i(e){return{startTime:e.startTime??0,redirectStartTime:0,redirectEndTime:0,postRedirectStartTime:e.startTime??0,finalServiceWorkerStartTime:0,finalNetworkResponseStartTime:0,finalNetworkRequestStartTime:0,endTime:0,encodedBodySize:0,decodedBodySize:0,finalConnectionTimingInfo:null}}function J5i(){return{referrerPolicy:"strict-origin-when-cross-origin"}}function Z5i(e){return{referrerPolicy:e.referrerPolicy}}function K5i(e){let t=e.referrerPolicy;h0(t);let i=null;if(e.referrer==="client"){let o=S5i();if(!o||o.origin==="null")return"no-referrer";i=new URL(o)}else e.referrer instanceof URL&&(i=e.referrer);let n=Rde(i),r=Rde(i,!0);n.toString().length>4096&&(n=r);let s=ij(e,n),a=cD(n)&&!cD(e.url);switch(t){case"origin":return r??Rde(i,!0);case"unsafe-url":return n;case"same-origin":return s?r:"no-referrer";case"origin-when-cross-origin":return s?n:r;case"strict-origin-when-cross-origin":{let o=lD(e);return ij(n,o)?n:cD(n)&&!cD(o)?"no-referrer":r}case"strict-origin":case"no-referrer-when-downgrade":default:return a?"no-referrer":r}}function Rde(e,t){return h0(e instanceof URL),e.protocol==="file:"||e.protocol==="about:"||e.protocol==="blank:"?"no-referrer":(e.username="",e.password="",e.hash="",t&&(e.pathname="",e.search=""),e)}function cD(e){if(!(e instanceof URL))return!1;if(e.href==="about:blank"||e.href==="about:srcdoc"||e.protocol==="data:"||e.protocol==="file:")return!0;return t(e.origin);function t(i){if(i==null||i==="null")return!1;let n=new URL(i);return!!(n.protocol==="https:"||n.protocol==="wss:"||/^127(?:\.[0-9]+){0,2}\.[0-9]+$|^\[(?:0*:)*?:?0*1\]$/.test(n.hostname)||n.hostname==="localhost"||n.hostname.includes("localhost.")||n.hostname.endsWith(".localhost"))}}function X5i(e,t){if(tj===void 0)return!0;let i=CIt(t);if(i==="no metadata"||i.length===0)return!0;let n=t3i(i),r=i3i(i,n);for(let s of r){let a=s.algo,o=s.hash,c=tj.createHash(a).update(e).digest("base64");if(c[c.length-1]==="="&&(c[c.length-2]==="="?c=c.slice(0,-2):c=c.slice(0,-1)),n3i(c,o))return!0}return!1}var e3i=/(?<algo>sha256|sha384|sha512)-((?<hash>[A-Za-z0-9+/]+|[A-Za-z0-9_-]+)={0,2}(?:\s|$)( +[!-~]*)?)?/i;function CIt(e){let t=[],i=!0;for(let n of e.split(" ")){i=!1;let r=e3i.exec(n);if(r===null||r.groups===void 0||r.groups.algo===void 0)continue;let s=r.groups.algo.toLowerCase();yIt.includes(s)&&t.push(r.groups)}return i===!0?"no metadata":t}function t3i(e){let t=e[0].algo;if(t[3]==="5")return t;for(let i=1;i<e.length;++i){let n=e[i];if(n.algo[3]==="5"){t="sha512";break}else{if(t[3]==="3")continue;n.algo[3]==="3"&&(t="sha384")}}return t}function i3i(e,t){if(e.length===1)return e;let i=0;for(let n=0;n<e.length;++n)e[n].algo===t&&(e[i++]=e[n]);return e.length=i,e}function n3i(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;++i)if(e[i]!==t[i]){if(e[i]==="+"&&t[i]==="-"||e[i]==="/"&&t[i]==="_")continue;return!1}return!0}function r3i(e){}function ij(e,t){return e.origin===t.origin&&e.origin==="null"||e.protocol===t.protocol&&e.hostname===t.hostname&&e.port===t.port}function s3i(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function a3i(e){return e.controller.state==="aborted"}function o3i(e){return e.controller.state==="aborted"||e.controller.stat
|
|||
|
|
`||e===" "||e===" "}function Nde(e,t=!0,i=!0){let n=0,r=e.length-1;if(t)for(;n<e.length&&DIt(e[n]);n++);if(i)for(;r>0&&DIt(e[r]);r--);return e.slice(n,r+1)}function RIt(e){return e==="\r"||e===`
|
|||
|
|
`||e===" "||e==="\f"||e===" "}function D3i(e,t=!0,i=!0){let n=0,r=e.length-1;if(t)for(;n<e.length&&RIt(e[n]);n++);if(i)for(;r>0&&RIt(e[r]);r--);return e.slice(n,r+1)}NIt.exports={dataURLProcessor:_3i,URLSerializer:TIt,collectASequenceOfCodePoints:sj,collectASequenceOfCodePointsFast:m0,stringPercentDecode:MIt,parseMIMEType:Lde,collectAnHTTPQuotedString:UIt,serializeAMimeType:S3i}});var aj=A((DHn,OIt)=>{"use strict";var{Blob:qIt,File:LIt}=require("buffer"),{types:Fde}=require("util"),{kState:Xc}=fh(),{isBlobLike:PIt}=eu(),{webidl:$i}=io(),{parseMIMEType:R3i,serializeAMimeType:T3i}=tp(),{kEnumerableProperty:FIt}=xi(),M3i=new TextEncoder,uD=class e extends qIt{constructor(t,i,n={}){$i.argumentLengthCheck(arguments,2,{header:"File constructor"}),t=$i.converters["sequence<BlobPart>"](t),i=$i.converters.USVString(i),n=$i.converters.FilePropertyBag(n);let r=i,s=n.type,a;e:{if(s){if(s=R3i(s),s==="failure"){s="";break e}s=T3i(s).toLowerCase()}a=n.lastModified}super(U3i(t,n),{type:s}),this[Xc]={name:r,lastModified:a,type:s}}get name(){return $i.brandCheck(this,e),this[Xc].name}get lastModified(){return $i.brandCheck(this,e),this[Xc].lastModified}get type(){return $i.brandCheck(this,e),this[Xc].type}},qde=class e{constructor(t,i,n={}){let r=i,s=n.type,a=n.lastModified??Date.now();this[Xc]={blobLike:t,name:r,type:s,lastModified:a}}stream(...t){return $i.brandCheck(this,e),this[Xc].blobLike.stream(...t)}arrayBuffer(...t){return $i.brandCheck(this,e),this[Xc].blobLike.arrayBuffer(...t)}slice(...t){return $i.brandCheck(this,e),this[Xc].blobLike.slice(...t)}text(...t){return $i.brandCheck(this,e),this[Xc].blobLike.text(...t)}get size(){return $i.brandCheck(this,e),this[Xc].blobLike.size}get type(){return $i.brandCheck(this,e),this[Xc].blobLike.type}get name(){return $i.brandCheck(this,e),this[Xc].name}get lastModified(){return $i.brandCheck(this,e),this[Xc].lastModified}get[Symbol.toStringTag](){return"File"}};Object.defineProperties(uD.prototype,{[Symbol.toStringTag]:{value:"File",configurable:!0},name:FIt,lastModified:FIt});$i.converters.Blob=$i.interfaceConverter(qIt);$i.converters.BlobPart=function(e,t){if($i.util.Type(e)==="Object"){if(PIt(e))return $i.converters.Blob(e,{strict:!1});if(ArrayBuffer.isView(e)||Fde.isAnyArrayBuffer(e))return $i.converters.BufferSource(e,t)}return $i.converters.USVString(e,t)};$i.converters["sequence<BlobPart>"]=$i.sequenceConverter($i.converters.BlobPart);$i.converters.FilePropertyBag=$i.dictionaryConverter([{key:"lastModified",converter:$i.converters["long long"],get defaultValue(){return Date.now()}},{key:"type",converter:$i.converters.DOMString,defaultValue:""},{key:"endings",converter:e=>(e=$i.converters.DOMString(e),e=e.toLowerCase(),e!=="native"&&(e="transparent"),e),defaultValue:"transparent"}]);function U3i(e,t){let i=[];for(let n of e)if(typeof n=="string"){let r=n;t.endings==="native"&&(r=N3i(r)),i.push(M3i.encode(r))}else Fde.isAnyArrayBuffer(n)||Fde.isTypedArray(n)?n.buffer?i.push(new Uint8Array(n.buffer,n.byteOffset,n.byteLength)):i.push(new Uint8Array(n)):PIt(n)&&i.push(n);return i}function N3i(e){let t=`
|
|||
|
|
`;return process.platform==="win32"&&(t=`\r
|
|||
|
|
`),e.replace(/\r?\n/g,t)}function L3i(e){return LIt&&e instanceof LIt||e instanceof uD||e&&(typeof e.stream=="function"||typeof e.arrayBuffer=="function")&&e[Symbol.toStringTag]==="File"}OIt.exports={File:uD,FileLike:qde,isFileLike:L3i}});var cj=A((RHn,HIt)=>{"use strict";var{isBlobLike:oj,toUSVString:F3i,makeIterator:Pde}=eu(),{kState:Ca}=fh(),{File:$It,FileLike:jIt,isFileLike:q3i}=aj(),{webidl:Ki}=io(),{Blob:P3i,File:Ode}=require("buffer"),GIt=Ode??$It,f0=class e{constructor(t){if(t!==void 0)throw Ki.errors.conversionFailed({prefix:"FormData constructor",argument:"Argument 1",types:["undefined"]});this[Ca]=[]}append(t,i,n=void 0){if(Ki.brandCheck(this,e),Ki.argumentLengthCheck(arguments,2,{header:"FormData.append"}),arguments.length===3&&!oj(i))throw new TypeError("Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'");t=Ki.converters.USVString(t),i=oj(i)?Ki.converters.Blob(i,{strict:!1}):Ki.converters.USVString(i),n=arguments.length===3?Ki.converters.USVString(n):void 0;let r=VIt(t,i,n);this[Ca].push(r)}delete(t){Ki.brandCheck(this,e),Ki.argumentLengthCheck(arguments,1,{header:"FormData.delete"}),t=Ki.converters.USVString(t),this[Ca]=this[Ca].filter(i=>i.name!==t)}get(t){Ki.brandCheck(this,e),Ki.argumentLengthCheck(arguments,1,{header:"FormData.get"}),t=Ki.converters.USVString(t);let i=this[Ca].findIndex(n=>n.name===t);return i===-1?null:this[Ca][i].value}getAll(t){return Ki.brandCheck(this,e),Ki.argumentLengthCheck(arguments,1,{header:"FormData.getAll"}),t=Ki.converters.USVString(t),this[Ca].filter(i=>i.name===t).map(i=>i.value)}has(t){return Ki.brandCheck(this,e),Ki.argumentLengthCheck(arguments,1,{header:"FormData.has"}),t=Ki.converters.USVString(t),this[Ca].findIndex(i=>i.name===t)!==-1}set(t,i,n=void 0){if(Ki.brandCheck(this,e),Ki.argumentLengthCheck(arguments,2,{header:"FormData.set"}),arguments.length===3&&!oj(i))throw new TypeError("Failed to execute 'set' on 'FormData': parameter 2 is not of type 'Blob'");t=Ki.converters.USVString(t),i=oj(i)?Ki.converters.Blob(i,{strict:!1}):Ki.converters.USVString(i),n=arguments.length===3?F3i(n):void 0;let r=VIt(t,i,n),s=this[Ca].findIndex(a=>a.name===t);s!==-1?this[Ca]=[...this[Ca].slice(0,s),r,...this[Ca].slice(s+1).filter(a=>a.name!==t)]:this[Ca].push(r)}entries(){return Ki.brandCheck(this,e),Pde(()=>this[Ca].map(t=>[t.name,t.value]),"FormData","key+value")}keys(){return Ki.brandCheck(this,e),Pde(()=>this[Ca].map(t=>[t.name,t.value]),"FormData","key")}values(){return Ki.brandCheck(this,e),Pde(()=>this[Ca].map(t=>[t.name,t.value]),"FormData","value")}forEach(t,i=globalThis){if(Ki.brandCheck(this,e),Ki.argumentLengthCheck(arguments,1,{header:"FormData.forEach"}),typeof t!="function")throw new TypeError("Failed to execute 'forEach' on 'FormData': parameter 1 is not of type 'Function'.");for(let[n,r]of this)t.apply(i,[r,n,this])}};f0.prototype[Symbol.iterator]=f0.prototype.entries;Object.defineProperties(f0.prototype,{[Symbol.toStringTag]:{value:"FormData",configurable:!0}});function VIt(e,t,i){if(e=Buffer.from(e).toString("utf8"),typeof t=="string")t=Buffer.from(t).toString("utf8");else if(q3i(t)||(t=t instanceof P3i?new GIt([t],"blob",{type:t.type}):new jIt(t,"blob",{type:t.type})),i!==void 0){let n={type:t.type,lastModified:t.lastModified};t=Ode&&t instanceof Ode||t instanceof $It?new GIt([t],i,n):new jIt(t,i,n)}return{name:e,value:t}}HIt.exports={FormData:f0}});var pD=A((THn,tCt)=>{"use strict";var O3i=uIt(),g0=xi(),{ReadableStreamFrom:j3i,isBlobLike:YIt,isReadableStreamLike:G3i,readableStreamClose:V3i,createDeferredPromise:$3i,fullyReadBody:H3i}=eu(),{FormData:zIt}=cj(),{kState:bh}=fh(),{webidl:jde}=io(),{DOMException:ZIt,structuredClone:Y3i}=Yf(),{Blob:z3i,File:W3i}=require("buffer"),{kBodyUsed:J3i}=kn(),Gde=require("assert"),{isErrored:Z3i}=xi(),{isUint8Array:KIt,isArrayBuffer:K3i}=require("util/types"),{File:X3i}=aj(),{parseMIMEType:eYi,serializeAMimeType:tYi}=tp(),Vde;try{let e=require("node:crypto");Vde=t=>e.randomInt(0,t)}catch{Vde=e=>Math.floor(Math.random(e))}var gh=globalThis.ReadableStream,WIt=W3i??X3i,lj=new TextEncoder,iYi=new TextDec
|
|||
|
|
Content-Disposition: form-data`;let d=g=>g.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),l=g=>g.replace(/\r?\n|\r/g,`\r
|
|||
|
|
`),p=[],h=new Uint8Array([13,10]);s=0;let m=!1;for(let[g,b]of e)if(typeof b=="string"){let v=lj.encode(u+`; name="${d(l(g))}"\r
|
|||
|
|
\r
|
|||
|
|
${l(b)}\r
|
|||
|
|
`);p.push(v),s+=v.byteLength}else{let v=lj.encode(`${u}; name="${d(l(g))}"`+(b.name?`; filename="${d(b.name)}"`:"")+`\r
|
|||
|
|
Content-Type: ${b.type||"application/octet-stream"}\r
|
|||
|
|
\r
|
|||
|
|
`);p.push(v,b,h),typeof b.size=="number"?s+=v.byteLength+b.size+h.byteLength:m=!0}let f=lj.encode(`--${c}--`);p.push(f),s+=f.byteLength,m&&(s=null),r=e,n=async function*(){for(let g of p)g.stream?yield*g.stream():yield g},a="multipart/form-data; boundary="+c}else if(YIt(e))r=e,s=e.size,e.type&&(a=e.type);else if(typeof e[Symbol.asyncIterator]=="function"){if(t)throw new TypeError("keepalive");if(g0.isDisturbed(e)||e.locked)throw new TypeError("Response body object should not be disturbed or locked");i=e instanceof gh?e:j3i(e)}if((typeof r=="string"||g0.isBuffer(r))&&(s=Buffer.byteLength(r)),n!=null){let c;i=new gh({async start(){c=n(e)[Symbol.asyncIterator]()},async pull(u){let{value:d,done:l}=await c.next();return l?queueMicrotask(()=>{u.close()}):Z3i(i)||u.enqueue(new Uint8Array(d)),u.desiredSize>0},async cancel(u){await c.return()},type:void 0})}return[{stream:i,source:r,length:s},a]}function nYi(e,t=!1){return gh||(gh=require("stream/web").ReadableStream),e instanceof gh&&(Gde(!g0.isDisturbed(e),"The body has already been consumed."),Gde(!e.locked,"The stream is locked.")),XIt(e,t)}function rYi(e){let[t,i]=e.stream.tee(),n=Y3i(i,{transfer:[i]}),[,r]=n.tee();return e.stream=t,{stream:r,length:e.length,source:e.source}}async function*JIt(e){if(e)if(KIt(e))yield e;else{let t=e.stream;if(g0.isDisturbed(t))throw new TypeError("The body has already been consumed.");if(t.locked)throw new TypeError("The stream is locked.");t[J3i]=!0,yield*t}}function $de(e){if(e.aborted)throw new ZIt("The operation was aborted.","AbortError")}function sYi(e){return{blob(){return uj(this,i=>{let n=lYi(this);return n==="failure"?n="":n&&(n=tYi(n)),new z3i([i],{type:n})},e)},arrayBuffer(){return uj(this,i=>new Uint8Array(i).buffer,e)},text(){return uj(this,eCt,e)},json(){return uj(this,cYi,e)},async formData(){jde.brandCheck(this,e),$de(this[bh]);let i=this.headers.get("Content-Type");if(/multipart\/form-data/.test(i)){let n={};for(let[o,c]of this.headers)n[o.toLowerCase()]=c;let r=new zIt,s;try{s=new O3i({headers:n,preservePath:!0})}catch(o){throw new ZIt(`${o}`,"AbortError")}s.on("field",(o,c)=>{r.append(o,c)}),s.on("file",(o,c,u,d,l)=>{let p=[];if(d==="base64"||d.toLowerCase()==="base64"){let h="";c.on("data",m=>{h+=m.toString().replace(/[\r\n]/gm,"");let f=h.length-h.length%4;p.push(Buffer.from(h.slice(0,f),"base64")),h=h.slice(f)}),c.on("end",()=>{p.push(Buffer.from(h,"base64")),r.append(o,new WIt(p,u,{type:l}))})}else c.on("data",h=>{p.push(h)}),c.on("end",()=>{r.append(o,new WIt(p,u,{type:l}))})});let a=new Promise((o,c)=>{s.on("finish",o),s.on("error",u=>c(new TypeError(u)))});if(this.body!==null)for await(let o of JIt(this[bh].body))s.write(o);return s.end(),await a,r}else if(/application\/x-www-form-urlencoded/.test(i)){let n;try{let s="",a=new TextDecoder("utf-8",{ignoreBOM:!0});for await(let o of JIt(this[bh].body)){if(!KIt(o))throw new TypeError("Expected Uint8Array chunk");s+=a.decode(o,{stream:!0})}s+=a.decode(),n=new URLSearchParams(s)}catch(s){throw Object.assign(new TypeError,{cause:s})}let r=new zIt;for(let[s,a]of n)r.append(s,a);return r}else throw await Promise.resolve(),$de(this[bh]),jde.errors.exception({header:`${e.name}.formData`,message:"Could not parse content as FormData."})}}}function aYi(e){Object.assign(e.prototype,sYi(e))}async function uj(e,t,i){if(jde.brandCheck(e,i),$de(e[bh]),oYi(e[bh].body))throw new TypeError("Body is unusable");let n=$3i(),r=a=>n.reject(a),s=a=>{try{n.resolve(t(a))}catch(o){r(o)}};return e[bh].body==null?(s(new Uint8Array),n.promise):(await H3i(e[bh].body,s,r),n.promise)}function oYi(e){return e!=null&&(e.stream.locked||g0.isDisturbed(e.stream))}function eCt(e){return e.length===0?"":(e[0]===239&&e[1]===187&&e[2]===191&&(e=e.subarray(3)),iYi.decode(e))}function cYi(e){return JSON.parse(eCt(e))}function lYi(e){let{headersList:t}=e[bh],i=t.get("content-type");return i===null?"failure":eYi(i)}tCt.exports={extractBody:XIt,safelyExtractBody:nYi,cloneBody:rYi,mixinBody:aYi}});var sCt=A((MHn,rCt)=>{"use strict";var{InvalidArgumentError:yn,NotSupportedError:uYi}=An(),vh=require("assert"),{kHTTP2B
|
|||
|
|
`),this.body=g.stream,this.contentLength=g.length}else rc.isBlobLike(r)&&this.contentType==null&&r.type&&(this.contentType=r.type,this.headers+=`content-type: ${r.type}\r
|
|||
|
|
`);rc.validateHandler(f,n,u),this.servername=rc.getServerName(this.host),this[ip]=f,Jr.create.hasSubscribers&&Jr.create.publish({request:this})}onBodySent(t){if(this[ip].onBodySent)try{return this[ip].onBodySent(t)}catch(i){this.abort(i)}}onRequestSent(){if(Jr.bodySent.hasSubscribers&&Jr.bodySent.publish({request:this}),this[ip].onRequestSent)try{return this[ip].onRequestSent()}catch(t){this.abort(t)}}onConnect(t){if(vh(!this.aborted),vh(!this.completed),this.error)t(this.error);else return this.abort=t,this[ip].onConnect(t)}onHeaders(t,i,n,r){vh(!this.aborted),vh(!this.completed),Jr.headers.hasSubscribers&&Jr.headers.publish({request:this,response:{statusCode:t,headers:i,statusText:r}});try{return this[ip].onHeaders(t,i,n,r)}catch(s){this.abort(s)}}onData(t){vh(!this.aborted),vh(!this.completed);try{return this[ip].onData(t)}catch(i){return this.abort(i),!1}}onUpgrade(t,i,n){return vh(!this.aborted),vh(!this.completed),this[ip].onUpgrade(t,i,n)}onComplete(t){this.onFinally(),vh(!this.aborted),this.completed=!0,Jr.trailers.hasSubscribers&&Jr.trailers.publish({request:this,trailers:t});try{return this[ip].onComplete(t)}catch(i){this.onError(i)}}onError(t){if(this.onFinally(),Jr.error.hasSubscribers&&Jr.error.publish({request:this,error:t}),!this.aborted)return this.aborted=!0,this[ip].onError(t)}onFinally(){this.errorHandler&&(this.body.off("error",this.errorHandler),this.errorHandler=null),this.endHandler&&(this.body.off("end",this.endHandler),this.endHandler=null)}addHeader(t,i){return dD(this,t,i),this}static[AYi](t,i,n){return new e(t,i,n)}static[pYi](t,i,n){let r=i.headers;i={...i,headers:null};let s=new e(t,i,n);if(s.headers={},Array.isArray(r)){if(r.length%2!==0)throw new yn("headers array must be even");for(let a=0;a<r.length;a+=2)dD(s,r[a],r[a+1],!0)}else if(r&&typeof r=="object"){let a=Object.keys(r);for(let o=0;o<a.length;o++){let c=a[o];dD(s,c,r[c],!0)}}else if(r!=null)throw new yn("headers must be an object or an array");return s}static[dYi](t){let i=t.split(`\r
|
|||
|
|
`),n={};for(let r of i){let[s,a]=r.split(": ");a==null||a.length===0||(n[s]?n[s]+=`,${a}`:n[s]=a)}return n}};function Ov(e,t,i){if(t&&typeof t=="object")throw new yn(`invalid ${e} header`);if(t=t!=null?`${t}`:"",nCt.exec(t)!==null)throw new yn(`invalid ${e} header`);return i?t:`${e}: ${t}\r
|
|||
|
|
`}function dD(e,t,i,n=!1){if(i&&typeof i=="object"&&!Array.isArray(i))throw new yn(`invalid ${t} header`);if(i===void 0)return;if(e.host===null&&t.length===4&&t.toLowerCase()==="host"){if(nCt.exec(i)!==null)throw new yn(`invalid ${t} header`);e.host=i}else if(e.contentLength===null&&t.length===14&&t.toLowerCase()==="content-length"){if(e.contentLength=parseInt(i,10),!Number.isFinite(e.contentLength))throw new yn("invalid content-length header")}else if(e.contentType===null&&t.length===12&&t.toLowerCase()==="content-type")e.contentType=i,n?e.headers[t]=Ov(t,i,n):e.headers+=Ov(t,i);else{if(t.length===17&&t.toLowerCase()==="transfer-encoding")throw new yn("invalid transfer-encoding header");if(t.length===10&&t.toLowerCase()==="connection"){let r=typeof i=="string"?i.toLowerCase():null;if(r!=="close"&&r!=="keep-alive")throw new yn("invalid connection header");r==="close"&&(e.reset=!0)}else{if(t.length===10&&t.toLowerCase()==="keep-alive")throw new yn("invalid keep-alive header");if(t.length===7&&t.toLowerCase()==="upgrade")throw new yn("invalid upgrade header");if(t.length===6&&t.toLowerCase()==="expect")throw new uYi("expect header not supported");if(iCt.exec(t)===null)throw new yn("invalid header key");if(Array.isArray(i))for(let r=0;r<i.length;r++)n?e.headers[t]?e.headers[t]+=`,${Ov(t,i[r],n)}`:e.headers[t]=Ov(t,i[r],n):e.headers+=Ov(t,i[r]);else n?e.headers[t]=Ov(t,i,n):e.headers+=Ov(t,i)}}}rCt.exports=Yde});var pj=A((UHn,aCt)=>{"use strict";var mYi=require("events"),zde=class extends mYi{dispatch(){throw new Error("not implemented")}close(){throw new Error("not implemented")}destroy(){throw new Error("not implemented")}};aCt.exports=zde});var hD=A((NHn,oCt)=>{"use strict";var fYi=pj(),{ClientDestroyedError:Wde,ClientClosedError:gYi,InvalidArgumentError:b0}=An(),{kDestroy:bYi,kClose:vYi,kDispatch:Jde,kInterceptors:jv}=kn(),v0=Symbol("destroyed"),AD=Symbol("closed"),yh=Symbol("onDestroyed"),y0=Symbol("onClosed"),dj=Symbol("Intercepted Dispatch"),Zde=class extends fYi{constructor(){super(),this[v0]=!1,this[yh]=null,this[AD]=!1,this[y0]=[]}get destroyed(){return this[v0]}get closed(){return this[AD]}get interceptors(){return this[jv]}set interceptors(t){if(t){for(let i=t.length-1;i>=0;i--)if(typeof this[jv][i]!="function")throw new b0("interceptor must be an function")}this[jv]=t}close(t){if(t===void 0)return new Promise((n,r)=>{this.close((s,a)=>s?r(s):n(a))});if(typeof t!="function")throw new b0("invalid callback");if(this[v0]){queueMicrotask(()=>t(new Wde,null));return}if(this[AD]){this[y0]?this[y0].push(t):queueMicrotask(()=>t(null,null));return}this[AD]=!0,this[y0].push(t);let i=()=>{let n=this[y0];this[y0]=null;for(let r=0;r<n.length;r++)n[r](null,null)};this[vYi]().then(()=>this.destroy()).then(()=>{queueMicrotask(i)})}destroy(t,i){if(typeof t=="function"&&(i=t,t=null),i===void 0)return new Promise((r,s)=>{this.destroy(t,(a,o)=>a?s(a):r(o))});if(typeof i!="function")throw new b0("invalid callback");if(this[v0]){this[yh]?this[yh].push(i):queueMicrotask(()=>i(null,null));return}t||(t=new Wde),this[v0]=!0,this[yh]=this[yh]||[],this[yh].push(i);let n=()=>{let r=this[yh];this[yh]=null;for(let s=0;s<r.length;s++)r[s](null,null)};this[bYi](t).then(()=>{queueMicrotask(n)})}[dj](t,i){if(!this[jv]||this[jv].length===0)return this[dj]=this[Jde],this[Jde](t,i);let n=this[Jde].bind(this);for(let r=this[jv].length-1;r>=0;r--)n=this[jv][r](n);return this[dj]=n,n(t,i)}dispatch(t,i){if(!i||typeof i!="object")throw new b0("handler must be an object");try{if(!t||typeof t!="object")throw new b0("opts must be an object.");if(this[v0]||this[yh])throw new Wde;if(this[AD])throw new gYi;return this[dj](t,i)}catch(n){if(typeof i.onError!="function")throw new b0("invalid onError method");return i.onError(n),!1}}};oCt.exports=Zde});var mD=A((qHn,uCt)=>{"use strict";var yYi=require("net"),cCt=require("assert"),lCt=xi(),{InvalidArgumentError:xYi,ConnectTimeoutError:EYi}=An(),Kde,Xde;global.FinalizationRegistry&&!process.env.NODE_V8_COVERAGE?Xde=class{constructor(t){this._maxCachedSessions=t,this._sessionCache=new Map,this._sessionRegistry=new gl
|
|||
|
|
`,this[_Ct]=c??3e5,this[BCt]=r??3e5,this[xD]=v??!0,this[XYi]=I,this[ED]=j,this[Wf]=null,this[kCt]=G>-1?G:-1,this[Qd]="h1",this[tl]=null,this[yj]=W?{openStreams:0,maxConcurrentStreams:te??100}:null,this[SCt]=`${this[Ws].hostname}${this[Ws].port?`:${this[Ws].port}`:""}`,this[Sn]=[],this[Dn]=0,this[el]=0}get pipelining(){return this[Zf]}set pipelining(t){this[Zf]=t,il(this,!0)}get[$v](){return this[Sn].length-this[el]}get[cr](){return this[el]-this[Dn]}get[Vv](){return this[Sn].length-this[Dn]}get[KYi](){return!!this[Cr]&&!this[E0]&&!this[Cr].destroyed}get[oAe](){let t=this[Cr];return t&&(t[no]||t[Ih]||t[C0])||this[Vv]>=(this[Zf]||1)||this[$v]>0}[ZYi](t){MCt(this),this.once("connect",t)}[izi](t,i){let n=t.origin||this[Ws].origin,r=this[Qd]==="h2"?aAe[rzi](n,t,i):aAe[azi](n,t,i);return this[Sn].push(r),this[Gv]||(dt.bodyLength(r.body)==null&&dt.isIterable(r.body)?(this[Gv]=1,process.nextTick(il,this)):il(this,!0)),this[Gv]&&this[Jf]!==2&&this[oAe]&&(this[Jf]=2),this[Jf]<2}async[ezi](){return new Promise(t=>{this[Vv]?this[Wf]=t:t(null)})}async[tzi](t){return new Promise(i=>{let n=this[Sn].splice(this[el]);for(let s=0;s<n.length;s++){let a=n[s];ro(this,a,t)}let r=()=>{this[Wf]&&(this[Wf](),this[Wf]=null),i()};this[tl]!=null&&(dt.destroy(this[tl],t),this[tl]=null,this[yj]=null),this[Cr]?dt.destroy(this[Cr].on("close",r),t):queueMicrotask(r),il(this)})}};function hzi(e){ze(e.code!=="ERR_TLS_CERT_ALTNAME_INVALID"),this[Cr][Js]=e,Cj(this[_d],e)}function mzi(e,t,i){let n=new Bd(`HTTP/2: "frameError" received - type ${e}, code ${t}`);i===0&&(this[Cr][Js]=n,Cj(this[_d],n))}function fzi(){dt.destroy(this,new I0("other side closed")),dt.destroy(this[Cr],new I0("other side closed"))}function gzi(e){let t=this[_d],i=new Bd(`HTTP/2: "GOAWAY" frame received with code ${e}`);if(t[Cr]=null,t[tl]=null,t.destroyed){ze(this[$v]===0);let n=t[Sn].splice(t[Dn]);for(let r=0;r<n.length;r++){let s=n[r];ro(this,s,i)}}else if(t[cr]>0){let n=t[Sn][t[Dn]];t[Sn][t[Dn]++]=null,ro(t,n,i)}t[el]=t[Dn],ze(t[cr]===0),t.emit("disconnect",t[Ws],[t],i),il(t)}var Id=dCt(),bzi=mj(),vzi=Buffer.alloc(0);async function yzi(){let e=process.env.JEST_WORKER_ID?nAe():void 0,t;try{t=await WebAssembly.compile(Buffer.from(vCt(),"base64"))}catch{t=await WebAssembly.compile(Buffer.from(e||nAe(),"base64"))}return await WebAssembly.instantiate(t,{env:{wasm_on_url:(i,n,r)=>0,wasm_on_status:(i,n,r)=>{ze.strictEqual(us.ptr,i);let s=n-wd+Cd.byteOffset;return us.onStatus(new fj(Cd.buffer,s,r))||0},wasm_on_message_begin:i=>(ze.strictEqual(us.ptr,i),us.onMessageBegin()||0),wasm_on_header_field:(i,n,r)=>{ze.strictEqual(us.ptr,i);let s=n-wd+Cd.byteOffset;return us.onHeaderField(new fj(Cd.buffer,s,r))||0},wasm_on_header_value:(i,n,r)=>{ze.strictEqual(us.ptr,i);let s=n-wd+Cd.byteOffset;return us.onHeaderValue(new fj(Cd.buffer,s,r))||0},wasm_on_headers_complete:(i,n,r,s)=>(ze.strictEqual(us.ptr,i),us.onHeadersComplete(n,!!r,!!s)||0),wasm_on_body:(i,n,r)=>{ze.strictEqual(us.ptr,i);let s=n-wd+Cd.byteOffset;return us.onBody(new fj(Cd.buffer,s,r))||0},wasm_on_message_complete:i=>(ze.strictEqual(us.ptr,i),us.onMessageComplete()||0)}})}var sAe=null,uAe=yzi();uAe.catch();var us=null,Cd=null,gj=0,wd=null,w0=1,vj=2,pAe=3,dAe=class{constructor(t,i,{exports:n}){ze(Number.isFinite(t[bj])&&t[bj]>0),this.llhttp=n,this.ptr=this.llhttp.llhttp_alloc(Id.TYPE.RESPONSE),this.client=t,this.socket=i,this.timeout=null,this.timeoutValue=null,this.timeoutType=null,this.statusCode=null,this.statusText="",this.upgrade=!1,this.headers=[],this.headersSize=0,this.headersMaxSize=t[bj],this.shouldKeepAlive=!1,this.paused=!1,this.resume=this.resume.bind(this),this.bytesRead=0,this.keepAlive="",this.contentLength="",this.connection="",this.maxResponseSize=t[kCt]}setTimeout(t,i){this.timeoutType=i,t!==this.timeoutValue?(rAe.clearTimeout(this.timeout),t?(this.timeout=rAe.setTimeout(xzi,t,this),this.timeout.unref&&this.timeout.unref()):this.timeout=null,this.timeoutValue=t):this.timeout&&this.timeout.refresh&&this.timeout.refresh()}resume(){this.socket.destroyed||!this.paused||(ze(this.ptr!=null),ze(us==null),this.llhttp.llhtt
|
|||
|
|
`;return typeof s=="string"?m+=`host: ${s}\r
|
|||
|
|
`:m+=e[ICt],a?m+=`connection: upgrade\r
|
|||
|
|
upgrade: ${a}\r
|
|||
|
|
`:e[Zf]&&!h[no]?m+=`connection: keep-alive\r
|
|||
|
|
`:m+=`connection: close\r
|
|||
|
|
`,o&&(m+=o),wa.sendHeaders.hasSubscribers&&wa.sendHeaders.publish({request:t,headers:m,socket:h}),!i||l===0?(p===0?h.write(`${m}content-length: 0\r
|
|||
|
|
\r
|
|||
|
|
`,"latin1"):(ze(p===null,"no body must not have content length"),h.write(`${m}\r
|
|||
|
|
`,"latin1")),t.onRequestSent()):dt.isBuffer(i)?(ze(p===i.byteLength,"buffer body must have content length"),h.cork(),h.write(`${m}content-length: ${p}\r
|
|||
|
|
\r
|
|||
|
|
`,"latin1"),h.write(i),h.uncork(),t.onBodySent(i),t.onRequestSent(),d||(h[no]=!0)):dt.isBlobLike(i)?typeof i.stream=="function"?Ej({body:i.stream(),client:e,request:t,socket:h,contentLength:p,header:m,expectsPayload:d}):LCt({body:i,client:e,request:t,socket:h,contentLength:p,header:m,expectsPayload:d}):dt.isStream(i)?NCt({body:i,client:e,request:t,socket:h,contentLength:p,header:m,expectsPayload:d}):dt.isIterable(i)?Ej({body:i,client:e,request:t,socket:h,contentLength:p,header:m,expectsPayload:d}):ze(!1),!0}function Czi(e,t,i){let{body:n,method:r,path:s,host:a,upgrade:o,expectContinue:c,signal:u,headers:d}=i,l;if(typeof d=="string"?l=aAe[szi](d.trim()):l=d,o)return ro(e,i,new Error("Upgrade not supported for H2")),!1;try{i.onConnect(v=>{i.aborted||i.completed||ro(e,i,v||new hAe)})}catch(v){ro(e,i,v)}if(i.aborted)return!1;let p,h=e[yj];if(l[ozi]=a||e[SCt],l[czi]=r,r==="CONNECT")return t.ref(),p=t.request(l,{endStream:!1,signal:u}),p.id&&!p.pending?(i.onUpgrade(null,null,p),++h.openStreams):p.once("ready",()=>{i.onUpgrade(null,null,p),++h.openStreams}),p.once("close",()=>{h.openStreams-=1,h.openStreams===0&&t.unref()}),!0;l[lzi]=s,l[uzi]="https";let m=r==="PUT"||r==="POST"||r==="PATCH";n&&typeof n.read=="function"&&n.read(0);let f=dt.bodyLength(n);if(f==null&&(f=i.contentLength),(f===0||!m)&&(f=null),UCt(r)&&f>0&&i.contentLength!=null&&i.contentLength!==f){if(e[xD])return ro(e,i,new Eh),!1;process.emitWarning(new Eh)}f!=null&&(ze(n,"no body must not have content length"),l[pzi]=`${f}`),t.ref();let g=r==="GET"||r==="HEAD";return c?(l[dzi]="100-continue",p=t.request(l,{endStream:g,signal:u}),p.once("continue",b)):(p=t.request(l,{endStream:g,signal:u}),b()),++h.openStreams,p.once("response",v=>{let{[Azi]:y,...I}=v;i.onHeaders(Number(y),I,p.resume.bind(p),"")===!1&&p.pause()}),p.once("end",()=>{i.onComplete([])}),p.on("data",v=>{i.onData(v)===!1&&p.pause()}),p.once("close",()=>{h.openStreams-=1,h.openStreams===0&&t.unref()}),p.once("error",function(v){e[tl]&&!e[tl].destroyed&&!this.closed&&!this.destroyed&&(h.streams-=1,dt.destroy(p,v))}),p.once("frameError",(v,y)=>{let I=new Bd(`HTTP/2: "frameError" received - type ${v}, code ${y}`);ro(e,i,I),e[tl]&&!e[tl].destroyed&&!this.closed&&!this.destroyed&&(h.streams-=1,dt.destroy(p,I))}),!0;function b(){n?dt.isBuffer(n)?(ze(f===n.byteLength,"buffer body must have content length"),p.cork(),p.write(n),p.uncork(),p.end(),i.onBodySent(n),i.onRequestSent()):dt.isBlobLike(n)?typeof n.stream=="function"?Ej({client:e,request:i,contentLength:f,h2stream:p,expectsPayload:m,body:n.stream(),socket:e[Cr],header:""}):LCt({body:n,client:e,request:i,contentLength:f,expectsPayload:m,h2stream:p,header:"",socket:e[Cr]}):dt.isStream(n)?NCt({body:n,client:e,request:i,contentLength:f,expectsPayload:m,socket:e[Cr],h2stream:p,header:""}):dt.isIterable(n)?Ej({body:n,client:e,request:i,contentLength:f,expectsPayload:m,header:"",h2stream:p,socket:e[Cr]}):ze(!1):i.onRequestSent()}}function NCt({h2stream:e,body:t,client:i,request:n,socket:r,contentLength:s,header:a,expectsPayload:o}){if(ze(s!==0||i[cr]===0,"stream body cannot be pipelined"),i[Qd]==="h2"){let f=function(g){n.onBodySent(g)},m=OYi(t,e,g=>{g?(dt.destroy(t,g),dt.destroy(e,g)):n.onRequestSent()});m.on("data",f),m.once("end",()=>{m.removeListener("data",f),dt.destroy(m)});return}let c=!1,u=new Ij({socket:r,request:n,contentLength:s,client:i,expectsPayload:o,header:a}),d=function(m){if(!c)try{!u.write(m)&&this.pause&&this.pause()}catch(f){dt.destroy(this,f)}},l=function(){c||t.resume&&t.resume()},p=function(){if(c)return;let m=new hAe;queueMicrotask(()=>h(m))},h=function(m){if(!c){if(c=!0,ze(r.destroyed||r[Ih]&&i[cr]<=1),r.off("drain",l).off("error",h),t.removeListener("data",d).removeListener("end",h).removeListener("error",h).removeListener("close",p),!m)try{u.end()}catch(f){m=f}u.destroy(m),m&&(m.code!=="UND_ERR_INFO"||m.message!=="reset")?dt.destroy(t,m):dt.destroy(t)}};t.on("data",d).on("end",h).on("error",h).on("close",p),t.resume&&t.resume(),r.on("drain",l).on("error",h)}async function LCt({h2stream:e,body:t,client:i,request:n,socket:r,contentLen
|
|||
|
|
\r
|
|||
|
|
`,"latin1"),r.write(u),r.uncork()),n.onBodySent(u),n.onRequestSent(),o||(r[no]=!0),il(i)}catch(u){dt.destroy(c?e:r,u)}}async function Ej({h2stream:e,body:t,client:i,request:n,socket:r,contentLength:s,header:a,expectsPayload:o}){ze(s!==0||i[cr]===0,"iterator body cannot be pipelined");let c=null;function u(){if(c){let p=c;c=null,p()}}let d=()=>new Promise((p,h)=>{ze(c===null),r[Js]?h(r[Js]):c=p});if(i[Qd]==="h2"){e.on("close",u).on("drain",u);try{for await(let p of t){if(r[Js])throw r[Js];let h=e.write(p);n.onBodySent(p),h||await d()}}catch(p){e.destroy(p)}finally{n.onRequestSent(),e.end(),e.off("close",u).off("drain",u)}return}r.on("close",u).on("drain",u);let l=new Ij({socket:r,request:n,contentLength:s,client:i,expectsPayload:o,header:a});try{for await(let p of t){if(r[Js])throw r[Js];l.write(p)||await d()}l.end()}catch(p){l.destroy(p)}finally{r.off("close",u).off("drain",u)}}var Ij=class{constructor({socket:t,request:i,contentLength:n,client:r,expectsPayload:s,header:a}){this.socket=t,this.request=i,this.contentLength=n,this.client=r,this.bytesWritten=0,this.expectsPayload=s,this.header=a,t[Ih]=!0}write(t){let{socket:i,request:n,contentLength:r,client:s,bytesWritten:a,expectsPayload:o,header:c}=this;if(i[Js])throw i[Js];if(i.destroyed)return!1;let u=Buffer.byteLength(t);if(!u)return!0;if(r!==null&&a+u>r){if(s[xD])throw new Eh;process.emitWarning(new Eh)}i.cork(),a===0&&(o||(i[no]=!0),r===null?i.write(`${c}transfer-encoding: chunked\r
|
|||
|
|
`,"latin1"):i.write(`${c}content-length: ${r}\r
|
|||
|
|
\r
|
|||
|
|
`,"latin1")),r===null&&i.write(`\r
|
|||
|
|
${u.toString(16)}\r
|
|||
|
|
`,"latin1"),this.bytesWritten+=u;let d=i.write(t);return i.uncork(),n.onBodySent(t),d||i[Ir].timeout&&i[Ir].timeoutType===w0&&i[Ir].timeout.refresh&&i[Ir].timeout.refresh(),d}end(){let{socket:t,contentLength:i,client:n,bytesWritten:r,expectsPayload:s,header:a,request:o}=this;if(o.onRequestSent(),t[Ih]=!1,t[Js])throw t[Js];if(!t.destroyed){if(r===0?s?t.write(`${a}content-length: 0\r
|
|||
|
|
\r
|
|||
|
|
`,"latin1"):t.write(`${a}\r
|
|||
|
|
`,"latin1"):i===null&&t.write(`\r
|
|||
|
|
0\r
|
|||
|
|
\r
|
|||
|
|
`,"latin1"),i!==null&&r!==i){if(n[xD])throw new Eh;process.emitWarning(new Eh)}t[Ir].timeout&&t[Ir].timeoutType===w0&&t[Ir].timeout.refresh&&t[Ir].timeout.refresh(),il(n)}}destroy(t){let{socket:i,client:n}=this;i[Ih]=!1,t&&(ze(n[cr]<=1,"pipeline should only contain this request"),dt.destroy(i,t))}};function ro(e,t,i){try{t.onError(i),ze(t.aborted)}catch(n){e.emit("error",n)}}FCt.exports=lAe});var PCt=A((zHn,qCt)=>{"use strict";var wj=class{constructor(){this.bottom=0,this.top=0,this.list=new Array(2048),this.next=null}isEmpty(){return this.top===this.bottom}isFull(){return(this.top+1&2047)===this.bottom}push(t){this.list[this.top]=t,this.top=this.top+1&2047}shift(){let t=this.list[this.bottom];return t===void 0?null:(this.list[this.bottom]=void 0,this.bottom=this.bottom+1&2047,t)}};qCt.exports=class{constructor(){this.head=this.tail=new wj}isEmpty(){return this.head.isEmpty()}push(t){this.head.isFull()&&(this.head=this.head.next=new wj),this.head.push(t)}shift(){let t=this.tail,i=t.shift();return t.isEmpty()&&t.next!==null&&(this.tail=t.next),i}}});var jCt=A((WHn,OCt)=>{"use strict";var{kFree:wzi,kConnected:Bzi,kPending:_zi,kQueued:Qzi,kRunning:kzi,kSize:Szi}=kn(),Hv=Symbol("pool"),mAe=class{constructor(t){this[Hv]=t}get connected(){return this[Hv][Bzi]}get free(){return this[Hv][wzi]}get pending(){return this[Hv][_zi]}get queued(){return this[Hv][Qzi]}get running(){return this[Hv][kzi]}get size(){return this[Hv][Szi]}};OCt.exports=mAe});var xAe=A((JHn,KCt)=>{"use strict";var Dzi=hD(),Rzi=PCt(),{kConnected:fAe,kSize:GCt,kRunning:VCt,kPending:$Ct,kQueued:CD,kBusy:Tzi,kFree:Mzi,kUrl:Uzi,kClose:Nzi,kDestroy:Lzi,kDispatch:Fzi}=kn(),qzi=jCt(),sc=Symbol("clients"),so=Symbol("needDrain"),wD=Symbol("queue"),gAe=Symbol("closed resolve"),bAe=Symbol("onDrain"),HCt=Symbol("onConnect"),YCt=Symbol("onDisconnect"),zCt=Symbol("onConnectionError"),vAe=Symbol("get dispatcher"),JCt=Symbol("add client"),ZCt=Symbol("remove client"),WCt=Symbol("stats"),yAe=class extends Dzi{constructor(){super(),this[wD]=new Rzi,this[sc]=[],this[CD]=0;let t=this;this[bAe]=function(n,r){let s=t[wD],a=!1;for(;!a;){let o=s.shift();if(!o)break;t[CD]--,a=!this.dispatch(o.opts,o.handler)}this[so]=a,!this[so]&&t[so]&&(t[so]=!1,t.emit("drain",n,[t,...r])),t[gAe]&&s.isEmpty()&&Promise.all(t[sc].map(o=>o.close())).then(t[gAe])},this[HCt]=(i,n)=>{t.emit("connect",i,[t,...n])},this[YCt]=(i,n,r)=>{t.emit("disconnect",i,[t,...n],r)},this[zCt]=(i,n,r)=>{t.emit("connectionError",i,[t,...n],r)},this[WCt]=new qzi(this)}get[Tzi](){return this[so]}get[fAe](){return this[sc].filter(t=>t[fAe]).length}get[Mzi](){return this[sc].filter(t=>t[fAe]&&!t[so]).length}get[$Ct](){let t=this[CD];for(let{[$Ct]:i}of this[sc])t+=i;return t}get[VCt](){let t=0;for(let{[VCt]:i}of this[sc])t+=i;return t}get[GCt](){let t=this[CD];for(let{[GCt]:i}of this[sc])t+=i;return t}get stats(){return this[WCt]}async[Nzi](){return this[wD].isEmpty()?Promise.all(this[sc].map(t=>t.close())):new Promise(t=>{this[gAe]=t})}async[Lzi](t){for(;;){let i=this[wD].shift();if(!i)break;i.handler.onError(t)}return Promise.all(this[sc].map(i=>i.destroy(t)))}[Fzi](t,i){let n=this[vAe]();return n?n.dispatch(t,i)||(n[so]=!0,this[so]=!this[vAe]()):(this[so]=!0,this[wD].push({opts:t,handler:i}),this[CD]++),!this[so]}[JCt](t){return t.on("drain",this[bAe]).on("connect",this[HCt]).on("disconnect",this[YCt]).on("connectionError",this[zCt]),this[sc].push(t),this[so]&&process.nextTick(()=>{this[so]&&this[bAe](t[Uzi],[this,t])}),this}[ZCt](t){t.close(()=>{let i=this[sc].indexOf(t);i!==-1&&this[sc].splice(i,1)}),this[so]=this[sc].some(i=>!i[so]&&i.closed!==!0&&i.destroyed!==!0)}};KCt.exports={PoolBase:yAe,kClients:sc,kNeedDrain:so,kAddClient:JCt,kRemoveClient:ZCt,kGetDispatcher:vAe}});var B0=A((ZHn,t0t)=>{"use strict";var{PoolBase:Pzi,kClients:Bj,kNeedDrain:Ozi,kAddClient:jzi,kGetDispatcher:Gzi}=xAe(),Vzi=ID(),{InvalidArgumentError:EAe}=An(),IAe=xi(),{kUrl:XCt,kInterceptors:$zi}=kn(),Hzi=mD(),CAe=Symbol("options"),wAe=Symbol("connections"),e0t=Symbol("factory");function Yzi(e,t){return new Vzi(e,t)}var BAe=class extends Pzi{constructor
|
|||
|
|
${n.count} ${n.noun} ${n.is} pending:
|
|||
|
|
|
|||
|
|
${t.format(i)}
|
|||
|
|
`.trim())}};Twt.exports=uhe});var Pwt=A((E6n,qwt)=>{"use strict";var{kProxy:z9i,kClose:W9i,kDestroy:J9i,kInterceptors:Z9i}=kn(),{URL:Uwt}=require("url"),Nwt=_D(),K9i=B0(),X9i=hD(),{InvalidArgumentError:RD,RequestAbortedError:eJi}=An(),Lwt=mD(),SD=Symbol("proxy agent"),Yj=Symbol("proxy client"),DD=Symbol("proxy headers"),phe=Symbol("request tls settings"),tJi=Symbol("proxy tls settings"),Fwt=Symbol("connect endpoint function");function iJi(e){return e==="https:"?443:80}function nJi(e){if(typeof e=="string"&&(e={uri:e}),!e||!e.uri)throw new RD("Proxy opts.uri is mandatory");return{uri:e.uri,protocol:e.protocol||"https"}}function rJi(e,t){return new K9i(e,t)}var dhe=class extends X9i{constructor(t){if(super(t),this[z9i]=nJi(t),this[SD]=new Nwt(t),this[Z9i]=t.interceptors&&t.interceptors.ProxyAgent&&Array.isArray(t.interceptors.ProxyAgent)?t.interceptors.ProxyAgent:[],typeof t=="string"&&(t={uri:t}),!t||!t.uri)throw new RD("Proxy opts.uri is mandatory");let{clientFactory:i=rJi}=t;if(typeof i!="function")throw new RD("Proxy opts.clientFactory must be a function.");this[phe]=t.requestTls,this[tJi]=t.proxyTls,this[DD]=t.headers||{};let n=new Uwt(t.uri),{origin:r,port:s,host:a,username:o,password:c}=n;if(t.auth&&t.token)throw new RD("opts.auth cannot be used in combination with opts.token");t.auth?this[DD]["proxy-authorization"]=`Basic ${t.auth}`:t.token?this[DD]["proxy-authorization"]=t.token:o&&c&&(this[DD]["proxy-authorization"]=`Basic ${Buffer.from(`${decodeURIComponent(o)}:${decodeURIComponent(c)}`).toString("base64")}`);let u=Lwt({...t.proxyTls});this[Fwt]=Lwt({...t.requestTls}),this[Yj]=i(n,{connect:u}),this[SD]=new Nwt({...t,connect:async(d,l)=>{let p=d.host;d.port||(p+=`:${iJi(d.protocol)}`);try{let{socket:h,statusCode:m}=await this[Yj].connect({origin:r,port:s,path:p,signal:d.signal,headers:{...this[DD],host:a}});if(m!==200&&(h.on("error",()=>{}).destroy(),l(new eJi(`Proxy response (${m}) !== 200 when HTTP Tunneling`))),d.protocol!=="https:"){l(null,h);return}let f;this[phe]?f=this[phe].servername:f=d.servername,this[Fwt]({...d,servername:f,httpSocket:h},l)}catch(h){l(h)}}})}dispatch(t,i){let{host:n}=new Uwt(t.origin),r=sJi(t.headers);return aJi(r),this[SD].dispatch({...t,headers:{...r,host:n}},i)}async[W9i](){await this[SD].close(),await this[Yj].close()}async[J9i](){await this[SD].destroy(),await this[Yj].destroy()}};function sJi(e){if(Array.isArray(e)){let t={};for(let i=0;i<e.length;i+=2)t[e[i]]=e[i+1];return t}return e}function aJi(e){if(e&&Object.keys(e).find(i=>i.toLowerCase()==="proxy-authorization"))throw new RD("Proxy-Authorization should be sent in ProxyAgent constructor")}qwt.exports=dhe});var $wt=A((I6n,Vwt)=>{"use strict";var Kv=require("assert"),{kRetryHandlerDefaultRetry:Owt}=kn(),{RequestRetryError:zj}=An(),{isDisturbed:jwt,parseHeaders:oJi,parseRangeHeader:Gwt}=xi();function cJi(e){let t=Date.now();return new Date(e).getTime()-t}var Ahe=class e{constructor(t,i){let{retryOptions:n,...r}=t,{retry:s,maxRetries:a,maxTimeout:o,minTimeout:c,timeoutFactor:u,methods:d,errorCodes:l,retryAfter:p,statusCodes:h}=n??{};this.dispatch=i.dispatch,this.handler=i.handler,this.opts=r,this.abort=null,this.aborted=!1,this.retryOpts={retry:s??e[Owt],retryAfter:p??!0,maxTimeout:o??30*1e3,timeout:c??500,timeoutFactor:u??2,maxRetries:a??5,methods:d??["GET","HEAD","OPTIONS","PUT","DELETE","TRACE"],statusCodes:h??[500,502,503,504,429],errorCodes:l??["ECONNRESET","ECONNREFUSED","ENOTFOUND","ENETDOWN","ENETUNREACH","EHOSTDOWN","EHOSTUNREACH","EPIPE"]},this.retryCount=0,this.start=0,this.end=null,this.etag=null,this.resume=null,this.handler.onConnect(m=>{this.aborted=!0,this.abort?this.abort(m):this.reason=m})}onRequestSent(){this.handler.onRequestSent&&this.handler.onRequestSent()}onUpgrade(t,i,n){this.handler.onUpgrade&&this.handler.onUpgrade(t,i,n)}onConnect(t){this.aborted?t(this.reason):this.abort=t}onBodySent(t){if(this.handler.onBodySent)return this.handler.onBodySent(t)}static[Owt](t,{state:i,opts:n},r){let{statusCode:s,code:a,headers:o}=t,{method:c,retryOptions:u}=n,{maxRetries:d,timeout:l,maxTimeout:p,timeoutFactor:h,st
|
|||
|
|
Must be one of: ${t.join(", ")}`);if(n&&!lme.includes(n))throw new RangeError(`Invalid size provided: ${n}
|
|||
|
|
Must be one of: ${lme.join(", ")}`);let r=new gXi.URL(`${this.base}${e}.${i}`);return n&&r.searchParams.set("size",String(n)),r.toString()}};wr(dme,"CDN");function ekt(e){return Reflect.has(e,"_errors")}wr(ekt,"isErrorGroupWrapper");function tkt(e){return typeof Reflect.get(e,"message")=="string"}wr(tkt,"isErrorResponse");var WD=class extends Error{constructor(e,t,i,n,r,s){super(WD.getMessage(e)),this.rawError=e,this.code=t,this.status=i,this.method=n,this.url=r,this.requestBody={files:s.files,json:s.body}}requestBody;get name(){return`${WD.name}[${this.code}]`}static getMessage(e){let t="";return"code"in e?(e.errors&&(t=[...this.flattenDiscordError(e.errors)].join(`
|
|||
|
|
`)),e.message&&t?`${e.message}
|
|||
|
|
${t}`:e.message||t||"Unknown Error"):e.error_description??"No Description"}static*flattenDiscordError(e,t=""){if(tkt(e))return yield`${t.length?`${t}[${e.code}]`:`${e.code}`}: ${e.message}`.trim();for(let[i,n]of Object.entries(e)){let r=i.startsWith("_")?t:t?Number.isNaN(Number(i))?`${t}.${i}`:`${t}[${i}]`:i;if(typeof n=="string")yield n;else if(ekt(n))for(let s of n._errors)yield*this.flattenDiscordError(s,r);else yield*this.flattenDiscordError(n,r)}}};wr(WD,"DiscordAPIError");var yXi=require("http"),KG=class extends Error{constructor(e,t,i,n){super(yXi.STATUS_CODES[e]),this.status=e,this.method=t,this.url=i,this.requestBody={files:n.files,json:n.body}}requestBody;name=KG.name};wr(KG,"HTTPError");var XG=class extends Error{timeToReset;limit;method;hash;url;route;majorParameter;global;constructor({timeToReset:e,limit:t,method:i,hash:n,url:r,route:s,majorParameter:a,global:o}){super(),this.timeToReset=e,this.limit=t,this.method=i,this.hash=n,this.url=r,this.route=s,this.majorParameter=a,this.global=o}get name(){return`${XG.name}[${this.route}]`}};wr(XG,"RateLimitError");var ome=require("buffer"),xXi=require("events"),HG=require("timers"),YG=re(),EXi=cn(),IXi=lr(),CXi=sy(),wXi=require("timers/promises"),jQt=require("buffer"),ikt=require("url"),GQt=require("util"),BXi=sy();function sg(e){return e===void 0||typeof e=="string"?e:e.join(";")}wr(sg,"parseHeader");function nkt(e){switch(typeof e){case"string":return e;case"number":case"bigint":case"boolean":return e.toString();case"object":return e===null?null:e instanceof Date?Number.isNaN(e.getTime())?null:e.toISOString():typeof e.toString=="function"&&e.toString!==Object.prototype.toString?e.toString():null;default:return null}}wr(nkt,"serializeSearchParam");function rkt(e){let t=new ikt.URLSearchParams;if(!e)return t;for(let[i,n]of Object.entries(e)){let r=nkt(n);r!==null&&t.append(i,r)}return t}wr(rkt,"makeURLSearchParams");async function e4(e){return sg(e.headers["content-type"])?.startsWith("application/json")?e.body.json():e.body.arrayBuffer()}wr(e4,"parseResponse");function pme(e,t,i){if(e==="/channels/:id"){if(typeof t!="object"||t===null||i!=="PATCH")return!1;let n=t;return["name","topic"].some(r=>Reflect.has(n,r))}return!0}wr(pme,"hasSublimit");async function skt(e){if(e==null)return null;if(typeof e=="string")return e;if(GQt.types.isUint8Array(e))return e;if(GQt.types.isArrayBuffer(e))return new Uint8Array(e);if(e instanceof ikt.URLSearchParams)return e.toString();if(e instanceof DataView)return new Uint8Array(e.buffer);if(e instanceof jQt.Blob)return new Uint8Array(await e.arrayBuffer());if(e instanceof BXi.FormData)return e;if(e[Symbol.iterator]){let t=[...e],i=t.reduce((s,a)=>s+a.length,0),n=new Uint8Array(i),r=0;return t.reduce((s,a)=>(s.set(a,r),r+=a.length,s),n)}else if(e[Symbol.asyncIterator]){let t=[];for await(let i of e)t.push(i);return jQt.Buffer.concat(t)}throw new TypeError("Unable to resolve body.")}wr(skt,"resolveBody");function akt(e){return e.name==="AbortError"?!0:"code"in e&&e.code==="ECONNRESET"||e.message.includes("ECONNRESET")}wr(akt,"shouldRetry");async function JG(e,t){let{options:i}=e;if(!i.rejectOnRateLimit)return;if(typeof i.rejectOnRateLimit=="function"?await i.rejectOnRateLimit(t):i.rejectOnRateLimit.some(r=>t.route.startsWith(r.toLowerCase())))throw new XG(t)}wr(JG,"onRateLimit");var VQt=require("timers"),_Xi=sy(),zG=0,WG=null;function Ame(e){(!WG||WG<Date.now())&&(WG=Date.now()+1e3*60*10,zG=0),zG++,e.options.invalidRequestWarningInterval>0&&zG%e.options.invalidRequestWarningInterval===0&&e.emit("invalidRequestWarning",{count:zG,remainingTime:WG-Date.now()})}wr(Ame,"incrementInvalidCount");async function hme(e,t,i,n,r,s){let a=new AbortController,o=(0,VQt.setTimeout)(()=>a.abort(),e.options.timeout).unref();if(r.signal){let u=r.signal;u.aborted?a.abort():u.addEventListener("abort",()=>a.abort())}let c;try{c=await(0,_Xi.request)(i,{...n,signal:a.signal})}catch(u){if(!(u instanceof Error))throw u;if(akt(u)&&s!==e.options.retries)return null;throw u}finally{(0,VQt.clearTimeout)(o)}return e.listenerCount("response")&&e.emit("response",{met
|
|||
|
|
`)),await(0,wXi.setTimeout)(c),this.runRequest(e,t,i,n,r)}else{let d=await mme(this.manager,a,s,t,n,r);return d===null?this.runRequest(e,t,i,n,++r):d}}};wr(okt,"BurstHandler");var cme=require("timers/promises"),$Qt=$b(),ckt=class{constructor(e,t,i){this.manager=e,this.hash=t,this.majorParameter=i,this.id=`${t}:${i}`}id;reset=-1;remaining=1;limit=Number.POSITIVE_INFINITY;#e=new $Qt.AsyncQueue;#t=null;#n=null;#i=!1;get inactive(){return this.#e.remaining===0&&(this.#t===null||this.#t.remaining===0)&&!this.limited}get globalLimited(){return this.manager.globalRemaining<=0&&Date.now()<this.manager.globalReset}get localLimited(){return this.remaining<=0&&Date.now()<this.reset}get limited(){return this.globalLimited||this.localLimited}get timeToReset(){return this.reset+this.manager.options.offset-Date.now()}debug(e){this.manager.emit("restDebug",`[REST ${this.id}] ${e}`)}async globalDelayFor(e){await(0,cme.setTimeout)(e),this.manager.globalDelay=null}async queueRequest(e,t,i,n){let r=this.#e,s=0;if(this.#t&&pme(e.bucketRoute,n.body,i.method)&&(r=this.#t,s=1),await r.wait({signal:n.signal}),s===0)if(this.#t&&pme(e.bucketRoute,n.body,i.method)){r=this.#t;let a=r.wait();this.#e.shift(),await a}else this.#n&&await this.#n.promise;try{return await this.runRequest(e,t,i,n)}finally{r.shift(),this.#i&&(this.#i=!1,this.#t?.shift()),this.#t?.remaining===0&&(this.#n?.resolve(),this.#t=null)}}async runRequest(e,t,i,n,r=0){for(;this.limited;){let f=this.globalLimited,g,b,v;f?(g=this.manager.options.globalRequestsPerSecond,b=this.manager.globalReset+this.manager.options.offset-Date.now(),this.manager.globalDelay||(this.manager.globalDelay=this.globalDelayFor(b)),v=this.manager.globalDelay):(g=this.limit,b=this.timeToReset,v=(0,cme.setTimeout)(b));let y={timeToReset:b,limit:g,method:i.method??"get",hash:this.hash,url:t,route:e.bucketRoute,majorParameter:this.majorParameter,global:f};this.manager.emit("rateLimited",y),await JG(this.manager,y),f?this.debug(`Global rate limit hit, blocking all requests for ${b}ms`):this.debug(`Waiting ${b}ms for rate limit to pass`),await v}(!this.manager.globalReset||this.manager.globalReset<Date.now())&&(this.manager.globalReset=Date.now()+1e3,this.manager.globalRemaining=this.manager.options.globalRequestsPerSecond),this.manager.globalRemaining--;let s=i.method??"get",a=await hme(this.manager,e,t,i,n,r);if(a===null)return this.runRequest(e,t,i,n,++r);let o=a.statusCode,c=0,u=sg(a.headers["x-ratelimit-limit"]),d=sg(a.headers["x-ratelimit-remaining"]),l=sg(a.headers["x-ratelimit-reset-after"]),p=sg(a.headers["x-ratelimit-bucket"]),h=sg(a.headers["retry-after"]);if(this.limit=u?Number(u):Number.POSITIVE_INFINITY,this.remaining=d?Number(d):1,this.reset=l?Number(l)*1e3+Date.now()+this.manager.options.offset:Date.now(),h&&(c=Number(h)*1e3+this.manager.options.offset),p&&p!==this.hash)this.debug(["Received bucket hash update",` Old Hash : ${this.hash}`,` New Hash : ${p}`].join(`
|
|||
|
|
`)),this.manager.hashes.set(`${s}:${e.bucketRoute}`,{value:p,lastAccess:Date.now()});else if(p){let f=this.manager.hashes.get(`${s}:${e.bucketRoute}`);f&&(f.lastAccess=Date.now())}let m=null;if(c>0&&(a.headers["x-ratelimit-global"]!==void 0?(this.manager.globalRemaining=0,this.manager.globalReset=Date.now()+c):this.localLimited||(m=c)),(o===401||o===403||o===429)&&Ame(this.manager),o>=200&&o<300)return a;if(o===429){let f=this.globalLimited,g,b;if(f?(g=this.manager.options.globalRequestsPerSecond,b=this.manager.globalReset+this.manager.options.offset-Date.now()):(g=this.limit,b=this.timeToReset),await JG(this.manager,{timeToReset:b,limit:g,method:s,hash:this.hash,url:t,route:e.bucketRoute,majorParameter:this.majorParameter,global:f}),this.debug(["Encountered unexpected 429 rate limit",` Global : ${f.toString()}`,` Method : ${s}`,` URL : ${t}`,` Bucket : ${e.bucketRoute}`,` Major parameter: ${e.majorParameter}`,` Hash : ${this.hash}`,` Limit : ${g}`,` Retry After : ${c}ms`,` Sublimit : ${m?`${m}ms`:"None"}`].join(`
|
|||
|
|
`)),m){let v=!this.#t;v&&(this.#t=new $Qt.AsyncQueue,this.#t.wait(),this.#e.shift()),this.#n?.resolve(),this.#n=null,await(0,cme.setTimeout)(m);let y,I=new Promise(T=>y=T);this.#n={promise:I,resolve:y},v&&(await this.#e.wait(),this.#i=!0)}return this.runRequest(e,t,i,n,r)}else{let f=await mme(this.manager,a,s,t,n,r);return f===null?this.runRequest(e,t,i,n,++r):f}}};wr(ckt,"SequentialHandler");var QXi=(0,EXi.lazy)(async()=>Promise.resolve().then(()=>(PQt(),qQt))),lkt=(e=>(e.Delete="DELETE",e.Get="GET",e.Patch="PATCH",e.Post="POST",e.Put="PUT",e))(lkt||{}),t4=class extends xXi.EventEmitter{agent=null;globalRemaining;globalDelay=null;globalReset=-1;hashes=new YG.Collection;handlers=new YG.Collection;#e=null;hashTimer;handlerTimer;options;constructor(e){super(),this.options={...ZG,...e},this.options.offset=Math.max(0,this.options.offset),this.globalRemaining=this.options.globalRequestsPerSecond,this.agent=e.agent??null,this.setupSweepers()}setupSweepers(){let e=wr(t=>{if(t>144e5)throw new Error("Cannot set an interval greater than 4 hours")},"validateMaxInterval");this.options.hashSweepInterval!==0&&this.options.hashSweepInterval!==Number.POSITIVE_INFINITY&&(e(this.options.hashSweepInterval),this.hashTimer=(0,HG.setInterval)(()=>{let t=new YG.Collection,i=Date.now();this.hashes.sweep((n,r)=>{if(n.lastAccess===-1)return!1;let s=Math.floor(i-n.lastAccess)>this.options.hashLifetime;return s&&t.set(r,n),this.emit("restDebug",`Hash ${n.value} for ${r} swept due to lifetime being exceeded`),s}),this.emit("hashSweep",t)},this.options.hashSweepInterval).unref()),this.options.handlerSweepInterval!==0&&this.options.handlerSweepInterval!==Number.POSITIVE_INFINITY&&(e(this.options.handlerSweepInterval),this.handlerTimer=(0,HG.setInterval)(()=>{let t=new YG.Collection;this.handlers.sweep((i,n)=>{let{inactive:r}=i;return r&&t.set(n,i),this.emit("restDebug",`Handler ${i.id} for ${n} swept due to being inactive`),r}),this.emit("handlerSweep",t)},this.options.handlerSweepInterval).unref())}setAgent(e){return this.agent=e,this}setToken(e){return this.#e=e,this}async queueRequest(e){let t=t4.generateRouteData(e.fullRoute,e.method),i=this.hashes.get(`${e.method}:${t.bucketRoute}`)??{value:`Global(${e.method}:${t.bucketRoute})`,lastAccess:-1},n=this.handlers.get(`${i.value}:${t.majorParameter}`)??this.createHandler(i.value,t.majorParameter),{url:r,fetchOptions:s}=await this.resolveRequest(e);return n.queueRequest(t,r,s,{body:e.body,files:e.files,auth:e.auth!==!1,signal:e.signal})}createHandler(e,t){let i=t===ume?new okt(this,e,t):new ckt(this,e,t);return this.handlers.set(i.id,i),i}async resolveRequest(e){let{options:t}=this,i="";if(e.query){let c=e.query.toString();c!==""&&(i=`?${c}`)}let n={...this.options.headers,"User-Agent":`${zQt} ${t.userAgentAppendix}`.trim()};if(e.auth!==!1){if(!this.#e)throw new Error("Expected token to be set for this request, but none was present");n.Authorization=`${e.authPrefix??this.options.authPrefix} ${this.#e}`}e.reason?.length&&(n["X-Audit-Log-Reason"]=encodeURIComponent(e.reason));let r=`${t.api}${e.versioned===!1?"":`/v${t.version}`}${e.fullRoute}${i}`,s,a={};if(e.files?.length){let c=new CXi.FormData;for(let[u,d]of e.files.entries()){let l=d.key??`files[${u}]`;if(ome.Buffer.isBuffer(d.data)){let{fileTypeFromBuffer:p}=await QXi(),h=d.contentType;if(!h){let m=(await p(d.data))?.mime;m&&(h=XQt[m]??m)}c.append(l,new ome.Blob([d.data],{type:h}),d.name)}else c.append(l,new ome.Blob([`${d.data}`],{type:d.contentType}),d.name)}if(e.body!=null)if(e.appendToFormData)for(let[u,d]of Object.entries(e.body))c.append(u,d);else c.append("payload_json",JSON.stringify(e.body));s=c}else e.body!=null&&(e.passThroughBody?s=e.body:(s=JSON.stringify(e.body),a={"Content-Type":"application/json"}));s=await skt(s);let o={headers:{...e.headers,...a,...n},method:e.method.toUpperCase()};return s!==void 0&&(o.body=s),o.dispatcher=e.dispatcher??this.agent??void 0,{url:r,fetchOptions:o}}clearHashSweeper(){(0,HG.clearInterval)(this.hashTimer)}clearHandlerSweeper(){(0,HG.clearInterval)(this.handlerTimer)}static generateRouteData(e,t){if(e.
|
|||
|
|
`).join(`\r
|
|||
|
|
`)),s.removeListener("error",TUt),d.setSocket(s,a,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(d),d.on("close",()=>{this.clients.delete(d),this._shouldEmitClose&&!this.clients.size&&process.nextTick(S1,this)})),o(d,r)}};UUt.exports=wye;function kpn(e,t){for(let i of Object.keys(t))e.on(i,t[i]);return function(){for(let n of Object.keys(t))e.removeListener(n,t[n])}}function S1(e){e._state=MUt,e.emit("close")}function TUt(){this.destroy()}function D1(e,t,i,n){i=i||R8.STATUS_CODES[t],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(i),...n},e.once("finish",e.destroy),e.end(`HTTP/1.1 ${t} ${R8.STATUS_CODES[t]}\r
|
|||
|
|
`+Object.keys(n).map(r=>`${r}: ${n[r]}`).join(`\r
|
|||
|
|
`)+`\r
|
|||
|
|
\r
|
|||
|
|
`+i)}function By(e,t,i,n,r,s){if(e.listenerCount("wsClientError")){let a=new Error(r);Error.captureStackTrace(a,By),e.emit("wsClientError",a,i,t)}else D1(i,n,r,s)}});var FUt=A((a9n,LUt)=>{"use strict";var Ph=D8();Ph.createWebSocketStream=_Ut();Ph.Server=NUt();Ph.Receiver=mye();Ph.Sender=bye();Ph.WebSocket=Ph;Ph.WebSocketServer=Ph.Server;LUt.exports=Ph});var Rye=A((o9n,nNt)=>{"use strict";var Spn=Object.create,gw=Object.defineProperty,Dpn=Object.getOwnPropertyDescriptor,Rpn=Object.getOwnPropertyNames,Tpn=Object.getPrototypeOf,Mpn=Object.prototype.hasOwnProperty,Upn=(e,t,i)=>t in e?gw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,dl=(e,t)=>gw(e,"name",{value:t,configurable:!0}),Npn=(e,t)=>{for(var i in t)gw(e,i,{get:t[i],enumerable:!0})},VUt=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Rpn(t))!Mpn.call(e,r)&&r!==i&&gw(e,r,{get:()=>t[r],enumerable:!(n=Dpn(t,r))||n.enumerable});return e},Lpn=(e,t,i)=>(i=e!=null?Spn(Tpn(e)):{},VUt(t||!e||!e.__esModule?gw(i,"default",{value:e,enumerable:!0}):i,e)),Fpn=e=>VUt(gw({},"__esModule",{value:!0}),e),qpn=(e,t,i)=>(Upn(e,typeof t!="symbol"?t+"":t,i),i),$Ut={};Npn($Ut,{CloseCodes:()=>eNt,CompressionMethod:()=>JUt,DefaultDeviceProperty:()=>_ye,DefaultWebSocketManagerOptions:()=>ZUt,Encoding:()=>WUt,ImportantGatewayOpcodes:()=>KUt,SimpleContextFetchingStrategy:()=>F8,SimpleIdentifyThrottler:()=>kye,SimpleShardingStrategy:()=>Dye,WebSocketManager:()=>iNt,WebSocketShard:()=>P8,WebSocketShardDestroyRecovery:()=>Sye,WebSocketShardEvents:()=>q8,WebSocketShardStatus:()=>XUt,WorkerBootstrapper:()=>tNt,WorkerContextFetchingStrategy:()=>Qye,WorkerReceivePayloadOp:()=>YUt,WorkerSendPayloadOp:()=>HUt,WorkerShardingStrategy:()=>zUt,getInitialSendRateLimitState:()=>R1,managerToFetchingStrategyOptions:()=>L8,version:()=>adn});nNt.exports=Fpn($Ut);async function L8(e){let{buildIdentifyThrottler:t,buildStrategy:i,retrieveSessionInfo:n,updateSessionInfo:r,shardCount:s,shardIds:a,rest:o,...c}=e.options;return{...c,gatewayInformation:await e.fetchGatewayInformation(),shardCount:await e.getShardCount()}}dl(L8,"managerToFetchingStrategyOptions");var U8=class{constructor(e,t){this.manager=e,this.options=t}static async ensureThrottler(e){let t=U8.throttlerCache.get(e);if(t)return t;let i=await e.options.buildIdentifyThrottler(e);return U8.throttlerCache.set(e,i),i}async retrieveSessionInfo(e){return this.manager.options.retrieveSessionInfo(e)}updateSessionInfo(e,t){return this.manager.options.updateSessionInfo(e,t)}async waitForIdentify(e,t){await(await U8.ensureThrottler(this.manager)).waitForIdentify(e,t)}},F8=U8;dl(F8,"SimpleContextFetchingStrategy");qpn(F8,"throttlerCache",new WeakMap);var hw=require("worker_threads"),qUt=re(),Ppn=require("events"),T8=require("path"),Opn=require("worker_threads"),mw=re(),HUt=(e=>(e[e.Connect=0]="Connect",e[e.Destroy=1]="Destroy",e[e.Send=2]="Send",e[e.SessionInfoResponse=3]="SessionInfoResponse",e[e.ShardIdentifyResponse=4]="ShardIdentifyResponse",e[e.FetchStatus=5]="FetchStatus",e))(HUt||{}),YUt=(e=>(e[e.Connected=0]="Connected",e[e.Destroyed=1]="Destroyed",e[e.Event=2]="Event",e[e.RetrieveSessionInfo=3]="RetrieveSessionInfo",e[e.UpdateSessionInfo=4]="UpdateSessionInfo",e[e.WaitForIdentify=5]="WaitForIdentify",e[e.FetchStatusResponse=6]="FetchStatusResponse",e[e.WorkerReady=7]="WorkerReady",e[e.CancelIdentify=8]="CancelIdentify",e))(YUt||{}),zUt=class{manager;options;#e=[];#t=new mw.Collection;connectPromises=new mw.Collection;destroyPromises=new mw.Collection;fetchStatusPromises=new mw.Collection;waitForIdentifyControllers=new mw.Collection;throttler;constructor(e,t){this.manager=e,this.options=t}async spawn(e){let t=this.options.shardsPerWorker==="all"?e.length:this.options.shardsPerWorker,i=await L8(this.manager),n=Math.ceil(e.length/t),r=[];for(let s=0;s<n;s++){let a=e.slice(s*t,(s+1)*t),o={...i,shardIds:a};r.push(this.setupWorker(o))}await Promise.all(r)}async connect(){let e=[];for(let[t,i]of this.#t.entries()){let n={op:0,shardId:t},r=new Promise(s=>this.connectPromises.set(t,s));i.postMessage(n),e.push(r)}await Promise.a
|
|||
|
|
${e.slice(1).map(i=>` ${i}`).join(`
|
|||
|
|
`)}`:""}`;this.emit("debug",{message:t})}};dl(P8,"WebSocketShard");var Dye=class{manager;shards=new jpn.Collection;constructor(e){this.manager=e}async spawn(e){let t=await L8(this.manager);for(let i of e){let n=new F8(this.manager,t),r=new P8(n,i);for(let s of Object.values(q8))r.on(s,a=>this.manager.emit(s,{...a,shardId:i}));this.shards.set(i,r)}}async connect(){let e=[];for(let t of this.shards.values())e.push(t.connect());await Promise.all(e)}async destroy(e){let t=[];for(let i of this.shards.values())t.push(i.destroy(e));await Promise.all(t),this.shards.clear()}async send(e,t){let i=this.shards.get(e);if(!i)throw new RangeError(`Shard ${e} not found`);return i.send(t)}async fetchStatus(){return this.shards.mapValues(e=>e.status)}};dl(Dye,"SimpleShardingStrategy");var bg=require("worker_threads"),ndn=re(),tNt=class{data=bg.workerData;shards=new ndn.Collection;constructor(){if(bg.isMainThread)throw new Error("Expected WorkerBootstrap to not be used within the main thread")}async connect(e){let t=this.shards.get(e);if(!t)throw new RangeError(`Shard ${e} does not exist`);await t.connect()}async destroy(e,t){let i=this.shards.get(e);if(!i)throw new RangeError(`Shard ${e} does not exist`);await i.destroy(t)}setupThreadEvents(){bg.parentPort.on("messageerror",e=>{throw e}).on("message",async e=>{switch(e.op){case 0:{await this.connect(e.shardId);let t={op:0,shardId:e.shardId};bg.parentPort.postMessage(t);break}case 1:{await this.destroy(e.shardId,e.options);let t={op:1,shardId:e.shardId};bg.parentPort.postMessage(t);break}case 2:{let t=this.shards.get(e.shardId);if(!t)throw new RangeError(`Shard ${e.shardId} does not exist`);await t.send(e.payload);break}case 3:break;case 4:break;case 5:{let t=this.shards.get(e.shardId);if(!t)throw new Error(`Shard ${e.shardId} does not exist`);let i={op:6,status:t.status,nonce:e.nonce};bg.parentPort.postMessage(i);break}}})}async bootstrap(e={}){for(let i of this.data.shardIds){let n=new P8(new Qye(this.data),i);for(let r of e.forwardEvents??Object.values(q8))n.on(r,s=>{let a={op:2,event:r,data:s,shardId:i};bg.parentPort.postMessage(a)});await e.shardCallback?.(n),this.shards.set(i,n)}this.setupThreadEvents();let t={op:7};bg.parentPort.postMessage(t)}};dl(tNt,"WorkerBootstrapper");var GUt=cn(),rdn=PI(),sdn=Be(),iNt=class extends rdn.AsyncEventEmitter{options;gatewayInformation=null;shardIds=null;strategy;constructor(e){super(),this.options={...ZUt,...e},this.strategy=this.options.buildStrategy(this)}async fetchGatewayInformation(e=!1){if(this.gatewayInformation){if(this.gatewayInformation.expiresAt<=Date.now())this.gatewayInformation=null;else if(!e)return this.gatewayInformation.data}let t=await this.options.rest.get(sdn.Routes.gatewayBot());return this.gatewayInformation={data:t,expiresAt:Date.now()+t.session_start_limit.reset_after},this.gatewayInformation.data}async updateShardCount(e){await this.strategy.destroy({reason:"User is adjusting their shards"}),this.options.shardCount=e;let t=await this.getShardIds(!0);return await this.strategy.spawn(t),this}async getShardCount(){if(this.options.shardCount)return this.options.shardCount;let e=await this.getShardIds();return Math.max(...e)+1}async getShardIds(e=!1){if(this.shardIds&&!e)return this.shardIds;let t;if(this.options.shardIds)if(Array.isArray(this.options.shardIds))t=this.options.shardIds;else{let{start:i,end:n}=this.options.shardIds;t=[...(0,GUt.range)({start:i,end:n+1})]}else{let i=await this.fetchGatewayInformation();t=[...(0,GUt.range)(this.options.shardCount??i.shards)]}return this.shardIds=t,t}async connect(){let e=await this.getShardCount(),t=await this.fetchGatewayInformation();if(t.session_start_limit.remaining<e)throw new Error(`Not enough sessions remaining to spawn ${e} shards; only ${t.session_start_limit.remaining} remaining; resets at ${new Date(Date.now()+t.session_start_limit.reset_after).toISOString()}`);await this.updateShardCount(e),await this.strategy.connect()}destroy(e){return this.strategy.destroy(e)}send(e,t){return this.strategy.send(e,t)}fetchStatus(){return this.strategy.fetchStatus()}};dl(iNt,"WebSock
|
|||
|
|
Event Code: ${t.code}
|
|||
|
|
Clean : ${t.wasClean}
|
|||
|
|
Reason : ${t.reason??"No reason received"}`),this.emit(G8.Close,t)}onReadyPacket(t){if(!t){this.debug(`Received broken packet: '${t}'.`);return}this.emit(G8.Ready),this.expectedGuilds=new Set(t.guilds.map(i=>i.id)),this.status=j8.WaitingForGuilds}gotGuild(t){this.expectedGuilds.delete(t),this.checkReady()}checkReady(){if(this.readyTimeout&&(udn(this.readyTimeout),this.readyTimeout=null),!this.expectedGuilds.size){this.debug("Shard received all its guilds. Marking as fully ready."),this.status=j8.Ready,this.emit(G8.AllReady);return}let t=this.manager.client.options.intents.has(pdn.Guilds),{waitGuildTimeout:i}=this.manager.client.options;this.readyTimeout=ldn(()=>{this.debug(`Shard ${t?"did":"will"} not receive any more guild packets${t?` in ${i} ms`:""}.
|
|||
|
|
Unavailable guild count: ${this.expectedGuilds.size}`),this.readyTimeout=null,this.status=j8.Ready,this.emit(G8.AllReady,this.expectedGuilds)},t?i:0).unref()}send(t,i=!1){i&&!sNt&&(cdn.emitWarning("Sending important payloads explicitly is deprecated. They are determined by their opcode implicitly now.","DeprecationWarning"),sNt=!0),this.manager._ws.send(this.id,t)}};aNt.exports=Tye});var cNt=A((b9n,oNt)=>{"use strict";oNt.exports=(e,t)=>{e.actions.ApplicationCommandPermissionsUpdate.handle(t.d)}});var uNt=A((v9n,lNt)=>{"use strict";lNt.exports=(e,t)=>{e.actions.AutoModerationActionExecution.handle(t.d)}});var dNt=A((y9n,pNt)=>{"use strict";pNt.exports=(e,t)=>{e.actions.AutoModerationRuleCreate.handle(t.d)}});var hNt=A((x9n,ANt)=>{"use strict";ANt.exports=(e,t)=>{e.actions.AutoModerationRuleDelete.handle(t.d)}});var fNt=A((E9n,mNt)=>{"use strict";mNt.exports=(e,t)=>{e.actions.AutoModerationRuleUpdate.handle(t.d)}});var bNt=A((I9n,gNt)=>{"use strict";gNt.exports=(e,t)=>{e.actions.ChannelCreate.handle(t.d)}});var yNt=A((C9n,vNt)=>{"use strict";vNt.exports=(e,t)=>{e.actions.ChannelDelete.handle(t.d)}});var ENt=A((w9n,xNt)=>{"use strict";var ddn=qe();xNt.exports=(e,{d:t})=>{let i=e.channels.cache.get(t.channel_id),n=t.last_pin_timestamp?Date.parse(t.last_pin_timestamp):null;i&&(i.lastPinTimestamp=n,e.emit(ddn.ChannelPinsUpdate,i,n))}});var CNt=A((B9n,INt)=>{"use strict";var Adn=qe();INt.exports=(e,t)=>{let{old:i,updated:n}=e.actions.ChannelUpdate.handle(t.d);i&&n&&e.emit(Adn.ChannelUpdate,i,n)}});var BNt=A((_9n,wNt)=>{"use strict";wNt.exports=(e,t)=>{e.actions.GuildAuditLogEntryCreate.handle(t.d)}});var QNt=A((Q9n,_Nt)=>{"use strict";_Nt.exports=(e,t)=>{e.actions.GuildBanAdd.handle(t.d)}});var SNt=A((k9n,kNt)=>{"use strict";kNt.exports=(e,t)=>{e.actions.GuildBanRemove.handle(t.d)}});var RNt=A((S9n,DNt)=>{"use strict";var hdn=qe(),mdn=Pd();DNt.exports=(e,{d:t},i)=>{let n=e.guilds.cache.get(t.id);n?!n.available&&!t.unavailable&&n._patch(t):(t.shardId=i.id,n=e.guilds._add(t),e.ws.status===mdn.Ready&&e.emit(hdn.GuildCreate,n))}});var MNt=A((D9n,TNt)=>{"use strict";TNt.exports=(e,t)=>{e.actions.GuildDelete.handle(t.d)}});var NNt=A((R9n,UNt)=>{"use strict";UNt.exports=(e,t)=>{e.actions.GuildEmojisUpdate.handle(t.d)}});var FNt=A((T9n,LNt)=>{"use strict";LNt.exports=(e,t)=>{e.actions.GuildIntegrationsUpdate.handle(t.d)}});var PNt=A((M9n,qNt)=>{"use strict";var{Collection:fdn}=re(),gdn=qe();qNt.exports=(e,{d:t})=>{let i=e.guilds.cache.get(t.guild_id);if(!i)return;let n=new fdn;for(let r of t.members)n.set(r.user.id,i.members._add(r));if(t.presences)for(let r of t.presences)i.presences._add(Object.assign(r,{guild:i}));e.emit(gdn.GuildMembersChunk,n,i,{index:t.chunk_index,count:t.chunk_count,notFound:t.not_found,nonce:t.nonce})}});var jNt=A((U9n,ONt)=>{"use strict";var bdn=qe(),vdn=Pd();ONt.exports=(e,{d:t},i)=>{let n=e.guilds.cache.get(t.guild_id);if(n){n.memberCount++;let r=n.members._add(t);i.status===vdn.Ready&&e.emit(bdn.GuildMemberAdd,r)}}});var VNt=A((N9n,GNt)=>{"use strict";GNt.exports=(e,t,i)=>{e.actions.GuildMemberRemove.handle(t.d,i)}});var HNt=A((L9n,$Nt)=>{"use strict";$Nt.exports=(e,t,i)=>{e.actions.GuildMemberUpdate.handle(t.d,i)}});var zNt=A((F9n,YNt)=>{"use strict";YNt.exports=(e,t)=>{e.actions.GuildRoleCreate.handle(t.d)}});var JNt=A((q9n,WNt)=>{"use strict";WNt.exports=(e,t)=>{e.actions.GuildRoleDelete.handle(t.d)}});var KNt=A((P9n,ZNt)=>{"use strict";ZNt.exports=(e,t)=>{e.actions.GuildRoleUpdate.handle(t.d)}});var eLt=A((O9n,XNt)=>{"use strict";XNt.exports=(e,t)=>{e.actions.GuildScheduledEventCreate.handle(t.d)}});var iLt=A((j9n,tLt)=>{"use strict";tLt.exports=(e,t)=>{e.actions.GuildScheduledEventDelete.handle(t.d)}});var rLt=A((G9n,nLt)=>{"use strict";nLt.exports=(e,t)=>{e.actions.GuildScheduledEventUpdate.handle(t.d)}});var aLt=A((V9n,sLt)=>{"use strict";sLt.exports=(e,t)=>{e.actions.GuildScheduledEventUserAdd.handle(t.d)}});var cLt=A(($9n,oLt)=>{"use strict";oLt.exports=(e,t)=>{e.actions.GuildScheduledEventUserRemove.handle(t.d)}});var uLt=A((H9n,lLt)=>{"use strict";lLt.exports=(e,t)=>{e.actions.GuildStickersUpda
|
|||
|
|
URL: ${a}
|
|||
|
|
Recommended Shards: ${o}`),this.debug(`Session Limit Information
|
|||
|
|
Total: ${u}
|
|||
|
|
Remaining: ${d}`),this.gateway=`${a}/`,this.client.options.shardCount=await this._ws.getShardCount(),this.client.options.shards=await this._ws.getShardIds(),this.totalShards=this.client.options.shards.length;for(let l of this.client.options.shards)if(!this.shards.has(l)){let p=new Tdn(this,l);this.shards.set(l,p),p.on(T1.AllReady,h=>{this.client.emit(_y.ShardReady,p.id,h),this.checkShardsReady()}),p.status=Au.Connecting}await this._ws.connect(),this.shards.forEach(l=>{l.listenerCount(T1.InvalidSession)>0&&!EFt&&(vFt.emitWarning("The WebSocketShard#invalidSession event is deprecated and will never emit.","DeprecationWarning"),EFt=!0),l.listenerCount(T1.Destroyed)>0&&!IFt&&(vFt.emitWarning("The WebSocketShard#destroyed event is deprecated and will never emit.","DeprecationWarning"),IFt=!0)})}attachEvents(){this._ws.on(vg.Debug,({message:t,shardId:i})=>this.debug(t,i)),this._ws.on(vg.Dispatch,({data:t,shardId:i})=>{this.client.emit(_y.Raw,t,i);let n=this.shards.get(i);this.handlePacket(t,n),n.status===Au.WaitingForGuilds&&Ldn.includes(t.t)&&n.gotGuild(t.d.id)}),this._ws.on(vg.Ready,({data:t,shardId:i})=>{this.shards.get(i).onReadyPacket(t)}),this._ws.on(vg.Closed,({code:t,shardId:i})=>{let n=this.shards.get(i);if(n.emit(T1.Close,{code:t,reason:xFt,wasClean:!0}),Fdn.includes(t)&&this.destroyed){n.status=Au.Disconnected,this.client.emit(_y.ShardDisconnect,{code:t,reason:xFt,wasClean:!0},i),this.debug(Fye[t],i);return}this.shards.get(i).status=Au.Connecting,this.client.emit(_y.ShardReconnecting,i)}),this._ws.on(vg.Hello,({shardId:t})=>{let i=this.shards.get(t);i.sessionInfo?(i.closeSequence=i.sessionInfo.sequence,i.status=Au.Resuming):i.status=Au.Identifying}),this._ws.on(vg.Resumed,({shardId:t})=>{let i=this.shards.get(t);i.status=Au.Ready,i.emit(T1.Resumed)}),this._ws.on(vg.HeartbeatComplete,({heartbeatAt:t,latency:i,shardId:n})=>{this.debug(`Heartbeat acknowledged, latency of ${i}ms.`,n);let r=this.shards.get(n);r.lastPingTimestamp=t,r.ping=i}),this._ws.on(vg.Error,t=>{this.client.emit(_y.ShardError,t,t.shardId)})}broadcast(t){for(let i of this.shards.keys())this._ws.send(i,t)}destroy(){this.destroyed||(this.debug(`Manager was destroyed. Called by:
|
|||
|
|
${new Error().stack}`),this.destroyed=!0,this._ws.destroy({code:Lye.Normal}))}handlePacket(t,i){if(t&&this.status!==Au.Ready&&!Ndn.includes(t.t))return this.packetQueue.push({packet:t,shard:i}),!1;if(this.packetQueue.length){let n=this.packetQueue.shift();kdn(()=>{this.handlePacket(n.packet,n.shard)}).unref()}return t&&yFt[t.t]&&yFt[t.t](this.client,t,i),!0}checkShardsReady(){this.status!==Au.Ready&&(this.shards.size!==this.totalShards||this.shards.some(t=>t.status!==Au.Ready)||this.triggerClientReady())}triggerClientReady(){this.status=Au.Ready,this.client.readyTimestamp=Date.now(),this.client.emit(_y.ClientReady,this.client),this.handlePacket()}};wFt.exports=qye});var V8=A((wJn,BFt)=>{"use strict";var qdn=zn(),Pdn=p1(),Oye=S4(),{parseEmoji:Odn}=Yi(),jye=class extends qdn{constructor(t,i){super(t,Pdn,i)}resolve(t){return t instanceof Oye?super.resolve(t.id):super.resolve(t)}resolveId(t){return t instanceof Oye?t.id:super.resolveId(t)}resolveIdentifier(t){let i=this.resolve(t);if(i)return i.identifier;if(t instanceof Oye)return t.identifier;if(typeof t=="string"){let n=Odn(t);return n?.name.length&&(t=`${n.animated?"a:":""}${n.name}${n.id?`:${n.id}`:""}`),t.includes("%")?t:encodeURIComponent(t)}return null}};BFt.exports=jye});var Vye=A((BJn,QFt)=>{"use strict";var jdn=require("node:process"),{Routes:Gdn}=Be(),Vdn=zn(),{BaseChannel:$dn}=ag(),{createChannel:Hdn}=v1(),{ThreadChannelTypes:Ydn}=ap(),zdn=qe(),_Ft=!1,Gye=class extends Vdn{constructor(t,i){super(t,$dn,i);let n=this._cache.constructor.name==="Collection"||this._cache.maxSize===void 0||this._cache.maxSize===1/0;!_Ft&&!n&&(_Ft=!0,jdn.emitWarning(`Overriding the cache handling for ${this.constructor.name} is unsupported and breaks functionality.`,"UnsupportedCacheOverwriteWarning"))}_add(t,i,{cache:n=!0,allowUnknownGuild:r=!1}={}){let s=this.cache.get(t.id);if(s)return n&&s._patch(t),i?.channels?._add(s),Ydn.includes(s.type)&&s.parent?.threads?._add(s),s;let a=Hdn(this.client,t,i,{allowUnknownGuild:r});return a?(n&&!r&&this.cache.set(a.id,a),a):(this.client.emit(zdn.Debug,`Failed to find guild, or unknown type for channel ${t.id} ${t.type}`),null)}_remove(t){let i=this.cache.get(t);i?.guild?.channels.cache.delete(t);for(let[n,r]of i?.guild?.invites.cache??[])r.channelId===t&&i.guild.invites.cache.delete(n);i?.parent?.threads?.cache.delete(t),this.cache.delete(t)}async fetch(t,{allowUnknownGuild:i=!1,cache:n=!0,force:r=!1}={}){if(!r){let a=this.cache.get(t);if(a&&!a.partial)return a}let s=await this.client.rest.get(Gdn.channel(t));return this._add(s,null,{cache:n,allowUnknownGuild:i})}};QFt.exports=Gye});var Hye=A((_Jn,kFt)=>{"use strict";var{Collection:bw}=re(),Wdn=w4(),Jdn=a8(),Zdn=y1(),Kdn=Fd(),{flatten:Xdn}=Yi(),$ye=class{constructor(t,i){if(i.users)for(let n of i.users)t.client.users._add(n);if(i.threads)for(let n of i.threads)t.client.channels._add(n,t);if(this.webhooks=new bw,i.webhooks)for(let n of i.webhooks)this.webhooks.set(n.id,new Kdn(t.client,n));if(this.integrations=new bw,i.integrations)for(let n of i.integrations)this.integrations.set(n.id,new Zdn(t.client,n,t));if(this.guildScheduledEvents=i.guild_scheduled_events.reduce((n,r)=>n.set(r.id,t.scheduledEvents._add(r)),new bw),this.applicationCommands=new bw,i.application_commands)for(let n of i.application_commands)this.applicationCommands.set(n.id,new Wdn(t.client,n,t));this.autoModerationRules=i.auto_moderation_rules.reduce((n,r)=>n.set(r.id,t.autoModerationRules._add(r)),new bw),this.entries=new bw;for(let n of i.audit_log_entries){let r=new Jdn(t,n,this);this.entries.set(r.id,r)}}toJSON(){return Xdn(this)}};kFt.exports=$ye});var zye=A((QJn,SFt)=>{"use strict";var eAn=k4(),Yye=class extends eAn{constructor(t,i,n){super(t,i,n),this.roles=i.roles}};SFt.exports=Yye});var $8=A((kJn,RFt)=>{"use strict";var{Collection:DFt}=re(),{DiscordSnowflake:tAn}=lr(),{Routes:iAn}=Be(),nAn=Ei(),rAn=zye(),{Sticker:sAn}=lg(),Wye=class extends nAn{constructor(t,i){super(t),i&&this._patch(i)}_patch(t){this.id=t.id,"name"in t&&(this.name=t.name),"icon"in t&&(this.icon=t.icon),"splash"in t&&(this.splash=t.splash),"discover
|
|||
|
|
${e}
|
|||
|
|
\`\`\``:`\`\`\`${e}
|
|||
|
|
${t}
|
|||
|
|
\`\`\``}di(_qt,"codeBlock");function Qqt(e){return`\`${e}\``}di(Qqt,"inlineCode");function kqt(e){return`_${e}_`}di(kqt,"italic");function Sqt(e){return`**${e}**`}di(Sqt,"bold");function Dqt(e){return`__${e}__`}di(Dqt,"underscore");function Rqt(e){return`~~${e}~~`}di(Rqt,"strikethrough");function Tqt(e){return`> ${e}`}di(Tqt,"quote");function Mqt(e){return`>>> ${e}`}di(Mqt,"blockQuote");function Uqt(e){return`<${e}>`}di(Uqt,"hideLinkEmbed");function Nqt(e,t,i){return i?`[${e}](${t} "${i}")`:`[${e}](${t})`}di(Nqt,"hyperlink");function Lqt(e){return`||${e}||`}di(Lqt,"spoiler");function Fqt(e){return`<@${e}>`}di(Fqt,"userMention");function qqt(e){return`<#${e}>`}di(qqt,"channelMention");function Pqt(e){return`<@&${e}>`}di(Pqt,"roleMention");function Oqt(e,t,i,n){return n!==void 0?`</${e} ${t} ${i}:${n}>`:i!==void 0?`</${e} ${t}:${i}>`:`</${e}:${t}>`}di(Oqt,"chatInputApplicationCommandMention");function jqt(e,t=!1){return`<${t?"a":""}:_:${e}>`}di(jqt,"formatEmoji");function lV(e,t){return`https://discord.com/channels/${t??"@me"}/${e}`}di(lV,"channelLink");function Gqt(e,t,i){return`${i===void 0?lV(e):lV(e,i)}/${t}`}di(Gqt,"messageLink");var Vqt=(e=>(e[e.One=1]="One",e[e.Two=2]="Two",e[e.Three=3]="Three",e))(Vqt||{});function $qt(e,t){switch(t){case 3:return`### ${e}`;case 2:return`## ${e}`;default:return`# ${e}`}}di($qt,"heading");function pV(e,t,i=0){return Array.isArray(e)?e.map(n=>pV(n,t,i+1)).join(`
|
|||
|
|
`):`${" ".repeat(i-1)}${t?`${t}.`:"-"} ${e}`}di(pV,"listCallback");function Hqt(e,t=1){return pV(e,Math.max(t,1))}di(Hqt,"orderedList");function Yqt(e){return pV(e)}di(Yqt,"unorderedList");function zqt(e,t){return typeof e!="number"&&(e=Math.floor((e?.getTime()??Date.now())/1e3)),typeof t=="string"?`<t:${e}:${t}>`:`<t:${e}>`}di(zqt,"time");var bfn={ShortTime:"t",LongTime:"T",ShortDate:"d",LongDate:"D",ShortDateTime:"f",LongDateTime:"F",RelativeTime:"R"},Wqt=(e=>(e.Shrug="\xAF_(\u30C4)_/\xAF",e.Tableflip="(\u256F\xB0\u25A1\xB0)\u256F\uFE35 \u253B\u2501\u253B",e.Unflip="\u252C\u2500\u252C\u30CE( \xBA _ \xBA\u30CE)",e))(Wqt||{}),Jqt=(e=>(e.Browse="<id:browse>",e.Customize="<id:customize>",e.Guide="<id:guide>",e))(Jqt||{})});var PEe=A(O=>{"use strict";var{__exportStar:Uy}=(T7(),bCe(R7));O.BaseClient=u4();O.Client=$2t();O.Shard=fEe();O.ShardClientUtil=Zxe();O.ShardingManager=iqt();O.WebhookClient=$ge();O.DiscordjsError=KD().DiscordjsError;O.DiscordjsTypeError=KD().DiscordjsTypeError;O.DiscordjsRangeError=KD().DiscordjsRangeError;O.DiscordjsErrorCodes=ZD();O.ActivityFlagsBitField=xxe();O.ApplicationFlagsBitField=mge();O.BaseManager=o4();O.BitField=au();O.ChannelFlagsBitField=XD();O.Collection=re().Collection;O.Constants=ap();O.Colors=Cme();O.DataResolver=pc();O.Events=qe();O.Formatters=rqt();O.GuildMemberFlagsBitField=P4().GuildMemberFlagsBitField;O.IntentsBitField=uEe();O.LimitedCollection=Eme();O.MessageFlagsBitField=E4();O.Options=r4();O.Partials=ly();O.PermissionsBitField=uo();O.ShardEvents=hEe();O.Status=Pd();O.SnowflakeUtil=lr().DiscordSnowflake;O.Sweepers=AEe();O.SystemChannelFlagsBitField=aV();O.ThreadMemberFlagsBitField=ibe();O.UserFlagsBitField=Rge();Uy(Yi(),O);O.WebSocketShardEvents=O8();O.version=bme().version;O.ApplicationCommandManager=_4();O.ApplicationCommandPermissionsManager=l1();O.AutoModerationRuleManager=Zye();O.BaseGuildEmojiManager=V8();O.CachedManager=zn();O.ChannelManager=Vye();O.ClientVoiceManager=rye();O.DataManager=X0();O.GuildApplicationCommandManager=Xye();O.GuildBanManager=ixe();O.GuildChannelManager=rxe();O.GuildEmojiManager=oxe();O.GuildEmojiRoleManager=Qge();O.GuildForumThreadManager=xbe();O.GuildInviteManager=uxe();O.GuildManager=Hxe();O.GuildMemberManager=hxe();O.GuildMemberRoleManager=zge();O.GuildScheduledEventManager=gxe();O.GuildStickerManager=vxe();O.GuildTextThreadManager=K4();O.MessageManager=Ag();O.PermissionOverwriteManager=qme();O.PresenceManager=Cxe();O.ReactionManager=qge();O.ReactionUserManager=Uge();O.RoleManager=Qxe();O.StageInstanceManager=Sxe();O.ThreadManager=Z4();O.ThreadMemberManager=sbe();O.UserManager=Wxe();O.VoiceStateManager=Rxe();O.WebSocketManager=Pye();O.WebSocketShard=Mye();O.ActionRow=lfe();O.ActionRowBuilder=h4();O.Activity=Cw().Activity;O.AnonymousGuild=v4();O.Application=f4();O.ApplicationCommand=w4();O.ApplicationRoleConnectionMetadata=nge().ApplicationRoleConnectionMetadata;O.AutocompleteInteraction=nve();O.AutoModerationActionExecution=Yme();O.AutoModerationRule=n8();O.Base=Ei();O.BaseGuild=b4();O.BaseGuildEmoji=k4();O.BaseGuildTextChannel=e8();O.BaseGuildVoiceChannel=b1();O.ButtonBuilder=pfe();O.ButtonComponent=Afe();O.ButtonInteraction=cve();O.CategoryChannel=ife();O.BaseChannel=ag().BaseChannel;O.ChatInputCommandInteraction=dve();O.ClientApplication=Q4();O.ClientPresence=eEe();O.ClientUser=Nye();O.CommandInteraction=A8();O.Collector=n1();O.CommandInteractionOptionResolver=x1();O.Component=py();O.ContextMenuCommandInteraction=m8();O.DMChannel=ebe();O.Embed=vge();O.EmbedBuilder=aqt();O.Emoji=tw().Emoji;O.ForumChannel=Ebe();O.Guild=Pxe().Guild;O.GuildAuditLogs=Hye();O.GuildAuditLogsEntry=a8();O.GuildBan=o8();O.GuildChannel=Nd();O.GuildEmoji=p1();O.GuildMember=dg().GuildMember;O.GuildPreview=$8();O.GuildPreviewEmoji=zye();O.GuildScheduledEvent=r1().GuildScheduledEvent;O.GuildTemplate=s1();O.Integration=y1();O.IntegrationApplication=g4();O.BaseInteraction=Ay();O.InteractionCollector=ew();O.InteractionResponse=sve();O.InteractionWebhook=nw();O.Invite=cg();O.InviteStageInstance=jfe();O.InviteGuild=Jfe();O.Message=Dh().Message;O.Attachment=I4();O.AttachmentBui
|
|||
|
|
`?(s+=1,a=0):a+=1,r+=1,o+=1,t-=1;e.position=r,e.streamPosition=o,e.line=s,e.column=a,e.wasDataInCommand||(i?(e.trimCommandStartPosition=o,e.trimCommandStartLine=s,e.trimCommandStartColumn=a):e.wasDataInCommand=!0),i||(e.noWhitePosition=o,e.noWhiteLine=s,e.noWhiteColumn=a)}var iyn={type:"whitespace",length:1},nyn={type:"eoln",length:1},ryn={type:"data",length:1};function syn(e){if(!e.options.allowDollarDollarString)return null;let t=e.position,i=e.source,n=/^(\$[a-zA-Z0-9_]*\$)/.exec(i.slice(t));if(!n)return null;let r=n[1];for(t+=r.length;t<e.end;){if(i.slice(t).startsWith(r))return{type:"string",length:t+r.length-e.position};t++}return null}function CIe(e){var t;let i=e.position,n=e.source,r=n[i];if(e.isCopyFromStdin){if(n.slice(i).startsWith("\\.")&&!e.wasDataOnLine)return{type:"copy_stdin_end",length:2};let o=i;for(;o<e.end&&n[o]!=`
|
|||
|
|
`;)o++;return o<e.end&&n[o]==`
|
|||
|
|
`&&o++,{type:"copy_stdin_line",length:o-i}}if(e.options.stringsBegins.includes(r)){i++;let o=e.options.stringsEnds[r],c=e.options.stringEscapes[r];for(;i<e.end&&n[i]!=o;)c&&n[i]==c?i+=2:i++;return{type:"string",length:i-e.position+1}}if(e.options.queryParameterStyle&&((t=e.options.queryParameterStyle)===null||t===void 0?void 0:t.length)==1&&r==e.options.queryParameterStyle&&(e.options.queryParameterStyle=="?"||/[a-zA-Z0-9_]/.test(n[i+1]))){if(i++,e.options.queryParameterStyle!="?")for(;i<e.end&&/[a-zA-Z0-9_]/.test(n[i]);)i++;return{type:"parameter",value:n.slice(e.position,i),length:i-e.position}}let s=e.options.skipSeparatorBeginEnd&&e.beginEndIdentLevel>0;if(e.currentDelimiter&&n.slice(i).startsWith(e.currentDelimiter)&&!s)return{type:"delimiter",length:e.currentDelimiter.length};if(r==" "||r==" "||r=="\r")return iyn;if(r==`
|
|||
|
|
`)return nyn;if(e.options.doubleDashComments&&r=="-"&&n[i+1]=="-"){for(;i<e.end&&n[i]!=`
|
|||
|
|
`;)i++;return{type:"comment",length:i-e.position}}if(e.options.multilineComments&&r=="/"&&n[i+1]=="*"){for(i+=2;i<e.end&&!(n[i]=="*"&&n[i+1]=="/");)i++;return{type:"comment",length:i-e.position+2}}if(e.options.allowCustomDelimiter&&!e.wasDataOnLine){let o=n.slice(i).match(/^DELIMITER[ \t]+([^\n]+)/i);if(o)return{type:"set_delimiter",value:o[1].trim(),length:o[0].length}}if(e.options.allowCustomSqlTerminator){let o=n.slice(i).match(/^SET[ \t]+SQLT(ERMINATOR)?[ \t]+(ON|OFF|".")/i);if(o){if(o[2].toUpperCase()=="OFF")return{type:"set_sqlterminator",value:null,length:o[0].length};if(o[2].toUpperCase()=="ON")return{type:"set_sqlterminator",value:Z1,length:o[0].length};if(o[2].startsWith('"'))return{type:"set_sqlterminator",value:o[2].slice(1,-1),length:o[0].length}}}if((e.options.allowGoDelimiter||e.options.adaptiveGoSplit)&&!e.wasDataOnLine){let o=n.slice(i).match(/^GO[\t\r ]*(\n|$)/i);if(o)return{type:"go_delimiter",length:o[0].endsWith(`
|
|||
|
|
`)?o[0].length-1:o[0].length}}if(e.options.allowSlashDelimiter&&!e.wasDataOnLine){let o=n.slice(i).match(/^\/[\t\r ]*(\n|$)/i);if(o)return{type:"slash_delimiter",length:o[0].endsWith(`
|
|||
|
|
`)?o[0].length-1:o[0].length}}if(e.options.adaptiveGoSplit){let o=n.slice(i).match(/^(CREATE|ALTER)\s*(PROCEDURE|FUNCTION|TRIGGER)/i);if(o)return{type:"create_routine",length:o[0].length}}if(e.options.copyFromStdin&&!e.wasDataOnLine&&n.slice(i).startsWith("COPY "))return{type:"copy",length:5};if(e.isCopyFromStdinCandidate&&n.slice(i).startsWith("FROM stdin;")){let o=i+11,c=o-1;for(;o<e.end&&n[o]!=`
|
|||
|
|
`;)o++;return n[o]==`
|
|||
|
|
`&&o++,{type:"copy_stdin_start",length:o-i,lengthWithoutWhitespace:c-i}}if(e.options.skipSeparatorBeginEnd&&n.slice(i).match(/^begin/i)){let o=i+5,c=o;for(;c<e.end&&/[^a-zA-Z0-9]/.test(n[c]);)c++;if(!Xvn.test(n.slice(c)))return{type:"begin",length:o-i,lengthWithoutWhitespace:c-i}}if(e.options.skipSeparatorBeginEnd&&n.slice(i).match(/^end/i)){let o=i+3,c=o;for(;c<e.end&&/[^a-zA-Z0-9]/.test(n[c]);)c++;if(!tyn.test(n.slice(c)))return{type:"end",length:o-i}}let a=syn(e);return a||ryn}gu.scanToken=CIe;function ayn(e,t){var i;let n={options:e.options,source:e.source,position:e.position,currentDelimiter:e.currentDelimiter,end:e.end,wasDataOnLine:e.wasDataOnLine,isCopyFromStdinCandidate:e.isCopyFromStdinCandidate,isCopyFromStdin:e.isCopyFromStdin,beginEndIdentLevel:e.beginEndIdentLevel};for(n.position+=t.length;n.position<n.end;){let r=CIe(n);if(!r){n.position+=1;continue}switch(r.type){case"whitespace":n.position+=r.length;continue;case"eoln":return!1;case"comment":if(!((i=r.value)===null||i===void 0)&&i.includes(`
|
|||
|
|
`))return!0;n.position+=r.length;continue;default:return!0}}}function Yd(e,t){e.commandPart+=e.source.slice(e.currentCommandStart,e.position),Sjt(e,t)}function Sjt(e,t){let i=e.commandPart.substring(e.trimCommandStartPosition-e.commandStartPosition,e.noWhitePosition-e.commandStartPosition);i.trim()&&(e.options.returnRichInfo?e.pushOutput({text:i,start:{position:e.commandStartPosition,line:e.commandStartLine,column:e.commandStartColumn},end:{position:e.streamPosition,line:e.line,column:e.column},trimStart:{position:e.trimCommandStartPosition,line:e.trimCommandStartLine,column:e.trimCommandStartColumn},trimEnd:{position:e.noWhitePosition,line:e.noWhiteLine,column:e.noWhiteColumn},specialMarker:t}):e.pushOutput(i))}function Wh(e){e.commandStartPosition=e.streamPosition,e.commandStartLine=e.line,e.commandStartColumn=e.column,e.trimCommandStartPosition=e.streamPosition,e.trimCommandStartLine=e.line,e.trimCommandStartColumn=e.column,e.wasDataInCommand=!1}function oyn(e){for(;e.position<e.end;)e.source[e.position]==`
|
|||
|
|
`?(Yd(e),e.commandPart="",Jn(e,1,!0),e.currentCommandStart=e.position,Wh(e)):Jn(e,1,/\s/.test(e.source[e.position]));e.end>e.currentCommandStart&&(e.commandPart+=e.source.slice(e.currentCommandStart,e.position))}function Djt(e){if(e.options.splitByLines){oyn(e);return}for(;e.position<e.end;){let t=CIe(e);if(!t){Jn(e,1,!1);continue}switch(t.type){case"string":Jn(e,t.length,!1),e.wasDataOnLine=!0;break;case"comment":Jn(e,t.length,!!e.options.ignoreComments),e.wasDataOnLine=!0;break;case"eoln":if(!e.wasDataOnLine&&e.options.splitByEmptyLine){Yd(e),e.commandPart="",Jn(e,t.length,!1),e.currentCommandStart=e.position,e.wasDataOnLine=!1,Wh(e);break}Jn(e,t.length,!0),e.wasDataOnLine=!1;break;case"data":Jn(e,t.length,!1),e.wasDataOnLine=!0;break;case"parameter":Jn(e,t.length,!1),e.wasDataOnLine=!0;break;case"whitespace":Jn(e,t.length,!0);break;case"set_delimiter":case"set_sqlterminator":Yd(e),e.commandPart="",e.currentDelimiter=t.value,Jn(e,t.length,!1),e.currentCommandStart=e.position,Wh(e);break;case"go_delimiter":Yd(e),e.commandPart="",Jn(e,t.length,!1),e.currentCommandStart=e.position,Wh(e),e.options.adaptiveGoSplit&&(e.currentDelimiter=Z1);break;case"slash_delimiter":Yd(e),e.commandPart="",Jn(e,t.length,!1),e.currentCommandStart=e.position,Wh(e);break;case"create_routine":Jn(e,t.length,!1),e.options.adaptiveGoSplit&&(e.currentDelimiter=null);break;case"copy":Jn(e,t.length,!1),e.isCopyFromStdinCandidate=!0,e.wasDataOnLine=!0;break;case"copy_stdin_start":Jn(e,t.lengthWithoutWhitespace,!1),Jn(e,t.length-t.lengthWithoutWhitespace,!0),e.isCopyFromStdin=!0,e.isCopyFromStdinCandidate=!1,e.wasDataOnLine=!1,Yd(e,"copy_stdin_start"),e.commandPart="",e.currentCommandStart=e.position,Wh(e);break;case"copy_stdin_line":Jn(e,t.length,!1),e.isCopyFromStdin=!0,e.isCopyFromStdinCandidate=!1,Yd(e,"copy_stdin_line"),e.commandPart="",e.currentCommandStart=e.position,Wh(e);break;case"copy_stdin_end":Jn(e,t.length,!1),e.isCopyFromStdin=!1,e.wasDataOnLine=!0,Yd(e,"copy_stdin_end"),e.commandPart="",e.currentCommandStart=e.position,Wh(e);break;case"delimiter":if(e.options.preventSingleLineSplit&&ayn(e,t)){Jn(e,t.length,!1),e.wasDataOnLine=!0;break}e.options.keepSemicolonInCommands&&e.currentDelimiter===Z1?(Jn(e,1,!1),Yd(e)):(Yd(e),Jn(e,t.length,!1)),e.commandPart="",e.currentCommandStart=e.position,Wh(e),e.isCopyFromStdinCandidate=!1;break;case"begin":e.options.skipSeparatorBeginEnd&&e.beginEndIdentLevel++,Jn(e,t.length,!1);break;case"end":e.options.skipSeparatorBeginEnd&&e.beginEndIdentLevel>0&&e.beginEndIdentLevel--,Jn(e,t.length,!1);break}}e.end>e.currentCommandStart&&(e.commandPart+=e.source.slice(e.currentCommandStart,e.position))}gu.splitQueryLine=Djt;function Rjt(e){return e?.adaptiveGoSplit?Z1:e?.allowSemicolon===!1?null:Z1}gu.getInitialDelimiter=Rjt;function Tjt(e){Sjt(e)}gu.finishSplitStream=Tjt;function cyn(e,t=null){var i;let n=Object.assign(Object.assign({},Zvn.defaultSplitterOptions),t);if(n.noSplit){if(n.returnRichInfo){let a=e.split(`
|
|||
|
|
`);return[{text:e,start:{position:0,line:0,column:0},end:{position:e.length,line:a.length,column:((i=a[a.length-1])===null||i===void 0?void 0:i.length)||0}}]}return[e]}let r=[],s={source:e,end:e.length,currentDelimiter:Rjt(t),position:0,column:0,line:0,currentCommandStart:0,commandStartLine:0,commandStartColumn:0,commandStartPosition:0,streamPosition:0,noWhiteLine:0,noWhiteColumn:0,noWhitePosition:0,trimCommandStartPosition:0,trimCommandStartLine:0,trimCommandStartColumn:0,beginEndIdentLevel:0,wasDataInCommand:!1,isCopyFromStdin:!1,isCopyFromStdinCandidate:!1,pushOutput:a=>r.push(a),wasDataOnLine:!1,options:n,commandPart:""};return Djt(s),Tjt(s),r}gu.splitQuery=cyn});var Ujt=A(Lw=>{"use strict";Object.defineProperty(Lw,"__esModule",{value:!0});Lw.replaceQueryParameters=Lw.extractQueryParameters=void 0;var BIe=wIe();function Mjt(e,t){return{options:t,source:e,position:0,currentDelimiter:(0,BIe.getInitialDelimiter)(t),end:e.length,wasDataOnLine:!1,isCopyFromStdin:!1,isCopyFromStdinCandidate:!1,beginEndIdentLevel:0}}function lyn(e,t){if(!e||!t)return[];let i=Mjt(e,t),n=new Set;for(;i.position<i.end;){let r=(0,BIe.scanToken)(i);if(r===null)break;r.type==="parameter"&&(r.value=="?"?n.add(`?${n.size+1}`):n.add(r.value)),i.position+=r.length}return Array.from(n)}Lw.extractQueryParameters=lyn;function uyn(e,t,i){if(!e||!i)return e;let n=Mjt(e,i),r="",s=0;for(;n.position<n.end;){let a=(0,BIe.scanToken)(n);if(a===null)break;if(a.type==="parameter"){let o=a.value=="?"?`?${++s}`:a.value;t[o]?r+=t[o]:r+=e.substring(n.position,n.position+a.length)}else r+=e.substring(n.position,n.position+a.length);n.position+=a.length}return r}Lw.replaceQueryParameters=uyn});var Ljt=A(hl=>{"use strict";var pyn=hl&&hl.__createBinding||(Object.create?(function(e,t,i,n){n===void 0&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}):(function(e,t,i,n){n===void 0&&(n=i),e[n]=t[i]})),dyn=hl&&hl.__exportStar||function(e,t){for(var i in e)i!=="default"&&!Object.prototype.hasOwnProperty.call(t,i)&&pyn(t,e,i)};Object.defineProperty(hl,"__esModule",{value:!0});hl.replaceQueryParameters=hl.extractQueryParameters=hl.splitQuery=void 0;var Ayn=wIe();Object.defineProperty(hl,"splitQuery",{enumerable:!0,get:function(){return Ayn.splitQuery}});var Njt=Ujt();Object.defineProperty(hl,"extractQueryParameters",{enumerable:!0,get:function(){return Njt.extractQueryParameters}});Object.defineProperty(hl,"replaceQueryParameters",{enumerable:!0,get:function(){return Njt.replaceQueryParameters}});dyn(IIe(),hl)});var yer=Ze(_r(),1);function Vw(e,t){return function(){return e.apply(t,arguments)}}var{toString:C4t}=Object.prototype,{getPrototypeOf:y$}=Object,{iterator:yR,toStringTag:ECe}=Symbol,xR=(e=>t=>{let i=C4t.call(t);return e[i]||(e[i]=i.slice(8,-1).toLowerCase())})(Object.create(null)),Cu=e=>(e=e.toLowerCase(),t=>xR(t)===e),ER=e=>t=>typeof t===e,{isArray:tx}=Array,ex=ER("undefined");function $w(e){return e!==null&&!ex(e)&&e.constructor!==null&&!ex(e.constructor)&&Co(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}var ICe=Cu("ArrayBuffer");function w4t(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ICe(e.buffer),t}var B4t=ER("string"),Co=ER("function"),CCe=ER("number"),Hw=e=>e!==null&&typeof e=="object",_4t=e=>e===!0||e===!1,vR=e=>{if(xR(e)!=="object")return!1;let t=y$(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(ECe in e)&&!(yR in e)},Q4t=e=>{if(!Hw(e)||$w(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},k4t=Cu("Date"),S4t=Cu("File"),D4t=Cu("Blob"),R4t=Cu("FileList"),T4t=e=>Hw(e)&&Co(e.pipe),M4t=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||Co(e.append)&&((t=xR(e))==="formdata"||t==="object"&&Co(e.toString)&&e.toString()==="[object FormData]"))},U4t=Cu("URLSearchParams"),[N4t,L4t,F4t,q4t]=["ReadableStream","Request","Response","Headers"].map(Cu),P4t=e=>e.trim?e.trim(
|
|||
|
|
`).forEach(function(a){r=a.indexOf(":"),i=a.substring(0,r).trim().toLowerCase(),n=a.substring(r+1).trim(),!(!i||t[i]&&s$t[i])&&(i==="set-cookie"?t[i]?t[i].push(n):t[i]=[n]:t[i]=t[i]?t[i]+", "+n:n)}),t};var jwe=Symbol("internals");function eB(e){return e&&String(e).trim().toLowerCase()}function UR(e){return e===!1||e==null?e:q.isArray(e)?e.map(UR):String(e)}function a$t(e){let t=Object.create(null),i=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,n;for(;n=i.exec(e);)t[n[1]]=n[2];return t}var o$t=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function J$(e,t,i,n,r){if(q.isFunction(n))return n.call(this,t,i);if(r&&(t=i),!!q.isString(t)){if(q.isString(n))return t.indexOf(n)!==-1;if(q.isRegExp(n))return n.test(t)}}function c$t(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,i,n)=>i.toUpperCase()+n)}function l$t(e,t){let i=q.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+i,{value:function(r,s,a){return this[n].call(this,t,r,s,a)},configurable:!0})})}var ox=class{constructor(t){t&&this.set(t)}set(t,i,n){let r=this;function s(o,c,u){let d=eB(c);if(!d)throw new Error("header name must be a non-empty string");let l=q.findKey(r,d);(!l||r[l]===void 0||u===!0||u===void 0&&r[l]!==!1)&&(r[l||c]=UR(o))}let a=(o,c)=>q.forEach(o,(u,d)=>s(u,d,c));if(q.isPlainObject(t)||t instanceof this.constructor)a(t,i);else if(q.isString(t)&&(t=t.trim())&&!o$t(t))a(Owe(t),i);else if(q.isObject(t)&&q.isIterable(t)){let o={},c,u;for(let d of t){if(!q.isArray(d))throw TypeError("Object iterator must return a key-value pair");o[u=d[0]]=(c=o[u])?q.isArray(c)?[...c,d[1]]:[c,d[1]]:d[1]}a(o,i)}else t!=null&&s(i,t,n);return this}get(t,i){if(t=eB(t),t){let n=q.findKey(this,t);if(n){let r=this[n];if(!i)return r;if(i===!0)return a$t(r);if(q.isFunction(i))return i.call(this,r,n);if(q.isRegExp(i))return i.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,i){if(t=eB(t),t){let n=q.findKey(this,t);return!!(n&&this[n]!==void 0&&(!i||J$(this,this[n],n,i)))}return!1}delete(t,i){let n=this,r=!1;function s(a){if(a=eB(a),a){let o=q.findKey(n,a);o&&(!i||J$(n,n[o],o,i))&&(delete n[o],r=!0)}}return q.isArray(t)?t.forEach(s):s(t),r}clear(t){let i=Object.keys(this),n=i.length,r=!1;for(;n--;){let s=i[n];(!t||J$(this,this[s],s,t,!0))&&(delete this[s],r=!0)}return r}normalize(t){let i=this,n={};return q.forEach(this,(r,s)=>{let a=q.findKey(n,s);if(a){i[a]=UR(r),delete i[s];return}let o=t?c$t(s):String(s).trim();o!==s&&delete i[s],i[o]=UR(r),n[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){let i=Object.create(null);return q.forEach(this,(n,r)=>{n!=null&&n!==!1&&(i[r]=t&&q.isArray(n)?n.join(", "):n)}),i}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,i])=>t+": "+i).join(`
|
|||
|
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...i){let n=new this(t);return i.forEach(r=>n.set(r)),n}static accessor(t){let n=(this[jwe]=this[jwe]={accessors:{}}).accessors,r=this.prototype;function s(a){let o=eB(a);n[o]||(l$t(r,a),n[o]=!0)}return q.isArray(t)?t.forEach(s):s(t),this}};ox.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);q.reduceDescriptors(ox.prototype,({value:e},t)=>{let i=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[i]=n}}});q.freezeMethods(ox);var er=ox;function tB(e,t){let i=this||ax,n=t||i,r=er.from(n.headers),s=n.data;return q.forEach(e,function(o){s=o.call(i,s,r.normalize(),t?t.status:void 0)}),r.normalize(),s}function iB(e){return!!(e&&e.__CANCEL__)}var Z$=class extends Ne{constructor(t,i,n){super(t??"canceled",Ne.ERR_CANCELED,i,n),this.name="CanceledError",this.__CANCEL__=!0}},vc=Z$;function gp(e,t,i){let n=i.config.validateStatus;!i.status||!n||n(i.status)?e(i):t(new Ne("Request failed with status code "+i.status,[Ne.ERR_BAD_REQUEST,Ne.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i))}function K$(e){return typeof e!="string"?!1:/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function X$(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function Sg(e,t,i){let n=!K$(t);return e&&(n||i==!1)?X$(e,t):t}var EBe=Ze(Vwe(),1),IBe=Ze(require("http"),1),CBe=Ze(require("https"),1),wH=Ze(require("http2"),1),BH=Ze(require("util"),1),wBe=Ze(aBe(),1),sA=Ze(require("zlib"),1);var Mg="1.13.5";function oB(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}var J$t=/^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;function gH(e,t,i){let n=i&&i.Blob||Qi.classes.Blob,r=oB(e);if(t===void 0&&n&&(t=!0),r==="data"){e=r.length?e.slice(r.length+1):e;let s=J$t.exec(e);if(!s)throw new Ne("Invalid URL",Ne.ERR_INVALID_URL);let a=s[1],o=s[2],c=s[3],u=Buffer.from(decodeURIComponent(c),o?"base64":"utf8");if(t){if(!n)throw new Ne("Blob is not supported",Ne.ERR_NOT_SUPPORT);return new n([u],{type:a})}return u}throw new Ne("Unsupported protocol "+r,Ne.ERR_NOT_SUPPORT)}var rA=Ze(require("stream"),1);var oBe=Ze(require("stream"),1);var bH=Symbol("internals"),vH=class extends oBe.default.Transform{constructor(t){t=q.toFlatObject(t,{maxRate:0,chunkSize:64*1024,minChunkSize:100,timeWindow:500,ticksRate:2,samplesCount:15},null,(n,r)=>!q.isUndefined(r[n])),super({readableHighWaterMark:t.chunkSize});let i=this[bH]={timeWindow:t.timeWindow,chunkSize:t.chunkSize,maxRate:t.maxRate,minChunkSize:t.minChunkSize,bytesSeen:0,isCaptured:!1,notifiedBytesLoaded:0,ts:Date.now(),bytes:0,onReadCallback:null};this.on("newListener",n=>{n==="progress"&&(i.isCaptured||(i.isCaptured=!0))})}_read(t){let i=this[bH];return i.onReadCallback&&i.onReadCallback(),super._read(t)}_transform(t,i,n){let r=this[bH],s=r.maxRate,a=this.readableHighWaterMark,o=r.timeWindow,c=1e3/o,u=s/c,d=r.minChunkSize!==!1?Math.max(r.minChunkSize,u*.01):0,l=(h,m)=>{let f=Buffer.byteLength(h);r.bytesSeen+=f,r.bytes+=f,r.isCaptured&&this.emit("progress",r.bytesSeen),this.push(h)?process.nextTick(m):r.onReadCallback=()=>{r.onReadCallback=null,process.nextTick(m)}},p=(h,m)=>{let f=Buffer.byteLength(h),g=null,b=a,v,y=0;if(s){let I=Date.now();(!r.ts||(y=I-r.ts)>=o)&&(r.ts=I,v=u-r.bytes,r.bytes=v<0?-v:0,y=0),v=u-r.bytes}if(s){if(v<=0)return setTimeout(()=>{m(null,h)},o-y);v<b&&(b=v)}b&&f>b&&f-b>d&&(g=h.subarray(b),h=h.subarray(0,b)),l(h,g?()=>{process.nextTick(m,null,g)}:m)};p(t,function h(m,f){if(m)return n(m);f?p(f,h):n(null)})}},yH=vH;var BBe=require("events");var lBe=Ze(require("util"),1),uBe=require("stream");var{asyncIterator:cBe}=Symbol,Z$t=async function*(e){e.stream?yield*e.stream():e.arrayBuffer?yield await e.arrayBuffer():e[cBe]?yield*e[cBe]():yield e},jR=Z$t;var K$t=Qi.ALPHABET.ALPHA_DIGIT+"-_",cB=typeof TextEncoder=="function"?new TextEncoder:new lBe.default.TextEncoder,Ug=`\r
|
|||
|
|
`,X$t=cB.encode(Ug),eHt=2,xH=class{constructor(t,i){let{escapeName:n}=this.constructor,r=q.isString(i),s=`Content-Disposition: form-data; name="${n(t)}"${!r&&i.name?`; filename="${n(i.name)}"`:""}${Ug}`;r?i=cB.encode(String(i).replace(/\r?\n|\r\n?/g,Ug)):s+=`Content-Type: ${i.type||"application/octet-stream"}${Ug}`,this.headers=cB.encode(s+Ug),this.contentLength=r?i.byteLength:i.size,this.size=this.headers.byteLength+this.contentLength+eHt,this.name=t,this.value=i}async*encode(){yield this.headers;let{value:t}=this;q.isTypedArray(t)?yield t:yield*jR(t),yield X$t}static escapeName(t){return String(t).replace(/[\r\n"]/g,i=>({"\r":"%0D","\n":"%0A",'"':"%22"})[i])}},tHt=(e,t,i)=>{let{tag:n="form-data-boundary",size:r=25,boundary:s=n+"-"+Qi.generateString(r,K$t)}=i||{};if(!q.isFormData(e))throw TypeError("FormData instance required");if(s.length<1||s.length>70)throw Error("boundary must be 10-70 characters long");let a=cB.encode("--"+s+Ug),o=cB.encode("--"+s+"--"+Ug),c=o.byteLength,u=Array.from(e.entries()).map(([l,p])=>{let h=new xH(l,p);return c+=h.size,h});c+=a.byteLength*u.length,c=q.toFiniteNumber(c);let d={"Content-Type":`multipart/form-data; boundary=${s}`};return Number.isFinite(c)&&(d["Content-Length"]=c),t&&t(d),uBe.Readable.from((async function*(){for(let l of u)yield a,yield*l.encode();yield o})())},pBe=tHt;var dBe=Ze(require("stream"),1),EH=class extends dBe.default.Transform{__transform(t,i,n){this.push(t),n()}_transform(t,i,n){if(t.length!==0&&(this._transform=this.__transform,t[0]!==120)){let r=Buffer.alloc(2);r[0]=120,r[1]=156,this.push(r,i)}this.__transform(t,i,n)}},ABe=EH;var iHt=(e,t)=>q.isAsyncFn(e)?function(...i){let n=i.pop();e.apply(this,i).then(r=>{try{t?n(null,...t(r)):n(null,r)}catch(s){n(s)}},n)}:e,hBe=iHt;function nHt(e,t){e=e||10;let i=new Array(e),n=new Array(e),r=0,s=0,a;return t=t!==void 0?t:1e3,function(c){let u=Date.now(),d=n[s];a||(a=u),i[r]=c,n[r]=u;let l=s,p=0;for(;l!==r;)p+=i[l++],l=l%e;if(r=(r+1)%e,r===s&&(s=(s+1)%e),u-a<t)return;let h=d&&u-d;return h?Math.round(p*1e3/h):void 0}}var mBe=nHt;function rHt(e,t){let i=0,n=1e3/t,r,s,a=(u,d=Date.now())=>{i=d,r=null,s&&(clearTimeout(s),s=null),e(...u)};return[(...u)=>{let d=Date.now(),l=d-i;l>=n?a(u,d):(r=u,s||(s=setTimeout(()=>{s=null,a(r)},n-l)))},()=>r&&a(r)]}var fBe=rHt;var nA=(e,t,i=3)=>{let n=0,r=mBe(50,250);return fBe(s=>{let a=s.loaded,o=s.lengthComputable?s.total:void 0,c=a-n,u=r(c),d=a<=o;n=a;let l={loaded:a,total:o,progress:o?a/o:void 0,bytes:c,rate:u||void 0,estimated:u&&o&&d?(o-a)/u:void 0,event:s,lengthComputable:o!=null,[t?"download":"upload"]:!0};e(l)},i)},dx=(e,t)=>{let i=e!=null;return[n=>t[0]({lengthComputable:i,total:e,loaded:n}),t[1]]},Ax=e=>(...t)=>q.asap(()=>e(...t));function IH(e){if(!e||typeof e!="string"||!e.startsWith("data:"))return 0;let t=e.indexOf(",");if(t<0)return 0;let i=e.slice(5,t),n=e.slice(t+1);if(/;base64/i.test(i)){let s=n.length,a=n.length;for(let p=0;p<a;p++)if(n.charCodeAt(p)===37&&p+2<a){let h=n.charCodeAt(p+1),m=n.charCodeAt(p+2);(h>=48&&h<=57||h>=65&&h<=70||h>=97&&h<=102)&&(m>=48&&m<=57||m>=65&&m<=70||m>=97&&m<=102)&&(s-=2,p+=2)}let o=0,c=a-1,u=p=>p>=2&&n.charCodeAt(p-2)===37&&n.charCodeAt(p-1)===51&&(n.charCodeAt(p)===68||n.charCodeAt(p)===100);c>=0&&(n.charCodeAt(c)===61?(o++,c--):u(c)&&(o++,c-=3)),o===1&&c>=0&&(n.charCodeAt(c)===61||u(c))&&o++;let l=Math.floor(s/4)*3-(o||0);return l>0?l:0}return Buffer.byteLength(n,"utf8")}var gBe={flush:sA.default.constants.Z_SYNC_FLUSH,finishFlush:sA.default.constants.Z_SYNC_FLUSH},sHt={flush:sA.default.constants.BROTLI_OPERATION_FLUSH,finishFlush:sA.default.constants.BROTLI_OPERATION_FLUSH},bBe=q.isFunction(sA.default.createBrotliDecompress),{http:aHt,https:oHt}=wBe.default,cHt=/https:?/,vBe=Qi.protocols.map(e=>e+":"),yBe=(e,[t,i])=>(e.on("end",i).on("error",i),t),CH=class{constructor(){this.sessions=Object.create(null)}getSession(t,i){i=Object.assign({sessionTimeout:1e3},i);let n=this.sessions[t];if(n){let d=n.length;for(let l=0;l<d;l++){let[p,h]=n[l];if(!p.destroyed&&!p.closed&&BH.default.isDeepStrictEqual(h,i))return p}}let r=wH.default.connect(t,i),s,a=(
|
|||
|
|
`+a.map(FBe).join(`
|
|||
|
|
`):" "+FBe(a[0]):"as no adapter specified";throw new Ne("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r}var $R={getAdapter:wHt,adapters:kH};function SH(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new vc(null,e)}function HR(e){return SH(e),e.headers=er.from(e.headers),e.data=tB.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),$R.getAdapter(e.adapter||ax.adapter,e)(e).then(function(n){return SH(e),n.data=tB.call(e,e.transformResponse,n),n.headers=er.from(n.headers),n},function(n){return iB(n)||(SH(e),n&&n.response&&(n.response.data=tB.call(e,e.transformResponse,n.response),n.response.headers=er.from(n.response.headers))),Promise.reject(n)})}var YR={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{YR[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});var qBe={};YR.transitional=function(t,i,n){function r(s,a){return"[Axios v"+Mg+"] Transitional option '"+s+"'"+a+(n?". "+n:"")}return(s,a,o)=>{if(t===!1)throw new Ne(r(a," has been removed"+(i?" in "+i:"")),Ne.ERR_DEPRECATED);return i&&!qBe[a]&&(qBe[a]=!0,console.warn(r(a," has been deprecated since v"+i+" and will be removed in the near future"))),t?t(s,a,o):!0}};YR.spelling=function(t){return(i,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function BHt(e,t,i){if(typeof e!="object")throw new Ne("options must be an object",Ne.ERR_BAD_OPTION_VALUE);let n=Object.keys(e),r=n.length;for(;r-- >0;){let s=n[r],a=t[s];if(a){let o=e[s],c=o===void 0||a(o,s,e);if(c!==!0)throw new Ne("option "+s+" must be "+c,Ne.ERR_BAD_OPTION_VALUE);continue}if(i!==!0)throw new Ne("Unknown option "+s,Ne.ERR_BAD_OPTION)}}var lB={assertOptions:BHt,validators:YR};var yl=lB.validators,hx=class{constructor(t){this.defaults=t||{},this.interceptors={request:new G$,response:new G$}}async request(t,i){try{return await this._request(t,i)}catch(n){if(n instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;let s=r.stack?r.stack.replace(/^.+\n/,""):"";try{n.stack?s&&!String(n.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|||
|
|
`+s):n.stack=s}catch{}}throw n}}_request(t,i){typeof t=="string"?(i=i||{},i.url=t):i=t||{},i=Bu(this.defaults,i);let{transitional:n,paramsSerializer:r,headers:s}=i;n!==void 0&&lB.assertOptions(n,{silentJSONParsing:yl.transitional(yl.boolean),forcedJSONParsing:yl.transitional(yl.boolean),clarifyTimeoutError:yl.transitional(yl.boolean),legacyInterceptorReqResOrdering:yl.transitional(yl.boolean)},!1),r!=null&&(q.isFunction(r)?i.paramsSerializer={serialize:r}:lB.assertOptions(r,{encode:yl.function,serialize:yl.function},!0)),i.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?i.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:i.allowAbsoluteUrls=!0),lB.assertOptions(i,{baseUrl:yl.spelling("baseURL"),withXsrfToken:yl.spelling("withXSRFToken")},!0),i.method=(i.method||this.defaults.method||"get").toLowerCase();let a=s&&q.merge(s.common,s[i.method]);s&&q.forEach(["delete","get","head","post","put","patch","common"],m=>{delete s[m]}),i.headers=er.concat(a,s);let o=[],c=!0;this.interceptors.request.forEach(function(f){if(typeof f.runWhen=="function"&&f.runWhen(i)===!1)return;c=c&&f.synchronous;let g=i.transitional||lm;g&&g.legacyInterceptorReqResOrdering?o.unshift(f.fulfilled,f.rejected):o.push(f.fulfilled,f.rejected)});let u=[];this.interceptors.response.forEach(function(f){u.push(f.fulfilled,f.rejected)});let d,l=0,p;if(!c){let m=[HR.bind(this),void 0];for(m.unshift(...o),m.push(...u),p=m.length,d=Promise.resolve(i);l<p;)d=d.then(m[l++],m[l++]);return d}p=o.length;let h=i;for(;l<p;){let m=o[l++],f=o[l++];try{h=m(h)}catch(g){f.call(this,g);break}}try{d=HR.call(this,h)}catch(m){return Promise.reject(m)}for(l=0,p=u.length;l<p;)d=d.then(u[l++],u[l++]);return d}getUri(t){t=Bu(this.defaults,t);let i=Sg(t.baseURL,t.url,t.allowAbsoluteUrls);return kg(i,t.params,t.paramsSerializer)}};q.forEach(["delete","get","head","options"],function(t){hx.prototype[t]=function(i,n){return this.request(Bu(n||{},{method:t,url:i,data:(n||{}).data}))}});q.forEach(["post","put","patch"],function(t){function i(n){return function(s,a,o){return this.request(Bu(o||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:s,data:a}))}}hx.prototype[t]=i(),hx.prototype[t+"Form"]=i(!0)});var uB=hx;var DH=class e{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let i;this.promise=new Promise(function(s){i=s});let n=this;this.promise.then(r=>{if(!n._listeners)return;let s=n._listeners.length;for(;s-- >0;)n._listeners[s](r);n._listeners=null}),this.promise.then=r=>{let s,a=new Promise(o=>{n.subscribe(o),s=o}).then(r);return a.cancel=function(){n.unsubscribe(s)},a},t(function(s,a,o){n.reason||(n.reason=new vc(s,a,o),i(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let i=this._listeners.indexOf(t);i!==-1&&this._listeners.splice(i,1)}toAbortSignal(){let t=new AbortController,i=n=>{t.abort(n)};return this.subscribe(i),t.signal.unsubscribe=()=>this.unsubscribe(i),t.signal}static source(){let t;return{token:new e(function(r){t=r}),cancel:t}}},PBe=DH;function RH(e){return function(i){return e.apply(null,i)}}function TH(e){return q.isObject(e)&&e.isAxiosError===!0}var MH={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,
|
|||
|
|
`)}var JR=e=>(t,i,n,r)=>{let s=n?Object.assign(n,{async:!1}):{async:!1},a=t._zod.run({value:i,issues:[]},s);if(a instanceof Promise)throw new vp;if(a.issues.length){let o=new(r?.Err??e)(a.issues.map(c=>Ic(c,s,Or())));throw WR(o,r?.callee),o}return a.value},ZR=JR(gx),KR=e=>async(t,i,n,r)=>{let s=n?Object.assign(n,{async:!0}):{async:!0},a=t._zod.run({value:i,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){let o=new(r?.Err??e)(a.issues.map(c=>Ic(c,s,Or())));throw WR(o,r?.callee),o}return a.value},XR=KR(gx),eT=e=>(t,i,n)=>{let r=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:i,issues:[]},r);if(s instanceof Promise)throw new vp;return s.issues.length?{success:!1,error:new(e??yB)(s.issues.map(a=>Ic(a,r,Or())))}:{success:!0,data:s.value}},ZH=eT(gx),tT=e=>async(t,i,n)=>{let r=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:i,issues:[]},r);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(a=>Ic(a,r,Or())))}:{success:!0,data:s.value}},KH=tT(gx);var qg={};fp(qg,{_emoji:()=>XBe,base64:()=>A6,base64url:()=>iT,bigint:()=>y6,boolean:()=>I6,browserEmail:()=>t6t,cidrv4:()=>p6,cidrv6:()=>d6,cuid:()=>XH,cuid2:()=>e6,date:()=>f6,datetime:()=>b6,domain:()=>i6t,duration:()=>s6,e164:()=>m6,email:()=>o6,emoji:()=>c6,extendedDuration:()=>zHt,guid:()=>a6,hostname:()=>h6,html5Email:()=>KHt,integer:()=>x6,ipv4:()=>l6,ipv6:()=>u6,ksuid:()=>n6,lowercase:()=>B6,nanoid:()=>r6,null:()=>C6,number:()=>E6,rfc5322Email:()=>XHt,string:()=>v6,time:()=>g6,ulid:()=>t6,undefined:()=>w6,unicodeEmail:()=>e6t,uppercase:()=>_6,uuid:()=>Fg,uuid4:()=>WHt,uuid6:()=>JHt,uuid7:()=>ZHt,xid:()=>i6});var XH=/^[cC][^\s-]{8,}$/,e6=/^[0-9a-z]+$/,t6=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,i6=/^[0-9a-vA-V]{20}$/,n6=/^[A-Za-z0-9]{27}$/,r6=/^[a-zA-Z0-9_-]{21}$/,s6=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,zHt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,a6=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Fg=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,WHt=Fg(4),JHt=Fg(6),ZHt=Fg(7),o6=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,KHt=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,XHt=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,e6t=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,t6t=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,XBe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function c6(){return new RegExp(XBe,"u")}var l6=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,u6=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,p6=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,d6=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,A6=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,iT=/^[A-Za-z0-9_-]*$/,h6=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,i6t=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,m6=/^\+(?:[0-9]){6,14}[0-9]$/,e_e="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:
|
|||
|
|
`).filter(a=>a),r=Math.min(...n.map(a=>a.length-a.trimStart().length)),s=n.map(a=>a.slice(r)).map(a=>" ".repeat(this.indent*2)+a);for(let a of s)this.content.push(a)}compile(){let t=Function,i=this?.args,r=[...(this?.content??[""]).map(s=>` ${s}`)];return new t(...i,r.join(`
|
|||
|
|
`))}};var H6={major:4,minor:0,patch:0};var kt=H("$ZodType",(e,t)=>{var i;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=H6;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let r of n)for(let s of r._zod.onattach)s(e);if(n.length===0)(i=e._zod).deferred??(i.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let r=(s,a,o)=>{let c=Lg(s),u;for(let d of a){if(d._zod.def.when){if(!d._zod.def.when(s))continue}else if(c)continue;let l=s.issues.length,p=d._zod.check(s);if(p instanceof Promise&&o?.async===!1)throw new vp;if(u||p instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await p,s.issues.length!==l&&(c||(c=Lg(s,l)))});else{if(s.issues.length===l)continue;c||(c=Lg(s,l))}}return u?u.then(()=>s):s};e._zod.run=(s,a)=>{let o=e._zod.parse(s,a);if(o instanceof Promise){if(a.async===!1)throw new vp;return o.then(c=>r(c,n,a))}return r(o,n,a)}}e["~standard"]={validate:r=>{try{let s=ZH(e,r);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return KH(e,r).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}}),Pg=H("$ZodString",(e,t)=>{kt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??v6(e._zod.bag),e._zod.parse=(i,n)=>{if(t.coerce)try{i.value=String(i.value)}catch{}return typeof i.value=="string"||i.issues.push({expected:"string",code:"invalid_type",input:i.value,inst:e}),i}}),un=H("$ZodStringFormat",(e,t)=>{bx.init(e,t),Pg.init(e,t)}),z6=H("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=a6),un.init(e,t)}),W6=H("$ZodUUID",(e,t)=>{if(t.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Fg(n))}else t.pattern??(t.pattern=Fg());un.init(e,t)}),J6=H("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=o6),un.init(e,t)}),Z6=H("$ZodURL",(e,t)=>{un.init(e,t),e._zod.check=i=>{try{let n=i.value,r=new URL(n),s=r.href;t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:h6.source,input:i.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:i.value,inst:e,continue:!t.abort})),!n.endsWith("/")&&s.endsWith("/")?i.value=s.slice(0,-1):i.value=s;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!t.abort})}}}),K6=H("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=c6()),un.init(e,t)}),X6=H("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=r6),un.init(e,t)}),e5=H("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=XH),un.init(e,t)}),t5=H("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=e6),un.init(e,t)}),i5=H("$ZodULID",(e,t)=>{t.pattern??(t.pattern=t6),un.init(e,t)}),n5=H("$ZodXID",(e,t)=>{t.pattern??(t.pattern=i6),un.init(e,t)}),r5=H("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=n6),un.init(e,t)}),s5=H("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=b6(t)),un.init(e,t)}),a5=H("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=f6),un.init(e,t)}),o5=H("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=g6(t)),un.init(e,t)}),c5=H("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=s6),un.init(e,t)}),l5=H("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=l6),un.init(e,t),e._zod.onattach.push(i=>{let n=i._zod.bag;n.format="ipv4"})}),u5=H("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=u6),un.init(e,t),e._zod.onattach.push(i=>{let n=i._zod.bag;n.format="ipv6"}),e._zod.check=i=>{try{new URL(`http://[${i.value}]`)}catch{i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:e,continue:!t.abort})}}}),p5=H("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=p6),un.init(e,t)}),d5=H("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=d6),un.init(e,t),e._zod.check=i=>{let[n,r]=i.value.split("/");try{if(!r)throw new Error;let s=Number(r);if(`${s}`!==r)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${n}]`)}catch{i.issues.push({code:"invalid_format",format:"cidrv6",inpu
|
|||
|
|
if (${y}.issues.length) {
|
|||
|
|
if (input[${I}] === undefined) {
|
|||
|
|
if (${I} in input) {
|
|||
|
|
newResult[${I}] = undefined;
|
|||
|
|
}
|
|||
|
|
} else {
|
|||
|
|
payload.issues = payload.issues.concat(
|
|||
|
|
${y}.issues.map((iss) => ({
|
|||
|
|
...iss,
|
|||
|
|
path: iss.path ? [${I}, ...iss.path] : [${I}],
|
|||
|
|
}))
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
} else if (${y}.value === undefined) {
|
|||
|
|
if (${I} in input) newResult[${I}] = undefined;
|
|||
|
|
} else {
|
|||
|
|
newResult[${I}] = ${y}.value;
|
|||
|
|
}
|
|||
|
|
`)}else{let y=f[v];p.write(`const ${y} = ${m(v)};`),p.write(`
|
|||
|
|
if (${y}.issues.length) payload.issues = payload.issues.concat(${y}.issues.map(iss => ({
|
|||
|
|
...iss,
|
|||
|
|
path: iss.path ? [${Ng(v)}, ...iss.path] : [${Ng(v)}]
|
|||
|
|
})));`),p.write(`newResult[${Ng(v)}] = ${y}.value`)}p.write("payload.value = newResult;"),p.write("return payload;");let b=p.compile();return(v,y)=>b(l,v,y)},r,s=mx,a=!dB.jitless,c=a&&GH.value,u=t.catchall,d;e._zod.parse=(l,p)=>{d??(d=i.value);let h=l.value;if(!s(h))return l.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),l;let m=[];if(a&&c&&p?.async===!1&&p.jitless!==!0)r||(r=n(t.shape)),l=r(l,p);else{l.value={};let y=d.shape;for(let I of d.keys){let T=y[I],j=T._zod.run({value:h[I],issues:[]},p),Y=T._zod.optin==="optional"&&T._zod.optout==="optional";j instanceof Promise?m.push(j.then(G=>Y?a_e(G,l,I,h):sT(G,l,I))):Y?a_e(j,l,I,h):sT(j,l,I)}}if(!u)return m.length?Promise.all(m).then(()=>l):l;let f=[],g=d.keySet,b=u._zod,v=b.def.type;for(let y of Object.keys(h)){if(g.has(y))continue;if(v==="never"){f.push(y);continue}let I=b.run({value:h[y],issues:[]},p);I instanceof Promise?m.push(I.then(T=>sT(T,l,y))):sT(I,l,y)}return f.length&&l.issues.push({code:"unrecognized_keys",keys:f,input:h,inst:e}),m.length?Promise.all(m).then(()=>l):l}});function o_e(e,t,i,n){for(let r of e)if(r.issues.length===0)return t.value=r.value,t;return t.issues.push({code:"invalid_union",input:t.value,inst:i,errors:e.map(r=>r.issues.map(s=>Ic(s,n,Or())))}),t}var lT=H("$ZodUnion",(e,t)=>{kt.init(e,t),Ui(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),Ui(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),Ui(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),Ui(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(n=>n._zod.pattern);return new RegExp(`^(${i.map(n=>fB(n.source)).join("|")})$`)}}),e._zod.parse=(i,n)=>{let r=!1,s=[];for(let a of t.options){let o=a._zod.run({value:i.value,issues:[]},n);if(o instanceof Promise)s.push(o),r=!0;else{if(o.issues.length===0)return o;s.push(o)}}return r?Promise.all(s).then(a=>o_e(a,i,e,n)):o_e(s,i,e,n)}}),k5=H("$ZodDiscriminatedUnion",(e,t)=>{lT.init(e,t);let i=e._zod.parse;Ui(e._zod,"propValues",()=>{let r={};for(let s of t.options){let a=s._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let[o,c]of Object.entries(a)){r[o]||(r[o]=new Set);for(let u of c)r[o].add(u)}}return r});let n=mB(()=>{let r=t.options,s=new Map;for(let a of r){let o=a._zod.propValues[t.discriminator];if(!o||o.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let c of o){if(s.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);s.set(c,a)}}return s});e._zod.parse=(r,s)=>{let a=r.value;if(!mx(a))return r.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),r;let o=n.value.get(a?.[t.discriminator]);return o?o._zod.run(r,s):t.unionFallback?i(r,s):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:a,path:[t.discriminator],inst:e}),r)}}),S5=H("$ZodIntersection",(e,t)=>{kt.init(e,t),e._zod.parse=(i,n)=>{let r=i.value,s=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return s instanceof Promise||a instanceof Promise?Promise.all([s,a]).then(([c,u])=>c_e(i,c,u)):c_e(i,s,a)}});function Y6(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(fx(e)&&fx(t)){let i=Object.keys(t),n=Object.keys(e).filter(s=>i.indexOf(s)!==-1),r={...e,...t};for(let s of n){let a=Y6(e[s],t[s]);if(!a.valid)return{valid:!1,mergeErrorPath:[s,...a.mergeErrorPath]};r[s]=a.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let i=[];for(let n=0;n<e.length;n++){let r=e[n],s=t[n],a=Y6(r,s);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};i.push(a.data)}return{valid:!0,data:i}}return{valid:!1,mergeErrorPath:[]}}function c_e(e,t,i){if(t.issues.length&&e.issues.push(...t.issues),i.issues.length&&e.issu
|
|||
|
|
|
|||
|
|
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let d of this.seen.entries()){let l=d[1];if(t===d[0]){a(d);continue}if(n.external){let h=n.external.registry.get(d[0])?.id;if(t!==d[0]&&h){a(d);continue}}if(this.metadataRegistry.get(d[0])?.id){a(d);continue}if(l.cycle){a(d);continue}if(l.count>1&&n.reused==="ref"){a(d);continue}}let o=(d,l)=>{let p=this.seen.get(d),h=p.def??p.schema,m={...h};if(p.ref===null)return;let f=p.ref;if(p.ref=null,f){o(f,l);let g=this.seen.get(f).schema;g.$ref&&l.target==="draft-7"?(h.allOf=h.allOf??[],h.allOf.push(g)):(Object.assign(h,g),Object.assign(h,m))}p.isParent||this.override({zodSchema:d,jsonSchema:h,path:p.path??[]})};for(let d of[...this.seen.entries()].reverse())o(d[0],{target:this.target});let c={};if(this.target==="draft-2020-12"?c.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?c.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),n.external?.uri){let d=n.external.registry.get(t)?.id;if(!d)throw new Error("Schema is missing an `id` property");c.$id=n.external.uri(d)}Object.assign(c,r.def);let u=n.external?.defs??{};for(let d of this.seen.entries()){let l=d[1];l.def&&l.defId&&(u[l.defId]=l.def)}n.external||Object.keys(u).length>0&&(this.target==="draft-2020-12"?c.$defs=u:c.definitions=u);try{return JSON.parse(JSON.stringify(c))}catch{throw new Error("Error converting schema to JSON.")}}};function q3(e,t){if(e instanceof yx){let n=new GB(t),r={};for(let o of e._idmap.entries()){let[c,u]=o;n.process(u)}let s={},a={registry:e,uri:t?.uri,defs:r};for(let o of e._idmap.entries()){let[c,u]=o;s[c]=n.emit(u,{...t,external:a})}if(Object.keys(r).length>0){let o=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[o]:r}}return{schemas:s}}let i=new GB(t);return i.process(e),i.emit(e,t)}function es(e,t){let i=t??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);let r=e._zod.def;switch(r.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return es(r.element,i);case"object":{for(let s in r.shape)if(es(r.shape[s],i))return!0;return!1}case"union":{for(let s of r.options)if(es(s,i))return!0;return!1}case"intersection":return es(r.left,i)||es(r.right,i);case"tuple":{for(let s of r.items)if(es(s,i))return!0;return!!(r.rest&&es(r.rest,i))}case"record":return es(r.keyType,i)||es(r.valueType,i);case"map":return es(r.keyType,i)||es(r.valueType,i);case"set":return es(r.valueType,i);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return es(r.innerType,i);case"lazy":return es(r.getter(),i);case"default":return es(r.innerType,i);case"prefault":return es(r.innerType,i);case"custom":return!1;case"transform":return!0;case"pipe":return es(r.in,i)||es(r.out,i);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${r.type}`)}var sQe={};var FT={};fp(FT,{ZodISODate:()=>UT,ZodISODateTime:()=>MT,ZodISODuration:()=>LT,ZodISOTime:()=>NT,date:()=>O3,datetime:()=>P3,duration:()=>G3,time:()=>j3});var MT=H("ZodISODateTime",(e,t)=>{s5.init(e,t),mn.init(e,t)});function P3(e){return t3(MT,e)}var UT=H("ZodISODate",(e,t)=>{a5.init(e,t),mn.init(e,t)});function O3(e){return i3(UT,e)}var NT=H("ZodISOTime",(e,t)=>{o5.init(e,t),mn.init(e,t)});function j3(e){return n3(NT,e)}var LT=H("ZodISODuration",(e,t)=>{c5.init(e,t),mn.init(e,t)});function G3(e){return r3(LT,e)}var oQe=(e,t)=>{yB.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>EB(e,i)},flatten:{value:i=>xB(e,i)},addIssue:{value:i=>e.issues.push(i)},addIssues:{value:i=>e.issues.push(...i)},isEmpty:{get(){return e.issues.length===0}}})},A5t=H("ZodError",oQe),wx=H("ZodError",oQe,{Parent:Error});var V3=JR(wx),$3=KR(wx),H3=eT(wx),Y3=tT(wx);var zt=H("ZodType",(e,t)=>(kt.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...i)=>e.clone({...t,checks:[...t.checks??[]
|
|||
|
|
const module = { exports: {} };
|
|||
|
|
${e}
|
|||
|
|
return module.exports;
|
|||
|
|
`)(qn.oxmysql,pB,globalThis.GetResourceKvpString))}catch(e){console.error("Failed to load custom queries from config/database/queries.js"),console.error(e)}function qzt(e){let t=e.match(new RegExp("^(?:([^:/?#.]+):)?(?://(?:([^/?#]*)@)?([\\w\\d\\-\\u0100-\\uffff.%]*)(?::([0-9]+))?)?([^?#]+)?(?:\\?([^#]*))?$"));if(!t)throw new Error(`mysql_connection_string structure was invalid (${e})`);let i=t[2]?t[2].split(":"):[];return{user:i[0]||void 0,password:i[1]||void 0,host:t[3],port:parseInt(t[4]),database:t[5]?.replace(/^\/+/,""),...t[6]&&t[6].split("&").reduce((n,r)=>{let[s,a]=r.split("=");return n[s]=a,n},{})}}var RQn=KY.includes("mysql://")?qzt(KY):KY.replace(/(?:host(?:name)|ip|server|data\s?source|addr(?:ess)?)=/gi,"host=").replace(/(?:user\s?(?:id|name)?|uid)=/gi,"user=").replace(/(?:pwd|pass)=/gi,"password=").replace(/(?:db)=/gi,"database=").split(";").reduce((e,t)=>{let[i,n]=t.split("=");return i&&(e[i]=n),e},{}),Pzt={async getPlayerNotes(e){return await qn.oxmysql.query("SELECT * FROM luxu_admin_player_notes WHERE license = ? ORDER BY id DESC",[e])},async addPlayerNote(e,t,i){qn.oxmysql.insert("INSERT INTO luxu_admin_player_notes (license, text, author) VALUES (?,?,?)",[e,t,i])},async removePlayerNote(e){qn.oxmysql.query("DELETE FROM luxu_admin_player_notes WHERE id = ? LIMIT 1",[e])},async addPlayerBan(e){let t=typeof e.duration=="number"&&!Number.isNaN(e.duration)&&e.duration>0,i=t?Math.min(e.duration,xc):0,n=t?Date.now()+i:xc,r=Qr(n);try{let s=await qn.oxmysql.insert("INSERT INTO luxu_admin_bans (player_id, player_name, identifiers, tokens, reason, expires_at, staff_id) VALUES (?,?,?,?,?,?,?)",[e.uniqueId,e.playerName,JSON.stringify(e.identifiers),JSON.stringify(e.tokens),e.reason,r,e.staffId]);if(s)return wSe?.({id:s,staff_id:e.staffId,player_id:e.uniqueId,player_name:e.playerName,created_at:Date.now(),expires_at:n,reason:e.reason,identifiers:e.identifiers,tokens:e.tokens}),!0}catch(s){console.error("Error adding player ban",s)}return!1},async removePlayerBan(e){return BSe?.(e),await qn.oxmysql.update("UPDATE luxu_admin_bans SET expires_at = NOW() WHERE id = ?",[e])},async getPlayerBans(e){return(await qn.oxmysql.query("SELECT * FROM luxu_admin_bans WHERE player_id = ?",[e])).map(t=>({...t,identifiers:JSON.parse(t.identifiers),tokens:JSON.parse(t.tokens)}))},async getAllBans(){return(await qn.oxmysql.rawExecute("SELECT * FROM luxu_admin_bans ORDER BY id DESC")).map(e=>({...e,identifiers:JSON.parse(e.identifiers),tokens:JSON.parse(e.tokens)}))},async getPlayerWarnings(e){return await qn.oxmysql.rawExecute("SELECT * FROM luxu_admin_warnings WHERE player_id = ?",[e])},async addPlayerWarning(e,t,i,n){return await qn.oxmysql.insert("INSERT INTO luxu_admin_warnings (player_id, player_name, reason, staff_id) VALUES (?,?,?,?)",[e,t,i,n])},async getAllWarnings(){return await qn.oxmysql.query("SELECT * FROM luxu_admin_warnings ORDER BY id DESC")},async removePlayerWarning(e){return await qn.oxmysql.update("DELETE FROM luxu_admin_warnings WHERE id = ?",[e])},async getPlayerFlag(e){return(0,globalThis.GetResourceKvpString)("flag:"+e)||!1},async setPlayerFlag(e,t){t?(0,globalThis.SetResourceKvp)("flag:"+e,t):(0,globalThis.DeleteResourceKvp)("flag:"+e)},async getNotes(e){return await qn.oxmysql.query("SELECT * FROM luxu_admin_player_notes WHERE player_id = ?",[e])},async addNote(e,t,i,n){return await qn.oxmysql.insert("INSERT INTO luxu_admin_player_notes (player_id, text, staff_id, staff_name) VALUES (?,?,?,?)",[e,t,i,n])},async deleteNote(e){return await qn.oxmysql.update("DELETE FROM luxu_admin_player_notes WHERE id = ?",[e])},async getZones(){return(await qn.oxmysql.query("SELECT * FROM luxu_admin_zones"))?.map(t=>({id:t.id,name:t.name,points:JSON.parse(t.points),metadata:JSON.parse(t.metadata),rgba:JSON.parse(t.rgba),debug:!!t.debug,customHandler:t.customHandler||"",height:t.height||400}))},async createZone(e){try{return await qn.oxmysql.insert("INSERT INTO luxu_admin_zones (name, points, metadata, rgba, debug, customHandler, height) VALUES (?,?,?,?,?,?,?)",[e.name,JSON.stringify(e.points),JSON.stringify(e.metadata),J
|
|||
|
|
m.id,
|
|||
|
|
m.nickname,
|
|||
|
|
s.id as existing_session_id
|
|||
|
|
FROM luxu_admin_group_members m
|
|||
|
|
LEFT JOIN luxu_admin_duty_sessions s ON m.id = s.staff_id AND s.end_time IS NULL
|
|||
|
|
WHERE m.id = ?
|
|||
|
|
LIMIT 1`,[e]);if(!i)return null;if(i.existing_session_id)return i.existing_session_id;let n=await qa.oxmysql.insert("INSERT INTO luxu_admin_duty_sessions (staff_id, start_time) VALUES (?, ?)",[e,t]);return n?(await qa.oxmysql.update("UPDATE luxu_admin_group_members SET current_duty_start = ? WHERE id = ?",[t,e]),dz(),n):null}catch(t){return console.error("[DutyTracking] Failed to start duty session:",t),null}}async function vM(e){try{let t=Date.now(),i=Qr(t),n=await qa.oxmysql.single("SELECT id, start_time FROM luxu_admin_duty_sessions WHERE staff_id = ? AND end_time IS NULL ORDER BY start_time DESC LIMIT 1",[e]);if(!n)return!1;let r=new Date(n.start_time).getTime(),s=Math.floor((t-r)/1e3);if(s<0?s=0:s>86400&&(s=86400),await qa.oxmysql.update("UPDATE luxu_admin_duty_sessions SET end_time = ?, duration_seconds = ? WHERE id = ?",[i,s,n.id]),await qa.oxmysql.update("UPDATE luxu_admin_group_members SET current_duty_start = NULL, total_duty_seconds = total_duty_seconds + ? WHERE id = ?",[s,e]),s>=0&&s<=86400){let a=tWt();await qa.oxmysql.query(`INSERT INTO luxu_admin_duty_daily_stats (staff_id, date, total_seconds, session_count)
|
|||
|
|
VALUES (?, ?, ?, 1)
|
|||
|
|
ON DUPLICATE KEY UPDATE
|
|||
|
|
total_seconds = total_seconds + ?,
|
|||
|
|
session_count = session_count + 1`,[e,a,s,s])}return dz(),!0}catch(t){return console.error("[DutyTracking] Failed to end duty session:",t),!1}}async function zSe(e){try{let[t,i,n]=await Promise.all([qa.oxmysql.single(`SELECT
|
|||
|
|
COALESCE(SUM(duration_seconds), 0) as total_time,
|
|||
|
|
COUNT(*) as sessions_count
|
|||
|
|
FROM luxu_admin_duty_sessions
|
|||
|
|
WHERE staff_id = ? AND duration_seconds IS NOT NULL`,[e]),qa.oxmysql.single("SELECT * FROM luxu_admin_duty_sessions WHERE staff_id = ? AND end_time IS NULL",[e]),qa.oxmysql.query(`SELECT * FROM luxu_admin_duty_daily_stats
|
|||
|
|
WHERE staff_id = ? AND date >= DATE_SUB(CURDATE(), INTERVAL 30 DAY)
|
|||
|
|
ORDER BY date DESC`,[e])]),r=t&&t.sessions_count>0?Math.floor(t.total_time/t.sessions_count):0;return{total_time:t?.total_time||0,sessions_count:t?.sessions_count||0,average_session_duration:r,current_session:i||void 0,daily_stats:n||[]}}catch(t){return console.error("Failed to get staff duty stats:",t),{total_time:0,sessions_count:0,average_session_duration:0,daily_stats:[]}}}async function WSe(){try{if(o_&&Date.now()-o_.timestamp<YSe)return o_.data;let e=await qa.oxmysql.query(`SELECT
|
|||
|
|
m.id as staff_id,
|
|||
|
|
m.nickname,
|
|||
|
|
m.group,
|
|||
|
|
m.avatar,
|
|||
|
|
m.current_duty_start,
|
|||
|
|
m.total_duty_seconds,
|
|||
|
|
today.total_seconds as today_total_seconds,
|
|||
|
|
today.session_count as sessions_today,
|
|||
|
|
week.total_seconds as week_total_seconds,
|
|||
|
|
month.total_seconds as month_total_seconds
|
|||
|
|
FROM luxu_admin_group_members m
|
|||
|
|
LEFT JOIN luxu_admin_duty_daily_stats today
|
|||
|
|
ON m.id = today.staff_id AND today.date = CURDATE()
|
|||
|
|
LEFT JOIN (
|
|||
|
|
SELECT staff_id, SUM(total_seconds) as total_seconds
|
|||
|
|
FROM luxu_admin_duty_daily_stats
|
|||
|
|
WHERE date >= DATE_SUB(CURDATE(), INTERVAL 7 DAY)
|
|||
|
|
GROUP BY staff_id
|
|||
|
|
) week ON m.id = week.staff_id
|
|||
|
|
LEFT JOIN (
|
|||
|
|
SELECT staff_id, SUM(total_seconds) as total_seconds
|
|||
|
|
FROM luxu_admin_duty_daily_stats
|
|||
|
|
WHERE date >= DATE_SUB(CURDATE(), INTERVAL 30 DAY)
|
|||
|
|
GROUP BY staff_id
|
|||
|
|
) month ON m.id = month.staff_id
|
|||
|
|
ORDER BY m.group, m.nickname`),t=new Map;$t.forEach(n=>{n.id&&t.set(n.id,{is_online:!0,is_on_duty:n.onDuty})});let i=e.map(n=>{let r=t.get(n.staff_id)||{is_online:!1,is_on_duty:!1},s;return n.current_duty_start&&(s={staff_id:n.staff_id,start_time:new Date(n.current_duty_start).getTime()}),{staff_id:n.staff_id,nickname:n.nickname,group:n.group,avatar:n.avatar,current_session:s,today_total_seconds:Number(n.today_total_seconds||0),week_total_seconds:Number(n.week_total_seconds||0),month_total_seconds:Number(n.month_total_seconds||0),sessions_today:n.sessions_today||0,is_online:r.is_online,is_on_duty:r.is_on_duty}});return o_={data:i,timestamp:Date.now()},i}catch(e){return console.error("Failed to get all staff duty overview:",e),[]}}async function JSe(e="week"){try{let t=uz.get(e);if(t&&Date.now()-t.timestamp<YSe)return t.data;let i="";switch(e){case"day":i="WHERE s.date = CURDATE()";break;case"week":i="WHERE s.date >= DATE_SUB(CURDATE(), INTERVAL 7 DAY)";break;case"month":i="WHERE s.date >= DATE_SUB(CURDATE(), INTERVAL 30 DAY)";break}let r=await qa.oxmysql.query(`SELECT
|
|||
|
|
m.id as staff_id,
|
|||
|
|
m.nickname,
|
|||
|
|
m.group,
|
|||
|
|
m.avatar,
|
|||
|
|
COALESCE(SUM(s.total_seconds), 0) as total_seconds,
|
|||
|
|
COALESCE(SUM(s.session_count), 0) as session_count
|
|||
|
|
FROM luxu_admin_group_members m
|
|||
|
|
LEFT JOIN luxu_admin_duty_daily_stats s ON m.id = s.staff_id ${i}
|
|||
|
|
GROUP BY m.id
|
|||
|
|
ORDER BY total_seconds DESC
|
|||
|
|
LIMIT 20`)||[];return uz.set(e,{data:r,timestamp:Date.now()}),r}catch(t){return console.error("Failed to get duty leaderboard:",t),[]}}function dz(){o_=null,uz.clear()}Ke("dutyTracking:getOverview",async()=>await WSe());Ke("dutyTracking:getLeaderboard",async(e,t)=>await JSe(t));Ke("dutyTracking:getStaffStats",async(e,t)=>await zSe(t));Te.registerNonActionHandler("dutyTracking:getOverview",async e=>await WSe());Te.registerNonActionHandler("dutyTracking:getLeaderboard",async e=>await JSe(e.data.period));Te.registerNonActionHandler("dutyTracking:getStaffStats",async e=>await zSe(e.data.staffId));async function ZSe(){try{let e=await qa.oxmysql.update(`UPDATE luxu_admin_duty_sessions
|
|||
|
|
SET end_time = NOW(),
|
|||
|
|
duration_seconds = GREATEST(0, LEAST(TIMESTAMPDIFF(SECOND, start_time, NOW()), 86400))
|
|||
|
|
WHERE end_time IS NULL`);e&&e>0&&console.log(`Cleaned up ${e} incomplete duty sessions`),await qa.oxmysql.update("UPDATE luxu_admin_group_members SET current_duty_start = NULL"),dz()}catch(e){console.error("Failed to clean up duty sessions:",e)}}var eU=require("crypto"),xTe=require("stream"),ETe=Ze(require("tls"),1);var iZt=e=>new Promise(t=>setTimeout(t,e)),kW=(0,globalThis.GetConvar)("voice_externalAddress","127.0.0.1"),SW=(0,globalThis.GetConvarInt)("voice_externalPort",(0,globalThis.GetConvarInt)("netPort",30120));globalThis.__dirname=(0,globalThis.GetResourcePath)((0,globalThis.GetCurrentResourceName)())+"/server/modules";var nZt=yTe(),tU=!1,Jx=null;function ITe(){if((0,globalThis.GetResourceState)("pma-voice")==="started"&&(0,globalThis.GetConvarInt)("voice_externalDisallowJoin",0)===1){Jx='pma-voice has external connections disabled. Remove "set voice_externalDisallowJoin 1" from server.cfg.';return}if((0,globalThis.GetConvar)("mumble_disableServer","false")==="true"){Jx="Built-in mumble server is disabled (mumble_disableServer true). Audio listening is unavailable.";return}let e=(0,globalThis.GetConvar)("mumble_allowExternalConnections","NOT_SET");if(e!=="true")if(e==="NOT_SET")(0,globalThis.ExecuteCommand)("set mumble_allowExternalConnections true"),console.log("[MUMBLE] mumble_allowExternalConnections was not set \u2014 auto-enabled via ExecuteCommand."),console.log('[MUMBLE] Add "set mumble_allowExternalConnections true" to server.cfg to persist across restarts.');else{Jx=`mumble_allowExternalConnections is "${e}". Set it to "true" in server.cfg.`;return}tU=!0}async function rZt(e,t,i){let n=i.tls??{},r=n.rejectUnauthorized??!0,s=await new Promise((o,c)=>{ETe.default.connect(t,e,n).once("error",c).once("secureConnect",function(){this.authorized||!r?o(this):c(this.authorizationError)})}),a=new nZt(i);for(let o of["CryptSetup","CodecVersion","ServerConfig","TextMessage"])a[`_on${o}`]=()=>{};return a.connectDataStream(s)}var Bc=new Map,Kx=new Map,Xx=new Map,U_=new Map,sZt=5e3,vm=new Map,eE={removeStaffAuth:e=>{for(let[t,i]of vm)i===e&&vm.delete(t)},authStaff:e=>{let t=(0,eU.randomUUID)();return vm.set(t,e),t},isKeyValid:e=>vm.has(e)};Te.registerNonActionHandler("mumble:requestKey",e=>{for(let[t,i]of vm)if(i===e.staff.id)return t;return eE.authStaff(e.staff.id)});Te.registerNonActionHandler("audio:requestStream",async e=>{if(!tU)throw new Error(Jx??"Mumble server is not available");let t=e.data?.target;if(!t)throw new Error("Audio request missing target player");if(!(0,globalThis.GetPlayerName)(t.toString()))throw new Error(`Target player ${t} is not online`);await _Te(t);let i=Bc.get(t);if(!i)throw new Error("Failed to create audio stream");let n=(0,eU.randomUUID)();return Kx.set(n,{target:t}),i.webSocketSubscribers.set(n,{staffId:e.staff.id}),i.cleanupTimeout&&(clearTimeout(i.cleanupTimeout),i.cleanupTimeout=null),{streamId:n}});Te.registerNonActionHandler("audio:stopStream",e=>{let t=e.data?.streamId;if(!t)throw new Error("Audio stop missing streamId");let i=Kx.get(t);if(!i)return;Kx.delete(t);let n=Bc.get(i.target);n&&(n.webSocketSubscribers.delete(t),BTe(i.target,n))});async function CTe(e,t){if(!tU){e.status=503,e.body={error:Jx??"Mumble server is not available"};return}let{authorization:i}=e.request?.headers??{};if(!i){e.status=401;return}let n=i.replace("Bearer ","").trim();if(!vm.has(n)){e.status=401;return}let{target:r}=e.request.body;if(!r){e.status=400,e.body={error:"Missing target player"};return}if(!(0,globalThis.GetPlayerName)(r.toString())){e.status=404,e.body={error:`Player ${r} is not online`};return}try{await _Te(r);let s=Bc.get(r);if(!s){e.status=500,e.body={error:"Failed to create audio stream"};return}s.cleanupTimeout&&(clearTimeout(s.cleanupTimeout),s.cleanupTimeout=null),s.activeConnections++;let a=(0,eU.randomUUID)(),o=new xTe.PassThrough({highWaterMark:64*1024});s.httpStreams.add(o),Xx.set(a,{target:r,clientStream:o}),e.set({"Content-Type":"application/octet-stream","Transfer-Encoding":"chunked",Connection:"keep-alive","Cache-Control":"no-cache","X-Content-Type-Options":"nosniff
|
|||
|
|
${t}`),console.log(" LUXU ADMIN \u2014 Mumble Diagnostic Report"),console.log(t),tU?console.log(" Status : OK"):(console.log(" Status : NOT READY"),console.log(` Reason : ${Jx}`)),console.log(t),console.log(" Configuration"),i("Target IP",kW,kW==="127.0.0.1"?"default":""),i("Target port",String(SW),SW===30120?"default (netPort)":""),console.log(t),console.log(" Convars");let n=(0,globalThis.GetResourceState)("pma-voice");if(i("pma-voice",n),n==="started"){let a=(0,globalThis.GetConvarInt)("voice_externalDisallowJoin",0);i("voice_externalDisallowJoin",String(a),a===1?"BLOCKS EXTERNAL CONNECTIONS \u2014 remove this line":"")}let r=(0,globalThis.GetConvar)("mumble_disableServer","false");i("mumble_disableServer",r,r==="true"?"MUMBLE DISABLED":"");let s=(0,globalThis.GetConvar)("mumble_allowExternalConnections","NOT_SET");if(i("mumble_allowExternalConnections",s,s!=="true"?'must be "true" \u2192 set mumble_allowExternalConnections true':""),console.log(t),console.log(" Runtime"),i("Active clients",String(Bc.size)),i("HTTP streams (by ID)",String(Xx.size)),i("WebSocket streams",String(Kx.size)),i("Pending client creations",String(U_.size)),i("Auth tokens",String(vm.size)),Bc.size>0){console.log(t),console.log(" Active client breakdown");for(let[a,o]of Bc){let c=(0,globalThis.GetPlayerName)(a.toString())??"unknown",u=U_.has(a)?" [creating]":"",d=o.cleanupTimeout?" [cleanup pending]":"";console.log(` Player ${a} (${c})${u}${d} \u2014 HTTP: ${o.activeConnections}, WS: ${o.webSocketSubscribers.size}`)}}console.log(`${t}
|
|||
|
|
`)},!0);ts(e=>{Bc.has(e)&&N_(e)});var nU=Ze(_r(),1),ym=Ze(require("os"),1);function tE(e,t){return Math.round(e*Math.pow(10,t))/Math.pow(10,t)}var TW=class{constructor(){this.cache=new Map;this.DEFAULT_TTL=300*1e3}set(t,i,n=this.DEFAULT_TTL){this.cache.set(t,{data:i,timestamp:Date.now(),ttl:n})}get(t){let i=this.cache.get(t);return i?Date.now()-i.timestamp>i.ttl?(this.cache.delete(t),null):i.data:null}invalidate(t){this.cache.delete(t)}cleanup(){let t=Date.now();for(let[i,n]of this.cache.entries())t-n.timestamp>n.ttl&&this.cache.delete(i)}size(){return this.cache.size}},Su=new TW,MW=class{constructor(){this.operations=new Map}throttle(t,i,n){let r=this.operations.get(t);r&&r.timer&&clearTimeout(r.timer);let s=setTimeout(()=>{i(),this.operations.delete(t)},n);this.operations.set(t,{timer:s,pending:!0})}cancel(t){let i=this.operations.get(t);i?.timer&&(clearTimeout(i.timer),this.operations.delete(t))}},rU=new MW,UW=1440*60*1e3,oZt=(0,globalThis.GetConvarInt)("sv_maxClients",1),xm=new Map,NW=0,TTe="serverStatsHistory",kTe=10080*60*1e3,wA=[];function cZt(){let e=(0,globalThis.GetResourceKvpString)(TTe);if(e)try{wA=JSON.parse(e)}catch{wA=[]}}function lZt(){(0,globalThis.SetResourceKvp)(TTe,JSON.stringify(wA))}function iE(e){let t=Date.now(),i=wA.slice().reverse().find(n=>t-n.timestamp>=e);return i?i.stats:{}}function L_(e){let t=e.toString(),i=(0,globalThis.GetPlayerIdentifierByType)(t,"license2");return i||(i=(0,globalThis.GetPlayerIdentifierByType)(t,"license")),i||null}_u(async()=>{let e=globalThis.source,t=L_(e);if(!t){console.error(`[Statistics] Warning: Could not get license identifier for player ${e}`);return}xm.set(t,Date.now()),uZt(),bZt(t)});ts(e=>{let t=L_(e);if(!t){console.error(`[Statistics] Warning: Could not get license identifier for player ${e}`);return}UTe(t),xm.delete(t)});function uZt(){rU.throttle("save_unique_players",()=>{let e=Date.now(),t=Array.from(xm.entries()).filter(([i,n])=>e-n<UW).map(([i,n])=>({license:i,joinTime:n}));(0,globalThis.SetResourceKvp)("uniquePlayers",JSON.stringify(t))},5e3)}async function pZt(){let e="rich_list",t=Su.get(e);if(t)return t;let i=[];try{i=await Ge.getRichList()}catch(n){console.error("Error fetching rich list:",n)}return Su.set(e,i,600*1e3),i}async function dZt(){let e="job_distribution",t=Su.get(e);if(t)return t;let i={};try{let n=await Ge.getJobDistribution();pB.name==="qb"||pB.name==="qbx"?(i=(await Ae.job.getJobs()).reduce((s,a)=>(s[a.name]=0,s),{}),Object.entries(n).forEach(([s,a])=>{i.hasOwnProperty(s)&&(i[s]+=a)})):i=n}catch(n){console.error("Error fetching job distribution:",n)}return Su.set(e,i,300*1e3),i}function STe(e){return tE(e/1024/1024/1024,2)}function AZt(){return new Promise(e=>{let t=process.cpuUsage(),i=process.hrtime.bigint();setTimeout(()=>{let n=process.cpuUsage(t),r=process.hrtime.bigint(),s=Number(r-i)/1e3;if(s<=0){NW=0,e({user:"0.00",system:"0.00",total:"0.00"});return}let a=Math.max(0,n.user/s*100),o=Math.max(0,n.system/s*100),c=a+o,u=Math.min(100,c);NW=Number(u.toFixed(2)),e({user:Math.min(100,a).toFixed(2),system:Math.min(100,o).toFixed(2),total:u.toFixed(2)})},100)})}var hZt=(()=>{let e=ym.default.cpus();return{model:e[0]?.model||"Unknown CPU",cores:e.length}})();async function MTe(){let e=hZt.model,t=STe(ym.default.totalmem()),i=STe(ym.default.totalmem()-ym.default.freemem()),n=(0,globalThis.GetGameTimer)(),r=Date.now()-n,s=tE((ym.default.totalmem()-ym.default.freemem())/ym.default.totalmem()*100,2);return await AZt(),{uptime:n,maxSlots:oZt,uniquePlayers:xm.size,cpu_name:e,cpu_usage:NW,total_memory:t,memory_usage:i,memory_usage_percentage:s,startTimestamp:r}}var ki={richList:[],totalUniquePlayers:{current:0,previous_week:0},totalCharacters:{current:0,previous_week:0},playerRetention:{current:0,previous_week:0},totalBankMoney:{current:0,previous_week:0},totalBans:{current:0,previous_week:0},totalWarnings:{current:0,previous_week:0},playersInJail:{current:0,previous_week:0},onlinePlayerCount:{current:0,previous_week:0},totalReports:{current:0,previous_week:0},jobDistribution:{}};async function mZt(e){if(e!==0)return iE(e)?.totalUniquePla
|
|||
|
|
FROM luxu_admin_staff_logs
|
|||
|
|
WHERE created_at > DATE_SUB(NOW(), INTERVAL ? DAY)
|
|||
|
|
GROUP BY staff_id, staff_name
|
|||
|
|
ORDER BY count DESC`,[e])??[]).map(i=>({id:i.staff_id,nickname:i.staff_name,count:i.count}))}function cMe(){return Gn}function lMe(e){let{type:t,page:i=1,limit:n=50,search:r=""}=e,s=Gn[t]||[],a=r?s.filter(l=>l.text.toLowerCase().includes(r.toLowerCase())):s,o=a.length,c=(i-1)*n,u=c+n;return{logs:a.slice(c,u),total:o,page:i,limit:n,hasMore:u<o}}async function uMe(){return{staff:await KW(),players:Gn.players.length,deaths:Gn.deaths.length,chat:Gn.chat.length,reports:Gn.reports.length,bans:Gn.bans.length,warnings:Gn.warnings.length}}function pMe(e){if(e==="staff"){QA.oxmysql.rawExecute("DELETE FROM luxu_admin_staff_logs").catch(t=>{console.error("Failed to clear staff logs:",t)}),kr.clearLogChannel(e);return}Gn[e]=[],pU[e]=!0,kr.clearLogChannel(e)}function sMe(e){if(e!=="staff")try{let t=O_.default.join((0,globalThis.GetResourcePath)(pt),"logs");BA.default.existsSync(t)||BA.default.mkdirSync(t,{recursive:!0});let i=JSON.stringify(Gn[e],null,2);BA.default.writeFile(O_.default.join(t,`${e}.json`),i,n=>{n&&console.error(`Failed to save log ${e}:`,n)})}catch(t){console.error(`Failed to save log ${e}:`,t)}}function jZt(e){if(e==="staff")return[];let t=(0,globalThis.GetResourcePath)(pt),i=O_.default.join(t,"logs"),n=O_.default.join(i,`${e}.json`);if(BA.default.existsSync(i)||BA.default.mkdirSync(i,{recursive:!0}),!BA.default.existsSync(n))return BA.default.writeFileSync(n,JSON.stringify([],null,2),"utf8"),[];try{let r=BA.default.readFileSync(n,"utf8");return JSON.parse(r)}catch(r){return console.error(`Error reading log file ${n}:`,r),[]}}function dMe(){if(!Ci.logs.enabled)return;let e=(0,globalThis.GetResourceKvpString)("logs");if(e){let t=Date.now(),i=Ci.logs?.max_age_days?Ci.logs.max_age_days*1e3*60*60*24:1e3*60*60*24*30,n=JSON.parse(e);Gn.players=n.players?.filter(r=>t-r.createdAt<i)||[],Gn.deaths=n.deaths?.filter(r=>t-r.createdAt<i)||[],Gn.chat=n.chat?.filter(r=>t-r.createdAt<i)||[],Gn.reports=n.reports?.filter(r=>t-r.createdAt<i)||[],Object.keys(Gn).forEach(r=>{sMe(r)}),(0,globalThis.DeleteResourceKvp)("logs"),console.log("Migrated logs, find them in \u{1F4C1} luxu_admin/logs");return}Object.keys(Gn).forEach(t=>{Gn[t]=jZt(t)}),Ci.logs.options.player_deaths&&Cn("log:playerDeathBatch",(t,i)=>{Array.isArray(i)&&i.forEach(n=>{_A("deaths",t.toString()+" "+n)})}),Cn("log:playerActionsBatch",(t,i)=>{i.forEach(n=>{_A("players",t.toString()+" "+n)})}),Ci.logs.options.chat_messages&&onNet("chatMessage",(t,i,n)=>{_A("chat",`${i}: ${n}`)}),setInterval(()=>{let t=Ci.logs?.max_age_days??30;QA.oxmysql.rawExecute("DELETE FROM luxu_admin_staff_logs WHERE created_at < DATE_SUB(NOW(), INTERVAL ? DAY)",[t]).catch(i=>{console.error("Failed to clean up old staff logs:",i)})},1e3*60*60*24),setInterval(()=>{Object.keys(Gn).forEach(t=>{pU[t]&&(pU[t]=!1,sMe(t))})},ike.loop_delays.save_logs)}var XW=Ze(_r(),1);var rb=new Map,GZt={async getBans(e){try{return Et(e.group,"moderation.view.bans")?await Ge.getAllBans():void 0}catch(t){return console.error("Error fetching bans",t),[]}},async getWarnings(e){if(Et(e.group,"moderation.view.warnings"))return await Ge.getAllWarnings()},async getJail(e){if(Et(e.group,"moderation.view.jail"))return await Ge.getAllJail()}};Object.entries(GZt).forEach(([e,t])=>{Ke(e,async i=>{let n=oe(i);if(n)return await t(n)}),Te.registerNonActionHandler(e,async i=>{let{staff:n}=i;if(n)return await t(n)})});var dU=new Map,AU=new Map;function e9(){dU.clear(),AU.clear();for(let e of rb.values())if(!(e.expires_at&&e.expires_at<Date.now())){for(let t of e.identifiers)dU.set(t,e);for(let t of e.tokens)AU.set(t,e)}}function AMe(e){rb.set(e.id,e),e9(),emit("luxu_admin:server:playerBanned",e);let t=e.identifiers.find(i=>i.startsWith("discord:"))?.replace("discord:","");setTimeout(()=>{let i=kr.getLogChannelId("bans");if(i)try{let n=global.exports[pt].playerBannedEmbed(e,t,e.staff_id?Im(e.staff_id):null);kr.sendMessageToChannel(i,{embeds:n})}catch(n){console.error("ERRO WHILE CREATING CUSTOM BAN EMBED"),console.error(n)}},500)}function AE(e){rb.delete(e),e9(),emit("luxu_admin:server:playerUnbanned",e)}_Se(AMe,AE);var VZt=C.object({nam
|
|||
|
|
<rect width="128" height="128" fill="#1a1a1a"/>
|
|||
|
|
<path d="M44 40h40c2.2 0 4 1.8 4 4v40c0 2.2-1.8 4-4 4H44c-2.2 0-4-1.8-4-4V44c0-2.2 1.8-4 4-4z" fill="none" stroke="#444" stroke-width="2"/>
|
|||
|
|
<circle cx="52" cy="52" r="6" fill="#444"/>
|
|||
|
|
<path d="M40 80l20-20 12 12 16-16v24H40z" fill="#444"/>
|
|||
|
|
</svg>`),$oi=86400,Hoi=new Map;TA.get("/ping",async(e,t)=>(e.body="pong",await t()));TA.post("/requestAudio",CTe);TA.post("/stopAudio",wTe);TA.get("/live",async(e,t)=>(e.status=200,e.type="text/plain",e.body="live",await t()));TA.get(/^\/inventory(?:\/(.*))?$/,async(e,t)=>{try{let i=(e.params[0]||e.path.replace("/inventory/","")).trim();if(!i)return e.status=400,e.body="Invalid path format",await t();let n=i.split("/").filter(m=>m.length>0);if(n.length<2)return e.status=400,e.body="Invalid path format",await t();let r=n[0];if(!r.startsWith("cfx-nui-"))return e.status=400,e.body="Invalid resource name format",await t();let s=aQ.default.extname(n[n.length-1]).toLowerCase();if(!joi.has(s))return e.status=400,e.body="Invalid file type",await t();let a=r.replace(/^cfx-nui-/,""),o=n.slice(1).join("/"),c=(0,globalThis.GetResourcePath)(a);if(!c)return e.status=404,e.body="Resource not found",await t();let u=aQ.default.join(c,o),d=aQ.default.normalize(u),l=aQ.default.normalize(c);if(!d.startsWith(l))return e.status=403,e.body="Access denied",await t();let p,h=!1;try{p=await qPe.default.promises.readFile(d)}catch(m){if(m instanceof Error&&"code"in m&&m.code==="ENOENT")p=Voi,h=!0;else throw m}return h?(e.set("Cache-Control",`public, max-age=${$oi}`),e.set("Content-Type","image/svg+xml")):(e.set("Cache-Control","public, max-age=31536000, immutable"),e.set("Content-Type",Goi[s])),e.body=p,await t()}catch(i){return console.error("Error serving inventory image:",i),e.status=500,e.body="Internal server error",await t()}});var Yoi=["https://luxu.app","https://luxu.gg","https://cfx-nui-"+pt.toLowerCase()];oQ.use((0,LPe.default)({origin:e=>{let t=e.get("origin")||e.request.headers.origin||e.request.headers.referer||"no-origin";return t&&Yoi.includes(t)?t:""}}));oQ.use((0,PPe.default)({multipart:!0,json:!0,urlencoded:!0,formLimit:"2mb",jsonLimit:"2mb",textLimit:"2mb",formidable:{multiples:!1,maxFileSize:15*1024*1024}}));oQ.use((0,OPe.default)({driver:"memory",db:Hoi,duration:6e4,whitelist:e=>!!e.path.includes("/inventory/"),errorMessage:"Not that quick buddy!",max:500}));function GPe(){oQ.use(TA.routes()).use(TA.allowedMethods()),(0,jPe.setHttpCallback)(oQ.callback())}var Q7=require("node:fs");var Dm=new Map;async function VPe(e){return new Promise((t,i)=>{if(Dm.has(e)){let s=Dm.get(e);clearTimeout(s.timeout),s.reject("Screenshot request cancelled - new request initiated")}let n=(0,globalThis.GetConvar)("web_baseUrl","");if(n===""){i("Web base URL is not set");return}he("screenshot:request",e,{endpoint:"https://"+n+"/"+pt+"/screenshot-response",svId:e});let r=setTimeout(()=>{i("Screenshot failed for player "+e+" (Took too long to screenshot)"),Dm.delete(e)},1e4);Dm.set(e,{resolve:t,reject:i,timeout:r})})}TA.post("/screenshot-response",async e=>{if(!e.request.body||typeof e.request.body!="object"){e.status=400,e.body={error:"Invalid form data"};return}let t=e.request.body.target,i=Number(t);if(!Number.isInteger(i)){e.status=400,e.body={error:"Invalid target"};return}if(!Dm.has(i)){e.status=400,e.body={error:"No pending screenshot for target"};return}let{timeout:n,resolve:r,reject:s}=Dm.get(i);try{let a=e.request.files?.base64;if(!a){e.status=400,e.body={error:"Missing screenshot file"};return}let o=Array.isArray(a)?a[0]:a,c=o.filepath??o.path;if(!c)throw new Error("Missing uploaded file path");let u=await Q7.promises.readFile(c);await zoi(c);let d=o.mimetype??"image/png";clearTimeout(n),r(`data:${d};base64,${u.toString("base64")}`),Dm.delete(i),e.status=200,e.body={ok:!0}}catch(a){clearTimeout(n),Dm.delete(i),s(a),e.status=500,e.body={error:"Failed to process screenshot"}}});async function zoi(e){try{await Q7.promises.unlink(e)}catch(t){t.code!=="ENOENT"&&console.warn("Failed to cleanup temp file",t)}}process.version.startsWith("22")?{ActionRowBuilder:Gh,EmbedBuilder:dV,ModalBuilder:q1,TextInputBuilder:Vh,TextInputStyle:$h}=$pe():{ActionRowBuilder:Gh,EmbedBuilder:dV,ModalBuilder:q1,TextInputBuilder:Vh,TextInputStyle:$h}=PEe();var Gh,dV,q1,Vh,$h,ePt={ban:{handler:async e=>{let t=e.options.getInteger("targetid"),i=e.options.getString("reason"
|
|||
|
|
**Banned until:** ${f}`})}catch(l){console.error("Error executing ban command from Discord:",l),await e.editReply({content:"Failed to ban player. Please try again."})}},permission:"player.ban"},kick:{handler:async e=>{let t=e.options.getInteger("targetid"),i=e.options.getString("reason")?.trim()??"Kicked by staff.";if(!t||t<0){await e.reply({content:"Please provide a valid player ID.",ephemeral:!0});return}try{if(await e.deferReply({ephemeral:!0}),!(0,globalThis.GetPlayerName)(t.toString())){await e.editReply({content:`Player ${t} is not online.`});return}let n=await Ru(e.user.id);se(n??0,e.user.username,`player kicked: id:${t} - ${i}`),(0,globalThis.DropPlayer)(t.toString(),i),await e.editReply({content:`Player ${t} has been kicked.`})}catch(n){console.error("Error executing kick command from Discord:",n),await e.editReply({content:"Failed to kick player. Please try again."})}},permission:"player.kick"},giveitem:{handler:async e=>{let t=e.options.getInteger("targetid"),i=e.options.getString("item")?.trim(),n=e.options.getInteger("amount")??1;if(!t||t<0||!i){await e.reply({content:"Please provide a valid player ID and item name.",ephemeral:!0});return}try{if(await e.deferReply({ephemeral:!0}),!(0,globalThis.GetPlayerName)(t.toString())){await e.editReply({content:`Player ${t} is not online.`});return}if(!await Ae.inventory.canCarryItem(t,i,n)){await e.editReply({content:`Player ${t} cannot carry ${n}x ${i}.`});return}await Ae.inventory.addItem(t,i,n);let r=await Ru(e.user.id);se(r??0,e.user.username,`gave ${n} of ${i} to player id:${t}`),await e.editReply({content:`Gave ${n}x ${i} to player ${t}.`})}catch(r){console.error("Error executing give_item command from Discord:",r),await e.editReply({content:"Failed to give item. Please try again."})}},permission:"inventory.give"},revive:{handler:async e=>{let t=e.options.getInteger("targetid");if(!t||t<0){await e.reply({content:"Please provide a valid player ID.",ephemeral:!0});return}try{if(await e.deferReply({ephemeral:!0}),!(0,globalThis.GetPlayerName)(t.toString())){await e.editReply({content:`Player ${t} is not online.`});return}he("actions:revive",t),Ae.player.revive(t);let i=await Ru(e.user.id);se(i??0,e.user.username,`revived player id:${t}`),await e.editReply({content:`Player ${t} has been revived.`})}catch(i){console.error("Error executing revive command from Discord:",i),await e.editReply({content:"Failed to revive player. Please try again."})}},permission:"player.revive"},getaccountbalances:{handler:async e=>{let t=e.options.getInteger("targetid");if(!t||t<0){await e.reply({content:"Please provide a valid player ID.",ephemeral:!0});return}try{if(await e.deferReply({ephemeral:!0}),!(0,globalThis.GetPlayerName)(t.toString())){await e.editReply({content:`Player ${t} is not online.`});return}let i=await Ae.player.getPlayerObject(t);if(!i){await e.editReply({content:`Failed to load player object for ${t}.`});return}let n=await Ae.player.getMoneyAccounts(i),r=`**Accounts:**
|
|||
|
|
`+Object.entries(n).map(s=>`${s[0]}: ${s[1]}`).join(`
|
|||
|
|
`);await e.editReply({content:r.length>0?r:`No accounts found for player ${t}.`})}catch(i){console.error("Error fetching account balances via Discord:",i),await e.editReply({content:"Failed to fetch account balances. Please try again."})}},permission:"player.manage_accounts"},jail:{handler:async e=>{let t=e.options.getInteger("targetid"),i=e.options.getString("reason")?.trim()??"No reason provided",n=e.options.getInteger("durationminutes")??0,r=Ci.jail.jail_cells.find(s=>s.name===e.options.getString("cell"))?.name??Ci.jail.jail_cells[0].name;if(!t||t<0){await e.reply({content:"Please provide a valid player ID.",ephemeral:!0});return}try{if(await e.deferReply({ephemeral:!0}),!(0,globalThis.GetPlayerName)(t.toString())){await e.editReply({content:`Player ${t} is not online.`});return}let s=n*60*1e3,a=await Ae.player.getPlayerObject(t),o=a?await Ae.player.getCharName(a):"Unknown",c=await Ae.player.getCharId(a);if(!a)return;if(await Ny.oxmysql.scalar("SELECT 1 FROM luxu_admin_jail WHERE char_id = ? AND expires_at > NOW()",[c])){await e.editReply({content:wt.this_player_is_already_jailed});return}let d=await Ru(e.user.id);if(!d)return;let l=(0,globalThis.GetEntityCoords)((0,globalThis.GetPlayerPed)(t.toString()));if(!await Ge.addPlayerJail({charId:c,char_name:o,staff_id:d,staff_name:e.user.username??"Unknown",expires_at:Qr(Date.now()+s),cell_name:r,last_coords:JSON.stringify({x:l[0],y:l[1],z:l[2]}),reason:i}))return;gi(t,{title:wt.you_have_been_jailed,description:i,type:"warning",duration:5e3}),global.exports[pt].proccessJailSentence(t,c);let h=await Ru(e.user.id);se(h??0,e.user.username,`jailed player id:${t} for ${n} - ${i}`),await e.editReply({content:`Player ${t} jailed for ${n} minutes.`})}catch(s){console.error("Error executing jail command from Discord:",s),await e.editReply({content:"Failed to jail player. Please try again."})}},permission:"player.jail"},setaccountbalance:{handler:async e=>{let t=e.options.getInteger("targetid"),i=e.options.getString("account")?.trim(),n=e.options.getInteger("amount");if(!t||t<0||!i||n===null){await e.reply({content:"Please provide valid target, account, and amount.",ephemeral:!0});return}if(n<0){await e.reply({content:"Amount must be zero or positive.",ephemeral:!0});return}try{if(await e.deferReply({ephemeral:!0}),!(0,globalThis.GetPlayerName)(t.toString())){await e.editReply({content:`Player ${t} is not online.`});return}let r=await Ae.player.getPlayerObject(t);if(!r){await e.editReply({content:`Failed to load player object for ${t}.`});return}await Ae.player.setAccountMoney(t,r,i,n),await e.editReply({content:`Set ${i} balance for player ${t} to ${n}.`})}catch(r){console.error("Error setting account balance from Discord:",r),await e.editReply({content:"Failed to set account balance. Please try again."})}},permission:"player.manage_accounts"},spawn_vehicle:{handler:async e=>{let t=e.options.getInteger("targetid"),i=e.options.getString("model");if(!t||t<0){await e.reply({content:"Please provide a valid player ID.",ephemeral:!0});return}if(!(0,globalThis.GetPlayerName)(t.toString())){await e.reply({content:`Player ${t} is not online.`,ephemeral:!0});return}let n=(0,Xqt.randomUUID)();Sw.add(n),he("actions:spawn_vehicle",t,{model:i,id:n}),await e.reply({content:`Spawned vehicle ${i} for player ${t}.`,ephemeral:!0})},permission:"vehicles.spawn"},totalplayers:{handler:async e=>{let t=(0,globalThis.GetNumPlayerIndices)();await e.reply({content:`Total players: ${t}`,ephemeral:!0})},permission:null},setstatus:{handler:async(e,t)=>{let i=e.options.getString("status");await t.user.setActivity(i),await e.reply({content:`Status set to ${i}`,ephemeral:!0})},permission:"discordbot.manage"},log:{handler:async e=>{let t=e.options.getString("type"),i=e.options.getChannel("channel");if(!i){await e.reply({content:"No channel provided",ephemeral:!0});return}if(!globalThis.discordClient.channels.cache.get(i.id)){await e.reply({content:"Channel not found",ephemeral:!0});return}await e.reply({content:`Log set to ${t} in ${i}`,ephemeral:!0}),kr.sendMessageToChannel(i.id,`Log set to ${t} in ${i}`),kr.store
|
|||
|
|
`);await e.reply({content:`**Staff List (Page ${o}/${a}):**
|
|||
|
|
${l}`,ephemeral:!0})}}catch(i){await e.reply({content:"Error fetching staff",ephemeral:!0}),console.error(i)}if(t==="groups"){let n=(await Ny.oxmysql.query("SELECT * FROM `luxu_admin_groups`")).map(r=>`ID: \`${r.id}\` | Name: **${r.name}**`).join(`
|
|||
|
|
`);await e.reply({content:`**Groups:**
|
|||
|
|
${n}`,ephemeral:!0})}if(t==="add"){if(await uE(e.user.id,"staff.manage")===!1){await e.reply({content:"You do not have permission to add staff members.",ephemeral:!0});return}let i=new q1().setCustomId("add_staff_modal").setTitle("Add Staff Member"),n=new Vh().setCustomId("nickname").setLabel("Nickname").setStyle($h.Short).setPlaceholder("Enter Nickname").setRequired(!0),r=new Vh().setCustomId("gender").setLabel("Gender").setValue("male").setStyle($h.Short).setPlaceholder("Enter Gender").setRequired(!0),s=new Vh().setCustomId("group").setLabel("Group").setValue("owner").setStyle($h.Short).setPlaceholder("Enter Group Name").setRequired(!0),a=new Vh().setCustomId("license2").setLabel("License2").setStyle($h.Short).setPlaceholder("Enter license2").setRequired(!1),o=new Vh().setCustomId("discordid").setLabel("Discord ID").setStyle($h.Short).setPlaceholder("Enter Discord ID").setRequired(!1);i.addComponents(new Gh().addComponents(n),new Gh().addComponents(r),new Gh().addComponents(s),new Gh().addComponents(a),new Gh().addComponents(o));try{await e.showModal(i);let c=await e.awaitModalSubmit({time:3e5,filter:b=>b.customId==="add_staff_modal"&&b.user.id===e.user.id}),u=c.fields.getTextInputValue("nickname"),d=c.fields.getTextInputValue("gender").toLowerCase();d!=="male"&&d!=="female"&&(d="male");let l=c.fields.getTextInputValue("group").toLowerCase(),p=c.fields.getTextInputValue("license2").replace("license:","license2:"),h=c.fields.getTextInputValue("discordid")?.replace("discord:",""),m=p.trim()?p.trim():void 0,f=h?.trim()?"discord:"+h.trim():void 0,g=yc;if(f){let b=await globalThis.discordClient.users.fetch(h);if(!b){await c.reply({content:"Discord user not found.",ephemeral:!0});return}g=b.displayAvatarURL({size:1024})}try{if(!await P_({gender:d,nickname:u,license2:m,discord:f,group:l,id:0,avatar:g})){await c.reply({content:"Failed to add staff member.",ephemeral:!0});return}await c.reply({content:"Staff member added.",ephemeral:!0})}catch(b){console.error("Failed to add staff member.",b),await c.reply({content:"Failed to add staff member.",ephemeral:!0});return}}catch(c){console.error("Modal submission failed, probably timed out.",c)}}if(t==="remove"){if(await uE(e.user.id,"staff.manage")===!1){await e.reply({content:"You do not have permission to remove staff members.",ephemeral:!0});return}let i=new q1().setCustomId("remove_staff_modal").setTitle("Remove Staff Member"),n=new Vh().setCustomId("staff_id").setLabel("Staff ID").setStyle($h.Short).setPlaceholder("Enter the staff ID to remove").setRequired(!0),r=new Gh().addComponents(n);i.addComponents(r);try{await e.showModal(i);let s=await e.awaitModalSubmit({time:6e4,filter:o=>o.customId==="remove_staff_modal"&&o.user.id===e.user.id}),a=s.fields.getTextInputValue("staff_id");if(!a||isNaN(parseInt(a))){await s.reply({content:"Invalid staff ID.",ephemeral:!0});return}await q_(parseInt(a)),await s.reply({content:`Staff member with ID ${a} removed.`,ephemeral:!0})}catch(s){console.error("Modal submission failed, probably timed out.",s)}}},permission:"staff.view"},clearlogchannel:{handler:async e=>{let t=e.options.getString("type");if(!t){await e.reply({content:"No log type provided",ephemeral:!0});return}try{pMe(t),await e.reply({content:`Successfully cleared all log records for log type: ${t}`,ephemeral:!0})}catch(i){console.error("Error clearing log channel records:",i),await e.reply({content:`Failed to clear log records for type: ${t}`,ephemeral:!0})}},permission:"logs.define"},screenshot:{handler:async e=>{let t=e.options.getInteger("targetid");if(!t||t<0){await e.reply({content:"Please provide a valid player ID.",ephemeral:!0});return}try{if(await e.deferReply({ephemeral:!0}),!(0,globalThis.GetPlayerName)(t.toString())){await e.editReply({content:`Player ${t} is not online.`});return}let i=await VPe(t),n=i.startsWith("data:")?i:`data:image/png;base64,${i}`,[,r]=n.split(",",2);if(!r)throw new Error("Invalid screenshot payload");let a=n.match(/^data:(.+);base64/)?.[1]??"image/png",c=`screenshot_player_${t}.${a==="image/png"?"png":a==="image/jpeg"?"jpg":"png"}`,u=Buffer.fro
|
|||
|
|
`);await e.reply({content:`**Ban List (Page ${s}/${r}) - Total: ${t.length} bans:**
|
|||
|
|
${u}`,ephemeral:!0})}catch(t){await e.reply({content:"Error fetching bans",ephemeral:!0}),console.error("Error fetching bans from Discord:",t)}},permission:"player.ban"},playerlist:{handler:async e=>{try{let t=Object.values(Pn),i=e.options.getInteger("page")??1,n=10,r=Math.ceil(t.length/n),s=Math.max(1,Math.min(i,r)),a=(s-1)*n,o=a+n,c=t.slice(a,o);if(c.length===0){await e.reply({content:`No players found on page ${s}.`,ephemeral:!0});return}let u=c.map(d=>{let l=d?.char?.name??d?.name??"Unknown",p=d.source,h=d.uniqueId,m=d.char?.job?`${d.char.job.label} (${d.char.job.gradeName})`:"None",f=(0,globalThis.GetPlayerPing)(p.toString());return`**${l}** | ID: \`${p}\` | Job: **${m}** | Ping: **${f}ms** | Unique: \`${h}\``}).join(`
|
|||
|
|
`);await e.reply({content:`**Player List (Page ${s}/${r}) - Total: ${t.length} players:**
|
|||
|
|
${u}`,ephemeral:!0})}catch(t){await e.reply({content:"Error fetching player list",ephemeral:!0}),console.error("Error fetching player list from Discord:",t)}},permission:""}};function vfn(e){console.log(`Discord bot logged in as ${e.user.tag}!`)}function yfn(e,t){console.error("Discord bot error:",e);let i=e?.code;(i==="TOKEN_INVALID"||i==="DISALLOWED_INTENT")&&t(`Authentication error: ${i}`)}function xfn(e){e("Token has been invalidated by Discord")}async function Efn(e,t){try{if(!e.isChatInputCommand())return;let i=ePt[e.commandName];if(!i){await e.reply("Command not found");return}if(i.permission===""){if(!await Ru(e.user.id)){await e.reply("You do not have permission to use this command");return}}else if(i.permission&&await uE(e.user.id,i.permission)===!1){await e.reply("You do not have permission to use this command");return}await i.handler(e,t)}catch(i){console.error("Error handling Discord interaction:",i);try{e.isChatInputCommand()&&!e.replied&&await e.reply({content:"An error occurred while processing your command.",ephemeral:!0})}catch(n){console.error("Failed to send error reply:",n)}}}async function Ifn(e,t){try{let i=e.roles.cache,n=t.roles.cache,r=n.filter(a=>!i.has(a.id)),s=i.filter(a=>!n.has(a.id));if(r.size===0&&s.size===0)return;for(let a of r.values()){let o=await VTe(a.id);if(!o)continue;let c=await Ru(t.user.id);c?await AV.oxmysql.update("UPDATE luxu_admin_group_members SET `group` = ? WHERE id = ? LIMIT 1",[o.name,c]):await P_({id:0,nickname:t.displayName??t.user.username,group:o.name,discord:`discord:${t.user.id}`,avatar:t.displayAvatarURL({size:1024}),gender:"male"}),await tPt(t.user.id)}for(let a of s.values()){let o=await Ru(t.user.id);if(!o)continue;let c=await AV.oxmysql.scalar("SELECT `group` FROM luxu_admin_group_members WHERE id = ? LIMIT 1",[o]);if(!c)continue;let u=await AV.oxmysql.scalar("SELECT discord_role_id FROM luxu_admin_groups WHERE name = ? LIMIT 1",[c]);u&&u===a.id&&(await q_(o),await tPt(t.user.id))}}catch(i){console.error("Failed to sync Discord roles with staff groups:",i)}}async function tPt(e){for(let t of getPlayers())if((0,globalThis.GetPlayerIdentifierByType)(t,"discord")?.replace("discord:","")===e){await HTe(Number(t));break}}function iPt(e,t){e.on("ready",()=>vfn(e)),e.on("error",i=>yfn(i,t)),e.on("invalidated",()=>xfn(t)),e.on("interactionCreate",i=>Efn(i,e)),e.on("guildMemberUpdate",(i,n)=>Ifn(i,n))}process.version.startsWith("22")?{Client:hV,GatewayIntentBits:Dw,REST:mV,Routes:fV}=$pe():{Client:hV,GatewayIntentBits:Dw,REST:mV,Routes:fV}=PEe();var hV,Dw,mV,fV;function nPt(){return new hV({intents:[Dw.Guilds,Dw.GuildMembers,Dw.GuildPresences],rest:{timeout:3e4,retries:1}})}function rPt(e,t){return i=>{if(!t.value){t.value=!0,console.error(`Discord bot destroyed: ${i}`),console.error("The bot will NOT attempt to reconnect. Please restart the resource after fixing the issue.");try{e.destroy()}catch{}globalThis.discordClient=void 0}}}async function sPt(){await new mV({version:"10",timeout:3e4}).setToken(ir.discord_bot.token).put(fV.applicationCommands(ir.discord_bot.client_id),{body:JW.commands.filter(t=>t.enabled)}),await uU(10),console.log("Successfully reloaded application (/) commands.")}async function aPt(e,t,i){if(i.value)throw new Error("Bot was destroyed during login");await e.login(ir.discord_bot.token),globalThis.discordClient=e,console.log("Discord bot logged in successfully")}async function oPt(){if(!ir.discord_bot.enabled)return;let e=ZW();if(!e.valid){console.error("Discord Bot Configuration Errors:"),e.errors.forEach(t=>console.error(` - ${t}`));return}try{let t=sPt(),i=nPt(),n={value:!1},r=rPt(i,n);iPt(i,r),await t,await aPt(i,r,n)}catch(t){console.error("Failed to start Discord bot:",t)}}function up(e,t){globalThis.exports[pt].AnticheatBypass(e,t)}var Ra=Ze(require("fs"),1);var Yh=Ze(require("path"),1);var Cfn=100,wfn=24,gV=wfn*60*60*1e3,cPt=Xi.loop_delays.coords_update||1e4,Bfn=300*1e3,lPt=1e4,_fn=6e4,Qfn=3,VEe=7,$Ee=5,Ly=Yh.default.join((0,globalThis.GetResourcePath)(pt),"logs/coords_history"),OEe=1500,Hh=new Map,uPt=0,Rw=null,jEe=null;function HEe
|
|||
|
|
SELECT
|
|||
|
|
e.*,
|
|||
|
|
m.nickname AS author_name,
|
|||
|
|
m.avatar AS author_avatar
|
|||
|
|
FROM luxu_admin_events e
|
|||
|
|
LEFT JOIN luxu_admin_group_members m ON e.author_id = m.id
|
|||
|
|
ORDER BY e.date ASC
|
|||
|
|
`)}catch(e){return console.error(e),[]}},async delete(e){let{id:t}=e,i=oe(source);se(i?.id??0,i?.nickname??Ue(source),`Deleted event id:${t}`);try{return await BV.oxmysql.update("DELETE FROM luxu_admin_events WHERE id = ?",[t])===1}catch{return!1}},async createEvent(e){try{let{title:t,description:i,date:n}=jfn.parse(e),r=oe(source);if(!r)return!1;let s=Qr(n),a=await BV.oxmysql.insert("INSERT INTO luxu_admin_events (title, description, date, author_id) VALUES (?, ?, ?, ?)",[t,i,s,r.id]);return se(r.id,r.nickname,`Created event ${t}`),a}catch(t){return console.error("ERROR CREATING EVENT",t),!1}}};Te.registerNonActionHandler("events:get",async({staff:e})=>Et(e.group,"events.view")?await Mw.get():!1);Te.registerNonActionHandler("events:delete",({staff:e,data:t})=>Et(e.group,"events.view")?Mw.delete(t):!1);Te.registerNonActionHandler("events:createEvent",({staff:e,data:t})=>Et(e.group,"events.view")?Mw.createEvent(t):!1);Ke("events:get",async e=>On(e,"events.view",!0)?Mw.get():!1);Ke("events:delete",async(e,t)=>On(e,"events.delete",!0)?Mw.delete(t):!1);Ke("events:createEvent",async(e,t)=>On(e,"events.create",!0)?Mw.createEvent(t):!1);var NPt=Ze(_r(),1);global.exports("getPlayerStaffGroup",e=>{let t=oe(e);return t?t.group:!1});global.exports("getStaffGroups",async()=>{let e=await NPt.oxmysql.query("SELECT name, label, hierarchy, permissions FROM luxu_admin_groups");return e?e.map(t=>({name:t.name,label:t.label,hierarchy:t.hierarchy,permissions:JSON.parse(t.permissions)})):!1});global.exports("getOnlineStaff",(e=!1)=>{let t=[];return $t.forEach((i,n)=>{e&&!i.onDuty||t.push({source:Number(n),duty:i.onDuty,group:i.group,staffId:i.id,nickname:i.nickname,avatar:i.avatar??yc})}),t});global.exports("getPlayerStaffDutyState",e=>{let t=oe(e);return t?t.onDuty:!1});global.exports("formatMariaDBDate",Qr);global.exports("warnPlayer",async(e,t)=>{if(!e||!t||!(0,globalThis.GetPlayerName)(e.toString()))return;let i=be(e),n=(await Ge.getPlayerWarnings(i))?.length??0,r=(0,globalThis.GetPlayerIdentifierByType)(e.toString(),"discord")?.replace("discord:",""),s=Ue(e.toString());if((n+1)%Ci.warnings.maximum_warnings_until_ban===0){let a=getPlayerIdentifiers(e),o=getPlayerTokens(e);return Ge.addPlayerBan({uniqueId:i,identifiers:a,tokens:o,reason:Ci.warnings.ban_message,duration:Ci.warnings.ban_duration_days*24*60*60*1e3,staffId:null,playerName:s}),(0,globalThis.DropPlayer)(e.toString(),Ci.warnings.ban_message),dE(e,{message:t,staffName:"system",staffUniqueId:null}),setTimeout(()=>{let c=kr.getLogChannelId("warnings");if(c)try{let u=global.exports[pt].playerWarningEmbed({uniqueId:i,playerName:s,discordId:r,reason:t,staffName:"system"});kr.sendMessageToChannel(c,{embeds:u})}catch(u){console.error("ERRO WHILE CREATING CUSTOM WARNING EMBED"),console.error(u)}},500),!0}});global.exports("createBan",async e=>await Ge.addPlayerBan(e));global.exports("removeBan",async e=>await Ge.removePlayerBan(e));var j1=Ze(_r(),1);Cn("media:deleteVideoClip",async(e,t)=>{let i=await j1.oxmysql.prepare("SELECT author_id FROM luxu_admin_media WHERE cdn_id = ?",[t]);!i||be(e)!==i&&!On(e,"media.manage")||(j1.oxmysql.query("DELETE FROM luxu_admin_media WHERE cdn_id = ?",[t]),Py.delete("video",t))});Ke("media:requestPresignedUrl",async(e,t)=>{let i=await Py.createPresignedUrl(t);return console.debug("url",i),i});Cn("media:presignedSuccess",async(e,{id:t,url:i,type:n,expiration:r})=>{let s=be(e);r?j1.oxmysql.query("INSERT INTO luxu_admin_media (cdn_id, url, type, author_id, expiration) VALUES (?, ?, ?, ?, ?)",[t,i,n,s,Qr(r)]):j1.oxmysql.query("INSERT INTO luxu_admin_media (cdn_id, url, type, author_id) VALUES (?, ?, ?, ?)",[t,i,n,s])});var G1=Ze(_r(),1);(0,globalThis.RegisterCommand)("luxuadminv1migrate",async e=>{if(e===0){console.log("MIGRATING BANS");try{let t=await G1.oxmysql.query("SELECT * from luxu_banlist");t.forEach(i=>{let n=JSON.parse(i.identifiers);if(!Array.isArray(n))return;let r=(n.find(a=>a.includes("license")||a.includes("license2"))??n[0]).split(":")[1],s=Qr(new Date(i.expiration*1e3).getTime());G1.oxmysql.insert("INSERT INTO luxu_admin_bans (player
|
|||
|
|
Please add the following ace to your group:
|
|||
|
|
add_ace resource.luxu_admin command allow`)}))});Te.registerNonActionHandler("getTurnServers",()=>ir.custom_ice_servers);Te.registerNonActionHandler("inventory:getItemList",()=>Ae.inventory.getItems());Te.registerNonActionHandler("getConfig",()=>{let e=globalThis.exports[pt].getInventoryConfig();return Ci.inventory=e,Ci.inventory.images_url=`https://${(0,globalThis.GetConvar)("web_baseUrl","")}/${pt}/inventory/${e.images_url.replace("https://","")}`,Ci});Te.registerNonActionHandler("getServerEndpoint",()=>{let e=(0,globalThis.GetCurrentResourceName)(),t=(0,globalThis.GetConvar)("web_baseUrl","");return t===""?!1:`https://${t}/${e}`});Te.registerNonActionHandler("getAllVehicleModels",()=>Tp.list);(0,globalThis.RegisterCommand)("luxu:gencloudflare:turn",(e,t)=>{let i=t[0],n=t[1];if(!i)return console.error("No key provided");if(!n)return console.error("No api token provided");mr.post(`https://rtc.live.cloudflare.com/v1/turn/keys/${i}/credentials/generate-ice-servers`,{ttl:86400},{headers:{Authorization:`Bearer ${n}`,"Content-Type":"application/json"}}).then(r=>{r.data?(console.log("Successfully generated ICE servers, add this to your api.json"),console.log(r.data.iceServers)):console.error("Failed to generate ICE servers")}).catch(r=>console.error(r))},!0);
|
|||
|
|
})();
|