qumra-cli 1.1.45 → 1.1.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/cli.cjs CHANGED
@@ -304,45 +304,45 @@ function(e){var t=lj,n=Xj,r=Sj,i=eF,s=nF(),a=kN("express:application"),c=hF,l=x,
304
304
  * Copyright(c) 2015 Douglas Christopher Wilson
305
305
  * MIT Licensed
306
306
  */
307
- parse:function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");var n={},r=(t||{}).decode||fU,i=0;for(;i<e.length;){var s=e.indexOf("=",i);if(-1===s)break;var o=e.indexOf(";",i);if(-1===o)o=e.length;else if(o<s){i=e.lastIndexOf(";",s-1)+1;continue}var a=e.slice(i,s).trim();if(void 0===n[a]){var c=e.slice(s+1,o).trim();34===c.charCodeAt(0)&&(c=c.slice(1,-1)),n[a]=gU(c,r)}i=o+1}return n},serialize:function(e,t,n){var r=n||{},i=r.encode||mU;if("function"!=typeof i)throw new TypeError("option encode is invalid");if(!dU.test(e))throw new TypeError("argument name is invalid");var s=i(t);if(s&&!dU.test(s))throw new TypeError("argument val is invalid");var o=e+"="+s;if(null!=r.maxAge){var a=r.maxAge-0;if(isNaN(a)||!isFinite(a))throw new TypeError("option maxAge is invalid");o+="; Max-Age="+Math.floor(a)}if(r.domain){if(!dU.test(r.domain))throw new TypeError("option domain is invalid");o+="; Domain="+r.domain}if(r.path){if(!dU.test(r.path))throw new TypeError("option path is invalid");o+="; Path="+r.path}if(r.expires){var c=r.expires;if(!function(e){return"[object Date]"===hU.call(e)||e instanceof Date}(c)||isNaN(c.valueOf()))throw new TypeError("option expires is invalid");o+="; Expires="+c.toUTCString()}r.httpOnly&&(o+="; HttpOnly");r.secure&&(o+="; Secure");r.partitioned&&(o+="; Partitioned");if(r.priority){switch("string"==typeof r.priority?r.priority.toLowerCase():r.priority){case"low":o+="; Priority=Low";break;case"medium":o+="; Priority=Medium";break;case"high":o+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(r.sameSite){switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return o}},hU=Object.prototype.toString,dU=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function fU(e){return-1!==e.indexOf("%")?decodeURIComponent(e):e}function mU(e){return encodeURIComponent(e)}function gU(e,t){try{return t(e)}catch(t){return e}}var yU={exports:{}};
307
+ parse:function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");var n={},r=e.length;if(r<2)return n;var i=t&&t.decode||bU,s=0,o=0,a=0;do{if(-1===(o=e.indexOf("=",s)))break;if(-1===(a=e.indexOf(";",s)))a=r;else if(o>a){s=e.lastIndexOf(";",o-1)+1;continue}var c=yU(e,s,o),l=vU(e,o,c),u=e.slice(c,l);if(!n.hasOwnProperty(u)){var p=yU(e,o+1,a),h=vU(e,a,p);34===e.charCodeAt(p)&&34===e.charCodeAt(h-1)&&(p++,h--);var d=e.slice(p,h);n[u]=_U(d,i)}s=a+1}while(s<r);return n},serialize:function(e,t,n){var r=n&&n.encode||encodeURIComponent;if("function"!=typeof r)throw new TypeError("option encode is invalid");if(!dU.test(e))throw new TypeError("argument name is invalid");var i=r(t);if(!fU.test(i))throw new TypeError("argument val is invalid");var s=e+"="+i;if(!n)return s;if(null!=n.maxAge){var o=Math.floor(n.maxAge);if(!isFinite(o))throw new TypeError("option maxAge is invalid");s+="; Max-Age="+o}if(n.domain){if(!mU.test(n.domain))throw new TypeError("option domain is invalid");s+="; Domain="+n.domain}if(n.path){if(!gU.test(n.path))throw new TypeError("option path is invalid");s+="; Path="+n.path}if(n.expires){var a=n.expires;if(!function(e){return"[object Date]"===hU.call(e)}(a)||isNaN(a.valueOf()))throw new TypeError("option expires is invalid");s+="; Expires="+a.toUTCString()}n.httpOnly&&(s+="; HttpOnly");n.secure&&(s+="; Secure");n.partitioned&&(s+="; Partitioned");if(n.priority){switch("string"==typeof n.priority?n.priority.toLowerCase():n.priority){case"low":s+="; Priority=Low";break;case"medium":s+="; Priority=Medium";break;case"high":s+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(n.sameSite){switch("string"==typeof n.sameSite?n.sameSite.toLowerCase():n.sameSite){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return s}},hU=Object.prototype.toString,dU=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,fU=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,mU=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,gU=/^[\u0020-\u003A\u003D-\u007E]*$/;function yU(e,t,n){do{var r=e.charCodeAt(t);if(32!==r&&9!==r)return t}while(++t<n);return n}function vU(e,t,n){for(;t>n;){var r=e.charCodeAt(--t);if(32!==r&&9!==r)return t+1}return n}function bU(e){return-1!==e.indexOf("%")?decodeURIComponent(e):e}function _U(e,t){try{return t(e)}catch(t){return e}}var wU={exports:{}};
308
308
  /*!
309
309
  * vary
310
310
  * Copyright(c) 2014-2017 Douglas Christopher Wilson
311
311
  * MIT Licensed
312
- */yU.exports=function(e,t){if(!e||!e.getHeader||!e.setHeader)throw new TypeError("res argument is required");var n=e.getHeader("Vary")||"",r=Array.isArray(n)?n.join(", "):String(n);(n=bU(r,t))&&e.setHeader("Vary",n)},yU.exports.append=bU;var vU=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function bU(e,t){if("string"!=typeof e)throw new TypeError("header argument is required");if(!t)throw new TypeError("field argument is required");for(var n=Array.isArray(t)?t:_U(String(t)),r=0;r<n.length;r++)if(!vU.test(n[r]))throw new TypeError("field argument contains an invalid header name");if("*"===e)return e;var i=e,s=_U(e.toLowerCase());if(-1!==n.indexOf("*")||-1!==s.indexOf("*"))return"*";for(var o=0;o<n.length;o++){var a=n[o].toLowerCase();-1===s.indexOf(a)&&(s.push(a),i=i?i+", "+n[o]:n[o])}return i}function _U(e){for(var t=0,n=[],r=0,i=0,s=e.length;i<s;i++)switch(e.charCodeAt(i)){case 32:r===t&&(r=t=i+1);break;case 44:n.push(e.substring(r,t)),r=t=i+1;break;default:t=i+1}return n.push(e.substring(r,t)),n}var wU=yU.exports,xU=yF.Buffer,EU=MF,SU=FL,TU=XO("express"),DU=AN,kU=IN,AU=x,CU=mF.isAbsolute,RU=MN,OU=o,LU=YN,IU=Pj,PU=uU.sign,NU=mF.normalizeType,jU=mF.normalizeTypes,FU=mF.setCharset,BU=pU,MU=BB,UU=OU.extname,qU=MU.mime,HU=OU.resolve,$U=wU,zU=Object.create(AU.ServerResponse.prototype),WU=zU,GU=/;\s*charset\s*=/;
312
+ */wU.exports=function(e,t){if(!e||!e.getHeader||!e.setHeader)throw new TypeError("res argument is required");var n=e.getHeader("Vary")||"",r=Array.isArray(n)?n.join(", "):String(n);(n=EU(r,t))&&e.setHeader("Vary",n)},wU.exports.append=EU;var xU=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function EU(e,t){if("string"!=typeof e)throw new TypeError("header argument is required");if(!t)throw new TypeError("field argument is required");for(var n=Array.isArray(t)?t:SU(String(t)),r=0;r<n.length;r++)if(!xU.test(n[r]))throw new TypeError("field argument contains an invalid header name");if("*"===e)return e;var i=e,s=SU(e.toLowerCase());if(-1!==n.indexOf("*")||-1!==s.indexOf("*"))return"*";for(var o=0;o<n.length;o++){var a=n[o].toLowerCase();-1===s.indexOf(a)&&(s.push(a),i=i?i+", "+n[o]:n[o])}return i}function SU(e){for(var t=0,n=[],r=0,i=0,s=e.length;i<s;i++)switch(e.charCodeAt(i)){case 32:r===t&&(r=t=i+1);break;case 44:n.push(e.substring(r,t)),r=t=i+1;break;default:t=i+1}return n.push(e.substring(r,t)),n}var TU=wU.exports,DU=yF.Buffer,kU=MF,AU=FL,CU=XO("express"),RU=AN,OU=IN,LU=x,IU=mF.isAbsolute,PU=MN,NU=o,jU=YN,FU=Pj,BU=uU.sign,MU=mF.normalizeType,UU=mF.normalizeTypes,qU=mF.setCharset,HU=pU,$U=BB,zU=NU.extname,WU=$U.mime,GU=NU.resolve,VU=TU,KU=Object.create(LU.ServerResponse.prototype),YU=KU,ZU=/;\s*charset\s*=/;
313
313
  /*!
314
314
  * express
315
315
  * Copyright(c) 2009-2013 TJ Holowaychuk
316
316
  * Copyright(c) 2014-2015 Douglas Christopher Wilson
317
317
  * MIT Licensed
318
- */function VU(e,t,n,r){var i,s=!1;function o(){if(!s){s=!0;var e=new Error("Request aborted");e.code="ECONNABORTED",r(e)}}function a(e){s||(s=!0,r(e))}t.on("directory",(function(){if(!s){s=!0;var e=new Error("EISDIR, read");e.code="EISDIR",r(e)}})),t.on("end",(function(){s||(s=!0,r())})),t.on("error",a),t.on("file",(function(){i=!1})),t.on("stream",(function(){i=!0})),RU(e,(function(e){return e&&"ECONNRESET"===e.code?o():e?a(e):void(s||setImmediate((function(){!1===i||s?s||(s=!0,r()):o()})))})),n.headers&&t.on("headers",(function(e){for(var t=n.headers,r=Object.keys(t),i=0;i<r.length;i++){var s=r[i];e.setHeader(s,t[s])}})),t.pipe(e)}function KU(e,t,n,r){var i=t||n?JSON.stringify(e,t,n):JSON.stringify(e);return r&&"string"==typeof i&&(i=i.replace(/[<>&]/g,(function(e){switch(e.charCodeAt(0)){case 60:return"\\u003c";case 62:return"\\u003e";case 38:return"\\u0026";default:return e}}))),i}zU.status=function(e){return("string"==typeof e||Math.floor(e)!==e)&&e>99&&e<1e3&&TU("res.status("+JSON.stringify(e)+"): use res.status("+Math.floor(e)+") instead"),this.statusCode=e,this},zU.links=function(e){var t=this.get("Link")||"";return t&&(t+=", "),this.set("Link",t+Object.keys(e).map((function(t){return"<"+e[t]+'>; rel="'+t+'"'})).join(", "))},zU.send=function(e){var t,n,r=e,i=this.req,s=this.app;switch(2===arguments.length&&("number"!=typeof arguments[0]&&"number"==typeof arguments[1]?(TU("res.send(body, status): Use res.status(status).send(body) instead"),this.statusCode=arguments[1]):(TU("res.send(status, body): Use res.status(status).send(body) instead"),this.statusCode=arguments[0],r=arguments[1])),"number"==typeof r&&1===arguments.length&&(this.get("Content-Type")||this.type("txt"),TU("res.send(status): Use res.sendStatus(status) instead"),this.statusCode=r,r=LU.message[r]),typeof r){case"string":this.get("Content-Type")||this.type("html");break;case"boolean":case"number":case"object":if(null===r)r="";else{if(!xU.isBuffer(r))return this.json(r);this.get("Content-Type")||this.type("bin")}}"string"==typeof r&&(t="utf8","string"==typeof(n=this.get("Content-Type"))&&this.set("Content-Type",FU(n,"utf-8")));var o,a,c=s.get("etag fn"),l=!this.get("ETag")&&"function"==typeof c;return void 0!==r&&(xU.isBuffer(r)?o=r.length:!l&&r.length<1e3?o=xU.byteLength(r,t):(r=xU.from(r,t),t=void 0,o=r.length),this.set("Content-Length",o)),l&&void 0!==o&&(a=c(r,t))&&this.set("ETag",a),i.fresh&&(this.statusCode=304),204!==this.statusCode&&304!==this.statusCode||(this.removeHeader("Content-Type"),this.removeHeader("Content-Length"),this.removeHeader("Transfer-Encoding"),r=""),205===this.statusCode&&(this.set("Content-Length","0"),this.removeHeader("Transfer-Encoding"),r=""),"HEAD"===i.method?this.end():this.end(r,t),this},zU.json=function(e){var t=e;2===arguments.length&&("number"==typeof arguments[1]?(TU("res.json(obj, status): Use res.status(status).json(obj) instead"),this.statusCode=arguments[1]):(TU("res.json(status, obj): Use res.status(status).json(obj) instead"),this.statusCode=arguments[0],t=arguments[1]));var n=this.app,r=n.get("json escape"),i=KU(t,n.get("json replacer"),n.get("json spaces"),r);return this.get("Content-Type")||this.set("Content-Type","application/json"),this.send(i)},zU.jsonp=function(e){var t=e;2===arguments.length&&("number"==typeof arguments[1]?(TU("res.jsonp(obj, status): Use res.status(status).jsonp(obj) instead"),this.statusCode=arguments[1]):(TU("res.jsonp(status, obj): Use res.status(status).jsonp(obj) instead"),this.statusCode=arguments[0],t=arguments[1]));var n=this.app,r=n.get("json escape"),i=KU(t,n.get("json replacer"),n.get("json spaces"),r),s=this.req.query[n.get("jsonp callback name")];return this.get("Content-Type")||(this.set("X-Content-Type-Options","nosniff"),this.set("Content-Type","application/json")),Array.isArray(s)&&(s=s[0]),"string"==typeof s&&0!==s.length&&(this.set("X-Content-Type-Options","nosniff"),this.set("Content-Type","text/javascript"),s=s.replace(/[^\[\]\w$.]/g,""),void 0===i?i="":"string"==typeof i&&(i=i.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")),i="/**/ typeof "+s+" === 'function' && "+s+"("+i+");"),this.send(i)},zU.sendStatus=function(e){var t=LU.message[e]||String(e);return this.statusCode=e,this.type("txt"),this.send(t)},zU.sendFile=function(e,t,n){var r=n,i=this.req,s=i.next,o=t||{};if(!e)throw new TypeError("path argument is required to res.sendFile");if("string"!=typeof e)throw new TypeError("path must be a string to res.sendFile");if("function"==typeof t&&(r=t,o={}),!o.root&&!CU(e))throw new TypeError("path must be absolute or specify root to res.sendFile");var a=encodeURI(e);VU(this,MU(i,a,o),o,(function(e){return r?r(e):e&&"EISDIR"===e.code?s():void(e&&"ECONNABORTED"!==e.code&&"write"!==e.syscall&&s(e))}))},zU.sendfile=function(e,t,n){var r=n,i=this.req,s=i.next,o=t||{};"function"==typeof t&&(r=t,o={}),VU(this,MU(i,e,o),o,(function(e){return r?r(e):e&&"EISDIR"===e.code?s():void(e&&"ECONNABORTED"!==e.code&&"write"!==e.syscall&&s(e))}))},zU.sendfile=TU.function(zU.sendfile,"res.sendfile: Use res.sendFile instead"),zU.download=function(e,t,n,r){var i=r,s=t,o=n||null;"function"==typeof t?(i=t,s=null,o=null):"function"==typeof n&&(i=n,o=null),"object"!=typeof t||"function"!=typeof n&&void 0!==n||(s=null,o=t);var a={"Content-Disposition":EU(s||e)};if(o&&o.headers)for(var c=Object.keys(o.headers),l=0;l<c.length;l++){var u=c[l];"content-disposition"!==u.toLowerCase()&&(a[u]=o.headers[u])}(o=Object.create(o)).headers=a;var p=o.root?e:HU(e);return this.sendFile(p,o,i)},zU.contentType=zU.type=function(e){var t=-1===e.indexOf("/")?qU.lookup(e):e;return this.set("Content-Type",t)},zU.format=function(e){var t=this.req,n=t.next,r=Object.keys(e).filter((function(e){return"default"!==e})),i=r.length>0&&t.accepts(r);return this.vary("Accept"),i?(this.set("Content-Type",NU(i).value),e[i](t,this,n)):e.default?e.default(t,this,n):n(SU(406,{types:jU(r).map((function(e){return e.value}))})),this},zU.attachment=function(e){return e&&this.type(UU(e)),this.set("Content-Disposition",EU(e)),this},zU.append=function(e,t){var n=this.get(e),r=t;return n&&(r=Array.isArray(n)?n.concat(t):Array.isArray(t)?[n].concat(t):[n,t]),this.set(e,r)},zU.set=zU.header=function(e,t){if(2===arguments.length){var n=Array.isArray(t)?t.map(String):String(t);if("content-type"===e.toLowerCase()){if(Array.isArray(n))throw new TypeError("Content-Type cannot be set to an Array");if(!GU.test(n)){var r=qU.charsets.lookup(n.split(";")[0]);r&&(n+="; charset="+r.toLowerCase())}}this.setHeader(e,n)}else for(var i in e)this.set(i,e[i]);return this},zU.get=function(e){return this.getHeader(e)},zU.clearCookie=function(e,t){t&&(t.maxAge&&TU('res.clearCookie: Passing "options.maxAge" is deprecated. In v5.0.0 of Express, this option will be ignored, as res.clearCookie will automatically set cookies to expire immediately. Please update your code to omit this option.'),t.expires&&TU('res.clearCookie: Passing "options.expires" is deprecated. In v5.0.0 of Express, this option will be ignored, as res.clearCookie will automatically set cookies to expire immediately. Please update your code to omit this option.'));var n=IU({expires:new Date(1),path:"/"},t);return this.cookie(e,"",n)},zU.cookie=function(e,t,n){var r=IU({},n),i=this.req.secret,s=r.signed;if(s&&!i)throw new Error('cookieParser("secret") required for signed cookies');var o="object"==typeof t?"j:"+JSON.stringify(t):String(t);if(s&&(o="s:"+PU(o,i)),null!=r.maxAge){var a=r.maxAge-0;isNaN(a)||(r.expires=new Date(Date.now()+a),r.maxAge=Math.floor(a/1e3))}return null==r.path&&(r.path="/"),this.append("Set-Cookie",BU.serialize(e,String(o),r)),this},zU.location=function(e){var t;return"back"===e?(TU('res.location("back"): use res.location(req.get("Referrer") || "/") and refer to https://dub.sh/security-redirect for best practices'),t=this.req.get("Referrer")||"/"):t=String(e),this.set("Location",DU(t))},zU.redirect=function(e){var t,n=e,r=302;2===arguments.length&&("number"==typeof arguments[0]?(r=arguments[0],n=arguments[1]):(TU("res.redirect(url, status): Use res.redirect(status, url) instead"),r=arguments[1])),n=this.location(n).get("Location"),this.format({text:function(){t=LU.message[r]+". Redirecting to "+n},html:function(){var e=kU(n);t="<p>"+LU.message[r]+". Redirecting to "+e+"</p>"},default:function(){t=""}}),this.statusCode=r,this.set("Content-Length",xU.byteLength(t)),"HEAD"===this.req.method?this.end():this.end(t)},zU.vary=function(e){return!e||Array.isArray(e)&&!e.length?(TU("res.vary(): Provide a field name"),this):($U(this,e),this)},zU.render=function(e,t,n){var r=this.req.app,i=n,s=t||{},o=this.req,a=this;"function"==typeof t&&(i=t,s={}),s._locals=a.locals,i=i||function(e,t){if(e)return o.next(e);a.send(t)},r.render(e,s,i)};var YU,ZU={exports:{}};
318
+ */function QU(e,t,n,r){var i,s=!1;function o(){if(!s){s=!0;var e=new Error("Request aborted");e.code="ECONNABORTED",r(e)}}function a(e){s||(s=!0,r(e))}t.on("directory",(function(){if(!s){s=!0;var e=new Error("EISDIR, read");e.code="EISDIR",r(e)}})),t.on("end",(function(){s||(s=!0,r())})),t.on("error",a),t.on("file",(function(){i=!1})),t.on("stream",(function(){i=!0})),PU(e,(function(e){return e&&"ECONNRESET"===e.code?o():e?a(e):void(s||setImmediate((function(){!1===i||s?s||(s=!0,r()):o()})))})),n.headers&&t.on("headers",(function(e){for(var t=n.headers,r=Object.keys(t),i=0;i<r.length;i++){var s=r[i];e.setHeader(s,t[s])}})),t.pipe(e)}function JU(e,t,n,r){var i=t||n?JSON.stringify(e,t,n):JSON.stringify(e);return r&&"string"==typeof i&&(i=i.replace(/[<>&]/g,(function(e){switch(e.charCodeAt(0)){case 60:return"\\u003c";case 62:return"\\u003e";case 38:return"\\u0026";default:return e}}))),i}KU.status=function(e){return("string"==typeof e||Math.floor(e)!==e)&&e>99&&e<1e3&&CU("res.status("+JSON.stringify(e)+"): use res.status("+Math.floor(e)+") instead"),this.statusCode=e,this},KU.links=function(e){var t=this.get("Link")||"";return t&&(t+=", "),this.set("Link",t+Object.keys(e).map((function(t){return"<"+e[t]+'>; rel="'+t+'"'})).join(", "))},KU.send=function(e){var t,n,r=e,i=this.req,s=this.app;switch(2===arguments.length&&("number"!=typeof arguments[0]&&"number"==typeof arguments[1]?(CU("res.send(body, status): Use res.status(status).send(body) instead"),this.statusCode=arguments[1]):(CU("res.send(status, body): Use res.status(status).send(body) instead"),this.statusCode=arguments[0],r=arguments[1])),"number"==typeof r&&1===arguments.length&&(this.get("Content-Type")||this.type("txt"),CU("res.send(status): Use res.sendStatus(status) instead"),this.statusCode=r,r=jU.message[r]),typeof r){case"string":this.get("Content-Type")||this.type("html");break;case"boolean":case"number":case"object":if(null===r)r="";else{if(!DU.isBuffer(r))return this.json(r);this.get("Content-Type")||this.type("bin")}}"string"==typeof r&&(t="utf8","string"==typeof(n=this.get("Content-Type"))&&this.set("Content-Type",qU(n,"utf-8")));var o,a,c=s.get("etag fn"),l=!this.get("ETag")&&"function"==typeof c;return void 0!==r&&(DU.isBuffer(r)?o=r.length:!l&&r.length<1e3?o=DU.byteLength(r,t):(r=DU.from(r,t),t=void 0,o=r.length),this.set("Content-Length",o)),l&&void 0!==o&&(a=c(r,t))&&this.set("ETag",a),i.fresh&&(this.statusCode=304),204!==this.statusCode&&304!==this.statusCode||(this.removeHeader("Content-Type"),this.removeHeader("Content-Length"),this.removeHeader("Transfer-Encoding"),r=""),205===this.statusCode&&(this.set("Content-Length","0"),this.removeHeader("Transfer-Encoding"),r=""),"HEAD"===i.method?this.end():this.end(r,t),this},KU.json=function(e){var t=e;2===arguments.length&&("number"==typeof arguments[1]?(CU("res.json(obj, status): Use res.status(status).json(obj) instead"),this.statusCode=arguments[1]):(CU("res.json(status, obj): Use res.status(status).json(obj) instead"),this.statusCode=arguments[0],t=arguments[1]));var n=this.app,r=n.get("json escape"),i=JU(t,n.get("json replacer"),n.get("json spaces"),r);return this.get("Content-Type")||this.set("Content-Type","application/json"),this.send(i)},KU.jsonp=function(e){var t=e;2===arguments.length&&("number"==typeof arguments[1]?(CU("res.jsonp(obj, status): Use res.status(status).jsonp(obj) instead"),this.statusCode=arguments[1]):(CU("res.jsonp(status, obj): Use res.status(status).jsonp(obj) instead"),this.statusCode=arguments[0],t=arguments[1]));var n=this.app,r=n.get("json escape"),i=JU(t,n.get("json replacer"),n.get("json spaces"),r),s=this.req.query[n.get("jsonp callback name")];return this.get("Content-Type")||(this.set("X-Content-Type-Options","nosniff"),this.set("Content-Type","application/json")),Array.isArray(s)&&(s=s[0]),"string"==typeof s&&0!==s.length&&(this.set("X-Content-Type-Options","nosniff"),this.set("Content-Type","text/javascript"),s=s.replace(/[^\[\]\w$.]/g,""),void 0===i?i="":"string"==typeof i&&(i=i.replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")),i="/**/ typeof "+s+" === 'function' && "+s+"("+i+");"),this.send(i)},KU.sendStatus=function(e){var t=jU.message[e]||String(e);return this.statusCode=e,this.type("txt"),this.send(t)},KU.sendFile=function(e,t,n){var r=n,i=this.req,s=i.next,o=t||{};if(!e)throw new TypeError("path argument is required to res.sendFile");if("string"!=typeof e)throw new TypeError("path must be a string to res.sendFile");if("function"==typeof t&&(r=t,o={}),!o.root&&!IU(e))throw new TypeError("path must be absolute or specify root to res.sendFile");var a=encodeURI(e);QU(this,$U(i,a,o),o,(function(e){return r?r(e):e&&"EISDIR"===e.code?s():void(e&&"ECONNABORTED"!==e.code&&"write"!==e.syscall&&s(e))}))},KU.sendfile=function(e,t,n){var r=n,i=this.req,s=i.next,o=t||{};"function"==typeof t&&(r=t,o={}),QU(this,$U(i,e,o),o,(function(e){return r?r(e):e&&"EISDIR"===e.code?s():void(e&&"ECONNABORTED"!==e.code&&"write"!==e.syscall&&s(e))}))},KU.sendfile=CU.function(KU.sendfile,"res.sendfile: Use res.sendFile instead"),KU.download=function(e,t,n,r){var i=r,s=t,o=n||null;"function"==typeof t?(i=t,s=null,o=null):"function"==typeof n&&(i=n,o=null),"object"!=typeof t||"function"!=typeof n&&void 0!==n||(s=null,o=t);var a={"Content-Disposition":kU(s||e)};if(o&&o.headers)for(var c=Object.keys(o.headers),l=0;l<c.length;l++){var u=c[l];"content-disposition"!==u.toLowerCase()&&(a[u]=o.headers[u])}(o=Object.create(o)).headers=a;var p=o.root?e:GU(e);return this.sendFile(p,o,i)},KU.contentType=KU.type=function(e){var t=-1===e.indexOf("/")?WU.lookup(e):e;return this.set("Content-Type",t)},KU.format=function(e){var t=this.req,n=t.next,r=Object.keys(e).filter((function(e){return"default"!==e})),i=r.length>0&&t.accepts(r);return this.vary("Accept"),i?(this.set("Content-Type",MU(i).value),e[i](t,this,n)):e.default?e.default(t,this,n):n(AU(406,{types:UU(r).map((function(e){return e.value}))})),this},KU.attachment=function(e){return e&&this.type(zU(e)),this.set("Content-Disposition",kU(e)),this},KU.append=function(e,t){var n=this.get(e),r=t;return n&&(r=Array.isArray(n)?n.concat(t):Array.isArray(t)?[n].concat(t):[n,t]),this.set(e,r)},KU.set=KU.header=function(e,t){if(2===arguments.length){var n=Array.isArray(t)?t.map(String):String(t);if("content-type"===e.toLowerCase()){if(Array.isArray(n))throw new TypeError("Content-Type cannot be set to an Array");if(!ZU.test(n)){var r=WU.charsets.lookup(n.split(";")[0]);r&&(n+="; charset="+r.toLowerCase())}}this.setHeader(e,n)}else for(var i in e)this.set(i,e[i]);return this},KU.get=function(e){return this.getHeader(e)},KU.clearCookie=function(e,t){t&&(t.maxAge&&CU('res.clearCookie: Passing "options.maxAge" is deprecated. In v5.0.0 of Express, this option will be ignored, as res.clearCookie will automatically set cookies to expire immediately. Please update your code to omit this option.'),t.expires&&CU('res.clearCookie: Passing "options.expires" is deprecated. In v5.0.0 of Express, this option will be ignored, as res.clearCookie will automatically set cookies to expire immediately. Please update your code to omit this option.'));var n=FU({expires:new Date(1),path:"/"},t);return this.cookie(e,"",n)},KU.cookie=function(e,t,n){var r=FU({},n),i=this.req.secret,s=r.signed;if(s&&!i)throw new Error('cookieParser("secret") required for signed cookies');var o="object"==typeof t?"j:"+JSON.stringify(t):String(t);if(s&&(o="s:"+BU(o,i)),null!=r.maxAge){var a=r.maxAge-0;isNaN(a)||(r.expires=new Date(Date.now()+a),r.maxAge=Math.floor(a/1e3))}return null==r.path&&(r.path="/"),this.append("Set-Cookie",HU.serialize(e,String(o),r)),this},KU.location=function(e){var t;return"back"===e?(CU('res.location("back"): use res.location(req.get("Referrer") || "/") and refer to https://dub.sh/security-redirect for best practices'),t=this.req.get("Referrer")||"/"):t=String(e),this.set("Location",RU(t))},KU.redirect=function(e){var t,n=e,r=302;2===arguments.length&&("number"==typeof arguments[0]?(r=arguments[0],n=arguments[1]):(CU("res.redirect(url, status): Use res.redirect(status, url) instead"),r=arguments[1])),n=this.location(n).get("Location"),this.format({text:function(){t=jU.message[r]+". Redirecting to "+n},html:function(){var e=OU(n);t="<p>"+jU.message[r]+". Redirecting to "+e+"</p>"},default:function(){t=""}}),this.statusCode=r,this.set("Content-Length",DU.byteLength(t)),"HEAD"===this.req.method?this.end():this.end(t)},KU.vary=function(e){return!e||Array.isArray(e)&&!e.length?(CU("res.vary(): Provide a field name"),this):(VU(this,e),this)},KU.render=function(e,t,n){var r=this.req.app,i=n,s=t||{},o=this.req,a=this;"function"==typeof t&&(i=t,s={}),s._locals=a.locals,i=i||function(e,t){if(e)return o.next(e);a.send(t)},r.render(e,s,i)};var XU,eq={exports:{}};
319
319
  /*!
320
320
  * serve-static
321
321
  * Copyright(c) 2010 Sencha Inc.
322
322
  * Copyright(c) 2011 TJ Holowaychuk
323
323
  * Copyright(c) 2014-2016 Douglas Christopher Wilson
324
324
  * MIT Licensed
325
- */function QU(){if(YU)return ZU.exports;YU=1;var e=AN,t=IN,n=VN,r=o.resolve,i=BB,s=S;return ZU.exports=function(o,a){if(!o)throw new TypeError("root path required");if("string"!=typeof o)throw new TypeError("root path must be a string");var c=Object.create(a||null),l=!1!==c.fallthrough,u=!1!==c.redirect,p=c.setHeaders;if(p&&"function"!=typeof p)throw new TypeError("option setHeaders must be function");c.maxage=c.maxage||c.maxAge||0,c.root=r(o);var h=u?function(r){if(this.hasTrailingSlash())this.error(404);else{var i=n.original(this.req);i.path=null,i.pathname=function(e){for(var t=0;t<e.length&&47===e.charCodeAt(t);t++);return t>1?"/"+e.substr(t):e}(i.pathname+"/");var o,a,c=e(s.format(i)),l=(o="Redirecting",a="Redirecting to "+t(c),'<!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>'+o+"</title>\n</head>\n<body>\n<pre>"+a+"</pre>\n</body>\n</html>\n");r.statusCode=301,r.setHeader("Content-Type","text/html; charset=UTF-8"),r.setHeader("Content-Length",Buffer.byteLength(l)),r.setHeader("Content-Security-Policy","default-src 'none'"),r.setHeader("X-Content-Type-Options","nosniff"),r.setHeader("Location",c),r.end(l)}}:function(){this.error(404)};return function(e,t,r){if("GET"!==e.method&&"HEAD"!==e.method)return l?r():(t.statusCode=405,t.setHeader("Allow","GET, HEAD"),t.setHeader("Content-Length","0"),void t.end());var s=!l,o=n.original(e),a=n(e).pathname;"/"===a&&"/"!==o.pathname.substr(-1)&&(a="");var u=i(e,a,c);u.on("directory",h),p&&u.on("headers",p),l&&u.on("file",(function(){s=!0})),u.on("error",(function(e){!s&&e.statusCode<500?r():r(e)})),u.pipe(t)}},ZU.exports.mime=i.mime,ZU.exports}
325
+ */function tq(){if(XU)return eq.exports;XU=1;var e=AN,t=IN,n=VN,r=o.resolve,i=BB,s=S;return eq.exports=function(o,a){if(!o)throw new TypeError("root path required");if("string"!=typeof o)throw new TypeError("root path must be a string");var c=Object.create(a||null),l=!1!==c.fallthrough,u=!1!==c.redirect,p=c.setHeaders;if(p&&"function"!=typeof p)throw new TypeError("option setHeaders must be function");c.maxage=c.maxage||c.maxAge||0,c.root=r(o);var h=u?function(r){if(this.hasTrailingSlash())this.error(404);else{var i=n.original(this.req);i.path=null,i.pathname=function(e){for(var t=0;t<e.length&&47===e.charCodeAt(t);t++);return t>1?"/"+e.substr(t):e}(i.pathname+"/");var o,a,c=e(s.format(i)),l=(o="Redirecting",a="Redirecting to "+t(c),'<!DOCTYPE html>\n<html lang="en">\n<head>\n<meta charset="utf-8">\n<title>'+o+"</title>\n</head>\n<body>\n<pre>"+a+"</pre>\n</body>\n</html>\n");r.statusCode=301,r.setHeader("Content-Type","text/html; charset=UTF-8"),r.setHeader("Content-Length",Buffer.byteLength(l)),r.setHeader("Content-Security-Policy","default-src 'none'"),r.setHeader("X-Content-Type-Options","nosniff"),r.setHeader("Location",c),r.end(l)}}:function(){this.error(404)};return function(e,t,r){if("GET"!==e.method&&"HEAD"!==e.method)return l?r():(t.statusCode=405,t.setHeader("Allow","GET, HEAD"),t.setHeader("Content-Length","0"),void t.end());var s=!l,o=n.original(e),a=n(e).pathname;"/"===a&&"/"!==o.pathname.substr(-1)&&(a="");var u=i(e,a,c);u.on("directory",h),p&&u.on("headers",p),l&&u.on("file",(function(){s=!0})),u.on("error",(function(e){!s&&e.statusCode<500?r():r(e)})),u.pipe(t)}},eq.exports.mime=i.mime,eq.exports}
326
326
  /*!
327
327
  * express
328
328
  * Copyright(c) 2009-2013 TJ Holowaychuk
329
329
  * Copyright(c) 2013 Roman Shtylman
330
330
  * Copyright(c) 2014-2015 Douglas Christopher Wilson
331
331
  * MIT Licensed
332
- */!function(e,t){var n=hN,r=p.EventEmitter,i=dN,s=eM,o=Oj,a=Xj,c=cU,l=WU;(t=e.exports=function(){var e=function(t,n,r){e.handle(t,n,r)};return i(e,r.prototype,!1),i(e,s,!1),e.request=Object.create(c,{app:{configurable:!0,enumerable:!0,writable:!0,value:e}}),e.response=Object.create(l,{app:{configurable:!0,enumerable:!0,writable:!0,value:e}}),e.init(),e}).application=s,t.request=c,t.response=l,t.Route=o,t.Router=a,t.json=n.json,t.query=nF(),t.raw=n.raw,t.static=QU(),t.text=n.text,t.urlencoded=n.urlencoded;["bodyParser","compress","cookieSession","session","logger","cookieParser","favicon","responseTime","errorHandler","timeout","methodOverride","vhost","csrf","directory","limit","multipart","staticCache"].forEach((function(e){Object.defineProperty(t,e,{get:function(){throw new Error("Most middleware (like "+e+") is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.")},configurable:!0})}))}(ZO,ZO.exports);var JU=q(ZO.exports),XU={},eq={};
332
+ */!function(e,t){var n=hN,r=p.EventEmitter,i=dN,s=eM,o=Oj,a=Xj,c=cU,l=YU;(t=e.exports=function(){var e=function(t,n,r){e.handle(t,n,r)};return i(e,r.prototype,!1),i(e,s,!1),e.request=Object.create(c,{app:{configurable:!0,enumerable:!0,writable:!0,value:e}}),e.response=Object.create(l,{app:{configurable:!0,enumerable:!0,writable:!0,value:e}}),e.init(),e}).application=s,t.request=c,t.response=l,t.Route=o,t.Router=a,t.json=n.json,t.query=nF(),t.raw=n.raw,t.static=tq(),t.text=n.text,t.urlencoded=n.urlencoded;["bodyParser","compress","cookieSession","session","logger","cookieParser","favicon","responseTime","errorHandler","timeout","methodOverride","vhost","csrf","directory","limit","multipart","staticCache"].forEach((function(e){Object.defineProperty(t,e,{get:function(){throw new Error("Most middleware (like "+e+") is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.")},configurable:!0})}))}(ZO,ZO.exports);var nq=q(ZO.exports),rq={},iq={};
333
333
  /*!
334
334
  * express
335
335
  * Copyright(c) 2009-2013 TJ Holowaychuk
336
336
  * Copyright(c) 2013 Roman Shtylman
337
337
  * Copyright(c) 2014-2015 Douglas Christopher Wilson
338
338
  * MIT Licensed
339
- */const tq=o,nq="\\\\/",rq=`[^${nq}]`,iq="\\.",sq="\\/",oq="[^/]",aq=`(?:${sq}|$)`,cq=`(?:^|${sq})`,lq=`${iq}{1,2}${aq}`,uq={DOT_LITERAL:iq,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:sq,ONE_CHAR:"(?=.)",QMARK:oq,END_ANCHOR:aq,DOTS_SLASH:lq,NO_DOT:`(?!${iq})`,NO_DOTS:`(?!${cq}${lq})`,NO_DOT_SLASH:`(?!${iq}{0,1}${aq})`,NO_DOTS_SLASH:`(?!${lq})`,QMARK_NO_DOT:`[^.${sq}]`,STAR:`${oq}*?`,START_ANCHOR:cq},pq={...uq,SLASH_LITERAL:`[${nq}]`,QMARK:rq,STAR:`${rq}*?`,DOTS_SLASH:`${iq}{1,2}(?:[${nq}]|$)`,NO_DOT:`(?!${iq})`,NO_DOTS:`(?!(?:^|[${nq}])${iq}{1,2}(?:[${nq}]|$))`,NO_DOT_SLASH:`(?!${iq}{0,1}(?:[${nq}]|$))`,NO_DOTS_SLASH:`(?!${iq}{1,2}(?:[${nq}]|$))`,QMARK_NO_DOT:`[^.${nq}]`,START_ANCHOR:`(?:^|[${nq}])`,END_ANCHOR:`(?:[${nq}]|$)`};var hq={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:tq.sep,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?pq:uq};!function(e){const t=o,n="win32"===process.platform,{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:i,REGEX_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_GLOBAL:a}=hq;e.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),e.hasRegexChars=e=>s.test(e),e.isRegexChar=t=>1===t.length&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(a,"\\$1"),e.toPosixSlashes=e=>e.replace(r,"/"),e.removeBackslashes=e=>e.replace(i,(e=>"\\"===e?"":e)),e.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);return 3===e.length&&e[0]>=9||8===e[0]&&e[1]>=10},e.isWindows=e=>e&&"boolean"==typeof e.windows?e.windows:!0===n||"\\"===t.sep,e.escapeLast=(t,n,r)=>{const i=t.lastIndexOf(n,r);return-1===i?t:"\\"===t[i-1]?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith("./")&&(n=n.slice(2),t.prefix="./"),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?"":"^"}(?:${e})${n.contains?"":"$"}`;return!0===t.negated&&(r=`(?:^(?!${r}).*$)`),r}}(eq);const dq=eq,{CHAR_ASTERISK:fq,CHAR_AT:mq,CHAR_BACKWARD_SLASH:gq,CHAR_COMMA:yq,CHAR_DOT:vq,CHAR_EXCLAMATION_MARK:bq,CHAR_FORWARD_SLASH:_q,CHAR_LEFT_CURLY_BRACE:wq,CHAR_LEFT_PARENTHESES:xq,CHAR_LEFT_SQUARE_BRACKET:Eq,CHAR_PLUS:Sq,CHAR_QUESTION_MARK:Tq,CHAR_RIGHT_CURLY_BRACE:Dq,CHAR_RIGHT_PARENTHESES:kq,CHAR_RIGHT_SQUARE_BRACKET:Aq}=hq,Cq=e=>e===_q||e===gq,Rq=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};var Oq=(e,t)=>{const n=t||{},r=e.length-1,i=!0===n.parts||!0===n.scanToEnd,s=[],o=[],a=[];let c,l,u=e,p=-1,h=0,d=0,f=!1,m=!1,g=!1,y=!1,v=!1,b=!1,_=!1,w=!1,x=!1,E=!1,S=0,T={value:"",depth:0,isGlob:!1};const D=()=>p>=r,k=()=>(c=l,u.charCodeAt(++p));for(;p<r;){let e;if(l=k(),l!==gq){if(!0===b||l===wq){for(S++;!0!==D()&&(l=k());)if(l!==gq)if(l!==wq){if(!0!==b&&l===vq&&(l=k())===vq){if(f=T.isBrace=!0,g=T.isGlob=!0,E=!0,!0===i)continue;break}if(!0!==b&&l===yq){if(f=T.isBrace=!0,g=T.isGlob=!0,E=!0,!0===i)continue;break}if(l===Dq&&(S--,0===S)){b=!1,f=T.isBrace=!0,E=!0;break}}else S++;else _=T.backslashes=!0,k();if(!0===i)continue;break}if(l!==_q){if(!0!==n.noext){if(!0===(l===Sq||l===mq||l===fq||l===Tq||l===bq)&&u.charCodeAt(p+1)===xq){if(g=T.isGlob=!0,y=T.isExtglob=!0,E=!0,l===bq&&p===h&&(x=!0),!0===i){for(;!0!==D()&&(l=k());)if(l!==gq){if(l===kq){g=T.isGlob=!0,E=!0;break}}else _=T.backslashes=!0,l=k();continue}break}}if(l===fq){if(c===fq&&(v=T.isGlobstar=!0),g=T.isGlob=!0,E=!0,!0===i)continue;break}if(l===Tq){if(g=T.isGlob=!0,E=!0,!0===i)continue;break}if(l===Eq){for(;!0!==D()&&(e=k());)if(e!==gq){if(e===Aq){m=T.isBracket=!0,g=T.isGlob=!0,E=!0;break}}else _=T.backslashes=!0,k();if(!0===i)continue;break}if(!0===n.nonegate||l!==bq||p!==h){if(!0!==n.noparen&&l===xq){if(g=T.isGlob=!0,!0===i){for(;!0!==D()&&(l=k());)if(l!==xq){if(l===kq){E=!0;break}}else _=T.backslashes=!0,l=k();continue}break}if(!0===g){if(E=!0,!0===i)continue;break}}else w=T.negated=!0,h++}else{if(s.push(p),o.push(T),T={value:"",depth:0,isGlob:!1},!0===E)continue;if(c===vq&&p===h+1){h+=2;continue}d=p+1}}else _=T.backslashes=!0,l=k(),l===wq&&(b=!0)}!0===n.noext&&(y=!1,g=!1);let A=u,C="",R="";h>0&&(C=u.slice(0,h),u=u.slice(h),d-=h),A&&!0===g&&d>0?(A=u.slice(0,d),R=u.slice(d)):!0===g?(A="",R=u):A=u,A&&""!==A&&"/"!==A&&A!==u&&Cq(A.charCodeAt(A.length-1))&&(A=A.slice(0,-1)),!0===n.unescape&&(R&&(R=dq.removeBackslashes(R)),A&&!0===_&&(A=dq.removeBackslashes(A)));const O={prefix:C,input:e,start:h,base:A,glob:R,isBrace:f,isBracket:m,isGlob:g,isExtglob:y,isGlobstar:v,negated:w,negatedExtglob:x};if(!0===n.tokens&&(O.maxDepth=0,Cq(l)||o.push(T),O.tokens=o),!0===n.parts||!0===n.tokens){let t;for(let r=0;r<s.length;r++){const i=t?t+1:h,c=s[r],l=e.slice(i,c);n.tokens&&(0===r&&0!==h?(o[r].isPrefix=!0,o[r].value=C):o[r].value=l,Rq(o[r]),O.maxDepth+=o[r].depth),0===r&&""===l||a.push(l),t=c}if(t&&t+1<e.length){const r=e.slice(t+1);a.push(r),n.tokens&&(o[o.length-1].value=r,Rq(o[o.length-1]),O.maxDepth+=o[o.length-1].depth)}O.slashes=s,O.parts=a}return O};const Lq=hq,Iq=eq,{MAX_LENGTH:Pq,POSIX_REGEX_SOURCE:Nq,REGEX_NON_SPECIAL_CHARS:jq,REGEX_SPECIAL_CHARS_BACKREF:Fq,REPLACEMENTS:Bq}=Lq,Mq=(e,t)=>{if("function"==typeof t.expandRange)return t.expandRange(...e,t);e.sort();const n=`[${e.join("-")}]`;try{new RegExp(n)}catch(t){return e.map((e=>Iq.escapeRegex(e))).join("..")}return n},Uq=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,qq=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");e=Bq[e]||e;const n={...t},r="number"==typeof n.maxLength?Math.min(Pq,n.maxLength):Pq;let i=e.length;if(i>r)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${r}`);const s={type:"bos",value:"",output:n.prepend||""},o=[s],a=n.capture?"":"?:",c=Iq.isWindows(t),l=Lq.globChars(c),u=Lq.extglobChars(l),{DOT_LITERAL:p,PLUS_LITERAL:h,SLASH_LITERAL:d,ONE_CHAR:f,DOTS_SLASH:m,NO_DOT:g,NO_DOT_SLASH:y,NO_DOTS_SLASH:v,QMARK:b,QMARK_NO_DOT:_,STAR:w,START_ANCHOR:x}=l,E=e=>`(${a}(?:(?!${x}${e.dot?m:p}).)*?)`,S=n.dot?"":g,T=n.dot?b:_;let D=!0===n.bash?E(n):w;n.capture&&(D=`(${D})`),"boolean"==typeof n.noext&&(n.noextglob=n.noext);const k={input:e,index:-1,start:0,dot:!0===n.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};e=Iq.removePrefix(e,k),i=e.length;const A=[],C=[],R=[];let O,L=s;const I=()=>k.index===i-1,P=k.peek=(t=1)=>e[k.index+t],N=k.advance=()=>e[++k.index]||"",j=()=>e.slice(k.index+1),F=(e="",t=0)=>{k.consumed+=e,k.index+=t},B=e=>{k.output+=null!=e.output?e.output:e.value,F(e.value)},M=()=>{let e=1;for(;"!"===P()&&("("!==P(2)||"?"===P(3));)N(),k.start++,e++;return e%2!=0&&(k.negated=!0,k.start++,!0)},U=e=>{k[e]++,R.push(e)},q=e=>{k[e]--,R.pop()},H=e=>{if("globstar"===L.type){const t=k.braces>0&&("comma"===e.type||"brace"===e.type),n=!0===e.extglob||A.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(k.output=k.output.slice(0,-L.output.length),L.type="star",L.value="*",L.output=D,k.output+=L.output)}if(A.length&&"paren"!==e.type&&(A[A.length-1].inner+=e.value),(e.value||e.output)&&B(e),L&&"text"===L.type&&"text"===e.type)return L.value+=e.value,void(L.output=(L.output||"")+e.value);e.prev=L,o.push(e),L=e},$=(e,t)=>{const r={...u[t],conditions:1,inner:""};r.prev=L,r.parens=k.parens,r.output=k.output;const i=(n.capture?"(":"")+r.open;U("parens"),H({type:e,value:t,output:k.output?"":f}),H({type:"paren",extglob:!0,value:N(),output:i}),A.push(r)},z=e=>{let r,i=e.close+(n.capture?")":"");if("negate"===e.type){let s=D;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(s=E(n)),(s!==D||I()||/^\)+$/.test(j()))&&(i=e.close=`)$))${s}`),e.inner.includes("*")&&(r=j())&&/^\.[^\\/.]+$/.test(r)){const n=qq(r,{...t,fastpaths:!1}).output;i=e.close=`)${n})${s})`}"bos"===e.prev.type&&(k.negatedExtglob=!0)}H({type:"paren",extglob:!0,value:O,output:i}),q("parens")};if(!1!==n.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(e)){let r=!1,i=e.replace(Fq,((e,t,n,i,s,o)=>"\\"===i?(r=!0,e):"?"===i?t?t+i+(s?b.repeat(s.length):""):0===o?T+(s?b.repeat(s.length):""):b.repeat(n.length):"."===i?p.repeat(n.length):"*"===i?t?t+i+(s?D:""):D:t?e:`\\${e}`));return!0===r&&(i=!0===n.unescape?i.replace(/\\/g,""):i.replace(/\\+/g,(e=>e.length%2==0?"\\\\":e?"\\":""))),i===e&&!0===n.contains?(k.output=e,k):(k.output=Iq.wrapOutput(i,k,t),k)}for(;!I();){if(O=N(),"\0"===O)continue;if("\\"===O){const e=P();if("/"===e&&!0!==n.bash)continue;if("."===e||";"===e)continue;if(!e){O+="\\",H({type:"text",value:O});continue}const t=/^\\+/.exec(j());let r=0;if(t&&t[0].length>2&&(r=t[0].length,k.index+=r,r%2!=0&&(O+="\\")),!0===n.unescape?O=N():O+=N(),0===k.brackets){H({type:"text",value:O});continue}}if(k.brackets>0&&("]"!==O||"["===L.value||"[^"===L.value)){if(!1!==n.posix&&":"===O){const e=L.value.slice(1);if(e.includes("[")&&(L.posix=!0,e.includes(":"))){const e=L.value.lastIndexOf("["),t=L.value.slice(0,e),n=L.value.slice(e+2),r=Nq[n];if(r){L.value=t+r,k.backtrack=!0,N(),s.output||1!==o.indexOf(L)||(s.output=f);continue}}}("["===O&&":"!==P()||"-"===O&&"]"===P())&&(O=`\\${O}`),"]"!==O||"["!==L.value&&"[^"!==L.value||(O=`\\${O}`),!0===n.posix&&"!"===O&&"["===L.value&&(O="^"),L.value+=O,B({value:O});continue}if(1===k.quotes&&'"'!==O){O=Iq.escapeRegex(O),L.value+=O,B({value:O});continue}if('"'===O){k.quotes=1===k.quotes?0:1,!0===n.keepQuotes&&H({type:"text",value:O});continue}if("("===O){U("parens"),H({type:"paren",value:O});continue}if(")"===O){if(0===k.parens&&!0===n.strictBrackets)throw new SyntaxError(Uq("opening","("));const e=A[A.length-1];if(e&&k.parens===e.parens+1){z(A.pop());continue}H({type:"paren",value:O,output:k.parens?")":"\\)"}),q("parens");continue}if("["===O){if(!0!==n.nobracket&&j().includes("]"))U("brackets");else{if(!0!==n.nobracket&&!0===n.strictBrackets)throw new SyntaxError(Uq("closing","]"));O=`\\${O}`}H({type:"bracket",value:O});continue}if("]"===O){if(!0===n.nobracket||L&&"bracket"===L.type&&1===L.value.length){H({type:"text",value:O,output:`\\${O}`});continue}if(0===k.brackets){if(!0===n.strictBrackets)throw new SyntaxError(Uq("opening","["));H({type:"text",value:O,output:`\\${O}`});continue}q("brackets");const e=L.value.slice(1);if(!0===L.posix||"^"!==e[0]||e.includes("/")||(O=`/${O}`),L.value+=O,B({value:O}),!1===n.literalBrackets||Iq.hasRegexChars(e))continue;const t=Iq.escapeRegex(L.value);if(k.output=k.output.slice(0,-L.value.length),!0===n.literalBrackets){k.output+=t,L.value=t;continue}L.value=`(${a}${t}|${L.value})`,k.output+=L.value;continue}if("{"===O&&!0!==n.nobrace){U("braces");const e={type:"brace",value:O,output:"(",outputIndex:k.output.length,tokensIndex:k.tokens.length};C.push(e),H(e);continue}if("}"===O){const e=C[C.length-1];if(!0===n.nobrace||!e){H({type:"text",value:O,output:O});continue}let t=")";if(!0===e.dots){const e=o.slice(),r=[];for(let t=e.length-1;t>=0&&(o.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&r.unshift(e[t].value);t=Mq(r,n),k.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const n=k.output.slice(0,e.outputIndex),r=k.tokens.slice(e.tokensIndex);e.value=e.output="\\{",O=t="\\}",k.output=n;for(const e of r)k.output+=e.output||e.value}H({type:"brace",value:O,output:t}),q("braces"),C.pop();continue}if("|"===O){A.length>0&&A[A.length-1].conditions++,H({type:"text",value:O});continue}if(","===O){let e=O;const t=C[C.length-1];t&&"braces"===R[R.length-1]&&(t.comma=!0,e="|"),H({type:"comma",value:O,output:e});continue}if("/"===O){if("dot"===L.type&&k.index===k.start+1){k.start=k.index+1,k.consumed="",k.output="",o.pop(),L=s;continue}H({type:"slash",value:O,output:d});continue}if("."===O){if(k.braces>0&&"dot"===L.type){"."===L.value&&(L.output=p);const e=C[C.length-1];L.type="dots",L.output+=O,L.value+=O,e.dots=!0;continue}if(k.braces+k.parens===0&&"bos"!==L.type&&"slash"!==L.type){H({type:"text",value:O,output:p});continue}H({type:"dot",value:O,output:p});continue}if("?"===O){if(!(L&&"("===L.value)&&!0!==n.noextglob&&"("===P()&&"?"!==P(2)){$("qmark",O);continue}if(L&&"paren"===L.type){const e=P();let t=O;if("<"===e&&!Iq.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===L.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(j()))&&(t=`\\${O}`),H({type:"text",value:O,output:t});continue}if(!0!==n.dot&&("slash"===L.type||"bos"===L.type)){H({type:"qmark",value:O,output:_});continue}H({type:"qmark",value:O,output:b});continue}if("!"===O){if(!0!==n.noextglob&&"("===P()&&("?"!==P(2)||!/[!=<:]/.test(P(3)))){$("negate",O);continue}if(!0!==n.nonegate&&0===k.index){M();continue}}if("+"===O){if(!0!==n.noextglob&&"("===P()&&"?"!==P(2)){$("plus",O);continue}if(L&&"("===L.value||!1===n.regex){H({type:"plus",value:O,output:h});continue}if(L&&("bracket"===L.type||"paren"===L.type||"brace"===L.type)||k.parens>0){H({type:"plus",value:O});continue}H({type:"plus",value:h});continue}if("@"===O){if(!0!==n.noextglob&&"("===P()&&"?"!==P(2)){H({type:"at",extglob:!0,value:O,output:""});continue}H({type:"text",value:O});continue}if("*"!==O){"$"!==O&&"^"!==O||(O=`\\${O}`);const e=jq.exec(j());e&&(O+=e[0],k.index+=e[0].length),H({type:"text",value:O});continue}if(L&&("globstar"===L.type||!0===L.star)){L.type="star",L.star=!0,L.value+=O,L.output=D,k.backtrack=!0,k.globstar=!0,F(O);continue}let t=j();if(!0!==n.noextglob&&/^\([^?]/.test(t)){$("star",O);continue}if("star"===L.type){if(!0===n.noglobstar){F(O);continue}const r=L.prev,i=r.prev,s="slash"===r.type||"bos"===r.type,o=i&&("star"===i.type||"globstar"===i.type);if(!0===n.bash&&(!s||t[0]&&"/"!==t[0])){H({type:"star",value:O,output:""});continue}const a=k.braces>0&&("comma"===r.type||"brace"===r.type),c=A.length&&("pipe"===r.type||"paren"===r.type);if(!s&&"paren"!==r.type&&!a&&!c){H({type:"star",value:O,output:""});continue}for(;"/**"===t.slice(0,3);){const n=e[k.index+4];if(n&&"/"!==n)break;t=t.slice(3),F("/**",3)}if("bos"===r.type&&I()){L.type="globstar",L.value+=O,L.output=E(n),k.output=L.output,k.globstar=!0,F(O);continue}if("slash"===r.type&&"bos"!==r.prev.type&&!o&&I()){k.output=k.output.slice(0,-(r.output+L.output).length),r.output=`(?:${r.output}`,L.type="globstar",L.output=E(n)+(n.strictSlashes?")":"|$)"),L.value+=O,k.globstar=!0,k.output+=r.output+L.output,F(O);continue}if("slash"===r.type&&"bos"!==r.prev.type&&"/"===t[0]){const e=void 0!==t[1]?"|$":"";k.output=k.output.slice(0,-(r.output+L.output).length),r.output=`(?:${r.output}`,L.type="globstar",L.output=`${E(n)}${d}|${d}${e})`,L.value+=O,k.output+=r.output+L.output,k.globstar=!0,F(O+N()),H({type:"slash",value:"/",output:""});continue}if("bos"===r.type&&"/"===t[0]){L.type="globstar",L.value+=O,L.output=`(?:^|${d}|${E(n)}${d})`,k.output=L.output,k.globstar=!0,F(O+N()),H({type:"slash",value:"/",output:""});continue}k.output=k.output.slice(0,-L.output.length),L.type="globstar",L.output=E(n),L.value+=O,k.output+=L.output,k.globstar=!0,F(O);continue}const r={type:"star",value:O,output:D};!0!==n.bash?!L||"bracket"!==L.type&&"paren"!==L.type||!0!==n.regex?(k.index!==k.start&&"slash"!==L.type&&"dot"!==L.type||("dot"===L.type?(k.output+=y,L.output+=y):!0===n.dot?(k.output+=v,L.output+=v):(k.output+=S,L.output+=S),"*"!==P()&&(k.output+=f,L.output+=f)),H(r)):(r.output=O,H(r)):(r.output=".*?","bos"!==L.type&&"slash"!==L.type||(r.output=S+r.output),H(r))}for(;k.brackets>0;){if(!0===n.strictBrackets)throw new SyntaxError(Uq("closing","]"));k.output=Iq.escapeLast(k.output,"["),q("brackets")}for(;k.parens>0;){if(!0===n.strictBrackets)throw new SyntaxError(Uq("closing",")"));k.output=Iq.escapeLast(k.output,"("),q("parens")}for(;k.braces>0;){if(!0===n.strictBrackets)throw new SyntaxError(Uq("closing","}"));k.output=Iq.escapeLast(k.output,"{"),q("braces")}if(!0===n.strictSlashes||"star"!==L.type&&"bracket"!==L.type||H({type:"maybe_slash",value:"",output:`${d}?`}),!0===k.backtrack){k.output="";for(const e of k.tokens)k.output+=null!=e.output?e.output:e.value,e.suffix&&(k.output+=e.suffix)}return k};qq.fastpaths=(e,t)=>{const n={...t},r="number"==typeof n.maxLength?Math.min(Pq,n.maxLength):Pq,i=e.length;if(i>r)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${r}`);e=Bq[e]||e;const s=Iq.isWindows(t),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:l,NO_DOT:u,NO_DOTS:p,NO_DOTS_SLASH:h,STAR:d,START_ANCHOR:f}=Lq.globChars(s),m=n.dot?p:u,g=n.dot?h:u,y=n.capture?"":"?:";let v=!0===n.bash?".*?":d;n.capture&&(v=`(${v})`);const b=e=>!0===e.noglobstar?v:`(${y}(?:(?!${f}${e.dot?l:o}).)*?)`,_=e=>{switch(e){case"*":return`${m}${c}${v}`;case".*":return`${o}${c}${v}`;case"*.*":return`${m}${v}${o}${c}${v}`;case"*/*":return`${m}${v}${a}${c}${g}${v}`;case"**":return m+b(n);case"**/*":return`(?:${m}${b(n)}${a})?${g}${c}${v}`;case"**/*.*":return`(?:${m}${b(n)}${a})?${g}${v}${o}${c}${v}`;case"**/.*":return`(?:${m}${b(n)}${a})?${o}${c}${v}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const n=_(t[1]);if(!n)return;return n+o+t[2]}}},w=Iq.removePrefix(e,{negated:!1,prefix:""});let x=_(w);return x&&!0!==n.strictSlashes&&(x+=`${a}?`),x};const Hq=o,$q=Oq,zq=qq,Wq=eq,Gq=hq,Vq=(e,t,n=!1)=>{if(Array.isArray(e)){const r=e.map((e=>Vq(e,t,n))),i=e=>{for(const t of r){const n=t(e);if(n)return n}return!1};return i}const r=(i=e)&&"object"==typeof i&&!Array.isArray(i)&&e.tokens&&e.input;var i;if(""===e||"string"!=typeof e&&!r)throw new TypeError("Expected pattern to be a non-empty string");const s=t||{},o=Wq.isWindows(t),a=r?Vq.compileRe(e,t):Vq.makeRe(e,t,!1,!0),c=a.state;delete a.state;let l=()=>!1;if(s.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};l=Vq(s.ignore,e,n)}const u=(n,r=!1)=>{const{isMatch:i,match:u,output:p}=Vq.test(n,a,t,{glob:e,posix:o}),h={glob:e,state:c,regex:a,posix:o,input:n,output:p,match:u,isMatch:i};return"function"==typeof s.onResult&&s.onResult(h),!1===i?(h.isMatch=!1,!!r&&h):l(n)?("function"==typeof s.onIgnore&&s.onIgnore(h),h.isMatch=!1,!!r&&h):("function"==typeof s.onMatch&&s.onMatch(h),!r||h)};return n&&(u.state=c),u};Vq.test=(e,t,n,{glob:r,posix:i}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const s=n||{},o=s.format||(i?Wq.toPosixSlashes:null);let a=e===r,c=a&&o?o(e):e;return!1===a&&(c=o?o(e):e,a=c===r),!1!==a&&!0!==s.capture||(a=!0===s.matchBase||!0===s.basename?Vq.matchBase(e,t,n,i):t.exec(c)),{isMatch:Boolean(a),match:a,output:c}},Vq.matchBase=(e,t,n,r=Wq.isWindows(n))=>(t instanceof RegExp?t:Vq.makeRe(t,n)).test(Hq.basename(e)),Vq.isMatch=(e,t,n)=>Vq(t,n)(e),Vq.parse=(e,t)=>Array.isArray(e)?e.map((e=>Vq.parse(e,t))):zq(e,{...t,fastpaths:!1}),Vq.scan=(e,t)=>$q(e,t),Vq.compileRe=(e,t,n=!1,r=!1)=>{if(!0===n)return e.output;const i=t||{},s=i.contains?"":"^",o=i.contains?"":"$";let a=`${s}(?:${e.output})${o}`;e&&!0===e.negated&&(a=`^(?!${a}).*$`);const c=Vq.toRegex(a,t);return!0===r&&(c.state=e),c},Vq.makeRe=(e,t={},n=!1,r=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return!1===t.fastpaths||"."!==e[0]&&"*"!==e[0]||(i.output=zq.fastpaths(e,t)),i.output||(i=zq(e,t)),Vq.compileRe(i,t,n,r)},Vq.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},Vq.constants=Gq;var Kq=Vq;const Yq=s,{Readable:Zq}=h,Qq=o,{promisify:Jq}=y,Xq=Kq,eH=Jq(Yq.readdir),tH=Jq(Yq.stat),nH=Jq(Yq.lstat),rH=Jq(Yq.realpath),iH="READDIRP_RECURSIVE_ERROR",sH=new Set(["ENOENT","EPERM","EACCES","ELOOP",iH]),oH="files",aH="directories",cH="files_directories",lH="all",uH=[oH,aH,cH,lH],[pH,hH]=process.versions.node.split(".").slice(0,2).map((e=>Number.parseInt(e,10))),dH="win32"===process.platform&&(pH>10||10===pH&&hH>=5),fH=e=>{if(void 0!==e){if("function"==typeof e)return e;if("string"==typeof e){const t=Xq(e.trim());return e=>t(e.basename)}if(Array.isArray(e)){const t=[],n=[];for(const r of e){const e=r.trim();"!"===e.charAt(0)?n.push(Xq(e.slice(1))):t.push(Xq(e))}return n.length>0?t.length>0?e=>t.some((t=>t(e.basename)))&&!n.some((t=>t(e.basename))):e=>!n.some((t=>t(e.basename))):e=>t.some((t=>t(e.basename)))}}};class mH extends Zq{static get defaultOptions(){return{root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:oH,lstat:!1,depth:2147483648,alwaysStat:!1}}constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark||4096});const t={...mH.defaultOptions,...e},{root:n,type:r}=t;this._fileFilter=fH(t.fileFilter),this._directoryFilter=fH(t.directoryFilter);const i=t.lstat?nH:tH;this._stat=dH?e=>i(e,{bigint:!0}):i,this._maxDepth=t.depth,this._wantsDir=[aH,cH,lH].includes(r),this._wantsFile=[oH,cH,lH].includes(r),this._wantsEverything=r===lH,this._root=Qq.resolve(n),this._isDirent="Dirent"in Yq&&!t.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){const{path:t,depth:n,files:r=[]}=this.parent||{};if(r.length>0){const i=r.splice(0,e).map((e=>this._formatEntry(e,t)));for(const t of await Promise.all(i)){if(this.destroyed)return;const r=await this._getEntryType(t);"directory"===r&&this._directoryFilter(t)?(n<=this._maxDepth&&this.parents.push(this._exploreDir(t.fullPath,n+1)),this._wantsDir&&(this.push(t),e--)):("file"===r||this._includeAsFile(t))&&this._fileFilter(t)&&this._wantsFile&&(this.push(t),e--)}}else{const e=this.parents.pop();if(!e){this.push(null);break}if(this.parent=await e,this.destroyed)return}}}catch(e){this.destroy(e)}finally{this.reading=!1}}}async _exploreDir(e,t){let n;try{n=await eH(e,this._rdOptions)}catch(e){this._onError(e)}return{files:n,depth:t,path:e}}async _formatEntry(e,t){let n;try{const r=this._isDirent?e.name:e,i=Qq.resolve(Qq.join(t,r));n={path:Qq.relative(this._root,i),fullPath:i,basename:r},n[this._statsProp]=this._isDirent?e:await this._stat(i)}catch(e){this._onError(e)}return n}_onError(e){(e=>sH.has(e.code))(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){const t=e&&e[this._statsProp];if(t){if(t.isFile())return"file";if(t.isDirectory())return"directory";if(t&&t.isSymbolicLink()){const t=e.fullPath;try{const e=await rH(t),n=await nH(e);if(n.isFile())return"file";if(n.isDirectory()){const n=e.length;if(t.startsWith(e)&&t.substr(n,1)===Qq.sep){const n=new Error(`Circular symlink detected: "${t}" points to "${e}"`);return n.code=iH,this._onError(n)}return"directory"}}catch(e){this._onError(e)}}}}_includeAsFile(e){const t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}}const gH=(e,t={})=>{let n=t.entryType||t.type;if("both"===n&&(n=cH),n&&(t.type=n),!e)throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");if("string"!=typeof e)throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(n&&!uH.includes(n))throw new Error(`readdirp: Invalid type passed. Use one of ${uH.join(", ")}`);return t.root=e,new mH(t)};gH.promise=(e,t={})=>new Promise(((n,r)=>{const i=[];gH(e,t).on("data",(e=>i.push(e))).on("end",(()=>n(i))).on("error",(e=>r(e)))})),gH.ReaddirpStream=mH,gH.default=gH;var yH=gH,vH={exports:{}},bH=vH.exports;Object.defineProperty(bH,"__esModule",{value:!0});const _H=Kq,wH=Xv,xH={returnIndex:!1},EH=(e,t,n,r)=>{const i=Array.isArray(n),s=i?n[0]:n;if(!i&&"string"!=typeof s)throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(s));const o=wH(s,!1);for(let e=0;e<t.length;e++){if((0,t[e])(o))return!!r&&-1}const a=i&&[o].concat(n.slice(1));for(let t=0;t<e.length;t++){const n=e[t];if(i?n(...a):n(o))return!r||t}return!!r&&-1},SH=(e,t,n=xH)=>{if(null==e)throw new TypeError("anymatch: specify first argument");const r="boolean"==typeof n?{returnIndex:n}:n,i=r.returnIndex||!1,s=(o=e,Array.isArray(o)?o:[o]);var o;const a=s.filter((e=>"string"==typeof e&&"!"===e.charAt(0))).map((e=>e.slice(1))).map((e=>_H(e,r))),c=s.filter((e=>"string"!=typeof e||"string"==typeof e&&"!"!==e.charAt(0))).map((e=>((e,t)=>{if("function"==typeof e)return e;if("string"==typeof e){const n=_H(e,t);return t=>e===t||n(t)}return e instanceof RegExp?t=>e.test(t):e=>!1})(e,r)));return null==t?(e,t=!1)=>EH(c,a,e,"boolean"==typeof t&&t):EH(c,a,t,i)};SH.default=SH,vH.exports=SH;var TH,DH=vH.exports,kH=function(e){if("string"!=typeof e||""===e)return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1},AH={"{":"}","(":")","[":"]"},CH=function(e){if("!"===e[0])return!0;for(var t=0,n=-2,r=-2,i=-2,s=-2,o=-2;t<e.length;){if("*"===e[t])return!0;if("?"===e[t+1]&&/[\].+)]/.test(e[t]))return!0;if(-1!==r&&"["===e[t]&&"]"!==e[t+1]&&(r<t&&(r=e.indexOf("]",t)),r>t)){if(-1===o||o>r)return!0;if(-1===(o=e.indexOf("\\",t))||o>r)return!0}if(-1!==i&&"{"===e[t]&&"}"!==e[t+1]&&(i=e.indexOf("}",t))>t&&(-1===(o=e.indexOf("\\",t))||o>i))return!0;if(-1!==s&&"("===e[t]&&"?"===e[t+1]&&/[:!=]/.test(e[t+2])&&")"!==e[t+3]&&(s=e.indexOf(")",t))>t&&(-1===(o=e.indexOf("\\",t))||o>s))return!0;if(-1!==n&&"("===e[t]&&"|"!==e[t+1]&&(n<t&&(n=e.indexOf("|",t)),-1!==n&&")"!==e[n+1]&&(s=e.indexOf(")",n))>n&&(-1===(o=e.indexOf("\\",n))||o>s)))return!0;if("\\"===e[t]){var a=e[t+1];t+=2;var c=AH[a];if(c){var l=e.indexOf(c,t);-1!==l&&(t=l+1)}if("!"===e[t])return!0}else t++}return!1},RH=function(e){if("!"===e[0])return!0;for(var t=0;t<e.length;){if(/[*?{}()[\]]/.test(e[t]))return!0;if("\\"===e[t]){var n=e[t+1];t+=2;var r=AH[n];if(r){var i=e.indexOf(r,t);-1!==i&&(t=i+1)}if("!"===e[t])return!0}else t++}return!1},OH=function(e,t){if("string"!=typeof e||""===e)return!1;if(kH(e))return!0;var n=CH;return t&&!1===t.strict&&(n=RH),n(e)},LH=OH,IH=o.posix.dirname,PH="win32"===a.platform(),NH=/\\/g,jH=/[\{\[].*[\}\]]$/,FH=/(^|[^\\])([\{\[]|\([^\)]+$)/,BH=/\\([\!\*\?\|\[\]\(\)\{\}])/g,MH={};
339
+ */const sq=o,oq="\\\\/",aq=`[^${oq}]`,cq="\\.",lq="\\/",uq="[^/]",pq=`(?:${lq}|$)`,hq=`(?:^|${lq})`,dq=`${cq}{1,2}${pq}`,fq={DOT_LITERAL:cq,PLUS_LITERAL:"\\+",QMARK_LITERAL:"\\?",SLASH_LITERAL:lq,ONE_CHAR:"(?=.)",QMARK:uq,END_ANCHOR:pq,DOTS_SLASH:dq,NO_DOT:`(?!${cq})`,NO_DOTS:`(?!${hq}${dq})`,NO_DOT_SLASH:`(?!${cq}{0,1}${pq})`,NO_DOTS_SLASH:`(?!${dq})`,QMARK_NO_DOT:`[^.${lq}]`,STAR:`${uq}*?`,START_ANCHOR:hq},mq={...fq,SLASH_LITERAL:`[${oq}]`,QMARK:aq,STAR:`${aq}*?`,DOTS_SLASH:`${cq}{1,2}(?:[${oq}]|$)`,NO_DOT:`(?!${cq})`,NO_DOTS:`(?!(?:^|[${oq}])${cq}{1,2}(?:[${oq}]|$))`,NO_DOT_SLASH:`(?!${cq}{0,1}(?:[${oq}]|$))`,NO_DOTS_SLASH:`(?!${cq}{1,2}(?:[${oq}]|$))`,QMARK_NO_DOT:`[^.${oq}]`,START_ANCHOR:`(?:^|[${oq}])`,END_ANCHOR:`(?:[${oq}]|$)`};var gq={MAX_LENGTH:65536,POSIX_REGEX_SOURCE:{alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"},REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:sq.sep,extglobChars:e=>({"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}),globChars:e=>!0===e?mq:fq};!function(e){const t=o,n="win32"===process.platform,{REGEX_BACKSLASH:r,REGEX_REMOVE_BACKSLASH:i,REGEX_SPECIAL_CHARS:s,REGEX_SPECIAL_CHARS_GLOBAL:a}=gq;e.isObject=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),e.hasRegexChars=e=>s.test(e),e.isRegexChar=t=>1===t.length&&e.hasRegexChars(t),e.escapeRegex=e=>e.replace(a,"\\$1"),e.toPosixSlashes=e=>e.replace(r,"/"),e.removeBackslashes=e=>e.replace(i,(e=>"\\"===e?"":e)),e.supportsLookbehinds=()=>{const e=process.version.slice(1).split(".").map(Number);return 3===e.length&&e[0]>=9||8===e[0]&&e[1]>=10},e.isWindows=e=>e&&"boolean"==typeof e.windows?e.windows:!0===n||"\\"===t.sep,e.escapeLast=(t,n,r)=>{const i=t.lastIndexOf(n,r);return-1===i?t:"\\"===t[i-1]?e.escapeLast(t,n,i-1):`${t.slice(0,i)}\\${t.slice(i)}`},e.removePrefix=(e,t={})=>{let n=e;return n.startsWith("./")&&(n=n.slice(2),t.prefix="./"),n},e.wrapOutput=(e,t={},n={})=>{let r=`${n.contains?"":"^"}(?:${e})${n.contains?"":"$"}`;return!0===t.negated&&(r=`(?:^(?!${r}).*$)`),r}}(iq);const yq=iq,{CHAR_ASTERISK:vq,CHAR_AT:bq,CHAR_BACKWARD_SLASH:_q,CHAR_COMMA:wq,CHAR_DOT:xq,CHAR_EXCLAMATION_MARK:Eq,CHAR_FORWARD_SLASH:Sq,CHAR_LEFT_CURLY_BRACE:Tq,CHAR_LEFT_PARENTHESES:Dq,CHAR_LEFT_SQUARE_BRACKET:kq,CHAR_PLUS:Aq,CHAR_QUESTION_MARK:Cq,CHAR_RIGHT_CURLY_BRACE:Rq,CHAR_RIGHT_PARENTHESES:Oq,CHAR_RIGHT_SQUARE_BRACKET:Lq}=gq,Iq=e=>e===Sq||e===_q,Pq=e=>{!0!==e.isPrefix&&(e.depth=e.isGlobstar?1/0:1)};var Nq=(e,t)=>{const n=t||{},r=e.length-1,i=!0===n.parts||!0===n.scanToEnd,s=[],o=[],a=[];let c,l,u=e,p=-1,h=0,d=0,f=!1,m=!1,g=!1,y=!1,v=!1,b=!1,_=!1,w=!1,x=!1,E=!1,S=0,T={value:"",depth:0,isGlob:!1};const D=()=>p>=r,k=()=>(c=l,u.charCodeAt(++p));for(;p<r;){let e;if(l=k(),l!==_q){if(!0===b||l===Tq){for(S++;!0!==D()&&(l=k());)if(l!==_q)if(l!==Tq){if(!0!==b&&l===xq&&(l=k())===xq){if(f=T.isBrace=!0,g=T.isGlob=!0,E=!0,!0===i)continue;break}if(!0!==b&&l===wq){if(f=T.isBrace=!0,g=T.isGlob=!0,E=!0,!0===i)continue;break}if(l===Rq&&(S--,0===S)){b=!1,f=T.isBrace=!0,E=!0;break}}else S++;else _=T.backslashes=!0,k();if(!0===i)continue;break}if(l!==Sq){if(!0!==n.noext){if(!0===(l===Aq||l===bq||l===vq||l===Cq||l===Eq)&&u.charCodeAt(p+1)===Dq){if(g=T.isGlob=!0,y=T.isExtglob=!0,E=!0,l===Eq&&p===h&&(x=!0),!0===i){for(;!0!==D()&&(l=k());)if(l!==_q){if(l===Oq){g=T.isGlob=!0,E=!0;break}}else _=T.backslashes=!0,l=k();continue}break}}if(l===vq){if(c===vq&&(v=T.isGlobstar=!0),g=T.isGlob=!0,E=!0,!0===i)continue;break}if(l===Cq){if(g=T.isGlob=!0,E=!0,!0===i)continue;break}if(l===kq){for(;!0!==D()&&(e=k());)if(e!==_q){if(e===Lq){m=T.isBracket=!0,g=T.isGlob=!0,E=!0;break}}else _=T.backslashes=!0,k();if(!0===i)continue;break}if(!0===n.nonegate||l!==Eq||p!==h){if(!0!==n.noparen&&l===Dq){if(g=T.isGlob=!0,!0===i){for(;!0!==D()&&(l=k());)if(l!==Dq){if(l===Oq){E=!0;break}}else _=T.backslashes=!0,l=k();continue}break}if(!0===g){if(E=!0,!0===i)continue;break}}else w=T.negated=!0,h++}else{if(s.push(p),o.push(T),T={value:"",depth:0,isGlob:!1},!0===E)continue;if(c===xq&&p===h+1){h+=2;continue}d=p+1}}else _=T.backslashes=!0,l=k(),l===Tq&&(b=!0)}!0===n.noext&&(y=!1,g=!1);let A=u,C="",R="";h>0&&(C=u.slice(0,h),u=u.slice(h),d-=h),A&&!0===g&&d>0?(A=u.slice(0,d),R=u.slice(d)):!0===g?(A="",R=u):A=u,A&&""!==A&&"/"!==A&&A!==u&&Iq(A.charCodeAt(A.length-1))&&(A=A.slice(0,-1)),!0===n.unescape&&(R&&(R=yq.removeBackslashes(R)),A&&!0===_&&(A=yq.removeBackslashes(A)));const O={prefix:C,input:e,start:h,base:A,glob:R,isBrace:f,isBracket:m,isGlob:g,isExtglob:y,isGlobstar:v,negated:w,negatedExtglob:x};if(!0===n.tokens&&(O.maxDepth=0,Iq(l)||o.push(T),O.tokens=o),!0===n.parts||!0===n.tokens){let t;for(let r=0;r<s.length;r++){const i=t?t+1:h,c=s[r],l=e.slice(i,c);n.tokens&&(0===r&&0!==h?(o[r].isPrefix=!0,o[r].value=C):o[r].value=l,Pq(o[r]),O.maxDepth+=o[r].depth),0===r&&""===l||a.push(l),t=c}if(t&&t+1<e.length){const r=e.slice(t+1);a.push(r),n.tokens&&(o[o.length-1].value=r,Pq(o[o.length-1]),O.maxDepth+=o[o.length-1].depth)}O.slashes=s,O.parts=a}return O};const jq=gq,Fq=iq,{MAX_LENGTH:Bq,POSIX_REGEX_SOURCE:Mq,REGEX_NON_SPECIAL_CHARS:Uq,REGEX_SPECIAL_CHARS_BACKREF:qq,REPLACEMENTS:Hq}=jq,$q=(e,t)=>{if("function"==typeof t.expandRange)return t.expandRange(...e,t);e.sort();const n=`[${e.join("-")}]`;try{new RegExp(n)}catch(t){return e.map((e=>Fq.escapeRegex(e))).join("..")}return n},zq=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,Wq=(e,t)=>{if("string"!=typeof e)throw new TypeError("Expected a string");e=Hq[e]||e;const n={...t},r="number"==typeof n.maxLength?Math.min(Bq,n.maxLength):Bq;let i=e.length;if(i>r)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${r}`);const s={type:"bos",value:"",output:n.prepend||""},o=[s],a=n.capture?"":"?:",c=Fq.isWindows(t),l=jq.globChars(c),u=jq.extglobChars(l),{DOT_LITERAL:p,PLUS_LITERAL:h,SLASH_LITERAL:d,ONE_CHAR:f,DOTS_SLASH:m,NO_DOT:g,NO_DOT_SLASH:y,NO_DOTS_SLASH:v,QMARK:b,QMARK_NO_DOT:_,STAR:w,START_ANCHOR:x}=l,E=e=>`(${a}(?:(?!${x}${e.dot?m:p}).)*?)`,S=n.dot?"":g,T=n.dot?b:_;let D=!0===n.bash?E(n):w;n.capture&&(D=`(${D})`),"boolean"==typeof n.noext&&(n.noextglob=n.noext);const k={input:e,index:-1,start:0,dot:!0===n.dot,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};e=Fq.removePrefix(e,k),i=e.length;const A=[],C=[],R=[];let O,L=s;const I=()=>k.index===i-1,P=k.peek=(t=1)=>e[k.index+t],N=k.advance=()=>e[++k.index]||"",j=()=>e.slice(k.index+1),F=(e="",t=0)=>{k.consumed+=e,k.index+=t},B=e=>{k.output+=null!=e.output?e.output:e.value,F(e.value)},M=()=>{let e=1;for(;"!"===P()&&("("!==P(2)||"?"===P(3));)N(),k.start++,e++;return e%2!=0&&(k.negated=!0,k.start++,!0)},U=e=>{k[e]++,R.push(e)},q=e=>{k[e]--,R.pop()},H=e=>{if("globstar"===L.type){const t=k.braces>0&&("comma"===e.type||"brace"===e.type),n=!0===e.extglob||A.length&&("pipe"===e.type||"paren"===e.type);"slash"===e.type||"paren"===e.type||t||n||(k.output=k.output.slice(0,-L.output.length),L.type="star",L.value="*",L.output=D,k.output+=L.output)}if(A.length&&"paren"!==e.type&&(A[A.length-1].inner+=e.value),(e.value||e.output)&&B(e),L&&"text"===L.type&&"text"===e.type)return L.value+=e.value,void(L.output=(L.output||"")+e.value);e.prev=L,o.push(e),L=e},$=(e,t)=>{const r={...u[t],conditions:1,inner:""};r.prev=L,r.parens=k.parens,r.output=k.output;const i=(n.capture?"(":"")+r.open;U("parens"),H({type:e,value:t,output:k.output?"":f}),H({type:"paren",extglob:!0,value:N(),output:i}),A.push(r)},z=e=>{let r,i=e.close+(n.capture?")":"");if("negate"===e.type){let s=D;if(e.inner&&e.inner.length>1&&e.inner.includes("/")&&(s=E(n)),(s!==D||I()||/^\)+$/.test(j()))&&(i=e.close=`)$))${s}`),e.inner.includes("*")&&(r=j())&&/^\.[^\\/.]+$/.test(r)){const n=Wq(r,{...t,fastpaths:!1}).output;i=e.close=`)${n})${s})`}"bos"===e.prev.type&&(k.negatedExtglob=!0)}H({type:"paren",extglob:!0,value:O,output:i}),q("parens")};if(!1!==n.fastpaths&&!/(^[*!]|[/()[\]{}"])/.test(e)){let r=!1,i=e.replace(qq,((e,t,n,i,s,o)=>"\\"===i?(r=!0,e):"?"===i?t?t+i+(s?b.repeat(s.length):""):0===o?T+(s?b.repeat(s.length):""):b.repeat(n.length):"."===i?p.repeat(n.length):"*"===i?t?t+i+(s?D:""):D:t?e:`\\${e}`));return!0===r&&(i=!0===n.unescape?i.replace(/\\/g,""):i.replace(/\\+/g,(e=>e.length%2==0?"\\\\":e?"\\":""))),i===e&&!0===n.contains?(k.output=e,k):(k.output=Fq.wrapOutput(i,k,t),k)}for(;!I();){if(O=N(),"\0"===O)continue;if("\\"===O){const e=P();if("/"===e&&!0!==n.bash)continue;if("."===e||";"===e)continue;if(!e){O+="\\",H({type:"text",value:O});continue}const t=/^\\+/.exec(j());let r=0;if(t&&t[0].length>2&&(r=t[0].length,k.index+=r,r%2!=0&&(O+="\\")),!0===n.unescape?O=N():O+=N(),0===k.brackets){H({type:"text",value:O});continue}}if(k.brackets>0&&("]"!==O||"["===L.value||"[^"===L.value)){if(!1!==n.posix&&":"===O){const e=L.value.slice(1);if(e.includes("[")&&(L.posix=!0,e.includes(":"))){const e=L.value.lastIndexOf("["),t=L.value.slice(0,e),n=L.value.slice(e+2),r=Mq[n];if(r){L.value=t+r,k.backtrack=!0,N(),s.output||1!==o.indexOf(L)||(s.output=f);continue}}}("["===O&&":"!==P()||"-"===O&&"]"===P())&&(O=`\\${O}`),"]"!==O||"["!==L.value&&"[^"!==L.value||(O=`\\${O}`),!0===n.posix&&"!"===O&&"["===L.value&&(O="^"),L.value+=O,B({value:O});continue}if(1===k.quotes&&'"'!==O){O=Fq.escapeRegex(O),L.value+=O,B({value:O});continue}if('"'===O){k.quotes=1===k.quotes?0:1,!0===n.keepQuotes&&H({type:"text",value:O});continue}if("("===O){U("parens"),H({type:"paren",value:O});continue}if(")"===O){if(0===k.parens&&!0===n.strictBrackets)throw new SyntaxError(zq("opening","("));const e=A[A.length-1];if(e&&k.parens===e.parens+1){z(A.pop());continue}H({type:"paren",value:O,output:k.parens?")":"\\)"}),q("parens");continue}if("["===O){if(!0!==n.nobracket&&j().includes("]"))U("brackets");else{if(!0!==n.nobracket&&!0===n.strictBrackets)throw new SyntaxError(zq("closing","]"));O=`\\${O}`}H({type:"bracket",value:O});continue}if("]"===O){if(!0===n.nobracket||L&&"bracket"===L.type&&1===L.value.length){H({type:"text",value:O,output:`\\${O}`});continue}if(0===k.brackets){if(!0===n.strictBrackets)throw new SyntaxError(zq("opening","["));H({type:"text",value:O,output:`\\${O}`});continue}q("brackets");const e=L.value.slice(1);if(!0===L.posix||"^"!==e[0]||e.includes("/")||(O=`/${O}`),L.value+=O,B({value:O}),!1===n.literalBrackets||Fq.hasRegexChars(e))continue;const t=Fq.escapeRegex(L.value);if(k.output=k.output.slice(0,-L.value.length),!0===n.literalBrackets){k.output+=t,L.value=t;continue}L.value=`(${a}${t}|${L.value})`,k.output+=L.value;continue}if("{"===O&&!0!==n.nobrace){U("braces");const e={type:"brace",value:O,output:"(",outputIndex:k.output.length,tokensIndex:k.tokens.length};C.push(e),H(e);continue}if("}"===O){const e=C[C.length-1];if(!0===n.nobrace||!e){H({type:"text",value:O,output:O});continue}let t=")";if(!0===e.dots){const e=o.slice(),r=[];for(let t=e.length-1;t>=0&&(o.pop(),"brace"!==e[t].type);t--)"dots"!==e[t].type&&r.unshift(e[t].value);t=$q(r,n),k.backtrack=!0}if(!0!==e.comma&&!0!==e.dots){const n=k.output.slice(0,e.outputIndex),r=k.tokens.slice(e.tokensIndex);e.value=e.output="\\{",O=t="\\}",k.output=n;for(const e of r)k.output+=e.output||e.value}H({type:"brace",value:O,output:t}),q("braces"),C.pop();continue}if("|"===O){A.length>0&&A[A.length-1].conditions++,H({type:"text",value:O});continue}if(","===O){let e=O;const t=C[C.length-1];t&&"braces"===R[R.length-1]&&(t.comma=!0,e="|"),H({type:"comma",value:O,output:e});continue}if("/"===O){if("dot"===L.type&&k.index===k.start+1){k.start=k.index+1,k.consumed="",k.output="",o.pop(),L=s;continue}H({type:"slash",value:O,output:d});continue}if("."===O){if(k.braces>0&&"dot"===L.type){"."===L.value&&(L.output=p);const e=C[C.length-1];L.type="dots",L.output+=O,L.value+=O,e.dots=!0;continue}if(k.braces+k.parens===0&&"bos"!==L.type&&"slash"!==L.type){H({type:"text",value:O,output:p});continue}H({type:"dot",value:O,output:p});continue}if("?"===O){if(!(L&&"("===L.value)&&!0!==n.noextglob&&"("===P()&&"?"!==P(2)){$("qmark",O);continue}if(L&&"paren"===L.type){const e=P();let t=O;if("<"===e&&!Fq.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");("("===L.value&&!/[!=<:]/.test(e)||"<"===e&&!/<([!=]|\w+>)/.test(j()))&&(t=`\\${O}`),H({type:"text",value:O,output:t});continue}if(!0!==n.dot&&("slash"===L.type||"bos"===L.type)){H({type:"qmark",value:O,output:_});continue}H({type:"qmark",value:O,output:b});continue}if("!"===O){if(!0!==n.noextglob&&"("===P()&&("?"!==P(2)||!/[!=<:]/.test(P(3)))){$("negate",O);continue}if(!0!==n.nonegate&&0===k.index){M();continue}}if("+"===O){if(!0!==n.noextglob&&"("===P()&&"?"!==P(2)){$("plus",O);continue}if(L&&"("===L.value||!1===n.regex){H({type:"plus",value:O,output:h});continue}if(L&&("bracket"===L.type||"paren"===L.type||"brace"===L.type)||k.parens>0){H({type:"plus",value:O});continue}H({type:"plus",value:h});continue}if("@"===O){if(!0!==n.noextglob&&"("===P()&&"?"!==P(2)){H({type:"at",extglob:!0,value:O,output:""});continue}H({type:"text",value:O});continue}if("*"!==O){"$"!==O&&"^"!==O||(O=`\\${O}`);const e=Uq.exec(j());e&&(O+=e[0],k.index+=e[0].length),H({type:"text",value:O});continue}if(L&&("globstar"===L.type||!0===L.star)){L.type="star",L.star=!0,L.value+=O,L.output=D,k.backtrack=!0,k.globstar=!0,F(O);continue}let t=j();if(!0!==n.noextglob&&/^\([^?]/.test(t)){$("star",O);continue}if("star"===L.type){if(!0===n.noglobstar){F(O);continue}const r=L.prev,i=r.prev,s="slash"===r.type||"bos"===r.type,o=i&&("star"===i.type||"globstar"===i.type);if(!0===n.bash&&(!s||t[0]&&"/"!==t[0])){H({type:"star",value:O,output:""});continue}const a=k.braces>0&&("comma"===r.type||"brace"===r.type),c=A.length&&("pipe"===r.type||"paren"===r.type);if(!s&&"paren"!==r.type&&!a&&!c){H({type:"star",value:O,output:""});continue}for(;"/**"===t.slice(0,3);){const n=e[k.index+4];if(n&&"/"!==n)break;t=t.slice(3),F("/**",3)}if("bos"===r.type&&I()){L.type="globstar",L.value+=O,L.output=E(n),k.output=L.output,k.globstar=!0,F(O);continue}if("slash"===r.type&&"bos"!==r.prev.type&&!o&&I()){k.output=k.output.slice(0,-(r.output+L.output).length),r.output=`(?:${r.output}`,L.type="globstar",L.output=E(n)+(n.strictSlashes?")":"|$)"),L.value+=O,k.globstar=!0,k.output+=r.output+L.output,F(O);continue}if("slash"===r.type&&"bos"!==r.prev.type&&"/"===t[0]){const e=void 0!==t[1]?"|$":"";k.output=k.output.slice(0,-(r.output+L.output).length),r.output=`(?:${r.output}`,L.type="globstar",L.output=`${E(n)}${d}|${d}${e})`,L.value+=O,k.output+=r.output+L.output,k.globstar=!0,F(O+N()),H({type:"slash",value:"/",output:""});continue}if("bos"===r.type&&"/"===t[0]){L.type="globstar",L.value+=O,L.output=`(?:^|${d}|${E(n)}${d})`,k.output=L.output,k.globstar=!0,F(O+N()),H({type:"slash",value:"/",output:""});continue}k.output=k.output.slice(0,-L.output.length),L.type="globstar",L.output=E(n),L.value+=O,k.output+=L.output,k.globstar=!0,F(O);continue}const r={type:"star",value:O,output:D};!0!==n.bash?!L||"bracket"!==L.type&&"paren"!==L.type||!0!==n.regex?(k.index!==k.start&&"slash"!==L.type&&"dot"!==L.type||("dot"===L.type?(k.output+=y,L.output+=y):!0===n.dot?(k.output+=v,L.output+=v):(k.output+=S,L.output+=S),"*"!==P()&&(k.output+=f,L.output+=f)),H(r)):(r.output=O,H(r)):(r.output=".*?","bos"!==L.type&&"slash"!==L.type||(r.output=S+r.output),H(r))}for(;k.brackets>0;){if(!0===n.strictBrackets)throw new SyntaxError(zq("closing","]"));k.output=Fq.escapeLast(k.output,"["),q("brackets")}for(;k.parens>0;){if(!0===n.strictBrackets)throw new SyntaxError(zq("closing",")"));k.output=Fq.escapeLast(k.output,"("),q("parens")}for(;k.braces>0;){if(!0===n.strictBrackets)throw new SyntaxError(zq("closing","}"));k.output=Fq.escapeLast(k.output,"{"),q("braces")}if(!0===n.strictSlashes||"star"!==L.type&&"bracket"!==L.type||H({type:"maybe_slash",value:"",output:`${d}?`}),!0===k.backtrack){k.output="";for(const e of k.tokens)k.output+=null!=e.output?e.output:e.value,e.suffix&&(k.output+=e.suffix)}return k};Wq.fastpaths=(e,t)=>{const n={...t},r="number"==typeof n.maxLength?Math.min(Bq,n.maxLength):Bq,i=e.length;if(i>r)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${r}`);e=Hq[e]||e;const s=Fq.isWindows(t),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:l,NO_DOT:u,NO_DOTS:p,NO_DOTS_SLASH:h,STAR:d,START_ANCHOR:f}=jq.globChars(s),m=n.dot?p:u,g=n.dot?h:u,y=n.capture?"":"?:";let v=!0===n.bash?".*?":d;n.capture&&(v=`(${v})`);const b=e=>!0===e.noglobstar?v:`(${y}(?:(?!${f}${e.dot?l:o}).)*?)`,_=e=>{switch(e){case"*":return`${m}${c}${v}`;case".*":return`${o}${c}${v}`;case"*.*":return`${m}${v}${o}${c}${v}`;case"*/*":return`${m}${v}${a}${c}${g}${v}`;case"**":return m+b(n);case"**/*":return`(?:${m}${b(n)}${a})?${g}${c}${v}`;case"**/*.*":return`(?:${m}${b(n)}${a})?${g}${v}${o}${c}${v}`;case"**/.*":return`(?:${m}${b(n)}${a})?${o}${c}${v}`;default:{const t=/^(.*?)\.(\w+)$/.exec(e);if(!t)return;const n=_(t[1]);if(!n)return;return n+o+t[2]}}},w=Fq.removePrefix(e,{negated:!1,prefix:""});let x=_(w);return x&&!0!==n.strictSlashes&&(x+=`${a}?`),x};const Gq=o,Vq=Nq,Kq=Wq,Yq=iq,Zq=gq,Qq=(e,t,n=!1)=>{if(Array.isArray(e)){const r=e.map((e=>Qq(e,t,n))),i=e=>{for(const t of r){const n=t(e);if(n)return n}return!1};return i}const r=(i=e)&&"object"==typeof i&&!Array.isArray(i)&&e.tokens&&e.input;var i;if(""===e||"string"!=typeof e&&!r)throw new TypeError("Expected pattern to be a non-empty string");const s=t||{},o=Yq.isWindows(t),a=r?Qq.compileRe(e,t):Qq.makeRe(e,t,!1,!0),c=a.state;delete a.state;let l=()=>!1;if(s.ignore){const e={...t,ignore:null,onMatch:null,onResult:null};l=Qq(s.ignore,e,n)}const u=(n,r=!1)=>{const{isMatch:i,match:u,output:p}=Qq.test(n,a,t,{glob:e,posix:o}),h={glob:e,state:c,regex:a,posix:o,input:n,output:p,match:u,isMatch:i};return"function"==typeof s.onResult&&s.onResult(h),!1===i?(h.isMatch=!1,!!r&&h):l(n)?("function"==typeof s.onIgnore&&s.onIgnore(h),h.isMatch=!1,!!r&&h):("function"==typeof s.onMatch&&s.onMatch(h),!r||h)};return n&&(u.state=c),u};Qq.test=(e,t,n,{glob:r,posix:i}={})=>{if("string"!=typeof e)throw new TypeError("Expected input to be a string");if(""===e)return{isMatch:!1,output:""};const s=n||{},o=s.format||(i?Yq.toPosixSlashes:null);let a=e===r,c=a&&o?o(e):e;return!1===a&&(c=o?o(e):e,a=c===r),!1!==a&&!0!==s.capture||(a=!0===s.matchBase||!0===s.basename?Qq.matchBase(e,t,n,i):t.exec(c)),{isMatch:Boolean(a),match:a,output:c}},Qq.matchBase=(e,t,n,r=Yq.isWindows(n))=>(t instanceof RegExp?t:Qq.makeRe(t,n)).test(Gq.basename(e)),Qq.isMatch=(e,t,n)=>Qq(t,n)(e),Qq.parse=(e,t)=>Array.isArray(e)?e.map((e=>Qq.parse(e,t))):Kq(e,{...t,fastpaths:!1}),Qq.scan=(e,t)=>Vq(e,t),Qq.compileRe=(e,t,n=!1,r=!1)=>{if(!0===n)return e.output;const i=t||{},s=i.contains?"":"^",o=i.contains?"":"$";let a=`${s}(?:${e.output})${o}`;e&&!0===e.negated&&(a=`^(?!${a}).*$`);const c=Qq.toRegex(a,t);return!0===r&&(c.state=e),c},Qq.makeRe=(e,t={},n=!1,r=!1)=>{if(!e||"string"!=typeof e)throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return!1===t.fastpaths||"."!==e[0]&&"*"!==e[0]||(i.output=Kq.fastpaths(e,t)),i.output||(i=Kq(e,t)),Qq.compileRe(i,t,n,r)},Qq.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(e){if(t&&!0===t.debug)throw e;return/$^/}},Qq.constants=Zq;var Jq=Qq;const Xq=s,{Readable:eH}=h,tH=o,{promisify:nH}=y,rH=Jq,iH=nH(Xq.readdir),sH=nH(Xq.stat),oH=nH(Xq.lstat),aH=nH(Xq.realpath),cH="READDIRP_RECURSIVE_ERROR",lH=new Set(["ENOENT","EPERM","EACCES","ELOOP",cH]),uH="files",pH="directories",hH="files_directories",dH="all",fH=[uH,pH,hH,dH],[mH,gH]=process.versions.node.split(".").slice(0,2).map((e=>Number.parseInt(e,10))),yH="win32"===process.platform&&(mH>10||10===mH&&gH>=5),vH=e=>{if(void 0!==e){if("function"==typeof e)return e;if("string"==typeof e){const t=rH(e.trim());return e=>t(e.basename)}if(Array.isArray(e)){const t=[],n=[];for(const r of e){const e=r.trim();"!"===e.charAt(0)?n.push(rH(e.slice(1))):t.push(rH(e))}return n.length>0?t.length>0?e=>t.some((t=>t(e.basename)))&&!n.some((t=>t(e.basename))):e=>!n.some((t=>t(e.basename))):e=>t.some((t=>t(e.basename)))}}};class bH extends eH{static get defaultOptions(){return{root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:uH,lstat:!1,depth:2147483648,alwaysStat:!1}}constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark||4096});const t={...bH.defaultOptions,...e},{root:n,type:r}=t;this._fileFilter=vH(t.fileFilter),this._directoryFilter=vH(t.directoryFilter);const i=t.lstat?oH:sH;this._stat=yH?e=>i(e,{bigint:!0}):i,this._maxDepth=t.depth,this._wantsDir=[pH,hH,dH].includes(r),this._wantsFile=[uH,hH,dH].includes(r),this._wantsEverything=r===dH,this._root=tH.resolve(n),this._isDirent="Dirent"in Xq&&!t.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){const{path:t,depth:n,files:r=[]}=this.parent||{};if(r.length>0){const i=r.splice(0,e).map((e=>this._formatEntry(e,t)));for(const t of await Promise.all(i)){if(this.destroyed)return;const r=await this._getEntryType(t);"directory"===r&&this._directoryFilter(t)?(n<=this._maxDepth&&this.parents.push(this._exploreDir(t.fullPath,n+1)),this._wantsDir&&(this.push(t),e--)):("file"===r||this._includeAsFile(t))&&this._fileFilter(t)&&this._wantsFile&&(this.push(t),e--)}}else{const e=this.parents.pop();if(!e){this.push(null);break}if(this.parent=await e,this.destroyed)return}}}catch(e){this.destroy(e)}finally{this.reading=!1}}}async _exploreDir(e,t){let n;try{n=await iH(e,this._rdOptions)}catch(e){this._onError(e)}return{files:n,depth:t,path:e}}async _formatEntry(e,t){let n;try{const r=this._isDirent?e.name:e,i=tH.resolve(tH.join(t,r));n={path:tH.relative(this._root,i),fullPath:i,basename:r},n[this._statsProp]=this._isDirent?e:await this._stat(i)}catch(e){this._onError(e)}return n}_onError(e){(e=>lH.has(e.code))(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){const t=e&&e[this._statsProp];if(t){if(t.isFile())return"file";if(t.isDirectory())return"directory";if(t&&t.isSymbolicLink()){const t=e.fullPath;try{const e=await aH(t),n=await oH(e);if(n.isFile())return"file";if(n.isDirectory()){const n=e.length;if(t.startsWith(e)&&t.substr(n,1)===tH.sep){const n=new Error(`Circular symlink detected: "${t}" points to "${e}"`);return n.code=cH,this._onError(n)}return"directory"}}catch(e){this._onError(e)}}}}_includeAsFile(e){const t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}}const _H=(e,t={})=>{let n=t.entryType||t.type;if("both"===n&&(n=hH),n&&(t.type=n),!e)throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");if("string"!=typeof e)throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(n&&!fH.includes(n))throw new Error(`readdirp: Invalid type passed. Use one of ${fH.join(", ")}`);return t.root=e,new bH(t)};_H.promise=(e,t={})=>new Promise(((n,r)=>{const i=[];_H(e,t).on("data",(e=>i.push(e))).on("end",(()=>n(i))).on("error",(e=>r(e)))})),_H.ReaddirpStream=bH,_H.default=_H;var wH=_H,xH={exports:{}},EH=xH.exports;Object.defineProperty(EH,"__esModule",{value:!0});const SH=Jq,TH=Xv,DH={returnIndex:!1},kH=(e,t,n,r)=>{const i=Array.isArray(n),s=i?n[0]:n;if(!i&&"string"!=typeof s)throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(s));const o=TH(s,!1);for(let e=0;e<t.length;e++){if((0,t[e])(o))return!!r&&-1}const a=i&&[o].concat(n.slice(1));for(let t=0;t<e.length;t++){const n=e[t];if(i?n(...a):n(o))return!r||t}return!!r&&-1},AH=(e,t,n=DH)=>{if(null==e)throw new TypeError("anymatch: specify first argument");const r="boolean"==typeof n?{returnIndex:n}:n,i=r.returnIndex||!1,s=(o=e,Array.isArray(o)?o:[o]);var o;const a=s.filter((e=>"string"==typeof e&&"!"===e.charAt(0))).map((e=>e.slice(1))).map((e=>SH(e,r))),c=s.filter((e=>"string"!=typeof e||"string"==typeof e&&"!"!==e.charAt(0))).map((e=>((e,t)=>{if("function"==typeof e)return e;if("string"==typeof e){const n=SH(e,t);return t=>e===t||n(t)}return e instanceof RegExp?t=>e.test(t):e=>!1})(e,r)));return null==t?(e,t=!1)=>kH(c,a,e,"boolean"==typeof t&&t):kH(c,a,t,i)};AH.default=AH,xH.exports=AH;var CH,RH=xH.exports,OH=function(e){if("string"!=typeof e||""===e)return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1},LH={"{":"}","(":")","[":"]"},IH=function(e){if("!"===e[0])return!0;for(var t=0,n=-2,r=-2,i=-2,s=-2,o=-2;t<e.length;){if("*"===e[t])return!0;if("?"===e[t+1]&&/[\].+)]/.test(e[t]))return!0;if(-1!==r&&"["===e[t]&&"]"!==e[t+1]&&(r<t&&(r=e.indexOf("]",t)),r>t)){if(-1===o||o>r)return!0;if(-1===(o=e.indexOf("\\",t))||o>r)return!0}if(-1!==i&&"{"===e[t]&&"}"!==e[t+1]&&(i=e.indexOf("}",t))>t&&(-1===(o=e.indexOf("\\",t))||o>i))return!0;if(-1!==s&&"("===e[t]&&"?"===e[t+1]&&/[:!=]/.test(e[t+2])&&")"!==e[t+3]&&(s=e.indexOf(")",t))>t&&(-1===(o=e.indexOf("\\",t))||o>s))return!0;if(-1!==n&&"("===e[t]&&"|"!==e[t+1]&&(n<t&&(n=e.indexOf("|",t)),-1!==n&&")"!==e[n+1]&&(s=e.indexOf(")",n))>n&&(-1===(o=e.indexOf("\\",n))||o>s)))return!0;if("\\"===e[t]){var a=e[t+1];t+=2;var c=LH[a];if(c){var l=e.indexOf(c,t);-1!==l&&(t=l+1)}if("!"===e[t])return!0}else t++}return!1},PH=function(e){if("!"===e[0])return!0;for(var t=0;t<e.length;){if(/[*?{}()[\]]/.test(e[t]))return!0;if("\\"===e[t]){var n=e[t+1];t+=2;var r=LH[n];if(r){var i=e.indexOf(r,t);-1!==i&&(t=i+1)}if("!"===e[t])return!0}else t++}return!1},NH=function(e,t){if("string"!=typeof e||""===e)return!1;if(OH(e))return!0;var n=IH;return t&&!1===t.strict&&(n=PH),n(e)},jH=NH,FH=o.posix.dirname,BH="win32"===a.platform(),MH=/\\/g,UH=/[\{\[].*[\}\]]$/,qH=/(^|[^\\])([\{\[]|\([^\)]+$)/,HH=/\\([\!\*\?\|\[\]\(\)\{\}])/g,$H={};
340
340
  /*!
341
341
  * is-extglob <https://github.com/jonschlinkert/is-extglob>
342
342
  *
343
343
  * Copyright (c) 2014-2016, Jon Schlinkert.
344
344
  * Licensed under the MIT License.
345
- */(TH=MH).isInteger=e=>"number"==typeof e?Number.isInteger(e):"string"==typeof e&&""!==e.trim()&&Number.isInteger(Number(e)),TH.find=(e,t)=>e.nodes.find((e=>e.type===t)),TH.exceedsLimit=(e,t,n=1,r)=>!1!==r&&!(!TH.isInteger(e)||!TH.isInteger(t))&&(Number(t)-Number(e))/Number(n)>=r,TH.escapeNode=(e,t=0,n)=>{const r=e.nodes[t];r&&(n&&r.type===n||"open"===r.type||"close"===r.type)&&!0!==r.escaped&&(r.value="\\"+r.value,r.escaped=!0)},TH.encloseBrace=e=>!("brace"!==e.type||e.commas>>0+e.ranges||(e.invalid=!0,0)),TH.isInvalidBrace=e=>!("brace"!==e.type||!0!==e.invalid&&!e.dollar&&(e.commas>>0+e.ranges&&!0===e.open&&!0===e.close||(e.invalid=!0,0))),TH.isOpenOrClose=e=>"open"===e.type||"close"===e.type||!0===e.open||!0===e.close,TH.reduce=e=>e.reduce(((e,t)=>("text"===t.type&&e.push(t.value),"range"===t.type&&(t.type="text"),e)),[]),TH.flatten=(...e)=>{const t=[],n=e=>{for(let r=0;r<e.length;r++){const i=e[r];Array.isArray(i)?n(i):void 0!==i&&t.push(i)}return t};return n(e),t};const UH=MH;var qH=(e,t={})=>{const n=(e,r={})=>{const i=t.escapeInvalid&&UH.isInvalidBrace(r),s=!0===e.invalid&&!0===t.escapeInvalid;let o="";if(e.value)return(i||s)&&UH.isOpenOrClose(e)?"\\"+e.value:e.value;if(e.value)return e.value;if(e.nodes)for(const t of e.nodes)o+=n(t);return o};return n(e)};
345
+ */(CH=$H).isInteger=e=>"number"==typeof e?Number.isInteger(e):"string"==typeof e&&""!==e.trim()&&Number.isInteger(Number(e)),CH.find=(e,t)=>e.nodes.find((e=>e.type===t)),CH.exceedsLimit=(e,t,n=1,r)=>!1!==r&&!(!CH.isInteger(e)||!CH.isInteger(t))&&(Number(t)-Number(e))/Number(n)>=r,CH.escapeNode=(e,t=0,n)=>{const r=e.nodes[t];r&&(n&&r.type===n||"open"===r.type||"close"===r.type)&&!0!==r.escaped&&(r.value="\\"+r.value,r.escaped=!0)},CH.encloseBrace=e=>!("brace"!==e.type||e.commas>>0+e.ranges||(e.invalid=!0,0)),CH.isInvalidBrace=e=>!("brace"!==e.type||!0!==e.invalid&&!e.dollar&&(e.commas>>0+e.ranges&&!0===e.open&&!0===e.close||(e.invalid=!0,0))),CH.isOpenOrClose=e=>"open"===e.type||"close"===e.type||!0===e.open||!0===e.close,CH.reduce=e=>e.reduce(((e,t)=>("text"===t.type&&e.push(t.value),"range"===t.type&&(t.type="text"),e)),[]),CH.flatten=(...e)=>{const t=[],n=e=>{for(let r=0;r<e.length;r++){const i=e[r];Array.isArray(i)?n(i):void 0!==i&&t.push(i)}return t};return n(e),t};const zH=$H;var WH=(e,t={})=>{const n=(e,r={})=>{const i=t.escapeInvalid&&zH.isInvalidBrace(r),s=!0===e.invalid&&!0===t.escapeInvalid;let o="";if(e.value)return(i||s)&&zH.isOpenOrClose(e)?"\\"+e.value:e.value;if(e.value)return e.value;if(e.nodes)for(const t of e.nodes)o+=n(t);return o};return n(e)};
346
346
  /*!
347
347
  * is-number <https://github.com/jonschlinkert/is-number>
348
348
  *
@@ -355,26 +355,26 @@ parse:function(e,t){if("string"!=typeof e)throw new TypeError("argument str must
355
355
  * Copyright (c) 2015-present, Jon Schlinkert.
356
356
  * Released under the MIT License.
357
357
  */
358
- const HH=function(e){return"number"==typeof e?e-e==0:"string"==typeof e&&""!==e.trim()&&(Number.isFinite?Number.isFinite(+e):isFinite(+e))},$H=(e,t,n)=>{if(!1===HH(e))throw new TypeError("toRegexRange: expected the first argument to be a number");if(void 0===t||e===t)return String(e);if(!1===HH(t))throw new TypeError("toRegexRange: expected the second argument to be a number.");let r={relaxZeros:!0,...n};"boolean"==typeof r.strictZeros&&(r.relaxZeros=!1===r.strictZeros);let i=e+":"+t+"="+String(r.relaxZeros)+String(r.shorthand)+String(r.capture)+String(r.wrap);if($H.cache.hasOwnProperty(i))return $H.cache[i].result;let s=Math.min(e,t),o=Math.max(e,t);if(1===Math.abs(s-o)){let n=e+"|"+t;return r.capture?`(${n})`:!1===r.wrap?n:`(?:${n})`}let a=XH(e)||XH(t),c={min:e,max:t,a:s,b:o},l=[],u=[];if(a&&(c.isPadded=a,c.maxLen=String(c.max).length),s<0){u=WH(o<0?Math.abs(o):1,Math.abs(s),c,r),s=c.a=0}return o>=0&&(l=WH(s,o,c,r)),c.negatives=u,c.positives=l,c.result=function(e,t){let n=GH(e,t,"-",!1)||[],r=GH(t,e,"",!1)||[],i=GH(e,t,"-?",!0)||[];return n.concat(i).concat(r).join("|")}(u,l),!0===r.capture?c.result=`(${c.result})`:!1!==r.wrap&&l.length+u.length>1&&(c.result=`(?:${c.result})`),$H.cache[i]=c,c.result};function zH(e,t,n){if(e===t)return{pattern:e,count:[],digits:0};let r=function(e,t){let n=[];for(let r=0;r<e.length;r++)n.push([e[r],t[r]]);return n}(e,t),i=r.length,s="",o=0;for(let e=0;e<i;e++){let[t,n]=r[e];t===n?s+=t:"0"!==t||"9"!==n?s+=JH(t,n):o++}return o&&(s+=!0===n.shorthand?"\\d":"[0-9]"),{pattern:s,count:[o],digits:i}}function WH(e,t,n,r){let i,s=function(e,t){let n=1,r=1,i=YH(e,n),s=new Set([t]);for(;e<=i&&i<=t;)s.add(i),n+=1,i=YH(e,n);for(i=ZH(t+1,r)-1;e<i&&i<=t;)s.add(i),r+=1,i=ZH(t+1,r)-1;return s=[...s],s.sort(VH),s}(e,t),o=[],a=e;for(let e=0;e<s.length;e++){let t=s[e],c=zH(String(a),String(t),r),l="";n.isPadded||!i||i.pattern!==c.pattern?(n.isPadded&&(l=e$(t,n,r)),c.string=l+c.pattern+QH(c.count),o.push(c),a=t+1,i=c):(i.count.length>1&&i.count.pop(),i.count.push(c.count[0]),i.string=i.pattern+QH(i.count),a=t+1)}return o}function GH(e,t,n,r,i){let s=[];for(let i of e){let{string:e}=i;r||KH(t,"string",e)||s.push(n+e),r&&KH(t,"string",e)&&s.push(n+e)}return s}function VH(e,t){return e>t?1:t>e?-1:0}function KH(e,t,n){return e.some((e=>e[t]===n))}function YH(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function ZH(e,t){return e-e%Math.pow(10,t)}function QH(e){let[t=0,n=""]=e;return n||t>1?`{${t+(n?","+n:"")}}`:""}function JH(e,t,n){return`[${e}${t-e==1?"":"-"}${t}]`}function XH(e){return/^-?(0+)\d/.test(e)}function e$(e,t,n){if(!t.isPadded)return e;let r=Math.abs(t.maxLen-String(e).length),i=!1!==n.relaxZeros;switch(r){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:return i?`0{0,${r}}`:`0{${r}}`}}$H.cache={},$H.clearCache=()=>$H.cache={};
358
+ const GH=function(e){return"number"==typeof e?e-e==0:"string"==typeof e&&""!==e.trim()&&(Number.isFinite?Number.isFinite(+e):isFinite(+e))},VH=(e,t,n)=>{if(!1===GH(e))throw new TypeError("toRegexRange: expected the first argument to be a number");if(void 0===t||e===t)return String(e);if(!1===GH(t))throw new TypeError("toRegexRange: expected the second argument to be a number.");let r={relaxZeros:!0,...n};"boolean"==typeof r.strictZeros&&(r.relaxZeros=!1===r.strictZeros);let i=e+":"+t+"="+String(r.relaxZeros)+String(r.shorthand)+String(r.capture)+String(r.wrap);if(VH.cache.hasOwnProperty(i))return VH.cache[i].result;let s=Math.min(e,t),o=Math.max(e,t);if(1===Math.abs(s-o)){let n=e+"|"+t;return r.capture?`(${n})`:!1===r.wrap?n:`(?:${n})`}let a=r$(e)||r$(t),c={min:e,max:t,a:s,b:o},l=[],u=[];if(a&&(c.isPadded=a,c.maxLen=String(c.max).length),s<0){u=YH(o<0?Math.abs(o):1,Math.abs(s),c,r),s=c.a=0}return o>=0&&(l=YH(s,o,c,r)),c.negatives=u,c.positives=l,c.result=function(e,t){let n=ZH(e,t,"-",!1)||[],r=ZH(t,e,"",!1)||[],i=ZH(e,t,"-?",!0)||[];return n.concat(i).concat(r).join("|")}(u,l),!0===r.capture?c.result=`(${c.result})`:!1!==r.wrap&&l.length+u.length>1&&(c.result=`(?:${c.result})`),VH.cache[i]=c,c.result};function KH(e,t,n){if(e===t)return{pattern:e,count:[],digits:0};let r=function(e,t){let n=[];for(let r=0;r<e.length;r++)n.push([e[r],t[r]]);return n}(e,t),i=r.length,s="",o=0;for(let e=0;e<i;e++){let[t,n]=r[e];t===n?s+=t:"0"!==t||"9"!==n?s+=n$(t,n):o++}return o&&(s+=!0===n.shorthand?"\\d":"[0-9]"),{pattern:s,count:[o],digits:i}}function YH(e,t,n,r){let i,s=function(e,t){let n=1,r=1,i=XH(e,n),s=new Set([t]);for(;e<=i&&i<=t;)s.add(i),n+=1,i=XH(e,n);for(i=e$(t+1,r)-1;e<i&&i<=t;)s.add(i),r+=1,i=e$(t+1,r)-1;return s=[...s],s.sort(QH),s}(e,t),o=[],a=e;for(let e=0;e<s.length;e++){let t=s[e],c=KH(String(a),String(t),r),l="";n.isPadded||!i||i.pattern!==c.pattern?(n.isPadded&&(l=i$(t,n,r)),c.string=l+c.pattern+t$(c.count),o.push(c),a=t+1,i=c):(i.count.length>1&&i.count.pop(),i.count.push(c.count[0]),i.string=i.pattern+t$(i.count),a=t+1)}return o}function ZH(e,t,n,r,i){let s=[];for(let i of e){let{string:e}=i;r||JH(t,"string",e)||s.push(n+e),r&&JH(t,"string",e)&&s.push(n+e)}return s}function QH(e,t){return e>t?1:t>e?-1:0}function JH(e,t,n){return e.some((e=>e[t]===n))}function XH(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function e$(e,t){return e-e%Math.pow(10,t)}function t$(e){let[t=0,n=""]=e;return n||t>1?`{${t+(n?","+n:"")}}`:""}function n$(e,t,n){return`[${e}${t-e==1?"":"-"}${t}]`}function r$(e){return/^-?(0+)\d/.test(e)}function i$(e,t,n){if(!t.isPadded)return e;let r=Math.abs(t.maxLen-String(e).length),i=!1!==n.relaxZeros;switch(r){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:return i?`0{0,${r}}`:`0{${r}}`}}VH.cache={},VH.clearCache=()=>VH.cache={};
359
359
  /*!
360
360
  * fill-range <https://github.com/jonschlinkert/fill-range>
361
361
  *
362
362
  * Copyright (c) 2014-present, Jon Schlinkert.
363
363
  * Licensed under the MIT License.
364
364
  */
365
- const t$=y,n$=$H,r$=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),i$=e=>"number"==typeof e||"string"==typeof e&&""!==e,s$=e=>Number.isInteger(+e),o$=e=>{let t=`${e}`,n=-1;if("-"===t[0]&&(t=t.slice(1)),"0"===t)return!1;for(;"0"===t[++n];);return n>0},a$=(e,t,n)=>{if(t>0){let n="-"===e[0]?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0")}return!1===n?String(e):e},c$=(e,t)=>{let n="-"===e[0]?"-":"";for(n&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return n?"-"+e:e},l$=(e,t,n,r)=>{if(n)return n$(e,t,{wrap:!1,...r});let i=String.fromCharCode(e);return e===t?i:`[${i}-${String.fromCharCode(t)}]`},u$=(e,t,n)=>{if(Array.isArray(e)){let t=!0===n.wrap,r=n.capture?"":"?:";return t?`(${r}${e.join("|")})`:e.join("|")}return n$(e,t,n)},p$=(...e)=>new RangeError("Invalid range arguments: "+t$.inspect(...e)),h$=(e,t,n)=>{if(!0===n.strictRanges)throw p$([e,t]);return[]},d$=(e,t,n=1,r={})=>{let i=Number(e),s=Number(t);if(!Number.isInteger(i)||!Number.isInteger(s)){if(!0===r.strictRanges)throw p$([e,t]);return[]}0===i&&(i=0),0===s&&(s=0);let o=i>s,a=String(e),c=String(t),l=String(n);n=Math.max(Math.abs(n),1);let u=o$(a)||o$(c)||o$(l),p=u?Math.max(a.length,c.length,l.length):0,h=!1===u&&!1===((e,t,n)=>"string"==typeof e||"string"==typeof t||!0===n.stringify)(e,t,r),d=r.transform||(e=>t=>!0===e?Number(t):String(t))(h);if(r.toRegex&&1===n)return l$(c$(e,p),c$(t,p),!0,r);let f={negatives:[],positives:[]},m=[],g=0;for(;o?i>=s:i<=s;)!0===r.toRegex&&n>1?f[(y=i)<0?"negatives":"positives"].push(Math.abs(y)):m.push(a$(d(i,g),p,h)),i=o?i-n:i+n,g++;var y;return!0===r.toRegex?n>1?((e,t,n)=>{e.negatives.sort(((e,t)=>e<t?-1:e>t?1:0)),e.positives.sort(((e,t)=>e<t?-1:e>t?1:0));let r,i=t.capture?"":"?:",s="",o="";return e.positives.length&&(s=e.positives.map((e=>c$(String(e),n))).join("|")),e.negatives.length&&(o=`-(${i}${e.negatives.map((e=>c$(String(e),n))).join("|")})`),r=s&&o?`${s}|${o}`:s||o,t.wrap?`(${i}${r})`:r})(f,r,p):u$(m,null,{wrap:!1,...r}):m},f$=(e,t,n,r={})=>{if(null==t&&i$(e))return[e];if(!i$(e)||!i$(t))return h$(e,t,r);if("function"==typeof n)return f$(e,t,1,{transform:n});if(r$(n))return f$(e,t,0,n);let i={...r};return!0===i.capture&&(i.wrap=!0),n=n||i.step||1,s$(n)?s$(e)&&s$(t)?d$(e,t,n,i):((e,t,n=1,r={})=>{if(!s$(e)&&e.length>1||!s$(t)&&t.length>1)return h$(e,t,r);let i=r.transform||(e=>String.fromCharCode(e)),s=`${e}`.charCodeAt(0),o=`${t}`.charCodeAt(0),a=s>o,c=Math.min(s,o),l=Math.max(s,o);if(r.toRegex&&1===n)return l$(c,l,!1,r);let u=[],p=0;for(;a?s>=o:s<=o;)u.push(i(s,p)),s=a?s-n:s+n,p++;return!0===r.toRegex?u$(u,null,{wrap:!1,options:r}):u})(e,t,Math.max(Math.abs(n),1),i):null==n||r$(n)?f$(e,t,1,n):((e,t)=>{if(!0===t.strictRanges)throw new TypeError(`Expected step "${e}" to be a number`);return[]})(n,i)};const m$=f$,g$=MH;var y$=(e,t={})=>{const n=(e,r={})=>{const i=g$.isInvalidBrace(r),s=!0===e.invalid&&!0===t.escapeInvalid,o=!0===i||!0===s,a=!0===t.escapeInvalid?"\\":"";let c="";if(!0===e.isOpen)return a+e.value;if(!0===e.isClose)return console.log("node.isClose",a,e.value),a+e.value;if("open"===e.type)return o?a+e.value:"(";if("close"===e.type)return o?a+e.value:")";if("comma"===e.type)return"comma"===e.prev.type?"":o?e.value:"|";if(e.value)return e.value;if(e.nodes&&e.ranges>0){const n=g$.reduce(e.nodes),r=m$(...n,{...t,wrap:!1,toRegex:!0,strictZeros:!0});if(0!==r.length)return n.length>1&&r.length>1?`(${r})`:r}if(e.nodes)for(const t of e.nodes)c+=n(t,e);return c};return n(e)};const v$=f$,b$=qH,_$=MH,w$=(e="",t="",n=!1)=>{const r=[];if(e=[].concat(e),!(t=[].concat(t)).length)return e;if(!e.length)return n?_$.flatten(t).map((e=>`{${e}}`)):t;for(const i of e)if(Array.isArray(i))for(const e of i)r.push(w$(e,t,n));else for(let e of t)!0===n&&"string"==typeof e&&(e=`{${e}}`),r.push(Array.isArray(e)?w$(i,e,n):i+e);return _$.flatten(r)};var x$=(e,t={})=>{const n=void 0===t.rangeLimit?1e3:t.rangeLimit,r=(e,i={})=>{e.queue=[];let s=i,o=i.queue;for(;"brace"!==s.type&&"root"!==s.type&&s.parent;)s=s.parent,o=s.queue;if(e.invalid||e.dollar)return void o.push(w$(o.pop(),b$(e,t)));if("brace"===e.type&&!0!==e.invalid&&2===e.nodes.length)return void o.push(w$(o.pop(),["{}"]));if(e.nodes&&e.ranges>0){const r=_$.reduce(e.nodes);if(_$.exceedsLimit(...r,t.step,n))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let i=v$(...r,t);return 0===i.length&&(i=b$(e,t)),o.push(w$(o.pop(),i)),void(e.nodes=[])}const a=_$.encloseBrace(e);let c=e.queue,l=e;for(;"brace"!==l.type&&"root"!==l.type&&l.parent;)l=l.parent,c=l.queue;for(let t=0;t<e.nodes.length;t++){const n=e.nodes[t];"comma"!==n.type||"brace"!==e.type?"close"!==n.type?n.value&&"open"!==n.type?c.push(w$(c.pop(),n.value)):n.nodes&&r(n,e):o.push(w$(o.pop(),c,a)):(1===t&&c.push(""),c.push(""))}return c};return _$.flatten(r(e))};const E$=qH,{MAX_LENGTH:S$,CHAR_BACKSLASH:T$,CHAR_BACKTICK:D$,CHAR_COMMA:k$,CHAR_DOT:A$,CHAR_LEFT_PARENTHESES:C$,CHAR_RIGHT_PARENTHESES:R$,CHAR_LEFT_CURLY_BRACE:O$,CHAR_RIGHT_CURLY_BRACE:L$,CHAR_LEFT_SQUARE_BRACKET:I$,CHAR_RIGHT_SQUARE_BRACKET:P$,CHAR_DOUBLE_QUOTE:N$,CHAR_SINGLE_QUOTE:j$,CHAR_NO_BREAK_SPACE:F$,CHAR_ZERO_WIDTH_NOBREAK_SPACE:B$}={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"};var M$=(e,t={})=>{if("string"!=typeof e)throw new TypeError("Expected a string");const n=t||{},r="number"==typeof n.maxLength?Math.min(S$,n.maxLength):S$;if(e.length>r)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${r})`);const i={type:"root",input:e,nodes:[]},s=[i];let o=i,a=i,c=0;const l=e.length;let u,p=0,h=0;const d=()=>e[p++],f=e=>{if("text"===e.type&&"dot"===a.type&&(a.type="text"),!a||"text"!==a.type||"text"!==e.type)return o.nodes.push(e),e.parent=o,e.prev=a,a=e,e;a.value+=e.value};for(f({type:"bos"});p<l;)if(o=s[s.length-1],u=d(),u!==B$&&u!==F$)if(u!==T$)if(u!==P$)if(u!==I$)if(u!==C$)if(u!==R$)if(u!==N$&&u!==j$&&u!==D$)if(u!==O$)if(u!==L$)if(u===k$&&h>0){if(o.ranges>0){o.ranges=0;const e=o.nodes.shift();o.nodes=[e,{type:"text",value:E$(o)}]}f({type:"comma",value:u}),o.commas++}else if(u===A$&&h>0&&0===o.commas){const e=o.nodes;if(0===h||0===e.length){f({type:"text",value:u});continue}if("dot"===a.type){if(o.range=[],a.value+=u,a.type="range",3!==o.nodes.length&&5!==o.nodes.length){o.invalid=!0,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if("range"===a.type){e.pop();const t=e[e.length-1];t.value+=a.value+u,a=t,o.ranges--;continue}f({type:"dot",value:u})}else f({type:"text",value:u});else{if("brace"!==o.type){f({type:"text",value:u});continue}const e="close";o=s.pop(),o.close=!0,f({type:e,value:u}),h--,o=s[s.length-1]}else{h++;const e=a.value&&"$"===a.value.slice(-1)||!0===o.dollar;o=f({type:"brace",open:!0,close:!1,dollar:e,depth:h,commas:0,ranges:0,nodes:[]}),s.push(o),f({type:"open",value:u})}else{const e=u;let n;for(!0!==t.keepQuotes&&(u="");p<l&&(n=d());)if(n!==T$){if(n===e){!0===t.keepQuotes&&(u+=n);break}u+=n}else u+=n+d();f({type:"text",value:u})}else{if("paren"!==o.type){f({type:"text",value:u});continue}o=s.pop(),f({type:"text",value:u}),o=s[s.length-1]}else o=f({type:"paren",nodes:[]}),s.push(o),f({type:"text",value:u});else{let e;for(c++;p<l&&(e=d());)if(u+=e,e!==I$)if(e!==T$){if(e===P$&&(c--,0===c))break}else u+=d();else c++;f({type:"text",value:u})}else f({type:"text",value:"\\"+u});else f({type:"text",value:(t.keepEscaping?u:"")+d()});do{if(o=s.pop(),"root"!==o.type){o.nodes.forEach((e=>{e.nodes||("open"===e.type&&(e.isOpen=!0),"close"===e.type&&(e.isClose=!0),e.nodes||(e.type="text"),e.invalid=!0)}));const e=s[s.length-1],t=e.nodes.indexOf(o);e.nodes.splice(t,1,...o.nodes)}}while(s.length>0);return f({type:"eos"}),i};const U$=qH,q$=y$,H$=x$,$$=M$,z$=(e,t={})=>{let n=[];if(Array.isArray(e))for(const r of e){const e=z$.create(r,t);Array.isArray(e)?n.push(...e):n.push(e)}else n=[].concat(z$.create(e,t));return t&&!0===t.expand&&!0===t.nodupes&&(n=[...new Set(n)]),n};z$.parse=(e,t={})=>$$(e,t),z$.stringify=(e,t={})=>U$("string"==typeof e?z$.parse(e,t):e,t),z$.compile=(e,t={})=>("string"==typeof e&&(e=z$.parse(e,t)),q$(e,t)),z$.expand=(e,t={})=>{"string"==typeof e&&(e=z$.parse(e,t));let n=H$(e,t);return!0===t.noempty&&(n=n.filter(Boolean)),!0===t.nodupes&&(n=[...new Set(n)]),n},z$.create=(e,t={})=>""===e||e.length<3?[e]:!0!==t.expand?z$.compile(e,t):z$.expand(e,t);var W$=z$;const G$=o,V$=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]);var K$={};!function(e){const{sep:t}=o,{platform:n}=process,r=a;e.EV_ALL="all",e.EV_READY="ready",e.EV_ADD="add",e.EV_CHANGE="change",e.EV_ADD_DIR="addDir",e.EV_UNLINK="unlink",e.EV_UNLINK_DIR="unlinkDir",e.EV_RAW="raw",e.EV_ERROR="error",e.STR_DATA="data",e.STR_END="end",e.STR_CLOSE="close",e.FSEVENT_CREATED="created",e.FSEVENT_MODIFIED="modified",e.FSEVENT_DELETED="deleted",e.FSEVENT_MOVED="moved",e.FSEVENT_CLONED="cloned",e.FSEVENT_UNKNOWN="unknown",e.FSEVENT_FLAG_MUST_SCAN_SUBDIRS=1,e.FSEVENT_TYPE_FILE="file",e.FSEVENT_TYPE_DIRECTORY="directory",e.FSEVENT_TYPE_SYMLINK="symlink",e.KEY_LISTENERS="listeners",e.KEY_ERR="errHandlers",e.KEY_RAW="rawEmitters",e.HANDLER_KEYS=[e.KEY_LISTENERS,e.KEY_ERR,e.KEY_RAW],e.DOT_SLASH=`.${t}`,e.BACK_SLASH_RE=/\\/g,e.DOUBLE_SLASH_RE=/\/\//,e.SLASH_OR_BACK_SLASH_RE=/[/\\]/,e.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,e.REPLACER_RE=/^\.[/\\]/,e.SLASH="/",e.SLASH_SLASH="//",e.BRACE_START="{",e.BANG="!",e.ONE_DOT=".",e.TWO_DOTS="..",e.STAR="*",e.GLOBSTAR="**",e.ROOT_GLOBSTAR="/**/*",e.SLASH_GLOBSTAR="/**",e.DIR_SUFFIX="Dir",e.ANYMATCH_OPTS={dot:!0},e.STRING_TYPE="string",e.FUNCTION_TYPE="function",e.EMPTY_STR="",e.EMPTY_FN=()=>{},e.IDENTITY_FN=e=>e,e.isWindows="win32"===n,e.isMacos="darwin"===n,e.isLinux="linux"===n,e.isIBMi="OS400"===r.type()}(K$);const Y$=s,Z$=o,{promisify:Q$}=y,J$=e=>V$.has(G$.extname(e).slice(1).toLowerCase()),{isWindows:X$,isLinux:ez,EMPTY_FN:tz,EMPTY_STR:nz,KEY_LISTENERS:rz,KEY_ERR:iz,KEY_RAW:sz,HANDLER_KEYS:oz,EV_CHANGE:az,EV_ADD:cz,EV_ADD_DIR:lz,EV_ERROR:uz,STR_DATA:pz,STR_END:hz,BRACE_START:dz,STAR:fz}=K$,mz=Q$(Y$.open),gz=Q$(Y$.stat),yz=Q$(Y$.lstat),vz=Q$(Y$.close),bz=Q$(Y$.realpath),_z={lstat:yz,stat:gz},wz=(e,t)=>{e instanceof Set?e.forEach(t):t(e)},xz=(e,t,n)=>{let r=e[t];r instanceof Set||(e[t]=r=new Set([r])),r.add(n)},Ez=(e,t,n)=>{const r=e[t];r instanceof Set?r.delete(n):r===n&&delete e[t]},Sz=e=>e instanceof Set?0===e.size:!e,Tz=new Map;function Dz(e,t,n,r,i){const s=(t,r)=>{n(e),i(t,r,{watchedPath:e}),r&&e!==r&&kz(Z$.resolve(e,r),rz,Z$.join(e,r))};try{return Y$.watch(e,t,s)}catch(e){r(e)}}const kz=(e,t,n,r,i)=>{const s=Tz.get(e);s&&wz(s[t],(e=>{e(n,r,i)}))},Az=(e,t,n,r)=>{const{listener:i,errHandler:s,rawEmitter:o}=r;let a,c=Tz.get(t);if(!n.persistent)return a=Dz(e,n,i,s,o),a.close.bind(a);if(c)xz(c,rz,i),xz(c,iz,s),xz(c,sz,o);else{if(a=Dz(e,n,kz.bind(null,t,rz),s,kz.bind(null,t,sz)),!a)return;a.on(uz,(async n=>{const r=kz.bind(null,t,iz);if(c.watcherUnusable=!0,X$&&"EPERM"===n.code)try{const t=await mz(e,"r");await vz(t),r(n)}catch(e){}else r(n)})),c={listeners:i,errHandlers:s,rawEmitters:o,watcher:a},Tz.set(t,c)}return()=>{Ez(c,rz,i),Ez(c,iz,s),Ez(c,sz,o),Sz(c.listeners)&&(c.watcher.close(),Tz.delete(t),oz.forEach((e=>t=>{const n=e[t];n instanceof Set?n.clear():delete e[t]})(c)),c.watcher=void 0,Object.freeze(c))}},Cz=new Map;var Rz=class{constructor(e){this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){const n=this.fsw.options,r=Z$.dirname(e),i=Z$.basename(e);this.fsw._getWatchedDir(r).add(i);const s=Z$.resolve(e),o={persistent:n.persistent};let a;return t||(t=tz),n.usePolling?(o.interval=n.enableBinaryInterval&&J$(i)?n.binaryInterval:n.interval,a=((e,t,n,r)=>{const{listener:i,rawEmitter:s}=r;let o=Cz.get(t);const a=o&&o.options;return a&&(a.persistent<n.persistent||a.interval>n.interval)&&(o.listeners,o.rawEmitters,Y$.unwatchFile(t),o=void 0),o?(xz(o,rz,i),xz(o,sz,s)):(o={listeners:i,rawEmitters:s,options:n,watcher:Y$.watchFile(t,n,((n,r)=>{wz(o.rawEmitters,(e=>{e(az,t,{curr:n,prev:r})}));const i=n.mtimeMs;(n.size!==r.size||i>r.mtimeMs||0===i)&&wz(o.listeners,(t=>t(e,n)))}))},Cz.set(t,o)),()=>{Ez(o,rz,i),Ez(o,sz,s),Sz(o.listeners)&&(Cz.delete(t),Y$.unwatchFile(t),o.options=o.watcher=void 0,Object.freeze(o))}})(e,s,o,{listener:t,rawEmitter:this.fsw._emitRaw})):a=Az(e,s,o,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),a}_handleFile(e,t,n){if(this.fsw.closed)return;const r=Z$.dirname(e),i=Z$.basename(e),s=this.fsw._getWatchedDir(r);let o=t;if(s.has(i))return;const a=async(t,n)=>{if(this.fsw._throttle("watch",e,5))if(n&&0!==n.mtimeMs){if(s.has(i)){const t=n.atimeMs,r=n.mtimeMs;(!t||t<=r||r!==o.mtimeMs)&&this.fsw._emit(az,e,n),o=n}}else try{const n=await gz(e);if(this.fsw.closed)return;const r=n.atimeMs,i=n.mtimeMs;(!r||r<=i||i!==o.mtimeMs)&&this.fsw._emit(az,e,n),ez&&o.ino!==n.ino?(this.fsw._closeFile(t),o=n,this.fsw._addPathCloser(t,this._watchWithNodeFs(e,a))):o=n}catch(e){this.fsw._remove(r,i)}},c=this._watchWithNodeFs(e,a);if((!n||!this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(cz,e,0))return;this.fsw._emit(cz,e,t)}return c}async _handleSymlink(e,t,n,r){if(this.fsw.closed)return;const i=e.fullPath,s=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){let t;this.fsw._incrReadyCount();try{t=await bz(n)}catch(e){return this.fsw._emitReady(),!0}if(this.fsw.closed)return;return s.has(r)?this.fsw._symlinkPaths.get(i)!==t&&(this.fsw._symlinkPaths.set(i,t),this.fsw._emit(az,n,e.stats)):(s.add(r),this.fsw._symlinkPaths.set(i,t),this.fsw._emit(cz,n,e.stats)),this.fsw._emitReady(),!0}if(this.fsw._symlinkPaths.has(i))return!0;this.fsw._symlinkPaths.set(i,!0)}_handleRead(e,t,n,r,i,s,o){if(e=Z$.join(e,nz),!n.hasGlob&&!(o=this.fsw._throttle("readdir",e,1e3)))return;const a=this.fsw._getWatchedDir(n.path),c=new Set;let l=this.fsw._readdirp(e,{fileFilter:e=>n.filterPath(e),directoryFilter:e=>n.filterDir(e),depth:0}).on(pz,(async o=>{if(this.fsw.closed)return void(l=void 0);const u=o.path;let p=Z$.join(e,u);c.add(u),o.stats.isSymbolicLink()&&await this._handleSymlink(o,e,p,u)||(this.fsw.closed?l=void 0:u!==r&&(r||a.has(u))||(this.fsw._incrReadyCount(),p=Z$.join(i,Z$.relative(i,p)),this._addToNodeFs(p,t,n,s+1)))})).on(uz,this._boundHandleError);return new Promise((t=>l.once(hz,(()=>{if(this.fsw.closed)return void(l=void 0);const u=!!o&&o.clear();t(),a.getChildren().filter((t=>t!==e&&!c.has(t)&&(!n.hasGlob||n.filterPath({fullPath:Z$.resolve(e,t)})))).forEach((t=>{this.fsw._remove(e,t)})),l=void 0,u&&this._handleRead(e,!1,n,r,i,s,o)}))))}async _handleDir(e,t,n,r,i,s,o){const a=this.fsw._getWatchedDir(Z$.dirname(e)),c=a.has(Z$.basename(e));let l,u;n&&this.fsw.options.ignoreInitial||i||c||s.hasGlob&&!s.globFilter(e)||this.fsw._emit(lz,e,t),a.add(Z$.basename(e)),this.fsw._getWatchedDir(e);const p=this.fsw.options.depth;if((null==p||r<=p)&&!this.fsw._symlinkPaths.has(o)){if(!i&&(await this._handleRead(e,n,s,i,e,r,l),this.fsw.closed))return;u=this._watchWithNodeFs(e,((t,n)=>{n&&0===n.mtimeMs||this._handleRead(t,!1,s,i,e,r,l)}))}return u}async _addToNodeFs(e,t,n,r,i){const s=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return s(),!1;const o=this.fsw._getWatchHelpers(e,r);!o.hasGlob&&n&&(o.hasGlob=n.hasGlob,o.globFilter=n.globFilter,o.filterPath=e=>n.filterPath(e),o.filterDir=e=>n.filterDir(e));try{const n=await _z[o.statMethod](o.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(o.watchPath,n))return s(),!1;const a=this.fsw.options.followSymlinks&&!e.includes(fz)&&!e.includes(dz);let c;if(n.isDirectory()){const s=Z$.resolve(e),l=a?await bz(e):e;if(this.fsw.closed)return;if(c=await this._handleDir(o.watchPath,n,t,r,i,o,l),this.fsw.closed)return;s!==l&&void 0!==l&&this.fsw._symlinkPaths.set(s,l)}else if(n.isSymbolicLink()){const i=a?await bz(e):e;if(this.fsw.closed)return;const s=Z$.dirname(o.watchPath);if(this.fsw._getWatchedDir(s).add(o.watchPath),this.fsw._emit(cz,o.watchPath,n),c=await this._handleDir(s,n,t,r,e,o,i),this.fsw.closed)return;void 0!==i&&this.fsw._symlinkPaths.set(Z$.resolve(e),i)}else c=this._handleFile(o.watchPath,n,t);return s(),this.fsw._addPathCloser(e,c),!1}catch(t){if(this.fsw._handleError(t))return s(),e}}},Oz={exports:{}};const Lz=s,Iz=o,{promisify:Pz}=y;let Nz;try{Nz=require("fsevents")}catch(Dk){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(Dk)}if(Nz){const e=process.version.match(/v(\d+)\.(\d+)/);if(e&&e[1]&&e[2]){const t=Number.parseInt(e[1],10),n=Number.parseInt(e[2],10);8===t&&n<16&&(Nz=void 0)}}const{EV_ADD:jz,EV_CHANGE:Fz,EV_ADD_DIR:Bz,EV_UNLINK:Mz,EV_ERROR:Uz,STR_DATA:qz,STR_END:Hz,FSEVENT_CREATED:$z,FSEVENT_MODIFIED:zz,FSEVENT_DELETED:Wz,FSEVENT_MOVED:Gz,FSEVENT_UNKNOWN:Vz,FSEVENT_FLAG_MUST_SCAN_SUBDIRS:Kz,FSEVENT_TYPE_FILE:Yz,FSEVENT_TYPE_DIRECTORY:Zz,FSEVENT_TYPE_SYMLINK:Qz,ROOT_GLOBSTAR:Jz,DIR_SUFFIX:Xz,DOT_SLASH:eW,FUNCTION_TYPE:tW,EMPTY_FN:nW,IDENTITY_FN:rW}=K$,iW=Pz(Lz.stat),sW=Pz(Lz.lstat),oW=Pz(Lz.realpath),aW={stat:iW,lstat:sW},cW=new Map,lW=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),uW=(e,t)=>({stop:Nz.watch(e,t)});const pW=e=>{let t=0;for(const n of cW.keys())if(0===n.indexOf(e)&&(t++,t>=10))return!0;return!1},hW=(e,t)=>{let n=0;for(;!e.indexOf(t)&&(e=Iz.dirname(e))!==t;)n++;return n},dW=(e,t)=>e.type===Zz&&t.isDirectory()||e.type===Qz&&t.isSymbolicLink()||e.type===Yz&&t.isFile();Oz.exports=class{constructor(e){this.fsw=e}checkIgnored(e,t){const n=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,t))return n.add(e),t&&t.isDirectory()&&n.add(e+Jz),!0;n.delete(e),n.delete(e+Jz)}addOrChange(e,t,n,r,i,s,o,a){const c=i.has(s)?Fz:jz;this.handleEvent(c,e,t,n,r,i,s,o,a)}async checkExists(e,t,n,r,i,s,o,a){try{const c=await iW(e);if(this.fsw.closed)return;dW(o,c)?this.addOrChange(e,t,n,r,i,s,o,a):this.handleEvent(Mz,e,t,n,r,i,s,o,a)}catch(c){"EACCES"===c.code?this.addOrChange(e,t,n,r,i,s,o,a):this.handleEvent(Mz,e,t,n,r,i,s,o,a)}}handleEvent(e,t,n,r,i,s,o,a,c){if(!this.fsw.closed&&!this.checkIgnored(t))if(e===Mz){const e=a.type===Zz;(e||s.has(o))&&this.fsw._remove(i,o,e)}else{if(e===jz){if(a.type===Zz&&this.fsw._getWatchedDir(t),a.type===Qz&&c.followSymlinks){const e=void 0===c.depth?void 0:hW(n,r)+1;return this._addToFsEvents(t,!1,!0,e)}this.fsw._getWatchedDir(i).add(o)}const s=a.type===Zz?e+Xz:e;this.fsw._emit(s,t),s===Bz&&this._addToFsEvents(t,!1,!0)}}_watchWithFsEvents(e,t,n,r){if(this.fsw.closed||this.fsw._isIgnored(e))return;const i=this.fsw.options,s=function(e,t,n,r){let i=Iz.extname(t)?Iz.dirname(t):t;const s=Iz.dirname(i);let o=cW.get(i);pW(s)&&(i=s);const a=Iz.resolve(e),c=a!==t,l=(e,r,i)=>{c&&(e=e.replace(t,a)),e!==a&&e.indexOf(a+Iz.sep)||n(e,r,i)};let u=!1;for(const e of cW.keys())if(0===t.indexOf(Iz.resolve(e)+Iz.sep)){i=e,o=cW.get(i),u=!0;break}return o||u?o.listeners.add(l):(o={listeners:new Set([l]),rawEmitter:r,watcher:uW(i,((e,t)=>{if(!o.listeners.size)return;if(t&Kz)return;const n=Nz.getInfo(e,t);o.listeners.forEach((r=>{r(e,t,n)})),o.rawEmitter(n.event,e,n)}))},cW.set(i,o)),()=>{const e=o.listeners;if(e.delete(l),!e.size&&(cW.delete(i),o.watcher))return o.watcher.stop().then((()=>{o.rawEmitter=o.watcher=void 0,Object.freeze(o)}))}}(e,t,(async(s,o,a)=>{if(this.fsw.closed)return;if(void 0!==i.depth&&hW(s,t)>i.depth)return;const c=n(Iz.join(e,Iz.relative(e,s)));if(r&&!r(c))return;const l=Iz.dirname(c),u=Iz.basename(c),p=this.fsw._getWatchedDir(a.type===Zz?c:l);if(lW.has(o)||a.event===Vz)if(typeof i.ignored===tW){let e;try{e=await iW(c)}catch(e){}if(this.fsw.closed)return;if(this.checkIgnored(c,e))return;dW(a,e)?this.addOrChange(c,s,t,l,p,u,a,i):this.handleEvent(Mz,c,s,t,l,p,u,a,i)}else this.checkExists(c,s,t,l,p,u,a,i);else switch(a.event){case $z:case zz:return this.addOrChange(c,s,t,l,p,u,a,i);case Wz:case Gz:return this.checkExists(c,s,t,l,p,u,a,i)}}),this.fsw._emitRaw);return this.fsw._emitReady(),s}async _handleFsEventsSymlink(e,t,n,r){if(!this.fsw.closed&&!this.fsw._symlinkPaths.has(t)){this.fsw._symlinkPaths.set(t,!0),this.fsw._incrReadyCount();try{const t=await oW(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(t))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(t||e,(r=>{let i=e;return t&&t!==eW?i=r.replace(t,e):r!==eW&&(i=Iz.join(e,r)),n(i)}),!1,r)}catch(e){if(this.fsw._handleError(e))return this.fsw._emitReady()}}}emitAdd(e,t,n,r,i){const s=n(e),o=t.isDirectory(),a=this.fsw._getWatchedDir(Iz.dirname(s)),c=Iz.basename(s);o&&this.fsw._getWatchedDir(s),a.has(c)||(a.add(c),r.ignoreInitial&&!0!==i||this.fsw._emit(o?Bz:jz,s,t))}initWatch(e,t,n,r){if(this.fsw.closed)return;const i=this._watchWithFsEvents(n.watchPath,Iz.resolve(e||n.watchPath),r,n.globFilter);this.fsw._addPathCloser(t,i)}async _addToFsEvents(e,t,n,r){if(this.fsw.closed)return;const i=this.fsw.options,s=typeof t===tW?t:rW,o=this.fsw._getWatchHelpers(e);try{const t=await aW[o.statMethod](o.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(o.watchPath,t))throw null;if(t.isDirectory()){if(o.globFilter||this.emitAdd(s(e),t,s,i,n),r&&r>i.depth)return;this.fsw._readdirp(o.watchPath,{fileFilter:e=>o.filterPath(e),directoryFilter:e=>o.filterDir(e),...(a=i.depth-(r||0),isNaN(a)?{}:{depth:a})}).on(qz,(e=>{if(this.fsw.closed)return;if(e.stats.isDirectory()&&!o.filterPath(e))return;const t=Iz.join(o.watchPath,e.path),{fullPath:r}=e;if(o.followSymlinks&&e.stats.isSymbolicLink()){const e=void 0===i.depth?void 0:hW(t,Iz.resolve(o.watchPath))+1;this._handleFsEventsSymlink(t,r,s,e)}else this.emitAdd(t,e.stats,s,i,n)})).on(Uz,nW).on(Hz,(()=>{this.fsw._emitReady()}))}else this.emitAdd(o.watchPath,t,s,i,n),this.fsw._emitReady()}catch(e){e&&!this.fsw._handleError(e)||(this.fsw._emitReady(),this.fsw._emitReady())}var a;if(i.persistent&&!0!==n)if(typeof t===tW)this.initWatch(void 0,e,o,s);else{let t;try{t=await oW(o.watchPath)}catch(e){}this.initWatch(t,e,o,s)}}},Oz.exports.canUse=()=>Nz&&cW.size<128;var fW=Oz.exports;const{EventEmitter:mW}=p,gW=s,yW=o,{promisify:vW}=y,bW=yH,_W=DH.default,wW=function(e,t){Object.assign({flipBackslashes:!0},t).flipBackslashes&&PH&&e.indexOf("/")<0&&(e=e.replace(NH,"/")),jH.test(e)&&(e+="/"),e+="a";do{e=IH(e)}while(LH(e)||FH.test(e));return e.replace(BH,"$1")},xW=OH,EW=W$,SW=Xv,TW=Rz,DW=fW,{EV_ALL:kW,EV_READY:AW,EV_ADD:CW,EV_CHANGE:RW,EV_UNLINK:OW,EV_ADD_DIR:LW,EV_UNLINK_DIR:IW,EV_RAW:PW,EV_ERROR:NW,STR_CLOSE:jW,STR_END:FW,BACK_SLASH_RE:BW,DOUBLE_SLASH_RE:MW,SLASH_OR_BACK_SLASH_RE:UW,DOT_RE:qW,REPLACER_RE:HW,SLASH:$W,SLASH_SLASH:zW,BRACE_START:WW,BANG:GW,ONE_DOT:VW,TWO_DOTS:KW,GLOBSTAR:YW,SLASH_GLOBSTAR:ZW,ANYMATCH_OPTS:QW,STRING_TYPE:JW,FUNCTION_TYPE:XW,EMPTY_STR:eG,EMPTY_FN:tG,isWindows:nG,isMacos:rG,isIBMi:iG}=K$,sG=vW(gW.stat),oG=vW(gW.readdir),aG=(e=[])=>Array.isArray(e)?e:[e],cG=(e,t=[])=>(e.forEach((e=>{Array.isArray(e)?cG(e,t):t.push(e)})),t),lG=e=>{const t=cG(aG(e));if(!t.every((e=>typeof e===JW)))throw new TypeError(`Non-string provided as watch path: ${t}`);return t.map(pG)},uG=e=>{let t=e.replace(BW,$W),n=!1;for(t.startsWith(zW)&&(n=!0);t.match(MW);)t=t.replace(MW,$W);return n&&(t=$W+t),t},pG=e=>uG(yW.normalize(uG(e))),hG=(e=eG)=>t=>typeof t!==JW?t:pG(yW.isAbsolute(t)?t:yW.join(e,t)),dG=(e,t)=>void 0===e[t];class fG{constructor(e,t){this.path=e,this._removeWatcher=t,this.items=new Set}add(e){const{items:t}=this;t&&e!==VW&&e!==KW&&t.add(e)}async remove(e){const{items:t}=this;if(!t)return;if(t.delete(e),t.size>0)return;const n=this.path;try{await oG(n)}catch(e){this._removeWatcher&&this._removeWatcher(yW.dirname(n),yW.basename(n))}}has(e){const{items:t}=this;if(t)return t.has(e)}getChildren(){const{items:e}=this;if(e)return[...e.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this)}}class mG{constructor(e,t,n,r){this.fsw=r,this.path=e=e.replace(HW,eG),this.watchPath=t,this.fullWatchPath=yW.resolve(t),this.hasGlob=t!==e,e===eG&&(this.hasGlob=!1),this.globSymlink=!(!this.hasGlob||!n)&&void 0,this.globFilter=!!this.hasGlob&&_W(e,void 0,QW),this.dirParts=this.getDirParts(e),this.dirParts.forEach((e=>{e.length>1&&e.pop()})),this.followSymlinks=n,this.statMethod=n?"stat":"lstat"}checkGlobSymlink(e){return void 0===this.globSymlink&&(this.globSymlink=e.fullParentDir!==this.fullWatchPath&&{realPath:e.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):e.fullPath}entryPath(e){return yW.join(this.watchPath,yW.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){const{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);const n=this.entryPath(e);return(!this.hasGlob||typeof this.globFilter!==XW||this.globFilter(n))&&this.fsw._isntIgnored(n,t)&&this.fsw._hasReadPermissions(t)}getDirParts(e){if(!this.hasGlob)return[];const t=[];return(e.includes(WW)?EW.expand(e):[e]).forEach((e=>{t.push(yW.relative(this.watchPath,e).split(UW))})),t}filterDir(e){if(this.hasGlob){const t=this.getDirParts(this.checkGlobSymlink(e));let n=!1;this.unmatchedGlob=!this.dirParts.some((e=>e.every(((e,r)=>(e===YW&&(n=!0),n||!t[0][r]||_W(e,t[0][r],QW))))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}}class gG extends mW{constructor(e){super();const t={};e&&Object.assign(t,e),this._watched=new Map,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._symlinkPaths=new Map,this._streams=new Set,this.closed=!1,dG(t,"persistent")&&(t.persistent=!0),dG(t,"ignoreInitial")&&(t.ignoreInitial=!1),dG(t,"ignorePermissionErrors")&&(t.ignorePermissionErrors=!1),dG(t,"interval")&&(t.interval=100),dG(t,"binaryInterval")&&(t.binaryInterval=300),dG(t,"disableGlobbing")&&(t.disableGlobbing=!1),t.enableBinaryInterval=t.binaryInterval!==t.interval,dG(t,"useFsEvents")&&(t.useFsEvents=!t.usePolling);DW.canUse()||(t.useFsEvents=!1),dG(t,"usePolling")&&!t.useFsEvents&&(t.usePolling=rG),iG&&(t.usePolling=!0);const n=process.env.CHOKIDAR_USEPOLLING;if(void 0!==n){const e=n.toLowerCase();t.usePolling="false"!==e&&"0"!==e&&("true"===e||"1"===e||!!e)}const r=process.env.CHOKIDAR_INTERVAL;r&&(t.interval=Number.parseInt(r,10)),dG(t,"atomic")&&(t.atomic=!t.usePolling&&!t.useFsEvents),t.atomic&&(this._pendingUnlinks=new Map),dG(t,"followSymlinks")&&(t.followSymlinks=!0),dG(t,"awaitWriteFinish")&&(t.awaitWriteFinish=!1),!0===t.awaitWriteFinish&&(t.awaitWriteFinish={});const i=t.awaitWriteFinish;i&&(i.stabilityThreshold||(i.stabilityThreshold=2e3),i.pollInterval||(i.pollInterval=100),this._pendingWrites=new Map),t.ignored&&(t.ignored=aG(t.ignored));let s=0;this._emitReady=()=>{s++,s>=this._readyCount&&(this._emitReady=tG,this._readyEmitted=!0,process.nextTick((()=>this.emit(AW))))},this._emitRaw=(...e)=>this.emit(PW,...e),this._readyEmitted=!1,this.options=t,t.useFsEvents?this._fsEventsHandler=new DW(this):this._nodeFsHandler=new TW(this),Object.freeze(t)}add(e,t,n){const{cwd:r,disableGlobbing:i}=this.options;this.closed=!1;let s=lG(e);return r&&(s=s.map((e=>{const t=((e,t)=>yW.isAbsolute(e)?e:e.startsWith(GW)?GW+yW.join(t,e.slice(1)):yW.join(t,e))(e,r);return i||!xW(e)?t:SW(t)}))),s=s.filter((e=>e.startsWith(GW)?(this._ignoredPaths.add(e.slice(1)),!1):(this._ignoredPaths.delete(e),this._ignoredPaths.delete(e+ZW),this._userIgnored=void 0,!0))),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=s.length),this.options.persistent&&(this._readyCount+=s.length),s.forEach((e=>this._fsEventsHandler._addToFsEvents(e)))):(this._readyCount||(this._readyCount=0),this._readyCount+=s.length,Promise.all(s.map((async e=>{const r=await this._nodeFsHandler._addToNodeFs(e,!n,0,0,t);return r&&this._emitReady(),r}))).then((e=>{this.closed||e.filter((e=>e)).forEach((e=>{this.add(yW.dirname(e),yW.basename(t||e))}))}))),this}unwatch(e){if(this.closed)return this;const t=lG(e),{cwd:n}=this.options;return t.forEach((e=>{yW.isAbsolute(e)||this._closers.has(e)||(n&&(e=yW.join(n,e)),e=yW.resolve(e)),this._closePath(e),this._ignoredPaths.add(e),this._watched.has(e)&&this._ignoredPaths.add(e+ZW),this._userIgnored=void 0})),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();const e=[];return this._closers.forEach((t=>t.forEach((t=>{const n=t();n instanceof Promise&&e.push(n)})))),this._streams.forEach((e=>e.destroy())),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach((e=>e.dispose())),["closers","watched","streams","symlinkPaths","throttled"].forEach((e=>{this[`_${e}`].clear()})),this._closePromise=e.length?Promise.all(e).then((()=>{})):Promise.resolve(),this._closePromise}getWatched(){const e={};return this._watched.forEach(((t,n)=>{const r=this.options.cwd?yW.relative(this.options.cwd,n):n;e[r||VW]=t.getChildren().sort()})),e}emitWithAll(e,t){this.emit(...t),e!==NW&&this.emit(kW,...t)}async _emit(e,t,n,r,i){if(this.closed)return;const s=this.options;nG&&(t=yW.normalize(t)),s.cwd&&(t=yW.relative(s.cwd,t));const o=[e,t];void 0!==i?o.push(n,r,i):void 0!==r?o.push(n,r):void 0!==n&&o.push(n);const a=s.awaitWriteFinish;let c;if(a&&(c=this._pendingWrites.get(t)))return c.lastChange=new Date,this;if(s.atomic){if(e===OW)return this._pendingUnlinks.set(t,o),setTimeout((()=>{this._pendingUnlinks.forEach(((e,t)=>{this.emit(...e),this.emit(kW,...e),this._pendingUnlinks.delete(t)}))}),"number"==typeof s.atomic?s.atomic:100),this;e===CW&&this._pendingUnlinks.has(t)&&(e=o[0]=RW,this._pendingUnlinks.delete(t))}if(a&&(e===CW||e===RW)&&this._readyEmitted){const n=(t,n)=>{t?(e=o[0]=NW,o[1]=t,this.emitWithAll(e,o)):n&&(o.length>2?o[2]=n:o.push(n),this.emitWithAll(e,o))};return this._awaitWriteFinish(t,a.stabilityThreshold,e,n),this}if(e===RW){if(!this._throttle(RW,t,50))return this}if(s.alwaysStat&&void 0===n&&(e===CW||e===LW||e===RW)){const e=s.cwd?yW.join(s.cwd,t):t;let n;try{n=await sG(e)}catch(e){}if(!n||this.closed)return;o.push(n)}return this.emitWithAll(e,o),this}_handleError(e){const t=e&&e.code;return e&&"ENOENT"!==t&&"ENOTDIR"!==t&&(!this.options.ignorePermissionErrors||"EPERM"!==t&&"EACCES"!==t)&&this.emit(NW,e),e||this.closed}_throttle(e,t,n){this._throttled.has(e)||this._throttled.set(e,new Map);const r=this._throttled.get(e),i=r.get(t);if(i)return i.count++,!1;let s;const o=()=>{const e=r.get(t),n=e?e.count:0;return r.delete(t),clearTimeout(s),e&&clearTimeout(e.timeoutObject),n};s=setTimeout(o,n);const a={timeoutObject:s,clear:o,count:0};return r.set(t,a),a}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,n,r){let i,s=e;this.options.cwd&&!yW.isAbsolute(e)&&(s=yW.join(this.options.cwd,e));const o=new Date,a=n=>{gW.stat(s,((s,o)=>{if(s||!this._pendingWrites.has(e))return void(s&&"ENOENT"!==s.code&&r(s));const c=Number(new Date);n&&o.size!==n.size&&(this._pendingWrites.get(e).lastChange=c);c-this._pendingWrites.get(e).lastChange>=t?(this._pendingWrites.delete(e),r(void 0,o)):i=setTimeout(a,this.options.awaitWriteFinish.pollInterval,o)}))};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:o,cancelWait:()=>(this._pendingWrites.delete(e),clearTimeout(i),n)}),i=setTimeout(a,this.options.awaitWriteFinish.pollInterval))}_getGlobIgnored(){return[...this._ignoredPaths.values()]}_isIgnored(e,t){if(this.options.atomic&&qW.test(e))return!0;if(!this._userIgnored){const{cwd:e}=this.options,t=this.options.ignored,n=t&&t.map(hG(e)),r=aG(n).filter((e=>typeof e===JW&&!xW(e))).map((e=>e+ZW)),i=this._getGlobIgnored().map(hG(e)).concat(n,r);this._userIgnored=_W(i,void 0,QW)}return this._userIgnored([e,t])}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e,t){const n=t||this.options.disableGlobbing||!xW(e)?e:wW(e),r=this.options.followSymlinks;return new mG(e,n,r,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));const t=yW.resolve(e);return this._watched.has(t)||this._watched.set(t,new fG(t,this._boundRemove)),this._watched.get(t)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return!0;const t=511&(e&&Number.parseInt(e.mode,10)),n=Number.parseInt(t.toString(8)[0],10);return Boolean(4&n)}_remove(e,t,n){const r=yW.join(e,t),i=yW.resolve(r);if(n=null!=n?n:this._watched.has(r)||this._watched.has(i),!this._throttle("remove",r,100))return;n||this.options.useFsEvents||1!==this._watched.size||this.add(e,t,!0);this._getWatchedDir(r).getChildren().forEach((e=>this._remove(r,e)));const s=this._getWatchedDir(e),o=s.has(t);s.remove(t),this._symlinkPaths.has(i)&&this._symlinkPaths.delete(i);let a=r;if(this.options.cwd&&(a=yW.relative(this.options.cwd,r)),this.options.awaitWriteFinish&&this._pendingWrites.has(a)){if(this._pendingWrites.get(a).cancelWait()===CW)return}this._watched.delete(r),this._watched.delete(i);const c=n?IW:OW;o&&!this._isIgnored(r)&&this._emit(c,r),this.options.useFsEvents||this._closePath(r)}_closePath(e){this._closeFile(e);const t=yW.dirname(e);this._getWatchedDir(t).remove(yW.basename(e))}_closeFile(e){const t=this._closers.get(e);t&&(t.forEach((e=>e())),this._closers.delete(e))}_addPathCloser(e,t){if(!t)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(t)}_readdirp(e,t){if(this.closed)return;const n={type:kW,alwaysStat:!0,lstat:!0,...t};let r=bW(e,n);return this._streams.add(r),r.once(jW,(()=>{r=void 0})),r.once(FW,(()=>{r&&(this._streams.delete(r),r=void 0)})),r}}XU.FSWatcher=gG;XU.watch=(e,t)=>{const n=new gG(t);return n.add(e),n};var yG={exports:{}},vG={},bG={},_G={exports:{}};
365
+ const s$=y,o$=VH,a$=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),c$=e=>"number"==typeof e||"string"==typeof e&&""!==e,l$=e=>Number.isInteger(+e),u$=e=>{let t=`${e}`,n=-1;if("-"===t[0]&&(t=t.slice(1)),"0"===t)return!1;for(;"0"===t[++n];);return n>0},p$=(e,t,n)=>{if(t>0){let n="-"===e[0]?"-":"";n&&(e=e.slice(1)),e=n+e.padStart(n?t-1:t,"0")}return!1===n?String(e):e},h$=(e,t)=>{let n="-"===e[0]?"-":"";for(n&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return n?"-"+e:e},d$=(e,t,n,r)=>{if(n)return o$(e,t,{wrap:!1,...r});let i=String.fromCharCode(e);return e===t?i:`[${i}-${String.fromCharCode(t)}]`},f$=(e,t,n)=>{if(Array.isArray(e)){let t=!0===n.wrap,r=n.capture?"":"?:";return t?`(${r}${e.join("|")})`:e.join("|")}return o$(e,t,n)},m$=(...e)=>new RangeError("Invalid range arguments: "+s$.inspect(...e)),g$=(e,t,n)=>{if(!0===n.strictRanges)throw m$([e,t]);return[]},y$=(e,t,n=1,r={})=>{let i=Number(e),s=Number(t);if(!Number.isInteger(i)||!Number.isInteger(s)){if(!0===r.strictRanges)throw m$([e,t]);return[]}0===i&&(i=0),0===s&&(s=0);let o=i>s,a=String(e),c=String(t),l=String(n);n=Math.max(Math.abs(n),1);let u=u$(a)||u$(c)||u$(l),p=u?Math.max(a.length,c.length,l.length):0,h=!1===u&&!1===((e,t,n)=>"string"==typeof e||"string"==typeof t||!0===n.stringify)(e,t,r),d=r.transform||(e=>t=>!0===e?Number(t):String(t))(h);if(r.toRegex&&1===n)return d$(h$(e,p),h$(t,p),!0,r);let f={negatives:[],positives:[]},m=[],g=0;for(;o?i>=s:i<=s;)!0===r.toRegex&&n>1?f[(y=i)<0?"negatives":"positives"].push(Math.abs(y)):m.push(p$(d(i,g),p,h)),i=o?i-n:i+n,g++;var y;return!0===r.toRegex?n>1?((e,t,n)=>{e.negatives.sort(((e,t)=>e<t?-1:e>t?1:0)),e.positives.sort(((e,t)=>e<t?-1:e>t?1:0));let r,i=t.capture?"":"?:",s="",o="";return e.positives.length&&(s=e.positives.map((e=>h$(String(e),n))).join("|")),e.negatives.length&&(o=`-(${i}${e.negatives.map((e=>h$(String(e),n))).join("|")})`),r=s&&o?`${s}|${o}`:s||o,t.wrap?`(${i}${r})`:r})(f,r,p):f$(m,null,{wrap:!1,...r}):m},v$=(e,t,n,r={})=>{if(null==t&&c$(e))return[e];if(!c$(e)||!c$(t))return g$(e,t,r);if("function"==typeof n)return v$(e,t,1,{transform:n});if(a$(n))return v$(e,t,0,n);let i={...r};return!0===i.capture&&(i.wrap=!0),n=n||i.step||1,l$(n)?l$(e)&&l$(t)?y$(e,t,n,i):((e,t,n=1,r={})=>{if(!l$(e)&&e.length>1||!l$(t)&&t.length>1)return g$(e,t,r);let i=r.transform||(e=>String.fromCharCode(e)),s=`${e}`.charCodeAt(0),o=`${t}`.charCodeAt(0),a=s>o,c=Math.min(s,o),l=Math.max(s,o);if(r.toRegex&&1===n)return d$(c,l,!1,r);let u=[],p=0;for(;a?s>=o:s<=o;)u.push(i(s,p)),s=a?s-n:s+n,p++;return!0===r.toRegex?f$(u,null,{wrap:!1,options:r}):u})(e,t,Math.max(Math.abs(n),1),i):null==n||a$(n)?v$(e,t,1,n):((e,t)=>{if(!0===t.strictRanges)throw new TypeError(`Expected step "${e}" to be a number`);return[]})(n,i)};const b$=v$,_$=$H;var w$=(e,t={})=>{const n=(e,r={})=>{const i=_$.isInvalidBrace(r),s=!0===e.invalid&&!0===t.escapeInvalid,o=!0===i||!0===s,a=!0===t.escapeInvalid?"\\":"";let c="";if(!0===e.isOpen)return a+e.value;if(!0===e.isClose)return console.log("node.isClose",a,e.value),a+e.value;if("open"===e.type)return o?a+e.value:"(";if("close"===e.type)return o?a+e.value:")";if("comma"===e.type)return"comma"===e.prev.type?"":o?e.value:"|";if(e.value)return e.value;if(e.nodes&&e.ranges>0){const n=_$.reduce(e.nodes),r=b$(...n,{...t,wrap:!1,toRegex:!0,strictZeros:!0});if(0!==r.length)return n.length>1&&r.length>1?`(${r})`:r}if(e.nodes)for(const t of e.nodes)c+=n(t,e);return c};return n(e)};const x$=v$,E$=WH,S$=$H,T$=(e="",t="",n=!1)=>{const r=[];if(e=[].concat(e),!(t=[].concat(t)).length)return e;if(!e.length)return n?S$.flatten(t).map((e=>`{${e}}`)):t;for(const i of e)if(Array.isArray(i))for(const e of i)r.push(T$(e,t,n));else for(let e of t)!0===n&&"string"==typeof e&&(e=`{${e}}`),r.push(Array.isArray(e)?T$(i,e,n):i+e);return S$.flatten(r)};var D$=(e,t={})=>{const n=void 0===t.rangeLimit?1e3:t.rangeLimit,r=(e,i={})=>{e.queue=[];let s=i,o=i.queue;for(;"brace"!==s.type&&"root"!==s.type&&s.parent;)s=s.parent,o=s.queue;if(e.invalid||e.dollar)return void o.push(T$(o.pop(),E$(e,t)));if("brace"===e.type&&!0!==e.invalid&&2===e.nodes.length)return void o.push(T$(o.pop(),["{}"]));if(e.nodes&&e.ranges>0){const r=S$.reduce(e.nodes);if(S$.exceedsLimit(...r,t.step,n))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let i=x$(...r,t);return 0===i.length&&(i=E$(e,t)),o.push(T$(o.pop(),i)),void(e.nodes=[])}const a=S$.encloseBrace(e);let c=e.queue,l=e;for(;"brace"!==l.type&&"root"!==l.type&&l.parent;)l=l.parent,c=l.queue;for(let t=0;t<e.nodes.length;t++){const n=e.nodes[t];"comma"!==n.type||"brace"!==e.type?"close"!==n.type?n.value&&"open"!==n.type?c.push(T$(c.pop(),n.value)):n.nodes&&r(n,e):o.push(T$(o.pop(),c,a)):(1===t&&c.push(""),c.push(""))}return c};return S$.flatten(r(e))};const k$=WH,{MAX_LENGTH:A$,CHAR_BACKSLASH:C$,CHAR_BACKTICK:R$,CHAR_COMMA:O$,CHAR_DOT:L$,CHAR_LEFT_PARENTHESES:I$,CHAR_RIGHT_PARENTHESES:P$,CHAR_LEFT_CURLY_BRACE:N$,CHAR_RIGHT_CURLY_BRACE:j$,CHAR_LEFT_SQUARE_BRACKET:F$,CHAR_RIGHT_SQUARE_BRACKET:B$,CHAR_DOUBLE_QUOTE:M$,CHAR_SINGLE_QUOTE:U$,CHAR_NO_BREAK_SPACE:q$,CHAR_ZERO_WIDTH_NOBREAK_SPACE:H$}={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:"\n",CHAR_NO_BREAK_SPACE:" ",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:"\t",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\ufeff"};var $$=(e,t={})=>{if("string"!=typeof e)throw new TypeError("Expected a string");const n=t||{},r="number"==typeof n.maxLength?Math.min(A$,n.maxLength):A$;if(e.length>r)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${r})`);const i={type:"root",input:e,nodes:[]},s=[i];let o=i,a=i,c=0;const l=e.length;let u,p=0,h=0;const d=()=>e[p++],f=e=>{if("text"===e.type&&"dot"===a.type&&(a.type="text"),!a||"text"!==a.type||"text"!==e.type)return o.nodes.push(e),e.parent=o,e.prev=a,a=e,e;a.value+=e.value};for(f({type:"bos"});p<l;)if(o=s[s.length-1],u=d(),u!==H$&&u!==q$)if(u!==C$)if(u!==B$)if(u!==F$)if(u!==I$)if(u!==P$)if(u!==M$&&u!==U$&&u!==R$)if(u!==N$)if(u!==j$)if(u===O$&&h>0){if(o.ranges>0){o.ranges=0;const e=o.nodes.shift();o.nodes=[e,{type:"text",value:k$(o)}]}f({type:"comma",value:u}),o.commas++}else if(u===L$&&h>0&&0===o.commas){const e=o.nodes;if(0===h||0===e.length){f({type:"text",value:u});continue}if("dot"===a.type){if(o.range=[],a.value+=u,a.type="range",3!==o.nodes.length&&5!==o.nodes.length){o.invalid=!0,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if("range"===a.type){e.pop();const t=e[e.length-1];t.value+=a.value+u,a=t,o.ranges--;continue}f({type:"dot",value:u})}else f({type:"text",value:u});else{if("brace"!==o.type){f({type:"text",value:u});continue}const e="close";o=s.pop(),o.close=!0,f({type:e,value:u}),h--,o=s[s.length-1]}else{h++;const e=a.value&&"$"===a.value.slice(-1)||!0===o.dollar;o=f({type:"brace",open:!0,close:!1,dollar:e,depth:h,commas:0,ranges:0,nodes:[]}),s.push(o),f({type:"open",value:u})}else{const e=u;let n;for(!0!==t.keepQuotes&&(u="");p<l&&(n=d());)if(n!==C$){if(n===e){!0===t.keepQuotes&&(u+=n);break}u+=n}else u+=n+d();f({type:"text",value:u})}else{if("paren"!==o.type){f({type:"text",value:u});continue}o=s.pop(),f({type:"text",value:u}),o=s[s.length-1]}else o=f({type:"paren",nodes:[]}),s.push(o),f({type:"text",value:u});else{let e;for(c++;p<l&&(e=d());)if(u+=e,e!==F$)if(e!==C$){if(e===B$&&(c--,0===c))break}else u+=d();else c++;f({type:"text",value:u})}else f({type:"text",value:"\\"+u});else f({type:"text",value:(t.keepEscaping?u:"")+d()});do{if(o=s.pop(),"root"!==o.type){o.nodes.forEach((e=>{e.nodes||("open"===e.type&&(e.isOpen=!0),"close"===e.type&&(e.isClose=!0),e.nodes||(e.type="text"),e.invalid=!0)}));const e=s[s.length-1],t=e.nodes.indexOf(o);e.nodes.splice(t,1,...o.nodes)}}while(s.length>0);return f({type:"eos"}),i};const z$=WH,W$=w$,G$=D$,V$=$$,K$=(e,t={})=>{let n=[];if(Array.isArray(e))for(const r of e){const e=K$.create(r,t);Array.isArray(e)?n.push(...e):n.push(e)}else n=[].concat(K$.create(e,t));return t&&!0===t.expand&&!0===t.nodupes&&(n=[...new Set(n)]),n};K$.parse=(e,t={})=>V$(e,t),K$.stringify=(e,t={})=>z$("string"==typeof e?K$.parse(e,t):e,t),K$.compile=(e,t={})=>("string"==typeof e&&(e=K$.parse(e,t)),W$(e,t)),K$.expand=(e,t={})=>{"string"==typeof e&&(e=K$.parse(e,t));let n=G$(e,t);return!0===t.noempty&&(n=n.filter(Boolean)),!0===t.nodupes&&(n=[...new Set(n)]),n},K$.create=(e,t={})=>""===e||e.length<3?[e]:!0!==t.expand?K$.compile(e,t):K$.expand(e,t);var Y$=K$;const Z$=o,Q$=new Set(["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]);var J$={};!function(e){const{sep:t}=o,{platform:n}=process,r=a;e.EV_ALL="all",e.EV_READY="ready",e.EV_ADD="add",e.EV_CHANGE="change",e.EV_ADD_DIR="addDir",e.EV_UNLINK="unlink",e.EV_UNLINK_DIR="unlinkDir",e.EV_RAW="raw",e.EV_ERROR="error",e.STR_DATA="data",e.STR_END="end",e.STR_CLOSE="close",e.FSEVENT_CREATED="created",e.FSEVENT_MODIFIED="modified",e.FSEVENT_DELETED="deleted",e.FSEVENT_MOVED="moved",e.FSEVENT_CLONED="cloned",e.FSEVENT_UNKNOWN="unknown",e.FSEVENT_FLAG_MUST_SCAN_SUBDIRS=1,e.FSEVENT_TYPE_FILE="file",e.FSEVENT_TYPE_DIRECTORY="directory",e.FSEVENT_TYPE_SYMLINK="symlink",e.KEY_LISTENERS="listeners",e.KEY_ERR="errHandlers",e.KEY_RAW="rawEmitters",e.HANDLER_KEYS=[e.KEY_LISTENERS,e.KEY_ERR,e.KEY_RAW],e.DOT_SLASH=`.${t}`,e.BACK_SLASH_RE=/\\/g,e.DOUBLE_SLASH_RE=/\/\//,e.SLASH_OR_BACK_SLASH_RE=/[/\\]/,e.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/,e.REPLACER_RE=/^\.[/\\]/,e.SLASH="/",e.SLASH_SLASH="//",e.BRACE_START="{",e.BANG="!",e.ONE_DOT=".",e.TWO_DOTS="..",e.STAR="*",e.GLOBSTAR="**",e.ROOT_GLOBSTAR="/**/*",e.SLASH_GLOBSTAR="/**",e.DIR_SUFFIX="Dir",e.ANYMATCH_OPTS={dot:!0},e.STRING_TYPE="string",e.FUNCTION_TYPE="function",e.EMPTY_STR="",e.EMPTY_FN=()=>{},e.IDENTITY_FN=e=>e,e.isWindows="win32"===n,e.isMacos="darwin"===n,e.isLinux="linux"===n,e.isIBMi="OS400"===r.type()}(J$);const X$=s,ez=o,{promisify:tz}=y,nz=e=>Q$.has(Z$.extname(e).slice(1).toLowerCase()),{isWindows:rz,isLinux:iz,EMPTY_FN:sz,EMPTY_STR:oz,KEY_LISTENERS:az,KEY_ERR:cz,KEY_RAW:lz,HANDLER_KEYS:uz,EV_CHANGE:pz,EV_ADD:hz,EV_ADD_DIR:dz,EV_ERROR:fz,STR_DATA:mz,STR_END:gz,BRACE_START:yz,STAR:vz}=J$,bz=tz(X$.open),_z=tz(X$.stat),wz=tz(X$.lstat),xz=tz(X$.close),Ez=tz(X$.realpath),Sz={lstat:wz,stat:_z},Tz=(e,t)=>{e instanceof Set?e.forEach(t):t(e)},Dz=(e,t,n)=>{let r=e[t];r instanceof Set||(e[t]=r=new Set([r])),r.add(n)},kz=(e,t,n)=>{const r=e[t];r instanceof Set?r.delete(n):r===n&&delete e[t]},Az=e=>e instanceof Set?0===e.size:!e,Cz=new Map;function Rz(e,t,n,r,i){const s=(t,r)=>{n(e),i(t,r,{watchedPath:e}),r&&e!==r&&Oz(ez.resolve(e,r),az,ez.join(e,r))};try{return X$.watch(e,t,s)}catch(e){r(e)}}const Oz=(e,t,n,r,i)=>{const s=Cz.get(e);s&&Tz(s[t],(e=>{e(n,r,i)}))},Lz=(e,t,n,r)=>{const{listener:i,errHandler:s,rawEmitter:o}=r;let a,c=Cz.get(t);if(!n.persistent)return a=Rz(e,n,i,s,o),a.close.bind(a);if(c)Dz(c,az,i),Dz(c,cz,s),Dz(c,lz,o);else{if(a=Rz(e,n,Oz.bind(null,t,az),s,Oz.bind(null,t,lz)),!a)return;a.on(fz,(async n=>{const r=Oz.bind(null,t,cz);if(c.watcherUnusable=!0,rz&&"EPERM"===n.code)try{const t=await bz(e,"r");await xz(t),r(n)}catch(e){}else r(n)})),c={listeners:i,errHandlers:s,rawEmitters:o,watcher:a},Cz.set(t,c)}return()=>{kz(c,az,i),kz(c,cz,s),kz(c,lz,o),Az(c.listeners)&&(c.watcher.close(),Cz.delete(t),uz.forEach((e=>t=>{const n=e[t];n instanceof Set?n.clear():delete e[t]})(c)),c.watcher=void 0,Object.freeze(c))}},Iz=new Map;var Pz=class{constructor(e){this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){const n=this.fsw.options,r=ez.dirname(e),i=ez.basename(e);this.fsw._getWatchedDir(r).add(i);const s=ez.resolve(e),o={persistent:n.persistent};let a;return t||(t=sz),n.usePolling?(o.interval=n.enableBinaryInterval&&nz(i)?n.binaryInterval:n.interval,a=((e,t,n,r)=>{const{listener:i,rawEmitter:s}=r;let o=Iz.get(t);const a=o&&o.options;return a&&(a.persistent<n.persistent||a.interval>n.interval)&&(o.listeners,o.rawEmitters,X$.unwatchFile(t),o=void 0),o?(Dz(o,az,i),Dz(o,lz,s)):(o={listeners:i,rawEmitters:s,options:n,watcher:X$.watchFile(t,n,((n,r)=>{Tz(o.rawEmitters,(e=>{e(pz,t,{curr:n,prev:r})}));const i=n.mtimeMs;(n.size!==r.size||i>r.mtimeMs||0===i)&&Tz(o.listeners,(t=>t(e,n)))}))},Iz.set(t,o)),()=>{kz(o,az,i),kz(o,lz,s),Az(o.listeners)&&(Iz.delete(t),X$.unwatchFile(t),o.options=o.watcher=void 0,Object.freeze(o))}})(e,s,o,{listener:t,rawEmitter:this.fsw._emitRaw})):a=Lz(e,s,o,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),a}_handleFile(e,t,n){if(this.fsw.closed)return;const r=ez.dirname(e),i=ez.basename(e),s=this.fsw._getWatchedDir(r);let o=t;if(s.has(i))return;const a=async(t,n)=>{if(this.fsw._throttle("watch",e,5))if(n&&0!==n.mtimeMs){if(s.has(i)){const t=n.atimeMs,r=n.mtimeMs;(!t||t<=r||r!==o.mtimeMs)&&this.fsw._emit(pz,e,n),o=n}}else try{const n=await _z(e);if(this.fsw.closed)return;const r=n.atimeMs,i=n.mtimeMs;(!r||r<=i||i!==o.mtimeMs)&&this.fsw._emit(pz,e,n),iz&&o.ino!==n.ino?(this.fsw._closeFile(t),o=n,this.fsw._addPathCloser(t,this._watchWithNodeFs(e,a))):o=n}catch(e){this.fsw._remove(r,i)}},c=this._watchWithNodeFs(e,a);if((!n||!this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(hz,e,0))return;this.fsw._emit(hz,e,t)}return c}async _handleSymlink(e,t,n,r){if(this.fsw.closed)return;const i=e.fullPath,s=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){let t;this.fsw._incrReadyCount();try{t=await Ez(n)}catch(e){return this.fsw._emitReady(),!0}if(this.fsw.closed)return;return s.has(r)?this.fsw._symlinkPaths.get(i)!==t&&(this.fsw._symlinkPaths.set(i,t),this.fsw._emit(pz,n,e.stats)):(s.add(r),this.fsw._symlinkPaths.set(i,t),this.fsw._emit(hz,n,e.stats)),this.fsw._emitReady(),!0}if(this.fsw._symlinkPaths.has(i))return!0;this.fsw._symlinkPaths.set(i,!0)}_handleRead(e,t,n,r,i,s,o){if(e=ez.join(e,oz),!n.hasGlob&&!(o=this.fsw._throttle("readdir",e,1e3)))return;const a=this.fsw._getWatchedDir(n.path),c=new Set;let l=this.fsw._readdirp(e,{fileFilter:e=>n.filterPath(e),directoryFilter:e=>n.filterDir(e),depth:0}).on(mz,(async o=>{if(this.fsw.closed)return void(l=void 0);const u=o.path;let p=ez.join(e,u);c.add(u),o.stats.isSymbolicLink()&&await this._handleSymlink(o,e,p,u)||(this.fsw.closed?l=void 0:u!==r&&(r||a.has(u))||(this.fsw._incrReadyCount(),p=ez.join(i,ez.relative(i,p)),this._addToNodeFs(p,t,n,s+1)))})).on(fz,this._boundHandleError);return new Promise((t=>l.once(gz,(()=>{if(this.fsw.closed)return void(l=void 0);const u=!!o&&o.clear();t(),a.getChildren().filter((t=>t!==e&&!c.has(t)&&(!n.hasGlob||n.filterPath({fullPath:ez.resolve(e,t)})))).forEach((t=>{this.fsw._remove(e,t)})),l=void 0,u&&this._handleRead(e,!1,n,r,i,s,o)}))))}async _handleDir(e,t,n,r,i,s,o){const a=this.fsw._getWatchedDir(ez.dirname(e)),c=a.has(ez.basename(e));let l,u;n&&this.fsw.options.ignoreInitial||i||c||s.hasGlob&&!s.globFilter(e)||this.fsw._emit(dz,e,t),a.add(ez.basename(e)),this.fsw._getWatchedDir(e);const p=this.fsw.options.depth;if((null==p||r<=p)&&!this.fsw._symlinkPaths.has(o)){if(!i&&(await this._handleRead(e,n,s,i,e,r,l),this.fsw.closed))return;u=this._watchWithNodeFs(e,((t,n)=>{n&&0===n.mtimeMs||this._handleRead(t,!1,s,i,e,r,l)}))}return u}async _addToNodeFs(e,t,n,r,i){const s=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return s(),!1;const o=this.fsw._getWatchHelpers(e,r);!o.hasGlob&&n&&(o.hasGlob=n.hasGlob,o.globFilter=n.globFilter,o.filterPath=e=>n.filterPath(e),o.filterDir=e=>n.filterDir(e));try{const n=await Sz[o.statMethod](o.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(o.watchPath,n))return s(),!1;const a=this.fsw.options.followSymlinks&&!e.includes(vz)&&!e.includes(yz);let c;if(n.isDirectory()){const s=ez.resolve(e),l=a?await Ez(e):e;if(this.fsw.closed)return;if(c=await this._handleDir(o.watchPath,n,t,r,i,o,l),this.fsw.closed)return;s!==l&&void 0!==l&&this.fsw._symlinkPaths.set(s,l)}else if(n.isSymbolicLink()){const i=a?await Ez(e):e;if(this.fsw.closed)return;const s=ez.dirname(o.watchPath);if(this.fsw._getWatchedDir(s).add(o.watchPath),this.fsw._emit(hz,o.watchPath,n),c=await this._handleDir(s,n,t,r,e,o,i),this.fsw.closed)return;void 0!==i&&this.fsw._symlinkPaths.set(ez.resolve(e),i)}else c=this._handleFile(o.watchPath,n,t);return s(),this.fsw._addPathCloser(e,c),!1}catch(t){if(this.fsw._handleError(t))return s(),e}}},Nz={exports:{}};const jz=s,Fz=o,{promisify:Bz}=y;let Mz;try{Mz=require("fsevents")}catch(Dk){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(Dk)}if(Mz){const e=process.version.match(/v(\d+)\.(\d+)/);if(e&&e[1]&&e[2]){const t=Number.parseInt(e[1],10),n=Number.parseInt(e[2],10);8===t&&n<16&&(Mz=void 0)}}const{EV_ADD:Uz,EV_CHANGE:qz,EV_ADD_DIR:Hz,EV_UNLINK:$z,EV_ERROR:zz,STR_DATA:Wz,STR_END:Gz,FSEVENT_CREATED:Vz,FSEVENT_MODIFIED:Kz,FSEVENT_DELETED:Yz,FSEVENT_MOVED:Zz,FSEVENT_UNKNOWN:Qz,FSEVENT_FLAG_MUST_SCAN_SUBDIRS:Jz,FSEVENT_TYPE_FILE:Xz,FSEVENT_TYPE_DIRECTORY:eW,FSEVENT_TYPE_SYMLINK:tW,ROOT_GLOBSTAR:nW,DIR_SUFFIX:rW,DOT_SLASH:iW,FUNCTION_TYPE:sW,EMPTY_FN:oW,IDENTITY_FN:aW}=J$,cW=Bz(jz.stat),lW=Bz(jz.lstat),uW=Bz(jz.realpath),pW={stat:cW,lstat:lW},hW=new Map,dW=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),fW=(e,t)=>({stop:Mz.watch(e,t)});const mW=e=>{let t=0;for(const n of hW.keys())if(0===n.indexOf(e)&&(t++,t>=10))return!0;return!1},gW=(e,t)=>{let n=0;for(;!e.indexOf(t)&&(e=Fz.dirname(e))!==t;)n++;return n},yW=(e,t)=>e.type===eW&&t.isDirectory()||e.type===tW&&t.isSymbolicLink()||e.type===Xz&&t.isFile();Nz.exports=class{constructor(e){this.fsw=e}checkIgnored(e,t){const n=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,t))return n.add(e),t&&t.isDirectory()&&n.add(e+nW),!0;n.delete(e),n.delete(e+nW)}addOrChange(e,t,n,r,i,s,o,a){const c=i.has(s)?qz:Uz;this.handleEvent(c,e,t,n,r,i,s,o,a)}async checkExists(e,t,n,r,i,s,o,a){try{const c=await cW(e);if(this.fsw.closed)return;yW(o,c)?this.addOrChange(e,t,n,r,i,s,o,a):this.handleEvent($z,e,t,n,r,i,s,o,a)}catch(c){"EACCES"===c.code?this.addOrChange(e,t,n,r,i,s,o,a):this.handleEvent($z,e,t,n,r,i,s,o,a)}}handleEvent(e,t,n,r,i,s,o,a,c){if(!this.fsw.closed&&!this.checkIgnored(t))if(e===$z){const e=a.type===eW;(e||s.has(o))&&this.fsw._remove(i,o,e)}else{if(e===Uz){if(a.type===eW&&this.fsw._getWatchedDir(t),a.type===tW&&c.followSymlinks){const e=void 0===c.depth?void 0:gW(n,r)+1;return this._addToFsEvents(t,!1,!0,e)}this.fsw._getWatchedDir(i).add(o)}const s=a.type===eW?e+rW:e;this.fsw._emit(s,t),s===Hz&&this._addToFsEvents(t,!1,!0)}}_watchWithFsEvents(e,t,n,r){if(this.fsw.closed||this.fsw._isIgnored(e))return;const i=this.fsw.options,s=function(e,t,n,r){let i=Fz.extname(t)?Fz.dirname(t):t;const s=Fz.dirname(i);let o=hW.get(i);mW(s)&&(i=s);const a=Fz.resolve(e),c=a!==t,l=(e,r,i)=>{c&&(e=e.replace(t,a)),e!==a&&e.indexOf(a+Fz.sep)||n(e,r,i)};let u=!1;for(const e of hW.keys())if(0===t.indexOf(Fz.resolve(e)+Fz.sep)){i=e,o=hW.get(i),u=!0;break}return o||u?o.listeners.add(l):(o={listeners:new Set([l]),rawEmitter:r,watcher:fW(i,((e,t)=>{if(!o.listeners.size)return;if(t&Jz)return;const n=Mz.getInfo(e,t);o.listeners.forEach((r=>{r(e,t,n)})),o.rawEmitter(n.event,e,n)}))},hW.set(i,o)),()=>{const e=o.listeners;if(e.delete(l),!e.size&&(hW.delete(i),o.watcher))return o.watcher.stop().then((()=>{o.rawEmitter=o.watcher=void 0,Object.freeze(o)}))}}(e,t,(async(s,o,a)=>{if(this.fsw.closed)return;if(void 0!==i.depth&&gW(s,t)>i.depth)return;const c=n(Fz.join(e,Fz.relative(e,s)));if(r&&!r(c))return;const l=Fz.dirname(c),u=Fz.basename(c),p=this.fsw._getWatchedDir(a.type===eW?c:l);if(dW.has(o)||a.event===Qz)if(typeof i.ignored===sW){let e;try{e=await cW(c)}catch(e){}if(this.fsw.closed)return;if(this.checkIgnored(c,e))return;yW(a,e)?this.addOrChange(c,s,t,l,p,u,a,i):this.handleEvent($z,c,s,t,l,p,u,a,i)}else this.checkExists(c,s,t,l,p,u,a,i);else switch(a.event){case Vz:case Kz:return this.addOrChange(c,s,t,l,p,u,a,i);case Yz:case Zz:return this.checkExists(c,s,t,l,p,u,a,i)}}),this.fsw._emitRaw);return this.fsw._emitReady(),s}async _handleFsEventsSymlink(e,t,n,r){if(!this.fsw.closed&&!this.fsw._symlinkPaths.has(t)){this.fsw._symlinkPaths.set(t,!0),this.fsw._incrReadyCount();try{const t=await uW(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(t))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(t||e,(r=>{let i=e;return t&&t!==iW?i=r.replace(t,e):r!==iW&&(i=Fz.join(e,r)),n(i)}),!1,r)}catch(e){if(this.fsw._handleError(e))return this.fsw._emitReady()}}}emitAdd(e,t,n,r,i){const s=n(e),o=t.isDirectory(),a=this.fsw._getWatchedDir(Fz.dirname(s)),c=Fz.basename(s);o&&this.fsw._getWatchedDir(s),a.has(c)||(a.add(c),r.ignoreInitial&&!0!==i||this.fsw._emit(o?Hz:Uz,s,t))}initWatch(e,t,n,r){if(this.fsw.closed)return;const i=this._watchWithFsEvents(n.watchPath,Fz.resolve(e||n.watchPath),r,n.globFilter);this.fsw._addPathCloser(t,i)}async _addToFsEvents(e,t,n,r){if(this.fsw.closed)return;const i=this.fsw.options,s=typeof t===sW?t:aW,o=this.fsw._getWatchHelpers(e);try{const t=await pW[o.statMethod](o.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(o.watchPath,t))throw null;if(t.isDirectory()){if(o.globFilter||this.emitAdd(s(e),t,s,i,n),r&&r>i.depth)return;this.fsw._readdirp(o.watchPath,{fileFilter:e=>o.filterPath(e),directoryFilter:e=>o.filterDir(e),...(a=i.depth-(r||0),isNaN(a)?{}:{depth:a})}).on(Wz,(e=>{if(this.fsw.closed)return;if(e.stats.isDirectory()&&!o.filterPath(e))return;const t=Fz.join(o.watchPath,e.path),{fullPath:r}=e;if(o.followSymlinks&&e.stats.isSymbolicLink()){const e=void 0===i.depth?void 0:gW(t,Fz.resolve(o.watchPath))+1;this._handleFsEventsSymlink(t,r,s,e)}else this.emitAdd(t,e.stats,s,i,n)})).on(zz,oW).on(Gz,(()=>{this.fsw._emitReady()}))}else this.emitAdd(o.watchPath,t,s,i,n),this.fsw._emitReady()}catch(e){e&&!this.fsw._handleError(e)||(this.fsw._emitReady(),this.fsw._emitReady())}var a;if(i.persistent&&!0!==n)if(typeof t===sW)this.initWatch(void 0,e,o,s);else{let t;try{t=await uW(o.watchPath)}catch(e){}this.initWatch(t,e,o,s)}}},Nz.exports.canUse=()=>Mz&&hW.size<128;var vW=Nz.exports;const{EventEmitter:bW}=p,_W=s,wW=o,{promisify:xW}=y,EW=wH,SW=RH.default,TW=function(e,t){Object.assign({flipBackslashes:!0},t).flipBackslashes&&BH&&e.indexOf("/")<0&&(e=e.replace(MH,"/")),UH.test(e)&&(e+="/"),e+="a";do{e=FH(e)}while(jH(e)||qH.test(e));return e.replace(HH,"$1")},DW=NH,kW=Y$,AW=Xv,CW=Pz,RW=vW,{EV_ALL:OW,EV_READY:LW,EV_ADD:IW,EV_CHANGE:PW,EV_UNLINK:NW,EV_ADD_DIR:jW,EV_UNLINK_DIR:FW,EV_RAW:BW,EV_ERROR:MW,STR_CLOSE:UW,STR_END:qW,BACK_SLASH_RE:HW,DOUBLE_SLASH_RE:$W,SLASH_OR_BACK_SLASH_RE:zW,DOT_RE:WW,REPLACER_RE:GW,SLASH:VW,SLASH_SLASH:KW,BRACE_START:YW,BANG:ZW,ONE_DOT:QW,TWO_DOTS:JW,GLOBSTAR:XW,SLASH_GLOBSTAR:eG,ANYMATCH_OPTS:tG,STRING_TYPE:nG,FUNCTION_TYPE:rG,EMPTY_STR:iG,EMPTY_FN:sG,isWindows:oG,isMacos:aG,isIBMi:cG}=J$,lG=xW(_W.stat),uG=xW(_W.readdir),pG=(e=[])=>Array.isArray(e)?e:[e],hG=(e,t=[])=>(e.forEach((e=>{Array.isArray(e)?hG(e,t):t.push(e)})),t),dG=e=>{const t=hG(pG(e));if(!t.every((e=>typeof e===nG)))throw new TypeError(`Non-string provided as watch path: ${t}`);return t.map(mG)},fG=e=>{let t=e.replace(HW,VW),n=!1;for(t.startsWith(KW)&&(n=!0);t.match($W);)t=t.replace($W,VW);return n&&(t=VW+t),t},mG=e=>fG(wW.normalize(fG(e))),gG=(e=iG)=>t=>typeof t!==nG?t:mG(wW.isAbsolute(t)?t:wW.join(e,t)),yG=(e,t)=>void 0===e[t];class vG{constructor(e,t){this.path=e,this._removeWatcher=t,this.items=new Set}add(e){const{items:t}=this;t&&e!==QW&&e!==JW&&t.add(e)}async remove(e){const{items:t}=this;if(!t)return;if(t.delete(e),t.size>0)return;const n=this.path;try{await uG(n)}catch(e){this._removeWatcher&&this._removeWatcher(wW.dirname(n),wW.basename(n))}}has(e){const{items:t}=this;if(t)return t.has(e)}getChildren(){const{items:e}=this;if(e)return[...e.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this)}}class bG{constructor(e,t,n,r){this.fsw=r,this.path=e=e.replace(GW,iG),this.watchPath=t,this.fullWatchPath=wW.resolve(t),this.hasGlob=t!==e,e===iG&&(this.hasGlob=!1),this.globSymlink=!(!this.hasGlob||!n)&&void 0,this.globFilter=!!this.hasGlob&&SW(e,void 0,tG),this.dirParts=this.getDirParts(e),this.dirParts.forEach((e=>{e.length>1&&e.pop()})),this.followSymlinks=n,this.statMethod=n?"stat":"lstat"}checkGlobSymlink(e){return void 0===this.globSymlink&&(this.globSymlink=e.fullParentDir!==this.fullWatchPath&&{realPath:e.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):e.fullPath}entryPath(e){return wW.join(this.watchPath,wW.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){const{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);const n=this.entryPath(e);return(!this.hasGlob||typeof this.globFilter!==rG||this.globFilter(n))&&this.fsw._isntIgnored(n,t)&&this.fsw._hasReadPermissions(t)}getDirParts(e){if(!this.hasGlob)return[];const t=[];return(e.includes(YW)?kW.expand(e):[e]).forEach((e=>{t.push(wW.relative(this.watchPath,e).split(zW))})),t}filterDir(e){if(this.hasGlob){const t=this.getDirParts(this.checkGlobSymlink(e));let n=!1;this.unmatchedGlob=!this.dirParts.some((e=>e.every(((e,r)=>(e===XW&&(n=!0),n||!t[0][r]||SW(e,t[0][r],tG))))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}}class _G extends bW{constructor(e){super();const t={};e&&Object.assign(t,e),this._watched=new Map,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._symlinkPaths=new Map,this._streams=new Set,this.closed=!1,yG(t,"persistent")&&(t.persistent=!0),yG(t,"ignoreInitial")&&(t.ignoreInitial=!1),yG(t,"ignorePermissionErrors")&&(t.ignorePermissionErrors=!1),yG(t,"interval")&&(t.interval=100),yG(t,"binaryInterval")&&(t.binaryInterval=300),yG(t,"disableGlobbing")&&(t.disableGlobbing=!1),t.enableBinaryInterval=t.binaryInterval!==t.interval,yG(t,"useFsEvents")&&(t.useFsEvents=!t.usePolling);RW.canUse()||(t.useFsEvents=!1),yG(t,"usePolling")&&!t.useFsEvents&&(t.usePolling=aG),cG&&(t.usePolling=!0);const n=process.env.CHOKIDAR_USEPOLLING;if(void 0!==n){const e=n.toLowerCase();t.usePolling="false"!==e&&"0"!==e&&("true"===e||"1"===e||!!e)}const r=process.env.CHOKIDAR_INTERVAL;r&&(t.interval=Number.parseInt(r,10)),yG(t,"atomic")&&(t.atomic=!t.usePolling&&!t.useFsEvents),t.atomic&&(this._pendingUnlinks=new Map),yG(t,"followSymlinks")&&(t.followSymlinks=!0),yG(t,"awaitWriteFinish")&&(t.awaitWriteFinish=!1),!0===t.awaitWriteFinish&&(t.awaitWriteFinish={});const i=t.awaitWriteFinish;i&&(i.stabilityThreshold||(i.stabilityThreshold=2e3),i.pollInterval||(i.pollInterval=100),this._pendingWrites=new Map),t.ignored&&(t.ignored=pG(t.ignored));let s=0;this._emitReady=()=>{s++,s>=this._readyCount&&(this._emitReady=sG,this._readyEmitted=!0,process.nextTick((()=>this.emit(LW))))},this._emitRaw=(...e)=>this.emit(BW,...e),this._readyEmitted=!1,this.options=t,t.useFsEvents?this._fsEventsHandler=new RW(this):this._nodeFsHandler=new CW(this),Object.freeze(t)}add(e,t,n){const{cwd:r,disableGlobbing:i}=this.options;this.closed=!1;let s=dG(e);return r&&(s=s.map((e=>{const t=((e,t)=>wW.isAbsolute(e)?e:e.startsWith(ZW)?ZW+wW.join(t,e.slice(1)):wW.join(t,e))(e,r);return i||!DW(e)?t:AW(t)}))),s=s.filter((e=>e.startsWith(ZW)?(this._ignoredPaths.add(e.slice(1)),!1):(this._ignoredPaths.delete(e),this._ignoredPaths.delete(e+eG),this._userIgnored=void 0,!0))),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=s.length),this.options.persistent&&(this._readyCount+=s.length),s.forEach((e=>this._fsEventsHandler._addToFsEvents(e)))):(this._readyCount||(this._readyCount=0),this._readyCount+=s.length,Promise.all(s.map((async e=>{const r=await this._nodeFsHandler._addToNodeFs(e,!n,0,0,t);return r&&this._emitReady(),r}))).then((e=>{this.closed||e.filter((e=>e)).forEach((e=>{this.add(wW.dirname(e),wW.basename(t||e))}))}))),this}unwatch(e){if(this.closed)return this;const t=dG(e),{cwd:n}=this.options;return t.forEach((e=>{wW.isAbsolute(e)||this._closers.has(e)||(n&&(e=wW.join(n,e)),e=wW.resolve(e)),this._closePath(e),this._ignoredPaths.add(e),this._watched.has(e)&&this._ignoredPaths.add(e+eG),this._userIgnored=void 0})),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();const e=[];return this._closers.forEach((t=>t.forEach((t=>{const n=t();n instanceof Promise&&e.push(n)})))),this._streams.forEach((e=>e.destroy())),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach((e=>e.dispose())),["closers","watched","streams","symlinkPaths","throttled"].forEach((e=>{this[`_${e}`].clear()})),this._closePromise=e.length?Promise.all(e).then((()=>{})):Promise.resolve(),this._closePromise}getWatched(){const e={};return this._watched.forEach(((t,n)=>{const r=this.options.cwd?wW.relative(this.options.cwd,n):n;e[r||QW]=t.getChildren().sort()})),e}emitWithAll(e,t){this.emit(...t),e!==MW&&this.emit(OW,...t)}async _emit(e,t,n,r,i){if(this.closed)return;const s=this.options;oG&&(t=wW.normalize(t)),s.cwd&&(t=wW.relative(s.cwd,t));const o=[e,t];void 0!==i?o.push(n,r,i):void 0!==r?o.push(n,r):void 0!==n&&o.push(n);const a=s.awaitWriteFinish;let c;if(a&&(c=this._pendingWrites.get(t)))return c.lastChange=new Date,this;if(s.atomic){if(e===NW)return this._pendingUnlinks.set(t,o),setTimeout((()=>{this._pendingUnlinks.forEach(((e,t)=>{this.emit(...e),this.emit(OW,...e),this._pendingUnlinks.delete(t)}))}),"number"==typeof s.atomic?s.atomic:100),this;e===IW&&this._pendingUnlinks.has(t)&&(e=o[0]=PW,this._pendingUnlinks.delete(t))}if(a&&(e===IW||e===PW)&&this._readyEmitted){const n=(t,n)=>{t?(e=o[0]=MW,o[1]=t,this.emitWithAll(e,o)):n&&(o.length>2?o[2]=n:o.push(n),this.emitWithAll(e,o))};return this._awaitWriteFinish(t,a.stabilityThreshold,e,n),this}if(e===PW){if(!this._throttle(PW,t,50))return this}if(s.alwaysStat&&void 0===n&&(e===IW||e===jW||e===PW)){const e=s.cwd?wW.join(s.cwd,t):t;let n;try{n=await lG(e)}catch(e){}if(!n||this.closed)return;o.push(n)}return this.emitWithAll(e,o),this}_handleError(e){const t=e&&e.code;return e&&"ENOENT"!==t&&"ENOTDIR"!==t&&(!this.options.ignorePermissionErrors||"EPERM"!==t&&"EACCES"!==t)&&this.emit(MW,e),e||this.closed}_throttle(e,t,n){this._throttled.has(e)||this._throttled.set(e,new Map);const r=this._throttled.get(e),i=r.get(t);if(i)return i.count++,!1;let s;const o=()=>{const e=r.get(t),n=e?e.count:0;return r.delete(t),clearTimeout(s),e&&clearTimeout(e.timeoutObject),n};s=setTimeout(o,n);const a={timeoutObject:s,clear:o,count:0};return r.set(t,a),a}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,n,r){let i,s=e;this.options.cwd&&!wW.isAbsolute(e)&&(s=wW.join(this.options.cwd,e));const o=new Date,a=n=>{_W.stat(s,((s,o)=>{if(s||!this._pendingWrites.has(e))return void(s&&"ENOENT"!==s.code&&r(s));const c=Number(new Date);n&&o.size!==n.size&&(this._pendingWrites.get(e).lastChange=c);c-this._pendingWrites.get(e).lastChange>=t?(this._pendingWrites.delete(e),r(void 0,o)):i=setTimeout(a,this.options.awaitWriteFinish.pollInterval,o)}))};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:o,cancelWait:()=>(this._pendingWrites.delete(e),clearTimeout(i),n)}),i=setTimeout(a,this.options.awaitWriteFinish.pollInterval))}_getGlobIgnored(){return[...this._ignoredPaths.values()]}_isIgnored(e,t){if(this.options.atomic&&WW.test(e))return!0;if(!this._userIgnored){const{cwd:e}=this.options,t=this.options.ignored,n=t&&t.map(gG(e)),r=pG(n).filter((e=>typeof e===nG&&!DW(e))).map((e=>e+eG)),i=this._getGlobIgnored().map(gG(e)).concat(n,r);this._userIgnored=SW(i,void 0,tG)}return this._userIgnored([e,t])}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e,t){const n=t||this.options.disableGlobbing||!DW(e)?e:TW(e),r=this.options.followSymlinks;return new bG(e,n,r,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));const t=wW.resolve(e);return this._watched.has(t)||this._watched.set(t,new vG(t,this._boundRemove)),this._watched.get(t)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return!0;const t=511&(e&&Number.parseInt(e.mode,10)),n=Number.parseInt(t.toString(8)[0],10);return Boolean(4&n)}_remove(e,t,n){const r=wW.join(e,t),i=wW.resolve(r);if(n=null!=n?n:this._watched.has(r)||this._watched.has(i),!this._throttle("remove",r,100))return;n||this.options.useFsEvents||1!==this._watched.size||this.add(e,t,!0);this._getWatchedDir(r).getChildren().forEach((e=>this._remove(r,e)));const s=this._getWatchedDir(e),o=s.has(t);s.remove(t),this._symlinkPaths.has(i)&&this._symlinkPaths.delete(i);let a=r;if(this.options.cwd&&(a=wW.relative(this.options.cwd,r)),this.options.awaitWriteFinish&&this._pendingWrites.has(a)){if(this._pendingWrites.get(a).cancelWait()===IW)return}this._watched.delete(r),this._watched.delete(i);const c=n?FW:NW;o&&!this._isIgnored(r)&&this._emit(c,r),this.options.useFsEvents||this._closePath(r)}_closePath(e){this._closeFile(e);const t=wW.dirname(e);this._getWatchedDir(t).remove(wW.basename(e))}_closeFile(e){const t=this._closers.get(e);t&&(t.forEach((e=>e())),this._closers.delete(e))}_addPathCloser(e,t){if(!t)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(t)}_readdirp(e,t){if(this.closed)return;const n={type:OW,alwaysStat:!0,lstat:!0,...t};let r=EW(e,n);return this._streams.add(r),r.once(UW,(()=>{r=void 0})),r.once(qW,(()=>{r&&(this._streams.delete(r),r=void 0)})),r}}rq.FSWatcher=_G;rq.watch=(e,t)=>{const n=new _G(t);return n.add(e),n};var wG={exports:{}},xG={},EG={},SG={exports:{}};
366
366
  /*!
367
367
  * base64id v0.1.0
368
368
  */
369
- !function(e){var t=w,n=function(){};n.prototype.getRandomBytes=function(e){var n=4096,r=this;if((e=e||12)>n)return t.randomBytes(e);var i=parseInt(n/e),s=parseInt(.85*i);if(!s)return t.randomBytes(e);if(null==this.bytesBufferIndex&&(this.bytesBufferIndex=-1),this.bytesBufferIndex==i&&(this.bytesBuffer=null,this.bytesBufferIndex=-1),(-1==this.bytesBufferIndex||this.bytesBufferIndex>s)&&(this.isGeneratingBytes||(this.isGeneratingBytes=!0,t.randomBytes(n,(function(e,t){r.bytesBuffer=t,r.bytesBufferIndex=0,r.isGeneratingBytes=!1}))),-1==this.bytesBufferIndex))return t.randomBytes(e);var o=this.bytesBuffer.slice(e*this.bytesBufferIndex,e*(this.bytesBufferIndex+1));return this.bytesBufferIndex++,o},n.prototype.generateId=function(){var e=Buffer.alloc(15);return e.writeInt32BE?(this.sequenceNumber=this.sequenceNumber+1|0,e.writeInt32BE(this.sequenceNumber,11),t.randomBytes?this.getRandomBytes(12).copy(e):[0,4,8].forEach((function(t){e.writeInt32BE(Math.random()*Math.pow(2,32)|0,t)})),e.toString("base64").replace(/\//g,"_").replace(/\+/g,"-")):Math.abs(Math.random()*Math.random()*Date.now()|0).toString()+Math.abs(Math.random()*Math.random()*Date.now()|0).toString()},e.exports=new n}(_G);var wG=_G.exports,xG={},EG={},SG={},TG={},DG={},kG={};Object.defineProperty(kG,"__esModule",{value:!0}),kG.ERROR_PACKET=kG.PACKET_TYPES_REVERSE=kG.PACKET_TYPES=void 0;const AG=Object.create(null);kG.PACKET_TYPES=AG,AG.open="0",AG.close="1",AG.ping="2",AG.pong="3",AG.message="4",AG.upgrade="5",AG.noop="6";const CG=Object.create(null);kG.PACKET_TYPES_REVERSE=CG,Object.keys(AG).forEach((e=>{CG[AG[e]]=e}));kG.ERROR_PACKET={type:"error",data:"parser error"},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.encodePacket=void 0,e.encodePacketToBinary=function(t,i){if(t.data instanceof ArrayBuffer||ArrayBuffer.isView(t.data))return i(n(t.data,!1));(0,e.encodePacket)(t,!0,(e=>{r||(r=new TextEncoder),i(r.encode(e))}))};const t=kG;e.encodePacket=({type:e,data:r},i,s)=>r instanceof ArrayBuffer||ArrayBuffer.isView(r)?s(i?r:"b"+n(r,!0).toString("base64")):s(t.PACKET_TYPES[e]+(r||""));const n=(e,t)=>Buffer.isBuffer(e)||e instanceof Uint8Array&&!t?e:e instanceof ArrayBuffer?Buffer.from(e):Buffer.from(e.buffer,e.byteOffset,e.byteLength);let r}(DG);var RG={};Object.defineProperty(RG,"__esModule",{value:!0}),RG.decodePacket=void 0;const OG=kG;RG.decodePacket=(e,t)=>{if("string"!=typeof e)return{type:"message",data:LG(e,t)};const n=e.charAt(0);if("b"===n){const n=Buffer.from(e.substring(1),"base64");return{type:"message",data:LG(n,t)}}return OG.PACKET_TYPES_REVERSE[n]?e.length>1?{type:OG.PACKET_TYPES_REVERSE[n],data:e.substring(1)}:{type:OG.PACKET_TYPES_REVERSE[n]}:OG.ERROR_PACKET};const LG=(e,t)=>"arraybuffer"===t?e instanceof ArrayBuffer?e:Buffer.isBuffer(e)?e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength):e.buffer:Buffer.isBuffer(e)?e:Buffer.from(e);!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decodePayload=e.decodePacket=e.encodePayload=e.encodePacket=e.protocol=void 0,e.createPacketEncoderStream=function(){return new TransformStream({transform(e,n){(0,t.encodePacketToBinary)(e,(t=>{const r=t.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const e=new DataView(i.buffer);e.setUint8(0,126),e.setUint16(1,r)}else{i=new Uint8Array(9);const e=new DataView(i.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(r))}e.data&&"string"!=typeof e.data&&(i[0]|=128),n.enqueue(i),n.enqueue(t)}))}})},e.createPacketDecoderStream=function(e,t){s||(s=new TextDecoder);const i=[];let c=0,l=-1,u=!1;return new TransformStream({transform(p,h){for(i.push(p);;){if(0===c){if(o(i)<1)break;const e=a(i,1);u=!(128&~e[0]),l=127&e[0],c=l<126?3:126===l?1:2}else if(1===c){if(o(i)<2)break;const e=a(i,2);l=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),c=3}else if(2===c){if(o(i)<8)break;const e=a(i,8),t=new DataView(e.buffer,e.byteOffset,e.length),n=t.getUint32(0);if(n>Math.pow(2,21)-1){h.enqueue(r.ERROR_PACKET);break}l=n*Math.pow(2,32)+t.getUint32(4),c=3}else{if(o(i)<l)break;const e=a(i,l);h.enqueue((0,n.decodePacket)(u?e:s.decode(e),t)),c=0}if(0===l||l>e){h.enqueue(r.ERROR_PACKET);break}}}})};const t=DG;Object.defineProperty(e,"encodePacket",{enumerable:!0,get:function(){return t.encodePacket}});const n=RG;Object.defineProperty(e,"decodePacket",{enumerable:!0,get:function(){return n.decodePacket}});const r=kG,i=String.fromCharCode(30);e.encodePayload=(e,n)=>{const r=e.length,s=new Array(r);let o=0;e.forEach(((e,a)=>{(0,t.encodePacket)(e,!1,(e=>{s[a]=e,++o===r&&n(s.join(i))}))}))};let s;function o(e){return e.reduce(((e,t)=>e+t.length),0)}function a(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}e.decodePayload=(e,t)=>{const r=e.split(i),s=[];for(let e=0;e<r.length;e++){const i=(0,n.decodePacket)(r[e],t);if(s.push(i),"error"===i.type)break}return s},e.protocol=4}(TG);var IG,PG,NG,jG={},FG=String.fromCharCode;
370
- /*! https://mths.be/utf8js v2.1.2 by @mathias */function BG(e){for(var t,n,r=[],i=0,s=e.length;i<s;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<s?56320==(64512&(n=e.charCodeAt(i++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),i--):r.push(t);return r}function MG(e,t){if(e>=55296&&e<=57343){if(t)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function UG(e,t){return FG(e>>t&63|128)}function qG(e,t){if(!(4294967168&e))return FG(e);var n="";return 4294965248&e?4294901760&e?4292870144&e||(n=FG(e>>18&7|240),n+=UG(e,12),n+=UG(e,6)):(MG(e,t)||(e=65533),n=FG(e>>12&15|224),n+=UG(e,6)):n=FG(e>>6&31|192),n+=FG(63&e|128)}function HG(){if(NG>=PG)throw Error("Invalid byte index");var e=255&IG[NG];if(NG++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function $G(e){var t,n;if(NG>PG)throw Error("Invalid byte index");if(NG==PG)return!1;if(t=255&IG[NG],NG++,!(128&t))return t;if(192==(224&t)){if((n=(31&t)<<6|HG())>=128)return n;throw Error("Invalid continuation byte")}if(224==(240&t)){if((n=(15&t)<<12|HG()<<6|HG())>=2048)return MG(n,e)?n:65533;throw Error("Invalid continuation byte")}if(240==(248&t)&&(n=(7&t)<<18|HG()<<12|HG()<<6|HG())>=65536&&n<=1114111)return n;throw Error("Invalid UTF-8 detected")}var zG={version:"2.1.2",encode:function(e,t){for(var n=!1!==(t=t||{}).strict,r=BG(e),i=r.length,s=-1,o="";++s<i;)o+=qG(r[s],n);return o},decode:function(e,t){var n=!1!==(t=t||{}).strict;IG=BG(e),PG=IG.length,NG=0;for(var r,i=[];!1!==(r=$G(n));)i.push(r);return function(e){for(var t,n=e.length,r=-1,i="";++r<n;)(t=e[r])>65535&&(i+=FG((t-=65536)>>>10&1023|55296),t=56320|1023&t),i+=FG(t);return i}(i)}};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decodePayloadAsBinary=e.encodePayloadAsBinary=e.decodePayload=e.encodePayload=e.decodeBase64Packet=e.decodePacket=e.encodeBase64Packet=e.encodePacket=e.packets=e.protocol=void 0;var t=zG;e.protocol=3;e.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6};var n=Object.keys(e.packets),r={type:"error",data:"parser error"};const i=Buffer.concat([]);function s(n,r,i,s){if("function"==typeof r&&(s=r,r=null),"function"==typeof i&&(s=i,i=null),Buffer.isBuffer(n.data))return o(n,r,s);if(n.data&&(n.data.buffer||n.data)instanceof ArrayBuffer)return o({type:n.type,data:d(n.data)},r,s);var a=e.packets[n.type];return void 0!==n.data&&(a+=i?t.encode(String(n.data),{strict:!1}):String(n.data)),s(""+a)}function o(t,n,r){if(!n)return a(t,r);var i=t.data,s=Buffer.allocUnsafe(1);return s[0]=e.packets[t.type],r(Buffer.concat([s,i]))}function a(t,n){var r=Buffer.isBuffer(t.data)?t.data:d(t.data),i="b"+e.packets[t.type];return n(i+=r.toString("base64"))}function c(e,i,s){if(void 0===e)return r;var o;if("string"==typeof e)return"b"===(o=e.charAt(0))?l(e.slice(1),i):s&&!1===(e=function(e){try{e=t.decode(e,{strict:!1})}catch(e){return!1}return e}(e))?r:Number(o)==o&&n[o]?e.length>1?{type:n[o],data:e.slice(1)}:{type:n[o]}:r;if("arraybuffer"===i){var a=new Uint8Array(e);return o=a[0],{type:n[o],data:a.buffer.slice(1)}}return e instanceof ArrayBuffer&&(e=d(e)),o=e[0],{type:n[o],data:e.slice(1)}}function l(e,t){var r=n[e.charAt(0)],i=Buffer.from(e.slice(1),"base64");if("arraybuffer"===t){for(var s=new Uint8Array(i.length),o=0;o<s.length;o++)s[o]=i[o];i=s.buffer}return{type:r,data:i}}function u(e,t,n){const r=new Array(e.length);let i=0;for(let s=0;s<e.length;s++)t(e[s],((t,o)=>{r[s]=o,++i===e.length&&n(null,r)}))}function p(e){for(var t="",n=0,r=e.length;n<r;n++)t+=String.fromCharCode(e[n]);return t}function h(e){for(var t=Buffer.allocUnsafe(e.length),n=0,r=e.length;n<r;n++)t.writeUInt8(e.charCodeAt(n),n);return t}function d(e){var t=e.byteLength||e.length,n=e.byteOffset||0;return Buffer.from(e.buffer||e,n,t)}function f(e,t){if(!e.length)return t(i);u(e,m,(function(e,n){return t(Buffer.concat(n))}))}function m(e,t){s(e,!0,!0,(function(e){var n,r=""+e.length;if("string"==typeof e){(n=Buffer.allocUnsafe(r.length+2))[0]=0;for(var i=0;i<r.length;i++)n[i+1]=parseInt(r[i],10);return n[n.length-1]=255,t(null,Buffer.concat([n,h(e)]))}for((n=Buffer.allocUnsafe(r.length+2))[0]=1,i=0;i<r.length;i++)n[i+1]=parseInt(r[i],10);n[n.length-1]=255,t(null,Buffer.concat([n,e]))}))}function g(e,t,n){"function"==typeof t&&(n=t,t=null);for(var i,s=e,o=[];s.length>0;){var a="",l=0===s[0];for(i=1;255!==s[i];i++){if(a.length>310)return n(r,0,1);a+=""+s[i]}s=s.slice(a.length+1);var u=parseInt(a,10),h=s.slice(1,u+1);l&&(h=p(h)),o.push(h),s=s.slice(u+1)}var d=o.length;for(i=0;i<d;i++){n(c(o[i],t,!0),i,d)}}e.encodePacket=s,e.encodeBase64Packet=a,e.decodePacket=c,e.decodeBase64Packet=l,e.encodePayload=function(e,t,n){if("function"==typeof t&&(n=t,t=null),t&&(e=>{for(const t of e)if(t.data instanceof ArrayBuffer||ArrayBuffer.isView(t.data))return!0;return!1})(e))return f(e,n);if(!e.length)return n("0:");u(e,(function(e,n){s(e,t,!1,(function(e){n(null,function(e){return e.length+":"+e}(e))}))}),(function(e,t){return n(t.join(""))}))},e.decodePayload=function(e,t,n){if("string"!=typeof e)return g(e,t,n);if("function"==typeof t&&(n=t,t=null),""===e)return n(r,0,1);for(var i,s,o,a="",l=0,u=e.length;l<u;l++){var p=e.charAt(l);if(":"===p){if(""===a||a!=(i=Number(a)))return n(r,0,1);if(a!=(s=e.slice(l+1,l+1+i)).length)return n(r,0,1);if(s.length){if(o=c(s,t,!1),r.type===o.type&&r.data===o.data)return n(r,0,1);if(!1===n(o,l+i,u))return}l+=i,a=""}else a+=p}return""!==a?n(r,0,1):void 0},e.encodePayloadAsBinary=f,e.decodePayloadAsBinary=g}(jG),Object.defineProperty(SG,"__esModule",{value:!0}),SG.Transport=void 0;const WG=p,GG=TG,VG=jG,KG=(0,ah.default)("engine:transport");function YG(){}let ZG=class extends WG.EventEmitter{constructor(e){super(),this.writable=!1,this._readyState="open",this.discarded=!1,this.protocol="4"===e._query.EIO?4:3,this.parser=4===this.protocol?GG:VG,this.supportsBinary=!(e._query&&e._query.b64)}get readyState(){return this._readyState}set readyState(e){KG("readyState updated from %s to %s (%s)",this._readyState,e,this.name),this._readyState=e}discard(){this.discarded=!0}onRequest(e){KG("setting request"),this.req=e}close(e){"closed"!==this.readyState&&"closing"!==this.readyState&&(this.readyState="closing",this.doClose(e||YG))}onError(e,t){if(this.listeners("error").length){const n=new Error(e);n.type="TransportError",n.description=t,this.emit("error",n)}else KG("ignored transport error %s (%s)",e,t)}onPacket(e){this.emit("packet",e)}onData(e){this.onPacket(this.parser.decodePacket(e))}onClose(){this.readyState="closed",this.emit("close")}};SG.Transport=ZG,Object.defineProperty(EG,"__esModule",{value:!0}),EG.Polling=void 0;const QG=SG,JG=T,XG=KM,eV=(0,ah.default)("engine:polling"),tV={gzip:JG.createGzip,deflate:JG.createDeflate};let nV=class extends QG.Transport{constructor(e){super(e),this.closeTimeout=3e4}get name(){return"polling"}get supportsFraming(){return!1}onRequest(e){const t=e.res;e.res=null,"GET"===e.method?this.onPollRequest(e,t):"POST"===e.method?this.onDataRequest(e,t):(t.writeHead(500),t.end())}onPollRequest(e,t){if(this.req)return eV("request overlap"),this.onError("overlap from client"),t.writeHead(400),void t.end();eV("setting request"),this.req=e,this.res=t;const n=()=>{this.onError("poll connection closed prematurely")};e.cleanup=()=>{e.removeListener("close",n),this.req=this.res=null},e.on("close",n),this.writable=!0,this.emit("drain"),this.writable&&this.shouldClose&&(eV("triggering empty send to append close packet"),this.send([{type:"noop"}]))}onDataRequest(e,t){if(this.dataReq)return this.onError("data request overlap from client"),t.writeHead(400),void t.end();const n="application/octet-stream"===e.headers["content-type"];if(n&&4===this.protocol)return this.onError("invalid content");this.dataReq=e,this.dataRes=t;let r=n?Buffer.concat([]):"";const i=()=>{e.removeListener("data",o),e.removeListener("end",a),e.removeListener("close",s),this.dataReq=this.dataRes=r=null},s=()=>{i(),this.onError("data request connection closed prematurely")},o=e=>{let s;n?(r=Buffer.concat([r,e]),s=r.length):(r+=e,s=Buffer.byteLength(r)),s>this.maxHttpBufferSize&&(t.writeHead(413).end(),i())},a=()=>{this.onData(r);t.writeHead(200,this.headers(e,{"Content-Type":"text/html","Content-Length":2})),t.end("ok"),i()};e.on("close",s),n||e.setEncoding("utf8"),e.on("data",o),e.on("end",a)}onData(e){eV('received "%s"',e);const t=e=>{if("close"===e.type)return eV("got xhr close packet"),this.onClose(),!1;this.onPacket(e)};3===this.protocol?this.parser.decodePayload(e,t):this.parser.decodePayload(e).forEach(t)}onClose(){this.writable&&this.send([{type:"noop"}]),super.onClose()}send(e){this.writable=!1,this.shouldClose&&(eV("appending close packet to payload"),e.push({type:"close"}),this.shouldClose(),this.shouldClose=null);const t=t=>{const n=e.some((e=>e.options&&e.options.compress));this.write(t,{compress:n})};3===this.protocol?this.parser.encodePayload(e,this.supportsBinary,t):this.parser.encodePayload(e,t)}write(e,t){eV('writing "%s"',e),this.doWrite(e,t,(()=>{this.req.cleanup()}))}doWrite(e,t,n){const r="string"==typeof e,i={"Content-Type":r?"text/plain; charset=UTF-8":"application/octet-stream"},s=e=>{i["Content-Length"]="string"==typeof e?Buffer.byteLength(e):e.length,this.res.writeHead(200,this.headers(this.req,i)),this.res.end(e),n()};if(!this.httpCompression||!t.compress)return void s(e);if((r?Buffer.byteLength(e):e.length)<this.httpCompression.threshold)return void s(e);const o=XG(this.req).encodings(["gzip","deflate"]);o?this.compress(e,o,((e,t)=>{if(e)return this.res.writeHead(500),this.res.end(),void n(e);i["Content-Encoding"]=o,s(t)})):s(e)}compress(e,t,n){eV("compressing");const r=[];let i=0;tV[t](this.httpCompression).on("error",n).on("data",(function(e){r.push(e),i+=e.length})).on("end",(function(){n(null,Buffer.concat(r,i))})).end(e)}doClose(e){let t;eV("closing"),this.dataReq&&(eV("aborting ongoing data request"),this.dataReq.destroy());const n=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(eV("transport writable - closing right away"),this.send([{type:"close"}]),n()):this.discarded?(eV("transport discarded - closing right away"),n()):(eV("transport not writable - buffering orderly close"),this.shouldClose=n,t=setTimeout(n,this.closeTimeout))}headers(e,t){t=t||{};const n=e.headers["user-agent"];return n&&(~n.indexOf(";MSIE")||~n.indexOf("Trident/"))&&(t["X-XSS-Protection"]="0"),t["cache-control"]="no-store",this.emit("headers",t,e),t}};EG.Polling=nV;var rV={};Object.defineProperty(rV,"__esModule",{value:!0}),rV.JSONP=void 0;const iV=EG,sV=L,oV=/\\\\n/g,aV=/(\\)?\\n/g;class cV extends iV.Polling{constructor(e){super(e),this.head="___eio["+(e._query.j||"").replace(/[^0-9]/g,"")+"](",this.foot=");"}onData(e){"string"==typeof(e=sV.parse(e).d)&&(e=e.replace(aV,(function(e,t){return t?e:"\n"})),super.onData(e.replace(oV,"\\n")))}doWrite(e,t,n){const r=JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");e=this.head+r+this.foot,super.doWrite(e,t,n)}}rV.JSONP=cV;var lV={};Object.defineProperty(lV,"__esModule",{value:!0}),lV.WebSocket=void 0;const uV=SG,pV=(0,ah.default)("engine:ws");let hV=class extends uV.Transport{constructor(e){super(e),this.socket=e.websocket,this.socket.on("message",((e,t)=>{const n=t?e:e.toString();pV('received "%s"',n),super.onData(n)})),this.socket.once("close",this.onClose.bind(this)),this.socket.on("error",this.onError.bind(this)),this.writable=!0,this.perMessageDeflate=null}get name(){return"websocket"}get handlesUpgrades(){return!0}get supportsFraming(){return!0}send(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t+1===e.length,i={};n.options&&(i.compress=n.options.compress);const s=e=>{if(e)return this.onError("write error",e.stack);r&&(this.writable=!0,this.emit("drain"))},o=e=>{if(this.perMessageDeflate){("string"==typeof e?Buffer.byteLength(e):e.length)<this.perMessageDeflate.threshold&&(i.compress=!1)}pV('writing "%s"',e),this.socket.send(e,i,s)};n.options&&"string"==typeof n.options.wsPreEncoded?o(n.options.wsPreEncoded):this._canSendPreEncodedFrame(n)?this.socket._sender.sendFrame(n.options.wsPreEncodedFrame,s):this.parser.encodePacket(n,this.supportsBinary,o)}}_canSendPreEncodedFrame(e){var t,n,r;return!this.perMessageDeflate&&"function"==typeof(null===(n=null===(t=this.socket)||void 0===t?void 0:t._sender)||void 0===n?void 0:n.sendFrame)&&void 0!==(null===(r=e.options)||void 0===r?void 0:r.wsPreEncodedFrame)}doClose(e){pV("closing"),this.socket.close(),e&&e()}};lV.WebSocket=hV;var dV={};Object.defineProperty(dV,"__esModule",{value:!0}),dV.WebTransport=void 0;const fV=SG,mV=TG,gV=(0,ah.default)("engine:webtransport");let yV=class extends fV.Transport{constructor(e,t,n){super({_query:{EIO:"4"}}),this.session=e;const r=(0,mV.createPacketEncoderStream)();r.readable.pipeTo(t.writable).catch((()=>{gV("the stream was closed")})),this.writer=r.writable.getWriter(),(async()=>{try{for(;;){const{value:e,done:t}=await n.read();if(t){gV("session is closed");break}gV("received chunk: %o",e),this.onPacket(e)}}catch(e){gV("error while reading: %s",e.message)}})(),e.closed.then((()=>this.onClose())),this.writable=!0}get name(){return"webtransport"}get supportsFraming(){return!0}async send(e){this.writable=!1;try{for(let t=0;t<e.length;t++){const n=e[t];await this.writer.write(n)}}catch(e){gV("error while writing: %s",e.message)}this.writable=!0,this.emit("drain")}doClose(e){gV("closing WebTransport session"),this.session.close(),e&&e()}};dV.WebTransport=yV,Object.defineProperty(xG,"__esModule",{value:!0});const vV=EG,bV=rV,_V=lV,wV=dV;function xV(e){return"string"==typeof e._query.j?new bV.JSONP(e):new vV.Polling(e)}xG.default={polling:xV,websocket:_V.WebSocket,webtransport:wV.WebTransport},xV.upgradesTo=["websocket","webtransport"];var EV={};Object.defineProperty(EV,"__esModule",{value:!0}),EV.Socket=void 0;const SV=p,TV=P,DV=(0,ah.default)("engine:socket");let kV=class extends SV.EventEmitter{constructor(e,t,n,r,i){super(),this._readyState="opening",this.upgrading=!1,this.upgraded=!1,this.writeBuffer=[],this.packetsFn=[],this.sentCallbackFn=[],this.cleanupFn=[],this.id=e,this.server=t,this.request=r,this.protocol=i,r&&(r.websocket&&r.websocket._socket?this.remoteAddress=r.websocket._socket.remoteAddress:this.remoteAddress=r.connection.remoteAddress),this.pingTimeoutTimer=null,this.pingIntervalTimer=null,this.setTransport(n),this.onOpen()}get readyState(){return this._readyState}set readyState(e){DV("readyState updated from %s to %s",this._readyState,e),this._readyState=e}onOpen(){this.readyState="open",this.transport.sid=this.id,this.sendPacket("open",JSON.stringify({sid:this.id,upgrades:this.getAvailableUpgrades(),pingInterval:this.server.opts.pingInterval,pingTimeout:this.server.opts.pingTimeout,maxPayload:this.server.opts.maxHttpBufferSize})),this.server.opts.initialPacket&&this.sendPacket("message",this.server.opts.initialPacket),this.emit("open"),3===this.protocol?this.resetPingTimeout(this.server.opts.pingInterval+this.server.opts.pingTimeout):this.schedulePing()}onPacket(e){if("open"!==this.readyState)return DV("packet received with closed socket");switch(DV(`received packet ${e.type}`),this.emit("packet",e),this.resetPingTimeout(this.server.opts.pingInterval+this.server.opts.pingTimeout),e.type){case"ping":if(3!==this.transport.protocol)return void this.onError("invalid heartbeat direction");DV("got ping"),this.sendPacket("pong"),this.emit("heartbeat");break;case"pong":if(3===this.transport.protocol)return void this.onError("invalid heartbeat direction");DV("got pong"),this.pingIntervalTimer.refresh(),this.emit("heartbeat");break;case"error":this.onClose("parse error");break;case"message":this.emit("data",e.data),this.emit("message",e.data)}}onError(e){DV("transport error"),this.onClose("transport error",e)}schedulePing(){this.pingIntervalTimer=(0,TV.setTimeout)((()=>{DV("writing ping packet - expecting pong within %sms",this.server.opts.pingTimeout),this.sendPacket("ping"),this.resetPingTimeout(this.server.opts.pingTimeout)}),this.server.opts.pingInterval)}resetPingTimeout(e){(0,TV.clearTimeout)(this.pingTimeoutTimer),this.pingTimeoutTimer=(0,TV.setTimeout)((()=>{"closed"!==this.readyState&&this.onClose("ping timeout")}),e)}setTransport(e){const t=this.onError.bind(this),n=this.onPacket.bind(this),r=this.flush.bind(this),i=this.onClose.bind(this,"transport close");this.transport=e,this.transport.once("error",t),this.transport.on("packet",n),this.transport.on("drain",r),this.transport.once("close",i),this.setupSendCallback(),this.cleanupFn.push((function(){e.removeListener("error",t),e.removeListener("packet",n),e.removeListener("drain",r),e.removeListener("close",i)}))}maybeUpgrade(e){DV('might upgrade socket transport from "%s" to "%s"',this.transport.name,e.name),this.upgrading=!0;const t=(0,TV.setTimeout)((()=>{DV("client did not complete upgrade - closing transport"),s(),"open"===e.readyState&&e.close()}),this.server.opts.upgradeTimeout);let n;const r=t=>{"ping"===t.type&&"probe"===t.data?(DV("got probe ping packet, sending pong"),e.send([{type:"pong",data:"probe"}]),this.emit("upgrading",e),clearInterval(n),n=setInterval(i,100)):"upgrade"===t.type&&"closed"!==this.readyState?(DV("got upgrade packet - upgrading"),s(),this.transport.discard(),this.upgraded=!0,this.clearTransport(),this.setTransport(e),this.emit("upgrade",e),this.flush(),"closing"===this.readyState&&e.close((()=>{this.onClose("forced close")}))):(s(),e.close())},i=()=>{"polling"===this.transport.name&&this.transport.writable&&(DV("writing a noop packet to polling for fast upgrade"),this.transport.send([{type:"noop"}]))},s=()=>{this.upgrading=!1,clearInterval(n),(0,TV.clearTimeout)(t),e.removeListener("packet",r),e.removeListener("close",a),e.removeListener("error",o),this.removeListener("close",c)},o=t=>{DV("client did not complete upgrade - %s",t),s(),e.close(),e=null},a=()=>{o("transport closed")},c=()=>{o("socket closed")};e.on("packet",r),e.once("close",a),e.once("error",o),this.once("close",c)}clearTransport(){let e;const t=this.cleanupFn.length;for(let n=0;n<t;n++)e=this.cleanupFn.shift(),e();this.transport.on("error",(function(){DV("error triggered by discarded transport")})),this.transport.close(),(0,TV.clearTimeout)(this.pingTimeoutTimer)}onClose(e,t){"closed"!==this.readyState&&(this.readyState="closed",(0,TV.clearTimeout)(this.pingIntervalTimer),(0,TV.clearTimeout)(this.pingTimeoutTimer),process.nextTick((()=>{this.writeBuffer=[]})),this.packetsFn=[],this.sentCallbackFn=[],this.clearTransport(),this.emit("close",e,t))}setupSendCallback(){const e=()=>{if(this.sentCallbackFn.length>0){const e=this.sentCallbackFn.splice(0,1)[0];if("function"==typeof e)DV("executing send callback"),e(this.transport);else if(Array.isArray(e)){DV("executing batch send callback");const t=e.length;let n=0;for(;n<t;n++)"function"==typeof e[n]&&e[n](this.transport)}}};this.transport.on("drain",e),this.cleanupFn.push((()=>{this.transport.removeListener("drain",e)}))}send(e,t,n){return this.sendPacket("message",e,t,n),this}write(e,t,n){return this.sendPacket("message",e,t,n),this}sendPacket(e,t,n={},r){if("function"==typeof n&&(r=n,n={}),"closing"!==this.readyState&&"closed"!==this.readyState){DV('sending packet "%s" (%s)',e,t),n.compress=!1!==n.compress;const i={type:e,options:n};t&&(i.data=t),this.emit("packetCreate",i),this.writeBuffer.push(i),r&&this.packetsFn.push(r),this.flush()}}flush(){if("closed"!==this.readyState&&this.transport.writable&&this.writeBuffer.length){DV("flushing buffer to transport"),this.emit("flush",this.writeBuffer),this.server.emit("flush",this,this.writeBuffer);const e=this.writeBuffer;this.writeBuffer=[],this.transport.supportsFraming?this.sentCallbackFn.push.apply(this.sentCallbackFn,this.packetsFn):this.sentCallbackFn.push(this.packetsFn),this.packetsFn=[],this.transport.send(e),this.emit("drain"),this.server.emit("drain",this)}}getAvailableUpgrades(){const e=[],t=this.server.upgrades(this.transport.name);let n=0;const r=t.length;for(;n<r;++n){const r=t[n];-1!==this.server.opts.transports.indexOf(r)&&e.push(r)}return e}close(e){if("open"===this.readyState){if(this.readyState="closing",this.writeBuffer.length)return DV("there are %d remaining packets in the buffer, waiting for the 'drain' event",this.writeBuffer.length),void this.once("drain",(()=>{DV("all packets have been sent, closing the transport"),this.closeTransport(e)}));DV("the buffer is empty, closing the transport right away",e),this.closeTransport(e)}}closeTransport(e){DV("closing the transport (discard? %s)",e),e&&this.transport.discard(),this.transport.close(this.onClose.bind(this,"forced close"))}};EV.Socket=kV;var AV={
369
+ !function(e){var t=w,n=function(){};n.prototype.getRandomBytes=function(e){var n=4096,r=this;if((e=e||12)>n)return t.randomBytes(e);var i=parseInt(n/e),s=parseInt(.85*i);if(!s)return t.randomBytes(e);if(null==this.bytesBufferIndex&&(this.bytesBufferIndex=-1),this.bytesBufferIndex==i&&(this.bytesBuffer=null,this.bytesBufferIndex=-1),(-1==this.bytesBufferIndex||this.bytesBufferIndex>s)&&(this.isGeneratingBytes||(this.isGeneratingBytes=!0,t.randomBytes(n,(function(e,t){r.bytesBuffer=t,r.bytesBufferIndex=0,r.isGeneratingBytes=!1}))),-1==this.bytesBufferIndex))return t.randomBytes(e);var o=this.bytesBuffer.slice(e*this.bytesBufferIndex,e*(this.bytesBufferIndex+1));return this.bytesBufferIndex++,o},n.prototype.generateId=function(){var e=Buffer.alloc(15);return e.writeInt32BE?(this.sequenceNumber=this.sequenceNumber+1|0,e.writeInt32BE(this.sequenceNumber,11),t.randomBytes?this.getRandomBytes(12).copy(e):[0,4,8].forEach((function(t){e.writeInt32BE(Math.random()*Math.pow(2,32)|0,t)})),e.toString("base64").replace(/\//g,"_").replace(/\+/g,"-")):Math.abs(Math.random()*Math.random()*Date.now()|0).toString()+Math.abs(Math.random()*Math.random()*Date.now()|0).toString()},e.exports=new n}(SG);var TG=SG.exports,DG={},kG={},AG={},CG={},RG={},OG={};Object.defineProperty(OG,"__esModule",{value:!0}),OG.ERROR_PACKET=OG.PACKET_TYPES_REVERSE=OG.PACKET_TYPES=void 0;const LG=Object.create(null);OG.PACKET_TYPES=LG,LG.open="0",LG.close="1",LG.ping="2",LG.pong="3",LG.message="4",LG.upgrade="5",LG.noop="6";const IG=Object.create(null);OG.PACKET_TYPES_REVERSE=IG,Object.keys(LG).forEach((e=>{IG[LG[e]]=e}));OG.ERROR_PACKET={type:"error",data:"parser error"},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.encodePacket=void 0,e.encodePacketToBinary=function(t,i){if(t.data instanceof ArrayBuffer||ArrayBuffer.isView(t.data))return i(n(t.data,!1));(0,e.encodePacket)(t,!0,(e=>{r||(r=new TextEncoder),i(r.encode(e))}))};const t=OG;e.encodePacket=({type:e,data:r},i,s)=>r instanceof ArrayBuffer||ArrayBuffer.isView(r)?s(i?r:"b"+n(r,!0).toString("base64")):s(t.PACKET_TYPES[e]+(r||""));const n=(e,t)=>Buffer.isBuffer(e)||e instanceof Uint8Array&&!t?e:e instanceof ArrayBuffer?Buffer.from(e):Buffer.from(e.buffer,e.byteOffset,e.byteLength);let r}(RG);var PG={};Object.defineProperty(PG,"__esModule",{value:!0}),PG.decodePacket=void 0;const NG=OG;PG.decodePacket=(e,t)=>{if("string"!=typeof e)return{type:"message",data:jG(e,t)};const n=e.charAt(0);if("b"===n){const n=Buffer.from(e.substring(1),"base64");return{type:"message",data:jG(n,t)}}return NG.PACKET_TYPES_REVERSE[n]?e.length>1?{type:NG.PACKET_TYPES_REVERSE[n],data:e.substring(1)}:{type:NG.PACKET_TYPES_REVERSE[n]}:NG.ERROR_PACKET};const jG=(e,t)=>"arraybuffer"===t?e instanceof ArrayBuffer?e:Buffer.isBuffer(e)?e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength):e.buffer:Buffer.isBuffer(e)?e:Buffer.from(e);!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decodePayload=e.decodePacket=e.encodePayload=e.encodePacket=e.protocol=void 0,e.createPacketEncoderStream=function(){return new TransformStream({transform(e,n){(0,t.encodePacketToBinary)(e,(t=>{const r=t.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const e=new DataView(i.buffer);e.setUint8(0,126),e.setUint16(1,r)}else{i=new Uint8Array(9);const e=new DataView(i.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(r))}e.data&&"string"!=typeof e.data&&(i[0]|=128),n.enqueue(i),n.enqueue(t)}))}})},e.createPacketDecoderStream=function(e,t){s||(s=new TextDecoder);const i=[];let c=0,l=-1,u=!1;return new TransformStream({transform(p,h){for(i.push(p);;){if(0===c){if(o(i)<1)break;const e=a(i,1);u=!(128&~e[0]),l=127&e[0],c=l<126?3:126===l?1:2}else if(1===c){if(o(i)<2)break;const e=a(i,2);l=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),c=3}else if(2===c){if(o(i)<8)break;const e=a(i,8),t=new DataView(e.buffer,e.byteOffset,e.length),n=t.getUint32(0);if(n>Math.pow(2,21)-1){h.enqueue(r.ERROR_PACKET);break}l=n*Math.pow(2,32)+t.getUint32(4),c=3}else{if(o(i)<l)break;const e=a(i,l);h.enqueue((0,n.decodePacket)(u?e:s.decode(e),t)),c=0}if(0===l||l>e){h.enqueue(r.ERROR_PACKET);break}}}})};const t=RG;Object.defineProperty(e,"encodePacket",{enumerable:!0,get:function(){return t.encodePacket}});const n=PG;Object.defineProperty(e,"decodePacket",{enumerable:!0,get:function(){return n.decodePacket}});const r=OG,i=String.fromCharCode(30);e.encodePayload=(e,n)=>{const r=e.length,s=new Array(r);let o=0;e.forEach(((e,a)=>{(0,t.encodePacket)(e,!1,(e=>{s[a]=e,++o===r&&n(s.join(i))}))}))};let s;function o(e){return e.reduce(((e,t)=>e+t.length),0)}function a(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}e.decodePayload=(e,t)=>{const r=e.split(i),s=[];for(let e=0;e<r.length;e++){const i=(0,n.decodePacket)(r[e],t);if(s.push(i),"error"===i.type)break}return s},e.protocol=4}(CG);var FG,BG,MG,UG={},qG=String.fromCharCode;
370
+ /*! https://mths.be/utf8js v2.1.2 by @mathias */function HG(e){for(var t,n,r=[],i=0,s=e.length;i<s;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<s?56320==(64512&(n=e.charCodeAt(i++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),i--):r.push(t);return r}function $G(e,t){if(e>=55296&&e<=57343){if(t)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function zG(e,t){return qG(e>>t&63|128)}function WG(e,t){if(!(4294967168&e))return qG(e);var n="";return 4294965248&e?4294901760&e?4292870144&e||(n=qG(e>>18&7|240),n+=zG(e,12),n+=zG(e,6)):($G(e,t)||(e=65533),n=qG(e>>12&15|224),n+=zG(e,6)):n=qG(e>>6&31|192),n+=qG(63&e|128)}function GG(){if(MG>=BG)throw Error("Invalid byte index");var e=255&FG[MG];if(MG++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function VG(e){var t,n;if(MG>BG)throw Error("Invalid byte index");if(MG==BG)return!1;if(t=255&FG[MG],MG++,!(128&t))return t;if(192==(224&t)){if((n=(31&t)<<6|GG())>=128)return n;throw Error("Invalid continuation byte")}if(224==(240&t)){if((n=(15&t)<<12|GG()<<6|GG())>=2048)return $G(n,e)?n:65533;throw Error("Invalid continuation byte")}if(240==(248&t)&&(n=(7&t)<<18|GG()<<12|GG()<<6|GG())>=65536&&n<=1114111)return n;throw Error("Invalid UTF-8 detected")}var KG={version:"2.1.2",encode:function(e,t){for(var n=!1!==(t=t||{}).strict,r=HG(e),i=r.length,s=-1,o="";++s<i;)o+=WG(r[s],n);return o},decode:function(e,t){var n=!1!==(t=t||{}).strict;FG=HG(e),BG=FG.length,MG=0;for(var r,i=[];!1!==(r=VG(n));)i.push(r);return function(e){for(var t,n=e.length,r=-1,i="";++r<n;)(t=e[r])>65535&&(i+=qG((t-=65536)>>>10&1023|55296),t=56320|1023&t),i+=qG(t);return i}(i)}};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.decodePayloadAsBinary=e.encodePayloadAsBinary=e.decodePayload=e.encodePayload=e.decodeBase64Packet=e.decodePacket=e.encodeBase64Packet=e.encodePacket=e.packets=e.protocol=void 0;var t=KG;e.protocol=3;e.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6};var n=Object.keys(e.packets),r={type:"error",data:"parser error"};const i=Buffer.concat([]);function s(n,r,i,s){if("function"==typeof r&&(s=r,r=null),"function"==typeof i&&(s=i,i=null),Buffer.isBuffer(n.data))return o(n,r,s);if(n.data&&(n.data.buffer||n.data)instanceof ArrayBuffer)return o({type:n.type,data:d(n.data)},r,s);var a=e.packets[n.type];return void 0!==n.data&&(a+=i?t.encode(String(n.data),{strict:!1}):String(n.data)),s(""+a)}function o(t,n,r){if(!n)return a(t,r);var i=t.data,s=Buffer.allocUnsafe(1);return s[0]=e.packets[t.type],r(Buffer.concat([s,i]))}function a(t,n){var r=Buffer.isBuffer(t.data)?t.data:d(t.data),i="b"+e.packets[t.type];return n(i+=r.toString("base64"))}function c(e,i,s){if(void 0===e)return r;var o;if("string"==typeof e)return"b"===(o=e.charAt(0))?l(e.slice(1),i):s&&!1===(e=function(e){try{e=t.decode(e,{strict:!1})}catch(e){return!1}return e}(e))?r:Number(o)==o&&n[o]?e.length>1?{type:n[o],data:e.slice(1)}:{type:n[o]}:r;if("arraybuffer"===i){var a=new Uint8Array(e);return o=a[0],{type:n[o],data:a.buffer.slice(1)}}return e instanceof ArrayBuffer&&(e=d(e)),o=e[0],{type:n[o],data:e.slice(1)}}function l(e,t){var r=n[e.charAt(0)],i=Buffer.from(e.slice(1),"base64");if("arraybuffer"===t){for(var s=new Uint8Array(i.length),o=0;o<s.length;o++)s[o]=i[o];i=s.buffer}return{type:r,data:i}}function u(e,t,n){const r=new Array(e.length);let i=0;for(let s=0;s<e.length;s++)t(e[s],((t,o)=>{r[s]=o,++i===e.length&&n(null,r)}))}function p(e){for(var t="",n=0,r=e.length;n<r;n++)t+=String.fromCharCode(e[n]);return t}function h(e){for(var t=Buffer.allocUnsafe(e.length),n=0,r=e.length;n<r;n++)t.writeUInt8(e.charCodeAt(n),n);return t}function d(e){var t=e.byteLength||e.length,n=e.byteOffset||0;return Buffer.from(e.buffer||e,n,t)}function f(e,t){if(!e.length)return t(i);u(e,m,(function(e,n){return t(Buffer.concat(n))}))}function m(e,t){s(e,!0,!0,(function(e){var n,r=""+e.length;if("string"==typeof e){(n=Buffer.allocUnsafe(r.length+2))[0]=0;for(var i=0;i<r.length;i++)n[i+1]=parseInt(r[i],10);return n[n.length-1]=255,t(null,Buffer.concat([n,h(e)]))}for((n=Buffer.allocUnsafe(r.length+2))[0]=1,i=0;i<r.length;i++)n[i+1]=parseInt(r[i],10);n[n.length-1]=255,t(null,Buffer.concat([n,e]))}))}function g(e,t,n){"function"==typeof t&&(n=t,t=null);for(var i,s=e,o=[];s.length>0;){var a="",l=0===s[0];for(i=1;255!==s[i];i++){if(a.length>310)return n(r,0,1);a+=""+s[i]}s=s.slice(a.length+1);var u=parseInt(a,10),h=s.slice(1,u+1);l&&(h=p(h)),o.push(h),s=s.slice(u+1)}var d=o.length;for(i=0;i<d;i++){n(c(o[i],t,!0),i,d)}}e.encodePacket=s,e.encodeBase64Packet=a,e.decodePacket=c,e.decodeBase64Packet=l,e.encodePayload=function(e,t,n){if("function"==typeof t&&(n=t,t=null),t&&(e=>{for(const t of e)if(t.data instanceof ArrayBuffer||ArrayBuffer.isView(t.data))return!0;return!1})(e))return f(e,n);if(!e.length)return n("0:");u(e,(function(e,n){s(e,t,!1,(function(e){n(null,function(e){return e.length+":"+e}(e))}))}),(function(e,t){return n(t.join(""))}))},e.decodePayload=function(e,t,n){if("string"!=typeof e)return g(e,t,n);if("function"==typeof t&&(n=t,t=null),""===e)return n(r,0,1);for(var i,s,o,a="",l=0,u=e.length;l<u;l++){var p=e.charAt(l);if(":"===p){if(""===a||a!=(i=Number(a)))return n(r,0,1);if(a!=(s=e.slice(l+1,l+1+i)).length)return n(r,0,1);if(s.length){if(o=c(s,t,!1),r.type===o.type&&r.data===o.data)return n(r,0,1);if(!1===n(o,l+i,u))return}l+=i,a=""}else a+=p}return""!==a?n(r,0,1):void 0},e.encodePayloadAsBinary=f,e.decodePayloadAsBinary=g}(UG),Object.defineProperty(AG,"__esModule",{value:!0}),AG.Transport=void 0;const YG=p,ZG=CG,QG=UG,JG=(0,ah.default)("engine:transport");function XG(){}let eV=class extends YG.EventEmitter{constructor(e){super(),this.writable=!1,this._readyState="open",this.discarded=!1,this.protocol="4"===e._query.EIO?4:3,this.parser=4===this.protocol?ZG:QG,this.supportsBinary=!(e._query&&e._query.b64)}get readyState(){return this._readyState}set readyState(e){JG("readyState updated from %s to %s (%s)",this._readyState,e,this.name),this._readyState=e}discard(){this.discarded=!0}onRequest(e){JG("setting request"),this.req=e}close(e){"closed"!==this.readyState&&"closing"!==this.readyState&&(this.readyState="closing",this.doClose(e||XG))}onError(e,t){if(this.listeners("error").length){const n=new Error(e);n.type="TransportError",n.description=t,this.emit("error",n)}else JG("ignored transport error %s (%s)",e,t)}onPacket(e){this.emit("packet",e)}onData(e){this.onPacket(this.parser.decodePacket(e))}onClose(){this.readyState="closed",this.emit("close")}};AG.Transport=eV,Object.defineProperty(kG,"__esModule",{value:!0}),kG.Polling=void 0;const tV=AG,nV=T,rV=KM,iV=(0,ah.default)("engine:polling"),sV={gzip:nV.createGzip,deflate:nV.createDeflate};let oV=class extends tV.Transport{constructor(e){super(e),this.closeTimeout=3e4}get name(){return"polling"}get supportsFraming(){return!1}onRequest(e){const t=e.res;e.res=null,"GET"===e.method?this.onPollRequest(e,t):"POST"===e.method?this.onDataRequest(e,t):(t.writeHead(500),t.end())}onPollRequest(e,t){if(this.req)return iV("request overlap"),this.onError("overlap from client"),t.writeHead(400),void t.end();iV("setting request"),this.req=e,this.res=t;const n=()=>{this.onError("poll connection closed prematurely")};e.cleanup=()=>{e.removeListener("close",n),this.req=this.res=null},e.on("close",n),this.writable=!0,this.emit("drain"),this.writable&&this.shouldClose&&(iV("triggering empty send to append close packet"),this.send([{type:"noop"}]))}onDataRequest(e,t){if(this.dataReq)return this.onError("data request overlap from client"),t.writeHead(400),void t.end();const n="application/octet-stream"===e.headers["content-type"];if(n&&4===this.protocol)return this.onError("invalid content");this.dataReq=e,this.dataRes=t;let r=n?Buffer.concat([]):"";const i=()=>{e.removeListener("data",o),e.removeListener("end",a),e.removeListener("close",s),this.dataReq=this.dataRes=r=null},s=()=>{i(),this.onError("data request connection closed prematurely")},o=e=>{let s;n?(r=Buffer.concat([r,e]),s=r.length):(r+=e,s=Buffer.byteLength(r)),s>this.maxHttpBufferSize&&(t.writeHead(413).end(),i())},a=()=>{this.onData(r);t.writeHead(200,this.headers(e,{"Content-Type":"text/html","Content-Length":2})),t.end("ok"),i()};e.on("close",s),n||e.setEncoding("utf8"),e.on("data",o),e.on("end",a)}onData(e){iV('received "%s"',e);const t=e=>{if("close"===e.type)return iV("got xhr close packet"),this.onClose(),!1;this.onPacket(e)};3===this.protocol?this.parser.decodePayload(e,t):this.parser.decodePayload(e).forEach(t)}onClose(){this.writable&&this.send([{type:"noop"}]),super.onClose()}send(e){this.writable=!1,this.shouldClose&&(iV("appending close packet to payload"),e.push({type:"close"}),this.shouldClose(),this.shouldClose=null);const t=t=>{const n=e.some((e=>e.options&&e.options.compress));this.write(t,{compress:n})};3===this.protocol?this.parser.encodePayload(e,this.supportsBinary,t):this.parser.encodePayload(e,t)}write(e,t){iV('writing "%s"',e),this.doWrite(e,t,(()=>{this.req.cleanup()}))}doWrite(e,t,n){const r="string"==typeof e,i={"Content-Type":r?"text/plain; charset=UTF-8":"application/octet-stream"},s=e=>{i["Content-Length"]="string"==typeof e?Buffer.byteLength(e):e.length,this.res.writeHead(200,this.headers(this.req,i)),this.res.end(e),n()};if(!this.httpCompression||!t.compress)return void s(e);if((r?Buffer.byteLength(e):e.length)<this.httpCompression.threshold)return void s(e);const o=rV(this.req).encodings(["gzip","deflate"]);o?this.compress(e,o,((e,t)=>{if(e)return this.res.writeHead(500),this.res.end(),void n(e);i["Content-Encoding"]=o,s(t)})):s(e)}compress(e,t,n){iV("compressing");const r=[];let i=0;sV[t](this.httpCompression).on("error",n).on("data",(function(e){r.push(e),i+=e.length})).on("end",(function(){n(null,Buffer.concat(r,i))})).end(e)}doClose(e){let t;iV("closing"),this.dataReq&&(iV("aborting ongoing data request"),this.dataReq.destroy());const n=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(iV("transport writable - closing right away"),this.send([{type:"close"}]),n()):this.discarded?(iV("transport discarded - closing right away"),n()):(iV("transport not writable - buffering orderly close"),this.shouldClose=n,t=setTimeout(n,this.closeTimeout))}headers(e,t){t=t||{};const n=e.headers["user-agent"];return n&&(~n.indexOf(";MSIE")||~n.indexOf("Trident/"))&&(t["X-XSS-Protection"]="0"),t["cache-control"]="no-store",this.emit("headers",t,e),t}};kG.Polling=oV;var aV={};Object.defineProperty(aV,"__esModule",{value:!0}),aV.JSONP=void 0;const cV=kG,lV=L,uV=/\\\\n/g,pV=/(\\)?\\n/g;class hV extends cV.Polling{constructor(e){super(e),this.head="___eio["+(e._query.j||"").replace(/[^0-9]/g,"")+"](",this.foot=");"}onData(e){"string"==typeof(e=lV.parse(e).d)&&(e=e.replace(pV,(function(e,t){return t?e:"\n"})),super.onData(e.replace(uV,"\\n")))}doWrite(e,t,n){const r=JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");e=this.head+r+this.foot,super.doWrite(e,t,n)}}aV.JSONP=hV;var dV={};Object.defineProperty(dV,"__esModule",{value:!0}),dV.WebSocket=void 0;const fV=AG,mV=(0,ah.default)("engine:ws");let gV=class extends fV.Transport{constructor(e){super(e),this.socket=e.websocket,this.socket.on("message",((e,t)=>{const n=t?e:e.toString();mV('received "%s"',n),super.onData(n)})),this.socket.once("close",this.onClose.bind(this)),this.socket.on("error",this.onError.bind(this)),this.writable=!0,this.perMessageDeflate=null}get name(){return"websocket"}get handlesUpgrades(){return!0}get supportsFraming(){return!0}send(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t+1===e.length,i={};n.options&&(i.compress=n.options.compress);const s=e=>{if(e)return this.onError("write error",e.stack);r&&(this.writable=!0,this.emit("drain"))},o=e=>{if(this.perMessageDeflate){("string"==typeof e?Buffer.byteLength(e):e.length)<this.perMessageDeflate.threshold&&(i.compress=!1)}mV('writing "%s"',e),this.socket.send(e,i,s)};n.options&&"string"==typeof n.options.wsPreEncoded?o(n.options.wsPreEncoded):this._canSendPreEncodedFrame(n)?this.socket._sender.sendFrame(n.options.wsPreEncodedFrame,s):this.parser.encodePacket(n,this.supportsBinary,o)}}_canSendPreEncodedFrame(e){var t,n,r;return!this.perMessageDeflate&&"function"==typeof(null===(n=null===(t=this.socket)||void 0===t?void 0:t._sender)||void 0===n?void 0:n.sendFrame)&&void 0!==(null===(r=e.options)||void 0===r?void 0:r.wsPreEncodedFrame)}doClose(e){mV("closing"),this.socket.close(),e&&e()}};dV.WebSocket=gV;var yV={};Object.defineProperty(yV,"__esModule",{value:!0}),yV.WebTransport=void 0;const vV=AG,bV=CG,_V=(0,ah.default)("engine:webtransport");let wV=class extends vV.Transport{constructor(e,t,n){super({_query:{EIO:"4"}}),this.session=e;const r=(0,bV.createPacketEncoderStream)();r.readable.pipeTo(t.writable).catch((()=>{_V("the stream was closed")})),this.writer=r.writable.getWriter(),(async()=>{try{for(;;){const{value:e,done:t}=await n.read();if(t){_V("session is closed");break}_V("received chunk: %o",e),this.onPacket(e)}}catch(e){_V("error while reading: %s",e.message)}})(),e.closed.then((()=>this.onClose())),this.writable=!0}get name(){return"webtransport"}get supportsFraming(){return!0}async send(e){this.writable=!1;try{for(let t=0;t<e.length;t++){const n=e[t];await this.writer.write(n)}}catch(e){_V("error while writing: %s",e.message)}this.writable=!0,this.emit("drain")}doClose(e){_V("closing WebTransport session"),this.session.close(),e&&e()}};yV.WebTransport=wV,Object.defineProperty(DG,"__esModule",{value:!0});const xV=kG,EV=aV,SV=dV,TV=yV;function DV(e){return"string"==typeof e._query.j?new EV.JSONP(e):new xV.Polling(e)}DG.default={polling:DV,websocket:SV.WebSocket,webtransport:TV.WebTransport},DV.upgradesTo=["websocket","webtransport"];var kV={};Object.defineProperty(kV,"__esModule",{value:!0}),kV.Socket=void 0;const AV=p,CV=P,RV=(0,ah.default)("engine:socket");let OV=class extends AV.EventEmitter{constructor(e,t,n,r,i){super(),this._readyState="opening",this.upgrading=!1,this.upgraded=!1,this.writeBuffer=[],this.packetsFn=[],this.sentCallbackFn=[],this.cleanupFn=[],this.id=e,this.server=t,this.request=r,this.protocol=i,r&&(r.websocket&&r.websocket._socket?this.remoteAddress=r.websocket._socket.remoteAddress:this.remoteAddress=r.connection.remoteAddress),this.pingTimeoutTimer=null,this.pingIntervalTimer=null,this.setTransport(n),this.onOpen()}get readyState(){return this._readyState}set readyState(e){RV("readyState updated from %s to %s",this._readyState,e),this._readyState=e}onOpen(){this.readyState="open",this.transport.sid=this.id,this.sendPacket("open",JSON.stringify({sid:this.id,upgrades:this.getAvailableUpgrades(),pingInterval:this.server.opts.pingInterval,pingTimeout:this.server.opts.pingTimeout,maxPayload:this.server.opts.maxHttpBufferSize})),this.server.opts.initialPacket&&this.sendPacket("message",this.server.opts.initialPacket),this.emit("open"),3===this.protocol?this.resetPingTimeout(this.server.opts.pingInterval+this.server.opts.pingTimeout):this.schedulePing()}onPacket(e){if("open"!==this.readyState)return RV("packet received with closed socket");switch(RV(`received packet ${e.type}`),this.emit("packet",e),this.resetPingTimeout(this.server.opts.pingInterval+this.server.opts.pingTimeout),e.type){case"ping":if(3!==this.transport.protocol)return void this.onError("invalid heartbeat direction");RV("got ping"),this.sendPacket("pong"),this.emit("heartbeat");break;case"pong":if(3===this.transport.protocol)return void this.onError("invalid heartbeat direction");RV("got pong"),this.pingIntervalTimer.refresh(),this.emit("heartbeat");break;case"error":this.onClose("parse error");break;case"message":this.emit("data",e.data),this.emit("message",e.data)}}onError(e){RV("transport error"),this.onClose("transport error",e)}schedulePing(){this.pingIntervalTimer=(0,CV.setTimeout)((()=>{RV("writing ping packet - expecting pong within %sms",this.server.opts.pingTimeout),this.sendPacket("ping"),this.resetPingTimeout(this.server.opts.pingTimeout)}),this.server.opts.pingInterval)}resetPingTimeout(e){(0,CV.clearTimeout)(this.pingTimeoutTimer),this.pingTimeoutTimer=(0,CV.setTimeout)((()=>{"closed"!==this.readyState&&this.onClose("ping timeout")}),e)}setTransport(e){const t=this.onError.bind(this),n=this.onPacket.bind(this),r=this.flush.bind(this),i=this.onClose.bind(this,"transport close");this.transport=e,this.transport.once("error",t),this.transport.on("packet",n),this.transport.on("drain",r),this.transport.once("close",i),this.setupSendCallback(),this.cleanupFn.push((function(){e.removeListener("error",t),e.removeListener("packet",n),e.removeListener("drain",r),e.removeListener("close",i)}))}maybeUpgrade(e){RV('might upgrade socket transport from "%s" to "%s"',this.transport.name,e.name),this.upgrading=!0;const t=(0,CV.setTimeout)((()=>{RV("client did not complete upgrade - closing transport"),s(),"open"===e.readyState&&e.close()}),this.server.opts.upgradeTimeout);let n;const r=t=>{"ping"===t.type&&"probe"===t.data?(RV("got probe ping packet, sending pong"),e.send([{type:"pong",data:"probe"}]),this.emit("upgrading",e),clearInterval(n),n=setInterval(i,100)):"upgrade"===t.type&&"closed"!==this.readyState?(RV("got upgrade packet - upgrading"),s(),this.transport.discard(),this.upgraded=!0,this.clearTransport(),this.setTransport(e),this.emit("upgrade",e),this.flush(),"closing"===this.readyState&&e.close((()=>{this.onClose("forced close")}))):(s(),e.close())},i=()=>{"polling"===this.transport.name&&this.transport.writable&&(RV("writing a noop packet to polling for fast upgrade"),this.transport.send([{type:"noop"}]))},s=()=>{this.upgrading=!1,clearInterval(n),(0,CV.clearTimeout)(t),e.removeListener("packet",r),e.removeListener("close",a),e.removeListener("error",o),this.removeListener("close",c)},o=t=>{RV("client did not complete upgrade - %s",t),s(),e.close(),e=null},a=()=>{o("transport closed")},c=()=>{o("socket closed")};e.on("packet",r),e.once("close",a),e.once("error",o),this.once("close",c)}clearTransport(){let e;const t=this.cleanupFn.length;for(let n=0;n<t;n++)e=this.cleanupFn.shift(),e();this.transport.on("error",(function(){RV("error triggered by discarded transport")})),this.transport.close(),(0,CV.clearTimeout)(this.pingTimeoutTimer)}onClose(e,t){"closed"!==this.readyState&&(this.readyState="closed",(0,CV.clearTimeout)(this.pingIntervalTimer),(0,CV.clearTimeout)(this.pingTimeoutTimer),process.nextTick((()=>{this.writeBuffer=[]})),this.packetsFn=[],this.sentCallbackFn=[],this.clearTransport(),this.emit("close",e,t))}setupSendCallback(){const e=()=>{if(this.sentCallbackFn.length>0){const e=this.sentCallbackFn.splice(0,1)[0];if("function"==typeof e)RV("executing send callback"),e(this.transport);else if(Array.isArray(e)){RV("executing batch send callback");const t=e.length;let n=0;for(;n<t;n++)"function"==typeof e[n]&&e[n](this.transport)}}};this.transport.on("drain",e),this.cleanupFn.push((()=>{this.transport.removeListener("drain",e)}))}send(e,t,n){return this.sendPacket("message",e,t,n),this}write(e,t,n){return this.sendPacket("message",e,t,n),this}sendPacket(e,t,n={},r){if("function"==typeof n&&(r=n,n={}),"closing"!==this.readyState&&"closed"!==this.readyState){RV('sending packet "%s" (%s)',e,t),n.compress=!1!==n.compress;const i={type:e,options:n};t&&(i.data=t),this.emit("packetCreate",i),this.writeBuffer.push(i),r&&this.packetsFn.push(r),this.flush()}}flush(){if("closed"!==this.readyState&&this.transport.writable&&this.writeBuffer.length){RV("flushing buffer to transport"),this.emit("flush",this.writeBuffer),this.server.emit("flush",this,this.writeBuffer);const e=this.writeBuffer;this.writeBuffer=[],this.transport.supportsFraming?this.sentCallbackFn.push.apply(this.sentCallbackFn,this.packetsFn):this.sentCallbackFn.push(this.packetsFn),this.packetsFn=[],this.transport.send(e),this.emit("drain"),this.server.emit("drain",this)}}getAvailableUpgrades(){const e=[],t=this.server.upgrades(this.transport.name);let n=0;const r=t.length;for(;n<r;++n){const r=t[n];-1!==this.server.opts.transports.indexOf(r)&&e.push(r)}return e}close(e){if("open"===this.readyState){if(this.readyState="closing",this.writeBuffer.length)return RV("there are %d remaining packets in the buffer, waiting for the 'drain' event",this.writeBuffer.length),void this.once("drain",(()=>{RV("all packets have been sent, closing the transport"),this.closeTransport(e)}));RV("the buffer is empty, closing the transport right away",e),this.closeTransport(e)}}closeTransport(e){RV("closing the transport (discard? %s)",e),e&&this.transport.discard(),this.transport.close(this.onClose.bind(this,"forced close"))}};kV.Socket=OV;var LV={
371
371
  /*!
372
372
  * cookie
373
373
  * Copyright(c) 2012-2014 Roman Shtylman
374
374
  * Copyright(c) 2015 Douglas Christopher Wilson
375
375
  * MIT Licensed
376
376
  */
377
- parse:function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var n={},r=t||{},i=e.split(OV),s=r.decode||CV,o=0;o<i.length;o++){var a=i[o],c=a.indexOf("=");if(!(c<0)){var l=a.substr(0,c).trim(),u=a.substr(++c,a.length).trim();'"'==u[0]&&(u=u.slice(1,-1)),null==n[l]&&(n[l]=IV(u,s))}}return n},serialize:function(e,t,n){var r=n||{},i=r.encode||RV;if("function"!=typeof i)throw new TypeError("option encode is invalid");if(!LV.test(e))throw new TypeError("argument name is invalid");var s=i(t);if(s&&!LV.test(s))throw new TypeError("argument val is invalid");var o=e+"="+s;if(null!=r.maxAge){var a=r.maxAge-0;if(isNaN(a)||!isFinite(a))throw new TypeError("option maxAge is invalid");o+="; Max-Age="+Math.floor(a)}if(r.domain){if(!LV.test(r.domain))throw new TypeError("option domain is invalid");o+="; Domain="+r.domain}if(r.path){if(!LV.test(r.path))throw new TypeError("option path is invalid");o+="; Path="+r.path}if(r.expires){if("function"!=typeof r.expires.toUTCString)throw new TypeError("option expires is invalid");o+="; Expires="+r.expires.toUTCString()}r.httpOnly&&(o+="; HttpOnly");r.secure&&(o+="; Secure");if(r.sameSite){switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return o}},CV=decodeURIComponent,RV=encodeURIComponent,OV=/; */,LV=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function IV(e,t){try{return t(e)}catch(t){return e}}var PV,NV,jV,FV,BV,MV,UV={exports:{}},qV={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}},HV={exports:{}},$V={exports:{}};function zV(){if(jV)return $V.exports;jV=1;const e="function"==typeof __webpack_require__?__non_webpack_require__:rF;return"function"==typeof e.addon?$V.exports=e.addon.bind(e):$V.exports=function(){if(NV)return PV;NV=1;var e=s,t=o,n=a,r="function"==typeof __webpack_require__?__non_webpack_require__:rF,i=process.config&&process.config.variables||{},c=!!process.env.PREBUILDS_ONLY,l=process.versions.modules,u=process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE||"undefined"!=typeof window&&window.process&&"renderer"===window.process.type?"electron":process.versions&&process.versions.nw?"node-webkit":"node",p=process.env.npm_config_arch||n.arch(),h=process.env.npm_config_platform||n.platform(),d=process.env.LIBC||(function(t){return"linux"===t&&e.existsSync("/etc/alpine-release")}(h)?"musl":"glibc"),f=process.env.ARM_VERSION||("arm64"===p?"8":i.arm_version)||"",m=(process.versions.uv||"").split(".")[0];function g(e){return r(g.resolve(e))}function y(t){try{return e.readdirSync(t)}catch(e){return[]}}function v(e,n){var r=y(e).filter(n);return r[0]&&t.join(e,r[0])}function b(e){return/\.node$/.test(e)}function _(e){var t=e.split("-");if(2===t.length){var n=t[0],r=t[1].split("+");if(n&&r.length&&r.every(Boolean))return{name:e,platform:n,architectures:r}}}function w(e,t){return function(n){return null!=n&&n.platform===e&&n.architectures.includes(t)}}function x(e,t){return e.architectures.length-t.architectures.length}function E(e){var t=e.split("."),n={file:e,specificity:0};if("node"===t.pop()){for(var r=0;r<t.length;r++){var i=t[r];if("node"===i||"electron"===i||"node-webkit"===i)n.runtime=i;else if("napi"===i)n.napi=!0;else if("abi"===i.slice(0,3))n.abi=i.slice(3);else if("uv"===i.slice(0,2))n.uv=i.slice(2);else if("armv"===i.slice(0,4))n.armv=i.slice(4);else{if("glibc"!==i&&"musl"!==i)continue;n.libc=i}n.specificity++}return n}}function S(e,t){return function(n){return!(null==n||n.runtime&&n.runtime!==e&&!function(e){return"node"===e.runtime&&e.napi}(n)||n.abi&&n.abi!==t&&!n.napi||n.uv&&n.uv!==m||n.armv&&n.armv!==f||n.libc&&n.libc!==d)}}function T(e){return function(t,n){return t.runtime!==n.runtime?t.runtime===e?-1:1:t.abi!==n.abi?t.abi?-1:1:t.specificity!==n.specificity?t.specificity>n.specificity?-1:1:0}}return PV=g,g.resolve=g.path=function(e){e=t.resolve(e||".");try{var n=r(t.join(e,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[n+"_PREBUILD"]&&(e=process.env[n+"_PREBUILD"])}catch(e){}if(!c){var i=v(t.join(e,"build/Release"),b);if(i)return i;var s=v(t.join(e,"build/Debug"),b);if(s)return s}var o=D(e);if(o)return o;var a=D(t.dirname(process.execPath));if(a)return a;var g=["platform="+h,"arch="+p,"runtime="+u,"abi="+l,"uv="+m,f?"armv="+f:"","libc="+d,"node="+process.versions.node,process.versions.electron?"electron="+process.versions.electron:"","function"==typeof __webpack_require__?"webpack=true":""].filter(Boolean).join(" ");throw new Error("No native build was found for "+g+"\n loaded from: "+e+"\n");function D(e){var n=y(t.join(e,"prebuilds")).map(_).filter(w(h,p)).sort(x)[0];if(n){var r=t.join(e,"prebuilds",n.name),i=y(r).map(E).filter(S(u,l)).sort(T(u))[0];return i?t.join(r,i.file):void 0}}},g.parseTags=E,g.matchTags=S,g.compareTags=T,g.parseTuple=_,g.matchTuple=w,g.compareTuples=x,PV}(),$V.exports}const{EMPTY_BUFFER:WV}=qV,GV=Buffer[Symbol.species];function VV(e,t,n,r,i){for(let s=0;s<i;s++)n[r+s]=e[s]^t[3&s]}function KV(e,t){for(let n=0;n<e.length;n++)e[n]^=t[3&n]}if(UV.exports={concat:function(e,t){if(0===e.length)return WV;if(1===e.length)return e[0];const n=Buffer.allocUnsafe(t);let r=0;for(let t=0;t<e.length;t++){const i=e[t];n.set(i,r),r+=i.length}return r<t?new GV(n.buffer,n.byteOffset,r):n},mask:VV,toArrayBuffer:function(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)},toBuffer:function e(t){if(e.readOnly=!0,Buffer.isBuffer(t))return t;let n;return t instanceof ArrayBuffer?n=new GV(t):ArrayBuffer.isView(t)?n=new GV(t.buffer,t.byteOffset,t.byteLength):(n=Buffer.from(t),e.readOnly=!1),n},unmask:KV},!process.env.WS_NO_BUFFER_UTIL)try{const e=function(){if(MV)return HV.exports;MV=1;try{HV.exports=zV()(__dirname)}catch(e){HV.exports=(BV||(BV=1,FV={mask:(e,t,n,r,i)=>{for(var s=0;s<i;s++)n[r+s]=e[s]^t[3&s]},unmask:(e,t)=>{const n=e.length;for(var r=0;r<n;r++)e[r]^=t[3&r]}}),FV)}return HV.exports}();UV.exports.mask=function(t,n,r,i,s){s<48?VV(t,n,r,i,s):e.mask(t,n,r,i,s)},UV.exports.unmask=function(t,n){t.length<32?KV(t,n):e.unmask(t,n)}}catch(e){}var YV=UV.exports;const ZV=Symbol("kDone"),QV=Symbol("kRun");const JV=T,XV=YV,eK=class{constructor(e){this[ZV]=()=>{this.pending--,this[QV]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[QV]()}[QV](){if(this.pending!==this.concurrency&&this.jobs.length){const e=this.jobs.shift();this.pending++,e(this[ZV])}}},{kStatusCode:tK}=qV,nK=Buffer[Symbol.species],rK=Buffer.from([0,0,255,255]),iK=Symbol("permessage-deflate"),sK=Symbol("total-length"),oK=Symbol("callback"),aK=Symbol("buffers"),cK=Symbol("error");let lK;var uK=class{constructor(e,t,n){if(this._maxPayload=0|n,this._options=e||{},this._threshold=void 0!==this._options.threshold?this._options.threshold:1024,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,!lK){const e=void 0!==this._options.concurrencyLimit?this._options.concurrencyLimit:10;lK=new eK(e)}}static get extensionName(){return"permessage-deflate"}offer(){const e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:null==this._options.clientMaxWindowBits&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){const e=this._deflate[oK];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){const t=this._options,n=e.find((e=>!(!1===t.serverNoContextTakeover&&e.server_no_context_takeover||e.server_max_window_bits&&(!1===t.serverMaxWindowBits||"number"==typeof t.serverMaxWindowBits&&t.serverMaxWindowBits>e.server_max_window_bits)||"number"==typeof t.clientMaxWindowBits&&!e.client_max_window_bits)));if(!n)throw new Error("None of the extension offers can be accepted");return t.serverNoContextTakeover&&(n.server_no_context_takeover=!0),t.clientNoContextTakeover&&(n.client_no_context_takeover=!0),"number"==typeof t.serverMaxWindowBits&&(n.server_max_window_bits=t.serverMaxWindowBits),"number"==typeof t.clientMaxWindowBits?n.client_max_window_bits=t.clientMaxWindowBits:!0!==n.client_max_window_bits&&!1!==t.clientMaxWindowBits||delete n.client_max_window_bits,n}acceptAsClient(e){const t=e[0];if(!1===this._options.clientNoContextTakeover&&t.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(t.client_max_window_bits){if(!1===this._options.clientMaxWindowBits||"number"==typeof this._options.clientMaxWindowBits&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"')}else"number"==typeof this._options.clientMaxWindowBits&&(t.client_max_window_bits=this._options.clientMaxWindowBits);return t}normalizeParams(e){return e.forEach((e=>{Object.keys(e).forEach((t=>{let n=e[t];if(n.length>1)throw new Error(`Parameter "${t}" must have only a single value`);if(n=n[0],"client_max_window_bits"===t){if(!0!==n){const e=+n;if(!Number.isInteger(e)||e<8||e>15)throw new TypeError(`Invalid value for parameter "${t}": ${n}`);n=e}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${t}": ${n}`)}else if("server_max_window_bits"===t){const e=+n;if(!Number.isInteger(e)||e<8||e>15)throw new TypeError(`Invalid value for parameter "${t}": ${n}`);n=e}else{if("client_no_context_takeover"!==t&&"server_no_context_takeover"!==t)throw new Error(`Unknown parameter "${t}"`);if(!0!==n)throw new TypeError(`Invalid value for parameter "${t}": ${n}`)}e[t]=n}))})),e}decompress(e,t,n){lK.add((r=>{this._decompress(e,t,((e,t)=>{r(),n(e,t)}))}))}compress(e,t,n){lK.add((r=>{this._compress(e,t,((e,t)=>{r(),n(e,t)}))}))}_decompress(e,t,n){const r=this._isServer?"client":"server";if(!this._inflate){const e=`${r}_max_window_bits`,t="number"!=typeof this.params[e]?JV.Z_DEFAULT_WINDOWBITS:this.params[e];this._inflate=JV.createInflateRaw({...this._options.zlibInflateOptions,windowBits:t}),this._inflate[iK]=this,this._inflate[sK]=0,this._inflate[aK]=[],this._inflate.on("error",dK),this._inflate.on("data",hK)}this._inflate[oK]=n,this._inflate.write(e),t&&this._inflate.write(rK),this._inflate.flush((()=>{const e=this._inflate[cK];if(e)return this._inflate.close(),this._inflate=null,void n(e);const i=XV.concat(this._inflate[aK],this._inflate[sK]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[sK]=0,this._inflate[aK]=[],t&&this.params[`${r}_no_context_takeover`]&&this._inflate.reset()),n(null,i)}))}_compress(e,t,n){const r=this._isServer?"server":"client";if(!this._deflate){const e=`${r}_max_window_bits`,t="number"!=typeof this.params[e]?JV.Z_DEFAULT_WINDOWBITS:this.params[e];this._deflate=JV.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:t}),this._deflate[sK]=0,this._deflate[aK]=[],this._deflate.on("data",pK)}this._deflate[oK]=n,this._deflate.write(e),this._deflate.flush(JV.Z_SYNC_FLUSH,(()=>{if(!this._deflate)return;let e=XV.concat(this._deflate[aK],this._deflate[sK]);t&&(e=new nK(e.buffer,e.byteOffset,e.length-4)),this._deflate[oK]=null,this._deflate[sK]=0,this._deflate[aK]=[],t&&this.params[`${r}_no_context_takeover`]&&this._deflate.reset(),n(null,e)}))}};function pK(e){this[aK].push(e),this[sK]+=e.length}function hK(e){this[sK]+=e.length,this[iK]._maxPayload<1||this[sK]<=this[iK]._maxPayload?this[aK].push(e):(this[cK]=new RangeError("Max payload size exceeded"),this[cK].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[cK][tK]=1009,this.removeListener("data",hK),this.reset())}function dK(e){this[iK]._inflate=null,e[tK]=1007,this[oK](e)}var fK,mK,gK,yK={exports:{}},vK={exports:{}};const{isUtf8:bK}=v;function _K(e){const t=e.length;let n=0;for(;n<t;)if(128&e[n])if(192==(224&e[n])){if(n+1===t||128!=(192&e[n+1])||192==(254&e[n]))return!1;n+=2}else if(224==(240&e[n])){if(n+2>=t||128!=(192&e[n+1])||128!=(192&e[n+2])||224===e[n]&&128==(224&e[n+1])||237===e[n]&&160==(224&e[n+1]))return!1;n+=3}else{if(240!=(248&e[n]))return!1;if(n+3>=t||128!=(192&e[n+1])||128!=(192&e[n+2])||128!=(192&e[n+3])||240===e[n]&&128==(240&e[n+1])||244===e[n]&&e[n+1]>143||e[n]>244)return!1;n+=4}else n++;return!0}if(yK.exports={isValidStatusCode:function(e){return e>=1e3&&e<=1014&&1004!==e&&1005!==e&&1006!==e||e>=3e3&&e<=4999},isValidUTF8:_K,tokenChars:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0]},bK)yK.exports.isValidUTF8=function(e){return e.length<24?_K(e):bK(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{const e=function(){if(gK)return vK.exports;gK=1;try{vK.exports=zV()(__dirname)}catch(e){vK.exports=(mK||(mK=1,fK=function(e){const t=e.length;let n=0;for(;n<t;)if(128&e[n])if(192==(224&e[n])){if(n+1===t||128!=(192&e[n+1])||192==(254&e[n]))return!1;n+=2}else if(224==(240&e[n])){if(n+2>=t||128!=(192&e[n+1])||128!=(192&e[n+2])||224===e[n]&&128==(224&e[n+1])||237===e[n]&&160==(224&e[n+1]))return!1;n+=3}else{if(240!=(248&e[n]))return!1;if(n+3>=t||128!=(192&e[n+1])||128!=(192&e[n+2])||128!=(192&e[n+3])||240===e[n]&&128==(240&e[n+1])||244===e[n]&&e[n+1]>143||e[n]>244)return!1;n+=4}else n++;return!0}),fK)}return vK.exports}();yK.exports.isValidUTF8=function(t){return t.length<32?_K(t):e(t)}}catch(e){}var wK=yK.exports;const{Writable:xK}=h,EK=uK,{BINARY_TYPES:SK,EMPTY_BUFFER:TK,kStatusCode:DK,kWebSocket:kK}=qV,{concat:AK,toArrayBuffer:CK,unmask:RK}=YV,{isValidStatusCode:OK,isValidUTF8:LK}=wK,IK=Buffer[Symbol.species];var PK=class extends xK{constructor(e={}){super(),this._allowSynchronousEvents=void 0===e.allowSynchronousEvents||e.allowSynchronousEvents,this._binaryType=e.binaryType||SK[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=0|e.maxPayload,this._skipUTF8Validation=!!e.skipUTF8Validation,this[kK]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=0}_write(e,t,n){if(8===this._opcode&&0==this._state)return n();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(n)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){const t=this._buffers[0];return this._buffers[0]=new IK(t.buffer,t.byteOffset+e,t.length-e),new IK(t.buffer,t.byteOffset,e)}const t=Buffer.allocUnsafe(e);do{const n=this._buffers[0],r=t.length-e;e>=n.length?t.set(this._buffers.shift(),r):(t.set(new Uint8Array(n.buffer,n.byteOffset,e),r),this._buffers[0]=new IK(n.buffer,n.byteOffset+e,n.length-e)),e-=n.length}while(e>0);return t}startLoop(e){this._loop=!0;do{switch(this._state){case 0:this.getInfo(e);break;case 1:this.getPayloadLength16(e);break;case 2:this.getPayloadLength64(e);break;case 3:this.getMask();break;case 4:this.getData(e);break;case 5:case 6:return void(this._loop=!1)}}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2)return void(this._loop=!1);const t=this.consume(2);if(48&t[0]){return void e(this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3"))}const n=!(64&~t[0]);if(!n||this._extensions[EK.extensionName]){if(this._fin=!(128&~t[0]),this._opcode=15&t[0],this._payloadLength=127&t[1],0===this._opcode){if(n){return void e(this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1"))}if(!this._fragmented){return void e(this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE"))}this._opcode=this._fragmented}else if(1===this._opcode||2===this._opcode){if(this._fragmented){return void e(this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE"))}this._compressed=n}else{if(!(this._opcode>7&&this._opcode<11)){return void e(this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE"))}if(!this._fin){return void e(this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN"))}if(n){return void e(this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1"))}if(this._payloadLength>125||8===this._opcode&&1===this._payloadLength){return void e(this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH"))}}if(this._fin||this._fragmented||(this._fragmented=this._opcode),this._masked=!(128&~t[1]),this._isServer){if(!this._masked){return void e(this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK"))}}else if(this._masked){return void e(this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK"))}126===this._payloadLength?this._state=1:127===this._payloadLength?this._state=2:this.haveLength(e)}else{e(this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1"))}}getPayloadLength16(e){this._bufferedBytes<2?this._loop=!1:(this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e))}getPayloadLength64(e){if(this._bufferedBytes<8)return void(this._loop=!1);const t=this.consume(8),n=t.readUInt32BE(0);if(n>Math.pow(2,21)-1){e(this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH"))}else this._payloadLength=n*Math.pow(2,32)+t.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){e(this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"))}else this._masked?this._state=3:this._state=4}getMask(){this._bufferedBytes<4?this._loop=!1:(this._mask=this.consume(4),this._state=4)}getData(e){let t=TK;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength)return void(this._loop=!1);t=this.consume(this._payloadLength),this._masked&&this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3]&&RK(t,this._mask)}if(this._opcode>7)this.controlMessage(t,e);else{if(this._compressed)return this._state=5,void this.decompress(t,e);t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}}decompress(e,t){this._extensions[EK.extensionName].decompress(e,this._fin,((e,n)=>{if(e)return t(e);if(n.length){if(this._messageLength+=n.length,this._messageLength>this._maxPayload&&this._maxPayload>0){const e=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");return void t(e)}this._fragments.push(n)}this.dataMessage(t),0===this._state&&this.startLoop(t)}))}dataMessage(e){if(!this._fin)return void(this._state=0);const t=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],2===this._opcode){let r;r="nodebuffer"===this._binaryType?AK(n,t):"arraybuffer"===this._binaryType?CK(AK(n,t)):n,this._allowSynchronousEvents?(this.emit("message",r,!0),this._state=0):(this._state=6,setImmediate((()=>{this.emit("message",r,!0),this._state=0,this.startLoop(e)})))}else{const r=AK(n,t);if(!this._skipUTF8Validation&&!LK(r)){const t=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");return void e(t)}5===this._state||this._allowSynchronousEvents?(this.emit("message",r,!1),this._state=0):(this._state=6,setImmediate((()=>{this.emit("message",r,!1),this._state=0,this.startLoop(e)})))}}controlMessage(e,t){if(8!==this._opcode)this._allowSynchronousEvents?(this.emit(9===this._opcode?"ping":"pong",e),this._state=0):(this._state=6,setImmediate((()=>{this.emit(9===this._opcode?"ping":"pong",e),this._state=0,this.startLoop(t)})));else{if(0===e.length)this._loop=!1,this.emit("conclude",1005,TK),this.end();else{const n=e.readUInt16BE(0);if(!OK(n)){const e=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");return void t(e)}const r=new IK(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!LK(r)){const e=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");return void t(e)}this._loop=!1,this.emit("conclude",n,r),this.end()}this._state=0}}createError(e,t,n,r,i){this._loop=!1,this._errored=!0;const s=new e(n?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(s,this.createError),s.code=i,s[DK]=r,s}};const{randomFillSync:NK}=w,jK=uK,{EMPTY_BUFFER:FK}=qV,{isValidStatusCode:BK}=wK,{mask:MK,toBuffer:UK}=YV,qK=Symbol("kByteLength"),HK=Buffer.alloc(4),$K=8192;let zK,WK=$K;var GK=class e{constructor(e,t,n){this._extensions=t||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(e,t){let n,r,i=!1,s=2,o=!1;t.mask&&(n=t.maskBuffer||HK,t.generateMask?t.generateMask(n):(WK===$K&&(void 0===zK&&(zK=Buffer.alloc($K)),NK(zK,0,$K),WK=0),n[0]=zK[WK++],n[1]=zK[WK++],n[2]=zK[WK++],n[3]=zK[WK++]),o=!(n[0]|n[1]|n[2]|n[3]),s=6),"string"==typeof e?r=t.mask&&!o||void 0===t[qK]?(e=Buffer.from(e)).length:t[qK]:(r=e.length,i=t.mask&&t.readOnly&&!o);let a=r;r>=65536?(s+=8,a=127):r>125&&(s+=2,a=126);const c=Buffer.allocUnsafe(i?r+s:s);return c[0]=t.fin?128|t.opcode:t.opcode,t.rsv1&&(c[0]|=64),c[1]=a,126===a?c.writeUInt16BE(r,2):127===a&&(c[2]=c[3]=0,c.writeUIntBE(r,4,6)),t.mask?(c[1]|=128,c[s-4]=n[0],c[s-3]=n[1],c[s-2]=n[2],c[s-1]=n[3],o?[c,e]:i?(MK(e,n,c,s,r),[c]):(MK(e,n,e,0,r),[c,e])):[c,e]}close(t,n,r,i){let s;if(void 0===t)s=FK;else{if("number"!=typeof t||!BK(t))throw new TypeError("First argument must be a valid error code number");if(void 0!==n&&n.length){const e=Buffer.byteLength(n);if(e>123)throw new RangeError("The message must not be greater than 123 bytes");s=Buffer.allocUnsafe(2+e),s.writeUInt16BE(t,0),"string"==typeof n?s.write(n,2):s.set(n,2)}else s=Buffer.allocUnsafe(2),s.writeUInt16BE(t,0)}const o={[qK]:s.length,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._deflating?this.enqueue([this.dispatch,s,!1,o,i]):this.sendFrame(e.frame(s,o),i)}ping(t,n,r){let i,s;if("string"==typeof t?(i=Buffer.byteLength(t),s=!1):(i=(t=UK(t)).length,s=UK.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");const o={[qK]:i,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};this._deflating?this.enqueue([this.dispatch,t,!1,o,r]):this.sendFrame(e.frame(t,o),r)}pong(t,n,r){let i,s;if("string"==typeof t?(i=Buffer.byteLength(t),s=!1):(i=(t=UK(t)).length,s=UK.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");const o={[qK]:i,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};this._deflating?this.enqueue([this.dispatch,t,!1,o,r]):this.sendFrame(e.frame(t,o),r)}send(t,n,r){const i=this._extensions[jK.extensionName];let s,o,a=n.binary?2:1,c=n.compress;if("string"==typeof t?(s=Buffer.byteLength(t),o=!1):(s=(t=UK(t)).length,o=UK.readOnly),this._firstFragment?(this._firstFragment=!1,c&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(c=s>=i._threshold),this._compress=c):(c=!1,a=0),n.fin&&(this._firstFragment=!0),i){const e={[qK]:s,fin:n.fin,generateMask:this._generateMask,mask:n.mask,maskBuffer:this._maskBuffer,opcode:a,readOnly:o,rsv1:c};this._deflating?this.enqueue([this.dispatch,t,this._compress,e,r]):this.dispatch(t,this._compress,e,r)}else this.sendFrame(e.frame(t,{[qK]:s,fin:n.fin,generateMask:this._generateMask,mask:n.mask,maskBuffer:this._maskBuffer,opcode:a,readOnly:o,rsv1:!1}),r)}dispatch(t,n,r,i){if(!n)return void this.sendFrame(e.frame(t,r),i);const s=this._extensions[jK.extensionName];this._bufferedBytes+=r[qK],this._deflating=!0,s.compress(t,r.fin,((t,n)=>{if(this._socket.destroyed){const e=new Error("The socket was closed while data was being compressed");"function"==typeof i&&i(e);for(let t=0;t<this._queue.length;t++){const n=this._queue[t],r=n[n.length-1];"function"==typeof r&&r(e)}}else this._bufferedBytes-=r[qK],this._deflating=!1,r.readOnly=!1,this.sendFrame(e.frame(n,r),i),this.dequeue()}))}dequeue(){for(;!this._deflating&&this._queue.length;){const e=this._queue.shift();this._bufferedBytes-=e[3][qK],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][qK],this._queue.push(e)}sendFrame(e,t){2===e.length?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork()):this._socket.write(e[0],t)}};const{kForOnEventAttribute:VK,kListener:KK}=qV,YK=Symbol("kCode"),ZK=Symbol("kData"),QK=Symbol("kError"),JK=Symbol("kMessage"),XK=Symbol("kReason"),eY=Symbol("kTarget"),tY=Symbol("kType"),nY=Symbol("kWasClean");class rY{constructor(e){this[eY]=null,this[tY]=e}get target(){return this[eY]}get type(){return this[tY]}}Object.defineProperty(rY.prototype,"target",{enumerable:!0}),Object.defineProperty(rY.prototype,"type",{enumerable:!0});class iY extends rY{constructor(e,t={}){super(e),this[YK]=void 0===t.code?0:t.code,this[XK]=void 0===t.reason?"":t.reason,this[nY]=void 0!==t.wasClean&&t.wasClean}get code(){return this[YK]}get reason(){return this[XK]}get wasClean(){return this[nY]}}Object.defineProperty(iY.prototype,"code",{enumerable:!0}),Object.defineProperty(iY.prototype,"reason",{enumerable:!0}),Object.defineProperty(iY.prototype,"wasClean",{enumerable:!0});class sY extends rY{constructor(e,t={}){super(e),this[QK]=void 0===t.error?null:t.error,this[JK]=void 0===t.message?"":t.message}get error(){return this[QK]}get message(){return this[JK]}}Object.defineProperty(sY.prototype,"error",{enumerable:!0}),Object.defineProperty(sY.prototype,"message",{enumerable:!0});class oY extends rY{constructor(e,t={}){super(e),this[ZK]=void 0===t.data?null:t.data}get data(){return this[ZK]}}Object.defineProperty(oY.prototype,"data",{enumerable:!0});const aY={addEventListener(e,t,n={}){for(const r of this.listeners(e))if(!n[VK]&&r[KK]===t&&!r[VK])return;let r;if("message"===e)r=function(e,n){const r=new oY("message",{data:n?e:e.toString()});r[eY]=this,lY(t,this,r)};else if("close"===e)r=function(e,n){const r=new iY("close",{code:e,reason:n.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});r[eY]=this,lY(t,this,r)};else if("error"===e)r=function(e){const n=new sY("error",{error:e,message:e.message});n[eY]=this,lY(t,this,n)};else{if("open"!==e)return;r=function(){const e=new rY("open");e[eY]=this,lY(t,this,e)}}r[VK]=!!n[VK],r[KK]=t,n.once?this.once(e,r):this.on(e,r)},removeEventListener(e,t){for(const n of this.listeners(e))if(n[KK]===t&&!n[VK]){this.removeListener(e,n);break}}};var cY={CloseEvent:iY,ErrorEvent:sY,Event:rY,EventTarget:aY,MessageEvent:oY};function lY(e,t,n){"object"==typeof e&&e.handleEvent?e.handleEvent.call(e,n):e.call(t,n)}const{tokenChars:uY}=wK;function pY(e,t,n){void 0===e[t]?e[t]=[n]:e[t].push(n)}var hY={format:function(e){return Object.keys(e).map((t=>{let n=e[t];return Array.isArray(n)||(n=[n]),n.map((e=>[t].concat(Object.keys(e).map((t=>{let n=e[t];return Array.isArray(n)||(n=[n]),n.map((e=>!0===e?t:`${t}=${e}`)).join("; ")}))).join("; "))).join(", ")})).join(", ")},parse:function(e){const t=Object.create(null);let n,r,i=Object.create(null),s=!1,o=!1,a=!1,c=-1,l=-1,u=-1,p=0;for(;p<e.length;p++)if(l=e.charCodeAt(p),void 0===n)if(-1===u&&1===uY[l])-1===c&&(c=p);else if(0===p||32!==l&&9!==l){if(59!==l&&44!==l)throw new SyntaxError(`Unexpected character at index ${p}`);{if(-1===c)throw new SyntaxError(`Unexpected character at index ${p}`);-1===u&&(u=p);const r=e.slice(c,u);44===l?(pY(t,r,i),i=Object.create(null)):n=r,c=u=-1}}else-1===u&&-1!==c&&(u=p);else if(void 0===r)if(-1===u&&1===uY[l])-1===c&&(c=p);else if(32===l||9===l)-1===u&&-1!==c&&(u=p);else if(59===l||44===l){if(-1===c)throw new SyntaxError(`Unexpected character at index ${p}`);-1===u&&(u=p),pY(i,e.slice(c,u),!0),44===l&&(pY(t,n,i),i=Object.create(null),n=void 0),c=u=-1}else{if(61!==l||-1===c||-1!==u)throw new SyntaxError(`Unexpected character at index ${p}`);r=e.slice(c,p),c=u=-1}else if(o){if(1!==uY[l])throw new SyntaxError(`Unexpected character at index ${p}`);-1===c?c=p:s||(s=!0),o=!1}else if(a)if(1===uY[l])-1===c&&(c=p);else if(34===l&&-1!==c)a=!1,u=p;else{if(92!==l)throw new SyntaxError(`Unexpected character at index ${p}`);o=!0}else if(34===l&&61===e.charCodeAt(p-1))a=!0;else if(-1===u&&1===uY[l])-1===c&&(c=p);else if(-1===c||32!==l&&9!==l){if(59!==l&&44!==l)throw new SyntaxError(`Unexpected character at index ${p}`);{if(-1===c)throw new SyntaxError(`Unexpected character at index ${p}`);-1===u&&(u=p);let o=e.slice(c,u);s&&(o=o.replace(/\\/g,""),s=!1),pY(i,r,o),44===l&&(pY(t,n,i),i=Object.create(null),n=void 0),r=void 0,c=u=-1}}else-1===u&&(u=p);if(-1===c||a||32===l||9===l)throw new SyntaxError("Unexpected end of input");-1===u&&(u=p);const h=e.slice(c,u);return void 0===n?pY(t,h,i):(void 0===r?pY(i,h,!0):pY(i,r,s?h.replace(/\\/g,""):h),pY(t,n,i)),t}};const dY=p,fY=E,mY=x,gY=O,yY=N,{randomBytes:vY,createHash:bY}=w,{URL:_Y}=S,wY=uK,xY=PK,EY=GK,{BINARY_TYPES:SY,EMPTY_BUFFER:TY,GUID:DY,kForOnEventAttribute:kY,kListener:AY,kStatusCode:CY,kWebSocket:RY,NOOP:OY}=qV,{EventTarget:{addEventListener:LY,removeEventListener:IY}}=cY,{format:PY,parse:NY}=hY,{toBuffer:jY}=YV,FY=Symbol("kAborted"),BY=[8,13],MY=["CONNECTING","OPEN","CLOSING","CLOSED"],UY=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;let qY=class e extends dY{constructor(t,n,r){super(),this._binaryType=SY[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=TY,this._closeTimer=null,this._extensions={},this._paused=!1,this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,null!==t?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,void 0===n?n=[]:Array.isArray(n)||("object"==typeof n&&null!==n?(r=n,n=[]):n=[n]),$Y(this,t,n,r)):(this._autoPong=r.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){SY.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,n,r){const i=new xY({allowSynchronousEvents:r.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:r.maxPayload,skipUTF8Validation:r.skipUTF8Validation});this._sender=new EY(t,this._extensions,r.generateMask),this._receiver=i,this._socket=t,i[RY]=this,t[RY]=this,i.on("conclude",YY),i.on("drain",ZY),i.on("error",QY),i.on("message",XY),i.on("ping",eZ),i.on("pong",tZ),t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),n.length>0&&t.unshift(n),t.on("close",rZ),t.on("data",iZ),t.on("end",sZ),t.on("error",oZ),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket)return this._readyState=e.CLOSED,void this.emit("close",this._closeCode,this._closeMessage);this._extensions[wY.extensionName]&&this._extensions[wY.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,n){if(this.readyState!==e.CLOSED)if(this.readyState!==e.CONNECTING)this.readyState!==e.CLOSING?(this._readyState=e.CLOSING,this._sender.close(t,n,!this._isServer,(e=>{e||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())})),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),3e4)):this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();else{const e="WebSocket was closed before the connection was established";VY(this,this._req,e)}}pause(){this.readyState!==e.CONNECTING&&this.readyState!==e.CLOSED&&(this._paused=!0,this._socket.pause())}ping(t,n,r){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");"function"==typeof t?(r=t,t=n=void 0):"function"==typeof n&&(r=n,n=void 0),"number"==typeof t&&(t=t.toString()),this.readyState===e.OPEN?(void 0===n&&(n=!this._isServer),this._sender.ping(t||TY,n,r)):KY(this,t,r)}pong(t,n,r){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");"function"==typeof t?(r=t,t=n=void 0):"function"==typeof n&&(r=n,n=void 0),"number"==typeof t&&(t=t.toString()),this.readyState===e.OPEN?(void 0===n&&(n=!this._isServer),this._sender.pong(t||TY,n,r)):KY(this,t,r)}resume(){this.readyState!==e.CONNECTING&&this.readyState!==e.CLOSED&&(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,n,r){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if("function"==typeof n&&(r=n,n={}),"number"==typeof t&&(t=t.toString()),this.readyState!==e.OPEN)return void KY(this,t,r);const i={binary:"string"!=typeof t,mask:!this._isServer,compress:!0,fin:!0,...n};this._extensions[wY.extensionName]||(i.compress=!1),this._sender.send(t||TY,i,r)}terminate(){if(this.readyState!==e.CLOSED)if(this.readyState!==e.CONNECTING)this._socket&&(this._readyState=e.CLOSING,this._socket.destroy());else{const e="WebSocket was closed before the connection was established";VY(this,this._req,e)}}};Object.defineProperty(qY,"CONNECTING",{enumerable:!0,value:MY.indexOf("CONNECTING")}),Object.defineProperty(qY.prototype,"CONNECTING",{enumerable:!0,value:MY.indexOf("CONNECTING")}),Object.defineProperty(qY,"OPEN",{enumerable:!0,value:MY.indexOf("OPEN")}),Object.defineProperty(qY.prototype,"OPEN",{enumerable:!0,value:MY.indexOf("OPEN")}),Object.defineProperty(qY,"CLOSING",{enumerable:!0,value:MY.indexOf("CLOSING")}),Object.defineProperty(qY.prototype,"CLOSING",{enumerable:!0,value:MY.indexOf("CLOSING")}),Object.defineProperty(qY,"CLOSED",{enumerable:!0,value:MY.indexOf("CLOSED")}),Object.defineProperty(qY.prototype,"CLOSED",{enumerable:!0,value:MY.indexOf("CLOSED")}),["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach((e=>{Object.defineProperty(qY.prototype,e,{enumerable:!0})})),["open","error","close","message"].forEach((e=>{Object.defineProperty(qY.prototype,`on${e}`,{enumerable:!0,get(){for(const t of this.listeners(e))if(t[kY])return t[AY];return null},set(t){for(const t of this.listeners(e))if(t[kY]){this.removeListener(e,t);break}"function"==typeof t&&this.addEventListener(e,t,{[kY]:!0})}})})),qY.prototype.addEventListener=LY,qY.prototype.removeEventListener=IY;var HY=qY;function $Y(e,t,n,r){const i={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:BY[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...r,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(e._autoPong=i.autoPong,!BY.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${BY.join(", ")})`);let s;if(t instanceof _Y)s=t;else try{s=new _Y(t)}catch(e){throw new SyntaxError(`Invalid URL: ${t}`)}"http:"===s.protocol?s.protocol="ws:":"https:"===s.protocol&&(s.protocol="wss:"),e._url=s.href;const o="wss:"===s.protocol,a="ws+unix:"===s.protocol;let c;if("ws:"===s.protocol||o||a?a&&!s.pathname?c="The URL's pathname is empty":s.hash&&(c="The URL contains a fragment identifier"):c='The URL\'s protocol must be one of "ws:", "wss:", "http:", "https", or "ws+unix:"',c){const t=new SyntaxError(c);if(0===e._redirects)throw t;return void zY(e,t)}const l=o?443:80,u=vY(16).toString("base64"),p=o?fY.request:mY.request,h=new Set;let d,f;if(i.createConnection=i.createConnection||(o?GY:WY),i.defaultPort=i.defaultPort||l,i.port=s.port||l,i.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":u,Connection:"Upgrade",Upgrade:"websocket"},i.path=s.pathname+s.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(d=new wY(!0!==i.perMessageDeflate?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=PY({[wY.extensionName]:d.offer()})),n.length){for(const e of n){if("string"!=typeof e||!UY.test(e)||h.has(e))throw new SyntaxError("An invalid or duplicated subprotocol was specified");h.add(e)}i.headers["Sec-WebSocket-Protocol"]=n.join(",")}if(i.origin&&(i.protocolVersion<13?i.headers["Sec-WebSocket-Origin"]=i.origin:i.headers.Origin=i.origin),(s.username||s.password)&&(i.auth=`${s.username}:${s.password}`),a){const e=i.path.split(":");i.socketPath=e[0],i.path=e[1]}if(i.followRedirects){if(0===e._redirects){e._originalIpc=a,e._originalSecure=o,e._originalHostOrSocketPath=a?i.socketPath:s.host;const t=r&&r.headers;if(r={...r,headers:{}},t)for(const[e,n]of Object.entries(t))r.headers[e.toLowerCase()]=n}else if(0===e.listenerCount("redirect")){const t=a?!!e._originalIpc&&i.socketPath===e._originalHostOrSocketPath:!e._originalIpc&&s.host===e._originalHostOrSocketPath;(!t||e._originalSecure&&!o)&&(delete i.headers.authorization,delete i.headers.cookie,t||delete i.headers.host,i.auth=void 0)}i.auth&&!r.headers.authorization&&(r.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),f=e._req=p(i),e._redirects&&e.emit("redirect",e.url,f)}else f=e._req=p(i);i.timeout&&f.on("timeout",(()=>{VY(e,f,"Opening handshake has timed out")})),f.on("error",(t=>{null===f||f[FY]||(f=e._req=null,zY(e,t))})),f.on("response",(s=>{const o=s.headers.location,a=s.statusCode;if(o&&i.followRedirects&&a>=300&&a<400){if(++e._redirects>i.maxRedirects)return void VY(e,f,"Maximum redirects exceeded");let s;f.abort();try{s=new _Y(o,t)}catch(t){const n=new SyntaxError(`Invalid URL: ${o}`);return void zY(e,n)}$Y(e,s,n,r)}else e.emit("unexpected-response",f,s)||VY(e,f,`Unexpected server response: ${s.statusCode}`)})),f.on("upgrade",((t,n,r)=>{if(e.emit("upgrade",t),e.readyState!==qY.CONNECTING)return;f=e._req=null;const s=t.headers.upgrade;if(void 0===s||"websocket"!==s.toLowerCase())return void VY(e,n,"Invalid Upgrade header");const o=bY("sha1").update(u+DY).digest("base64");if(t.headers["sec-websocket-accept"]!==o)return void VY(e,n,"Invalid Sec-WebSocket-Accept header");const a=t.headers["sec-websocket-protocol"];let c;if(void 0!==a?h.size?h.has(a)||(c="Server sent an invalid subprotocol"):c="Server sent a subprotocol but none was requested":h.size&&(c="Server sent no subprotocol"),c)return void VY(e,n,c);a&&(e._protocol=a);const l=t.headers["sec-websocket-extensions"];if(void 0!==l){if(!d){return void VY(e,n,"Server sent a Sec-WebSocket-Extensions header but no extension was requested")}let t;try{t=NY(l)}catch(t){return void VY(e,n,"Invalid Sec-WebSocket-Extensions header")}const r=Object.keys(t);if(1!==r.length||r[0]!==wY.extensionName){return void VY(e,n,"Server indicated an extension that was not requested")}try{d.accept(t[wY.extensionName])}catch(t){return void VY(e,n,"Invalid Sec-WebSocket-Extensions header")}e._extensions[wY.extensionName]=d}e.setSocket(n,r,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})})),i.finishRequest?i.finishRequest(f,e):f.end()}function zY(e,t){e._readyState=qY.CLOSING,e.emit("error",t),e.emitClose()}function WY(e){return e.path=e.socketPath,gY.connect(e)}function GY(e){return e.path=void 0,e.servername||""===e.servername||(e.servername=gY.isIP(e.host)?"":e.host),yY.connect(e)}function VY(e,t,n){e._readyState=qY.CLOSING;const r=new Error(n);Error.captureStackTrace(r,VY),t.setHeader?(t[FY]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(zY,e,r)):(t.destroy(r),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function KY(e,t,n){if(t){const n=jY(t).length;e._socket?e._sender._bufferedBytes+=n:e._bufferedAmount+=n}if(n){const t=new Error(`WebSocket is not open: readyState ${e.readyState} (${MY[e.readyState]})`);process.nextTick(n,t)}}function YY(e,t){const n=this[RY];n._closeFrameReceived=!0,n._closeMessage=t,n._closeCode=e,void 0!==n._socket[RY]&&(n._socket.removeListener("data",iZ),process.nextTick(nZ,n._socket),1005===e?n.close():n.close(e,t))}function ZY(){const e=this[RY];e.isPaused||e._socket.resume()}function QY(e){const t=this[RY];void 0!==t._socket[RY]&&(t._socket.removeListener("data",iZ),process.nextTick(nZ,t._socket),t.close(e[CY])),t.emit("error",e)}function JY(){this[RY].emitClose()}function XY(e,t){this[RY].emit("message",e,t)}function eZ(e){const t=this[RY];t._autoPong&&t.pong(e,!this._isServer,OY),t.emit("ping",e)}function tZ(e){this[RY].emit("pong",e)}function nZ(e){e.resume()}function rZ(){const e=this[RY];let t;this.removeListener("close",rZ),this.removeListener("data",iZ),this.removeListener("end",sZ),e._readyState=qY.CLOSING,this._readableState.endEmitted||e._closeFrameReceived||e._receiver._writableState.errorEmitted||null===(t=e._socket.read())||e._receiver.write(t),e._receiver.end(),this[RY]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",JY),e._receiver.on("finish",JY))}function iZ(e){this[RY]._receiver.write(e)||this.pause()}function sZ(){const e=this[RY];e._readyState=qY.CLOSING,e._receiver.end(),this.end()}function oZ(){const e=this[RY];this.removeListener("error",oZ),this.on("error",OY),e&&(e._readyState=qY.CLOSING,this.destroy())}var aZ=q(HY);const{Duplex:cZ}=h;function lZ(e){e.emit("close")}function uZ(){!this.destroyed&&this._writableState.finished&&this.destroy()}function pZ(e){this.removeListener("error",pZ),this.destroy(),0===this.listenerCount("error")&&this.emit("error",e)}var hZ=function(e,t){let n=!0;const r=new cZ({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",(function(t,n){const i=!n&&r._readableState.objectMode?t.toString():t;r.push(i)||e.pause()})),e.once("error",(function(e){r.destroyed||(n=!1,r.destroy(e))})),e.once("close",(function(){r.destroyed||r.push(null)})),r._destroy=function(t,i){if(e.readyState===e.CLOSED)return i(t),void process.nextTick(lZ,r);let s=!1;e.once("error",(function(e){s=!0,i(e)})),e.once("close",(function(){s||i(t),process.nextTick(lZ,r)})),n&&e.terminate()},r._final=function(t){e.readyState!==e.CONNECTING?null!==e._socket&&(e._socket._writableState.finished?(t(),r._readableState.endEmitted&&r.destroy()):(e._socket.once("finish",(function(){t()})),e.close())):e.once("open",(function(){r._final(t)}))},r._read=function(){e.isPaused&&e.resume()},r._write=function(t,n,i){e.readyState!==e.CONNECTING?e.send(t,i):e.once("open",(function(){r._write(t,n,i)}))},r.on("end",uZ),r.on("error",pZ),r};const{tokenChars:dZ}=wK;var fZ={parse:function(e){const t=new Set;let n=-1,r=-1,i=0;for(;i<e.length;i++){const s=e.charCodeAt(i);if(-1===r&&1===dZ[s])-1===n&&(n=i);else if(0===i||32!==s&&9!==s){if(44!==s)throw new SyntaxError(`Unexpected character at index ${i}`);{if(-1===n)throw new SyntaxError(`Unexpected character at index ${i}`);-1===r&&(r=i);const s=e.slice(n,r);if(t.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);t.add(s),n=r=-1}}else-1===r&&-1!==n&&(r=i)}if(-1===n||-1!==r)throw new SyntaxError("Unexpected end of input");const s=e.slice(n,i);if(t.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);return t.add(s),t}};const mZ=p,gZ=x,{createHash:yZ}=w,vZ=hY,bZ=uK,_Z=fZ,wZ=HY,{GUID:xZ,kWebSocket:EZ}=qV,SZ=/^[+/0-9A-Za-z]{22}==$/;var TZ=class extends mZ{constructor(e,t){if(super(),null==(e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:wZ,...e}).port&&!e.server&&!e.noServer||null!=e.port&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(null!=e.port?(this._server=gZ.createServer(((e,t)=>{const n=gZ.STATUS_CODES[426];t.writeHead(426,{"Content-Length":n.length,"Content-Type":"text/plain"}),t.end(n)})),this._server.listen(e.port,e.host,e.backlog,t)):e.server&&(this._server=e.server),this._server){const e=this.emit.bind(this,"connection");this._removeListeners=function(e,t){for(const n of Object.keys(t))e.on(n,t[n]);return function(){for(const n of Object.keys(t))e.removeListener(n,t[n])}}(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(t,n,r)=>{this.handleUpgrade(t,n,r,e)}})}!0===e.perMessageDeflate&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=0}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(2===this._state)return e&&this.once("close",(()=>{e(new Error("The server is not running"))})),void process.nextTick(DZ,this);if(e&&this.once("close",e),1!==this._state)if(this._state=1,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients&&this.clients.size?this._shouldEmitClose=!0:process.nextTick(DZ,this);else{const e=this._server;this._removeListeners(),this._removeListeners=this._server=null,e.close((()=>{DZ(this)}))}}shouldHandle(e){if(this.options.path){const t=e.url.indexOf("?");if((-1!==t?e.url.slice(0,t):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,t,n,r){t.on("error",kZ);const i=e.headers["sec-websocket-key"],s=e.headers.upgrade,o=+e.headers["sec-websocket-version"];if("GET"!==e.method){return void CZ(this,e,t,405,"Invalid HTTP method")}if(void 0===s||"websocket"!==s.toLowerCase()){return void CZ(this,e,t,400,"Invalid Upgrade header")}if(void 0===i||!SZ.test(i)){return void CZ(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header")}if(8!==o&&13!==o){return void CZ(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header")}if(!this.shouldHandle(e))return void AZ(t,400);const a=e.headers["sec-websocket-protocol"];let c=new Set;if(void 0!==a)try{c=_Z.parse(a)}catch(n){return void CZ(this,e,t,400,"Invalid Sec-WebSocket-Protocol header")}const l=e.headers["sec-websocket-extensions"],u={};if(this.options.perMessageDeflate&&void 0!==l){const n=new bZ(this.options.perMessageDeflate,!0,this.options.maxPayload);try{const e=vZ.parse(l);e[bZ.extensionName]&&(n.accept(e[bZ.extensionName]),u[bZ.extensionName]=n)}catch(n){return void CZ(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header")}}if(this.options.verifyClient){const s={origin:e.headers[""+(8===o?"sec-websocket-origin":"origin")],secure:!(!e.socket.authorized&&!e.socket.encrypted),req:e};if(2===this.options.verifyClient.length)return void this.options.verifyClient(s,((s,o,a,l)=>{if(!s)return AZ(t,o||401,a,l);this.completeUpgrade(u,i,c,e,t,n,r)}));if(!this.options.verifyClient(s))return AZ(t,401)}this.completeUpgrade(u,i,c,e,t,n,r)}completeUpgrade(e,t,n,r,i,s,o){if(!i.readable||!i.writable)return i.destroy();if(i[EZ])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>0)return AZ(i,503);const a=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${yZ("sha1").update(t+xZ).digest("base64")}`],c=new this.options.WebSocket(null,void 0,this.options);if(n.size){const e=this.options.handleProtocols?this.options.handleProtocols(n,r):n.values().next().value;e&&(a.push(`Sec-WebSocket-Protocol: ${e}`),c._protocol=e)}if(e[bZ.extensionName]){const t=e[bZ.extensionName].params,n=vZ.format({[bZ.extensionName]:[t]});a.push(`Sec-WebSocket-Extensions: ${n}`),c._extensions=e}this.emit("headers",a,r),i.write(a.concat("\r\n").join("\r\n")),i.removeListener("error",kZ),c.setSocket(i,s,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(c),c.on("close",(()=>{this.clients.delete(c),this._shouldEmitClose&&!this.clients.size&&process.nextTick(DZ,this)}))),o(c,r)}};function DZ(e){e._state=2,e.emit("close")}function kZ(){this.destroy()}function AZ(e,t,n,r){n=n||gZ.STATUS_CODES[t],r={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(n),...r},e.once("finish",e.destroy),e.end(`HTTP/1.1 ${t} ${gZ.STATUS_CODES[t]}\r\n`+Object.keys(r).map((e=>`${e}: ${r[e]}`)).join("\r\n")+"\r\n\r\n"+n)}function CZ(e,t,n,r,i){if(e.listenerCount("wsClientError")){const r=new Error(i);Error.captureStackTrace(r,CZ),e.emit("wsClientError",r,n,t)}else AZ(n,r,i)}const RZ=HY;RZ.createWebSocketStream=hZ,RZ.Server=TZ,RZ.Receiver=PK,RZ.Sender=GK,RZ.WebSocket=RZ,RZ.WebSocketServer=RZ.Server;var OZ=RZ,LZ={exports:{}},IZ=Object.getOwnPropertySymbols,PZ=Object.prototype.hasOwnProperty,NZ=Object.prototype.propertyIsEnumerable;var jZ=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,r,i=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),s=1;s<arguments.length;s++){for(var o in n=Object(arguments[s]))PZ.call(n,o)&&(i[o]=n[o]);if(IZ){r=IZ(n);for(var a=0;a<r.length;a++)NZ.call(n,r[a])&&(i[r[a]]=n[r[a]])}}return i};!function(){var e=jZ,t=wU,n={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function r(e){return"string"==typeof e||e instanceof String}function i(e,t){if(Array.isArray(t)){for(var n=0;n<t.length;++n)if(i(e,t[n]))return!0;return!1}return r(t)?e===t:t instanceof RegExp?t.test(e):!!t}function s(e,t){var n,s=t.headers.origin,o=[];return e.origin&&"*"!==e.origin?r(e.origin)?(o.push([{key:"Access-Control-Allow-Origin",value:e.origin}]),o.push([{key:"Vary",value:"Origin"}])):(n=i(s,e.origin),o.push([{key:"Access-Control-Allow-Origin",value:!!n&&s}]),o.push([{key:"Vary",value:"Origin"}])):o.push([{key:"Access-Control-Allow-Origin",value:"*"}]),o}function o(e){return!0===e.credentials?{key:"Access-Control-Allow-Credentials",value:"true"}:null}function a(e){var t=e.exposedHeaders;return t?(t.join&&(t=t.join(",")),t&&t.length?{key:"Access-Control-Expose-Headers",value:t}:null):null}function c(e,n){for(var r=0,i=e.length;r<i;r++){var s=e[r];s&&(Array.isArray(s)?c(s,n):"Vary"===s.key&&s.value?t(n,s.value):s.value&&n.setHeader(s.key,s.value))}}LZ.exports=function(t){var r=null;return r="function"==typeof t?t:function(e,n){n(null,t)},function(t,i,l){r(t,(function(r,u){if(r)l(r);else{var p=e({},n,u),h=null;p.origin&&"function"==typeof p.origin?h=p.origin:p.origin&&(h=function(e,t){t(null,p.origin)}),h?h(t.headers.origin,(function(e,n){e||!n?l(e):(p.origin=n,function(e,t,n,r){var i=[];"OPTIONS"===(t.method&&t.method.toUpperCase&&t.method.toUpperCase())?(i.push(s(e,t)),i.push(o(e)),i.push(function(e){var t=e.methods;return t.join&&(t=e.methods.join(",")),{key:"Access-Control-Allow-Methods",value:t}}(e)),i.push(function(e,t){var n=e.allowedHeaders||e.headers,r=[];return n?n.join&&(n=n.join(",")):(n=t.headers["access-control-request-headers"],r.push([{key:"Vary",value:"Access-Control-Request-Headers"}])),n&&n.length&&r.push([{key:"Access-Control-Allow-Headers",value:n}]),r}(e,t)),i.push(function(e){var t=("number"==typeof e.maxAge||e.maxAge)&&e.maxAge.toString();return t&&t.length?{key:"Access-Control-Max-Age",value:t}:null}(e)),i.push(a(e)),c(i,n),e.preflightContinue?r():(n.statusCode=e.optionsSuccessStatus,n.setHeader("Content-Length","0"),n.end())):(i.push(s(e,t)),i.push(o(e)),i.push(a(e)),c(i,n),r())}(p,t,i,l))})):l()}}))}}}();var FZ=LZ.exports;Object.defineProperty(bG,"__esModule",{value:!0}),bG.Server=bG.BaseServer=void 0;const BZ=L,MZ=S,UZ=wG,qZ=xG,HZ=p,$Z=EV,zZ=AV,WZ=OZ,GZ=dV,VZ=TG,KZ=(0,ah.default)("engine"),YZ=Symbol("responseHeaders");class ZZ extends HZ.EventEmitter{constructor(e={}){super(),this.middlewares=[],this.clients={},this.clientsCount=0,this.opts=Object.assign({wsEngine:WZ.Server,pingTimeout:2e4,pingInterval:25e3,upgradeTimeout:1e4,maxHttpBufferSize:1e6,transports:["polling","websocket"],allowUpgrades:!0,httpCompression:{threshold:1024},cors:!1,allowEIO3:!1},e),e.cookie&&(this.opts.cookie=Object.assign({name:"io",path:"/",httpOnly:!1!==e.cookie.path,sameSite:"lax"},e.cookie)),this.opts.cors&&this.use(FZ(this.opts.cors)),e.perMessageDeflate&&(this.opts.perMessageDeflate=Object.assign({threshold:1024},e.perMessageDeflate)),this.init()}_computePath(e){let t=(e.path||"/engine.io").replace(/\/$/,"");return!1!==e.addTrailingSlash&&(t+="/"),t}upgrades(e){return this.opts.allowUpgrades&&qZ.default[e].upgradesTo||[]}verify(e,t,n){const r=e._query.transport;if(!~this.opts.transports.indexOf(r)||"webtransport"===r)return KZ('unknown transport "%s"',r),n(JZ.errors.UNKNOWN_TRANSPORT,{transport:r});const i=function(e){if((e+="").length<1)return!1;if(!tQ[e.charCodeAt(0)])return KZ('invalid header, index 0, char "%s"',e.charCodeAt(0)),!0;if(e.length<2)return!1;if(!tQ[e.charCodeAt(1)])return KZ('invalid header, index 1, char "%s"',e.charCodeAt(1)),!0;if(e.length<3)return!1;if(!tQ[e.charCodeAt(2)])return KZ('invalid header, index 2, char "%s"',e.charCodeAt(2)),!0;if(e.length<4)return!1;if(!tQ[e.charCodeAt(3)])return KZ('invalid header, index 3, char "%s"',e.charCodeAt(3)),!0;for(let t=4;t<e.length;++t)if(!tQ[e.charCodeAt(t)])return KZ('invalid header, index "%i", char "%s"',t,e.charCodeAt(t)),!0;return!1}(e.headers.origin);if(i){const t=e.headers.origin;return e.headers.origin=null,KZ("origin header invalid"),n(JZ.errors.BAD_REQUEST,{name:"INVALID_ORIGIN",origin:t})}const s=e._query.sid;if(!s)return"GET"!==e.method?n(JZ.errors.BAD_HANDSHAKE_METHOD,{method:e.method}):"websocket"!==r||t?this.opts.allowRequest?this.opts.allowRequest(e,((e,t)=>{if(!t)return n(JZ.errors.FORBIDDEN,{message:e});n()})):n():(KZ("invalid transport upgrade"),n(JZ.errors.BAD_REQUEST,{name:"TRANSPORT_HANDSHAKE_ERROR"}));{if(!this.clients.hasOwnProperty(s))return KZ('unknown sid "%s"',s),n(JZ.errors.UNKNOWN_SID,{sid:s});const e=this.clients[s].transport.name;if(!t&&e!==r)return KZ("bad request: unexpected transport without upgrade"),n(JZ.errors.BAD_REQUEST,{name:"TRANSPORT_MISMATCH",transport:r,previousTransport:e})}n()}use(e){this.middlewares.push(e)}_applyMiddlewares(e,t,n){if(0===this.middlewares.length)return KZ("no middleware to apply, skipping"),n();const r=i=>{KZ("applying middleware n°%d",i+1),this.middlewares[i](e,t,(e=>{if(e)return n(e);i+1<this.middlewares.length?r(i+1):n()}))};r(0)}close(){KZ("closing all open clients");for(let e in this.clients)this.clients.hasOwnProperty(e)&&this.clients[e].close(!0);return this.cleanup(),this}generateId(e){return UZ.generateId()}async handshake(e,t,n){const r="4"===t._query.EIO?4:3;if(3===r&&!this.opts.allowEIO3)return KZ("unsupported protocol version"),this.emit("connection_error",{req:t,code:JZ.errors.UNSUPPORTED_PROTOCOL_VERSION,message:JZ.errorMessages[JZ.errors.UNSUPPORTED_PROTOCOL_VERSION],context:{protocol:r}}),void n(JZ.errors.UNSUPPORTED_PROTOCOL_VERSION);let i;try{i=await this.generateId(t)}catch(e){return KZ("error while generating an id"),this.emit("connection_error",{req:t,code:JZ.errors.BAD_REQUEST,message:JZ.errorMessages[JZ.errors.BAD_REQUEST],context:{name:"ID_GENERATION_ERROR",error:e}}),void n(JZ.errors.BAD_REQUEST)}KZ('handshaking client "%s"',i);try{var s=this.createTransport(e,t);"polling"===e?(s.maxHttpBufferSize=this.opts.maxHttpBufferSize,s.httpCompression=this.opts.httpCompression):"websocket"===e&&(s.perMessageDeflate=this.opts.perMessageDeflate)}catch(r){return KZ('error handshaking to transport "%s"',e),this.emit("connection_error",{req:t,code:JZ.errors.BAD_REQUEST,message:JZ.errorMessages[JZ.errors.BAD_REQUEST],context:{name:"TRANSPORT_HANDSHAKE_ERROR",error:r}}),void n(JZ.errors.BAD_REQUEST)}const o=new $Z.Socket(i,this,s,t,r);return s.on("headers",((e,t)=>{!t._query.sid&&(this.opts.cookie&&(e["Set-Cookie"]=[(0,zZ.serialize)(this.opts.cookie.name,i,this.opts.cookie)]),this.emit("initial_headers",e,t)),this.emit("headers",e,t)})),s.onRequest(t),this.clients[i]=o,this.clientsCount++,o.once("close",(()=>{delete this.clients[i],this.clientsCount--})),this.emit("connection",o),s}async onWebTransportSession(e){const t=setTimeout((()=>{KZ("the client failed to establish a bidirectional stream in the given period"),e.close()}),this.opts.upgradeTimeout),n=e.incomingBidirectionalStreams.getReader(),r=await n.read();if(r.done)return void KZ("session is closed");const i=r.value,s=(0,VZ.createPacketDecoderStream)(this.opts.maxHttpBufferSize,"nodebuffer"),o=i.readable.pipeThrough(s).getReader(),{value:a,done:c}=await o.read();if(c)return void KZ("stream is closed");if(clearTimeout(t),"open"!==a.type)return KZ("invalid WebTransport handshake"),e.close();if(void 0===a.data){const t=new GZ.WebTransport(e,i,o),n=UZ.generateId();KZ('handshaking client "%s" (WebTransport)',n);const r=new $Z.Socket(n,this,t,null,4);return this.clients[n]=r,this.clientsCount++,r.once("close",(()=>{delete this.clients[n],this.clientsCount--})),void this.emit("connection",r)}const l=function(e){try{const t=JSON.parse(e);if("string"==typeof t.sid)return t.sid}catch(e){}}(a.data);if(!l)return KZ("invalid WebTransport handshake"),e.close();const u=this.clients[l];if(u)if(u.upgrading)KZ("transport has already been trying to upgrade"),e.close();else if(u.upgraded)KZ("transport had already been upgraded"),e.close();else{KZ("upgrading existing transport");const t=new GZ.WebTransport(e,i,o);u.maybeUpgrade(t)}else KZ("upgrade attempt for closed client"),e.close()}}bG.BaseServer=ZZ,ZZ.errors={UNKNOWN_TRANSPORT:0,UNKNOWN_SID:1,BAD_HANDSHAKE_METHOD:2,BAD_REQUEST:3,FORBIDDEN:4,UNSUPPORTED_PROTOCOL_VERSION:5},ZZ.errorMessages={0:"Transport unknown",1:"Session ID unknown",2:"Bad handshake method",3:"Bad request",4:"Forbidden",5:"Unsupported protocol version"};class QZ{constructor(e,t){this.req=e,this.socket=t,e[YZ]={}}setHeader(e,t){this.req[YZ][e]=t}getHeader(e){return this.req[YZ][e]}removeHeader(e){delete this.req[YZ][e]}write(){}writeHead(){}end(){this.socket.destroy()}}let JZ=class e extends ZZ{init(){~this.opts.transports.indexOf("websocket")&&(this.ws&&this.ws.close(),this.ws=new this.opts.wsEngine({noServer:!0,clientTracking:!1,perMessageDeflate:this.opts.perMessageDeflate,maxPayload:this.opts.maxHttpBufferSize}),"function"==typeof this.ws.on&&this.ws.on("headers",((e,t)=>{const n=t[YZ]||{};delete t[YZ];!t._query.sid&&this.emit("initial_headers",n,t),this.emit("headers",n,t),KZ("writing headers: %j",n),Object.keys(n).forEach((t=>{e.push(`${t}: ${n[t]}`)}))})))}cleanup(){this.ws&&(KZ("closing webSocketServer"),this.ws.close())}prepare(e){e._query||(e._query=~e.url.indexOf("?")?BZ.parse((0,MZ.parse)(e.url).query):{})}createTransport(e,t){return new qZ.default[e](t)}handleRequest(t,n){KZ('handling "%s" http request "%s"',t.method,t.url),this.prepare(t),t.res=n;const r=(r,i)=>{if(void 0!==r)return this.emit("connection_error",{req:t,code:r,message:e.errorMessages[r],context:i}),void XZ(n,r,i);if(t._query.sid)KZ("setting new request for existing client"),this.clients[t._query.sid].transport.onRequest(t);else{const e=(e,t)=>XZ(n,e,t);this.handshake(t._query.transport,t,e)}};this._applyMiddlewares(t,n,(n=>{n?r(e.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!1,r)}))}handleUpgrade(t,n,r){this.prepare(t);const i=new QZ(t,n),s=(s,o)=>{if(void 0!==s)return this.emit("connection_error",{req:t,code:s,message:e.errorMessages[s],context:o}),void eQ(n,s,o);const a=Buffer.from(r);r=null,i.writeHead(),this.ws.handleUpgrade(t,n,a,(e=>{this.onWebSocket(t,n,e)}))};this._applyMiddlewares(t,i,(n=>{n?s(e.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!0,s)}))}onWebSocket(e,t,n){if(n.on("error",i),void 0!==qZ.default[e._query.transport]&&!qZ.default[e._query.transport].prototype.handlesUpgrades)return KZ("transport doesnt handle upgraded requests"),void n.close();const r=e._query.sid;if(e.websocket=n,r){const t=this.clients[r];if(t)if(t.upgrading)KZ("transport has already been trying to upgrade"),n.close();else if(t.upgraded)KZ("transport had already been upgraded"),n.close();else{KZ("upgrading existing transport"),n.removeListener("error",i);const r=this.createTransport(e._query.transport,e);r.perMessageDeflate=this.opts.perMessageDeflate,t.maybeUpgrade(r)}else KZ("upgrade attempt for closed client"),n.close()}else{const n=(e,n)=>eQ(t,e,n);this.handshake(e._query.transport,e,n)}function i(){KZ("websocket error before upgrade")}}attach(e,t={}){const n=this._computePath(t),r=t.destroyUpgradeTimeout||1e3;function i(e){return n===e.url.slice(0,n.length)}const s=e.listeners("request").slice(0);e.removeAllListeners("request"),e.on("close",this.close.bind(this)),e.on("listening",this.init.bind(this)),e.on("request",((t,r)=>{if(i(t))KZ('intercepting request for path "%s"',n),this.handleRequest(t,r);else{let n=0;const i=s.length;for(;n<i;n++)s[n].call(e,t,r)}})),~this.opts.transports.indexOf("websocket")&&e.on("upgrade",((e,n,s)=>{i(e)?this.handleUpgrade(e,n,s):!1!==t.destroyUpgrade&&setTimeout((function(){if(n.writable&&n.bytesWritten<=0)return n.on("error",(e=>{KZ("error while destroying upgrade: %s",e.message)})),n.end()}),r)}))}};function XZ(e,t,n){const r=t===JZ.errors.FORBIDDEN?403:400,i=n&&n.message?n.message:JZ.errorMessages[t];e.writeHead(r,{"Content-Type":"application/json"}),e.end(JSON.stringify({code:t,message:i}))}function eQ(e,t,n={}){if(e.on("error",(()=>{KZ("ignoring error from closed connection")})),e.writable){const r=n.message||JZ.errorMessages[t],i=Buffer.byteLength(r);e.write("HTTP/1.1 400 Bad Request\r\nConnection: close\r\nContent-type: text/html\r\nContent-Length: "+i+"\r\n\r\n"+r)}e.destroy()}bG.Server=JZ;const tQ=[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];var nQ={},rQ={},iQ={};Object.defineProperty(iQ,"__esModule",{value:!0}),iQ.Polling=void 0;const sQ=SG,oQ=T,aQ=KM,cQ=(0,ah.default)("engine:polling"),lQ={gzip:oQ.createGzip,deflate:oQ.createDeflate};let uQ=class extends sQ.Transport{constructor(e){super(e),this.closeTimeout=3e4}get name(){return"polling"}get supportsFraming(){return!1}onRequest(e){const t=e.res;e.res=null,"get"===e.getMethod()?this.onPollRequest(e,t):"post"===e.getMethod()?this.onDataRequest(e,t):(t.writeStatus("500 Internal Server Error"),t.end())}onPollRequest(e,t){if(this.req)return cQ("request overlap"),this.onError("overlap from client"),t.writeStatus("500 Internal Server Error"),void t.end();cQ("setting request"),this.req=e,this.res=t;e.cleanup=()=>{this.req=this.res=null},t.onAborted((()=>{this.writable=!1,this.onError("poll connection closed prematurely")})),this.writable=!0,this.emit("drain"),this.writable&&this.shouldClose&&(cQ("triggering empty send to append close packet"),this.send([{type:"noop"}]))}onDataRequest(e,t){if(this.dataReq)return this.onError("data request overlap from client"),t.writeStatus("500 Internal Server Error"),void t.end();const n=Number(e.headers["content-length"]);if(!n)return this.onError("content-length header required"),void t.writeStatus("411 Length Required").end();if(n>this.maxHttpBufferSize)return this.onError("payload too large"),void t.writeStatus("413 Payload Too Large").end();if("application/octet-stream"===e.headers["content-type"]&&4===this.protocol)return this.onError("invalid content");let r;this.dataReq=e,this.dataRes=t;let i=0;const s={"Content-Type":"text/html"};this.headers(e,s);for(let e in s)t.writeHeader(e,String(s[e]));const o=e=>{this.onData(e.toString()),this.onDataRequestCleanup(),t.cork((()=>{t.end("ok")}))};t.onAborted((()=>{this.onDataRequestCleanup(),this.onError("data request connection closed prematurely")})),t.onData(((e,s)=>{const a=i+e.byteLength;if(a>n)return this.onError("content-length mismatch"),void t.close();if(!r){if(s)return void o(Buffer.from(e));r=Buffer.allocUnsafe(n)}if(Buffer.from(e).copy(r,i),s)return a!=n?(this.onError("content-length mismatch"),t.writeStatus("400 Content-Length Mismatch").end(),void this.onDataRequestCleanup()):void o(r);i=a}))}onDataRequestCleanup(){this.dataReq=this.dataRes=null}onData(e){cQ('received "%s"',e);const t=e=>{if("close"===e.type)return cQ("got xhr close packet"),this.onClose(),!1;this.onPacket(e)};3===this.protocol?this.parser.decodePayload(e,t):this.parser.decodePayload(e).forEach(t)}onClose(){this.writable&&this.send([{type:"noop"}]),super.onClose()}send(e){this.writable=!1,this.shouldClose&&(cQ("appending close packet to payload"),e.push({type:"close"}),this.shouldClose(),this.shouldClose=null);const t=t=>{const n=e.some((e=>e.options&&e.options.compress));this.write(t,{compress:n})};3===this.protocol?this.parser.encodePayload(e,this.supportsBinary,t):this.parser.encodePayload(e,t)}write(e,t){cQ('writing "%s"',e),this.doWrite(e,t,(()=>{this.req.cleanup()}))}doWrite(e,t,n){const r="string"==typeof e,i={"Content-Type":r?"text/plain; charset=UTF-8":"application/octet-stream"},s=e=>{this.headers(this.req,i),this.res.cork((()=>{Object.keys(i).forEach((e=>{this.res.writeHeader(e,String(i[e]))})),this.res.end(e)})),n()};if(!this.httpCompression||!t.compress)return void s(e);if((r?Buffer.byteLength(e):e.length)<this.httpCompression.threshold)return void s(e);const o=aQ(this.req).encodings(["gzip","deflate"]);o?this.compress(e,o,((e,t)=>{if(e)return this.res.writeStatus("500 Internal Server Error"),this.res.end(),void n(e);i["Content-Encoding"]=o,s(t)})):s(e)}compress(e,t,n){cQ("compressing");const r=[];let i=0;lQ[t](this.httpCompression).on("error",n).on("data",(function(e){r.push(e),i+=e.length})).on("end",(function(){n(null,Buffer.concat(r,i))})).end(e)}doClose(e){let t;cQ("closing");const n=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(cQ("transport writable - closing right away"),this.send([{type:"close"}]),n()):this.discarded?(cQ("transport discarded - closing right away"),n()):(cQ("transport not writable - buffering orderly close"),this.shouldClose=n,t=setTimeout(n,this.closeTimeout))}headers(e,t){t=t||{};const n=e.headers["user-agent"];return n&&(~n.indexOf(";MSIE")||~n.indexOf("Trident/"))&&(t["X-XSS-Protection"]="0"),t["cache-control"]="no-store",this.emit("headers",t,e),t}};iQ.Polling=uQ;var pQ={};Object.defineProperty(pQ,"__esModule",{value:!0}),pQ.WebSocket=void 0;const hQ=SG,dQ=(0,ah.default)("engine:ws");let fQ=class extends hQ.Transport{constructor(e){super(e),this.writable=!1,this.perMessageDeflate=null}get name(){return"websocket"}get handlesUpgrades(){return!0}get supportsFraming(){return!0}send(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t+1===e.length,i=e=>{const t="string"!=typeof e,n=this.perMessageDeflate&&Buffer.byteLength(e)>this.perMessageDeflate.threshold;dQ('writing "%s"',e),this.socket.send(e,t,n),r&&(this.writable=!0,this.emit("drain"))};n.options&&"string"==typeof n.options.wsPreEncoded?i(n.options.wsPreEncoded):this.parser.encodePacket(n,this.supportsBinary,i)}}doClose(e){dQ("closing"),e&&e(),this.socket.end()}};pQ.WebSocket=fQ,Object.defineProperty(rQ,"__esModule",{value:!0});const mQ=iQ,gQ=pQ;rQ.default={polling:mQ.Polling,websocket:gQ.WebSocket},Object.defineProperty(nQ,"__esModule",{value:!0}),nQ.uServer=void 0;const yQ=bG,vQ=rQ,bQ=(0,ah.default)("engine:uws");class _Q extends yQ.BaseServer{init(){}cleanup(){}prepare(e,t){e.method=e.getMethod().toUpperCase(),e.url=e.getUrl();const n=new URLSearchParams(e.getQuery());e._query=Object.fromEntries(n.entries()),e.headers={},e.forEach(((t,n)=>{e.headers[t]=n})),e.connection={remoteAddress:Buffer.from(t.getRemoteAddressAsText()).toString()},t.onAborted((()=>{bQ("response has been aborted")}))}createTransport(e,t){return new vQ.default[e](t)}attach(e,t={}){const n=this._computePath(t);e.any(n,this.handleRequest.bind(this)).ws(n,{compression:t.compression,idleTimeout:t.idleTimeout,maxBackpressure:t.maxBackpressure,maxPayloadLength:this.opts.maxHttpBufferSize,upgrade:this.handleUpgrade.bind(this),open:e=>{const t=e.getUserData().transport;t.socket=e,t.writable=!0,t.emit("drain")},message:(e,t,n)=>{e.getUserData().transport.onData(n?t:Buffer.from(t).toString())},close:(e,t,n)=>{e.getUserData().transport.onClose(t,n)}})}_applyMiddlewares(e,t,n){if(0===this.middlewares.length)return n();e.res=new wQ(t),super._applyMiddlewares(e,e.res,(t=>{e.res.writeHead(),n(t)}))}handleRequest(e,t){bQ('handling "%s" http request "%s"',t.getMethod(),t.getUrl()),this.prepare(t,e),t.res=e;const n=(n,r)=>{if(void 0!==n)return this.emit("connection_error",{req:t,code:n,message:yQ.Server.errorMessages[n],context:r}),void this.abortRequest(t.res,n,r);if(t._query.sid)bQ("setting new request for existing client"),this.clients[t._query.sid].transport.onRequest(t);else{const n=(t,n)=>this.abortRequest(e,t,n);this.handshake(t._query.transport,t,n)}};this._applyMiddlewares(t,e,(e=>{e?n(yQ.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!1,n)}))}handleUpgrade(e,t,n){bQ("on upgrade"),this.prepare(t,e),t.res=e;const r=async(r,i)=>{if(void 0!==r)return this.emit("connection_error",{req:t,code:r,message:yQ.Server.errorMessages[r],context:i}),void this.abortRequest(e,r,i);const s=t._query.sid;let o;if(s){const n=this.clients[s];n?n.upgrading?(bQ("transport has already been trying to upgrade"),e.close()):n.upgraded?(bQ("transport had already been upgraded"),e.close()):(bQ("upgrading existing transport"),o=this.createTransport(t._query.transport,t),n.maybeUpgrade(o)):(bQ("upgrade attempt for closed client"),e.close())}else if(o=await this.handshake(t._query.transport,t,((t,n)=>this.abortRequest(e,t,n))),!o)return;t.res.writeStatus("101 Switching Protocols"),e.upgrade({transport:o},t.getHeader("sec-websocket-key"),t.getHeader("sec-websocket-protocol"),t.getHeader("sec-websocket-extensions"),n)};this._applyMiddlewares(t,e,(e=>{e?r(yQ.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!0,r)}))}abortRequest(e,t,n){const r=t===yQ.Server.errors.FORBIDDEN?"403 Forbidden":"400 Bad Request",i=n&&n.message?n.message:yQ.Server.errorMessages[t];e.writeStatus(r),e.writeHeader("Content-Type","application/json"),e.end(JSON.stringify({code:t,message:i}))}}nQ.uServer=_Q;class wQ{constructor(e){this.res=e,this.statusWritten=!1,this.headers=[],this.isAborted=!1}set statusCode(e){e&&this.writeStatus(200===e?"200 OK":"204 No Content")}writeHead(e){this.statusCode=e}setHeader(e,t){Array.isArray(t)?t.forEach((t=>{this.writeHeader(e,t)})):this.writeHeader(e,t)}removeHeader(){}getHeader(){}writeStatus(e){if(!this.isAborted)return this.res.writeStatus(e),this.statusWritten=!0,this.writeBufferedHeaders(),this}writeHeader(e,t){this.isAborted||"Content-Length"!==e&&(this.statusWritten?this.res.writeHeader(e,t):this.headers.push([e,t]))}writeBufferedHeaders(){this.headers.forEach((([e,t])=>{this.res.writeHeader(e,t)}))}end(e){this.isAborted||this.res.cork((()=>{this.statusWritten||this.writeBufferedHeaders(),this.res.end(e)}))}onData(e){this.isAborted||this.res.onData(e)}onAborted(e){this.isAborted||this.res.onAborted((()=>{this.isAborted=!0,e()}))}cork(e){this.isAborted||this.res.cork(e)}}!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.protocol=e.Transport=e.Socket=e.uServer=e.parser=e.attach=e.listen=e.transports=e.Server=void 0;const t=x,n=bG;Object.defineProperty(e,"Server",{enumerable:!0,get:function(){return n.Server}});const r=xG;e.transports=r.default;const i=TG;e.parser=i;var s=nQ;Object.defineProperty(e,"uServer",{enumerable:!0,get:function(){return s.uServer}});var o=EV;Object.defineProperty(e,"Socket",{enumerable:!0,get:function(){return o.Socket}});var a=SG;function c(e,t){const r=new n.Server(t);return r.attach(e,t),r}Object.defineProperty(e,"Transport",{enumerable:!0,get:function(){return a.Transport}}),e.protocol=i.protocol,e.listen=function(e,n,r){"function"==typeof n&&(r=n,n={});const i=(0,t.createServer)((function(e,t){t.writeHead(501),t.end("Not Implemented")})),s=c(i,n);return s.httpServer=i,i.listen(e,r),s},e.attach=c}(vG);var xQ={},EQ={};function SQ(e){if(e)return function(e){for(var t in SQ.prototype)e[t]=SQ.prototype[t];return e}(e)}SQ.prototype.on=SQ.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},SQ.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},SQ.prototype.off=SQ.prototype.removeListener=SQ.prototype.removeAllListeners=SQ.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var i=0;i<r.length;i++)if((n=r[i])===t||n.fn===t){r.splice(i,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},SQ.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var i=(n=n.slice(0)).length;r<i;++r)n[r].apply(this,t)}return this},SQ.prototype.emitReserved=SQ.prototype.emit,SQ.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},SQ.prototype.hasListeners=function(e){return!!this.listeners(e).length};var TQ=H(Object.freeze({__proto__:null,Emitter:SQ})),DQ={},kQ={};Object.defineProperty(kQ,"__esModule",{value:!0}),kQ.hasBinary=kQ.isBinary=void 0;const AQ="function"==typeof ArrayBuffer,CQ=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,RQ=Object.prototype.toString,OQ="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===RQ.call(Blob),LQ="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===RQ.call(File);function IQ(e){return AQ&&(e instanceof ArrayBuffer||CQ(e))||OQ&&e instanceof Blob||LQ&&e instanceof File}kQ.isBinary=IQ,kQ.hasBinary=function e(t,n){if(!t||"object"!=typeof t)return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n<r;n++)if(e(t[n]))return!0;return!1}if(IQ(t))return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return e(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return!0;return!1},Object.defineProperty(DQ,"__esModule",{value:!0}),DQ.reconstructPacket=DQ.deconstructPacket=void 0;const PQ=kQ;function NQ(e,t){if(!e)return e;if((0,PQ.isBinary)(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=NQ(e[r],t);return n}if("object"==typeof e&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=NQ(e[r],t));return n}return e}function jQ(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=jQ(e[n],t);else if("object"==typeof e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=jQ(e[n],t));return e}DQ.deconstructPacket=function(e){const t=[],n=e.data,r=e;return r.data=NQ(n,t),r.attachments=t.length,{packet:r,buffers:t}},DQ.reconstructPacket=function(e,t){return e.data=jQ(e.data,t),delete e.attachments,e},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Decoder=e.Encoder=e.PacketType=e.protocol=void 0;const t=TQ,n=DQ,r=kQ,i=(0,ah.default)("socket.io-parser"),s=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var o;e.protocol=5,function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(o=e.PacketType||(e.PacketType={}));function a(e){return"[object Object]"===Object.prototype.toString.call(e)}e.Encoder=class{constructor(e){this.replacer=e}encode(e){return i("encoding packet %j",e),e.type!==o.EVENT&&e.type!==o.ACK||!(0,r.hasBinary)(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===o.EVENT?o.BINARY_EVENT:o.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==o.BINARY_EVENT&&e.type!==o.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),i("encoded %j as %s",e,t),t}encodeAsBinary(e){const t=(0,n.deconstructPacket)(e),r=this.encodeAsString(t.packet),i=t.buffers;return i.unshift(r),i}};class c extends t.Emitter{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===o.BINARY_EVENT;n||t.type===o.BINARY_ACK?(t.type=n?o.EVENT:o.ACK,this.reconstructor=new l(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!(0,r.isBinary)(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(void 0===o[n.type])throw new Error("unknown packet type "+n.type);if(n.type===o.BINARY_EVENT||n.type===o.BINARY_ACK){const r=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const i=e.substring(r,t);if(i!=Number(i)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(i)}if("/"===e.charAt(t+1)){const r=t+1;for(;++t;){if(","===e.charAt(t))break;if(t===e.length)break}n.nsp=e.substring(r,t)}else n.nsp="/";const r=e.charAt(t+1);if(""!==r&&Number(r)==r){const r=t+1;for(;++t;){const n=e.charAt(t);if(null==n||Number(n)!=n){--t;break}if(t===e.length)break}n.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(!c.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return i("decoded %s as %j",e,n),n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case o.CONNECT:return a(t);case o.DISCONNECT:return void 0===t;case o.CONNECT_ERROR:return"string"==typeof t||a(t);case o.EVENT:case o.BINARY_EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===s.indexOf(t[0]));case o.ACK:case o.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}e.Decoder=c;class l{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=(0,n.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}}(EQ),Object.defineProperty(xQ,"__esModule",{value:!0}),xQ.Client=void 0;const FQ=EQ,BQ=S,MQ=ah("socket.io:client");xQ.Client=class{constructor(e,t){this.sockets=new Map,this.nsps=new Map,this.server=e,this.conn=t,this.encoder=e.encoder,this.decoder=new e._parser.Decoder,this.id=t.id,this.setup()}get request(){return this.conn.request}setup(){this.onclose=this.onclose.bind(this),this.ondata=this.ondata.bind(this),this.onerror=this.onerror.bind(this),this.ondecoded=this.ondecoded.bind(this),this.decoder.on("decoded",this.ondecoded),this.conn.on("data",this.ondata),this.conn.on("error",this.onerror),this.conn.on("close",this.onclose),this.connectTimeout=setTimeout((()=>{0===this.nsps.size?(MQ("no namespace joined yet, close the client"),this.close()):MQ("the client has already joined a namespace, nothing to do")}),this.server._connectTimeout)}connect(e,t={}){if(this.server._nsps.has(e))return MQ("connecting to namespace %s",e),this.doConnect(e,t);this.server._checkNamespace(e,t,(n=>{n?this.doConnect(e,t):(MQ("creation of namespace %s was denied",e),this._packet({type:FQ.PacketType.CONNECT_ERROR,nsp:e,data:{message:"Invalid namespace"}}))}))}doConnect(e,t){const n=this.server.of(e);n._add(this,t,(e=>{this.sockets.set(e.id,e),this.nsps.set(n.name,e),this.connectTimeout&&(clearTimeout(this.connectTimeout),this.connectTimeout=void 0)}))}_disconnect(){for(const e of this.sockets.values())e.disconnect();this.sockets.clear(),this.close()}_remove(e){if(this.sockets.has(e.id)){const t=this.sockets.get(e.id).nsp.name;this.sockets.delete(e.id),this.nsps.delete(t)}else MQ("ignoring remove for %s",e.id)}close(){"open"===this.conn.readyState&&(MQ("forcing transport close"),this.conn.close(),this.onclose("forced server close"))}_packet(e,t={}){if("open"!==this.conn.readyState)return void MQ("ignoring packet write %j",e);const n=t.preEncoded?e:this.encoder.encode(e);this.writeToEngine(n,t)}writeToEngine(e,t){if(t.volatile&&!this.conn.transport.writable)return void MQ("volatile packet is discarded since the transport is not currently writable");const n=Array.isArray(e)?e:[e];for(const e of n)this.conn.write(e,t)}ondata(e){try{this.decoder.add(e)}catch(e){MQ("invalid packet format"),this.onerror(e)}}ondecoded(e){let t,n;if(3===this.conn.protocol){const r=BQ.parse(e.nsp,!0);t=r.pathname,n=r.query}else t=e.nsp,n=e.data;const r=this.nsps.get(t);r||e.type!==FQ.PacketType.CONNECT?r&&e.type!==FQ.PacketType.CONNECT&&e.type!==FQ.PacketType.CONNECT_ERROR?process.nextTick((function(){r._onpacket(e)})):(MQ("invalid state (packet type: %s)",e.type),this.close()):this.connect(t,n)}onerror(e){for(const t of this.sockets.values())t._onerror(e);this.conn.close()}onclose(e,t){MQ("client close with reason %s",e),this.destroy();for(const n of this.sockets.values())n._onclose(e,t);this.sockets.clear(),this.decoder.destroy()}destroy(){this.conn.removeListener("data",this.ondata),this.conn.removeListener("error",this.onerror),this.conn.removeListener("close",this.onclose),this.decoder.removeListener("decoded",this.ondecoded),this.connectTimeout&&(clearTimeout(this.connectTimeout),this.connectTimeout=void 0)}};var UQ={},qQ={},HQ={};Object.defineProperty(HQ,"__esModule",{value:!0}),HQ.StrictEventEmitter=void 0;const $Q=p;class zQ extends $Q.EventEmitter{on(e,t){return super.on(e,t)}once(e,t){return super.once(e,t)}emit(e,...t){return super.emit(e,...t)}emitReserved(e,...t){return super.emit(e,...t)}emitUntyped(e,...t){return super.emit(e,...t)}listeners(e){return super.listeners(e)}}HQ.StrictEventEmitter=zQ;var WQ,GQ,VQ={};function KQ(){if(WQ)return VQ;WQ=1,Object.defineProperty(VQ,"__esModule",{value:!0}),VQ.RemoteSocket=VQ.BroadcastOperator=void 0;const e=YQ(),t=EQ;class n{constructor(e,t=new Set,n=new Set,r={}){this.adapter=e,this.rooms=t,this.exceptRooms=n,this.flags=r}to(e){const t=new Set(this.rooms);return Array.isArray(e)?e.forEach((e=>t.add(e))):t.add(e),new n(this.adapter,t,this.exceptRooms,this.flags)}in(e){return this.to(e)}except(e){const t=new Set(this.exceptRooms);return Array.isArray(e)?e.forEach((e=>t.add(e))):t.add(e),new n(this.adapter,this.rooms,t,this.flags)}compress(e){const t=Object.assign({},this.flags,{compress:e});return new n(this.adapter,this.rooms,this.exceptRooms,t)}get volatile(){const e=Object.assign({},this.flags,{volatile:!0});return new n(this.adapter,this.rooms,this.exceptRooms,e)}get local(){const e=Object.assign({},this.flags,{local:!0});return new n(this.adapter,this.rooms,this.exceptRooms,e)}timeout(e){const t=Object.assign({},this.flags,{timeout:e});return new n(this.adapter,this.rooms,this.exceptRooms,t)}emit(n,...r){if(e.RESERVED_EVENTS.has(n))throw new Error(`"${String(n)}" is a reserved event name`);const i=[n,...r],s={type:t.PacketType.EVENT,data:i};if(!("function"==typeof i[i.length-1]))return this.adapter.broadcast(s,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags}),!0;const o=i.pop();let a=!1,c=[];const l=setTimeout((()=>{a=!0,o.apply(this,[new Error("operation has timed out"),this.flags.expectSingleResponse?null:c])}),this.flags.timeout);let u=-1,p=0,h=0;const d=()=>{a||u!==p||c.length!==h||(clearTimeout(l),o.apply(this,[null,this.flags.expectSingleResponse?c[0]:c]))};return this.adapter.broadcastWithAck(s,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags},(e=>{h+=e,p++,d()}),(e=>{c.push(e),d()})),this.adapter.serverCount().then((e=>{u=e,d()})),!0}emitWithAck(e,...t){return new Promise(((n,r)=>{t.push(((e,t)=>e?(e.responses=t,r(e)):n(t))),this.emit(e,...t)}))}allSockets(){if(!this.adapter)throw new Error("No adapter for this namespace, are you trying to get the list of clients of a dynamic namespace?");return this.adapter.sockets(this.rooms)}fetchSockets(){return this.adapter.fetchSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags}).then((t=>t.map((t=>t instanceof e.Socket?t:new r(this.adapter,t)))))}socketsJoin(e){this.adapter.addSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},Array.isArray(e)?e:[e])}socketsLeave(e){this.adapter.delSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},Array.isArray(e)?e:[e])}disconnectSockets(e=!1){this.adapter.disconnectSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},e)}}VQ.BroadcastOperator=n;class r{constructor(e,t){this.id=t.id,this.handshake=t.handshake,this.rooms=new Set(t.rooms),this.data=t.data,this.operator=new n(e,new Set([this.id]),new Set,{expectSingleResponse:!0})}timeout(e){return this.operator.timeout(e)}emit(e,...t){return this.operator.emit(e,...t)}join(e){return this.operator.socketsJoin(e)}leave(e){return this.operator.socketsLeave(e)}disconnect(e=!1){return this.operator.disconnectSockets(e),this}}return VQ.RemoteSocket=r,VQ}function YQ(){return GQ||(GQ=1,function(e){var t=U&&U.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Socket=e.RESERVED_EVENTS=void 0;const n=EQ,r=t(ah),i=HQ,s=t(wG),o=KQ(),a=(0,r.default)("socket.io:socket"),c=new Set(["transport error","transport close","forced close","ping timeout","server shutting down","forced server close"]);function l(){}e.RESERVED_EVENTS=new Set(["connect","connect_error","disconnect","disconnecting","newListener","removeListener"]);class u extends i.StrictEventEmitter{constructor(e,t,r,i){super(),this.nsp=e,this.client=t,this.recovered=!1,this.data={},this.connected=!1,this.acks=new Map,this.fns=[],this.flags={},this.server=e.server,this.adapter=this.nsp.adapter,i?(this.id=i.sid,this.pid=i.pid,i.rooms.forEach((e=>this.join(e))),this.data=i.data,i.missedPackets.forEach((e=>{this.packet({type:n.PacketType.EVENT,data:e})})),this.recovered=!0):(3===t.conn.protocol?this.id="/"!==e.name?e.name+"#"+t.id:t.id:this.id=s.default.generateId(),this.server._opts.connectionStateRecovery&&(this.pid=s.default.generateId())),this.handshake=this.buildHandshake(r),this.on("error",l)}buildHandshake(e){var t,n,r,i;return{headers:(null===(t=this.request)||void 0===t?void 0:t.headers)||{},time:new Date+"",address:this.conn.remoteAddress,xdomain:!!(null===(n=this.request)||void 0===n?void 0:n.headers.origin),secure:!this.request||!!this.request.connection.encrypted,issued:+new Date,url:null===(r=this.request)||void 0===r?void 0:r.url,query:(null===(i=this.request)||void 0===i?void 0:i._query)||{},auth:e}}emit(t,...r){if(e.RESERVED_EVENTS.has(t))throw new Error(`"${String(t)}" is a reserved event name`);const i=[t,...r],s={type:n.PacketType.EVENT,data:i};if("function"==typeof i[i.length-1]){const e=this.nsp._ids++;a("emitting packet with ack id %d",e),this.registerAckCallback(e,i.pop()),s.id=e}const o=Object.assign({},this.flags);return this.flags={},this.nsp.server.opts.connectionStateRecovery?this.adapter.broadcast(s,{rooms:new Set([this.id]),except:new Set,flags:o}):(this.notifyOutgoingListeners(s),this.packet(s,o)),!0}emitWithAck(e,...t){const n=void 0!==this.flags.timeout;return new Promise(((r,i)=>{t.push(((e,t)=>n?e?i(e):r(t):r(e))),this.emit(e,...t)}))}registerAckCallback(e,t){const n=this.flags.timeout;if(void 0===n)return void this.acks.set(e,t);const r=setTimeout((()=>{a("event with ack id %d has timed out after %d ms",e,n),this.acks.delete(e),t.call(this,new Error("operation has timed out"))}),n);this.acks.set(e,((...e)=>{clearTimeout(r),t.apply(this,[null,...e])}))}to(e){return this.newBroadcastOperator().to(e)}in(e){return this.newBroadcastOperator().in(e)}except(e){return this.newBroadcastOperator().except(e)}send(...e){return this.emit("message",...e),this}write(...e){return this.emit("message",...e),this}packet(e,t={}){e.nsp=this.nsp.name,t.compress=!1!==t.compress,this.client._packet(e,t)}join(e){return a("join room %s",e),this.adapter.addAll(this.id,new Set(Array.isArray(e)?e:[e]))}leave(e){return a("leave room %s",e),this.adapter.del(this.id,e)}leaveAll(){this.adapter.delAll(this.id)}_onconnect(){a("socket connected - writing packet"),this.connected=!0,this.join(this.id),3===this.conn.protocol?this.packet({type:n.PacketType.CONNECT}):this.packet({type:n.PacketType.CONNECT,data:{sid:this.id,pid:this.pid}})}_onpacket(e){switch(a("got packet %j",e),e.type){case n.PacketType.EVENT:case n.PacketType.BINARY_EVENT:this.onevent(e);break;case n.PacketType.ACK:case n.PacketType.BINARY_ACK:this.onack(e);break;case n.PacketType.DISCONNECT:this.ondisconnect()}}onevent(e){const t=e.data||[];if(a("emitting event %j",t),null!=e.id&&(a("attaching ack callback to event"),t.push(this.ack(e.id))),this._anyListeners&&this._anyListeners.length){const e=this._anyListeners.slice();for(const n of e)n.apply(this,t)}this.dispatch(t)}ack(e){const t=this;let r=!1;return function(){if(r)return;const i=Array.prototype.slice.call(arguments);a("sending ack %j",i),t.packet({id:e,type:n.PacketType.ACK,data:i}),r=!0}}onack(e){const t=this.acks.get(e.id);"function"==typeof t?(a("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),this.acks.delete(e.id)):a("bad ack %s",e.id)}ondisconnect(){a("got disconnect packet"),this._onclose("client namespace disconnect")}_onerror(e){this.emitReserved("error",e)}_onclose(e,t){if(!this.connected)return this;a("closing socket - reason %s",e),this.emitReserved("disconnecting",e,t),this.server._opts.connectionStateRecovery&&c.has(e)&&(a("connection state recovery is enabled for sid %s",this.id),this.adapter.persistSession({sid:this.id,pid:this.pid,rooms:[...this.rooms],data:this.data})),this._cleanup(),this.client._remove(this),this.connected=!1,this.emitReserved("disconnect",e,t)}_cleanup(){this.leaveAll(),this.nsp._remove(this),this.join=l}_error(e){this.packet({type:n.PacketType.CONNECT_ERROR,data:e})}disconnect(e=!1){return this.connected?(e?this.client._disconnect():(this.packet({type:n.PacketType.DISCONNECT}),this._onclose("server namespace disconnect")),this):this}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}get broadcast(){return this.newBroadcastOperator()}get local(){return this.newBroadcastOperator().local}timeout(e){return this.flags.timeout=e,this}dispatch(e){a("dispatching an event %j",e),this.run(e,(t=>{process.nextTick((()=>{if(t)return this._onerror(t);this.connected?super.emitUntyped.apply(this,e):a("ignore packet received after disconnection")}))}))}use(e){return this.fns.push(e),this}run(e,t){const n=this.fns.slice(0);if(!n.length)return t(null);!function r(i){n[i](e,(function(e){return e?t(e):n[i+1]?void r(i+1):t(null)}))}(0)}get disconnected(){return!this.connected}get request(){return this.client.request}get conn(){return this.client.conn}get rooms(){return this.adapter.socketRooms(this.id)||new Set}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const n of t)n.apply(this,e.data)}}newBroadcastOperator(){const e=Object.assign({},this.flags);return this.flags={},new o.BroadcastOperator(this.adapter,new Set,new Set([this.id]),e)}}e.Socket=u}(qQ)),qQ}!function(e){var t=U&&U.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Namespace=e.RESERVED_EVENTS=void 0;const n=YQ(),r=HQ,i=t(ah),s=KQ(),o=(0,i.default)("socket.io:namespace");e.RESERVED_EVENTS=new Set(["connect","connection","new_namespace"]);class a extends r.StrictEventEmitter{constructor(e,t){super(),this.sockets=new Map,this._fns=[],this._ids=0,this.server=e,this.name=t,this._initAdapter()}_initAdapter(){this.adapter=new(this.server.adapter())(this)}use(e){return this._fns.push(e),this}run(e,t){const n=this._fns.slice(0);if(!n.length)return t(null);!function r(i){n[i](e,(function(e){return e?t(e):n[i+1]?void r(i+1):t(null)}))}(0)}to(e){return new s.BroadcastOperator(this.adapter).to(e)}in(e){return new s.BroadcastOperator(this.adapter).in(e)}except(e){return new s.BroadcastOperator(this.adapter).except(e)}async _add(e,t,n){var r;o("adding socket to nsp %s",this.name);const i=await this._createSocket(e,t);if((null===(r=this.server.opts.connectionStateRecovery)||void 0===r?void 0:r.skipMiddlewares)&&i.recovered&&"open"===e.conn.readyState)return this._doConnect(i,n);this.run(i,(t=>{process.nextTick((()=>"open"!==e.conn.readyState?(o("next called after client was closed - ignoring socket"),void i._cleanup()):t?(o("middleware error, sending CONNECT_ERROR packet to the client"),i._cleanup(),3===e.conn.protocol?i._error(t.data||t.message):i._error({message:t.message,data:t.data})):void this._doConnect(i,n)))}))}async _createSocket(e,t){const r=t.pid,i=t.offset;if(this.server.opts.connectionStateRecovery&&"string"==typeof r&&"string"==typeof i){let s;try{s=await this.adapter.restoreSession(r,i)}catch(e){o("error while restoring session: %s",e)}if(s)return o("connection state recovered for sid %s",s.sid),new n.Socket(this,e,t,s)}return new n.Socket(this,e,t)}_doConnect(e,t){this.sockets.set(e.id,e),e._onconnect(),t&&t(e),this.emitReserved("connect",e),this.emitReserved("connection",e)}_remove(e){this.sockets.has(e.id)?this.sockets.delete(e.id):o("ignoring remove for %s",e.id)}emit(e,...t){return new s.BroadcastOperator(this.adapter).emit(e,...t)}send(...e){return this.emit("message",...e),this}write(...e){return this.emit("message",...e),this}serverSideEmit(t,...n){if(e.RESERVED_EVENTS.has(t))throw new Error(`"${String(t)}" is a reserved event name`);return n.unshift(t),this.adapter.serverSideEmit(n),!0}serverSideEmitWithAck(e,...t){return new Promise(((n,r)=>{t.push(((e,t)=>e?(e.responses=t,r(e)):n(t))),this.serverSideEmit(e,...t)}))}_onServerSideEmit(e){super.emitUntyped.apply(this,e)}allSockets(){return new s.BroadcastOperator(this.adapter).allSockets()}compress(e){return new s.BroadcastOperator(this.adapter).compress(e)}get volatile(){return new s.BroadcastOperator(this.adapter).volatile}get local(){return new s.BroadcastOperator(this.adapter).local}timeout(e){return new s.BroadcastOperator(this.adapter).timeout(e)}fetchSockets(){return new s.BroadcastOperator(this.adapter).fetchSockets()}socketsJoin(e){return new s.BroadcastOperator(this.adapter).socketsJoin(e)}socketsLeave(e){return new s.BroadcastOperator(this.adapter).socketsLeave(e)}disconnectSockets(e=!1){return new s.BroadcastOperator(this.adapter).disconnectSockets(e)}}e.Namespace=a}(UQ);var ZQ={},QQ={},JQ={},XQ={};Object.defineProperty(XQ,"__esModule",{value:!0}),XQ.yeast=XQ.decode=XQ.encode=void 0;const eJ="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),tJ=64,nJ={};let rJ,iJ=0,sJ=0;function oJ(e){let t="";do{t=eJ[e%tJ]+t,e=Math.floor(e/tJ)}while(e>0);return t}for(XQ.encode=oJ,XQ.decode=function(e){let t=0;for(sJ=0;sJ<e.length;sJ++)t=t*tJ+nJ[e.charAt(sJ)];return t},XQ.yeast=function(){const e=oJ(+new Date);return e!==rJ?(iJ=0,rJ=e):e+"."+oJ(iJ++)};sJ<tJ;sJ++)nJ[eJ[sJ]]=sJ;var aJ;Object.defineProperty(JQ,"__esModule",{value:!0}),JQ.SessionAwareAdapter=JQ.Adapter=void 0;const cJ=p,lJ=XQ,uJ=OZ,pJ="function"==typeof(null===(aJ=null==uJ?void 0:uJ.Sender)||void 0===aJ?void 0:aJ.frame);class hJ extends cJ.EventEmitter{constructor(e){super(),this.nsp=e,this.rooms=new Map,this.sids=new Map,this.encoder=e.server.encoder}init(){}close(){}serverCount(){return Promise.resolve(1)}addAll(e,t){this.sids.has(e)||this.sids.set(e,new Set);for(const n of t)this.sids.get(e).add(n),this.rooms.has(n)||(this.rooms.set(n,new Set),this.emit("create-room",n)),this.rooms.get(n).has(e)||(this.rooms.get(n).add(e),this.emit("join-room",n,e))}del(e,t){this.sids.has(e)&&this.sids.get(e).delete(t),this._del(t,e)}_del(e,t){const n=this.rooms.get(e);if(null!=n){n.delete(t)&&this.emit("leave-room",e,t),0===n.size&&this.rooms.delete(e)&&this.emit("delete-room",e)}}delAll(e){if(this.sids.has(e)){for(const t of this.sids.get(e))this._del(t,e);this.sids.delete(e)}}broadcast(e,t){const n=t.flags||{},r={preEncoded:!0,volatile:n.volatile,compress:n.compress};e.nsp=this.nsp.name;const i=this._encode(e,r);this.apply(t,(t=>{"function"==typeof t.notifyOutgoingListeners&&t.notifyOutgoingListeners(e),t.client.writeToEngine(i,r)}))}broadcastWithAck(e,t,n,r){const i=t.flags||{},s={preEncoded:!0,volatile:i.volatile,compress:i.compress};e.nsp=this.nsp.name,e.id=this.nsp._ids++;const o=this._encode(e,s);let a=0;this.apply(t,(t=>{a++,t.acks.set(e.id,r),"function"==typeof t.notifyOutgoingListeners&&t.notifyOutgoingListeners(e),t.client.writeToEngine(o,s)})),n(a)}_encode(e,t){const n=this.encoder.encode(e);if(pJ&&1===n.length&&"string"==typeof n[0]){const e=Buffer.from("4"+n[0]);t.wsPreEncodedFrame=uJ.Sender.frame(e,{readOnly:!1,mask:!1,rsv1:!1,opcode:1,fin:!0})}return n}sockets(e){const t=new Set;return this.apply({rooms:e},(e=>{t.add(e.id)})),Promise.resolve(t)}socketRooms(e){return this.sids.get(e)}fetchSockets(e){const t=[];return this.apply(e,(e=>{t.push(e)})),Promise.resolve(t)}addSockets(e,t){this.apply(e,(e=>{e.join(t)}))}delSockets(e,t){this.apply(e,(e=>{t.forEach((t=>e.leave(t)))}))}disconnectSockets(e,t){this.apply(e,(e=>{e.disconnect(t)}))}apply(e,t){const n=e.rooms,r=this.computeExceptSids(e.except);if(n.size){const e=new Set;for(const i of n)if(this.rooms.has(i))for(const n of this.rooms.get(i)){if(e.has(n)||r.has(n))continue;const i=this.nsp.sockets.get(n);i&&(t(i),e.add(n))}}else for(const[e]of this.sids){if(r.has(e))continue;const n=this.nsp.sockets.get(e);n&&t(n)}}computeExceptSids(e){const t=new Set;if(e&&e.size>0)for(const n of e)this.rooms.has(n)&&this.rooms.get(n).forEach((e=>t.add(e)));return t}serverSideEmit(e){console.warn("this adapter does not support the serverSideEmit() functionality")}persistSession(e){}restoreSession(e,t){return null}}JQ.Adapter=hJ;function dJ(e,t){const n=0===t.rooms.size||e.some((e=>t.rooms.has(e))),r=e.every((e=>!t.except.has(e)));return n&&r}JQ.SessionAwareAdapter=class extends hJ{constructor(e){super(e),this.nsp=e,this.sessions=new Map,this.packets=[],this.maxDisconnectionDuration=e.server.opts.connectionStateRecovery.maxDisconnectionDuration;const t=setInterval((()=>{const e=Date.now()-this.maxDisconnectionDuration;this.sessions.forEach(((t,n)=>{t.disconnectedAt<e&&this.sessions.delete(n)}));for(let t=this.packets.length-1;t>=0;t--){if(this.packets[t].emittedAt<e){this.packets.splice(0,t+1);break}}}),6e4);t.unref()}persistSession(e){e.disconnectedAt=Date.now(),this.sessions.set(e.pid,e)}restoreSession(e,t){const n=this.sessions.get(e);if(!n)return null;if(n.disconnectedAt+this.maxDisconnectionDuration<Date.now())return this.sessions.delete(e),null;const r=this.packets.findIndex((e=>e.id===t));if(-1===r)return null;const i=[];for(let e=r+1;e<this.packets.length;e++){const t=this.packets[e];dJ(n.rooms,t.opts)&&i.push(t.data)}return Promise.resolve(Object.assign(Object.assign({},n),{missedPackets:i}))}broadcast(e,t){var n;const r=2===e.type,i=void 0===e.id,s=void 0===(null===(n=t.flags)||void 0===n?void 0:n.volatile);if(r&&i&&s){const n=(0,lJ.yeast)();e.data.push(n),this.packets.push({id:n,opts:t,data:e.data,emittedAt:Date.now()})}super.broadcast(e,t)}};var fJ={};!function(e){var t=U&&U.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};Object.defineProperty(e,"__esModule",{value:!0}),e.ClusterAdapterWithHeartbeat=e.ClusterAdapter=e.MessageType=void 0;const n=JQ,r=w,i=(0,ah.debug)("socket.io-adapter"),s=5e3;function o(){return(0,r.randomBytes)(8).toString("hex")}var a;function c(e){return{rooms:[...e.rooms],except:[...e.except],flags:e.flags}}function l(e){return{rooms:new Set(e.rooms),except:new Set(e.except),flags:e.flags}}!function(e){e[e.INITIAL_HEARTBEAT=1]="INITIAL_HEARTBEAT",e[e.HEARTBEAT=2]="HEARTBEAT",e[e.BROADCAST=3]="BROADCAST",e[e.SOCKETS_JOIN=4]="SOCKETS_JOIN",e[e.SOCKETS_LEAVE=5]="SOCKETS_LEAVE",e[e.DISCONNECT_SOCKETS=6]="DISCONNECT_SOCKETS",e[e.FETCH_SOCKETS=7]="FETCH_SOCKETS",e[e.FETCH_SOCKETS_RESPONSE=8]="FETCH_SOCKETS_RESPONSE",e[e.SERVER_SIDE_EMIT=9]="SERVER_SIDE_EMIT",e[e.SERVER_SIDE_EMIT_RESPONSE=10]="SERVER_SIDE_EMIT_RESPONSE",e[e.BROADCAST_CLIENT_COUNT=11]="BROADCAST_CLIENT_COUNT",e[e.BROADCAST_ACK=12]="BROADCAST_ACK",e[e.ADAPTER_CLOSE=13]="ADAPTER_CLOSE"}(a=e.MessageType||(e.MessageType={}));class u extends n.Adapter{constructor(e){super(e),this.requests=new Map,this.ackRequests=new Map,this.uid=o()}onMessage(e,n){if(e.uid===this.uid)return i("[%s] ignore message from self",this.uid);switch(i("[%s] new event of type %d from %s",this.uid,e.type,e.uid),e.type){case a.BROADCAST:if(void 0!==e.data.requestId)super.broadcastWithAck(e.data.packet,l(e.data.opts),(t=>{i("[%s] waiting for %d client acknowledgements",this.uid,t),this.publishResponse(e.uid,{type:a.BROADCAST_CLIENT_COUNT,data:{requestId:e.data.requestId,clientCount:t}})}),(t=>{i("[%s] received acknowledgement with value %j",this.uid,t),this.publishResponse(e.uid,{type:a.BROADCAST_ACK,data:{requestId:e.data.requestId,packet:t}})}));else{const t=e.data.packet,r=l(e.data.opts);this.addOffsetIfNecessary(t,r,n),super.broadcast(t,r)}break;case a.SOCKETS_JOIN:super.addSockets(l(e.data.opts),e.data.rooms);break;case a.SOCKETS_LEAVE:super.delSockets(l(e.data.opts),e.data.rooms);break;case a.DISCONNECT_SOCKETS:super.disconnectSockets(l(e.data.opts),e.data.close);break;case a.FETCH_SOCKETS:i("[%s] calling fetchSockets with opts %j",this.uid,e.data.opts),super.fetchSockets(l(e.data.opts)).then((n=>{this.publishResponse(e.uid,{type:a.FETCH_SOCKETS_RESPONSE,data:{requestId:e.data.requestId,sockets:n.map((e=>{const n=e.handshake,r=t(n,["sessionStore"]);return{id:e.id,handshake:r,rooms:[...e.rooms],data:e.data}}))}})}));break;case a.SERVER_SIDE_EMIT:{const t=e.data.packet;if(!(void 0!==e.data.requestId))return void this.nsp._onServerSideEmit(t);let n=!1;const r=t=>{n||(n=!0,i("[%s] calling acknowledgement with %j",this.uid,t),this.publishResponse(e.uid,{type:a.SERVER_SIDE_EMIT_RESPONSE,data:{requestId:e.data.requestId,packet:t}}))};this.nsp._onServerSideEmit([...t,r]);break}case a.BROADCAST_CLIENT_COUNT:case a.BROADCAST_ACK:case a.FETCH_SOCKETS_RESPONSE:case a.SERVER_SIDE_EMIT_RESPONSE:this.onResponse(e);break;default:i("[%s] unknown message type: %s",this.uid,e.type)}}onResponse(e){var t,n;const r=e.data.requestId;switch(i("[%s] received response %s to request %s",this.uid,e.type,r),e.type){case a.BROADCAST_CLIENT_COUNT:null===(t=this.ackRequests.get(r))||void 0===t||t.clientCountCallback(e.data.clientCount);break;case a.BROADCAST_ACK:null===(n=this.ackRequests.get(r))||void 0===n||n.ack(e.data.packet);break;case a.FETCH_SOCKETS_RESPONSE:{const t=this.requests.get(r);if(!t)return;t.current++,e.data.sockets.forEach((e=>t.responses.push(e))),t.current===t.expected&&(clearTimeout(t.timeout),t.resolve(t.responses),this.requests.delete(r));break}case a.SERVER_SIDE_EMIT_RESPONSE:{const t=this.requests.get(r);if(!t)return;t.current++,t.responses.push(e.data.packet),t.current===t.expected&&(clearTimeout(t.timeout),t.resolve(null,t.responses),this.requests.delete(r));break}default:i("[%s] unknown response type: %s",this.uid,e.type)}}async broadcast(e,t){var n;if(!(null===(n=t.flags)||void 0===n?void 0:n.local))try{const n=await this.publishAndReturnOffset({type:a.BROADCAST,data:{packet:e,opts:c(t)}});this.addOffsetIfNecessary(e,t,n)}catch(e){return i("[%s] error while broadcasting message: %s",this.uid,e.message)}super.broadcast(e,t)}addOffsetIfNecessary(e,t,n){var r;if(!this.nsp.server.opts.connectionStateRecovery)return;const i=2===e.type,s=void 0===e.id,o=void 0===(null===(r=t.flags)||void 0===r?void 0:r.volatile);i&&s&&o&&e.data.push(n)}broadcastWithAck(e,t,n,r){var i;if(!(null===(i=null==t?void 0:t.flags)||void 0===i?void 0:i.local)){const i=o();this.ackRequests.set(i,{clientCountCallback:n,ack:r}),this.publish({type:a.BROADCAST,data:{packet:e,requestId:i,opts:c(t)}}),setTimeout((()=>{this.ackRequests.delete(i)}),t.flags.timeout)}super.broadcastWithAck(e,t,n,r)}async addSockets(e,t){var n;if(!(null===(n=e.flags)||void 0===n?void 0:n.local))try{await this.publishAndReturnOffset({type:a.SOCKETS_JOIN,data:{opts:c(e),rooms:t}})}catch(e){i("[%s] error while publishing message: %s",this.uid,e.message)}super.addSockets(e,t)}async delSockets(e,t){var n;if(!(null===(n=e.flags)||void 0===n?void 0:n.local))try{await this.publishAndReturnOffset({type:a.SOCKETS_LEAVE,data:{opts:c(e),rooms:t}})}catch(e){i("[%s] error while publishing message: %s",this.uid,e.message)}super.delSockets(e,t)}async disconnectSockets(e,t){var n;if(!(null===(n=e.flags)||void 0===n?void 0:n.local))try{await this.publishAndReturnOffset({type:a.DISCONNECT_SOCKETS,data:{opts:c(e),close:t}})}catch(e){i("[%s] error while publishing message: %s",this.uid,e.message)}super.disconnectSockets(e,t)}async fetchSockets(e){var t;const[n,r]=await Promise.all([super.fetchSockets(e),this.serverCount()]),i=r-1;if((null===(t=e.flags)||void 0===t?void 0:t.local)||i<=0)return n;const l=o();return new Promise(((t,r)=>{const o=setTimeout((()=>{const e=this.requests.get(l);e&&(r(new Error(`timeout reached: only ${e.current} responses received out of ${e.expected}`)),this.requests.delete(l))}),e.flags.timeout||s),u={type:a.FETCH_SOCKETS,resolve:t,timeout:o,current:0,expected:i,responses:n};this.requests.set(l,u),this.publish({type:a.FETCH_SOCKETS,data:{opts:c(e),requestId:l}})}))}async serverSideEmit(e){if(!("function"==typeof e[e.length-1]))return this.publish({type:a.SERVER_SIDE_EMIT,data:{packet:e}});const t=e.pop(),n=await this.serverCount()-1;if(i('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,n),n<=0)return t(null,[]);const r=o(),c=setTimeout((()=>{const e=this.requests.get(r);e&&(t(new Error(`timeout reached: only ${e.current} responses received out of ${e.expected}`),e.responses),this.requests.delete(r))}),s),l={type:a.SERVER_SIDE_EMIT,resolve:t,timeout:c,current:0,expected:n,responses:[]};this.requests.set(r,l),this.publish({type:a.SERVER_SIDE_EMIT,data:{requestId:r,packet:e}})}publish(e){this.publishAndReturnOffset(e).catch((e=>{i("[%s] error while publishing message: %s",this.uid,e)}))}publishAndReturnOffset(e){return e.uid=this.uid,e.nsp=this.nsp.name,this.doPublish(e)}publishResponse(e,t){t.uid=this.uid,t.nsp=this.nsp.name,this.doPublishResponse(e,t).catch((e=>{i("[%s] error while publishing response: %s",this.uid,e)}))}}e.ClusterAdapter=u;e.ClusterAdapterWithHeartbeat=class extends u{constructor(e,t){super(e),this.nodesMap=new Map,this.customRequests=new Map,this._opts=Object.assign({heartbeatInterval:5e3,heartbeatTimeout:1e4},t),this.cleanupTimer=setInterval((()=>{const e=Date.now();this.nodesMap.forEach(((t,n)=>{e-t>this._opts.heartbeatTimeout&&(i("[%s] node %s seems down",this.uid,n),this.removeNode(n))}))}),1e3)}init(){this.publish({type:a.INITIAL_HEARTBEAT})}scheduleHeartbeat(){this.heartbeatTimer?this.heartbeatTimer.refresh():this.heartbeatTimer=setTimeout((()=>{this.publish({type:a.HEARTBEAT})}),this._opts.heartbeatInterval)}close(){this.publish({type:a.ADAPTER_CLOSE}),clearTimeout(this.heartbeatTimer),this.cleanupTimer&&clearInterval(this.cleanupTimer)}onMessage(e,t){if(e.uid===this.uid)return i("[%s] ignore message from self",this.uid);switch(e.uid&&"emitter"!==e.uid&&this.nodesMap.set(e.uid,Date.now()),i("[%s] new event of type %d from %s",this.uid,e.type,e.uid),e.type){case a.INITIAL_HEARTBEAT:this.publish({type:a.HEARTBEAT});break;case a.HEARTBEAT:break;case a.ADAPTER_CLOSE:this.removeNode(e.uid);break;default:super.onMessage(e,t)}}serverCount(){return Promise.resolve(1+this.nodesMap.size)}publish(e){return this.scheduleHeartbeat(),super.publish(e)}async serverSideEmit(e){if(!("function"==typeof e[e.length-1]))return this.publish({type:a.SERVER_SIDE_EMIT,data:{packet:e}});const t=e.pop(),n=this.nodesMap.size;if(i('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,n),n<=0)return t(null,[]);const r=o(),c=setTimeout((()=>{const e=this.customRequests.get(r);e&&(t(new Error(`timeout reached: missing ${e.missingUids.size} responses`),e.responses),this.customRequests.delete(r))}),s),l={type:a.SERVER_SIDE_EMIT,resolve:t,timeout:c,missingUids:new Set([...this.nodesMap.keys()]),responses:[]};this.customRequests.set(r,l),this.publish({type:a.SERVER_SIDE_EMIT,data:{requestId:r,packet:e}})}async fetchSockets(e){var t;const[n,r]=await Promise.all([super.fetchSockets({rooms:e.rooms,except:e.except,flags:{local:!0}}),this.serverCount()]),i=r-1;if((null===(t=e.flags)||void 0===t?void 0:t.local)||i<=0)return n;const l=o();return new Promise(((t,r)=>{const i=setTimeout((()=>{const e=this.customRequests.get(l);e&&(r(new Error(`timeout reached: missing ${e.missingUids.size} responses`)),this.customRequests.delete(l))}),e.flags.timeout||s),o={type:a.FETCH_SOCKETS,resolve:t,timeout:i,missingUids:new Set([...this.nodesMap.keys()]),responses:n};this.customRequests.set(l,o),this.publish({type:a.FETCH_SOCKETS,data:{opts:c(e),requestId:l}})}))}onResponse(e){const t=e.data.requestId;switch(i("[%s] received response %s to request %s",this.uid,e.type,t),e.type){case a.FETCH_SOCKETS_RESPONSE:{const n=this.customRequests.get(t);if(!n)return;e.data.sockets.forEach((e=>n.responses.push(e))),n.missingUids.delete(e.uid),0===n.missingUids.size&&(clearTimeout(n.timeout),n.resolve(n.responses),this.customRequests.delete(t));break}case a.SERVER_SIDE_EMIT_RESPONSE:{const n=this.customRequests.get(t);if(!n)return;n.responses.push(e.data.packet),n.missingUids.delete(e.uid),0===n.missingUids.size&&(clearTimeout(n.timeout),n.resolve(null,n.responses),this.customRequests.delete(t));break}default:super.onResponse(e)}}removeNode(e){this.customRequests.forEach(((t,n)=>{t.missingUids.delete(e),0===t.missingUids.size&&(clearTimeout(t.timeout),t.type===a.FETCH_SOCKETS?t.resolve(t.responses):t.type===a.SERVER_SIDE_EMIT&&t.resolve(null,t.responses),this.customRequests.delete(n))})),this.nodesMap.delete(e)}}}(fJ),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MessageType=e.ClusterAdapterWithHeartbeat=e.ClusterAdapter=e.SessionAwareAdapter=e.Adapter=void 0;var t=JQ;Object.defineProperty(e,"Adapter",{enumerable:!0,get:function(){return t.Adapter}}),Object.defineProperty(e,"SessionAwareAdapter",{enumerable:!0,get:function(){return t.SessionAwareAdapter}});var n=fJ;Object.defineProperty(e,"ClusterAdapter",{enumerable:!0,get:function(){return n.ClusterAdapter}}),Object.defineProperty(e,"ClusterAdapterWithHeartbeat",{enumerable:!0,get:function(){return n.ClusterAdapterWithHeartbeat}}),Object.defineProperty(e,"MessageType",{enumerable:!0,get:function(){return n.MessageType}})}(QQ);var mJ=U&&U.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(ZQ,"__esModule",{value:!0}),ZQ.ParentNamespace=void 0;const gJ=UQ,yJ=QQ,vJ=(0,mJ(ah).default)("socket.io:parent-namespace");class bJ extends gJ.Namespace{constructor(e){super(e,"/_"+bJ.count++),this.children=new Set}_initAdapter(){this.adapter=new _J(this,this.children)}emit(e,...t){return this.children.forEach((n=>{n.emit(e,...t)})),!0}createChild(e){vJ("creating child namespace %s",e);const t=new gJ.Namespace(this.server,e);if(t._fns=this._fns.slice(0),this.listeners("connect").forEach((e=>t.on("connect",e))),this.listeners("connection").forEach((e=>t.on("connection",e))),this.children.add(t),this.server._opts.cleanupEmptyChildNamespaces){const n=t._remove;t._remove=r=>{n.call(t,r),0===t.sockets.size&&(vJ("closing child namespace %s",e),t.adapter.close(),this.server._nsps.delete(t.name),this.children.delete(t))}}return this.server._nsps.set(e,t),this.server.sockets.emitReserved("new_namespace",t),t}fetchSockets(){throw new Error("fetchSockets() is not supported on parent namespaces")}}ZQ.ParentNamespace=bJ,bJ.count=0;class _J extends yJ.Adapter{constructor(e,t){super(e),this.children=t}broadcast(e,t){this.children.forEach((n=>{n.adapter.broadcast(e,t)}))}}var wJ={},xJ=U&&U.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(wJ,"__esModule",{value:!0}),wJ.serveFile=wJ.restoreAdapter=wJ.patchAdapter=void 0;const EJ=QQ,SJ=s,TJ=(0,xJ(ah).default)("socket.io:adapter-uws"),DJ="",{addAll:kJ,del:AJ,broadcast:CJ}=EJ.Adapter.prototype;function RJ(e,t,n,r){const i=t.conn.id,s=t.conn.transport.socket;n&&(TJ("subscribe connection %s to topic %s",i,e),s.subscribe(e)),r.forEach((t=>{const n=`${e}${DJ}${t}`;TJ("subscribe connection %s to topic %s",i,n),s.subscribe(n)}))}wJ.patchAdapter=function(e){EJ.Adapter.prototype.addAll=function(e,t){const n=!this.sids.has(e);kJ.call(this,e,t);const r=this.nsp.sockets.get(e);r&&("websocket"!==r.conn.transport.name?n&&r.conn.on("upgrade",(()=>{const t=this.sids.get(e);t&&RJ(this.nsp.name,r,n,t)})):RJ(this.nsp.name,r,n,t))},EJ.Adapter.prototype.del=function(e,t){AJ.call(this,e,t);const n=this.nsp.sockets.get(e);if(n&&"websocket"===n.conn.transport.name){const e=n.conn.id,r=n.conn.transport.socket,i=`${this.nsp.name}${DJ}${t}`;TJ("unsubscribe connection %s from topic %s",e,i),r.unsubscribe(i)}},EJ.Adapter.prototype.broadcast=function(t,n){if(!(n.rooms.size<=1&&0===n.except.size))return void CJ.call(this,t,n);const r=n.flags||{},i={preEncoded:!0,volatile:r.volatile,compress:r.compress};t.nsp=this.nsp.name;const s=this.encoder.encode(t),o=0===n.rooms.size?this.nsp.name:`${this.nsp.name}${DJ}${n.rooms.keys().next().value}`;TJ("fast publish to %s",o),s.forEach((t=>{const n="string"!=typeof t;e.publish(o,n?t:"4"+t,n)})),this.apply(n,(e=>{"websocket"!==e.conn.transport.name&&e.client.writeToEngine(s,i)}))}},wJ.restoreAdapter=function(){EJ.Adapter.prototype.addAll=kJ,EJ.Adapter.prototype.del=AJ,EJ.Adapter.prototype.broadcast=CJ};wJ.serveFile=function(e,t){const{size:n}=(0,SJ.statSync)(t),r=(0,SJ.createReadStream)(t),i=()=>!r.destroyed&&r.destroy();e.onAborted(i),r.on("data",(t=>{const i=(e=>{const{buffer:t,byteOffset:n,byteLength:r}=e;return t.slice(n,n+r)})(t),s=e.getWriteOffset(),[o,a]=e.tryEnd(i,n);a||o||(r.pause(),e.onWritable((t=>{const[o,a]=e.tryEnd(i.slice(t-s),n);return!a&&o&&r.resume(),o})))})).on("error",(e=>{throw i(),e})).on("end",i)};var OJ="4.7.5";!function(e,t){var n=U&&U.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=U&&U.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=U&&U.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return r(t,e),t},a=U&&U.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Namespace=t.Socket=t.Server=void 0;const c=x,l=s,u=T,d=KM,f=h,m=o,g=vG,y=xQ,v=p,b=UQ;Object.defineProperty(t,"Namespace",{enumerable:!0,get:function(){return b.Namespace}});const _=ZQ,w=QQ,E=i(EQ),S=a(ah),D=YQ();Object.defineProperty(t,"Socket",{enumerable:!0,get:function(){return D.Socket}});const k=HQ,A=wJ,C=a(FZ),R=(0,S.default)("socket.io:server"),O=OJ,L=/\.map/;class I extends k.StrictEventEmitter{constructor(e,t={}){super(),this._nsps=new Map,this.parentNsps=new Map,this.parentNamespacesFromRegExp=new Map,"object"==typeof e&&e instanceof Object&&!e.listen&&(t=e,e=void 0),this.path(t.path||"/socket.io"),this.connectTimeout(t.connectTimeout||45e3),this.serveClient(!1!==t.serveClient),this._parser=t.parser||E,this.encoder=new this._parser.Encoder,this.opts=t,t.connectionStateRecovery?(t.connectionStateRecovery=Object.assign({maxDisconnectionDuration:12e4,skipMiddlewares:!0},t.connectionStateRecovery),this.adapter(t.adapter||w.SessionAwareAdapter)):this.adapter(t.adapter||w.Adapter),t.cleanupEmptyChildNamespaces=!!t.cleanupEmptyChildNamespaces,this.sockets=this.of("/"),(e||"number"==typeof e)&&this.attach(e),this.opts.cors&&(this._corsMiddleware=(0,C.default)(this.opts.cors))}get _opts(){return this.opts}serveClient(e){return arguments.length?(this._serveClient=e,this):this._serveClient}_checkNamespace(e,t,n){if(0===this.parentNsps.size)return n(!1);const r=this.parentNsps.keys(),i=()=>{const s=r.next();if(s.done)return n(!1);s.value(e,t,((t,r)=>{if(t||!r)return i();if(this._nsps.has(e))return R("dynamic namespace %s already exists",e),n(this._nsps.get(e));const o=this.parentNsps.get(s.value).createChild(e);R("dynamic namespace %s was created",e),n(o)}))};i()}path(e){if(!arguments.length)return this._path;this._path=e.replace(/\/$/,"");const t=this._path.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");return this.clientPathRegex=new RegExp("^"+t+"/socket\\.io(\\.msgpack|\\.esm)?(\\.min)?\\.js(\\.map)?(?:\\?|$)"),this}connectTimeout(e){return void 0===e?this._connectTimeout:(this._connectTimeout=e,this)}adapter(e){if(!arguments.length)return this._adapter;this._adapter=e;for(const e of this._nsps.values())e._initAdapter();return this}listen(e,t={}){return this.attach(e,t)}attach(e,t={}){if("function"==typeof e){throw new Error("You are trying to attach socket.io to an express request handler function. Please pass a http.Server instance.")}if(Number(e)==e&&(e=Number(e)),"number"==typeof e){R("creating http server and binding to %d",e);const t=e;e=c.createServer(((e,t)=>{t.writeHead(404),t.end()})),e.listen(t)}return Object.assign(t,this.opts),t.path=t.path||this._path,this.initEngine(e,t),this}attachApp(e,t={}){Object.assign(t,this.opts),t.path=t.path||this._path,R("creating uWebSockets.js-based engine with opts %j",t);const n=new g.uServer(t);n.attach(e,t),this.bind(n),this._serveClient&&e.get(`${this._path}/*`,((e,t)=>{if(!this.clientPathRegex.test(t.getUrl()))return void t.setYield(!0);const n=t.getUrl().replace(this._path,"").replace(/\?.*$/,"").replace(/^\//,""),r=L.test(n),i=r?"map":"source",s='"'+O+'"',o="W/"+s,a=t.getHeader("if-none-match");if(a&&(s===a||o===a))return R("serve client %s 304",i),e.writeStatus("304 Not Modified"),void e.end();R("serve client %s",i),e.writeHeader("cache-control","public, max-age=0"),e.writeHeader("content-type","application/"+(r?"json":"javascript")+"; charset=utf-8"),e.writeHeader("etag",s);const c=m.join(__dirname,"../client-dist/",n);(0,A.serveFile)(e,c)})),(0,A.patchAdapter)(e)}initEngine(e,t){R("creating engine.io instance with opts %j",t),this.eio=(0,g.attach)(e,t),this._serveClient&&this.attachServe(e),this.httpServer=e,this.bind(this.eio)}attachServe(e){R("attaching client serving req handler");const t=e.listeners("request").slice(0);e.removeAllListeners("request"),e.on("request",((n,r)=>{if(this.clientPathRegex.test(n.url))this._corsMiddleware?this._corsMiddleware(n,r,(()=>{this.serve(n,r)})):this.serve(n,r);else for(let i=0;i<t.length;i++)t[i].call(e,n,r)}))}serve(e,t){const n=e.url.replace(this._path,"").replace(/\?.*$/,""),r=L.test(n),i=r?"map":"source",s='"'+O+'"',o="W/"+s,a=e.headers["if-none-match"];if(a&&(s===a||o===a))return R("serve client %s 304",i),t.writeHead(304),void t.end();R("serve client %s",i),t.setHeader("Cache-Control","public, max-age=0"),t.setHeader("Content-Type","application/"+(r?"json":"javascript")+"; charset=utf-8"),t.setHeader("ETag",s),I.sendFile(n,e,t)}static sendFile(e,t,n){const r=(0,l.createReadStream)(m.join(__dirname,"../client-dist/",e)),i=e=>{e&&n.end()};switch(d(t).encodings(["br","gzip","deflate"])){case"br":n.writeHead(200,{"content-encoding":"br"}),(0,f.pipeline)(r,(0,u.createBrotliCompress)(),n,i);break;case"gzip":n.writeHead(200,{"content-encoding":"gzip"}),(0,f.pipeline)(r,(0,u.createGzip)(),n,i);break;case"deflate":n.writeHead(200,{"content-encoding":"deflate"}),(0,f.pipeline)(r,(0,u.createDeflate)(),n,i);break;default:n.writeHead(200),(0,f.pipeline)(r,n,i)}}bind(e){return this.engine=e,this.engine.on("connection",this.onconnection.bind(this)),this}onconnection(e){R("incoming connection with id %s",e.id);const t=new y.Client(this,e);return 3===e.protocol&&t.connect("/"),this}of(e,t){if("function"==typeof e||e instanceof RegExp){const n=new _.ParentNamespace(this);return R("initializing parent namespace %s",n.name),"function"==typeof e?this.parentNsps.set(e,n):(this.parentNsps.set(((t,n,r)=>r(null,e.test(t))),n),this.parentNamespacesFromRegExp.set(e,n)),t&&n.on("connect",t),n}"/"!==String(e)[0]&&(e="/"+e);let n=this._nsps.get(e);if(!n){for(const[t,n]of this.parentNamespacesFromRegExp)if(t.test(e))return R("attaching namespace %s to parent namespace %s",e,t),n.createChild(e);R("initializing namespace %s",e),n=new b.Namespace(this,e),this._nsps.set(e,n),"/"!==e&&this.sockets.emitReserved("new_namespace",n)}return t&&n.on("connect",t),n}close(e){this._nsps.forEach((e=>{e.sockets.forEach((e=>{e._onclose("server shutting down")})),e.adapter.close()})),this.engine.close(),(0,A.restoreAdapter)(),this.httpServer?this.httpServer.close(e):e&&e()}use(e){return this.sockets.use(e),this}to(e){return this.sockets.to(e)}in(e){return this.sockets.in(e)}except(e){return this.sockets.except(e)}send(...e){return this.sockets.emit("message",...e),this}write(...e){return this.sockets.emit("message",...e),this}serverSideEmit(e,...t){return this.sockets.serverSideEmit(e,...t)}serverSideEmitWithAck(e,...t){return this.sockets.serverSideEmitWithAck(e,...t)}allSockets(){return this.sockets.allSockets()}compress(e){return this.sockets.compress(e)}get volatile(){return this.sockets.volatile}get local(){return this.sockets.local}timeout(e){return this.sockets.timeout(e)}fetchSockets(){return this.sockets.fetchSockets()}socketsJoin(e){return this.sockets.socketsJoin(e)}socketsLeave(e){return this.sockets.socketsLeave(e)}disconnectSockets(e=!1){return this.sockets.disconnectSockets(e)}}t.Server=I;const P=Object.keys(v.EventEmitter.prototype).filter((function(e){return"function"==typeof v.EventEmitter.prototype[e]}));P.forEach((function(e){I.prototype[e]=function(){return this.sockets[e].apply(this.sockets,arguments)}})),e.exports=(e,t)=>new I(e,t),e.exports.Server=I,e.exports.Namespace=b.Namespace,e.exports.Socket=D.Socket,YQ()}(yG,yG.exports);var LJ=q(yG.exports);const{Server:IJ,Namespace:PJ,Socket:NJ}=LJ,jJ=e=>new Promise(((t,n)=>{const r=a.platform();let i;if("win32"===r)i=`start ${e}`;else if("darwin"===r)i=`open ${e}`;else{if("linux"!==r)return n(new Error(`Unsupported platform: ${r}`));i=`xdg-open ${e}`}d.exec(i,(e=>{if(e)return n(new Error(`Failed to open URL on ${r}: ${e.message}`));t()}))})),FJ=process.cwd(),BJ=o.join(FJ,"src","views");const MJ=new ke;MJ.name("theme").description("dev, list"),MJ.command("create").description("Run development server with Webpack and BrowserSync").action(gf),MJ.command("check").description("Run development server with Webpack and BrowserSync").action((async function(){const e=zr("Checking files...").start();try{const t=await qO(BJ,"views"),n=Object.keys(t);await HO(n,e)}catch(t){e.fail("Failed to retrieve files"),console.error(_t.red(`Failed to retrieve files - Error: ${t.message}`))}})),MJ.command("dev").description("Run development server with Webpack and BrowserSync").action((async()=>{await mf();const{data:e}=await of.get("/apps"),t=e?.apps?.map((e=>({name:e.subdomain,value:e._id}))),n=await yl.prompt({type:"list",name:"app",message:"Choose the theme you want to use",choices:t});var r=e?.apps?.find((e=>e._id===n.app));const i=JU(),s=3e3,a=new x.Server(i),c=new IJ(a),l=zr("Start Server").start(),u=process.cwd(),p=o.join(u,"src");o.join(u,"src","assets");const h=o.join(u,"dist");d.exec("npx webpack --config webpack.config.js --mode development --stats errors-warnings",(async e=>{e&&console.log(e,"errrrrr");try{await I.access(p),await I.access(h)}catch{console.error("Error: Required directories do not exist."),process.exit(1)}i.use(JU.static(h)),i.get("/api/auth",((e,t)=>{const{redirect_url:n,token:r}=e.query;if(console.log("🚀 ~ app.get ~ req.query:",e.query),!n||!r)return t.status(400).send("Missing redirect_url or token");t.cookie("token",r,{httpOnly:!1,secure:"production"===process.env.NODE_ENV,expires:new Date(9999,0,1)}),t.redirect(n)})),i.get("/api/auth/logout",((e,t)=>{t.clearCookie("token",{httpOnly:!0,secure:"production"===process.env.NODE_ENV}),t.redirect("/")})),i.get("*",j(i,{viewsDirectory:p,secretKey:r.secretKey,watch:!0},"development")),zr("REloading");const t=zr("Connected"),n=zr("Budilding");c.on("connection",(e=>{t.stop(),t.start();const r=XU.watch([p,o.join(u,"tailwind.config.js")]);r.on("change",(()=>{r.close(),t.stop(),n.start(),d.exec(`cd ${u} && npx webpack --config webpack.config.js --mode development --stats errors-warnings`,(t=>{if(t)return console.log(t),void n.fail(_t.red("Build failed"));n.succeed(_t.blue("Rebuilt successfully")),e.emit("reload")}))})),e.on("disconnect",(()=>{r.close()}))})),c.on("disconnect",(()=>{console.log(_t.blue("Disconnected")),t.stop(),reloadSpinner.stop()})),a.listen(s,(()=>{l.succeed("Server Started"),console.log("Server running at http://localhost:3000"),jJ("http://localhost:3000")}))}))})),MJ.command("list").description("List available themes").action((async()=>{const e=zr("Fetching Data...").start();try{const{data:t}=await of.get("/themes");e.stop();const n=t?.themes?.map((e=>({name:e.title,value:e._id}))),r=await yl.prompt({type:"list",name:"selectedThemeId",message:"Choose the theme you want to use:",choices:n}),i=t?.themes.find((e=>e._id===r.selectedThemeId));console.log("🚀 ~ getThemes ~ selectedTheme:",i)}catch(t){e.stop(),console.error("Failed to fetch data:",t)}}));const UJ=Object.create(null);UJ.open="0",UJ.close="1",UJ.ping="2",UJ.pong="3",UJ.message="4",UJ.upgrade="5",UJ.noop="6";const qJ=Object.create(null);Object.keys(UJ).forEach((e=>{qJ[UJ[e]]=e}));const HJ={type:"error",data:"parser error"},$J=({type:e,data:t},n,r)=>t instanceof ArrayBuffer||ArrayBuffer.isView(t)?r(n?t:"b"+zJ(t,!0).toString("base64")):r(UJ[e]+(t||"")),zJ=(e,t)=>Buffer.isBuffer(e)||e instanceof Uint8Array&&!t?e:e instanceof ArrayBuffer?Buffer.from(e):Buffer.from(e.buffer,e.byteOffset,e.byteLength);let WJ;const GJ=(e,t)=>{if("string"!=typeof e)return{type:"message",data:VJ(e,t)};const n=e.charAt(0);if("b"===n){const n=Buffer.from(e.substring(1),"base64");return{type:"message",data:VJ(n,t)}}return qJ[n]?e.length>1?{type:qJ[n],data:e.substring(1)}:{type:qJ[n]}:HJ},VJ=(e,t)=>"arraybuffer"===t?e instanceof ArrayBuffer?e:Buffer.isBuffer(e)?e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength):e.buffer:Buffer.isBuffer(e)?e:Buffer.from(e),KJ=String.fromCharCode(30);function YJ(){return new TransformStream({transform(e,t){!function(e,t){if(e.data instanceof ArrayBuffer||ArrayBuffer.isView(e.data))return t(zJ(e.data,!1));$J(e,!0,(e=>{WJ||(WJ=new TextEncoder),t(WJ.encode(e))}))}(e,(n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const e=new DataView(i.buffer);e.setUint8(0,126),e.setUint16(1,r)}else{i=new Uint8Array(9);const e=new DataView(i.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(r))}e.data&&"string"!=typeof e.data&&(i[0]|=128),t.enqueue(i),t.enqueue(n)}))}})}let ZJ;function QJ(e){return e.reduce(((e,t)=>e+t.length),0)}function JJ(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}const XJ=global;function eX(e,...t){return t.reduce(((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t)),{})}const tX=XJ.setTimeout,nX=XJ.clearTimeout;function rX(e,t){t.useNativeTimers?(e.setTimeoutFn=tX.bind(XJ),e.clearTimeoutFn=nX.bind(XJ)):(e.setTimeoutFn=XJ.setTimeout.bind(XJ),e.clearTimeoutFn=XJ.clearTimeout.bind(XJ))}class iX extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class sX extends SQ{constructor(e){super(),this.writable=!1,rX(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,t,n){return super.emitReserved("error",new iX(e,t,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=GJ(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return-1===e.indexOf(":")?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(e){const t=function(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}(e);return t.length?"?"+t:""}}const oX="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),aX=64,cX={};let lX,uX=0,pX=0;function hX(e){let t="";do{t=oX[e%aX]+t,e=Math.floor(e/aX)}while(e>0);return t}function dX(){const e=hX(+new Date);return e!==lX?(uX=0,lX=e):e+"."+hX(uX++)}for(;pX<aX;pX++)cX[oX[pX]]=pX;
377
+ parse:function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");for(var n={},r=t||{},i=e.split(NV),s=r.decode||IV,o=0;o<i.length;o++){var a=i[o],c=a.indexOf("=");if(!(c<0)){var l=a.substr(0,c).trim(),u=a.substr(++c,a.length).trim();'"'==u[0]&&(u=u.slice(1,-1)),null==n[l]&&(n[l]=FV(u,s))}}return n},serialize:function(e,t,n){var r=n||{},i=r.encode||PV;if("function"!=typeof i)throw new TypeError("option encode is invalid");if(!jV.test(e))throw new TypeError("argument name is invalid");var s=i(t);if(s&&!jV.test(s))throw new TypeError("argument val is invalid");var o=e+"="+s;if(null!=r.maxAge){var a=r.maxAge-0;if(isNaN(a)||!isFinite(a))throw new TypeError("option maxAge is invalid");o+="; Max-Age="+Math.floor(a)}if(r.domain){if(!jV.test(r.domain))throw new TypeError("option domain is invalid");o+="; Domain="+r.domain}if(r.path){if(!jV.test(r.path))throw new TypeError("option path is invalid");o+="; Path="+r.path}if(r.expires){if("function"!=typeof r.expires.toUTCString)throw new TypeError("option expires is invalid");o+="; Expires="+r.expires.toUTCString()}r.httpOnly&&(o+="; HttpOnly");r.secure&&(o+="; Secure");if(r.sameSite){switch("string"==typeof r.sameSite?r.sameSite.toLowerCase():r.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return o}},IV=decodeURIComponent,PV=encodeURIComponent,NV=/; */,jV=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function FV(e,t){try{return t(e)}catch(t){return e}}var BV,MV,UV,qV,HV,$V,zV={exports:{}},WV={BINARY_TYPES:["nodebuffer","arraybuffer","fragments"],EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}},GV={exports:{}},VV={exports:{}};function KV(){if(UV)return VV.exports;UV=1;const e="function"==typeof __webpack_require__?__non_webpack_require__:rF;return"function"==typeof e.addon?VV.exports=e.addon.bind(e):VV.exports=function(){if(MV)return BV;MV=1;var e=s,t=o,n=a,r="function"==typeof __webpack_require__?__non_webpack_require__:rF,i=process.config&&process.config.variables||{},c=!!process.env.PREBUILDS_ONLY,l=process.versions.modules,u=process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE||"undefined"!=typeof window&&window.process&&"renderer"===window.process.type?"electron":process.versions&&process.versions.nw?"node-webkit":"node",p=process.env.npm_config_arch||n.arch(),h=process.env.npm_config_platform||n.platform(),d=process.env.LIBC||(function(t){return"linux"===t&&e.existsSync("/etc/alpine-release")}(h)?"musl":"glibc"),f=process.env.ARM_VERSION||("arm64"===p?"8":i.arm_version)||"",m=(process.versions.uv||"").split(".")[0];function g(e){return r(g.resolve(e))}function y(t){try{return e.readdirSync(t)}catch(e){return[]}}function v(e,n){var r=y(e).filter(n);return r[0]&&t.join(e,r[0])}function b(e){return/\.node$/.test(e)}function _(e){var t=e.split("-");if(2===t.length){var n=t[0],r=t[1].split("+");if(n&&r.length&&r.every(Boolean))return{name:e,platform:n,architectures:r}}}function w(e,t){return function(n){return null!=n&&n.platform===e&&n.architectures.includes(t)}}function x(e,t){return e.architectures.length-t.architectures.length}function E(e){var t=e.split("."),n={file:e,specificity:0};if("node"===t.pop()){for(var r=0;r<t.length;r++){var i=t[r];if("node"===i||"electron"===i||"node-webkit"===i)n.runtime=i;else if("napi"===i)n.napi=!0;else if("abi"===i.slice(0,3))n.abi=i.slice(3);else if("uv"===i.slice(0,2))n.uv=i.slice(2);else if("armv"===i.slice(0,4))n.armv=i.slice(4);else{if("glibc"!==i&&"musl"!==i)continue;n.libc=i}n.specificity++}return n}}function S(e,t){return function(n){return!(null==n||n.runtime&&n.runtime!==e&&!function(e){return"node"===e.runtime&&e.napi}(n)||n.abi&&n.abi!==t&&!n.napi||n.uv&&n.uv!==m||n.armv&&n.armv!==f||n.libc&&n.libc!==d)}}function T(e){return function(t,n){return t.runtime!==n.runtime?t.runtime===e?-1:1:t.abi!==n.abi?t.abi?-1:1:t.specificity!==n.specificity?t.specificity>n.specificity?-1:1:0}}return BV=g,g.resolve=g.path=function(e){e=t.resolve(e||".");try{var n=r(t.join(e,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[n+"_PREBUILD"]&&(e=process.env[n+"_PREBUILD"])}catch(e){}if(!c){var i=v(t.join(e,"build/Release"),b);if(i)return i;var s=v(t.join(e,"build/Debug"),b);if(s)return s}var o=D(e);if(o)return o;var a=D(t.dirname(process.execPath));if(a)return a;var g=["platform="+h,"arch="+p,"runtime="+u,"abi="+l,"uv="+m,f?"armv="+f:"","libc="+d,"node="+process.versions.node,process.versions.electron?"electron="+process.versions.electron:"","function"==typeof __webpack_require__?"webpack=true":""].filter(Boolean).join(" ");throw new Error("No native build was found for "+g+"\n loaded from: "+e+"\n");function D(e){var n=y(t.join(e,"prebuilds")).map(_).filter(w(h,p)).sort(x)[0];if(n){var r=t.join(e,"prebuilds",n.name),i=y(r).map(E).filter(S(u,l)).sort(T(u))[0];return i?t.join(r,i.file):void 0}}},g.parseTags=E,g.matchTags=S,g.compareTags=T,g.parseTuple=_,g.matchTuple=w,g.compareTuples=x,BV}(),VV.exports}const{EMPTY_BUFFER:YV}=WV,ZV=Buffer[Symbol.species];function QV(e,t,n,r,i){for(let s=0;s<i;s++)n[r+s]=e[s]^t[3&s]}function JV(e,t){for(let n=0;n<e.length;n++)e[n]^=t[3&n]}if(zV.exports={concat:function(e,t){if(0===e.length)return YV;if(1===e.length)return e[0];const n=Buffer.allocUnsafe(t);let r=0;for(let t=0;t<e.length;t++){const i=e[t];n.set(i,r),r+=i.length}return r<t?new ZV(n.buffer,n.byteOffset,r):n},mask:QV,toArrayBuffer:function(e){return e.length===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.length)},toBuffer:function e(t){if(e.readOnly=!0,Buffer.isBuffer(t))return t;let n;return t instanceof ArrayBuffer?n=new ZV(t):ArrayBuffer.isView(t)?n=new ZV(t.buffer,t.byteOffset,t.byteLength):(n=Buffer.from(t),e.readOnly=!1),n},unmask:JV},!process.env.WS_NO_BUFFER_UTIL)try{const e=function(){if($V)return GV.exports;$V=1;try{GV.exports=KV()(__dirname)}catch(e){GV.exports=(HV||(HV=1,qV={mask:(e,t,n,r,i)=>{for(var s=0;s<i;s++)n[r+s]=e[s]^t[3&s]},unmask:(e,t)=>{const n=e.length;for(var r=0;r<n;r++)e[r]^=t[3&r]}}),qV)}return GV.exports}();zV.exports.mask=function(t,n,r,i,s){s<48?QV(t,n,r,i,s):e.mask(t,n,r,i,s)},zV.exports.unmask=function(t,n){t.length<32?JV(t,n):e.unmask(t,n)}}catch(e){}var XV=zV.exports;const eK=Symbol("kDone"),tK=Symbol("kRun");const nK=T,rK=XV,iK=class{constructor(e){this[eK]=()=>{this.pending--,this[tK]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[tK]()}[tK](){if(this.pending!==this.concurrency&&this.jobs.length){const e=this.jobs.shift();this.pending++,e(this[eK])}}},{kStatusCode:sK}=WV,oK=Buffer[Symbol.species],aK=Buffer.from([0,0,255,255]),cK=Symbol("permessage-deflate"),lK=Symbol("total-length"),uK=Symbol("callback"),pK=Symbol("buffers"),hK=Symbol("error");let dK;var fK=class{constructor(e,t,n){if(this._maxPayload=0|n,this._options=e||{},this._threshold=void 0!==this._options.threshold?this._options.threshold:1024,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,!dK){const e=void 0!==this._options.concurrencyLimit?this._options.concurrencyLimit:10;dK=new iK(e)}}static get extensionName(){return"permessage-deflate"}offer(){const e={};return this._options.serverNoContextTakeover&&(e.server_no_context_takeover=!0),this._options.clientNoContextTakeover&&(e.client_no_context_takeover=!0),this._options.serverMaxWindowBits&&(e.server_max_window_bits=this._options.serverMaxWindowBits),this._options.clientMaxWindowBits?e.client_max_window_bits=this._options.clientMaxWindowBits:null==this._options.clientMaxWindowBits&&(e.client_max_window_bits=!0),e}accept(e){return e=this.normalizeParams(e),this.params=this._isServer?this.acceptAsServer(e):this.acceptAsClient(e),this.params}cleanup(){if(this._inflate&&(this._inflate.close(),this._inflate=null),this._deflate){const e=this._deflate[uK];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){const t=this._options,n=e.find((e=>!(!1===t.serverNoContextTakeover&&e.server_no_context_takeover||e.server_max_window_bits&&(!1===t.serverMaxWindowBits||"number"==typeof t.serverMaxWindowBits&&t.serverMaxWindowBits>e.server_max_window_bits)||"number"==typeof t.clientMaxWindowBits&&!e.client_max_window_bits)));if(!n)throw new Error("None of the extension offers can be accepted");return t.serverNoContextTakeover&&(n.server_no_context_takeover=!0),t.clientNoContextTakeover&&(n.client_no_context_takeover=!0),"number"==typeof t.serverMaxWindowBits&&(n.server_max_window_bits=t.serverMaxWindowBits),"number"==typeof t.clientMaxWindowBits?n.client_max_window_bits=t.clientMaxWindowBits:!0!==n.client_max_window_bits&&!1!==t.clientMaxWindowBits||delete n.client_max_window_bits,n}acceptAsClient(e){const t=e[0];if(!1===this._options.clientNoContextTakeover&&t.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(t.client_max_window_bits){if(!1===this._options.clientMaxWindowBits||"number"==typeof this._options.clientMaxWindowBits&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"')}else"number"==typeof this._options.clientMaxWindowBits&&(t.client_max_window_bits=this._options.clientMaxWindowBits);return t}normalizeParams(e){return e.forEach((e=>{Object.keys(e).forEach((t=>{let n=e[t];if(n.length>1)throw new Error(`Parameter "${t}" must have only a single value`);if(n=n[0],"client_max_window_bits"===t){if(!0!==n){const e=+n;if(!Number.isInteger(e)||e<8||e>15)throw new TypeError(`Invalid value for parameter "${t}": ${n}`);n=e}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${t}": ${n}`)}else if("server_max_window_bits"===t){const e=+n;if(!Number.isInteger(e)||e<8||e>15)throw new TypeError(`Invalid value for parameter "${t}": ${n}`);n=e}else{if("client_no_context_takeover"!==t&&"server_no_context_takeover"!==t)throw new Error(`Unknown parameter "${t}"`);if(!0!==n)throw new TypeError(`Invalid value for parameter "${t}": ${n}`)}e[t]=n}))})),e}decompress(e,t,n){dK.add((r=>{this._decompress(e,t,((e,t)=>{r(),n(e,t)}))}))}compress(e,t,n){dK.add((r=>{this._compress(e,t,((e,t)=>{r(),n(e,t)}))}))}_decompress(e,t,n){const r=this._isServer?"client":"server";if(!this._inflate){const e=`${r}_max_window_bits`,t="number"!=typeof this.params[e]?nK.Z_DEFAULT_WINDOWBITS:this.params[e];this._inflate=nK.createInflateRaw({...this._options.zlibInflateOptions,windowBits:t}),this._inflate[cK]=this,this._inflate[lK]=0,this._inflate[pK]=[],this._inflate.on("error",yK),this._inflate.on("data",gK)}this._inflate[uK]=n,this._inflate.write(e),t&&this._inflate.write(aK),this._inflate.flush((()=>{const e=this._inflate[hK];if(e)return this._inflate.close(),this._inflate=null,void n(e);const i=rK.concat(this._inflate[pK],this._inflate[lK]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[lK]=0,this._inflate[pK]=[],t&&this.params[`${r}_no_context_takeover`]&&this._inflate.reset()),n(null,i)}))}_compress(e,t,n){const r=this._isServer?"server":"client";if(!this._deflate){const e=`${r}_max_window_bits`,t="number"!=typeof this.params[e]?nK.Z_DEFAULT_WINDOWBITS:this.params[e];this._deflate=nK.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:t}),this._deflate[lK]=0,this._deflate[pK]=[],this._deflate.on("data",mK)}this._deflate[uK]=n,this._deflate.write(e),this._deflate.flush(nK.Z_SYNC_FLUSH,(()=>{if(!this._deflate)return;let e=rK.concat(this._deflate[pK],this._deflate[lK]);t&&(e=new oK(e.buffer,e.byteOffset,e.length-4)),this._deflate[uK]=null,this._deflate[lK]=0,this._deflate[pK]=[],t&&this.params[`${r}_no_context_takeover`]&&this._deflate.reset(),n(null,e)}))}};function mK(e){this[pK].push(e),this[lK]+=e.length}function gK(e){this[lK]+=e.length,this[cK]._maxPayload<1||this[lK]<=this[cK]._maxPayload?this[pK].push(e):(this[hK]=new RangeError("Max payload size exceeded"),this[hK].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[hK][sK]=1009,this.removeListener("data",gK),this.reset())}function yK(e){this[cK]._inflate=null,e[sK]=1007,this[uK](e)}var vK,bK,_K,wK={exports:{}},xK={exports:{}};const{isUtf8:EK}=v;function SK(e){const t=e.length;let n=0;for(;n<t;)if(128&e[n])if(192==(224&e[n])){if(n+1===t||128!=(192&e[n+1])||192==(254&e[n]))return!1;n+=2}else if(224==(240&e[n])){if(n+2>=t||128!=(192&e[n+1])||128!=(192&e[n+2])||224===e[n]&&128==(224&e[n+1])||237===e[n]&&160==(224&e[n+1]))return!1;n+=3}else{if(240!=(248&e[n]))return!1;if(n+3>=t||128!=(192&e[n+1])||128!=(192&e[n+2])||128!=(192&e[n+3])||240===e[n]&&128==(240&e[n+1])||244===e[n]&&e[n+1]>143||e[n]>244)return!1;n+=4}else n++;return!0}if(wK.exports={isValidStatusCode:function(e){return e>=1e3&&e<=1014&&1004!==e&&1005!==e&&1006!==e||e>=3e3&&e<=4999},isValidUTF8:SK,tokenChars:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0]},EK)wK.exports.isValidUTF8=function(e){return e.length<24?SK(e):EK(e)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{const e=function(){if(_K)return xK.exports;_K=1;try{xK.exports=KV()(__dirname)}catch(e){xK.exports=(bK||(bK=1,vK=function(e){const t=e.length;let n=0;for(;n<t;)if(128&e[n])if(192==(224&e[n])){if(n+1===t||128!=(192&e[n+1])||192==(254&e[n]))return!1;n+=2}else if(224==(240&e[n])){if(n+2>=t||128!=(192&e[n+1])||128!=(192&e[n+2])||224===e[n]&&128==(224&e[n+1])||237===e[n]&&160==(224&e[n+1]))return!1;n+=3}else{if(240!=(248&e[n]))return!1;if(n+3>=t||128!=(192&e[n+1])||128!=(192&e[n+2])||128!=(192&e[n+3])||240===e[n]&&128==(240&e[n+1])||244===e[n]&&e[n+1]>143||e[n]>244)return!1;n+=4}else n++;return!0}),vK)}return xK.exports}();wK.exports.isValidUTF8=function(t){return t.length<32?SK(t):e(t)}}catch(e){}var TK=wK.exports;const{Writable:DK}=h,kK=fK,{BINARY_TYPES:AK,EMPTY_BUFFER:CK,kStatusCode:RK,kWebSocket:OK}=WV,{concat:LK,toArrayBuffer:IK,unmask:PK}=XV,{isValidStatusCode:NK,isValidUTF8:jK}=TK,FK=Buffer[Symbol.species];var BK=class extends DK{constructor(e={}){super(),this._allowSynchronousEvents=void 0===e.allowSynchronousEvents||e.allowSynchronousEvents,this._binaryType=e.binaryType||AK[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=0|e.maxPayload,this._skipUTF8Validation=!!e.skipUTF8Validation,this[OK]=void 0,this._bufferedBytes=0,this._buffers=[],this._compressed=!1,this._payloadLength=0,this._mask=void 0,this._fragmented=0,this._masked=!1,this._fin=!1,this._opcode=0,this._totalPayloadLength=0,this._messageLength=0,this._fragments=[],this._errored=!1,this._loop=!1,this._state=0}_write(e,t,n){if(8===this._opcode&&0==this._state)return n();this._bufferedBytes+=e.length,this._buffers.push(e),this.startLoop(n)}consume(e){if(this._bufferedBytes-=e,e===this._buffers[0].length)return this._buffers.shift();if(e<this._buffers[0].length){const t=this._buffers[0];return this._buffers[0]=new FK(t.buffer,t.byteOffset+e,t.length-e),new FK(t.buffer,t.byteOffset,e)}const t=Buffer.allocUnsafe(e);do{const n=this._buffers[0],r=t.length-e;e>=n.length?t.set(this._buffers.shift(),r):(t.set(new Uint8Array(n.buffer,n.byteOffset,e),r),this._buffers[0]=new FK(n.buffer,n.byteOffset+e,n.length-e)),e-=n.length}while(e>0);return t}startLoop(e){this._loop=!0;do{switch(this._state){case 0:this.getInfo(e);break;case 1:this.getPayloadLength16(e);break;case 2:this.getPayloadLength64(e);break;case 3:this.getMask();break;case 4:this.getData(e);break;case 5:case 6:return void(this._loop=!1)}}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2)return void(this._loop=!1);const t=this.consume(2);if(48&t[0]){return void e(this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3"))}const n=!(64&~t[0]);if(!n||this._extensions[kK.extensionName]){if(this._fin=!(128&~t[0]),this._opcode=15&t[0],this._payloadLength=127&t[1],0===this._opcode){if(n){return void e(this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1"))}if(!this._fragmented){return void e(this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE"))}this._opcode=this._fragmented}else if(1===this._opcode||2===this._opcode){if(this._fragmented){return void e(this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE"))}this._compressed=n}else{if(!(this._opcode>7&&this._opcode<11)){return void e(this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE"))}if(!this._fin){return void e(this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN"))}if(n){return void e(this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1"))}if(this._payloadLength>125||8===this._opcode&&1===this._payloadLength){return void e(this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH"))}}if(this._fin||this._fragmented||(this._fragmented=this._opcode),this._masked=!(128&~t[1]),this._isServer){if(!this._masked){return void e(this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK"))}}else if(this._masked){return void e(this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK"))}126===this._payloadLength?this._state=1:127===this._payloadLength?this._state=2:this.haveLength(e)}else{e(this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1"))}}getPayloadLength16(e){this._bufferedBytes<2?this._loop=!1:(this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e))}getPayloadLength64(e){if(this._bufferedBytes<8)return void(this._loop=!1);const t=this.consume(8),n=t.readUInt32BE(0);if(n>Math.pow(2,21)-1){e(this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH"))}else this._payloadLength=n*Math.pow(2,32)+t.readUInt32BE(4),this.haveLength(e)}haveLength(e){if(this._payloadLength&&this._opcode<8&&(this._totalPayloadLength+=this._payloadLength,this._totalPayloadLength>this._maxPayload&&this._maxPayload>0)){e(this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH"))}else this._masked?this._state=3:this._state=4}getMask(){this._bufferedBytes<4?this._loop=!1:(this._mask=this.consume(4),this._state=4)}getData(e){let t=CK;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength)return void(this._loop=!1);t=this.consume(this._payloadLength),this._masked&&this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3]&&PK(t,this._mask)}if(this._opcode>7)this.controlMessage(t,e);else{if(this._compressed)return this._state=5,void this.decompress(t,e);t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}}decompress(e,t){this._extensions[kK.extensionName].decompress(e,this._fin,((e,n)=>{if(e)return t(e);if(n.length){if(this._messageLength+=n.length,this._messageLength>this._maxPayload&&this._maxPayload>0){const e=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");return void t(e)}this._fragments.push(n)}this.dataMessage(t),0===this._state&&this.startLoop(t)}))}dataMessage(e){if(!this._fin)return void(this._state=0);const t=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],2===this._opcode){let r;r="nodebuffer"===this._binaryType?LK(n,t):"arraybuffer"===this._binaryType?IK(LK(n,t)):n,this._allowSynchronousEvents?(this.emit("message",r,!0),this._state=0):(this._state=6,setImmediate((()=>{this.emit("message",r,!0),this._state=0,this.startLoop(e)})))}else{const r=LK(n,t);if(!this._skipUTF8Validation&&!jK(r)){const t=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");return void e(t)}5===this._state||this._allowSynchronousEvents?(this.emit("message",r,!1),this._state=0):(this._state=6,setImmediate((()=>{this.emit("message",r,!1),this._state=0,this.startLoop(e)})))}}controlMessage(e,t){if(8!==this._opcode)this._allowSynchronousEvents?(this.emit(9===this._opcode?"ping":"pong",e),this._state=0):(this._state=6,setImmediate((()=>{this.emit(9===this._opcode?"ping":"pong",e),this._state=0,this.startLoop(t)})));else{if(0===e.length)this._loop=!1,this.emit("conclude",1005,CK),this.end();else{const n=e.readUInt16BE(0);if(!NK(n)){const e=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");return void t(e)}const r=new FK(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!jK(r)){const e=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");return void t(e)}this._loop=!1,this.emit("conclude",n,r),this.end()}this._state=0}}createError(e,t,n,r,i){this._loop=!1,this._errored=!0;const s=new e(n?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(s,this.createError),s.code=i,s[RK]=r,s}};const{randomFillSync:MK}=w,UK=fK,{EMPTY_BUFFER:qK}=WV,{isValidStatusCode:HK}=TK,{mask:$K,toBuffer:zK}=XV,WK=Symbol("kByteLength"),GK=Buffer.alloc(4),VK=8192;let KK,YK=VK;var ZK=class e{constructor(e,t,n){this._extensions=t||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._deflating=!1,this._queue=[]}static frame(e,t){let n,r,i=!1,s=2,o=!1;t.mask&&(n=t.maskBuffer||GK,t.generateMask?t.generateMask(n):(YK===VK&&(void 0===KK&&(KK=Buffer.alloc(VK)),MK(KK,0,VK),YK=0),n[0]=KK[YK++],n[1]=KK[YK++],n[2]=KK[YK++],n[3]=KK[YK++]),o=!(n[0]|n[1]|n[2]|n[3]),s=6),"string"==typeof e?r=t.mask&&!o||void 0===t[WK]?(e=Buffer.from(e)).length:t[WK]:(r=e.length,i=t.mask&&t.readOnly&&!o);let a=r;r>=65536?(s+=8,a=127):r>125&&(s+=2,a=126);const c=Buffer.allocUnsafe(i?r+s:s);return c[0]=t.fin?128|t.opcode:t.opcode,t.rsv1&&(c[0]|=64),c[1]=a,126===a?c.writeUInt16BE(r,2):127===a&&(c[2]=c[3]=0,c.writeUIntBE(r,4,6)),t.mask?(c[1]|=128,c[s-4]=n[0],c[s-3]=n[1],c[s-2]=n[2],c[s-1]=n[3],o?[c,e]:i?($K(e,n,c,s,r),[c]):($K(e,n,e,0,r),[c,e])):[c,e]}close(t,n,r,i){let s;if(void 0===t)s=qK;else{if("number"!=typeof t||!HK(t))throw new TypeError("First argument must be a valid error code number");if(void 0!==n&&n.length){const e=Buffer.byteLength(n);if(e>123)throw new RangeError("The message must not be greater than 123 bytes");s=Buffer.allocUnsafe(2+e),s.writeUInt16BE(t,0),"string"==typeof n?s.write(n,2):s.set(n,2)}else s=Buffer.allocUnsafe(2),s.writeUInt16BE(t,0)}const o={[WK]:s.length,fin:!0,generateMask:this._generateMask,mask:r,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._deflating?this.enqueue([this.dispatch,s,!1,o,i]):this.sendFrame(e.frame(s,o),i)}ping(t,n,r){let i,s;if("string"==typeof t?(i=Buffer.byteLength(t),s=!1):(i=(t=zK(t)).length,s=zK.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");const o={[WK]:i,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};this._deflating?this.enqueue([this.dispatch,t,!1,o,r]):this.sendFrame(e.frame(t,o),r)}pong(t,n,r){let i,s;if("string"==typeof t?(i=Buffer.byteLength(t),s=!1):(i=(t=zK(t)).length,s=zK.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");const o={[WK]:i,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};this._deflating?this.enqueue([this.dispatch,t,!1,o,r]):this.sendFrame(e.frame(t,o),r)}send(t,n,r){const i=this._extensions[UK.extensionName];let s,o,a=n.binary?2:1,c=n.compress;if("string"==typeof t?(s=Buffer.byteLength(t),o=!1):(s=(t=zK(t)).length,o=zK.readOnly),this._firstFragment?(this._firstFragment=!1,c&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(c=s>=i._threshold),this._compress=c):(c=!1,a=0),n.fin&&(this._firstFragment=!0),i){const e={[WK]:s,fin:n.fin,generateMask:this._generateMask,mask:n.mask,maskBuffer:this._maskBuffer,opcode:a,readOnly:o,rsv1:c};this._deflating?this.enqueue([this.dispatch,t,this._compress,e,r]):this.dispatch(t,this._compress,e,r)}else this.sendFrame(e.frame(t,{[WK]:s,fin:n.fin,generateMask:this._generateMask,mask:n.mask,maskBuffer:this._maskBuffer,opcode:a,readOnly:o,rsv1:!1}),r)}dispatch(t,n,r,i){if(!n)return void this.sendFrame(e.frame(t,r),i);const s=this._extensions[UK.extensionName];this._bufferedBytes+=r[WK],this._deflating=!0,s.compress(t,r.fin,((t,n)=>{if(this._socket.destroyed){const e=new Error("The socket was closed while data was being compressed");"function"==typeof i&&i(e);for(let t=0;t<this._queue.length;t++){const n=this._queue[t],r=n[n.length-1];"function"==typeof r&&r(e)}}else this._bufferedBytes-=r[WK],this._deflating=!1,r.readOnly=!1,this.sendFrame(e.frame(n,r),i),this.dequeue()}))}dequeue(){for(;!this._deflating&&this._queue.length;){const e=this._queue.shift();this._bufferedBytes-=e[3][WK],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][WK],this._queue.push(e)}sendFrame(e,t){2===e.length?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork()):this._socket.write(e[0],t)}};const{kForOnEventAttribute:QK,kListener:JK}=WV,XK=Symbol("kCode"),eY=Symbol("kData"),tY=Symbol("kError"),nY=Symbol("kMessage"),rY=Symbol("kReason"),iY=Symbol("kTarget"),sY=Symbol("kType"),oY=Symbol("kWasClean");class aY{constructor(e){this[iY]=null,this[sY]=e}get target(){return this[iY]}get type(){return this[sY]}}Object.defineProperty(aY.prototype,"target",{enumerable:!0}),Object.defineProperty(aY.prototype,"type",{enumerable:!0});class cY extends aY{constructor(e,t={}){super(e),this[XK]=void 0===t.code?0:t.code,this[rY]=void 0===t.reason?"":t.reason,this[oY]=void 0!==t.wasClean&&t.wasClean}get code(){return this[XK]}get reason(){return this[rY]}get wasClean(){return this[oY]}}Object.defineProperty(cY.prototype,"code",{enumerable:!0}),Object.defineProperty(cY.prototype,"reason",{enumerable:!0}),Object.defineProperty(cY.prototype,"wasClean",{enumerable:!0});class lY extends aY{constructor(e,t={}){super(e),this[tY]=void 0===t.error?null:t.error,this[nY]=void 0===t.message?"":t.message}get error(){return this[tY]}get message(){return this[nY]}}Object.defineProperty(lY.prototype,"error",{enumerable:!0}),Object.defineProperty(lY.prototype,"message",{enumerable:!0});class uY extends aY{constructor(e,t={}){super(e),this[eY]=void 0===t.data?null:t.data}get data(){return this[eY]}}Object.defineProperty(uY.prototype,"data",{enumerable:!0});const pY={addEventListener(e,t,n={}){for(const r of this.listeners(e))if(!n[QK]&&r[JK]===t&&!r[QK])return;let r;if("message"===e)r=function(e,n){const r=new uY("message",{data:n?e:e.toString()});r[iY]=this,dY(t,this,r)};else if("close"===e)r=function(e,n){const r=new cY("close",{code:e,reason:n.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});r[iY]=this,dY(t,this,r)};else if("error"===e)r=function(e){const n=new lY("error",{error:e,message:e.message});n[iY]=this,dY(t,this,n)};else{if("open"!==e)return;r=function(){const e=new aY("open");e[iY]=this,dY(t,this,e)}}r[QK]=!!n[QK],r[JK]=t,n.once?this.once(e,r):this.on(e,r)},removeEventListener(e,t){for(const n of this.listeners(e))if(n[JK]===t&&!n[QK]){this.removeListener(e,n);break}}};var hY={CloseEvent:cY,ErrorEvent:lY,Event:aY,EventTarget:pY,MessageEvent:uY};function dY(e,t,n){"object"==typeof e&&e.handleEvent?e.handleEvent.call(e,n):e.call(t,n)}const{tokenChars:fY}=TK;function mY(e,t,n){void 0===e[t]?e[t]=[n]:e[t].push(n)}var gY={format:function(e){return Object.keys(e).map((t=>{let n=e[t];return Array.isArray(n)||(n=[n]),n.map((e=>[t].concat(Object.keys(e).map((t=>{let n=e[t];return Array.isArray(n)||(n=[n]),n.map((e=>!0===e?t:`${t}=${e}`)).join("; ")}))).join("; "))).join(", ")})).join(", ")},parse:function(e){const t=Object.create(null);let n,r,i=Object.create(null),s=!1,o=!1,a=!1,c=-1,l=-1,u=-1,p=0;for(;p<e.length;p++)if(l=e.charCodeAt(p),void 0===n)if(-1===u&&1===fY[l])-1===c&&(c=p);else if(0===p||32!==l&&9!==l){if(59!==l&&44!==l)throw new SyntaxError(`Unexpected character at index ${p}`);{if(-1===c)throw new SyntaxError(`Unexpected character at index ${p}`);-1===u&&(u=p);const r=e.slice(c,u);44===l?(mY(t,r,i),i=Object.create(null)):n=r,c=u=-1}}else-1===u&&-1!==c&&(u=p);else if(void 0===r)if(-1===u&&1===fY[l])-1===c&&(c=p);else if(32===l||9===l)-1===u&&-1!==c&&(u=p);else if(59===l||44===l){if(-1===c)throw new SyntaxError(`Unexpected character at index ${p}`);-1===u&&(u=p),mY(i,e.slice(c,u),!0),44===l&&(mY(t,n,i),i=Object.create(null),n=void 0),c=u=-1}else{if(61!==l||-1===c||-1!==u)throw new SyntaxError(`Unexpected character at index ${p}`);r=e.slice(c,p),c=u=-1}else if(o){if(1!==fY[l])throw new SyntaxError(`Unexpected character at index ${p}`);-1===c?c=p:s||(s=!0),o=!1}else if(a)if(1===fY[l])-1===c&&(c=p);else if(34===l&&-1!==c)a=!1,u=p;else{if(92!==l)throw new SyntaxError(`Unexpected character at index ${p}`);o=!0}else if(34===l&&61===e.charCodeAt(p-1))a=!0;else if(-1===u&&1===fY[l])-1===c&&(c=p);else if(-1===c||32!==l&&9!==l){if(59!==l&&44!==l)throw new SyntaxError(`Unexpected character at index ${p}`);{if(-1===c)throw new SyntaxError(`Unexpected character at index ${p}`);-1===u&&(u=p);let o=e.slice(c,u);s&&(o=o.replace(/\\/g,""),s=!1),mY(i,r,o),44===l&&(mY(t,n,i),i=Object.create(null),n=void 0),r=void 0,c=u=-1}}else-1===u&&(u=p);if(-1===c||a||32===l||9===l)throw new SyntaxError("Unexpected end of input");-1===u&&(u=p);const h=e.slice(c,u);return void 0===n?mY(t,h,i):(void 0===r?mY(i,h,!0):mY(i,r,s?h.replace(/\\/g,""):h),mY(t,n,i)),t}};const yY=p,vY=E,bY=x,_Y=O,wY=N,{randomBytes:xY,createHash:EY}=w,{URL:SY}=S,TY=fK,DY=BK,kY=ZK,{BINARY_TYPES:AY,EMPTY_BUFFER:CY,GUID:RY,kForOnEventAttribute:OY,kListener:LY,kStatusCode:IY,kWebSocket:PY,NOOP:NY}=WV,{EventTarget:{addEventListener:jY,removeEventListener:FY}}=hY,{format:BY,parse:MY}=gY,{toBuffer:UY}=XV,qY=Symbol("kAborted"),HY=[8,13],$Y=["CONNECTING","OPEN","CLOSING","CLOSED"],zY=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/;let WY=class e extends yY{constructor(t,n,r){super(),this._binaryType=AY[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=CY,this._closeTimer=null,this._extensions={},this._paused=!1,this._protocol="",this._readyState=e.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,null!==t?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,void 0===n?n=[]:Array.isArray(n)||("object"==typeof n&&null!==n?(r=n,n=[]):n=[n]),VY(this,t,n,r)):(this._autoPong=r.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){AY.includes(e)&&(this._binaryType=e,this._receiver&&(this._receiver._binaryType=e))}get bufferedAmount(){return this._socket?this._socket._writableState.length+this._sender._bufferedBytes:this._bufferedAmount}get extensions(){return Object.keys(this._extensions).join()}get isPaused(){return this._paused}get onclose(){return null}get onerror(){return null}get onopen(){return null}get onmessage(){return null}get protocol(){return this._protocol}get readyState(){return this._readyState}get url(){return this._url}setSocket(t,n,r){const i=new DY({allowSynchronousEvents:r.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:r.maxPayload,skipUTF8Validation:r.skipUTF8Validation});this._sender=new kY(t,this._extensions,r.generateMask),this._receiver=i,this._socket=t,i[PY]=this,t[PY]=this,i.on("conclude",XY),i.on("drain",eZ),i.on("error",tZ),i.on("message",rZ),i.on("ping",iZ),i.on("pong",sZ),t.setTimeout&&t.setTimeout(0),t.setNoDelay&&t.setNoDelay(),n.length>0&&t.unshift(n),t.on("close",aZ),t.on("data",cZ),t.on("end",lZ),t.on("error",uZ),this._readyState=e.OPEN,this.emit("open")}emitClose(){if(!this._socket)return this._readyState=e.CLOSED,void this.emit("close",this._closeCode,this._closeMessage);this._extensions[TY.extensionName]&&this._extensions[TY.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=e.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(t,n){if(this.readyState!==e.CLOSED)if(this.readyState!==e.CONNECTING)this.readyState!==e.CLOSING?(this._readyState=e.CLOSING,this._sender.close(t,n,!this._isServer,(e=>{e||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())})),this._closeTimer=setTimeout(this._socket.destroy.bind(this._socket),3e4)):this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();else{const e="WebSocket was closed before the connection was established";QY(this,this._req,e)}}pause(){this.readyState!==e.CONNECTING&&this.readyState!==e.CLOSED&&(this._paused=!0,this._socket.pause())}ping(t,n,r){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");"function"==typeof t?(r=t,t=n=void 0):"function"==typeof n&&(r=n,n=void 0),"number"==typeof t&&(t=t.toString()),this.readyState===e.OPEN?(void 0===n&&(n=!this._isServer),this._sender.ping(t||CY,n,r)):JY(this,t,r)}pong(t,n,r){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");"function"==typeof t?(r=t,t=n=void 0):"function"==typeof n&&(r=n,n=void 0),"number"==typeof t&&(t=t.toString()),this.readyState===e.OPEN?(void 0===n&&(n=!this._isServer),this._sender.pong(t||CY,n,r)):JY(this,t,r)}resume(){this.readyState!==e.CONNECTING&&this.readyState!==e.CLOSED&&(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(t,n,r){if(this.readyState===e.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if("function"==typeof n&&(r=n,n={}),"number"==typeof t&&(t=t.toString()),this.readyState!==e.OPEN)return void JY(this,t,r);const i={binary:"string"!=typeof t,mask:!this._isServer,compress:!0,fin:!0,...n};this._extensions[TY.extensionName]||(i.compress=!1),this._sender.send(t||CY,i,r)}terminate(){if(this.readyState!==e.CLOSED)if(this.readyState!==e.CONNECTING)this._socket&&(this._readyState=e.CLOSING,this._socket.destroy());else{const e="WebSocket was closed before the connection was established";QY(this,this._req,e)}}};Object.defineProperty(WY,"CONNECTING",{enumerable:!0,value:$Y.indexOf("CONNECTING")}),Object.defineProperty(WY.prototype,"CONNECTING",{enumerable:!0,value:$Y.indexOf("CONNECTING")}),Object.defineProperty(WY,"OPEN",{enumerable:!0,value:$Y.indexOf("OPEN")}),Object.defineProperty(WY.prototype,"OPEN",{enumerable:!0,value:$Y.indexOf("OPEN")}),Object.defineProperty(WY,"CLOSING",{enumerable:!0,value:$Y.indexOf("CLOSING")}),Object.defineProperty(WY.prototype,"CLOSING",{enumerable:!0,value:$Y.indexOf("CLOSING")}),Object.defineProperty(WY,"CLOSED",{enumerable:!0,value:$Y.indexOf("CLOSED")}),Object.defineProperty(WY.prototype,"CLOSED",{enumerable:!0,value:$Y.indexOf("CLOSED")}),["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach((e=>{Object.defineProperty(WY.prototype,e,{enumerable:!0})})),["open","error","close","message"].forEach((e=>{Object.defineProperty(WY.prototype,`on${e}`,{enumerable:!0,get(){for(const t of this.listeners(e))if(t[OY])return t[LY];return null},set(t){for(const t of this.listeners(e))if(t[OY]){this.removeListener(e,t);break}"function"==typeof t&&this.addEventListener(e,t,{[OY]:!0})}})})),WY.prototype.addEventListener=jY,WY.prototype.removeEventListener=FY;var GY=WY;function VY(e,t,n,r){const i={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:HY[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...r,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(e._autoPong=i.autoPong,!HY.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${HY.join(", ")})`);let s;if(t instanceof SY)s=t;else try{s=new SY(t)}catch(e){throw new SyntaxError(`Invalid URL: ${t}`)}"http:"===s.protocol?s.protocol="ws:":"https:"===s.protocol&&(s.protocol="wss:"),e._url=s.href;const o="wss:"===s.protocol,a="ws+unix:"===s.protocol;let c;if("ws:"===s.protocol||o||a?a&&!s.pathname?c="The URL's pathname is empty":s.hash&&(c="The URL contains a fragment identifier"):c='The URL\'s protocol must be one of "ws:", "wss:", "http:", "https", or "ws+unix:"',c){const t=new SyntaxError(c);if(0===e._redirects)throw t;return void KY(e,t)}const l=o?443:80,u=xY(16).toString("base64"),p=o?vY.request:bY.request,h=new Set;let d,f;if(i.createConnection=i.createConnection||(o?ZY:YY),i.defaultPort=i.defaultPort||l,i.port=s.port||l,i.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":u,Connection:"Upgrade",Upgrade:"websocket"},i.path=s.pathname+s.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(d=new TY(!0!==i.perMessageDeflate?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=BY({[TY.extensionName]:d.offer()})),n.length){for(const e of n){if("string"!=typeof e||!zY.test(e)||h.has(e))throw new SyntaxError("An invalid or duplicated subprotocol was specified");h.add(e)}i.headers["Sec-WebSocket-Protocol"]=n.join(",")}if(i.origin&&(i.protocolVersion<13?i.headers["Sec-WebSocket-Origin"]=i.origin:i.headers.Origin=i.origin),(s.username||s.password)&&(i.auth=`${s.username}:${s.password}`),a){const e=i.path.split(":");i.socketPath=e[0],i.path=e[1]}if(i.followRedirects){if(0===e._redirects){e._originalIpc=a,e._originalSecure=o,e._originalHostOrSocketPath=a?i.socketPath:s.host;const t=r&&r.headers;if(r={...r,headers:{}},t)for(const[e,n]of Object.entries(t))r.headers[e.toLowerCase()]=n}else if(0===e.listenerCount("redirect")){const t=a?!!e._originalIpc&&i.socketPath===e._originalHostOrSocketPath:!e._originalIpc&&s.host===e._originalHostOrSocketPath;(!t||e._originalSecure&&!o)&&(delete i.headers.authorization,delete i.headers.cookie,t||delete i.headers.host,i.auth=void 0)}i.auth&&!r.headers.authorization&&(r.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),f=e._req=p(i),e._redirects&&e.emit("redirect",e.url,f)}else f=e._req=p(i);i.timeout&&f.on("timeout",(()=>{QY(e,f,"Opening handshake has timed out")})),f.on("error",(t=>{null===f||f[qY]||(f=e._req=null,KY(e,t))})),f.on("response",(s=>{const o=s.headers.location,a=s.statusCode;if(o&&i.followRedirects&&a>=300&&a<400){if(++e._redirects>i.maxRedirects)return void QY(e,f,"Maximum redirects exceeded");let s;f.abort();try{s=new SY(o,t)}catch(t){const n=new SyntaxError(`Invalid URL: ${o}`);return void KY(e,n)}VY(e,s,n,r)}else e.emit("unexpected-response",f,s)||QY(e,f,`Unexpected server response: ${s.statusCode}`)})),f.on("upgrade",((t,n,r)=>{if(e.emit("upgrade",t),e.readyState!==WY.CONNECTING)return;f=e._req=null;const s=t.headers.upgrade;if(void 0===s||"websocket"!==s.toLowerCase())return void QY(e,n,"Invalid Upgrade header");const o=EY("sha1").update(u+RY).digest("base64");if(t.headers["sec-websocket-accept"]!==o)return void QY(e,n,"Invalid Sec-WebSocket-Accept header");const a=t.headers["sec-websocket-protocol"];let c;if(void 0!==a?h.size?h.has(a)||(c="Server sent an invalid subprotocol"):c="Server sent a subprotocol but none was requested":h.size&&(c="Server sent no subprotocol"),c)return void QY(e,n,c);a&&(e._protocol=a);const l=t.headers["sec-websocket-extensions"];if(void 0!==l){if(!d){return void QY(e,n,"Server sent a Sec-WebSocket-Extensions header but no extension was requested")}let t;try{t=MY(l)}catch(t){return void QY(e,n,"Invalid Sec-WebSocket-Extensions header")}const r=Object.keys(t);if(1!==r.length||r[0]!==TY.extensionName){return void QY(e,n,"Server indicated an extension that was not requested")}try{d.accept(t[TY.extensionName])}catch(t){return void QY(e,n,"Invalid Sec-WebSocket-Extensions header")}e._extensions[TY.extensionName]=d}e.setSocket(n,r,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})})),i.finishRequest?i.finishRequest(f,e):f.end()}function KY(e,t){e._readyState=WY.CLOSING,e.emit("error",t),e.emitClose()}function YY(e){return e.path=e.socketPath,_Y.connect(e)}function ZY(e){return e.path=void 0,e.servername||""===e.servername||(e.servername=_Y.isIP(e.host)?"":e.host),wY.connect(e)}function QY(e,t,n){e._readyState=WY.CLOSING;const r=new Error(n);Error.captureStackTrace(r,QY),t.setHeader?(t[qY]=!0,t.abort(),t.socket&&!t.socket.destroyed&&t.socket.destroy(),process.nextTick(KY,e,r)):(t.destroy(r),t.once("error",e.emit.bind(e,"error")),t.once("close",e.emitClose.bind(e)))}function JY(e,t,n){if(t){const n=UY(t).length;e._socket?e._sender._bufferedBytes+=n:e._bufferedAmount+=n}if(n){const t=new Error(`WebSocket is not open: readyState ${e.readyState} (${$Y[e.readyState]})`);process.nextTick(n,t)}}function XY(e,t){const n=this[PY];n._closeFrameReceived=!0,n._closeMessage=t,n._closeCode=e,void 0!==n._socket[PY]&&(n._socket.removeListener("data",cZ),process.nextTick(oZ,n._socket),1005===e?n.close():n.close(e,t))}function eZ(){const e=this[PY];e.isPaused||e._socket.resume()}function tZ(e){const t=this[PY];void 0!==t._socket[PY]&&(t._socket.removeListener("data",cZ),process.nextTick(oZ,t._socket),t.close(e[IY])),t.emit("error",e)}function nZ(){this[PY].emitClose()}function rZ(e,t){this[PY].emit("message",e,t)}function iZ(e){const t=this[PY];t._autoPong&&t.pong(e,!this._isServer,NY),t.emit("ping",e)}function sZ(e){this[PY].emit("pong",e)}function oZ(e){e.resume()}function aZ(){const e=this[PY];let t;this.removeListener("close",aZ),this.removeListener("data",cZ),this.removeListener("end",lZ),e._readyState=WY.CLOSING,this._readableState.endEmitted||e._closeFrameReceived||e._receiver._writableState.errorEmitted||null===(t=e._socket.read())||e._receiver.write(t),e._receiver.end(),this[PY]=void 0,clearTimeout(e._closeTimer),e._receiver._writableState.finished||e._receiver._writableState.errorEmitted?e.emitClose():(e._receiver.on("error",nZ),e._receiver.on("finish",nZ))}function cZ(e){this[PY]._receiver.write(e)||this.pause()}function lZ(){const e=this[PY];e._readyState=WY.CLOSING,e._receiver.end(),this.end()}function uZ(){const e=this[PY];this.removeListener("error",uZ),this.on("error",NY),e&&(e._readyState=WY.CLOSING,this.destroy())}var pZ=q(GY);const{Duplex:hZ}=h;function dZ(e){e.emit("close")}function fZ(){!this.destroyed&&this._writableState.finished&&this.destroy()}function mZ(e){this.removeListener("error",mZ),this.destroy(),0===this.listenerCount("error")&&this.emit("error",e)}var gZ=function(e,t){let n=!0;const r=new hZ({...t,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return e.on("message",(function(t,n){const i=!n&&r._readableState.objectMode?t.toString():t;r.push(i)||e.pause()})),e.once("error",(function(e){r.destroyed||(n=!1,r.destroy(e))})),e.once("close",(function(){r.destroyed||r.push(null)})),r._destroy=function(t,i){if(e.readyState===e.CLOSED)return i(t),void process.nextTick(dZ,r);let s=!1;e.once("error",(function(e){s=!0,i(e)})),e.once("close",(function(){s||i(t),process.nextTick(dZ,r)})),n&&e.terminate()},r._final=function(t){e.readyState!==e.CONNECTING?null!==e._socket&&(e._socket._writableState.finished?(t(),r._readableState.endEmitted&&r.destroy()):(e._socket.once("finish",(function(){t()})),e.close())):e.once("open",(function(){r._final(t)}))},r._read=function(){e.isPaused&&e.resume()},r._write=function(t,n,i){e.readyState!==e.CONNECTING?e.send(t,i):e.once("open",(function(){r._write(t,n,i)}))},r.on("end",fZ),r.on("error",mZ),r};const{tokenChars:yZ}=TK;var vZ={parse:function(e){const t=new Set;let n=-1,r=-1,i=0;for(;i<e.length;i++){const s=e.charCodeAt(i);if(-1===r&&1===yZ[s])-1===n&&(n=i);else if(0===i||32!==s&&9!==s){if(44!==s)throw new SyntaxError(`Unexpected character at index ${i}`);{if(-1===n)throw new SyntaxError(`Unexpected character at index ${i}`);-1===r&&(r=i);const s=e.slice(n,r);if(t.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);t.add(s),n=r=-1}}else-1===r&&-1!==n&&(r=i)}if(-1===n||-1!==r)throw new SyntaxError("Unexpected end of input");const s=e.slice(n,i);if(t.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);return t.add(s),t}};const bZ=p,_Z=x,{createHash:wZ}=w,xZ=gY,EZ=fK,SZ=vZ,TZ=GY,{GUID:DZ,kWebSocket:kZ}=WV,AZ=/^[+/0-9A-Za-z]{22}==$/;var CZ=class extends bZ{constructor(e,t){if(super(),null==(e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:TZ,...e}).port&&!e.server&&!e.noServer||null!=e.port&&(e.server||e.noServer)||e.server&&e.noServer)throw new TypeError('One and only one of the "port", "server", or "noServer" options must be specified');if(null!=e.port?(this._server=_Z.createServer(((e,t)=>{const n=_Z.STATUS_CODES[426];t.writeHead(426,{"Content-Length":n.length,"Content-Type":"text/plain"}),t.end(n)})),this._server.listen(e.port,e.host,e.backlog,t)):e.server&&(this._server=e.server),this._server){const e=this.emit.bind(this,"connection");this._removeListeners=function(e,t){for(const n of Object.keys(t))e.on(n,t[n]);return function(){for(const n of Object.keys(t))e.removeListener(n,t[n])}}(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(t,n,r)=>{this.handleUpgrade(t,n,r,e)}})}!0===e.perMessageDeflate&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=0}address(){if(this.options.noServer)throw new Error('The server is operating in "noServer" mode');return this._server?this._server.address():null}close(e){if(2===this._state)return e&&this.once("close",(()=>{e(new Error("The server is not running"))})),void process.nextTick(RZ,this);if(e&&this.once("close",e),1!==this._state)if(this._state=1,this.options.noServer||this.options.server)this._server&&(this._removeListeners(),this._removeListeners=this._server=null),this.clients&&this.clients.size?this._shouldEmitClose=!0:process.nextTick(RZ,this);else{const e=this._server;this._removeListeners(),this._removeListeners=this._server=null,e.close((()=>{RZ(this)}))}}shouldHandle(e){if(this.options.path){const t=e.url.indexOf("?");if((-1!==t?e.url.slice(0,t):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,t,n,r){t.on("error",OZ);const i=e.headers["sec-websocket-key"],s=e.headers.upgrade,o=+e.headers["sec-websocket-version"];if("GET"!==e.method){return void IZ(this,e,t,405,"Invalid HTTP method")}if(void 0===s||"websocket"!==s.toLowerCase()){return void IZ(this,e,t,400,"Invalid Upgrade header")}if(void 0===i||!AZ.test(i)){return void IZ(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header")}if(8!==o&&13!==o){return void IZ(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header")}if(!this.shouldHandle(e))return void LZ(t,400);const a=e.headers["sec-websocket-protocol"];let c=new Set;if(void 0!==a)try{c=SZ.parse(a)}catch(n){return void IZ(this,e,t,400,"Invalid Sec-WebSocket-Protocol header")}const l=e.headers["sec-websocket-extensions"],u={};if(this.options.perMessageDeflate&&void 0!==l){const n=new EZ(this.options.perMessageDeflate,!0,this.options.maxPayload);try{const e=xZ.parse(l);e[EZ.extensionName]&&(n.accept(e[EZ.extensionName]),u[EZ.extensionName]=n)}catch(n){return void IZ(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header")}}if(this.options.verifyClient){const s={origin:e.headers[""+(8===o?"sec-websocket-origin":"origin")],secure:!(!e.socket.authorized&&!e.socket.encrypted),req:e};if(2===this.options.verifyClient.length)return void this.options.verifyClient(s,((s,o,a,l)=>{if(!s)return LZ(t,o||401,a,l);this.completeUpgrade(u,i,c,e,t,n,r)}));if(!this.options.verifyClient(s))return LZ(t,401)}this.completeUpgrade(u,i,c,e,t,n,r)}completeUpgrade(e,t,n,r,i,s,o){if(!i.readable||!i.writable)return i.destroy();if(i[kZ])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>0)return LZ(i,503);const a=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${wZ("sha1").update(t+DZ).digest("base64")}`],c=new this.options.WebSocket(null,void 0,this.options);if(n.size){const e=this.options.handleProtocols?this.options.handleProtocols(n,r):n.values().next().value;e&&(a.push(`Sec-WebSocket-Protocol: ${e}`),c._protocol=e)}if(e[EZ.extensionName]){const t=e[EZ.extensionName].params,n=xZ.format({[EZ.extensionName]:[t]});a.push(`Sec-WebSocket-Extensions: ${n}`),c._extensions=e}this.emit("headers",a,r),i.write(a.concat("\r\n").join("\r\n")),i.removeListener("error",OZ),c.setSocket(i,s,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(c),c.on("close",(()=>{this.clients.delete(c),this._shouldEmitClose&&!this.clients.size&&process.nextTick(RZ,this)}))),o(c,r)}};function RZ(e){e._state=2,e.emit("close")}function OZ(){this.destroy()}function LZ(e,t,n,r){n=n||_Z.STATUS_CODES[t],r={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(n),...r},e.once("finish",e.destroy),e.end(`HTTP/1.1 ${t} ${_Z.STATUS_CODES[t]}\r\n`+Object.keys(r).map((e=>`${e}: ${r[e]}`)).join("\r\n")+"\r\n\r\n"+n)}function IZ(e,t,n,r,i){if(e.listenerCount("wsClientError")){const r=new Error(i);Error.captureStackTrace(r,IZ),e.emit("wsClientError",r,n,t)}else LZ(n,r,i)}const PZ=GY;PZ.createWebSocketStream=gZ,PZ.Server=CZ,PZ.Receiver=BK,PZ.Sender=ZK,PZ.WebSocket=PZ,PZ.WebSocketServer=PZ.Server;var NZ=PZ,jZ={exports:{}},FZ=Object.getOwnPropertySymbols,BZ=Object.prototype.hasOwnProperty,MZ=Object.prototype.propertyIsEnumerable;var UZ=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,r,i=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),s=1;s<arguments.length;s++){for(var o in n=Object(arguments[s]))BZ.call(n,o)&&(i[o]=n[o]);if(FZ){r=FZ(n);for(var a=0;a<r.length;a++)MZ.call(n,r[a])&&(i[r[a]]=n[r[a]])}}return i};!function(){var e=UZ,t=TU,n={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function r(e){return"string"==typeof e||e instanceof String}function i(e,t){if(Array.isArray(t)){for(var n=0;n<t.length;++n)if(i(e,t[n]))return!0;return!1}return r(t)?e===t:t instanceof RegExp?t.test(e):!!t}function s(e,t){var n,s=t.headers.origin,o=[];return e.origin&&"*"!==e.origin?r(e.origin)?(o.push([{key:"Access-Control-Allow-Origin",value:e.origin}]),o.push([{key:"Vary",value:"Origin"}])):(n=i(s,e.origin),o.push([{key:"Access-Control-Allow-Origin",value:!!n&&s}]),o.push([{key:"Vary",value:"Origin"}])):o.push([{key:"Access-Control-Allow-Origin",value:"*"}]),o}function o(e){return!0===e.credentials?{key:"Access-Control-Allow-Credentials",value:"true"}:null}function a(e){var t=e.exposedHeaders;return t?(t.join&&(t=t.join(",")),t&&t.length?{key:"Access-Control-Expose-Headers",value:t}:null):null}function c(e,n){for(var r=0,i=e.length;r<i;r++){var s=e[r];s&&(Array.isArray(s)?c(s,n):"Vary"===s.key&&s.value?t(n,s.value):s.value&&n.setHeader(s.key,s.value))}}jZ.exports=function(t){var r=null;return r="function"==typeof t?t:function(e,n){n(null,t)},function(t,i,l){r(t,(function(r,u){if(r)l(r);else{var p=e({},n,u),h=null;p.origin&&"function"==typeof p.origin?h=p.origin:p.origin&&(h=function(e,t){t(null,p.origin)}),h?h(t.headers.origin,(function(e,n){e||!n?l(e):(p.origin=n,function(e,t,n,r){var i=[];"OPTIONS"===(t.method&&t.method.toUpperCase&&t.method.toUpperCase())?(i.push(s(e,t)),i.push(o(e)),i.push(function(e){var t=e.methods;return t.join&&(t=e.methods.join(",")),{key:"Access-Control-Allow-Methods",value:t}}(e)),i.push(function(e,t){var n=e.allowedHeaders||e.headers,r=[];return n?n.join&&(n=n.join(",")):(n=t.headers["access-control-request-headers"],r.push([{key:"Vary",value:"Access-Control-Request-Headers"}])),n&&n.length&&r.push([{key:"Access-Control-Allow-Headers",value:n}]),r}(e,t)),i.push(function(e){var t=("number"==typeof e.maxAge||e.maxAge)&&e.maxAge.toString();return t&&t.length?{key:"Access-Control-Max-Age",value:t}:null}(e)),i.push(a(e)),c(i,n),e.preflightContinue?r():(n.statusCode=e.optionsSuccessStatus,n.setHeader("Content-Length","0"),n.end())):(i.push(s(e,t)),i.push(o(e)),i.push(a(e)),c(i,n),r())}(p,t,i,l))})):l()}}))}}}();var qZ=jZ.exports;Object.defineProperty(EG,"__esModule",{value:!0}),EG.Server=EG.BaseServer=void 0;const HZ=L,$Z=S,zZ=TG,WZ=DG,GZ=p,VZ=kV,KZ=LV,YZ=NZ,ZZ=yV,QZ=CG,JZ=(0,ah.default)("engine"),XZ=Symbol("responseHeaders");class eQ extends GZ.EventEmitter{constructor(e={}){super(),this.middlewares=[],this.clients={},this.clientsCount=0,this.opts=Object.assign({wsEngine:YZ.Server,pingTimeout:2e4,pingInterval:25e3,upgradeTimeout:1e4,maxHttpBufferSize:1e6,transports:["polling","websocket"],allowUpgrades:!0,httpCompression:{threshold:1024},cors:!1,allowEIO3:!1},e),e.cookie&&(this.opts.cookie=Object.assign({name:"io",path:"/",httpOnly:!1!==e.cookie.path,sameSite:"lax"},e.cookie)),this.opts.cors&&this.use(qZ(this.opts.cors)),e.perMessageDeflate&&(this.opts.perMessageDeflate=Object.assign({threshold:1024},e.perMessageDeflate)),this.init()}_computePath(e){let t=(e.path||"/engine.io").replace(/\/$/,"");return!1!==e.addTrailingSlash&&(t+="/"),t}upgrades(e){return this.opts.allowUpgrades&&WZ.default[e].upgradesTo||[]}verify(e,t,n){const r=e._query.transport;if(!~this.opts.transports.indexOf(r)||"webtransport"===r)return JZ('unknown transport "%s"',r),n(nQ.errors.UNKNOWN_TRANSPORT,{transport:r});const i=function(e){if((e+="").length<1)return!1;if(!sQ[e.charCodeAt(0)])return JZ('invalid header, index 0, char "%s"',e.charCodeAt(0)),!0;if(e.length<2)return!1;if(!sQ[e.charCodeAt(1)])return JZ('invalid header, index 1, char "%s"',e.charCodeAt(1)),!0;if(e.length<3)return!1;if(!sQ[e.charCodeAt(2)])return JZ('invalid header, index 2, char "%s"',e.charCodeAt(2)),!0;if(e.length<4)return!1;if(!sQ[e.charCodeAt(3)])return JZ('invalid header, index 3, char "%s"',e.charCodeAt(3)),!0;for(let t=4;t<e.length;++t)if(!sQ[e.charCodeAt(t)])return JZ('invalid header, index "%i", char "%s"',t,e.charCodeAt(t)),!0;return!1}(e.headers.origin);if(i){const t=e.headers.origin;return e.headers.origin=null,JZ("origin header invalid"),n(nQ.errors.BAD_REQUEST,{name:"INVALID_ORIGIN",origin:t})}const s=e._query.sid;if(!s)return"GET"!==e.method?n(nQ.errors.BAD_HANDSHAKE_METHOD,{method:e.method}):"websocket"!==r||t?this.opts.allowRequest?this.opts.allowRequest(e,((e,t)=>{if(!t)return n(nQ.errors.FORBIDDEN,{message:e});n()})):n():(JZ("invalid transport upgrade"),n(nQ.errors.BAD_REQUEST,{name:"TRANSPORT_HANDSHAKE_ERROR"}));{if(!this.clients.hasOwnProperty(s))return JZ('unknown sid "%s"',s),n(nQ.errors.UNKNOWN_SID,{sid:s});const e=this.clients[s].transport.name;if(!t&&e!==r)return JZ("bad request: unexpected transport without upgrade"),n(nQ.errors.BAD_REQUEST,{name:"TRANSPORT_MISMATCH",transport:r,previousTransport:e})}n()}use(e){this.middlewares.push(e)}_applyMiddlewares(e,t,n){if(0===this.middlewares.length)return JZ("no middleware to apply, skipping"),n();const r=i=>{JZ("applying middleware n°%d",i+1),this.middlewares[i](e,t,(e=>{if(e)return n(e);i+1<this.middlewares.length?r(i+1):n()}))};r(0)}close(){JZ("closing all open clients");for(let e in this.clients)this.clients.hasOwnProperty(e)&&this.clients[e].close(!0);return this.cleanup(),this}generateId(e){return zZ.generateId()}async handshake(e,t,n){const r="4"===t._query.EIO?4:3;if(3===r&&!this.opts.allowEIO3)return JZ("unsupported protocol version"),this.emit("connection_error",{req:t,code:nQ.errors.UNSUPPORTED_PROTOCOL_VERSION,message:nQ.errorMessages[nQ.errors.UNSUPPORTED_PROTOCOL_VERSION],context:{protocol:r}}),void n(nQ.errors.UNSUPPORTED_PROTOCOL_VERSION);let i;try{i=await this.generateId(t)}catch(e){return JZ("error while generating an id"),this.emit("connection_error",{req:t,code:nQ.errors.BAD_REQUEST,message:nQ.errorMessages[nQ.errors.BAD_REQUEST],context:{name:"ID_GENERATION_ERROR",error:e}}),void n(nQ.errors.BAD_REQUEST)}JZ('handshaking client "%s"',i);try{var s=this.createTransport(e,t);"polling"===e?(s.maxHttpBufferSize=this.opts.maxHttpBufferSize,s.httpCompression=this.opts.httpCompression):"websocket"===e&&(s.perMessageDeflate=this.opts.perMessageDeflate)}catch(r){return JZ('error handshaking to transport "%s"',e),this.emit("connection_error",{req:t,code:nQ.errors.BAD_REQUEST,message:nQ.errorMessages[nQ.errors.BAD_REQUEST],context:{name:"TRANSPORT_HANDSHAKE_ERROR",error:r}}),void n(nQ.errors.BAD_REQUEST)}const o=new VZ.Socket(i,this,s,t,r);return s.on("headers",((e,t)=>{!t._query.sid&&(this.opts.cookie&&(e["Set-Cookie"]=[(0,KZ.serialize)(this.opts.cookie.name,i,this.opts.cookie)]),this.emit("initial_headers",e,t)),this.emit("headers",e,t)})),s.onRequest(t),this.clients[i]=o,this.clientsCount++,o.once("close",(()=>{delete this.clients[i],this.clientsCount--})),this.emit("connection",o),s}async onWebTransportSession(e){const t=setTimeout((()=>{JZ("the client failed to establish a bidirectional stream in the given period"),e.close()}),this.opts.upgradeTimeout),n=e.incomingBidirectionalStreams.getReader(),r=await n.read();if(r.done)return void JZ("session is closed");const i=r.value,s=(0,QZ.createPacketDecoderStream)(this.opts.maxHttpBufferSize,"nodebuffer"),o=i.readable.pipeThrough(s).getReader(),{value:a,done:c}=await o.read();if(c)return void JZ("stream is closed");if(clearTimeout(t),"open"!==a.type)return JZ("invalid WebTransport handshake"),e.close();if(void 0===a.data){const t=new ZZ.WebTransport(e,i,o),n=zZ.generateId();JZ('handshaking client "%s" (WebTransport)',n);const r=new VZ.Socket(n,this,t,null,4);return this.clients[n]=r,this.clientsCount++,r.once("close",(()=>{delete this.clients[n],this.clientsCount--})),void this.emit("connection",r)}const l=function(e){try{const t=JSON.parse(e);if("string"==typeof t.sid)return t.sid}catch(e){}}(a.data);if(!l)return JZ("invalid WebTransport handshake"),e.close();const u=this.clients[l];if(u)if(u.upgrading)JZ("transport has already been trying to upgrade"),e.close();else if(u.upgraded)JZ("transport had already been upgraded"),e.close();else{JZ("upgrading existing transport");const t=new ZZ.WebTransport(e,i,o);u.maybeUpgrade(t)}else JZ("upgrade attempt for closed client"),e.close()}}EG.BaseServer=eQ,eQ.errors={UNKNOWN_TRANSPORT:0,UNKNOWN_SID:1,BAD_HANDSHAKE_METHOD:2,BAD_REQUEST:3,FORBIDDEN:4,UNSUPPORTED_PROTOCOL_VERSION:5},eQ.errorMessages={0:"Transport unknown",1:"Session ID unknown",2:"Bad handshake method",3:"Bad request",4:"Forbidden",5:"Unsupported protocol version"};class tQ{constructor(e,t){this.req=e,this.socket=t,e[XZ]={}}setHeader(e,t){this.req[XZ][e]=t}getHeader(e){return this.req[XZ][e]}removeHeader(e){delete this.req[XZ][e]}write(){}writeHead(){}end(){this.socket.destroy()}}let nQ=class e extends eQ{init(){~this.opts.transports.indexOf("websocket")&&(this.ws&&this.ws.close(),this.ws=new this.opts.wsEngine({noServer:!0,clientTracking:!1,perMessageDeflate:this.opts.perMessageDeflate,maxPayload:this.opts.maxHttpBufferSize}),"function"==typeof this.ws.on&&this.ws.on("headers",((e,t)=>{const n=t[XZ]||{};delete t[XZ];!t._query.sid&&this.emit("initial_headers",n,t),this.emit("headers",n,t),JZ("writing headers: %j",n),Object.keys(n).forEach((t=>{e.push(`${t}: ${n[t]}`)}))})))}cleanup(){this.ws&&(JZ("closing webSocketServer"),this.ws.close())}prepare(e){e._query||(e._query=~e.url.indexOf("?")?HZ.parse((0,$Z.parse)(e.url).query):{})}createTransport(e,t){return new WZ.default[e](t)}handleRequest(t,n){JZ('handling "%s" http request "%s"',t.method,t.url),this.prepare(t),t.res=n;const r=(r,i)=>{if(void 0!==r)return this.emit("connection_error",{req:t,code:r,message:e.errorMessages[r],context:i}),void rQ(n,r,i);if(t._query.sid)JZ("setting new request for existing client"),this.clients[t._query.sid].transport.onRequest(t);else{const e=(e,t)=>rQ(n,e,t);this.handshake(t._query.transport,t,e)}};this._applyMiddlewares(t,n,(n=>{n?r(e.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!1,r)}))}handleUpgrade(t,n,r){this.prepare(t);const i=new tQ(t,n),s=(s,o)=>{if(void 0!==s)return this.emit("connection_error",{req:t,code:s,message:e.errorMessages[s],context:o}),void iQ(n,s,o);const a=Buffer.from(r);r=null,i.writeHead(),this.ws.handleUpgrade(t,n,a,(e=>{this.onWebSocket(t,n,e)}))};this._applyMiddlewares(t,i,(n=>{n?s(e.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!0,s)}))}onWebSocket(e,t,n){if(n.on("error",i),void 0!==WZ.default[e._query.transport]&&!WZ.default[e._query.transport].prototype.handlesUpgrades)return JZ("transport doesnt handle upgraded requests"),void n.close();const r=e._query.sid;if(e.websocket=n,r){const t=this.clients[r];if(t)if(t.upgrading)JZ("transport has already been trying to upgrade"),n.close();else if(t.upgraded)JZ("transport had already been upgraded"),n.close();else{JZ("upgrading existing transport"),n.removeListener("error",i);const r=this.createTransport(e._query.transport,e);r.perMessageDeflate=this.opts.perMessageDeflate,t.maybeUpgrade(r)}else JZ("upgrade attempt for closed client"),n.close()}else{const n=(e,n)=>iQ(t,e,n);this.handshake(e._query.transport,e,n)}function i(){JZ("websocket error before upgrade")}}attach(e,t={}){const n=this._computePath(t),r=t.destroyUpgradeTimeout||1e3;function i(e){return n===e.url.slice(0,n.length)}const s=e.listeners("request").slice(0);e.removeAllListeners("request"),e.on("close",this.close.bind(this)),e.on("listening",this.init.bind(this)),e.on("request",((t,r)=>{if(i(t))JZ('intercepting request for path "%s"',n),this.handleRequest(t,r);else{let n=0;const i=s.length;for(;n<i;n++)s[n].call(e,t,r)}})),~this.opts.transports.indexOf("websocket")&&e.on("upgrade",((e,n,s)=>{i(e)?this.handleUpgrade(e,n,s):!1!==t.destroyUpgrade&&setTimeout((function(){if(n.writable&&n.bytesWritten<=0)return n.on("error",(e=>{JZ("error while destroying upgrade: %s",e.message)})),n.end()}),r)}))}};function rQ(e,t,n){const r=t===nQ.errors.FORBIDDEN?403:400,i=n&&n.message?n.message:nQ.errorMessages[t];e.writeHead(r,{"Content-Type":"application/json"}),e.end(JSON.stringify({code:t,message:i}))}function iQ(e,t,n={}){if(e.on("error",(()=>{JZ("ignoring error from closed connection")})),e.writable){const r=n.message||nQ.errorMessages[t],i=Buffer.byteLength(r);e.write("HTTP/1.1 400 Bad Request\r\nConnection: close\r\nContent-type: text/html\r\nContent-Length: "+i+"\r\n\r\n"+r)}e.destroy()}EG.Server=nQ;const sQ=[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];var oQ={},aQ={},cQ={};Object.defineProperty(cQ,"__esModule",{value:!0}),cQ.Polling=void 0;const lQ=AG,uQ=T,pQ=KM,hQ=(0,ah.default)("engine:polling"),dQ={gzip:uQ.createGzip,deflate:uQ.createDeflate};let fQ=class extends lQ.Transport{constructor(e){super(e),this.closeTimeout=3e4}get name(){return"polling"}get supportsFraming(){return!1}onRequest(e){const t=e.res;e.res=null,"get"===e.getMethod()?this.onPollRequest(e,t):"post"===e.getMethod()?this.onDataRequest(e,t):(t.writeStatus("500 Internal Server Error"),t.end())}onPollRequest(e,t){if(this.req)return hQ("request overlap"),this.onError("overlap from client"),t.writeStatus("500 Internal Server Error"),void t.end();hQ("setting request"),this.req=e,this.res=t;e.cleanup=()=>{this.req=this.res=null},t.onAborted((()=>{this.writable=!1,this.onError("poll connection closed prematurely")})),this.writable=!0,this.emit("drain"),this.writable&&this.shouldClose&&(hQ("triggering empty send to append close packet"),this.send([{type:"noop"}]))}onDataRequest(e,t){if(this.dataReq)return this.onError("data request overlap from client"),t.writeStatus("500 Internal Server Error"),void t.end();const n=Number(e.headers["content-length"]);if(!n)return this.onError("content-length header required"),void t.writeStatus("411 Length Required").end();if(n>this.maxHttpBufferSize)return this.onError("payload too large"),void t.writeStatus("413 Payload Too Large").end();if("application/octet-stream"===e.headers["content-type"]&&4===this.protocol)return this.onError("invalid content");let r;this.dataReq=e,this.dataRes=t;let i=0;const s={"Content-Type":"text/html"};this.headers(e,s);for(let e in s)t.writeHeader(e,String(s[e]));const o=e=>{this.onData(e.toString()),this.onDataRequestCleanup(),t.cork((()=>{t.end("ok")}))};t.onAborted((()=>{this.onDataRequestCleanup(),this.onError("data request connection closed prematurely")})),t.onData(((e,s)=>{const a=i+e.byteLength;if(a>n)return this.onError("content-length mismatch"),void t.close();if(!r){if(s)return void o(Buffer.from(e));r=Buffer.allocUnsafe(n)}if(Buffer.from(e).copy(r,i),s)return a!=n?(this.onError("content-length mismatch"),t.writeStatus("400 Content-Length Mismatch").end(),void this.onDataRequestCleanup()):void o(r);i=a}))}onDataRequestCleanup(){this.dataReq=this.dataRes=null}onData(e){hQ('received "%s"',e);const t=e=>{if("close"===e.type)return hQ("got xhr close packet"),this.onClose(),!1;this.onPacket(e)};3===this.protocol?this.parser.decodePayload(e,t):this.parser.decodePayload(e).forEach(t)}onClose(){this.writable&&this.send([{type:"noop"}]),super.onClose()}send(e){this.writable=!1,this.shouldClose&&(hQ("appending close packet to payload"),e.push({type:"close"}),this.shouldClose(),this.shouldClose=null);const t=t=>{const n=e.some((e=>e.options&&e.options.compress));this.write(t,{compress:n})};3===this.protocol?this.parser.encodePayload(e,this.supportsBinary,t):this.parser.encodePayload(e,t)}write(e,t){hQ('writing "%s"',e),this.doWrite(e,t,(()=>{this.req.cleanup()}))}doWrite(e,t,n){const r="string"==typeof e,i={"Content-Type":r?"text/plain; charset=UTF-8":"application/octet-stream"},s=e=>{this.headers(this.req,i),this.res.cork((()=>{Object.keys(i).forEach((e=>{this.res.writeHeader(e,String(i[e]))})),this.res.end(e)})),n()};if(!this.httpCompression||!t.compress)return void s(e);if((r?Buffer.byteLength(e):e.length)<this.httpCompression.threshold)return void s(e);const o=pQ(this.req).encodings(["gzip","deflate"]);o?this.compress(e,o,((e,t)=>{if(e)return this.res.writeStatus("500 Internal Server Error"),this.res.end(),void n(e);i["Content-Encoding"]=o,s(t)})):s(e)}compress(e,t,n){hQ("compressing");const r=[];let i=0;dQ[t](this.httpCompression).on("error",n).on("data",(function(e){r.push(e),i+=e.length})).on("end",(function(){n(null,Buffer.concat(r,i))})).end(e)}doClose(e){let t;hQ("closing");const n=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(hQ("transport writable - closing right away"),this.send([{type:"close"}]),n()):this.discarded?(hQ("transport discarded - closing right away"),n()):(hQ("transport not writable - buffering orderly close"),this.shouldClose=n,t=setTimeout(n,this.closeTimeout))}headers(e,t){t=t||{};const n=e.headers["user-agent"];return n&&(~n.indexOf(";MSIE")||~n.indexOf("Trident/"))&&(t["X-XSS-Protection"]="0"),t["cache-control"]="no-store",this.emit("headers",t,e),t}};cQ.Polling=fQ;var mQ={};Object.defineProperty(mQ,"__esModule",{value:!0}),mQ.WebSocket=void 0;const gQ=AG,yQ=(0,ah.default)("engine:ws");let vQ=class extends gQ.Transport{constructor(e){super(e),this.writable=!1,this.perMessageDeflate=null}get name(){return"websocket"}get handlesUpgrades(){return!0}get supportsFraming(){return!0}send(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t+1===e.length,i=e=>{const t="string"!=typeof e,n=this.perMessageDeflate&&Buffer.byteLength(e)>this.perMessageDeflate.threshold;yQ('writing "%s"',e),this.socket.send(e,t,n),r&&(this.writable=!0,this.emit("drain"))};n.options&&"string"==typeof n.options.wsPreEncoded?i(n.options.wsPreEncoded):this.parser.encodePacket(n,this.supportsBinary,i)}}doClose(e){yQ("closing"),e&&e(),this.socket.end()}};mQ.WebSocket=vQ,Object.defineProperty(aQ,"__esModule",{value:!0});const bQ=cQ,_Q=mQ;aQ.default={polling:bQ.Polling,websocket:_Q.WebSocket},Object.defineProperty(oQ,"__esModule",{value:!0}),oQ.uServer=void 0;const wQ=EG,xQ=aQ,EQ=(0,ah.default)("engine:uws");class SQ extends wQ.BaseServer{init(){}cleanup(){}prepare(e,t){e.method=e.getMethod().toUpperCase(),e.url=e.getUrl();const n=new URLSearchParams(e.getQuery());e._query=Object.fromEntries(n.entries()),e.headers={},e.forEach(((t,n)=>{e.headers[t]=n})),e.connection={remoteAddress:Buffer.from(t.getRemoteAddressAsText()).toString()},t.onAborted((()=>{EQ("response has been aborted")}))}createTransport(e,t){return new xQ.default[e](t)}attach(e,t={}){const n=this._computePath(t);e.any(n,this.handleRequest.bind(this)).ws(n,{compression:t.compression,idleTimeout:t.idleTimeout,maxBackpressure:t.maxBackpressure,maxPayloadLength:this.opts.maxHttpBufferSize,upgrade:this.handleUpgrade.bind(this),open:e=>{const t=e.getUserData().transport;t.socket=e,t.writable=!0,t.emit("drain")},message:(e,t,n)=>{e.getUserData().transport.onData(n?t:Buffer.from(t).toString())},close:(e,t,n)=>{e.getUserData().transport.onClose(t,n)}})}_applyMiddlewares(e,t,n){if(0===this.middlewares.length)return n();e.res=new TQ(t),super._applyMiddlewares(e,e.res,(t=>{e.res.writeHead(),n(t)}))}handleRequest(e,t){EQ('handling "%s" http request "%s"',t.getMethod(),t.getUrl()),this.prepare(t,e),t.res=e;const n=(n,r)=>{if(void 0!==n)return this.emit("connection_error",{req:t,code:n,message:wQ.Server.errorMessages[n],context:r}),void this.abortRequest(t.res,n,r);if(t._query.sid)EQ("setting new request for existing client"),this.clients[t._query.sid].transport.onRequest(t);else{const n=(t,n)=>this.abortRequest(e,t,n);this.handshake(t._query.transport,t,n)}};this._applyMiddlewares(t,e,(e=>{e?n(wQ.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!1,n)}))}handleUpgrade(e,t,n){EQ("on upgrade"),this.prepare(t,e),t.res=e;const r=async(r,i)=>{if(void 0!==r)return this.emit("connection_error",{req:t,code:r,message:wQ.Server.errorMessages[r],context:i}),void this.abortRequest(e,r,i);const s=t._query.sid;let o;if(s){const n=this.clients[s];n?n.upgrading?(EQ("transport has already been trying to upgrade"),e.close()):n.upgraded?(EQ("transport had already been upgraded"),e.close()):(EQ("upgrading existing transport"),o=this.createTransport(t._query.transport,t),n.maybeUpgrade(o)):(EQ("upgrade attempt for closed client"),e.close())}else if(o=await this.handshake(t._query.transport,t,((t,n)=>this.abortRequest(e,t,n))),!o)return;t.res.writeStatus("101 Switching Protocols"),e.upgrade({transport:o},t.getHeader("sec-websocket-key"),t.getHeader("sec-websocket-protocol"),t.getHeader("sec-websocket-extensions"),n)};this._applyMiddlewares(t,e,(e=>{e?r(wQ.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!0,r)}))}abortRequest(e,t,n){const r=t===wQ.Server.errors.FORBIDDEN?"403 Forbidden":"400 Bad Request",i=n&&n.message?n.message:wQ.Server.errorMessages[t];e.writeStatus(r),e.writeHeader("Content-Type","application/json"),e.end(JSON.stringify({code:t,message:i}))}}oQ.uServer=SQ;class TQ{constructor(e){this.res=e,this.statusWritten=!1,this.headers=[],this.isAborted=!1}set statusCode(e){e&&this.writeStatus(200===e?"200 OK":"204 No Content")}writeHead(e){this.statusCode=e}setHeader(e,t){Array.isArray(t)?t.forEach((t=>{this.writeHeader(e,t)})):this.writeHeader(e,t)}removeHeader(){}getHeader(){}writeStatus(e){if(!this.isAborted)return this.res.writeStatus(e),this.statusWritten=!0,this.writeBufferedHeaders(),this}writeHeader(e,t){this.isAborted||"Content-Length"!==e&&(this.statusWritten?this.res.writeHeader(e,t):this.headers.push([e,t]))}writeBufferedHeaders(){this.headers.forEach((([e,t])=>{this.res.writeHeader(e,t)}))}end(e){this.isAborted||this.res.cork((()=>{this.statusWritten||this.writeBufferedHeaders(),this.res.end(e)}))}onData(e){this.isAborted||this.res.onData(e)}onAborted(e){this.isAborted||this.res.onAborted((()=>{this.isAborted=!0,e()}))}cork(e){this.isAborted||this.res.cork(e)}}!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.protocol=e.Transport=e.Socket=e.uServer=e.parser=e.attach=e.listen=e.transports=e.Server=void 0;const t=x,n=EG;Object.defineProperty(e,"Server",{enumerable:!0,get:function(){return n.Server}});const r=DG;e.transports=r.default;const i=CG;e.parser=i;var s=oQ;Object.defineProperty(e,"uServer",{enumerable:!0,get:function(){return s.uServer}});var o=kV;Object.defineProperty(e,"Socket",{enumerable:!0,get:function(){return o.Socket}});var a=AG;function c(e,t){const r=new n.Server(t);return r.attach(e,t),r}Object.defineProperty(e,"Transport",{enumerable:!0,get:function(){return a.Transport}}),e.protocol=i.protocol,e.listen=function(e,n,r){"function"==typeof n&&(r=n,n={});const i=(0,t.createServer)((function(e,t){t.writeHead(501),t.end("Not Implemented")})),s=c(i,n);return s.httpServer=i,i.listen(e,r),s},e.attach=c}(xG);var DQ={},kQ={};function AQ(e){if(e)return function(e){for(var t in AQ.prototype)e[t]=AQ.prototype[t];return e}(e)}AQ.prototype.on=AQ.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},AQ.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},AQ.prototype.off=AQ.prototype.removeListener=AQ.prototype.removeAllListeners=AQ.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var i=0;i<r.length;i++)if((n=r[i])===t||n.fn===t){r.splice(i,1);break}return 0===r.length&&delete this._callbacks["$"+e],this},AQ.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){r=0;for(var i=(n=n.slice(0)).length;r<i;++r)n[r].apply(this,t)}return this},AQ.prototype.emitReserved=AQ.prototype.emit,AQ.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},AQ.prototype.hasListeners=function(e){return!!this.listeners(e).length};var CQ=H(Object.freeze({__proto__:null,Emitter:AQ})),RQ={},OQ={};Object.defineProperty(OQ,"__esModule",{value:!0}),OQ.hasBinary=OQ.isBinary=void 0;const LQ="function"==typeof ArrayBuffer,IQ=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,PQ=Object.prototype.toString,NQ="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===PQ.call(Blob),jQ="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===PQ.call(File);function FQ(e){return LQ&&(e instanceof ArrayBuffer||IQ(e))||NQ&&e instanceof Blob||jQ&&e instanceof File}OQ.isBinary=FQ,OQ.hasBinary=function e(t,n){if(!t||"object"!=typeof t)return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n<r;n++)if(e(t[n]))return!0;return!1}if(FQ(t))return!0;if(t.toJSON&&"function"==typeof t.toJSON&&1===arguments.length)return e(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return!0;return!1},Object.defineProperty(RQ,"__esModule",{value:!0}),RQ.reconstructPacket=RQ.deconstructPacket=void 0;const BQ=OQ;function MQ(e,t){if(!e)return e;if((0,BQ.isBinary)(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=MQ(e[r],t);return n}if("object"==typeof e&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=MQ(e[r],t));return n}return e}function UQ(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=UQ(e[n],t);else if("object"==typeof e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=UQ(e[n],t));return e}RQ.deconstructPacket=function(e){const t=[],n=e.data,r=e;return r.data=MQ(n,t),r.attachments=t.length,{packet:r,buffers:t}},RQ.reconstructPacket=function(e,t){return e.data=UQ(e.data,t),delete e.attachments,e},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Decoder=e.Encoder=e.PacketType=e.protocol=void 0;const t=CQ,n=RQ,r=OQ,i=(0,ah.default)("socket.io-parser"),s=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var o;e.protocol=5,function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(o=e.PacketType||(e.PacketType={}));function a(e){return"[object Object]"===Object.prototype.toString.call(e)}e.Encoder=class{constructor(e){this.replacer=e}encode(e){return i("encoding packet %j",e),e.type!==o.EVENT&&e.type!==o.ACK||!(0,r.hasBinary)(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===o.EVENT?o.BINARY_EVENT:o.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==o.BINARY_EVENT&&e.type!==o.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),i("encoded %j as %s",e,t),t}encodeAsBinary(e){const t=(0,n.deconstructPacket)(e),r=this.encodeAsString(t.packet),i=t.buffers;return i.unshift(r),i}};class c extends t.Emitter{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===o.BINARY_EVENT;n||t.type===o.BINARY_ACK?(t.type=n?o.EVENT:o.ACK,this.reconstructor=new l(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!(0,r.isBinary)(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(void 0===o[n.type])throw new Error("unknown packet type "+n.type);if(n.type===o.BINARY_EVENT||n.type===o.BINARY_ACK){const r=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const i=e.substring(r,t);if(i!=Number(i)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(i)}if("/"===e.charAt(t+1)){const r=t+1;for(;++t;){if(","===e.charAt(t))break;if(t===e.length)break}n.nsp=e.substring(r,t)}else n.nsp="/";const r=e.charAt(t+1);if(""!==r&&Number(r)==r){const r=t+1;for(;++t;){const n=e.charAt(t);if(null==n||Number(n)!=n){--t;break}if(t===e.length)break}n.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(!c.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return i("decoded %s as %j",e,n),n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case o.CONNECT:return a(t);case o.DISCONNECT:return void 0===t;case o.CONNECT_ERROR:return"string"==typeof t||a(t);case o.EVENT:case o.BINARY_EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===s.indexOf(t[0]));case o.ACK:case o.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}e.Decoder=c;class l{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=(0,n.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}}(kQ),Object.defineProperty(DQ,"__esModule",{value:!0}),DQ.Client=void 0;const qQ=kQ,HQ=S,$Q=ah("socket.io:client");DQ.Client=class{constructor(e,t){this.sockets=new Map,this.nsps=new Map,this.server=e,this.conn=t,this.encoder=e.encoder,this.decoder=new e._parser.Decoder,this.id=t.id,this.setup()}get request(){return this.conn.request}setup(){this.onclose=this.onclose.bind(this),this.ondata=this.ondata.bind(this),this.onerror=this.onerror.bind(this),this.ondecoded=this.ondecoded.bind(this),this.decoder.on("decoded",this.ondecoded),this.conn.on("data",this.ondata),this.conn.on("error",this.onerror),this.conn.on("close",this.onclose),this.connectTimeout=setTimeout((()=>{0===this.nsps.size?($Q("no namespace joined yet, close the client"),this.close()):$Q("the client has already joined a namespace, nothing to do")}),this.server._connectTimeout)}connect(e,t={}){if(this.server._nsps.has(e))return $Q("connecting to namespace %s",e),this.doConnect(e,t);this.server._checkNamespace(e,t,(n=>{n?this.doConnect(e,t):($Q("creation of namespace %s was denied",e),this._packet({type:qQ.PacketType.CONNECT_ERROR,nsp:e,data:{message:"Invalid namespace"}}))}))}doConnect(e,t){const n=this.server.of(e);n._add(this,t,(e=>{this.sockets.set(e.id,e),this.nsps.set(n.name,e),this.connectTimeout&&(clearTimeout(this.connectTimeout),this.connectTimeout=void 0)}))}_disconnect(){for(const e of this.sockets.values())e.disconnect();this.sockets.clear(),this.close()}_remove(e){if(this.sockets.has(e.id)){const t=this.sockets.get(e.id).nsp.name;this.sockets.delete(e.id),this.nsps.delete(t)}else $Q("ignoring remove for %s",e.id)}close(){"open"===this.conn.readyState&&($Q("forcing transport close"),this.conn.close(),this.onclose("forced server close"))}_packet(e,t={}){if("open"!==this.conn.readyState)return void $Q("ignoring packet write %j",e);const n=t.preEncoded?e:this.encoder.encode(e);this.writeToEngine(n,t)}writeToEngine(e,t){if(t.volatile&&!this.conn.transport.writable)return void $Q("volatile packet is discarded since the transport is not currently writable");const n=Array.isArray(e)?e:[e];for(const e of n)this.conn.write(e,t)}ondata(e){try{this.decoder.add(e)}catch(e){$Q("invalid packet format"),this.onerror(e)}}ondecoded(e){let t,n;if(3===this.conn.protocol){const r=HQ.parse(e.nsp,!0);t=r.pathname,n=r.query}else t=e.nsp,n=e.data;const r=this.nsps.get(t);r||e.type!==qQ.PacketType.CONNECT?r&&e.type!==qQ.PacketType.CONNECT&&e.type!==qQ.PacketType.CONNECT_ERROR?process.nextTick((function(){r._onpacket(e)})):($Q("invalid state (packet type: %s)",e.type),this.close()):this.connect(t,n)}onerror(e){for(const t of this.sockets.values())t._onerror(e);this.conn.close()}onclose(e,t){$Q("client close with reason %s",e),this.destroy();for(const n of this.sockets.values())n._onclose(e,t);this.sockets.clear(),this.decoder.destroy()}destroy(){this.conn.removeListener("data",this.ondata),this.conn.removeListener("error",this.onerror),this.conn.removeListener("close",this.onclose),this.decoder.removeListener("decoded",this.ondecoded),this.connectTimeout&&(clearTimeout(this.connectTimeout),this.connectTimeout=void 0)}};var zQ={},WQ={},GQ={};Object.defineProperty(GQ,"__esModule",{value:!0}),GQ.StrictEventEmitter=void 0;const VQ=p;class KQ extends VQ.EventEmitter{on(e,t){return super.on(e,t)}once(e,t){return super.once(e,t)}emit(e,...t){return super.emit(e,...t)}emitReserved(e,...t){return super.emit(e,...t)}emitUntyped(e,...t){return super.emit(e,...t)}listeners(e){return super.listeners(e)}}GQ.StrictEventEmitter=KQ;var YQ,ZQ,QQ={};function JQ(){if(YQ)return QQ;YQ=1,Object.defineProperty(QQ,"__esModule",{value:!0}),QQ.RemoteSocket=QQ.BroadcastOperator=void 0;const e=XQ(),t=kQ;class n{constructor(e,t=new Set,n=new Set,r={}){this.adapter=e,this.rooms=t,this.exceptRooms=n,this.flags=r}to(e){const t=new Set(this.rooms);return Array.isArray(e)?e.forEach((e=>t.add(e))):t.add(e),new n(this.adapter,t,this.exceptRooms,this.flags)}in(e){return this.to(e)}except(e){const t=new Set(this.exceptRooms);return Array.isArray(e)?e.forEach((e=>t.add(e))):t.add(e),new n(this.adapter,this.rooms,t,this.flags)}compress(e){const t=Object.assign({},this.flags,{compress:e});return new n(this.adapter,this.rooms,this.exceptRooms,t)}get volatile(){const e=Object.assign({},this.flags,{volatile:!0});return new n(this.adapter,this.rooms,this.exceptRooms,e)}get local(){const e=Object.assign({},this.flags,{local:!0});return new n(this.adapter,this.rooms,this.exceptRooms,e)}timeout(e){const t=Object.assign({},this.flags,{timeout:e});return new n(this.adapter,this.rooms,this.exceptRooms,t)}emit(n,...r){if(e.RESERVED_EVENTS.has(n))throw new Error(`"${String(n)}" is a reserved event name`);const i=[n,...r],s={type:t.PacketType.EVENT,data:i};if(!("function"==typeof i[i.length-1]))return this.adapter.broadcast(s,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags}),!0;const o=i.pop();let a=!1,c=[];const l=setTimeout((()=>{a=!0,o.apply(this,[new Error("operation has timed out"),this.flags.expectSingleResponse?null:c])}),this.flags.timeout);let u=-1,p=0,h=0;const d=()=>{a||u!==p||c.length!==h||(clearTimeout(l),o.apply(this,[null,this.flags.expectSingleResponse?c[0]:c]))};return this.adapter.broadcastWithAck(s,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags},(e=>{h+=e,p++,d()}),(e=>{c.push(e),d()})),this.adapter.serverCount().then((e=>{u=e,d()})),!0}emitWithAck(e,...t){return new Promise(((n,r)=>{t.push(((e,t)=>e?(e.responses=t,r(e)):n(t))),this.emit(e,...t)}))}allSockets(){if(!this.adapter)throw new Error("No adapter for this namespace, are you trying to get the list of clients of a dynamic namespace?");return this.adapter.sockets(this.rooms)}fetchSockets(){return this.adapter.fetchSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags}).then((t=>t.map((t=>t instanceof e.Socket?t:new r(this.adapter,t)))))}socketsJoin(e){this.adapter.addSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},Array.isArray(e)?e:[e])}socketsLeave(e){this.adapter.delSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},Array.isArray(e)?e:[e])}disconnectSockets(e=!1){this.adapter.disconnectSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags},e)}}QQ.BroadcastOperator=n;class r{constructor(e,t){this.id=t.id,this.handshake=t.handshake,this.rooms=new Set(t.rooms),this.data=t.data,this.operator=new n(e,new Set([this.id]),new Set,{expectSingleResponse:!0})}timeout(e){return this.operator.timeout(e)}emit(e,...t){return this.operator.emit(e,...t)}join(e){return this.operator.socketsJoin(e)}leave(e){return this.operator.socketsLeave(e)}disconnect(e=!1){return this.operator.disconnectSockets(e),this}}return QQ.RemoteSocket=r,QQ}function XQ(){return ZQ||(ZQ=1,function(e){var t=U&&U.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Socket=e.RESERVED_EVENTS=void 0;const n=kQ,r=t(ah),i=GQ,s=t(TG),o=JQ(),a=(0,r.default)("socket.io:socket"),c=new Set(["transport error","transport close","forced close","ping timeout","server shutting down","forced server close"]);function l(){}e.RESERVED_EVENTS=new Set(["connect","connect_error","disconnect","disconnecting","newListener","removeListener"]);class u extends i.StrictEventEmitter{constructor(e,t,r,i){super(),this.nsp=e,this.client=t,this.recovered=!1,this.data={},this.connected=!1,this.acks=new Map,this.fns=[],this.flags={},this.server=e.server,this.adapter=this.nsp.adapter,i?(this.id=i.sid,this.pid=i.pid,i.rooms.forEach((e=>this.join(e))),this.data=i.data,i.missedPackets.forEach((e=>{this.packet({type:n.PacketType.EVENT,data:e})})),this.recovered=!0):(3===t.conn.protocol?this.id="/"!==e.name?e.name+"#"+t.id:t.id:this.id=s.default.generateId(),this.server._opts.connectionStateRecovery&&(this.pid=s.default.generateId())),this.handshake=this.buildHandshake(r),this.on("error",l)}buildHandshake(e){var t,n,r,i;return{headers:(null===(t=this.request)||void 0===t?void 0:t.headers)||{},time:new Date+"",address:this.conn.remoteAddress,xdomain:!!(null===(n=this.request)||void 0===n?void 0:n.headers.origin),secure:!this.request||!!this.request.connection.encrypted,issued:+new Date,url:null===(r=this.request)||void 0===r?void 0:r.url,query:(null===(i=this.request)||void 0===i?void 0:i._query)||{},auth:e}}emit(t,...r){if(e.RESERVED_EVENTS.has(t))throw new Error(`"${String(t)}" is a reserved event name`);const i=[t,...r],s={type:n.PacketType.EVENT,data:i};if("function"==typeof i[i.length-1]){const e=this.nsp._ids++;a("emitting packet with ack id %d",e),this.registerAckCallback(e,i.pop()),s.id=e}const o=Object.assign({},this.flags);return this.flags={},this.nsp.server.opts.connectionStateRecovery?this.adapter.broadcast(s,{rooms:new Set([this.id]),except:new Set,flags:o}):(this.notifyOutgoingListeners(s),this.packet(s,o)),!0}emitWithAck(e,...t){const n=void 0!==this.flags.timeout;return new Promise(((r,i)=>{t.push(((e,t)=>n?e?i(e):r(t):r(e))),this.emit(e,...t)}))}registerAckCallback(e,t){const n=this.flags.timeout;if(void 0===n)return void this.acks.set(e,t);const r=setTimeout((()=>{a("event with ack id %d has timed out after %d ms",e,n),this.acks.delete(e),t.call(this,new Error("operation has timed out"))}),n);this.acks.set(e,((...e)=>{clearTimeout(r),t.apply(this,[null,...e])}))}to(e){return this.newBroadcastOperator().to(e)}in(e){return this.newBroadcastOperator().in(e)}except(e){return this.newBroadcastOperator().except(e)}send(...e){return this.emit("message",...e),this}write(...e){return this.emit("message",...e),this}packet(e,t={}){e.nsp=this.nsp.name,t.compress=!1!==t.compress,this.client._packet(e,t)}join(e){return a("join room %s",e),this.adapter.addAll(this.id,new Set(Array.isArray(e)?e:[e]))}leave(e){return a("leave room %s",e),this.adapter.del(this.id,e)}leaveAll(){this.adapter.delAll(this.id)}_onconnect(){a("socket connected - writing packet"),this.connected=!0,this.join(this.id),3===this.conn.protocol?this.packet({type:n.PacketType.CONNECT}):this.packet({type:n.PacketType.CONNECT,data:{sid:this.id,pid:this.pid}})}_onpacket(e){switch(a("got packet %j",e),e.type){case n.PacketType.EVENT:case n.PacketType.BINARY_EVENT:this.onevent(e);break;case n.PacketType.ACK:case n.PacketType.BINARY_ACK:this.onack(e);break;case n.PacketType.DISCONNECT:this.ondisconnect()}}onevent(e){const t=e.data||[];if(a("emitting event %j",t),null!=e.id&&(a("attaching ack callback to event"),t.push(this.ack(e.id))),this._anyListeners&&this._anyListeners.length){const e=this._anyListeners.slice();for(const n of e)n.apply(this,t)}this.dispatch(t)}ack(e){const t=this;let r=!1;return function(){if(r)return;const i=Array.prototype.slice.call(arguments);a("sending ack %j",i),t.packet({id:e,type:n.PacketType.ACK,data:i}),r=!0}}onack(e){const t=this.acks.get(e.id);"function"==typeof t?(a("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),this.acks.delete(e.id)):a("bad ack %s",e.id)}ondisconnect(){a("got disconnect packet"),this._onclose("client namespace disconnect")}_onerror(e){this.emitReserved("error",e)}_onclose(e,t){if(!this.connected)return this;a("closing socket - reason %s",e),this.emitReserved("disconnecting",e,t),this.server._opts.connectionStateRecovery&&c.has(e)&&(a("connection state recovery is enabled for sid %s",this.id),this.adapter.persistSession({sid:this.id,pid:this.pid,rooms:[...this.rooms],data:this.data})),this._cleanup(),this.client._remove(this),this.connected=!1,this.emitReserved("disconnect",e,t)}_cleanup(){this.leaveAll(),this.nsp._remove(this),this.join=l}_error(e){this.packet({type:n.PacketType.CONNECT_ERROR,data:e})}disconnect(e=!1){return this.connected?(e?this.client._disconnect():(this.packet({type:n.PacketType.DISCONNECT}),this._onclose("server namespace disconnect")),this):this}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}get broadcast(){return this.newBroadcastOperator()}get local(){return this.newBroadcastOperator().local}timeout(e){return this.flags.timeout=e,this}dispatch(e){a("dispatching an event %j",e),this.run(e,(t=>{process.nextTick((()=>{if(t)return this._onerror(t);this.connected?super.emitUntyped.apply(this,e):a("ignore packet received after disconnection")}))}))}use(e){return this.fns.push(e),this}run(e,t){const n=this.fns.slice(0);if(!n.length)return t(null);!function r(i){n[i](e,(function(e){return e?t(e):n[i+1]?void r(i+1):t(null)}))}(0)}get disconnected(){return!this.connected}get request(){return this.client.request}get conn(){return this.client.conn}get rooms(){return this.adapter.socketRooms(this.id)||new Set}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const n of t)n.apply(this,e.data)}}newBroadcastOperator(){const e=Object.assign({},this.flags);return this.flags={},new o.BroadcastOperator(this.adapter,new Set,new Set([this.id]),e)}}e.Socket=u}(WQ)),WQ}!function(e){var t=U&&U.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.Namespace=e.RESERVED_EVENTS=void 0;const n=XQ(),r=GQ,i=t(ah),s=JQ(),o=(0,i.default)("socket.io:namespace");e.RESERVED_EVENTS=new Set(["connect","connection","new_namespace"]);class a extends r.StrictEventEmitter{constructor(e,t){super(),this.sockets=new Map,this._fns=[],this._ids=0,this.server=e,this.name=t,this._initAdapter()}_initAdapter(){this.adapter=new(this.server.adapter())(this)}use(e){return this._fns.push(e),this}run(e,t){const n=this._fns.slice(0);if(!n.length)return t(null);!function r(i){n[i](e,(function(e){return e?t(e):n[i+1]?void r(i+1):t(null)}))}(0)}to(e){return new s.BroadcastOperator(this.adapter).to(e)}in(e){return new s.BroadcastOperator(this.adapter).in(e)}except(e){return new s.BroadcastOperator(this.adapter).except(e)}async _add(e,t,n){var r;o("adding socket to nsp %s",this.name);const i=await this._createSocket(e,t);if((null===(r=this.server.opts.connectionStateRecovery)||void 0===r?void 0:r.skipMiddlewares)&&i.recovered&&"open"===e.conn.readyState)return this._doConnect(i,n);this.run(i,(t=>{process.nextTick((()=>"open"!==e.conn.readyState?(o("next called after client was closed - ignoring socket"),void i._cleanup()):t?(o("middleware error, sending CONNECT_ERROR packet to the client"),i._cleanup(),3===e.conn.protocol?i._error(t.data||t.message):i._error({message:t.message,data:t.data})):void this._doConnect(i,n)))}))}async _createSocket(e,t){const r=t.pid,i=t.offset;if(this.server.opts.connectionStateRecovery&&"string"==typeof r&&"string"==typeof i){let s;try{s=await this.adapter.restoreSession(r,i)}catch(e){o("error while restoring session: %s",e)}if(s)return o("connection state recovered for sid %s",s.sid),new n.Socket(this,e,t,s)}return new n.Socket(this,e,t)}_doConnect(e,t){this.sockets.set(e.id,e),e._onconnect(),t&&t(e),this.emitReserved("connect",e),this.emitReserved("connection",e)}_remove(e){this.sockets.has(e.id)?this.sockets.delete(e.id):o("ignoring remove for %s",e.id)}emit(e,...t){return new s.BroadcastOperator(this.adapter).emit(e,...t)}send(...e){return this.emit("message",...e),this}write(...e){return this.emit("message",...e),this}serverSideEmit(t,...n){if(e.RESERVED_EVENTS.has(t))throw new Error(`"${String(t)}" is a reserved event name`);return n.unshift(t),this.adapter.serverSideEmit(n),!0}serverSideEmitWithAck(e,...t){return new Promise(((n,r)=>{t.push(((e,t)=>e?(e.responses=t,r(e)):n(t))),this.serverSideEmit(e,...t)}))}_onServerSideEmit(e){super.emitUntyped.apply(this,e)}allSockets(){return new s.BroadcastOperator(this.adapter).allSockets()}compress(e){return new s.BroadcastOperator(this.adapter).compress(e)}get volatile(){return new s.BroadcastOperator(this.adapter).volatile}get local(){return new s.BroadcastOperator(this.adapter).local}timeout(e){return new s.BroadcastOperator(this.adapter).timeout(e)}fetchSockets(){return new s.BroadcastOperator(this.adapter).fetchSockets()}socketsJoin(e){return new s.BroadcastOperator(this.adapter).socketsJoin(e)}socketsLeave(e){return new s.BroadcastOperator(this.adapter).socketsLeave(e)}disconnectSockets(e=!1){return new s.BroadcastOperator(this.adapter).disconnectSockets(e)}}e.Namespace=a}(zQ);var eJ={},tJ={},nJ={},rJ={};Object.defineProperty(rJ,"__esModule",{value:!0}),rJ.yeast=rJ.decode=rJ.encode=void 0;const iJ="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),sJ=64,oJ={};let aJ,cJ=0,lJ=0;function uJ(e){let t="";do{t=iJ[e%sJ]+t,e=Math.floor(e/sJ)}while(e>0);return t}for(rJ.encode=uJ,rJ.decode=function(e){let t=0;for(lJ=0;lJ<e.length;lJ++)t=t*sJ+oJ[e.charAt(lJ)];return t},rJ.yeast=function(){const e=uJ(+new Date);return e!==aJ?(cJ=0,aJ=e):e+"."+uJ(cJ++)};lJ<sJ;lJ++)oJ[iJ[lJ]]=lJ;var pJ;Object.defineProperty(nJ,"__esModule",{value:!0}),nJ.SessionAwareAdapter=nJ.Adapter=void 0;const hJ=p,dJ=rJ,fJ=NZ,mJ="function"==typeof(null===(pJ=null==fJ?void 0:fJ.Sender)||void 0===pJ?void 0:pJ.frame);class gJ extends hJ.EventEmitter{constructor(e){super(),this.nsp=e,this.rooms=new Map,this.sids=new Map,this.encoder=e.server.encoder}init(){}close(){}serverCount(){return Promise.resolve(1)}addAll(e,t){this.sids.has(e)||this.sids.set(e,new Set);for(const n of t)this.sids.get(e).add(n),this.rooms.has(n)||(this.rooms.set(n,new Set),this.emit("create-room",n)),this.rooms.get(n).has(e)||(this.rooms.get(n).add(e),this.emit("join-room",n,e))}del(e,t){this.sids.has(e)&&this.sids.get(e).delete(t),this._del(t,e)}_del(e,t){const n=this.rooms.get(e);if(null!=n){n.delete(t)&&this.emit("leave-room",e,t),0===n.size&&this.rooms.delete(e)&&this.emit("delete-room",e)}}delAll(e){if(this.sids.has(e)){for(const t of this.sids.get(e))this._del(t,e);this.sids.delete(e)}}broadcast(e,t){const n=t.flags||{},r={preEncoded:!0,volatile:n.volatile,compress:n.compress};e.nsp=this.nsp.name;const i=this._encode(e,r);this.apply(t,(t=>{"function"==typeof t.notifyOutgoingListeners&&t.notifyOutgoingListeners(e),t.client.writeToEngine(i,r)}))}broadcastWithAck(e,t,n,r){const i=t.flags||{},s={preEncoded:!0,volatile:i.volatile,compress:i.compress};e.nsp=this.nsp.name,e.id=this.nsp._ids++;const o=this._encode(e,s);let a=0;this.apply(t,(t=>{a++,t.acks.set(e.id,r),"function"==typeof t.notifyOutgoingListeners&&t.notifyOutgoingListeners(e),t.client.writeToEngine(o,s)})),n(a)}_encode(e,t){const n=this.encoder.encode(e);if(mJ&&1===n.length&&"string"==typeof n[0]){const e=Buffer.from("4"+n[0]);t.wsPreEncodedFrame=fJ.Sender.frame(e,{readOnly:!1,mask:!1,rsv1:!1,opcode:1,fin:!0})}return n}sockets(e){const t=new Set;return this.apply({rooms:e},(e=>{t.add(e.id)})),Promise.resolve(t)}socketRooms(e){return this.sids.get(e)}fetchSockets(e){const t=[];return this.apply(e,(e=>{t.push(e)})),Promise.resolve(t)}addSockets(e,t){this.apply(e,(e=>{e.join(t)}))}delSockets(e,t){this.apply(e,(e=>{t.forEach((t=>e.leave(t)))}))}disconnectSockets(e,t){this.apply(e,(e=>{e.disconnect(t)}))}apply(e,t){const n=e.rooms,r=this.computeExceptSids(e.except);if(n.size){const e=new Set;for(const i of n)if(this.rooms.has(i))for(const n of this.rooms.get(i)){if(e.has(n)||r.has(n))continue;const i=this.nsp.sockets.get(n);i&&(t(i),e.add(n))}}else for(const[e]of this.sids){if(r.has(e))continue;const n=this.nsp.sockets.get(e);n&&t(n)}}computeExceptSids(e){const t=new Set;if(e&&e.size>0)for(const n of e)this.rooms.has(n)&&this.rooms.get(n).forEach((e=>t.add(e)));return t}serverSideEmit(e){console.warn("this adapter does not support the serverSideEmit() functionality")}persistSession(e){}restoreSession(e,t){return null}}nJ.Adapter=gJ;function yJ(e,t){const n=0===t.rooms.size||e.some((e=>t.rooms.has(e))),r=e.every((e=>!t.except.has(e)));return n&&r}nJ.SessionAwareAdapter=class extends gJ{constructor(e){super(e),this.nsp=e,this.sessions=new Map,this.packets=[],this.maxDisconnectionDuration=e.server.opts.connectionStateRecovery.maxDisconnectionDuration;const t=setInterval((()=>{const e=Date.now()-this.maxDisconnectionDuration;this.sessions.forEach(((t,n)=>{t.disconnectedAt<e&&this.sessions.delete(n)}));for(let t=this.packets.length-1;t>=0;t--){if(this.packets[t].emittedAt<e){this.packets.splice(0,t+1);break}}}),6e4);t.unref()}persistSession(e){e.disconnectedAt=Date.now(),this.sessions.set(e.pid,e)}restoreSession(e,t){const n=this.sessions.get(e);if(!n)return null;if(n.disconnectedAt+this.maxDisconnectionDuration<Date.now())return this.sessions.delete(e),null;const r=this.packets.findIndex((e=>e.id===t));if(-1===r)return null;const i=[];for(let e=r+1;e<this.packets.length;e++){const t=this.packets[e];yJ(n.rooms,t.opts)&&i.push(t.data)}return Promise.resolve(Object.assign(Object.assign({},n),{missedPackets:i}))}broadcast(e,t){var n;const r=2===e.type,i=void 0===e.id,s=void 0===(null===(n=t.flags)||void 0===n?void 0:n.volatile);if(r&&i&&s){const n=(0,dJ.yeast)();e.data.push(n),this.packets.push({id:n,opts:t,data:e.data,emittedAt:Date.now()})}super.broadcast(e,t)}};var vJ={};!function(e){var t=U&&U.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n};Object.defineProperty(e,"__esModule",{value:!0}),e.ClusterAdapterWithHeartbeat=e.ClusterAdapter=e.MessageType=void 0;const n=nJ,r=w,i=(0,ah.debug)("socket.io-adapter"),s=5e3;function o(){return(0,r.randomBytes)(8).toString("hex")}var a;function c(e){return{rooms:[...e.rooms],except:[...e.except],flags:e.flags}}function l(e){return{rooms:new Set(e.rooms),except:new Set(e.except),flags:e.flags}}!function(e){e[e.INITIAL_HEARTBEAT=1]="INITIAL_HEARTBEAT",e[e.HEARTBEAT=2]="HEARTBEAT",e[e.BROADCAST=3]="BROADCAST",e[e.SOCKETS_JOIN=4]="SOCKETS_JOIN",e[e.SOCKETS_LEAVE=5]="SOCKETS_LEAVE",e[e.DISCONNECT_SOCKETS=6]="DISCONNECT_SOCKETS",e[e.FETCH_SOCKETS=7]="FETCH_SOCKETS",e[e.FETCH_SOCKETS_RESPONSE=8]="FETCH_SOCKETS_RESPONSE",e[e.SERVER_SIDE_EMIT=9]="SERVER_SIDE_EMIT",e[e.SERVER_SIDE_EMIT_RESPONSE=10]="SERVER_SIDE_EMIT_RESPONSE",e[e.BROADCAST_CLIENT_COUNT=11]="BROADCAST_CLIENT_COUNT",e[e.BROADCAST_ACK=12]="BROADCAST_ACK",e[e.ADAPTER_CLOSE=13]="ADAPTER_CLOSE"}(a=e.MessageType||(e.MessageType={}));class u extends n.Adapter{constructor(e){super(e),this.requests=new Map,this.ackRequests=new Map,this.uid=o()}onMessage(e,n){if(e.uid===this.uid)return i("[%s] ignore message from self",this.uid);switch(i("[%s] new event of type %d from %s",this.uid,e.type,e.uid),e.type){case a.BROADCAST:if(void 0!==e.data.requestId)super.broadcastWithAck(e.data.packet,l(e.data.opts),(t=>{i("[%s] waiting for %d client acknowledgements",this.uid,t),this.publishResponse(e.uid,{type:a.BROADCAST_CLIENT_COUNT,data:{requestId:e.data.requestId,clientCount:t}})}),(t=>{i("[%s] received acknowledgement with value %j",this.uid,t),this.publishResponse(e.uid,{type:a.BROADCAST_ACK,data:{requestId:e.data.requestId,packet:t}})}));else{const t=e.data.packet,r=l(e.data.opts);this.addOffsetIfNecessary(t,r,n),super.broadcast(t,r)}break;case a.SOCKETS_JOIN:super.addSockets(l(e.data.opts),e.data.rooms);break;case a.SOCKETS_LEAVE:super.delSockets(l(e.data.opts),e.data.rooms);break;case a.DISCONNECT_SOCKETS:super.disconnectSockets(l(e.data.opts),e.data.close);break;case a.FETCH_SOCKETS:i("[%s] calling fetchSockets with opts %j",this.uid,e.data.opts),super.fetchSockets(l(e.data.opts)).then((n=>{this.publishResponse(e.uid,{type:a.FETCH_SOCKETS_RESPONSE,data:{requestId:e.data.requestId,sockets:n.map((e=>{const n=e.handshake,r=t(n,["sessionStore"]);return{id:e.id,handshake:r,rooms:[...e.rooms],data:e.data}}))}})}));break;case a.SERVER_SIDE_EMIT:{const t=e.data.packet;if(!(void 0!==e.data.requestId))return void this.nsp._onServerSideEmit(t);let n=!1;const r=t=>{n||(n=!0,i("[%s] calling acknowledgement with %j",this.uid,t),this.publishResponse(e.uid,{type:a.SERVER_SIDE_EMIT_RESPONSE,data:{requestId:e.data.requestId,packet:t}}))};this.nsp._onServerSideEmit([...t,r]);break}case a.BROADCAST_CLIENT_COUNT:case a.BROADCAST_ACK:case a.FETCH_SOCKETS_RESPONSE:case a.SERVER_SIDE_EMIT_RESPONSE:this.onResponse(e);break;default:i("[%s] unknown message type: %s",this.uid,e.type)}}onResponse(e){var t,n;const r=e.data.requestId;switch(i("[%s] received response %s to request %s",this.uid,e.type,r),e.type){case a.BROADCAST_CLIENT_COUNT:null===(t=this.ackRequests.get(r))||void 0===t||t.clientCountCallback(e.data.clientCount);break;case a.BROADCAST_ACK:null===(n=this.ackRequests.get(r))||void 0===n||n.ack(e.data.packet);break;case a.FETCH_SOCKETS_RESPONSE:{const t=this.requests.get(r);if(!t)return;t.current++,e.data.sockets.forEach((e=>t.responses.push(e))),t.current===t.expected&&(clearTimeout(t.timeout),t.resolve(t.responses),this.requests.delete(r));break}case a.SERVER_SIDE_EMIT_RESPONSE:{const t=this.requests.get(r);if(!t)return;t.current++,t.responses.push(e.data.packet),t.current===t.expected&&(clearTimeout(t.timeout),t.resolve(null,t.responses),this.requests.delete(r));break}default:i("[%s] unknown response type: %s",this.uid,e.type)}}async broadcast(e,t){var n;if(!(null===(n=t.flags)||void 0===n?void 0:n.local))try{const n=await this.publishAndReturnOffset({type:a.BROADCAST,data:{packet:e,opts:c(t)}});this.addOffsetIfNecessary(e,t,n)}catch(e){return i("[%s] error while broadcasting message: %s",this.uid,e.message)}super.broadcast(e,t)}addOffsetIfNecessary(e,t,n){var r;if(!this.nsp.server.opts.connectionStateRecovery)return;const i=2===e.type,s=void 0===e.id,o=void 0===(null===(r=t.flags)||void 0===r?void 0:r.volatile);i&&s&&o&&e.data.push(n)}broadcastWithAck(e,t,n,r){var i;if(!(null===(i=null==t?void 0:t.flags)||void 0===i?void 0:i.local)){const i=o();this.ackRequests.set(i,{clientCountCallback:n,ack:r}),this.publish({type:a.BROADCAST,data:{packet:e,requestId:i,opts:c(t)}}),setTimeout((()=>{this.ackRequests.delete(i)}),t.flags.timeout)}super.broadcastWithAck(e,t,n,r)}async addSockets(e,t){var n;if(!(null===(n=e.flags)||void 0===n?void 0:n.local))try{await this.publishAndReturnOffset({type:a.SOCKETS_JOIN,data:{opts:c(e),rooms:t}})}catch(e){i("[%s] error while publishing message: %s",this.uid,e.message)}super.addSockets(e,t)}async delSockets(e,t){var n;if(!(null===(n=e.flags)||void 0===n?void 0:n.local))try{await this.publishAndReturnOffset({type:a.SOCKETS_LEAVE,data:{opts:c(e),rooms:t}})}catch(e){i("[%s] error while publishing message: %s",this.uid,e.message)}super.delSockets(e,t)}async disconnectSockets(e,t){var n;if(!(null===(n=e.flags)||void 0===n?void 0:n.local))try{await this.publishAndReturnOffset({type:a.DISCONNECT_SOCKETS,data:{opts:c(e),close:t}})}catch(e){i("[%s] error while publishing message: %s",this.uid,e.message)}super.disconnectSockets(e,t)}async fetchSockets(e){var t;const[n,r]=await Promise.all([super.fetchSockets(e),this.serverCount()]),i=r-1;if((null===(t=e.flags)||void 0===t?void 0:t.local)||i<=0)return n;const l=o();return new Promise(((t,r)=>{const o=setTimeout((()=>{const e=this.requests.get(l);e&&(r(new Error(`timeout reached: only ${e.current} responses received out of ${e.expected}`)),this.requests.delete(l))}),e.flags.timeout||s),u={type:a.FETCH_SOCKETS,resolve:t,timeout:o,current:0,expected:i,responses:n};this.requests.set(l,u),this.publish({type:a.FETCH_SOCKETS,data:{opts:c(e),requestId:l}})}))}async serverSideEmit(e){if(!("function"==typeof e[e.length-1]))return this.publish({type:a.SERVER_SIDE_EMIT,data:{packet:e}});const t=e.pop(),n=await this.serverCount()-1;if(i('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,n),n<=0)return t(null,[]);const r=o(),c=setTimeout((()=>{const e=this.requests.get(r);e&&(t(new Error(`timeout reached: only ${e.current} responses received out of ${e.expected}`),e.responses),this.requests.delete(r))}),s),l={type:a.SERVER_SIDE_EMIT,resolve:t,timeout:c,current:0,expected:n,responses:[]};this.requests.set(r,l),this.publish({type:a.SERVER_SIDE_EMIT,data:{requestId:r,packet:e}})}publish(e){this.publishAndReturnOffset(e).catch((e=>{i("[%s] error while publishing message: %s",this.uid,e)}))}publishAndReturnOffset(e){return e.uid=this.uid,e.nsp=this.nsp.name,this.doPublish(e)}publishResponse(e,t){t.uid=this.uid,t.nsp=this.nsp.name,this.doPublishResponse(e,t).catch((e=>{i("[%s] error while publishing response: %s",this.uid,e)}))}}e.ClusterAdapter=u;e.ClusterAdapterWithHeartbeat=class extends u{constructor(e,t){super(e),this.nodesMap=new Map,this.customRequests=new Map,this._opts=Object.assign({heartbeatInterval:5e3,heartbeatTimeout:1e4},t),this.cleanupTimer=setInterval((()=>{const e=Date.now();this.nodesMap.forEach(((t,n)=>{e-t>this._opts.heartbeatTimeout&&(i("[%s] node %s seems down",this.uid,n),this.removeNode(n))}))}),1e3)}init(){this.publish({type:a.INITIAL_HEARTBEAT})}scheduleHeartbeat(){this.heartbeatTimer?this.heartbeatTimer.refresh():this.heartbeatTimer=setTimeout((()=>{this.publish({type:a.HEARTBEAT})}),this._opts.heartbeatInterval)}close(){this.publish({type:a.ADAPTER_CLOSE}),clearTimeout(this.heartbeatTimer),this.cleanupTimer&&clearInterval(this.cleanupTimer)}onMessage(e,t){if(e.uid===this.uid)return i("[%s] ignore message from self",this.uid);switch(e.uid&&"emitter"!==e.uid&&this.nodesMap.set(e.uid,Date.now()),i("[%s] new event of type %d from %s",this.uid,e.type,e.uid),e.type){case a.INITIAL_HEARTBEAT:this.publish({type:a.HEARTBEAT});break;case a.HEARTBEAT:break;case a.ADAPTER_CLOSE:this.removeNode(e.uid);break;default:super.onMessage(e,t)}}serverCount(){return Promise.resolve(1+this.nodesMap.size)}publish(e){return this.scheduleHeartbeat(),super.publish(e)}async serverSideEmit(e){if(!("function"==typeof e[e.length-1]))return this.publish({type:a.SERVER_SIDE_EMIT,data:{packet:e}});const t=e.pop(),n=this.nodesMap.size;if(i('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,n),n<=0)return t(null,[]);const r=o(),c=setTimeout((()=>{const e=this.customRequests.get(r);e&&(t(new Error(`timeout reached: missing ${e.missingUids.size} responses`),e.responses),this.customRequests.delete(r))}),s),l={type:a.SERVER_SIDE_EMIT,resolve:t,timeout:c,missingUids:new Set([...this.nodesMap.keys()]),responses:[]};this.customRequests.set(r,l),this.publish({type:a.SERVER_SIDE_EMIT,data:{requestId:r,packet:e}})}async fetchSockets(e){var t;const[n,r]=await Promise.all([super.fetchSockets({rooms:e.rooms,except:e.except,flags:{local:!0}}),this.serverCount()]),i=r-1;if((null===(t=e.flags)||void 0===t?void 0:t.local)||i<=0)return n;const l=o();return new Promise(((t,r)=>{const i=setTimeout((()=>{const e=this.customRequests.get(l);e&&(r(new Error(`timeout reached: missing ${e.missingUids.size} responses`)),this.customRequests.delete(l))}),e.flags.timeout||s),o={type:a.FETCH_SOCKETS,resolve:t,timeout:i,missingUids:new Set([...this.nodesMap.keys()]),responses:n};this.customRequests.set(l,o),this.publish({type:a.FETCH_SOCKETS,data:{opts:c(e),requestId:l}})}))}onResponse(e){const t=e.data.requestId;switch(i("[%s] received response %s to request %s",this.uid,e.type,t),e.type){case a.FETCH_SOCKETS_RESPONSE:{const n=this.customRequests.get(t);if(!n)return;e.data.sockets.forEach((e=>n.responses.push(e))),n.missingUids.delete(e.uid),0===n.missingUids.size&&(clearTimeout(n.timeout),n.resolve(n.responses),this.customRequests.delete(t));break}case a.SERVER_SIDE_EMIT_RESPONSE:{const n=this.customRequests.get(t);if(!n)return;n.responses.push(e.data.packet),n.missingUids.delete(e.uid),0===n.missingUids.size&&(clearTimeout(n.timeout),n.resolve(null,n.responses),this.customRequests.delete(t));break}default:super.onResponse(e)}}removeNode(e){this.customRequests.forEach(((t,n)=>{t.missingUids.delete(e),0===t.missingUids.size&&(clearTimeout(t.timeout),t.type===a.FETCH_SOCKETS?t.resolve(t.responses):t.type===a.SERVER_SIDE_EMIT&&t.resolve(null,t.responses),this.customRequests.delete(n))})),this.nodesMap.delete(e)}}}(vJ),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.MessageType=e.ClusterAdapterWithHeartbeat=e.ClusterAdapter=e.SessionAwareAdapter=e.Adapter=void 0;var t=nJ;Object.defineProperty(e,"Adapter",{enumerable:!0,get:function(){return t.Adapter}}),Object.defineProperty(e,"SessionAwareAdapter",{enumerable:!0,get:function(){return t.SessionAwareAdapter}});var n=vJ;Object.defineProperty(e,"ClusterAdapter",{enumerable:!0,get:function(){return n.ClusterAdapter}}),Object.defineProperty(e,"ClusterAdapterWithHeartbeat",{enumerable:!0,get:function(){return n.ClusterAdapterWithHeartbeat}}),Object.defineProperty(e,"MessageType",{enumerable:!0,get:function(){return n.MessageType}})}(tJ);var bJ=U&&U.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(eJ,"__esModule",{value:!0}),eJ.ParentNamespace=void 0;const _J=zQ,wJ=tJ,xJ=(0,bJ(ah).default)("socket.io:parent-namespace");class EJ extends _J.Namespace{constructor(e){super(e,"/_"+EJ.count++),this.children=new Set}_initAdapter(){this.adapter=new SJ(this,this.children)}emit(e,...t){return this.children.forEach((n=>{n.emit(e,...t)})),!0}createChild(e){xJ("creating child namespace %s",e);const t=new _J.Namespace(this.server,e);if(t._fns=this._fns.slice(0),this.listeners("connect").forEach((e=>t.on("connect",e))),this.listeners("connection").forEach((e=>t.on("connection",e))),this.children.add(t),this.server._opts.cleanupEmptyChildNamespaces){const n=t._remove;t._remove=r=>{n.call(t,r),0===t.sockets.size&&(xJ("closing child namespace %s",e),t.adapter.close(),this.server._nsps.delete(t.name),this.children.delete(t))}}return this.server._nsps.set(e,t),this.server.sockets.emitReserved("new_namespace",t),t}fetchSockets(){throw new Error("fetchSockets() is not supported on parent namespaces")}}eJ.ParentNamespace=EJ,EJ.count=0;class SJ extends wJ.Adapter{constructor(e,t){super(e),this.children=t}broadcast(e,t){this.children.forEach((n=>{n.adapter.broadcast(e,t)}))}}var TJ={},DJ=U&&U.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(TJ,"__esModule",{value:!0}),TJ.serveFile=TJ.restoreAdapter=TJ.patchAdapter=void 0;const kJ=tJ,AJ=s,CJ=(0,DJ(ah).default)("socket.io:adapter-uws"),RJ="",{addAll:OJ,del:LJ,broadcast:IJ}=kJ.Adapter.prototype;function PJ(e,t,n,r){const i=t.conn.id,s=t.conn.transport.socket;n&&(CJ("subscribe connection %s to topic %s",i,e),s.subscribe(e)),r.forEach((t=>{const n=`${e}${RJ}${t}`;CJ("subscribe connection %s to topic %s",i,n),s.subscribe(n)}))}TJ.patchAdapter=function(e){kJ.Adapter.prototype.addAll=function(e,t){const n=!this.sids.has(e);OJ.call(this,e,t);const r=this.nsp.sockets.get(e);r&&("websocket"!==r.conn.transport.name?n&&r.conn.on("upgrade",(()=>{const t=this.sids.get(e);t&&PJ(this.nsp.name,r,n,t)})):PJ(this.nsp.name,r,n,t))},kJ.Adapter.prototype.del=function(e,t){LJ.call(this,e,t);const n=this.nsp.sockets.get(e);if(n&&"websocket"===n.conn.transport.name){const e=n.conn.id,r=n.conn.transport.socket,i=`${this.nsp.name}${RJ}${t}`;CJ("unsubscribe connection %s from topic %s",e,i),r.unsubscribe(i)}},kJ.Adapter.prototype.broadcast=function(t,n){if(!(n.rooms.size<=1&&0===n.except.size))return void IJ.call(this,t,n);const r=n.flags||{},i={preEncoded:!0,volatile:r.volatile,compress:r.compress};t.nsp=this.nsp.name;const s=this.encoder.encode(t),o=0===n.rooms.size?this.nsp.name:`${this.nsp.name}${RJ}${n.rooms.keys().next().value}`;CJ("fast publish to %s",o),s.forEach((t=>{const n="string"!=typeof t;e.publish(o,n?t:"4"+t,n)})),this.apply(n,(e=>{"websocket"!==e.conn.transport.name&&e.client.writeToEngine(s,i)}))}},TJ.restoreAdapter=function(){kJ.Adapter.prototype.addAll=OJ,kJ.Adapter.prototype.del=LJ,kJ.Adapter.prototype.broadcast=IJ};TJ.serveFile=function(e,t){const{size:n}=(0,AJ.statSync)(t),r=(0,AJ.createReadStream)(t),i=()=>!r.destroyed&&r.destroy();e.onAborted(i),r.on("data",(t=>{const i=(e=>{const{buffer:t,byteOffset:n,byteLength:r}=e;return t.slice(n,n+r)})(t),s=e.getWriteOffset(),[o,a]=e.tryEnd(i,n);a||o||(r.pause(),e.onWritable((t=>{const[o,a]=e.tryEnd(i.slice(t-s),n);return!a&&o&&r.resume(),o})))})).on("error",(e=>{throw i(),e})).on("end",i)};var NJ="4.7.5";!function(e,t){var n=U&&U.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),r=U&&U.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=U&&U.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return r(t,e),t},a=U&&U.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Namespace=t.Socket=t.Server=void 0;const c=x,l=s,u=T,d=KM,f=h,m=o,g=xG,y=DQ,v=p,b=zQ;Object.defineProperty(t,"Namespace",{enumerable:!0,get:function(){return b.Namespace}});const _=eJ,w=tJ,E=i(kQ),S=a(ah),D=XQ();Object.defineProperty(t,"Socket",{enumerable:!0,get:function(){return D.Socket}});const k=GQ,A=TJ,C=a(qZ),R=(0,S.default)("socket.io:server"),O=NJ,L=/\.map/;class I extends k.StrictEventEmitter{constructor(e,t={}){super(),this._nsps=new Map,this.parentNsps=new Map,this.parentNamespacesFromRegExp=new Map,"object"==typeof e&&e instanceof Object&&!e.listen&&(t=e,e=void 0),this.path(t.path||"/socket.io"),this.connectTimeout(t.connectTimeout||45e3),this.serveClient(!1!==t.serveClient),this._parser=t.parser||E,this.encoder=new this._parser.Encoder,this.opts=t,t.connectionStateRecovery?(t.connectionStateRecovery=Object.assign({maxDisconnectionDuration:12e4,skipMiddlewares:!0},t.connectionStateRecovery),this.adapter(t.adapter||w.SessionAwareAdapter)):this.adapter(t.adapter||w.Adapter),t.cleanupEmptyChildNamespaces=!!t.cleanupEmptyChildNamespaces,this.sockets=this.of("/"),(e||"number"==typeof e)&&this.attach(e),this.opts.cors&&(this._corsMiddleware=(0,C.default)(this.opts.cors))}get _opts(){return this.opts}serveClient(e){return arguments.length?(this._serveClient=e,this):this._serveClient}_checkNamespace(e,t,n){if(0===this.parentNsps.size)return n(!1);const r=this.parentNsps.keys(),i=()=>{const s=r.next();if(s.done)return n(!1);s.value(e,t,((t,r)=>{if(t||!r)return i();if(this._nsps.has(e))return R("dynamic namespace %s already exists",e),n(this._nsps.get(e));const o=this.parentNsps.get(s.value).createChild(e);R("dynamic namespace %s was created",e),n(o)}))};i()}path(e){if(!arguments.length)return this._path;this._path=e.replace(/\/$/,"");const t=this._path.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");return this.clientPathRegex=new RegExp("^"+t+"/socket\\.io(\\.msgpack|\\.esm)?(\\.min)?\\.js(\\.map)?(?:\\?|$)"),this}connectTimeout(e){return void 0===e?this._connectTimeout:(this._connectTimeout=e,this)}adapter(e){if(!arguments.length)return this._adapter;this._adapter=e;for(const e of this._nsps.values())e._initAdapter();return this}listen(e,t={}){return this.attach(e,t)}attach(e,t={}){if("function"==typeof e){throw new Error("You are trying to attach socket.io to an express request handler function. Please pass a http.Server instance.")}if(Number(e)==e&&(e=Number(e)),"number"==typeof e){R("creating http server and binding to %d",e);const t=e;e=c.createServer(((e,t)=>{t.writeHead(404),t.end()})),e.listen(t)}return Object.assign(t,this.opts),t.path=t.path||this._path,this.initEngine(e,t),this}attachApp(e,t={}){Object.assign(t,this.opts),t.path=t.path||this._path,R("creating uWebSockets.js-based engine with opts %j",t);const n=new g.uServer(t);n.attach(e,t),this.bind(n),this._serveClient&&e.get(`${this._path}/*`,((e,t)=>{if(!this.clientPathRegex.test(t.getUrl()))return void t.setYield(!0);const n=t.getUrl().replace(this._path,"").replace(/\?.*$/,"").replace(/^\//,""),r=L.test(n),i=r?"map":"source",s='"'+O+'"',o="W/"+s,a=t.getHeader("if-none-match");if(a&&(s===a||o===a))return R("serve client %s 304",i),e.writeStatus("304 Not Modified"),void e.end();R("serve client %s",i),e.writeHeader("cache-control","public, max-age=0"),e.writeHeader("content-type","application/"+(r?"json":"javascript")+"; charset=utf-8"),e.writeHeader("etag",s);const c=m.join(__dirname,"../client-dist/",n);(0,A.serveFile)(e,c)})),(0,A.patchAdapter)(e)}initEngine(e,t){R("creating engine.io instance with opts %j",t),this.eio=(0,g.attach)(e,t),this._serveClient&&this.attachServe(e),this.httpServer=e,this.bind(this.eio)}attachServe(e){R("attaching client serving req handler");const t=e.listeners("request").slice(0);e.removeAllListeners("request"),e.on("request",((n,r)=>{if(this.clientPathRegex.test(n.url))this._corsMiddleware?this._corsMiddleware(n,r,(()=>{this.serve(n,r)})):this.serve(n,r);else for(let i=0;i<t.length;i++)t[i].call(e,n,r)}))}serve(e,t){const n=e.url.replace(this._path,"").replace(/\?.*$/,""),r=L.test(n),i=r?"map":"source",s='"'+O+'"',o="W/"+s,a=e.headers["if-none-match"];if(a&&(s===a||o===a))return R("serve client %s 304",i),t.writeHead(304),void t.end();R("serve client %s",i),t.setHeader("Cache-Control","public, max-age=0"),t.setHeader("Content-Type","application/"+(r?"json":"javascript")+"; charset=utf-8"),t.setHeader("ETag",s),I.sendFile(n,e,t)}static sendFile(e,t,n){const r=(0,l.createReadStream)(m.join(__dirname,"../client-dist/",e)),i=e=>{e&&n.end()};switch(d(t).encodings(["br","gzip","deflate"])){case"br":n.writeHead(200,{"content-encoding":"br"}),(0,f.pipeline)(r,(0,u.createBrotliCompress)(),n,i);break;case"gzip":n.writeHead(200,{"content-encoding":"gzip"}),(0,f.pipeline)(r,(0,u.createGzip)(),n,i);break;case"deflate":n.writeHead(200,{"content-encoding":"deflate"}),(0,f.pipeline)(r,(0,u.createDeflate)(),n,i);break;default:n.writeHead(200),(0,f.pipeline)(r,n,i)}}bind(e){return this.engine=e,this.engine.on("connection",this.onconnection.bind(this)),this}onconnection(e){R("incoming connection with id %s",e.id);const t=new y.Client(this,e);return 3===e.protocol&&t.connect("/"),this}of(e,t){if("function"==typeof e||e instanceof RegExp){const n=new _.ParentNamespace(this);return R("initializing parent namespace %s",n.name),"function"==typeof e?this.parentNsps.set(e,n):(this.parentNsps.set(((t,n,r)=>r(null,e.test(t))),n),this.parentNamespacesFromRegExp.set(e,n)),t&&n.on("connect",t),n}"/"!==String(e)[0]&&(e="/"+e);let n=this._nsps.get(e);if(!n){for(const[t,n]of this.parentNamespacesFromRegExp)if(t.test(e))return R("attaching namespace %s to parent namespace %s",e,t),n.createChild(e);R("initializing namespace %s",e),n=new b.Namespace(this,e),this._nsps.set(e,n),"/"!==e&&this.sockets.emitReserved("new_namespace",n)}return t&&n.on("connect",t),n}close(e){this._nsps.forEach((e=>{e.sockets.forEach((e=>{e._onclose("server shutting down")})),e.adapter.close()})),this.engine.close(),(0,A.restoreAdapter)(),this.httpServer?this.httpServer.close(e):e&&e()}use(e){return this.sockets.use(e),this}to(e){return this.sockets.to(e)}in(e){return this.sockets.in(e)}except(e){return this.sockets.except(e)}send(...e){return this.sockets.emit("message",...e),this}write(...e){return this.sockets.emit("message",...e),this}serverSideEmit(e,...t){return this.sockets.serverSideEmit(e,...t)}serverSideEmitWithAck(e,...t){return this.sockets.serverSideEmitWithAck(e,...t)}allSockets(){return this.sockets.allSockets()}compress(e){return this.sockets.compress(e)}get volatile(){return this.sockets.volatile}get local(){return this.sockets.local}timeout(e){return this.sockets.timeout(e)}fetchSockets(){return this.sockets.fetchSockets()}socketsJoin(e){return this.sockets.socketsJoin(e)}socketsLeave(e){return this.sockets.socketsLeave(e)}disconnectSockets(e=!1){return this.sockets.disconnectSockets(e)}}t.Server=I;const P=Object.keys(v.EventEmitter.prototype).filter((function(e){return"function"==typeof v.EventEmitter.prototype[e]}));P.forEach((function(e){I.prototype[e]=function(){return this.sockets[e].apply(this.sockets,arguments)}})),e.exports=(e,t)=>new I(e,t),e.exports.Server=I,e.exports.Namespace=b.Namespace,e.exports.Socket=D.Socket,XQ()}(wG,wG.exports);var jJ=q(wG.exports);const{Server:FJ,Namespace:BJ,Socket:MJ}=jJ,UJ=e=>new Promise(((t,n)=>{const r=a.platform();let i;if("win32"===r)i=`start ${e}`;else if("darwin"===r)i=`open ${e}`;else{if("linux"!==r)return n(new Error(`Unsupported platform: ${r}`));i=`xdg-open ${e}`}d.exec(i,(e=>{if(e)return n(new Error(`Failed to open URL on ${r}: ${e.message}`));t()}))})),qJ=process.cwd(),HJ=o.join(qJ,"src","views");const $J=new ke;$J.name("theme").description("dev, list"),$J.command("create").description("Run development server with Webpack and BrowserSync").action(gf),$J.command("check").description("Run development server with Webpack and BrowserSync").action((async function(){const e=zr("Checking files...").start();try{const t=await qO(HJ,"views"),n=Object.keys(t);await HO(n,e)}catch(t){e.fail("Failed to retrieve files"),console.error(_t.red(`Failed to retrieve files - Error: ${t.message}`))}})),$J.command("dev").description("Run development server with Webpack and BrowserSync").action((async()=>{await mf();const{data:e}=await of.get("/apps"),t=e?.apps?.map((e=>({name:e.subdomain,value:e._id}))),n=await yl.prompt({type:"list",name:"app",message:"Choose the theme you want to use",choices:t});var r=e?.apps?.find((e=>e._id===n.app));const i=nq(),s=3e3,a=new x.Server(i),c=new FJ(a),l=zr("Start Server").start(),u=process.cwd(),p=o.join(u,"src");o.join(u,"src","assets");const h=o.join(u,"dist");d.exec("npx webpack --config webpack.config.js --mode development --stats errors-warnings",(async e=>{e&&console.log(e,"errrrrr");try{await I.access(p),await I.access(h)}catch{console.error("Error: Required directories do not exist."),process.exit(1)}i.use(nq.static(h)),i.get("/api/auth",((e,t)=>{const{redirect_url:n,token:r}=e.query;if(console.log("🚀 ~ app.get ~ req.query:",e.query),!n||!r)return t.status(400).send("Missing redirect_url or token");t.cookie("token",r,{httpOnly:!1,secure:"production"===process.env.NODE_ENV,expires:new Date(9999,0,1)}),t.redirect(n)})),i.get("/api/auth/logout",((e,t)=>{t.clearCookie("token",{httpOnly:!0,secure:"production"===process.env.NODE_ENV}),t.redirect("/")})),i.get("*",j(i,{viewsDirectory:p,secretKey:r.secretKey,watch:!0},"development")),zr("REloading");const t=zr("Connected"),n=zr("Budilding");c.on("connection",(e=>{t.stop(),t.start();const r=rq.watch([p,o.join(u,"tailwind.config.js")]);r.on("change",(()=>{r.close(),t.stop(),n.start(),d.exec(`cd ${u} && npx webpack --config webpack.config.js --mode development --stats errors-warnings`,(t=>{if(t)return console.log(t),void n.fail(_t.red("Build failed"));n.succeed(_t.blue("Rebuilt successfully")),e.emit("reload")}))})),e.on("disconnect",(()=>{r.close()}))})),c.on("disconnect",(()=>{console.log(_t.blue("Disconnected")),t.stop(),reloadSpinner.stop()})),a.listen(s,(()=>{l.succeed("Server Started"),console.log("Server running at http://localhost:3000"),UJ("http://localhost:3000")}))}))})),$J.command("list").description("List available themes").action((async()=>{const e=zr("Fetching Data...").start();try{const{data:t}=await of.get("/themes");e.stop();const n=t?.themes?.map((e=>({name:e.title,value:e._id}))),r=await yl.prompt({type:"list",name:"selectedThemeId",message:"Choose the theme you want to use:",choices:n}),i=t?.themes.find((e=>e._id===r.selectedThemeId));console.log("🚀 ~ getThemes ~ selectedTheme:",i)}catch(t){e.stop(),console.error("Failed to fetch data:",t)}}));const zJ=Object.create(null);zJ.open="0",zJ.close="1",zJ.ping="2",zJ.pong="3",zJ.message="4",zJ.upgrade="5",zJ.noop="6";const WJ=Object.create(null);Object.keys(zJ).forEach((e=>{WJ[zJ[e]]=e}));const GJ={type:"error",data:"parser error"},VJ=({type:e,data:t},n,r)=>t instanceof ArrayBuffer||ArrayBuffer.isView(t)?r(n?t:"b"+KJ(t,!0).toString("base64")):r(zJ[e]+(t||"")),KJ=(e,t)=>Buffer.isBuffer(e)||e instanceof Uint8Array&&!t?e:e instanceof ArrayBuffer?Buffer.from(e):Buffer.from(e.buffer,e.byteOffset,e.byteLength);let YJ;const ZJ=(e,t)=>{if("string"!=typeof e)return{type:"message",data:QJ(e,t)};const n=e.charAt(0);if("b"===n){const n=Buffer.from(e.substring(1),"base64");return{type:"message",data:QJ(n,t)}}return WJ[n]?e.length>1?{type:WJ[n],data:e.substring(1)}:{type:WJ[n]}:GJ},QJ=(e,t)=>"arraybuffer"===t?e instanceof ArrayBuffer?e:Buffer.isBuffer(e)?e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength):e.buffer:Buffer.isBuffer(e)?e:Buffer.from(e),JJ=String.fromCharCode(30);function XJ(){return new TransformStream({transform(e,t){!function(e,t){if(e.data instanceof ArrayBuffer||ArrayBuffer.isView(e.data))return t(KJ(e.data,!1));VJ(e,!0,(e=>{YJ||(YJ=new TextEncoder),t(YJ.encode(e))}))}(e,(n=>{const r=n.length;let i;if(r<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,r);else if(r<65536){i=new Uint8Array(3);const e=new DataView(i.buffer);e.setUint8(0,126),e.setUint16(1,r)}else{i=new Uint8Array(9);const e=new DataView(i.buffer);e.setUint8(0,127),e.setBigUint64(1,BigInt(r))}e.data&&"string"!=typeof e.data&&(i[0]|=128),t.enqueue(i),t.enqueue(n)}))}})}let eX;function tX(e){return e.reduce(((e,t)=>e+t.length),0)}function nX(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let i=0;i<t;i++)n[i]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}const rX=global;function iX(e,...t){return t.reduce(((t,n)=>(e.hasOwnProperty(n)&&(t[n]=e[n]),t)),{})}const sX=rX.setTimeout,oX=rX.clearTimeout;function aX(e,t){t.useNativeTimers?(e.setTimeoutFn=sX.bind(rX),e.clearTimeoutFn=oX.bind(rX)):(e.setTimeoutFn=rX.setTimeout.bind(rX),e.clearTimeoutFn=rX.clearTimeout.bind(rX))}class cX extends Error{constructor(e,t,n){super(e),this.description=t,this.context=n,this.type="TransportError"}}class lX extends AQ{constructor(e){super(),this.writable=!1,aX(this,e),this.opts=e,this.query=e.query,this.socket=e.socket}onError(e,t,n){return super.emitReserved("error",new cX(e,t,n)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this}send(e){"open"===this.readyState&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const t=ZJ(e,this.socket.binaryType);this.onPacket(t)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,t={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(t)}_hostname(){const e=this.opts.hostname;return-1===e.indexOf(":")?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(443!==this.opts.port)||!this.opts.secure&&80!==Number(this.opts.port))?":"+this.opts.port:""}_query(e){const t=function(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}(e);return t.length?"?"+t:""}}const uX="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),pX=64,hX={};let dX,fX=0,mX=0;function gX(e){let t="";do{t=uX[e%pX]+t,e=Math.floor(e/pX)}while(e>0);return t}function yX(){const e=gX(+new Date);return e!==dX?(fX=0,dX=e):e+"."+gX(fX++)}for(;mX<pX;mX++)hX[uX[mX]]=mX;
378
378
  /**
379
379
  * Wrapper for built-in http.js to emulate the browser XMLHttpRequest object.
380
380
  *
@@ -386,5 +386,5 @@ parse:function(e,t){if("string"!=typeof e)throw new TypeError("argument str must
386
386
  * @author Dan DeFelippi <dan@driverdan.com>
387
387
  * @contributor David Ellis <d.f.ellis@ieee.org>
388
388
  * @license MIT
389
- */var fX=s,mX=S,gX=d.spawn,yX=vX;function vX(e){e=e||{};var t,n,r=this,i=x,s=E,o={},a=!1,c={"User-Agent":"node-XMLHttpRequest",Accept:"*/*"},l=Object.assign({},c),u=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","content-transfer-encoding","cookie","cookie2","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"],p=["TRACE","TRACK","CONNECT"],h=!1,d=!1,f=!1,m={};this.UNSENT=0,this.OPENED=1,this.HEADERS_RECEIVED=2,this.LOADING=3,this.DONE=4,this.readyState=this.UNSENT,this.onreadystatechange=null,this.responseText="",this.responseXML="",this.status=null,this.statusText=null;this.open=function(e,t,n,r,i){if(this.abort(),d=!1,f=!1,!function(e){return e&&-1===p.indexOf(e)}(e))throw new Error("SecurityError: Request method not allowed");o={method:e,url:t.toString(),async:"boolean"!=typeof n||n,user:r||null,password:i||null},g(this.OPENED)},this.setDisableHeaderCheck=function(e){a=e},this.setRequestHeader=function(e,t){if(this.readyState!=this.OPENED)throw new Error("INVALID_STATE_ERR: setRequestHeader can only be called when state is OPEN");if(!function(e){return a||e&&-1===u.indexOf(e.toLowerCase())}(e))return console.warn('Refused to set unsafe header "'+e+'"'),!1;if(h)throw new Error("INVALID_STATE_ERR: send flag is true");return l[e]=t,!0},this.getResponseHeader=function(e){return"string"==typeof e&&this.readyState>this.OPENED&&n.headers[e.toLowerCase()]&&!d?n.headers[e.toLowerCase()]:null},this.getAllResponseHeaders=function(){if(this.readyState<this.HEADERS_RECEIVED||d)return"";var e="";for(var t in n.headers)"set-cookie"!==t&&"set-cookie2"!==t&&(e+=t+": "+n.headers[t]+"\r\n");return e.substr(0,e.length-2)},this.getRequestHeader=function(e){return"string"==typeof e&&l[e]?l[e]:""},this.send=function(a){if(this.readyState!=this.OPENED)throw new Error("INVALID_STATE_ERR: connection must be opened before send() is called");if(h)throw new Error("INVALID_STATE_ERR: send has already been called");var c,u=!1,p=!1,f=mX.parse(o.url);switch(f.protocol){case"https:":u=!0;case"http:":c=f.hostname;break;case"file:":p=!0;break;case void 0:case"":c="localhost";break;default:throw new Error("Protocol not supported.")}if(p){if("GET"!==o.method)throw new Error("XMLHttpRequest: Only GET method is supported");if(o.async)fX.readFile(unescape(f.pathname),"utf8",(function(e,t){e?r.handleError(e,e.errno||-1):(r.status=200,r.responseText=t,g(r.DONE))}));else try{this.responseText=fX.readFileSync(unescape(f.pathname),"utf8"),this.status=200,g(r.DONE)}catch(e){this.handleError(e,e.errno||-1)}}else{var m=f.port||(u?443:80),y=f.pathname+(f.search?f.search:"");if(l.Host=c,u&&443===m||80===m||(l.Host+=":"+f.port),o.user){void 0===o.password&&(o.password="");var v=new Buffer(o.user+":"+o.password);l.Authorization="Basic "+v.toString("base64")}"GET"===o.method||"HEAD"===o.method?a=null:a?(l["Content-Length"]=Buffer.isBuffer(a)?a.length:Buffer.byteLength(a),l["Content-Type"]||(l["Content-Type"]="text/plain;charset=UTF-8")):"POST"===o.method&&(l["Content-Length"]=0);var b=e.agent||!1,_={host:c,port:m,path:y,method:o.method,headers:l,agent:b};if(u&&(_.pfx=e.pfx,_.key=e.key,_.passphrase=e.passphrase,_.cert=e.cert,_.ca=e.ca,_.ciphers=e.ciphers,_.rejectUnauthorized=!1!==e.rejectUnauthorized),d=!1,o.async){var w=u?s.request:i.request;h=!0,r.dispatchEvent("readystatechange");var x=function(i){if(302===(n=i).statusCode||303===n.statusCode||307===n.statusCode){o.url=n.headers.location;var s=mX.parse(o.url);c=s.hostname;var a={hostname:s.hostname,port:s.port,path:s.path,method:303===n.statusCode?"GET":o.method,headers:l};return u&&(a.pfx=e.pfx,a.key=e.key,a.passphrase=e.passphrase,a.cert=e.cert,a.ca=e.ca,a.ciphers=e.ciphers,a.rejectUnauthorized=!1!==e.rejectUnauthorized),void(t=w(a,x).on("error",E)).end()}n&&n.setEncoding&&n.setEncoding("utf8"),g(r.HEADERS_RECEIVED),r.status=n.statusCode,n.on("data",(function(e){e&&(r.responseText+=e),h&&g(r.LOADING)})),n.on("end",(function(){h&&(h=!1,g(r.DONE))})),n.on("error",(function(e){r.handleError(e)}))},E=function(e){r.handleError(e)};t=w(_,x).on("error",E),e.autoUnref&&t.on("socket",(e=>{e.unref()})),a&&t.write(a),t.end(),r.dispatchEvent("loadstart")}else{var S=".node-xmlhttprequest-content-"+process.pid,T=".node-xmlhttprequest-sync-"+process.pid;fX.writeFileSync(T,"","utf8");for(var D="var http = require('http'), https = require('https'), fs = require('fs');var doRequest = http"+(u?"s":"")+".request;var options = "+JSON.stringify(_)+";var responseText = '';var req = doRequest(options, function(response) {response.setEncoding('utf8');response.on('data', function(chunk) { responseText += chunk;});response.on('end', function() {fs.writeFileSync('"+S+"', 'NODE-XMLHTTPREQUEST-STATUS:' + response.statusCode + ',' + responseText, 'utf8');fs.unlinkSync('"+T+"');});response.on('error', function(error) {fs.writeFileSync('"+S+"', 'NODE-XMLHTTPREQUEST-ERROR:' + JSON.stringify(error), 'utf8');fs.unlinkSync('"+T+"');});}).on('error', function(error) {fs.writeFileSync('"+S+"', 'NODE-XMLHTTPREQUEST-ERROR:' + JSON.stringify(error), 'utf8');fs.unlinkSync('"+T+"');});"+(a?"req.write('"+JSON.stringify(a).slice(1,-1).replace(/'/g,"\\'")+"');":"")+"req.end();",k=gX(process.argv[0],["-e",D]);fX.existsSync(T););if(r.responseText=fX.readFileSync(S,"utf8"),k.stdin.end(),fX.unlinkSync(S),r.responseText.match(/^NODE-XMLHTTPREQUEST-ERROR:/)){var A=r.responseText.replace(/^NODE-XMLHTTPREQUEST-ERROR:/,"");r.handleError(A,503)}else r.status=r.responseText.replace(/^NODE-XMLHTTPREQUEST-STATUS:([0-9]*),.*/,"$1"),r.responseText=r.responseText.replace(/^NODE-XMLHTTPREQUEST-STATUS:[0-9]*,(.*)/,"$1"),g(r.DONE)}}},this.handleError=function(e,t){this.status=t||0,this.statusText=e,this.responseText=e.stack,d=!0,g(this.DONE)},this.abort=function(){t&&(t.abort(),t=null),l=Object.assign({},c),this.responseText="",this.responseXML="",d=f=!0,this.readyState===this.UNSENT||this.readyState===this.OPENED&&!h||this.readyState===this.DONE||(h=!1,g(this.DONE)),this.readyState=this.UNSENT},this.addEventListener=function(e,t){e in m||(m[e]=[]),m[e].push(t)},this.removeEventListener=function(e,t){e in m&&(m[e]=m[e].filter((function(e){return e!==t})))},this.dispatchEvent=function(e){if("function"==typeof r["on"+e]&&(this.readyState===this.DONE?setImmediate((function(){r["on"+e]()})):r["on"+e]()),e in m)for(let t=0,n=m[e].length;t<n;t++)this.readyState===this.DONE?setImmediate((function(){m[e][t].call(r)})):m[e][t].call(r)};var g=function(e){if(!(r.readyState===e||r.readyState===r.UNSENT&&f)&&(r.readyState=e,(o.async||r.readyState<r.OPENED||r.readyState===r.DONE)&&r.dispatchEvent("readystatechange"),r.readyState===r.DONE)){let e;e=f?"abort":d?"error":"load",r.dispatchEvent(e),r.dispatchEvent("loadend")}}}vX.XMLHttpRequest=vX;var bX=q(yX);const _X=bX||B({__proto__:null,default:bX},[yX]);class wX{constructor(){this.cookies=new Map}parseCookies(e){const t=e.getResponseHeader("set-cookie");t&&t.forEach((e=>{const t=function(e){const t=e.split("; "),n=t[0].indexOf("=");if(-1===n)return;const r=t[0].substring(0,n).trim();if(!r.length)return;let i=t[0].substring(n+1).trim();34===i.charCodeAt(0)&&(i=i.slice(1,-1));const s={name:r,value:i};for(let e=1;e<t.length;e++){const n=t[e].split("=");if(2!==n.length)continue;const r=n[0].trim(),i=n[1].trim();switch(r){case"Expires":s.expires=new Date(i);break;case"Max-Age":const e=new Date;e.setUTCSeconds(e.getUTCSeconds()+parseInt(i,10)),s.expires=e}}return s}(e);t&&this.cookies.set(t.name,t)}))}addCookies(e){const t=[];this.cookies.forEach(((e,n)=>{var r;(null===(r=e.expires)||void 0===r?void 0:r.getTime())<Date.now()?this.cookies.delete(n):t.push(`${n}=${e.value}`)})),t.length&&(e.setDisableHeaderCheck(!0),e.setRequestHeader("cookie",t.join("; ")))}}function xX(){}const EX=null!=new _X({xdomain:!1}).responseType;let SX=class e extends SQ{constructor(e,t){super(),rX(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.data=void 0!==t.data?t.data:null,this.create()}create(){var t;const n=eX(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new _X(n);try{r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let e in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(e)&&r.setRequestHeader(e,this.opts.extraHeaders[e])}}catch(e){}if("POST"===this.method)try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{r.setRequestHeader("Accept","*/*")}catch(e){}null===(t=this.opts.cookieJar)||void 0===t||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var e;3===r.readyState&&(null===(e=this.opts.cookieJar)||void 0===e||e.parseCookies(r)),4===r.readyState&&(200===r.status||1223===r.status?this.onLoad():this.setTimeoutFn((()=>{this.onError("number"==typeof r.status?r.status:0)}),0))},r.send(this.data)}catch(e){return void this.setTimeoutFn((()=>{this.onError(e)}),0)}"undefined"!=typeof document&&(this.index=e.requestsCount++,e.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(t){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=xX,t)try{this.xhr.abort()}catch(e){}"undefined"!=typeof document&&delete e.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}};if(SX.requestsCount=0,SX.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",TX);else if("function"==typeof addEventListener){addEventListener("onpagehide"in XJ?"pagehide":"unload",TX,!1)}function TX(){for(let e in SX.requests)SX.requests.hasOwnProperty(e)&&SX.requests[e].abort()}const DX=aZ,kX=process.nextTick,AX="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();const CX={websocket:class extends sX{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),t=this.opts.protocols,n=AX?{}:eX(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=new DX(e,t,n)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;$J(n,this.supportsBinary,(e=>{const t={};if(n.options&&(t.compress=n.options.compress),this.opts.perMessageDeflate){("string"==typeof e?Buffer.byteLength(e):e.length)<this.opts.perMessageDeflate.threshold&&(t.compress=!1)}try{this.ws.send(e,t)}catch(e){}r&&kX((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=dX()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}check(){return!!DX}},webtransport:class extends sX{get name(){return"webtransport"}doOpen(){"function"==typeof WebTransport&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then((()=>{this.onClose()})).catch((e=>{this.onError("webtransport error",e)})),this.transport.ready.then((()=>{this.transport.createBidirectionalStream().then((e=>{const t=function(e,t){ZJ||(ZJ=new TextDecoder);const n=[];let r=0,i=-1,s=!1;return new TransformStream({transform(o,a){for(n.push(o);;){if(0===r){if(QJ(n)<1)break;const e=JJ(n,1);s=!(128&~e[0]),i=127&e[0],r=i<126?3:126===i?1:2}else if(1===r){if(QJ(n)<2)break;const e=JJ(n,2);i=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),r=3}else if(2===r){if(QJ(n)<8)break;const e=JJ(n,8),t=new DataView(e.buffer,e.byteOffset,e.length),s=t.getUint32(0);if(s>Math.pow(2,21)-1){a.enqueue(HJ);break}i=s*Math.pow(2,32)+t.getUint32(4),r=3}else{if(QJ(n)<i)break;const e=JJ(n,i);a.enqueue(GJ(s?e:ZJ.decode(e),t)),r=0}if(0===i||i>e){a.enqueue(HJ);break}}}})}(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),r=YJ();r.readable.pipeTo(e.writable),this.writer=r.writable.getWriter();const i=()=>{n.read().then((({done:e,value:t})=>{e||(this.onPacket(t),i())})).catch((e=>{}))};i();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this.writer.write(s).then((()=>this.onOpen()))}))})))}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;this.writer.write(n).then((()=>{r&&kX((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){var e;null===(e=this.transport)||void 0===e||e.close()}},polling:class extends sX{constructor(e){if(super(e),this.polling=!1,"undefined"!=typeof location){const t="https:"===location.protocol;let n=location.port;n||(n=t?"443":"80"),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||n!==e.port}const t=e&&e.forceBase64;this.supportsBinary=EX&&!t,this.opts.withCredentials&&(this.cookieJar=new wX)}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let e=0;this.polling&&(e++,this.once("pollComplete",(function(){--e||t()}))),this.writable||(e++,this.once("drain",(function(){--e||t()})))}else t()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){((e,t)=>{const n=e.split(KJ),r=[];for(let e=0;e<n.length;e++){const i=GJ(n[e],t);if(r.push(i),"error"===i.type)break}return r})(e,this.socket.binaryType).forEach((e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){this.writable=!1,((e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach(((e,s)=>{$J(e,!1,(e=>{r[s]=e,++i===n&&t(r.join(KJ))}))}))})(e,(e=>{this.doWrite(e,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=dX()),this.supportsBinary||t.sid||(t.b64=1),this.createUri(e,t)}request(e={}){return Object.assign(e,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new SX(this.uri(),e)}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",((e,t)=>{this.onError("xhr post error",e,t)}))}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",((e,t)=>{this.onError("xhr poll error",e,t)})),this.pollXhr=e}}},RX=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,OX=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function LX(e){if(e.length>2e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");-1!=n&&-1!=r&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=RX.exec(e||""),s={},o=14;for(;o--;)s[OX[o]]=i[o]||"";return-1!=n&&-1!=r&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=function(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");"/"!=t.slice(0,1)&&0!==t.length||r.splice(0,1);"/"==t.slice(-1)&&r.splice(r.length-1,1);return r}(0,s.path),s.queryKey=function(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(e,t,r){t&&(n[t]=r)})),n}(0,s.query),s}let IX=class e extends SQ{constructor(e,t={}){super(),this.binaryType="nodebuffer",this.writeBuffer=[],e&&"object"==typeof e&&(t=e,e=null),e?(e=LX(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=LX(t.host).host),rX(this,t),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=t.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(e){let t={},n=e.split("&");for(let e=0,r=n.length;e<r;e++){let r=n[e].split("=");t[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return t}(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,"function"==typeof addEventListener&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new CX[e](n)}open(){let t;if(this.opts.rememberUpgrade&&e.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))t="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);t=this.transports[0]}this.readyState="opening";try{t=this.createTransport(t)}catch(e){return this.transports.shift(),void this.open()}t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(e=>this.onClose("transport close",e)))}probe(t){let n=this.createTransport(t),r=!1;e.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",(t=>{if(!r)if("pong"===t.type&&"probe"===t.data){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;e.priorWebsocketSuccess="websocket"===n.name,this.transport.pause((()=>{r||"closed"!==this.readyState&&(u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())}))}else{const e=new Error("probe error");e.transport=n.name,this.emitReserved("upgradeError",e)}})))};function s(){r||(r=!0,u(),n.close(),n=null)}const o=e=>{const t=new Error("probe error: "+e);t.transport=n.name,s(),this.emitReserved("upgradeError",t)};function a(){o("transport closed")}function c(){o("socket closed")}function l(e){n&&e.name!==n.name&&s()}const u=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",a),this.off("close",c),this.off("upgrading",l)};n.once("open",i),n.once("error",o),n.once("close",a),this.once("close",c),this.once("upgrading",l),-1!==this.upgrades.indexOf("webtransport")&&"webtransport"!==t?this.setTimeoutFn((()=>{r||n.open()}),200):n.open()}onOpen(){if(this.readyState="open",e.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade){let e=0;const t=this.upgrades.length;for(;e<t;e++)this.probe(this.upgrades[e])}}onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),this.resetPingTimeout(),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn((()=>{this.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let n=0;n<this.writeBuffer.length;n++){const r=this.writeBuffer[n].data;if(r&&(e+="string"==typeof(t=r)?function(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}(t):Math.ceil(1.33*(t.byteLength||t.size))),n>0&&e>this.maxPayload)return this.writeBuffer.slice(0,n);e+=2}var t;return this.writeBuffer}write(e,t,n){return this.sendPacket("message",e,t,n),this}send(e,t,n){return this.sendPacket("message",e,t,n),this}sendPacket(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof n&&(r=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;(n=n||{}).compress=!1!==n.compress;const i={type:e,data:t,options:n};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?n():e()})):this.upgrading?n():e()),this}onError(t){e.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const t=[];let n=0;const r=e.length;for(;n<r;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}};IX.protocol=4,IX.protocol;const PX="function"==typeof ArrayBuffer,NX=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,jX=Object.prototype.toString,FX="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===jX.call(Blob),BX="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===jX.call(File);function MX(e){return PX&&(e instanceof ArrayBuffer||NX(e))||FX&&e instanceof Blob||BX&&e instanceof File}function UX(e,t){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(UX(e[t]))return!0;return!1}if(MX(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return UX(e.toJSON(),!0);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&UX(e[t]))return!0;return!1}function qX(e){const t=[],n=e.data,r=e;return r.data=HX(n,t),r.attachments=t.length,{packet:r,buffers:t}}function HX(e,t){if(!e)return e;if(MX(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=HX(e[r],t);return n}if("object"==typeof e&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=HX(e[r],t));return n}return e}function $X(e,t){return e.data=zX(e.data,t),delete e.attachments,e}function zX(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=zX(e[n],t);else if("object"==typeof e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=zX(e[n],t));return e}const WX=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var GX;!function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(GX||(GX={}));function VX(e){return"[object Object]"===Object.prototype.toString.call(e)}class KX extends SQ{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===GX.BINARY_EVENT;n||t.type===GX.BINARY_ACK?(t.type=n?GX.EVENT:GX.ACK,this.reconstructor=new YX(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!MX(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(void 0===GX[n.type])throw new Error("unknown packet type "+n.type);if(n.type===GX.BINARY_EVENT||n.type===GX.BINARY_ACK){const r=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const i=e.substring(r,t);if(i!=Number(i)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(i)}if("/"===e.charAt(t+1)){const r=t+1;for(;++t;){if(","===e.charAt(t))break;if(t===e.length)break}n.nsp=e.substring(r,t)}else n.nsp="/";const r=e.charAt(t+1);if(""!==r&&Number(r)==r){const r=t+1;for(;++t;){const n=e.charAt(t);if(null==n||Number(n)!=n){--t;break}if(t===e.length)break}n.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(!KX.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case GX.CONNECT:return VX(t);case GX.DISCONNECT:return void 0===t;case GX.CONNECT_ERROR:return"string"==typeof t||VX(t);case GX.EVENT:case GX.BINARY_EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===WX.indexOf(t[0]));case GX.ACK:case GX.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class YX{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=$X(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}var ZX=Object.freeze({__proto__:null,Decoder:KX,Encoder:class{constructor(e){this.replacer=e}encode(e){return e.type!==GX.EVENT&&e.type!==GX.ACK||!UX(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===GX.EVENT?GX.BINARY_EVENT:GX.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==GX.BINARY_EVENT&&e.type!==GX.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=qX(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}},get PacketType(){return GX},protocol:5});function QX(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const JX=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class XX extends SQ{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[QX(e,"open",this.onopen.bind(this)),QX(e,"packet",this.onpacket.bind(this)),QX(e,"error",this.onerror.bind(this)),QX(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(JX.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const n={type:GX.EVENT,data:t,options:{}};if(n.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){const e=this.ids++,r=t.pop();this._registerAckCallback(e,r),n.id=e}const r=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!r||!this.connected)||(this.connected?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(e,t){var n;const r=null!==(n=this.flags.timeout)&&void 0!==n?n:this._opts.ackTimeout;if(void 0===r)return void(this.acks[e]=t);const i=this.io.setTimeoutFn((()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,new Error("operation has timed out"))}),r),s=(...e)=>{this.io.clearTimeoutFn(i),t.apply(this,e)};s.withError=!0,this.acks[e]=s}emitWithAck(e,...t){return new Promise(((n,r)=>{const i=(e,t)=>e?r(e):n(t);i.withError=!0,t.push(i),this.emit(e,...t)}))}_addToQueue(e){let t;"function"==typeof e[e.length-1]&&(t=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push(((e,...r)=>{if(n!==this._queue[0])return;return null!==e?n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)):(this._queue.shift(),t&&t(null,...r)),n.pending=!1,this._drainQueue()})),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||0===this._queue.length)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth((e=>{this._sendConnectPacket(e)})):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:GX.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach((e=>{if(!this.sendBuffer.some((t=>String(t.id)===e))){const t=this.acks[e];delete this.acks[e],t.withError&&t.call(this,new Error("socket has been disconnected"))}}))}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case GX.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case GX.EVENT:case GX.BINARY_EVENT:this.onevent(e);break;case GX.ACK:case GX.BINARY_ACK:this.onack(e);break;case GX.DISCONNECT:this.ondisconnect();break;case GX.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){const t=e.data||[];null!=e.id&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&"string"==typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let n=!1;return function(...r){n||(n=!0,t.packet({type:GX.ACK,id:e,data:r}))}}onack(e){const t=this.acks[e.id];"function"==typeof t&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach((e=>this.emitEvent(e))),this.receiveBuffer=[],this.sendBuffer.forEach((e=>{this.notifyOutgoingListeners(e),this.packet(e)})),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach((e=>e())),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:GX.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const n of t)n.apply(this,e.data)}}}function e0(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}e0.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=1&Math.floor(10*t)?e+n:e-n}return 0|Math.min(e,this.max)},e0.prototype.reset=function(){this.attempts=0},e0.prototype.setMin=function(e){this.ms=e},e0.prototype.setMax=function(e){this.max=e},e0.prototype.setJitter=function(e){this.jitter=e};class t0 extends SQ{constructor(e,t){var n;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.opts=t,rX(this,t),this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(n=t.randomizationFactor)&&void 0!==n?n:.5),this.backoff=new e0({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const r=t.parser||ZX;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new IX(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=QX(t,"open",(function(){n.onopen(),e&&e()})),i=t=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",t),e?e(t):this.maybeReconnectOnOpen()},s=QX(t,"error",i);if(!1!==this._timeout){const e=this._timeout,n=this.setTimeoutFn((()=>{r(),i(new Error("timeout")),t.close()}),e);this.opts.autoUnref&&n.unref(),this.subs.push((()=>{this.clearTimeoutFn(n)}))}return this.subs.push(r),this.subs.push(s),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(QX(e,"ping",this.onping.bind(this)),QX(e,"data",this.ondata.bind(this)),QX(e,"error",this.onerror.bind(this)),QX(e,"close",this.onclose.bind(this)),QX(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose("parse error",e)}}ondecoded(e){kX((()=>{this.emitReserved("packet",e)}),this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new XX(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const e of t){if(this.nsps[e].active)return}this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach((e=>e())),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn((()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open((t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):e.onreconnect()})))}),t);this.opts.autoUnref&&n.unref(),this.subs.push((()=>{this.clearTimeoutFn(n)}))}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const n0={};function r0(e,t){"object"==typeof e&&(t=e,e=void 0);const n=function(e,t="",n){let r=e;n=n||"undefined"!=typeof location&&location,null==e&&(e=n.protocol+"//"+n.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==n?n.protocol+"//"+e:"https://"+e),r=LX(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const i=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+t,r.href=r.protocol+"://"+i+(n&&n.port===r.port?"":":"+r.port),r}(e,(t=t||{}).path||"/socket.io"),r=n.source,i=n.id,s=n.path,o=n0[i]&&s in n0[i].nsps;let a;return t.forceNew||t["force new connection"]||!1===t.multiplex||o?a=new t0(r,t):(n0[i]||(n0[i]=new t0(r,t)),a=n0[i]),n.query&&!t.query&&(t.query=n.queryKey),a.socket(n.path,t)}Object.assign(r0,{Manager:t0,Socket:XX,io:r0,connect:r0});const i0=async()=>{const e=zr("Login Init...").start();try{console.log(`${tf}/login`);const t=await fetch(`${tf}/login`,{method:"POST"});if(!t.ok)throw new Error("Network response was not ok");const n=await t.json(),{room:r,sessionId:i}=n;e.succeed();const s=zr("Wait User Auth").start();jJ(`https://partner.qumra.cloud/cli/auth?sessionId=${i}`).then((()=>{const e=r0("https://api.qumra.cloud");e.on("connect",(()=>{e.emit("authRoom",r)})),e.on("login",(({data:t,token:n})=>{rf("user",t),rf("token",n),s.succeed("success"),e.disconnect()}))})).catch((e=>console.error("Failed to open URL:",e)))}catch(t){e.stop(),console.error("Failed to fetch data:",t)}};new ke("user").command("login").description("Run development server with Webpack and BrowserSync").action(i0);df.parseFont("Standard","flf2a$ 6 5 16 15 13 0 24463 229\nStandard by Glenn Chappell & Ian Chai 3/93 -- based on Frank's .sig\nIncludes ISO Latin-1\nfiglet release 2.1 -- 12 Aug 1994\nModified for figlet 2.2 by John Cowan <cowan@ccil.org>\n to add Latin-{2,3,4,5} support (Unicode U+0100-017F).\nPermission is hereby given to modify this font, as long as the\nmodifier's name is placed on a comment line.\n\nModified by Paul Burton <solution@earthlink.net> 12/96 to include new parameter\nsupported by FIGlet and FIGWin. May also be slightly modified for better use\nof new full-width/kern/smush alternatives, but default output is NOT changed.\n\nFont modified May 20, 2012 by patorjk to add the 0xCA0 character\n $@\n $@\n $@\n $@\n $@\n $@@\n _ @\n | |@\n | |@\n |_|@\n (_)@\n @@\n _ _ @\n ( | )@\n V V @\n $ @\n $ @\n @@\n _ _ @\n _| || |_ @\n |_ .. _|@\n |_ _|@\n |_||_| @\n @@\n _ @\n | | @\n / __)@\n \\__ \\@\n ( /@\n |_| @@\n _ __@\n (_)/ /@\n / / @\n / /_ @\n /_/(_)@\n @@\n ___ @\n ( _ ) @\n / _ \\/\\@\n | (_> <@\n \\___/\\/@\n @@\n _ @\n ( )@\n |/ @\n $ @\n $ @\n @@\n __@\n / /@\n | | @\n | | @\n | | @\n \\_\\@@\n __ @\n \\ \\ @\n | |@\n | |@\n | |@\n /_/ @@\n @\n __/\\__@\n \\ /@\n /_ _\\@\n \\/ @\n @@\n @\n _ @\n _| |_ @\n |_ _|@\n |_| @\n @@\n @\n @\n @\n _ @\n ( )@\n |/ @@\n @\n @\n _____ @\n |_____|@\n $ @\n @@\n @\n @\n @\n _ @\n (_)@\n @@\n __@\n / /@\n / / @\n / / @\n /_/ @\n @@\n ___ @\n / _ \\ @\n | | | |@\n | |_| |@\n \\___/ @\n @@\n _ @\n / |@\n | |@\n | |@\n |_|@\n @@\n ____ @\n |___ \\ @\n __) |@\n / __/ @\n |_____|@\n @@\n _____ @\n |___ / @\n |_ \\ @\n ___) |@\n |____/ @\n @@\n _ _ @\n | || | @\n | || |_ @\n |__ _|@\n |_| @\n @@\n ____ @\n | ___| @\n |___ \\ @\n ___) |@\n |____/ @\n @@\n __ @\n / /_ @\n | '_ \\ @\n | (_) |@\n \\___/ @\n @@\n _____ @\n |___ |@\n / / @\n / / @\n /_/ @\n @@\n ___ @\n ( _ ) @\n / _ \\ @\n | (_) |@\n \\___/ @\n @@\n ___ @\n / _ \\ @\n | (_) |@\n \\__, |@\n /_/ @\n @@\n @\n _ @\n (_)@\n _ @\n (_)@\n @@\n @\n _ @\n (_)@\n _ @\n ( )@\n |/ @@\n __@\n / /@\n / / @\n \\ \\ @\n \\_\\@\n @@\n @\n _____ @\n |_____|@\n |_____|@\n $ @\n @@\n __ @\n \\ \\ @\n \\ \\@\n / /@\n /_/ @\n @@\n ___ @\n |__ \\@\n / /@\n |_| @\n (_) @\n @@\n ____ @\n / __ \\ @\n / / _` |@\n | | (_| |@\n \\ \\__,_|@\n \\____/ @@\n _ @\n / \\ @\n / _ \\ @\n / ___ \\ @\n /_/ \\_\\@\n @@\n ____ @\n | __ ) @\n | _ \\ @\n | |_) |@\n |____/ @\n @@\n ____ @\n / ___|@\n | | @\n | |___ @\n \\____|@\n @@\n ____ @\n | _ \\ @\n | | | |@\n | |_| |@\n |____/ @\n @@\n _____ @\n | ____|@\n | _| @\n | |___ @\n |_____|@\n @@\n _____ @\n | ___|@\n | |_ @\n | _| @\n |_| @\n @@\n ____ @\n / ___|@\n | | _ @\n | |_| |@\n \\____|@\n @@\n _ _ @\n | | | |@\n | |_| |@\n | _ |@\n |_| |_|@\n @@\n ___ @\n |_ _|@\n | | @\n | | @\n |___|@\n @@\n _ @\n | |@\n _ | |@\n | |_| |@\n \\___/ @\n @@\n _ __@\n | |/ /@\n | ' / @\n | . \\ @\n |_|\\_\\@\n @@\n _ @\n | | @\n | | @\n | |___ @\n |_____|@\n @@\n __ __ @\n | \\/ |@\n | |\\/| |@\n | | | |@\n |_| |_|@\n @@\n _ _ @\n | \\ | |@\n | \\| |@\n | |\\ |@\n |_| \\_|@\n @@\n ___ @\n / _ \\ @\n | | | |@\n | |_| |@\n \\___/ @\n @@\n ____ @\n | _ \\ @\n | |_) |@\n | __/ @\n |_| @\n @@\n ___ @\n / _ \\ @\n | | | |@\n | |_| |@\n \\__\\_\\@\n @@\n ____ @\n | _ \\ @\n | |_) |@\n | _ < @\n |_| \\_\\@\n @@\n ____ @\n / ___| @\n \\___ \\ @\n ___) |@\n |____/ @\n @@\n _____ @\n |_ _|@\n | | @\n | | @\n |_| @\n @@\n _ _ @\n | | | |@\n | | | |@\n | |_| |@\n \\___/ @\n @@\n __ __@\n \\ \\ / /@\n \\ \\ / / @\n \\ V / @\n \\_/ @\n @@\n __ __@\n \\ \\ / /@\n \\ \\ /\\ / / @\n \\ V V / @\n \\_/\\_/ @\n @@\n __ __@\n \\ \\/ /@\n \\ / @\n / \\ @\n /_/\\_\\@\n @@\n __ __@\n \\ \\ / /@\n \\ V / @\n | | @\n |_| @\n @@\n _____@\n |__ /@\n / / @\n / /_ @\n /____|@\n @@\n __ @\n | _|@\n | | @\n | | @\n | | @\n |__|@@\n __ @\n \\ \\ @\n \\ \\ @\n \\ \\ @\n \\_\\@\n @@\n __ @\n |_ |@\n | |@\n | |@\n | |@\n |__|@@\n /\\ @\n |/\\|@\n $ @\n $ @\n $ @\n @@\n @\n @\n @\n @\n _____ @\n |_____|@@\n _ @\n ( )@\n \\|@\n $ @\n $ @\n @@\n @\n __ _ @\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n _ @\n | |__ @\n | '_ \\ @\n | |_) |@\n |_.__/ @\n @@\n @\n ___ @\n / __|@\n | (__ @\n \\___|@\n @@\n _ @\n __| |@\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n @\n ___ @\n / _ \\@\n | __/@\n \\___|@\n @@\n __ @\n / _|@\n | |_ @\n | _|@\n |_| @\n @@\n @\n __ _ @\n / _` |@\n | (_| |@\n \\__, |@\n |___/ @@\n _ @\n | |__ @\n | '_ \\ @\n | | | |@\n |_| |_|@\n @@\n _ @\n (_)@\n | |@\n | |@\n |_|@\n @@\n _ @\n (_)@\n | |@\n | |@\n _/ |@\n |__/ @@\n _ @\n | | __@\n | |/ /@\n | < @\n |_|\\_\\@\n @@\n _ @\n | |@\n | |@\n | |@\n |_|@\n @@\n @\n _ __ ___ @\n | '_ ` _ \\ @\n | | | | | |@\n |_| |_| |_|@\n @@\n @\n _ __ @\n | '_ \\ @\n | | | |@\n |_| |_|@\n @@\n @\n ___ @\n / _ \\ @\n | (_) |@\n \\___/ @\n @@\n @\n _ __ @\n | '_ \\ @\n | |_) |@\n | .__/ @\n |_| @@\n @\n __ _ @\n / _` |@\n | (_| |@\n \\__, |@\n |_|@@\n @\n _ __ @\n | '__|@\n | | @\n |_| @\n @@\n @\n ___ @\n / __|@\n \\__ \\@\n |___/@\n @@\n _ @\n | |_ @\n | __|@\n | |_ @\n \\__|@\n @@\n @\n _ _ @\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n @\n __ __@\n \\ \\ / /@\n \\ V / @\n \\_/ @\n @@\n @\n __ __@\n \\ \\ /\\ / /@\n \\ V V / @\n \\_/\\_/ @\n @@\n @\n __ __@\n \\ \\/ /@\n > < @\n /_/\\_\\@\n @@\n @\n _ _ @\n | | | |@\n | |_| |@\n \\__, |@\n |___/ @@\n @\n ____@\n |_ /@\n / / @\n /___|@\n @@\n __@\n / /@\n | | @\n < < @\n | | @\n \\_\\@@\n _ @\n | |@\n | |@\n | |@\n | |@\n |_|@@\n __ @\n \\ \\ @\n | | @\n > >@\n | | @\n /_/ @@\n /\\/|@\n |/\\/ @\n $ @\n $ @\n $ @\n @@\n _ _ @\n (_)_(_)@\n /_\\ @\n / _ \\ @\n /_/ \\_\\@\n @@\n _ _ @\n (_)_(_)@\n / _ \\ @\n | |_| |@\n \\___/ @\n @@\n _ _ @\n (_) (_)@\n | | | |@\n | |_| |@\n \\___/ @\n @@\n _ _ @\n (_)_(_)@\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n _ _ @\n (_)_(_)@\n / _ \\ @\n | (_) |@\n \\___/ @\n @@\n _ _ @\n (_) (_)@\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n ___ @\n / _ \\@\n | |/ /@\n | |\\ \\@\n | ||_/@\n |_| @@\n160 NO-BREAK SPACE\n $@\n $@\n $@\n $@\n $@\n $@@\n161 INVERTED EXCLAMATION MARK\n _ @\n (_)@\n | |@\n | |@\n |_|@\n @@\n162 CENT SIGN\n _ @\n | | @\n / __)@\n | (__ @\n \\ )@\n |_| @@\n163 POUND SIGN\n ___ @\n / ,_\\ @\n _| |_ @\n | |___ @\n (_,____|@\n @@\n164 CURRENCY SIGN\n /\\___/\\@\n \\ _ /@\n | (_) |@\n / ___ \\@\n \\/ \\/@\n @@\n165 YEN SIGN\n __ __ @\n \\ V / @\n |__ __|@\n |__ __|@\n |_| @\n @@\n166 BROKEN BAR\n _ @\n | |@\n |_|@\n _ @\n | |@\n |_|@@\n167 SECTION SIGN\n __ @\n _/ _)@\n / \\ \\ @\n \\ \\\\ \\@\n \\ \\_/@\n (__/ @@\n168 DIAERESIS\n _ _ @\n (_) (_)@\n $ $ @\n $ $ @\n $ $ @\n @@\n169 COPYRIGHT SIGN\n _____ @\n / ___ \\ @\n / / __| \\ @\n | | (__ |@\n \\ \\___| / @\n \\_____/ @@\n170 FEMININE ORDINAL INDICATOR\n __ _ @\n / _` |@\n \\__,_|@\n |____|@\n $ @\n @@\n171 LEFT-POINTING DOUBLE ANGLE QUOTATION MARK\n ____@\n / / /@\n / / / @\n \\ \\ \\ @\n \\_\\_\\@\n @@\n172 NOT SIGN\n @\n _____ @\n |___ |@\n |_|@\n $ @\n @@\n173 SOFT HYPHEN\n @\n @\n ____ @\n |____|@\n $ @\n @@\n174 REGISTERED SIGN\n _____ @\n / ___ \\ @\n / | _ \\ \\ @\n | | / |@\n \\ |_|_\\ / @\n \\_____/ @@\n175 MACRON\n _____ @\n |_____|@\n $ @\n $ @\n $ @\n @@\n176 DEGREE SIGN\n __ @\n / \\ @\n | () |@\n \\__/ @\n $ @\n @@\n177 PLUS-MINUS SIGN\n _ @\n _| |_ @\n |_ _|@\n _|_|_ @\n |_____|@\n @@\n178 SUPERSCRIPT TWO\n ___ @\n |_ )@\n / / @\n /___|@\n $ @\n @@\n179 SUPERSCRIPT THREE\n ____@\n |__ /@\n |_ \\@\n |___/@\n $ @\n @@\n180 ACUTE ACCENT\n __@\n /_/@\n $ @\n $ @\n $ @\n @@\n181 MICRO SIGN\n @\n _ _ @\n | | | |@\n | |_| |@\n | ._,_|@\n |_| @@\n182 PILCROW SIGN\n _____ @\n / |@\n | (| | |@\n \\__ | |@\n |_|_|@\n @@\n183 MIDDLE DOT\n @\n _ @\n (_)@\n $ @\n $ @\n @@\n184 CEDILLA\n @\n @\n @\n @\n _ @\n )_)@@\n185 SUPERSCRIPT ONE\n _ @\n / |@\n | |@\n |_|@\n $ @\n @@\n186 MASCULINE ORDINAL INDICATOR\n ___ @\n / _ \\@\n \\___/@\n |___|@\n $ @\n @@\n187 RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK\n ____ @\n \\ \\ \\ @\n \\ \\ \\@\n / / /@\n /_/_/ @\n @@\n188 VULGAR FRACTION ONE QUARTER\n _ __ @\n / | / / _ @\n | |/ / | | @\n |_/ /|_ _|@\n /_/ |_| @\n @@\n189 VULGAR FRACTION ONE HALF\n _ __ @\n / | / /__ @\n | |/ /_ )@\n |_/ / / / @\n /_/ /___|@\n @@\n190 VULGAR FRACTION THREE QUARTERS\n ____ __ @\n |__ / / / _ @\n |_ \\/ / | | @\n |___/ /|_ _|@\n /_/ |_| @\n @@\n191 INVERTED QUESTION MARK\n _ @\n (_) @\n | | @\n / /_ @\n \\___|@\n @@\n192 LATIN CAPITAL LETTER A WITH GRAVE\n __ @\n \\_\\ @\n /_\\ @\n / _ \\ @\n /_/ \\_\\@\n @@\n193 LATIN CAPITAL LETTER A WITH ACUTE\n __ @\n /_/ @\n /_\\ @\n / _ \\ @\n /_/ \\_\\@\n @@\n194 LATIN CAPITAL LETTER A WITH CIRCUMFLEX\n //\\ @\n |/_\\| @\n /_\\ @\n / _ \\ @\n /_/ \\_\\@\n @@\n195 LATIN CAPITAL LETTER A WITH TILDE\n /\\/| @\n |/\\/ @\n /_\\ @\n / _ \\ @\n /_/ \\_\\@\n @@\n196 LATIN CAPITAL LETTER A WITH DIAERESIS\n _ _ @\n (_)_(_)@\n /_\\ @\n / _ \\ @\n /_/ \\_\\@\n @@\n197 LATIN CAPITAL LETTER A WITH RING ABOVE\n _ @\n (o) @\n /_\\ @\n / _ \\ @\n /_/ \\_\\@\n @@\n198 LATIN CAPITAL LETTER AE\n ______ @\n / ____|@\n / _ _| @\n / __ |___ @\n /_/ |_____|@\n @@\n199 LATIN CAPITAL LETTER C WITH CEDILLA\n ____ @\n / ___|@\n | | @\n | |___ @\n \\____|@\n )_) @@\n200 LATIN CAPITAL LETTER E WITH GRAVE\n __ @\n _\\_\\_ @\n | ____|@\n | _|_ @\n |_____|@\n @@\n201 LATIN CAPITAL LETTER E WITH ACUTE\n __ @\n _/_/_ @\n | ____|@\n | _|_ @\n |_____|@\n @@\n202 LATIN CAPITAL LETTER E WITH CIRCUMFLEX\n //\\ @\n |/_\\| @\n | ____|@\n | _|_ @\n |_____|@\n @@\n203 LATIN CAPITAL LETTER E WITH DIAERESIS\n _ _ @\n (_)_(_)@\n | ____|@\n | _|_ @\n |_____|@\n @@\n204 LATIN CAPITAL LETTER I WITH GRAVE\n __ @\n \\_\\ @\n |_ _|@\n | | @\n |___|@\n @@\n205 LATIN CAPITAL LETTER I WITH ACUTE\n __ @\n /_/ @\n |_ _|@\n | | @\n |___|@\n @@\n206 LATIN CAPITAL LETTER I WITH CIRCUMFLEX\n //\\ @\n |/_\\|@\n |_ _|@\n | | @\n |___|@\n @@\n207 LATIN CAPITAL LETTER I WITH DIAERESIS\n _ _ @\n (_)_(_)@\n |_ _| @\n | | @\n |___| @\n @@\n208 LATIN CAPITAL LETTER ETH\n ____ @\n | _ \\ @\n _| |_| |@\n |__ __| |@\n |____/ @\n @@\n209 LATIN CAPITAL LETTER N WITH TILDE\n /\\/|@\n |/\\/ @\n | \\| |@\n | .` |@\n |_|\\_|@\n @@\n210 LATIN CAPITAL LETTER O WITH GRAVE\n __ @\n \\_\\ @\n / _ \\ @\n | |_| |@\n \\___/ @\n @@\n211 LATIN CAPITAL LETTER O WITH ACUTE\n __ @\n /_/ @\n / _ \\ @\n | |_| |@\n \\___/ @\n @@\n212 LATIN CAPITAL LETTER O WITH CIRCUMFLEX\n //\\ @\n |/_\\| @\n / _ \\ @\n | |_| |@\n \\___/ @\n @@\n213 LATIN CAPITAL LETTER O WITH TILDE\n /\\/| @\n |/\\/ @\n / _ \\ @\n | |_| |@\n \\___/ @\n @@\n214 LATIN CAPITAL LETTER O WITH DIAERESIS\n _ _ @\n (_)_(_)@\n / _ \\ @\n | |_| |@\n \\___/ @\n @@\n215 MULTIPLICATION SIGN\n @\n @\n /\\/\\@\n > <@\n \\/\\/@\n @@\n216 LATIN CAPITAL LETTER O WITH STROKE\n ____ @\n / _// @\n | |// |@\n | //| |@\n //__/ @\n @@\n217 LATIN CAPITAL LETTER U WITH GRAVE\n __ @\n _\\_\\_ @\n | | | |@\n | |_| |@\n \\___/ @\n @@\n218 LATIN CAPITAL LETTER U WITH ACUTE\n __ @\n _/_/_ @\n | | | |@\n | |_| |@\n \\___/ @\n @@\n219 LATIN CAPITAL LETTER U WITH CIRCUMFLEX\n //\\ @\n |/ \\| @\n | | | |@\n | |_| |@\n \\___/ @\n @@\n220 LATIN CAPITAL LETTER U WITH DIAERESIS\n _ _ @\n (_) (_)@\n | | | |@\n | |_| |@\n \\___/ @\n @@\n221 LATIN CAPITAL LETTER Y WITH ACUTE\n __ @\n __/_/__@\n \\ \\ / /@\n \\ V / @\n |_| @\n @@\n222 LATIN CAPITAL LETTER THORN\n _ @\n | |___ @\n | __ \\@\n | ___/@\n |_| @\n @@\n223 LATIN SMALL LETTER SHARP S\n ___ @\n / _ \\@\n | |/ /@\n | |\\ \\@\n | ||_/@\n |_| @@\n224 LATIN SMALL LETTER A WITH GRAVE\n __ @\n \\_\\_ @\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n225 LATIN SMALL LETTER A WITH ACUTE\n __ @\n /_/_ @\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n226 LATIN SMALL LETTER A WITH CIRCUMFLEX\n //\\ @\n |/_\\| @\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n227 LATIN SMALL LETTER A WITH TILDE\n /\\/| @\n |/\\/_ @\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n228 LATIN SMALL LETTER A WITH DIAERESIS\n _ _ @\n (_)_(_)@\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n229 LATIN SMALL LETTER A WITH RING ABOVE\n __ @\n (()) @\n / _ '|@\n | (_| |@\n \\__,_|@\n @@\n230 LATIN SMALL LETTER AE\n @\n __ ____ @\n / _` _ \\@\n | (_| __/@\n \\__,____|@\n @@\n231 LATIN SMALL LETTER C WITH CEDILLA\n @\n ___ @\n / __|@\n | (__ @\n \\___|@\n )_) @@\n232 LATIN SMALL LETTER E WITH GRAVE\n __ @\n \\_\\ @\n / _ \\@\n | __/@\n \\___|@\n @@\n233 LATIN SMALL LETTER E WITH ACUTE\n __ @\n /_/ @\n / _ \\@\n | __/@\n \\___|@\n @@\n234 LATIN SMALL LETTER E WITH CIRCUMFLEX\n //\\ @\n |/_\\|@\n / _ \\@\n | __/@\n \\___|@\n @@\n235 LATIN SMALL LETTER E WITH DIAERESIS\n _ _ @\n (_)_(_)@\n / _ \\ @\n | __/ @\n \\___| @\n @@\n236 LATIN SMALL LETTER I WITH GRAVE\n __ @\n \\_\\@\n | |@\n | |@\n |_|@\n @@\n237 LATIN SMALL LETTER I WITH ACUTE\n __@\n /_/@\n | |@\n | |@\n |_|@\n @@\n238 LATIN SMALL LETTER I WITH CIRCUMFLEX\n //\\ @\n |/_\\|@\n | | @\n | | @\n |_| @\n @@\n239 LATIN SMALL LETTER I WITH DIAERESIS\n _ _ @\n (_)_(_)@\n | | @\n | | @\n |_| @\n @@\n240 LATIN SMALL LETTER ETH\n /\\/\\ @\n > < @\n _\\/\\ |@\n / __` |@\n \\____/ @\n @@\n241 LATIN SMALL LETTER N WITH TILDE\n /\\/| @\n |/\\/ @\n | '_ \\ @\n | | | |@\n |_| |_|@\n @@\n242 LATIN SMALL LETTER O WITH GRAVE\n __ @\n \\_\\ @\n / _ \\ @\n | (_) |@\n \\___/ @\n @@\n243 LATIN SMALL LETTER O WITH ACUTE\n __ @\n /_/ @\n / _ \\ @\n | (_) |@\n \\___/ @\n @@\n244 LATIN SMALL LETTER O WITH CIRCUMFLEX\n //\\ @\n |/_\\| @\n / _ \\ @\n | (_) |@\n \\___/ @\n @@\n245 LATIN SMALL LETTER O WITH TILDE\n /\\/| @\n |/\\/ @\n / _ \\ @\n | (_) |@\n \\___/ @\n @@\n246 LATIN SMALL LETTER O WITH DIAERESIS\n _ _ @\n (_)_(_)@\n / _ \\ @\n | (_) |@\n \\___/ @\n @@\n247 DIVISION SIGN\n @\n _ @\n _(_)_ @\n |_____|@\n (_) @\n @@\n248 LATIN SMALL LETTER O WITH STROKE\n @\n ____ @\n / _//\\ @\n | (//) |@\n \\//__/ @\n @@\n249 LATIN SMALL LETTER U WITH GRAVE\n __ @\n _\\_\\_ @\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n250 LATIN SMALL LETTER U WITH ACUTE\n __ @\n _/_/_ @\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n251 LATIN SMALL LETTER U WITH CIRCUMFLEX\n //\\ @\n |/ \\| @\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n252 LATIN SMALL LETTER U WITH DIAERESIS\n _ _ @\n (_) (_)@\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n253 LATIN SMALL LETTER Y WITH ACUTE\n __ @\n _/_/_ @\n | | | |@\n | |_| |@\n \\__, |@\n |___/ @@\n254 LATIN SMALL LETTER THORN\n _ @\n | |__ @\n | '_ \\ @\n | |_) |@\n | .__/ @\n |_| @@\n255 LATIN SMALL LETTER Y WITH DIAERESIS\n _ _ @\n (_) (_)@\n | | | |@\n | |_| |@\n \\__, |@\n |___/ @@\n0x0100 LATIN CAPITAL LETTER A WITH MACRON\n ____ @\n /___/ @\n /_\\ @\n / _ \\ @\n /_/ \\_\\@\n @@\n0x0101 LATIN SMALL LETTER A WITH MACRON\n ___ @\n /_ _/@\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n0x0102 LATIN CAPITAL LETTER A WITH BREVE\n _ _ @\n \\\\_// @\n /_\\ @\n / _ \\ @\n /_/ \\_\\@\n @@\n0x0103 LATIN SMALL LETTER A WITH BREVE\n \\_/ @\n ___ @\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n0x0104 LATIN CAPITAL LETTER A WITH OGONEK\n @\n _ @\n /_\\ @\n / _ \\ @\n /_/ \\_\\@\n (_(@@\n0x0105 LATIN SMALL LETTER A WITH OGONEK\n @\n __ _ @\n / _` |@\n | (_| |@\n \\__,_|@\n (_(@@\n0x0106 LATIN CAPITAL LETTER C WITH ACUTE\n __ @\n _/_/ @\n / ___|@\n | |___ @\n \\____|@\n @@\n0x0107 LATIN SMALL LETTER C WITH ACUTE\n __ @\n /__/@\n / __|@\n | (__ @\n \\___|@\n @@\n0x0108 LATIN CAPITAL LETTER C WITH CIRCUMFLEX\n /\\ @\n _//\\\\@\n / ___|@\n | |___ @\n \\____|@\n @@\n0x0109 LATIN SMALL LETTER C WITH CIRCUMFLEX\n /\\ @\n /_\\ @\n / __|@\n | (__ @\n \\___|@\n @@\n0x010A LATIN CAPITAL LETTER C WITH DOT ABOVE\n [] @\n ____ @\n / ___|@\n | |___ @\n \\____|@\n @@\n0x010B LATIN SMALL LETTER C WITH DOT ABOVE\n [] @\n ___ @\n / __|@\n | (__ @\n \\___|@\n @@\n0x010C LATIN CAPITAL LETTER C WITH CARON\n \\\\// @\n _\\/_ @\n / ___|@\n | |___ @\n \\____|@\n @@\n0x010D LATIN SMALL LETTER C WITH CARON\n \\\\//@\n _\\/ @\n / __|@\n | (__ @\n \\___|@\n @@\n0x010E LATIN CAPITAL LETTER D WITH CARON\n \\\\// @\n __\\/ @\n | _ \\ @\n | |_| |@\n |____/ @\n @@\n0x010F LATIN SMALL LETTER D WITH CARON\n \\/ _ @\n __| |@\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n0x0110 LATIN CAPITAL LETTER D WITH STROKE\n ____ @\n |_ __ \\ @\n /| |/ | |@\n /|_|/_| |@\n |_____/ @\n @@\n0x0111 LATIN SMALL LETTER D WITH STROKE\n ---|@\n __| |@\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n0x0112 LATIN CAPITAL LETTER E WITH MACRON\n ____ @\n /___/ @\n | ____|@\n | _|_ @\n |_____|@\n @@\n0x0113 LATIN SMALL LETTER E WITH MACRON\n ____@\n /_ _/@\n / _ \\ @\n | __/ @\n \\___| @\n @@\n0x0114 LATIN CAPITAL LETTER E WITH BREVE\n _ _ @\n \\\\_// @\n | ____|@\n | _|_ @\n |_____|@\n @@\n0x0115 LATIN SMALL LETTER E WITH BREVE\n \\\\ //@\n -- @\n / _ \\ @\n | __/ @\n \\___| @\n @@\n0x0116 LATIN CAPITAL LETTER E WITH DOT ABOVE\n [] @\n _____ @\n | ____|@\n | _|_ @\n |_____|@\n @@\n0x0117 LATIN SMALL LETTER E WITH DOT ABOVE\n [] @\n __ @\n / _ \\@\n | __/@\n \\___|@\n @@\n0x0118 LATIN CAPITAL LETTER E WITH OGONEK\n @\n _____ @\n | ____|@\n | _|_ @\n |_____|@\n (__(@@\n0x0119 LATIN SMALL LETTER E WITH OGONEK\n @\n ___ @\n / _ \\@\n | __/@\n \\___|@\n (_(@@\n0x011A LATIN CAPITAL LETTER E WITH CARON\n \\\\// @\n __\\/_ @\n | ____|@\n | _|_ @\n |_____|@\n @@\n0x011B LATIN SMALL LETTER E WITH CARON\n \\\\//@\n \\/ @\n / _ \\@\n | __/@\n \\___|@\n @@\n0x011C LATIN CAPITAL LETTER G WITH CIRCUMFLEX\n _/\\_ @\n / ___|@\n | | _ @\n | |_| |@\n \\____|@\n @@\n0x011D LATIN SMALL LETTER G WITH CIRCUMFLEX\n /\\ @\n _/_ \\@\n / _` |@\n | (_| |@\n \\__, |@\n |___/ @@\n0x011E LATIN CAPITAL LETTER G WITH BREVE\n _\\/_ @\n / ___|@\n | | _ @\n | |_| |@\n \\____|@\n @@\n0x011F LATIN SMALL LETTER G WITH BREVE\n \\___/ @\n __ _ @\n / _` |@\n | (_| |@\n \\__, |@\n |___/ @@\n0x0120 LATIN CAPITAL LETTER G WITH DOT ABOVE\n _[]_ @\n / ___|@\n | | _ @\n | |_| |@\n \\____|@\n @@\n0x0121 LATIN SMALL LETTER G WITH DOT ABOVE\n [] @\n __ _ @\n / _` |@\n | (_| |@\n \\__, |@\n |___/ @@\n0x0122 LATIN CAPITAL LETTER G WITH CEDILLA\n ____ @\n / ___|@\n | | _ @\n | |_| |@\n \\____|@\n )__) @@\n0x0123 LATIN SMALL LETTER G WITH CEDILLA\n @\n __ _ @\n / _` |@\n | (_| |@\n \\__, |@\n |_))))@@\n0x0124 LATIN CAPITAL LETTER H WITH CIRCUMFLEX\n _/ \\_ @\n | / \\ |@\n | |_| |@\n | _ |@\n |_| |_|@\n @@\n0x0125 LATIN SMALL LETTER H WITH CIRCUMFLEX\n _ /\\ @\n | |//\\ @\n | '_ \\ @\n | | | |@\n |_| |_|@\n @@\n0x0126 LATIN CAPITAL LETTER H WITH STROKE\n _ _ @\n | |=| |@\n | |_| |@\n | _ |@\n |_| |_|@\n @@\n0x0127 LATIN SMALL LETTER H WITH STROKE\n _ @\n |=|__ @\n | '_ \\ @\n | | | |@\n |_| |_|@\n @@\n0x0128 LATIN CAPITAL LETTER I WITH TILDE\n /\\//@\n |_ _|@\n | | @\n | | @\n |___|@\n @@\n0x0129 LATIN SMALL LETTER I WITH TILDE\n @\n /\\/@\n | |@\n | |@\n |_|@\n @@\n0x012A LATIN CAPITAL LETTER I WITH MACRON\n /___/@\n |_ _|@\n | | @\n | | @\n |___|@\n @@\n0x012B LATIN SMALL LETTER I WITH MACRON\n ____@\n /___/@\n | | @\n | | @\n |_| @\n @@\n0x012C LATIN CAPITAL LETTER I WITH BREVE\n \\__/@\n |_ _|@\n | | @\n | | @\n |___|@\n @@\n0x012D LATIN SMALL LETTER I WITH BREVE\n @\n \\_/@\n | |@\n | |@\n |_|@\n @@\n0x012E LATIN CAPITAL LETTER I WITH OGONEK\n ___ @\n |_ _|@\n | | @\n | | @\n |___|@\n (__(@@\n0x012F LATIN SMALL LETTER I WITH OGONEK\n _ @\n (_) @\n | | @\n | | @\n |_|_@\n (_(@@\n0x0130 LATIN CAPITAL LETTER I WITH DOT ABOVE\n _[] @\n |_ _|@\n | | @\n | | @\n |___|@\n @@\n0x0131 LATIN SMALL LETTER DOTLESS I\n @\n _ @\n | |@\n | |@\n |_|@\n @@\n0x0132 LATIN CAPITAL LIGATURE IJ\n ___ _ @\n |_ _|| |@\n | | | |@\n | |_| |@\n |__|__/ @\n @@\n0x0133 LATIN SMALL LIGATURE IJ\n _ _ @\n (_) (_)@\n | | | |@\n | | | |@\n |_|_/ |@\n |__/ @@\n0x0134 LATIN CAPITAL LETTER J WITH CIRCUMFLEX\n /\\ @\n /_\\|@\n _ | | @\n | |_| | @\n \\___/ @\n @@\n0x0135 LATIN SMALL LETTER J WITH CIRCUMFLEX\n /\\@\n /_\\@\n | |@\n | |@\n _/ |@\n |__/ @@\n0x0136 LATIN CAPITAL LETTER K WITH CEDILLA\n _ _ @\n | |/ / @\n | ' / @\n | . \\ @\n |_|\\_\\ @\n )__)@@\n0x0137 LATIN SMALL LETTER K WITH CEDILLA\n _ @\n | | __@\n | |/ /@\n | < @\n |_|\\_\\@\n )_)@@\n0x0138 LATIN SMALL LETTER KRA\n @\n _ __ @\n | |/ \\@\n | < @\n |_|\\_\\@\n @@\n0x0139 LATIN CAPITAL LETTER L WITH ACUTE\n _ //@\n | | // @\n | | @\n | |___ @\n |_____|@\n @@\n0x013A LATIN SMALL LETTER L WITH ACUTE\n //@\n | |@\n | |@\n | |@\n |_|@\n @@\n0x013B LATIN CAPITAL LETTER L WITH CEDILLA\n _ @\n | | @\n | | @\n | |___ @\n |_____|@\n )__)@@\n0x013C LATIN SMALL LETTER L WITH CEDILLA\n _ @\n | | @\n | | @\n | | @\n |_| @\n )_)@@\n0x013D LATIN CAPITAL LETTER L WITH CARON\n _ \\\\//@\n | | \\/ @\n | | @\n | |___ @\n |_____|@\n @@\n0x013E LATIN SMALL LETTER L WITH CARON\n _ \\\\//@\n | | \\/ @\n | | @\n | | @\n |_| @\n @@\n0x013F LATIN CAPITAL LETTER L WITH MIDDLE DOT\n _ @\n | | @\n | | [] @\n | |___ @\n |_____|@\n @@\n0x0140 LATIN SMALL LETTER L WITH MIDDLE DOT\n _ @\n | | @\n | | []@\n | | @\n |_| @\n @@\n0x0141 LATIN CAPITAL LETTER L WITH STROKE\n __ @\n | // @\n |//| @\n // |__ @\n |_____|@\n @@\n0x0142 LATIN SMALL LETTER L WITH STROKE\n _ @\n | |@\n |//@\n //|@\n |_|@\n @@\n0x0143 LATIN CAPITAL LETTER N WITH ACUTE\n _/ /_ @\n | \\ | |@\n | \\| |@\n | |\\ |@\n |_| \\_|@\n @@\n0x0144 LATIN SMALL LETTER N WITH ACUTE\n _ @\n _ /_/ @\n | '_ \\ @\n | | | |@\n |_| |_|@\n @@\n0x0145 LATIN CAPITAL LETTER N WITH CEDILLA\n _ _ @\n | \\ | |@\n | \\| |@\n | |\\ |@\n |_| \\_|@\n )_) @@\n0x0146 LATIN SMALL LETTER N WITH CEDILLA\n @\n _ __ @\n | '_ \\ @\n | | | |@\n |_| |_|@\n )_) @@\n0x0147 LATIN CAPITAL LETTER N WITH CARON\n _\\/ _ @\n | \\ | |@\n | \\| |@\n | |\\ |@\n |_| \\_|@\n @@\n0x0148 LATIN SMALL LETTER N WITH CARON\n \\\\// @\n _\\/_ @\n | '_ \\ @\n | | | |@\n |_| |_|@\n @@\n0x0149 LATIN SMALL LETTER N PRECEDED BY APOSTROPHE\n @\n _ __ @\n ( )| '_\\ @\n |/| | | |@\n |_| |_|@\n @@\n0x014A LATIN CAPITAL LETTER ENG\n _ _ @\n | \\ | |@\n | \\| |@\n | |\\ |@\n |_| \\ |@\n )_)@@\n0x014B LATIN SMALL LETTER ENG\n _ __ @\n | '_ \\ @\n | | | |@\n |_| | |@\n | |@\n |__ @@\n0x014C LATIN CAPITAL LETTER O WITH MACRON\n ____ @\n /_ _/ @\n / _ \\ @\n | (_) |@\n \\___/ @\n @@\n0x014D LATIN SMALL LETTER O WITH MACRON\n ____ @\n /_ _/ @\n / _ \\ @\n | (_) |@\n \\___/ @\n @@\n0x014E LATIN CAPITAL LETTER O WITH BREVE\n \\ / @\n _-_ @\n / _ \\ @\n | |_| |@\n \\___/ @\n @@\n0x014F LATIN SMALL LETTER O WITH BREVE\n \\ / @\n _-_ @\n / _ \\ @\n | |_| |@\n \\___/ @\n @@\n0x0150 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE\n ___ @\n /_/_/@\n / _ \\ @\n | |_| |@\n \\___/ @\n @@\n0x0151 LATIN SMALL LETTER O WITH DOUBLE ACUTE\n ___ @\n /_/_/@\n / _ \\ @\n | |_| |@\n \\___/ @\n @@\n0x0152 LATIN CAPITAL LIGATURE OE\n ___ ___ @\n / _ \\| __|@\n | | | | | @\n | |_| | |__@\n \\___/|____@\n @@\n0x0153 LATIN SMALL LIGATURE OE\n @\n ___ ___ @\n / _ \\ / _ \\@\n | (_) | __/@\n \\___/ \\___|@\n @@\n0x0154 LATIN CAPITAL LETTER R WITH ACUTE\n _/_/ @\n | _ \\ @\n | |_) |@\n | _ < @\n |_| \\_\\@\n @@\n0x0155 LATIN SMALL LETTER R WITH ACUTE\n __@\n _ /_/@\n | '__|@\n | | @\n |_| @\n @@\n0x0156 LATIN CAPITAL LETTER R WITH CEDILLA\n ____ @\n | _ \\ @\n | |_) |@\n | _ < @\n |_| \\_\\@\n )_) @@\n0x0157 LATIN SMALL LETTER R WITH CEDILLA\n @\n _ __ @\n | '__|@\n | | @\n |_| @\n )_) @@\n0x0158 LATIN CAPITAL LETTER R WITH CARON\n _\\_/ @\n | _ \\ @\n | |_) |@\n | _ < @\n |_| \\_\\@\n @@\n0x0159 LATIN SMALL LETTER R WITH CARON\n \\\\// @\n _\\/_ @\n | '__|@\n | | @\n |_| @\n @@\n0x015A LATIN CAPITAL LETTER S WITH ACUTE\n _/_/ @\n / ___| @\n \\___ \\ @\n ___) |@\n |____/ @\n @@\n0x015B LATIN SMALL LETTER S WITH ACUTE\n __@\n _/_/@\n / __|@\n \\__ \\@\n |___/@\n @@\n0x015C LATIN CAPITAL LETTER S WITH CIRCUMFLEX\n _/\\_ @\n / ___| @\n \\___ \\ @\n ___) |@\n |____/ @\n @@\n0x015D LATIN SMALL LETTER S WITH CIRCUMFLEX\n @\n /_\\_@\n / __|@\n \\__ \\@\n |___/@\n @@\n0x015E LATIN CAPITAL LETTER S WITH CEDILLA\n ____ @\n / ___| @\n \\___ \\ @\n ___) |@\n |____/ @\n )__)@@\n0x015F LATIN SMALL LETTER S WITH CEDILLA\n @\n ___ @\n / __|@\n \\__ \\@\n |___/@\n )_)@@\n0x0160 LATIN CAPITAL LETTER S WITH CARON\n _\\_/ @\n / ___| @\n \\___ \\ @\n ___) |@\n |____/ @\n @@\n0x0161 LATIN SMALL LETTER S WITH CARON\n \\\\//@\n _\\/ @\n / __|@\n \\__ \\@\n |___/@\n @@\n0x0162 LATIN CAPITAL LETTER T WITH CEDILLA\n _____ @\n |_ _|@\n | | @\n | | @\n |_| @\n )__)@@\n0x0163 LATIN SMALL LETTER T WITH CEDILLA\n _ @\n | |_ @\n | __|@\n | |_ @\n \\__|@\n )_)@@\n0x0164 LATIN CAPITAL LETTER T WITH CARON\n _____ @\n |_ _|@\n | | @\n | | @\n |_| @\n @@\n0x0165 LATIN SMALL LETTER T WITH CARON\n \\/ @\n | |_ @\n | __|@\n | |_ @\n \\__|@\n @@\n0x0166 LATIN CAPITAL LETTER T WITH STROKE\n _____ @\n |_ _|@\n | | @\n -|-|- @\n |_| @\n @@\n0x0167 LATIN SMALL LETTER T WITH STROKE\n _ @\n | |_ @\n | __|@\n |-|_ @\n \\__|@\n @@\n0x0168 LATIN CAPITAL LETTER U WITH TILDE\n @\n _/\\/_ @\n | | | |@\n | |_| |@\n \\___/ @\n @@\n0x0169 LATIN SMALL LETTER U WITH TILDE\n @\n _/\\/_ @\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n0x016A LATIN CAPITAL LETTER U WITH MACRON\n ____ @\n /__ _/@\n | | | |@\n | |_| |@\n \\___/ @\n @@\n0x016B LATIN SMALL LETTER U WITH MACRON\n ____ @\n / _ /@\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n0x016C LATIN CAPITAL LETTER U WITH BREVE\n @\n \\_/_ @\n | | | |@\n | |_| |@\n \\____|@\n @@\n0x016D LATIN SMALL LETTER U WITH BREVE\n @\n \\_/_ @\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n0x016E LATIN CAPITAL LETTER U WITH RING ABOVE\n O @\n __ _ @\n | | | |@\n | |_| |@\n \\___/ @\n @@\n0x016F LATIN SMALL LETTER U WITH RING ABOVE\n O @\n __ __ @\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n0x0170 LATIN CAPITAL LETTER U WITH DOUBLE ACUTE\n -- --@\n /_//_/@\n | | | |@\n | |_| |@\n \\___/ @\n @@\n0x0171 LATIN SMALL LETTER U WITH DOUBLE ACUTE\n ____@\n _/_/_/@\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n0x0172 LATIN CAPITAL LETTER U WITH OGONEK\n _ _ @\n | | | |@\n | | | |@\n | |_| |@\n \\___/ @\n (__(@@\n0x0173 LATIN SMALL LETTER U WITH OGONEK\n @\n _ _ @\n | | | |@\n | |_| |@\n \\__,_|@\n (_(@@\n0x0174 LATIN CAPITAL LETTER W WITH CIRCUMFLEX\n __ /\\ __@\n \\ \\ //\\\\/ /@\n \\ \\ /\\ / / @\n \\ V V / @\n \\_/\\_/ @\n @@\n0x0175 LATIN SMALL LETTER W WITH CIRCUMFLEX\n /\\ @\n __ //\\\\__@\n \\ \\ /\\ / /@\n \\ V V / @\n \\_/\\_/ @\n @@\n0x0176 LATIN CAPITAL LETTER Y WITH CIRCUMFLEX\n /\\ @\n __//\\\\ @\n \\ \\ / /@\n \\ V / @\n |_| @\n @@\n0x0177 LATIN SMALL LETTER Y WITH CIRCUMFLEX\n /\\ @\n //\\\\ @\n | | | |@\n | |_| |@\n \\__, |@\n |___/ @@\n0x0178 LATIN CAPITAL LETTER Y WITH DIAERESIS\n [] []@\n __ _@\n \\ \\ / /@\n \\ V / @\n |_| @\n @@\n0x0179 LATIN CAPITAL LETTER Z WITH ACUTE\n __/_/@\n |__ /@\n / / @\n / /_ @\n /____|@\n @@\n0x017A LATIN SMALL LETTER Z WITH ACUTE\n _ @\n _/_/@\n |_ /@\n / / @\n /___|@\n @@\n0x017B LATIN CAPITAL LETTER Z WITH DOT ABOVE\n __[]_@\n |__ /@\n / / @\n / /_ @\n /____|@\n @@\n0x017C LATIN SMALL LETTER Z WITH DOT ABOVE\n [] @\n ____@\n |_ /@\n / / @\n /___|@\n @@\n0x017D LATIN CAPITAL LETTER Z WITH CARON\n _\\_/_@\n |__ /@\n / / @\n / /_ @\n /____|@\n @@\n0x017E LATIN SMALL LETTER Z WITH CARON\n \\\\//@\n _\\/_@\n |_ /@\n / / @\n /___|@\n @@\n0x017F LATIN SMALL LETTER LONG S\n __ @\n / _|@\n |-| | @\n |-| | @\n |_| @\n @@\n0x02C7 CARON\n \\\\//@\n \\/ @\n $@\n $@\n $@\n $@@\n0x02D8 BREVE\n \\\\_//@\n \\_/ @\n $@\n $@\n $@\n $@@\n0x02D9 DOT ABOVE\n []@\n $@\n $@\n $@\n $@\n $@@\n0x02DB OGONEK\n $@\n $@\n $@\n $@\n $@\n )_) @@\n0x02DD DOUBLE ACUTE ACCENT\n _ _ @\n /_/_/@\n $@\n $@\n $@\n $@@\n0xCA0 KANNADA LETTER TTHA\n _____)@\n /_ ___/@\n / _ \\ @\n | (_) | @\n $\\___/$ @\n @@\n ");const s0=new ke,o0=process.cwd(),a0=o.join(o0,"qumra.config.json");function c0(e,t){s.existsSync(a0)||(console.error("Error: qumra.config.json not found!"),process.exit(1));const n=JSON.parse(s.readFileSync(a0,"utf-8")),r=n.version;let[i,o,a]=n.version.split(".").map(Number);try{if(t)switch(e){case"patch":a+=1;break;case"minor":o+=1,a=0;break;case"major":i+=1,o=0,a=0}else switch(e){case"patch":a=Math.max(0,a-1);break;case"minor":o>0&&(o-=1,a=0);break;case"major":i>0&&(i-=1,o=0,a=0)}n.version=`${i}.${o}.${a}`,s.writeFileSync(a0,JSON.stringify(n,null,2),"utf-8"),console.log(`Updated version to ${n.version}`)}catch(e){console.error("Error updating version:",e.message),n.version=r,s.writeFileSync(a0,JSON.stringify(n,null,2),"utf-8"),console.log(`Reverted to previous version: ${r}`)}}s0.name("version").description("Update project version (patch, minor, major)"),s0.command("patch").description("Increment the patch version").action((()=>c0("patch",!0))),s0.command("minor").description("Increment the minor version").action((()=>c0("minor",!0))),s0.command("major").description("Increment the major version").action((()=>c0("major",!0))),s0.command("unpatch").description("Decrement the patch version").action((()=>c0("patch",!1))),s0.command("unminor").description("Decrement the minor version").action((()=>c0("minor",!1))),s0.command("unmajor").description("Decrement the major version").action((()=>c0("major",!1)));const l0=new ke;l0.version(ef).description("CLI to create a new project"),l0.command("status").description("cli status").action((async()=>{const e=(e,t)=>e.split("\n").map((e=>{const n=Math.max(0,Math.floor((t-e.length)/2));return" ".repeat(n)+e})).join("\n"),t=100,n=df.textSync("Qumra Cloud CLI",{font:"Standard",horizontalLayout:"default",verticalLayout:"default",width:t,whitespaceBreak:!0}),r=df.textSync("Version 1.0.0",{font:"Standard",horizontalLayout:"default",verticalLayout:"default",width:t,whitespaceBreak:!0}),i=e(n,t),s=e(r,t),o=e("\n Welcome to Qumra Cloud CLI!\n \n At Qumra, we offer innovative cloud solutions to streamline your tech needs.\n Our tools are designed to make technology work for you with ease and efficiency.\n \n Learn more about our partners and how we collaborate to deliver the best:\n https://partners.qumra.cloud\n ",t);console.log(_t.green(i)),console.log(_t.green(s)),console.log(_t.green(o))})),l0.command("create-new-app").description("Create a new project").action(gf),l0.command("build").description("Build a project").action((()=>{const e=process.cwd(),t=o.join(e,"src","views"),n=o.join(e,"build"),r=o.join(n,"views.zip");s.existsSync(t)||(console.log(_t.red('Error: The "views" folder does not exist.')),process.exit(1)),s.existsSync(n)||s.mkdirSync(n);const i=zr('Compressing the "views" folder...').start(),a=s.createWriteStream(r),c=UO("zip",{zlib:{level:9}});a.on("close",(()=>{i.succeed(_t.blue(`"views" folder compressed successfully into ${r}`))})),c.on("warning",(e=>{if("ENOENT"!==e.code)throw e;console.warn(e)})),c.on("error",(e=>{throw i.fail(_t.red(`Failed to compress "views" folder: ${e.message}`)),e})),c.pipe(a),c.directory(t,!1),c.finalize()})),l0.command("publish").description("Publish your project").action((async function(){const e=function(){s.existsSync(YO)||(console.log('File "qumra.config.json" not found!'),process.exit(1));const e=s.readFileSync(YO,"utf-8");try{return JSON.parse(e)}catch(e){console.log(chalk.red('Failed to parse "qumra.config.json". Invalid JSON format.',e.message))}}(),t=zr("Checking files...").start();try{const n=await qO(GO),r=await qO(VO,"views"),i=await qO(KO,"locales"),a={...r,...i},c=Object.keys(a),l=Date.now();d.exec("npm run build",(r=>{r&&t.fail(r),HO(c,t).then((r=>{(async function(e,t){try{return(await of.post("/themes/uploadRequest",{paths:e,config:t})).data}catch(e){console.log("🚀 ~ uploadRequest ~ error:",e)}})(r.paths,e).then((i=>{(async function(e,t,n){const r=new sp;r.append("encryptionKey",e),r.append("paths",JSON.stringify(t));for(const[e,t]of Object.entries(n))r.append("files",s.createReadStream(t),{filename:o.basename(t),filepath:e}),r.append("filePaths",e);const i=zr(_t.cyan("Uploading theme...")).start();try{const e=await $O.post("/theme/upload",r,{onUploadProgress:e=>{const t=Math.round(100*e.loaded/e.total);i.text=_t.cyan(`Uploading theme... ${t}%`)}});return i.succeed(_t.green("Theme Files Upload successful!")),e.data}catch(e){throw i.fail(_t.red("Upload failed.")),console.error("🚀 ~ uploadTheme ~ error:",e.message),e.message}})(i.encryptionKey,r.paths,a).then((r=>{(async function(e,t,n){const r=new sp;r.append("encryptionKey",e),r.append("paths",JSON.stringify(t));for(const[e,t]of Object.entries(n))r.append("files",s.createReadStream(t),{filename:o.basename(t),filepath:e}),r.append("filePaths",e);const i=zr(_t.cyan("Uploading Assets Files...")).start();try{const e=await zO.post("/upload/assets",r,{onUploadProgress:e=>{const t=Math.round(100*e.loaded/e.total);i.text=_t.cyan(`Uploading theme... ${t}%`)}});return i.succeed(_t.green("Upload successful!")),e.data}catch(e){i.fail(_t.red("Assets Files Upload failed.")),console.error("🚀 ~ uploadAssets ~ error:",e.message)}})(i.encryptionKey,Object.keys(n),n).then((()=>{const n=((Date.now()-l)/1e3).toFixed(2);t.succeed(`Version ${e.version} upload completed successfully in ${n} seconds! 🎉🚀`)}))}))}))})).catch((e=>{}))}))}catch(e){console.error(`Failed to publish files - Error: ${e.message}`)}})),l0.command("login").description("developer login").action(i0),l0.addCommand(MJ),l0.addCommand(s0),l0.command("save").action((async()=>{await sf("token"),await rf("token",{test:"asdasdasd"})})),l0.parse(process.argv);
389
+ */var vX=s,bX=S,_X=d.spawn,wX=xX;function xX(e){e=e||{};var t,n,r=this,i=x,s=E,o={},a=!1,c={"User-Agent":"node-XMLHttpRequest",Accept:"*/*"},l=Object.assign({},c),u=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","content-transfer-encoding","cookie","cookie2","date","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"],p=["TRACE","TRACK","CONNECT"],h=!1,d=!1,f=!1,m={};this.UNSENT=0,this.OPENED=1,this.HEADERS_RECEIVED=2,this.LOADING=3,this.DONE=4,this.readyState=this.UNSENT,this.onreadystatechange=null,this.responseText="",this.responseXML="",this.status=null,this.statusText=null;this.open=function(e,t,n,r,i){if(this.abort(),d=!1,f=!1,!function(e){return e&&-1===p.indexOf(e)}(e))throw new Error("SecurityError: Request method not allowed");o={method:e,url:t.toString(),async:"boolean"!=typeof n||n,user:r||null,password:i||null},g(this.OPENED)},this.setDisableHeaderCheck=function(e){a=e},this.setRequestHeader=function(e,t){if(this.readyState!=this.OPENED)throw new Error("INVALID_STATE_ERR: setRequestHeader can only be called when state is OPEN");if(!function(e){return a||e&&-1===u.indexOf(e.toLowerCase())}(e))return console.warn('Refused to set unsafe header "'+e+'"'),!1;if(h)throw new Error("INVALID_STATE_ERR: send flag is true");return l[e]=t,!0},this.getResponseHeader=function(e){return"string"==typeof e&&this.readyState>this.OPENED&&n.headers[e.toLowerCase()]&&!d?n.headers[e.toLowerCase()]:null},this.getAllResponseHeaders=function(){if(this.readyState<this.HEADERS_RECEIVED||d)return"";var e="";for(var t in n.headers)"set-cookie"!==t&&"set-cookie2"!==t&&(e+=t+": "+n.headers[t]+"\r\n");return e.substr(0,e.length-2)},this.getRequestHeader=function(e){return"string"==typeof e&&l[e]?l[e]:""},this.send=function(a){if(this.readyState!=this.OPENED)throw new Error("INVALID_STATE_ERR: connection must be opened before send() is called");if(h)throw new Error("INVALID_STATE_ERR: send has already been called");var c,u=!1,p=!1,f=bX.parse(o.url);switch(f.protocol){case"https:":u=!0;case"http:":c=f.hostname;break;case"file:":p=!0;break;case void 0:case"":c="localhost";break;default:throw new Error("Protocol not supported.")}if(p){if("GET"!==o.method)throw new Error("XMLHttpRequest: Only GET method is supported");if(o.async)vX.readFile(unescape(f.pathname),"utf8",(function(e,t){e?r.handleError(e,e.errno||-1):(r.status=200,r.responseText=t,g(r.DONE))}));else try{this.responseText=vX.readFileSync(unescape(f.pathname),"utf8"),this.status=200,g(r.DONE)}catch(e){this.handleError(e,e.errno||-1)}}else{var m=f.port||(u?443:80),y=f.pathname+(f.search?f.search:"");if(l.Host=c,u&&443===m||80===m||(l.Host+=":"+f.port),o.user){void 0===o.password&&(o.password="");var v=new Buffer(o.user+":"+o.password);l.Authorization="Basic "+v.toString("base64")}"GET"===o.method||"HEAD"===o.method?a=null:a?(l["Content-Length"]=Buffer.isBuffer(a)?a.length:Buffer.byteLength(a),l["Content-Type"]||(l["Content-Type"]="text/plain;charset=UTF-8")):"POST"===o.method&&(l["Content-Length"]=0);var b=e.agent||!1,_={host:c,port:m,path:y,method:o.method,headers:l,agent:b};if(u&&(_.pfx=e.pfx,_.key=e.key,_.passphrase=e.passphrase,_.cert=e.cert,_.ca=e.ca,_.ciphers=e.ciphers,_.rejectUnauthorized=!1!==e.rejectUnauthorized),d=!1,o.async){var w=u?s.request:i.request;h=!0,r.dispatchEvent("readystatechange");var x=function(i){if(302===(n=i).statusCode||303===n.statusCode||307===n.statusCode){o.url=n.headers.location;var s=bX.parse(o.url);c=s.hostname;var a={hostname:s.hostname,port:s.port,path:s.path,method:303===n.statusCode?"GET":o.method,headers:l};return u&&(a.pfx=e.pfx,a.key=e.key,a.passphrase=e.passphrase,a.cert=e.cert,a.ca=e.ca,a.ciphers=e.ciphers,a.rejectUnauthorized=!1!==e.rejectUnauthorized),void(t=w(a,x).on("error",E)).end()}n&&n.setEncoding&&n.setEncoding("utf8"),g(r.HEADERS_RECEIVED),r.status=n.statusCode,n.on("data",(function(e){e&&(r.responseText+=e),h&&g(r.LOADING)})),n.on("end",(function(){h&&(h=!1,g(r.DONE))})),n.on("error",(function(e){r.handleError(e)}))},E=function(e){r.handleError(e)};t=w(_,x).on("error",E),e.autoUnref&&t.on("socket",(e=>{e.unref()})),a&&t.write(a),t.end(),r.dispatchEvent("loadstart")}else{var S=".node-xmlhttprequest-content-"+process.pid,T=".node-xmlhttprequest-sync-"+process.pid;vX.writeFileSync(T,"","utf8");for(var D="var http = require('http'), https = require('https'), fs = require('fs');var doRequest = http"+(u?"s":"")+".request;var options = "+JSON.stringify(_)+";var responseText = '';var req = doRequest(options, function(response) {response.setEncoding('utf8');response.on('data', function(chunk) { responseText += chunk;});response.on('end', function() {fs.writeFileSync('"+S+"', 'NODE-XMLHTTPREQUEST-STATUS:' + response.statusCode + ',' + responseText, 'utf8');fs.unlinkSync('"+T+"');});response.on('error', function(error) {fs.writeFileSync('"+S+"', 'NODE-XMLHTTPREQUEST-ERROR:' + JSON.stringify(error), 'utf8');fs.unlinkSync('"+T+"');});}).on('error', function(error) {fs.writeFileSync('"+S+"', 'NODE-XMLHTTPREQUEST-ERROR:' + JSON.stringify(error), 'utf8');fs.unlinkSync('"+T+"');});"+(a?"req.write('"+JSON.stringify(a).slice(1,-1).replace(/'/g,"\\'")+"');":"")+"req.end();",k=_X(process.argv[0],["-e",D]);vX.existsSync(T););if(r.responseText=vX.readFileSync(S,"utf8"),k.stdin.end(),vX.unlinkSync(S),r.responseText.match(/^NODE-XMLHTTPREQUEST-ERROR:/)){var A=r.responseText.replace(/^NODE-XMLHTTPREQUEST-ERROR:/,"");r.handleError(A,503)}else r.status=r.responseText.replace(/^NODE-XMLHTTPREQUEST-STATUS:([0-9]*),.*/,"$1"),r.responseText=r.responseText.replace(/^NODE-XMLHTTPREQUEST-STATUS:[0-9]*,(.*)/,"$1"),g(r.DONE)}}},this.handleError=function(e,t){this.status=t||0,this.statusText=e,this.responseText=e.stack,d=!0,g(this.DONE)},this.abort=function(){t&&(t.abort(),t=null),l=Object.assign({},c),this.responseText="",this.responseXML="",d=f=!0,this.readyState===this.UNSENT||this.readyState===this.OPENED&&!h||this.readyState===this.DONE||(h=!1,g(this.DONE)),this.readyState=this.UNSENT},this.addEventListener=function(e,t){e in m||(m[e]=[]),m[e].push(t)},this.removeEventListener=function(e,t){e in m&&(m[e]=m[e].filter((function(e){return e!==t})))},this.dispatchEvent=function(e){if("function"==typeof r["on"+e]&&(this.readyState===this.DONE?setImmediate((function(){r["on"+e]()})):r["on"+e]()),e in m)for(let t=0,n=m[e].length;t<n;t++)this.readyState===this.DONE?setImmediate((function(){m[e][t].call(r)})):m[e][t].call(r)};var g=function(e){if(!(r.readyState===e||r.readyState===r.UNSENT&&f)&&(r.readyState=e,(o.async||r.readyState<r.OPENED||r.readyState===r.DONE)&&r.dispatchEvent("readystatechange"),r.readyState===r.DONE)){let e;e=f?"abort":d?"error":"load",r.dispatchEvent(e),r.dispatchEvent("loadend")}}}xX.XMLHttpRequest=xX;var EX=q(wX);const SX=EX||B({__proto__:null,default:EX},[wX]);class TX{constructor(){this.cookies=new Map}parseCookies(e){const t=e.getResponseHeader("set-cookie");t&&t.forEach((e=>{const t=function(e){const t=e.split("; "),n=t[0].indexOf("=");if(-1===n)return;const r=t[0].substring(0,n).trim();if(!r.length)return;let i=t[0].substring(n+1).trim();34===i.charCodeAt(0)&&(i=i.slice(1,-1));const s={name:r,value:i};for(let e=1;e<t.length;e++){const n=t[e].split("=");if(2!==n.length)continue;const r=n[0].trim(),i=n[1].trim();switch(r){case"Expires":s.expires=new Date(i);break;case"Max-Age":const e=new Date;e.setUTCSeconds(e.getUTCSeconds()+parseInt(i,10)),s.expires=e}}return s}(e);t&&this.cookies.set(t.name,t)}))}addCookies(e){const t=[];this.cookies.forEach(((e,n)=>{var r;(null===(r=e.expires)||void 0===r?void 0:r.getTime())<Date.now()?this.cookies.delete(n):t.push(`${n}=${e.value}`)})),t.length&&(e.setDisableHeaderCheck(!0),e.setRequestHeader("cookie",t.join("; ")))}}function DX(){}const kX=null!=new SX({xdomain:!1}).responseType;let AX=class e extends AQ{constructor(e,t){super(),aX(this,t),this.opts=t,this.method=t.method||"GET",this.uri=e,this.data=void 0!==t.data?t.data:null,this.create()}create(){var t;const n=iX(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this.opts.xd;const r=this.xhr=new SX(n);try{r.open(this.method,this.uri,!0);try{if(this.opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let e in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(e)&&r.setRequestHeader(e,this.opts.extraHeaders[e])}}catch(e){}if("POST"===this.method)try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{r.setRequestHeader("Accept","*/*")}catch(e){}null===(t=this.opts.cookieJar)||void 0===t||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(r.timeout=this.opts.requestTimeout),r.onreadystatechange=()=>{var e;3===r.readyState&&(null===(e=this.opts.cookieJar)||void 0===e||e.parseCookies(r)),4===r.readyState&&(200===r.status||1223===r.status?this.onLoad():this.setTimeoutFn((()=>{this.onError("number"==typeof r.status?r.status:0)}),0))},r.send(this.data)}catch(e){return void this.setTimeoutFn((()=>{this.onError(e)}),0)}"undefined"!=typeof document&&(this.index=e.requestsCount++,e.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(t){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=DX,t)try{this.xhr.abort()}catch(e){}"undefined"!=typeof document&&delete e.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;null!==e&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}};if(AX.requestsCount=0,AX.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",CX);else if("function"==typeof addEventListener){addEventListener("onpagehide"in rX?"pagehide":"unload",CX,!1)}function CX(){for(let e in AX.requests)AX.requests.hasOwnProperty(e)&&AX.requests[e].abort()}const RX=pZ,OX=process.nextTick,LX="undefined"!=typeof navigator&&"string"==typeof navigator.product&&"reactnative"===navigator.product.toLowerCase();const IX={websocket:class extends lX{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),t=this.opts.protocols,n=LX?{}:iX(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(n.headers=this.opts.extraHeaders);try{this.ws=new RX(e,t,n)}catch(e){return this.emitReserved("error",e)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;VJ(n,this.supportsBinary,(e=>{const t={};if(n.options&&(t.compress=n.options.compress),this.opts.perMessageDeflate){("string"==typeof e?Buffer.byteLength(e):e.length)<this.opts.perMessageDeflate.threshold&&(t.compress=!1)}try{this.ws.send(e,t)}catch(e){}r&&OX((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){void 0!==this.ws&&(this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",t=this.query||{};return this.opts.timestampRequests&&(t[this.opts.timestampParam]=yX()),this.supportsBinary||(t.b64=1),this.createUri(e,t)}check(){return!!RX}},webtransport:class extends lX{get name(){return"webtransport"}doOpen(){"function"==typeof WebTransport&&(this.transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name]),this.transport.closed.then((()=>{this.onClose()})).catch((e=>{this.onError("webtransport error",e)})),this.transport.ready.then((()=>{this.transport.createBidirectionalStream().then((e=>{const t=function(e,t){eX||(eX=new TextDecoder);const n=[];let r=0,i=-1,s=!1;return new TransformStream({transform(o,a){for(n.push(o);;){if(0===r){if(tX(n)<1)break;const e=nX(n,1);s=!(128&~e[0]),i=127&e[0],r=i<126?3:126===i?1:2}else if(1===r){if(tX(n)<2)break;const e=nX(n,2);i=new DataView(e.buffer,e.byteOffset,e.length).getUint16(0),r=3}else if(2===r){if(tX(n)<8)break;const e=nX(n,8),t=new DataView(e.buffer,e.byteOffset,e.length),s=t.getUint32(0);if(s>Math.pow(2,21)-1){a.enqueue(GJ);break}i=s*Math.pow(2,32)+t.getUint32(4),r=3}else{if(tX(n)<i)break;const e=nX(n,i);a.enqueue(ZJ(s?e:eX.decode(e),t)),r=0}if(0===i||i>e){a.enqueue(GJ);break}}}})}(Number.MAX_SAFE_INTEGER,this.socket.binaryType),n=e.readable.pipeThrough(t).getReader(),r=XJ();r.readable.pipeTo(e.writable),this.writer=r.writable.getWriter();const i=()=>{n.read().then((({done:e,value:t})=>{e||(this.onPacket(t),i())})).catch((e=>{}))};i();const s={type:"open"};this.query.sid&&(s.data=`{"sid":"${this.query.sid}"}`),this.writer.write(s).then((()=>this.onOpen()))}))})))}write(e){this.writable=!1;for(let t=0;t<e.length;t++){const n=e[t],r=t===e.length-1;this.writer.write(n).then((()=>{r&&OX((()=>{this.writable=!0,this.emitReserved("drain")}),this.setTimeoutFn)}))}}doClose(){var e;null===(e=this.transport)||void 0===e||e.close()}},polling:class extends lX{constructor(e){if(super(e),this.polling=!1,"undefined"!=typeof location){const t="https:"===location.protocol;let n=location.port;n||(n=t?"443":"80"),this.xd="undefined"!=typeof location&&e.hostname!==location.hostname||n!==e.port}const t=e&&e.forceBase64;this.supportsBinary=kX&&!t,this.opts.withCredentials&&(this.cookieJar=new TX)}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const t=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let e=0;this.polling&&(e++,this.once("pollComplete",(function(){--e||t()}))),this.writable||(e++,this.once("drain",(function(){--e||t()})))}else t()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){((e,t)=>{const n=e.split(JJ),r=[];for(let e=0;e<n.length;e++){const i=ZJ(n[e],t);if(r.push(i),"error"===i.type)break}return r})(e,this.socket.binaryType).forEach((e=>{if("opening"===this.readyState&&"open"===e.type&&this.onOpen(),"close"===e.type)return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(e)})),"closed"!==this.readyState&&(this.polling=!1,this.emitReserved("pollComplete"),"open"===this.readyState&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};"open"===this.readyState?e():this.once("open",e)}write(e){this.writable=!1,((e,t)=>{const n=e.length,r=new Array(n);let i=0;e.forEach(((e,s)=>{VJ(e,!1,(e=>{r[s]=e,++i===n&&t(r.join(JJ))}))}))})(e,(e=>{this.doWrite(e,(()=>{this.writable=!0,this.emitReserved("drain")}))}))}uri(){const e=this.opts.secure?"https":"http",t=this.query||{};return!1!==this.opts.timestampRequests&&(t[this.opts.timestampParam]=yX()),this.supportsBinary||t.sid||(t.b64=1),this.createUri(e,t)}request(e={}){return Object.assign(e,{xd:this.xd,cookieJar:this.cookieJar},this.opts),new AX(this.uri(),e)}doWrite(e,t){const n=this.request({method:"POST",data:e});n.on("success",t),n.on("error",((e,t)=>{this.onError("xhr post error",e,t)}))}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",((e,t)=>{this.onError("xhr poll error",e,t)})),this.pollXhr=e}}},PX=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,NX=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function jX(e){if(e.length>2e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");-1!=n&&-1!=r&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let i=PX.exec(e||""),s={},o=14;for(;o--;)s[NX[o]]=i[o]||"";return-1!=n&&-1!=r&&(s.source=t,s.host=s.host.substring(1,s.host.length-1).replace(/;/g,":"),s.authority=s.authority.replace("[","").replace("]","").replace(/;/g,":"),s.ipv6uri=!0),s.pathNames=function(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");"/"!=t.slice(0,1)&&0!==t.length||r.splice(0,1);"/"==t.slice(-1)&&r.splice(r.length-1,1);return r}(0,s.path),s.queryKey=function(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(e,t,r){t&&(n[t]=r)})),n}(0,s.query),s}let FX=class e extends AQ{constructor(e,t={}){super(),this.binaryType="nodebuffer",this.writeBuffer=[],e&&"object"==typeof e&&(t=e,e=null),e?(e=jX(e),t.hostname=e.host,t.secure="https"===e.protocol||"wss"===e.protocol,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=jX(t.host).host),aX(this,t),this.secure=null!=t.secure?t.secure:"undefined"!=typeof location&&"https:"===location.protocol,t.hostname&&!t.port&&(t.port=this.secure?"443":"80"),this.hostname=t.hostname||("undefined"!=typeof location?location.hostname:"localhost"),this.port=t.port||("undefined"!=typeof location&&location.port?location.port:this.secure?"443":"80"),this.transports=t.transports||["polling","websocket","webtransport"],this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},t),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),"string"==typeof this.opts.query&&(this.opts.query=function(e){let t={},n=e.split("&");for(let e=0,r=n.length;e<r;e++){let r=n[e].split("=");t[decodeURIComponent(r[0])]=decodeURIComponent(r[1])}return t}(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,"function"==typeof addEventListener&&(this.opts.closeOnBeforeunload&&(this.beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this.beforeunloadEventListener,!1)),"localhost"!==this.hostname&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const t=Object.assign({},this.opts.query);t.EIO=4,t.transport=e,this.id&&(t.sid=this.id);const n=Object.assign({},this.opts,{query:t,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new IX[e](n)}open(){let t;if(this.opts.rememberUpgrade&&e.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))t="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((()=>{this.emitReserved("error","No transports available")}),0);t=this.transports[0]}this.readyState="opening";try{t=this.createTransport(t)}catch(e){return this.transports.shift(),void this.open()}t.open(),this.setTransport(t)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(e=>this.onClose("transport close",e)))}probe(t){let n=this.createTransport(t),r=!1;e.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",(t=>{if(!r)if("pong"===t.type&&"probe"===t.data){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;e.priorWebsocketSuccess="websocket"===n.name,this.transport.pause((()=>{r||"closed"!==this.readyState&&(u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())}))}else{const e=new Error("probe error");e.transport=n.name,this.emitReserved("upgradeError",e)}})))};function s(){r||(r=!0,u(),n.close(),n=null)}const o=e=>{const t=new Error("probe error: "+e);t.transport=n.name,s(),this.emitReserved("upgradeError",t)};function a(){o("transport closed")}function c(){o("socket closed")}function l(e){n&&e.name!==n.name&&s()}const u=()=>{n.removeListener("open",i),n.removeListener("error",o),n.removeListener("close",a),this.off("close",c),this.off("upgrading",l)};n.once("open",i),n.once("error",o),n.once("close",a),this.once("close",c),this.once("upgrading",l),-1!==this.upgrades.indexOf("webtransport")&&"webtransport"!==t?this.setTimeoutFn((()=>{r||n.open()}),200):n.open()}onOpen(){if(this.readyState="open",e.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade){let e=0;const t=this.upgrades.length;for(;e<t;e++)this.probe(this.upgrades[e])}}onPacket(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),this.resetPingTimeout(),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const t=new Error("server error");t.code=e.data,this.onError(t);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data)}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),"closed"!==this.readyState&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn((()=>{this.onClose("ping timeout")}),this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emitReserved("drain"):this.flush()}flush(){if("closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&"polling"===this.transport.name&&this.writeBuffer.length>1))return this.writeBuffer;let e=1;for(let n=0;n<this.writeBuffer.length;n++){const r=this.writeBuffer[n].data;if(r&&(e+="string"==typeof(t=r)?function(e){let t=0,n=0;for(let r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}(t):Math.ceil(1.33*(t.byteLength||t.size))),n>0&&e>this.maxPayload)return this.writeBuffer.slice(0,n);e+=2}var t;return this.writeBuffer}write(e,t,n){return this.sendPacket("message",e,t,n),this}send(e,t,n){return this.sendPacket("message",e,t,n),this}sendPacket(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof n&&(r=n,n=null),"closing"===this.readyState||"closed"===this.readyState)return;(n=n||{}).compress=!1!==n.compress;const i={type:e,data:t,options:n};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),r&&this.once("flush",r),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},t=()=>{this.off("upgrade",t),this.off("upgradeError",t),e()},n=()=>{this.once("upgrade",t),this.once("upgradeError",t)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(()=>{this.upgrading?n():e()})):this.upgrading?n():e()),this}onError(t){e.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}onClose(e,t){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&(removeEventListener("beforeunload",this.beforeunloadEventListener,!1),removeEventListener("offline",this.offlineEventListener,!1)),this.readyState="closed",this.id=null,this.emitReserved("close",e,t),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const t=[];let n=0;const r=e.length;for(;n<r;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}};FX.protocol=4,FX.protocol;const BX="function"==typeof ArrayBuffer,MX=e=>"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,UX=Object.prototype.toString,qX="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===UX.call(Blob),HX="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===UX.call(File);function $X(e){return BX&&(e instanceof ArrayBuffer||MX(e))||qX&&e instanceof Blob||HX&&e instanceof File}function zX(e,t){if(!e||"object"!=typeof e)return!1;if(Array.isArray(e)){for(let t=0,n=e.length;t<n;t++)if(zX(e[t]))return!0;return!1}if($X(e))return!0;if(e.toJSON&&"function"==typeof e.toJSON&&1===arguments.length)return zX(e.toJSON(),!0);for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&zX(e[t]))return!0;return!1}function WX(e){const t=[],n=e.data,r=e;return r.data=GX(n,t),r.attachments=t.length,{packet:r,buffers:t}}function GX(e,t){if(!e)return e;if($X(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=GX(e[r],t);return n}if("object"==typeof e&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=GX(e[r],t));return n}return e}function VX(e,t){return e.data=KX(e.data,t),delete e.attachments,e}function KX(e,t){if(!e)return e;if(e&&!0===e._placeholder){if("number"==typeof e.num&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=KX(e[n],t);else if("object"==typeof e)for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=KX(e[n],t));return e}const YX=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];var ZX;!function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"}(ZX||(ZX={}));function QX(e){return"[object Object]"===Object.prototype.toString.call(e)}class JX extends AQ{constructor(e){super(),this.reviver=e}add(e){let t;if("string"==typeof e){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);const n=t.type===ZX.BINARY_EVENT;n||t.type===ZX.BINARY_ACK?(t.type=n?ZX.EVENT:ZX.ACK,this.reconstructor=new XX(t),0===t.attachments&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else{if(!$X(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t))}}decodeString(e){let t=0;const n={type:Number(e.charAt(0))};if(void 0===ZX[n.type])throw new Error("unknown packet type "+n.type);if(n.type===ZX.BINARY_EVENT||n.type===ZX.BINARY_ACK){const r=t+1;for(;"-"!==e.charAt(++t)&&t!=e.length;);const i=e.substring(r,t);if(i!=Number(i)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(i)}if("/"===e.charAt(t+1)){const r=t+1;for(;++t;){if(","===e.charAt(t))break;if(t===e.length)break}n.nsp=e.substring(r,t)}else n.nsp="/";const r=e.charAt(t+1);if(""!==r&&Number(r)==r){const r=t+1;for(;++t;){const n=e.charAt(t);if(null==n||Number(n)!=n){--t;break}if(t===e.length)break}n.id=Number(e.substring(r,t+1))}if(e.charAt(++t)){const r=this.tryParse(e.substr(t));if(!JX.isPayloadValid(n.type,r))throw new Error("invalid payload");n.data=r}return n}tryParse(e){try{return JSON.parse(e,this.reviver)}catch(e){return!1}}static isPayloadValid(e,t){switch(e){case ZX.CONNECT:return QX(t);case ZX.DISCONNECT:return void 0===t;case ZX.CONNECT_ERROR:return"string"==typeof t||QX(t);case ZX.EVENT:case ZX.BINARY_EVENT:return Array.isArray(t)&&("number"==typeof t[0]||"string"==typeof t[0]&&-1===YX.indexOf(t[0]));case ZX.ACK:case ZX.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class XX{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const e=VX(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}var e0=Object.freeze({__proto__:null,Decoder:JX,Encoder:class{constructor(e){this.replacer=e}encode(e){return e.type!==ZX.EVENT&&e.type!==ZX.ACK||!zX(e)?[this.encodeAsString(e)]:this.encodeAsBinary({type:e.type===ZX.EVENT?ZX.BINARY_EVENT:ZX.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id})}encodeAsString(e){let t=""+e.type;return e.type!==ZX.BINARY_EVENT&&e.type!==ZX.BINARY_ACK||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data&&(t+=JSON.stringify(e.data,this.replacer)),t}encodeAsBinary(e){const t=WX(e),n=this.encodeAsString(t.packet),r=t.buffers;return r.unshift(n),r}},get PacketType(){return ZX},protocol:5});function t0(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const n0=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class r0 extends AQ{constructor(e,t,n){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=t,n&&n.auth&&(this.auth=n.auth),this._opts=Object.assign({},n),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[t0(e,"open",this.onopen.bind(this)),t0(e,"packet",this.onpacket.bind(this)),t0(e,"error",this.onerror.bind(this)),t0(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected||(this.subEvents(),this.io._reconnecting||this.io.open(),"open"===this.io._readyState&&this.onopen()),this}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...t){if(n0.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(t.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(t),this;const n={type:ZX.EVENT,data:t,options:{}};if(n.options.compress=!1!==this.flags.compress,"function"==typeof t[t.length-1]){const e=this.ids++,r=t.pop();this._registerAckCallback(e,r),n.id=e}const r=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!r||!this.connected)||(this.connected?(this.notifyOutgoingListeners(n),this.packet(n)):this.sendBuffer.push(n)),this.flags={},this}_registerAckCallback(e,t){var n;const r=null!==(n=this.flags.timeout)&&void 0!==n?n:this._opts.ackTimeout;if(void 0===r)return void(this.acks[e]=t);const i=this.io.setTimeoutFn((()=>{delete this.acks[e];for(let t=0;t<this.sendBuffer.length;t++)this.sendBuffer[t].id===e&&this.sendBuffer.splice(t,1);t.call(this,new Error("operation has timed out"))}),r),s=(...e)=>{this.io.clearTimeoutFn(i),t.apply(this,e)};s.withError=!0,this.acks[e]=s}emitWithAck(e,...t){return new Promise(((n,r)=>{const i=(e,t)=>e?r(e):n(t);i.withError=!0,t.push(i),this.emit(e,...t)}))}_addToQueue(e){let t;"function"==typeof e[e.length-1]&&(t=e.pop());const n={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push(((e,...r)=>{if(n!==this._queue[0])return;return null!==e?n.tryCount>this._opts.retries&&(this._queue.shift(),t&&t(e)):(this._queue.shift(),t&&t(null,...r)),n.pending=!1,this._drainQueue()})),this._queue.push(n),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||0===this._queue.length)return;const t=this._queue[0];t.pending&&!e||(t.pending=!0,t.tryCount++,this.flags=t.flags,this.emit.apply(this,t.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){"function"==typeof this.auth?this.auth((e=>{this._sendConnectPacket(e)})):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:ZX.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,t){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,t),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach((e=>{if(!this.sendBuffer.some((t=>String(t.id)===e))){const t=this.acks[e];delete this.acks[e],t.withError&&t.call(this,new Error("socket has been disconnected"))}}))}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case ZX.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case ZX.EVENT:case ZX.BINARY_EVENT:this.onevent(e);break;case ZX.ACK:case ZX.BINARY_ACK:this.onack(e);break;case ZX.DISCONNECT:this.ondisconnect();break;case ZX.CONNECT_ERROR:this.destroy();const t=new Error(e.data.message);t.data=e.data.data,this.emitReserved("connect_error",t)}}onevent(e){const t=e.data||[];null!=e.id&&t.push(this.ack(e.id)),this.connected?this.emitEvent(t):this.receiveBuffer.push(Object.freeze(t))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const t=this._anyListeners.slice();for(const n of t)n.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&"string"==typeof e[e.length-1]&&(this._lastOffset=e[e.length-1])}ack(e){const t=this;let n=!1;return function(...r){n||(n=!0,t.packet({type:ZX.ACK,id:e,data:r}))}}onack(e){const t=this.acks[e.id];"function"==typeof t&&(delete this.acks[e.id],t.withError&&e.data.unshift(null),t.apply(this,e.data))}onconnect(e,t){this.id=e,this.recovered=t&&this._pid===t,this._pid=t,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach((e=>this.emitEvent(e))),this.receiveBuffer=[],this.sendBuffer.forEach((e=>{this.notifyOutgoingListeners(e),this.packet(e)})),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach((e=>e())),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:ZX.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const t=this._anyListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const t=this._anyOutgoingListeners;for(let n=0;n<t.length;n++)if(e===t[n])return t.splice(n,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const t=this._anyOutgoingListeners.slice();for(const n of t)n.apply(this,e.data)}}}function i0(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}i0.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=1&Math.floor(10*t)?e+n:e-n}return 0|Math.min(e,this.max)},i0.prototype.reset=function(){this.attempts=0},i0.prototype.setMin=function(e){this.ms=e},i0.prototype.setMax=function(e){this.max=e},i0.prototype.setJitter=function(e){this.jitter=e};class s0 extends AQ{constructor(e,t){var n;super(),this.nsps={},this.subs=[],e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.opts=t,aX(this,t),this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(null!==(n=t.randomizationFactor)&&void 0!==n?n:.5),this.backoff=new i0({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this._readyState="closed",this.uri=e;const r=t.parser||e0;this.encoder=new r.Encoder,this.decoder=new r.Decoder,this._autoConnect=!1!==t.autoConnect,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return void 0===e?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var t;return void 0===e?this._reconnectionDelay:(this._reconnectionDelay=e,null===(t=this.backoff)||void 0===t||t.setMin(e),this)}randomizationFactor(e){var t;return void 0===e?this._randomizationFactor:(this._randomizationFactor=e,null===(t=this.backoff)||void 0===t||t.setJitter(e),this)}reconnectionDelayMax(e){var t;return void 0===e?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,null===(t=this.backoff)||void 0===t||t.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new FX(this.uri,this.opts);const t=this.engine,n=this;this._readyState="opening",this.skipReconnect=!1;const r=t0(t,"open",(function(){n.onopen(),e&&e()})),i=t=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",t),e?e(t):this.maybeReconnectOnOpen()},s=t0(t,"error",i);if(!1!==this._timeout){const e=this._timeout,n=this.setTimeoutFn((()=>{r(),i(new Error("timeout")),t.close()}),e);this.opts.autoUnref&&n.unref(),this.subs.push((()=>{this.clearTimeoutFn(n)}))}return this.subs.push(r),this.subs.push(s),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(t0(e,"ping",this.onping.bind(this)),t0(e,"data",this.ondata.bind(this)),t0(e,"error",this.onerror.bind(this)),t0(e,"close",this.onclose.bind(this)),t0(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(e){this.onclose("parse error",e)}}ondecoded(e){OX((()=>{this.emitReserved("packet",e)}),this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,t){let n=this.nsps[e];return n?this._autoConnect&&!n.active&&n.connect():(n=new r0(this,e,t),this.nsps[e]=n),n}_destroy(e){const t=Object.keys(this.nsps);for(const e of t){if(this.nsps[e].active)return}this._close()}_packet(e){const t=this.encoder.encode(e);for(let n=0;n<t.length;n++)this.engine.write(t[n],e.options)}cleanup(){this.subs.forEach((e=>e())),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,t){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,t),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const t=this.backoff.duration();this._reconnecting=!0;const n=this.setTimeoutFn((()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open((t=>{t?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",t)):e.onreconnect()})))}),t);this.opts.autoUnref&&n.unref(),this.subs.push((()=>{this.clearTimeoutFn(n)}))}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const o0={};function a0(e,t){"object"==typeof e&&(t=e,e=void 0);const n=function(e,t="",n){let r=e;n=n||"undefined"!=typeof location&&location,null==e&&(e=n.protocol+"//"+n.host),"string"==typeof e&&("/"===e.charAt(0)&&(e="/"===e.charAt(1)?n.protocol+e:n.host+e),/^(https?|wss?):\/\//.test(e)||(e=void 0!==n?n.protocol+"//"+e:"https://"+e),r=jX(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const i=-1!==r.host.indexOf(":")?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+t,r.href=r.protocol+"://"+i+(n&&n.port===r.port?"":":"+r.port),r}(e,(t=t||{}).path||"/socket.io"),r=n.source,i=n.id,s=n.path,o=o0[i]&&s in o0[i].nsps;let a;return t.forceNew||t["force new connection"]||!1===t.multiplex||o?a=new s0(r,t):(o0[i]||(o0[i]=new s0(r,t)),a=o0[i]),n.query&&!t.query&&(t.query=n.queryKey),a.socket(n.path,t)}Object.assign(a0,{Manager:s0,Socket:r0,io:a0,connect:a0});const c0=async()=>{const e=zr("Login Init...").start();try{console.log(`${tf}/login`);const t=await fetch(`${tf}/login`,{method:"POST"});if(!t.ok)throw new Error("Network response was not ok");const n=await t.json(),{room:r,sessionId:i}=n;e.succeed();const s=zr("Wait User Auth").start();UJ(`https://partner.qumra.cloud/cli/auth?sessionId=${i}`).then((()=>{const e=a0("https://api.qumra.cloud");e.on("connect",(()=>{e.emit("authRoom",r)})),e.on("login",(({data:t,token:n})=>{rf("user",t),rf("token",n),s.succeed("success"),e.disconnect()}))})).catch((e=>console.error("Failed to open URL:",e)))}catch(t){e.stop(),console.error("Failed to fetch data:",t)}};new ke("user").command("login").description("Run development server with Webpack and BrowserSync").action(c0);df.parseFont("Standard","flf2a$ 6 5 16 15 13 0 24463 229\nStandard by Glenn Chappell & Ian Chai 3/93 -- based on Frank's .sig\nIncludes ISO Latin-1\nfiglet release 2.1 -- 12 Aug 1994\nModified for figlet 2.2 by John Cowan <cowan@ccil.org>\n to add Latin-{2,3,4,5} support (Unicode U+0100-017F).\nPermission is hereby given to modify this font, as long as the\nmodifier's name is placed on a comment line.\n\nModified by Paul Burton <solution@earthlink.net> 12/96 to include new parameter\nsupported by FIGlet and FIGWin. May also be slightly modified for better use\nof new full-width/kern/smush alternatives, but default output is NOT changed.\n\nFont modified May 20, 2012 by patorjk to add the 0xCA0 character\n $@\n $@\n $@\n $@\n $@\n $@@\n _ @\n | |@\n | |@\n |_|@\n (_)@\n @@\n _ _ @\n ( | )@\n V V @\n $ @\n $ @\n @@\n _ _ @\n _| || |_ @\n |_ .. _|@\n |_ _|@\n |_||_| @\n @@\n _ @\n | | @\n / __)@\n \\__ \\@\n ( /@\n |_| @@\n _ __@\n (_)/ /@\n / / @\n / /_ @\n /_/(_)@\n @@\n ___ @\n ( _ ) @\n / _ \\/\\@\n | (_> <@\n \\___/\\/@\n @@\n _ @\n ( )@\n |/ @\n $ @\n $ @\n @@\n __@\n / /@\n | | @\n | | @\n | | @\n \\_\\@@\n __ @\n \\ \\ @\n | |@\n | |@\n | |@\n /_/ @@\n @\n __/\\__@\n \\ /@\n /_ _\\@\n \\/ @\n @@\n @\n _ @\n _| |_ @\n |_ _|@\n |_| @\n @@\n @\n @\n @\n _ @\n ( )@\n |/ @@\n @\n @\n _____ @\n |_____|@\n $ @\n @@\n @\n @\n @\n _ @\n (_)@\n @@\n __@\n / /@\n / / @\n / / @\n /_/ @\n @@\n ___ @\n / _ \\ @\n | | | |@\n | |_| |@\n \\___/ @\n @@\n _ @\n / |@\n | |@\n | |@\n |_|@\n @@\n ____ @\n |___ \\ @\n __) |@\n / __/ @\n |_____|@\n @@\n _____ @\n |___ / @\n |_ \\ @\n ___) |@\n |____/ @\n @@\n _ _ @\n | || | @\n | || |_ @\n |__ _|@\n |_| @\n @@\n ____ @\n | ___| @\n |___ \\ @\n ___) |@\n |____/ @\n @@\n __ @\n / /_ @\n | '_ \\ @\n | (_) |@\n \\___/ @\n @@\n _____ @\n |___ |@\n / / @\n / / @\n /_/ @\n @@\n ___ @\n ( _ ) @\n / _ \\ @\n | (_) |@\n \\___/ @\n @@\n ___ @\n / _ \\ @\n | (_) |@\n \\__, |@\n /_/ @\n @@\n @\n _ @\n (_)@\n _ @\n (_)@\n @@\n @\n _ @\n (_)@\n _ @\n ( )@\n |/ @@\n __@\n / /@\n / / @\n \\ \\ @\n \\_\\@\n @@\n @\n _____ @\n |_____|@\n |_____|@\n $ @\n @@\n __ @\n \\ \\ @\n \\ \\@\n / /@\n /_/ @\n @@\n ___ @\n |__ \\@\n / /@\n |_| @\n (_) @\n @@\n ____ @\n / __ \\ @\n / / _` |@\n | | (_| |@\n \\ \\__,_|@\n \\____/ @@\n _ @\n / \\ @\n / _ \\ @\n / ___ \\ @\n /_/ \\_\\@\n @@\n ____ @\n | __ ) @\n | _ \\ @\n | |_) |@\n |____/ @\n @@\n ____ @\n / ___|@\n | | @\n | |___ @\n \\____|@\n @@\n ____ @\n | _ \\ @\n | | | |@\n | |_| |@\n |____/ @\n @@\n _____ @\n | ____|@\n | _| @\n | |___ @\n |_____|@\n @@\n _____ @\n | ___|@\n | |_ @\n | _| @\n |_| @\n @@\n ____ @\n / ___|@\n | | _ @\n | |_| |@\n \\____|@\n @@\n _ _ @\n | | | |@\n | |_| |@\n | _ |@\n |_| |_|@\n @@\n ___ @\n |_ _|@\n | | @\n | | @\n |___|@\n @@\n _ @\n | |@\n _ | |@\n | |_| |@\n \\___/ @\n @@\n _ __@\n | |/ /@\n | ' / @\n | . \\ @\n |_|\\_\\@\n @@\n _ @\n | | @\n | | @\n | |___ @\n |_____|@\n @@\n __ __ @\n | \\/ |@\n | |\\/| |@\n | | | |@\n |_| |_|@\n @@\n _ _ @\n | \\ | |@\n | \\| |@\n | |\\ |@\n |_| \\_|@\n @@\n ___ @\n / _ \\ @\n | | | |@\n | |_| |@\n \\___/ @\n @@\n ____ @\n | _ \\ @\n | |_) |@\n | __/ @\n |_| @\n @@\n ___ @\n / _ \\ @\n | | | |@\n | |_| |@\n \\__\\_\\@\n @@\n ____ @\n | _ \\ @\n | |_) |@\n | _ < @\n |_| \\_\\@\n @@\n ____ @\n / ___| @\n \\___ \\ @\n ___) |@\n |____/ @\n @@\n _____ @\n |_ _|@\n | | @\n | | @\n |_| @\n @@\n _ _ @\n | | | |@\n | | | |@\n | |_| |@\n \\___/ @\n @@\n __ __@\n \\ \\ / /@\n \\ \\ / / @\n \\ V / @\n \\_/ @\n @@\n __ __@\n \\ \\ / /@\n \\ \\ /\\ / / @\n \\ V V / @\n \\_/\\_/ @\n @@\n __ __@\n \\ \\/ /@\n \\ / @\n / \\ @\n /_/\\_\\@\n @@\n __ __@\n \\ \\ / /@\n \\ V / @\n | | @\n |_| @\n @@\n _____@\n |__ /@\n / / @\n / /_ @\n /____|@\n @@\n __ @\n | _|@\n | | @\n | | @\n | | @\n |__|@@\n __ @\n \\ \\ @\n \\ \\ @\n \\ \\ @\n \\_\\@\n @@\n __ @\n |_ |@\n | |@\n | |@\n | |@\n |__|@@\n /\\ @\n |/\\|@\n $ @\n $ @\n $ @\n @@\n @\n @\n @\n @\n _____ @\n |_____|@@\n _ @\n ( )@\n \\|@\n $ @\n $ @\n @@\n @\n __ _ @\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n _ @\n | |__ @\n | '_ \\ @\n | |_) |@\n |_.__/ @\n @@\n @\n ___ @\n / __|@\n | (__ @\n \\___|@\n @@\n _ @\n __| |@\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n @\n ___ @\n / _ \\@\n | __/@\n \\___|@\n @@\n __ @\n / _|@\n | |_ @\n | _|@\n |_| @\n @@\n @\n __ _ @\n / _` |@\n | (_| |@\n \\__, |@\n |___/ @@\n _ @\n | |__ @\n | '_ \\ @\n | | | |@\n |_| |_|@\n @@\n _ @\n (_)@\n | |@\n | |@\n |_|@\n @@\n _ @\n (_)@\n | |@\n | |@\n _/ |@\n |__/ @@\n _ @\n | | __@\n | |/ /@\n | < @\n |_|\\_\\@\n @@\n _ @\n | |@\n | |@\n | |@\n |_|@\n @@\n @\n _ __ ___ @\n | '_ ` _ \\ @\n | | | | | |@\n |_| |_| |_|@\n @@\n @\n _ __ @\n | '_ \\ @\n | | | |@\n |_| |_|@\n @@\n @\n ___ @\n / _ \\ @\n | (_) |@\n \\___/ @\n @@\n @\n _ __ @\n | '_ \\ @\n | |_) |@\n | .__/ @\n |_| @@\n @\n __ _ @\n / _` |@\n | (_| |@\n \\__, |@\n |_|@@\n @\n _ __ @\n | '__|@\n | | @\n |_| @\n @@\n @\n ___ @\n / __|@\n \\__ \\@\n |___/@\n @@\n _ @\n | |_ @\n | __|@\n | |_ @\n \\__|@\n @@\n @\n _ _ @\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n @\n __ __@\n \\ \\ / /@\n \\ V / @\n \\_/ @\n @@\n @\n __ __@\n \\ \\ /\\ / /@\n \\ V V / @\n \\_/\\_/ @\n @@\n @\n __ __@\n \\ \\/ /@\n > < @\n /_/\\_\\@\n @@\n @\n _ _ @\n | | | |@\n | |_| |@\n \\__, |@\n |___/ @@\n @\n ____@\n |_ /@\n / / @\n /___|@\n @@\n __@\n / /@\n | | @\n < < @\n | | @\n \\_\\@@\n _ @\n | |@\n | |@\n | |@\n | |@\n |_|@@\n __ @\n \\ \\ @\n | | @\n > >@\n | | @\n /_/ @@\n /\\/|@\n |/\\/ @\n $ @\n $ @\n $ @\n @@\n _ _ @\n (_)_(_)@\n /_\\ @\n / _ \\ @\n /_/ \\_\\@\n @@\n _ _ @\n (_)_(_)@\n / _ \\ @\n | |_| |@\n \\___/ @\n @@\n _ _ @\n (_) (_)@\n | | | |@\n | |_| |@\n \\___/ @\n @@\n _ _ @\n (_)_(_)@\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n _ _ @\n (_)_(_)@\n / _ \\ @\n | (_) |@\n \\___/ @\n @@\n _ _ @\n (_) (_)@\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n ___ @\n / _ \\@\n | |/ /@\n | |\\ \\@\n | ||_/@\n |_| @@\n160 NO-BREAK SPACE\n $@\n $@\n $@\n $@\n $@\n $@@\n161 INVERTED EXCLAMATION MARK\n _ @\n (_)@\n | |@\n | |@\n |_|@\n @@\n162 CENT SIGN\n _ @\n | | @\n / __)@\n | (__ @\n \\ )@\n |_| @@\n163 POUND SIGN\n ___ @\n / ,_\\ @\n _| |_ @\n | |___ @\n (_,____|@\n @@\n164 CURRENCY SIGN\n /\\___/\\@\n \\ _ /@\n | (_) |@\n / ___ \\@\n \\/ \\/@\n @@\n165 YEN SIGN\n __ __ @\n \\ V / @\n |__ __|@\n |__ __|@\n |_| @\n @@\n166 BROKEN BAR\n _ @\n | |@\n |_|@\n _ @\n | |@\n |_|@@\n167 SECTION SIGN\n __ @\n _/ _)@\n / \\ \\ @\n \\ \\\\ \\@\n \\ \\_/@\n (__/ @@\n168 DIAERESIS\n _ _ @\n (_) (_)@\n $ $ @\n $ $ @\n $ $ @\n @@\n169 COPYRIGHT SIGN\n _____ @\n / ___ \\ @\n / / __| \\ @\n | | (__ |@\n \\ \\___| / @\n \\_____/ @@\n170 FEMININE ORDINAL INDICATOR\n __ _ @\n / _` |@\n \\__,_|@\n |____|@\n $ @\n @@\n171 LEFT-POINTING DOUBLE ANGLE QUOTATION MARK\n ____@\n / / /@\n / / / @\n \\ \\ \\ @\n \\_\\_\\@\n @@\n172 NOT SIGN\n @\n _____ @\n |___ |@\n |_|@\n $ @\n @@\n173 SOFT HYPHEN\n @\n @\n ____ @\n |____|@\n $ @\n @@\n174 REGISTERED SIGN\n _____ @\n / ___ \\ @\n / | _ \\ \\ @\n | | / |@\n \\ |_|_\\ / @\n \\_____/ @@\n175 MACRON\n _____ @\n |_____|@\n $ @\n $ @\n $ @\n @@\n176 DEGREE SIGN\n __ @\n / \\ @\n | () |@\n \\__/ @\n $ @\n @@\n177 PLUS-MINUS SIGN\n _ @\n _| |_ @\n |_ _|@\n _|_|_ @\n |_____|@\n @@\n178 SUPERSCRIPT TWO\n ___ @\n |_ )@\n / / @\n /___|@\n $ @\n @@\n179 SUPERSCRIPT THREE\n ____@\n |__ /@\n |_ \\@\n |___/@\n $ @\n @@\n180 ACUTE ACCENT\n __@\n /_/@\n $ @\n $ @\n $ @\n @@\n181 MICRO SIGN\n @\n _ _ @\n | | | |@\n | |_| |@\n | ._,_|@\n |_| @@\n182 PILCROW SIGN\n _____ @\n / |@\n | (| | |@\n \\__ | |@\n |_|_|@\n @@\n183 MIDDLE DOT\n @\n _ @\n (_)@\n $ @\n $ @\n @@\n184 CEDILLA\n @\n @\n @\n @\n _ @\n )_)@@\n185 SUPERSCRIPT ONE\n _ @\n / |@\n | |@\n |_|@\n $ @\n @@\n186 MASCULINE ORDINAL INDICATOR\n ___ @\n / _ \\@\n \\___/@\n |___|@\n $ @\n @@\n187 RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK\n ____ @\n \\ \\ \\ @\n \\ \\ \\@\n / / /@\n /_/_/ @\n @@\n188 VULGAR FRACTION ONE QUARTER\n _ __ @\n / | / / _ @\n | |/ / | | @\n |_/ /|_ _|@\n /_/ |_| @\n @@\n189 VULGAR FRACTION ONE HALF\n _ __ @\n / | / /__ @\n | |/ /_ )@\n |_/ / / / @\n /_/ /___|@\n @@\n190 VULGAR FRACTION THREE QUARTERS\n ____ __ @\n |__ / / / _ @\n |_ \\/ / | | @\n |___/ /|_ _|@\n /_/ |_| @\n @@\n191 INVERTED QUESTION MARK\n _ @\n (_) @\n | | @\n / /_ @\n \\___|@\n @@\n192 LATIN CAPITAL LETTER A WITH GRAVE\n __ @\n \\_\\ @\n /_\\ @\n / _ \\ @\n /_/ \\_\\@\n @@\n193 LATIN CAPITAL LETTER A WITH ACUTE\n __ @\n /_/ @\n /_\\ @\n / _ \\ @\n /_/ \\_\\@\n @@\n194 LATIN CAPITAL LETTER A WITH CIRCUMFLEX\n //\\ @\n |/_\\| @\n /_\\ @\n / _ \\ @\n /_/ \\_\\@\n @@\n195 LATIN CAPITAL LETTER A WITH TILDE\n /\\/| @\n |/\\/ @\n /_\\ @\n / _ \\ @\n /_/ \\_\\@\n @@\n196 LATIN CAPITAL LETTER A WITH DIAERESIS\n _ _ @\n (_)_(_)@\n /_\\ @\n / _ \\ @\n /_/ \\_\\@\n @@\n197 LATIN CAPITAL LETTER A WITH RING ABOVE\n _ @\n (o) @\n /_\\ @\n / _ \\ @\n /_/ \\_\\@\n @@\n198 LATIN CAPITAL LETTER AE\n ______ @\n / ____|@\n / _ _| @\n / __ |___ @\n /_/ |_____|@\n @@\n199 LATIN CAPITAL LETTER C WITH CEDILLA\n ____ @\n / ___|@\n | | @\n | |___ @\n \\____|@\n )_) @@\n200 LATIN CAPITAL LETTER E WITH GRAVE\n __ @\n _\\_\\_ @\n | ____|@\n | _|_ @\n |_____|@\n @@\n201 LATIN CAPITAL LETTER E WITH ACUTE\n __ @\n _/_/_ @\n | ____|@\n | _|_ @\n |_____|@\n @@\n202 LATIN CAPITAL LETTER E WITH CIRCUMFLEX\n //\\ @\n |/_\\| @\n | ____|@\n | _|_ @\n |_____|@\n @@\n203 LATIN CAPITAL LETTER E WITH DIAERESIS\n _ _ @\n (_)_(_)@\n | ____|@\n | _|_ @\n |_____|@\n @@\n204 LATIN CAPITAL LETTER I WITH GRAVE\n __ @\n \\_\\ @\n |_ _|@\n | | @\n |___|@\n @@\n205 LATIN CAPITAL LETTER I WITH ACUTE\n __ @\n /_/ @\n |_ _|@\n | | @\n |___|@\n @@\n206 LATIN CAPITAL LETTER I WITH CIRCUMFLEX\n //\\ @\n |/_\\|@\n |_ _|@\n | | @\n |___|@\n @@\n207 LATIN CAPITAL LETTER I WITH DIAERESIS\n _ _ @\n (_)_(_)@\n |_ _| @\n | | @\n |___| @\n @@\n208 LATIN CAPITAL LETTER ETH\n ____ @\n | _ \\ @\n _| |_| |@\n |__ __| |@\n |____/ @\n @@\n209 LATIN CAPITAL LETTER N WITH TILDE\n /\\/|@\n |/\\/ @\n | \\| |@\n | .` |@\n |_|\\_|@\n @@\n210 LATIN CAPITAL LETTER O WITH GRAVE\n __ @\n \\_\\ @\n / _ \\ @\n | |_| |@\n \\___/ @\n @@\n211 LATIN CAPITAL LETTER O WITH ACUTE\n __ @\n /_/ @\n / _ \\ @\n | |_| |@\n \\___/ @\n @@\n212 LATIN CAPITAL LETTER O WITH CIRCUMFLEX\n //\\ @\n |/_\\| @\n / _ \\ @\n | |_| |@\n \\___/ @\n @@\n213 LATIN CAPITAL LETTER O WITH TILDE\n /\\/| @\n |/\\/ @\n / _ \\ @\n | |_| |@\n \\___/ @\n @@\n214 LATIN CAPITAL LETTER O WITH DIAERESIS\n _ _ @\n (_)_(_)@\n / _ \\ @\n | |_| |@\n \\___/ @\n @@\n215 MULTIPLICATION SIGN\n @\n @\n /\\/\\@\n > <@\n \\/\\/@\n @@\n216 LATIN CAPITAL LETTER O WITH STROKE\n ____ @\n / _// @\n | |// |@\n | //| |@\n //__/ @\n @@\n217 LATIN CAPITAL LETTER U WITH GRAVE\n __ @\n _\\_\\_ @\n | | | |@\n | |_| |@\n \\___/ @\n @@\n218 LATIN CAPITAL LETTER U WITH ACUTE\n __ @\n _/_/_ @\n | | | |@\n | |_| |@\n \\___/ @\n @@\n219 LATIN CAPITAL LETTER U WITH CIRCUMFLEX\n //\\ @\n |/ \\| @\n | | | |@\n | |_| |@\n \\___/ @\n @@\n220 LATIN CAPITAL LETTER U WITH DIAERESIS\n _ _ @\n (_) (_)@\n | | | |@\n | |_| |@\n \\___/ @\n @@\n221 LATIN CAPITAL LETTER Y WITH ACUTE\n __ @\n __/_/__@\n \\ \\ / /@\n \\ V / @\n |_| @\n @@\n222 LATIN CAPITAL LETTER THORN\n _ @\n | |___ @\n | __ \\@\n | ___/@\n |_| @\n @@\n223 LATIN SMALL LETTER SHARP S\n ___ @\n / _ \\@\n | |/ /@\n | |\\ \\@\n | ||_/@\n |_| @@\n224 LATIN SMALL LETTER A WITH GRAVE\n __ @\n \\_\\_ @\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n225 LATIN SMALL LETTER A WITH ACUTE\n __ @\n /_/_ @\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n226 LATIN SMALL LETTER A WITH CIRCUMFLEX\n //\\ @\n |/_\\| @\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n227 LATIN SMALL LETTER A WITH TILDE\n /\\/| @\n |/\\/_ @\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n228 LATIN SMALL LETTER A WITH DIAERESIS\n _ _ @\n (_)_(_)@\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n229 LATIN SMALL LETTER A WITH RING ABOVE\n __ @\n (()) @\n / _ '|@\n | (_| |@\n \\__,_|@\n @@\n230 LATIN SMALL LETTER AE\n @\n __ ____ @\n / _` _ \\@\n | (_| __/@\n \\__,____|@\n @@\n231 LATIN SMALL LETTER C WITH CEDILLA\n @\n ___ @\n / __|@\n | (__ @\n \\___|@\n )_) @@\n232 LATIN SMALL LETTER E WITH GRAVE\n __ @\n \\_\\ @\n / _ \\@\n | __/@\n \\___|@\n @@\n233 LATIN SMALL LETTER E WITH ACUTE\n __ @\n /_/ @\n / _ \\@\n | __/@\n \\___|@\n @@\n234 LATIN SMALL LETTER E WITH CIRCUMFLEX\n //\\ @\n |/_\\|@\n / _ \\@\n | __/@\n \\___|@\n @@\n235 LATIN SMALL LETTER E WITH DIAERESIS\n _ _ @\n (_)_(_)@\n / _ \\ @\n | __/ @\n \\___| @\n @@\n236 LATIN SMALL LETTER I WITH GRAVE\n __ @\n \\_\\@\n | |@\n | |@\n |_|@\n @@\n237 LATIN SMALL LETTER I WITH ACUTE\n __@\n /_/@\n | |@\n | |@\n |_|@\n @@\n238 LATIN SMALL LETTER I WITH CIRCUMFLEX\n //\\ @\n |/_\\|@\n | | @\n | | @\n |_| @\n @@\n239 LATIN SMALL LETTER I WITH DIAERESIS\n _ _ @\n (_)_(_)@\n | | @\n | | @\n |_| @\n @@\n240 LATIN SMALL LETTER ETH\n /\\/\\ @\n > < @\n _\\/\\ |@\n / __` |@\n \\____/ @\n @@\n241 LATIN SMALL LETTER N WITH TILDE\n /\\/| @\n |/\\/ @\n | '_ \\ @\n | | | |@\n |_| |_|@\n @@\n242 LATIN SMALL LETTER O WITH GRAVE\n __ @\n \\_\\ @\n / _ \\ @\n | (_) |@\n \\___/ @\n @@\n243 LATIN SMALL LETTER O WITH ACUTE\n __ @\n /_/ @\n / _ \\ @\n | (_) |@\n \\___/ @\n @@\n244 LATIN SMALL LETTER O WITH CIRCUMFLEX\n //\\ @\n |/_\\| @\n / _ \\ @\n | (_) |@\n \\___/ @\n @@\n245 LATIN SMALL LETTER O WITH TILDE\n /\\/| @\n |/\\/ @\n / _ \\ @\n | (_) |@\n \\___/ @\n @@\n246 LATIN SMALL LETTER O WITH DIAERESIS\n _ _ @\n (_)_(_)@\n / _ \\ @\n | (_) |@\n \\___/ @\n @@\n247 DIVISION SIGN\n @\n _ @\n _(_)_ @\n |_____|@\n (_) @\n @@\n248 LATIN SMALL LETTER O WITH STROKE\n @\n ____ @\n / _//\\ @\n | (//) |@\n \\//__/ @\n @@\n249 LATIN SMALL LETTER U WITH GRAVE\n __ @\n _\\_\\_ @\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n250 LATIN SMALL LETTER U WITH ACUTE\n __ @\n _/_/_ @\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n251 LATIN SMALL LETTER U WITH CIRCUMFLEX\n //\\ @\n |/ \\| @\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n252 LATIN SMALL LETTER U WITH DIAERESIS\n _ _ @\n (_) (_)@\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n253 LATIN SMALL LETTER Y WITH ACUTE\n __ @\n _/_/_ @\n | | | |@\n | |_| |@\n \\__, |@\n |___/ @@\n254 LATIN SMALL LETTER THORN\n _ @\n | |__ @\n | '_ \\ @\n | |_) |@\n | .__/ @\n |_| @@\n255 LATIN SMALL LETTER Y WITH DIAERESIS\n _ _ @\n (_) (_)@\n | | | |@\n | |_| |@\n \\__, |@\n |___/ @@\n0x0100 LATIN CAPITAL LETTER A WITH MACRON\n ____ @\n /___/ @\n /_\\ @\n / _ \\ @\n /_/ \\_\\@\n @@\n0x0101 LATIN SMALL LETTER A WITH MACRON\n ___ @\n /_ _/@\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n0x0102 LATIN CAPITAL LETTER A WITH BREVE\n _ _ @\n \\\\_// @\n /_\\ @\n / _ \\ @\n /_/ \\_\\@\n @@\n0x0103 LATIN SMALL LETTER A WITH BREVE\n \\_/ @\n ___ @\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n0x0104 LATIN CAPITAL LETTER A WITH OGONEK\n @\n _ @\n /_\\ @\n / _ \\ @\n /_/ \\_\\@\n (_(@@\n0x0105 LATIN SMALL LETTER A WITH OGONEK\n @\n __ _ @\n / _` |@\n | (_| |@\n \\__,_|@\n (_(@@\n0x0106 LATIN CAPITAL LETTER C WITH ACUTE\n __ @\n _/_/ @\n / ___|@\n | |___ @\n \\____|@\n @@\n0x0107 LATIN SMALL LETTER C WITH ACUTE\n __ @\n /__/@\n / __|@\n | (__ @\n \\___|@\n @@\n0x0108 LATIN CAPITAL LETTER C WITH CIRCUMFLEX\n /\\ @\n _//\\\\@\n / ___|@\n | |___ @\n \\____|@\n @@\n0x0109 LATIN SMALL LETTER C WITH CIRCUMFLEX\n /\\ @\n /_\\ @\n / __|@\n | (__ @\n \\___|@\n @@\n0x010A LATIN CAPITAL LETTER C WITH DOT ABOVE\n [] @\n ____ @\n / ___|@\n | |___ @\n \\____|@\n @@\n0x010B LATIN SMALL LETTER C WITH DOT ABOVE\n [] @\n ___ @\n / __|@\n | (__ @\n \\___|@\n @@\n0x010C LATIN CAPITAL LETTER C WITH CARON\n \\\\// @\n _\\/_ @\n / ___|@\n | |___ @\n \\____|@\n @@\n0x010D LATIN SMALL LETTER C WITH CARON\n \\\\//@\n _\\/ @\n / __|@\n | (__ @\n \\___|@\n @@\n0x010E LATIN CAPITAL LETTER D WITH CARON\n \\\\// @\n __\\/ @\n | _ \\ @\n | |_| |@\n |____/ @\n @@\n0x010F LATIN SMALL LETTER D WITH CARON\n \\/ _ @\n __| |@\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n0x0110 LATIN CAPITAL LETTER D WITH STROKE\n ____ @\n |_ __ \\ @\n /| |/ | |@\n /|_|/_| |@\n |_____/ @\n @@\n0x0111 LATIN SMALL LETTER D WITH STROKE\n ---|@\n __| |@\n / _` |@\n | (_| |@\n \\__,_|@\n @@\n0x0112 LATIN CAPITAL LETTER E WITH MACRON\n ____ @\n /___/ @\n | ____|@\n | _|_ @\n |_____|@\n @@\n0x0113 LATIN SMALL LETTER E WITH MACRON\n ____@\n /_ _/@\n / _ \\ @\n | __/ @\n \\___| @\n @@\n0x0114 LATIN CAPITAL LETTER E WITH BREVE\n _ _ @\n \\\\_// @\n | ____|@\n | _|_ @\n |_____|@\n @@\n0x0115 LATIN SMALL LETTER E WITH BREVE\n \\\\ //@\n -- @\n / _ \\ @\n | __/ @\n \\___| @\n @@\n0x0116 LATIN CAPITAL LETTER E WITH DOT ABOVE\n [] @\n _____ @\n | ____|@\n | _|_ @\n |_____|@\n @@\n0x0117 LATIN SMALL LETTER E WITH DOT ABOVE\n [] @\n __ @\n / _ \\@\n | __/@\n \\___|@\n @@\n0x0118 LATIN CAPITAL LETTER E WITH OGONEK\n @\n _____ @\n | ____|@\n | _|_ @\n |_____|@\n (__(@@\n0x0119 LATIN SMALL LETTER E WITH OGONEK\n @\n ___ @\n / _ \\@\n | __/@\n \\___|@\n (_(@@\n0x011A LATIN CAPITAL LETTER E WITH CARON\n \\\\// @\n __\\/_ @\n | ____|@\n | _|_ @\n |_____|@\n @@\n0x011B LATIN SMALL LETTER E WITH CARON\n \\\\//@\n \\/ @\n / _ \\@\n | __/@\n \\___|@\n @@\n0x011C LATIN CAPITAL LETTER G WITH CIRCUMFLEX\n _/\\_ @\n / ___|@\n | | _ @\n | |_| |@\n \\____|@\n @@\n0x011D LATIN SMALL LETTER G WITH CIRCUMFLEX\n /\\ @\n _/_ \\@\n / _` |@\n | (_| |@\n \\__, |@\n |___/ @@\n0x011E LATIN CAPITAL LETTER G WITH BREVE\n _\\/_ @\n / ___|@\n | | _ @\n | |_| |@\n \\____|@\n @@\n0x011F LATIN SMALL LETTER G WITH BREVE\n \\___/ @\n __ _ @\n / _` |@\n | (_| |@\n \\__, |@\n |___/ @@\n0x0120 LATIN CAPITAL LETTER G WITH DOT ABOVE\n _[]_ @\n / ___|@\n | | _ @\n | |_| |@\n \\____|@\n @@\n0x0121 LATIN SMALL LETTER G WITH DOT ABOVE\n [] @\n __ _ @\n / _` |@\n | (_| |@\n \\__, |@\n |___/ @@\n0x0122 LATIN CAPITAL LETTER G WITH CEDILLA\n ____ @\n / ___|@\n | | _ @\n | |_| |@\n \\____|@\n )__) @@\n0x0123 LATIN SMALL LETTER G WITH CEDILLA\n @\n __ _ @\n / _` |@\n | (_| |@\n \\__, |@\n |_))))@@\n0x0124 LATIN CAPITAL LETTER H WITH CIRCUMFLEX\n _/ \\_ @\n | / \\ |@\n | |_| |@\n | _ |@\n |_| |_|@\n @@\n0x0125 LATIN SMALL LETTER H WITH CIRCUMFLEX\n _ /\\ @\n | |//\\ @\n | '_ \\ @\n | | | |@\n |_| |_|@\n @@\n0x0126 LATIN CAPITAL LETTER H WITH STROKE\n _ _ @\n | |=| |@\n | |_| |@\n | _ |@\n |_| |_|@\n @@\n0x0127 LATIN SMALL LETTER H WITH STROKE\n _ @\n |=|__ @\n | '_ \\ @\n | | | |@\n |_| |_|@\n @@\n0x0128 LATIN CAPITAL LETTER I WITH TILDE\n /\\//@\n |_ _|@\n | | @\n | | @\n |___|@\n @@\n0x0129 LATIN SMALL LETTER I WITH TILDE\n @\n /\\/@\n | |@\n | |@\n |_|@\n @@\n0x012A LATIN CAPITAL LETTER I WITH MACRON\n /___/@\n |_ _|@\n | | @\n | | @\n |___|@\n @@\n0x012B LATIN SMALL LETTER I WITH MACRON\n ____@\n /___/@\n | | @\n | | @\n |_| @\n @@\n0x012C LATIN CAPITAL LETTER I WITH BREVE\n \\__/@\n |_ _|@\n | | @\n | | @\n |___|@\n @@\n0x012D LATIN SMALL LETTER I WITH BREVE\n @\n \\_/@\n | |@\n | |@\n |_|@\n @@\n0x012E LATIN CAPITAL LETTER I WITH OGONEK\n ___ @\n |_ _|@\n | | @\n | | @\n |___|@\n (__(@@\n0x012F LATIN SMALL LETTER I WITH OGONEK\n _ @\n (_) @\n | | @\n | | @\n |_|_@\n (_(@@\n0x0130 LATIN CAPITAL LETTER I WITH DOT ABOVE\n _[] @\n |_ _|@\n | | @\n | | @\n |___|@\n @@\n0x0131 LATIN SMALL LETTER DOTLESS I\n @\n _ @\n | |@\n | |@\n |_|@\n @@\n0x0132 LATIN CAPITAL LIGATURE IJ\n ___ _ @\n |_ _|| |@\n | | | |@\n | |_| |@\n |__|__/ @\n @@\n0x0133 LATIN SMALL LIGATURE IJ\n _ _ @\n (_) (_)@\n | | | |@\n | | | |@\n |_|_/ |@\n |__/ @@\n0x0134 LATIN CAPITAL LETTER J WITH CIRCUMFLEX\n /\\ @\n /_\\|@\n _ | | @\n | |_| | @\n \\___/ @\n @@\n0x0135 LATIN SMALL LETTER J WITH CIRCUMFLEX\n /\\@\n /_\\@\n | |@\n | |@\n _/ |@\n |__/ @@\n0x0136 LATIN CAPITAL LETTER K WITH CEDILLA\n _ _ @\n | |/ / @\n | ' / @\n | . \\ @\n |_|\\_\\ @\n )__)@@\n0x0137 LATIN SMALL LETTER K WITH CEDILLA\n _ @\n | | __@\n | |/ /@\n | < @\n |_|\\_\\@\n )_)@@\n0x0138 LATIN SMALL LETTER KRA\n @\n _ __ @\n | |/ \\@\n | < @\n |_|\\_\\@\n @@\n0x0139 LATIN CAPITAL LETTER L WITH ACUTE\n _ //@\n | | // @\n | | @\n | |___ @\n |_____|@\n @@\n0x013A LATIN SMALL LETTER L WITH ACUTE\n //@\n | |@\n | |@\n | |@\n |_|@\n @@\n0x013B LATIN CAPITAL LETTER L WITH CEDILLA\n _ @\n | | @\n | | @\n | |___ @\n |_____|@\n )__)@@\n0x013C LATIN SMALL LETTER L WITH CEDILLA\n _ @\n | | @\n | | @\n | | @\n |_| @\n )_)@@\n0x013D LATIN CAPITAL LETTER L WITH CARON\n _ \\\\//@\n | | \\/ @\n | | @\n | |___ @\n |_____|@\n @@\n0x013E LATIN SMALL LETTER L WITH CARON\n _ \\\\//@\n | | \\/ @\n | | @\n | | @\n |_| @\n @@\n0x013F LATIN CAPITAL LETTER L WITH MIDDLE DOT\n _ @\n | | @\n | | [] @\n | |___ @\n |_____|@\n @@\n0x0140 LATIN SMALL LETTER L WITH MIDDLE DOT\n _ @\n | | @\n | | []@\n | | @\n |_| @\n @@\n0x0141 LATIN CAPITAL LETTER L WITH STROKE\n __ @\n | // @\n |//| @\n // |__ @\n |_____|@\n @@\n0x0142 LATIN SMALL LETTER L WITH STROKE\n _ @\n | |@\n |//@\n //|@\n |_|@\n @@\n0x0143 LATIN CAPITAL LETTER N WITH ACUTE\n _/ /_ @\n | \\ | |@\n | \\| |@\n | |\\ |@\n |_| \\_|@\n @@\n0x0144 LATIN SMALL LETTER N WITH ACUTE\n _ @\n _ /_/ @\n | '_ \\ @\n | | | |@\n |_| |_|@\n @@\n0x0145 LATIN CAPITAL LETTER N WITH CEDILLA\n _ _ @\n | \\ | |@\n | \\| |@\n | |\\ |@\n |_| \\_|@\n )_) @@\n0x0146 LATIN SMALL LETTER N WITH CEDILLA\n @\n _ __ @\n | '_ \\ @\n | | | |@\n |_| |_|@\n )_) @@\n0x0147 LATIN CAPITAL LETTER N WITH CARON\n _\\/ _ @\n | \\ | |@\n | \\| |@\n | |\\ |@\n |_| \\_|@\n @@\n0x0148 LATIN SMALL LETTER N WITH CARON\n \\\\// @\n _\\/_ @\n | '_ \\ @\n | | | |@\n |_| |_|@\n @@\n0x0149 LATIN SMALL LETTER N PRECEDED BY APOSTROPHE\n @\n _ __ @\n ( )| '_\\ @\n |/| | | |@\n |_| |_|@\n @@\n0x014A LATIN CAPITAL LETTER ENG\n _ _ @\n | \\ | |@\n | \\| |@\n | |\\ |@\n |_| \\ |@\n )_)@@\n0x014B LATIN SMALL LETTER ENG\n _ __ @\n | '_ \\ @\n | | | |@\n |_| | |@\n | |@\n |__ @@\n0x014C LATIN CAPITAL LETTER O WITH MACRON\n ____ @\n /_ _/ @\n / _ \\ @\n | (_) |@\n \\___/ @\n @@\n0x014D LATIN SMALL LETTER O WITH MACRON\n ____ @\n /_ _/ @\n / _ \\ @\n | (_) |@\n \\___/ @\n @@\n0x014E LATIN CAPITAL LETTER O WITH BREVE\n \\ / @\n _-_ @\n / _ \\ @\n | |_| |@\n \\___/ @\n @@\n0x014F LATIN SMALL LETTER O WITH BREVE\n \\ / @\n _-_ @\n / _ \\ @\n | |_| |@\n \\___/ @\n @@\n0x0150 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE\n ___ @\n /_/_/@\n / _ \\ @\n | |_| |@\n \\___/ @\n @@\n0x0151 LATIN SMALL LETTER O WITH DOUBLE ACUTE\n ___ @\n /_/_/@\n / _ \\ @\n | |_| |@\n \\___/ @\n @@\n0x0152 LATIN CAPITAL LIGATURE OE\n ___ ___ @\n / _ \\| __|@\n | | | | | @\n | |_| | |__@\n \\___/|____@\n @@\n0x0153 LATIN SMALL LIGATURE OE\n @\n ___ ___ @\n / _ \\ / _ \\@\n | (_) | __/@\n \\___/ \\___|@\n @@\n0x0154 LATIN CAPITAL LETTER R WITH ACUTE\n _/_/ @\n | _ \\ @\n | |_) |@\n | _ < @\n |_| \\_\\@\n @@\n0x0155 LATIN SMALL LETTER R WITH ACUTE\n __@\n _ /_/@\n | '__|@\n | | @\n |_| @\n @@\n0x0156 LATIN CAPITAL LETTER R WITH CEDILLA\n ____ @\n | _ \\ @\n | |_) |@\n | _ < @\n |_| \\_\\@\n )_) @@\n0x0157 LATIN SMALL LETTER R WITH CEDILLA\n @\n _ __ @\n | '__|@\n | | @\n |_| @\n )_) @@\n0x0158 LATIN CAPITAL LETTER R WITH CARON\n _\\_/ @\n | _ \\ @\n | |_) |@\n | _ < @\n |_| \\_\\@\n @@\n0x0159 LATIN SMALL LETTER R WITH CARON\n \\\\// @\n _\\/_ @\n | '__|@\n | | @\n |_| @\n @@\n0x015A LATIN CAPITAL LETTER S WITH ACUTE\n _/_/ @\n / ___| @\n \\___ \\ @\n ___) |@\n |____/ @\n @@\n0x015B LATIN SMALL LETTER S WITH ACUTE\n __@\n _/_/@\n / __|@\n \\__ \\@\n |___/@\n @@\n0x015C LATIN CAPITAL LETTER S WITH CIRCUMFLEX\n _/\\_ @\n / ___| @\n \\___ \\ @\n ___) |@\n |____/ @\n @@\n0x015D LATIN SMALL LETTER S WITH CIRCUMFLEX\n @\n /_\\_@\n / __|@\n \\__ \\@\n |___/@\n @@\n0x015E LATIN CAPITAL LETTER S WITH CEDILLA\n ____ @\n / ___| @\n \\___ \\ @\n ___) |@\n |____/ @\n )__)@@\n0x015F LATIN SMALL LETTER S WITH CEDILLA\n @\n ___ @\n / __|@\n \\__ \\@\n |___/@\n )_)@@\n0x0160 LATIN CAPITAL LETTER S WITH CARON\n _\\_/ @\n / ___| @\n \\___ \\ @\n ___) |@\n |____/ @\n @@\n0x0161 LATIN SMALL LETTER S WITH CARON\n \\\\//@\n _\\/ @\n / __|@\n \\__ \\@\n |___/@\n @@\n0x0162 LATIN CAPITAL LETTER T WITH CEDILLA\n _____ @\n |_ _|@\n | | @\n | | @\n |_| @\n )__)@@\n0x0163 LATIN SMALL LETTER T WITH CEDILLA\n _ @\n | |_ @\n | __|@\n | |_ @\n \\__|@\n )_)@@\n0x0164 LATIN CAPITAL LETTER T WITH CARON\n _____ @\n |_ _|@\n | | @\n | | @\n |_| @\n @@\n0x0165 LATIN SMALL LETTER T WITH CARON\n \\/ @\n | |_ @\n | __|@\n | |_ @\n \\__|@\n @@\n0x0166 LATIN CAPITAL LETTER T WITH STROKE\n _____ @\n |_ _|@\n | | @\n -|-|- @\n |_| @\n @@\n0x0167 LATIN SMALL LETTER T WITH STROKE\n _ @\n | |_ @\n | __|@\n |-|_ @\n \\__|@\n @@\n0x0168 LATIN CAPITAL LETTER U WITH TILDE\n @\n _/\\/_ @\n | | | |@\n | |_| |@\n \\___/ @\n @@\n0x0169 LATIN SMALL LETTER U WITH TILDE\n @\n _/\\/_ @\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n0x016A LATIN CAPITAL LETTER U WITH MACRON\n ____ @\n /__ _/@\n | | | |@\n | |_| |@\n \\___/ @\n @@\n0x016B LATIN SMALL LETTER U WITH MACRON\n ____ @\n / _ /@\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n0x016C LATIN CAPITAL LETTER U WITH BREVE\n @\n \\_/_ @\n | | | |@\n | |_| |@\n \\____|@\n @@\n0x016D LATIN SMALL LETTER U WITH BREVE\n @\n \\_/_ @\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n0x016E LATIN CAPITAL LETTER U WITH RING ABOVE\n O @\n __ _ @\n | | | |@\n | |_| |@\n \\___/ @\n @@\n0x016F LATIN SMALL LETTER U WITH RING ABOVE\n O @\n __ __ @\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n0x0170 LATIN CAPITAL LETTER U WITH DOUBLE ACUTE\n -- --@\n /_//_/@\n | | | |@\n | |_| |@\n \\___/ @\n @@\n0x0171 LATIN SMALL LETTER U WITH DOUBLE ACUTE\n ____@\n _/_/_/@\n | | | |@\n | |_| |@\n \\__,_|@\n @@\n0x0172 LATIN CAPITAL LETTER U WITH OGONEK\n _ _ @\n | | | |@\n | | | |@\n | |_| |@\n \\___/ @\n (__(@@\n0x0173 LATIN SMALL LETTER U WITH OGONEK\n @\n _ _ @\n | | | |@\n | |_| |@\n \\__,_|@\n (_(@@\n0x0174 LATIN CAPITAL LETTER W WITH CIRCUMFLEX\n __ /\\ __@\n \\ \\ //\\\\/ /@\n \\ \\ /\\ / / @\n \\ V V / @\n \\_/\\_/ @\n @@\n0x0175 LATIN SMALL LETTER W WITH CIRCUMFLEX\n /\\ @\n __ //\\\\__@\n \\ \\ /\\ / /@\n \\ V V / @\n \\_/\\_/ @\n @@\n0x0176 LATIN CAPITAL LETTER Y WITH CIRCUMFLEX\n /\\ @\n __//\\\\ @\n \\ \\ / /@\n \\ V / @\n |_| @\n @@\n0x0177 LATIN SMALL LETTER Y WITH CIRCUMFLEX\n /\\ @\n //\\\\ @\n | | | |@\n | |_| |@\n \\__, |@\n |___/ @@\n0x0178 LATIN CAPITAL LETTER Y WITH DIAERESIS\n [] []@\n __ _@\n \\ \\ / /@\n \\ V / @\n |_| @\n @@\n0x0179 LATIN CAPITAL LETTER Z WITH ACUTE\n __/_/@\n |__ /@\n / / @\n / /_ @\n /____|@\n @@\n0x017A LATIN SMALL LETTER Z WITH ACUTE\n _ @\n _/_/@\n |_ /@\n / / @\n /___|@\n @@\n0x017B LATIN CAPITAL LETTER Z WITH DOT ABOVE\n __[]_@\n |__ /@\n / / @\n / /_ @\n /____|@\n @@\n0x017C LATIN SMALL LETTER Z WITH DOT ABOVE\n [] @\n ____@\n |_ /@\n / / @\n /___|@\n @@\n0x017D LATIN CAPITAL LETTER Z WITH CARON\n _\\_/_@\n |__ /@\n / / @\n / /_ @\n /____|@\n @@\n0x017E LATIN SMALL LETTER Z WITH CARON\n \\\\//@\n _\\/_@\n |_ /@\n / / @\n /___|@\n @@\n0x017F LATIN SMALL LETTER LONG S\n __ @\n / _|@\n |-| | @\n |-| | @\n |_| @\n @@\n0x02C7 CARON\n \\\\//@\n \\/ @\n $@\n $@\n $@\n $@@\n0x02D8 BREVE\n \\\\_//@\n \\_/ @\n $@\n $@\n $@\n $@@\n0x02D9 DOT ABOVE\n []@\n $@\n $@\n $@\n $@\n $@@\n0x02DB OGONEK\n $@\n $@\n $@\n $@\n $@\n )_) @@\n0x02DD DOUBLE ACUTE ACCENT\n _ _ @\n /_/_/@\n $@\n $@\n $@\n $@@\n0xCA0 KANNADA LETTER TTHA\n _____)@\n /_ ___/@\n / _ \\ @\n | (_) | @\n $\\___/$ @\n @@\n ");const l0=new ke,u0=process.cwd(),p0=o.join(u0,"qumra.config.json");function h0(e,t){s.existsSync(p0)||(console.error("Error: qumra.config.json not found!"),process.exit(1));const n=JSON.parse(s.readFileSync(p0,"utf-8")),r=n.version;let[i,o,a]=n.version.split(".").map(Number);try{if(t)switch(e){case"patch":a+=1;break;case"minor":o+=1,a=0;break;case"major":i+=1,o=0,a=0}else switch(e){case"patch":a=Math.max(0,a-1);break;case"minor":o>0&&(o-=1,a=0);break;case"major":i>0&&(i-=1,o=0,a=0)}n.version=`${i}.${o}.${a}`,s.writeFileSync(p0,JSON.stringify(n,null,2),"utf-8"),console.log(`Updated version to ${n.version}`)}catch(e){console.error("Error updating version:",e.message),n.version=r,s.writeFileSync(p0,JSON.stringify(n,null,2),"utf-8"),console.log(`Reverted to previous version: ${r}`)}}l0.name("version").description("Update project version (patch, minor, major)"),l0.command("patch").description("Increment the patch version").action((()=>h0("patch",!0))),l0.command("minor").description("Increment the minor version").action((()=>h0("minor",!0))),l0.command("major").description("Increment the major version").action((()=>h0("major",!0))),l0.command("unpatch").description("Decrement the patch version").action((()=>h0("patch",!1))),l0.command("unminor").description("Decrement the minor version").action((()=>h0("minor",!1))),l0.command("unmajor").description("Decrement the major version").action((()=>h0("major",!1)));const d0=new ke;d0.version(ef).description("CLI to create a new project"),d0.command("status").description("cli status").action((async()=>{const e=(e,t)=>e.split("\n").map((e=>{const n=Math.max(0,Math.floor((t-e.length)/2));return" ".repeat(n)+e})).join("\n"),t=100,n=df.textSync("Qumra Cloud CLI",{font:"Standard",horizontalLayout:"default",verticalLayout:"default",width:t,whitespaceBreak:!0}),r=df.textSync("Version 1.0.0",{font:"Standard",horizontalLayout:"default",verticalLayout:"default",width:t,whitespaceBreak:!0}),i=e(n,t),s=e(r,t),o=e("\n Welcome to Qumra Cloud CLI!\n \n At Qumra, we offer innovative cloud solutions to streamline your tech needs.\n Our tools are designed to make technology work for you with ease and efficiency.\n \n Learn more about our partners and how we collaborate to deliver the best:\n https://partners.qumra.cloud\n ",t);console.log(_t.green(i)),console.log(_t.green(s)),console.log(_t.green(o))})),d0.command("create-new-app").description("Create a new project").action(gf),d0.command("build").description("Build a project").action((()=>{const e=process.cwd(),t=o.join(e,"src","views"),n=o.join(e,"build"),r=o.join(n,"views.zip");s.existsSync(t)||(console.log(_t.red('Error: The "views" folder does not exist.')),process.exit(1)),s.existsSync(n)||s.mkdirSync(n);const i=zr('Compressing the "views" folder...').start(),a=s.createWriteStream(r),c=UO("zip",{zlib:{level:9}});a.on("close",(()=>{i.succeed(_t.blue(`"views" folder compressed successfully into ${r}`))})),c.on("warning",(e=>{if("ENOENT"!==e.code)throw e;console.warn(e)})),c.on("error",(e=>{throw i.fail(_t.red(`Failed to compress "views" folder: ${e.message}`)),e})),c.pipe(a),c.directory(t,!1),c.finalize()})),d0.command("publish").description("Publish your project").action((async function(){const e=function(){s.existsSync(YO)||(console.log('File "qumra.config.json" not found!'),process.exit(1));const e=s.readFileSync(YO,"utf-8");try{return JSON.parse(e)}catch(e){console.log(chalk.red('Failed to parse "qumra.config.json". Invalid JSON format.',e.message))}}(),t=zr("Checking files...").start();try{const n=await qO(GO),r=await qO(VO,"views"),i=await qO(KO,"locales"),a={...r,...i},c=Object.keys(a),l=Date.now();d.exec("npm run build",(r=>{r&&t.fail(r),HO(c,t).then((r=>{(async function(e,t){try{return(await of.post("/themes/uploadRequest",{paths:e,config:t})).data}catch(e){console.log("🚀 ~ uploadRequest ~ error:",e)}})(r.paths,e).then((i=>{(async function(e,t,n){const r=new sp;r.append("encryptionKey",e),r.append("paths",JSON.stringify(t));for(const[e,t]of Object.entries(n))r.append("files",s.createReadStream(t),{filename:o.basename(t),filepath:e}),r.append("filePaths",e);const i=zr(_t.cyan("Uploading theme...")).start();try{const e=await $O.post("/theme/upload",r,{onUploadProgress:e=>{const t=Math.round(100*e.loaded/e.total);i.text=_t.cyan(`Uploading theme... ${t}%`)}});return i.succeed(_t.green("Theme Files Upload successful!")),e.data}catch(e){throw i.fail(_t.red("Upload failed.")),console.error("🚀 ~ uploadTheme ~ error:",e.message),e.message}})(i.encryptionKey,r.paths,a).then((r=>{(async function(e,t,n){const r=new sp;r.append("encryptionKey",e),r.append("paths",JSON.stringify(t));for(const[e,t]of Object.entries(n))r.append("files",s.createReadStream(t),{filename:o.basename(t),filepath:e}),r.append("filePaths",e);const i=zr(_t.cyan("Uploading Assets Files...")).start();try{const e=await zO.post("/upload/assets",r,{onUploadProgress:e=>{const t=Math.round(100*e.loaded/e.total);i.text=_t.cyan(`Uploading theme... ${t}%`)}});return i.succeed(_t.green("Upload successful!")),e.data}catch(e){i.fail(_t.red("Assets Files Upload failed.")),console.error("🚀 ~ uploadAssets ~ error:",e.message)}})(i.encryptionKey,Object.keys(n),n).then((()=>{const n=((Date.now()-l)/1e3).toFixed(2);t.succeed(`Version ${e.version} upload completed successfully in ${n} seconds! 🎉🚀`)}))}))}))})).catch((e=>{}))}))}catch(e){console.error(`Failed to publish files - Error: ${e.message}`)}})),d0.command("login").description("developer login").action(c0),d0.addCommand($J),d0.addCommand(l0),d0.command("save").action((async()=>{await sf("token"),await rf("token",{test:"asdasdasd"})})),d0.parse(process.argv);
390
390
  //# sourceMappingURL=cli.cjs.map