9remote 2.0.82 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/server.cjs
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
const __importMetaUrl = require('url').pathToFileURL(__filename).href;
|
|
2
|
-
var
|
|
3
|
-
`)}catch{}}function
|
|
4
|
-
=== SESSION ${new Date().toISOString()} pid=${process.pid} argv=${process.argv.slice(2).join(" ")} ===`),
|
|
5
|
-
`).filter(Boolean).slice(-r)}catch{return[]}}function On(r){return{info:(...e)=>fo(r,"info",Pp(e)),warn:(...e)=>fo(r,"warn",Pp(e)),error:(...e)=>fo(r,"error",Pp(e))}}var Br,Np,Ya,Ja,Xa,Iv,Ip,YO,JO,ji=Ce(()=>{Br=K(require("fs"),1),Np=K(require("path"),1);bt();Ya=ie.LOGS,Ja=Np.default.join(Ya,lo.fileName),Xa=Np.default.join(Ya,lo.rotatedName),Iv=!1,Ip=null;YO=/\x1b\[[0-9;]*m/g,JO=/https?:\/\/[^\s]+/g});var qv=A((E4,Lp)=>{"use strict";Lp.exports=Hv;Lp.exports.preferredCharsets=Hv;var QO=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function eM(r){for(var e=r.split(","),t=0,n=0;t<e.length;t++){var i=tM(e[t].trim(),t);i&&(e[n++]=i)}return e.length=n,e}function tM(r,e){var t=QO.exec(r);if(!t)return null;var n=t[1],i=1;if(t[2])for(var s=t[2].split(";"),o=0;o<s.length;o++){var a=s[o].trim().split("=");if(a[0]==="q"){i=parseFloat(a[1]);break}}return{charset:n,q:i,i:e}}function rM(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=nM(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function nM(r,e,t){var n=0;if(e.charset.toLowerCase()===r.toLowerCase())n|=1;else if(e.charset!=="*")return null;return{i:t,o:e.i,q:e.q,s:n}}function Hv(r,e){var t=eM(r===void 0?"*":r||"");if(!e)return t.filter(Fv).sort(jv).map(iM);var n=e.map(function(s,o){return rM(s,t,o)});return n.filter(Fv).sort(jv).map(function(s){return e[n.indexOf(s)]})}function jv(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function iM(r){return r.charset}function Fv(r){return r.q>0}});var zv=A((T4,Bp)=>{"use strict";Bp.exports=Gv;Bp.exports.preferredEncodings=Gv;var sM=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function oM(r){for(var e=r.split(","),t=!1,n=1,i=0,s=0;i<e.length;i++){var o=aM(e[i].trim(),i);o&&(e[s++]=o,t=t||Wv("identity",o),n=Math.min(n,o.q||1))}return t||(e[s++]={encoding:"identity",q:n,i}),e.length=s,e}function aM(r,e){var t=sM.exec(r);if(!t)return null;var n=t[1],i=1;if(t[2])for(var s=t[2].split(";"),o=0;o<s.length;o++){var a=s[o].trim().split("=");if(a[0]==="q"){i=parseFloat(a[1]);break}}return{encoding:n,q:i,i:e}}function cM(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=Wv(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function Wv(r,e,t){var n=0;if(e.encoding.toLowerCase()===r.toLowerCase())n|=1;else if(e.encoding!=="*")return null;return{i:t,o:e.i,q:e.q,s:n}}function Gv(r,e){var t=oM(r||"");if(!e)return t.filter($v).sort(Uv).map(lM);var n=e.map(function(s,o){return cM(s,t,o)});return n.filter($v).sort(Uv).map(function(s){return e[n.indexOf(s)]})}function Uv(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function lM(r){return r.encoding}function $v(r){return r.q>0}});var Xv=A((C4,jp)=>{"use strict";jp.exports=Jv;jp.exports.preferredLanguages=Jv;var uM=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function pM(r){for(var e=r.split(","),t=0,n=0;t<e.length;t++){var i=Yv(e[t].trim(),t);i&&(e[n++]=i)}return e.length=n,e}function Yv(r,e){var t=uM.exec(r);if(!t)return null;var n=t[1],i=t[2],s=n;i&&(s+="-"+i);var o=1;if(t[3])for(var a=t[3].split(";"),c=0;c<a.length;c++){var l=a[c].split("=");l[0]==="q"&&(o=parseFloat(l[1]))}return{prefix:n,suffix:i,q:o,i:e,full:s}}function fM(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=dM(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function dM(r,e,t){var n=Yv(r);if(!n)return null;var i=0;if(e.full.toLowerCase()===n.full.toLowerCase())i|=4;else if(e.prefix.toLowerCase()===n.full.toLowerCase())i|=2;else if(e.full.toLowerCase()===n.prefix.toLowerCase())i|=1;else if(e.full!=="*")return null;return{i:t,o:e.i,q:e.q,s:i}}function Jv(r,e){var t=pM(r===void 0?"*":r||"");if(!e)return t.filter(Kv).sort(Vv).map(hM);var n=e.map(function(s,o){return fM(s,t,o)});return n.filter(Kv).sort(Vv).map(function(s){return e[n.indexOf(s)]})}function Vv(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function hM(r){return r.full}function Kv(r){return r.q>0}});var ny=A((k4,Fp)=>{"use strict";Fp.exports=ty;Fp.exports.preferredMediaTypes=ty;var mM=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function gM(r){for(var e=bM(r),t=0,n=0;t<e.length;t++){var i=ey(e[t].trim(),t);i&&(e[n++]=i)}return e.length=n,e}function ey(r,e){var t=mM.exec(r);if(!t)return null;var n=Object.create(null),i=1,s=t[2],o=t[1];if(t[3])for(var a=wM(t[3]).map(_M),c=0;c<a.length;c++){var l=a[c],u=l[0].toLowerCase(),f=l[1],h=f&&f[0]==='"'&&f[f.length-1]==='"'?f.substr(1,f.length-2):f;if(u==="q"){i=parseFloat(h);break}n[u]=h}return{type:o,subtype:s,params:n,q:i,i:e}}function vM(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=yM(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function yM(r,e,t){var n=ey(r),i=0;if(!n)return null;if(e.type.toLowerCase()==n.type.toLowerCase())i|=4;else if(e.type!="*")return null;if(e.subtype.toLowerCase()==n.subtype.toLowerCase())i|=2;else if(e.subtype!="*")return null;var s=Object.keys(e.params);if(s.length>0)if(s.every(function(o){return e.params[o]=="*"||(e.params[o]||"").toLowerCase()==(n.params[o]||"").toLowerCase()}))i|=1;else return null;return{i:t,o:e.i,q:e.q,s:i}}function ty(r,e){var t=gM(r===void 0?"*/*":r||"");if(!e)return t.filter(Qv).sort(Zv).map(xM);var n=e.map(function(s,o){return vM(s,t,o)});return n.filter(Qv).sort(Zv).map(function(s){return e[n.indexOf(s)]})}function Zv(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function xM(r){return r.type+"/"+r.subtype}function Qv(r){return r.q>0}function ry(r){for(var e=0,t=0;(t=r.indexOf('"',t))!==-1;)e++,t++;return e}function _M(r){var e=r.indexOf("="),t,n;return e===-1?t=r:(t=r.substr(0,e),n=r.substr(e+1)),[t,n]}function bM(r){for(var e=r.split(","),t=1,n=0;t<e.length;t++)ry(e[n])%2==0?e[++n]=e[t]:e[n]+=","+e[t];return e.length=n+1,e}function wM(r){for(var e=r.split(";"),t=1,n=0;t<e.length;t++)ry(e[n])%2==0?e[++n]=e[t]:e[n]+=";"+e[t];e.length=n+1;for(var t=0;t<e.length;t++)e[t]=e[t].trim();return e}});var iy=A((A4,Hp)=>{"use strict";var SM=qv(),EM=zv(),TM=Xv(),CM=ny();Hp.exports=pe;Hp.exports.Negotiator=pe;function pe(r){if(!(this instanceof pe))return new pe(r);this.request=r}pe.prototype.charset=function(e){var t=this.charsets(e);return t&&t[0]};pe.prototype.charsets=function(e){return SM(this.request.headers["accept-charset"],e)};pe.prototype.encoding=function(e){var t=this.encodings(e);return t&&t[0]};pe.prototype.encodings=function(e){return EM(this.request.headers["accept-encoding"],e)};pe.prototype.language=function(e){var t=this.languages(e);return t&&t[0]};pe.prototype.languages=function(e){return TM(this.request.headers["accept-language"],e)};pe.prototype.mediaType=function(e){var t=this.mediaTypes(e);return t&&t[0]};pe.prototype.mediaTypes=function(e){return CM(this.request.headers.accept,e)};pe.prototype.preferredCharset=pe.prototype.charset;pe.prototype.preferredCharsets=pe.prototype.charsets;pe.prototype.preferredEncoding=pe.prototype.encoding;pe.prototype.preferredEncodings=pe.prototype.encodings;pe.prototype.preferredLanguage=pe.prototype.language;pe.prototype.preferredLanguages=pe.prototype.languages;pe.prototype.preferredMediaType=pe.prototype.mediaType;pe.prototype.preferredMediaTypes=pe.prototype.mediaTypes});var sy=A((R4,kM)=>{kM.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}});var ay=A((O4,oy)=>{oy.exports=sy()});var uy=A(Bt=>{"use strict";var Za=ay(),AM=require("path").extname,cy=/^\s*([^;\s]*)(?:;|\s|$)/,RM=/^text\//i;Bt.charset=ly;Bt.charsets={lookup:ly};Bt.contentType=OM;Bt.extension=MM;Bt.extensions=Object.create(null);Bt.lookup=PM;Bt.types=Object.create(null);IM(Bt.extensions,Bt.types);function ly(r){if(!r||typeof r!="string")return!1;var e=cy.exec(r),t=e&&Za[e[1].toLowerCase()];return t&&t.charset?t.charset:e&&RM.test(e[1])?"UTF-8":!1}function OM(r){if(!r||typeof r!="string")return!1;var e=r.indexOf("/")===-1?Bt.lookup(r):r;if(!e)return!1;if(e.indexOf("charset")===-1){var t=Bt.charset(e);t&&(e+="; charset="+t.toLowerCase())}return e}function MM(r){if(!r||typeof r!="string")return!1;var e=cy.exec(r),t=e&&Bt.extensions[e[1].toLowerCase()];return!t||!t.length?!1:t[0]}function PM(r){if(!r||typeof r!="string")return!1;var e=AM("x."+r).toLowerCase().substr(1);return e&&Bt.types[e]||!1}function IM(r,e){var t=["nginx","apache",void 0,"iana"];Object.keys(Za).forEach(function(i){var s=Za[i],o=s.extensions;if(!(!o||!o.length)){r[i]=o;for(var a=0;a<o.length;a++){var c=o[a];if(e[c]){var l=t.indexOf(Za[e[c]].source),u=t.indexOf(s.source);if(e[c]!=="application/octet-stream"&&(l>u||l===u&&e[c].substr(0,12)==="application/"))continue}e[c]=i}}})}});var Qa=A((P4,py)=>{"use strict";var NM=iy(),DM=uy();py.exports=Vt;function Vt(r){if(!(this instanceof Vt))return new Vt(r);this.headers=r.headers,this.negotiator=new NM(r)}Vt.prototype.type=Vt.prototype.types=function(r){var e=r;if(e&&!Array.isArray(e)){e=new Array(arguments.length);for(var t=0;t<e.length;t++)e[t]=arguments[t]}if(!e||e.length===0)return this.negotiator.mediaTypes();if(!this.headers.accept)return e[0];var n=e.map(LM),i=this.negotiator.mediaTypes(n.filter(BM)),s=i[0];return s?e[n.indexOf(s)]:!1};Vt.prototype.encoding=Vt.prototype.encodings=function(r){var e=r;if(e&&!Array.isArray(e)){e=new Array(arguments.length);for(var t=0;t<e.length;t++)e[t]=arguments[t]}return!e||e.length===0?this.negotiator.encodings():this.negotiator.encodings(e)[0]||!1};Vt.prototype.charset=Vt.prototype.charsets=function(r){var e=r;if(e&&!Array.isArray(e)){e=new Array(arguments.length);for(var t=0;t<e.length;t++)e[t]=arguments[t]}return!e||e.length===0?this.negotiator.charsets():this.negotiator.charsets(e)[0]||!1};Vt.prototype.lang=Vt.prototype.langs=Vt.prototype.language=Vt.prototype.languages=function(r){var e=r;if(e&&!Array.isArray(e)){e=new Array(arguments.length);for(var t=0;t<e.length;t++)e[t]=arguments[t]}return!e||e.length===0?this.negotiator.languages():this.negotiator.languages(e)[0]||!1};function LM(r){return r.indexOf("/")===-1?DM.lookup(r):r}function BM(r){return typeof r=="string"}});var Up=A((fy,dy)=>{var ho=require("crypto"),qp=function(){};qp.prototype.getRandomBytes=function(r){var e=4096,t=this;if(r=r||12,r>e)return ho.randomBytes(r);var n=parseInt(e/r),i=parseInt(n*.85);if(!i||(this.bytesBufferIndex==null&&(this.bytesBufferIndex=-1),this.bytesBufferIndex==n&&(this.bytesBuffer=null,this.bytesBufferIndex=-1),(this.bytesBufferIndex==-1||this.bytesBufferIndex>i)&&(this.isGeneratingBytes||(this.isGeneratingBytes=!0,ho.randomBytes(e,function(o,a){t.bytesBuffer=a,t.bytesBufferIndex=0,t.isGeneratingBytes=!1})),this.bytesBufferIndex==-1)))return ho.randomBytes(r);var s=this.bytesBuffer.slice(r*this.bytesBufferIndex,r*(this.bytesBufferIndex+1));return this.bytesBufferIndex++,s};qp.prototype.generateId=function(){var r=Buffer.alloc(15);return r.writeInt32BE?(this.sequenceNumber=this.sequenceNumber+1|0,r.writeInt32BE(this.sequenceNumber,11),ho.randomBytes?this.getRandomBytes(12).copy(r):[0,4,8].forEach(function(e){r.writeInt32BE(Math.random()*Math.pow(2,32)|0,e)}),r.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()};fy=dy.exports=new qp});var ec=A(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.ERROR_PACKET=Mn.PACKET_TYPES_REVERSE=Mn.PACKET_TYPES=void 0;var jr=Object.create(null);Mn.PACKET_TYPES=jr;jr.open="0";jr.close="1";jr.ping="2";jr.pong="3";jr.message="4";jr.upgrade="5";jr.noop="6";var hy=Object.create(null);Mn.PACKET_TYPES_REVERSE=hy;Object.keys(jr).forEach(r=>{hy[jr[r]]=r});var jM={type:"error",data:"parser error"};Mn.ERROR_PACKET=jM});var gy=A(Fi=>{"use strict";Object.defineProperty(Fi,"__esModule",{value:!0});Fi.encodePacket=void 0;Fi.encodePacketToBinary=qM;var FM=ec(),HM=({type:r,data:e},t,n)=>e instanceof ArrayBuffer||ArrayBuffer.isView(e)?n(t?e:"b"+my(e,!0).toString("base64")):n(FM.PACKET_TYPES[r]+(e||""));Fi.encodePacket=HM;var my=(r,e)=>Buffer.isBuffer(r)||r instanceof Uint8Array&&!e?r:r instanceof ArrayBuffer?Buffer.from(r):Buffer.from(r.buffer,r.byteOffset,r.byteLength),$p;function qM(r,e){if(r.data instanceof ArrayBuffer||ArrayBuffer.isView(r.data))return e(my(r.data,!1));(0,Fi.encodePacket)(r,!0,t=>{$p||($p=new TextEncoder),e($p.encode(t))})}});var yy=A(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.decodePacket=void 0;var tc=ec(),UM=(r,e)=>{if(typeof r!="string")return{type:"message",data:vy(r,e)};let t=r.charAt(0);if(t==="b"){let n=Buffer.from(r.substring(1),"base64");return{type:"message",data:vy(n,e)}}return tc.PACKET_TYPES_REVERSE[t]?r.length>1?{type:tc.PACKET_TYPES_REVERSE[t],data:r.substring(1)}:{type:tc.PACKET_TYPES_REVERSE[t]}:tc.ERROR_PACKET};rc.decodePacket=UM;var vy=(r,e)=>e==="arraybuffer"?r instanceof ArrayBuffer?r:Buffer.isBuffer(r)?r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength):r.buffer:Buffer.isBuffer(r)?r:Buffer.from(r)});var mo=A(jt=>{"use strict";Object.defineProperty(jt,"__esModule",{value:!0});jt.decodePayload=jt.decodePacket=jt.encodePayload=jt.encodePacket=jt.protocol=void 0;jt.createPacketEncoderStream=GM;jt.createPacketDecoderStream=zM;var Gp=gy();Object.defineProperty(jt,"encodePacket",{enumerable:!0,get:function(){return Gp.encodePacket}});var zp=yy();Object.defineProperty(jt,"decodePacket",{enumerable:!0,get:function(){return zp.decodePacket}});var xy=ec(),_y="",$M=(r,e)=>{let t=r.length,n=new Array(t),i=0;r.forEach((s,o)=>{(0,Gp.encodePacket)(s,!1,a=>{n[o]=a,++i===t&&e(n.join(_y))})})};jt.encodePayload=$M;var WM=(r,e)=>{let t=r.split(_y),n=[];for(let i=0;i<t.length;i++){let s=(0,zp.decodePacket)(t[i],e);if(n.push(s),s.type==="error")break}return n};jt.decodePayload=WM;function GM(){return new TransformStream({transform(r,e){(0,Gp.encodePacketToBinary)(r,t=>{let n=t.length,i;if(n<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,n);else if(n<65536){i=new Uint8Array(3);let s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,n)}else{i=new Uint8Array(9);let s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(n))}r.data&&typeof r.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(t)})}})}var Wp;function nc(r){return r.reduce((e,t)=>e+t.length,0)}function ic(r,e){if(r[0].length===e)return r.shift();let t=new Uint8Array(e),n=0;for(let i=0;i<e;i++)t[i]=r[0][n++],n===r[0].length&&(r.shift(),n=0);return r.length&&n<r[0].length&&(r[0]=r[0].slice(n)),t}function zM(r,e){Wp||(Wp=new TextDecoder);let t=[],n=0,i=-1,s=!1;return new TransformStream({transform(o,a){for(t.push(o);;){if(n===0){if(nc(t)<1)break;let c=ic(t,1);s=(c[0]&128)===128,i=c[0]&127,i<126?n=3:i===126?n=1:n=2}else if(n===1){if(nc(t)<2)break;let c=ic(t,2);i=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),n=3}else if(n===2){if(nc(t)<8)break;let c=ic(t,8),l=new DataView(c.buffer,c.byteOffset,c.length),u=l.getUint32(0);if(u>Math.pow(2,21)-1){a.enqueue(xy.ERROR_PACKET);break}i=u*Math.pow(2,32)+l.getUint32(4),n=3}else{if(nc(t)<i)break;let c=ic(t,i);a.enqueue((0,zp.decodePacket)(s?c:Wp.decode(c),e)),n=0}if(i===0||i>r){a.enqueue(xy.ERROR_PACKET);break}}}})}jt.protocol=4});var Ey=A((B4,Sy)=>{var Pn=String.fromCharCode;function by(r){for(var e=[],t=0,n=r.length,i,s;t<n;)i=r.charCodeAt(t++),i>=55296&&i<=56319&&t<n?(s=r.charCodeAt(t++),(s&64512)==56320?e.push(((i&1023)<<10)+(s&1023)+65536):(e.push(i),t--)):e.push(i);return e}function VM(r){for(var e=r.length,t=-1,n,i="";++t<e;)n=r[t],n>65535&&(n-=65536,i+=Pn(n>>>10&1023|55296),n=56320|n&1023),i+=Pn(n);return i}function wy(r,e){if(r>=55296&&r<=57343){if(e)throw Error("Lone surrogate U+"+r.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function Vp(r,e){return Pn(r>>e&63|128)}function KM(r,e){if((r&4294967168)==0)return Pn(r);var t="";return(r&4294965248)==0?t=Pn(r>>6&31|192):(r&4294901760)==0?(wy(r,e)||(r=65533),t=Pn(r>>12&15|224),t+=Vp(r,6)):(r&4292870144)==0&&(t=Pn(r>>18&7|240),t+=Vp(r,12),t+=Vp(r,6)),t+=Pn(r&63|128),t}function YM(r,e){e=e||{};for(var t=e.strict!==!1,n=by(r),i=n.length,s=-1,o,a="";++s<i;)o=n[s],a+=KM(o,t);return a}function Hi(){if(In>=oc)throw Error("Invalid byte index");var r=sc[In]&255;if(In++,(r&192)==128)return r&63;throw Error("Invalid continuation byte")}function JM(r){var e,t,n,i,s;if(In>oc)throw Error("Invalid byte index");if(In==oc)return!1;if(e=sc[In]&255,In++,(e&128)==0)return e;if((e&224)==192){if(t=Hi(),s=(e&31)<<6|t,s>=128)return s;throw Error("Invalid continuation byte")}if((e&240)==224){if(t=Hi(),n=Hi(),s=(e&15)<<12|t<<6|n,s>=2048)return wy(s,r)?s:65533;throw Error("Invalid continuation byte")}if((e&248)==240&&(t=Hi(),n=Hi(),i=Hi(),s=(e&7)<<18|t<<12|n<<6|i,s>=65536&&s<=1114111))return s;throw Error("Invalid UTF-8 detected")}var sc,oc,In;function XM(r,e){e=e||{};var t=e.strict!==!1;sc=by(r),oc=sc.length,In=0;for(var n=[],i;(i=JM(t))!==!1;)n.push(i);return VM(n)}Sy.exports={version:"2.1.2",encode:YM,decode:XM}});var Py=A(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.packets=ft.protocol=void 0;ft.encodePacket=Kp;ft.encodeBase64Packet=ky;ft.decodePacket=Yp;ft.decodeBase64Packet=Ay;ft.encodePayload=tP;ft.decodePayload=nP;ft.encodePayloadAsBinary=Oy;ft.decodePayloadAsBinary=My;var Cy=Ey();ft.protocol=3;var ZM=r=>{for(let e of r)if(e.data instanceof ArrayBuffer||ArrayBuffer.isView(e.data))return!0;return!1};ft.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6};var qi=Object.keys(ft.packets),Er={type:"error",data:"parser error"},QM=Buffer.concat([]);function Kp(r,e,t,n){if(typeof e=="function"&&(n=e,e=null),typeof t=="function"&&(n=t,t=null),Buffer.isBuffer(r.data))return Ty(r,e,n);if(r.data&&(r.data.buffer||r.data)instanceof ArrayBuffer)return Ty({type:r.type,data:Jp(r.data)},e,n);var i=ft.packets[r.type];return r.data!==void 0&&(i+=t?Cy.encode(String(r.data),{strict:!1}):String(r.data)),n(""+i)}function Ty(r,e,t){if(!e)return ky(r,t);var n=r.data,i=Buffer.allocUnsafe(1);return i[0]=ft.packets[r.type],t(Buffer.concat([i,n]))}function ky(r,e){var t=Buffer.isBuffer(r.data)?r.data:Jp(r.data),n="b"+ft.packets[r.type];return n+=t.toString("base64"),e(n)}function Yp(r,e,t){if(r===void 0)return Er;let n;if(typeof r=="string")return n=r.charAt(0),n==="b"?Ay(r.slice(1),e):t&&(r=eP(r),r===!1)||Number(n)!=n||!qi[n]?Er:r.length>1?{type:qi[n],data:r.slice(1)}:{type:qi[n]};if(e==="arraybuffer"){var i=new Uint8Array(r);return n=i[0],{type:qi[n],data:i.buffer.slice(1)}}return r instanceof ArrayBuffer&&(r=Jp(r)),n=r[0],{type:qi[n],data:r.slice(1)}}function eP(r){try{r=Cy.decode(r,{strict:!1})}catch{return!1}return r}function Ay(r,e){var t=qi[r.charAt(0)],n=Buffer.from(r.slice(1),"base64");if(e==="arraybuffer"){for(var i=new Uint8Array(n.length),s=0;s<i.length;s++)i[s]=n[s];n=i.buffer}return{type:t,data:n}}function tP(r,e,t){if(typeof e=="function"&&(t=e,e=null),e&&ZM(r))return Oy(r,t);if(!r.length)return t("0:");function n(i,s){Kp(i,e,!1,function(o){s(null,rP(o))})}Ry(r,n,function(i,s){return t(s.join(""))})}function rP(r){return r.length+":"+r}function Ry(r,e,t){let n=new Array(r.length),i=0;for(let s=0;s<r.length;s++)e(r[s],(o,a)=>{n[s]=a,++i===r.length&&t(null,n)})}function nP(r,e,t){if(typeof r!="string")return My(r,e,t);if(typeof e=="function"&&(t=e,e=null),r==="")return t(Er,0,1);for(var n="",i,s,o,a=0,c=r.length;a<c;a++){var l=r.charAt(a);if(l!==":"){n+=l;continue}if(n===""||n!=(i=Number(n))||(s=r.slice(a+1,a+1+i),n!=s.length))return t(Er,0,1);if(s.length){if(o=Yp(s,e,!1),Er.type===o.type&&Er.data===o.data)return t(Er,0,1);var u=t(o,a+i,c);if(u===!1)return}a+=i,n=""}if(n!=="")return t(Er,0,1)}function iP(r){for(var e="",t=0,n=r.length;t<n;t++)e+=String.fromCharCode(r[t]);return e}function sP(r){for(var e=Buffer.allocUnsafe(r.length),t=0,n=r.length;t<n;t++)e.writeUInt8(r.charCodeAt(t),t);return e}function Jp(r){var e=r.byteLength||r.length,t=r.byteOffset||0;return Buffer.from(r.buffer||r,t,e)}function Oy(r,e){if(!r.length)return e(QM);Ry(r,oP,function(t,n){return e(Buffer.concat(n))})}function oP(r,e){function t(n){var i=""+n.length,s;if(typeof n=="string"){s=Buffer.allocUnsafe(i.length+2),s[0]=0;for(var o=0;o<i.length;o++)s[o+1]=parseInt(i[o],10);return s[s.length-1]=255,e(null,Buffer.concat([s,sP(n)]))}s=Buffer.allocUnsafe(i.length+2),s[0]=1;for(var o=0;o<i.length;o++)s[o+1]=parseInt(i[o],10);s[s.length-1]=255,e(null,Buffer.concat([s,n]))}Kp(r,!0,!0,t)}function My(r,e,t){typeof e=="function"&&(t=e,e=null);for(var n=r,i=[],s;n.length>0;){var o="",a=n[0]===0;for(s=1;n[s]!==255;s++){if(o.length>310)return t(Er,0,1);o+=""+n[s]}n=n.slice(o.length+1);var c=parseInt(o,10),l=n.slice(1,c+1);a&&(l=iP(l)),i.push(l),n=n.slice(c+1)}var u=i.length;for(s=0;s<u;s++){var f=i[s];t(Yp(f,e,!0),s,u)}}});var Ny=A((F4,Iy)=>{var Ui=1e3,$i=Ui*60,Wi=$i*60,Xn=Wi*24,aP=Xn*7,cP=Xn*365.25;Iy.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return lP(r);if(t==="number"&&isFinite(r))return e.long?pP(r):uP(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function lP(r){if(r=String(r),!(r.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(e){var t=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return t*cP;case"weeks":case"week":case"w":return t*aP;case"days":case"day":case"d":return t*Xn;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Wi;case"minutes":case"minute":case"mins":case"min":case"m":return t*$i;case"seconds":case"second":case"secs":case"sec":case"s":return t*Ui;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function uP(r){var e=Math.abs(r);return e>=Xn?Math.round(r/Xn)+"d":e>=Wi?Math.round(r/Wi)+"h":e>=$i?Math.round(r/$i)+"m":e>=Ui?Math.round(r/Ui)+"s":r+"ms"}function pP(r){var e=Math.abs(r);return e>=Xn?ac(r,e,Xn,"day"):e>=Wi?ac(r,e,Wi,"hour"):e>=$i?ac(r,e,$i,"minute"):e>=Ui?ac(r,e,Ui,"second"):r+" ms"}function ac(r,e,t,n){var i=e>=t*1.5;return Math.round(r/t)+" "+n+(i?"s":"")}});var Xp=A((H4,Dy)=>{function fP(r){t.debug=t,t.default=t,t.coerce=c,t.disable=o,t.enable=i,t.enabled=a,t.humanize=Ny(),t.destroy=l,Object.keys(r).forEach(u=>{t[u]=r[u]}),t.names=[],t.skips=[],t.formatters={};function e(u){let f=0;for(let h=0;h<u.length;h++)f=(f<<5)-f+u.charCodeAt(h),f|=0;return t.colors[Math.abs(f)%t.colors.length]}t.selectColor=e;function t(u){let f,h=null,g,x;function S(...k){if(!S.enabled)return;let R=S,M=Number(new Date),I=M-(f||M);R.diff=I,R.prev=f,R.curr=M,f=M,k[0]=t.coerce(k[0]),typeof k[0]!="string"&&k.unshift("%O");let B=0;k[0]=k[0].replace(/%([a-zA-Z%])/g,(F,G)=>{if(F==="%%")return"%";B++;let D=t.formatters[G];if(typeof D=="function"){let U=k[B];F=D.call(R,U),k.splice(B,1),B--}return F}),t.formatArgs.call(R,k),(R.log||t.log).apply(R,k)}return S.namespace=u,S.useColors=t.useColors(),S.color=t.selectColor(u),S.extend=n,S.destroy=t.destroy,Object.defineProperty(S,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(g!==t.namespaces&&(g=t.namespaces,x=t.enabled(u)),x),set:k=>{h=k}}),typeof t.init=="function"&&t.init(S),S}function n(u,f){let h=t(this.namespace+(typeof f>"u"?":":f)+u);return h.log=this.log,h}function i(u){t.save(u),t.namespaces=u,t.names=[],t.skips=[];let f=(typeof u=="string"?u:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let h of f)h[0]==="-"?t.skips.push(h.slice(1)):t.names.push(h)}function s(u,f){let h=0,g=0,x=-1,S=0;for(;h<u.length;)if(g<f.length&&(f[g]===u[h]||f[g]==="*"))f[g]==="*"?(x=g,S=h,g++):(h++,g++);else if(x!==-1)g=x+1,S++,h=S;else return!1;for(;g<f.length&&f[g]==="*";)g++;return g===f.length}function o(){let u=[...t.names,...t.skips.map(f=>"-"+f)].join(",");return t.enable(""),u}function a(u){for(let f of t.skips)if(s(u,f))return!1;for(let f of t.names)if(s(u,f))return!0;return!1}function c(u){return u instanceof Error?u.stack||u.message:u}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}Dy.exports=fP});var Ly=A((Ft,cc)=>{Ft.formatArgs=hP;Ft.save=mP;Ft.load=gP;Ft.useColors=dP;Ft.storage=vP();Ft.destroy=(()=>{let r=!1;return()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Ft.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function dP(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let r;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(r=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(r[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function hP(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+cc.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;r.splice(1,0,e,"color: inherit");let t=0,n=0;r[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(t++,i==="%c"&&(n=t))}),r.splice(n,0,e)}Ft.log=console.debug||console.log||(()=>{});function mP(r){try{r?Ft.storage.setItem("debug",r):Ft.storage.removeItem("debug")}catch{}}function gP(){let r;try{r=Ft.storage.getItem("debug")||Ft.storage.getItem("DEBUG")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function vP(){try{return localStorage}catch{}}cc.exports=Xp()(Ft);var{formatters:yP}=cc.exports;yP.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var jy=A((q4,By)=>{"use strict";By.exports=(r,e=process.argv)=>{let t=r.startsWith("-")?"":r.length===1?"-":"--",n=e.indexOf(t+r),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}});var qy=A((U4,Hy)=>{"use strict";var xP=require("os"),Fy=require("tty"),ir=jy(),{env:dt}=process,Nn;ir("no-color")||ir("no-colors")||ir("color=false")||ir("color=never")?Nn=0:(ir("color")||ir("colors")||ir("color=true")||ir("color=always"))&&(Nn=1);"FORCE_COLOR"in dt&&(dt.FORCE_COLOR==="true"?Nn=1:dt.FORCE_COLOR==="false"?Nn=0:Nn=dt.FORCE_COLOR.length===0?1:Math.min(parseInt(dt.FORCE_COLOR,10),3));function Zp(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function Qp(r,e){if(Nn===0)return 0;if(ir("color=16m")||ir("color=full")||ir("color=truecolor"))return 3;if(ir("color=256"))return 2;if(r&&!e&&Nn===void 0)return 0;let t=Nn||0;if(dt.TERM==="dumb")return t;if(process.platform==="win32"){let n=xP.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in dt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in dt)||dt.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in dt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(dt.TEAMCITY_VERSION)?1:0;if(dt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in dt){let n=parseInt((dt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(dt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(dt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(dt.TERM)||"COLORTERM"in dt?1:t}function _P(r){let e=Qp(r,r&&r.isTTY);return Zp(e)}Hy.exports={supportsColor:_P,stdout:Zp(Qp(!0,Fy.isatty(1))),stderr:Zp(Qp(!0,Fy.isatty(2)))}});var $y=A((ht,uc)=>{var bP=require("tty"),lc=require("util");ht.init=AP;ht.log=TP;ht.formatArgs=SP;ht.save=CP;ht.load=kP;ht.useColors=wP;ht.destroy=lc.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");ht.colors=[6,2,3,4,5,1];try{let r=qy();r&&(r.stderr||r).level>=2&&(ht.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}ht.inspectOpts=Object.keys(process.env).filter(r=>/^debug_/i.test(r)).reduce((r,e)=>{let t=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,s)=>s.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),r[t]=n,r},{});function wP(){return"colors"in ht.inspectOpts?!!ht.inspectOpts.colors:bP.isatty(process.stderr.fd)}function SP(r){let{namespace:e,useColors:t}=this;if(t){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${i};1m${e} \x1B[0m`;r[0]=s+r[0].split(`
|
|
2
|
+
var MO=Object.create;var $a=Object.defineProperty;var PO=Object.getOwnPropertyDescriptor;var IO=Object.getOwnPropertyNames;var NO=Object.getPrototypeOf,DO=Object.prototype.hasOwnProperty;var Ce=(r,e)=>()=>(r&&(e=r(r=0)),e);var A=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),en=(r,e)=>{for(var t in e)$a(r,t,{get:e[t],enumerable:!0})},yv=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of IO(e))!DO.call(r,i)&&i!==t&&$a(r,i,{get:()=>e[i],enumerable:!(n=PO(e,i))||n.enumerable});return r};var K=(r,e,t)=>(t=r!=null?MO(NO(r)):{},yv(e||!r||!r.__esModule?$a(t,"default",{value:r,enumerable:!0}):t,r)),LO=r=>yv($a({},"__esModule",{value:!0}),r);var ji={};en(ji,{createRouter:()=>Op,jsonErr:()=>le,jsonOk:()=>X,parseJsonBody:()=>Bt});function XO(r){return new Promise(e=>{let t="";r.on("data",n=>t+=n),r.on("end",()=>e(t))})}function X(r,e={ok:!0}){r.setHeader("Content-Type","application/json"),r.writeHead(200),r.end(JSON.stringify(e))}function le(r,e,t){r.setHeader("Content-Type","application/json"),r.writeHead(e),r.end(JSON.stringify({error:t}))}async function Bt(r,e){try{let t=await XO(r);return JSON.parse(t||"{}")}catch{return le(e,400,"Invalid JSON"),null}}function Op(r,{fallback:e}={}){let t=new Map,n=[];for(let a of r){let c=a.method==="*"?["GET","POST","PUT","DELETE"]:[a.method];for(let l of c)a.path.endsWith("/*")?n.push({...a,prefix:a.path.slice(0,-2),method:l}):t.set(`${l}:${a.path}`,a)}let i=new Set,s=[];for(let a of r)a.public&&(a.path.endsWith("/*")?s.push(a.path.slice(0,-2)):i.add(a.path));function o(a){return i.has(a)?!0:s.some(c=>a.startsWith(c))}return async(a,c)=>{let l=(0,Ov.parse)(a.url,!0),{pathname:u,search:f}=l,h=!!a.headers["cf-connecting-ip"],g=a.socket.remoteAddress==="127.0.0.1"||a.socket.remoteAddress==="::1";if(!o(u)&&(h||!g)){le(c,403,"Forbidden");return}let x=`${a.method}:${u}`,S=t.get(x);if(S){try{await S.handler(a,c,{pathname:u,query:l.query,search:f})}catch(C){console.error("Error:",a.url,C),le(c,500,C.message)}return}for(let C of n)if(C.method===a.method&&u.startsWith(C.prefix)){try{await C.handler(a,c,{pathname:u,query:l.query,search:f})}catch(R){console.error("Error:",a.url,R),le(c,500,R.message)}return}if(e){try{await e(a,c,{pathname:u,search:f})}catch(C){console.error("Error:",a.url,C),le(c,500,C.message)}return}le(c,404,"Not found")}}var Ov,jt=Ce(()=>{Ov=require("url")});function mo(r,e={}){return fetch(r,{...e,headers:{...eM,...e.headers}})}var Ka,tn,Pv,Fi,Pp,ZO,Rn,ie,Iv,Mp,QO,Va,Mv,po,Ya,fo,Ip,Zn,Nv,Dv,Lv,ho,Bv,jv,eM,bt=Ce(()=>{Ka=K(require("dns"),1),tn=K(require("path"),1),Pv=K(require("os"),1),Fi="9remote",Pp=process.env.NREMOTE_REGISTRY||`https://registry.npmjs.org/${Fi}/latest`,ZO=`${Fi}@latest`,Rn=tn.default.join(Pv.default.homedir(),".9remote"),ie={ROOT:Rn,LOGS:tn.default.join(Rn,"logs"),STATE:tn.default.join(Rn,"state"),CONFIG:tn.default.join(Rn,"config"),BIN:tn.default.join(Rn,"bin"),PIDS:tn.default.join(Rn,"pids"),BUFFERS:tn.default.join(Rn,"buffers"),DAEMON:tn.default.join(Rn,"daemon")},Iv=new Ka.default.promises.Resolver;Iv.setServers(["1.1.1.1","1.0.0.1","8.8.8.8"]);Mp=Ka.default.lookup,QO=/^(\d{1,3}\.){3}\d{1,3}$|^::1$|^[0-9a-f:]+$/i;Ka.default.lookup=(r,e,t)=>{if(typeof e=="function"&&(t=e,e={}),r==="localhost"||QO.test(r))return Mp(r,e,t);Iv.resolve4(r).then(n=>{if(!n?.length)return Mp(r,e,t);e.all?t(null,n.map(i=>({address:i,family:4}))):t(null,n[0],4)}).catch(()=>Mp(r,e,t))};Va=2208,Mv=5173,po="local-ui",Ya=[`http://localhost:${Va}`,`http://127.0.0.1:${Va}`,`http://localhost:${Mv}`,`http://127.0.0.1:${Mv}`],fo={fileName:"agent.log",rotatedName:"agent.log.1",maxBytes:2*1024*1024,cleanupAfterDays:7},Ip=60,Zn={STOPPED:0,PREPARING:1,CONNECTING:2,TUNNELING:3,VERIFYING:4,READY:5},Nv=5e3,Dv=1e3,Lv=6e4,ho={CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN:"1"},Bv=["claude","codex","gemini","opencode","grok","cursor","antigravity","kiro","copilot","codebuddy","factory","qoder","rovodev","hermes","amp","pi"],jv={claude:"Claude",codex:"Codex",gemini:"Gemini",opencode:"OpenCode",grok:"Grok",cursor:"Cursor",antigravity:"Antigravity",kiro:"Kiro",copilot:"Copilot",codebuddy:"CodeBuddy",factory:"Factory",qoder:"Qoder",rovodev:"Rovo Dev",hermes:"Hermes",amp:"Amp",pi:"Pi"},eM={Accept:"application/json, text/plain, */*","Accept-Language":"en-US,en;q=0.9","Cache-Control":"no-cache",Pragma:"no-cache","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"}});function tM(){Br.default.existsSync(Ja)||Br.default.mkdirSync(Ja,{recursive:!0})}function rM(){try{if(Br.default.statSync(Xa).size<fo.maxBytes)return;try{Br.default.rmSync(Za,{force:!0})}catch{}Br.default.renameSync(Xa,Za)}catch{}}function nM(){try{let r=Br.default.statSync(Za);Date.now()-r.mtimeMs>fo.cleanupAfterDays*864e5&&Br.default.rmSync(Za,{force:!0})}catch{}}function Bp(r){try{rM(),Br.default.appendFileSync(Xa,r+`
|
|
3
|
+
`)}catch{}}function Np(r){return r.map(e=>{if(e instanceof Error)return e.stack||e.message;if(typeof e=="object")try{return JSON.stringify(e)}catch{return String(e)}return String(e)}).join(" ")}function Hv(){let r=new Date,e=(t,n=2)=>String(t).padStart(n,"0");return`${e(r.getHours())}:${e(r.getMinutes())}:${e(r.getSeconds())}.${e(r.getMilliseconds(),3)}`}function oM(r){return String(r).replace(iM,"").replace(sM,"").replace(/\s+$/g,"")}function go(r,e,t){let n=oM(t);if(!n)return;let i=e==="info"?r:`${r}:${e}`,s=`${Hv()} [${i}] ${n}`;if(Bp(s),Dp)try{Dp(s)}catch{}}function aM(){process.on("uncaughtException",r=>go("crash","error",`uncaughtException: ${r?.stack||r?.message||r}`)),process.on("unhandledRejection",r=>{let e=r instanceof Error?r.stack||r.message:String(r);go("crash","error",`unhandledRejection: ${e}`)}),process.on("exit",r=>Bp(`${Hv()} [exit] code=${r} pid=${process.pid}`))}function qv(){Fv||(Fv=!0,tM(),nM(),Bp(`
|
|
4
|
+
=== SESSION ${new Date().toISOString()} pid=${process.pid} argv=${process.argv.slice(2).join(" ")} ===`),aM())}function Uv(r){Dp=r}function $v(r=60){try{return Br.default.readFileSync(Xa,"utf8").split(`
|
|
5
|
+
`).filter(Boolean).slice(-r)}catch{return[]}}function On(r){return{info:(...e)=>go(r,"info",Np(e)),warn:(...e)=>go(r,"warn",Np(e)),error:(...e)=>go(r,"error",Np(e))}}var Br,Lp,Ja,Xa,Za,Fv,Dp,iM,sM,Hi=Ce(()=>{Br=K(require("fs"),1),Lp=K(require("path"),1);bt();Ja=ie.LOGS,Xa=Lp.default.join(Ja,fo.fileName),Za=Lp.default.join(Ja,fo.rotatedName),Fv=!1,Dp=null;iM=/\x1b\[[0-9;]*m/g,sM=/https?:\/\/[^\s]+/g});var Vv=A((D4,jp)=>{"use strict";jp.exports=zv;jp.exports.preferredCharsets=zv;var cM=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function lM(r){for(var e=r.split(","),t=0,n=0;t<e.length;t++){var i=uM(e[t].trim(),t);i&&(e[n++]=i)}return e.length=n,e}function uM(r,e){var t=cM.exec(r);if(!t)return null;var n=t[1],i=1;if(t[2])for(var s=t[2].split(";"),o=0;o<s.length;o++){var a=s[o].trim().split("=");if(a[0]==="q"){i=parseFloat(a[1]);break}}return{charset:n,q:i,i:e}}function pM(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=fM(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function fM(r,e,t){var n=0;if(e.charset.toLowerCase()===r.toLowerCase())n|=1;else if(e.charset!=="*")return null;return{i:t,o:e.i,q:e.q,s:n}}function zv(r,e){var t=lM(r===void 0?"*":r||"");if(!e)return t.filter(Gv).sort(Wv).map(dM);var n=e.map(function(s,o){return pM(s,t,o)});return n.filter(Gv).sort(Wv).map(function(s){return e[n.indexOf(s)]})}function Wv(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function dM(r){return r.charset}function Gv(r){return r.q>0}});var Zv=A((L4,Fp)=>{"use strict";Fp.exports=Xv;Fp.exports.preferredEncodings=Xv;var hM=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function mM(r){for(var e=r.split(","),t=!1,n=1,i=0,s=0;i<e.length;i++){var o=gM(e[i].trim(),i);o&&(e[s++]=o,t=t||Jv("identity",o),n=Math.min(n,o.q||1))}return t||(e[s++]={encoding:"identity",q:n,i}),e.length=s,e}function gM(r,e){var t=hM.exec(r);if(!t)return null;var n=t[1],i=1;if(t[2])for(var s=t[2].split(";"),o=0;o<s.length;o++){var a=s[o].trim().split("=");if(a[0]==="q"){i=parseFloat(a[1]);break}}return{encoding:n,q:i,i:e}}function vM(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=Jv(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function Jv(r,e,t){var n=0;if(e.encoding.toLowerCase()===r.toLowerCase())n|=1;else if(e.encoding!=="*")return null;return{i:t,o:e.i,q:e.q,s:n}}function Xv(r,e){var t=mM(r||"");if(!e)return t.filter(Yv).sort(Kv).map(yM);var n=e.map(function(s,o){return vM(s,t,o)});return n.filter(Yv).sort(Kv).map(function(s){return e[n.indexOf(s)]})}function Kv(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function yM(r){return r.encoding}function Yv(r){return r.q>0}});var ny=A((B4,Hp)=>{"use strict";Hp.exports=ry;Hp.exports.preferredLanguages=ry;var xM=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function _M(r){for(var e=r.split(","),t=0,n=0;t<e.length;t++){var i=ty(e[t].trim(),t);i&&(e[n++]=i)}return e.length=n,e}function ty(r,e){var t=xM.exec(r);if(!t)return null;var n=t[1],i=t[2],s=n;i&&(s+="-"+i);var o=1;if(t[3])for(var a=t[3].split(";"),c=0;c<a.length;c++){var l=a[c].split("=");l[0]==="q"&&(o=parseFloat(l[1]))}return{prefix:n,suffix:i,q:o,i:e,full:s}}function bM(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=wM(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function wM(r,e,t){var n=ty(r);if(!n)return null;var i=0;if(e.full.toLowerCase()===n.full.toLowerCase())i|=4;else if(e.prefix.toLowerCase()===n.full.toLowerCase())i|=2;else if(e.full.toLowerCase()===n.prefix.toLowerCase())i|=1;else if(e.full!=="*")return null;return{i:t,o:e.i,q:e.q,s:i}}function ry(r,e){var t=_M(r===void 0?"*":r||"");if(!e)return t.filter(ey).sort(Qv).map(SM);var n=e.map(function(s,o){return bM(s,t,o)});return n.filter(ey).sort(Qv).map(function(s){return e[n.indexOf(s)]})}function Qv(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function SM(r){return r.full}function ey(r){return r.q>0}});var ly=A((j4,qp)=>{"use strict";qp.exports=ay;qp.exports.preferredMediaTypes=ay;var EM=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function TM(r){for(var e=OM(r),t=0,n=0;t<e.length;t++){var i=oy(e[t].trim(),t);i&&(e[n++]=i)}return e.length=n,e}function oy(r,e){var t=EM.exec(r);if(!t)return null;var n=Object.create(null),i=1,s=t[2],o=t[1];if(t[3])for(var a=MM(t[3]).map(RM),c=0;c<a.length;c++){var l=a[c],u=l[0].toLowerCase(),f=l[1],h=f&&f[0]==='"'&&f[f.length-1]==='"'?f.substr(1,f.length-2):f;if(u==="q"){i=parseFloat(h);break}n[u]=h}return{type:o,subtype:s,params:n,q:i,i:e}}function CM(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=kM(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function kM(r,e,t){var n=oy(r),i=0;if(!n)return null;if(e.type.toLowerCase()==n.type.toLowerCase())i|=4;else if(e.type!="*")return null;if(e.subtype.toLowerCase()==n.subtype.toLowerCase())i|=2;else if(e.subtype!="*")return null;var s=Object.keys(e.params);if(s.length>0)if(s.every(function(o){return e.params[o]=="*"||(e.params[o]||"").toLowerCase()==(n.params[o]||"").toLowerCase()}))i|=1;else return null;return{i:t,o:e.i,q:e.q,s:i}}function ay(r,e){var t=TM(r===void 0?"*/*":r||"");if(!e)return t.filter(sy).sort(iy).map(AM);var n=e.map(function(s,o){return CM(s,t,o)});return n.filter(sy).sort(iy).map(function(s){return e[n.indexOf(s)]})}function iy(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function AM(r){return r.type+"/"+r.subtype}function sy(r){return r.q>0}function cy(r){for(var e=0,t=0;(t=r.indexOf('"',t))!==-1;)e++,t++;return e}function RM(r){var e=r.indexOf("="),t,n;return e===-1?t=r:(t=r.substr(0,e),n=r.substr(e+1)),[t,n]}function OM(r){for(var e=r.split(","),t=1,n=0;t<e.length;t++)cy(e[n])%2==0?e[++n]=e[t]:e[n]+=","+e[t];return e.length=n+1,e}function MM(r){for(var e=r.split(";"),t=1,n=0;t<e.length;t++)cy(e[n])%2==0?e[++n]=e[t]:e[n]+=";"+e[t];e.length=n+1;for(var t=0;t<e.length;t++)e[t]=e[t].trim();return e}});var uy=A((F4,Up)=>{"use strict";var PM=Vv(),IM=Zv(),NM=ny(),DM=ly();Up.exports=pe;Up.exports.Negotiator=pe;function pe(r){if(!(this instanceof pe))return new pe(r);this.request=r}pe.prototype.charset=function(e){var t=this.charsets(e);return t&&t[0]};pe.prototype.charsets=function(e){return PM(this.request.headers["accept-charset"],e)};pe.prototype.encoding=function(e){var t=this.encodings(e);return t&&t[0]};pe.prototype.encodings=function(e){return IM(this.request.headers["accept-encoding"],e)};pe.prototype.language=function(e){var t=this.languages(e);return t&&t[0]};pe.prototype.languages=function(e){return NM(this.request.headers["accept-language"],e)};pe.prototype.mediaType=function(e){var t=this.mediaTypes(e);return t&&t[0]};pe.prototype.mediaTypes=function(e){return DM(this.request.headers.accept,e)};pe.prototype.preferredCharset=pe.prototype.charset;pe.prototype.preferredCharsets=pe.prototype.charsets;pe.prototype.preferredEncoding=pe.prototype.encoding;pe.prototype.preferredEncodings=pe.prototype.encodings;pe.prototype.preferredLanguage=pe.prototype.language;pe.prototype.preferredLanguages=pe.prototype.languages;pe.prototype.preferredMediaType=pe.prototype.mediaType;pe.prototype.preferredMediaTypes=pe.prototype.mediaTypes});var py=A((H4,LM)=>{LM.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}});var dy=A((q4,fy)=>{fy.exports=py()});var gy=A(Ft=>{"use strict";var Qa=dy(),BM=require("path").extname,hy=/^\s*([^;\s]*)(?:;|\s|$)/,jM=/^text\//i;Ft.charset=my;Ft.charsets={lookup:my};Ft.contentType=FM;Ft.extension=HM;Ft.extensions=Object.create(null);Ft.lookup=qM;Ft.types=Object.create(null);UM(Ft.extensions,Ft.types);function my(r){if(!r||typeof r!="string")return!1;var e=hy.exec(r),t=e&&Qa[e[1].toLowerCase()];return t&&t.charset?t.charset:e&&jM.test(e[1])?"UTF-8":!1}function FM(r){if(!r||typeof r!="string")return!1;var e=r.indexOf("/")===-1?Ft.lookup(r):r;if(!e)return!1;if(e.indexOf("charset")===-1){var t=Ft.charset(e);t&&(e+="; charset="+t.toLowerCase())}return e}function HM(r){if(!r||typeof r!="string")return!1;var e=hy.exec(r),t=e&&Ft.extensions[e[1].toLowerCase()];return!t||!t.length?!1:t[0]}function qM(r){if(!r||typeof r!="string")return!1;var e=BM("x."+r).toLowerCase().substr(1);return e&&Ft.types[e]||!1}function UM(r,e){var t=["nginx","apache",void 0,"iana"];Object.keys(Qa).forEach(function(i){var s=Qa[i],o=s.extensions;if(!(!o||!o.length)){r[i]=o;for(var a=0;a<o.length;a++){var c=o[a];if(e[c]){var l=t.indexOf(Qa[e[c]].source),u=t.indexOf(s.source);if(e[c]!=="application/octet-stream"&&(l>u||l===u&&e[c].substr(0,12)==="application/"))continue}e[c]=i}}})}});var ec=A(($4,vy)=>{"use strict";var $M=uy(),WM=gy();vy.exports=Kt;function Kt(r){if(!(this instanceof Kt))return new Kt(r);this.headers=r.headers,this.negotiator=new $M(r)}Kt.prototype.type=Kt.prototype.types=function(r){var e=r;if(e&&!Array.isArray(e)){e=new Array(arguments.length);for(var t=0;t<e.length;t++)e[t]=arguments[t]}if(!e||e.length===0)return this.negotiator.mediaTypes();if(!this.headers.accept)return e[0];var n=e.map(GM),i=this.negotiator.mediaTypes(n.filter(zM)),s=i[0];return s?e[n.indexOf(s)]:!1};Kt.prototype.encoding=Kt.prototype.encodings=function(r){var e=r;if(e&&!Array.isArray(e)){e=new Array(arguments.length);for(var t=0;t<e.length;t++)e[t]=arguments[t]}return!e||e.length===0?this.negotiator.encodings():this.negotiator.encodings(e)[0]||!1};Kt.prototype.charset=Kt.prototype.charsets=function(r){var e=r;if(e&&!Array.isArray(e)){e=new Array(arguments.length);for(var t=0;t<e.length;t++)e[t]=arguments[t]}return!e||e.length===0?this.negotiator.charsets():this.negotiator.charsets(e)[0]||!1};Kt.prototype.lang=Kt.prototype.langs=Kt.prototype.language=Kt.prototype.languages=function(r){var e=r;if(e&&!Array.isArray(e)){e=new Array(arguments.length);for(var t=0;t<e.length;t++)e[t]=arguments[t]}return!e||e.length===0?this.negotiator.languages():this.negotiator.languages(e)[0]||!1};function GM(r){return r.indexOf("/")===-1?WM.lookup(r):r}function zM(r){return typeof r=="string"}});var Wp=A((yy,xy)=>{var vo=require("crypto"),$p=function(){};$p.prototype.getRandomBytes=function(r){var e=4096,t=this;if(r=r||12,r>e)return vo.randomBytes(r);var n=parseInt(e/r),i=parseInt(n*.85);if(!i||(this.bytesBufferIndex==null&&(this.bytesBufferIndex=-1),this.bytesBufferIndex==n&&(this.bytesBuffer=null,this.bytesBufferIndex=-1),(this.bytesBufferIndex==-1||this.bytesBufferIndex>i)&&(this.isGeneratingBytes||(this.isGeneratingBytes=!0,vo.randomBytes(e,function(o,a){t.bytesBuffer=a,t.bytesBufferIndex=0,t.isGeneratingBytes=!1})),this.bytesBufferIndex==-1)))return vo.randomBytes(r);var s=this.bytesBuffer.slice(r*this.bytesBufferIndex,r*(this.bytesBufferIndex+1));return this.bytesBufferIndex++,s};$p.prototype.generateId=function(){var r=Buffer.alloc(15);return r.writeInt32BE?(this.sequenceNumber=this.sequenceNumber+1|0,r.writeInt32BE(this.sequenceNumber,11),vo.randomBytes?this.getRandomBytes(12).copy(r):[0,4,8].forEach(function(e){r.writeInt32BE(Math.random()*Math.pow(2,32)|0,e)}),r.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()};yy=xy.exports=new $p});var tc=A(Mn=>{"use strict";Object.defineProperty(Mn,"__esModule",{value:!0});Mn.ERROR_PACKET=Mn.PACKET_TYPES_REVERSE=Mn.PACKET_TYPES=void 0;var jr=Object.create(null);Mn.PACKET_TYPES=jr;jr.open="0";jr.close="1";jr.ping="2";jr.pong="3";jr.message="4";jr.upgrade="5";jr.noop="6";var _y=Object.create(null);Mn.PACKET_TYPES_REVERSE=_y;Object.keys(jr).forEach(r=>{_y[jr[r]]=r});var VM={type:"error",data:"parser error"};Mn.ERROR_PACKET=VM});var wy=A(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.encodePacket=void 0;qi.encodePacketToBinary=JM;var KM=tc(),YM=({type:r,data:e},t,n)=>e instanceof ArrayBuffer||ArrayBuffer.isView(e)?n(t?e:"b"+by(e,!0).toString("base64")):n(KM.PACKET_TYPES[r]+(e||""));qi.encodePacket=YM;var by=(r,e)=>Buffer.isBuffer(r)||r instanceof Uint8Array&&!e?r:r instanceof ArrayBuffer?Buffer.from(r):Buffer.from(r.buffer,r.byteOffset,r.byteLength),Gp;function JM(r,e){if(r.data instanceof ArrayBuffer||ArrayBuffer.isView(r.data))return e(by(r.data,!1));(0,qi.encodePacket)(r,!0,t=>{Gp||(Gp=new TextEncoder),e(Gp.encode(t))})}});var Ey=A(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});nc.decodePacket=void 0;var rc=tc(),XM=(r,e)=>{if(typeof r!="string")return{type:"message",data:Sy(r,e)};let t=r.charAt(0);if(t==="b"){let n=Buffer.from(r.substring(1),"base64");return{type:"message",data:Sy(n,e)}}return rc.PACKET_TYPES_REVERSE[t]?r.length>1?{type:rc.PACKET_TYPES_REVERSE[t],data:r.substring(1)}:{type:rc.PACKET_TYPES_REVERSE[t]}:rc.ERROR_PACKET};nc.decodePacket=XM;var Sy=(r,e)=>e==="arraybuffer"?r instanceof ArrayBuffer?r:Buffer.isBuffer(r)?r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength):r.buffer:Buffer.isBuffer(r)?r:Buffer.from(r)});var yo=A(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.decodePayload=Ht.decodePacket=Ht.encodePayload=Ht.encodePacket=Ht.protocol=void 0;Ht.createPacketEncoderStream=eP;Ht.createPacketDecoderStream=tP;var Vp=wy();Object.defineProperty(Ht,"encodePacket",{enumerable:!0,get:function(){return Vp.encodePacket}});var Kp=Ey();Object.defineProperty(Ht,"decodePacket",{enumerable:!0,get:function(){return Kp.decodePacket}});var Ty=tc(),Cy="",ZM=(r,e)=>{let t=r.length,n=new Array(t),i=0;r.forEach((s,o)=>{(0,Vp.encodePacket)(s,!1,a=>{n[o]=a,++i===t&&e(n.join(Cy))})})};Ht.encodePayload=ZM;var QM=(r,e)=>{let t=r.split(Cy),n=[];for(let i=0;i<t.length;i++){let s=(0,Kp.decodePacket)(t[i],e);if(n.push(s),s.type==="error")break}return n};Ht.decodePayload=QM;function eP(){return new TransformStream({transform(r,e){(0,Vp.encodePacketToBinary)(r,t=>{let n=t.length,i;if(n<126)i=new Uint8Array(1),new DataView(i.buffer).setUint8(0,n);else if(n<65536){i=new Uint8Array(3);let s=new DataView(i.buffer);s.setUint8(0,126),s.setUint16(1,n)}else{i=new Uint8Array(9);let s=new DataView(i.buffer);s.setUint8(0,127),s.setBigUint64(1,BigInt(n))}r.data&&typeof r.data!="string"&&(i[0]|=128),e.enqueue(i),e.enqueue(t)})}})}var zp;function ic(r){return r.reduce((e,t)=>e+t.length,0)}function sc(r,e){if(r[0].length===e)return r.shift();let t=new Uint8Array(e),n=0;for(let i=0;i<e;i++)t[i]=r[0][n++],n===r[0].length&&(r.shift(),n=0);return r.length&&n<r[0].length&&(r[0]=r[0].slice(n)),t}function tP(r,e){zp||(zp=new TextDecoder);let t=[],n=0,i=-1,s=!1;return new TransformStream({transform(o,a){for(t.push(o);;){if(n===0){if(ic(t)<1)break;let c=sc(t,1);s=(c[0]&128)===128,i=c[0]&127,i<126?n=3:i===126?n=1:n=2}else if(n===1){if(ic(t)<2)break;let c=sc(t,2);i=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),n=3}else if(n===2){if(ic(t)<8)break;let c=sc(t,8),l=new DataView(c.buffer,c.byteOffset,c.length),u=l.getUint32(0);if(u>Math.pow(2,21)-1){a.enqueue(Ty.ERROR_PACKET);break}i=u*Math.pow(2,32)+l.getUint32(4),n=3}else{if(ic(t)<i)break;let c=sc(t,i);a.enqueue((0,Kp.decodePacket)(s?c:zp.decode(c),e)),n=0}if(i===0||i>r){a.enqueue(Ty.ERROR_PACKET);break}}}})}Ht.protocol=4});var Oy=A((K4,Ry)=>{var Pn=String.fromCharCode;function ky(r){for(var e=[],t=0,n=r.length,i,s;t<n;)i=r.charCodeAt(t++),i>=55296&&i<=56319&&t<n?(s=r.charCodeAt(t++),(s&64512)==56320?e.push(((i&1023)<<10)+(s&1023)+65536):(e.push(i),t--)):e.push(i);return e}function rP(r){for(var e=r.length,t=-1,n,i="";++t<e;)n=r[t],n>65535&&(n-=65536,i+=Pn(n>>>10&1023|55296),n=56320|n&1023),i+=Pn(n);return i}function Ay(r,e){if(r>=55296&&r<=57343){if(e)throw Error("Lone surrogate U+"+r.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function Yp(r,e){return Pn(r>>e&63|128)}function nP(r,e){if((r&4294967168)==0)return Pn(r);var t="";return(r&4294965248)==0?t=Pn(r>>6&31|192):(r&4294901760)==0?(Ay(r,e)||(r=65533),t=Pn(r>>12&15|224),t+=Yp(r,6)):(r&4292870144)==0&&(t=Pn(r>>18&7|240),t+=Yp(r,12),t+=Yp(r,6)),t+=Pn(r&63|128),t}function iP(r,e){e=e||{};for(var t=e.strict!==!1,n=ky(r),i=n.length,s=-1,o,a="";++s<i;)o=n[s],a+=nP(o,t);return a}function Ui(){if(In>=ac)throw Error("Invalid byte index");var r=oc[In]&255;if(In++,(r&192)==128)return r&63;throw Error("Invalid continuation byte")}function sP(r){var e,t,n,i,s;if(In>ac)throw Error("Invalid byte index");if(In==ac)return!1;if(e=oc[In]&255,In++,(e&128)==0)return e;if((e&224)==192){if(t=Ui(),s=(e&31)<<6|t,s>=128)return s;throw Error("Invalid continuation byte")}if((e&240)==224){if(t=Ui(),n=Ui(),s=(e&15)<<12|t<<6|n,s>=2048)return Ay(s,r)?s:65533;throw Error("Invalid continuation byte")}if((e&248)==240&&(t=Ui(),n=Ui(),i=Ui(),s=(e&7)<<18|t<<12|n<<6|i,s>=65536&&s<=1114111))return s;throw Error("Invalid UTF-8 detected")}var oc,ac,In;function oP(r,e){e=e||{};var t=e.strict!==!1;oc=ky(r),ac=oc.length,In=0;for(var n=[],i;(i=sP(t))!==!1;)n.push(i);return rP(n)}Ry.exports={version:"2.1.2",encode:iP,decode:oP}});var jy=A(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.packets=ft.protocol=void 0;ft.encodePacket=Jp;ft.encodeBase64Packet=Iy;ft.decodePacket=Xp;ft.decodeBase64Packet=Ny;ft.encodePayload=uP;ft.decodePayload=fP;ft.encodePayloadAsBinary=Ly;ft.decodePayloadAsBinary=By;var Py=Oy();ft.protocol=3;var aP=r=>{for(let e of r)if(e.data instanceof ArrayBuffer||ArrayBuffer.isView(e.data))return!0;return!1};ft.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6};var $i=Object.keys(ft.packets),Er={type:"error",data:"parser error"},cP=Buffer.concat([]);function Jp(r,e,t,n){if(typeof e=="function"&&(n=e,e=null),typeof t=="function"&&(n=t,t=null),Buffer.isBuffer(r.data))return My(r,e,n);if(r.data&&(r.data.buffer||r.data)instanceof ArrayBuffer)return My({type:r.type,data:Zp(r.data)},e,n);var i=ft.packets[r.type];return r.data!==void 0&&(i+=t?Py.encode(String(r.data),{strict:!1}):String(r.data)),n(""+i)}function My(r,e,t){if(!e)return Iy(r,t);var n=r.data,i=Buffer.allocUnsafe(1);return i[0]=ft.packets[r.type],t(Buffer.concat([i,n]))}function Iy(r,e){var t=Buffer.isBuffer(r.data)?r.data:Zp(r.data),n="b"+ft.packets[r.type];return n+=t.toString("base64"),e(n)}function Xp(r,e,t){if(r===void 0)return Er;let n;if(typeof r=="string")return n=r.charAt(0),n==="b"?Ny(r.slice(1),e):t&&(r=lP(r),r===!1)||Number(n)!=n||!$i[n]?Er:r.length>1?{type:$i[n],data:r.slice(1)}:{type:$i[n]};if(e==="arraybuffer"){var i=new Uint8Array(r);return n=i[0],{type:$i[n],data:i.buffer.slice(1)}}return r instanceof ArrayBuffer&&(r=Zp(r)),n=r[0],{type:$i[n],data:r.slice(1)}}function lP(r){try{r=Py.decode(r,{strict:!1})}catch{return!1}return r}function Ny(r,e){var t=$i[r.charAt(0)],n=Buffer.from(r.slice(1),"base64");if(e==="arraybuffer"){for(var i=new Uint8Array(n.length),s=0;s<i.length;s++)i[s]=n[s];n=i.buffer}return{type:t,data:n}}function uP(r,e,t){if(typeof e=="function"&&(t=e,e=null),e&&aP(r))return Ly(r,t);if(!r.length)return t("0:");function n(i,s){Jp(i,e,!1,function(o){s(null,pP(o))})}Dy(r,n,function(i,s){return t(s.join(""))})}function pP(r){return r.length+":"+r}function Dy(r,e,t){let n=new Array(r.length),i=0;for(let s=0;s<r.length;s++)e(r[s],(o,a)=>{n[s]=a,++i===r.length&&t(null,n)})}function fP(r,e,t){if(typeof r!="string")return By(r,e,t);if(typeof e=="function"&&(t=e,e=null),r==="")return t(Er,0,1);for(var n="",i,s,o,a=0,c=r.length;a<c;a++){var l=r.charAt(a);if(l!==":"){n+=l;continue}if(n===""||n!=(i=Number(n))||(s=r.slice(a+1,a+1+i),n!=s.length))return t(Er,0,1);if(s.length){if(o=Xp(s,e,!1),Er.type===o.type&&Er.data===o.data)return t(Er,0,1);var u=t(o,a+i,c);if(u===!1)return}a+=i,n=""}if(n!=="")return t(Er,0,1)}function dP(r){for(var e="",t=0,n=r.length;t<n;t++)e+=String.fromCharCode(r[t]);return e}function hP(r){for(var e=Buffer.allocUnsafe(r.length),t=0,n=r.length;t<n;t++)e.writeUInt8(r.charCodeAt(t),t);return e}function Zp(r){var e=r.byteLength||r.length,t=r.byteOffset||0;return Buffer.from(r.buffer||r,t,e)}function Ly(r,e){if(!r.length)return e(cP);Dy(r,mP,function(t,n){return e(Buffer.concat(n))})}function mP(r,e){function t(n){var i=""+n.length,s;if(typeof n=="string"){s=Buffer.allocUnsafe(i.length+2),s[0]=0;for(var o=0;o<i.length;o++)s[o+1]=parseInt(i[o],10);return s[s.length-1]=255,e(null,Buffer.concat([s,hP(n)]))}s=Buffer.allocUnsafe(i.length+2),s[0]=1;for(var o=0;o<i.length;o++)s[o+1]=parseInt(i[o],10);s[s.length-1]=255,e(null,Buffer.concat([s,n]))}Jp(r,!0,!0,t)}function By(r,e,t){typeof e=="function"&&(t=e,e=null);for(var n=r,i=[],s;n.length>0;){var o="",a=n[0]===0;for(s=1;n[s]!==255;s++){if(o.length>310)return t(Er,0,1);o+=""+n[s]}n=n.slice(o.length+1);var c=parseInt(o,10),l=n.slice(1,c+1);a&&(l=dP(l)),i.push(l),n=n.slice(c+1)}var u=i.length;for(s=0;s<u;s++){var f=i[s];t(Xp(f,e,!0),s,u)}}});var Hy=A((J4,Fy)=>{var Wi=1e3,Gi=Wi*60,zi=Gi*60,Qn=zi*24,gP=Qn*7,vP=Qn*365.25;Fy.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return yP(r);if(t==="number"&&isFinite(r))return e.long?_P(r):xP(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function yP(r){if(r=String(r),!(r.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(r);if(e){var t=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return t*vP;case"weeks":case"week":case"w":return t*gP;case"days":case"day":case"d":return t*Qn;case"hours":case"hour":case"hrs":case"hr":case"h":return t*zi;case"minutes":case"minute":case"mins":case"min":case"m":return t*Gi;case"seconds":case"second":case"secs":case"sec":case"s":return t*Wi;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function xP(r){var e=Math.abs(r);return e>=Qn?Math.round(r/Qn)+"d":e>=zi?Math.round(r/zi)+"h":e>=Gi?Math.round(r/Gi)+"m":e>=Wi?Math.round(r/Wi)+"s":r+"ms"}function _P(r){var e=Math.abs(r);return e>=Qn?cc(r,e,Qn,"day"):e>=zi?cc(r,e,zi,"hour"):e>=Gi?cc(r,e,Gi,"minute"):e>=Wi?cc(r,e,Wi,"second"):r+" ms"}function cc(r,e,t,n){var i=e>=t*1.5;return Math.round(r/t)+" "+n+(i?"s":"")}});var Qp=A((X4,qy)=>{function bP(r){t.debug=t,t.default=t,t.coerce=c,t.disable=o,t.enable=i,t.enabled=a,t.humanize=Hy(),t.destroy=l,Object.keys(r).forEach(u=>{t[u]=r[u]}),t.names=[],t.skips=[],t.formatters={};function e(u){let f=0;for(let h=0;h<u.length;h++)f=(f<<5)-f+u.charCodeAt(h),f|=0;return t.colors[Math.abs(f)%t.colors.length]}t.selectColor=e;function t(u){let f,h=null,g,x;function S(...C){if(!S.enabled)return;let R=S,M=Number(new Date),I=M-(f||M);R.diff=I,R.prev=f,R.curr=M,f=M,C[0]=t.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let B=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(F,G)=>{if(F==="%%")return"%";B++;let D=t.formatters[G];if(typeof D=="function"){let U=C[B];F=D.call(R,U),C.splice(B,1),B--}return F}),t.formatArgs.call(R,C),(R.log||t.log).apply(R,C)}return S.namespace=u,S.useColors=t.useColors(),S.color=t.selectColor(u),S.extend=n,S.destroy=t.destroy,Object.defineProperty(S,"enabled",{enumerable:!0,configurable:!1,get:()=>h!==null?h:(g!==t.namespaces&&(g=t.namespaces,x=t.enabled(u)),x),set:C=>{h=C}}),typeof t.init=="function"&&t.init(S),S}function n(u,f){let h=t(this.namespace+(typeof f>"u"?":":f)+u);return h.log=this.log,h}function i(u){t.save(u),t.namespaces=u,t.names=[],t.skips=[];let f=(typeof u=="string"?u:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let h of f)h[0]==="-"?t.skips.push(h.slice(1)):t.names.push(h)}function s(u,f){let h=0,g=0,x=-1,S=0;for(;h<u.length;)if(g<f.length&&(f[g]===u[h]||f[g]==="*"))f[g]==="*"?(x=g,S=h,g++):(h++,g++);else if(x!==-1)g=x+1,S++,h=S;else return!1;for(;g<f.length&&f[g]==="*";)g++;return g===f.length}function o(){let u=[...t.names,...t.skips.map(f=>"-"+f)].join(",");return t.enable(""),u}function a(u){for(let f of t.skips)if(s(u,f))return!1;for(let f of t.names)if(s(u,f))return!0;return!1}function c(u){return u instanceof Error?u.stack||u.message:u}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}qy.exports=bP});var Uy=A((qt,lc)=>{qt.formatArgs=SP;qt.save=EP;qt.load=TP;qt.useColors=wP;qt.storage=CP();qt.destroy=(()=>{let r=!1;return()=>{r||(r=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();qt.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function wP(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let r;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(r=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(r[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function SP(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+lc.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;r.splice(1,0,e,"color: inherit");let t=0,n=0;r[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(t++,i==="%c"&&(n=t))}),r.splice(n,0,e)}qt.log=console.debug||console.log||(()=>{});function EP(r){try{r?qt.storage.setItem("debug",r):qt.storage.removeItem("debug")}catch{}}function TP(){let r;try{r=qt.storage.getItem("debug")||qt.storage.getItem("DEBUG")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function CP(){try{return localStorage}catch{}}lc.exports=Qp()(qt);var{formatters:kP}=lc.exports;kP.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Wy=A((Z4,$y)=>{"use strict";$y.exports=(r,e=process.argv)=>{let t=r.startsWith("-")?"":r.length===1?"-":"--",n=e.indexOf(t+r),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}});var Vy=A((Q4,zy)=>{"use strict";var AP=require("os"),Gy=require("tty"),sr=Wy(),{env:dt}=process,Nn;sr("no-color")||sr("no-colors")||sr("color=false")||sr("color=never")?Nn=0:(sr("color")||sr("colors")||sr("color=true")||sr("color=always"))&&(Nn=1);"FORCE_COLOR"in dt&&(dt.FORCE_COLOR==="true"?Nn=1:dt.FORCE_COLOR==="false"?Nn=0:Nn=dt.FORCE_COLOR.length===0?1:Math.min(parseInt(dt.FORCE_COLOR,10),3));function ef(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function tf(r,e){if(Nn===0)return 0;if(sr("color=16m")||sr("color=full")||sr("color=truecolor"))return 3;if(sr("color=256"))return 2;if(r&&!e&&Nn===void 0)return 0;let t=Nn||0;if(dt.TERM==="dumb")return t;if(process.platform==="win32"){let n=AP.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in dt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in dt)||dt.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in dt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(dt.TEAMCITY_VERSION)?1:0;if(dt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in dt){let n=parseInt((dt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(dt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(dt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(dt.TERM)||"COLORTERM"in dt?1:t}function RP(r){let e=tf(r,r&&r.isTTY);return ef(e)}zy.exports={supportsColor:RP,stdout:ef(tf(!0,Gy.isatty(1))),stderr:ef(tf(!0,Gy.isatty(2)))}});var Yy=A((ht,pc)=>{var OP=require("tty"),uc=require("util");ht.init=BP;ht.log=NP;ht.formatArgs=PP;ht.save=DP;ht.load=LP;ht.useColors=MP;ht.destroy=uc.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");ht.colors=[6,2,3,4,5,1];try{let r=Vy();r&&(r.stderr||r).level>=2&&(ht.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}ht.inspectOpts=Object.keys(process.env).filter(r=>/^debug_/i.test(r)).reduce((r,e)=>{let t=e.substring(6).toLowerCase().replace(/_([a-z])/g,(i,s)=>s.toUpperCase()),n=process.env[e];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),r[t]=n,r},{});function MP(){return"colors"in ht.inspectOpts?!!ht.inspectOpts.colors:OP.isatty(process.stderr.fd)}function PP(r){let{namespace:e,useColors:t}=this;if(t){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${i};1m${e} \x1B[0m`;r[0]=s+r[0].split(`
|
|
6
6
|
`).join(`
|
|
7
|
-
`+s),r.push(i+"m+"+
|
|
8
|
-
`)}function
|
|
9
|
-
`).map(e=>e.trim()).join(" ")};
|
|
10
|
-
`}),super.onData(e.replace(HP,"\\n")))}doWrite(e,t,n){let i=JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");e=this.head+i+this.foot,super.doWrite(e,t,n)}};hc.JSONP=nf});var Ky=A(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});mc.WebSocket=void 0;var UP=Zn(),$P=Ae(),Vy=(0,$P.default)("engine:ws"),sf=class extends UP.Transport{constructor(e){super(e),this._doSend=t=>{this.socket.send(t,this._onSent)},this._doSendLast=t=>{this.socket.send(t,this._onSentLast)},this._onSent=t=>{t&&this.onError("write error",t.stack)},this._onSentLast=t=>{t?this.onError("write error",t.stack):(this.emit("drain"),this.writable=!0,this.emit("ready"))},this.socket=e.websocket,this.socket.on("message",(t,n)=>{let i=n?t:t.toString();Vy('received "%s"',i),super.onData(i)}),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}send(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],i=t+1===e.length;this._canSendPreEncodedFrame(n)?this.socket._sender.sendFrame(n.options.wsPreEncodedFrame,i?this._onSentLast:this._onSent):this.parser.encodePacket(n,this.supportsBinary,i?this._doSendLast:this._doSend)}}_canSendPreEncodedFrame(e){var t,n,i;return!this.perMessageDeflate&&typeof((n=(t=this.socket)===null||t===void 0?void 0:t._sender)===null||n===void 0?void 0:n.sendFrame)=="function"&&((i=e.options)===null||i===void 0?void 0:i.wsPreEncodedFrame)!==void 0}doClose(e){Vy("closing"),this.socket.close(),e&&e()}};mc.WebSocket=sf});var af=A(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});gc.WebTransport=void 0;var WP=Zn(),GP=Ae(),zP=mo(),Gi=(0,GP.default)("engine:webtransport"),of=class extends WP.Transport{constructor(e,t,n){super({_query:{EIO:"4"}}),this.session=e;let i=(0,zP.createPacketEncoderStream)();i.readable.pipeTo(t.writable).catch(()=>{Gi("the stream was closed")}),this.writer=i.writable.getWriter(),(async()=>{try{for(;;){let{value:s,done:o}=await n.read();if(o){Gi("session is closed");break}Gi("received chunk: %o",s),this.onPacket(s)}}catch(s){Gi("error while reading: %s",s.message)}})(),e.closed.then(()=>this.onClose()),this.writable=!0}get name(){return"webtransport"}async send(e){this.writable=!1;try{for(let t=0;t<e.length;t++){let n=e[t];await this.writer.write(n)}}catch(t){Gi("error while writing: %s",t.message)}this.emit("drain"),this.writable=!0,this.emit("ready")}doClose(e){Gi("closing WebTransport session"),this.session.close(),e&&e()}};gc.WebTransport=of});var lf=A(cf=>{"use strict";Object.defineProperty(cf,"__esModule",{value:!0});var VP=rf(),KP=zy(),YP=Ky(),JP=af();cf.default={polling:Yy,websocket:YP.WebSocket,webtransport:JP.WebTransport};function Yy(r){return typeof r._query.j=="string"?new KP.JSONP(r):new VP.Polling(r)}Yy.upgradesTo=["websocket","webtransport"]});var pf=A(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.Socket=void 0;var XP=require("events"),ZP=Ae(),rn=require("timers"),Re=(0,ZP.default)("engine:socket"),uf=class extends XP.EventEmitter{get readyState(){return this._readyState}set readyState(e){Re("readyState updated from %s to %s",this._readyState,e),this._readyState=e}constructor(e,t,n,i,s){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=i,this.protocol=s,i&&(i.websocket&&i.websocket._socket?this.remoteAddress=i.websocket._socket.remoteAddress:this.remoteAddress=i.connection.remoteAddress),this.pingTimeoutTimer=null,this.pingIntervalTimer=null,this.setTransport(n),this.onOpen()}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"),this.protocol===3?this.resetPingTimeout():this.schedulePing()}onPacket(e){if(this.readyState!=="open")return Re("packet received with closed socket");switch(Re(`received packet ${e.type}`),this.emit("packet",e),e.type){case"ping":if(this.transport.protocol!==3){this.onError(new Error("invalid heartbeat direction"));return}Re("got ping"),this.pingTimeoutTimer.refresh(),this.sendPacket("pong"),this.emit("heartbeat");break;case"pong":if(this.transport.protocol===3){this.onError(new Error("invalid heartbeat direction"));return}Re("got pong"),(0,rn.clearTimeout)(this.pingTimeoutTimer),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);break}}onError(e){Re("transport error"),this.onClose("transport error",e)}schedulePing(){this.pingIntervalTimer=(0,rn.setTimeout)(()=>{Re("writing ping packet - expecting pong within %sms",this.server.opts.pingTimeout),this.sendPacket("ping"),this.resetPingTimeout()},this.server.opts.pingInterval)}resetPingTimeout(){(0,rn.clearTimeout)(this.pingTimeoutTimer),this.pingTimeoutTimer=(0,rn.setTimeout)(()=>{this.readyState!=="closed"&&this.onClose("ping timeout")},this.protocol===3?this.server.opts.pingInterval+this.server.opts.pingTimeout:this.server.opts.pingTimeout)}setTransport(e){let t=this.onError.bind(this),n=()=>this.flush(),i=this.onPacket.bind(this),s=this.onDrain.bind(this),o=this.onClose.bind(this,"transport close");this.transport=e,this.transport.once("error",t),this.transport.on("ready",n),this.transport.on("packet",i),this.transport.on("drain",s),this.transport.once("close",o),this.cleanupFn.push(function(){e.removeListener("error",t),e.removeListener("ready",n),e.removeListener("packet",i),e.removeListener("drain",s),e.removeListener("close",o)})}onDrain(){if(this.sentCallbackFn.length>0){Re("executing batch send callback");let e=this.sentCallbackFn.shift();if(e)for(let t=0;t<e.length;t++)e[t](this.transport)}}_maybeUpgrade(e){Re('might upgrade socket transport from "%s" to "%s"',this.transport.name,e.name),this.upgrading=!0;let t=(0,rn.setTimeout)(()=>{Re("client did not complete upgrade - closing transport"),o(),e.readyState==="open"&&e.close()},this.server.opts.upgradeTimeout),n,i=u=>{u.type==="ping"&&u.data==="probe"?(Re("got probe ping packet, sending pong"),e.send([{type:"pong",data:"probe"}]),this.emit("upgrading",e),clearInterval(n),n=setInterval(s,100)):u.type==="upgrade"&&this.readyState!=="closed"?(Re("got upgrade packet - upgrading"),o(),this.transport.discard(),this.upgraded=!0,this.clearTransport(),this.setTransport(e),this.emit("upgrade",e),this.flush(),this.readyState==="closing"&&e.close(()=>{this.onClose("forced close")})):(o(),e.close())},s=()=>{this.transport.name==="polling"&&this.transport.writable&&(Re("writing a noop packet to polling for fast upgrade"),this.transport.send([{type:"noop"}]))},o=()=>{this.upgrading=!1,clearInterval(n),(0,rn.clearTimeout)(t),e.removeListener("packet",i),e.removeListener("close",c),e.removeListener("error",a),this.removeListener("close",l)},a=u=>{Re("client did not complete upgrade - %s",u),o(),e.close(),e=null},c=()=>{a("transport closed")},l=()=>{a("socket closed")};e.on("packet",i),e.once("close",c),e.once("error",a),this.once("close",l)}clearTransport(){let e,t=this.cleanupFn.length;for(let n=0;n<t;n++)e=this.cleanupFn.shift(),e();this.transport.on("error",function(){Re("error triggered by discarded transport")}),this.transport.close(),(0,rn.clearTimeout)(this.pingTimeoutTimer)}onClose(e,t){this.readyState!=="closed"&&(this.readyState="closed",(0,rn.clearTimeout)(this.pingIntervalTimer),(0,rn.clearTimeout)(this.pingTimeoutTimer),process.nextTick(()=>{this.writeBuffer=[]}),this.packetsFn=[],this.sentCallbackFn=[],this.clearTransport(),this.emit("close",e,t))}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={},i){if(typeof n=="function"&&(i=n,n={}),this.readyState!=="closing"&&this.readyState!=="closed"){Re('sending packet "%s" (%s)',e,t),n.compress=n.compress!==!1;let s={type:e,options:n};t&&(s.data=t),this.emit("packetCreate",s),this.writeBuffer.push(s),typeof i=="function"&&this.packetsFn.push(i),this.flush()}}flush(){if(this.readyState!=="closed"&&this.transport.writable&&this.writeBuffer.length){Re("flushing buffer to transport"),this.emit("flush",this.writeBuffer),this.server.emit("flush",this,this.writeBuffer);let e=this.writeBuffer;this.writeBuffer=[],this.packetsFn.length?(this.sentCallbackFn.push(this.packetsFn),this.packetsFn=[]):this.sentCallbackFn.push(null),this.transport.send(e),this.emit("drain"),this.server.emit("drain",this)}}getAvailableUpgrades(){let e=[],t=this.server.upgrades(this.transport.name);for(let n=0;n<t.length;++n){let i=t[n];this.server.opts.transports.indexOf(i)!==-1&&e.push(i)}return e}close(e){if(e&&(this.readyState==="open"||this.readyState==="closing"))return this.closeTransport(e);if(this.readyState==="open"){if(this.readyState="closing",this.writeBuffer.length){Re("there are %d remaining packets in the buffer, waiting for the 'drain' event",this.writeBuffer.length),this.once("drain",()=>{Re("all packets have been sent, closing the transport"),this.closeTransport(e)});return}Re("the buffer is empty, closing the transport right away"),this.closeTransport(e)}}closeTransport(e){Re("closing the transport (discard? %s)",!!e),e&&this.transport.discard(),this.transport.close(this.onClose.bind(this,"forced close"))}};vc.Socket=uf});var Zy=A(ff=>{"use strict";ff.parse=sI;ff.serialize=oI;var QP=Object.prototype.toString,eI=Object.prototype.hasOwnProperty,tI=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,rI=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,nI=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,iI=/^[\u0020-\u003A\u003D-\u007E]*$/;function sI(r,e){if(typeof r!="string")throw new TypeError("argument str must be a string");var t={},n=r.length;if(n<2)return t;var i=e&&e.decode||aI,s=0,o=0,a=0;do{if(o=r.indexOf("=",s),o===-1)break;if(a=r.indexOf(";",s),a===-1)a=n;else if(o>a){s=r.lastIndexOf(";",o-1)+1;continue}var c=Jy(r,s,o),l=Xy(r,o,c),u=r.slice(c,l);if(!eI.call(t,u)){var f=Jy(r,o+1,a),h=Xy(r,a,f);r.charCodeAt(f)===34&&r.charCodeAt(h-1)===34&&(f++,h--);var g=r.slice(f,h);t[u]=lI(g,i)}s=a+1}while(s<n);return t}function Jy(r,e,t){do{var n=r.charCodeAt(e);if(n!==32&&n!==9)return e}while(++e<t);return t}function Xy(r,e,t){for(;e>t;){var n=r.charCodeAt(--e);if(n!==32&&n!==9)return e+1}return t}function oI(r,e,t){var n=t&&t.encode||encodeURIComponent;if(typeof n!="function")throw new TypeError("option encode is invalid");if(!tI.test(r))throw new TypeError("argument name is invalid");var i=n(e);if(!rI.test(i))throw new TypeError("argument val is invalid");var s=r+"="+i;if(!t)return s;if(t.maxAge!=null){var o=Math.floor(t.maxAge);if(!isFinite(o))throw new TypeError("option maxAge is invalid");s+="; Max-Age="+o}if(t.domain){if(!nI.test(t.domain))throw new TypeError("option domain is invalid");s+="; Domain="+t.domain}if(t.path){if(!iI.test(t.path))throw new TypeError("option path is invalid");s+="; Path="+t.path}if(t.expires){var a=t.expires;if(!cI(a)||isNaN(a.valueOf()))throw new TypeError("option expires is invalid");s+="; Expires="+a.toUTCString()}if(t.httpOnly&&(s+="; HttpOnly"),t.secure&&(s+="; Secure"),t.partitioned&&(s+="; Partitioned"),t.priority){var c=typeof t.priority=="string"?t.priority.toLowerCase():t.priority;switch(c){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(t.sameSite){var l=typeof t.sameSite=="string"?t.sameSite.toLowerCase():t.sameSite;switch(l){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}function aI(r){return r.indexOf("%")!==-1?decodeURIComponent(r):r}function cI(r){return QP.call(r)==="[object Date]"}function lI(r,e){try{return e(r)}catch{return r}}});var nn=A((Z4,t0)=>{"use strict";var Qy=["nodebuffer","arraybuffer","fragments"],e0=typeof Blob<"u";e0&&Qy.push("blob");t0.exports={BINARY_TYPES:Qy,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:e0,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var v0=A((Q4,g0)=>{var s0=require("fs"),sn=require("path"),o0=require("os"),a0=typeof __webpack_require__=="function"?__non_webpack_require__:require,uI=process.config&&process.config.variables||{},pI=!!process.env.PREBUILDS_ONLY,r0=process.versions.modules,df=hI()?"electron":dI()?"node-webkit":"node",hf=process.env.npm_config_arch||o0.arch(),mf=process.env.npm_config_platform||o0.platform(),c0=process.env.LIBC||(mI(mf)?"musl":"glibc"),gf=process.env.ARM_VERSION||(hf==="arm64"?"8":uI.arm_version)||"",l0=(process.versions.uv||"").split(".")[0];g0.exports=Fr;function Fr(r){return a0(Fr.resolve(r))}Fr.resolve=Fr.path=function(r){r=sn.resolve(r||".");try{var e=a0(sn.join(r,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[e+"_PREBUILD"]&&(r=process.env[e+"_PREBUILD"])}catch{}if(!pI){var t=n0(sn.join(r,"build/Release"),i0);if(t)return t;var n=n0(sn.join(r,"build/Debug"),i0);if(n)return n}var i=a(r);if(i)return i;var s=a(sn.dirname(process.execPath));if(s)return s;var o=["platform="+mf,"arch="+hf,"runtime="+df,"abi="+r0,"uv="+l0,gf?"armv="+gf:"","libc="+c0,"node="+process.versions.node,process.versions.electron?"electron="+process.versions.electron:"",typeof __webpack_require__=="function"?"webpack=true":""].filter(Boolean).join(" ");throw new Error("No native build was found for "+o+`
|
|
7
|
+
`+s),r.push(i+"m+"+pc.exports.humanize(this.diff)+"\x1B[0m")}else r[0]=IP()+e+" "+r[0]}function IP(){return ht.inspectOpts.hideDate?"":new Date().toISOString()+" "}function NP(...r){return process.stderr.write(uc.formatWithOptions(ht.inspectOpts,...r)+`
|
|
8
|
+
`)}function DP(r){r?process.env.DEBUG=r:delete process.env.DEBUG}function LP(){return process.env.DEBUG}function BP(r){r.inspectOpts={};let e=Object.keys(ht.inspectOpts);for(let t=0;t<e.length;t++)r.inspectOpts[e[t]]=ht.inspectOpts[e[t]]}pc.exports=Qp()(ht);var{formatters:Ky}=pc.exports;Ky.o=function(r){return this.inspectOpts.colors=this.useColors,uc.inspect(r,this.inspectOpts).split(`
|
|
9
|
+
`).map(e=>e.trim()).join(" ")};Ky.O=function(r){return this.inspectOpts.colors=this.useColors,uc.inspect(r,this.inspectOpts)}});var Ae=A((e6,rf)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?rf.exports=Uy():rf.exports=Yy()});var ei=A(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.Transport=void 0;var jP=require("events"),FP=yo(),HP=jy(),qP=Ae(),Jy=(0,qP.default)("engine:transport");function UP(){}var fc=class extends jP.EventEmitter{get readyState(){return this._readyState}set readyState(e){Jy("readyState updated from %s to %s (%s)",this._readyState,e,this.name),this._readyState=e}constructor(e){super(),this.writable=!1,this._readyState="open",this.discarded=!1,this.protocol=e._query.EIO==="4"?4:3,this.parser=this.protocol===4?FP:HP,this.supportsBinary=!(e._query&&e._query.b64)}discard(){this.discarded=!0}onRequest(e){}close(e){this.readyState==="closed"||this.readyState==="closing"||(this.readyState="closing",this.doClose(e||UP))}onError(e,t){if(this.listeners("error").length){let n=new Error(e);n.type="TransportError",n.description=t,this.emit("error",n)}else Jy("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")}};dc.Transport=fc;fc.upgradesTo=[]});var sf=A(hc=>{"use strict";Object.defineProperty(hc,"__esModule",{value:!0});hc.Polling=void 0;var $P=ei(),Xy=require("zlib"),WP=ec(),GP=Ae(),Yt=(0,GP.default)("engine:polling"),zP={gzip:Xy.createGzip,deflate:Xy.createDeflate},nf=class extends $P.Transport{constructor(e){super(e),this.closeTimeout=30*1e3}get name(){return"polling"}onRequest(e){let t=e.res;e.res=null,e.method==="GET"?this.onPollRequest(e,t):e.method==="POST"?this.onDataRequest(e,t):(t.writeHead(500),t.end())}onPollRequest(e,t){if(this.req){Yt("request overlap"),this.onError("overlap from client"),t.writeHead(400),t.end();return}Yt("setting request"),this.req=e,this.res=t;let n=()=>{this.onError("poll connection closed prematurely")},i=()=>{e.removeListener("close",n),this.req=this.res=null};e.cleanup=i,e.on("close",n),this.writable=!0,this.emit("ready"),this.writable&&this.shouldClose&&(Yt("triggering empty send to append close packet"),this.send([{type:"noop"}]))}onDataRequest(e,t){if(this.dataReq){this.onError("data request overlap from client"),t.writeHead(400),t.end();return}let n=e.headers["content-type"]==="application/octet-stream";if(n&&this.protocol===4)return this.onError("invalid content");this.dataReq=e,this.dataRes=t;let i=n?Buffer.concat([]):"",s=()=>{e.removeListener("data",a),e.removeListener("end",c),e.removeListener("close",o),this.dataReq=this.dataRes=i=null},o=()=>{s(),this.onError("data request connection closed prematurely")},a=l=>{let u;n?(i=Buffer.concat([i,l]),u=i.length):(i+=l,u=Buffer.byteLength(i)),u>this.maxHttpBufferSize&&(t.writeHead(413).end(),s())},c=()=>{this.onData(i);let l={"Content-Type":"text/html","Content-Length":"2"};t.writeHead(200,this.headers(e,l)),t.end("ok"),s()};e.on("close",o),n||e.setEncoding("utf8"),e.on("data",a),e.on("end",c)}onData(e){Yt('received "%s"',e);let t=n=>{if(n.type==="close")return Yt("got xhr close packet"),this.onClose(),!1;this.onPacket(n)};this.protocol===3?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&&(Yt("appending close packet to payload"),e.push({type:"close"}),this.shouldClose(),this.shouldClose=null);let t=n=>{let i=e.some(s=>s.options&&s.options.compress);this.write(n,{compress:i})};this.protocol===3?this.parser.encodePayload(e,this.supportsBinary,t):this.parser.encodePayload(e,t)}write(e,t){Yt('writing "%s"',e),this.doWrite(e,t,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(e,t,n){let i=typeof e=="string",o={"Content-Type":i?"text/plain; charset=UTF-8":"application/octet-stream"},a=u=>{o["Content-Length"]=typeof u=="string"?Buffer.byteLength(u):u.length,this.res.writeHead(200,this.headers(this.req,o)),this.res.end(u),n()};if(!this.httpCompression||!t.compress){a(e);return}if((i?Buffer.byteLength(e):e.length)<this.httpCompression.threshold){a(e);return}let l=WP(this.req).encodings(["gzip","deflate"]);if(!l){a(e);return}this.compress(e,l,(u,f)=>{if(u){this.res.writeHead(500),this.res.end(),n(u);return}o["Content-Encoding"]=l,a(f)})}compress(e,t,n){Yt("compressing");let i=[],s=0;zP[t](this.httpCompression).on("error",n).on("data",function(o){i.push(o),s+=o.length}).on("end",function(){n(null,Buffer.concat(i,s))}).end(e)}doClose(e){Yt("closing");let t;this.dataReq&&(Yt("aborting ongoing data request"),this.dataReq.destroy());let n=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(Yt("transport writable - closing right away"),this.send([{type:"close"}]),n()):this.discarded?(Yt("transport discarded - closing right away"),n()):(Yt("transport not writable - buffering orderly close"),this.shouldClose=n,t=setTimeout(n,this.closeTimeout))}headers(e,t={}){let 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}};hc.Polling=nf});var Zy=A(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});mc.JSONP=void 0;var VP=sf(),KP=require("querystring"),YP=/\\\\n/g,JP=/(\\)?\\n/g,of=class extends VP.Polling{constructor(e){super(e),this.head="___eio["+(e._query.j||"").replace(/[^0-9]/g,"")+"](",this.foot=");"}onData(e){e=KP.parse(e).d,typeof e=="string"&&(e=e.replace(JP,function(t,n){return n?t:`
|
|
10
|
+
`}),super.onData(e.replace(YP,"\\n")))}doWrite(e,t,n){let i=JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029");e=this.head+i+this.foot,super.doWrite(e,t,n)}};mc.JSONP=of});var e0=A(gc=>{"use strict";Object.defineProperty(gc,"__esModule",{value:!0});gc.WebSocket=void 0;var XP=ei(),ZP=Ae(),Qy=(0,ZP.default)("engine:ws"),af=class extends XP.Transport{constructor(e){super(e),this._doSend=t=>{this.socket.send(t,this._onSent)},this._doSendLast=t=>{this.socket.send(t,this._onSentLast)},this._onSent=t=>{t&&this.onError("write error",t.stack)},this._onSentLast=t=>{t?this.onError("write error",t.stack):(this.emit("drain"),this.writable=!0,this.emit("ready"))},this.socket=e.websocket,this.socket.on("message",(t,n)=>{let i=n?t:t.toString();Qy('received "%s"',i),super.onData(i)}),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}send(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],i=t+1===e.length;this._canSendPreEncodedFrame(n)?this.socket._sender.sendFrame(n.options.wsPreEncodedFrame,i?this._onSentLast:this._onSent):this.parser.encodePacket(n,this.supportsBinary,i?this._doSendLast:this._doSend)}}_canSendPreEncodedFrame(e){var t,n,i;return!this.perMessageDeflate&&typeof((n=(t=this.socket)===null||t===void 0?void 0:t._sender)===null||n===void 0?void 0:n.sendFrame)=="function"&&((i=e.options)===null||i===void 0?void 0:i.wsPreEncodedFrame)!==void 0}doClose(e){Qy("closing"),this.socket.close(),e&&e()}};gc.WebSocket=af});var lf=A(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.WebTransport=void 0;var QP=ei(),eI=Ae(),tI=yo(),Vi=(0,eI.default)("engine:webtransport"),cf=class extends QP.Transport{constructor(e,t,n){super({_query:{EIO:"4"}}),this.session=e;let i=(0,tI.createPacketEncoderStream)();i.readable.pipeTo(t.writable).catch(()=>{Vi("the stream was closed")}),this.writer=i.writable.getWriter(),(async()=>{try{for(;;){let{value:s,done:o}=await n.read();if(o){Vi("session is closed");break}Vi("received chunk: %o",s),this.onPacket(s)}}catch(s){Vi("error while reading: %s",s.message)}})(),e.closed.then(()=>this.onClose()),this.writable=!0}get name(){return"webtransport"}async send(e){this.writable=!1;try{for(let t=0;t<e.length;t++){let n=e[t];await this.writer.write(n)}}catch(t){Vi("error while writing: %s",t.message)}this.emit("drain"),this.writable=!0,this.emit("ready")}doClose(e){Vi("closing WebTransport session"),this.session.close(),e&&e()}};vc.WebTransport=cf});var pf=A(uf=>{"use strict";Object.defineProperty(uf,"__esModule",{value:!0});var rI=sf(),nI=Zy(),iI=e0(),sI=lf();uf.default={polling:t0,websocket:iI.WebSocket,webtransport:sI.WebTransport};function t0(r){return typeof r._query.j=="string"?new nI.JSONP(r):new rI.Polling(r)}t0.upgradesTo=["websocket","webtransport"]});var df=A(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});yc.Socket=void 0;var oI=require("events"),aI=Ae(),rn=require("timers"),Re=(0,aI.default)("engine:socket"),ff=class extends oI.EventEmitter{get readyState(){return this._readyState}set readyState(e){Re("readyState updated from %s to %s",this._readyState,e),this._readyState=e}constructor(e,t,n,i,s){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=i,this.protocol=s,i&&(i.websocket&&i.websocket._socket?this.remoteAddress=i.websocket._socket.remoteAddress:this.remoteAddress=i.connection.remoteAddress),this.pingTimeoutTimer=null,this.pingIntervalTimer=null,this.setTransport(n),this.onOpen()}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"),this.protocol===3?this.resetPingTimeout():this.schedulePing()}onPacket(e){if(this.readyState!=="open")return Re("packet received with closed socket");switch(Re(`received packet ${e.type}`),this.emit("packet",e),e.type){case"ping":if(this.transport.protocol!==3){this.onError(new Error("invalid heartbeat direction"));return}Re("got ping"),this.pingTimeoutTimer.refresh(),this.sendPacket("pong"),this.emit("heartbeat");break;case"pong":if(this.transport.protocol===3){this.onError(new Error("invalid heartbeat direction"));return}Re("got pong"),(0,rn.clearTimeout)(this.pingTimeoutTimer),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);break}}onError(e){Re("transport error"),this.onClose("transport error",e)}schedulePing(){this.pingIntervalTimer=(0,rn.setTimeout)(()=>{Re("writing ping packet - expecting pong within %sms",this.server.opts.pingTimeout),this.sendPacket("ping"),this.resetPingTimeout()},this.server.opts.pingInterval)}resetPingTimeout(){(0,rn.clearTimeout)(this.pingTimeoutTimer),this.pingTimeoutTimer=(0,rn.setTimeout)(()=>{this.readyState!=="closed"&&this.onClose("ping timeout")},this.protocol===3?this.server.opts.pingInterval+this.server.opts.pingTimeout:this.server.opts.pingTimeout)}setTransport(e){let t=this.onError.bind(this),n=()=>this.flush(),i=this.onPacket.bind(this),s=this.onDrain.bind(this),o=this.onClose.bind(this,"transport close");this.transport=e,this.transport.once("error",t),this.transport.on("ready",n),this.transport.on("packet",i),this.transport.on("drain",s),this.transport.once("close",o),this.cleanupFn.push(function(){e.removeListener("error",t),e.removeListener("ready",n),e.removeListener("packet",i),e.removeListener("drain",s),e.removeListener("close",o)})}onDrain(){if(this.sentCallbackFn.length>0){Re("executing batch send callback");let e=this.sentCallbackFn.shift();if(e)for(let t=0;t<e.length;t++)e[t](this.transport)}}_maybeUpgrade(e){Re('might upgrade socket transport from "%s" to "%s"',this.transport.name,e.name),this.upgrading=!0;let t=(0,rn.setTimeout)(()=>{Re("client did not complete upgrade - closing transport"),o(),e.readyState==="open"&&e.close()},this.server.opts.upgradeTimeout),n,i=u=>{u.type==="ping"&&u.data==="probe"?(Re("got probe ping packet, sending pong"),e.send([{type:"pong",data:"probe"}]),this.emit("upgrading",e),clearInterval(n),n=setInterval(s,100)):u.type==="upgrade"&&this.readyState!=="closed"?(Re("got upgrade packet - upgrading"),o(),this.transport.discard(),this.upgraded=!0,this.clearTransport(),this.setTransport(e),this.emit("upgrade",e),this.flush(),this.readyState==="closing"&&e.close(()=>{this.onClose("forced close")})):(o(),e.close())},s=()=>{this.transport.name==="polling"&&this.transport.writable&&(Re("writing a noop packet to polling for fast upgrade"),this.transport.send([{type:"noop"}]))},o=()=>{this.upgrading=!1,clearInterval(n),(0,rn.clearTimeout)(t),e.removeListener("packet",i),e.removeListener("close",c),e.removeListener("error",a),this.removeListener("close",l)},a=u=>{Re("client did not complete upgrade - %s",u),o(),e.close(),e=null},c=()=>{a("transport closed")},l=()=>{a("socket closed")};e.on("packet",i),e.once("close",c),e.once("error",a),this.once("close",l)}clearTransport(){let e,t=this.cleanupFn.length;for(let n=0;n<t;n++)e=this.cleanupFn.shift(),e();this.transport.on("error",function(){Re("error triggered by discarded transport")}),this.transport.close(),(0,rn.clearTimeout)(this.pingTimeoutTimer)}onClose(e,t){this.readyState!=="closed"&&(this.readyState="closed",(0,rn.clearTimeout)(this.pingIntervalTimer),(0,rn.clearTimeout)(this.pingTimeoutTimer),process.nextTick(()=>{this.writeBuffer=[]}),this.packetsFn=[],this.sentCallbackFn=[],this.clearTransport(),this.emit("close",e,t))}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={},i){if(typeof n=="function"&&(i=n,n={}),this.readyState!=="closing"&&this.readyState!=="closed"){Re('sending packet "%s" (%s)',e,t),n.compress=n.compress!==!1;let s={type:e,options:n};t&&(s.data=t),this.emit("packetCreate",s),this.writeBuffer.push(s),typeof i=="function"&&this.packetsFn.push(i),this.flush()}}flush(){if(this.readyState!=="closed"&&this.transport.writable&&this.writeBuffer.length){Re("flushing buffer to transport"),this.emit("flush",this.writeBuffer),this.server.emit("flush",this,this.writeBuffer);let e=this.writeBuffer;this.writeBuffer=[],this.packetsFn.length?(this.sentCallbackFn.push(this.packetsFn),this.packetsFn=[]):this.sentCallbackFn.push(null),this.transport.send(e),this.emit("drain"),this.server.emit("drain",this)}}getAvailableUpgrades(){let e=[],t=this.server.upgrades(this.transport.name);for(let n=0;n<t.length;++n){let i=t[n];this.server.opts.transports.indexOf(i)!==-1&&e.push(i)}return e}close(e){if(e&&(this.readyState==="open"||this.readyState==="closing"))return this.closeTransport(e);if(this.readyState==="open"){if(this.readyState="closing",this.writeBuffer.length){Re("there are %d remaining packets in the buffer, waiting for the 'drain' event",this.writeBuffer.length),this.once("drain",()=>{Re("all packets have been sent, closing the transport"),this.closeTransport(e)});return}Re("the buffer is empty, closing the transport right away"),this.closeTransport(e)}}closeTransport(e){Re("closing the transport (discard? %s)",!!e),e&&this.transport.discard(),this.transport.close(this.onClose.bind(this,"forced close"))}};yc.Socket=ff});var i0=A(hf=>{"use strict";hf.parse=hI;hf.serialize=mI;var cI=Object.prototype.toString,lI=Object.prototype.hasOwnProperty,uI=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,pI=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,fI=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,dI=/^[\u0020-\u003A\u003D-\u007E]*$/;function hI(r,e){if(typeof r!="string")throw new TypeError("argument str must be a string");var t={},n=r.length;if(n<2)return t;var i=e&&e.decode||gI,s=0,o=0,a=0;do{if(o=r.indexOf("=",s),o===-1)break;if(a=r.indexOf(";",s),a===-1)a=n;else if(o>a){s=r.lastIndexOf(";",o-1)+1;continue}var c=r0(r,s,o),l=n0(r,o,c),u=r.slice(c,l);if(!lI.call(t,u)){var f=r0(r,o+1,a),h=n0(r,a,f);r.charCodeAt(f)===34&&r.charCodeAt(h-1)===34&&(f++,h--);var g=r.slice(f,h);t[u]=yI(g,i)}s=a+1}while(s<n);return t}function r0(r,e,t){do{var n=r.charCodeAt(e);if(n!==32&&n!==9)return e}while(++e<t);return t}function n0(r,e,t){for(;e>t;){var n=r.charCodeAt(--e);if(n!==32&&n!==9)return e+1}return t}function mI(r,e,t){var n=t&&t.encode||encodeURIComponent;if(typeof n!="function")throw new TypeError("option encode is invalid");if(!uI.test(r))throw new TypeError("argument name is invalid");var i=n(e);if(!pI.test(i))throw new TypeError("argument val is invalid");var s=r+"="+i;if(!t)return s;if(t.maxAge!=null){var o=Math.floor(t.maxAge);if(!isFinite(o))throw new TypeError("option maxAge is invalid");s+="; Max-Age="+o}if(t.domain){if(!fI.test(t.domain))throw new TypeError("option domain is invalid");s+="; Domain="+t.domain}if(t.path){if(!dI.test(t.path))throw new TypeError("option path is invalid");s+="; Path="+t.path}if(t.expires){var a=t.expires;if(!vI(a)||isNaN(a.valueOf()))throw new TypeError("option expires is invalid");s+="; Expires="+a.toUTCString()}if(t.httpOnly&&(s+="; HttpOnly"),t.secure&&(s+="; Secure"),t.partitioned&&(s+="; Partitioned"),t.priority){var c=typeof t.priority=="string"?t.priority.toLowerCase():t.priority;switch(c){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(t.sameSite){var l=typeof t.sameSite=="string"?t.sameSite.toLowerCase():t.sameSite;switch(l){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}function gI(r){return r.indexOf("%")!==-1?decodeURIComponent(r):r}function vI(r){return cI.call(r)==="[object Date]"}function yI(r,e){try{return e(r)}catch{return r}}});var nn=A((l6,a0)=>{"use strict";var s0=["nodebuffer","arraybuffer","fragments"],o0=typeof Blob<"u";o0&&s0.push("blob");a0.exports={BINARY_TYPES:s0,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:o0,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var S0=A((u6,w0)=>{var p0=require("fs"),sn=require("path"),f0=require("os"),d0=typeof __webpack_require__=="function"?__non_webpack_require__:require,xI=process.config&&process.config.variables||{},_I=!!process.env.PREBUILDS_ONLY,c0=process.versions.modules,mf=SI()?"electron":wI()?"node-webkit":"node",gf=process.env.npm_config_arch||f0.arch(),vf=process.env.npm_config_platform||f0.platform(),h0=process.env.LIBC||(EI(vf)?"musl":"glibc"),yf=process.env.ARM_VERSION||(gf==="arm64"?"8":xI.arm_version)||"",m0=(process.versions.uv||"").split(".")[0];w0.exports=Fr;function Fr(r){return d0(Fr.resolve(r))}Fr.resolve=Fr.path=function(r){r=sn.resolve(r||".");try{var e=d0(sn.join(r,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[e+"_PREBUILD"]&&(r=process.env[e+"_PREBUILD"])}catch{}if(!_I){var t=l0(sn.join(r,"build/Release"),u0);if(t)return t;var n=l0(sn.join(r,"build/Debug"),u0);if(n)return n}var i=a(r);if(i)return i;var s=a(sn.dirname(process.execPath));if(s)return s;var o=["platform="+vf,"arch="+gf,"runtime="+mf,"abi="+c0,"uv="+m0,yf?"armv="+yf:"","libc="+h0,"node="+process.versions.node,process.versions.electron?"electron="+process.versions.electron:"",typeof __webpack_require__=="function"?"webpack=true":""].filter(Boolean).join(" ");throw new Error("No native build was found for "+o+`
|
|
11
11
|
loaded from: `+r+`
|
|
12
|
-
`);function a(c){var l=vf(sn.join(c,"prebuilds")).map(u0),u=l.filter(p0(mf,hf)).sort(f0)[0];if(u){var f=sn.join(c,"prebuilds",u.name),h=vf(f).map(d0),g=h.filter(h0(df,r0)),x=g.sort(m0(df))[0];if(x)return sn.join(f,x.file)}}};function vf(r){try{return s0.readdirSync(r)}catch{return[]}}function n0(r,e){var t=vf(r).filter(e);return t[0]&&sn.join(r,t[0])}function i0(r){return/\.node$/.test(r)}function u0(r){var e=r.split("-");if(e.length===2){var t=e[0],n=e[1].split("+");if(t&&n.length&&n.every(Boolean))return{name:r,platform:t,architectures:n}}}function p0(r,e){return function(t){return t==null||t.platform!==r?!1:t.architectures.includes(e)}}function f0(r,e){return r.architectures.length-e.architectures.length}function d0(r){var e=r.split("."),t=e.pop(),n={file:r,specificity:0};if(t==="node"){for(var i=0;i<e.length;i++){var s=e[i];if(s==="node"||s==="electron"||s==="node-webkit")n.runtime=s;else if(s==="napi")n.napi=!0;else if(s.slice(0,3)==="abi")n.abi=s.slice(3);else if(s.slice(0,2)==="uv")n.uv=s.slice(2);else if(s.slice(0,4)==="armv")n.armv=s.slice(4);else if(s==="glibc"||s==="musl")n.libc=s;else continue;n.specificity++}return n}}function h0(r,e){return function(t){return!(t==null||t.runtime&&t.runtime!==r&&!fI(t)||t.abi&&t.abi!==e&&!t.napi||t.uv&&t.uv!==l0||t.armv&&t.armv!==gf||t.libc&&t.libc!==c0)}}function fI(r){return r.runtime==="node"&&r.napi}function m0(r){return function(e,t){return e.runtime!==t.runtime?e.runtime===r?-1:1:e.abi!==t.abi?e.abi?-1:1:e.specificity!==t.specificity?e.specificity>t.specificity?-1:1:0}}function dI(){return!!(process.versions&&process.versions.nw)}function hI(){return process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE?!0:typeof window<"u"&&window.process&&window.process.type==="renderer"}function mI(r){return r==="linux"&&s0.existsSync("/etc/alpine-release")}Fr.parseTags=d0;Fr.matchTags=h0;Fr.compareTags=m0;Fr.parseTuple=u0;Fr.matchTuple=p0;Fr.compareTuples=f0});var _f=A((e6,xf)=>{var yf=typeof __webpack_require__=="function"?__non_webpack_require__:require;typeof yf.addon=="function"?xf.exports=yf.addon.bind(yf):xf.exports=v0()});var x0=A((t6,y0)=>{"use strict";var gI=(r,e,t,n,i)=>{for(var s=0;s<i;s++)t[n+s]=r[s]^e[s&3]},vI=(r,e)=>{let t=r.length;for(var n=0;n<t;n++)r[n]^=e[n&3]};y0.exports={mask:gI,unmask:vI}});var wf=A((r6,bf)=>{"use strict";try{bf.exports=_f()(__dirname)}catch{bf.exports=x0()}});var go=A((n6,yc)=>{"use strict";var{EMPTY_BUFFER:yI}=nn(),Sf=Buffer[Symbol.species];function xI(r,e){if(r.length===0)return yI;if(r.length===1)return r[0];let t=Buffer.allocUnsafe(e),n=0;for(let i=0;i<r.length;i++){let s=r[i];t.set(s,n),n+=s.length}return n<e?new Sf(t.buffer,t.byteOffset,n):t}function _0(r,e,t,n,i){for(let s=0;s<i;s++)t[n+s]=r[s]^e[s&3]}function b0(r,e){for(let t=0;t<r.length;t++)r[t]^=e[t&3]}function _I(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function Ef(r){if(Ef.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new Sf(r):ArrayBuffer.isView(r)?e=new Sf(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),Ef.readOnly=!1),e}yc.exports={concat:xI,mask:_0,toArrayBuffer:_I,toBuffer:Ef,unmask:b0};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=wf();yc.exports.mask=function(e,t,n,i,s){s<48?_0(e,t,n,i,s):r.mask(e,t,n,i,s)},yc.exports.unmask=function(e,t){e.length<32?b0(e,t):r.unmask(e,t)}}catch{}});var E0=A((i6,S0)=>{"use strict";var w0=Symbol("kDone"),Tf=Symbol("kRun"),Cf=class{constructor(e){this[w0]=()=>{this.pending--,this[Tf]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[Tf]()}[Tf](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[w0])}}};S0.exports=Cf});var yo=A((s6,A0)=>{"use strict";var vo=require("zlib"),T0=go(),bI=E0(),{kStatusCode:C0}=nn(),wI=Buffer[Symbol.species],SI=Buffer.from([0,0,255,255]),_c=Symbol("permessage-deflate"),on=Symbol("total-length"),zi=Symbol("callback"),Dn=Symbol("buffers"),Vi=Symbol("error"),xc,kf=class{constructor(e,t,n){if(this._maxPayload=n|0,this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,!xc){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;xc=new bI(i)}}static get extensionName(){return"permessage-deflate"}offer(){let 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:this._options.clientMaxWindowBits==null&&(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){let e=this._deflate[zi];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let t=this._options,n=e.find(i=>!(t.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits=="number"&&t.serverMaxWindowBits>i.server_max_window_bits)||typeof t.clientMaxWindowBits=="number"&&!i.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),typeof t.serverMaxWindowBits=="number"&&(n.server_max_window_bits=t.serverMaxWindowBits),typeof t.clientMaxWindowBits=="number"?n.client_max_window_bits=t.clientMaxWindowBits:(n.client_max_window_bits===!0||t.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(e){let t=e[0];if(this._options.clientNoContextTakeover===!1&&t.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!t.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(t.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return t}normalizeParams(e){return e.forEach(t=>{Object.keys(t).forEach(n=>{let i=t[n];if(i.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(i=i[0],n==="client_max_window_bits"){if(i!==!0){let s=+i;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else if(n==="server_max_window_bits"){let s=+i;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=s}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(i!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else throw new Error(`Unknown parameter "${n}"`);t[n]=i})}),e}decompress(e,t,n){xc.add(i=>{this._decompress(e,t,(s,o)=>{i(),n(s,o)})})}compress(e,t,n){xc.add(i=>{this._compress(e,t,(s,o)=>{i(),n(s,o)})})}_decompress(e,t,n){let i=this._isServer?"client":"server";if(!this._inflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?vo.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=vo.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[_c]=this,this._inflate[on]=0,this._inflate[Dn]=[],this._inflate.on("error",TI),this._inflate.on("data",k0)}this._inflate[zi]=n,this._inflate.write(e),t&&this._inflate.write(SI),this._inflate.flush(()=>{let s=this._inflate[Vi];if(s){this._inflate.close(),this._inflate=null,n(s);return}let o=T0.concat(this._inflate[Dn],this._inflate[on]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[on]=0,this._inflate[Dn]=[],t&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),n(null,o)})}_compress(e,t,n){let i=this._isServer?"server":"client";if(!this._deflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?vo.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=vo.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[on]=0,this._deflate[Dn]=[],this._deflate.on("data",EI)}this._deflate[zi]=n,this._deflate.write(e),this._deflate.flush(vo.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=T0.concat(this._deflate[Dn],this._deflate[on]);t&&(s=new wI(s.buffer,s.byteOffset,s.length-4)),this._deflate[zi]=null,this._deflate[on]=0,this._deflate[Dn]=[],t&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,s)})}};A0.exports=kf;function EI(r){this[Dn].push(r),this[on]+=r.length}function k0(r){if(this[on]+=r.length,this[_c]._maxPayload<1||this[on]<=this[_c]._maxPayload){this[Dn].push(r);return}this[Vi]=new RangeError("Max payload size exceeded"),this[Vi].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Vi][C0]=1009,this.removeListener("data",k0),this.reset()}function TI(r){if(this[_c]._inflate=null,this[Vi]){this[zi](this[Vi]);return}r[C0]=1007,this[zi](r)}});var O0=A((o6,R0)=>{"use strict";function CI(r){let e=r.length,t=0;for(;t<e;)if((r[t]&128)===0)t++;else if((r[t]&224)===192){if(t+1===e||(r[t+1]&192)!==128||(r[t]&254)===192)return!1;t+=2}else if((r[t]&240)===224){if(t+2>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||r[t]===224&&(r[t+1]&224)===128||r[t]===237&&(r[t+1]&224)===160)return!1;t+=3}else if((r[t]&248)===240){if(t+3>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||(r[t+3]&192)!==128||r[t]===240&&(r[t+1]&240)===128||r[t]===244&&r[t+1]>143||r[t]>244)return!1;t+=4}else return!1;return!0}R0.exports=CI});var Rf=A((a6,Af)=>{"use strict";try{Af.exports=_f()(__dirname)}catch{Af.exports=O0()}});var Ki=A((c6,bc)=>{"use strict";var{isUtf8:M0}=require("buffer"),{hasBlob:kI}=nn(),AI=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function RI(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function Of(r){let e=r.length,t=0;for(;t<e;)if((r[t]&128)===0)t++;else if((r[t]&224)===192){if(t+1===e||(r[t+1]&192)!==128||(r[t]&254)===192)return!1;t+=2}else if((r[t]&240)===224){if(t+2>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||r[t]===224&&(r[t+1]&224)===128||r[t]===237&&(r[t+1]&224)===160)return!1;t+=3}else if((r[t]&248)===240){if(t+3>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||(r[t+3]&192)!==128||r[t]===240&&(r[t+1]&240)===128||r[t]===244&&r[t+1]>143||r[t]>244)return!1;t+=4}else return!1;return!0}function OI(r){return kI&&typeof r=="object"&&typeof r.arrayBuffer=="function"&&typeof r.type=="string"&&typeof r.stream=="function"&&(r[Symbol.toStringTag]==="Blob"||r[Symbol.toStringTag]==="File")}bc.exports={isBlob:OI,isValidStatusCode:RI,isValidUTF8:Of,tokenChars:AI};if(M0)bc.exports.isValidUTF8=function(r){return r.length<24?Of(r):M0(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=Rf();bc.exports.isValidUTF8=function(e){return e.length<32?Of(e):r(e)}}catch{}});var Df=A((l6,j0)=>{"use strict";var{Writable:MI}=require("stream"),P0=yo(),{BINARY_TYPES:PI,EMPTY_BUFFER:I0,kStatusCode:II,kWebSocket:NI}=nn(),{concat:Mf,toArrayBuffer:DI,unmask:LI}=go(),{isValidStatusCode:BI,isValidUTF8:N0}=Ki(),wc=Buffer[Symbol.species],sr=0,D0=1,L0=2,B0=3,Pf=4,If=5,Sc=6,Nf=class extends MI{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||PI[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[NI]=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=sr}_write(e,t,n){if(this._opcode===8&&this._state==sr)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){let n=this._buffers[0];return this._buffers[0]=new wc(n.buffer,n.byteOffset+e,n.length-e),new wc(n.buffer,n.byteOffset,e)}let t=Buffer.allocUnsafe(e);do{let n=this._buffers[0],i=t.length-e;e>=n.length?t.set(this._buffers.shift(),i):(t.set(new Uint8Array(n.buffer,n.byteOffset,e),i),this._buffers[0]=new wc(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 sr:this.getInfo(e);break;case D0:this.getPayloadLength16(e);break;case L0:this.getPayloadLength64(e);break;case B0:this.getMask();break;case Pf:this.getData(e);break;case If:case Sc:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if((t[0]&48)!==0){let i=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(i);return}let n=(t[0]&64)===64;if(n&&!this._extensions[P0.extensionName]){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(!this._fragmented){let i=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let i=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(i);return}if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let i=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(i);return}}else{let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked){let i=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(i);return}}else if(this._masked){let i=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(i);return}this._payloadLength===126?this._state=D0:this._payloadLength===127?this._state=L0:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),n=t.readUInt32BE(0);if(n>Math.pow(2,21)-1){let i=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(i);return}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)){let t=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(t);return}this._masked?this._state=B0:this._state=Pf}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Pf}getData(e){let t=I0;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}t=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&LI(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=If,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[P0.extensionName].decompress(e,this._fin,(i,s)=>{if(i)return t(i);if(s.length){if(this._messageLength+=s.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let o=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(o);return}this._fragments.push(s)}this.dataMessage(t),this._state===sr&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=sr;return}let t=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let i;this._binaryType==="nodebuffer"?i=Mf(n,t):this._binaryType==="arraybuffer"?i=DI(Mf(n,t)):this._binaryType==="blob"?i=new Blob(n):i=n,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=sr):(this._state=Sc,setImmediate(()=>{this.emit("message",i,!0),this._state=sr,this.startLoop(e)}))}else{let i=Mf(n,t);if(!this._skipUTF8Validation&&!N0(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(s);return}this._state===If||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=sr):(this._state=Sc,setImmediate(()=>{this.emit("message",i,!1),this._state=sr,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,I0),this.end();else{let n=e.readUInt16BE(0);if(!BI(n)){let s=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(s);return}let i=new wc(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!N0(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(s);return}this._loop=!1,this.emit("conclude",n,i),this.end()}this._state=sr;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=sr):(this._state=Sc,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=sr,this.startLoop(t)}))}createError(e,t,n,i,s){this._loop=!1,this._errored=!0;let o=new e(n?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(o,this.createError),o.code=s,o[II]=i,o}};j0.exports=Nf});var jf=A((p6,q0)=>{"use strict";var{Duplex:u6}=require("stream"),{randomFillSync:jI}=require("crypto"),F0=yo(),{EMPTY_BUFFER:FI,kWebSocket:HI,NOOP:qI}=nn(),{isBlob:Yi,isValidStatusCode:UI}=Ki(),{mask:H0,toBuffer:Qn}=go(),or=Symbol("kByteLength"),$I=Buffer.alloc(4),Ec=8*1024,ei,Ji=Ec,Tr=0,WI=1,GI=2,Lf=class r{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._queue=[],this._state=Tr,this.onerror=qI,this[HI]=void 0}static frame(e,t){let n,i=!1,s=2,o=!1;t.mask&&(n=t.maskBuffer||$I,t.generateMask?t.generateMask(n):(Ji===Ec&&(ei===void 0&&(ei=Buffer.alloc(Ec)),jI(ei,0,Ec),Ji=0),n[0]=ei[Ji++],n[1]=ei[Ji++],n[2]=ei[Ji++],n[3]=ei[Ji++]),o=(n[0]|n[1]|n[2]|n[3])===0,s=6);let a;typeof e=="string"?(!t.mask||o)&&t[or]!==void 0?a=t[or]:(e=Buffer.from(e),a=e.length):(a=e.length,i=t.mask&&t.readOnly&&!o);let c=a;a>=65536?(s+=8,c=127):a>125&&(s+=2,c=126);let l=Buffer.allocUnsafe(i?a+s:s);return l[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(l[0]|=64),l[1]=c,c===126?l.writeUInt16BE(a,2):c===127&&(l[2]=l[3]=0,l.writeUIntBE(a,4,6)),t.mask?(l[1]|=128,l[s-4]=n[0],l[s-3]=n[1],l[s-2]=n[2],l[s-1]=n[3],o?[l,e]:i?(H0(e,n,l,s,a),[l]):(H0(e,n,e,0,a),[l,e])):[l,e]}close(e,t,n,i){let s;if(e===void 0)s=FI;else{if(typeof e!="number"||!UI(e))throw new TypeError("First argument must be a valid error code number");if(t===void 0||!t.length)s=Buffer.allocUnsafe(2),s.writeUInt16BE(e,0);else{let a=Buffer.byteLength(t);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");s=Buffer.allocUnsafe(2+a),s.writeUInt16BE(e,0),typeof t=="string"?s.write(t,2):s.set(t,2)}}let o={[or]:s.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Tr?this.enqueue([this.dispatch,s,!1,o,i]):this.sendFrame(r.frame(s,o),i)}ping(e,t,n){let i,s;if(typeof e=="string"?(i=Buffer.byteLength(e),s=!1):Yi(e)?(i=e.size,s=!1):(e=Qn(e),i=e.length,s=Qn.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[or]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};Yi(e)?this._state!==Tr?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Tr?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}pong(e,t,n){let i,s;if(typeof e=="string"?(i=Buffer.byteLength(e),s=!1):Yi(e)?(i=e.size,s=!1):(e=Qn(e),i=e.length,s=Qn.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[or]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};Yi(e)?this._state!==Tr?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Tr?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}send(e,t,n){let i=this._extensions[F0.extensionName],s=t.binary?2:1,o=t.compress,a,c;typeof e=="string"?(a=Buffer.byteLength(e),c=!1):Yi(e)?(a=e.size,c=!1):(e=Qn(e),a=e.length,c=Qn.readOnly),this._firstFragment?(this._firstFragment=!1,o&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=a>=i._threshold),this._compress=o):(o=!1,s=0),t.fin&&(this._firstFragment=!0);let l={[or]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:c,rsv1:o};Yi(e)?this._state!==Tr?this.enqueue([this.getBlobData,e,this._compress,l,n]):this.getBlobData(e,this._compress,l,n):this._state!==Tr?this.enqueue([this.dispatch,e,this._compress,l,n]):this.dispatch(e,this._compress,l,n)}getBlobData(e,t,n,i){this._bufferedBytes+=n[or],this._state=GI,e.arrayBuffer().then(s=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(Bf,this,a,i);return}this._bufferedBytes-=n[or];let o=Qn(s);t?this.dispatch(o,t,n,i):(this._state=Tr,this.sendFrame(r.frame(o,n),i),this.dequeue())}).catch(s=>{process.nextTick(zI,this,s,i)})}dispatch(e,t,n,i){if(!t){this.sendFrame(r.frame(e,n),i);return}let s=this._extensions[F0.extensionName];this._bufferedBytes+=n[or],this._state=WI,s.compress(e,n.fin,(o,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");Bf(this,c,i);return}this._bufferedBytes-=n[or],this._state=Tr,n.readOnly=!1,this.sendFrame(r.frame(a,n),i),this.dequeue()})}dequeue(){for(;this._state===Tr&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][or],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][or],this._queue.push(e)}sendFrame(e,t){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork()):this._socket.write(e[0],t)}};q0.exports=Lf;function Bf(r,e,t){typeof t=="function"&&t(e);for(let n=0;n<r._queue.length;n++){let i=r._queue[n],s=i[i.length-1];typeof s=="function"&&s(e)}}function zI(r,e,t){Bf(r,e,t),r.onerror(e)}});var J0=A((f6,Y0)=>{"use strict";var{kForOnEventAttribute:xo,kListener:Ff}=nn(),U0=Symbol("kCode"),$0=Symbol("kData"),W0=Symbol("kError"),G0=Symbol("kMessage"),z0=Symbol("kReason"),Xi=Symbol("kTarget"),V0=Symbol("kType"),K0=Symbol("kWasClean"),an=class{constructor(e){this[Xi]=null,this[V0]=e}get target(){return this[Xi]}get type(){return this[V0]}};Object.defineProperty(an.prototype,"target",{enumerable:!0});Object.defineProperty(an.prototype,"type",{enumerable:!0});var ti=class extends an{constructor(e,t={}){super(e),this[U0]=t.code===void 0?0:t.code,this[z0]=t.reason===void 0?"":t.reason,this[K0]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[U0]}get reason(){return this[z0]}get wasClean(){return this[K0]}};Object.defineProperty(ti.prototype,"code",{enumerable:!0});Object.defineProperty(ti.prototype,"reason",{enumerable:!0});Object.defineProperty(ti.prototype,"wasClean",{enumerable:!0});var Zi=class extends an{constructor(e,t={}){super(e),this[W0]=t.error===void 0?null:t.error,this[G0]=t.message===void 0?"":t.message}get error(){return this[W0]}get message(){return this[G0]}};Object.defineProperty(Zi.prototype,"error",{enumerable:!0});Object.defineProperty(Zi.prototype,"message",{enumerable:!0});var _o=class extends an{constructor(e,t={}){super(e),this[$0]=t.data===void 0?null:t.data}get data(){return this[$0]}};Object.defineProperty(_o.prototype,"data",{enumerable:!0});var VI={addEventListener(r,e,t={}){for(let i of this.listeners(r))if(!t[xo]&&i[Ff]===e&&!i[xo])return;let n;if(r==="message")n=function(s,o){let a=new _o("message",{data:o?s:s.toString()});a[Xi]=this,Tc(e,this,a)};else if(r==="close")n=function(s,o){let a=new ti("close",{code:s,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[Xi]=this,Tc(e,this,a)};else if(r==="error")n=function(s){let o=new Zi("error",{error:s,message:s.message});o[Xi]=this,Tc(e,this,o)};else if(r==="open")n=function(){let s=new an("open");s[Xi]=this,Tc(e,this,s)};else return;n[xo]=!!t[xo],n[Ff]=e,t.once?this.once(r,n):this.on(r,n)},removeEventListener(r,e){for(let t of this.listeners(r))if(t[Ff]===e&&!t[xo]){this.removeListener(r,t);break}}};Y0.exports={CloseEvent:ti,ErrorEvent:Zi,Event:an,EventTarget:VI,MessageEvent:_o};function Tc(r,e,t){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,t):r.call(e,t)}});var Hf=A((d6,X0)=>{"use strict";var{tokenChars:bo}=Ki();function Hr(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}function KI(r){let e=Object.create(null),t=Object.create(null),n=!1,i=!1,s=!1,o,a,c=-1,l=-1,u=-1,f=0;for(;f<r.length;f++)if(l=r.charCodeAt(f),o===void 0)if(u===-1&&bo[l]===1)c===-1&&(c=f);else if(f!==0&&(l===32||l===9))u===-1&&c!==-1&&(u=f);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);u===-1&&(u=f);let g=r.slice(c,u);l===44?(Hr(e,g,t),t=Object.create(null)):o=g,c=u=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);else if(a===void 0)if(u===-1&&bo[l]===1)c===-1&&(c=f);else if(l===32||l===9)u===-1&&c!==-1&&(u=f);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);u===-1&&(u=f),Hr(t,r.slice(c,u),!0),l===44&&(Hr(e,o,t),t=Object.create(null),o=void 0),c=u=-1}else if(l===61&&c!==-1&&u===-1)a=r.slice(c,f),c=u=-1;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(i){if(bo[l]!==1)throw new SyntaxError(`Unexpected character at index ${f}`);c===-1?c=f:n||(n=!0),i=!1}else if(s)if(bo[l]===1)c===-1&&(c=f);else if(l===34&&c!==-1)s=!1,u=f;else if(l===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(l===34&&r.charCodeAt(f-1)===61)s=!0;else if(u===-1&&bo[l]===1)c===-1&&(c=f);else if(c!==-1&&(l===32||l===9))u===-1&&(u=f);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);u===-1&&(u=f);let g=r.slice(c,u);n&&(g=g.replace(/\\/g,""),n=!1),Hr(t,a,g),l===44&&(Hr(e,o,t),t=Object.create(null),o=void 0),a=void 0,c=u=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);if(c===-1||s||l===32||l===9)throw new SyntaxError("Unexpected end of input");u===-1&&(u=f);let h=r.slice(c,u);return o===void 0?Hr(e,h,t):(a===void 0?Hr(t,h,!0):n?Hr(t,a,h.replace(/\\/g,"")):Hr(t,a,h),Hr(e,o,t)),e}function YI(r){return Object.keys(r).map(e=>{let t=r[e];return Array.isArray(t)||(t=[t]),t.map(n=>[e].concat(Object.keys(n).map(i=>{let s=n[i];return Array.isArray(s)||(s=[s]),s.map(o=>o===!0?i:`${i}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}X0.exports={format:YI,parse:KI}});var Rc=A((g6,lx)=>{"use strict";var JI=require("events"),XI=require("https"),ZI=require("http"),ex=require("net"),QI=require("tls"),{randomBytes:eN,createHash:tN}=require("crypto"),{Duplex:h6,Readable:m6}=require("stream"),{URL:qf}=require("url"),Ln=yo(),rN=Df(),nN=jf(),{isBlob:iN}=Ki(),{BINARY_TYPES:Z0,EMPTY_BUFFER:Cc,GUID:sN,kForOnEventAttribute:Uf,kListener:oN,kStatusCode:aN,kWebSocket:mt,NOOP:tx}=nn(),{EventTarget:{addEventListener:cN,removeEventListener:lN}}=J0(),{format:uN,parse:pN}=Hf(),{toBuffer:fN}=go(),dN=30*1e3,rx=Symbol("kAborted"),$f=[8,13],cn=["CONNECTING","OPEN","CLOSING","CLOSED"],hN=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,we=class r extends JI{constructor(e,t,n){super(),this._binaryType=Z0[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Cc,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=r.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,t===void 0?t=[]:Array.isArray(t)||(typeof t=="object"&&t!==null?(n=t,t=[]):t=[t]),nx(this,e,t,n)):(this._autoPong=n.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){Z0.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(e,t,n){let i=new rN({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),s=new nN(e,this._extensions,n.generateMask);this._receiver=i,this._sender=s,this._socket=e,i[mt]=this,s[mt]=this,e[mt]=this,i.on("conclude",vN),i.on("drain",yN),i.on("error",xN),i.on("message",_N),i.on("ping",bN),i.on("pong",wN),s.onerror=SN,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",ox),e.on("data",Ac),e.on("end",ax),e.on("error",cx),this._readyState=r.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Ln.extensionName]&&this._extensions[Ln.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){Yt(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===r.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=r.CLOSING,this._sender.close(e,t,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),sx(this)}}pause(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=t=void 0):typeof t=="function"&&(n=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Wf(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||Cc,t,n)}pong(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=t=void 0):typeof t=="function"&&(n=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Wf(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||Cc,t,n)}resume(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"&&(n=t,t={}),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Wf(this,e,n);return}let i={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[Ln.extensionName]||(i.compress=!1),this._sender.send(e||Cc,i,n)}terminate(){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){Yt(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=r.CLOSING,this._socket.destroy())}}};Object.defineProperty(we,"CONNECTING",{enumerable:!0,value:cn.indexOf("CONNECTING")});Object.defineProperty(we.prototype,"CONNECTING",{enumerable:!0,value:cn.indexOf("CONNECTING")});Object.defineProperty(we,"OPEN",{enumerable:!0,value:cn.indexOf("OPEN")});Object.defineProperty(we.prototype,"OPEN",{enumerable:!0,value:cn.indexOf("OPEN")});Object.defineProperty(we,"CLOSING",{enumerable:!0,value:cn.indexOf("CLOSING")});Object.defineProperty(we.prototype,"CLOSING",{enumerable:!0,value:cn.indexOf("CLOSING")});Object.defineProperty(we,"CLOSED",{enumerable:!0,value:cn.indexOf("CLOSED")});Object.defineProperty(we.prototype,"CLOSED",{enumerable:!0,value:cn.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(we.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(we.prototype,`on${r}`,{enumerable:!0,get(){for(let e of this.listeners(r))if(e[Uf])return e[oN];return null},set(e){for(let t of this.listeners(r))if(t[Uf]){this.removeListener(r,t);break}typeof e=="function"&&this.addEventListener(r,e,{[Uf]:!0})}})});we.prototype.addEventListener=cN;we.prototype.removeEventListener=lN;lx.exports=we;function nx(r,e,t,n){let i={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:$f[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...n,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(r._autoPong=i.autoPong,!$f.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${$f.join(", ")})`);let s;if(e instanceof qf)s=e;else try{s=new qf(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),r._url=s.href;let o=s.protocol==="wss:",a=s.protocol==="ws+unix:",c;if(s.protocol!=="ws:"&&!o&&!a?c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!s.pathname?c="The URL's pathname is empty":s.hash&&(c="The URL contains a fragment identifier"),c){let S=new SyntaxError(c);if(r._redirects===0)throw S;kc(r,S);return}let l=o?443:80,u=eN(16).toString("base64"),f=o?XI.request:ZI.request,h=new Set,g;if(i.createConnection=i.createConnection||(o?gN:mN),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&&(g=new Ln(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=uN({[Ln.extensionName]:g.offer()})),t.length){for(let S of t){if(typeof S!="string"||!hN.test(S)||h.has(S))throw new SyntaxError("An invalid or duplicated subprotocol was specified");h.add(S)}i.headers["Sec-WebSocket-Protocol"]=t.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){let S=i.path.split(":");i.socketPath=S[0],i.path=S[1]}let x;if(i.followRedirects){if(r._redirects===0){r._originalIpc=a,r._originalSecure=o,r._originalHostOrSocketPath=a?i.socketPath:s.host;let S=n&&n.headers;if(n={...n,headers:{}},S)for(let[k,R]of Object.entries(S))n.headers[k.toLowerCase()]=R}else if(r.listenerCount("redirect")===0){let S=a?r._originalIpc?i.socketPath===r._originalHostOrSocketPath:!1:r._originalIpc?!1:s.host===r._originalHostOrSocketPath;(!S||r._originalSecure&&!o)&&(delete i.headers.authorization,delete i.headers.cookie,S||delete i.headers.host,i.auth=void 0)}i.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),x=r._req=f(i),r._redirects&&r.emit("redirect",r.url,x)}else x=r._req=f(i);i.timeout&&x.on("timeout",()=>{Yt(r,x,"Opening handshake has timed out")}),x.on("error",S=>{x===null||x[rx]||(x=r._req=null,kc(r,S))}),x.on("response",S=>{let k=S.headers.location,R=S.statusCode;if(k&&i.followRedirects&&R>=300&&R<400){if(++r._redirects>i.maxRedirects){Yt(r,x,"Maximum redirects exceeded");return}x.abort();let M;try{M=new qf(k,e)}catch{let B=new SyntaxError(`Invalid URL: ${k}`);kc(r,B);return}nx(r,M,t,n)}else r.emit("unexpected-response",x,S)||Yt(r,x,`Unexpected server response: ${S.statusCode}`)}),x.on("upgrade",(S,k,R)=>{if(r.emit("upgrade",S),r.readyState!==we.CONNECTING)return;x=r._req=null;let M=S.headers.upgrade;if(M===void 0||M.toLowerCase()!=="websocket"){Yt(r,k,"Invalid Upgrade header");return}let I=tN("sha1").update(u+sN).digest("base64");if(S.headers["sec-websocket-accept"]!==I){Yt(r,k,"Invalid Sec-WebSocket-Accept header");return}let B=S.headers["sec-websocket-protocol"],V;if(B!==void 0?h.size?h.has(B)||(V="Server sent an invalid subprotocol"):V="Server sent a subprotocol but none was requested":h.size&&(V="Server sent no subprotocol"),V){Yt(r,k,V);return}B&&(r._protocol=B);let F=S.headers["sec-websocket-extensions"];if(F!==void 0){if(!g){Yt(r,k,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let G;try{G=pN(F)}catch{Yt(r,k,"Invalid Sec-WebSocket-Extensions header");return}let D=Object.keys(G);if(D.length!==1||D[0]!==Ln.extensionName){Yt(r,k,"Server indicated an extension that was not requested");return}try{g.accept(G[Ln.extensionName])}catch{Yt(r,k,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[Ln.extensionName]=g}r.setSocket(k,R,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(x,r):x.end()}function kc(r,e){r._readyState=we.CLOSING,r._errorEmitted=!0,r.emit("error",e),r.emitClose()}function mN(r){return r.path=r.socketPath,ex.connect(r)}function gN(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=ex.isIP(r.host)?"":r.host),QI.connect(r)}function Yt(r,e,t){r._readyState=we.CLOSING;let n=new Error(t);Error.captureStackTrace(n,Yt),e.setHeader?(e[rx]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(kc,r,n)):(e.destroy(n),e.once("error",r.emit.bind(r,"error")),e.once("close",r.emitClose.bind(r)))}function Wf(r,e,t){if(e){let n=iN(e)?e.size:fN(e).length;r._socket?r._sender._bufferedBytes+=n:r._bufferedAmount+=n}if(t){let n=new Error(`WebSocket is not open: readyState ${r.readyState} (${cn[r.readyState]})`);process.nextTick(t,n)}}function vN(r,e){let t=this[mt];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=r,t._socket[mt]!==void 0&&(t._socket.removeListener("data",Ac),process.nextTick(ix,t._socket),r===1005?t.close():t.close(r,e))}function yN(){let r=this[mt];r.isPaused||r._socket.resume()}function xN(r){let e=this[mt];e._socket[mt]!==void 0&&(e._socket.removeListener("data",Ac),process.nextTick(ix,e._socket),e.close(r[aN])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r))}function Q0(){this[mt].emitClose()}function _N(r,e){this[mt].emit("message",r,e)}function bN(r){let e=this[mt];e._autoPong&&e.pong(r,!this._isServer,tx),e.emit("ping",r)}function wN(r){this[mt].emit("pong",r)}function ix(r){r.resume()}function SN(r){let e=this[mt];e.readyState!==we.CLOSED&&(e.readyState===we.OPEN&&(e._readyState=we.CLOSING,sx(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r)))}function sx(r){r._closeTimer=setTimeout(r._socket.destroy.bind(r._socket),dN)}function ox(){let r=this[mt];this.removeListener("close",ox),this.removeListener("data",Ac),this.removeListener("end",ax),r._readyState=we.CLOSING;let e;!this._readableState.endEmitted&&!r._closeFrameReceived&&!r._receiver._writableState.errorEmitted&&(e=r._socket.read())!==null&&r._receiver.write(e),r._receiver.end(),this[mt]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",Q0),r._receiver.on("finish",Q0))}function Ac(r){this[mt]._receiver.write(r)||this.pause()}function ax(){let r=this[mt];r._readyState=we.CLOSING,r._receiver.end(),this.end()}function cx(){let r=this[mt];this.removeListener("error",cx),this.on("error",tx),r&&(r._readyState=we.CLOSING,this.destroy())}});var dx=A((y6,fx)=>{"use strict";var v6=Rc(),{Duplex:EN}=require("stream");function ux(r){r.emit("close")}function TN(){!this.destroyed&&this._writableState.finished&&this.destroy()}function px(r){this.removeListener("error",px),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function CN(r,e){let t=!0,n=new EN({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return r.on("message",function(s,o){let a=!o&&n._readableState.objectMode?s.toString():s;n.push(a)||r.pause()}),r.once("error",function(s){n.destroyed||(t=!1,n.destroy(s))}),r.once("close",function(){n.destroyed||n.push(null)}),n._destroy=function(i,s){if(r.readyState===r.CLOSED){s(i),process.nextTick(ux,n);return}let o=!1;r.once("error",function(c){o=!0,s(c)}),r.once("close",function(){o||s(i),process.nextTick(ux,n)}),t&&r.terminate()},n._final=function(i){if(r.readyState===r.CONNECTING){r.once("open",function(){n._final(i)});return}r._socket!==null&&(r._socket._writableState.finished?(i(),n._readableState.endEmitted&&n.destroy()):(r._socket.once("finish",function(){i()}),r.close()))},n._read=function(){r.isPaused&&r.resume()},n._write=function(i,s,o){if(r.readyState===r.CONNECTING){r.once("open",function(){n._write(i,s,o)});return}r.send(i,o)},n.on("end",TN),n.on("error",px),n}fx.exports=CN});var mx=A((x6,hx)=>{"use strict";var{tokenChars:kN}=Ki();function AN(r){let e=new Set,t=-1,n=-1,i=0;for(i;i<r.length;i++){let o=r.charCodeAt(i);if(n===-1&&kN[o]===1)t===-1&&(t=i);else if(i!==0&&(o===32||o===9))n===-1&&t!==-1&&(n=i);else if(o===44){if(t===-1)throw new SyntaxError(`Unexpected character at index ${i}`);n===-1&&(n=i);let a=r.slice(t,n);if(e.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);e.add(a),t=n=-1}else throw new SyntaxError(`Unexpected character at index ${i}`)}if(t===-1||n!==-1)throw new SyntaxError("Unexpected end of input");let s=r.slice(t,i);if(e.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);return e.add(s),e}hx.exports={parse:AN}});var wx=A((b6,bx)=>{"use strict";var RN=require("events"),Oc=require("http"),{Duplex:_6}=require("stream"),{createHash:ON}=require("crypto"),gx=Hf(),ri=yo(),MN=mx(),PN=Rc(),{GUID:IN,kWebSocket:NN}=nn(),DN=/^[+/0-9A-Za-z]{22}==$/,vx=0,yx=1,_x=2,Gf=class extends RN{constructor(e,t){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:PN,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(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(e.port!=null?(this._server=Oc.createServer((n,i)=>{let s=Oc.STATUS_CODES[426];i.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),i.end(s)}),this._server.listen(e.port,e.host,e.backlog,t)):e.server&&(this._server=e.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=LN(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,s,o)=>{this.handleUpgrade(i,s,o,n)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=vx}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(this._state===_x){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(wo,this);return}if(e&&this.once("close",e),this._state!==yx)if(this._state=yx,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(wo,this):process.nextTick(wo,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{wo(this)})}}shouldHandle(e){if(this.options.path){let t=e.url.indexOf("?");if((t!==-1?e.url.slice(0,t):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,t,n,i){t.on("error",xx);let s=e.headers["sec-websocket-key"],o=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){ni(this,e,t,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){ni(this,e,t,400,"Invalid Upgrade header");return}if(s===void 0||!DN.test(s)){ni(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){ni(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){So(t,400);return}let c=e.headers["sec-websocket-protocol"],l=new Set;if(c!==void 0)try{l=MN.parse(c)}catch{ni(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let u=e.headers["sec-websocket-extensions"],f={};if(this.options.perMessageDeflate&&u!==void 0){let h=new ri(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let g=gx.parse(u);g[ri.extensionName]&&(h.accept(g[ri.extensionName]),f[ri.extensionName]=h)}catch{ni(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let h={origin:e.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(h,(g,x,S,k)=>{if(!g)return So(t,x||401,S,k);this.completeUpgrade(f,s,l,e,t,n,i)});return}if(!this.options.verifyClient(h))return So(t,401)}this.completeUpgrade(f,s,l,e,t,n,i)}completeUpgrade(e,t,n,i,s,o,a){if(!s.readable||!s.writable)return s.destroy();if(s[NN])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>vx)return So(s,503);let l=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${ON("sha1").update(t+IN).digest("base64")}`],u=new this.options.WebSocket(null,void 0,this.options);if(n.size){let f=this.options.handleProtocols?this.options.handleProtocols(n,i):n.values().next().value;f&&(l.push(`Sec-WebSocket-Protocol: ${f}`),u._protocol=f)}if(e[ri.extensionName]){let f=e[ri.extensionName].params,h=gx.format({[ri.extensionName]:[f]});l.push(`Sec-WebSocket-Extensions: ${h}`),u._extensions=e}this.emit("headers",l,i),s.write(l.concat(`\r
|
|
12
|
+
`);function a(c){var l=xf(sn.join(c,"prebuilds")).map(g0),u=l.filter(v0(vf,gf)).sort(y0)[0];if(u){var f=sn.join(c,"prebuilds",u.name),h=xf(f).map(x0),g=h.filter(_0(mf,c0)),x=g.sort(b0(mf))[0];if(x)return sn.join(f,x.file)}}};function xf(r){try{return p0.readdirSync(r)}catch{return[]}}function l0(r,e){var t=xf(r).filter(e);return t[0]&&sn.join(r,t[0])}function u0(r){return/\.node$/.test(r)}function g0(r){var e=r.split("-");if(e.length===2){var t=e[0],n=e[1].split("+");if(t&&n.length&&n.every(Boolean))return{name:r,platform:t,architectures:n}}}function v0(r,e){return function(t){return t==null||t.platform!==r?!1:t.architectures.includes(e)}}function y0(r,e){return r.architectures.length-e.architectures.length}function x0(r){var e=r.split("."),t=e.pop(),n={file:r,specificity:0};if(t==="node"){for(var i=0;i<e.length;i++){var s=e[i];if(s==="node"||s==="electron"||s==="node-webkit")n.runtime=s;else if(s==="napi")n.napi=!0;else if(s.slice(0,3)==="abi")n.abi=s.slice(3);else if(s.slice(0,2)==="uv")n.uv=s.slice(2);else if(s.slice(0,4)==="armv")n.armv=s.slice(4);else if(s==="glibc"||s==="musl")n.libc=s;else continue;n.specificity++}return n}}function _0(r,e){return function(t){return!(t==null||t.runtime&&t.runtime!==r&&!bI(t)||t.abi&&t.abi!==e&&!t.napi||t.uv&&t.uv!==m0||t.armv&&t.armv!==yf||t.libc&&t.libc!==h0)}}function bI(r){return r.runtime==="node"&&r.napi}function b0(r){return function(e,t){return e.runtime!==t.runtime?e.runtime===r?-1:1:e.abi!==t.abi?e.abi?-1:1:e.specificity!==t.specificity?e.specificity>t.specificity?-1:1:0}}function wI(){return!!(process.versions&&process.versions.nw)}function SI(){return process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE?!0:typeof window<"u"&&window.process&&window.process.type==="renderer"}function EI(r){return r==="linux"&&p0.existsSync("/etc/alpine-release")}Fr.parseTags=x0;Fr.matchTags=_0;Fr.compareTags=b0;Fr.parseTuple=g0;Fr.matchTuple=v0;Fr.compareTuples=y0});var wf=A((p6,bf)=>{var _f=typeof __webpack_require__=="function"?__non_webpack_require__:require;typeof _f.addon=="function"?bf.exports=_f.addon.bind(_f):bf.exports=S0()});var T0=A((f6,E0)=>{"use strict";var TI=(r,e,t,n,i)=>{for(var s=0;s<i;s++)t[n+s]=r[s]^e[s&3]},CI=(r,e)=>{let t=r.length;for(var n=0;n<t;n++)r[n]^=e[n&3]};E0.exports={mask:TI,unmask:CI}});var Ef=A((d6,Sf)=>{"use strict";try{Sf.exports=wf()(__dirname)}catch{Sf.exports=T0()}});var xo=A((h6,xc)=>{"use strict";var{EMPTY_BUFFER:kI}=nn(),Tf=Buffer[Symbol.species];function AI(r,e){if(r.length===0)return kI;if(r.length===1)return r[0];let t=Buffer.allocUnsafe(e),n=0;for(let i=0;i<r.length;i++){let s=r[i];t.set(s,n),n+=s.length}return n<e?new Tf(t.buffer,t.byteOffset,n):t}function C0(r,e,t,n,i){for(let s=0;s<i;s++)t[n+s]=r[s]^e[s&3]}function k0(r,e){for(let t=0;t<r.length;t++)r[t]^=e[t&3]}function RI(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function Cf(r){if(Cf.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new Tf(r):ArrayBuffer.isView(r)?e=new Tf(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),Cf.readOnly=!1),e}xc.exports={concat:AI,mask:C0,toArrayBuffer:RI,toBuffer:Cf,unmask:k0};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=Ef();xc.exports.mask=function(e,t,n,i,s){s<48?C0(e,t,n,i,s):r.mask(e,t,n,i,s)},xc.exports.unmask=function(e,t){e.length<32?k0(e,t):r.unmask(e,t)}}catch{}});var O0=A((m6,R0)=>{"use strict";var A0=Symbol("kDone"),kf=Symbol("kRun"),Af=class{constructor(e){this[A0]=()=>{this.pending--,this[kf]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[kf]()}[kf](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[A0])}}};R0.exports=Af});var bo=A((g6,N0)=>{"use strict";var _o=require("zlib"),M0=xo(),OI=O0(),{kStatusCode:P0}=nn(),MI=Buffer[Symbol.species],PI=Buffer.from([0,0,255,255]),bc=Symbol("permessage-deflate"),on=Symbol("total-length"),Ki=Symbol("callback"),Dn=Symbol("buffers"),Yi=Symbol("error"),_c,Rf=class{constructor(e,t,n){if(this._maxPayload=n|0,this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,!_c){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;_c=new OI(i)}}static get extensionName(){return"permessage-deflate"}offer(){let 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:this._options.clientMaxWindowBits==null&&(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){let e=this._deflate[Ki];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let t=this._options,n=e.find(i=>!(t.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits=="number"&&t.serverMaxWindowBits>i.server_max_window_bits)||typeof t.clientMaxWindowBits=="number"&&!i.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),typeof t.serverMaxWindowBits=="number"&&(n.server_max_window_bits=t.serverMaxWindowBits),typeof t.clientMaxWindowBits=="number"?n.client_max_window_bits=t.clientMaxWindowBits:(n.client_max_window_bits===!0||t.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(e){let t=e[0];if(this._options.clientNoContextTakeover===!1&&t.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!t.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(t.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return t}normalizeParams(e){return e.forEach(t=>{Object.keys(t).forEach(n=>{let i=t[n];if(i.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(i=i[0],n==="client_max_window_bits"){if(i!==!0){let s=+i;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else if(n==="server_max_window_bits"){let s=+i;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=s}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(i!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else throw new Error(`Unknown parameter "${n}"`);t[n]=i})}),e}decompress(e,t,n){_c.add(i=>{this._decompress(e,t,(s,o)=>{i(),n(s,o)})})}compress(e,t,n){_c.add(i=>{this._compress(e,t,(s,o)=>{i(),n(s,o)})})}_decompress(e,t,n){let i=this._isServer?"client":"server";if(!this._inflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?_o.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=_o.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[bc]=this,this._inflate[on]=0,this._inflate[Dn]=[],this._inflate.on("error",NI),this._inflate.on("data",I0)}this._inflate[Ki]=n,this._inflate.write(e),t&&this._inflate.write(PI),this._inflate.flush(()=>{let s=this._inflate[Yi];if(s){this._inflate.close(),this._inflate=null,n(s);return}let o=M0.concat(this._inflate[Dn],this._inflate[on]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[on]=0,this._inflate[Dn]=[],t&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),n(null,o)})}_compress(e,t,n){let i=this._isServer?"server":"client";if(!this._deflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?_o.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=_o.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[on]=0,this._deflate[Dn]=[],this._deflate.on("data",II)}this._deflate[Ki]=n,this._deflate.write(e),this._deflate.flush(_o.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=M0.concat(this._deflate[Dn],this._deflate[on]);t&&(s=new MI(s.buffer,s.byteOffset,s.length-4)),this._deflate[Ki]=null,this._deflate[on]=0,this._deflate[Dn]=[],t&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,s)})}};N0.exports=Rf;function II(r){this[Dn].push(r),this[on]+=r.length}function I0(r){if(this[on]+=r.length,this[bc]._maxPayload<1||this[on]<=this[bc]._maxPayload){this[Dn].push(r);return}this[Yi]=new RangeError("Max payload size exceeded"),this[Yi].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Yi][P0]=1009,this.removeListener("data",I0),this.reset()}function NI(r){if(this[bc]._inflate=null,this[Yi]){this[Ki](this[Yi]);return}r[P0]=1007,this[Ki](r)}});var L0=A((v6,D0)=>{"use strict";function DI(r){let e=r.length,t=0;for(;t<e;)if((r[t]&128)===0)t++;else if((r[t]&224)===192){if(t+1===e||(r[t+1]&192)!==128||(r[t]&254)===192)return!1;t+=2}else if((r[t]&240)===224){if(t+2>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||r[t]===224&&(r[t+1]&224)===128||r[t]===237&&(r[t+1]&224)===160)return!1;t+=3}else if((r[t]&248)===240){if(t+3>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||(r[t+3]&192)!==128||r[t]===240&&(r[t+1]&240)===128||r[t]===244&&r[t+1]>143||r[t]>244)return!1;t+=4}else return!1;return!0}D0.exports=DI});var Mf=A((y6,Of)=>{"use strict";try{Of.exports=wf()(__dirname)}catch{Of.exports=L0()}});var Ji=A((x6,wc)=>{"use strict";var{isUtf8:B0}=require("buffer"),{hasBlob:LI}=nn(),BI=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function jI(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function Pf(r){let e=r.length,t=0;for(;t<e;)if((r[t]&128)===0)t++;else if((r[t]&224)===192){if(t+1===e||(r[t+1]&192)!==128||(r[t]&254)===192)return!1;t+=2}else if((r[t]&240)===224){if(t+2>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||r[t]===224&&(r[t+1]&224)===128||r[t]===237&&(r[t+1]&224)===160)return!1;t+=3}else if((r[t]&248)===240){if(t+3>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||(r[t+3]&192)!==128||r[t]===240&&(r[t+1]&240)===128||r[t]===244&&r[t+1]>143||r[t]>244)return!1;t+=4}else return!1;return!0}function FI(r){return LI&&typeof r=="object"&&typeof r.arrayBuffer=="function"&&typeof r.type=="string"&&typeof r.stream=="function"&&(r[Symbol.toStringTag]==="Blob"||r[Symbol.toStringTag]==="File")}wc.exports={isBlob:FI,isValidStatusCode:jI,isValidUTF8:Pf,tokenChars:BI};if(B0)wc.exports.isValidUTF8=function(r){return r.length<24?Pf(r):B0(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=Mf();wc.exports.isValidUTF8=function(e){return e.length<32?Pf(e):r(e)}}catch{}});var Bf=A((_6,W0)=>{"use strict";var{Writable:HI}=require("stream"),j0=bo(),{BINARY_TYPES:qI,EMPTY_BUFFER:F0,kStatusCode:UI,kWebSocket:$I}=nn(),{concat:If,toArrayBuffer:WI,unmask:GI}=xo(),{isValidStatusCode:zI,isValidUTF8:H0}=Ji(),Sc=Buffer[Symbol.species],or=0,q0=1,U0=2,$0=3,Nf=4,Df=5,Ec=6,Lf=class extends HI{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||qI[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[$I]=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=or}_write(e,t,n){if(this._opcode===8&&this._state==or)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){let n=this._buffers[0];return this._buffers[0]=new Sc(n.buffer,n.byteOffset+e,n.length-e),new Sc(n.buffer,n.byteOffset,e)}let t=Buffer.allocUnsafe(e);do{let n=this._buffers[0],i=t.length-e;e>=n.length?t.set(this._buffers.shift(),i):(t.set(new Uint8Array(n.buffer,n.byteOffset,e),i),this._buffers[0]=new Sc(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 or:this.getInfo(e);break;case q0:this.getPayloadLength16(e);break;case U0:this.getPayloadLength64(e);break;case $0:this.getMask();break;case Nf:this.getData(e);break;case Df:case Ec:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if((t[0]&48)!==0){let i=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(i);return}let n=(t[0]&64)===64;if(n&&!this._extensions[j0.extensionName]){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(!this._fragmented){let i=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let i=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(i);return}if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let i=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(i);return}}else{let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked){let i=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(i);return}}else if(this._masked){let i=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(i);return}this._payloadLength===126?this._state=q0:this._payloadLength===127?this._state=U0:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),n=t.readUInt32BE(0);if(n>Math.pow(2,21)-1){let i=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(i);return}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)){let t=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(t);return}this._masked?this._state=$0:this._state=Nf}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Nf}getData(e){let t=F0;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}t=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&GI(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=Df,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[j0.extensionName].decompress(e,this._fin,(i,s)=>{if(i)return t(i);if(s.length){if(this._messageLength+=s.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let o=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(o);return}this._fragments.push(s)}this.dataMessage(t),this._state===or&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=or;return}let t=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let i;this._binaryType==="nodebuffer"?i=If(n,t):this._binaryType==="arraybuffer"?i=WI(If(n,t)):this._binaryType==="blob"?i=new Blob(n):i=n,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=or):(this._state=Ec,setImmediate(()=>{this.emit("message",i,!0),this._state=or,this.startLoop(e)}))}else{let i=If(n,t);if(!this._skipUTF8Validation&&!H0(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(s);return}this._state===Df||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=or):(this._state=Ec,setImmediate(()=>{this.emit("message",i,!1),this._state=or,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,F0),this.end();else{let n=e.readUInt16BE(0);if(!zI(n)){let s=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(s);return}let i=new Sc(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!H0(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(s);return}this._loop=!1,this.emit("conclude",n,i),this.end()}this._state=or;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=or):(this._state=Ec,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=or,this.startLoop(t)}))}createError(e,t,n,i,s){this._loop=!1,this._errored=!0;let o=new e(n?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(o,this.createError),o.code=s,o[UI]=i,o}};W0.exports=Lf});var Hf=A((w6,V0)=>{"use strict";var{Duplex:b6}=require("stream"),{randomFillSync:VI}=require("crypto"),G0=bo(),{EMPTY_BUFFER:KI,kWebSocket:YI,NOOP:JI}=nn(),{isBlob:Xi,isValidStatusCode:XI}=Ji(),{mask:z0,toBuffer:ti}=xo(),ar=Symbol("kByteLength"),ZI=Buffer.alloc(4),Tc=8*1024,ri,Zi=Tc,Tr=0,QI=1,eN=2,jf=class r{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._queue=[],this._state=Tr,this.onerror=JI,this[YI]=void 0}static frame(e,t){let n,i=!1,s=2,o=!1;t.mask&&(n=t.maskBuffer||ZI,t.generateMask?t.generateMask(n):(Zi===Tc&&(ri===void 0&&(ri=Buffer.alloc(Tc)),VI(ri,0,Tc),Zi=0),n[0]=ri[Zi++],n[1]=ri[Zi++],n[2]=ri[Zi++],n[3]=ri[Zi++]),o=(n[0]|n[1]|n[2]|n[3])===0,s=6);let a;typeof e=="string"?(!t.mask||o)&&t[ar]!==void 0?a=t[ar]:(e=Buffer.from(e),a=e.length):(a=e.length,i=t.mask&&t.readOnly&&!o);let c=a;a>=65536?(s+=8,c=127):a>125&&(s+=2,c=126);let l=Buffer.allocUnsafe(i?a+s:s);return l[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(l[0]|=64),l[1]=c,c===126?l.writeUInt16BE(a,2):c===127&&(l[2]=l[3]=0,l.writeUIntBE(a,4,6)),t.mask?(l[1]|=128,l[s-4]=n[0],l[s-3]=n[1],l[s-2]=n[2],l[s-1]=n[3],o?[l,e]:i?(z0(e,n,l,s,a),[l]):(z0(e,n,e,0,a),[l,e])):[l,e]}close(e,t,n,i){let s;if(e===void 0)s=KI;else{if(typeof e!="number"||!XI(e))throw new TypeError("First argument must be a valid error code number");if(t===void 0||!t.length)s=Buffer.allocUnsafe(2),s.writeUInt16BE(e,0);else{let a=Buffer.byteLength(t);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");s=Buffer.allocUnsafe(2+a),s.writeUInt16BE(e,0),typeof t=="string"?s.write(t,2):s.set(t,2)}}let o={[ar]:s.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Tr?this.enqueue([this.dispatch,s,!1,o,i]):this.sendFrame(r.frame(s,o),i)}ping(e,t,n){let i,s;if(typeof e=="string"?(i=Buffer.byteLength(e),s=!1):Xi(e)?(i=e.size,s=!1):(e=ti(e),i=e.length,s=ti.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[ar]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};Xi(e)?this._state!==Tr?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Tr?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}pong(e,t,n){let i,s;if(typeof e=="string"?(i=Buffer.byteLength(e),s=!1):Xi(e)?(i=e.size,s=!1):(e=ti(e),i=e.length,s=ti.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[ar]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};Xi(e)?this._state!==Tr?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Tr?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}send(e,t,n){let i=this._extensions[G0.extensionName],s=t.binary?2:1,o=t.compress,a,c;typeof e=="string"?(a=Buffer.byteLength(e),c=!1):Xi(e)?(a=e.size,c=!1):(e=ti(e),a=e.length,c=ti.readOnly),this._firstFragment?(this._firstFragment=!1,o&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=a>=i._threshold),this._compress=o):(o=!1,s=0),t.fin&&(this._firstFragment=!0);let l={[ar]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:c,rsv1:o};Xi(e)?this._state!==Tr?this.enqueue([this.getBlobData,e,this._compress,l,n]):this.getBlobData(e,this._compress,l,n):this._state!==Tr?this.enqueue([this.dispatch,e,this._compress,l,n]):this.dispatch(e,this._compress,l,n)}getBlobData(e,t,n,i){this._bufferedBytes+=n[ar],this._state=eN,e.arrayBuffer().then(s=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(Ff,this,a,i);return}this._bufferedBytes-=n[ar];let o=ti(s);t?this.dispatch(o,t,n,i):(this._state=Tr,this.sendFrame(r.frame(o,n),i),this.dequeue())}).catch(s=>{process.nextTick(tN,this,s,i)})}dispatch(e,t,n,i){if(!t){this.sendFrame(r.frame(e,n),i);return}let s=this._extensions[G0.extensionName];this._bufferedBytes+=n[ar],this._state=QI,s.compress(e,n.fin,(o,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");Ff(this,c,i);return}this._bufferedBytes-=n[ar],this._state=Tr,n.readOnly=!1,this.sendFrame(r.frame(a,n),i),this.dequeue()})}dequeue(){for(;this._state===Tr&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][ar],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][ar],this._queue.push(e)}sendFrame(e,t){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork()):this._socket.write(e[0],t)}};V0.exports=jf;function Ff(r,e,t){typeof t=="function"&&t(e);for(let n=0;n<r._queue.length;n++){let i=r._queue[n],s=i[i.length-1];typeof s=="function"&&s(e)}}function tN(r,e,t){Ff(r,e,t),r.onerror(e)}});var rx=A((S6,tx)=>{"use strict";var{kForOnEventAttribute:wo,kListener:qf}=nn(),K0=Symbol("kCode"),Y0=Symbol("kData"),J0=Symbol("kError"),X0=Symbol("kMessage"),Z0=Symbol("kReason"),Qi=Symbol("kTarget"),Q0=Symbol("kType"),ex=Symbol("kWasClean"),an=class{constructor(e){this[Qi]=null,this[Q0]=e}get target(){return this[Qi]}get type(){return this[Q0]}};Object.defineProperty(an.prototype,"target",{enumerable:!0});Object.defineProperty(an.prototype,"type",{enumerable:!0});var ni=class extends an{constructor(e,t={}){super(e),this[K0]=t.code===void 0?0:t.code,this[Z0]=t.reason===void 0?"":t.reason,this[ex]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[K0]}get reason(){return this[Z0]}get wasClean(){return this[ex]}};Object.defineProperty(ni.prototype,"code",{enumerable:!0});Object.defineProperty(ni.prototype,"reason",{enumerable:!0});Object.defineProperty(ni.prototype,"wasClean",{enumerable:!0});var es=class extends an{constructor(e,t={}){super(e),this[J0]=t.error===void 0?null:t.error,this[X0]=t.message===void 0?"":t.message}get error(){return this[J0]}get message(){return this[X0]}};Object.defineProperty(es.prototype,"error",{enumerable:!0});Object.defineProperty(es.prototype,"message",{enumerable:!0});var So=class extends an{constructor(e,t={}){super(e),this[Y0]=t.data===void 0?null:t.data}get data(){return this[Y0]}};Object.defineProperty(So.prototype,"data",{enumerable:!0});var rN={addEventListener(r,e,t={}){for(let i of this.listeners(r))if(!t[wo]&&i[qf]===e&&!i[wo])return;let n;if(r==="message")n=function(s,o){let a=new So("message",{data:o?s:s.toString()});a[Qi]=this,Cc(e,this,a)};else if(r==="close")n=function(s,o){let a=new ni("close",{code:s,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[Qi]=this,Cc(e,this,a)};else if(r==="error")n=function(s){let o=new es("error",{error:s,message:s.message});o[Qi]=this,Cc(e,this,o)};else if(r==="open")n=function(){let s=new an("open");s[Qi]=this,Cc(e,this,s)};else return;n[wo]=!!t[wo],n[qf]=e,t.once?this.once(r,n):this.on(r,n)},removeEventListener(r,e){for(let t of this.listeners(r))if(t[qf]===e&&!t[wo]){this.removeListener(r,t);break}}};tx.exports={CloseEvent:ni,ErrorEvent:es,Event:an,EventTarget:rN,MessageEvent:So};function Cc(r,e,t){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,t):r.call(e,t)}});var Uf=A((E6,nx)=>{"use strict";var{tokenChars:Eo}=Ji();function Hr(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}function nN(r){let e=Object.create(null),t=Object.create(null),n=!1,i=!1,s=!1,o,a,c=-1,l=-1,u=-1,f=0;for(;f<r.length;f++)if(l=r.charCodeAt(f),o===void 0)if(u===-1&&Eo[l]===1)c===-1&&(c=f);else if(f!==0&&(l===32||l===9))u===-1&&c!==-1&&(u=f);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);u===-1&&(u=f);let g=r.slice(c,u);l===44?(Hr(e,g,t),t=Object.create(null)):o=g,c=u=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);else if(a===void 0)if(u===-1&&Eo[l]===1)c===-1&&(c=f);else if(l===32||l===9)u===-1&&c!==-1&&(u=f);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);u===-1&&(u=f),Hr(t,r.slice(c,u),!0),l===44&&(Hr(e,o,t),t=Object.create(null),o=void 0),c=u=-1}else if(l===61&&c!==-1&&u===-1)a=r.slice(c,f),c=u=-1;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(i){if(Eo[l]!==1)throw new SyntaxError(`Unexpected character at index ${f}`);c===-1?c=f:n||(n=!0),i=!1}else if(s)if(Eo[l]===1)c===-1&&(c=f);else if(l===34&&c!==-1)s=!1,u=f;else if(l===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(l===34&&r.charCodeAt(f-1)===61)s=!0;else if(u===-1&&Eo[l]===1)c===-1&&(c=f);else if(c!==-1&&(l===32||l===9))u===-1&&(u=f);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);u===-1&&(u=f);let g=r.slice(c,u);n&&(g=g.replace(/\\/g,""),n=!1),Hr(t,a,g),l===44&&(Hr(e,o,t),t=Object.create(null),o=void 0),a=void 0,c=u=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);if(c===-1||s||l===32||l===9)throw new SyntaxError("Unexpected end of input");u===-1&&(u=f);let h=r.slice(c,u);return o===void 0?Hr(e,h,t):(a===void 0?Hr(t,h,!0):n?Hr(t,a,h.replace(/\\/g,"")):Hr(t,a,h),Hr(e,o,t)),e}function iN(r){return Object.keys(r).map(e=>{let t=r[e];return Array.isArray(t)||(t=[t]),t.map(n=>[e].concat(Object.keys(n).map(i=>{let s=n[i];return Array.isArray(s)||(s=[s]),s.map(o=>o===!0?i:`${i}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}nx.exports={format:iN,parse:nN}});var Oc=A((k6,mx)=>{"use strict";var sN=require("events"),oN=require("https"),aN=require("http"),ox=require("net"),cN=require("tls"),{randomBytes:lN,createHash:uN}=require("crypto"),{Duplex:T6,Readable:C6}=require("stream"),{URL:$f}=require("url"),Ln=bo(),pN=Bf(),fN=Hf(),{isBlob:dN}=Ji(),{BINARY_TYPES:ix,EMPTY_BUFFER:kc,GUID:hN,kForOnEventAttribute:Wf,kListener:mN,kStatusCode:gN,kWebSocket:mt,NOOP:ax}=nn(),{EventTarget:{addEventListener:vN,removeEventListener:yN}}=rx(),{format:xN,parse:_N}=Uf(),{toBuffer:bN}=xo(),wN=30*1e3,cx=Symbol("kAborted"),Gf=[8,13],cn=["CONNECTING","OPEN","CLOSING","CLOSED"],SN=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,we=class r extends sN{constructor(e,t,n){super(),this._binaryType=ix[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=kc,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=r.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,t===void 0?t=[]:Array.isArray(t)||(typeof t=="object"&&t!==null?(n=t,t=[]):t=[t]),lx(this,e,t,n)):(this._autoPong=n.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){ix.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(e,t,n){let i=new pN({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),s=new fN(e,this._extensions,n.generateMask);this._receiver=i,this._sender=s,this._socket=e,i[mt]=this,s[mt]=this,e[mt]=this,i.on("conclude",CN),i.on("drain",kN),i.on("error",AN),i.on("message",RN),i.on("ping",ON),i.on("pong",MN),s.onerror=PN,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",fx),e.on("data",Rc),e.on("end",dx),e.on("error",hx),this._readyState=r.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Ln.extensionName]&&this._extensions[Ln.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){Jt(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===r.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=r.CLOSING,this._sender.close(e,t,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),px(this)}}pause(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=t=void 0):typeof t=="function"&&(n=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){zf(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||kc,t,n)}pong(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=t=void 0):typeof t=="function"&&(n=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){zf(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||kc,t,n)}resume(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"&&(n=t,t={}),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){zf(this,e,n);return}let i={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[Ln.extensionName]||(i.compress=!1),this._sender.send(e||kc,i,n)}terminate(){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){Jt(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=r.CLOSING,this._socket.destroy())}}};Object.defineProperty(we,"CONNECTING",{enumerable:!0,value:cn.indexOf("CONNECTING")});Object.defineProperty(we.prototype,"CONNECTING",{enumerable:!0,value:cn.indexOf("CONNECTING")});Object.defineProperty(we,"OPEN",{enumerable:!0,value:cn.indexOf("OPEN")});Object.defineProperty(we.prototype,"OPEN",{enumerable:!0,value:cn.indexOf("OPEN")});Object.defineProperty(we,"CLOSING",{enumerable:!0,value:cn.indexOf("CLOSING")});Object.defineProperty(we.prototype,"CLOSING",{enumerable:!0,value:cn.indexOf("CLOSING")});Object.defineProperty(we,"CLOSED",{enumerable:!0,value:cn.indexOf("CLOSED")});Object.defineProperty(we.prototype,"CLOSED",{enumerable:!0,value:cn.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(we.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(we.prototype,`on${r}`,{enumerable:!0,get(){for(let e of this.listeners(r))if(e[Wf])return e[mN];return null},set(e){for(let t of this.listeners(r))if(t[Wf]){this.removeListener(r,t);break}typeof e=="function"&&this.addEventListener(r,e,{[Wf]:!0})}})});we.prototype.addEventListener=vN;we.prototype.removeEventListener=yN;mx.exports=we;function lx(r,e,t,n){let i={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:Gf[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...n,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(r._autoPong=i.autoPong,!Gf.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${Gf.join(", ")})`);let s;if(e instanceof $f)s=e;else try{s=new $f(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),r._url=s.href;let o=s.protocol==="wss:",a=s.protocol==="ws+unix:",c;if(s.protocol!=="ws:"&&!o&&!a?c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!s.pathname?c="The URL's pathname is empty":s.hash&&(c="The URL contains a fragment identifier"),c){let S=new SyntaxError(c);if(r._redirects===0)throw S;Ac(r,S);return}let l=o?443:80,u=lN(16).toString("base64"),f=o?oN.request:aN.request,h=new Set,g;if(i.createConnection=i.createConnection||(o?TN:EN),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&&(g=new Ln(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=xN({[Ln.extensionName]:g.offer()})),t.length){for(let S of t){if(typeof S!="string"||!SN.test(S)||h.has(S))throw new SyntaxError("An invalid or duplicated subprotocol was specified");h.add(S)}i.headers["Sec-WebSocket-Protocol"]=t.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){let S=i.path.split(":");i.socketPath=S[0],i.path=S[1]}let x;if(i.followRedirects){if(r._redirects===0){r._originalIpc=a,r._originalSecure=o,r._originalHostOrSocketPath=a?i.socketPath:s.host;let S=n&&n.headers;if(n={...n,headers:{}},S)for(let[C,R]of Object.entries(S))n.headers[C.toLowerCase()]=R}else if(r.listenerCount("redirect")===0){let S=a?r._originalIpc?i.socketPath===r._originalHostOrSocketPath:!1:r._originalIpc?!1:s.host===r._originalHostOrSocketPath;(!S||r._originalSecure&&!o)&&(delete i.headers.authorization,delete i.headers.cookie,S||delete i.headers.host,i.auth=void 0)}i.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),x=r._req=f(i),r._redirects&&r.emit("redirect",r.url,x)}else x=r._req=f(i);i.timeout&&x.on("timeout",()=>{Jt(r,x,"Opening handshake has timed out")}),x.on("error",S=>{x===null||x[cx]||(x=r._req=null,Ac(r,S))}),x.on("response",S=>{let C=S.headers.location,R=S.statusCode;if(C&&i.followRedirects&&R>=300&&R<400){if(++r._redirects>i.maxRedirects){Jt(r,x,"Maximum redirects exceeded");return}x.abort();let M;try{M=new $f(C,e)}catch{let B=new SyntaxError(`Invalid URL: ${C}`);Ac(r,B);return}lx(r,M,t,n)}else r.emit("unexpected-response",x,S)||Jt(r,x,`Unexpected server response: ${S.statusCode}`)}),x.on("upgrade",(S,C,R)=>{if(r.emit("upgrade",S),r.readyState!==we.CONNECTING)return;x=r._req=null;let M=S.headers.upgrade;if(M===void 0||M.toLowerCase()!=="websocket"){Jt(r,C,"Invalid Upgrade header");return}let I=uN("sha1").update(u+hN).digest("base64");if(S.headers["sec-websocket-accept"]!==I){Jt(r,C,"Invalid Sec-WebSocket-Accept header");return}let B=S.headers["sec-websocket-protocol"],V;if(B!==void 0?h.size?h.has(B)||(V="Server sent an invalid subprotocol"):V="Server sent a subprotocol but none was requested":h.size&&(V="Server sent no subprotocol"),V){Jt(r,C,V);return}B&&(r._protocol=B);let F=S.headers["sec-websocket-extensions"];if(F!==void 0){if(!g){Jt(r,C,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let G;try{G=_N(F)}catch{Jt(r,C,"Invalid Sec-WebSocket-Extensions header");return}let D=Object.keys(G);if(D.length!==1||D[0]!==Ln.extensionName){Jt(r,C,"Server indicated an extension that was not requested");return}try{g.accept(G[Ln.extensionName])}catch{Jt(r,C,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[Ln.extensionName]=g}r.setSocket(C,R,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(x,r):x.end()}function Ac(r,e){r._readyState=we.CLOSING,r._errorEmitted=!0,r.emit("error",e),r.emitClose()}function EN(r){return r.path=r.socketPath,ox.connect(r)}function TN(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=ox.isIP(r.host)?"":r.host),cN.connect(r)}function Jt(r,e,t){r._readyState=we.CLOSING;let n=new Error(t);Error.captureStackTrace(n,Jt),e.setHeader?(e[cx]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(Ac,r,n)):(e.destroy(n),e.once("error",r.emit.bind(r,"error")),e.once("close",r.emitClose.bind(r)))}function zf(r,e,t){if(e){let n=dN(e)?e.size:bN(e).length;r._socket?r._sender._bufferedBytes+=n:r._bufferedAmount+=n}if(t){let n=new Error(`WebSocket is not open: readyState ${r.readyState} (${cn[r.readyState]})`);process.nextTick(t,n)}}function CN(r,e){let t=this[mt];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=r,t._socket[mt]!==void 0&&(t._socket.removeListener("data",Rc),process.nextTick(ux,t._socket),r===1005?t.close():t.close(r,e))}function kN(){let r=this[mt];r.isPaused||r._socket.resume()}function AN(r){let e=this[mt];e._socket[mt]!==void 0&&(e._socket.removeListener("data",Rc),process.nextTick(ux,e._socket),e.close(r[gN])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r))}function sx(){this[mt].emitClose()}function RN(r,e){this[mt].emit("message",r,e)}function ON(r){let e=this[mt];e._autoPong&&e.pong(r,!this._isServer,ax),e.emit("ping",r)}function MN(r){this[mt].emit("pong",r)}function ux(r){r.resume()}function PN(r){let e=this[mt];e.readyState!==we.CLOSED&&(e.readyState===we.OPEN&&(e._readyState=we.CLOSING,px(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r)))}function px(r){r._closeTimer=setTimeout(r._socket.destroy.bind(r._socket),wN)}function fx(){let r=this[mt];this.removeListener("close",fx),this.removeListener("data",Rc),this.removeListener("end",dx),r._readyState=we.CLOSING;let e;!this._readableState.endEmitted&&!r._closeFrameReceived&&!r._receiver._writableState.errorEmitted&&(e=r._socket.read())!==null&&r._receiver.write(e),r._receiver.end(),this[mt]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",sx),r._receiver.on("finish",sx))}function Rc(r){this[mt]._receiver.write(r)||this.pause()}function dx(){let r=this[mt];r._readyState=we.CLOSING,r._receiver.end(),this.end()}function hx(){let r=this[mt];this.removeListener("error",hx),this.on("error",ax),r&&(r._readyState=we.CLOSING,this.destroy())}});var xx=A((R6,yx)=>{"use strict";var A6=Oc(),{Duplex:IN}=require("stream");function gx(r){r.emit("close")}function NN(){!this.destroyed&&this._writableState.finished&&this.destroy()}function vx(r){this.removeListener("error",vx),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function DN(r,e){let t=!0,n=new IN({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return r.on("message",function(s,o){let a=!o&&n._readableState.objectMode?s.toString():s;n.push(a)||r.pause()}),r.once("error",function(s){n.destroyed||(t=!1,n.destroy(s))}),r.once("close",function(){n.destroyed||n.push(null)}),n._destroy=function(i,s){if(r.readyState===r.CLOSED){s(i),process.nextTick(gx,n);return}let o=!1;r.once("error",function(c){o=!0,s(c)}),r.once("close",function(){o||s(i),process.nextTick(gx,n)}),t&&r.terminate()},n._final=function(i){if(r.readyState===r.CONNECTING){r.once("open",function(){n._final(i)});return}r._socket!==null&&(r._socket._writableState.finished?(i(),n._readableState.endEmitted&&n.destroy()):(r._socket.once("finish",function(){i()}),r.close()))},n._read=function(){r.isPaused&&r.resume()},n._write=function(i,s,o){if(r.readyState===r.CONNECTING){r.once("open",function(){n._write(i,s,o)});return}r.send(i,o)},n.on("end",NN),n.on("error",vx),n}yx.exports=DN});var bx=A((O6,_x)=>{"use strict";var{tokenChars:LN}=Ji();function BN(r){let e=new Set,t=-1,n=-1,i=0;for(i;i<r.length;i++){let o=r.charCodeAt(i);if(n===-1&&LN[o]===1)t===-1&&(t=i);else if(i!==0&&(o===32||o===9))n===-1&&t!==-1&&(n=i);else if(o===44){if(t===-1)throw new SyntaxError(`Unexpected character at index ${i}`);n===-1&&(n=i);let a=r.slice(t,n);if(e.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);e.add(a),t=n=-1}else throw new SyntaxError(`Unexpected character at index ${i}`)}if(t===-1||n!==-1)throw new SyntaxError("Unexpected end of input");let s=r.slice(t,i);if(e.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);return e.add(s),e}_x.exports={parse:BN}});var Ax=A((P6,kx)=>{"use strict";var jN=require("events"),Mc=require("http"),{Duplex:M6}=require("stream"),{createHash:FN}=require("crypto"),wx=Uf(),ii=bo(),HN=bx(),qN=Oc(),{GUID:UN,kWebSocket:$N}=nn(),WN=/^[+/0-9A-Za-z]{22}==$/,Sx=0,Ex=1,Cx=2,Vf=class extends jN{constructor(e,t){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:qN,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(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(e.port!=null?(this._server=Mc.createServer((n,i)=>{let s=Mc.STATUS_CODES[426];i.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),i.end(s)}),this._server.listen(e.port,e.host,e.backlog,t)):e.server&&(this._server=e.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=GN(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,s,o)=>{this.handleUpgrade(i,s,o,n)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=Sx}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(this._state===Cx){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(To,this);return}if(e&&this.once("close",e),this._state!==Ex)if(this._state=Ex,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(To,this):process.nextTick(To,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{To(this)})}}shouldHandle(e){if(this.options.path){let t=e.url.indexOf("?");if((t!==-1?e.url.slice(0,t):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,t,n,i){t.on("error",Tx);let s=e.headers["sec-websocket-key"],o=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){si(this,e,t,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){si(this,e,t,400,"Invalid Upgrade header");return}if(s===void 0||!WN.test(s)){si(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){si(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){Co(t,400);return}let c=e.headers["sec-websocket-protocol"],l=new Set;if(c!==void 0)try{l=HN.parse(c)}catch{si(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let u=e.headers["sec-websocket-extensions"],f={};if(this.options.perMessageDeflate&&u!==void 0){let h=new ii(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let g=wx.parse(u);g[ii.extensionName]&&(h.accept(g[ii.extensionName]),f[ii.extensionName]=h)}catch{si(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let h={origin:e.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(h,(g,x,S,C)=>{if(!g)return Co(t,x||401,S,C);this.completeUpgrade(f,s,l,e,t,n,i)});return}if(!this.options.verifyClient(h))return Co(t,401)}this.completeUpgrade(f,s,l,e,t,n,i)}completeUpgrade(e,t,n,i,s,o,a){if(!s.readable||!s.writable)return s.destroy();if(s[$N])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Sx)return Co(s,503);let l=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${FN("sha1").update(t+UN).digest("base64")}`],u=new this.options.WebSocket(null,void 0,this.options);if(n.size){let f=this.options.handleProtocols?this.options.handleProtocols(n,i):n.values().next().value;f&&(l.push(`Sec-WebSocket-Protocol: ${f}`),u._protocol=f)}if(e[ii.extensionName]){let f=e[ii.extensionName].params,h=wx.format({[ii.extensionName]:[f]});l.push(`Sec-WebSocket-Extensions: ${h}`),u._extensions=e}this.emit("headers",l,i),s.write(l.concat(`\r
|
|
13
13
|
`).join(`\r
|
|
14
|
-
`)),s.removeListener("error",
|
|
14
|
+
`)),s.removeListener("error",Tx),u.setSocket(s,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(u),u.on("close",()=>{this.clients.delete(u),this._shouldEmitClose&&!this.clients.size&&process.nextTick(To,this)})),a(u,i)}};kx.exports=Vf;function GN(r,e){for(let t of Object.keys(e))r.on(t,e[t]);return function(){for(let n of Object.keys(e))r.removeListener(n,e[n])}}function To(r){r._state=Cx,r.emit("close")}function Tx(){this.destroy()}function Co(r,e,t,n){t=t||Mc.STATUS_CODES[e],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(t),...n},r.once("finish",r.destroy),r.end(`HTTP/1.1 ${e} ${Mc.STATUS_CODES[e]}\r
|
|
15
15
|
`+Object.keys(n).map(i=>`${i}: ${n[i]}`).join(`\r
|
|
16
16
|
`)+`\r
|
|
17
17
|
\r
|
|
18
|
-
`+t)}function ni(r,e,t,n,i,s){if(r.listenerCount("wsClientError")){let o=new Error(i);Error.captureStackTrace(o,ni),r.emit("wsClientError",o,t,e)}else So(t,n,i,s)}});var Ex=A((w6,Sx)=>{"use strict";var ln=Rc();ln.createWebSocketStream=dx();ln.Server=wx();ln.Receiver=Df();ln.Sender=jf();ln.WebSocket=ln;ln.WebSocketServer=ln.Server;Sx.exports=ln});var kx=A((S6,Cx)=>{"use strict";var Tx=Object.getOwnPropertySymbols,BN=Object.prototype.hasOwnProperty,jN=Object.prototype.propertyIsEnumerable;function FN(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function HN(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;var n=Object.getOwnPropertyNames(e).map(function(s){return e[s]});if(n.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(s){i[s]=s}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}Cx.exports=HN()?Object.assign:function(r,e){for(var t,n=FN(r),i,s=1;s<arguments.length;s++){t=Object(arguments[s]);for(var o in t)BN.call(t,o)&&(n[o]=t[o]);if(Tx){i=Tx(t);for(var a=0;a<i.length;a++)jN.call(t,i[a])&&(n[i[a]]=t[i[a]])}}return n}});var Ox=A((E6,zf)=>{"use strict";zf.exports=UN;zf.exports.append=Rx;var qN=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function Rx(r,e){if(typeof r!="string")throw new TypeError("header argument is required");if(!e)throw new TypeError("field argument is required");for(var t=Array.isArray(e)?e:Ax(String(e)),n=0;n<t.length;n++)if(!qN.test(t[n]))throw new TypeError("field argument contains an invalid header name");if(r==="*")return r;var i=r,s=Ax(r.toLowerCase());if(t.indexOf("*")!==-1||s.indexOf("*")!==-1)return"*";for(var o=0;o<t.length;o++){var a=t[o].toLowerCase();s.indexOf(a)===-1&&(s.push(a),i=i?i+", "+t[o]:t[o])}return i}function Ax(r){for(var e=0,t=[],n=0,i=0,s=r.length;i<s;i++)switch(r.charCodeAt(i)){case 32:n===e&&(n=e=i+1);break;case 44:t.push(r.substring(n,e)),n=e=i+1;break;default:e=i+1;break}return t.push(r.substring(n,e)),t}function UN(r,e){if(!r||!r.getHeader||!r.setHeader)throw new TypeError("res argument is required");var t=r.getHeader("Vary")||"",n=Array.isArray(t)?t.join(", "):String(t);(t=Rx(n,e))&&r.setHeader("Vary",t)}});var Vf=A((T6,Mx)=>{(function(){"use strict";var r=kx(),e=Ox(),t={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function n(x){return typeof x=="string"||x instanceof String}function i(x,S){if(Array.isArray(S)){for(var k=0;k<S.length;++k)if(i(x,S[k]))return!0;return!1}else return n(S)?x===S:S instanceof RegExp?S.test(x):!!S}function s(x,S){var k=S.headers.origin,R=[],M;return!x.origin||x.origin==="*"?R.push([{key:"Access-Control-Allow-Origin",value:"*"}]):n(x.origin)?(R.push([{key:"Access-Control-Allow-Origin",value:x.origin}]),R.push([{key:"Vary",value:"Origin"}])):(M=i(k,x.origin),R.push([{key:"Access-Control-Allow-Origin",value:M?k:!1}]),R.push([{key:"Vary",value:"Origin"}])),R}function o(x){var S=x.methods;return S.join&&(S=x.methods.join(",")),{key:"Access-Control-Allow-Methods",value:S}}function a(x){return x.credentials===!0?{key:"Access-Control-Allow-Credentials",value:"true"}:null}function c(x,S){var k=x.allowedHeaders||x.headers,R=[];return k?k.join&&(k=k.join(",")):(k=S.headers["access-control-request-headers"],R.push([{key:"Vary",value:"Access-Control-Request-Headers"}])),k&&k.length&&R.push([{key:"Access-Control-Allow-Headers",value:k}]),R}function l(x){var S=x.exposedHeaders;if(S)S.join&&(S=S.join(","));else return null;return S&&S.length?{key:"Access-Control-Expose-Headers",value:S}:null}function u(x){var S=(typeof x.maxAge=="number"||x.maxAge)&&x.maxAge.toString();return S&&S.length?{key:"Access-Control-Max-Age",value:S}:null}function f(x,S){for(var k=0,R=x.length;k<R;k++){var M=x[k];M&&(Array.isArray(M)?f(M,S):M.key==="Vary"&&M.value?e(S,M.value):M.value&&S.setHeader(M.key,M.value))}}function h(x,S,k,R){var M=[],I=S.method&&S.method.toUpperCase&&S.method.toUpperCase();I==="OPTIONS"?(M.push(s(x,S)),M.push(a(x)),M.push(o(x)),M.push(c(x,S)),M.push(u(x)),M.push(l(x)),f(M,k),x.preflightContinue?R():(k.statusCode=x.optionsSuccessStatus,k.setHeader("Content-Length","0"),k.end())):(M.push(s(x,S)),M.push(a(x)),M.push(l(x)),f(M,k),R())}function g(x){var S=null;return typeof x=="function"?S=x:S=function(k,R){R(null,x)},function(R,M,I){S(R,function(B,V){if(B)I(B);else{var F=r({},t,V),G=null;F.origin&&typeof F.origin=="function"?G=F.origin:F.origin&&(G=function(D,U){U(null,F.origin)}),G?G(R.headers.origin,function(D,U){D||!U?I(D):(F.origin=U,h(F,R,M,I))}):I()}})}}Mx.exports=g})()});var Yf=A(ts=>{"use strict";Object.defineProperty(ts,"__esModule",{value:!0});ts.Server=ts.BaseServer=void 0;var Px=Up(),Mc=lf(),$N=require("events"),Ix=pf(),WN=Ae(),GN=Zy(),zN=Ex(),Nx=af(),VN=mo(),ee=(0,WN.default)("engine"),Qi=Symbol("responseHeaders");function KN(r){try{let e=JSON.parse(r);if(typeof e.sid=="string")return e.sid}catch{}}var es=class extends $N.EventEmitter{constructor(e={}){super(),this.middlewares=[],this.clients={},this.clientsCount=0,this.opts=Object.assign({wsEngine:zN.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:e.cookie.path!==!1,sameSite:"lax"},e.cookie)),this.opts.cors&&this.use(Vf()(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 e.addTrailingSlash!==!1&&(t+="/"),t}upgrades(e){return this.opts.allowUpgrades?Mc.default[e].upgradesTo||[]:[]}verify(e,t,n){let i=e._query.transport;if(!~this.opts.transports.indexOf(i)||i==="webtransport")return ee('unknown transport "%s"',i),n(ye.errors.UNKNOWN_TRANSPORT,{transport:i});if(YN(e.headers.origin)){let a=e.headers.origin;return e.headers.origin=null,ee("origin header invalid"),n(ye.errors.BAD_REQUEST,{name:"INVALID_ORIGIN",origin:a})}let o=e._query.sid;if(o){if(!this.clients.hasOwnProperty(o))return ee('unknown sid "%s"',o),n(ye.errors.UNKNOWN_SID,{sid:o});let a=this.clients[o].transport.name;if(!t&&a!==i)return ee("bad request: unexpected transport without upgrade"),n(ye.errors.BAD_REQUEST,{name:"TRANSPORT_MISMATCH",transport:i,previousTransport:a})}else return e.method!=="GET"?n(ye.errors.BAD_HANDSHAKE_METHOD,{method:e.method}):i==="websocket"&&!t?(ee("invalid transport upgrade"),n(ye.errors.BAD_REQUEST,{name:"TRANSPORT_HANDSHAKE_ERROR"})):this.opts.allowRequest?this.opts.allowRequest(e,(a,c)=>{if(!c)return n(ye.errors.FORBIDDEN,{message:a});n()}):n();n()}use(e){this.middlewares.push(e)}_applyMiddlewares(e,t,n){if(this.middlewares.length===0)return ee("no middleware to apply, skipping"),n();let i=s=>{ee("applying middleware n\xB0%d",s+1),this.middlewares[s](e,t,o=>{if(o)return n(o);s+1<this.middlewares.length?i(s+1):n()})};i(0)}close(){ee("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 Px.generateId()}async handshake(e,t,n){let i=t._query.EIO==="4"?4:3;if(i===3&&!this.opts.allowEIO3){ee("unsupported protocol version"),this.emit("connection_error",{req:t,code:ye.errors.UNSUPPORTED_PROTOCOL_VERSION,message:ye.errorMessages[ye.errors.UNSUPPORTED_PROTOCOL_VERSION],context:{protocol:i}}),n(ye.errors.UNSUPPORTED_PROTOCOL_VERSION);return}let s;try{s=await this.generateId(t)}catch(c){ee("error while generating an id"),this.emit("connection_error",{req:t,code:ye.errors.BAD_REQUEST,message:ye.errorMessages[ye.errors.BAD_REQUEST],context:{name:"ID_GENERATION_ERROR",error:c}}),n(ye.errors.BAD_REQUEST);return}ee('handshaking client "%s"',s);try{var o=this.createTransport(e,t);e==="polling"?(o.maxHttpBufferSize=this.opts.maxHttpBufferSize,o.httpCompression=this.opts.httpCompression):e==="websocket"&&(o.perMessageDeflate=this.opts.perMessageDeflate)}catch(c){ee('error handshaking to transport "%s"',e),this.emit("connection_error",{req:t,code:ye.errors.BAD_REQUEST,message:ye.errorMessages[ye.errors.BAD_REQUEST],context:{name:"TRANSPORT_HANDSHAKE_ERROR",error:c}}),n(ye.errors.BAD_REQUEST);return}let a=new Ix.Socket(s,this,o,t,i);return o.on("headers",(c,l)=>{!l._query.sid&&(this.opts.cookie&&(c["Set-Cookie"]=[(0,GN.serialize)(this.opts.cookie.name,s,this.opts.cookie)]),this.emit("initial_headers",c,l)),this.emit("headers",c,l)}),o.onRequest(t),this.clients[s]=a,this.clientsCount++,a.once("close",()=>{delete this.clients[s],this.clientsCount--}),this.emit("connection",a),o}async onWebTransportSession(e){let t=setTimeout(()=>{ee("the client failed to establish a bidirectional stream in the given period"),e.close()},this.opts.upgradeTimeout),i=await e.incomingBidirectionalStreams.getReader().read();if(i.done){ee("session is closed");return}let s=i.value,o=(0,VN.createPacketDecoderStream)(this.opts.maxHttpBufferSize,"nodebuffer"),a=s.readable.pipeThrough(o).getReader(),{value:c,done:l}=await a.read();if(l){ee("stream is closed");return}if(clearTimeout(t),c.type!=="open")return ee("invalid WebTransport handshake"),e.close();if(c.data===void 0){let h=new Nx.WebTransport(e,s,a),g=Px.generateId();ee('handshaking client "%s" (WebTransport)',g);let x=new Ix.Socket(g,this,h,null,4);this.clients[g]=x,this.clientsCount++,x.once("close",()=>{delete this.clients[g],this.clientsCount--}),this.emit("connection",x);return}let u=KN(c.data);if(!u)return ee("invalid WebTransport handshake"),e.close();let f=this.clients[u];if(!f)ee("upgrade attempt for closed client"),e.close();else if(f.upgrading)ee("transport has already been trying to upgrade"),e.close();else if(f.upgraded)ee("transport had already been upgraded"),e.close();else{ee("upgrading existing transport");let h=new Nx.WebTransport(e,s,a);f._maybeUpgrade(h)}}};ts.BaseServer=es;es.errors={UNKNOWN_TRANSPORT:0,UNKNOWN_SID:1,BAD_HANDSHAKE_METHOD:2,BAD_REQUEST:3,FORBIDDEN:4,UNSUPPORTED_PROTOCOL_VERSION:5};es.errorMessages={0:"Transport unknown",1:"Session ID unknown",2:"Bad handshake method",3:"Bad request",4:"Forbidden",5:"Unsupported protocol version"};var Kf=class{constructor(e,t){this.req=e,this.socket=t,e[Qi]={}}setHeader(e,t){this.req[Qi][e]=t}getHeader(e){return this.req[Qi][e]}removeHeader(e){delete this.req[Qi][e]}write(){}writeHead(){}end(){this.socket.destroy()}},ye=class r extends es{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}),typeof this.ws.on=="function"&&this.ws.on("headers",(e,t)=>{let n=t[Qi]||{};delete t[Qi],!t._query.sid&&this.emit("initial_headers",n,t),this.emit("headers",n,t),ee("writing headers: %j",n),Object.keys(n).forEach(s=>{e.push(`${s}: ${n[s]}`)})}))}cleanup(){this.ws&&(ee("closing webSocketServer"),this.ws.close())}prepare(e){if(!e._query){let t=new URL(e.url,"https://socket.io");e._query=Object.fromEntries(t.searchParams.entries())}}createTransport(e,t){return new Mc.default[e](t)}handleRequest(e,t){ee('handling "%s" http request "%s"',e.method,e.url),this.prepare(e),e.res=t;let n=(i,s)=>{if(i!==void 0){this.emit("connection_error",{req:e,code:i,message:r.errorMessages[i],context:s}),Dx(t,i,s);return}if(e._query.sid)ee("setting new request for existing client"),this.clients[e._query.sid].transport.onRequest(e);else{let o=(a,c)=>Dx(t,a,c);this.handshake(e._query.transport,e,o)}};this._applyMiddlewares(e,t,i=>{i?n(r.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(e,!1,n)})}handleUpgrade(e,t,n){this.prepare(e);let i=new Kf(e,t),s=(o,a)=>{if(o!==void 0){this.emit("connection_error",{req:e,code:o,message:r.errorMessages[o],context:a}),Lx(t,o,a);return}let c=Buffer.from(n);n=null,i.writeHead(),this.ws.handleUpgrade(e,t,c,l=>{this.onWebSocket(e,t,l)})};this._applyMiddlewares(e,i,o=>{o?s(r.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(e,!0,s)})}onWebSocket(e,t,n){if(n.on("error",s),Mc.default[e._query.transport]!==void 0&&!Mc.default[e._query.transport].prototype.handlesUpgrades){ee("transport doesnt handle upgraded requests"),n.close();return}let i=e._query.sid;if(e.websocket=n,i){let o=this.clients[i];if(!o)ee("upgrade attempt for closed client"),n.close();else if(o.upgrading)ee("transport has already been trying to upgrade"),n.close();else if(o.upgraded)ee("transport had already been upgraded"),n.close();else{ee("upgrading existing transport"),n.removeListener("error",s);let a=this.createTransport(e._query.transport,e);a.perMessageDeflate=this.opts.perMessageDeflate,o._maybeUpgrade(a)}}else{let o=(a,c)=>Lx(t,a,c);this.handshake(e._query.transport,e,o)}function s(){ee("websocket error before upgrade")}}attach(e,t={}){let n=this._computePath(t),i=t.destroyUpgradeTimeout||1e3;function s(a){return n===a.url.slice(0,n.length)}let o=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",(a,c)=>{if(s(a))ee('intercepting request for path "%s"',n),this.handleRequest(a,c);else{let l=0,u=o.length;for(;l<u;l++)o[l].call(e,a,c)}}),~this.opts.transports.indexOf("websocket")&&e.on("upgrade",(a,c,l)=>{s(a)?this.handleUpgrade(a,c,l):t.destroyUpgrade!==!1&&setTimeout(function(){if(c.writable&&c.bytesWritten<=0)return c.on("error",u=>{ee("error while destroying upgrade: %s",u.message)}),c.end()},i)})}};ts.Server=ye;function Dx(r,e,t){let n=e===ye.errors.FORBIDDEN?403:400,i=t&&t.message?t.message:ye.errorMessages[e];r.writeHead(n,{"Content-Type":"application/json"}),r.end(JSON.stringify({code:e,message:i}))}function Lx(r,e,t={}){if(r.on("error",()=>{ee("ignoring error from closed connection")}),r.writable){let n=t.message||ye.errorMessages[e],i=Buffer.byteLength(n);r.write(`HTTP/1.1 400 Bad Request\r
|
|
18
|
+
`+t)}function si(r,e,t,n,i,s){if(r.listenerCount("wsClientError")){let o=new Error(i);Error.captureStackTrace(o,si),r.emit("wsClientError",o,t,e)}else Co(t,n,i,s)}});var Ox=A((I6,Rx)=>{"use strict";var ln=Oc();ln.createWebSocketStream=xx();ln.Server=Ax();ln.Receiver=Bf();ln.Sender=Hf();ln.WebSocket=ln;ln.WebSocketServer=ln.Server;Rx.exports=ln});var Ix=A((N6,Px)=>{"use strict";var Mx=Object.getOwnPropertySymbols,zN=Object.prototype.hasOwnProperty,VN=Object.prototype.propertyIsEnumerable;function KN(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function YN(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var e={},t=0;t<10;t++)e["_"+String.fromCharCode(t)]=t;var n=Object.getOwnPropertyNames(e).map(function(s){return e[s]});if(n.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(s){i[s]=s}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}Px.exports=YN()?Object.assign:function(r,e){for(var t,n=KN(r),i,s=1;s<arguments.length;s++){t=Object(arguments[s]);for(var o in t)zN.call(t,o)&&(n[o]=t[o]);if(Mx){i=Mx(t);for(var a=0;a<i.length;a++)VN.call(t,i[a])&&(n[i[a]]=t[i[a]])}}return n}});var Lx=A((D6,Kf)=>{"use strict";Kf.exports=XN;Kf.exports.append=Dx;var JN=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function Dx(r,e){if(typeof r!="string")throw new TypeError("header argument is required");if(!e)throw new TypeError("field argument is required");for(var t=Array.isArray(e)?e:Nx(String(e)),n=0;n<t.length;n++)if(!JN.test(t[n]))throw new TypeError("field argument contains an invalid header name");if(r==="*")return r;var i=r,s=Nx(r.toLowerCase());if(t.indexOf("*")!==-1||s.indexOf("*")!==-1)return"*";for(var o=0;o<t.length;o++){var a=t[o].toLowerCase();s.indexOf(a)===-1&&(s.push(a),i=i?i+", "+t[o]:t[o])}return i}function Nx(r){for(var e=0,t=[],n=0,i=0,s=r.length;i<s;i++)switch(r.charCodeAt(i)){case 32:n===e&&(n=e=i+1);break;case 44:t.push(r.substring(n,e)),n=e=i+1;break;default:e=i+1;break}return t.push(r.substring(n,e)),t}function XN(r,e){if(!r||!r.getHeader||!r.setHeader)throw new TypeError("res argument is required");var t=r.getHeader("Vary")||"",n=Array.isArray(t)?t.join(", "):String(t);(t=Dx(n,e))&&r.setHeader("Vary",t)}});var Yf=A((L6,Bx)=>{(function(){"use strict";var r=Ix(),e=Lx(),t={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function n(x){return typeof x=="string"||x instanceof String}function i(x,S){if(Array.isArray(S)){for(var C=0;C<S.length;++C)if(i(x,S[C]))return!0;return!1}else return n(S)?x===S:S instanceof RegExp?S.test(x):!!S}function s(x,S){var C=S.headers.origin,R=[],M;return!x.origin||x.origin==="*"?R.push([{key:"Access-Control-Allow-Origin",value:"*"}]):n(x.origin)?(R.push([{key:"Access-Control-Allow-Origin",value:x.origin}]),R.push([{key:"Vary",value:"Origin"}])):(M=i(C,x.origin),R.push([{key:"Access-Control-Allow-Origin",value:M?C:!1}]),R.push([{key:"Vary",value:"Origin"}])),R}function o(x){var S=x.methods;return S.join&&(S=x.methods.join(",")),{key:"Access-Control-Allow-Methods",value:S}}function a(x){return x.credentials===!0?{key:"Access-Control-Allow-Credentials",value:"true"}:null}function c(x,S){var C=x.allowedHeaders||x.headers,R=[];return C?C.join&&(C=C.join(",")):(C=S.headers["access-control-request-headers"],R.push([{key:"Vary",value:"Access-Control-Request-Headers"}])),C&&C.length&&R.push([{key:"Access-Control-Allow-Headers",value:C}]),R}function l(x){var S=x.exposedHeaders;if(S)S.join&&(S=S.join(","));else return null;return S&&S.length?{key:"Access-Control-Expose-Headers",value:S}:null}function u(x){var S=(typeof x.maxAge=="number"||x.maxAge)&&x.maxAge.toString();return S&&S.length?{key:"Access-Control-Max-Age",value:S}:null}function f(x,S){for(var C=0,R=x.length;C<R;C++){var M=x[C];M&&(Array.isArray(M)?f(M,S):M.key==="Vary"&&M.value?e(S,M.value):M.value&&S.setHeader(M.key,M.value))}}function h(x,S,C,R){var M=[],I=S.method&&S.method.toUpperCase&&S.method.toUpperCase();I==="OPTIONS"?(M.push(s(x,S)),M.push(a(x)),M.push(o(x)),M.push(c(x,S)),M.push(u(x)),M.push(l(x)),f(M,C),x.preflightContinue?R():(C.statusCode=x.optionsSuccessStatus,C.setHeader("Content-Length","0"),C.end())):(M.push(s(x,S)),M.push(a(x)),M.push(l(x)),f(M,C),R())}function g(x){var S=null;return typeof x=="function"?S=x:S=function(C,R){R(null,x)},function(R,M,I){S(R,function(B,V){if(B)I(B);else{var F=r({},t,V),G=null;F.origin&&typeof F.origin=="function"?G=F.origin:F.origin&&(G=function(D,U){U(null,F.origin)}),G?G(R.headers.origin,function(D,U){D||!U?I(D):(F.origin=U,h(F,R,M,I))}):I()}})}}Bx.exports=g})()});var Xf=A(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.Server=ns.BaseServer=void 0;var jx=Wp(),Pc=pf(),ZN=require("events"),Fx=df(),QN=Ae(),eD=i0(),tD=Ox(),Hx=lf(),rD=yo(),ee=(0,QN.default)("engine"),ts=Symbol("responseHeaders");function nD(r){try{let e=JSON.parse(r);if(typeof e.sid=="string")return e.sid}catch{}}var rs=class extends ZN.EventEmitter{constructor(e={}){super(),this.middlewares=[],this.clients={},this.clientsCount=0,this.opts=Object.assign({wsEngine:tD.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:e.cookie.path!==!1,sameSite:"lax"},e.cookie)),this.opts.cors&&this.use(Yf()(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 e.addTrailingSlash!==!1&&(t+="/"),t}upgrades(e){return this.opts.allowUpgrades?Pc.default[e].upgradesTo||[]:[]}verify(e,t,n){let i=e._query.transport;if(!~this.opts.transports.indexOf(i)||i==="webtransport")return ee('unknown transport "%s"',i),n(ye.errors.UNKNOWN_TRANSPORT,{transport:i});if(iD(e.headers.origin)){let a=e.headers.origin;return e.headers.origin=null,ee("origin header invalid"),n(ye.errors.BAD_REQUEST,{name:"INVALID_ORIGIN",origin:a})}let o=e._query.sid;if(o){if(!this.clients.hasOwnProperty(o))return ee('unknown sid "%s"',o),n(ye.errors.UNKNOWN_SID,{sid:o});let a=this.clients[o].transport.name;if(!t&&a!==i)return ee("bad request: unexpected transport without upgrade"),n(ye.errors.BAD_REQUEST,{name:"TRANSPORT_MISMATCH",transport:i,previousTransport:a})}else return e.method!=="GET"?n(ye.errors.BAD_HANDSHAKE_METHOD,{method:e.method}):i==="websocket"&&!t?(ee("invalid transport upgrade"),n(ye.errors.BAD_REQUEST,{name:"TRANSPORT_HANDSHAKE_ERROR"})):this.opts.allowRequest?this.opts.allowRequest(e,(a,c)=>{if(!c)return n(ye.errors.FORBIDDEN,{message:a});n()}):n();n()}use(e){this.middlewares.push(e)}_applyMiddlewares(e,t,n){if(this.middlewares.length===0)return ee("no middleware to apply, skipping"),n();let i=s=>{ee("applying middleware n\xB0%d",s+1),this.middlewares[s](e,t,o=>{if(o)return n(o);s+1<this.middlewares.length?i(s+1):n()})};i(0)}close(){ee("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 jx.generateId()}async handshake(e,t,n){let i=t._query.EIO==="4"?4:3;if(i===3&&!this.opts.allowEIO3){ee("unsupported protocol version"),this.emit("connection_error",{req:t,code:ye.errors.UNSUPPORTED_PROTOCOL_VERSION,message:ye.errorMessages[ye.errors.UNSUPPORTED_PROTOCOL_VERSION],context:{protocol:i}}),n(ye.errors.UNSUPPORTED_PROTOCOL_VERSION);return}let s;try{s=await this.generateId(t)}catch(c){ee("error while generating an id"),this.emit("connection_error",{req:t,code:ye.errors.BAD_REQUEST,message:ye.errorMessages[ye.errors.BAD_REQUEST],context:{name:"ID_GENERATION_ERROR",error:c}}),n(ye.errors.BAD_REQUEST);return}ee('handshaking client "%s"',s);try{var o=this.createTransport(e,t);e==="polling"?(o.maxHttpBufferSize=this.opts.maxHttpBufferSize,o.httpCompression=this.opts.httpCompression):e==="websocket"&&(o.perMessageDeflate=this.opts.perMessageDeflate)}catch(c){ee('error handshaking to transport "%s"',e),this.emit("connection_error",{req:t,code:ye.errors.BAD_REQUEST,message:ye.errorMessages[ye.errors.BAD_REQUEST],context:{name:"TRANSPORT_HANDSHAKE_ERROR",error:c}}),n(ye.errors.BAD_REQUEST);return}let a=new Fx.Socket(s,this,o,t,i);return o.on("headers",(c,l)=>{!l._query.sid&&(this.opts.cookie&&(c["Set-Cookie"]=[(0,eD.serialize)(this.opts.cookie.name,s,this.opts.cookie)]),this.emit("initial_headers",c,l)),this.emit("headers",c,l)}),o.onRequest(t),this.clients[s]=a,this.clientsCount++,a.once("close",()=>{delete this.clients[s],this.clientsCount--}),this.emit("connection",a),o}async onWebTransportSession(e){let t=setTimeout(()=>{ee("the client failed to establish a bidirectional stream in the given period"),e.close()},this.opts.upgradeTimeout),i=await e.incomingBidirectionalStreams.getReader().read();if(i.done){ee("session is closed");return}let s=i.value,o=(0,rD.createPacketDecoderStream)(this.opts.maxHttpBufferSize,"nodebuffer"),a=s.readable.pipeThrough(o).getReader(),{value:c,done:l}=await a.read();if(l){ee("stream is closed");return}if(clearTimeout(t),c.type!=="open")return ee("invalid WebTransport handshake"),e.close();if(c.data===void 0){let h=new Hx.WebTransport(e,s,a),g=jx.generateId();ee('handshaking client "%s" (WebTransport)',g);let x=new Fx.Socket(g,this,h,null,4);this.clients[g]=x,this.clientsCount++,x.once("close",()=>{delete this.clients[g],this.clientsCount--}),this.emit("connection",x);return}let u=nD(c.data);if(!u)return ee("invalid WebTransport handshake"),e.close();let f=this.clients[u];if(!f)ee("upgrade attempt for closed client"),e.close();else if(f.upgrading)ee("transport has already been trying to upgrade"),e.close();else if(f.upgraded)ee("transport had already been upgraded"),e.close();else{ee("upgrading existing transport");let h=new Hx.WebTransport(e,s,a);f._maybeUpgrade(h)}}};ns.BaseServer=rs;rs.errors={UNKNOWN_TRANSPORT:0,UNKNOWN_SID:1,BAD_HANDSHAKE_METHOD:2,BAD_REQUEST:3,FORBIDDEN:4,UNSUPPORTED_PROTOCOL_VERSION:5};rs.errorMessages={0:"Transport unknown",1:"Session ID unknown",2:"Bad handshake method",3:"Bad request",4:"Forbidden",5:"Unsupported protocol version"};var Jf=class{constructor(e,t){this.req=e,this.socket=t,e[ts]={}}setHeader(e,t){this.req[ts][e]=t}getHeader(e){return this.req[ts][e]}removeHeader(e){delete this.req[ts][e]}write(){}writeHead(){}end(){this.socket.destroy()}},ye=class r extends rs{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}),typeof this.ws.on=="function"&&this.ws.on("headers",(e,t)=>{let n=t[ts]||{};delete t[ts],!t._query.sid&&this.emit("initial_headers",n,t),this.emit("headers",n,t),ee("writing headers: %j",n),Object.keys(n).forEach(s=>{e.push(`${s}: ${n[s]}`)})}))}cleanup(){this.ws&&(ee("closing webSocketServer"),this.ws.close())}prepare(e){if(!e._query){let t=new URL(e.url,"https://socket.io");e._query=Object.fromEntries(t.searchParams.entries())}}createTransport(e,t){return new Pc.default[e](t)}handleRequest(e,t){ee('handling "%s" http request "%s"',e.method,e.url),this.prepare(e),e.res=t;let n=(i,s)=>{if(i!==void 0){this.emit("connection_error",{req:e,code:i,message:r.errorMessages[i],context:s}),qx(t,i,s);return}if(e._query.sid)ee("setting new request for existing client"),this.clients[e._query.sid].transport.onRequest(e);else{let o=(a,c)=>qx(t,a,c);this.handshake(e._query.transport,e,o)}};this._applyMiddlewares(e,t,i=>{i?n(r.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(e,!1,n)})}handleUpgrade(e,t,n){this.prepare(e);let i=new Jf(e,t),s=(o,a)=>{if(o!==void 0){this.emit("connection_error",{req:e,code:o,message:r.errorMessages[o],context:a}),Ux(t,o,a);return}let c=Buffer.from(n);n=null,i.writeHead(),this.ws.handleUpgrade(e,t,c,l=>{this.onWebSocket(e,t,l)})};this._applyMiddlewares(e,i,o=>{o?s(r.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(e,!0,s)})}onWebSocket(e,t,n){if(n.on("error",s),Pc.default[e._query.transport]!==void 0&&!Pc.default[e._query.transport].prototype.handlesUpgrades){ee("transport doesnt handle upgraded requests"),n.close();return}let i=e._query.sid;if(e.websocket=n,i){let o=this.clients[i];if(!o)ee("upgrade attempt for closed client"),n.close();else if(o.upgrading)ee("transport has already been trying to upgrade"),n.close();else if(o.upgraded)ee("transport had already been upgraded"),n.close();else{ee("upgrading existing transport"),n.removeListener("error",s);let a=this.createTransport(e._query.transport,e);a.perMessageDeflate=this.opts.perMessageDeflate,o._maybeUpgrade(a)}}else{let o=(a,c)=>Ux(t,a,c);this.handshake(e._query.transport,e,o)}function s(){ee("websocket error before upgrade")}}attach(e,t={}){let n=this._computePath(t),i=t.destroyUpgradeTimeout||1e3;function s(a){return n===a.url.slice(0,n.length)}let o=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",(a,c)=>{if(s(a))ee('intercepting request for path "%s"',n),this.handleRequest(a,c);else{let l=0,u=o.length;for(;l<u;l++)o[l].call(e,a,c)}}),~this.opts.transports.indexOf("websocket")&&e.on("upgrade",(a,c,l)=>{s(a)?this.handleUpgrade(a,c,l):t.destroyUpgrade!==!1&&setTimeout(function(){if(c.writable&&c.bytesWritten<=0)return c.on("error",u=>{ee("error while destroying upgrade: %s",u.message)}),c.end()},i)})}};ns.Server=ye;function qx(r,e,t){let n=e===ye.errors.FORBIDDEN?403:400,i=t&&t.message?t.message:ye.errorMessages[e];r.writeHead(n,{"Content-Type":"application/json"}),r.end(JSON.stringify({code:e,message:i}))}function Ux(r,e,t={}){if(r.on("error",()=>{ee("ignoring error from closed connection")}),r.writable){let n=t.message||ye.errorMessages[e],i=Buffer.byteLength(n);r.write(`HTTP/1.1 400 Bad Request\r
|
|
19
19
|
Connection: close\r
|
|
20
20
|
Content-type: text/html\r
|
|
21
21
|
Content-Length: `+i+`\r
|
|
22
22
|
\r
|
|
23
|
-
`+n)}r.destroy()}var Eo=[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];function YN(r){if(r+="",r.length<1)return!1;if(!Eo[r.charCodeAt(0)])return ee('invalid header, index 0, char "%s"',r.charCodeAt(0)),!0;if(r.length<2)return!1;if(!Eo[r.charCodeAt(1)])return ee('invalid header, index 1, char "%s"',r.charCodeAt(1)),!0;if(r.length<3)return!1;if(!Eo[r.charCodeAt(2)])return ee('invalid header, index 2, char "%s"',r.charCodeAt(2)),!0;if(r.length<4)return!1;if(!Eo[r.charCodeAt(3)])return ee('invalid header, index 3, char "%s"',r.charCodeAt(3)),!0;for(let e=4;e<r.length;++e)if(!Eo[r.charCodeAt(e)])return ee('invalid header, index "%i", char "%s"',e,r.charCodeAt(e)),!0;return!1}});var jx=A(Pc=>{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});Pc.Polling=void 0;var JN=Zn(),Bx=require("zlib"),XN=Qa(),ZN=Ae(),ar=(0,ZN.default)("engine:polling"),QN={gzip:Bx.createGzip,deflate:Bx.createDeflate},Jf=class extends JN.Transport{constructor(e){super(e),this.closeTimeout=30*1e3}get name(){return"polling"}onRequest(e){let t=e.res;e.res=null,e.getMethod()==="get"?this.onPollRequest(e,t):e.getMethod()==="post"?this.onDataRequest(e,t):(t.writeStatus("500 Internal Server Error"),t.end())}onPollRequest(e,t){if(this.req){ar("request overlap"),this.onError("overlap from client"),t.writeStatus("500 Internal Server Error"),t.end();return}ar("setting request"),this.req=e,this.res=t;let n=()=>{this.writable=!1,this.onError("poll connection closed prematurely")},i=()=>{this.req=this.res=null};e.cleanup=i,t.onAborted(n),this.writable=!0,this.emit("ready"),this.writable&&this.shouldClose&&(ar("triggering empty send to append close packet"),this.send([{type:"noop"}]))}onDataRequest(e,t){if(this.dataReq){this.onError("data request overlap from client"),t.writeStatus("500 Internal Server Error"),t.end();return}let n=Number(e.headers["content-length"]);if(!n){this.onError("content-length header required"),t.writeStatus("411 Length Required").end();return}if(n>this.maxHttpBufferSize){this.onError("payload too large"),t.writeStatus("413 Payload Too Large").end();return}if(e.headers["content-type"]==="application/octet-stream"&&this.protocol===4)return this.onError("invalid content");this.dataReq=e,this.dataRes=t;let s,o=0,a={"Content-Type":"text/html"};this.headers(e,a);for(let l in a)t.writeHeader(l,String(a[l]));let c=l=>{this.onData(l.toString()),this.onDataRequestCleanup(),t.cork(()=>{t.end("ok")})};t.onAborted(()=>{this.onDataRequestCleanup(),this.onError("data request connection closed prematurely")}),t.onData((l,u)=>{let f=o+l.byteLength;if(f>n){this.onError("content-length mismatch"),t.close();return}if(!s){if(u){c(Buffer.from(l));return}s=Buffer.allocUnsafe(n)}if(Buffer.from(l).copy(s,o),u){if(f!=n){this.onError("content-length mismatch"),t.writeStatus("400 Content-Length Mismatch").end(),this.onDataRequestCleanup();return}c(s);return}o=f})}onDataRequestCleanup(){this.dataReq=this.dataRes=null}onData(e){ar('received "%s"',e);let t=n=>{if(n.type==="close")return ar("got xhr close packet"),this.onClose(),!1;this.onPacket(n)};this.protocol===3?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&&(ar("appending close packet to payload"),e.push({type:"close"}),this.shouldClose(),this.shouldClose=null);let t=n=>{let i=e.some(s=>s.options&&s.options.compress);this.write(n,{compress:i})};this.protocol===3?this.parser.encodePayload(e,this.supportsBinary,t):this.parser.encodePayload(e,t)}write(e,t){ar('writing "%s"',e),this.doWrite(e,t,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(e,t,n){let i=typeof e=="string",o={"Content-Type":i?"text/plain; charset=UTF-8":"application/octet-stream"},a=u=>{this.headers(this.req,o),this.res.cork(()=>{Object.keys(o).forEach(f=>{this.res.writeHeader(f,String(o[f]))}),this.res.end(u)}),n()};if(!this.httpCompression||!t.compress){a(e);return}if((i?Buffer.byteLength(e):e.length)<this.httpCompression.threshold){a(e);return}let l=XN(this.req).encodings(["gzip","deflate"]);if(!l){a(e);return}this.compress(e,l,(u,f)=>{if(u){this.res.writeStatus("500 Internal Server Error"),this.res.end(),n(u);return}o["Content-Encoding"]=l,a(f)})}compress(e,t,n){ar("compressing");let i=[],s=0;QN[t](this.httpCompression).on("error",n).on("data",function(o){i.push(o),s+=o.length}).on("end",function(){n(null,Buffer.concat(i,s))}).end(e)}doClose(e){ar("closing");let t,n=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(ar("transport writable - closing right away"),this.send([{type:"close"}]),n()):this.discarded?(ar("transport discarded - closing right away"),n()):(ar("transport not writable - buffering orderly close"),this.shouldClose=n,t=setTimeout(n,this.closeTimeout))}headers(e,t){t=t||{};let 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}};Pc.Polling=Jf});var Hx=A(Ic=>{"use strict";Object.defineProperty(Ic,"__esModule",{value:!0});Ic.WebSocket=void 0;var eD=Zn(),tD=Ae(),Fx=(0,tD.default)("engine:ws"),Xf=class extends eD.Transport{constructor(e){super(e),this.writable=!1,this.perMessageDeflate=null}get name(){return"websocket"}get handlesUpgrades(){return!0}send(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],i=t+1===e.length,s=o=>{let a=typeof o!="string",c=this.perMessageDeflate&&Buffer.byteLength(o)>this.perMessageDeflate.threshold;Fx('writing "%s"',o),this.socket.send(o,a,c),i&&(this.emit("drain"),this.writable=!0,this.emit("ready"))};n.options&&typeof n.options.wsPreEncoded=="string"?s(n.options.wsPreEncoded):this.parser.encodePacket(n,this.supportsBinary,s)}}doClose(e){Fx("closing"),e&&e(),this.socket.end()}};Ic.WebSocket=Xf});var qx=A(Zf=>{"use strict";Object.defineProperty(Zf,"__esModule",{value:!0});var rD=jx(),nD=Hx();Zf.default={polling:rD.Polling,websocket:nD.WebSocket}});var Ux=A(Nc=>{"use strict";Object.defineProperty(Nc,"__esModule",{value:!0});Nc.uServer=void 0;var iD=Ae(),ii=Yf(),sD=qx(),Bn=(0,iD.default)("engine:uws"),Qf=class extends ii.BaseServer{init(){}cleanup(){}prepare(e,t){e.method=e.getMethod().toUpperCase(),e.url=e.getUrl();let n=new URLSearchParams(e.getQuery());e._query=Object.fromEntries(n.entries()),e.headers={},e.forEach((i,s)=>{e.headers[i]=s}),e.connection={remoteAddress:Buffer.from(t.getRemoteAddressAsText()).toString()},t.onAborted(()=>{Bn("response has been aborted")})}createTransport(e,t){return new sD.default[e](t)}attach(e,t={}){let 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:i=>{let s=i.getUserData().transport;s.socket=i,s.writable=!0,s.emit("ready")},message:(i,s,o)=>{i.getUserData().transport.onData(o?s:Buffer.from(s).toString())},close:(i,s,o)=>{i.getUserData().transport.onClose(s,o)}})}_applyMiddlewares(e,t,n){if(this.middlewares.length===0)return n();e.res=new ed(t),super._applyMiddlewares(e,e.res,i=>{e.res.writeHead(),n(i)})}handleRequest(e,t){Bn('handling "%s" http request "%s"',t.getMethod(),t.getUrl()),this.prepare(t,e),t.res=e;let n=(i,s)=>{if(i!==void 0){this.emit("connection_error",{req:t,code:i,message:ii.Server.errorMessages[i],context:s}),this.abortRequest(t.res,i,s);return}if(t._query.sid)Bn("setting new request for existing client"),this.clients[t._query.sid].transport.onRequest(t);else{let o=(a,c)=>this.abortRequest(e,a,c);this.handshake(t._query.transport,t,o)}};this._applyMiddlewares(t,e,i=>{i?n(ii.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!1,n)})}handleUpgrade(e,t,n){Bn("on upgrade"),this.prepare(t,e),t.res=e;let i=async(s,o)=>{if(s!==void 0){this.emit("connection_error",{req:t,code:s,message:ii.Server.errorMessages[s],context:o}),this.abortRequest(e,s,o);return}let a=t._query.sid,c;if(a){let f=this.clients[a];if(f){if(f.upgrading)return Bn("transport has already been trying to upgrade"),e.close();if(f.upgraded)return Bn("transport had already been upgraded"),e.close();Bn("upgrading existing transport"),c=this.createTransport(t._query.transport,t),f._maybeUpgrade(c)}else return Bn("upgrade attempt for closed client"),e.close()}else if(c=await this.handshake(t._query.transport,t,(f,h)=>this.abortRequest(e,f,h)),!c)return;let l={};!a&&this.emit("initial_headers",l,t),this.emit("headers",l,t),t.res.writeStatus("101 Switching Protocols"),Object.keys(l).forEach(f=>{t.res.writeHeader(f,l[f])}),e.upgrade({transport:c},t.getHeader("sec-websocket-key"),t.getHeader("sec-websocket-protocol"),t.getHeader("sec-websocket-extensions"),n)};this._applyMiddlewares(t,e,s=>{s?i(ii.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!0,i)})}abortRequest(e,t,n){let i=t===ii.Server.errors.FORBIDDEN?"403 Forbidden":"400 Bad Request",s=n&&n.message?n.message:ii.Server.errorMessages[t];e.writeStatus(i),e.writeHeader("Content-Type","application/json"),e.end(JSON.stringify({code:t,message:s}))}};Nc.uServer=Qf;var ed=class{constructor(e){this.res=e,this.statusWritten=!1,this.headers=[],this.isAborted=!1}set statusCode(e){e&&this.writeStatus(e===200?"200 OK":"204 No Content")}writeHead(e){this.statusCode=e}setHeader(e,t){Array.isArray(t)?t.forEach(n=>{this.writeHeader(e,n)}):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||e!=="Content-Length"&&(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)}}});var zx=A(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.protocol=gt.Transport=gt.Socket=gt.uServer=gt.parser=gt.transports=gt.Server=void 0;gt.listen=pD;gt.attach=Gx;var oD=require("http"),$x=Yf();Object.defineProperty(gt,"Server",{enumerable:!0,get:function(){return $x.Server}});var aD=lf();gt.transports=aD.default;var Wx=mo();gt.parser=Wx;var cD=Ux();Object.defineProperty(gt,"uServer",{enumerable:!0,get:function(){return cD.uServer}});var lD=pf();Object.defineProperty(gt,"Socket",{enumerable:!0,get:function(){return lD.Socket}});var uD=Zn();Object.defineProperty(gt,"Transport",{enumerable:!0,get:function(){return uD.Transport}});gt.protocol=Wx.protocol;function pD(r,e,t){typeof e=="function"&&(t=e,e={});let n=(0,oD.createServer)(function(s,o){o.writeHead(501),o.end("Not Implemented")}),i=Gx(n,e);return i.httpServer=n,n.listen(r,t),i}function Gx(r,e){let t=new $x.Server(e);return t.attach(r,e),t}});var Kx=A(Vx=>{Vx.Emitter=At;function At(r){if(r)return fD(r)}function fD(r){for(var e in At.prototype)r[e]=At.prototype[e];return r}At.prototype.on=At.prototype.addEventListener=function(r,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(e),this};At.prototype.once=function(r,e){function t(){this.off(r,t),e.apply(this,arguments)}return t.fn=e,this.on(r,t),this};At.prototype.off=At.prototype.removeListener=At.prototype.removeAllListeners=At.prototype.removeEventListener=function(r,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+r];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var n,i=0;i<t.length;i++)if(n=t[i],n===e||n.fn===e){t.splice(i,1);break}return t.length===0&&delete this._callbacks["$"+r],this};At.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+r],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t){t=t.slice(0);for(var n=0,i=t.length;n<i;++n)t[n].apply(this,e)}return this};At.prototype.emitReserved=At.prototype.emit;At.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]};At.prototype.hasListeners=function(r){return!!this.listeners(r).length}});var td=A(Lc=>{"use strict";Object.defineProperty(Lc,"__esModule",{value:!0});Lc.isBinary=Jx;Lc.hasBinary=Dc;var dD=typeof ArrayBuffer=="function",hD=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,Yx=Object.prototype.toString,mD=typeof Blob=="function"||typeof Blob<"u"&&Yx.call(Blob)==="[object BlobConstructor]",gD=typeof File=="function"||typeof File<"u"&&Yx.call(File)==="[object FileConstructor]";function Jx(r){return dD&&(r instanceof ArrayBuffer||hD(r))||mD&&r instanceof Blob||gD&&r instanceof File}function Dc(r,e){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let t=0,n=r.length;t<n;t++)if(Dc(r[t]))return!0;return!1}if(Jx(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return Dc(r.toJSON(),!0);for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&Dc(r[t]))return!0;return!1}});var Xx=A(Bc=>{"use strict";Object.defineProperty(Bc,"__esModule",{value:!0});Bc.deconstructPacket=yD;Bc.reconstructPacket=xD;var vD=td();function yD(r){let e=[],t=r.data,n=r;return n.data=rd(t,e),n.attachments=e.length,{packet:n,buffers:e}}function rd(r,e){if(!r)return r;if((0,vD.isBinary)(r)){let t={_placeholder:!0,num:e.length};return e.push(r),t}else if(Array.isArray(r)){let t=new Array(r.length);for(let n=0;n<r.length;n++)t[n]=rd(r[n],e);return t}else if(typeof r=="object"&&!(r instanceof Date)){let t={};for(let n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=rd(r[n],e));return t}return r}function xD(r,e){return r.data=nd(r.data,e),delete r.attachments,r}function nd(r,e){if(!r)return r;if(r&&r._placeholder===!0){if(typeof r.num=="number"&&r.num>=0&&r.num<e.length)return e[r.num];throw new Error("illegal attachments")}else if(Array.isArray(r))for(let t=0;t<r.length;t++)r[t]=nd(r[t],e);else if(typeof r=="object")for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&(r[t]=nd(r[t],e));return r}});var To=A(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.Decoder=Cr.Encoder=Cr.PacketType=Cr.protocol=void 0;Cr.isPacketValid=TD;var _D=Kx(),Zx=Xx(),Qx=td(),bD=Ae(),id=(0,bD.default)("socket.io-parser"),e_=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];Cr.protocol=5;var fe;(function(r){r[r.CONNECT=0]="CONNECT",r[r.DISCONNECT=1]="DISCONNECT",r[r.EVENT=2]="EVENT",r[r.ACK=3]="ACK",r[r.CONNECT_ERROR=4]="CONNECT_ERROR",r[r.BINARY_EVENT=5]="BINARY_EVENT",r[r.BINARY_ACK=6]="BINARY_ACK"})(fe||(Cr.PacketType=fe={}));var sd=class{constructor(e){this.replacer=e}encode(e){return id("encoding packet %j",e),(e.type===fe.EVENT||e.type===fe.ACK)&&(0,Qx.hasBinary)(e)?this.encodeAsBinary({type:e.type===fe.EVENT?fe.BINARY_EVENT:fe.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===fe.BINARY_EVENT||e.type===fe.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),id("encoded %j as %s",e,t),t}encodeAsBinary(e){let t=(0,Zx.deconstructPacket)(e),n=this.encodeAsString(t.packet),i=t.buffers;return i.unshift(n),i}};Cr.Encoder=sd;var od=class r extends _D.Emitter{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof e=="function"?{reviver:e}:e)}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);let n=t.type===fe.BINARY_EVENT;n||t.type===fe.BINARY_ACK?(t.type=n?fe.EVENT:fe.ACK,this.reconstructor=new ad(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if((0,Qx.isBinary)(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0,n={type:Number(e.charAt(0))};if(fe[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===fe.BINARY_EVENT||n.type===fe.BINARY_ACK){let s=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);let o=e.substring(s,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");let a=Number(o);if(!t_(a)||a<0)throw new Error("Illegal attachments");if(a>this.opts.maxAttachments)throw new Error("too many attachments");n.attachments=a}if(e.charAt(t+1)==="/"){let s=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););n.nsp=e.substring(s,t)}else n.nsp="/";let i=e.charAt(t+1);if(i!==""&&Number(i)==i){let s=t+1;for(;++t;){let o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}n.id=Number(e.substring(s,t+1))}if(e.charAt(++t)){let s=this.tryParse(e.substr(t));if(r.isPayloadValid(n.type,s))n.data=s;else throw new Error("invalid payload")}return id("decoded %s as %j",e,n),n}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case fe.CONNECT:return jc(t);case fe.DISCONNECT:return t===void 0;case fe.CONNECT_ERROR:return typeof t=="string"||jc(t);case fe.EVENT:case fe.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&e_.indexOf(t[0])===-1);case fe.ACK:case fe.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}};Cr.Decoder=od;var ad=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let t=(0,Zx.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function wD(r){return typeof r=="string"}var t_=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r};function SD(r){return r===void 0||t_(r)}function jc(r){return Object.prototype.toString.call(r)==="[object Object]"}function ED(r,e){switch(r){case fe.CONNECT:return e===void 0||jc(e);case fe.DISCONNECT:return e===void 0;case fe.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&e_.indexOf(e[0])===-1);case fe.ACK:return Array.isArray(e);case fe.CONNECT_ERROR:return typeof e=="string"||jc(e);default:return!1}}function TD(r){return wD(r.nsp)&&SD(r.id)&&ED(r.type,r.data)}});var r_=A(rs=>{"use strict";var CD=rs&&rs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(rs,"__esModule",{value:!0});rs.Client=void 0;var Fc=To(),kD=CD(Ae()),kr=(0,kD.default)("socket.io:client"),cd=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(()=>{this.nsps.size===0?(kr("no namespace joined yet, close the client"),this.close()):kr("the client has already joined a namespace, nothing to do")},this.server._connectTimeout)}connect(e,t={}){if(this.server._nsps.has(e))return kr("connecting to namespace %s",e),this.doConnect(e,t);this.server._checkNamespace(e,t,n=>{n?this.doConnect(e,t):(kr("creation of namespace %s was denied",e),this._packet({type:Fc.PacketType.CONNECT_ERROR,nsp:e,data:{message:"Invalid namespace"}}))})}doConnect(e,t){let n=this.server.of(e);n._add(this,t,i=>{this.sockets.set(i.id,i),this.nsps.set(n.name,i),this.connectTimeout&&(clearTimeout(this.connectTimeout),this.connectTimeout=void 0)})}_disconnect(){for(let e of this.sockets.values())e.disconnect();this.sockets.clear(),this.close()}_remove(e){if(this.sockets.has(e.id)){let t=this.sockets.get(e.id).nsp.name;this.sockets.delete(e.id),this.nsps.delete(t)}else kr("ignoring remove for %s",e.id)}close(){this.conn.readyState==="open"&&(kr("forcing transport close"),this.conn.close(),this.onclose("forced server close"))}_packet(e,t={}){if(this.conn.readyState!=="open"){kr("ignoring packet write %j",e);return}let n=t.preEncoded?e:this.encoder.encode(e);this.writeToEngine(n,t)}writeToEngine(e,t){if(t.volatile&&!this.conn.transport.writable){kr("volatile packet is discarded since the transport is not currently writable");return}let n=Array.isArray(e)?e:[e];for(let i of n)this.conn.write(i,t)}ondata(e){try{this.decoder.add(e)}catch(t){kr("invalid packet format"),this.onerror(t)}}ondecoded(e){let{namespace:t,authPayload:n}=this._parseNamespace(e),i=this.nsps.get(t);!i&&e.type===Fc.PacketType.CONNECT?this.connect(t,n):i&&e.type!==Fc.PacketType.CONNECT&&e.type!==Fc.PacketType.CONNECT_ERROR?process.nextTick(function(){i._onpacket(e)}):(kr("invalid state (packet type: %s)",e.type),this.close())}_parseNamespace(e){if(this.conn.protocol!==3)return{namespace:e.nsp,authPayload:e.data};let t=new URL(e.nsp,"https://socket.io");return{namespace:t.pathname,authPayload:Object.fromEntries(t.searchParams.entries())}}onerror(e){for(let t of this.sockets.values())t._onerror(e);this.conn.close()}onclose(e,t){kr("client close with reason %s",e),this.destroy();for(let 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)}};rs.Client=cd});var qc=A(Hc=>{"use strict";Object.defineProperty(Hc,"__esModule",{value:!0});Hc.StrictEventEmitter=void 0;var AD=require("events"),ld=class extends AD.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)}};Hc.StrictEventEmitter=ld});var ud=A(Uc=>{"use strict";Object.defineProperty(Uc,"__esModule",{value:!0});Uc.RESERVED_EVENTS=void 0;Uc.RESERVED_EVENTS=new Set(["connect","connect_error","disconnect","disconnecting","newListener","removeListener"])});var pd=A(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.RemoteSocket=ns.BroadcastOperator=void 0;var RD=ud(),OD=To(),$c=class r{constructor(e,t=new Set,n=new Set,i={}){this.adapter=e,this.rooms=t,this.exceptRooms=n,this.flags=i}to(e){let t=new Set(this.rooms);return Array.isArray(e)?e.forEach(n=>t.add(n)):t.add(e),new r(this.adapter,t,this.exceptRooms,this.flags)}in(e){return this.to(e)}except(e){let t=new Set(this.exceptRooms);return Array.isArray(e)?e.forEach(n=>t.add(n)):t.add(e),new r(this.adapter,this.rooms,t,this.flags)}compress(e){let t=Object.assign({},this.flags,{compress:e});return new r(this.adapter,this.rooms,this.exceptRooms,t)}get volatile(){let e=Object.assign({},this.flags,{volatile:!0});return new r(this.adapter,this.rooms,this.exceptRooms,e)}get local(){let e=Object.assign({},this.flags,{local:!0});return new r(this.adapter,this.rooms,this.exceptRooms,e)}timeout(e){let t=Object.assign({},this.flags,{timeout:e});return new r(this.adapter,this.rooms,this.exceptRooms,t)}emit(e,...t){if(RD.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let n=[e,...t],i={type:OD.PacketType.EVENT,data:n};if(!(typeof n[n.length-1]=="function"))return this.adapter.broadcast(i,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags}),!0;let o=n.pop(),a=!1,c=[],l=setTimeout(()=>{a=!0,o.apply(this,[new Error("operation has timed out"),this.flags.expectSingleResponse?null:c])},this.flags.timeout),u=-1,f=0,h=0,g=()=>{!a&&u===f&&c.length===h&&(clearTimeout(l),o.apply(this,[null,this.flags.expectSingleResponse?c[0]:c]))};return this.adapter.broadcastWithAck(i,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags},x=>{h+=x,f++,g()},x=>{c.push(x),g()}),this.adapter.serverCount().then(x=>{u=x,g()}),!0}emitWithAck(e,...t){return new Promise((n,i)=>{t.push((s,o)=>s?(s.responses=o,i(s)):n(o)),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(e=>e.map(t=>t.server?t:new Wc(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)}};ns.BroadcastOperator=$c;var Wc=class{constructor(e,t){this.id=t.id,this.handshake=t.handshake,this.rooms=new Set(t.rooms),this.data=t.data,this.operator=new $c(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}};ns.RemoteSocket=Wc});var dd=A(is=>{"use strict";var s_=is&&is.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(is,"__esModule",{value:!0});is.Socket=void 0;var cr=To(),MD=s_(Ae()),PD=qc(),n_=s_(Up()),ID=pd(),ND=ud(),wt=(0,MD.default)("socket.io:socket"),DD=new Set(["transport error","transport close","forced close","ping timeout","server shutting down","forced server close"]);function i_(){}var fd=class extends PD.StrictEventEmitter{constructor(e,t,n,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=e.adapter,i?(this.id=i.sid,this.pid=i.pid,i.rooms.forEach(s=>this.join(s)),this.data=i.data,i.missedPackets.forEach(s=>{this.packet({type:cr.PacketType.EVENT,data:s})}),this.recovered=!0):(t.conn.protocol===3?this.id=e.name!=="/"?e.name+"#"+t.id:t.id:this.id=n_.default.generateId(),this.server._opts.connectionStateRecovery&&(this.pid=n_.default.generateId())),this.handshake=this.buildHandshake(n),this.on("error",i_)}buildHandshake(e){var t,n,i,s;return{headers:((t=this.request)===null||t===void 0?void 0:t.headers)||{},time:new Date+"",address:this.conn.remoteAddress,xdomain:!!(!((n=this.request)===null||n===void 0)&&n.headers.origin),secure:!this.request||!!this.request.connection.encrypted,issued:+new Date,url:(i=this.request)===null||i===void 0?void 0:i.url,query:((s=this.request)===null||s===void 0?void 0:s._query)||{},auth:e}}emit(e,...t){if(ND.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let n=[e,...t],i={type:cr.PacketType.EVENT,data:n};if(typeof n[n.length-1]=="function"){let o=this.nsp._ids++;wt("emitting packet with ack id %d",o),this.registerAckCallback(o,n.pop()),i.id=o}let s=Object.assign({},this.flags);return this.flags={},this.nsp.server.opts.connectionStateRecovery?this.adapter.broadcast(i,{rooms:new Set([this.id]),except:new Set,flags:s}):(this.notifyOutgoingListeners(i),this.packet(i,s)),!0}emitWithAck(e,...t){let n=this.flags.timeout!==void 0;return new Promise((i,s)=>{t.push((o,a)=>n?o?s(o):i(a):i(o)),this.emit(e,...t)})}registerAckCallback(e,t){let n=this.flags.timeout;if(n===void 0){this.acks.set(e,t);return}let i=setTimeout(()=>{wt("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,(...s)=>{clearTimeout(i),t.apply(this,[null,...s])})}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=t.compress!==!1,this.client._packet(e,t)}join(e){return wt("join room %s",e),this.adapter.addAll(this.id,new Set(Array.isArray(e)?e:[e]))}leave(e){return wt("leave room %s",e),this.adapter.del(this.id,e)}leaveAll(){this.adapter.delAll(this.id)}_onconnect(){wt("socket connected - writing packet"),this.connected=!0,this.join(this.id),this.conn.protocol===3?this.packet({type:cr.PacketType.CONNECT}):this.packet({type:cr.PacketType.CONNECT,data:{sid:this.id,pid:this.pid}})}_onpacket(e){switch(wt("got packet %j",e),e.type){case cr.PacketType.EVENT:this.onevent(e);break;case cr.PacketType.BINARY_EVENT:this.onevent(e);break;case cr.PacketType.ACK:this.onack(e);break;case cr.PacketType.BINARY_ACK:this.onack(e);break;case cr.PacketType.DISCONNECT:this.ondisconnect();break}}onevent(e){let t=e.data||[];if(wt("emitting event %j",t),e.id!=null&&(wt("attaching ack callback to event"),t.push(this.ack(e.id))),this._anyListeners&&this._anyListeners.length){let n=this._anyListeners.slice();for(let i of n)i.apply(this,t)}this.dispatch(t)}ack(e){let t=this,n=!1;return function(){if(n)return;let i=Array.prototype.slice.call(arguments);wt("sending ack %j",i),t.packet({id:e,type:cr.PacketType.ACK,data:i}),n=!0}}onack(e){let t=this.acks.get(e.id);typeof t=="function"?(wt("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),this.acks.delete(e.id)):wt("bad ack %s",e.id)}ondisconnect(){wt("got disconnect packet"),this._onclose("client namespace disconnect")}_onerror(e){this.emitReserved("error",e)}_onclose(e,t){if(!this.connected)return this;wt("closing socket - reason %s",e),this.emitReserved("disconnecting",e,t),this.server._opts.connectionStateRecovery&&DD.has(e)&&(wt("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=i_}_error(e){this.packet({type:cr.PacketType.CONNECT_ERROR,data:e})}disconnect(e=!1){return this.connected?(e?this.client._disconnect():(this.packet({type:cr.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){wt("dispatching an event %j",e),this.run(e,t=>{process.nextTick(()=>{if(t)return this._onerror(t);this.connected?super.emitUntyped.apply(this,e):wt("ignore packet received after disconnection")})})}use(e){return this.fns.push(e),this}run(e,t){if(!this.fns.length)return t();let n=this.fns.slice(0);function i(s){n[s](e,o=>{if(o)return t(o);if(!n[s+1])return t();i(s+1)})}i(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){let 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){let 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){let t=this._anyOutgoingListeners.slice();for(let n of t)n.apply(this,e.data)}}newBroadcastOperator(){let e=Object.assign({},this.flags);return this.flags={},new ID.BroadcastOperator(this.adapter,new Set,new Set([this.id]),e)}};is.Socket=fd});var md=A(un=>{"use strict";var LD=un&&un.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(un,"__esModule",{value:!0});un.Namespace=un.RESERVED_EVENTS=void 0;var o_=dd(),BD=qc(),jD=LD(Ae()),Jt=pd(),ss=(0,jD.default)("socket.io:namespace");un.RESERVED_EVENTS=new Set(["connect","connection","new_namespace"]);var hd=class extends BD.StrictEventEmitter{constructor(e,t){super(),this.sockets=new Map,this._preConnectSockets=new Map,this._fns=[],this._ids=0,this.server=e,this.name=t,this._initAdapter()}_initAdapter(){this.adapter=new(this.server.adapter())(this),Promise.resolve(this.adapter.init()).catch(e=>{ss("error while initializing adapter: %s",e)})}use(e){return this._fns.push(e),this}run(e,t){if(!this._fns.length)return t();let n=this._fns.slice(0);function i(s){n[s](e,o=>{if(o)return t(o);if(!n[s+1])return t();i(s+1)})}i(0)}to(e){return new Jt.BroadcastOperator(this.adapter).to(e)}in(e){return new Jt.BroadcastOperator(this.adapter).in(e)}except(e){return new Jt.BroadcastOperator(this.adapter).except(e)}async _add(e,t,n){var i;ss("adding socket to nsp %s",this.name);let s=await this._createSocket(e,t);if(this._preConnectSockets.set(s.id,s),!((i=this.server.opts.connectionStateRecovery)===null||i===void 0)&&i.skipMiddlewares&&s.recovered&&e.conn.readyState==="open")return this._doConnect(s,n);this.run(s,o=>{process.nextTick(()=>{if(e.conn.readyState!=="open"){ss("next called after client was closed - ignoring socket"),s._cleanup();return}if(o)return ss("middleware error, sending CONNECT_ERROR packet to the client"),s._cleanup(),e.conn.protocol===3?s._error(o.data||o.message):s._error({message:o.message,data:o.data});this._doConnect(s,n)})})}async _createSocket(e,t){let n=t.pid,i=t.offset;if(this.server.opts.connectionStateRecovery&&typeof n=="string"&&typeof i=="string"){let s;try{s=await this.adapter.restoreSession(n,i)}catch(o){ss("error while restoring session: %s",o)}if(s)return ss("connection state recovered for sid %s",s.sid),new o_.Socket(this,e,t,s)}return new o_.Socket(this,e,t)}_doConnect(e,t){this._preConnectSockets.delete(e.id),this.sockets.set(e.id,e),e._onconnect(),t&&t(e),this.emitReserved("connect",e),this.emitReserved("connection",e)}_remove(e){this.sockets.delete(e.id)||this._preConnectSockets.delete(e.id)}emit(e,...t){return new Jt.BroadcastOperator(this.adapter).emit(e,...t)}send(...e){return this.emit("message",...e),this}write(...e){return this.emit("message",...e),this}serverSideEmit(e,...t){if(un.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);return t.unshift(e),this.adapter.serverSideEmit(t),!0}serverSideEmitWithAck(e,...t){return new Promise((n,i)=>{t.push((s,o)=>s?(s.responses=o,i(s)):n(o)),this.serverSideEmit(e,...t)})}_onServerSideEmit(e){super.emitUntyped.apply(this,e)}allSockets(){return new Jt.BroadcastOperator(this.adapter).allSockets()}compress(e){return new Jt.BroadcastOperator(this.adapter).compress(e)}get volatile(){return new Jt.BroadcastOperator(this.adapter).volatile}get local(){return new Jt.BroadcastOperator(this.adapter).local}timeout(e){return new Jt.BroadcastOperator(this.adapter).timeout(e)}fetchSockets(){return new Jt.BroadcastOperator(this.adapter).fetchSockets()}socketsJoin(e){return new Jt.BroadcastOperator(this.adapter).socketsJoin(e)}socketsLeave(e){return new Jt.BroadcastOperator(this.adapter).socketsLeave(e)}disconnectSockets(e=!1){return new Jt.BroadcastOperator(this.adapter).disconnectSockets(e)}};un.Namespace=hd});var p_=A(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.encode=gd;Co.decode=FD;Co.yeast=HD;var l_="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Gc=64,u_={},a_=0,jn=0,c_;function gd(r){let e="";do e=l_[r%Gc]+e,r=Math.floor(r/Gc);while(r>0);return e}function FD(r){let e=0;for(jn=0;jn<r.length;jn++)e=e*Gc+u_[r.charAt(jn)];return e}function HD(){let r=gd(+new Date);return r!==c_?(a_=0,c_=r):r+"."+gd(a_++)}for(;jn<Gc;jn++)u_[l_[jn]]=jn});var pn=A(($6,h_)=>{"use strict";var f_=["nodebuffer","arraybuffer","fragments"],d_=typeof Blob<"u";d_&&f_.push("blob");h_.exports={BINARY_TYPES:f_,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:d_,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var ko=A((W6,zc)=>{"use strict";var{EMPTY_BUFFER:qD}=pn(),vd=Buffer[Symbol.species];function UD(r,e){if(r.length===0)return qD;if(r.length===1)return r[0];let t=Buffer.allocUnsafe(e),n=0;for(let i=0;i<r.length;i++){let s=r[i];t.set(s,n),n+=s.length}return n<e?new vd(t.buffer,t.byteOffset,n):t}function m_(r,e,t,n,i){for(let s=0;s<i;s++)t[n+s]=r[s]^e[s&3]}function g_(r,e){for(let t=0;t<r.length;t++)r[t]^=e[t&3]}function $D(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function yd(r){if(yd.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new vd(r):ArrayBuffer.isView(r)?e=new vd(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),yd.readOnly=!1),e}zc.exports={concat:UD,mask:m_,toArrayBuffer:$D,toBuffer:yd,unmask:g_};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=wf();zc.exports.mask=function(e,t,n,i,s){s<48?m_(e,t,n,i,s):r.mask(e,t,n,i,s)},zc.exports.unmask=function(e,t){e.length<32?g_(e,t):r.unmask(e,t)}}catch{}});var x_=A((G6,y_)=>{"use strict";var v_=Symbol("kDone"),xd=Symbol("kRun"),_d=class{constructor(e){this[v_]=()=>{this.pending--,this[xd]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[xd]()}[xd](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[v_])}}};y_.exports=_d});var Ro=A((z6,S_)=>{"use strict";var Ao=require("zlib"),__=ko(),WD=x_(),{kStatusCode:b_}=pn(),GD=Buffer[Symbol.species],zD=Buffer.from([0,0,255,255]),Kc=Symbol("permessage-deflate"),fn=Symbol("total-length"),os=Symbol("callback"),Fn=Symbol("buffers"),as=Symbol("error"),Vc,bd=class{constructor(e,t,n){if(this._maxPayload=n|0,this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,!Vc){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Vc=new WD(i)}}static get extensionName(){return"permessage-deflate"}offer(){let 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:this._options.clientMaxWindowBits==null&&(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){let e=this._deflate[os];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let t=this._options,n=e.find(i=>!(t.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits=="number"&&t.serverMaxWindowBits>i.server_max_window_bits)||typeof t.clientMaxWindowBits=="number"&&!i.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),typeof t.serverMaxWindowBits=="number"&&(n.server_max_window_bits=t.serverMaxWindowBits),typeof t.clientMaxWindowBits=="number"?n.client_max_window_bits=t.clientMaxWindowBits:(n.client_max_window_bits===!0||t.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(e){let t=e[0];if(this._options.clientNoContextTakeover===!1&&t.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!t.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(t.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return t}normalizeParams(e){return e.forEach(t=>{Object.keys(t).forEach(n=>{let i=t[n];if(i.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(i=i[0],n==="client_max_window_bits"){if(i!==!0){let s=+i;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else if(n==="server_max_window_bits"){let s=+i;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=s}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(i!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else throw new Error(`Unknown parameter "${n}"`);t[n]=i})}),e}decompress(e,t,n){Vc.add(i=>{this._decompress(e,t,(s,o)=>{i(),n(s,o)})})}compress(e,t,n){Vc.add(i=>{this._compress(e,t,(s,o)=>{i(),n(s,o)})})}_decompress(e,t,n){let i=this._isServer?"client":"server";if(!this._inflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?Ao.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=Ao.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[Kc]=this,this._inflate[fn]=0,this._inflate[Fn]=[],this._inflate.on("error",KD),this._inflate.on("data",w_)}this._inflate[os]=n,this._inflate.write(e),t&&this._inflate.write(zD),this._inflate.flush(()=>{let s=this._inflate[as];if(s){this._inflate.close(),this._inflate=null,n(s);return}let o=__.concat(this._inflate[Fn],this._inflate[fn]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[fn]=0,this._inflate[Fn]=[],t&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),n(null,o)})}_compress(e,t,n){let i=this._isServer?"server":"client";if(!this._deflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?Ao.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=Ao.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[fn]=0,this._deflate[Fn]=[],this._deflate.on("data",VD)}this._deflate[os]=n,this._deflate.write(e),this._deflate.flush(Ao.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=__.concat(this._deflate[Fn],this._deflate[fn]);t&&(s=new GD(s.buffer,s.byteOffset,s.length-4)),this._deflate[os]=null,this._deflate[fn]=0,this._deflate[Fn]=[],t&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,s)})}};S_.exports=bd;function VD(r){this[Fn].push(r),this[fn]+=r.length}function w_(r){if(this[fn]+=r.length,this[Kc]._maxPayload<1||this[fn]<=this[Kc]._maxPayload){this[Fn].push(r);return}this[as]=new RangeError("Max payload size exceeded"),this[as].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[as][b_]=1009,this.removeListener("data",w_),this.reset()}function KD(r){if(this[Kc]._inflate=null,this[as]){this[os](this[as]);return}r[b_]=1007,this[os](r)}});var cs=A((V6,Yc)=>{"use strict";var{isUtf8:E_}=require("buffer"),{hasBlob:YD}=pn(),JD=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function XD(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function wd(r){let e=r.length,t=0;for(;t<e;)if((r[t]&128)===0)t++;else if((r[t]&224)===192){if(t+1===e||(r[t+1]&192)!==128||(r[t]&254)===192)return!1;t+=2}else if((r[t]&240)===224){if(t+2>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||r[t]===224&&(r[t+1]&224)===128||r[t]===237&&(r[t+1]&224)===160)return!1;t+=3}else if((r[t]&248)===240){if(t+3>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||(r[t+3]&192)!==128||r[t]===240&&(r[t+1]&240)===128||r[t]===244&&r[t+1]>143||r[t]>244)return!1;t+=4}else return!1;return!0}function ZD(r){return YD&&typeof r=="object"&&typeof r.arrayBuffer=="function"&&typeof r.type=="string"&&typeof r.stream=="function"&&(r[Symbol.toStringTag]==="Blob"||r[Symbol.toStringTag]==="File")}Yc.exports={isBlob:ZD,isValidStatusCode:XD,isValidUTF8:wd,tokenChars:JD};if(E_)Yc.exports.isValidUTF8=function(r){return r.length<24?wd(r):E_(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=Rf();Yc.exports.isValidUTF8=function(e){return e.length<32?wd(e):r(e)}}catch{}});var kd=A((K6,M_)=>{"use strict";var{Writable:QD}=require("stream"),T_=Ro(),{BINARY_TYPES:eL,EMPTY_BUFFER:C_,kStatusCode:tL,kWebSocket:rL}=pn(),{concat:Sd,toArrayBuffer:nL,unmask:iL}=ko(),{isValidStatusCode:sL,isValidUTF8:k_}=cs(),Jc=Buffer[Symbol.species],lr=0,A_=1,R_=2,O_=3,Ed=4,Td=5,Xc=6,Cd=class extends QD{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||eL[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[rL]=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=lr}_write(e,t,n){if(this._opcode===8&&this._state==lr)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){let n=this._buffers[0];return this._buffers[0]=new Jc(n.buffer,n.byteOffset+e,n.length-e),new Jc(n.buffer,n.byteOffset,e)}let t=Buffer.allocUnsafe(e);do{let n=this._buffers[0],i=t.length-e;e>=n.length?t.set(this._buffers.shift(),i):(t.set(new Uint8Array(n.buffer,n.byteOffset,e),i),this._buffers[0]=new Jc(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 lr:this.getInfo(e);break;case A_:this.getPayloadLength16(e);break;case R_:this.getPayloadLength64(e);break;case O_:this.getMask();break;case Ed:this.getData(e);break;case Td:case Xc:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if((t[0]&48)!==0){let i=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(i);return}let n=(t[0]&64)===64;if(n&&!this._extensions[T_.extensionName]){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(!this._fragmented){let i=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let i=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(i);return}if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let i=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(i);return}}else{let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked){let i=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(i);return}}else if(this._masked){let i=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(i);return}this._payloadLength===126?this._state=A_:this._payloadLength===127?this._state=R_:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),n=t.readUInt32BE(0);if(n>Math.pow(2,21)-1){let i=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(i);return}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)){let t=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(t);return}this._masked?this._state=O_:this._state=Ed}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Ed}getData(e){let t=C_;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}t=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&iL(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=Td,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[T_.extensionName].decompress(e,this._fin,(i,s)=>{if(i)return t(i);if(s.length){if(this._messageLength+=s.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let o=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(o);return}this._fragments.push(s)}this.dataMessage(t),this._state===lr&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=lr;return}let t=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let i;this._binaryType==="nodebuffer"?i=Sd(n,t):this._binaryType==="arraybuffer"?i=nL(Sd(n,t)):this._binaryType==="blob"?i=new Blob(n):i=n,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=lr):(this._state=Xc,setImmediate(()=>{this.emit("message",i,!0),this._state=lr,this.startLoop(e)}))}else{let i=Sd(n,t);if(!this._skipUTF8Validation&&!k_(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(s);return}this._state===Td||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=lr):(this._state=Xc,setImmediate(()=>{this.emit("message",i,!1),this._state=lr,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,C_),this.end();else{let n=e.readUInt16BE(0);if(!sL(n)){let s=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(s);return}let i=new Jc(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!k_(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(s);return}this._loop=!1,this.emit("conclude",n,i),this.end()}this._state=lr;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=lr):(this._state=Xc,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=lr,this.startLoop(t)}))}createError(e,t,n,i,s){this._loop=!1,this._errored=!0;let o=new e(n?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(o,this.createError),o.code=s,o[tL]=i,o}};M_.exports=Cd});var Od=A((J6,N_)=>{"use strict";var{Duplex:Y6}=require("stream"),{randomFillSync:oL}=require("crypto"),P_=Ro(),{EMPTY_BUFFER:aL,kWebSocket:cL,NOOP:lL}=pn(),{isBlob:ls,isValidStatusCode:uL}=cs(),{mask:I_,toBuffer:si}=ko(),ur=Symbol("kByteLength"),pL=Buffer.alloc(4),Zc=8*1024,oi,us=Zc,Ar=0,fL=1,dL=2,Ad=class r{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._queue=[],this._state=Ar,this.onerror=lL,this[cL]=void 0}static frame(e,t){let n,i=!1,s=2,o=!1;t.mask&&(n=t.maskBuffer||pL,t.generateMask?t.generateMask(n):(us===Zc&&(oi===void 0&&(oi=Buffer.alloc(Zc)),oL(oi,0,Zc),us=0),n[0]=oi[us++],n[1]=oi[us++],n[2]=oi[us++],n[3]=oi[us++]),o=(n[0]|n[1]|n[2]|n[3])===0,s=6);let a;typeof e=="string"?(!t.mask||o)&&t[ur]!==void 0?a=t[ur]:(e=Buffer.from(e),a=e.length):(a=e.length,i=t.mask&&t.readOnly&&!o);let c=a;a>=65536?(s+=8,c=127):a>125&&(s+=2,c=126);let l=Buffer.allocUnsafe(i?a+s:s);return l[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(l[0]|=64),l[1]=c,c===126?l.writeUInt16BE(a,2):c===127&&(l[2]=l[3]=0,l.writeUIntBE(a,4,6)),t.mask?(l[1]|=128,l[s-4]=n[0],l[s-3]=n[1],l[s-2]=n[2],l[s-1]=n[3],o?[l,e]:i?(I_(e,n,l,s,a),[l]):(I_(e,n,e,0,a),[l,e])):[l,e]}close(e,t,n,i){let s;if(e===void 0)s=aL;else{if(typeof e!="number"||!uL(e))throw new TypeError("First argument must be a valid error code number");if(t===void 0||!t.length)s=Buffer.allocUnsafe(2),s.writeUInt16BE(e,0);else{let a=Buffer.byteLength(t);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");s=Buffer.allocUnsafe(2+a),s.writeUInt16BE(e,0),typeof t=="string"?s.write(t,2):s.set(t,2)}}let o={[ur]:s.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Ar?this.enqueue([this.dispatch,s,!1,o,i]):this.sendFrame(r.frame(s,o),i)}ping(e,t,n){let i,s;if(typeof e=="string"?(i=Buffer.byteLength(e),s=!1):ls(e)?(i=e.size,s=!1):(e=si(e),i=e.length,s=si.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[ur]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};ls(e)?this._state!==Ar?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Ar?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}pong(e,t,n){let i,s;if(typeof e=="string"?(i=Buffer.byteLength(e),s=!1):ls(e)?(i=e.size,s=!1):(e=si(e),i=e.length,s=si.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[ur]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};ls(e)?this._state!==Ar?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Ar?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}send(e,t,n){let i=this._extensions[P_.extensionName],s=t.binary?2:1,o=t.compress,a,c;typeof e=="string"?(a=Buffer.byteLength(e),c=!1):ls(e)?(a=e.size,c=!1):(e=si(e),a=e.length,c=si.readOnly),this._firstFragment?(this._firstFragment=!1,o&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=a>=i._threshold),this._compress=o):(o=!1,s=0),t.fin&&(this._firstFragment=!0);let l={[ur]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:c,rsv1:o};ls(e)?this._state!==Ar?this.enqueue([this.getBlobData,e,this._compress,l,n]):this.getBlobData(e,this._compress,l,n):this._state!==Ar?this.enqueue([this.dispatch,e,this._compress,l,n]):this.dispatch(e,this._compress,l,n)}getBlobData(e,t,n,i){this._bufferedBytes+=n[ur],this._state=dL,e.arrayBuffer().then(s=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(Rd,this,a,i);return}this._bufferedBytes-=n[ur];let o=si(s);t?this.dispatch(o,t,n,i):(this._state=Ar,this.sendFrame(r.frame(o,n),i),this.dequeue())}).catch(s=>{process.nextTick(hL,this,s,i)})}dispatch(e,t,n,i){if(!t){this.sendFrame(r.frame(e,n),i);return}let s=this._extensions[P_.extensionName];this._bufferedBytes+=n[ur],this._state=fL,s.compress(e,n.fin,(o,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");Rd(this,c,i);return}this._bufferedBytes-=n[ur],this._state=Ar,n.readOnly=!1,this.sendFrame(r.frame(a,n),i),this.dequeue()})}dequeue(){for(;this._state===Ar&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][ur],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][ur],this._queue.push(e)}sendFrame(e,t){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork()):this._socket.write(e[0],t)}};N_.exports=Ad;function Rd(r,e,t){typeof t=="function"&&t(e);for(let n=0;n<r._queue.length;n++){let i=r._queue[n],s=i[i.length-1];typeof s=="function"&&s(e)}}function hL(r,e,t){Rd(r,e,t),r.onerror(e)}});var $_=A((X6,U_)=>{"use strict";var{kForOnEventAttribute:Oo,kListener:Md}=pn(),D_=Symbol("kCode"),L_=Symbol("kData"),B_=Symbol("kError"),j_=Symbol("kMessage"),F_=Symbol("kReason"),ps=Symbol("kTarget"),H_=Symbol("kType"),q_=Symbol("kWasClean"),dn=class{constructor(e){this[ps]=null,this[H_]=e}get target(){return this[ps]}get type(){return this[H_]}};Object.defineProperty(dn.prototype,"target",{enumerable:!0});Object.defineProperty(dn.prototype,"type",{enumerable:!0});var ai=class extends dn{constructor(e,t={}){super(e),this[D_]=t.code===void 0?0:t.code,this[F_]=t.reason===void 0?"":t.reason,this[q_]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[D_]}get reason(){return this[F_]}get wasClean(){return this[q_]}};Object.defineProperty(ai.prototype,"code",{enumerable:!0});Object.defineProperty(ai.prototype,"reason",{enumerable:!0});Object.defineProperty(ai.prototype,"wasClean",{enumerable:!0});var fs=class extends dn{constructor(e,t={}){super(e),this[B_]=t.error===void 0?null:t.error,this[j_]=t.message===void 0?"":t.message}get error(){return this[B_]}get message(){return this[j_]}};Object.defineProperty(fs.prototype,"error",{enumerable:!0});Object.defineProperty(fs.prototype,"message",{enumerable:!0});var Mo=class extends dn{constructor(e,t={}){super(e),this[L_]=t.data===void 0?null:t.data}get data(){return this[L_]}};Object.defineProperty(Mo.prototype,"data",{enumerable:!0});var mL={addEventListener(r,e,t={}){for(let i of this.listeners(r))if(!t[Oo]&&i[Md]===e&&!i[Oo])return;let n;if(r==="message")n=function(s,o){let a=new Mo("message",{data:o?s:s.toString()});a[ps]=this,Qc(e,this,a)};else if(r==="close")n=function(s,o){let a=new ai("close",{code:s,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[ps]=this,Qc(e,this,a)};else if(r==="error")n=function(s){let o=new fs("error",{error:s,message:s.message});o[ps]=this,Qc(e,this,o)};else if(r==="open")n=function(){let s=new dn("open");s[ps]=this,Qc(e,this,s)};else return;n[Oo]=!!t[Oo],n[Md]=e,t.once?this.once(r,n):this.on(r,n)},removeEventListener(r,e){for(let t of this.listeners(r))if(t[Md]===e&&!t[Oo]){this.removeListener(r,t);break}}};U_.exports={CloseEvent:ai,ErrorEvent:fs,Event:dn,EventTarget:mL,MessageEvent:Mo};function Qc(r,e,t){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,t):r.call(e,t)}});var Pd=A((Z6,W_)=>{"use strict";var{tokenChars:Po}=cs();function qr(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}function gL(r){let e=Object.create(null),t=Object.create(null),n=!1,i=!1,s=!1,o,a,c=-1,l=-1,u=-1,f=0;for(;f<r.length;f++)if(l=r.charCodeAt(f),o===void 0)if(u===-1&&Po[l]===1)c===-1&&(c=f);else if(f!==0&&(l===32||l===9))u===-1&&c!==-1&&(u=f);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);u===-1&&(u=f);let g=r.slice(c,u);l===44?(qr(e,g,t),t=Object.create(null)):o=g,c=u=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);else if(a===void 0)if(u===-1&&Po[l]===1)c===-1&&(c=f);else if(l===32||l===9)u===-1&&c!==-1&&(u=f);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);u===-1&&(u=f),qr(t,r.slice(c,u),!0),l===44&&(qr(e,o,t),t=Object.create(null),o=void 0),c=u=-1}else if(l===61&&c!==-1&&u===-1)a=r.slice(c,f),c=u=-1;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(i){if(Po[l]!==1)throw new SyntaxError(`Unexpected character at index ${f}`);c===-1?c=f:n||(n=!0),i=!1}else if(s)if(Po[l]===1)c===-1&&(c=f);else if(l===34&&c!==-1)s=!1,u=f;else if(l===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(l===34&&r.charCodeAt(f-1)===61)s=!0;else if(u===-1&&Po[l]===1)c===-1&&(c=f);else if(c!==-1&&(l===32||l===9))u===-1&&(u=f);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);u===-1&&(u=f);let g=r.slice(c,u);n&&(g=g.replace(/\\/g,""),n=!1),qr(t,a,g),l===44&&(qr(e,o,t),t=Object.create(null),o=void 0),a=void 0,c=u=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);if(c===-1||s||l===32||l===9)throw new SyntaxError("Unexpected end of input");u===-1&&(u=f);let h=r.slice(c,u);return o===void 0?qr(e,h,t):(a===void 0?qr(t,h,!0):n?qr(t,a,h.replace(/\\/g,"")):qr(t,a,h),qr(e,o,t)),e}function vL(r){return Object.keys(r).map(e=>{let t=r[e];return Array.isArray(t)||(t=[t]),t.map(n=>[e].concat(Object.keys(n).map(i=>{let s=n[i];return Array.isArray(s)||(s=[s]),s.map(o=>o===!0?i:`${i}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}W_.exports={format:vL,parse:gL}});var nl=A((t8,rb)=>{"use strict";var yL=require("events"),xL=require("https"),_L=require("http"),V_=require("net"),bL=require("tls"),{randomBytes:wL,createHash:SL}=require("crypto"),{Duplex:Q6,Readable:e8}=require("stream"),{URL:Id}=require("url"),Hn=Ro(),EL=kd(),TL=Od(),{isBlob:CL}=cs(),{BINARY_TYPES:G_,EMPTY_BUFFER:el,GUID:kL,kForOnEventAttribute:Nd,kListener:AL,kStatusCode:RL,kWebSocket:vt,NOOP:K_}=pn(),{EventTarget:{addEventListener:OL,removeEventListener:ML}}=$_(),{format:PL,parse:IL}=Pd(),{toBuffer:NL}=ko(),DL=30*1e3,Y_=Symbol("kAborted"),Dd=[8,13],hn=["CONNECTING","OPEN","CLOSING","CLOSED"],LL=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Se=class r extends yL{constructor(e,t,n){super(),this._binaryType=G_[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=el,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=r.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,t===void 0?t=[]:Array.isArray(t)||(typeof t=="object"&&t!==null?(n=t,t=[]):t=[t]),J_(this,e,t,n)):(this._autoPong=n.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){G_.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(e,t,n){let i=new EL({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),s=new TL(e,this._extensions,n.generateMask);this._receiver=i,this._sender=s,this._socket=e,i[vt]=this,s[vt]=this,e[vt]=this,i.on("conclude",FL),i.on("drain",HL),i.on("error",qL),i.on("message",UL),i.on("ping",$L),i.on("pong",WL),s.onerror=GL,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",Q_),e.on("data",rl),e.on("end",eb),e.on("error",tb),this._readyState=r.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Hn.extensionName]&&this._extensions[Hn.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){Xt(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===r.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=r.CLOSING,this._sender.close(e,t,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),Z_(this)}}pause(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=t=void 0):typeof t=="function"&&(n=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Ld(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||el,t,n)}pong(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=t=void 0):typeof t=="function"&&(n=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Ld(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||el,t,n)}resume(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"&&(n=t,t={}),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){Ld(this,e,n);return}let i={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[Hn.extensionName]||(i.compress=!1),this._sender.send(e||el,i,n)}terminate(){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){Xt(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=r.CLOSING,this._socket.destroy())}}};Object.defineProperty(Se,"CONNECTING",{enumerable:!0,value:hn.indexOf("CONNECTING")});Object.defineProperty(Se.prototype,"CONNECTING",{enumerable:!0,value:hn.indexOf("CONNECTING")});Object.defineProperty(Se,"OPEN",{enumerable:!0,value:hn.indexOf("OPEN")});Object.defineProperty(Se.prototype,"OPEN",{enumerable:!0,value:hn.indexOf("OPEN")});Object.defineProperty(Se,"CLOSING",{enumerable:!0,value:hn.indexOf("CLOSING")});Object.defineProperty(Se.prototype,"CLOSING",{enumerable:!0,value:hn.indexOf("CLOSING")});Object.defineProperty(Se,"CLOSED",{enumerable:!0,value:hn.indexOf("CLOSED")});Object.defineProperty(Se.prototype,"CLOSED",{enumerable:!0,value:hn.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(Se.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(Se.prototype,`on${r}`,{enumerable:!0,get(){for(let e of this.listeners(r))if(e[Nd])return e[AL];return null},set(e){for(let t of this.listeners(r))if(t[Nd]){this.removeListener(r,t);break}typeof e=="function"&&this.addEventListener(r,e,{[Nd]:!0})}})});Se.prototype.addEventListener=OL;Se.prototype.removeEventListener=ML;rb.exports=Se;function J_(r,e,t,n){let i={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:Dd[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...n,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(r._autoPong=i.autoPong,!Dd.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${Dd.join(", ")})`);let s;if(e instanceof Id)s=e;else try{s=new Id(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),r._url=s.href;let o=s.protocol==="wss:",a=s.protocol==="ws+unix:",c;if(s.protocol!=="ws:"&&!o&&!a?c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!s.pathname?c="The URL's pathname is empty":s.hash&&(c="The URL contains a fragment identifier"),c){let S=new SyntaxError(c);if(r._redirects===0)throw S;tl(r,S);return}let l=o?443:80,u=wL(16).toString("base64"),f=o?xL.request:_L.request,h=new Set,g;if(i.createConnection=i.createConnection||(o?jL:BL),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&&(g=new Hn(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=PL({[Hn.extensionName]:g.offer()})),t.length){for(let S of t){if(typeof S!="string"||!LL.test(S)||h.has(S))throw new SyntaxError("An invalid or duplicated subprotocol was specified");h.add(S)}i.headers["Sec-WebSocket-Protocol"]=t.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){let S=i.path.split(":");i.socketPath=S[0],i.path=S[1]}let x;if(i.followRedirects){if(r._redirects===0){r._originalIpc=a,r._originalSecure=o,r._originalHostOrSocketPath=a?i.socketPath:s.host;let S=n&&n.headers;if(n={...n,headers:{}},S)for(let[k,R]of Object.entries(S))n.headers[k.toLowerCase()]=R}else if(r.listenerCount("redirect")===0){let S=a?r._originalIpc?i.socketPath===r._originalHostOrSocketPath:!1:r._originalIpc?!1:s.host===r._originalHostOrSocketPath;(!S||r._originalSecure&&!o)&&(delete i.headers.authorization,delete i.headers.cookie,S||delete i.headers.host,i.auth=void 0)}i.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),x=r._req=f(i),r._redirects&&r.emit("redirect",r.url,x)}else x=r._req=f(i);i.timeout&&x.on("timeout",()=>{Xt(r,x,"Opening handshake has timed out")}),x.on("error",S=>{x===null||x[Y_]||(x=r._req=null,tl(r,S))}),x.on("response",S=>{let k=S.headers.location,R=S.statusCode;if(k&&i.followRedirects&&R>=300&&R<400){if(++r._redirects>i.maxRedirects){Xt(r,x,"Maximum redirects exceeded");return}x.abort();let M;try{M=new Id(k,e)}catch{let B=new SyntaxError(`Invalid URL: ${k}`);tl(r,B);return}J_(r,M,t,n)}else r.emit("unexpected-response",x,S)||Xt(r,x,`Unexpected server response: ${S.statusCode}`)}),x.on("upgrade",(S,k,R)=>{if(r.emit("upgrade",S),r.readyState!==Se.CONNECTING)return;x=r._req=null;let M=S.headers.upgrade;if(M===void 0||M.toLowerCase()!=="websocket"){Xt(r,k,"Invalid Upgrade header");return}let I=SL("sha1").update(u+kL).digest("base64");if(S.headers["sec-websocket-accept"]!==I){Xt(r,k,"Invalid Sec-WebSocket-Accept header");return}let B=S.headers["sec-websocket-protocol"],V;if(B!==void 0?h.size?h.has(B)||(V="Server sent an invalid subprotocol"):V="Server sent a subprotocol but none was requested":h.size&&(V="Server sent no subprotocol"),V){Xt(r,k,V);return}B&&(r._protocol=B);let F=S.headers["sec-websocket-extensions"];if(F!==void 0){if(!g){Xt(r,k,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let G;try{G=IL(F)}catch{Xt(r,k,"Invalid Sec-WebSocket-Extensions header");return}let D=Object.keys(G);if(D.length!==1||D[0]!==Hn.extensionName){Xt(r,k,"Server indicated an extension that was not requested");return}try{g.accept(G[Hn.extensionName])}catch{Xt(r,k,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[Hn.extensionName]=g}r.setSocket(k,R,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(x,r):x.end()}function tl(r,e){r._readyState=Se.CLOSING,r._errorEmitted=!0,r.emit("error",e),r.emitClose()}function BL(r){return r.path=r.socketPath,V_.connect(r)}function jL(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=V_.isIP(r.host)?"":r.host),bL.connect(r)}function Xt(r,e,t){r._readyState=Se.CLOSING;let n=new Error(t);Error.captureStackTrace(n,Xt),e.setHeader?(e[Y_]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(tl,r,n)):(e.destroy(n),e.once("error",r.emit.bind(r,"error")),e.once("close",r.emitClose.bind(r)))}function Ld(r,e,t){if(e){let n=CL(e)?e.size:NL(e).length;r._socket?r._sender._bufferedBytes+=n:r._bufferedAmount+=n}if(t){let n=new Error(`WebSocket is not open: readyState ${r.readyState} (${hn[r.readyState]})`);process.nextTick(t,n)}}function FL(r,e){let t=this[vt];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=r,t._socket[vt]!==void 0&&(t._socket.removeListener("data",rl),process.nextTick(X_,t._socket),r===1005?t.close():t.close(r,e))}function HL(){let r=this[vt];r.isPaused||r._socket.resume()}function qL(r){let e=this[vt];e._socket[vt]!==void 0&&(e._socket.removeListener("data",rl),process.nextTick(X_,e._socket),e.close(r[RL])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r))}function z_(){this[vt].emitClose()}function UL(r,e){this[vt].emit("message",r,e)}function $L(r){let e=this[vt];e._autoPong&&e.pong(r,!this._isServer,K_),e.emit("ping",r)}function WL(r){this[vt].emit("pong",r)}function X_(r){r.resume()}function GL(r){let e=this[vt];e.readyState!==Se.CLOSED&&(e.readyState===Se.OPEN&&(e._readyState=Se.CLOSING,Z_(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r)))}function Z_(r){r._closeTimer=setTimeout(r._socket.destroy.bind(r._socket),DL)}function Q_(){let r=this[vt];this.removeListener("close",Q_),this.removeListener("data",rl),this.removeListener("end",eb),r._readyState=Se.CLOSING;let e;!this._readableState.endEmitted&&!r._closeFrameReceived&&!r._receiver._writableState.errorEmitted&&(e=r._socket.read())!==null&&r._receiver.write(e),r._receiver.end(),this[vt]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",z_),r._receiver.on("finish",z_))}function rl(r){this[vt]._receiver.write(r)||this.pause()}function eb(){let r=this[vt];r._readyState=Se.CLOSING,r._receiver.end(),this.end()}function tb(){let r=this[vt];this.removeListener("error",tb),this.on("error",K_),r&&(r._readyState=Se.CLOSING,this.destroy())}});var ob=A((n8,sb)=>{"use strict";var r8=nl(),{Duplex:zL}=require("stream");function nb(r){r.emit("close")}function VL(){!this.destroyed&&this._writableState.finished&&this.destroy()}function ib(r){this.removeListener("error",ib),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function KL(r,e){let t=!0,n=new zL({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return r.on("message",function(s,o){let a=!o&&n._readableState.objectMode?s.toString():s;n.push(a)||r.pause()}),r.once("error",function(s){n.destroyed||(t=!1,n.destroy(s))}),r.once("close",function(){n.destroyed||n.push(null)}),n._destroy=function(i,s){if(r.readyState===r.CLOSED){s(i),process.nextTick(nb,n);return}let o=!1;r.once("error",function(c){o=!0,s(c)}),r.once("close",function(){o||s(i),process.nextTick(nb,n)}),t&&r.terminate()},n._final=function(i){if(r.readyState===r.CONNECTING){r.once("open",function(){n._final(i)});return}r._socket!==null&&(r._socket._writableState.finished?(i(),n._readableState.endEmitted&&n.destroy()):(r._socket.once("finish",function(){i()}),r.close()))},n._read=function(){r.isPaused&&r.resume()},n._write=function(i,s,o){if(r.readyState===r.CONNECTING){r.once("open",function(){n._write(i,s,o)});return}r.send(i,o)},n.on("end",VL),n.on("error",ib),n}sb.exports=KL});var cb=A((i8,ab)=>{"use strict";var{tokenChars:YL}=cs();function JL(r){let e=new Set,t=-1,n=-1,i=0;for(i;i<r.length;i++){let o=r.charCodeAt(i);if(n===-1&&YL[o]===1)t===-1&&(t=i);else if(i!==0&&(o===32||o===9))n===-1&&t!==-1&&(n=i);else if(o===44){if(t===-1)throw new SyntaxError(`Unexpected character at index ${i}`);n===-1&&(n=i);let a=r.slice(t,n);if(e.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);e.add(a),t=n=-1}else throw new SyntaxError(`Unexpected character at index ${i}`)}if(t===-1||n!==-1)throw new SyntaxError("Unexpected end of input");let s=r.slice(t,i);if(e.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);return e.add(s),e}ab.exports={parse:JL}});var mb=A((o8,hb)=>{"use strict";var XL=require("events"),il=require("http"),{Duplex:s8}=require("stream"),{createHash:ZL}=require("crypto"),lb=Pd(),ci=Ro(),QL=cb(),e2=nl(),{GUID:t2,kWebSocket:r2}=pn(),n2=/^[+/0-9A-Za-z]{22}==$/,ub=0,pb=1,db=2,Bd=class extends XL{constructor(e,t){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:e2,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(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(e.port!=null?(this._server=il.createServer((n,i)=>{let s=il.STATUS_CODES[426];i.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),i.end(s)}),this._server.listen(e.port,e.host,e.backlog,t)):e.server&&(this._server=e.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=i2(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,s,o)=>{this.handleUpgrade(i,s,o,n)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=ub}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(this._state===db){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(Io,this);return}if(e&&this.once("close",e),this._state!==pb)if(this._state=pb,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(Io,this):process.nextTick(Io,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{Io(this)})}}shouldHandle(e){if(this.options.path){let t=e.url.indexOf("?");if((t!==-1?e.url.slice(0,t):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,t,n,i){t.on("error",fb);let s=e.headers["sec-websocket-key"],o=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){li(this,e,t,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){li(this,e,t,400,"Invalid Upgrade header");return}if(s===void 0||!n2.test(s)){li(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){li(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){No(t,400);return}let c=e.headers["sec-websocket-protocol"],l=new Set;if(c!==void 0)try{l=QL.parse(c)}catch{li(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let u=e.headers["sec-websocket-extensions"],f={};if(this.options.perMessageDeflate&&u!==void 0){let h=new ci(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let g=lb.parse(u);g[ci.extensionName]&&(h.accept(g[ci.extensionName]),f[ci.extensionName]=h)}catch{li(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let h={origin:e.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(h,(g,x,S,k)=>{if(!g)return No(t,x||401,S,k);this.completeUpgrade(f,s,l,e,t,n,i)});return}if(!this.options.verifyClient(h))return No(t,401)}this.completeUpgrade(f,s,l,e,t,n,i)}completeUpgrade(e,t,n,i,s,o,a){if(!s.readable||!s.writable)return s.destroy();if(s[r2])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>ub)return No(s,503);let l=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${ZL("sha1").update(t+t2).digest("base64")}`],u=new this.options.WebSocket(null,void 0,this.options);if(n.size){let f=this.options.handleProtocols?this.options.handleProtocols(n,i):n.values().next().value;f&&(l.push(`Sec-WebSocket-Protocol: ${f}`),u._protocol=f)}if(e[ci.extensionName]){let f=e[ci.extensionName].params,h=lb.format({[ci.extensionName]:[f]});l.push(`Sec-WebSocket-Extensions: ${h}`),u._extensions=e}this.emit("headers",l,i),s.write(l.concat(`\r
|
|
23
|
+
`+n)}r.destroy()}var ko=[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];function iD(r){if(r+="",r.length<1)return!1;if(!ko[r.charCodeAt(0)])return ee('invalid header, index 0, char "%s"',r.charCodeAt(0)),!0;if(r.length<2)return!1;if(!ko[r.charCodeAt(1)])return ee('invalid header, index 1, char "%s"',r.charCodeAt(1)),!0;if(r.length<3)return!1;if(!ko[r.charCodeAt(2)])return ee('invalid header, index 2, char "%s"',r.charCodeAt(2)),!0;if(r.length<4)return!1;if(!ko[r.charCodeAt(3)])return ee('invalid header, index 3, char "%s"',r.charCodeAt(3)),!0;for(let e=4;e<r.length;++e)if(!ko[r.charCodeAt(e)])return ee('invalid header, index "%i", char "%s"',e,r.charCodeAt(e)),!0;return!1}});var Wx=A(Ic=>{"use strict";Object.defineProperty(Ic,"__esModule",{value:!0});Ic.Polling=void 0;var sD=ei(),$x=require("zlib"),oD=ec(),aD=Ae(),cr=(0,aD.default)("engine:polling"),cD={gzip:$x.createGzip,deflate:$x.createDeflate},Zf=class extends sD.Transport{constructor(e){super(e),this.closeTimeout=30*1e3}get name(){return"polling"}onRequest(e){let t=e.res;e.res=null,e.getMethod()==="get"?this.onPollRequest(e,t):e.getMethod()==="post"?this.onDataRequest(e,t):(t.writeStatus("500 Internal Server Error"),t.end())}onPollRequest(e,t){if(this.req){cr("request overlap"),this.onError("overlap from client"),t.writeStatus("500 Internal Server Error"),t.end();return}cr("setting request"),this.req=e,this.res=t;let n=()=>{this.writable=!1,this.onError("poll connection closed prematurely")},i=()=>{this.req=this.res=null};e.cleanup=i,t.onAborted(n),this.writable=!0,this.emit("ready"),this.writable&&this.shouldClose&&(cr("triggering empty send to append close packet"),this.send([{type:"noop"}]))}onDataRequest(e,t){if(this.dataReq){this.onError("data request overlap from client"),t.writeStatus("500 Internal Server Error"),t.end();return}let n=Number(e.headers["content-length"]);if(!n){this.onError("content-length header required"),t.writeStatus("411 Length Required").end();return}if(n>this.maxHttpBufferSize){this.onError("payload too large"),t.writeStatus("413 Payload Too Large").end();return}if(e.headers["content-type"]==="application/octet-stream"&&this.protocol===4)return this.onError("invalid content");this.dataReq=e,this.dataRes=t;let s,o=0,a={"Content-Type":"text/html"};this.headers(e,a);for(let l in a)t.writeHeader(l,String(a[l]));let c=l=>{this.onData(l.toString()),this.onDataRequestCleanup(),t.cork(()=>{t.end("ok")})};t.onAborted(()=>{this.onDataRequestCleanup(),this.onError("data request connection closed prematurely")}),t.onData((l,u)=>{let f=o+l.byteLength;if(f>n){this.onError("content-length mismatch"),t.close();return}if(!s){if(u){c(Buffer.from(l));return}s=Buffer.allocUnsafe(n)}if(Buffer.from(l).copy(s,o),u){if(f!=n){this.onError("content-length mismatch"),t.writeStatus("400 Content-Length Mismatch").end(),this.onDataRequestCleanup();return}c(s);return}o=f})}onDataRequestCleanup(){this.dataReq=this.dataRes=null}onData(e){cr('received "%s"',e);let t=n=>{if(n.type==="close")return cr("got xhr close packet"),this.onClose(),!1;this.onPacket(n)};this.protocol===3?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&&(cr("appending close packet to payload"),e.push({type:"close"}),this.shouldClose(),this.shouldClose=null);let t=n=>{let i=e.some(s=>s.options&&s.options.compress);this.write(n,{compress:i})};this.protocol===3?this.parser.encodePayload(e,this.supportsBinary,t):this.parser.encodePayload(e,t)}write(e,t){cr('writing "%s"',e),this.doWrite(e,t,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(e,t,n){let i=typeof e=="string",o={"Content-Type":i?"text/plain; charset=UTF-8":"application/octet-stream"},a=u=>{this.headers(this.req,o),this.res.cork(()=>{Object.keys(o).forEach(f=>{this.res.writeHeader(f,String(o[f]))}),this.res.end(u)}),n()};if(!this.httpCompression||!t.compress){a(e);return}if((i?Buffer.byteLength(e):e.length)<this.httpCompression.threshold){a(e);return}let l=oD(this.req).encodings(["gzip","deflate"]);if(!l){a(e);return}this.compress(e,l,(u,f)=>{if(u){this.res.writeStatus("500 Internal Server Error"),this.res.end(),n(u);return}o["Content-Encoding"]=l,a(f)})}compress(e,t,n){cr("compressing");let i=[],s=0;cD[t](this.httpCompression).on("error",n).on("data",function(o){i.push(o),s+=o.length}).on("end",function(){n(null,Buffer.concat(i,s))}).end(e)}doClose(e){cr("closing");let t,n=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(cr("transport writable - closing right away"),this.send([{type:"close"}]),n()):this.discarded?(cr("transport discarded - closing right away"),n()):(cr("transport not writable - buffering orderly close"),this.shouldClose=n,t=setTimeout(n,this.closeTimeout))}headers(e,t){t=t||{};let 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}};Ic.Polling=Zf});var zx=A(Nc=>{"use strict";Object.defineProperty(Nc,"__esModule",{value:!0});Nc.WebSocket=void 0;var lD=ei(),uD=Ae(),Gx=(0,uD.default)("engine:ws"),Qf=class extends lD.Transport{constructor(e){super(e),this.writable=!1,this.perMessageDeflate=null}get name(){return"websocket"}get handlesUpgrades(){return!0}send(e){this.writable=!1;for(let t=0;t<e.length;t++){let n=e[t],i=t+1===e.length,s=o=>{let a=typeof o!="string",c=this.perMessageDeflate&&Buffer.byteLength(o)>this.perMessageDeflate.threshold;Gx('writing "%s"',o),this.socket.send(o,a,c),i&&(this.emit("drain"),this.writable=!0,this.emit("ready"))};n.options&&typeof n.options.wsPreEncoded=="string"?s(n.options.wsPreEncoded):this.parser.encodePacket(n,this.supportsBinary,s)}}doClose(e){Gx("closing"),e&&e(),this.socket.end()}};Nc.WebSocket=Qf});var Vx=A(ed=>{"use strict";Object.defineProperty(ed,"__esModule",{value:!0});var pD=Wx(),fD=zx();ed.default={polling:pD.Polling,websocket:fD.WebSocket}});var Kx=A(Dc=>{"use strict";Object.defineProperty(Dc,"__esModule",{value:!0});Dc.uServer=void 0;var dD=Ae(),oi=Xf(),hD=Vx(),Bn=(0,dD.default)("engine:uws"),td=class extends oi.BaseServer{init(){}cleanup(){}prepare(e,t){e.method=e.getMethod().toUpperCase(),e.url=e.getUrl();let n=new URLSearchParams(e.getQuery());e._query=Object.fromEntries(n.entries()),e.headers={},e.forEach((i,s)=>{e.headers[i]=s}),e.connection={remoteAddress:Buffer.from(t.getRemoteAddressAsText()).toString()},t.onAborted(()=>{Bn("response has been aborted")})}createTransport(e,t){return new hD.default[e](t)}attach(e,t={}){let 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:i=>{let s=i.getUserData().transport;s.socket=i,s.writable=!0,s.emit("ready")},message:(i,s,o)=>{i.getUserData().transport.onData(o?s:Buffer.from(s).toString())},close:(i,s,o)=>{i.getUserData().transport.onClose(s,o)}})}_applyMiddlewares(e,t,n){if(this.middlewares.length===0)return n();e.res=new rd(t),super._applyMiddlewares(e,e.res,i=>{e.res.writeHead(),n(i)})}handleRequest(e,t){Bn('handling "%s" http request "%s"',t.getMethod(),t.getUrl()),this.prepare(t,e),t.res=e;let n=(i,s)=>{if(i!==void 0){this.emit("connection_error",{req:t,code:i,message:oi.Server.errorMessages[i],context:s}),this.abortRequest(t.res,i,s);return}if(t._query.sid)Bn("setting new request for existing client"),this.clients[t._query.sid].transport.onRequest(t);else{let o=(a,c)=>this.abortRequest(e,a,c);this.handshake(t._query.transport,t,o)}};this._applyMiddlewares(t,e,i=>{i?n(oi.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!1,n)})}handleUpgrade(e,t,n){Bn("on upgrade"),this.prepare(t,e),t.res=e;let i=async(s,o)=>{if(s!==void 0){this.emit("connection_error",{req:t,code:s,message:oi.Server.errorMessages[s],context:o}),this.abortRequest(e,s,o);return}let a=t._query.sid,c;if(a){let f=this.clients[a];if(f){if(f.upgrading)return Bn("transport has already been trying to upgrade"),e.close();if(f.upgraded)return Bn("transport had already been upgraded"),e.close();Bn("upgrading existing transport"),c=this.createTransport(t._query.transport,t),f._maybeUpgrade(c)}else return Bn("upgrade attempt for closed client"),e.close()}else if(c=await this.handshake(t._query.transport,t,(f,h)=>this.abortRequest(e,f,h)),!c)return;let l={};!a&&this.emit("initial_headers",l,t),this.emit("headers",l,t),t.res.writeStatus("101 Switching Protocols"),Object.keys(l).forEach(f=>{t.res.writeHeader(f,l[f])}),e.upgrade({transport:c},t.getHeader("sec-websocket-key"),t.getHeader("sec-websocket-protocol"),t.getHeader("sec-websocket-extensions"),n)};this._applyMiddlewares(t,e,s=>{s?i(oi.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!0,i)})}abortRequest(e,t,n){let i=t===oi.Server.errors.FORBIDDEN?"403 Forbidden":"400 Bad Request",s=n&&n.message?n.message:oi.Server.errorMessages[t];e.writeStatus(i),e.writeHeader("Content-Type","application/json"),e.end(JSON.stringify({code:t,message:s}))}};Dc.uServer=td;var rd=class{constructor(e){this.res=e,this.statusWritten=!1,this.headers=[],this.isAborted=!1}set statusCode(e){e&&this.writeStatus(e===200?"200 OK":"204 No Content")}writeHead(e){this.statusCode=e}setHeader(e,t){Array.isArray(t)?t.forEach(n=>{this.writeHeader(e,n)}):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||e!=="Content-Length"&&(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)}}});var Zx=A(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.protocol=gt.Transport=gt.Socket=gt.uServer=gt.parser=gt.transports=gt.Server=void 0;gt.listen=_D;gt.attach=Xx;var mD=require("http"),Yx=Xf();Object.defineProperty(gt,"Server",{enumerable:!0,get:function(){return Yx.Server}});var gD=pf();gt.transports=gD.default;var Jx=yo();gt.parser=Jx;var vD=Kx();Object.defineProperty(gt,"uServer",{enumerable:!0,get:function(){return vD.uServer}});var yD=df();Object.defineProperty(gt,"Socket",{enumerable:!0,get:function(){return yD.Socket}});var xD=ei();Object.defineProperty(gt,"Transport",{enumerable:!0,get:function(){return xD.Transport}});gt.protocol=Jx.protocol;function _D(r,e,t){typeof e=="function"&&(t=e,e={});let n=(0,mD.createServer)(function(s,o){o.writeHead(501),o.end("Not Implemented")}),i=Xx(n,e);return i.httpServer=n,n.listen(r,t),i}function Xx(r,e){let t=new Yx.Server(e);return t.attach(r,e),t}});var e_=A(Qx=>{Qx.Emitter=Rt;function Rt(r){if(r)return bD(r)}function bD(r){for(var e in Rt.prototype)r[e]=Rt.prototype[e];return r}Rt.prototype.on=Rt.prototype.addEventListener=function(r,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(e),this};Rt.prototype.once=function(r,e){function t(){this.off(r,t),e.apply(this,arguments)}return t.fn=e,this.on(r,t),this};Rt.prototype.off=Rt.prototype.removeListener=Rt.prototype.removeAllListeners=Rt.prototype.removeEventListener=function(r,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+r];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+r],this;for(var n,i=0;i<t.length;i++)if(n=t[i],n===e||n.fn===e){t.splice(i,1);break}return t.length===0&&delete this._callbacks["$"+r],this};Rt.prototype.emit=function(r){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+r],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(t){t=t.slice(0);for(var n=0,i=t.length;n<i;++n)t[n].apply(this,e)}return this};Rt.prototype.emitReserved=Rt.prototype.emit;Rt.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]};Rt.prototype.hasListeners=function(r){return!!this.listeners(r).length}});var nd=A(Bc=>{"use strict";Object.defineProperty(Bc,"__esModule",{value:!0});Bc.isBinary=r_;Bc.hasBinary=Lc;var wD=typeof ArrayBuffer=="function",SD=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,t_=Object.prototype.toString,ED=typeof Blob=="function"||typeof Blob<"u"&&t_.call(Blob)==="[object BlobConstructor]",TD=typeof File=="function"||typeof File<"u"&&t_.call(File)==="[object FileConstructor]";function r_(r){return wD&&(r instanceof ArrayBuffer||SD(r))||ED&&r instanceof Blob||TD&&r instanceof File}function Lc(r,e){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let t=0,n=r.length;t<n;t++)if(Lc(r[t]))return!0;return!1}if(r_(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return Lc(r.toJSON(),!0);for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&Lc(r[t]))return!0;return!1}});var n_=A(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc.deconstructPacket=kD;jc.reconstructPacket=AD;var CD=nd();function kD(r){let e=[],t=r.data,n=r;return n.data=id(t,e),n.attachments=e.length,{packet:n,buffers:e}}function id(r,e){if(!r)return r;if((0,CD.isBinary)(r)){let t={_placeholder:!0,num:e.length};return e.push(r),t}else if(Array.isArray(r)){let t=new Array(r.length);for(let n=0;n<r.length;n++)t[n]=id(r[n],e);return t}else if(typeof r=="object"&&!(r instanceof Date)){let t={};for(let n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=id(r[n],e));return t}return r}function AD(r,e){return r.data=sd(r.data,e),delete r.attachments,r}function sd(r,e){if(!r)return r;if(r&&r._placeholder===!0){if(typeof r.num=="number"&&r.num>=0&&r.num<e.length)return e[r.num];throw new Error("illegal attachments")}else if(Array.isArray(r))for(let t=0;t<r.length;t++)r[t]=sd(r[t],e);else if(typeof r=="object")for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&(r[t]=sd(r[t],e));return r}});var Ao=A(Cr=>{"use strict";Object.defineProperty(Cr,"__esModule",{value:!0});Cr.Decoder=Cr.Encoder=Cr.PacketType=Cr.protocol=void 0;Cr.isPacketValid=ND;var RD=e_(),i_=n_(),s_=nd(),OD=Ae(),od=(0,OD.default)("socket.io-parser"),o_=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];Cr.protocol=5;var fe;(function(r){r[r.CONNECT=0]="CONNECT",r[r.DISCONNECT=1]="DISCONNECT",r[r.EVENT=2]="EVENT",r[r.ACK=3]="ACK",r[r.CONNECT_ERROR=4]="CONNECT_ERROR",r[r.BINARY_EVENT=5]="BINARY_EVENT",r[r.BINARY_ACK=6]="BINARY_ACK"})(fe||(Cr.PacketType=fe={}));var ad=class{constructor(e){this.replacer=e}encode(e){return od("encoding packet %j",e),(e.type===fe.EVENT||e.type===fe.ACK)&&(0,s_.hasBinary)(e)?this.encodeAsBinary({type:e.type===fe.EVENT?fe.BINARY_EVENT:fe.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===fe.BINARY_EVENT||e.type===fe.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),od("encoded %j as %s",e,t),t}encodeAsBinary(e){let t=(0,i_.deconstructPacket)(e),n=this.encodeAsString(t.packet),i=t.buffers;return i.unshift(n),i}};Cr.Encoder=ad;var cd=class r extends RD.Emitter{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof e=="function"?{reviver:e}:e)}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);let n=t.type===fe.BINARY_EVENT;n||t.type===fe.BINARY_ACK?(t.type=n?fe.EVENT:fe.ACK,this.reconstructor=new ld(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if((0,s_.isBinary)(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0,n={type:Number(e.charAt(0))};if(fe[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===fe.BINARY_EVENT||n.type===fe.BINARY_ACK){let s=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);let o=e.substring(s,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");let a=Number(o);if(!a_(a)||a<0)throw new Error("Illegal attachments");if(a>this.opts.maxAttachments)throw new Error("too many attachments");n.attachments=a}if(e.charAt(t+1)==="/"){let s=t+1;for(;++t&&!(e.charAt(t)===","||t===e.length););n.nsp=e.substring(s,t)}else n.nsp="/";let i=e.charAt(t+1);if(i!==""&&Number(i)==i){let s=t+1;for(;++t;){let o=e.charAt(t);if(o==null||Number(o)!=o){--t;break}if(t===e.length)break}n.id=Number(e.substring(s,t+1))}if(e.charAt(++t)){let s=this.tryParse(e.substr(t));if(r.isPayloadValid(n.type,s))n.data=s;else throw new Error("invalid payload")}return od("decoded %s as %j",e,n),n}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case fe.CONNECT:return Fc(t);case fe.DISCONNECT:return t===void 0;case fe.CONNECT_ERROR:return typeof t=="string"||Fc(t);case fe.EVENT:case fe.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&o_.indexOf(t[0])===-1);case fe.ACK:case fe.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}};Cr.Decoder=cd;var ld=class{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){let t=(0,i_.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function MD(r){return typeof r=="string"}var a_=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r};function PD(r){return r===void 0||a_(r)}function Fc(r){return Object.prototype.toString.call(r)==="[object Object]"}function ID(r,e){switch(r){case fe.CONNECT:return e===void 0||Fc(e);case fe.DISCONNECT:return e===void 0;case fe.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&o_.indexOf(e[0])===-1);case fe.ACK:return Array.isArray(e);case fe.CONNECT_ERROR:return typeof e=="string"||Fc(e);default:return!1}}function ND(r){return MD(r.nsp)&&PD(r.id)&&ID(r.type,r.data)}});var c_=A(is=>{"use strict";var DD=is&&is.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(is,"__esModule",{value:!0});is.Client=void 0;var Hc=Ao(),LD=DD(Ae()),kr=(0,LD.default)("socket.io:client"),ud=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(()=>{this.nsps.size===0?(kr("no namespace joined yet, close the client"),this.close()):kr("the client has already joined a namespace, nothing to do")},this.server._connectTimeout)}connect(e,t={}){if(this.server._nsps.has(e))return kr("connecting to namespace %s",e),this.doConnect(e,t);this.server._checkNamespace(e,t,n=>{n?this.doConnect(e,t):(kr("creation of namespace %s was denied",e),this._packet({type:Hc.PacketType.CONNECT_ERROR,nsp:e,data:{message:"Invalid namespace"}}))})}doConnect(e,t){let n=this.server.of(e);n._add(this,t,i=>{this.sockets.set(i.id,i),this.nsps.set(n.name,i),this.connectTimeout&&(clearTimeout(this.connectTimeout),this.connectTimeout=void 0)})}_disconnect(){for(let e of this.sockets.values())e.disconnect();this.sockets.clear(),this.close()}_remove(e){if(this.sockets.has(e.id)){let t=this.sockets.get(e.id).nsp.name;this.sockets.delete(e.id),this.nsps.delete(t)}else kr("ignoring remove for %s",e.id)}close(){this.conn.readyState==="open"&&(kr("forcing transport close"),this.conn.close(),this.onclose("forced server close"))}_packet(e,t={}){if(this.conn.readyState!=="open"){kr("ignoring packet write %j",e);return}let n=t.preEncoded?e:this.encoder.encode(e);this.writeToEngine(n,t)}writeToEngine(e,t){if(t.volatile&&!this.conn.transport.writable){kr("volatile packet is discarded since the transport is not currently writable");return}let n=Array.isArray(e)?e:[e];for(let i of n)this.conn.write(i,t)}ondata(e){try{this.decoder.add(e)}catch(t){kr("invalid packet format"),this.onerror(t)}}ondecoded(e){let{namespace:t,authPayload:n}=this._parseNamespace(e),i=this.nsps.get(t);!i&&e.type===Hc.PacketType.CONNECT?this.connect(t,n):i&&e.type!==Hc.PacketType.CONNECT&&e.type!==Hc.PacketType.CONNECT_ERROR?process.nextTick(function(){i._onpacket(e)}):(kr("invalid state (packet type: %s)",e.type),this.close())}_parseNamespace(e){if(this.conn.protocol!==3)return{namespace:e.nsp,authPayload:e.data};let t=new URL(e.nsp,"https://socket.io");return{namespace:t.pathname,authPayload:Object.fromEntries(t.searchParams.entries())}}onerror(e){for(let t of this.sockets.values())t._onerror(e);this.conn.close()}onclose(e,t){kr("client close with reason %s",e),this.destroy();for(let 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)}};is.Client=ud});var Uc=A(qc=>{"use strict";Object.defineProperty(qc,"__esModule",{value:!0});qc.StrictEventEmitter=void 0;var BD=require("events"),pd=class extends BD.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)}};qc.StrictEventEmitter=pd});var fd=A($c=>{"use strict";Object.defineProperty($c,"__esModule",{value:!0});$c.RESERVED_EVENTS=void 0;$c.RESERVED_EVENTS=new Set(["connect","connect_error","disconnect","disconnecting","newListener","removeListener"])});var dd=A(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.RemoteSocket=ss.BroadcastOperator=void 0;var jD=fd(),FD=Ao(),Wc=class r{constructor(e,t=new Set,n=new Set,i={}){this.adapter=e,this.rooms=t,this.exceptRooms=n,this.flags=i}to(e){let t=new Set(this.rooms);return Array.isArray(e)?e.forEach(n=>t.add(n)):t.add(e),new r(this.adapter,t,this.exceptRooms,this.flags)}in(e){return this.to(e)}except(e){let t=new Set(this.exceptRooms);return Array.isArray(e)?e.forEach(n=>t.add(n)):t.add(e),new r(this.adapter,this.rooms,t,this.flags)}compress(e){let t=Object.assign({},this.flags,{compress:e});return new r(this.adapter,this.rooms,this.exceptRooms,t)}get volatile(){let e=Object.assign({},this.flags,{volatile:!0});return new r(this.adapter,this.rooms,this.exceptRooms,e)}get local(){let e=Object.assign({},this.flags,{local:!0});return new r(this.adapter,this.rooms,this.exceptRooms,e)}timeout(e){let t=Object.assign({},this.flags,{timeout:e});return new r(this.adapter,this.rooms,this.exceptRooms,t)}emit(e,...t){if(jD.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let n=[e,...t],i={type:FD.PacketType.EVENT,data:n};if(!(typeof n[n.length-1]=="function"))return this.adapter.broadcast(i,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags}),!0;let o=n.pop(),a=!1,c=[],l=setTimeout(()=>{a=!0,o.apply(this,[new Error("operation has timed out"),this.flags.expectSingleResponse?null:c])},this.flags.timeout),u=-1,f=0,h=0,g=()=>{!a&&u===f&&c.length===h&&(clearTimeout(l),o.apply(this,[null,this.flags.expectSingleResponse?c[0]:c]))};return this.adapter.broadcastWithAck(i,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags},x=>{h+=x,f++,g()},x=>{c.push(x),g()}),this.adapter.serverCount().then(x=>{u=x,g()}),!0}emitWithAck(e,...t){return new Promise((n,i)=>{t.push((s,o)=>s?(s.responses=o,i(s)):n(o)),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(e=>e.map(t=>t.server?t:new Gc(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)}};ss.BroadcastOperator=Wc;var Gc=class{constructor(e,t){this.id=t.id,this.handshake=t.handshake,this.rooms=new Set(t.rooms),this.data=t.data,this.operator=new Wc(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}};ss.RemoteSocket=Gc});var md=A(os=>{"use strict";var p_=os&&os.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(os,"__esModule",{value:!0});os.Socket=void 0;var lr=Ao(),HD=p_(Ae()),qD=Uc(),l_=p_(Wp()),UD=dd(),$D=fd(),St=(0,HD.default)("socket.io:socket"),WD=new Set(["transport error","transport close","forced close","ping timeout","server shutting down","forced server close"]);function u_(){}var hd=class extends qD.StrictEventEmitter{constructor(e,t,n,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=e.adapter,i?(this.id=i.sid,this.pid=i.pid,i.rooms.forEach(s=>this.join(s)),this.data=i.data,i.missedPackets.forEach(s=>{this.packet({type:lr.PacketType.EVENT,data:s})}),this.recovered=!0):(t.conn.protocol===3?this.id=e.name!=="/"?e.name+"#"+t.id:t.id:this.id=l_.default.generateId(),this.server._opts.connectionStateRecovery&&(this.pid=l_.default.generateId())),this.handshake=this.buildHandshake(n),this.on("error",u_)}buildHandshake(e){var t,n,i,s;return{headers:((t=this.request)===null||t===void 0?void 0:t.headers)||{},time:new Date+"",address:this.conn.remoteAddress,xdomain:!!(!((n=this.request)===null||n===void 0)&&n.headers.origin),secure:!this.request||!!this.request.connection.encrypted,issued:+new Date,url:(i=this.request)===null||i===void 0?void 0:i.url,query:((s=this.request)===null||s===void 0?void 0:s._query)||{},auth:e}}emit(e,...t){if($D.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let n=[e,...t],i={type:lr.PacketType.EVENT,data:n};if(typeof n[n.length-1]=="function"){let o=this.nsp._ids++;St("emitting packet with ack id %d",o),this.registerAckCallback(o,n.pop()),i.id=o}let s=Object.assign({},this.flags);return this.flags={},this.nsp.server.opts.connectionStateRecovery?this.adapter.broadcast(i,{rooms:new Set([this.id]),except:new Set,flags:s}):(this.notifyOutgoingListeners(i),this.packet(i,s)),!0}emitWithAck(e,...t){let n=this.flags.timeout!==void 0;return new Promise((i,s)=>{t.push((o,a)=>n?o?s(o):i(a):i(o)),this.emit(e,...t)})}registerAckCallback(e,t){let n=this.flags.timeout;if(n===void 0){this.acks.set(e,t);return}let i=setTimeout(()=>{St("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,(...s)=>{clearTimeout(i),t.apply(this,[null,...s])})}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=t.compress!==!1,this.client._packet(e,t)}join(e){return St("join room %s",e),this.adapter.addAll(this.id,new Set(Array.isArray(e)?e:[e]))}leave(e){return St("leave room %s",e),this.adapter.del(this.id,e)}leaveAll(){this.adapter.delAll(this.id)}_onconnect(){St("socket connected - writing packet"),this.connected=!0,this.join(this.id),this.conn.protocol===3?this.packet({type:lr.PacketType.CONNECT}):this.packet({type:lr.PacketType.CONNECT,data:{sid:this.id,pid:this.pid}})}_onpacket(e){switch(St("got packet %j",e),e.type){case lr.PacketType.EVENT:this.onevent(e);break;case lr.PacketType.BINARY_EVENT:this.onevent(e);break;case lr.PacketType.ACK:this.onack(e);break;case lr.PacketType.BINARY_ACK:this.onack(e);break;case lr.PacketType.DISCONNECT:this.ondisconnect();break}}onevent(e){let t=e.data||[];if(St("emitting event %j",t),e.id!=null&&(St("attaching ack callback to event"),t.push(this.ack(e.id))),this._anyListeners&&this._anyListeners.length){let n=this._anyListeners.slice();for(let i of n)i.apply(this,t)}this.dispatch(t)}ack(e){let t=this,n=!1;return function(){if(n)return;let i=Array.prototype.slice.call(arguments);St("sending ack %j",i),t.packet({id:e,type:lr.PacketType.ACK,data:i}),n=!0}}onack(e){let t=this.acks.get(e.id);typeof t=="function"?(St("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),this.acks.delete(e.id)):St("bad ack %s",e.id)}ondisconnect(){St("got disconnect packet"),this._onclose("client namespace disconnect")}_onerror(e){this.emitReserved("error",e)}_onclose(e,t){if(!this.connected)return this;St("closing socket - reason %s",e),this.emitReserved("disconnecting",e,t),this.server._opts.connectionStateRecovery&&WD.has(e)&&(St("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=u_}_error(e){this.packet({type:lr.PacketType.CONNECT_ERROR,data:e})}disconnect(e=!1){return this.connected?(e?this.client._disconnect():(this.packet({type:lr.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){St("dispatching an event %j",e),this.run(e,t=>{process.nextTick(()=>{if(t)return this._onerror(t);this.connected?super.emitUntyped.apply(this,e):St("ignore packet received after disconnection")})})}use(e){return this.fns.push(e),this}run(e,t){if(!this.fns.length)return t();let n=this.fns.slice(0);function i(s){n[s](e,o=>{if(o)return t(o);if(!n[s+1])return t();i(s+1)})}i(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){let 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){let 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){let t=this._anyOutgoingListeners.slice();for(let n of t)n.apply(this,e.data)}}newBroadcastOperator(){let e=Object.assign({},this.flags);return this.flags={},new UD.BroadcastOperator(this.adapter,new Set,new Set([this.id]),e)}};os.Socket=hd});var vd=A(un=>{"use strict";var GD=un&&un.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(un,"__esModule",{value:!0});un.Namespace=un.RESERVED_EVENTS=void 0;var f_=md(),zD=Uc(),VD=GD(Ae()),Xt=dd(),as=(0,VD.default)("socket.io:namespace");un.RESERVED_EVENTS=new Set(["connect","connection","new_namespace"]);var gd=class extends zD.StrictEventEmitter{constructor(e,t){super(),this.sockets=new Map,this._preConnectSockets=new Map,this._fns=[],this._ids=0,this.server=e,this.name=t,this._initAdapter()}_initAdapter(){this.adapter=new(this.server.adapter())(this),Promise.resolve(this.adapter.init()).catch(e=>{as("error while initializing adapter: %s",e)})}use(e){return this._fns.push(e),this}run(e,t){if(!this._fns.length)return t();let n=this._fns.slice(0);function i(s){n[s](e,o=>{if(o)return t(o);if(!n[s+1])return t();i(s+1)})}i(0)}to(e){return new Xt.BroadcastOperator(this.adapter).to(e)}in(e){return new Xt.BroadcastOperator(this.adapter).in(e)}except(e){return new Xt.BroadcastOperator(this.adapter).except(e)}async _add(e,t,n){var i;as("adding socket to nsp %s",this.name);let s=await this._createSocket(e,t);if(this._preConnectSockets.set(s.id,s),!((i=this.server.opts.connectionStateRecovery)===null||i===void 0)&&i.skipMiddlewares&&s.recovered&&e.conn.readyState==="open")return this._doConnect(s,n);this.run(s,o=>{process.nextTick(()=>{if(e.conn.readyState!=="open"){as("next called after client was closed - ignoring socket"),s._cleanup();return}if(o)return as("middleware error, sending CONNECT_ERROR packet to the client"),s._cleanup(),e.conn.protocol===3?s._error(o.data||o.message):s._error({message:o.message,data:o.data});this._doConnect(s,n)})})}async _createSocket(e,t){let n=t.pid,i=t.offset;if(this.server.opts.connectionStateRecovery&&typeof n=="string"&&typeof i=="string"){let s;try{s=await this.adapter.restoreSession(n,i)}catch(o){as("error while restoring session: %s",o)}if(s)return as("connection state recovered for sid %s",s.sid),new f_.Socket(this,e,t,s)}return new f_.Socket(this,e,t)}_doConnect(e,t){this._preConnectSockets.delete(e.id),this.sockets.set(e.id,e),e._onconnect(),t&&t(e),this.emitReserved("connect",e),this.emitReserved("connection",e)}_remove(e){this.sockets.delete(e.id)||this._preConnectSockets.delete(e.id)}emit(e,...t){return new Xt.BroadcastOperator(this.adapter).emit(e,...t)}send(...e){return this.emit("message",...e),this}write(...e){return this.emit("message",...e),this}serverSideEmit(e,...t){if(un.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);return t.unshift(e),this.adapter.serverSideEmit(t),!0}serverSideEmitWithAck(e,...t){return new Promise((n,i)=>{t.push((s,o)=>s?(s.responses=o,i(s)):n(o)),this.serverSideEmit(e,...t)})}_onServerSideEmit(e){super.emitUntyped.apply(this,e)}allSockets(){return new Xt.BroadcastOperator(this.adapter).allSockets()}compress(e){return new Xt.BroadcastOperator(this.adapter).compress(e)}get volatile(){return new Xt.BroadcastOperator(this.adapter).volatile}get local(){return new Xt.BroadcastOperator(this.adapter).local}timeout(e){return new Xt.BroadcastOperator(this.adapter).timeout(e)}fetchSockets(){return new Xt.BroadcastOperator(this.adapter).fetchSockets()}socketsJoin(e){return new Xt.BroadcastOperator(this.adapter).socketsJoin(e)}socketsLeave(e){return new Xt.BroadcastOperator(this.adapter).socketsLeave(e)}disconnectSockets(e=!1){return new Xt.BroadcastOperator(this.adapter).disconnectSockets(e)}};un.Namespace=gd});var v_=A(Ro=>{"use strict";Object.defineProperty(Ro,"__esModule",{value:!0});Ro.encode=yd;Ro.decode=KD;Ro.yeast=YD;var m_="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),zc=64,g_={},d_=0,jn=0,h_;function yd(r){let e="";do e=m_[r%zc]+e,r=Math.floor(r/zc);while(r>0);return e}function KD(r){let e=0;for(jn=0;jn<r.length;jn++)e=e*zc+g_[r.charAt(jn)];return e}function YD(){let r=yd(+new Date);return r!==h_?(d_=0,h_=r):r+"."+yd(d_++)}for(;jn<zc;jn++)g_[m_[jn]]=jn});var pn=A((e8,__)=>{"use strict";var y_=["nodebuffer","arraybuffer","fragments"],x_=typeof Blob<"u";x_&&y_.push("blob");__.exports={BINARY_TYPES:y_,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:x_,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Oo=A((t8,Vc)=>{"use strict";var{EMPTY_BUFFER:JD}=pn(),xd=Buffer[Symbol.species];function XD(r,e){if(r.length===0)return JD;if(r.length===1)return r[0];let t=Buffer.allocUnsafe(e),n=0;for(let i=0;i<r.length;i++){let s=r[i];t.set(s,n),n+=s.length}return n<e?new xd(t.buffer,t.byteOffset,n):t}function b_(r,e,t,n,i){for(let s=0;s<i;s++)t[n+s]=r[s]^e[s&3]}function w_(r,e){for(let t=0;t<r.length;t++)r[t]^=e[t&3]}function ZD(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function _d(r){if(_d.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new xd(r):ArrayBuffer.isView(r)?e=new xd(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),_d.readOnly=!1),e}Vc.exports={concat:XD,mask:b_,toArrayBuffer:ZD,toBuffer:_d,unmask:w_};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=Ef();Vc.exports.mask=function(e,t,n,i,s){s<48?b_(e,t,n,i,s):r.mask(e,t,n,i,s)},Vc.exports.unmask=function(e,t){e.length<32?w_(e,t):r.unmask(e,t)}}catch{}});var T_=A((r8,E_)=>{"use strict";var S_=Symbol("kDone"),bd=Symbol("kRun"),wd=class{constructor(e){this[S_]=()=>{this.pending--,this[bd]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[bd]()}[bd](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[S_])}}};E_.exports=wd});var Po=A((n8,R_)=>{"use strict";var Mo=require("zlib"),C_=Oo(),QD=T_(),{kStatusCode:k_}=pn(),eL=Buffer[Symbol.species],tL=Buffer.from([0,0,255,255]),Yc=Symbol("permessage-deflate"),fn=Symbol("total-length"),cs=Symbol("callback"),Fn=Symbol("buffers"),ls=Symbol("error"),Kc,Sd=class{constructor(e,t,n){if(this._maxPayload=n|0,this._options=e||{},this._threshold=this._options.threshold!==void 0?this._options.threshold:1024,this._isServer=!!t,this._deflate=null,this._inflate=null,this.params=null,!Kc){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Kc=new QD(i)}}static get extensionName(){return"permessage-deflate"}offer(){let 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:this._options.clientMaxWindowBits==null&&(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){let e=this._deflate[cs];this._deflate.close(),this._deflate=null,e&&e(new Error("The deflate stream was closed while data was being processed"))}}acceptAsServer(e){let t=this._options,n=e.find(i=>!(t.serverNoContextTakeover===!1&&i.server_no_context_takeover||i.server_max_window_bits&&(t.serverMaxWindowBits===!1||typeof t.serverMaxWindowBits=="number"&&t.serverMaxWindowBits>i.server_max_window_bits)||typeof t.clientMaxWindowBits=="number"&&!i.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),typeof t.serverMaxWindowBits=="number"&&(n.server_max_window_bits=t.serverMaxWindowBits),typeof t.clientMaxWindowBits=="number"?n.client_max_window_bits=t.clientMaxWindowBits:(n.client_max_window_bits===!0||t.clientMaxWindowBits===!1)&&delete n.client_max_window_bits,n}acceptAsClient(e){let t=e[0];if(this._options.clientNoContextTakeover===!1&&t.client_no_context_takeover)throw new Error('Unexpected parameter "client_no_context_takeover"');if(!t.client_max_window_bits)typeof this._options.clientMaxWindowBits=="number"&&(t.client_max_window_bits=this._options.clientMaxWindowBits);else if(this._options.clientMaxWindowBits===!1||typeof this._options.clientMaxWindowBits=="number"&&t.client_max_window_bits>this._options.clientMaxWindowBits)throw new Error('Unexpected or invalid parameter "client_max_window_bits"');return t}normalizeParams(e){return e.forEach(t=>{Object.keys(t).forEach(n=>{let i=t[n];if(i.length>1)throw new Error(`Parameter "${n}" must have only a single value`);if(i=i[0],n==="client_max_window_bits"){if(i!==!0){let s=+i;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=s}else if(!this._isServer)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else if(n==="server_max_window_bits"){let s=+i;if(!Number.isInteger(s)||s<8||s>15)throw new TypeError(`Invalid value for parameter "${n}": ${i}`);i=s}else if(n==="client_no_context_takeover"||n==="server_no_context_takeover"){if(i!==!0)throw new TypeError(`Invalid value for parameter "${n}": ${i}`)}else throw new Error(`Unknown parameter "${n}"`);t[n]=i})}),e}decompress(e,t,n){Kc.add(i=>{this._decompress(e,t,(s,o)=>{i(),n(s,o)})})}compress(e,t,n){Kc.add(i=>{this._compress(e,t,(s,o)=>{i(),n(s,o)})})}_decompress(e,t,n){let i=this._isServer?"client":"server";if(!this._inflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?Mo.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=Mo.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[Yc]=this,this._inflate[fn]=0,this._inflate[Fn]=[],this._inflate.on("error",nL),this._inflate.on("data",A_)}this._inflate[cs]=n,this._inflate.write(e),t&&this._inflate.write(tL),this._inflate.flush(()=>{let s=this._inflate[ls];if(s){this._inflate.close(),this._inflate=null,n(s);return}let o=C_.concat(this._inflate[Fn],this._inflate[fn]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[fn]=0,this._inflate[Fn]=[],t&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),n(null,o)})}_compress(e,t,n){let i=this._isServer?"server":"client";if(!this._deflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?Mo.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=Mo.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[fn]=0,this._deflate[Fn]=[],this._deflate.on("data",rL)}this._deflate[cs]=n,this._deflate.write(e),this._deflate.flush(Mo.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=C_.concat(this._deflate[Fn],this._deflate[fn]);t&&(s=new eL(s.buffer,s.byteOffset,s.length-4)),this._deflate[cs]=null,this._deflate[fn]=0,this._deflate[Fn]=[],t&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,s)})}};R_.exports=Sd;function rL(r){this[Fn].push(r),this[fn]+=r.length}function A_(r){if(this[fn]+=r.length,this[Yc]._maxPayload<1||this[fn]<=this[Yc]._maxPayload){this[Fn].push(r);return}this[ls]=new RangeError("Max payload size exceeded"),this[ls].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[ls][k_]=1009,this.removeListener("data",A_),this.reset()}function nL(r){if(this[Yc]._inflate=null,this[ls]){this[cs](this[ls]);return}r[k_]=1007,this[cs](r)}});var us=A((i8,Jc)=>{"use strict";var{isUtf8:O_}=require("buffer"),{hasBlob:iL}=pn(),sL=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,0];function oL(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function Ed(r){let e=r.length,t=0;for(;t<e;)if((r[t]&128)===0)t++;else if((r[t]&224)===192){if(t+1===e||(r[t+1]&192)!==128||(r[t]&254)===192)return!1;t+=2}else if((r[t]&240)===224){if(t+2>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||r[t]===224&&(r[t+1]&224)===128||r[t]===237&&(r[t+1]&224)===160)return!1;t+=3}else if((r[t]&248)===240){if(t+3>=e||(r[t+1]&192)!==128||(r[t+2]&192)!==128||(r[t+3]&192)!==128||r[t]===240&&(r[t+1]&240)===128||r[t]===244&&r[t+1]>143||r[t]>244)return!1;t+=4}else return!1;return!0}function aL(r){return iL&&typeof r=="object"&&typeof r.arrayBuffer=="function"&&typeof r.type=="string"&&typeof r.stream=="function"&&(r[Symbol.toStringTag]==="Blob"||r[Symbol.toStringTag]==="File")}Jc.exports={isBlob:aL,isValidStatusCode:oL,isValidUTF8:Ed,tokenChars:sL};if(O_)Jc.exports.isValidUTF8=function(r){return r.length<24?Ed(r):O_(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=Mf();Jc.exports.isValidUTF8=function(e){return e.length<32?Ed(e):r(e)}}catch{}});var Rd=A((s8,B_)=>{"use strict";var{Writable:cL}=require("stream"),M_=Po(),{BINARY_TYPES:lL,EMPTY_BUFFER:P_,kStatusCode:uL,kWebSocket:pL}=pn(),{concat:Td,toArrayBuffer:fL,unmask:dL}=Oo(),{isValidStatusCode:hL,isValidUTF8:I_}=us(),Xc=Buffer[Symbol.species],ur=0,N_=1,D_=2,L_=3,Cd=4,kd=5,Zc=6,Ad=class extends cL{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||lL[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[pL]=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=ur}_write(e,t,n){if(this._opcode===8&&this._state==ur)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){let n=this._buffers[0];return this._buffers[0]=new Xc(n.buffer,n.byteOffset+e,n.length-e),new Xc(n.buffer,n.byteOffset,e)}let t=Buffer.allocUnsafe(e);do{let n=this._buffers[0],i=t.length-e;e>=n.length?t.set(this._buffers.shift(),i):(t.set(new Uint8Array(n.buffer,n.byteOffset,e),i),this._buffers[0]=new Xc(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 ur:this.getInfo(e);break;case N_:this.getPayloadLength16(e);break;case D_:this.getPayloadLength64(e);break;case L_:this.getMask();break;case Cd:this.getData(e);break;case kd:case Zc:this._loop=!1;return}while(this._loop);this._errored||e()}getInfo(e){if(this._bufferedBytes<2){this._loop=!1;return}let t=this.consume(2);if((t[0]&48)!==0){let i=this.createError(RangeError,"RSV2 and RSV3 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_2_3");e(i);return}let n=(t[0]&64)===64;if(n&&!this._extensions[M_.extensionName]){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._fin=(t[0]&128)===128,this._opcode=t[0]&15,this._payloadLength=t[1]&127,this._opcode===0){if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(!this._fragmented){let i=this.createError(RangeError,"invalid opcode 0",!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._opcode=this._fragmented}else if(this._opcode===1||this._opcode===2){if(this._fragmented){let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}this._compressed=n}else if(this._opcode>7&&this._opcode<11){if(!this._fin){let i=this.createError(RangeError,"FIN must be set",!0,1002,"WS_ERR_EXPECTED_FIN");e(i);return}if(n){let i=this.createError(RangeError,"RSV1 must be clear",!0,1002,"WS_ERR_UNEXPECTED_RSV_1");e(i);return}if(this._payloadLength>125||this._opcode===8&&this._payloadLength===1){let i=this.createError(RangeError,`invalid payload length ${this._payloadLength}`,!0,1002,"WS_ERR_INVALID_CONTROL_PAYLOAD_LENGTH");e(i);return}}else{let i=this.createError(RangeError,`invalid opcode ${this._opcode}`,!0,1002,"WS_ERR_INVALID_OPCODE");e(i);return}if(!this._fin&&!this._fragmented&&(this._fragmented=this._opcode),this._masked=(t[1]&128)===128,this._isServer){if(!this._masked){let i=this.createError(RangeError,"MASK must be set",!0,1002,"WS_ERR_EXPECTED_MASK");e(i);return}}else if(this._masked){let i=this.createError(RangeError,"MASK must be clear",!0,1002,"WS_ERR_UNEXPECTED_MASK");e(i);return}this._payloadLength===126?this._state=N_:this._payloadLength===127?this._state=D_:this.haveLength(e)}getPayloadLength16(e){if(this._bufferedBytes<2){this._loop=!1;return}this._payloadLength=this.consume(2).readUInt16BE(0),this.haveLength(e)}getPayloadLength64(e){if(this._bufferedBytes<8){this._loop=!1;return}let t=this.consume(8),n=t.readUInt32BE(0);if(n>Math.pow(2,21)-1){let i=this.createError(RangeError,"Unsupported WebSocket frame: payload length > 2^53 - 1",!1,1009,"WS_ERR_UNSUPPORTED_DATA_PAYLOAD_LENGTH");e(i);return}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)){let t=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");e(t);return}this._masked?this._state=L_:this._state=Cd}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Cd}getData(e){let t=P_;if(this._payloadLength){if(this._bufferedBytes<this._payloadLength){this._loop=!1;return}t=this.consume(this._payloadLength),this._masked&&(this._mask[0]|this._mask[1]|this._mask[2]|this._mask[3])!==0&&dL(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=kd,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[M_.extensionName].decompress(e,this._fin,(i,s)=>{if(i)return t(i);if(s.length){if(this._messageLength+=s.length,this._messageLength>this._maxPayload&&this._maxPayload>0){let o=this.createError(RangeError,"Max payload size exceeded",!1,1009,"WS_ERR_UNSUPPORTED_MESSAGE_LENGTH");t(o);return}this._fragments.push(s)}this.dataMessage(t),this._state===ur&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=ur;return}let t=this._messageLength,n=this._fragments;if(this._totalPayloadLength=0,this._messageLength=0,this._fragmented=0,this._fragments=[],this._opcode===2){let i;this._binaryType==="nodebuffer"?i=Td(n,t):this._binaryType==="arraybuffer"?i=fL(Td(n,t)):this._binaryType==="blob"?i=new Blob(n):i=n,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=ur):(this._state=Zc,setImmediate(()=>{this.emit("message",i,!0),this._state=ur,this.startLoop(e)}))}else{let i=Td(n,t);if(!this._skipUTF8Validation&&!I_(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(s);return}this._state===kd||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=ur):(this._state=Zc,setImmediate(()=>{this.emit("message",i,!1),this._state=ur,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,P_),this.end();else{let n=e.readUInt16BE(0);if(!hL(n)){let s=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(s);return}let i=new Xc(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!I_(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(s);return}this._loop=!1,this.emit("conclude",n,i),this.end()}this._state=ur;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=ur):(this._state=Zc,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=ur,this.startLoop(t)}))}createError(e,t,n,i,s){this._loop=!1,this._errored=!0;let o=new e(n?`Invalid WebSocket frame: ${t}`:t);return Error.captureStackTrace(o,this.createError),o.code=s,o[uL]=i,o}};B_.exports=Ad});var Pd=A((a8,H_)=>{"use strict";var{Duplex:o8}=require("stream"),{randomFillSync:mL}=require("crypto"),j_=Po(),{EMPTY_BUFFER:gL,kWebSocket:vL,NOOP:yL}=pn(),{isBlob:ps,isValidStatusCode:xL}=us(),{mask:F_,toBuffer:ai}=Oo(),pr=Symbol("kByteLength"),_L=Buffer.alloc(4),Qc=8*1024,ci,fs=Qc,Ar=0,bL=1,wL=2,Od=class r{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._queue=[],this._state=Ar,this.onerror=yL,this[vL]=void 0}static frame(e,t){let n,i=!1,s=2,o=!1;t.mask&&(n=t.maskBuffer||_L,t.generateMask?t.generateMask(n):(fs===Qc&&(ci===void 0&&(ci=Buffer.alloc(Qc)),mL(ci,0,Qc),fs=0),n[0]=ci[fs++],n[1]=ci[fs++],n[2]=ci[fs++],n[3]=ci[fs++]),o=(n[0]|n[1]|n[2]|n[3])===0,s=6);let a;typeof e=="string"?(!t.mask||o)&&t[pr]!==void 0?a=t[pr]:(e=Buffer.from(e),a=e.length):(a=e.length,i=t.mask&&t.readOnly&&!o);let c=a;a>=65536?(s+=8,c=127):a>125&&(s+=2,c=126);let l=Buffer.allocUnsafe(i?a+s:s);return l[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(l[0]|=64),l[1]=c,c===126?l.writeUInt16BE(a,2):c===127&&(l[2]=l[3]=0,l.writeUIntBE(a,4,6)),t.mask?(l[1]|=128,l[s-4]=n[0],l[s-3]=n[1],l[s-2]=n[2],l[s-1]=n[3],o?[l,e]:i?(F_(e,n,l,s,a),[l]):(F_(e,n,e,0,a),[l,e])):[l,e]}close(e,t,n,i){let s;if(e===void 0)s=gL;else{if(typeof e!="number"||!xL(e))throw new TypeError("First argument must be a valid error code number");if(t===void 0||!t.length)s=Buffer.allocUnsafe(2),s.writeUInt16BE(e,0);else{let a=Buffer.byteLength(t);if(a>123)throw new RangeError("The message must not be greater than 123 bytes");s=Buffer.allocUnsafe(2+a),s.writeUInt16BE(e,0),typeof t=="string"?s.write(t,2):s.set(t,2)}}let o={[pr]:s.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Ar?this.enqueue([this.dispatch,s,!1,o,i]):this.sendFrame(r.frame(s,o),i)}ping(e,t,n){let i,s;if(typeof e=="string"?(i=Buffer.byteLength(e),s=!1):ps(e)?(i=e.size,s=!1):(e=ai(e),i=e.length,s=ai.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[pr]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};ps(e)?this._state!==Ar?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Ar?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}pong(e,t,n){let i,s;if(typeof e=="string"?(i=Buffer.byteLength(e),s=!1):ps(e)?(i=e.size,s=!1):(e=ai(e),i=e.length,s=ai.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[pr]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};ps(e)?this._state!==Ar?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Ar?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}send(e,t,n){let i=this._extensions[j_.extensionName],s=t.binary?2:1,o=t.compress,a,c;typeof e=="string"?(a=Buffer.byteLength(e),c=!1):ps(e)?(a=e.size,c=!1):(e=ai(e),a=e.length,c=ai.readOnly),this._firstFragment?(this._firstFragment=!1,o&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=a>=i._threshold),this._compress=o):(o=!1,s=0),t.fin&&(this._firstFragment=!0);let l={[pr]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:c,rsv1:o};ps(e)?this._state!==Ar?this.enqueue([this.getBlobData,e,this._compress,l,n]):this.getBlobData(e,this._compress,l,n):this._state!==Ar?this.enqueue([this.dispatch,e,this._compress,l,n]):this.dispatch(e,this._compress,l,n)}getBlobData(e,t,n,i){this._bufferedBytes+=n[pr],this._state=wL,e.arrayBuffer().then(s=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(Md,this,a,i);return}this._bufferedBytes-=n[pr];let o=ai(s);t?this.dispatch(o,t,n,i):(this._state=Ar,this.sendFrame(r.frame(o,n),i),this.dequeue())}).catch(s=>{process.nextTick(SL,this,s,i)})}dispatch(e,t,n,i){if(!t){this.sendFrame(r.frame(e,n),i);return}let s=this._extensions[j_.extensionName];this._bufferedBytes+=n[pr],this._state=bL,s.compress(e,n.fin,(o,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");Md(this,c,i);return}this._bufferedBytes-=n[pr],this._state=Ar,n.readOnly=!1,this.sendFrame(r.frame(a,n),i),this.dequeue()})}dequeue(){for(;this._state===Ar&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][pr],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][pr],this._queue.push(e)}sendFrame(e,t){e.length===2?(this._socket.cork(),this._socket.write(e[0]),this._socket.write(e[1],t),this._socket.uncork()):this._socket.write(e[0],t)}};H_.exports=Od;function Md(r,e,t){typeof t=="function"&&t(e);for(let n=0;n<r._queue.length;n++){let i=r._queue[n],s=i[i.length-1];typeof s=="function"&&s(e)}}function SL(r,e,t){Md(r,e,t),r.onerror(e)}});var Y_=A((c8,K_)=>{"use strict";var{kForOnEventAttribute:Io,kListener:Id}=pn(),q_=Symbol("kCode"),U_=Symbol("kData"),$_=Symbol("kError"),W_=Symbol("kMessage"),G_=Symbol("kReason"),ds=Symbol("kTarget"),z_=Symbol("kType"),V_=Symbol("kWasClean"),dn=class{constructor(e){this[ds]=null,this[z_]=e}get target(){return this[ds]}get type(){return this[z_]}};Object.defineProperty(dn.prototype,"target",{enumerable:!0});Object.defineProperty(dn.prototype,"type",{enumerable:!0});var li=class extends dn{constructor(e,t={}){super(e),this[q_]=t.code===void 0?0:t.code,this[G_]=t.reason===void 0?"":t.reason,this[V_]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[q_]}get reason(){return this[G_]}get wasClean(){return this[V_]}};Object.defineProperty(li.prototype,"code",{enumerable:!0});Object.defineProperty(li.prototype,"reason",{enumerable:!0});Object.defineProperty(li.prototype,"wasClean",{enumerable:!0});var hs=class extends dn{constructor(e,t={}){super(e),this[$_]=t.error===void 0?null:t.error,this[W_]=t.message===void 0?"":t.message}get error(){return this[$_]}get message(){return this[W_]}};Object.defineProperty(hs.prototype,"error",{enumerable:!0});Object.defineProperty(hs.prototype,"message",{enumerable:!0});var No=class extends dn{constructor(e,t={}){super(e),this[U_]=t.data===void 0?null:t.data}get data(){return this[U_]}};Object.defineProperty(No.prototype,"data",{enumerable:!0});var EL={addEventListener(r,e,t={}){for(let i of this.listeners(r))if(!t[Io]&&i[Id]===e&&!i[Io])return;let n;if(r==="message")n=function(s,o){let a=new No("message",{data:o?s:s.toString()});a[ds]=this,el(e,this,a)};else if(r==="close")n=function(s,o){let a=new li("close",{code:s,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[ds]=this,el(e,this,a)};else if(r==="error")n=function(s){let o=new hs("error",{error:s,message:s.message});o[ds]=this,el(e,this,o)};else if(r==="open")n=function(){let s=new dn("open");s[ds]=this,el(e,this,s)};else return;n[Io]=!!t[Io],n[Id]=e,t.once?this.once(r,n):this.on(r,n)},removeEventListener(r,e){for(let t of this.listeners(r))if(t[Id]===e&&!t[Io]){this.removeListener(r,t);break}}};K_.exports={CloseEvent:li,ErrorEvent:hs,Event:dn,EventTarget:EL,MessageEvent:No};function el(r,e,t){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,t):r.call(e,t)}});var Nd=A((l8,J_)=>{"use strict";var{tokenChars:Do}=us();function qr(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}function TL(r){let e=Object.create(null),t=Object.create(null),n=!1,i=!1,s=!1,o,a,c=-1,l=-1,u=-1,f=0;for(;f<r.length;f++)if(l=r.charCodeAt(f),o===void 0)if(u===-1&&Do[l]===1)c===-1&&(c=f);else if(f!==0&&(l===32||l===9))u===-1&&c!==-1&&(u=f);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);u===-1&&(u=f);let g=r.slice(c,u);l===44?(qr(e,g,t),t=Object.create(null)):o=g,c=u=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);else if(a===void 0)if(u===-1&&Do[l]===1)c===-1&&(c=f);else if(l===32||l===9)u===-1&&c!==-1&&(u=f);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);u===-1&&(u=f),qr(t,r.slice(c,u),!0),l===44&&(qr(e,o,t),t=Object.create(null),o=void 0),c=u=-1}else if(l===61&&c!==-1&&u===-1)a=r.slice(c,f),c=u=-1;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(i){if(Do[l]!==1)throw new SyntaxError(`Unexpected character at index ${f}`);c===-1?c=f:n||(n=!0),i=!1}else if(s)if(Do[l]===1)c===-1&&(c=f);else if(l===34&&c!==-1)s=!1,u=f;else if(l===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(l===34&&r.charCodeAt(f-1)===61)s=!0;else if(u===-1&&Do[l]===1)c===-1&&(c=f);else if(c!==-1&&(l===32||l===9))u===-1&&(u=f);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);u===-1&&(u=f);let g=r.slice(c,u);n&&(g=g.replace(/\\/g,""),n=!1),qr(t,a,g),l===44&&(qr(e,o,t),t=Object.create(null),o=void 0),a=void 0,c=u=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);if(c===-1||s||l===32||l===9)throw new SyntaxError("Unexpected end of input");u===-1&&(u=f);let h=r.slice(c,u);return o===void 0?qr(e,h,t):(a===void 0?qr(t,h,!0):n?qr(t,a,h.replace(/\\/g,"")):qr(t,a,h),qr(e,o,t)),e}function CL(r){return Object.keys(r).map(e=>{let t=r[e];return Array.isArray(t)||(t=[t]),t.map(n=>[e].concat(Object.keys(n).map(i=>{let s=n[i];return Array.isArray(s)||(s=[s]),s.map(o=>o===!0?i:`${i}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}J_.exports={format:CL,parse:TL}});var il=A((f8,cb)=>{"use strict";var kL=require("events"),AL=require("https"),RL=require("http"),Q_=require("net"),OL=require("tls"),{randomBytes:ML,createHash:PL}=require("crypto"),{Duplex:u8,Readable:p8}=require("stream"),{URL:Dd}=require("url"),Hn=Po(),IL=Rd(),NL=Pd(),{isBlob:DL}=us(),{BINARY_TYPES:X_,EMPTY_BUFFER:tl,GUID:LL,kForOnEventAttribute:Ld,kListener:BL,kStatusCode:jL,kWebSocket:vt,NOOP:eb}=pn(),{EventTarget:{addEventListener:FL,removeEventListener:HL}}=Y_(),{format:qL,parse:UL}=Nd(),{toBuffer:$L}=Oo(),WL=30*1e3,tb=Symbol("kAborted"),Bd=[8,13],hn=["CONNECTING","OPEN","CLOSING","CLOSED"],GL=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Se=class r extends kL{constructor(e,t,n){super(),this._binaryType=X_[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=tl,this._closeTimer=null,this._errorEmitted=!1,this._extensions={},this._paused=!1,this._protocol="",this._readyState=r.CONNECTING,this._receiver=null,this._sender=null,this._socket=null,e!==null?(this._bufferedAmount=0,this._isServer=!1,this._redirects=0,t===void 0?t=[]:Array.isArray(t)||(typeof t=="object"&&t!==null?(n=t,t=[]):t=[t]),rb(this,e,t,n)):(this._autoPong=n.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){X_.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(e,t,n){let i=new IL({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),s=new NL(e,this._extensions,n.generateMask);this._receiver=i,this._sender=s,this._socket=e,i[vt]=this,s[vt]=this,e[vt]=this,i.on("conclude",KL),i.on("drain",YL),i.on("error",JL),i.on("message",XL),i.on("ping",ZL),i.on("pong",QL),s.onerror=e2,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",sb),e.on("data",nl),e.on("end",ob),e.on("error",ab),this._readyState=r.OPEN,this.emit("open")}emitClose(){if(!this._socket){this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage);return}this._extensions[Hn.extensionName]&&this._extensions[Hn.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){Zt(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===r.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=r.CLOSING,this._sender.close(e,t,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),ib(this)}}pause(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!0,this._socket.pause())}ping(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=t=void 0):typeof t=="function"&&(n=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){jd(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||tl,t,n)}pong(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof e=="function"?(n=e,e=t=void 0):typeof t=="function"&&(n=t,t=void 0),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){jd(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||tl,t,n)}resume(){this.readyState===r.CONNECTING||this.readyState===r.CLOSED||(this._paused=!1,this._receiver._writableState.needDrain||this._socket.resume())}send(e,t,n){if(this.readyState===r.CONNECTING)throw new Error("WebSocket is not open: readyState 0 (CONNECTING)");if(typeof t=="function"&&(n=t,t={}),typeof e=="number"&&(e=e.toString()),this.readyState!==r.OPEN){jd(this,e,n);return}let i={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[Hn.extensionName]||(i.compress=!1),this._sender.send(e||tl,i,n)}terminate(){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){Zt(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=r.CLOSING,this._socket.destroy())}}};Object.defineProperty(Se,"CONNECTING",{enumerable:!0,value:hn.indexOf("CONNECTING")});Object.defineProperty(Se.prototype,"CONNECTING",{enumerable:!0,value:hn.indexOf("CONNECTING")});Object.defineProperty(Se,"OPEN",{enumerable:!0,value:hn.indexOf("OPEN")});Object.defineProperty(Se.prototype,"OPEN",{enumerable:!0,value:hn.indexOf("OPEN")});Object.defineProperty(Se,"CLOSING",{enumerable:!0,value:hn.indexOf("CLOSING")});Object.defineProperty(Se.prototype,"CLOSING",{enumerable:!0,value:hn.indexOf("CLOSING")});Object.defineProperty(Se,"CLOSED",{enumerable:!0,value:hn.indexOf("CLOSED")});Object.defineProperty(Se.prototype,"CLOSED",{enumerable:!0,value:hn.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(Se.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(Se.prototype,`on${r}`,{enumerable:!0,get(){for(let e of this.listeners(r))if(e[Ld])return e[BL];return null},set(e){for(let t of this.listeners(r))if(t[Ld]){this.removeListener(r,t);break}typeof e=="function"&&this.addEventListener(r,e,{[Ld]:!0})}})});Se.prototype.addEventListener=FL;Se.prototype.removeEventListener=HL;cb.exports=Se;function rb(r,e,t,n){let i={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:Bd[1],maxPayload:104857600,skipUTF8Validation:!1,perMessageDeflate:!0,followRedirects:!1,maxRedirects:10,...n,socketPath:void 0,hostname:void 0,protocol:void 0,timeout:void 0,method:"GET",host:void 0,path:void 0,port:void 0};if(r._autoPong=i.autoPong,!Bd.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${Bd.join(", ")})`);let s;if(e instanceof Dd)s=e;else try{s=new Dd(e)}catch{throw new SyntaxError(`Invalid URL: ${e}`)}s.protocol==="http:"?s.protocol="ws:":s.protocol==="https:"&&(s.protocol="wss:"),r._url=s.href;let o=s.protocol==="wss:",a=s.protocol==="ws+unix:",c;if(s.protocol!=="ws:"&&!o&&!a?c=`The URL's protocol must be one of "ws:", "wss:", "http:", "https:", or "ws+unix:"`:a&&!s.pathname?c="The URL's pathname is empty":s.hash&&(c="The URL contains a fragment identifier"),c){let S=new SyntaxError(c);if(r._redirects===0)throw S;rl(r,S);return}let l=o?443:80,u=ML(16).toString("base64"),f=o?AL.request:RL.request,h=new Set,g;if(i.createConnection=i.createConnection||(o?VL:zL),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&&(g=new Hn(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=qL({[Hn.extensionName]:g.offer()})),t.length){for(let S of t){if(typeof S!="string"||!GL.test(S)||h.has(S))throw new SyntaxError("An invalid or duplicated subprotocol was specified");h.add(S)}i.headers["Sec-WebSocket-Protocol"]=t.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){let S=i.path.split(":");i.socketPath=S[0],i.path=S[1]}let x;if(i.followRedirects){if(r._redirects===0){r._originalIpc=a,r._originalSecure=o,r._originalHostOrSocketPath=a?i.socketPath:s.host;let S=n&&n.headers;if(n={...n,headers:{}},S)for(let[C,R]of Object.entries(S))n.headers[C.toLowerCase()]=R}else if(r.listenerCount("redirect")===0){let S=a?r._originalIpc?i.socketPath===r._originalHostOrSocketPath:!1:r._originalIpc?!1:s.host===r._originalHostOrSocketPath;(!S||r._originalSecure&&!o)&&(delete i.headers.authorization,delete i.headers.cookie,S||delete i.headers.host,i.auth=void 0)}i.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),x=r._req=f(i),r._redirects&&r.emit("redirect",r.url,x)}else x=r._req=f(i);i.timeout&&x.on("timeout",()=>{Zt(r,x,"Opening handshake has timed out")}),x.on("error",S=>{x===null||x[tb]||(x=r._req=null,rl(r,S))}),x.on("response",S=>{let C=S.headers.location,R=S.statusCode;if(C&&i.followRedirects&&R>=300&&R<400){if(++r._redirects>i.maxRedirects){Zt(r,x,"Maximum redirects exceeded");return}x.abort();let M;try{M=new Dd(C,e)}catch{let B=new SyntaxError(`Invalid URL: ${C}`);rl(r,B);return}rb(r,M,t,n)}else r.emit("unexpected-response",x,S)||Zt(r,x,`Unexpected server response: ${S.statusCode}`)}),x.on("upgrade",(S,C,R)=>{if(r.emit("upgrade",S),r.readyState!==Se.CONNECTING)return;x=r._req=null;let M=S.headers.upgrade;if(M===void 0||M.toLowerCase()!=="websocket"){Zt(r,C,"Invalid Upgrade header");return}let I=PL("sha1").update(u+LL).digest("base64");if(S.headers["sec-websocket-accept"]!==I){Zt(r,C,"Invalid Sec-WebSocket-Accept header");return}let B=S.headers["sec-websocket-protocol"],V;if(B!==void 0?h.size?h.has(B)||(V="Server sent an invalid subprotocol"):V="Server sent a subprotocol but none was requested":h.size&&(V="Server sent no subprotocol"),V){Zt(r,C,V);return}B&&(r._protocol=B);let F=S.headers["sec-websocket-extensions"];if(F!==void 0){if(!g){Zt(r,C,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let G;try{G=UL(F)}catch{Zt(r,C,"Invalid Sec-WebSocket-Extensions header");return}let D=Object.keys(G);if(D.length!==1||D[0]!==Hn.extensionName){Zt(r,C,"Server indicated an extension that was not requested");return}try{g.accept(G[Hn.extensionName])}catch{Zt(r,C,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[Hn.extensionName]=g}r.setSocket(C,R,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(x,r):x.end()}function rl(r,e){r._readyState=Se.CLOSING,r._errorEmitted=!0,r.emit("error",e),r.emitClose()}function zL(r){return r.path=r.socketPath,Q_.connect(r)}function VL(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=Q_.isIP(r.host)?"":r.host),OL.connect(r)}function Zt(r,e,t){r._readyState=Se.CLOSING;let n=new Error(t);Error.captureStackTrace(n,Zt),e.setHeader?(e[tb]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(rl,r,n)):(e.destroy(n),e.once("error",r.emit.bind(r,"error")),e.once("close",r.emitClose.bind(r)))}function jd(r,e,t){if(e){let n=DL(e)?e.size:$L(e).length;r._socket?r._sender._bufferedBytes+=n:r._bufferedAmount+=n}if(t){let n=new Error(`WebSocket is not open: readyState ${r.readyState} (${hn[r.readyState]})`);process.nextTick(t,n)}}function KL(r,e){let t=this[vt];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=r,t._socket[vt]!==void 0&&(t._socket.removeListener("data",nl),process.nextTick(nb,t._socket),r===1005?t.close():t.close(r,e))}function YL(){let r=this[vt];r.isPaused||r._socket.resume()}function JL(r){let e=this[vt];e._socket[vt]!==void 0&&(e._socket.removeListener("data",nl),process.nextTick(nb,e._socket),e.close(r[jL])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r))}function Z_(){this[vt].emitClose()}function XL(r,e){this[vt].emit("message",r,e)}function ZL(r){let e=this[vt];e._autoPong&&e.pong(r,!this._isServer,eb),e.emit("ping",r)}function QL(r){this[vt].emit("pong",r)}function nb(r){r.resume()}function e2(r){let e=this[vt];e.readyState!==Se.CLOSED&&(e.readyState===Se.OPEN&&(e._readyState=Se.CLOSING,ib(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r)))}function ib(r){r._closeTimer=setTimeout(r._socket.destroy.bind(r._socket),WL)}function sb(){let r=this[vt];this.removeListener("close",sb),this.removeListener("data",nl),this.removeListener("end",ob),r._readyState=Se.CLOSING;let e;!this._readableState.endEmitted&&!r._closeFrameReceived&&!r._receiver._writableState.errorEmitted&&(e=r._socket.read())!==null&&r._receiver.write(e),r._receiver.end(),this[vt]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",Z_),r._receiver.on("finish",Z_))}function nl(r){this[vt]._receiver.write(r)||this.pause()}function ob(){let r=this[vt];r._readyState=Se.CLOSING,r._receiver.end(),this.end()}function ab(){let r=this[vt];this.removeListener("error",ab),this.on("error",eb),r&&(r._readyState=Se.CLOSING,this.destroy())}});var fb=A((h8,pb)=>{"use strict";var d8=il(),{Duplex:t2}=require("stream");function lb(r){r.emit("close")}function r2(){!this.destroyed&&this._writableState.finished&&this.destroy()}function ub(r){this.removeListener("error",ub),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function n2(r,e){let t=!0,n=new t2({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return r.on("message",function(s,o){let a=!o&&n._readableState.objectMode?s.toString():s;n.push(a)||r.pause()}),r.once("error",function(s){n.destroyed||(t=!1,n.destroy(s))}),r.once("close",function(){n.destroyed||n.push(null)}),n._destroy=function(i,s){if(r.readyState===r.CLOSED){s(i),process.nextTick(lb,n);return}let o=!1;r.once("error",function(c){o=!0,s(c)}),r.once("close",function(){o||s(i),process.nextTick(lb,n)}),t&&r.terminate()},n._final=function(i){if(r.readyState===r.CONNECTING){r.once("open",function(){n._final(i)});return}r._socket!==null&&(r._socket._writableState.finished?(i(),n._readableState.endEmitted&&n.destroy()):(r._socket.once("finish",function(){i()}),r.close()))},n._read=function(){r.isPaused&&r.resume()},n._write=function(i,s,o){if(r.readyState===r.CONNECTING){r.once("open",function(){n._write(i,s,o)});return}r.send(i,o)},n.on("end",r2),n.on("error",ub),n}pb.exports=n2});var hb=A((m8,db)=>{"use strict";var{tokenChars:i2}=us();function s2(r){let e=new Set,t=-1,n=-1,i=0;for(i;i<r.length;i++){let o=r.charCodeAt(i);if(n===-1&&i2[o]===1)t===-1&&(t=i);else if(i!==0&&(o===32||o===9))n===-1&&t!==-1&&(n=i);else if(o===44){if(t===-1)throw new SyntaxError(`Unexpected character at index ${i}`);n===-1&&(n=i);let a=r.slice(t,n);if(e.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);e.add(a),t=n=-1}else throw new SyntaxError(`Unexpected character at index ${i}`)}if(t===-1||n!==-1)throw new SyntaxError("Unexpected end of input");let s=r.slice(t,i);if(e.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);return e.add(s),e}db.exports={parse:s2}});var bb=A((v8,_b)=>{"use strict";var o2=require("events"),sl=require("http"),{Duplex:g8}=require("stream"),{createHash:a2}=require("crypto"),mb=Nd(),ui=Po(),c2=hb(),l2=il(),{GUID:u2,kWebSocket:p2}=pn(),f2=/^[+/0-9A-Za-z]{22}==$/,gb=0,vb=1,xb=2,Fd=class extends o2{constructor(e,t){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:l2,...e},e.port==null&&!e.server&&!e.noServer||e.port!=null&&(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(e.port!=null?(this._server=sl.createServer((n,i)=>{let s=sl.STATUS_CODES[426];i.writeHead(426,{"Content-Length":s.length,"Content-Type":"text/plain"}),i.end(s)}),this._server.listen(e.port,e.host,e.backlog,t)):e.server&&(this._server=e.server),this._server){let n=this.emit.bind(this,"connection");this._removeListeners=d2(this._server,{listening:this.emit.bind(this,"listening"),error:this.emit.bind(this,"error"),upgrade:(i,s,o)=>{this.handleUpgrade(i,s,o,n)}})}e.perMessageDeflate===!0&&(e.perMessageDeflate={}),e.clientTracking&&(this.clients=new Set,this._shouldEmitClose=!1),this.options=e,this._state=gb}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(this._state===xb){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(Lo,this);return}if(e&&this.once("close",e),this._state!==vb)if(this._state=vb,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(Lo,this):process.nextTick(Lo,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{Lo(this)})}}shouldHandle(e){if(this.options.path){let t=e.url.indexOf("?");if((t!==-1?e.url.slice(0,t):e.url)!==this.options.path)return!1}return!0}handleUpgrade(e,t,n,i){t.on("error",yb);let s=e.headers["sec-websocket-key"],o=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){pi(this,e,t,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){pi(this,e,t,400,"Invalid Upgrade header");return}if(s===void 0||!f2.test(s)){pi(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){pi(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){Bo(t,400);return}let c=e.headers["sec-websocket-protocol"],l=new Set;if(c!==void 0)try{l=c2.parse(c)}catch{pi(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let u=e.headers["sec-websocket-extensions"],f={};if(this.options.perMessageDeflate&&u!==void 0){let h=new ui(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let g=mb.parse(u);g[ui.extensionName]&&(h.accept(g[ui.extensionName]),f[ui.extensionName]=h)}catch{pi(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let h={origin:e.headers[`${a===8?"sec-websocket-origin":"origin"}`],secure:!!(e.socket.authorized||e.socket.encrypted),req:e};if(this.options.verifyClient.length===2){this.options.verifyClient(h,(g,x,S,C)=>{if(!g)return Bo(t,x||401,S,C);this.completeUpgrade(f,s,l,e,t,n,i)});return}if(!this.options.verifyClient(h))return Bo(t,401)}this.completeUpgrade(f,s,l,e,t,n,i)}completeUpgrade(e,t,n,i,s,o,a){if(!s.readable||!s.writable)return s.destroy();if(s[p2])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>gb)return Bo(s,503);let l=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${a2("sha1").update(t+u2).digest("base64")}`],u=new this.options.WebSocket(null,void 0,this.options);if(n.size){let f=this.options.handleProtocols?this.options.handleProtocols(n,i):n.values().next().value;f&&(l.push(`Sec-WebSocket-Protocol: ${f}`),u._protocol=f)}if(e[ui.extensionName]){let f=e[ui.extensionName].params,h=mb.format({[ui.extensionName]:[f]});l.push(`Sec-WebSocket-Extensions: ${h}`),u._extensions=e}this.emit("headers",l,i),s.write(l.concat(`\r
|
|
24
24
|
`).join(`\r
|
|
25
|
-
`)),s.removeListener("error",
|
|
25
|
+
`)),s.removeListener("error",yb),u.setSocket(s,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(u),u.on("close",()=>{this.clients.delete(u),this._shouldEmitClose&&!this.clients.size&&process.nextTick(Lo,this)})),a(u,i)}};_b.exports=Fd;function d2(r,e){for(let t of Object.keys(e))r.on(t,e[t]);return function(){for(let n of Object.keys(e))r.removeListener(n,e[n])}}function Lo(r){r._state=xb,r.emit("close")}function yb(){this.destroy()}function Bo(r,e,t,n){t=t||sl.STATUS_CODES[e],n={Connection:"close","Content-Type":"text/html","Content-Length":Buffer.byteLength(t),...n},r.once("finish",r.destroy),r.end(`HTTP/1.1 ${e} ${sl.STATUS_CODES[e]}\r
|
|
26
26
|
`+Object.keys(n).map(i=>`${i}: ${n[i]}`).join(`\r
|
|
27
27
|
`)+`\r
|
|
28
28
|
\r
|
|
29
|
-
`+t)}function li(r,e,t,n,i,s){if(r.listenerCount("wsClientError")){let o=new Error(i);Error.captureStackTrace(o,li),r.emit("wsClientError",o,t,e)}else No(t,n,i,s)}});var vb=A((a8,gb)=>{"use strict";var mn=nl();mn.createWebSocketStream=ob();mn.Server=mb();mn.Receiver=kd();mn.Sender=Od();mn.WebSocket=mn;mn.WebSocketServer=mn.Server;gb.exports=mn});var Hd=A(ds=>{"use strict";var jd;Object.defineProperty(ds,"__esModule",{value:!0});ds.SessionAwareAdapter=ds.Adapter=void 0;var s2=require("events"),o2=p_(),sl=vb(),a2=typeof((jd=sl?.Sender)===null||jd===void 0?void 0:jd.frame)=="function",ol=class extends s2.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(let 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){let n=this.rooms.get(e);n!=null&&(n.delete(t)&&this.emit("leave-room",e,t),n.size===0&&this.rooms.delete(e)&&this.emit("delete-room",e))}delAll(e){if(this.sids.has(e)){for(let t of this.sids.get(e))this._del(t,e);this.sids.delete(e)}}broadcast(e,t){let n=t.flags||{},i={preEncoded:!0,volatile:n.volatile,compress:n.compress};e.nsp=this.nsp.name;let s=this._encode(e,i);this.apply(t,o=>{typeof o.notifyOutgoingListeners=="function"&&o.notifyOutgoingListeners(e),o.client.writeToEngine(s,i)})}broadcastWithAck(e,t,n,i){let s=t.flags||{},o={preEncoded:!0,volatile:s.volatile,compress:s.compress};e.nsp=this.nsp.name,e.id=this.nsp._ids++;let a=this._encode(e,o),c=0;this.apply(t,l=>{c++,l.acks.set(e.id,i),typeof l.notifyOutgoingListeners=="function"&&l.notifyOutgoingListeners(e),l.client.writeToEngine(a,o)}),n(c)}_encode(e,t){let n=this.encoder.encode(e);if(a2&&n.length===1&&typeof n[0]=="string"){let i=Buffer.from("4"+n[0]);t.wsPreEncodedFrame=sl.Sender.frame(i,{readOnly:!1,mask:!1,rsv1:!1,opcode:1,fin:!0})}return n}sockets(e){let t=new Set;return this.apply({rooms:e},n=>{t.add(n.id)}),Promise.resolve(t)}socketRooms(e){return this.sids.get(e)}fetchSockets(e){let t=[];return this.apply(e,n=>{t.push(n)}),Promise.resolve(t)}addSockets(e,t){this.apply(e,n=>{n.join(t)})}delSockets(e,t){this.apply(e,n=>{t.forEach(i=>n.leave(i))})}disconnectSockets(e,t){this.apply(e,n=>{n.disconnect(t)})}apply(e,t){let n=e.rooms,i=this.computeExceptSids(e.except);if(n.size){let s=new Set;for(let o of n)if(this.rooms.has(o))for(let a of this.rooms.get(o)){if(s.has(a)||i.has(a))continue;let c=this.nsp.sockets.get(a);c&&(t(c),s.add(a))}}else for(let[s]of this.sids){if(i.has(s))continue;let o=this.nsp.sockets.get(s);o&&t(o)}}computeExceptSids(e){let t=new Set;if(e&&e.size>0)for(let n of e)this.rooms.has(n)&&this.rooms.get(n).forEach(i=>t.add(i));return t}serverSideEmit(e){console.warn("this adapter does not support the serverSideEmit() functionality")}persistSession(e){}restoreSession(e,t){return null}};ds.Adapter=ol;var Fd=class extends ol{constructor(e){super(e),this.nsp=e,this.sessions=new Map,this.packets=[],this.maxDisconnectionDuration=e.server.opts.connectionStateRecovery.maxDisconnectionDuration,setInterval(()=>{let n=Date.now()-this.maxDisconnectionDuration;this.sessions.forEach((i,s)=>{i.disconnectedAt<n&&this.sessions.delete(s)});for(let i=this.packets.length-1;i>=0;i--)if(this.packets[i].emittedAt<n){this.packets.splice(0,i+1);break}},60*1e3).unref()}persistSession(e){e.disconnectedAt=Date.now(),this.sessions.set(e.pid,e)}restoreSession(e,t){let n=this.sessions.get(e);if(!n)return null;if(n.disconnectedAt+this.maxDisconnectionDuration<Date.now())return this.sessions.delete(e),null;let s=this.packets.findIndex(a=>a.id===t);if(s===-1)return null;let o=[];for(let a=s+1;a<this.packets.length;a++){let c=this.packets[a];c2(n.rooms,c.opts)&&o.push(c.data)}return Promise.resolve(Object.assign(Object.assign({},n),{missedPackets:o}))}broadcast(e,t){var n;let i=e.type===2,s=e.id===void 0,o=((n=t.flags)===null||n===void 0?void 0:n.volatile)===void 0;if(i&&s&&o){let a=(0,o2.yeast)();e.data.push(a),this.packets.push({id:a,opts:t,data:e.data,emittedAt:Date.now()})}super.broadcast(e,t)}};ds.SessionAwareAdapter=Fd;function c2(r,e){let t=e.rooms.size===0||r.some(i=>e.rooms.has(i)),n=r.every(i=>!e.except.has(i));return t&&n}});var yb=A(Ur=>{"use strict";var l2=Ur&&Ur.__rest||function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};Object.defineProperty(Ur,"__esModule",{value:!0});Ur.ClusterAdapterWithHeartbeat=Ur.ClusterAdapter=Ur.MessageType=void 0;var u2=Hd(),p2=Ae(),f2=require("crypto"),Ee=(0,p2.debug)("socket.io-adapter"),d2="emitter",al=5e3;function ms(){return(0,f2.randomBytes)(8).toString("hex")}var Q;(function(r){r[r.INITIAL_HEARTBEAT=1]="INITIAL_HEARTBEAT",r[r.HEARTBEAT=2]="HEARTBEAT",r[r.BROADCAST=3]="BROADCAST",r[r.SOCKETS_JOIN=4]="SOCKETS_JOIN",r[r.SOCKETS_LEAVE=5]="SOCKETS_LEAVE",r[r.DISCONNECT_SOCKETS=6]="DISCONNECT_SOCKETS",r[r.FETCH_SOCKETS=7]="FETCH_SOCKETS",r[r.FETCH_SOCKETS_RESPONSE=8]="FETCH_SOCKETS_RESPONSE",r[r.SERVER_SIDE_EMIT=9]="SERVER_SIDE_EMIT",r[r.SERVER_SIDE_EMIT_RESPONSE=10]="SERVER_SIDE_EMIT_RESPONSE",r[r.BROADCAST_CLIENT_COUNT=11]="BROADCAST_CLIENT_COUNT",r[r.BROADCAST_ACK=12]="BROADCAST_ACK",r[r.ADAPTER_CLOSE=13]="ADAPTER_CLOSE"})(Q||(Ur.MessageType=Q={}));function ui(r){return{rooms:[...r.rooms],except:[...r.except],flags:r.flags}}function hs(r){return{rooms:new Set(r.rooms),except:new Set(r.except),flags:r.flags}}var cl=class extends u2.Adapter{constructor(e){super(e),this.requests=new Map,this.ackRequests=new Map,this.uid=ms()}onMessage(e,t){if(e.uid===this.uid)return Ee("[%s] ignore message from self",this.uid);if(e.nsp!==this.nsp.name)return Ee("[%s] ignore message from another namespace (%s)",this.uid,e.nsp);switch(Ee("[%s] new event of type %d from %s",this.uid,e.type,e.uid),e.type){case Q.BROADCAST:{if(e.data.requestId!==void 0)super.broadcastWithAck(e.data.packet,hs(e.data.opts),i=>{Ee("[%s] waiting for %d client acknowledgements",this.uid,i),this.publishResponse(e.uid,{type:Q.BROADCAST_CLIENT_COUNT,data:{requestId:e.data.requestId,clientCount:i}})},i=>{Ee("[%s] received acknowledgement with value %j",this.uid,i),this.publishResponse(e.uid,{type:Q.BROADCAST_ACK,data:{requestId:e.data.requestId,packet:i}})});else{let i=e.data.packet,s=hs(e.data.opts);this.addOffsetIfNecessary(i,s,t),super.broadcast(i,s)}break}case Q.SOCKETS_JOIN:super.addSockets(hs(e.data.opts),e.data.rooms);break;case Q.SOCKETS_LEAVE:super.delSockets(hs(e.data.opts),e.data.rooms);break;case Q.DISCONNECT_SOCKETS:super.disconnectSockets(hs(e.data.opts),e.data.close);break;case Q.FETCH_SOCKETS:{Ee("[%s] calling fetchSockets with opts %j",this.uid,e.data.opts),super.fetchSockets(hs(e.data.opts)).then(n=>{this.publishResponse(e.uid,{type:Q.FETCH_SOCKETS_RESPONSE,data:{requestId:e.data.requestId,sockets:n.map(i=>{let s=i.handshake,{sessionStore:o}=s,a=l2(s,["sessionStore"]);return{id:i.id,handshake:a,rooms:[...i.rooms],data:i.data}})}})});break}case Q.SERVER_SIDE_EMIT:{let n=e.data.packet;if(!(e.data.requestId!==void 0)){this.nsp._onServerSideEmit(n);return}let s=!1,o=a=>{s||(s=!0,Ee("[%s] calling acknowledgement with %j",this.uid,a),this.publishResponse(e.uid,{type:Q.SERVER_SIDE_EMIT_RESPONSE,data:{requestId:e.data.requestId,packet:a}}))};this.nsp._onServerSideEmit([...n,o]);break}case Q.BROADCAST_CLIENT_COUNT:case Q.BROADCAST_ACK:case Q.FETCH_SOCKETS_RESPONSE:case Q.SERVER_SIDE_EMIT_RESPONSE:this.onResponse(e);break;default:Ee("[%s] unknown message type: %s",this.uid,e.type)}}onResponse(e){var t,n;let i=e.data.requestId;switch(Ee("[%s] received response %s to request %s",this.uid,e.type,i),e.type){case Q.BROADCAST_CLIENT_COUNT:{(t=this.ackRequests.get(i))===null||t===void 0||t.clientCountCallback(e.data.clientCount);break}case Q.BROADCAST_ACK:{(n=this.ackRequests.get(i))===null||n===void 0||n.ack(e.data.packet);break}case Q.FETCH_SOCKETS_RESPONSE:{let s=this.requests.get(i);if(!s)return;s.current++,e.data.sockets.forEach(o=>s.responses.push(o)),s.current===s.expected&&(clearTimeout(s.timeout),s.resolve(s.responses),this.requests.delete(i));break}case Q.SERVER_SIDE_EMIT_RESPONSE:{let s=this.requests.get(i);if(!s)return;s.current++,s.responses.push(e.data.packet),s.current===s.expected&&(clearTimeout(s.timeout),s.resolve(null,s.responses),this.requests.delete(i));break}default:Ee("[%s] unknown response type: %s",this.uid,e.type)}}async broadcast(e,t){var n;if(!((n=t.flags)===null||n===void 0?void 0:n.local))try{let s=await this.publishAndReturnOffset({type:Q.BROADCAST,data:{packet:e,opts:ui(t)}});this.addOffsetIfNecessary(e,t,s)}catch(s){return Ee("[%s] error while broadcasting message: %s",this.uid,s.message)}super.broadcast(e,t)}addOffsetIfNecessary(e,t,n){var i;if(!this.nsp.server.opts.connectionStateRecovery)return;let s=e.type===2,o=e.id===void 0,a=((i=t.flags)===null||i===void 0?void 0:i.volatile)===void 0;s&&o&&a&&e.data.push(n)}broadcastWithAck(e,t,n,i){var s;if(!((s=t?.flags)===null||s===void 0?void 0:s.local)){let a=ms();this.ackRequests.set(a,{clientCountCallback:n,ack:i}),this.publish({type:Q.BROADCAST,data:{packet:e,requestId:a,opts:ui(t)}}),setTimeout(()=>{this.ackRequests.delete(a)},t.flags.timeout)}super.broadcastWithAck(e,t,n,i)}async addSockets(e,t){var n;if(!((n=e.flags)===null||n===void 0?void 0:n.local))try{await this.publishAndReturnOffset({type:Q.SOCKETS_JOIN,data:{opts:ui(e),rooms:t}})}catch(s){Ee("[%s] error while publishing message: %s",this.uid,s.message)}super.addSockets(e,t)}async delSockets(e,t){var n;if(!((n=e.flags)===null||n===void 0?void 0:n.local))try{await this.publishAndReturnOffset({type:Q.SOCKETS_LEAVE,data:{opts:ui(e),rooms:t}})}catch(s){Ee("[%s] error while publishing message: %s",this.uid,s.message)}super.delSockets(e,t)}async disconnectSockets(e,t){var n;if(!((n=e.flags)===null||n===void 0?void 0:n.local))try{await this.publishAndReturnOffset({type:Q.DISCONNECT_SOCKETS,data:{opts:ui(e),close:t}})}catch(s){Ee("[%s] error while publishing message: %s",this.uid,s.message)}super.disconnectSockets(e,t)}async fetchSockets(e){var t;let[n,i]=await Promise.all([super.fetchSockets(e),this.serverCount()]),s=i-1;if(!((t=e.flags)===null||t===void 0)&&t.local||s<=0)return n;let o=ms();return new Promise((a,c)=>{let l=setTimeout(()=>{let f=this.requests.get(o);f&&(c(new Error(`timeout reached: only ${f.current} responses received out of ${f.expected}`)),this.requests.delete(o))},e.flags.timeout||al),u={type:Q.FETCH_SOCKETS,resolve:a,timeout:l,current:0,expected:s,responses:n};this.requests.set(o,u),this.publish({type:Q.FETCH_SOCKETS,data:{opts:ui(e),requestId:o}})})}async serverSideEmit(e){if(!(typeof e[e.length-1]=="function"))return this.publish({type:Q.SERVER_SIDE_EMIT,data:{packet:e}});let n=e.pop(),i=await this.serverCount()-1;if(Ee('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,i),i<=0)return n(null,[]);let s=ms(),o=setTimeout(()=>{let c=this.requests.get(s);c&&(n(new Error(`timeout reached: only ${c.current} responses received out of ${c.expected}`),c.responses),this.requests.delete(s))},al),a={type:Q.SERVER_SIDE_EMIT,resolve:n,timeout:o,current:0,expected:i,responses:[]};this.requests.set(s,a),this.publish({type:Q.SERVER_SIDE_EMIT,data:{requestId:s,packet:e}})}publish(e){Ee("[%s] sending message %s",this.uid,e.type),this.publishAndReturnOffset(e).catch(t=>{Ee("[%s] error while publishing message: %s",this.uid,t)})}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,Ee("[%s] sending response %s to %s",this.uid,t.type,e),this.doPublishResponse(e,t).catch(n=>{Ee("[%s] error while publishing response: %s",this.uid,n)})}};Ur.ClusterAdapter=cl;var qd=class extends cl{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(()=>{let n=Date.now();this.nodesMap.forEach((i,s)=>{n-i>this._opts.heartbeatTimeout&&(Ee("[%s] node %s seems down",this.uid,s),this.removeNode(s))})},1e3)}init(){this.publish({type:Q.INITIAL_HEARTBEAT})}scheduleHeartbeat(){this.heartbeatTimer?this.heartbeatTimer.refresh():this.heartbeatTimer=setTimeout(()=>{this.publish({type:Q.HEARTBEAT})},this._opts.heartbeatInterval)}close(){this.publish({type:Q.ADAPTER_CLOSE}),clearTimeout(this.heartbeatTimer),this.cleanupTimer&&clearInterval(this.cleanupTimer)}onMessage(e,t){if(e.uid===this.uid)return Ee("[%s] ignore message from self",this.uid);switch(e.uid&&e.uid!==d2&&this.nodesMap.set(e.uid,Date.now()),e.type){case Q.INITIAL_HEARTBEAT:this.publish({type:Q.HEARTBEAT});break;case Q.HEARTBEAT:break;case Q.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(!(typeof e[e.length-1]=="function"))return this.publish({type:Q.SERVER_SIDE_EMIT,data:{packet:e}});let n=e.pop(),i=this.nodesMap.size;if(Ee('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,i),i<=0)return n(null,[]);let s=ms(),o=setTimeout(()=>{let c=this.customRequests.get(s);c&&(n(new Error(`timeout reached: missing ${c.missingUids.size} responses`),c.responses),this.customRequests.delete(s))},al),a={type:Q.SERVER_SIDE_EMIT,resolve:n,timeout:o,missingUids:new Set([...this.nodesMap.keys()]),responses:[]};this.customRequests.set(s,a),this.publish({type:Q.SERVER_SIDE_EMIT,data:{requestId:s,packet:e}})}async fetchSockets(e){var t;let[n,i]=await Promise.all([super.fetchSockets({rooms:e.rooms,except:e.except,flags:{local:!0}}),this.serverCount()]),s=i-1;if(!((t=e.flags)===null||t===void 0)&&t.local||s<=0)return n;let o=ms();return new Promise((a,c)=>{let l=setTimeout(()=>{let f=this.customRequests.get(o);f&&(c(new Error(`timeout reached: missing ${f.missingUids.size} responses`)),this.customRequests.delete(o))},e.flags.timeout||al),u={type:Q.FETCH_SOCKETS,resolve:a,timeout:l,missingUids:new Set([...this.nodesMap.keys()]),responses:n};this.customRequests.set(o,u),this.publish({type:Q.FETCH_SOCKETS,data:{opts:ui(e),requestId:o}})})}onResponse(e){let t=e.data.requestId;switch(Ee("[%s] received response %s to request %s",this.uid,e.type,t),e.type){case Q.FETCH_SOCKETS_RESPONSE:{let n=this.customRequests.get(t);if(!n)return;e.data.sockets.forEach(i=>n.responses.push(i)),n.missingUids.delete(e.uid),n.missingUids.size===0&&(clearTimeout(n.timeout),n.resolve(n.responses),this.customRequests.delete(t));break}case Q.SERVER_SIDE_EMIT_RESPONSE:{let n=this.customRequests.get(t);if(!n)return;n.responses.push(e.data.packet),n.missingUids.delete(e.uid),n.missingUids.size===0&&(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),t.missingUids.size===0&&(clearTimeout(t.timeout),t.type===Q.FETCH_SOCKETS?t.resolve(t.responses):t.type===Q.SERVER_SIDE_EMIT&&t.resolve(null,t.responses),this.customRequests.delete(n))}),this.nodesMap.delete(e)}};Ur.ClusterAdapterWithHeartbeat=qd});var ll=A(pr=>{"use strict";Object.defineProperty(pr,"__esModule",{value:!0});pr.MessageType=pr.ClusterAdapterWithHeartbeat=pr.ClusterAdapter=pr.SessionAwareAdapter=pr.Adapter=void 0;var xb=Hd();Object.defineProperty(pr,"Adapter",{enumerable:!0,get:function(){return xb.Adapter}});Object.defineProperty(pr,"SessionAwareAdapter",{enumerable:!0,get:function(){return xb.SessionAwareAdapter}});var Ud=yb();Object.defineProperty(pr,"ClusterAdapter",{enumerable:!0,get:function(){return Ud.ClusterAdapter}});Object.defineProperty(pr,"ClusterAdapterWithHeartbeat",{enumerable:!0,get:function(){return Ud.ClusterAdapterWithHeartbeat}});Object.defineProperty(pr,"MessageType",{enumerable:!0,get:function(){return Ud.MessageType}})});var wb=A(gs=>{"use strict";var h2=gs&&gs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(gs,"__esModule",{value:!0});gs.ParentNamespace=void 0;var _b=md(),m2=ll(),g2=h2(Ae()),bb=(0,g2.default)("socket.io:parent-namespace"),ul=class r extends _b.Namespace{constructor(e){super(e,"/_"+r.count++),this.children=new Set}_initAdapter(){this.adapter=new $d(this)}emit(e,...t){return this.children.forEach(n=>{n.emit(e,...t)}),!0}createChild(e){bb("creating child namespace %s",e);let t=new _b.Namespace(this.server,e);if(this._fns.forEach(n=>t.use(n)),this.listeners("connect").forEach(n=>t.on("connect",n)),this.listeners("connection").forEach(n=>t.on("connection",n)),this.children.add(t),this.server._opts.cleanupEmptyChildNamespaces){let n=t._remove;t._remove=i=>{n.call(t,i),t.sockets.size===0&&(bb("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")}};gs.ParentNamespace=ul;ul.count=0;var $d=class extends m2.Adapter{broadcast(e,t){this.nsp.children.forEach(n=>{n.adapter.broadcast(e,t)})}}});var Ab=A(fi=>{"use strict";var v2=fi&&fi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(fi,"__esModule",{value:!0});fi.patchAdapter=x2;fi.restoreAdapter=_2;fi.serveFile=w2;var pi=ll(),Sb=require("fs"),y2=v2(Ae()),pl=(0,y2.default)("socket.io:adapter-uws"),Wd="",{addAll:Tb,del:Cb,broadcast:kb}=pi.Adapter.prototype;function x2(r){pi.Adapter.prototype.addAll=function(e,t){let n=!this.sids.has(e);Tb.call(this,e,t);let i=this.nsp.sockets.get(e)||this.nsp._preConnectSockets.get(e);if(i){if(i.conn.transport.name==="websocket"){Eb(this.nsp.name,i,n,t);return}n&&i.conn.on("upgrade",()=>{let s=this.sids.get(e);s&&Eb(this.nsp.name,i,n,s)})}},pi.Adapter.prototype.del=function(e,t){Cb.call(this,e,t);let n=this.nsp.sockets.get(e)||this.nsp._preConnectSockets.get(e);if(n&&n.conn.transport.name==="websocket"){let i=n.conn.id,s=n.conn.transport.socket,o=`${this.nsp.name}${Wd}${t}`;pl("unsubscribe connection %s from topic %s",i,o),s.unsubscribe(o)}},pi.Adapter.prototype.broadcast=function(e,t){if(!(t.rooms.size<=1&&t.except.size===0)){kb.call(this,e,t);return}let i=t.flags||{},s={preEncoded:!0,volatile:i.volatile,compress:i.compress};e.nsp=this.nsp.name;let o=this.encoder.encode(e),a=t.rooms.size===0?this.nsp.name:`${this.nsp.name}${Wd}${t.rooms.keys().next().value}`;pl("fast publish to %s",a),o.forEach(c=>{let l=typeof c!="string";r.publish(a,l?c:"4"+c,l)}),this.apply(t,c=>{c.conn.transport.name!=="websocket"&&c.client.writeToEngine(o,s)})}}function Eb(r,e,t,n){let i=e.conn.id,s=e.conn.transport.socket;t&&(pl("subscribe connection %s to topic %s",i,r),s.subscribe(r)),n.forEach(o=>{let a=`${r}${Wd}${o}`;pl("subscribe connection %s to topic %s",i,a),s.subscribe(a)})}function _2(){pi.Adapter.prototype.addAll=Tb,pi.Adapter.prototype.del=Cb,pi.Adapter.prototype.broadcast=kb}var b2=r=>{let{buffer:e,byteOffset:t,byteLength:n}=r;return e.slice(t,t+n)};function w2(r,e){let{size:t}=(0,Sb.statSync)(e),n=(0,Sb.createReadStream)(e),i=()=>!n.destroyed&&n.destroy(),s=a=>{throw i(),a},o=a=>{let c=b2(a);r.cork(()=>{let l=r.getWriteOffset(),[u,f]=r.tryEnd(c,t);!f&&!u&&(n.pause(),r.onWritable(h=>{let[g,x]=r.tryEnd(c.slice(h-l),t);return!x&&g&&n.resume(),g}))})};r.onAborted(i),n.on("data",o).on("error",s).on("end",i)}});var Rb=A((d8,S2)=>{S2.exports={name:"socket.io",version:"4.8.3",description:"node.js realtime framework server",keywords:["realtime","framework","websocket","tcp","events","socket","io"],files:["dist/","client-dist/","wrapper.mjs","!**/*.tsbuildinfo"],directories:{doc:"docs/",example:"example/",lib:"lib/",test:"test/"},type:"commonjs",main:"./dist/index.js",exports:{".":{types:"./dist/index.d.ts",import:"./wrapper.mjs",require:"./dist/index.js"},"./package.json":"./package.json"},types:"./dist/index.d.ts",license:"MIT",homepage:"https://github.com/socketio/socket.io/tree/main/packages/socket.io#readme",repository:{type:"git",url:"git+https://github.com/socketio/socket.io.git"},bugs:{url:"https://github.com/socketio/socket.io/issues"},scripts:{compile:"rimraf ./dist && tsc",test:"npm run format:check && npm run compile && npm run test:types && npm run test:unit","test:types":"tsd","test:unit":"nyc mocha --import=tsx --reporter spec --slow 200 --bail --timeout 10000 test/index.ts","format:check":'prettier --check "lib/**/*.ts" "test/**/*.ts"',"format:fix":'prettier --write "lib/**/*.ts" "test/**/*.ts"',prepack:"npm run compile"},dependencies:{accepts:"~1.3.4",base64id:"~2.0.0",cors:"~2.8.5",debug:"~4.4.1","engine.io":"~6.6.0","socket.io-adapter":"~2.5.2","socket.io-parser":"~4.2.4"},contributors:[{name:"Guillermo Rauch",email:"rauchg@gmail.com"},{name:"Arnout Kazemier",email:"info@3rd-eden.com"},{name:"Vladimir Dronnikov",email:"dronnikov@gmail.com"},{name:"Einar Otto Stangvik",email:"einaros@gmail.com"}],engines:{node:">=10.2.0"},tsd:{directory:"test"}}});var Bb=A((St,Do)=>{"use strict";var E2=St&&St.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),T2=St&&St.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),C2=St&&St.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&E2(e,r,t);return T2(e,r),e},Vd=St&&St.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(St,"__esModule",{value:!0});St.Namespace=St.Socket=St.Server=void 0;var k2=Vd(require("http")),A2=require("fs"),Gd=require("zlib"),R2=Qa(),fl=require("stream"),Ob=require("path"),Mb=zx(),O2=r_(),Pb=require("events"),Kd=md();Object.defineProperty(St,"Namespace",{enumerable:!0,get:function(){return Kd.Namespace}});var M2=wb(),Ib=ll(),P2=C2(To()),I2=Vd(Ae()),Lb=dd();Object.defineProperty(St,"Socket",{enumerable:!0,get:function(){return Lb.Socket}});var N2=qc(),zd=Ab(),D2=Vd(Vf()),Rt=(0,I2.default)("socket.io:server"),Nb=Rb().version,Db=/\.map/,vs=class r extends N2.StrictEventEmitter{constructor(e,t={}){super(),this._nsps=new Map,this.parentNsps=new Map,this.parentNamespacesFromRegExp=new Map,typeof e=="object"&&e instanceof Object&&!e.listen&&(t=e,e=void 0),this.path(t.path||"/socket.io"),this.connectTimeout(t.connectTimeout||45e3),this.serveClient(t.serveClient!==!1),this._parser=t.parser||P2,this.encoder=new this._parser.Encoder,this.opts=t,t.connectionStateRecovery?(t.connectionStateRecovery=Object.assign({maxDisconnectionDuration:120*1e3,skipMiddlewares:!0},t.connectionStateRecovery),this.adapter(t.adapter||Ib.SessionAwareAdapter)):this.adapter(t.adapter||Ib.Adapter),t.cleanupEmptyChildNamespaces=!!t.cleanupEmptyChildNamespaces,this.sockets=this.of("/"),(e||typeof e=="number")&&this.attach(e),this.opts.cors&&(this._corsMiddleware=(0,D2.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(this.parentNsps.size===0)return n(!1);let i=this.parentNsps.keys(),s=()=>{let o=i.next();if(o.done)return n(!1);o.value(e,t,(a,c)=>{if(a||!c)return s();if(this._nsps.has(e))return Rt("dynamic namespace %s already exists",e),n(this._nsps.get(e));let l=this.parentNsps.get(o.value).createChild(e);Rt("dynamic namespace %s was created",e),n(l)})};s()}path(e){if(!arguments.length)return this._path;this._path=e.replace(/\/$/,"");let t=this._path.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");return this.clientPathRegex=new RegExp("^"+t+"/socket\\.io(\\.msgpack|\\.esm)?(\\.min)?\\.js(\\.map)?(?:\\?|$)"),this}connectTimeout(e){return e===void 0?this._connectTimeout:(this._connectTimeout=e,this)}adapter(e){if(!arguments.length)return this._adapter;this._adapter=e;for(let t of this._nsps.values())t._initAdapter();return this}listen(e,t={}){return this.attach(e,t)}attach(e,t={}){if(typeof e=="function"){let n="You are trying to attach socket.io to an express request handler function. Please pass a http.Server instance.";throw new Error(n)}if(Number(e)==e&&(e=Number(e)),typeof e=="number"){Rt("creating http server and binding to %d",e);let n=e;e=k2.default.createServer((i,s)=>{s.writeHead(404),s.end()}),e.listen(n)}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,Rt("creating uWebSockets.js-based engine with opts %j",t);let n=new Mb.uServer(t);n.attach(e,t),this.bind(n),this._serveClient&&e.get(`${this._path}/*`,(i,s)=>{if(!this.clientPathRegex.test(s.getUrl())){s.setYield(!0);return}let o=s.getUrl().replace(this._path,"").replace(/\?.*$/,"").replace(/^\//,""),a=Db.test(o),c=a?"map":"source",l='"'+Nb+'"',u="W/"+l,f=s.getHeader("if-none-match");if(f&&(l===f||u===f)){Rt("serve client %s 304",c),i.writeStatus("304 Not Modified"),i.end();return}Rt("serve client %s",c),i.writeHeader("cache-control","public, max-age=0"),i.writeHeader("content-type","application/"+(a?"json":"javascript")+"; charset=utf-8"),i.writeHeader("etag",l);let h=Ob.join(__dirname,"../client-dist/",o);(0,zd.serveFile)(i,h)}),(0,zd.patchAdapter)(e)}initEngine(e,t){Rt("creating engine.io instance with opts %j",t),this.eio=(0,Mb.attach)(e,t),this._serveClient&&this.attachServe(e),this.httpServer=e,this.bind(this.eio)}attachServe(e){Rt("attaching client serving req handler");let t=e.listeners("request").slice(0);e.removeAllListeners("request"),e.on("request",(n,i)=>{if(this.clientPathRegex.test(n.url))this._corsMiddleware?this._corsMiddleware(n,i,()=>{this.serve(n,i)}):this.serve(n,i);else for(let s=0;s<t.length;s++)t[s].call(e,n,i)})}serve(e,t){let n=e.url.replace(this._path,"").replace(/\?.*$/,""),i=Db.test(n),s=i?"map":"source",o='"'+Nb+'"',a="W/"+o,c=e.headers["if-none-match"];if(c&&(o===c||a===c)){Rt("serve client %s 304",s),t.writeHead(304),t.end();return}Rt("serve client %s",s),t.setHeader("Cache-Control","public, max-age=0"),t.setHeader("Content-Type","application/"+(i?"json":"javascript")+"; charset=utf-8"),t.setHeader("ETag",o),r.sendFile(n,e,t)}static sendFile(e,t,n){let i=(0,A2.createReadStream)(Ob.join(__dirname,"../client-dist/",e)),s=R2(t).encodings(["br","gzip","deflate"]),o=a=>{a&&n.end()};switch(s){case"br":n.writeHead(200,{"content-encoding":"br"}),(0,fl.pipeline)(i,(0,Gd.createBrotliCompress)(),n,o);break;case"gzip":n.writeHead(200,{"content-encoding":"gzip"}),(0,fl.pipeline)(i,(0,Gd.createGzip)(),n,o);break;case"deflate":n.writeHead(200,{"content-encoding":"deflate"}),(0,fl.pipeline)(i,(0,Gd.createDeflate)(),n,o);break;default:n.writeHead(200),(0,fl.pipeline)(i,n,o)}}bind(e){return this.engine=e,this.engine.on("connection",this.onconnection.bind(this)),this}onconnection(e){Rt("incoming connection with id %s",e.id);let t=new O2.Client(this,e);return e.protocol===3&&t.connect("/"),this}of(e,t){if(typeof e=="function"||e instanceof RegExp){let i=new M2.ParentNamespace(this);return Rt("initializing parent namespace %s",i.name),typeof e=="function"?this.parentNsps.set(e,i):(this.parentNsps.set((s,o,a)=>a(null,e.test(s)),i),this.parentNamespacesFromRegExp.set(e,i)),t&&i.on("connect",t),i}String(e)[0]!=="/"&&(e="/"+e);let n=this._nsps.get(e);if(!n){for(let[i,s]of this.parentNamespacesFromRegExp)if(i.test(e))return Rt("attaching namespace %s to parent namespace %s",e,i),s.createChild(e);Rt("initializing namespace %s",e),n=new Kd.Namespace(this,e),this._nsps.set(e,n),e!=="/"&&this.sockets.emitReserved("new_namespace",n)}return t&&n.on("connect",t),n}async close(e){if(await Promise.allSettled([...this._nsps.values()].map(async t=>{t.sockets.forEach(n=>{n._onclose("server shutting down")}),await t.adapter.close()})),this.engine.close(),(0,zd.restoreAdapter)(),this.httpServer)return new Promise(t=>{this.httpServer.close(n=>{e&&e(n),n&&Rt("server was not running"),t()})});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)}};St.Server=vs;var L2=Object.keys(Pb.EventEmitter.prototype).filter(function(r){return typeof Pb.EventEmitter.prototype[r]=="function"});L2.forEach(function(r){vs.prototype[r]=function(){return this.sockets[r].apply(this.sockets,arguments)}});Do.exports=(r,e)=>new vs(r,e);Do.exports.Server=vs;Do.exports.Namespace=Kd.Namespace;Do.exports.Socket=Lb.Socket});function Yd(){return Lo=(0,Hb.randomBytes)(32).toString("hex"),Lo}function qb(){return Lo||Yd(),Lo}function Ub(r){return!!r&&typeof r=="string"&&r===Lo}var Hb,Lo,dl=Ce(()=>{Hb=require("crypto"),Lo=null});var zb,ml,$,pt=Ce(()=>{zb={darwin:{capture:"nodeScreenshots",encoder:"sharp",tileSize:128,inputFormat:"rgba"},win32:{capture:"nodeScreenshots",encoder:"sharp",tileSize:256,inputFormat:"rgba"},linux:{capture:"nodeScreenshots",encoder:"sharp",tileSize:256,inputFormat:"rgba"}},ml=zb[process.platform]||zb.linux,$={pipeline:{captureLib:ml.capture,encoder:ml.encoder,inputFormat:ml.inputFormat,tileSize:ml.tileSize,tileFormat:"webp",webpEffort:0,jpegQuality:50,tileConcurrency:6,outputScale:1,adaptiveTiers:[{minEffective:1,outputScale:1,jpegQuality:72},{minEffective:.7,outputScale:.95,jpegQuality:62},{minEffective:.4,outputScale:.8,jpegQuality:52},{minEffective:0,outputScale:.65,jpegQuality:45}],tierHysteresis:.05,checksumSampling:{rowStep:3,colStep:8}},webrtc:{enableWebRTC:!0,enableTurn:!1,turnApiUrl:"https://9remote.cc/api/webrtc/turn-credentials",turnRefreshInterval:1380*60*1e3,dcMaxMessageSize:65536,dcBufferThreshold:262144,iceDisconnectGraceMs:6e3,dcChunkSize:8,dcMaxTilesPerFrame:32,dcReliable:!0,dcOrdered:!1,answerTimeout:1e4,maxControlBuffer:500},robotSettings:{mouseDelay:2,keyboardDelay:2},throttling:{mouseThrottle:8,keyThrottle:25,typeTextThrottle:100,maxTextLength:1e3},resourceManagement:{inactiveTimeout:120*1e3,memoryCheckInterval:6e4,memoryWarningThreshold:1e3,maxTimersPerClient:100,maxChunkTimersPerClient:50,disconnectGraceMs:3e4},streaming:{activeInterval:60,idleInterval:400,idleThreshold:3,actionCaptureDelay:50,chunkSize:32,chunkDelay:5},focus:{paddingTiles:4},displayWake:{enabled:!0,throttleMs:3e4,macDurationSec:5},sleepInhibit:{defaultMode:"never",presets:{"30m":1800*1e3,"1h":3600*1e3,"2h":7200*1e3,"4h":14400*1e3,"24h":1440*60*1e3,never:null}},desktopSwitch:{darwin:{prev:{keyCode:123,mods:"control down"},next:{keyCode:124,mods:"control down"},new:{type:"missionControl"}},win32:{prev:["left",["control","command"]],next:["right",["control","command"]],new:["d",["control","command"]]},linux:{prev:null,next:null,new:null}},logging:{lifecycle:!1,errors:!0,dpiDetection:!1,focus:!1,focusEveryFrames:60,metrics:!1,metricsEveryFrames:30,webrtc:!1}}});var Bo,jo,ve,Xd=Ce(()=>{pt();ji();Bo=()=>$.logging,jo=On("remote"),ve={lifecycle:r=>{Bo().lifecycle&&jo.info(r)},focus:r=>{Bo().focus&&jo.info(r)},dpi:r=>{Bo().dpiDetection&&jo.info(r)},error:(r,e)=>{Bo().errors&&jo.error(`${r} ${e?.message||e||""}`)},warn:r=>{Bo().errors&&jo.warn(r)}}});function Ho(){for(let r of[ie.ROOT,ie.STATE])$r.default.existsSync(r)||$r.default.mkdirSync(r,{recursive:!0})}function eh(){try{return Ho(),$r.default.existsSync(Qd)?JSON.parse($r.default.readFileSync(Qd,"utf8"))||{}:{}}catch{return{}}}function Qb(r){try{Ho();let e={...eh(),...r};return $r.default.writeFileSync(Qd,JSON.stringify(e,null,2),{mode:384}),e}catch(e){return console.error("Error saving settings:",e),null}}function ew(){try{return Ho(),$r.default.existsSync(Zd)?JSON.parse($r.default.readFileSync(Zd,"utf8")):{machineId:null,key:null,name:"Default",createdAt:null}}catch{return{machineId:null,key:null,name:"Default",createdAt:null}}}function qn(r){try{Ho(),$r.default.writeFileSync(G2,JSON.stringify({cmd:r,ts:Date.now()}))}catch{}}function tw(r,e,t="Default"){try{Ho();let n={machineId:r,key:e,name:t,createdAt:new Date().toISOString()};return $r.default.writeFileSync(Zd,JSON.stringify(n,null,2),{mode:384}),n}catch(n){return console.error("Error saving key:",n),null}}var $r,Fo,j8,F8,Zd,G2,Qd,xs=Ce(()=>{$r=K(require("fs"),1),Fo=K(require("path"),1);bt();j8=ie.STATE,F8=Fo.default.join(ie.STATE,"state.json"),Zd=Fo.default.join(ie.ROOT,"keys.json"),G2=Fo.default.join(ie.STATE,"cmd.json"),Qd=Fo.default.join(ie.STATE,"settings.json")});function rw(){return new Promise(r=>{if(process.platform!=="darwin"){r({screenRecording:!0,accessibility:!0});return}let e=!1,t=!1,n=0,i=()=>{++n===2&&r({screenRecording:e,accessibility:t})};(0,qo.execFile)("osascript",["-e",'use framework "ApplicationServices"',"-e",`set checkOptions to current application's NSDictionary's dictionaryWithObject:(false) forKey:("AXTrustedCheckOptionPrompt" as string)`,"-e","return current application's AXIsProcessTrustedWithOptions(checkOptions) as boolean"],{timeout:3e3},(s,o)=>{t=!s&&o.trim()==="true",i()}),(0,qo.exec)(`osascript -e 'use framework "CoreGraphics"' -e "return (current application's CGPreflightScreenCaptureAccess()) as boolean"`,{timeout:3e3},(s,o)=>{e=!s&&o.trim()==="true",i()})})}function nw(r){let e=z2[r];e&&process.platform==="darwin"&&(0,qo.exec)(`open "${e}"`,()=>{})}var qo,z2,iw=Ce(()=>{qo=require("child_process"),z2={screenRecording:"x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture",accessibility:"x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility"}});function V2(){return!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY}function Wo(){for(let r=sw,e=null;r!==e;e=r,r=Rr.default.dirname(r)){let t=Rr.default.join(r,"package.json");if((0,de.existsSync)(t)){try{let n=JSON.parse((0,de.readFileSync)(t,"utf8"));if(n.name!==Bi)continue;let i=typeof n.bin=="string"?n.bin:n.bin?.[Bi];if(i){let s=Rr.default.resolve(r,i);if((0,de.existsSync)(s))return s}}catch{}break}}return process.argv[1]||Rr.default.resolve(sw,"..","index.js")}function ws(){return process.execPath}function cw(){let r=Rr.default.dirname(ws()),e=["/usr/local/bin","/usr/bin","/bin","/usr/sbin","/sbin","/opt/homebrew/bin"];return e.includes(r)||e.unshift(r),e.join(":")}function th(r){return String(r).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function K2(r,e){let t=[r,e,..._l].map(n=>` <string>${th(n)}</string>`).join(`
|
|
29
|
+
`+t)}function pi(r,e,t,n,i,s){if(r.listenerCount("wsClientError")){let o=new Error(i);Error.captureStackTrace(o,pi),r.emit("wsClientError",o,t,e)}else Bo(t,n,i,s)}});var Sb=A((y8,wb)=>{"use strict";var mn=il();mn.createWebSocketStream=fb();mn.Server=bb();mn.Receiver=Rd();mn.Sender=Pd();mn.WebSocket=mn;mn.WebSocketServer=mn.Server;wb.exports=mn});var Ud=A(ms=>{"use strict";var Hd;Object.defineProperty(ms,"__esModule",{value:!0});ms.SessionAwareAdapter=ms.Adapter=void 0;var h2=require("events"),m2=v_(),ol=Sb(),g2=typeof((Hd=ol?.Sender)===null||Hd===void 0?void 0:Hd.frame)=="function",al=class extends h2.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(let 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){let n=this.rooms.get(e);n!=null&&(n.delete(t)&&this.emit("leave-room",e,t),n.size===0&&this.rooms.delete(e)&&this.emit("delete-room",e))}delAll(e){if(this.sids.has(e)){for(let t of this.sids.get(e))this._del(t,e);this.sids.delete(e)}}broadcast(e,t){let n=t.flags||{},i={preEncoded:!0,volatile:n.volatile,compress:n.compress};e.nsp=this.nsp.name;let s=this._encode(e,i);this.apply(t,o=>{typeof o.notifyOutgoingListeners=="function"&&o.notifyOutgoingListeners(e),o.client.writeToEngine(s,i)})}broadcastWithAck(e,t,n,i){let s=t.flags||{},o={preEncoded:!0,volatile:s.volatile,compress:s.compress};e.nsp=this.nsp.name,e.id=this.nsp._ids++;let a=this._encode(e,o),c=0;this.apply(t,l=>{c++,l.acks.set(e.id,i),typeof l.notifyOutgoingListeners=="function"&&l.notifyOutgoingListeners(e),l.client.writeToEngine(a,o)}),n(c)}_encode(e,t){let n=this.encoder.encode(e);if(g2&&n.length===1&&typeof n[0]=="string"){let i=Buffer.from("4"+n[0]);t.wsPreEncodedFrame=ol.Sender.frame(i,{readOnly:!1,mask:!1,rsv1:!1,opcode:1,fin:!0})}return n}sockets(e){let t=new Set;return this.apply({rooms:e},n=>{t.add(n.id)}),Promise.resolve(t)}socketRooms(e){return this.sids.get(e)}fetchSockets(e){let t=[];return this.apply(e,n=>{t.push(n)}),Promise.resolve(t)}addSockets(e,t){this.apply(e,n=>{n.join(t)})}delSockets(e,t){this.apply(e,n=>{t.forEach(i=>n.leave(i))})}disconnectSockets(e,t){this.apply(e,n=>{n.disconnect(t)})}apply(e,t){let n=e.rooms,i=this.computeExceptSids(e.except);if(n.size){let s=new Set;for(let o of n)if(this.rooms.has(o))for(let a of this.rooms.get(o)){if(s.has(a)||i.has(a))continue;let c=this.nsp.sockets.get(a);c&&(t(c),s.add(a))}}else for(let[s]of this.sids){if(i.has(s))continue;let o=this.nsp.sockets.get(s);o&&t(o)}}computeExceptSids(e){let t=new Set;if(e&&e.size>0)for(let n of e)this.rooms.has(n)&&this.rooms.get(n).forEach(i=>t.add(i));return t}serverSideEmit(e){console.warn("this adapter does not support the serverSideEmit() functionality")}persistSession(e){}restoreSession(e,t){return null}};ms.Adapter=al;var qd=class extends al{constructor(e){super(e),this.nsp=e,this.sessions=new Map,this.packets=[],this.maxDisconnectionDuration=e.server.opts.connectionStateRecovery.maxDisconnectionDuration,setInterval(()=>{let n=Date.now()-this.maxDisconnectionDuration;this.sessions.forEach((i,s)=>{i.disconnectedAt<n&&this.sessions.delete(s)});for(let i=this.packets.length-1;i>=0;i--)if(this.packets[i].emittedAt<n){this.packets.splice(0,i+1);break}},60*1e3).unref()}persistSession(e){e.disconnectedAt=Date.now(),this.sessions.set(e.pid,e)}restoreSession(e,t){let n=this.sessions.get(e);if(!n)return null;if(n.disconnectedAt+this.maxDisconnectionDuration<Date.now())return this.sessions.delete(e),null;let s=this.packets.findIndex(a=>a.id===t);if(s===-1)return null;let o=[];for(let a=s+1;a<this.packets.length;a++){let c=this.packets[a];v2(n.rooms,c.opts)&&o.push(c.data)}return Promise.resolve(Object.assign(Object.assign({},n),{missedPackets:o}))}broadcast(e,t){var n;let i=e.type===2,s=e.id===void 0,o=((n=t.flags)===null||n===void 0?void 0:n.volatile)===void 0;if(i&&s&&o){let a=(0,m2.yeast)();e.data.push(a),this.packets.push({id:a,opts:t,data:e.data,emittedAt:Date.now()})}super.broadcast(e,t)}};ms.SessionAwareAdapter=qd;function v2(r,e){let t=e.rooms.size===0||r.some(i=>e.rooms.has(i)),n=r.every(i=>!e.except.has(i));return t&&n}});var Eb=A(Ur=>{"use strict";var y2=Ur&&Ur.__rest||function(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t};Object.defineProperty(Ur,"__esModule",{value:!0});Ur.ClusterAdapterWithHeartbeat=Ur.ClusterAdapter=Ur.MessageType=void 0;var x2=Ud(),_2=Ae(),b2=require("crypto"),Ee=(0,_2.debug)("socket.io-adapter"),w2="emitter",cl=5e3;function vs(){return(0,b2.randomBytes)(8).toString("hex")}var Q;(function(r){r[r.INITIAL_HEARTBEAT=1]="INITIAL_HEARTBEAT",r[r.HEARTBEAT=2]="HEARTBEAT",r[r.BROADCAST=3]="BROADCAST",r[r.SOCKETS_JOIN=4]="SOCKETS_JOIN",r[r.SOCKETS_LEAVE=5]="SOCKETS_LEAVE",r[r.DISCONNECT_SOCKETS=6]="DISCONNECT_SOCKETS",r[r.FETCH_SOCKETS=7]="FETCH_SOCKETS",r[r.FETCH_SOCKETS_RESPONSE=8]="FETCH_SOCKETS_RESPONSE",r[r.SERVER_SIDE_EMIT=9]="SERVER_SIDE_EMIT",r[r.SERVER_SIDE_EMIT_RESPONSE=10]="SERVER_SIDE_EMIT_RESPONSE",r[r.BROADCAST_CLIENT_COUNT=11]="BROADCAST_CLIENT_COUNT",r[r.BROADCAST_ACK=12]="BROADCAST_ACK",r[r.ADAPTER_CLOSE=13]="ADAPTER_CLOSE"})(Q||(Ur.MessageType=Q={}));function fi(r){return{rooms:[...r.rooms],except:[...r.except],flags:r.flags}}function gs(r){return{rooms:new Set(r.rooms),except:new Set(r.except),flags:r.flags}}var ll=class extends x2.Adapter{constructor(e){super(e),this.requests=new Map,this.ackRequests=new Map,this.uid=vs()}onMessage(e,t){if(e.uid===this.uid)return Ee("[%s] ignore message from self",this.uid);if(e.nsp!==this.nsp.name)return Ee("[%s] ignore message from another namespace (%s)",this.uid,e.nsp);switch(Ee("[%s] new event of type %d from %s",this.uid,e.type,e.uid),e.type){case Q.BROADCAST:{if(e.data.requestId!==void 0)super.broadcastWithAck(e.data.packet,gs(e.data.opts),i=>{Ee("[%s] waiting for %d client acknowledgements",this.uid,i),this.publishResponse(e.uid,{type:Q.BROADCAST_CLIENT_COUNT,data:{requestId:e.data.requestId,clientCount:i}})},i=>{Ee("[%s] received acknowledgement with value %j",this.uid,i),this.publishResponse(e.uid,{type:Q.BROADCAST_ACK,data:{requestId:e.data.requestId,packet:i}})});else{let i=e.data.packet,s=gs(e.data.opts);this.addOffsetIfNecessary(i,s,t),super.broadcast(i,s)}break}case Q.SOCKETS_JOIN:super.addSockets(gs(e.data.opts),e.data.rooms);break;case Q.SOCKETS_LEAVE:super.delSockets(gs(e.data.opts),e.data.rooms);break;case Q.DISCONNECT_SOCKETS:super.disconnectSockets(gs(e.data.opts),e.data.close);break;case Q.FETCH_SOCKETS:{Ee("[%s] calling fetchSockets with opts %j",this.uid,e.data.opts),super.fetchSockets(gs(e.data.opts)).then(n=>{this.publishResponse(e.uid,{type:Q.FETCH_SOCKETS_RESPONSE,data:{requestId:e.data.requestId,sockets:n.map(i=>{let s=i.handshake,{sessionStore:o}=s,a=y2(s,["sessionStore"]);return{id:i.id,handshake:a,rooms:[...i.rooms],data:i.data}})}})});break}case Q.SERVER_SIDE_EMIT:{let n=e.data.packet;if(!(e.data.requestId!==void 0)){this.nsp._onServerSideEmit(n);return}let s=!1,o=a=>{s||(s=!0,Ee("[%s] calling acknowledgement with %j",this.uid,a),this.publishResponse(e.uid,{type:Q.SERVER_SIDE_EMIT_RESPONSE,data:{requestId:e.data.requestId,packet:a}}))};this.nsp._onServerSideEmit([...n,o]);break}case Q.BROADCAST_CLIENT_COUNT:case Q.BROADCAST_ACK:case Q.FETCH_SOCKETS_RESPONSE:case Q.SERVER_SIDE_EMIT_RESPONSE:this.onResponse(e);break;default:Ee("[%s] unknown message type: %s",this.uid,e.type)}}onResponse(e){var t,n;let i=e.data.requestId;switch(Ee("[%s] received response %s to request %s",this.uid,e.type,i),e.type){case Q.BROADCAST_CLIENT_COUNT:{(t=this.ackRequests.get(i))===null||t===void 0||t.clientCountCallback(e.data.clientCount);break}case Q.BROADCAST_ACK:{(n=this.ackRequests.get(i))===null||n===void 0||n.ack(e.data.packet);break}case Q.FETCH_SOCKETS_RESPONSE:{let s=this.requests.get(i);if(!s)return;s.current++,e.data.sockets.forEach(o=>s.responses.push(o)),s.current===s.expected&&(clearTimeout(s.timeout),s.resolve(s.responses),this.requests.delete(i));break}case Q.SERVER_SIDE_EMIT_RESPONSE:{let s=this.requests.get(i);if(!s)return;s.current++,s.responses.push(e.data.packet),s.current===s.expected&&(clearTimeout(s.timeout),s.resolve(null,s.responses),this.requests.delete(i));break}default:Ee("[%s] unknown response type: %s",this.uid,e.type)}}async broadcast(e,t){var n;if(!((n=t.flags)===null||n===void 0?void 0:n.local))try{let s=await this.publishAndReturnOffset({type:Q.BROADCAST,data:{packet:e,opts:fi(t)}});this.addOffsetIfNecessary(e,t,s)}catch(s){return Ee("[%s] error while broadcasting message: %s",this.uid,s.message)}super.broadcast(e,t)}addOffsetIfNecessary(e,t,n){var i;if(!this.nsp.server.opts.connectionStateRecovery)return;let s=e.type===2,o=e.id===void 0,a=((i=t.flags)===null||i===void 0?void 0:i.volatile)===void 0;s&&o&&a&&e.data.push(n)}broadcastWithAck(e,t,n,i){var s;if(!((s=t?.flags)===null||s===void 0?void 0:s.local)){let a=vs();this.ackRequests.set(a,{clientCountCallback:n,ack:i}),this.publish({type:Q.BROADCAST,data:{packet:e,requestId:a,opts:fi(t)}}),setTimeout(()=>{this.ackRequests.delete(a)},t.flags.timeout)}super.broadcastWithAck(e,t,n,i)}async addSockets(e,t){var n;if(!((n=e.flags)===null||n===void 0?void 0:n.local))try{await this.publishAndReturnOffset({type:Q.SOCKETS_JOIN,data:{opts:fi(e),rooms:t}})}catch(s){Ee("[%s] error while publishing message: %s",this.uid,s.message)}super.addSockets(e,t)}async delSockets(e,t){var n;if(!((n=e.flags)===null||n===void 0?void 0:n.local))try{await this.publishAndReturnOffset({type:Q.SOCKETS_LEAVE,data:{opts:fi(e),rooms:t}})}catch(s){Ee("[%s] error while publishing message: %s",this.uid,s.message)}super.delSockets(e,t)}async disconnectSockets(e,t){var n;if(!((n=e.flags)===null||n===void 0?void 0:n.local))try{await this.publishAndReturnOffset({type:Q.DISCONNECT_SOCKETS,data:{opts:fi(e),close:t}})}catch(s){Ee("[%s] error while publishing message: %s",this.uid,s.message)}super.disconnectSockets(e,t)}async fetchSockets(e){var t;let[n,i]=await Promise.all([super.fetchSockets(e),this.serverCount()]),s=i-1;if(!((t=e.flags)===null||t===void 0)&&t.local||s<=0)return n;let o=vs();return new Promise((a,c)=>{let l=setTimeout(()=>{let f=this.requests.get(o);f&&(c(new Error(`timeout reached: only ${f.current} responses received out of ${f.expected}`)),this.requests.delete(o))},e.flags.timeout||cl),u={type:Q.FETCH_SOCKETS,resolve:a,timeout:l,current:0,expected:s,responses:n};this.requests.set(o,u),this.publish({type:Q.FETCH_SOCKETS,data:{opts:fi(e),requestId:o}})})}async serverSideEmit(e){if(!(typeof e[e.length-1]=="function"))return this.publish({type:Q.SERVER_SIDE_EMIT,data:{packet:e}});let n=e.pop(),i=await this.serverCount()-1;if(Ee('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,i),i<=0)return n(null,[]);let s=vs(),o=setTimeout(()=>{let c=this.requests.get(s);c&&(n(new Error(`timeout reached: only ${c.current} responses received out of ${c.expected}`),c.responses),this.requests.delete(s))},cl),a={type:Q.SERVER_SIDE_EMIT,resolve:n,timeout:o,current:0,expected:i,responses:[]};this.requests.set(s,a),this.publish({type:Q.SERVER_SIDE_EMIT,data:{requestId:s,packet:e}})}publish(e){Ee("[%s] sending message %s",this.uid,e.type),this.publishAndReturnOffset(e).catch(t=>{Ee("[%s] error while publishing message: %s",this.uid,t)})}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,Ee("[%s] sending response %s to %s",this.uid,t.type,e),this.doPublishResponse(e,t).catch(n=>{Ee("[%s] error while publishing response: %s",this.uid,n)})}};Ur.ClusterAdapter=ll;var $d=class extends ll{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(()=>{let n=Date.now();this.nodesMap.forEach((i,s)=>{n-i>this._opts.heartbeatTimeout&&(Ee("[%s] node %s seems down",this.uid,s),this.removeNode(s))})},1e3)}init(){this.publish({type:Q.INITIAL_HEARTBEAT})}scheduleHeartbeat(){this.heartbeatTimer?this.heartbeatTimer.refresh():this.heartbeatTimer=setTimeout(()=>{this.publish({type:Q.HEARTBEAT})},this._opts.heartbeatInterval)}close(){this.publish({type:Q.ADAPTER_CLOSE}),clearTimeout(this.heartbeatTimer),this.cleanupTimer&&clearInterval(this.cleanupTimer)}onMessage(e,t){if(e.uid===this.uid)return Ee("[%s] ignore message from self",this.uid);switch(e.uid&&e.uid!==w2&&this.nodesMap.set(e.uid,Date.now()),e.type){case Q.INITIAL_HEARTBEAT:this.publish({type:Q.HEARTBEAT});break;case Q.HEARTBEAT:break;case Q.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(!(typeof e[e.length-1]=="function"))return this.publish({type:Q.SERVER_SIDE_EMIT,data:{packet:e}});let n=e.pop(),i=this.nodesMap.size;if(Ee('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,i),i<=0)return n(null,[]);let s=vs(),o=setTimeout(()=>{let c=this.customRequests.get(s);c&&(n(new Error(`timeout reached: missing ${c.missingUids.size} responses`),c.responses),this.customRequests.delete(s))},cl),a={type:Q.SERVER_SIDE_EMIT,resolve:n,timeout:o,missingUids:new Set([...this.nodesMap.keys()]),responses:[]};this.customRequests.set(s,a),this.publish({type:Q.SERVER_SIDE_EMIT,data:{requestId:s,packet:e}})}async fetchSockets(e){var t;let[n,i]=await Promise.all([super.fetchSockets({rooms:e.rooms,except:e.except,flags:{local:!0}}),this.serverCount()]),s=i-1;if(!((t=e.flags)===null||t===void 0)&&t.local||s<=0)return n;let o=vs();return new Promise((a,c)=>{let l=setTimeout(()=>{let f=this.customRequests.get(o);f&&(c(new Error(`timeout reached: missing ${f.missingUids.size} responses`)),this.customRequests.delete(o))},e.flags.timeout||cl),u={type:Q.FETCH_SOCKETS,resolve:a,timeout:l,missingUids:new Set([...this.nodesMap.keys()]),responses:n};this.customRequests.set(o,u),this.publish({type:Q.FETCH_SOCKETS,data:{opts:fi(e),requestId:o}})})}onResponse(e){let t=e.data.requestId;switch(Ee("[%s] received response %s to request %s",this.uid,e.type,t),e.type){case Q.FETCH_SOCKETS_RESPONSE:{let n=this.customRequests.get(t);if(!n)return;e.data.sockets.forEach(i=>n.responses.push(i)),n.missingUids.delete(e.uid),n.missingUids.size===0&&(clearTimeout(n.timeout),n.resolve(n.responses),this.customRequests.delete(t));break}case Q.SERVER_SIDE_EMIT_RESPONSE:{let n=this.customRequests.get(t);if(!n)return;n.responses.push(e.data.packet),n.missingUids.delete(e.uid),n.missingUids.size===0&&(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),t.missingUids.size===0&&(clearTimeout(t.timeout),t.type===Q.FETCH_SOCKETS?t.resolve(t.responses):t.type===Q.SERVER_SIDE_EMIT&&t.resolve(null,t.responses),this.customRequests.delete(n))}),this.nodesMap.delete(e)}};Ur.ClusterAdapterWithHeartbeat=$d});var ul=A(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.MessageType=fr.ClusterAdapterWithHeartbeat=fr.ClusterAdapter=fr.SessionAwareAdapter=fr.Adapter=void 0;var Tb=Ud();Object.defineProperty(fr,"Adapter",{enumerable:!0,get:function(){return Tb.Adapter}});Object.defineProperty(fr,"SessionAwareAdapter",{enumerable:!0,get:function(){return Tb.SessionAwareAdapter}});var Wd=Eb();Object.defineProperty(fr,"ClusterAdapter",{enumerable:!0,get:function(){return Wd.ClusterAdapter}});Object.defineProperty(fr,"ClusterAdapterWithHeartbeat",{enumerable:!0,get:function(){return Wd.ClusterAdapterWithHeartbeat}});Object.defineProperty(fr,"MessageType",{enumerable:!0,get:function(){return Wd.MessageType}})});var Ab=A(ys=>{"use strict";var S2=ys&&ys.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ys,"__esModule",{value:!0});ys.ParentNamespace=void 0;var Cb=vd(),E2=ul(),T2=S2(Ae()),kb=(0,T2.default)("socket.io:parent-namespace"),pl=class r extends Cb.Namespace{constructor(e){super(e,"/_"+r.count++),this.children=new Set}_initAdapter(){this.adapter=new Gd(this)}emit(e,...t){return this.children.forEach(n=>{n.emit(e,...t)}),!0}createChild(e){kb("creating child namespace %s",e);let t=new Cb.Namespace(this.server,e);if(this._fns.forEach(n=>t.use(n)),this.listeners("connect").forEach(n=>t.on("connect",n)),this.listeners("connection").forEach(n=>t.on("connection",n)),this.children.add(t),this.server._opts.cleanupEmptyChildNamespaces){let n=t._remove;t._remove=i=>{n.call(t,i),t.sockets.size===0&&(kb("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")}};ys.ParentNamespace=pl;pl.count=0;var Gd=class extends E2.Adapter{broadcast(e,t){this.nsp.children.forEach(n=>{n.adapter.broadcast(e,t)})}}});var Nb=A(hi=>{"use strict";var C2=hi&&hi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(hi,"__esModule",{value:!0});hi.patchAdapter=A2;hi.restoreAdapter=R2;hi.serveFile=M2;var di=ul(),Rb=require("fs"),k2=C2(Ae()),fl=(0,k2.default)("socket.io:adapter-uws"),zd="",{addAll:Mb,del:Pb,broadcast:Ib}=di.Adapter.prototype;function A2(r){di.Adapter.prototype.addAll=function(e,t){let n=!this.sids.has(e);Mb.call(this,e,t);let i=this.nsp.sockets.get(e)||this.nsp._preConnectSockets.get(e);if(i){if(i.conn.transport.name==="websocket"){Ob(this.nsp.name,i,n,t);return}n&&i.conn.on("upgrade",()=>{let s=this.sids.get(e);s&&Ob(this.nsp.name,i,n,s)})}},di.Adapter.prototype.del=function(e,t){Pb.call(this,e,t);let n=this.nsp.sockets.get(e)||this.nsp._preConnectSockets.get(e);if(n&&n.conn.transport.name==="websocket"){let i=n.conn.id,s=n.conn.transport.socket,o=`${this.nsp.name}${zd}${t}`;fl("unsubscribe connection %s from topic %s",i,o),s.unsubscribe(o)}},di.Adapter.prototype.broadcast=function(e,t){if(!(t.rooms.size<=1&&t.except.size===0)){Ib.call(this,e,t);return}let i=t.flags||{},s={preEncoded:!0,volatile:i.volatile,compress:i.compress};e.nsp=this.nsp.name;let o=this.encoder.encode(e),a=t.rooms.size===0?this.nsp.name:`${this.nsp.name}${zd}${t.rooms.keys().next().value}`;fl("fast publish to %s",a),o.forEach(c=>{let l=typeof c!="string";r.publish(a,l?c:"4"+c,l)}),this.apply(t,c=>{c.conn.transport.name!=="websocket"&&c.client.writeToEngine(o,s)})}}function Ob(r,e,t,n){let i=e.conn.id,s=e.conn.transport.socket;t&&(fl("subscribe connection %s to topic %s",i,r),s.subscribe(r)),n.forEach(o=>{let a=`${r}${zd}${o}`;fl("subscribe connection %s to topic %s",i,a),s.subscribe(a)})}function R2(){di.Adapter.prototype.addAll=Mb,di.Adapter.prototype.del=Pb,di.Adapter.prototype.broadcast=Ib}var O2=r=>{let{buffer:e,byteOffset:t,byteLength:n}=r;return e.slice(t,t+n)};function M2(r,e){let{size:t}=(0,Rb.statSync)(e),n=(0,Rb.createReadStream)(e),i=()=>!n.destroyed&&n.destroy(),s=a=>{throw i(),a},o=a=>{let c=O2(a);r.cork(()=>{let l=r.getWriteOffset(),[u,f]=r.tryEnd(c,t);!f&&!u&&(n.pause(),r.onWritable(h=>{let[g,x]=r.tryEnd(c.slice(h-l),t);return!x&&g&&n.resume(),g}))})};r.onAborted(i),n.on("data",o).on("error",s).on("end",i)}});var Db=A((E8,P2)=>{P2.exports={name:"socket.io",version:"4.8.3",description:"node.js realtime framework server",keywords:["realtime","framework","websocket","tcp","events","socket","io"],files:["dist/","client-dist/","wrapper.mjs","!**/*.tsbuildinfo"],directories:{doc:"docs/",example:"example/",lib:"lib/",test:"test/"},type:"commonjs",main:"./dist/index.js",exports:{".":{types:"./dist/index.d.ts",import:"./wrapper.mjs",require:"./dist/index.js"},"./package.json":"./package.json"},types:"./dist/index.d.ts",license:"MIT",homepage:"https://github.com/socketio/socket.io/tree/main/packages/socket.io#readme",repository:{type:"git",url:"git+https://github.com/socketio/socket.io.git"},bugs:{url:"https://github.com/socketio/socket.io/issues"},scripts:{compile:"rimraf ./dist && tsc",test:"npm run format:check && npm run compile && npm run test:types && npm run test:unit","test:types":"tsd","test:unit":"nyc mocha --import=tsx --reporter spec --slow 200 --bail --timeout 10000 test/index.ts","format:check":'prettier --check "lib/**/*.ts" "test/**/*.ts"',"format:fix":'prettier --write "lib/**/*.ts" "test/**/*.ts"',prepack:"npm run compile"},dependencies:{accepts:"~1.3.4",base64id:"~2.0.0",cors:"~2.8.5",debug:"~4.4.1","engine.io":"~6.6.0","socket.io-adapter":"~2.5.2","socket.io-parser":"~4.2.4"},contributors:[{name:"Guillermo Rauch",email:"rauchg@gmail.com"},{name:"Arnout Kazemier",email:"info@3rd-eden.com"},{name:"Vladimir Dronnikov",email:"dronnikov@gmail.com"},{name:"Einar Otto Stangvik",email:"einaros@gmail.com"}],engines:{node:">=10.2.0"},tsd:{directory:"test"}}});var $b=A((Et,jo)=>{"use strict";var I2=Et&&Et.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),N2=Et&&Et.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),D2=Et&&Et.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&I2(e,r,t);return N2(e,r),e},Yd=Et&&Et.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Et,"__esModule",{value:!0});Et.Namespace=Et.Socket=Et.Server=void 0;var L2=Yd(require("http")),B2=require("fs"),Vd=require("zlib"),j2=ec(),dl=require("stream"),Lb=require("path"),Bb=Zx(),F2=c_(),jb=require("events"),Jd=vd();Object.defineProperty(Et,"Namespace",{enumerable:!0,get:function(){return Jd.Namespace}});var H2=Ab(),Fb=ul(),q2=D2(Ao()),U2=Yd(Ae()),Ub=md();Object.defineProperty(Et,"Socket",{enumerable:!0,get:function(){return Ub.Socket}});var $2=Uc(),Kd=Nb(),W2=Yd(Yf()),Ot=(0,U2.default)("socket.io:server"),Hb=Db().version,qb=/\.map/,xs=class r extends $2.StrictEventEmitter{constructor(e,t={}){super(),this._nsps=new Map,this.parentNsps=new Map,this.parentNamespacesFromRegExp=new Map,typeof e=="object"&&e instanceof Object&&!e.listen&&(t=e,e=void 0),this.path(t.path||"/socket.io"),this.connectTimeout(t.connectTimeout||45e3),this.serveClient(t.serveClient!==!1),this._parser=t.parser||q2,this.encoder=new this._parser.Encoder,this.opts=t,t.connectionStateRecovery?(t.connectionStateRecovery=Object.assign({maxDisconnectionDuration:120*1e3,skipMiddlewares:!0},t.connectionStateRecovery),this.adapter(t.adapter||Fb.SessionAwareAdapter)):this.adapter(t.adapter||Fb.Adapter),t.cleanupEmptyChildNamespaces=!!t.cleanupEmptyChildNamespaces,this.sockets=this.of("/"),(e||typeof e=="number")&&this.attach(e),this.opts.cors&&(this._corsMiddleware=(0,W2.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(this.parentNsps.size===0)return n(!1);let i=this.parentNsps.keys(),s=()=>{let o=i.next();if(o.done)return n(!1);o.value(e,t,(a,c)=>{if(a||!c)return s();if(this._nsps.has(e))return Ot("dynamic namespace %s already exists",e),n(this._nsps.get(e));let l=this.parentNsps.get(o.value).createChild(e);Ot("dynamic namespace %s was created",e),n(l)})};s()}path(e){if(!arguments.length)return this._path;this._path=e.replace(/\/$/,"");let t=this._path.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");return this.clientPathRegex=new RegExp("^"+t+"/socket\\.io(\\.msgpack|\\.esm)?(\\.min)?\\.js(\\.map)?(?:\\?|$)"),this}connectTimeout(e){return e===void 0?this._connectTimeout:(this._connectTimeout=e,this)}adapter(e){if(!arguments.length)return this._adapter;this._adapter=e;for(let t of this._nsps.values())t._initAdapter();return this}listen(e,t={}){return this.attach(e,t)}attach(e,t={}){if(typeof e=="function"){let n="You are trying to attach socket.io to an express request handler function. Please pass a http.Server instance.";throw new Error(n)}if(Number(e)==e&&(e=Number(e)),typeof e=="number"){Ot("creating http server and binding to %d",e);let n=e;e=L2.default.createServer((i,s)=>{s.writeHead(404),s.end()}),e.listen(n)}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,Ot("creating uWebSockets.js-based engine with opts %j",t);let n=new Bb.uServer(t);n.attach(e,t),this.bind(n),this._serveClient&&e.get(`${this._path}/*`,(i,s)=>{if(!this.clientPathRegex.test(s.getUrl())){s.setYield(!0);return}let o=s.getUrl().replace(this._path,"").replace(/\?.*$/,"").replace(/^\//,""),a=qb.test(o),c=a?"map":"source",l='"'+Hb+'"',u="W/"+l,f=s.getHeader("if-none-match");if(f&&(l===f||u===f)){Ot("serve client %s 304",c),i.writeStatus("304 Not Modified"),i.end();return}Ot("serve client %s",c),i.writeHeader("cache-control","public, max-age=0"),i.writeHeader("content-type","application/"+(a?"json":"javascript")+"; charset=utf-8"),i.writeHeader("etag",l);let h=Lb.join(__dirname,"../client-dist/",o);(0,Kd.serveFile)(i,h)}),(0,Kd.patchAdapter)(e)}initEngine(e,t){Ot("creating engine.io instance with opts %j",t),this.eio=(0,Bb.attach)(e,t),this._serveClient&&this.attachServe(e),this.httpServer=e,this.bind(this.eio)}attachServe(e){Ot("attaching client serving req handler");let t=e.listeners("request").slice(0);e.removeAllListeners("request"),e.on("request",(n,i)=>{if(this.clientPathRegex.test(n.url))this._corsMiddleware?this._corsMiddleware(n,i,()=>{this.serve(n,i)}):this.serve(n,i);else for(let s=0;s<t.length;s++)t[s].call(e,n,i)})}serve(e,t){let n=e.url.replace(this._path,"").replace(/\?.*$/,""),i=qb.test(n),s=i?"map":"source",o='"'+Hb+'"',a="W/"+o,c=e.headers["if-none-match"];if(c&&(o===c||a===c)){Ot("serve client %s 304",s),t.writeHead(304),t.end();return}Ot("serve client %s",s),t.setHeader("Cache-Control","public, max-age=0"),t.setHeader("Content-Type","application/"+(i?"json":"javascript")+"; charset=utf-8"),t.setHeader("ETag",o),r.sendFile(n,e,t)}static sendFile(e,t,n){let i=(0,B2.createReadStream)(Lb.join(__dirname,"../client-dist/",e)),s=j2(t).encodings(["br","gzip","deflate"]),o=a=>{a&&n.end()};switch(s){case"br":n.writeHead(200,{"content-encoding":"br"}),(0,dl.pipeline)(i,(0,Vd.createBrotliCompress)(),n,o);break;case"gzip":n.writeHead(200,{"content-encoding":"gzip"}),(0,dl.pipeline)(i,(0,Vd.createGzip)(),n,o);break;case"deflate":n.writeHead(200,{"content-encoding":"deflate"}),(0,dl.pipeline)(i,(0,Vd.createDeflate)(),n,o);break;default:n.writeHead(200),(0,dl.pipeline)(i,n,o)}}bind(e){return this.engine=e,this.engine.on("connection",this.onconnection.bind(this)),this}onconnection(e){Ot("incoming connection with id %s",e.id);let t=new F2.Client(this,e);return e.protocol===3&&t.connect("/"),this}of(e,t){if(typeof e=="function"||e instanceof RegExp){let i=new H2.ParentNamespace(this);return Ot("initializing parent namespace %s",i.name),typeof e=="function"?this.parentNsps.set(e,i):(this.parentNsps.set((s,o,a)=>a(null,e.test(s)),i),this.parentNamespacesFromRegExp.set(e,i)),t&&i.on("connect",t),i}String(e)[0]!=="/"&&(e="/"+e);let n=this._nsps.get(e);if(!n){for(let[i,s]of this.parentNamespacesFromRegExp)if(i.test(e))return Ot("attaching namespace %s to parent namespace %s",e,i),s.createChild(e);Ot("initializing namespace %s",e),n=new Jd.Namespace(this,e),this._nsps.set(e,n),e!=="/"&&this.sockets.emitReserved("new_namespace",n)}return t&&n.on("connect",t),n}async close(e){if(await Promise.allSettled([...this._nsps.values()].map(async t=>{t.sockets.forEach(n=>{n._onclose("server shutting down")}),await t.adapter.close()})),this.engine.close(),(0,Kd.restoreAdapter)(),this.httpServer)return new Promise(t=>{this.httpServer.close(n=>{e&&e(n),n&&Ot("server was not running"),t()})});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)}};Et.Server=xs;var G2=Object.keys(jb.EventEmitter.prototype).filter(function(r){return typeof jb.EventEmitter.prototype[r]=="function"});G2.forEach(function(r){xs.prototype[r]=function(){return this.sockets[r].apply(this.sockets,arguments)}});jo.exports=(r,e)=>new xs(r,e);jo.exports.Server=xs;jo.exports.Namespace=Jd.Namespace;jo.exports.Socket=Ub.Socket});function Xd(){return Fo=(0,zb.randomBytes)(32).toString("hex"),Fo}function Vb(){return Fo||Xd(),Fo}function Kb(r){return!!r&&typeof r=="string"&&r===Fo}var zb,Fo,hl=Ce(()=>{zb=require("crypto"),Fo=null});var Zb,gl,$,pt=Ce(()=>{Zb={darwin:{capture:"nodeScreenshots",encoder:"sharp",tileSize:128,inputFormat:"rgba"},win32:{capture:"nodeScreenshots",encoder:"sharp",tileSize:256,inputFormat:"rgba"},linux:{capture:"nodeScreenshots",encoder:"sharp",tileSize:256,inputFormat:"rgba"}},gl=Zb[process.platform]||Zb.linux,$={pipeline:{captureLib:gl.capture,encoder:gl.encoder,inputFormat:gl.inputFormat,tileSize:gl.tileSize,tileFormat:"webp",webpEffort:0,jpegQuality:50,tileConcurrency:6,outputScale:1,adaptiveTiers:[{minEffective:1,outputScale:1,jpegQuality:72},{minEffective:.7,outputScale:.95,jpegQuality:62},{minEffective:.4,outputScale:.8,jpegQuality:52},{minEffective:0,outputScale:.65,jpegQuality:45}],tierHysteresis:.05,checksumSampling:{rowStep:3,colStep:8}},webrtc:{enableWebRTC:!0,enableTurn:!1,turnApiUrl:"https://9remote.cc/api/webrtc/turn-credentials",turnRefreshInterval:1380*60*1e3,dcMaxMessageSize:65536,dcBufferThreshold:262144,iceDisconnectGraceMs:6e3,dcChunkSize:8,dcMaxTilesPerFrame:32,dcReliable:!0,dcOrdered:!1,answerTimeout:1e4,maxControlBuffer:500},robotSettings:{mouseDelay:2,keyboardDelay:2},throttling:{mouseThrottle:8,keyThrottle:25,typeTextThrottle:100,maxTextLength:1e3},resourceManagement:{inactiveTimeout:120*1e3,memoryCheckInterval:6e4,memoryWarningThreshold:1e3,maxTimersPerClient:100,maxChunkTimersPerClient:50,disconnectGraceMs:3e4},streaming:{activeInterval:60,idleInterval:400,idleThreshold:3,actionCaptureDelay:50,chunkSize:32,chunkDelay:5},focus:{paddingTiles:4},displayWake:{enabled:!0,throttleMs:3e4,macDurationSec:5},sleepInhibit:{defaultMode:"never",presets:{"30m":1800*1e3,"1h":3600*1e3,"2h":7200*1e3,"4h":14400*1e3,"24h":1440*60*1e3,never:null}},desktopSwitch:{darwin:{prev:{keyCode:123,mods:"control down"},next:{keyCode:124,mods:"control down"},new:{type:"missionControl"}},win32:{prev:["left",["control","command"]],next:["right",["control","command"]],new:["d",["control","command"]]},linux:{prev:null,next:null,new:null}},logging:{lifecycle:!1,errors:!0,dpiDetection:!1,focus:!1,focusEveryFrames:60,metrics:!1,metricsEveryFrames:30,webrtc:!1}}});var Ho,qo,ve,eh=Ce(()=>{pt();Hi();Ho=()=>$.logging,qo=On("remote"),ve={lifecycle:r=>{Ho().lifecycle&&qo.info(r)},focus:r=>{Ho().focus&&qo.info(r)},dpi:r=>{Ho().dpiDetection&&qo.info(r)},error:(r,e)=>{Ho().errors&&qo.error(`${r} ${e?.message||e||""}`)},warn:r=>{Ho().errors&&qo.warn(r)}}});function $o(){for(let r of[ie.ROOT,ie.STATE])$r.default.existsSync(r)||$r.default.mkdirSync(r,{recursive:!0})}function nh(){try{return $o(),$r.default.existsSync(rh)?JSON.parse($r.default.readFileSync(rh,"utf8"))||{}:{}}catch{return{}}}function sw(r){try{$o();let e={...nh(),...r};return $r.default.writeFileSync(rh,JSON.stringify(e,null,2),{mode:384}),e}catch(e){return console.error("Error saving settings:",e),null}}function ow(){try{return $o(),$r.default.existsSync(th)?JSON.parse($r.default.readFileSync(th,"utf8")):{machineId:null,key:null,name:"Default",createdAt:null}}catch{return{machineId:null,key:null,name:"Default",createdAt:null}}}function qn(r){try{$o(),$r.default.writeFileSync(eB,JSON.stringify({cmd:r,ts:Date.now()}))}catch{}}function aw(r,e,t="Default"){try{$o();let n={machineId:r,key:e,name:t,createdAt:new Date().toISOString()};return $r.default.writeFileSync(th,JSON.stringify(n,null,2),{mode:384}),n}catch(n){return console.error("Error saving key:",n),null}}var $r,Uo,Y8,J8,th,eB,rh,bs=Ce(()=>{$r=K(require("fs"),1),Uo=K(require("path"),1);bt();Y8=ie.STATE,J8=Uo.default.join(ie.STATE,"state.json"),th=Uo.default.join(ie.ROOT,"keys.json"),eB=Uo.default.join(ie.STATE,"cmd.json"),rh=Uo.default.join(ie.STATE,"settings.json")});function cw(){return new Promise(r=>{if(process.platform!=="darwin"){r({screenRecording:!0,accessibility:!0});return}let e=!1,t=!1,n=0,i=()=>{++n===2&&r({screenRecording:e,accessibility:t})};(0,Wo.execFile)("osascript",["-e",'use framework "ApplicationServices"',"-e",`set checkOptions to current application's NSDictionary's dictionaryWithObject:(false) forKey:("AXTrustedCheckOptionPrompt" as string)`,"-e","return current application's AXIsProcessTrustedWithOptions(checkOptions) as boolean"],{timeout:3e3},(s,o)=>{t=!s&&o.trim()==="true",i()}),(0,Wo.exec)(`osascript -e 'use framework "CoreGraphics"' -e "return (current application's CGPreflightScreenCaptureAccess()) as boolean"`,{timeout:3e3},(s,o)=>{e=!s&&o.trim()==="true",i()})})}function lw(r){let e=tB[r];e&&process.platform==="darwin"&&(0,Wo.exec)(`open "${e}"`,()=>{})}var Wo,tB,uw=Ce(()=>{Wo=require("child_process"),tB={screenRecording:"x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture",accessibility:"x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility"}});function rB(){return!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY}function Vo(){for(let r=pw,e=null;r!==e;e=r,r=Rr.default.dirname(r)){let t=Rr.default.join(r,"package.json");if((0,de.existsSync)(t)){try{let n=JSON.parse((0,de.readFileSync)(t,"utf8"));if(n.name!==Fi)continue;let i=typeof n.bin=="string"?n.bin:n.bin?.[Fi];if(i){let s=Rr.default.resolve(r,i);if((0,de.existsSync)(s))return s}}catch{}break}}return process.argv[1]||Rr.default.resolve(pw,"..","index.js")}function Es(){return process.execPath}function hw(){let r=Rr.default.dirname(Es()),e=["/usr/local/bin","/usr/bin","/bin","/usr/sbin","/sbin","/opt/homebrew/bin"];return e.includes(r)||e.unshift(r),e.join(":")}function ih(r){return String(r).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function nB(r,e){let t=[r,e,...bl].map(n=>` <string>${ih(n)}</string>`).join(`
|
|
30
30
|
`);return`<?xml version="1.0" encoding="UTF-8"?>
|
|
31
31
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
32
32
|
<plist version="1.0">
|
|
33
33
|
<dict>
|
|
34
34
|
<key>Label</key>
|
|
35
|
-
<string>${
|
|
35
|
+
<string>${Ss}</string>
|
|
36
36
|
<key>ProgramArguments</key>
|
|
37
37
|
<array>
|
|
38
38
|
${t}
|
|
@@ -44,136 +44,137 @@ ${t}
|
|
|
44
44
|
<key>EnvironmentVariables</key>
|
|
45
45
|
<dict>
|
|
46
46
|
<key>PATH</key>
|
|
47
|
-
<string>${
|
|
47
|
+
<string>${ih(hw())}</string>
|
|
48
48
|
<key>HOME</key>
|
|
49
|
-
<string>${
|
|
49
|
+
<string>${ih(Go)}</string>
|
|
50
50
|
</dict>
|
|
51
51
|
<key>StandardOutPath</key>
|
|
52
|
-
<string>${
|
|
52
|
+
<string>${yl}</string>
|
|
53
53
|
<key>StandardErrorPath</key>
|
|
54
|
-
<string>${
|
|
54
|
+
<string>${yl}</string>
|
|
55
55
|
</dict>
|
|
56
56
|
</plist>
|
|
57
|
-
`}function
|
|
58
|
-
WshShell.Run """${
|
|
59
|
-
`}function
|
|
57
|
+
`}function iB(){return(0,de.mkdirSync)(Rr.default.dirname(ut.darwin),{recursive:!0}),(0,de.writeFileSync)(ut.darwin,nB(Es(),Vo())),!0}function sB(){if((0,de.existsSync)(ut.darwin))try{(0,de.unlinkSync)(ut.darwin)}catch{}return!0}function oB(){return(0,de.existsSync)(ut.darwin)}function aB(){let r=bl.join(" ");return`Set WshShell = CreateObject("WScript.Shell")
|
|
58
|
+
WshShell.Run """${Es()}"" ""${Vo()}"" ${r}", 0, False
|
|
59
|
+
`}function mw(){try{(0,zo.execFileSync)("reg",["DELETE","HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run","/V",_l,"/F"],{windowsHide:!0,stdio:"ignore"})}catch{}}function cB(){let r=Rr.default.dirname(ut.win);return(0,de.existsSync)(r)?(mw(),(0,de.writeFileSync)(ut.win,aB()),!0):!1}function lB(){if(mw(),(0,de.existsSync)(ut.win))try{(0,de.unlinkSync)(ut.win)}catch{}return!0}function uB(){return(0,de.existsSync)(ut.win)}function pB(){let r=`${Es()} ${Vo()} ${bl.join(" ")}`;return`[Desktop Entry]
|
|
60
60
|
Type=Application
|
|
61
|
-
Name=${
|
|
61
|
+
Name=${_l}
|
|
62
62
|
Exec=${r}
|
|
63
63
|
X-GNOME-Autostart-enabled=true
|
|
64
64
|
NoDisplay=false
|
|
65
65
|
Terminal=false
|
|
66
|
-
`}function
|
|
67
|
-
Description=${
|
|
66
|
+
`}function fB(){let r=bl.map(e=>`'${e}'`).join(" ");return`[Unit]
|
|
67
|
+
Description=${_l} Agent
|
|
68
68
|
After=network-online.target
|
|
69
69
|
Wants=network-online.target
|
|
70
70
|
|
|
71
71
|
[Service]
|
|
72
72
|
Type=simple
|
|
73
|
-
ExecStart=${
|
|
73
|
+
ExecStart=${Es()} ${Vo()} ${r}
|
|
74
74
|
Restart=always
|
|
75
75
|
RestartSec=10
|
|
76
|
-
Environment=PATH=${
|
|
77
|
-
Environment=HOME=${
|
|
78
|
-
StandardOutput=append:${
|
|
79
|
-
StandardError=append:${
|
|
76
|
+
Environment=PATH=${hw()}
|
|
77
|
+
Environment=HOME=${Go}
|
|
78
|
+
StandardOutput=append:${yl}
|
|
79
|
+
StandardError=append:${yl}
|
|
80
80
|
|
|
81
81
|
[Install]
|
|
82
82
|
WantedBy=default.target
|
|
83
|
-
`}function
|
|
84
|
-
`).filter(Boolean))if((0,
|
|
83
|
+
`}function xl(r){try{return(0,zo.execFileSync)("systemctl",["--user",...r],{stdio:"ignore"}),!0}catch{return!1}}function dB(){return rB()?((0,de.mkdirSync)(Rr.default.dirname(ut.linuxSystemd),{recursive:!0}),(0,de.writeFileSync)(ut.linuxSystemd,fB()),xl(["daemon-reload"]),xl(["enable",`${Ss}.service`]),!0):((0,de.mkdirSync)(Rr.default.dirname(ut.linux),{recursive:!0}),(0,de.writeFileSync)(ut.linux,pB()),!0)}function hB(){if((0,de.existsSync)(ut.linuxSystemd)){xl(["disable",`${Ss}.service`]);try{(0,de.unlinkSync)(ut.linuxSystemd)}catch{}xl(["daemon-reload"])}if((0,de.existsSync)(ut.linux))try{(0,de.unlinkSync)(ut.linux)}catch{}return!0}function mB(){return(0,de.existsSync)(ut.linux)||(0,de.existsSync)(ut.linuxSystemd)}async function sh(){try{if(process.platform==="darwin")return oB();if(process.platform==="win32")return await uB();if(process.platform==="linux")return mB()}catch{}return!1}async function gw(r){try{if(process.platform==="darwin")return r?iB():sB();if(process.platform==="win32")return r?await cB():await lB();if(process.platform==="linux")return r?dB():hB()}catch{}return!1}var zo,de,ws,fw,Rr,dw,yl,Ss,_l,bl,Go,pw,ut,oh=Ce(()=>{zo=require("child_process"),de=require("fs"),ws=require("path"),fw=K(require("os"),1),Rr=K(require("path"),1),dw=require("url");bt();yl=(0,ws.join)(ie.LOGS,"autostart.log"),Ss="cc.9remote.agent",_l="9Remote",bl=["--tray","--skip-update","--start"],Go=fw.default.homedir(),pw=Rr.default.dirname((0,dw.fileURLToPath)(__importMetaUrl)),ut={darwin:(0,ws.join)(Go,"Library","LaunchAgents",`${Ss}.plist`),linux:(0,ws.join)(Go,".config","autostart",`${Ss}.desktop`),linuxSystemd:(0,ws.join)(Go,".config","systemd","user",`${Ss}.service`),win:(0,ws.join)(process.env.APPDATA||"","Microsoft","Windows","Start Menu","Programs","Startup",`${_l}.vbs`)}});function gB(){Ko.default.existsSync(ie.CONFIG)||Ko.default.mkdirSync(ie.CONFIG,{recursive:!0})}function Yo(){try{return JSON.parse(Ko.default.readFileSync(yw,"utf8"))||{}}catch{return{}}}function wl(r){try{gB();let e={...Yo(),...r};return Ko.default.writeFileSync(yw,JSON.stringify(e,null,2)),e}catch{return null}}var Ko,vw,yw,ah=Ce(()=>{Ko=K(require("fs"),1),vw=K(require("path"),1);bt();yw=vw.default.join(ie.CONFIG,"settings.json")});var Tl={};en(Tl,{getMode:()=>fh,isActive:()=>ph,onConnectionChange:()=>SB,setMode:()=>Zo,start:()=>wB,stop:()=>uh});function yB(){xw||(xw=!0,process.on("exit",()=>{if(Ut){try{Ut.kill()}catch{}Ut=null}}))}function xB(){if(!_w&&(_w=!0,process.platform==="darwin"))try{let r=(0,Xo.execSync)("pgrep -f 'caffeinate -imsd'",{encoding:"utf8"}).trim();for(let e of r.split(`
|
|
84
|
+
`).filter(Boolean))if((0,Xo.execSync)(`ps -o ppid= -p ${e}`,{encoding:"utf8"}).trim()==="1")try{process.kill(Number(e))}catch{}}catch{}}function Sl(){if(Ut)return;let r=vB[process.platform];if(r)try{Ut=(0,Xo.spawn)(r.cmd,r.args,{stdio:"ignore",windowsHide:!0}),Ut.on("error",e=>{El.warn(`inhibitor error: ${e.message}`),Ut=null}),Ut.on("exit",()=>{Ut=null}),yB(),El.info(`\u{1F4A4} Sleep inhibitor started (${r.cmd})`)}catch(e){El.warn(`Failed to start sleep inhibitor: ${e.message}`),Ut=null}}function bw(){if(Ut){try{Ut.kill()}catch{}Ut=null,El.info("\u{1F4A4} Sleep inhibitor stopped")}}function ww(){Jo&&(clearTimeout(Jo),Jo=null)}function _B(r){return($.sleepInhibit?.presets||{})[r]??null}function bB(r){let e=$.sleepInhibit?.presets||{};return Object.prototype.hasOwnProperty.call(e,r)}function lh(){if(xB(),ww(),Ts==="never"){Sl();return}let r=_B(Ts);if(r==null){Sl();return}if(ch>0){Sl();return}Sl(),Jo=setTimeout(()=>{Jo=null,ch===0&&bw()},r)}function wB(){lh()}function uh(){ww(),bw()}function ph(){return Ut!==null}function fh(){return Ts}function Zo(r){return bB(r)&&(Ts=r,lh()),Ts}function SB(r){ch=r,lh()}var Xo,El,vB,Ut,Ts,Jo,ch,xw,_w,Cl=Ce(()=>{Xo=require("child_process");pt();Hi();El=On("sleep"),vB={darwin:{cmd:"caffeinate",args:["-imsd","-w",String(process.pid)]},linux:{cmd:"systemd-inhibit",args:["--what=idle:sleep:handle-lid-switch","--who=9remote","--why=remote-active","sleep","infinity"]},win32:{cmd:"powershell.exe",args:["-NonInteractive","-NoProfile","-WindowStyle","Hidden","-Command",`Add-Type -Name K -Namespace W -MemberDefinition '[System.Runtime.InteropServices.DllImport("kernel32")]public static extern uint SetThreadExecutionState(uint e);'; [void][W.K]::SetThreadExecutionState(0x80000041); while($true){Start-Sleep 3600}`]}},Ut=null,Ts=$.sleepInhibit?.defaultMode||"never",Jo=null,ch=0,xw=!1;_w=!1});function EB(){(0,Un.mkdirSync)(ie.STATE,{recursive:!0})}function Ew(){try{if((0,Un.existsSync)(dh)){let r=JSON.parse((0,Un.readFileSync)(dh,"utf8"));r.step===Zn.READY&&r.permanentKey&&(gn={...gn,...r})}}catch{}}function TB(){try{EB(),(0,Un.writeFileSync)(dh,JSON.stringify(gn),{mode:384})}catch{}}function Tw(){$t=!!Yo().desktopEnabled}function hh(){wl({desktopEnabled:$t})}function Tt(r,e){let t=`data: ${JSON.stringify({type:r,...e})}
|
|
85
85
|
|
|
86
|
-
`;for(let n of
|
|
86
|
+
`;for(let n of kl)try{n.write(t)}catch{kl.delete(n)}}function xe(r){Tt("log",{message:`[${new Date().toLocaleTimeString()}] ${r}`})}function Cw(){return gn}function vn(r){gn={...gn,...r},Tt("state",gn),TB()}function kw(){vn({oneTimeKey:"",oneTimeKeyExpiresAt:null,qrUrl:""})}function Aw(){return Al}function Rw(r){Al=r||null}function Ow(r){mh=!!r}function Cs(){return!!mh&&!!$t&&!!Or.screenRecording&&!!Or.accessibility}function Mw(r){gh=r}async function Rl(){let r=await cw(),e=Or,t=Cs();Or=r,$t&&(!r.screenRecording||!r.accessibility)&&($t=!1,hh());let n=e.screenRecording&&e.accessibility,i=r.screenRecording&&r.accessibility;return!$t&&!n&&i&&($t=!0,hh()),(e.screenRecording!==r.screenRecording||e.accessibility!==r.accessibility)&&Tt("permissions",{...Or,desktopEnabled:$t}),Cs()!==t&&gh?.(),r}function Pw(r,e){let t=r.headers.origin;if(t&&!Ya.includes(t))return le(e,403,"Forbidden origin");X(e,{localToken:Vb()})}function Iw(r,e,t=null,n="ws"){mi.set(r,{socketId:r,ip:e,deviceId:t,type:n,connectedAt:Date.now()}),Tt("connections",{connections:[...mi.values()]}),Dw()}function Nw(r){mi.delete(r),Tt("connections",{connections:[...mi.values()]}),Dw()}async function Dw(){try{(await Promise.resolve().then(()=>(Cl(),Tl))).onConnectionChange(mi.size)}catch{}}function Lw(r,e){e.setHeader("Content-Type","text/event-stream"),e.setHeader("Cache-Control","no-cache"),e.setHeader("Connection","keep-alive"),e.writeHead(200),e.write(`data: ${JSON.stringify({type:"state",...gn})}
|
|
87
87
|
|
|
88
|
-
`),e.write(`data: ${JSON.stringify({type:"connections",connections:[...
|
|
88
|
+
`),e.write(`data: ${JSON.stringify({type:"connections",connections:[...mi.values()]})}
|
|
89
89
|
|
|
90
|
-
`),e.write(`data: ${JSON.stringify({type:"permissions",...Or,desktopEnabled
|
|
90
|
+
`),e.write(`data: ${JSON.stringify({type:"permissions",...Or,desktopEnabled:$t})}
|
|
91
91
|
|
|
92
|
-
`),
|
|
92
|
+
`),Al&&e.write(`data: ${JSON.stringify({type:"updateAvailable",...Al})}
|
|
93
93
|
|
|
94
|
-
`),Cl.add(e),r.on("close",()=>Cl.delete(e))}function Mw(r,e){X(e,{...gn,...Or,desktopEnabled:qt,remoteAvailable:fh})}async function Pw(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(Lt(),Li)),n=await t(r,e);n&&(vn(n),X(e))}function Iw(r,e){X(e),vn({step:Jn.PREPARING,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null}),qn("restart-tunnel")}function Nw(r,e){X(e),vn({step:Jn.PREPARING,stepDesc:""}),qn("start-tunnel")}function Dw(r,e){X(e),vn({step:Jn.STOPPED,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null}),qn("stop-tunnel")}function Lw(r,e){X(e),vn({step:Jn.STOPPED,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null}),qn("shutdown")}function Bw(r,e){X(e),qn("update")}function jw(r,e){X(e,{connections:[...di.values()]})}function Fw(r,e){let t=new URL(r.url,"http://localhost"),n=parseInt(t.searchParams.get("lines")||Mp,10);X(e,{logs:Bv(Number.isFinite(n)?n:Mp)})}async function Hw(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(Lt(),Li)),n=await t(r,e);if(!n)return;let i=!!n.enabled;if(i&&(!Or.screenRecording||!Or.accessibility)){X(e,{ok:!1,enabled:qt,reason:"permissions_required"});return}let s=Es();qt=i,ph(),Et("permissions",{...Or,desktopEnabled:qt}),Es()!==s&&dh?.(),X(e,{ok:!0,enabled:qt})}function qw(r,e){X(e,Or)}async function Uw(r,e){let t=await rh();X(e,{enabled:t})}async function $w(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(Lt(),Li)),n=await t(r,e);if(!n)return;let i=await uw(!!n.enabled),s=await rh();Et("autostart",{enabled:s}),X(e,{ok:i,enabled:s})}async function Ww(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(Lt(),Li)),n=await t(r,e);if(!n)return;let{type:i}=n;if(process.platform==="darwin"){nw(i);let s=Date.now(),o=setInterval(async()=>{((await Al())[i]||Date.now()-s>Ov)&&clearInterval(o)},Rv)}X(e)}var Un,vw,uh,gn,qt,fh,Or,Cl,di,kl,dh,yn=Ce(()=>{bt();ji();bt();xs();iw();nh();Lt();dl();bt();Un=require("fs"),vw=require("path");bt();ih();uh=(0,vw.join)(ie.STATE,"ui-state.json");gn={step:Jn.STOPPED,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null,permanentKey:"",qrUrl:"",latency:null,uptime:null,healthCheck:{running:!1,timeoutMs:0,startedAt:null,logs:[]},tunnelHealth:{status:"unknown",checkedAt:null}},qt=!1,fh=!1,Or={screenRecording:!1,accessibility:!1},Cl=new Set,di=new Map;Lv(xe);kl=null;dh=null});var Gw={};en(Gw,{ScreenHandler:()=>hh,encodeTilesBatch:()=>Ts});function vB(r){let e=Buffer.alloc(28);return e.writeUInt32LE(r.tileIndex,0),e.writeUInt32LE(r.x,4),e.writeUInt32LE(r.y,8),e.writeUInt32LE(r.width,12),e.writeUInt32LE(r.height,16),e.writeUInt32LE(r.imageBuffer.length,20),e.writeUInt32LE(r.hash>>>0,24),Buffer.concat([e,r.imageBuffer])}function Ts(r,e){let t=Buffer.alloc(12);return t.writeUInt32LE(r.length,0),t.writeDoubleBE(e,4),Buffer.concat([t,...r.map(vB)])}var hh,mh=Ce(()=>{Xd();pt();yn();hh=class{constructor(e,t){this.resourceManager=e,this.screenUpdateHelper=t}setupScreenHandlers(e,t,n){e.on("request-screen",t(async()=>{let i=this.resourceManager.getClient(e.id);if(i)try{let s=await i.tileManager.detectChangedTiles();s.length>0&&n.sendTiles({tiles:s,timestamp:Date.now()},Ts),this.resourceManager.updateClientActivity(e.id)}catch(s){ve.error("Tile capture error:",s),n.emit("screen-error",{error:s.message})}})),e.on("request-screen-with-hashes",t(async i=>{let s=this.resourceManager.getClient(e.id);if(s)try{let o=i.tileHashes||[],a=await s.tileManager.compareClientTileHashes(o);a?.tiles?.length>0&&n.sendTiles({tiles:a.tiles,timestamp:Date.now()},Ts),this.resourceManager.updateClientActivity(e.id)}catch(o){ve.error("Tile capture with hashes error:",o),n.emit("screen-error",{error:o.message})}})),e.on("start-streaming",t(async()=>{let i=this.resourceManager.getClient(e.id);if(!i)return;i.streamingTimeout&&(clearTimeout(i.streamingTimeout),i.streamingTimeout=null),ve.lifecycle("\u{1F680} Remote streaming started");let{tileFormat:s,webpEffort:o,jpegQuality:a}=$.pipeline;xe(`\u{1F5BC}\uFE0F Remote stream codec: ${s.toUpperCase()}${s==="webp"?` (effort=${o})`:""} q=${a}`),i.idleFrameCount=0,i.isStreaming=!0,i.streamGen=(i.streamGen||0)+1;let c=i.streamGen;i.tileManager.lastTileChecksums.clear();try{let u=await i.tileManager.getScreenDimensions();n.emit("screen-dimensions",u)}catch(u){ve.error("Get dimensions error:",u)}let l=async()=>{if(!e.connected||!i.isStreaming||i.streamGen!==c){i.streamingTimeout=null;return}try{let u=performance.now(),f=await i.tileManager.detectChangedTilesWithHashes();if(f.tiles.length>0&&e.connected){let R=n.sendTiles({tiles:f.tiles,timestamp:Date.now(),currentHashes:f.currentHashes},Ts);i.tileManager.commitHashes(R||[]),i.idleFrameCount=0}else i.idleFrameCount++;let{activeInterval:h,idleInterval:g,idleThreshold:x}=this.resourceManager.getStreamingConfig(),S=i.idleFrameCount>=x?g:h,k=Math.max(0,S-(performance.now()-u));i.streamingTimeout=setTimeout(l,k)}catch(u){ve.error("Auto streaming error:",u),i.streamingTimeout=setTimeout(l,200)}};l()})),e.on("stop-streaming",()=>{let i=this.resourceManager.getClient(e.id);i&&(i.isStreaming=!1,i.streamingTimeout&&(clearTimeout(i.streamingTimeout),i.streamingTimeout=null),i.tileManager?.clearMemory?.(),ve.lifecycle("\u23F9\uFE0F Remote streaming stopped"))}),e.on("get-screen-dimensions",t(async()=>{let i=this.resourceManager.getClient(e.id);if(i)try{let s=await i.tileManager.getScreenDimensions();n.emit("screen-dimensions",s)}catch(s){ve.error("Get dimensions error:",s),n.emit("screen-error",{error:s.message})}})),e.on("boost-stream",t(()=>{let i=this.resourceManager.getClient(e.id);i&&(i.idleFrameCount=0)})),e.on("set-focus",t(i=>{let s=this.resourceManager.getClient(e.id);if(!s)return;let o=i?.rect||null,a=typeof i?.zoom=="number"?i.zoom:1,c=typeof i?.viewerWidth=="number"?i.viewerWidth:0,l=typeof i?.dpr=="number"?i.dpr:1,u=s.tileManager.pickProfile({zoom:a,viewerWidth:c,dpr:l});if(s.tileManager.setProfile(u),s.tileManager.setFocusRect(o),o){let f=s.tileManager.activeTileSet?.size||0,h=s.tileManager.totalTiles,g=h?(f/h*100).toFixed(0):0;ve.focus(`\u{1F3AF} [Focus] rect=${o.x},${o.y} ${o.w}x${o.h} | tiles ${f}/${h} (${g}%)`)}else ve.focus("\u{1F3AF} [Focus] cleared \u2192 full screen")}))}}});function zw(r){gh.add(r)}function Cs(r){gh.delete(r)}function yt(r,e,t){for(let n of gh)if(n.hasReadyAdapter?.())try{n.emit(e,t)}catch{}}var gh,hi=Ce(()=>{gh=new Set});async function aS(){if(ea)return ea;let r=await import("node-screenshots");if(ea=(r.Monitor||r.default?.Monitor).all()[0],!ea)throw new Error("No monitor found via node-screenshots");return ea}async function cS(r){Sh=r,$.pipeline.captureLib==="nodeScreenshots"&&await aS()}async function lS(){let{captureLib:r,inputFormat:e}=$.pipeline;if(r==="robotjs"){let{width:s,height:o}=Sh.getScreenSize(),a=Sh.screen.capture(0,0,s,o),c=a.byteWidth/a.bytesPerPixel;return{buffer:Buffer.from(a.image),width:c,height:a.height,channels:a.bytesPerPixel,format:e}}let n=await(await aS()).captureImage();return{buffer:await n.toRaw(),width:n.width,height:n.height,channels:4,format:e}}var Sh,ea,uS=Ce(()=>{pt();Sh=null,ea=null});function MB(r){return r==="bgra"?Th.FORMAT_BGRA:Th.FORMAT_RGBA}function Ch(r){let e=new Uint32Array(r.buffer,r.byteOffset,r.length>>2);for(let t=0;t<e.length;t++){let n=e[t];e[t]=n&4278255360|(n&16711680)>>16|(n&255)<<16}}async function pS(r,e,t,n=4,i,s){let{encoder:o,inputFormat:a,jpegQuality:c,tileFormat:l,webpEffort:u}=$.pipeline,f=i??c,h=s??a;if(o==="jpegTurbo"&&l!=="webp")return Th.compressSync(r,{width:e,height:t,format:MB(h),quality:f});let g=r;h==="bgra"&&(g=Buffer.from(r),Ch(g));let x=(0,Fl.default)(g,{raw:{width:e,height:t,channels:n}});return l==="webp"?x.webp({quality:f,effort:u}).toBuffer():x.jpeg({quality:f}).toBuffer()}var Fl,Eh,Th,fS=Ce(()=>{Fl=K(require("sharp"),1),Eh=K(require("@julusian/jpeg-turbo"),1);pt();Th=Eh.default.default||Eh.default;Fl.default.cache(!1);Fl.default.concurrency(1)});var Hl,dS=Ce(()=>{pt();yn();Hl=class{constructor(){this.cfg=$.logging,this.samples=[],this.lastLogTime=Date.now()}now(){return this.cfg.metrics?performance.now():0}record({capture:e,checksum:t,encode:n,total:i,changedTiles:s,totalTiles:o,tileBytes:a,rawBytes:c}){this.cfg.metrics&&(this.samples.push({capture:e,checksum:t,encode:n,total:i,changedTiles:s,totalTiles:o,tileBytes:a,rawBytes:c}),this.samples.length>=this.cfg.metricsEveryFrames&&this._flush())}_flush(){let e=this.samples.length,t=I=>(this.samples.reduce((B,V)=>B+V[I],0)/e).toFixed(1),n=(Date.now()-this.lastLogTime)/1e3,i=(e/n).toFixed(1),s=[],o=0;for(let I of this.samples){for(let B of I.tileBytes)s.push(B);o+=I.tileBytes.reduce((B,V)=>B+V,0)}let a=(o/e/1024).toFixed(1),c=s.length?(s.reduce((I,B)=>I+B,0)/s.length/1024).toFixed(2):"0",l=s.length?(Math.min(...s)/1024).toFixed(2):"0",u=s.length?(Math.max(...s)/1024).toFixed(2):"0",f=this.samples.reduce((I,B)=>I+B.rawBytes,0)/e,h=o/e,g=h>0?(f/h).toFixed(0):"0",x=(this.samples.reduce((I,B)=>I+B.changedTiles,0)/e).toFixed(0),S=this.samples[0]?.totalTiles||0,k=S?(x/S*100).toFixed(1):"0",R=$.pipeline,M=`[Metrics] ${R.captureLib}+${R.encoder} tile=${R.tileSize} q${R.jpegQuality} scale=${R.outputScale} | fps=${i} | capture=${t("capture")}ms enc=${t("encode")}ms total=${t("total")}ms | tiles=${x}/${S} (${k}%) | data=${a}KB/frame | tileAvg=${c}KB (min ${l}, max ${u}) | compress=${g}x`;xe(M),console.log(M),this.samples=[],this.lastLogTime=Date.now()}}});var gS={};en(gS,{TileManager:()=>kh,mapLimit:()=>gi});async function gi(r,e,t){let n=new Array(r.length),i=0,s=Math.min(e,r.length),o=Array.from({length:s},async(a,c)=>{for(;i<r.length;){let l=i++;n[l]=await t(r[l],l,c)}});return await Promise.all(o),n}var Rs,Ul,hS,ql,mS,PB,IB,kh,vS=Ce(()=>{Rs=K(require("fs"),1),Ul=K(require("path"),1),hS=K(require("sharp"),1),ql=require("child_process"),mS=require("url");pt();uS();fS();dS();Xd();PB=(0,mS.fileURLToPath)(__importMetaUrl),IB=Ul.default.dirname(PB);kh=class{constructor(e){this.robot=e,this.metrics=new Hl,this.tileSize=$.pipeline.tileSize,this.lastTileChecksums=new Map,this.screenWidth=0,this.screenHeight=0,this.tilesPerRow=0,this.tilesPerColumn=0,this.totalTiles=0,this.frameCount=0,this.tempDir=Ul.default.join(IB,"../../temp"),this.changeThreshold=1,this.scaledWidth=0,this.scaledHeight=0,this.isProcessing=!1,this.sharedScreenCache=null,this.lastCaptureTime=0,this.CACHE_TTL=100,this.dpiScale=1,this.captureWidth=0,this.captureHeight=0,this.scaleFactor=$.pipeline.outputScale||1,this.compressionQuality=$.pipeline.jpegQuality,this.activeTileSet=null,this.focusStats={frames:0,scanned:0,changed:0,bytes:0},this._scratchExtract=[],this._scratchSwap=[],this._prefetchCapture=null,Rs.default.existsSync(this.tempDir)||Rs.default.mkdirSync(this.tempDir,{recursive:!0}),cS(e),this.initializeScreenDimensions()}initializeScreenDimensions(){try{let{width:e,height:t}=this.robot.getScreenSize();this.screenWidth=e,this.screenHeight=t,this.detectDpiScale(),this.scaledWidth=this.captureWidth,this.scaledHeight=this.captureHeight,this.tilesPerRow=Math.ceil(this.scaledWidth/this.tileSize),this.tilesPerColumn=Math.ceil(this.scaledHeight/this.tileSize),this.totalTiles=this.tilesPerRow*this.tilesPerColumn;let n=100;if(this.totalTiles>n){let i=Math.ceil(Math.sqrt(this.scaledWidth*this.scaledHeight/n));this.tileSize=Math.max(i,120),this.tilesPerRow=Math.ceil(this.scaledWidth/this.tileSize),this.tilesPerColumn=Math.ceil(this.scaledHeight/this.tileSize),this.totalTiles=this.tilesPerRow*this.tilesPerColumn}}catch(e){ve.error("Screen dimensions error:",e),this.screenWidth=1920,this.screenHeight=1080,this.dpiScale=1,this.captureWidth=1920,this.captureHeight=1080,this.scaledWidth=1728,this.scaledHeight=972,this.tileSize=120,this.tilesPerRow=Math.ceil(this.scaledWidth/this.tileSize),this.tilesPerColumn=Math.ceil(this.scaledHeight/this.tileSize),this.totalTiles=this.tilesPerRow*this.tilesPerColumn}}detectDpiScale(){if(process.platform==="darwin"){let e=this.robot.screen.capture(0,0,this.screenWidth,this.screenHeight),n=e.byteWidth/e.bytesPerPixel/this.screenWidth;n>=1.9&&n<=2.1?this.dpiScale=2:this.dpiScale=1}else process.platform==="win32"?this.dpiScale=this._detectDpiScaleWin32():this.dpiScale=1;this.captureWidth=Math.floor(this.screenWidth*this.dpiScale),this.captureHeight=Math.floor(this.screenHeight*this.dpiScale)}_detectDpiScaleWin32(){ve.dpi(`\u{1F50D} [DPI Detection] screenWidth from robot: ${this.screenWidth}x${this.screenHeight}`);try{let e=(0,ql.execSync)(`powershell -NonInteractive -NoProfile -WindowStyle Hidden -command "try{Get-ItemPropertyValue 'HKCU:\\Control Panel\\Desktop\\WindowMetrics' -Name AppliedDPI}catch{0}"`,{encoding:"utf8",windowsHide:!0}).trim(),t=Number(e);if(ve.dpi(`\u{1F50D} [DPI Detection] Strategy 1 (Registry AppliedDPI): ${t} DPI`),t>=96){let n=t/96;return ve.dpi(`\u2705 [DPI Detection] Using registry scale: ${n}x (${t}/96)`),n}}catch(e){ve.dpi(`\u274C [DPI Detection] Strategy 1 failed: ${e.message}`)}try{let e=(0,ql.execSync)('powershell -NonInteractive -NoProfile -WindowStyle Hidden -command "(Get-WmiObject -Class Win32_VideoController | Select-Object -First 1).CurrentHorizontalResolution"',{encoding:"utf8",windowsHide:!0}).trim(),t=Number(e);if(ve.dpi(`\u{1F50D} [DPI Detection] Strategy 2 (WMI): physical width = ${t}px`),t>0&&t>this.screenWidth){let n=t/this.screenWidth;return ve.dpi(`\u2705 [DPI Detection] Using WMI scale: ${n}x (${t}/${this.screenWidth})`),n}}catch(e){ve.dpi(`\u274C [DPI Detection] Strategy 2 failed: ${e.message}`)}try{let e=(0,ql.execSync)(`powershell -NonInteractive -NoProfile -WindowStyle Hidden -command "Add-Type -TypeDefinition 'using System;using System.Runtime.InteropServices;public class Disp{[DllImport(\\"user32\\")]public static extern bool EnumDisplaySettings(string d,int m,ref DEVMODE dm);[StructLayout(LayoutKind.Sequential,CharSet=CharSet.Ansi)]public struct DEVMODE{[MarshalAs(UnmanagedType.ByValTStr,SizeConst=32)]public string dmDeviceName;public short dmSpecVersion,dmDriverVersion,dmSize,dmDriverExtra;public int dmFields;public int dmPositionX,dmPositionY,dmDisplayOrientation,dmDisplayFixedOutput;public short dmColor,dmDuplex,dmYResolution,dmTTOption,dmCollate;[MarshalAs(UnmanagedType.ByValTStr,SizeConst=32)]public string dmFormName;public short dmLogPixels;public int dmBitsPerPel,dmPelsWidth,dmPelsHeight,dmDisplayFlags,dmDisplayFrequency;}}'; $dm=New-Object Disp+DEVMODE; $dm.dmSize=[System.Runtime.InteropServices.Marshal]::SizeOf($dm); [Disp]::EnumDisplaySettings($null,-1,[ref]$dm) | Out-Null; Write-Output $dm.dmPelsWidth"`,{encoding:"utf8",windowsHide:!0}).trim(),t=Number(e);if(ve.dpi(`\u{1F50D} [DPI Detection] Strategy 3 (EnumDisplaySettings): physical width = ${t}px`),t>0&&t>this.screenWidth){let n=t/this.screenWidth;return ve.dpi(`\u2705 [DPI Detection] Using EnumDisplaySettings scale: ${n}x (${t}/${this.screenWidth})`),n}}catch(e){ve.dpi(`\u274C [DPI Detection] Strategy 3 failed: ${e.message}`)}return ve.dpi("\u26A0\uFE0F [DPI Detection] All strategies failed, fallback to 1x"),1}async captureFullScreen(){let e=await lS();return{buffer:e.buffer,width:e.width,height:e.height,channels:e.channels}}async getSharedScreenCapture(){let e=Date.now();return this.sharedScreenCache&&e-this.lastCaptureTime<this.CACHE_TTL?this.sharedScreenCache:(this.sharedScreenCache=await this.captureFullScreen(),this.lastCaptureTime=e,this.sharedScreenCache)}async getCaptureForStreaming(){if(!this._prefetchCapture){let t=await this.captureFullScreen();return this._prefetchCapture=this.captureFullScreen(),t}let e=await this._prefetchCapture;return this._prefetchCapture=this.captureFullScreen(),e}clearScreenCache(){}async detectChangedTiles(){return(await this.detectChangedTilesWithHashes()).tiles}async detectChangedTilesWithHashes(){if(this.isProcessing)return{tiles:[],currentHashes:Array.from(this.lastTileChecksums.values())};this.isProcessing=!0;let e=this.metrics.now(),t=e,n=e;try{let i=await this.getCaptureForStreaming();t=this.metrics.now();let s=[],o=[],a=new Map;this.frameCount++;let c=this.activeTileSet;for(let f=0;f<this.totalTiles;f++){if(c&&!c.has(f))continue;let h=this.calculateTileChecksumDirect(i,f);a.set(f,h)}n=this.metrics.now();let l=Array.from(a.values());if(this.lastTileChecksums.size===0){let f=[];for(let g=0;g<this.totalTiles;g++)c&&!c.has(g)||f.push(g);let h=await gi(f,$.pipeline.tileConcurrency,(g,x,S)=>this.processTileAsync(i,g,null,a.get(g),S));return s.push(...h),this._recordFrame(e,t,n,s,i),{tiles:s,currentHashes:l}}for(let f=0;f<this.totalTiles;f++){if(c&&!c.has(f))continue;let h=a.get(f),g=this.lastTileChecksums.get(f);h!==g&&o.push(f)}if(o.length/this.totalTiles>this.changeThreshold){let f=[];for(let g=0;g<this.totalTiles;g++)c&&!c.has(g)||f.push(g);let h=await gi(f,$.pipeline.tileConcurrency,(g,x,S)=>this.processTileAsync(i,g,null,a.get(g),S));s.push(...h.map(g=>({...g,fullRefresh:!0})))}else if(o.length>0){let f=await gi(o,$.pipeline.tileConcurrency,(h,g,x)=>this.processTileAsync(i,h,null,a.get(h),x));s.push(...f)}return this._recordFrame(e,t,n,s,i),{tiles:s,currentHashes:l}}finally{this.isProcessing=!1}}async processTileAsync(e,t,n=null,i=null,s=null){let o=n||this.extractTile(e,t,s),a=await this.compressTileImage(o.buffer,o.width,o.height,s),{row:c,col:l}=this.getTilePosition(t);return{type:"tile-update",tileIndex:t,x:l*this.tileSize,y:c*this.tileSize,width:o.width,height:o.height,imageBuffer:a,hash:i??this.lastTileChecksums.get(t)??0,timestamp:Date.now(),frameCount:this.frameCount}}commitHashes(e){for(let t of e)this.lastTileChecksums.set(t.tileIndex,t.hash)}calculateTileChecksumDirect(e,t){let{row:n,col:i}=this.getTilePosition(t),s=i*this.tileSize,o=n*this.tileSize,a=Math.min(s+this.tileSize,e.width),c=Math.min(o+this.tileSize,e.height),l=a-s,u=c-o,f=e.channels,h=e.width*f,g=0,{rowStep:x,colStep:S}=$.pipeline.checksumSampling;for(let k=0;k<u;k+=x){let R=(o+k)*h+s*f;for(let M=0;M<l;M+=S){let I=R+M*f,B=M+1;g=g+e.buffer[I]*B>>>0,g^=e.buffer[I+1]<<1,g=g+e.buffer[I+2]*B>>>0,g^=e.buffer[I+3]<<2}}return g>>>0}setFocusRect(e){if(!e){this.activeTileSet=null;return}let t=$.focus.paddingTiles,n=Math.max(0,Math.floor(e.x/this.tileSize)-t),i=Math.max(0,Math.floor(e.y/this.tileSize)-t),s=Math.min(this.tilesPerRow-1,Math.floor((e.x+e.w)/this.tileSize)+t),o=Math.min(this.tilesPerColumn-1,Math.floor((e.y+e.h)/this.tileSize)+t),a=new Set;for(let l=i;l<=o;l++)for(let u=n;u<=s;u++)a.add(l*this.tilesPerRow+u);let c=this.activeTileSet;if(c)for(let l of a)c.has(l)||this.lastTileChecksums.delete(l);this.activeTileSet=a}getTilePosition(e){return{row:Math.floor(e/this.tilesPerRow),col:e%this.tilesPerRow}}_getScratch(e,t,n){let i=e[t];return(!i||i.length<n)&&(i=Buffer.allocUnsafe(n),e[t]=i),i.subarray(0,n)}extractTile(e,t,n=null){let{row:i,col:s}=this.getTilePosition(t),o=s*this.tileSize,a=i*this.tileSize,c=Math.min(o+this.tileSize,e.width),l=Math.min(a+this.tileSize,e.height),u=c-o,f=l-a,h=e.channels,g=u*h,x=u*f*h,S=n===null?Buffer.allocUnsafe(x):this._getScratch(this._scratchExtract,n,x);for(let k=0;k<f;k++){let R=((a+k)*e.width+o)*h,M=k*g;e.buffer.copy(S,M,R,R+g)}return{buffer:S,width:u,height:f,channels:h,tileIndex:t,x:o,y:a}}async compressTileImage(e,t,n,i=null){let s=this.scaleFactor;if(s&&s>0&&s<1){let o=Math.max(1,Math.floor(t*s)),a=Math.max(1,Math.floor(n*s)),{inputFormat:c}=$.pipeline,l=e,u=4;c==="bgra"&&(i===null?l=Buffer.from(e):(l=this._getScratch(this._scratchSwap,i,e.length),e.copy(l)),Ch(l));let{tileFormat:f,webpEffort:h}=$.pipeline,g=(0,hS.default)(l,{raw:{width:t,height:n,channels:u}}).resize(o,a,{kernel:"lanczos3",fastShrinkOnLoad:!1});return f==="webp"?g.webp({quality:this.compressionQuality,effort:h}).toBuffer():g.jpeg({quality:this.compressionQuality}).toBuffer()}return pS(e,t,n,4,this.compressionQuality)}pickProfile({zoom:e=1,viewerWidth:t=0,dpr:n=1}={}){let i=$.pipeline.adaptiveTiers||[];if(!i.length)return null;let s=this.captureWidth||this.screenWidth||1,o=t>0?t:s,a=e>0?e:1,c=n>0?n:1,l=o*a*c/s,u=$.pipeline.tierHysteresis||0,f=this._currentTier;for(let g of i){let x=f&&g===f?g.minEffective-u:g.minEffective;if(l>=x)return this._currentTier=g,g}let h=i[i.length-1];return this._currentTier=h,h}setProfile(e){if(!e)return;let t=e.outputScale??this.scaleFactor,n=e.jpegQuality??this.compressionQuality;t===this.scaleFactor&&n===this.compressionQuality||(this.scaleFactor=t,this.compressionQuality=n,this.lastTileChecksums.clear())}_recordFrame(e,t,n,i,s){if(this._recordFocusFrame(i),!this.metrics.cfg.metrics)return;let o=this.metrics.now(),a=i.map(l=>l.imageBuffer?.length||0),c=s?s.width*s.height*s.channels:0;this.metrics.record({capture:t-e,checksum:n-t,encode:o-n,total:o-e,changedTiles:i.length,totalTiles:this.totalTiles,tileBytes:a,rawBytes:c})}_recordFocusFrame(e){let t=this.focusStats;t.frames++,t.scanned+=this.activeTileSet?this.activeTileSet.size:this.totalTiles,t.changed+=e.length;for(let c of e)t.bytes+=c.imageBuffer?.length||0;if(t.frames<$.logging.focusEveryFrames)return;let n=(t.scanned/t.frames).toFixed(0),i=(t.changed/t.frames).toFixed(1),s=(t.bytes/t.frames/1024).toFixed(1),o=this.totalTiles?((1-n/this.totalTiles)*100).toFixed(0):0,a=this.activeTileSet?"focus":"full";ve.focus(`\u{1F3AF} [Focus/${a}] ${t.frames}f | scan ${n}/${this.totalTiles} tiles (saved ${o}%) | changed ${i}/f | data ${s}KB/f`),this.focusStats={frames:0,scanned:0,changed:0,bytes:0}}async getScreenDimensions(){try{let e=await this.captureFullScreen();this.scaledWidth=e.width,this.scaledHeight=e.height,this.tilesPerRow=Math.ceil(e.width/this.tileSize),this.tilesPerColumn=Math.ceil(e.height/this.tileSize),this.totalTiles=this.tilesPerRow*this.tilesPerColumn}catch(e){ve.error("Error getting dimensions:",e)}return{width:this.scaledWidth,height:this.scaledHeight,tileWidth:this.tileSize,tileHeight:this.tileSize,tileCount:this.totalTiles,scaleFactor:this.scaleFactor,originalWidth:this.screenWidth,originalHeight:this.screenHeight}}async compareClientTileHashes(e){if(this.isProcessing)return{tiles:[],currentHashes:[],changedIndices:[]};this.isProcessing=!0;try{let t=await this.getSharedScreenCapture(),n=[],i=[];this.frameCount++;let s=this.activeTileSet,o=new Map;for(let c=0;c<this.totalTiles;c++){if(s&&!s.has(c))continue;let l=this.calculateTileChecksumDirect(t,c);o.set(c,l),this.lastTileChecksums.set(c,l)}if(!e||e.length===0){let c=[];for(let u=0;u<this.totalTiles;u++)s&&!s.has(u)||c.push(u);let l=await gi(c,$.pipeline.tileConcurrency,u=>this.processTileAsync(t,u));return n.push(...l),{tiles:n,currentHashes:Array.from(o.values())}}for(let c=0;c<this.totalTiles;c++)s&&!s.has(c)||e[c]!==o.get(c)&&i.push(c);if(i.length/this.totalTiles>this.changeThreshold){let c=[];for(let u=0;u<this.totalTiles;u++)s&&!s.has(u)||c.push(u);let l=await gi(c,$.pipeline.tileConcurrency,u=>this.processTileAsync(t,u));n.push(...l.map(u=>({...u,fullRefresh:!0})))}else if(i.length>0){let c=await gi(i,$.pipeline.tileConcurrency,l=>this.processTileAsync(t,l));n.push(...c)}return this._recordFocusFrame(n),{tiles:n,currentHashes:Array.from(o.values()),changedIndices:i}}finally{this.isProcessing=!1}}clearMemory(){this.sharedScreenCache=null,this.lastCaptureTime=0,this.lastTileChecksums.clear(),this._scratchExtract=[],this._scratchSwap=[],this._traceFrames=50,this._prefetchCapture=null}reset(){this.lastTileChecksums.clear(),this.frameCount=0}cleanup(){try{Rs.default.existsSync(this.tempDir)&&Rs.default.readdirSync(this.tempDir).forEach(t=>Rs.default.unlinkSync(Ul.default.join(this.tempDir,t)))}catch(e){ve.warn(`Cleanup error: ${e.message}`)}}}});var yS={};en(yS,{ResourceManager:()=>Ah});var Ah,xS=Ce(()=>{pt();hi();Ah=class{constructor(){this.activeClients=new Map,this.activeTimers=new Map,this.chunkTimers=new Map,this.memoryCheckInterval=null}startResourceMonitoring(){this.memoryCheckInterval=setInterval(()=>{let e=process.memoryUsage(),t=Math.round(e.heapUsed/1024/1024);t>$.resourceManagement.memoryWarningThreshold&&(console.warn(`\u26A0\uFE0F High memory: ${t}MB`),this.cleanupInactiveClients())},$.resourceManagement.memoryCheckInterval)}stopResourceMonitoring(){this.memoryCheckInterval&&(clearInterval(this.memoryCheckInterval),this.memoryCheckInterval=null)}addClient(e,t){this.activeClients.set(e,{...t,lastActivity:Date.now()})}getClient(e){return this.activeClients.get(e)}updateClientActivity(e){let t=this.activeClients.get(e);t&&(t.lastActivity=Date.now())}cleanupInactiveClients(){let e=Date.now(),t=$.resourceManagement.inactiveTimeout;for(let[n,i]of this.activeClients.entries())e-i.lastActivity>t&&(console.log(`\u{1F9F9} Cleaning inactive client: ${n}`),this.cleanupClientResources(n,i),this.activeClients.delete(n))}cleanupClientResources(e,t){try{t.isStreaming=!1,t?.streamingTimeout&&(clearTimeout(t.streamingTimeout),t.streamingTimeout=null),t?.screenInterval&&(clearInterval(t.screenInterval),t.screenInterval=null);let n=this.activeTimers.get(e);n&&(n.forEach(s=>clearTimeout(s)),this.activeTimers.delete(e));let i=this.chunkTimers.get(e);i&&(i.forEach(s=>clearTimeout(s)),this.chunkTimers.delete(e)),t?.tileManager&&(t.tileManager.clearMemory(),t.tileManager.cleanup(),t.tileManager.reset()),t?.protocol&&(t.protocol.close(),Cs(t.protocol))}catch(n){console.error(`Error cleaning up ${e}:`,n.message)}}getStreamingConfig(){return $.streaming}getWebRTCConfig(){return $.webrtc}removeClient(e){let t=this.activeClients.get(e);t&&(this.cleanupClientResources(e,t),this.activeClients.delete(e))}getChunkTimers(e){return this.chunkTimers.has(e)||this.chunkTimers.set(e,new Set),this.chunkTimers.get(e)}cleanupAll(){this.stopResourceMonitoring();for(let[e,t]of this.activeClients.entries())this.cleanupClientResources(e,t);this.activeClients.clear(),this.activeTimers.clear(),this.chunkTimers.clear()}}});var _S={};en(_S,{ScreenUpdateHelper:()=>Rh});var Rh,bS=Ce(()=>{pt();Rh=class{constructor(e){this.resourceManager=e}async sendTilesInChunks(e,t,n,i=!1){if(!t||t.length===0)return;let s=$.streaming.chunkSize,o=[];for(let c=0;c<t.length;c+=s)o.push(t.slice(c,c+s));let a=this.resourceManager.getChunkTimers(e.id);for(let c=0;c<o.length;c++){let l=o[c],u=c===o.length-1,f=setTimeout(()=>{a.delete(f),e.connected&&e.emit("tiles-data",{tiles:l,timestamp:n,forceRefresh:!1,userAction:i,chunkInfo:{chunkIndex:c,totalChunks:o.length,isLastChunk:u}})},c*$.streaming.chunkDelay);a.add(f)}}}});var wS={};en(wS,{MouseHandler:()=>Oh});var Oh,SS=Ce(()=>{pt();Oh=class{constructor(e,t){this.robot=e,this.resourceManager=t,this.lastMouseMove=0}setupMouseHandlers(e,t){let n=this.robot;e.on("mouse-move",t(i=>{let s=Date.now();if(!(s-this.lastMouseMove<$.throttling.mouseThrottle)){this.lastMouseMove=s;try{let o=n.getScreenSize(),a=Math.round(i.x/100*o.width),c=Math.round(i.y/100*o.height),l=Math.max(0,Math.min(o.width-1,a)),u=Math.max(0,Math.min(o.height-1,c));n.moveMouse(l,u),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Mouse move error:",o.message)}}})),e.on("mouse-click",t(async i=>{try{let s=this.resourceManager.getClient(e.id);if(!s)return;let o=n.getScreenSize(),a=Math.round(i.x/100*o.width),c=Math.round(i.y/100*o.height),l=Math.max(0,Math.min(o.width-1,a)),u=Math.max(0,Math.min(o.height-1,c));n.moveMouse(l,u),n.mouseClick(i.button||"left",i.double||!1),s.idleFrameCount=0,this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Mouse click error:",s.message)}})),e.on("mouse-press",t(async i=>{try{if(!this.resourceManager.getClient(e.id))return;let o=n.getScreenSize(),a=Math.round(i.x/100*o.width),c=Math.round(i.y/100*o.height),l=Math.max(0,Math.min(o.width-1,a)),u=Math.max(0,Math.min(o.height-1,c));n.moveMouse(l,u),n.mouseToggle("down",i.button||"left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Mouse press error:",s.message)}})),e.on("mouse-release",t(async i=>{try{if(!this.resourceManager.getClient(e.id))return;let o=n.getScreenSize(),a=Math.round(i.x/100*o.width),c=Math.round(i.y/100*o.height),l=Math.max(0,Math.min(o.width-1,a)),u=Math.max(0,Math.min(o.height-1,c));n.moveMouse(l,u),n.mouseToggle("up",i.button||"left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Mouse release error:",s.message)}})),e.on("scroll",t(async i=>{try{let{direction:s,amount:o=60,horizontal:a=!1}=i,c=this.resourceManager.getClient(e.id);if(!c)return;let l=0,u=0;a||s==="left"||s==="right"?l=s==="right"?o:-o:u=s==="down"?-o:o,n.scrollMouse(l,u),c.idleFrameCount=0,this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Scroll error:",s.message)}})),e.on("mouse-drag-select",t(i=>{try{let{startX:s,startY:o,endX:a,endY:c}=i,l=n.getScreenSize(),u=Math.round(s/100*l.width),f=Math.round(o/100*l.height),h=Math.round(a/100*l.width),g=Math.round(c/100*l.height),x=Math.max(0,Math.min(l.width-1,u)),S=Math.max(0,Math.min(l.height-1,f)),k=Math.max(0,Math.min(l.width-1,h)),R=Math.max(0,Math.min(l.height-1,g));n.moveMouse(x,S),n.mouseToggle("down","left"),n.dragMouse(k,R),n.mouseToggle("up","left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Drag selection error:",s.message)}}))}}});var TS={};en(TS,{KeyboardHandler:()=>Mh});function NB(r){let e;r.type==="missionControl"?e='tell application "System Events" to key code 160':e=`tell application "System Events" to key code ${r.keyCode} using ${r.mods}`,(0,ES.execFile)("osascript",["-e",e],t=>{t&&console.error("osascript error:",t.message)})}var ES,Mh,CS=Ce(()=>{ES=require("child_process");pt();Mh=class{constructor(e,t){this.robot=e,this.resourceManager=t,this.lastKeyPress=0,this.lastTypeText=0}setupKeyboardHandlers(e,t){let n=this.robot;e.on("key-press",t(i=>{let s=Date.now();if(!(s-this.lastKeyPress<$.throttling.keyThrottle)){this.lastKeyPress=s;try{if(!i.key||typeof i.key!="string")return;let o=this.resourceManager.getClient(e.id),a=i.key,c=i.modifier||[];if(a.length===1)if(c.filter(u=>u!=="shift").length>0){n.keyTap(a.toLowerCase(),c);for(let u of c)n.keyToggle(u,"up")}else n.typeString(a);else{let u={return:"enter"}[a.toLowerCase()]??a.toLowerCase();n.keyTap(u,c)}o&&(o.idleFrameCount=0),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Key press error:",o.message)}}})),e.on("desktop-switch",t(i=>{try{let s=i?.direction,o=$.desktopSwitch[process.platform]?.[s];if(!o)return;process.platform==="darwin"?NB(o):n.keyTap(o[0],o[1]);let a=this.resourceManager.getClient(e.id);a&&(a.idleFrameCount=0),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Desktop switch error:",s.message)}})),e.on("type-text",t(i=>{let s=Date.now();if(!(s-this.lastTypeText<$.throttling.typeTextThrottle)){this.lastTypeText=s;try{if(!i.text||typeof i.text!="string")return;let o=i.text;o.length>$.throttling.maxTextLength&&(o=o.substring(0,$.throttling.maxTextLength));let a=o.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g,""),c=this.resourceManager.getClient(e.id);setTimeout(()=>{try{n.typeString(a),this.resourceManager.updateClientActivity(e.id),c&&(c.idleFrameCount=0,c.tileManager&&c.tileManager.clearScreenCache())}catch(l){console.error("Robot typeString error:",l.message)}},10)}catch(o){console.error("Type text error:",o.message)}}}))}}});var $h=A((nE,Uh)=>{(function(r,e){"use strict";function t(T,p){if(!T)throw new Error(p||"Assertion failed")}function n(T,p){T.super_=p;var m=function(){};m.prototype=p.prototype,T.prototype=new m,T.prototype.constructor=T}function i(T,p,m){if(i.isBN(T))return T;this.negative=0,this.words=null,this.length=0,this.red=null,T!==null&&((p==="le"||p==="be")&&(m=p,p=10),this._init(T||0,p||10,m||"be"))}typeof r=="object"?r.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=require("buffer").Buffer}catch{}i.isBN=function(p){return p instanceof i?!0:p!==null&&typeof p=="object"&&p.constructor.wordSize===i.wordSize&&Array.isArray(p.words)},i.max=function(p,m){return p.cmp(m)>0?p:m},i.min=function(p,m){return p.cmp(m)<0?p:m},i.prototype._init=function(p,m,y){if(typeof p=="number")return this._initNumber(p,m,y);if(typeof p=="object")return this._initArray(p,m,y);m==="hex"&&(m=16),t(m===(m|0)&&m>=2&&m<=36),p=p.toString().replace(/\s+/g,"");var w=0;p[0]==="-"&&(w++,this.negative=1),w<p.length&&(m===16?this._parseHex(p,w,y):(this._parseBase(p,m,w),y==="le"&&this._initArray(this.toArray(),m,y)))},i.prototype._initNumber=function(p,m,y){p<0&&(this.negative=1,p=-p),p<67108864?(this.words=[p&67108863],this.length=1):p<4503599627370496?(this.words=[p&67108863,p/67108864&67108863],this.length=2):(t(p<9007199254740992),this.words=[p&67108863,p/67108864&67108863,1],this.length=3),y==="le"&&this._initArray(this.toArray(),m,y)},i.prototype._initArray=function(p,m,y){if(t(typeof p.length=="number"),p.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(p.length/3),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var v,_,C=0;if(y==="be")for(w=p.length-1,v=0;w>=0;w-=3)_=p[w]|p[w-1]<<8|p[w-2]<<16,this.words[v]|=_<<C&67108863,this.words[v+1]=_>>>26-C&67108863,C+=24,C>=26&&(C-=26,v++);else if(y==="le")for(w=0,v=0;w<p.length;w+=3)_=p[w]|p[w+1]<<8|p[w+2]<<16,this.words[v]|=_<<C&67108863,this.words[v+1]=_>>>26-C&67108863,C+=24,C>=26&&(C-=26,v++);return this.strip()};function o(T,p){var m=T.charCodeAt(p);return m>=65&&m<=70?m-55:m>=97&&m<=102?m-87:m-48&15}function a(T,p,m){var y=o(T,m);return m-1>=p&&(y|=o(T,m-1)<<4),y}i.prototype._parseHex=function(p,m,y){this.length=Math.ceil((p.length-m)/6),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var v=0,_=0,C;if(y==="be")for(w=p.length-1;w>=m;w-=2)C=a(p,m,w)<<v,this.words[_]|=C&67108863,v>=18?(v-=18,_+=1,this.words[_]|=C>>>26):v+=8;else{var b=p.length-m;for(w=b%2===0?m+1:m;w<p.length;w+=2)C=a(p,m,w)<<v,this.words[_]|=C&67108863,v>=18?(v-=18,_+=1,this.words[_]|=C>>>26):v+=8}this.strip()};function c(T,p,m,y){for(var w=0,v=Math.min(T.length,m),_=p;_<v;_++){var C=T.charCodeAt(_)-48;w*=y,C>=49?w+=C-49+10:C>=17?w+=C-17+10:w+=C}return w}i.prototype._parseBase=function(p,m,y){this.words=[0],this.length=1;for(var w=0,v=1;v<=67108863;v*=m)w++;w--,v=v/m|0;for(var _=p.length-y,C=_%w,b=Math.min(_,_-C)+y,d=0,E=y;E<b;E+=w)d=c(p,E,E+w,m),this.imuln(v),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(C!==0){var q=1;for(d=c(p,E,p.length,m),E=0;E<C;E++)q*=m;this.imuln(q),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}this.strip()},i.prototype.copy=function(p){p.words=new Array(this.length);for(var m=0;m<this.length;m++)p.words[m]=this.words[m];p.length=this.length,p.negative=this.negative,p.red=this.red},i.prototype.clone=function(){var p=new i(null);return this.copy(p),p},i.prototype._expand=function(p){for(;this.length<p;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(p,m){p=p||10,m=m|0||1;var y;if(p===16||p==="hex"){y="";for(var w=0,v=0,_=0;_<this.length;_++){var C=this.words[_],b=((C<<w|v)&16777215).toString(16);v=C>>>24-w&16777215,w+=2,w>=26&&(w-=26,_--),v!==0||_!==this.length-1?y=l[6-b.length]+b+y:y=b+y}for(v!==0&&(y=v.toString(16)+y);y.length%m!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}if(p===(p|0)&&p>=2&&p<=36){var d=u[p],E=f[p];y="";var q=this.clone();for(q.negative=0;!q.isZero();){var O=q.modn(E).toString(p);q=q.idivn(E),q.isZero()?y=O+y:y=l[d-O.length]+O+y}for(this.isZero()&&(y="0"+y);y.length%m!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}t(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var p=this.words[0];return this.length===2?p+=this.words[1]*67108864:this.length===3&&this.words[2]===1?p+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-p:p},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(p,m){return t(typeof s<"u"),this.toArrayLike(s,p,m)},i.prototype.toArray=function(p,m){return this.toArrayLike(Array,p,m)},i.prototype.toArrayLike=function(p,m,y){var w=this.byteLength(),v=y||Math.max(1,w);t(w<=v,"byte array longer than desired length"),t(v>0,"Requested array length <= 0"),this.strip();var _=m==="le",C=new p(v),b,d,E=this.clone();if(_){for(d=0;!E.isZero();d++)b=E.andln(255),E.iushrn(8),C[d]=b;for(;d<v;d++)C[d]=0}else{for(d=0;d<v-w;d++)C[d]=0;for(d=0;!E.isZero();d++)b=E.andln(255),E.iushrn(8),C[v-d-1]=b}return C},Math.clz32?i.prototype._countBits=function(p){return 32-Math.clz32(p)}:i.prototype._countBits=function(p){var m=p,y=0;return m>=4096&&(y+=13,m>>>=13),m>=64&&(y+=7,m>>>=7),m>=8&&(y+=4,m>>>=4),m>=2&&(y+=2,m>>>=2),y+m},i.prototype._zeroBits=function(p){if(p===0)return 26;var m=p,y=0;return(m&8191)===0&&(y+=13,m>>>=13),(m&127)===0&&(y+=7,m>>>=7),(m&15)===0&&(y+=4,m>>>=4),(m&3)===0&&(y+=2,m>>>=2),(m&1)===0&&y++,y},i.prototype.bitLength=function(){var p=this.words[this.length-1],m=this._countBits(p);return(this.length-1)*26+m};function h(T){for(var p=new Array(T.bitLength()),m=0;m<p.length;m++){var y=m/26|0,w=m%26;p[m]=(T.words[y]&1<<w)>>>w}return p}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var p=0,m=0;m<this.length;m++){var y=this._zeroBits(this.words[m]);if(p+=y,y!==26)break}return p},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(p){return this.negative!==0?this.abs().inotn(p).iaddn(1):this.clone()},i.prototype.fromTwos=function(p){return this.testn(p-1)?this.notn(p).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(p){for(;this.length<p.length;)this.words[this.length++]=0;for(var m=0;m<p.length;m++)this.words[m]=this.words[m]|p.words[m];return this.strip()},i.prototype.ior=function(p){return t((this.negative|p.negative)===0),this.iuor(p)},i.prototype.or=function(p){return this.length>p.length?this.clone().ior(p):p.clone().ior(this)},i.prototype.uor=function(p){return this.length>p.length?this.clone().iuor(p):p.clone().iuor(this)},i.prototype.iuand=function(p){var m;this.length>p.length?m=p:m=this;for(var y=0;y<m.length;y++)this.words[y]=this.words[y]&p.words[y];return this.length=m.length,this.strip()},i.prototype.iand=function(p){return t((this.negative|p.negative)===0),this.iuand(p)},i.prototype.and=function(p){return this.length>p.length?this.clone().iand(p):p.clone().iand(this)},i.prototype.uand=function(p){return this.length>p.length?this.clone().iuand(p):p.clone().iuand(this)},i.prototype.iuxor=function(p){var m,y;this.length>p.length?(m=this,y=p):(m=p,y=this);for(var w=0;w<y.length;w++)this.words[w]=m.words[w]^y.words[w];if(this!==m)for(;w<m.length;w++)this.words[w]=m.words[w];return this.length=m.length,this.strip()},i.prototype.ixor=function(p){return t((this.negative|p.negative)===0),this.iuxor(p)},i.prototype.xor=function(p){return this.length>p.length?this.clone().ixor(p):p.clone().ixor(this)},i.prototype.uxor=function(p){return this.length>p.length?this.clone().iuxor(p):p.clone().iuxor(this)},i.prototype.inotn=function(p){t(typeof p=="number"&&p>=0);var m=Math.ceil(p/26)|0,y=p%26;this._expand(m),y>0&&m--;for(var w=0;w<m;w++)this.words[w]=~this.words[w]&67108863;return y>0&&(this.words[w]=~this.words[w]&67108863>>26-y),this.strip()},i.prototype.notn=function(p){return this.clone().inotn(p)},i.prototype.setn=function(p,m){t(typeof p=="number"&&p>=0);var y=p/26|0,w=p%26;return this._expand(y+1),m?this.words[y]=this.words[y]|1<<w:this.words[y]=this.words[y]&~(1<<w),this.strip()},i.prototype.iadd=function(p){var m;if(this.negative!==0&&p.negative===0)return this.negative=0,m=this.isub(p),this.negative^=1,this._normSign();if(this.negative===0&&p.negative!==0)return p.negative=0,m=this.isub(p),p.negative=1,m._normSign();var y,w;this.length>p.length?(y=this,w=p):(y=p,w=this);for(var v=0,_=0;_<w.length;_++)m=(y.words[_]|0)+(w.words[_]|0)+v,this.words[_]=m&67108863,v=m>>>26;for(;v!==0&&_<y.length;_++)m=(y.words[_]|0)+v,this.words[_]=m&67108863,v=m>>>26;if(this.length=y.length,v!==0)this.words[this.length]=v,this.length++;else if(y!==this)for(;_<y.length;_++)this.words[_]=y.words[_];return this},i.prototype.add=function(p){var m;return p.negative!==0&&this.negative===0?(p.negative=0,m=this.sub(p),p.negative^=1,m):p.negative===0&&this.negative!==0?(this.negative=0,m=p.sub(this),this.negative=1,m):this.length>p.length?this.clone().iadd(p):p.clone().iadd(this)},i.prototype.isub=function(p){if(p.negative!==0){p.negative=0;var m=this.iadd(p);return p.negative=1,m._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(p),this.negative=1,this._normSign();var y=this.cmp(p);if(y===0)return this.negative=0,this.length=1,this.words[0]=0,this;var w,v;y>0?(w=this,v=p):(w=p,v=this);for(var _=0,C=0;C<v.length;C++)m=(w.words[C]|0)-(v.words[C]|0)+_,_=m>>26,this.words[C]=m&67108863;for(;_!==0&&C<w.length;C++)m=(w.words[C]|0)+_,_=m>>26,this.words[C]=m&67108863;if(_===0&&C<w.length&&w!==this)for(;C<w.length;C++)this.words[C]=w.words[C];return this.length=Math.max(this.length,C),w!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(p){return this.clone().isub(p)};function g(T,p,m){m.negative=p.negative^T.negative;var y=T.length+p.length|0;m.length=y,y=y-1|0;var w=T.words[0]|0,v=p.words[0]|0,_=w*v,C=_&67108863,b=_/67108864|0;m.words[0]=C;for(var d=1;d<y;d++){for(var E=b>>>26,q=b&67108863,O=Math.min(d,p.length-1),P=Math.max(0,d-T.length+1);P<=O;P++){var j=d-P|0;w=T.words[j]|0,v=p.words[P]|0,_=w*v+q,E+=_/67108864|0,q=_&67108863}m.words[d]=q|0,b=E|0}return b!==0?m.words[d]=b|0:m.length--,m.strip()}var x=function(p,m,y){var w=p.words,v=m.words,_=y.words,C=0,b,d,E,q=w[0]|0,O=q&8191,P=q>>>13,j=w[1]|0,z=j&8191,H=j>>>13,ke=w[2]|0,ne=ke&8191,N=ke>>>13,te=w[3]|0,L=te&8191,W=te>>>13,oe=w[4]|0,Z=oe&8191,J=oe>>>13,kt=w[5]|0,ae=kt&8191,Ie=kt>>>13,Zg=w[6]|0,Ne=Zg&8191,De=Zg>>>13,Qg=w[7]|0,Le=Qg&8191,Be=Qg>>>13,ev=w[8]|0,je=ev&8191,Fe=ev>>>13,tv=w[9]|0,He=tv&8191,qe=tv>>>13,rv=v[0]|0,Ue=rv&8191,$e=rv>>>13,nv=v[1]|0,We=nv&8191,Ge=nv>>>13,iv=v[2]|0,ze=iv&8191,Ve=iv>>>13,sv=v[3]|0,Ke=sv&8191,Ye=sv>>>13,ov=v[4]|0,Je=ov&8191,Xe=ov>>>13,av=v[5]|0,Ze=av&8191,Qe=av>>>13,cv=v[6]|0,et=cv&8191,tt=cv>>>13,lv=v[7]|0,rt=lv&8191,nt=lv>>>13,uv=v[8]|0,it=uv&8191,st=uv>>>13,pv=v[9]|0,ot=pv&8191,at=pv>>>13;y.negative=p.negative^m.negative,y.length=19,b=Math.imul(O,Ue),d=Math.imul(O,$e),d=d+Math.imul(P,Ue)|0,E=Math.imul(P,$e);var sp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(sp>>>26)|0,sp&=67108863,b=Math.imul(z,Ue),d=Math.imul(z,$e),d=d+Math.imul(H,Ue)|0,E=Math.imul(H,$e),b=b+Math.imul(O,We)|0,d=d+Math.imul(O,Ge)|0,d=d+Math.imul(P,We)|0,E=E+Math.imul(P,Ge)|0;var op=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(op>>>26)|0,op&=67108863,b=Math.imul(ne,Ue),d=Math.imul(ne,$e),d=d+Math.imul(N,Ue)|0,E=Math.imul(N,$e),b=b+Math.imul(z,We)|0,d=d+Math.imul(z,Ge)|0,d=d+Math.imul(H,We)|0,E=E+Math.imul(H,Ge)|0,b=b+Math.imul(O,ze)|0,d=d+Math.imul(O,Ve)|0,d=d+Math.imul(P,ze)|0,E=E+Math.imul(P,Ve)|0;var ap=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(ap>>>26)|0,ap&=67108863,b=Math.imul(L,Ue),d=Math.imul(L,$e),d=d+Math.imul(W,Ue)|0,E=Math.imul(W,$e),b=b+Math.imul(ne,We)|0,d=d+Math.imul(ne,Ge)|0,d=d+Math.imul(N,We)|0,E=E+Math.imul(N,Ge)|0,b=b+Math.imul(z,ze)|0,d=d+Math.imul(z,Ve)|0,d=d+Math.imul(H,ze)|0,E=E+Math.imul(H,Ve)|0,b=b+Math.imul(O,Ke)|0,d=d+Math.imul(O,Ye)|0,d=d+Math.imul(P,Ke)|0,E=E+Math.imul(P,Ye)|0;var cp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(cp>>>26)|0,cp&=67108863,b=Math.imul(Z,Ue),d=Math.imul(Z,$e),d=d+Math.imul(J,Ue)|0,E=Math.imul(J,$e),b=b+Math.imul(L,We)|0,d=d+Math.imul(L,Ge)|0,d=d+Math.imul(W,We)|0,E=E+Math.imul(W,Ge)|0,b=b+Math.imul(ne,ze)|0,d=d+Math.imul(ne,Ve)|0,d=d+Math.imul(N,ze)|0,E=E+Math.imul(N,Ve)|0,b=b+Math.imul(z,Ke)|0,d=d+Math.imul(z,Ye)|0,d=d+Math.imul(H,Ke)|0,E=E+Math.imul(H,Ye)|0,b=b+Math.imul(O,Je)|0,d=d+Math.imul(O,Xe)|0,d=d+Math.imul(P,Je)|0,E=E+Math.imul(P,Xe)|0;var lp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(lp>>>26)|0,lp&=67108863,b=Math.imul(ae,Ue),d=Math.imul(ae,$e),d=d+Math.imul(Ie,Ue)|0,E=Math.imul(Ie,$e),b=b+Math.imul(Z,We)|0,d=d+Math.imul(Z,Ge)|0,d=d+Math.imul(J,We)|0,E=E+Math.imul(J,Ge)|0,b=b+Math.imul(L,ze)|0,d=d+Math.imul(L,Ve)|0,d=d+Math.imul(W,ze)|0,E=E+Math.imul(W,Ve)|0,b=b+Math.imul(ne,Ke)|0,d=d+Math.imul(ne,Ye)|0,d=d+Math.imul(N,Ke)|0,E=E+Math.imul(N,Ye)|0,b=b+Math.imul(z,Je)|0,d=d+Math.imul(z,Xe)|0,d=d+Math.imul(H,Je)|0,E=E+Math.imul(H,Xe)|0,b=b+Math.imul(O,Ze)|0,d=d+Math.imul(O,Qe)|0,d=d+Math.imul(P,Ze)|0,E=E+Math.imul(P,Qe)|0;var up=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(up>>>26)|0,up&=67108863,b=Math.imul(Ne,Ue),d=Math.imul(Ne,$e),d=d+Math.imul(De,Ue)|0,E=Math.imul(De,$e),b=b+Math.imul(ae,We)|0,d=d+Math.imul(ae,Ge)|0,d=d+Math.imul(Ie,We)|0,E=E+Math.imul(Ie,Ge)|0,b=b+Math.imul(Z,ze)|0,d=d+Math.imul(Z,Ve)|0,d=d+Math.imul(J,ze)|0,E=E+Math.imul(J,Ve)|0,b=b+Math.imul(L,Ke)|0,d=d+Math.imul(L,Ye)|0,d=d+Math.imul(W,Ke)|0,E=E+Math.imul(W,Ye)|0,b=b+Math.imul(ne,Je)|0,d=d+Math.imul(ne,Xe)|0,d=d+Math.imul(N,Je)|0,E=E+Math.imul(N,Xe)|0,b=b+Math.imul(z,Ze)|0,d=d+Math.imul(z,Qe)|0,d=d+Math.imul(H,Ze)|0,E=E+Math.imul(H,Qe)|0,b=b+Math.imul(O,et)|0,d=d+Math.imul(O,tt)|0,d=d+Math.imul(P,et)|0,E=E+Math.imul(P,tt)|0;var pp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(pp>>>26)|0,pp&=67108863,b=Math.imul(Le,Ue),d=Math.imul(Le,$e),d=d+Math.imul(Be,Ue)|0,E=Math.imul(Be,$e),b=b+Math.imul(Ne,We)|0,d=d+Math.imul(Ne,Ge)|0,d=d+Math.imul(De,We)|0,E=E+Math.imul(De,Ge)|0,b=b+Math.imul(ae,ze)|0,d=d+Math.imul(ae,Ve)|0,d=d+Math.imul(Ie,ze)|0,E=E+Math.imul(Ie,Ve)|0,b=b+Math.imul(Z,Ke)|0,d=d+Math.imul(Z,Ye)|0,d=d+Math.imul(J,Ke)|0,E=E+Math.imul(J,Ye)|0,b=b+Math.imul(L,Je)|0,d=d+Math.imul(L,Xe)|0,d=d+Math.imul(W,Je)|0,E=E+Math.imul(W,Xe)|0,b=b+Math.imul(ne,Ze)|0,d=d+Math.imul(ne,Qe)|0,d=d+Math.imul(N,Ze)|0,E=E+Math.imul(N,Qe)|0,b=b+Math.imul(z,et)|0,d=d+Math.imul(z,tt)|0,d=d+Math.imul(H,et)|0,E=E+Math.imul(H,tt)|0,b=b+Math.imul(O,rt)|0,d=d+Math.imul(O,nt)|0,d=d+Math.imul(P,rt)|0,E=E+Math.imul(P,nt)|0;var fp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(fp>>>26)|0,fp&=67108863,b=Math.imul(je,Ue),d=Math.imul(je,$e),d=d+Math.imul(Fe,Ue)|0,E=Math.imul(Fe,$e),b=b+Math.imul(Le,We)|0,d=d+Math.imul(Le,Ge)|0,d=d+Math.imul(Be,We)|0,E=E+Math.imul(Be,Ge)|0,b=b+Math.imul(Ne,ze)|0,d=d+Math.imul(Ne,Ve)|0,d=d+Math.imul(De,ze)|0,E=E+Math.imul(De,Ve)|0,b=b+Math.imul(ae,Ke)|0,d=d+Math.imul(ae,Ye)|0,d=d+Math.imul(Ie,Ke)|0,E=E+Math.imul(Ie,Ye)|0,b=b+Math.imul(Z,Je)|0,d=d+Math.imul(Z,Xe)|0,d=d+Math.imul(J,Je)|0,E=E+Math.imul(J,Xe)|0,b=b+Math.imul(L,Ze)|0,d=d+Math.imul(L,Qe)|0,d=d+Math.imul(W,Ze)|0,E=E+Math.imul(W,Qe)|0,b=b+Math.imul(ne,et)|0,d=d+Math.imul(ne,tt)|0,d=d+Math.imul(N,et)|0,E=E+Math.imul(N,tt)|0,b=b+Math.imul(z,rt)|0,d=d+Math.imul(z,nt)|0,d=d+Math.imul(H,rt)|0,E=E+Math.imul(H,nt)|0,b=b+Math.imul(O,it)|0,d=d+Math.imul(O,st)|0,d=d+Math.imul(P,it)|0,E=E+Math.imul(P,st)|0;var dp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(dp>>>26)|0,dp&=67108863,b=Math.imul(He,Ue),d=Math.imul(He,$e),d=d+Math.imul(qe,Ue)|0,E=Math.imul(qe,$e),b=b+Math.imul(je,We)|0,d=d+Math.imul(je,Ge)|0,d=d+Math.imul(Fe,We)|0,E=E+Math.imul(Fe,Ge)|0,b=b+Math.imul(Le,ze)|0,d=d+Math.imul(Le,Ve)|0,d=d+Math.imul(Be,ze)|0,E=E+Math.imul(Be,Ve)|0,b=b+Math.imul(Ne,Ke)|0,d=d+Math.imul(Ne,Ye)|0,d=d+Math.imul(De,Ke)|0,E=E+Math.imul(De,Ye)|0,b=b+Math.imul(ae,Je)|0,d=d+Math.imul(ae,Xe)|0,d=d+Math.imul(Ie,Je)|0,E=E+Math.imul(Ie,Xe)|0,b=b+Math.imul(Z,Ze)|0,d=d+Math.imul(Z,Qe)|0,d=d+Math.imul(J,Ze)|0,E=E+Math.imul(J,Qe)|0,b=b+Math.imul(L,et)|0,d=d+Math.imul(L,tt)|0,d=d+Math.imul(W,et)|0,E=E+Math.imul(W,tt)|0,b=b+Math.imul(ne,rt)|0,d=d+Math.imul(ne,nt)|0,d=d+Math.imul(N,rt)|0,E=E+Math.imul(N,nt)|0,b=b+Math.imul(z,it)|0,d=d+Math.imul(z,st)|0,d=d+Math.imul(H,it)|0,E=E+Math.imul(H,st)|0,b=b+Math.imul(O,ot)|0,d=d+Math.imul(O,at)|0,d=d+Math.imul(P,ot)|0,E=E+Math.imul(P,at)|0;var hp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(hp>>>26)|0,hp&=67108863,b=Math.imul(He,We),d=Math.imul(He,Ge),d=d+Math.imul(qe,We)|0,E=Math.imul(qe,Ge),b=b+Math.imul(je,ze)|0,d=d+Math.imul(je,Ve)|0,d=d+Math.imul(Fe,ze)|0,E=E+Math.imul(Fe,Ve)|0,b=b+Math.imul(Le,Ke)|0,d=d+Math.imul(Le,Ye)|0,d=d+Math.imul(Be,Ke)|0,E=E+Math.imul(Be,Ye)|0,b=b+Math.imul(Ne,Je)|0,d=d+Math.imul(Ne,Xe)|0,d=d+Math.imul(De,Je)|0,E=E+Math.imul(De,Xe)|0,b=b+Math.imul(ae,Ze)|0,d=d+Math.imul(ae,Qe)|0,d=d+Math.imul(Ie,Ze)|0,E=E+Math.imul(Ie,Qe)|0,b=b+Math.imul(Z,et)|0,d=d+Math.imul(Z,tt)|0,d=d+Math.imul(J,et)|0,E=E+Math.imul(J,tt)|0,b=b+Math.imul(L,rt)|0,d=d+Math.imul(L,nt)|0,d=d+Math.imul(W,rt)|0,E=E+Math.imul(W,nt)|0,b=b+Math.imul(ne,it)|0,d=d+Math.imul(ne,st)|0,d=d+Math.imul(N,it)|0,E=E+Math.imul(N,st)|0,b=b+Math.imul(z,ot)|0,d=d+Math.imul(z,at)|0,d=d+Math.imul(H,ot)|0,E=E+Math.imul(H,at)|0;var mp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(mp>>>26)|0,mp&=67108863,b=Math.imul(He,ze),d=Math.imul(He,Ve),d=d+Math.imul(qe,ze)|0,E=Math.imul(qe,Ve),b=b+Math.imul(je,Ke)|0,d=d+Math.imul(je,Ye)|0,d=d+Math.imul(Fe,Ke)|0,E=E+Math.imul(Fe,Ye)|0,b=b+Math.imul(Le,Je)|0,d=d+Math.imul(Le,Xe)|0,d=d+Math.imul(Be,Je)|0,E=E+Math.imul(Be,Xe)|0,b=b+Math.imul(Ne,Ze)|0,d=d+Math.imul(Ne,Qe)|0,d=d+Math.imul(De,Ze)|0,E=E+Math.imul(De,Qe)|0,b=b+Math.imul(ae,et)|0,d=d+Math.imul(ae,tt)|0,d=d+Math.imul(Ie,et)|0,E=E+Math.imul(Ie,tt)|0,b=b+Math.imul(Z,rt)|0,d=d+Math.imul(Z,nt)|0,d=d+Math.imul(J,rt)|0,E=E+Math.imul(J,nt)|0,b=b+Math.imul(L,it)|0,d=d+Math.imul(L,st)|0,d=d+Math.imul(W,it)|0,E=E+Math.imul(W,st)|0,b=b+Math.imul(ne,ot)|0,d=d+Math.imul(ne,at)|0,d=d+Math.imul(N,ot)|0,E=E+Math.imul(N,at)|0;var gp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(gp>>>26)|0,gp&=67108863,b=Math.imul(He,Ke),d=Math.imul(He,Ye),d=d+Math.imul(qe,Ke)|0,E=Math.imul(qe,Ye),b=b+Math.imul(je,Je)|0,d=d+Math.imul(je,Xe)|0,d=d+Math.imul(Fe,Je)|0,E=E+Math.imul(Fe,Xe)|0,b=b+Math.imul(Le,Ze)|0,d=d+Math.imul(Le,Qe)|0,d=d+Math.imul(Be,Ze)|0,E=E+Math.imul(Be,Qe)|0,b=b+Math.imul(Ne,et)|0,d=d+Math.imul(Ne,tt)|0,d=d+Math.imul(De,et)|0,E=E+Math.imul(De,tt)|0,b=b+Math.imul(ae,rt)|0,d=d+Math.imul(ae,nt)|0,d=d+Math.imul(Ie,rt)|0,E=E+Math.imul(Ie,nt)|0,b=b+Math.imul(Z,it)|0,d=d+Math.imul(Z,st)|0,d=d+Math.imul(J,it)|0,E=E+Math.imul(J,st)|0,b=b+Math.imul(L,ot)|0,d=d+Math.imul(L,at)|0,d=d+Math.imul(W,ot)|0,E=E+Math.imul(W,at)|0;var vp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(vp>>>26)|0,vp&=67108863,b=Math.imul(He,Je),d=Math.imul(He,Xe),d=d+Math.imul(qe,Je)|0,E=Math.imul(qe,Xe),b=b+Math.imul(je,Ze)|0,d=d+Math.imul(je,Qe)|0,d=d+Math.imul(Fe,Ze)|0,E=E+Math.imul(Fe,Qe)|0,b=b+Math.imul(Le,et)|0,d=d+Math.imul(Le,tt)|0,d=d+Math.imul(Be,et)|0,E=E+Math.imul(Be,tt)|0,b=b+Math.imul(Ne,rt)|0,d=d+Math.imul(Ne,nt)|0,d=d+Math.imul(De,rt)|0,E=E+Math.imul(De,nt)|0,b=b+Math.imul(ae,it)|0,d=d+Math.imul(ae,st)|0,d=d+Math.imul(Ie,it)|0,E=E+Math.imul(Ie,st)|0,b=b+Math.imul(Z,ot)|0,d=d+Math.imul(Z,at)|0,d=d+Math.imul(J,ot)|0,E=E+Math.imul(J,at)|0;var yp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(yp>>>26)|0,yp&=67108863,b=Math.imul(He,Ze),d=Math.imul(He,Qe),d=d+Math.imul(qe,Ze)|0,E=Math.imul(qe,Qe),b=b+Math.imul(je,et)|0,d=d+Math.imul(je,tt)|0,d=d+Math.imul(Fe,et)|0,E=E+Math.imul(Fe,tt)|0,b=b+Math.imul(Le,rt)|0,d=d+Math.imul(Le,nt)|0,d=d+Math.imul(Be,rt)|0,E=E+Math.imul(Be,nt)|0,b=b+Math.imul(Ne,it)|0,d=d+Math.imul(Ne,st)|0,d=d+Math.imul(De,it)|0,E=E+Math.imul(De,st)|0,b=b+Math.imul(ae,ot)|0,d=d+Math.imul(ae,at)|0,d=d+Math.imul(Ie,ot)|0,E=E+Math.imul(Ie,at)|0;var xp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(xp>>>26)|0,xp&=67108863,b=Math.imul(He,et),d=Math.imul(He,tt),d=d+Math.imul(qe,et)|0,E=Math.imul(qe,tt),b=b+Math.imul(je,rt)|0,d=d+Math.imul(je,nt)|0,d=d+Math.imul(Fe,rt)|0,E=E+Math.imul(Fe,nt)|0,b=b+Math.imul(Le,it)|0,d=d+Math.imul(Le,st)|0,d=d+Math.imul(Be,it)|0,E=E+Math.imul(Be,st)|0,b=b+Math.imul(Ne,ot)|0,d=d+Math.imul(Ne,at)|0,d=d+Math.imul(De,ot)|0,E=E+Math.imul(De,at)|0;var _p=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(_p>>>26)|0,_p&=67108863,b=Math.imul(He,rt),d=Math.imul(He,nt),d=d+Math.imul(qe,rt)|0,E=Math.imul(qe,nt),b=b+Math.imul(je,it)|0,d=d+Math.imul(je,st)|0,d=d+Math.imul(Fe,it)|0,E=E+Math.imul(Fe,st)|0,b=b+Math.imul(Le,ot)|0,d=d+Math.imul(Le,at)|0,d=d+Math.imul(Be,ot)|0,E=E+Math.imul(Be,at)|0;var bp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(bp>>>26)|0,bp&=67108863,b=Math.imul(He,it),d=Math.imul(He,st),d=d+Math.imul(qe,it)|0,E=Math.imul(qe,st),b=b+Math.imul(je,ot)|0,d=d+Math.imul(je,at)|0,d=d+Math.imul(Fe,ot)|0,E=E+Math.imul(Fe,at)|0;var wp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(wp>>>26)|0,wp&=67108863,b=Math.imul(He,ot),d=Math.imul(He,at),d=d+Math.imul(qe,ot)|0,E=Math.imul(qe,at);var Sp=(C+b|0)+((d&8191)<<13)|0;return C=(E+(d>>>13)|0)+(Sp>>>26)|0,Sp&=67108863,_[0]=sp,_[1]=op,_[2]=ap,_[3]=cp,_[4]=lp,_[5]=up,_[6]=pp,_[7]=fp,_[8]=dp,_[9]=hp,_[10]=mp,_[11]=gp,_[12]=vp,_[13]=yp,_[14]=xp,_[15]=_p,_[16]=bp,_[17]=wp,_[18]=Sp,C!==0&&(_[19]=C,y.length++),y};Math.imul||(x=g);function S(T,p,m){m.negative=p.negative^T.negative,m.length=T.length+p.length;for(var y=0,w=0,v=0;v<m.length-1;v++){var _=w;w=0;for(var C=y&67108863,b=Math.min(v,p.length-1),d=Math.max(0,v-T.length+1);d<=b;d++){var E=v-d,q=T.words[E]|0,O=p.words[d]|0,P=q*O,j=P&67108863;_=_+(P/67108864|0)|0,j=j+C|0,C=j&67108863,_=_+(j>>>26)|0,w+=_>>>26,_&=67108863}m.words[v]=C,y=_,_=w}return y!==0?m.words[v]=y:m.length--,m.strip()}function k(T,p,m){var y=new R;return y.mulp(T,p,m)}i.prototype.mulTo=function(p,m){var y,w=this.length+p.length;return this.length===10&&p.length===10?y=x(this,p,m):w<63?y=g(this,p,m):w<1024?y=S(this,p,m):y=k(this,p,m),y};function R(T,p){this.x=T,this.y=p}R.prototype.makeRBT=function(p){for(var m=new Array(p),y=i.prototype._countBits(p)-1,w=0;w<p;w++)m[w]=this.revBin(w,y,p);return m},R.prototype.revBin=function(p,m,y){if(p===0||p===y-1)return p;for(var w=0,v=0;v<m;v++)w|=(p&1)<<m-v-1,p>>=1;return w},R.prototype.permute=function(p,m,y,w,v,_){for(var C=0;C<_;C++)w[C]=m[p[C]],v[C]=y[p[C]]},R.prototype.transform=function(p,m,y,w,v,_){this.permute(_,p,m,y,w,v);for(var C=1;C<v;C<<=1)for(var b=C<<1,d=Math.cos(2*Math.PI/b),E=Math.sin(2*Math.PI/b),q=0;q<v;q+=b)for(var O=d,P=E,j=0;j<C;j++){var z=y[q+j],H=w[q+j],ke=y[q+j+C],ne=w[q+j+C],N=O*ke-P*ne;ne=O*ne+P*ke,ke=N,y[q+j]=z+ke,w[q+j]=H+ne,y[q+j+C]=z-ke,w[q+j+C]=H-ne,j!==b&&(N=d*O-E*P,P=d*P+E*O,O=N)}},R.prototype.guessLen13b=function(p,m){var y=Math.max(m,p)|1,w=y&1,v=0;for(y=y/2|0;y;y=y>>>1)v++;return 1<<v+1+w},R.prototype.conjugate=function(p,m,y){if(!(y<=1))for(var w=0;w<y/2;w++){var v=p[w];p[w]=p[y-w-1],p[y-w-1]=v,v=m[w],m[w]=-m[y-w-1],m[y-w-1]=-v}},R.prototype.normalize13b=function(p,m){for(var y=0,w=0;w<m/2;w++){var v=Math.round(p[2*w+1]/m)*8192+Math.round(p[2*w]/m)+y;p[w]=v&67108863,v<67108864?y=0:y=v/67108864|0}return p},R.prototype.convert13b=function(p,m,y,w){for(var v=0,_=0;_<m;_++)v=v+(p[_]|0),y[2*_]=v&8191,v=v>>>13,y[2*_+1]=v&8191,v=v>>>13;for(_=2*m;_<w;++_)y[_]=0;t(v===0),t((v&-8192)===0)},R.prototype.stub=function(p){for(var m=new Array(p),y=0;y<p;y++)m[y]=0;return m},R.prototype.mulp=function(p,m,y){var w=2*this.guessLen13b(p.length,m.length),v=this.makeRBT(w),_=this.stub(w),C=new Array(w),b=new Array(w),d=new Array(w),E=new Array(w),q=new Array(w),O=new Array(w),P=y.words;P.length=w,this.convert13b(p.words,p.length,C,w),this.convert13b(m.words,m.length,E,w),this.transform(C,_,b,d,w,v),this.transform(E,_,q,O,w,v);for(var j=0;j<w;j++){var z=b[j]*q[j]-d[j]*O[j];d[j]=b[j]*O[j]+d[j]*q[j],b[j]=z}return this.conjugate(b,d,w),this.transform(b,d,P,_,w,v),this.conjugate(P,_,w),this.normalize13b(P,w),y.negative=p.negative^m.negative,y.length=p.length+m.length,y.strip()},i.prototype.mul=function(p){var m=new i(null);return m.words=new Array(this.length+p.length),this.mulTo(p,m)},i.prototype.mulf=function(p){var m=new i(null);return m.words=new Array(this.length+p.length),k(this,p,m)},i.prototype.imul=function(p){return this.clone().mulTo(p,this)},i.prototype.imuln=function(p){t(typeof p=="number"),t(p<67108864);for(var m=0,y=0;y<this.length;y++){var w=(this.words[y]|0)*p,v=(w&67108863)+(m&67108863);m>>=26,m+=w/67108864|0,m+=v>>>26,this.words[y]=v&67108863}return m!==0&&(this.words[y]=m,this.length++),this.length=p===0?1:this.length,this},i.prototype.muln=function(p){return this.clone().imuln(p)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(p){var m=h(p);if(m.length===0)return new i(1);for(var y=this,w=0;w<m.length&&m[w]===0;w++,y=y.sqr());if(++w<m.length)for(var v=y.sqr();w<m.length;w++,v=v.sqr())m[w]!==0&&(y=y.mul(v));return y},i.prototype.iushln=function(p){t(typeof p=="number"&&p>=0);var m=p%26,y=(p-m)/26,w=67108863>>>26-m<<26-m,v;if(m!==0){var _=0;for(v=0;v<this.length;v++){var C=this.words[v]&w,b=(this.words[v]|0)-C<<m;this.words[v]=b|_,_=C>>>26-m}_&&(this.words[v]=_,this.length++)}if(y!==0){for(v=this.length-1;v>=0;v--)this.words[v+y]=this.words[v];for(v=0;v<y;v++)this.words[v]=0;this.length+=y}return this.strip()},i.prototype.ishln=function(p){return t(this.negative===0),this.iushln(p)},i.prototype.iushrn=function(p,m,y){t(typeof p=="number"&&p>=0);var w;m?w=(m-m%26)/26:w=0;var v=p%26,_=Math.min((p-v)/26,this.length),C=67108863^67108863>>>v<<v,b=y;if(w-=_,w=Math.max(0,w),b){for(var d=0;d<_;d++)b.words[d]=this.words[d];b.length=_}if(_!==0)if(this.length>_)for(this.length-=_,d=0;d<this.length;d++)this.words[d]=this.words[d+_];else this.words[0]=0,this.length=1;var E=0;for(d=this.length-1;d>=0&&(E!==0||d>=w);d--){var q=this.words[d]|0;this.words[d]=E<<26-v|q>>>v,E=q&C}return b&&E!==0&&(b.words[b.length++]=E),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(p,m,y){return t(this.negative===0),this.iushrn(p,m,y)},i.prototype.shln=function(p){return this.clone().ishln(p)},i.prototype.ushln=function(p){return this.clone().iushln(p)},i.prototype.shrn=function(p){return this.clone().ishrn(p)},i.prototype.ushrn=function(p){return this.clone().iushrn(p)},i.prototype.testn=function(p){t(typeof p=="number"&&p>=0);var m=p%26,y=(p-m)/26,w=1<<m;if(this.length<=y)return!1;var v=this.words[y];return!!(v&w)},i.prototype.imaskn=function(p){t(typeof p=="number"&&p>=0);var m=p%26,y=(p-m)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=y)return this;if(m!==0&&y++,this.length=Math.min(y,this.length),m!==0){var w=67108863^67108863>>>m<<m;this.words[this.length-1]&=w}return this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.maskn=function(p){return this.clone().imaskn(p)},i.prototype.iaddn=function(p){return t(typeof p=="number"),t(p<67108864),p<0?this.isubn(-p):this.negative!==0?this.length===1&&(this.words[0]|0)<p?(this.words[0]=p-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(p),this.negative=1,this):this._iaddn(p)},i.prototype._iaddn=function(p){this.words[0]+=p;for(var m=0;m<this.length&&this.words[m]>=67108864;m++)this.words[m]-=67108864,m===this.length-1?this.words[m+1]=1:this.words[m+1]++;return this.length=Math.max(this.length,m+1),this},i.prototype.isubn=function(p){if(t(typeof p=="number"),t(p<67108864),p<0)return this.iaddn(-p);if(this.negative!==0)return this.negative=0,this.iaddn(p),this.negative=1,this;if(this.words[0]-=p,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var m=0;m<this.length&&this.words[m]<0;m++)this.words[m]+=67108864,this.words[m+1]-=1;return this.strip()},i.prototype.addn=function(p){return this.clone().iaddn(p)},i.prototype.subn=function(p){return this.clone().isubn(p)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(p,m,y){var w=p.length+y,v;this._expand(w);var _,C=0;for(v=0;v<p.length;v++){_=(this.words[v+y]|0)+C;var b=(p.words[v]|0)*m;_-=b&67108863,C=(_>>26)-(b/67108864|0),this.words[v+y]=_&67108863}for(;v<this.length-y;v++)_=(this.words[v+y]|0)+C,C=_>>26,this.words[v+y]=_&67108863;if(C===0)return this.strip();for(t(C===-1),C=0,v=0;v<this.length;v++)_=-(this.words[v]|0)+C,C=_>>26,this.words[v]=_&67108863;return this.negative=1,this.strip()},i.prototype._wordDiv=function(p,m){var y=this.length-p.length,w=this.clone(),v=p,_=v.words[v.length-1]|0,C=this._countBits(_);y=26-C,y!==0&&(v=v.ushln(y),w.iushln(y),_=v.words[v.length-1]|0);var b=w.length-v.length,d;if(m!=="mod"){d=new i(null),d.length=b+1,d.words=new Array(d.length);for(var E=0;E<d.length;E++)d.words[E]=0}var q=w.clone()._ishlnsubmul(v,1,b);q.negative===0&&(w=q,d&&(d.words[b]=1));for(var O=b-1;O>=0;O--){var P=(w.words[v.length+O]|0)*67108864+(w.words[v.length+O-1]|0);for(P=Math.min(P/_|0,67108863),w._ishlnsubmul(v,P,O);w.negative!==0;)P--,w.negative=0,w._ishlnsubmul(v,1,O),w.isZero()||(w.negative^=1);d&&(d.words[O]=P)}return d&&d.strip(),w.strip(),m!=="div"&&y!==0&&w.iushrn(y),{div:d||null,mod:w}},i.prototype.divmod=function(p,m,y){if(t(!p.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var w,v,_;return this.negative!==0&&p.negative===0?(_=this.neg().divmod(p,m),m!=="mod"&&(w=_.div.neg()),m!=="div"&&(v=_.mod.neg(),y&&v.negative!==0&&v.iadd(p)),{div:w,mod:v}):this.negative===0&&p.negative!==0?(_=this.divmod(p.neg(),m),m!=="mod"&&(w=_.div.neg()),{div:w,mod:_.mod}):(this.negative&p.negative)!==0?(_=this.neg().divmod(p.neg(),m),m!=="div"&&(v=_.mod.neg(),y&&v.negative!==0&&v.isub(p)),{div:_.div,mod:v}):p.length>this.length||this.cmp(p)<0?{div:new i(0),mod:this}:p.length===1?m==="div"?{div:this.divn(p.words[0]),mod:null}:m==="mod"?{div:null,mod:new i(this.modn(p.words[0]))}:{div:this.divn(p.words[0]),mod:new i(this.modn(p.words[0]))}:this._wordDiv(p,m)},i.prototype.div=function(p){return this.divmod(p,"div",!1).div},i.prototype.mod=function(p){return this.divmod(p,"mod",!1).mod},i.prototype.umod=function(p){return this.divmod(p,"mod",!0).mod},i.prototype.divRound=function(p){var m=this.divmod(p);if(m.mod.isZero())return m.div;var y=m.div.negative!==0?m.mod.isub(p):m.mod,w=p.ushrn(1),v=p.andln(1),_=y.cmp(w);return _<0||v===1&&_===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},i.prototype.modn=function(p){t(p<=67108863);for(var m=(1<<26)%p,y=0,w=this.length-1;w>=0;w--)y=(m*y+(this.words[w]|0))%p;return y},i.prototype.idivn=function(p){t(p<=67108863);for(var m=0,y=this.length-1;y>=0;y--){var w=(this.words[y]|0)+m*67108864;this.words[y]=w/p|0,m=w%p}return this.strip()},i.prototype.divn=function(p){return this.clone().idivn(p)},i.prototype.egcd=function(p){t(p.negative===0),t(!p.isZero());var m=this,y=p.clone();m.negative!==0?m=m.umod(p):m=m.clone();for(var w=new i(1),v=new i(0),_=new i(0),C=new i(1),b=0;m.isEven()&&y.isEven();)m.iushrn(1),y.iushrn(1),++b;for(var d=y.clone(),E=m.clone();!m.isZero();){for(var q=0,O=1;(m.words[0]&O)===0&&q<26;++q,O<<=1);if(q>0)for(m.iushrn(q);q-- >0;)(w.isOdd()||v.isOdd())&&(w.iadd(d),v.isub(E)),w.iushrn(1),v.iushrn(1);for(var P=0,j=1;(y.words[0]&j)===0&&P<26;++P,j<<=1);if(P>0)for(y.iushrn(P);P-- >0;)(_.isOdd()||C.isOdd())&&(_.iadd(d),C.isub(E)),_.iushrn(1),C.iushrn(1);m.cmp(y)>=0?(m.isub(y),w.isub(_),v.isub(C)):(y.isub(m),_.isub(w),C.isub(v))}return{a:_,b:C,gcd:y.iushln(b)}},i.prototype._invmp=function(p){t(p.negative===0),t(!p.isZero());var m=this,y=p.clone();m.negative!==0?m=m.umod(p):m=m.clone();for(var w=new i(1),v=new i(0),_=y.clone();m.cmpn(1)>0&&y.cmpn(1)>0;){for(var C=0,b=1;(m.words[0]&b)===0&&C<26;++C,b<<=1);if(C>0)for(m.iushrn(C);C-- >0;)w.isOdd()&&w.iadd(_),w.iushrn(1);for(var d=0,E=1;(y.words[0]&E)===0&&d<26;++d,E<<=1);if(d>0)for(y.iushrn(d);d-- >0;)v.isOdd()&&v.iadd(_),v.iushrn(1);m.cmp(y)>=0?(m.isub(y),w.isub(v)):(y.isub(m),v.isub(w))}var q;return m.cmpn(1)===0?q=w:q=v,q.cmpn(0)<0&&q.iadd(p),q},i.prototype.gcd=function(p){if(this.isZero())return p.abs();if(p.isZero())return this.abs();var m=this.clone(),y=p.clone();m.negative=0,y.negative=0;for(var w=0;m.isEven()&&y.isEven();w++)m.iushrn(1),y.iushrn(1);do{for(;m.isEven();)m.iushrn(1);for(;y.isEven();)y.iushrn(1);var v=m.cmp(y);if(v<0){var _=m;m=y,y=_}else if(v===0||y.cmpn(1)===0)break;m.isub(y)}while(!0);return y.iushln(w)},i.prototype.invm=function(p){return this.egcd(p).a.umod(p)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(p){return this.words[0]&p},i.prototype.bincn=function(p){t(typeof p=="number");var m=p%26,y=(p-m)/26,w=1<<m;if(this.length<=y)return this._expand(y+1),this.words[y]|=w,this;for(var v=w,_=y;v!==0&&_<this.length;_++){var C=this.words[_]|0;C+=v,v=C>>>26,C&=67108863,this.words[_]=C}return v!==0&&(this.words[_]=v,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(p){var m=p<0;if(this.negative!==0&&!m)return-1;if(this.negative===0&&m)return 1;this.strip();var y;if(this.length>1)y=1;else{m&&(p=-p),t(p<=67108863,"Number is too big");var w=this.words[0]|0;y=w===p?0:w<p?-1:1}return this.negative!==0?-y|0:y},i.prototype.cmp=function(p){if(this.negative!==0&&p.negative===0)return-1;if(this.negative===0&&p.negative!==0)return 1;var m=this.ucmp(p);return this.negative!==0?-m|0:m},i.prototype.ucmp=function(p){if(this.length>p.length)return 1;if(this.length<p.length)return-1;for(var m=0,y=this.length-1;y>=0;y--){var w=this.words[y]|0,v=p.words[y]|0;if(w!==v){w<v?m=-1:w>v&&(m=1);break}}return m},i.prototype.gtn=function(p){return this.cmpn(p)===1},i.prototype.gt=function(p){return this.cmp(p)===1},i.prototype.gten=function(p){return this.cmpn(p)>=0},i.prototype.gte=function(p){return this.cmp(p)>=0},i.prototype.ltn=function(p){return this.cmpn(p)===-1},i.prototype.lt=function(p){return this.cmp(p)===-1},i.prototype.lten=function(p){return this.cmpn(p)<=0},i.prototype.lte=function(p){return this.cmp(p)<=0},i.prototype.eqn=function(p){return this.cmpn(p)===0},i.prototype.eq=function(p){return this.cmp(p)===0},i.red=function(p){return new D(p)},i.prototype.toRed=function(p){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),p.convertTo(this)._forceRed(p)},i.prototype.fromRed=function(){return t(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(p){return this.red=p,this},i.prototype.forceRed=function(p){return t(!this.red,"Already a number in reduction context"),this._forceRed(p)},i.prototype.redAdd=function(p){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,p)},i.prototype.redIAdd=function(p){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,p)},i.prototype.redSub=function(p){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,p)},i.prototype.redISub=function(p){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,p)},i.prototype.redShl=function(p){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,p)},i.prototype.redMul=function(p){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,p),this.red.mul(this,p)},i.prototype.redIMul=function(p){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,p),this.red.imul(this,p)},i.prototype.redSqr=function(){return t(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return t(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return t(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return t(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return t(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(p){return t(this.red&&!p.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,p)};var M={k256:null,p224:null,p192:null,p25519:null};function I(T,p){this.name=T,this.p=new i(p,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}I.prototype._tmp=function(){var p=new i(null);return p.words=new Array(Math.ceil(this.n/13)),p},I.prototype.ireduce=function(p){var m=p,y;do this.split(m,this.tmp),m=this.imulK(m),m=m.iadd(this.tmp),y=m.bitLength();while(y>this.n);var w=y<this.n?-1:m.ucmp(this.p);return w===0?(m.words[0]=0,m.length=1):w>0?m.isub(this.p):m.strip!==void 0?m.strip():m._strip(),m},I.prototype.split=function(p,m){p.iushrn(this.n,0,m)},I.prototype.imulK=function(p){return p.imul(this.k)};function B(){I.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(B,I),B.prototype.split=function(p,m){for(var y=4194303,w=Math.min(p.length,9),v=0;v<w;v++)m.words[v]=p.words[v];if(m.length=w,p.length<=9){p.words[0]=0,p.length=1;return}var _=p.words[9];for(m.words[m.length++]=_&y,v=10;v<p.length;v++){var C=p.words[v]|0;p.words[v-10]=(C&y)<<4|_>>>22,_=C}_>>>=22,p.words[v-10]=_,_===0&&p.length>10?p.length-=10:p.length-=9},B.prototype.imulK=function(p){p.words[p.length]=0,p.words[p.length+1]=0,p.length+=2;for(var m=0,y=0;y<p.length;y++){var w=p.words[y]|0;m+=w*977,p.words[y]=m&67108863,m=w*64+(m/67108864|0)}return p.words[p.length-1]===0&&(p.length--,p.words[p.length-1]===0&&p.length--),p};function V(){I.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(V,I);function F(){I.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(F,I);function G(){I.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(G,I),G.prototype.imulK=function(p){for(var m=0,y=0;y<p.length;y++){var w=(p.words[y]|0)*19+m,v=w&67108863;w>>>=26,p.words[y]=v,m=w}return m!==0&&(p.words[p.length++]=m),p},i._prime=function(p){if(M[p])return M[p];var m;if(p==="k256")m=new B;else if(p==="p224")m=new V;else if(p==="p192")m=new F;else if(p==="p25519")m=new G;else throw new Error("Unknown prime "+p);return M[p]=m,m};function D(T){if(typeof T=="string"){var p=i._prime(T);this.m=p.p,this.prime=p}else t(T.gtn(1),"modulus must be greater than 1"),this.m=T,this.prime=null}D.prototype._verify1=function(p){t(p.negative===0,"red works only with positives"),t(p.red,"red works only with red numbers")},D.prototype._verify2=function(p,m){t((p.negative|m.negative)===0,"red works only with positives"),t(p.red&&p.red===m.red,"red works only with red numbers")},D.prototype.imod=function(p){return this.prime?this.prime.ireduce(p)._forceRed(this):p.umod(this.m)._forceRed(this)},D.prototype.neg=function(p){return p.isZero()?p.clone():this.m.sub(p)._forceRed(this)},D.prototype.add=function(p,m){this._verify2(p,m);var y=p.add(m);return y.cmp(this.m)>=0&&y.isub(this.m),y._forceRed(this)},D.prototype.iadd=function(p,m){this._verify2(p,m);var y=p.iadd(m);return y.cmp(this.m)>=0&&y.isub(this.m),y},D.prototype.sub=function(p,m){this._verify2(p,m);var y=p.sub(m);return y.cmpn(0)<0&&y.iadd(this.m),y._forceRed(this)},D.prototype.isub=function(p,m){this._verify2(p,m);var y=p.isub(m);return y.cmpn(0)<0&&y.iadd(this.m),y},D.prototype.shl=function(p,m){return this._verify1(p),this.imod(p.ushln(m))},D.prototype.imul=function(p,m){return this._verify2(p,m),this.imod(p.imul(m))},D.prototype.mul=function(p,m){return this._verify2(p,m),this.imod(p.mul(m))},D.prototype.isqr=function(p){return this.imul(p,p.clone())},D.prototype.sqr=function(p){return this.mul(p,p)},D.prototype.sqrt=function(p){if(p.isZero())return p.clone();var m=this.m.andln(3);if(t(m%2===1),m===3){var y=this.m.add(new i(1)).iushrn(2);return this.pow(p,y)}for(var w=this.m.subn(1),v=0;!w.isZero()&&w.andln(1)===0;)v++,w.iushrn(1);t(!w.isZero());var _=new i(1).toRed(this),C=_.redNeg(),b=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new i(2*d*d).toRed(this);this.pow(d,b).cmp(C)!==0;)d.redIAdd(C);for(var E=this.pow(d,w),q=this.pow(p,w.addn(1).iushrn(1)),O=this.pow(p,w),P=v;O.cmp(_)!==0;){for(var j=O,z=0;j.cmp(_)!==0;z++)j=j.redSqr();t(z<P);var H=this.pow(E,new i(1).iushln(P-z-1));q=q.redMul(H),E=H.redSqr(),O=O.redMul(E),P=z}return q},D.prototype.invm=function(p){var m=p._invmp(this.m);return m.negative!==0?(m.negative=0,this.imod(m).redNeg()):this.imod(m)},D.prototype.pow=function(p,m){if(m.isZero())return new i(1).toRed(this);if(m.cmpn(1)===0)return p.clone();var y=4,w=new Array(1<<y);w[0]=new i(1).toRed(this),w[1]=p;for(var v=2;v<w.length;v++)w[v]=this.mul(w[v-1],p);var _=w[0],C=0,b=0,d=m.bitLength()%26;for(d===0&&(d=26),v=m.length-1;v>=0;v--){for(var E=m.words[v],q=d-1;q>=0;q--){var O=E>>q&1;if(_!==w[0]&&(_=this.sqr(_)),O===0&&C===0){b=0;continue}C<<=1,C|=O,b++,!(b!==y&&(v!==0||q!==0))&&(_=this.mul(_,w[C]),b=0,C=0)}d=26}return _},D.prototype.convertTo=function(p){var m=p.umod(this.m);return m===p?m.clone():m},D.prototype.convertFrom=function(p){var m=p.clone();return m.red=null,m},i.mont=function(p){return new U(p)};function U(T){D.call(this,T),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(U,D),U.prototype.convertTo=function(p){return this.imod(p.ushln(this.shift))},U.prototype.convertFrom=function(p){var m=this.imod(p.mul(this.rinv));return m.red=null,m},U.prototype.imul=function(p,m){if(p.isZero()||m.isZero())return p.words[0]=0,p.length=1,p;var y=p.imul(m),w=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=y.isub(w).iushrn(this.shift),_=v;return v.cmp(this.m)>=0?_=v.isub(this.m):v.cmpn(0)<0&&(_=v.iadd(this.m)),_._forceRed(this)},U.prototype.mul=function(p,m){if(p.isZero()||m.isZero())return new i(0)._forceRed(this);var y=p.mul(m),w=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=y.isub(w).iushrn(this.shift),_=v;return v.cmp(this.m)>=0?_=v.isub(this.m):v.cmpn(0)<0&&(_=v.iadd(this.m)),_._forceRed(this)},U.prototype.invm=function(p){var m=this.imod(p._invmp(this.m).mul(this.r2));return m._forceRed(this)}})(typeof Uh>"u"||Uh,nE)});var iE=A((eG,Wh)=>{typeof Object.create=="function"?Wh.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Wh.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}});var zn=A((tG,zh)=>{try{if(Gh=require("util"),typeof Gh.inherits!="function")throw"";zh.exports=Gh.inherits}catch{zh.exports=iE()}var Gh});var Xl=A((rG,sE)=>{"use strict";var Jl=require("buffer"),Ps=Jl.Buffer,fr={},dr;for(dr in Jl)Jl.hasOwnProperty(dr)&&(dr==="SlowBuffer"||dr==="Buffer"||(fr[dr]=Jl[dr]));var Is=fr.Buffer={};for(dr in Ps)Ps.hasOwnProperty(dr)&&(dr==="allocUnsafe"||dr==="allocUnsafeSlow"||(Is[dr]=Ps[dr]));fr.Buffer.prototype=Ps.prototype;(!Is.from||Is.from===Uint8Array.from)&&(Is.from=function(r,e,t){if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof r);if(r&&typeof r.length>"u")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);return Ps(r,e,t)});Is.alloc||(Is.alloc=function(r,e,t){if(typeof r!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof r);if(r<0||r>=2*(1<<30))throw new RangeError('The value "'+r+'" is invalid for option "size"');var n=Ps(r);return!e||e.length===0?n.fill(0):typeof t=="string"?n.fill(e,t):n.fill(e),n});if(!fr.kStringMaxLength)try{fr.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}fr.constants||(fr.constants={MAX_LENGTH:fr.kMaxLength},fr.kStringMaxLength&&(fr.constants.MAX_STRING_LENGTH=fr.kStringMaxLength));sE.exports=fr});var Zl=A(oE=>{"use strict";var GB=zn();function hr(r){this._reporterState={obj:null,path:[],options:r||{},errors:[]}}oE.Reporter=hr;hr.prototype.isError=function(e){return e instanceof Ns};hr.prototype.save=function(){let e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}};hr.prototype.restore=function(e){let t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)};hr.prototype.enterKey=function(e){return this._reporterState.path.push(e)};hr.prototype.exitKey=function(e){let t=this._reporterState;t.path=t.path.slice(0,e-1)};hr.prototype.leaveKey=function(e,t,n){let i=this._reporterState;this.exitKey(e),i.obj!==null&&(i.obj[t]=n)};hr.prototype.path=function(){return this._reporterState.path.join("/")};hr.prototype.enterObject=function(){let e=this._reporterState,t=e.obj;return e.obj={},t};hr.prototype.leaveObject=function(e){let t=this._reporterState,n=t.obj;return t.obj=e,n};hr.prototype.error=function(e){let t,n=this._reporterState,i=e instanceof Ns;if(i?t=e:t=new Ns(n.path.map(function(s){return"["+JSON.stringify(s)+"]"}).join(""),e.message||e,e.stack),!n.options.partial)throw t;return i||n.errors.push(t),t};hr.prototype.wrapResult=function(e){let t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e};function Ns(r,e){this.path=r,this.rethrow(e)}GB(Ns,Error);Ns.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,Ns),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}});var Bs=A(Vh=>{"use strict";var zB=zn(),Ql=Zl().Reporter,Ds=Xl().Buffer;function mr(r,e){if(Ql.call(this,e),!Ds.isBuffer(r)){this.error("Input not Buffer");return}this.base=r,this.offset=0,this.length=r.length}zB(mr,Ql);Vh.DecoderBuffer=mr;mr.isDecoderBuffer=function(e){return e instanceof mr?!0:typeof e=="object"&&Ds.isBuffer(e.base)&&e.constructor.name==="DecoderBuffer"&&typeof e.offset=="number"&&typeof e.length=="number"&&typeof e.save=="function"&&typeof e.restore=="function"&&typeof e.isEmpty=="function"&&typeof e.readUInt8=="function"&&typeof e.skip=="function"&&typeof e.raw=="function"};mr.prototype.save=function(){return{offset:this.offset,reporter:Ql.prototype.save.call(this)}};mr.prototype.restore=function(e){let t=new mr(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,Ql.prototype.restore.call(this,e.reporter),t};mr.prototype.isEmpty=function(){return this.offset===this.length};mr.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")};mr.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");let n=new mr(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+e,this.offset+=e,n};mr.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)};function Ls(r,e){if(Array.isArray(r))this.length=0,this.value=r.map(function(t){return Ls.isEncoderBuffer(t)||(t=new Ls(t,e)),this.length+=t.length,t},this);else if(typeof r=="number"){if(!(0<=r&&r<=255))return e.error("non-byte EncoderBuffer value");this.value=r,this.length=1}else if(typeof r=="string")this.value=r,this.length=Ds.byteLength(r);else if(Ds.isBuffer(r))this.value=r,this.length=r.length;else return e.error("Unsupported type: "+typeof r)}Vh.EncoderBuffer=Ls;Ls.isEncoderBuffer=function(e){return e instanceof Ls?!0:typeof e=="object"&&e.constructor.name==="EncoderBuffer"&&typeof e.length=="number"&&typeof e.join=="function"};Ls.prototype.join=function(e,t){return e||(e=Ds.alloc(this.length)),t||(t=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(n){n.join(e,t),t+=n.length}):(typeof this.value=="number"?e[t]=this.value:typeof this.value=="string"?e.write(this.value,t):Ds.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}});var lE=A((sG,cE)=>{cE.exports=aE;function aE(r,e){if(!r)throw new Error(e||"Assertion failed")}aE.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)}});var eu=A((oG,pE)=>{"use strict";var VB=Zl().Reporter,KB=Bs().EncoderBuffer,YB=Bs().DecoderBuffer,Ot=lE(),uE=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],JB=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(uE),XB=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function me(r,e,t){let n={};this._baseState=n,n.name=t,n.enc=r,n.parent=e||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}pE.exports=me;var ZB=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];me.prototype.clone=function(){let e=this._baseState,t={};ZB.forEach(function(i){t[i]=e[i]});let n=new this.constructor(t.parent);return n._baseState=t,n};me.prototype._wrap=function(){let e=this._baseState;JB.forEach(function(t){this[t]=function(){let i=new this.constructor(this);return e.children.push(i),i[t].apply(i,arguments)}},this)};me.prototype._init=function(e){let t=this._baseState;Ot(t.parent===null),e.call(this),t.children=t.children.filter(function(n){return n._baseState.parent===this},this),Ot.equal(t.children.length,1,"Root node can have only one child")};me.prototype._useArgs=function(e){let t=this._baseState,n=e.filter(function(i){return i instanceof this.constructor},this);e=e.filter(function(i){return!(i instanceof this.constructor)},this),n.length!==0&&(Ot(t.children===null),t.children=n,n.forEach(function(i){i._baseState.parent=this},this)),e.length!==0&&(Ot(t.args===null),t.args=e,t.reverseArgs=e.map(function(i){if(typeof i!="object"||i.constructor!==Object)return i;let s={};return Object.keys(i).forEach(function(o){o==(o|0)&&(o|=0);let a=i[o];s[a]=o}),s}))};XB.forEach(function(r){me.prototype[r]=function(){let t=this._baseState;throw new Error(r+" not implemented for encoding: "+t.enc)}});uE.forEach(function(r){me.prototype[r]=function(){let t=this._baseState,n=Array.prototype.slice.call(arguments);return Ot(t.tag===null),t.tag=r,this._useArgs(n),this}});me.prototype.use=function(e){Ot(e);let t=this._baseState;return Ot(t.use===null),t.use=e,this};me.prototype.optional=function(){let e=this._baseState;return e.optional=!0,this};me.prototype.def=function(e){let t=this._baseState;return Ot(t.default===null),t.default=e,t.optional=!0,this};me.prototype.explicit=function(e){let t=this._baseState;return Ot(t.explicit===null&&t.implicit===null),t.explicit=e,this};me.prototype.implicit=function(e){let t=this._baseState;return Ot(t.explicit===null&&t.implicit===null),t.implicit=e,this};me.prototype.obj=function(){let e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,t.length!==0&&this._useArgs(t),this};me.prototype.key=function(e){let t=this._baseState;return Ot(t.key===null),t.key=e,this};me.prototype.any=function(){let e=this._baseState;return e.any=!0,this};me.prototype.choice=function(e){let t=this._baseState;return Ot(t.choice===null),t.choice=e,this._useArgs(Object.keys(e).map(function(n){return e[n]})),this};me.prototype.contains=function(e){let t=this._baseState;return Ot(t.use===null),t.contains=e,this};me.prototype._decode=function(e,t){let n=this._baseState;if(n.parent===null)return e.wrapResult(n.children[0]._decode(e,t));let i=n.default,s=!0,o=null;if(n.key!==null&&(o=e.enterKey(n.key)),n.optional){let c=null;if(n.explicit!==null?c=n.explicit:n.implicit!==null?c=n.implicit:n.tag!==null&&(c=n.tag),c===null&&!n.any){let l=e.save();try{n.choice===null?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t),s=!0}catch{s=!1}e.restore(l)}else if(s=this._peekTag(e,c,n.any),e.isError(s))return s}let a;if(n.obj&&s&&(a=e.enterObject()),s){if(n.explicit!==null){let l=this._decodeTag(e,n.explicit);if(e.isError(l))return l;e=l}let c=e.offset;if(n.use===null&&n.choice===null){let l;n.any&&(l=e.save());let u=this._decodeTag(e,n.implicit!==null?n.implicit:n.tag,n.any);if(e.isError(u))return u;n.any?i=e.raw(l):e=u}if(t&&t.track&&n.tag!==null&&t.track(e.path(),c,e.length,"tagged"),t&&t.track&&n.tag!==null&&t.track(e.path(),e.offset,e.length,"content"),n.any||(n.choice===null?i=this._decodeGeneric(n.tag,e,t):i=this._decodeChoice(e,t)),e.isError(i))return i;if(!n.any&&n.choice===null&&n.children!==null&&n.children.forEach(function(u){u._decode(e,t)}),n.contains&&(n.tag==="octstr"||n.tag==="bitstr")){let l=new YB(i);i=this._getUse(n.contains,e._reporterState.obj)._decode(l,t)}}return n.obj&&s&&(i=e.leaveObject(a)),n.key!==null&&(i!==null||s===!0)?e.leaveKey(o,n.key,i):o!==null&&e.exitKey(o),i};me.prototype._decodeGeneric=function(e,t,n){let i=this._baseState;return e==="seq"||e==="set"?null:e==="seqof"||e==="setof"?this._decodeList(t,e,i.args[0],n):/str$/.test(e)?this._decodeStr(t,e,n):e==="objid"&&i.args?this._decodeObjid(t,i.args[0],i.args[1],n):e==="objid"?this._decodeObjid(t,null,null,n):e==="gentime"||e==="utctime"?this._decodeTime(t,e,n):e==="null_"?this._decodeNull(t,n):e==="bool"?this._decodeBool(t,n):e==="objDesc"?this._decodeStr(t,e,n):e==="int"||e==="enum"?this._decodeInt(t,i.args&&i.args[0],n):i.use!==null?this._getUse(i.use,t._reporterState.obj)._decode(t,n):t.error("unknown tag: "+e)};me.prototype._getUse=function(e,t){let n=this._baseState;return n.useDecoder=this._use(e,t),Ot(n.useDecoder._baseState.parent===null),n.useDecoder=n.useDecoder._baseState.children[0],n.implicit!==n.useDecoder._baseState.implicit&&(n.useDecoder=n.useDecoder.clone(),n.useDecoder._baseState.implicit=n.implicit),n.useDecoder};me.prototype._decodeChoice=function(e,t){let n=this._baseState,i=null,s=!1;return Object.keys(n.choice).some(function(o){let a=e.save(),c=n.choice[o];try{let l=c._decode(e,t);if(e.isError(l))return!1;i={type:o,value:l},s=!0}catch{return e.restore(a),!1}return!0},this),s?i:e.error("Choice not matched")};me.prototype._createEncoderBuffer=function(e){return new KB(e,this.reporter)};me.prototype._encode=function(e,t,n){let i=this._baseState;if(i.default!==null&&i.default===e)return;let s=this._encodeValue(e,t,n);if(s!==void 0&&!this._skipDefault(s,t,n))return s};me.prototype._encodeValue=function(e,t,n){let i=this._baseState;if(i.parent===null)return i.children[0]._encode(e,t||new VB);let s=null;if(this.reporter=t,i.optional&&e===void 0)if(i.default!==null)e=i.default;else return;let o=null,a=!1;if(i.any)s=this._createEncoderBuffer(e);else if(i.choice)s=this._encodeChoice(e,t);else if(i.contains)o=this._getUse(i.contains,n)._encode(e,t),a=!0;else if(i.children)o=i.children.map(function(c){if(c._baseState.tag==="null_")return c._encode(null,t,e);if(c._baseState.key===null)return t.error("Child should have a key");let l=t.enterKey(c._baseState.key);if(typeof e!="object")return t.error("Child expected, but input is not object");let u=c._encode(e[c._baseState.key],t,e);return t.leaveKey(l),u},this).filter(function(c){return c}),o=this._createEncoderBuffer(o);else if(i.tag==="seqof"||i.tag==="setof"){if(!(i.args&&i.args.length===1))return t.error("Too many args for : "+i.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");let c=this.clone();c._baseState.implicit=null,o=this._createEncoderBuffer(e.map(function(l){let u=this._baseState;return this._getUse(u.args[0],e)._encode(l,t)},c))}else i.use!==null?s=this._getUse(i.use,n)._encode(e,t):(o=this._encodePrimitive(i.tag,e),a=!0);if(!i.any&&i.choice===null){let c=i.implicit!==null?i.implicit:i.tag,l=i.implicit===null?"universal":"context";c===null?i.use===null&&t.error("Tag could be omitted only for .use()"):i.use===null&&(s=this._encodeComposite(c,a,l,o))}return i.explicit!==null&&(s=this._encodeComposite(i.explicit,!1,"context",s)),s};me.prototype._encodeChoice=function(e,t){let n=this._baseState,i=n.choice[e.type];return i||Ot(!1,e.type+" not found in "+JSON.stringify(Object.keys(n.choice))),i._encode(e.value,t)};me.prototype._encodePrimitive=function(e,t){let n=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if(e==="objid"&&n.args)return this._encodeObjid(t,n.reverseArgs[0],n.args[1]);if(e==="objid")return this._encodeObjid(t,null,null);if(e==="gentime"||e==="utctime")return this._encodeTime(t,e);if(e==="null_")return this._encodeNull();if(e==="int"||e==="enum")return this._encodeInt(t,n.args&&n.reverseArgs[0]);if(e==="bool")return this._encodeBool(t);if(e==="objDesc")return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)};me.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)};me.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}});var tu=A(yi=>{"use strict";function fE(r){let e={};return Object.keys(r).forEach(function(t){(t|0)==t&&(t=t|0);let n=r[t];e[n]=t}),e}yi.tagClass={0:"universal",1:"application",2:"context",3:"private"};yi.tagClassByName=fE(yi.tagClass);yi.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"};yi.tagByName=fE(yi.tag)});var Yh=A((cG,mE)=>{"use strict";var QB=zn(),wn=Xl().Buffer,dE=eu(),Kh=tu();function hE(r){this.enc="der",this.name=r.name,this.entity=r,this.tree=new Pr,this.tree._init(r.body)}mE.exports=hE;hE.prototype.encode=function(e,t){return this.tree._encode(e,t).join()};function Pr(r){dE.call(this,"der",r)}QB(Pr,dE);Pr.prototype._encodeComposite=function(e,t,n,i){let s=ej(e,t,n,this.reporter);if(i.length<128){let c=wn.alloc(2);return c[0]=s,c[1]=i.length,this._createEncoderBuffer([c,i])}let o=1;for(let c=i.length;c>=256;c>>=8)o++;let a=wn.alloc(2+o);a[0]=s,a[1]=128|o;for(let c=1+o,l=i.length;l>0;c--,l>>=8)a[c]=l&255;return this._createEncoderBuffer([a,i])};Pr.prototype._encodeStr=function(e,t){if(t==="bitstr")return this._createEncoderBuffer([e.unused|0,e.data]);if(t==="bmpstr"){let n=wn.alloc(e.length*2);for(let i=0;i<e.length;i++)n.writeUInt16BE(e.charCodeAt(i),i*2);return this._createEncoderBuffer(n)}else return t==="numstr"?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):t==="printstr"?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)?this._createEncoderBuffer(e):t==="objDesc"?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported")};Pr.prototype._encodeObjid=function(e,t,n){if(typeof e=="string"){if(!t)return this.reporter.error("string objid given, but no values map found");if(!t.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=t[e].split(/[\s.]+/g);for(let a=0;a<e.length;a++)e[a]|=0}else if(Array.isArray(e)){e=e.slice();for(let a=0;a<e.length;a++)e[a]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!n){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,e[0]*40+e[1])}let i=0;for(let a=0;a<e.length;a++){let c=e[a];for(i++;c>=128;c>>=7)i++}let s=wn.alloc(i),o=s.length-1;for(let a=e.length-1;a>=0;a--){let c=e[a];for(s[o--]=c&127;(c>>=7)>0;)s[o--]=128|c&127}return this._createEncoderBuffer(s)};function gr(r){return r<10?"0"+r:r}Pr.prototype._encodeTime=function(e,t){let n,i=new Date(e);return t==="gentime"?n=[gr(i.getUTCFullYear()),gr(i.getUTCMonth()+1),gr(i.getUTCDate()),gr(i.getUTCHours()),gr(i.getUTCMinutes()),gr(i.getUTCSeconds()),"Z"].join(""):t==="utctime"?n=[gr(i.getUTCFullYear()%100),gr(i.getUTCMonth()+1),gr(i.getUTCDate()),gr(i.getUTCHours()),gr(i.getUTCMinutes()),gr(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(n,"octstr")};Pr.prototype._encodeNull=function(){return this._createEncoderBuffer("")};Pr.prototype._encodeInt=function(e,t){if(typeof e=="string"){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if(typeof e!="number"&&!wn.isBuffer(e)){let s=e.toArray();!e.sign&&s[0]&128&&s.unshift(0),e=wn.from(s)}if(wn.isBuffer(e)){let s=e.length;e.length===0&&s++;let o=wn.alloc(s);return e.copy(o),e.length===0&&(o[0]=0),this._createEncoderBuffer(o)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let n=1;for(let s=e;s>=256;s>>=8)n++;let i=new Array(n);for(let s=i.length-1;s>=0;s--)i[s]=e&255,e>>=8;return i[0]&128&&i.unshift(0),this._createEncoderBuffer(wn.from(i))};Pr.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)};Pr.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getEncoder("der").tree};Pr.prototype._skipDefault=function(e,t,n){let i=this._baseState,s;if(i.default===null)return!1;let o=e.join();if(i.defaultBuffer===void 0&&(i.defaultBuffer=this._encodeValue(i.default,t,n).join()),o.length!==i.defaultBuffer.length)return!1;for(s=0;s<o.length;s++)if(o[s]!==i.defaultBuffer[s])return!1;return!0};function ej(r,e,t,n){let i;if(r==="seqof"?r="seq":r==="setof"&&(r="set"),Kh.tagByName.hasOwnProperty(r))i=Kh.tagByName[r];else if(typeof r=="number"&&(r|0)===r)i=r;else return n.error("Unknown tag: "+r);return i>=31?n.error("Multi-octet tag encoding unsupported"):(e||(i|=32),i|=Kh.tagClassByName[t||"universal"]<<6,i)}});var vE=A((lG,gE)=>{"use strict";var tj=zn(),Jh=Yh();function Xh(r){Jh.call(this,r),this.enc="pem"}tj(Xh,Jh);gE.exports=Xh;Xh.prototype.encode=function(e,t){let i=Jh.prototype.encode.call(this,e).toString("base64"),s=["-----BEGIN "+t.label+"-----"];for(let o=0;o<i.length;o+=64)s.push(i.slice(o,o+64));return s.push("-----END "+t.label+"-----"),s.join(`
|
|
95
|
-
`)}});var Zh=A(xE=>{"use strict";var yE=xE;yE.der=Yh();yE.pem=vE()});var em=A((pG,TE)=>{"use strict";var rj=zn(),nj=$h(),_E=Bs().DecoderBuffer,wE=eu(),bE=tu();function SE(r){this.enc="der",this.name=r.name,this.entity=r,this.tree=new Zt,this.tree._init(r.body)}TE.exports=SE;SE.prototype.decode=function(e,t){return _E.isDecoderBuffer(e)||(e=new _E(e,t)),this.tree._decode(e,t)};function Zt(r){wE.call(this,"der",r)}rj(Zt,wE);Zt.prototype._peekTag=function(e,t,n){if(e.isEmpty())return!1;let i=e.save(),s=Qh(e,'Failed to peek tag: "'+t+'"');return e.isError(s)?s:(e.restore(i),s.tag===t||s.tagStr===t||s.tagStr+"of"===t||n)};Zt.prototype._decodeTag=function(e,t,n){let i=Qh(e,'Failed to decode tag of "'+t+'"');if(e.isError(i))return i;let s=EE(e,i.primitive,'Failed to get length of "'+t+'"');if(e.isError(s))return s;if(!n&&i.tag!==t&&i.tagStr!==t&&i.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(i.primitive||s!==null)return e.skip(s,'Failed to match body of: "'+t+'"');let o=e.save(),a=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(a)?a:(s=e.offset-o.offset,e.restore(o),e.skip(s,'Failed to match body of: "'+t+'"'))};Zt.prototype._skipUntilEnd=function(e,t){for(;;){let n=Qh(e,t);if(e.isError(n))return n;let i=EE(e,n.primitive,t);if(e.isError(i))return i;let s;if(n.primitive||i!==null?s=e.skip(i):s=this._skipUntilEnd(e,t),e.isError(s))return s;if(n.tagStr==="end")break}};Zt.prototype._decodeList=function(e,t,n,i){let s=[];for(;!e.isEmpty();){let o=this._peekTag(e,"end");if(e.isError(o))return o;let a=n.decode(e,"der",i);if(e.isError(a)&&o)break;s.push(a)}return s};Zt.prototype._decodeStr=function(e,t){if(t==="bitstr"){let n=e.readUInt8();return e.isError(n)?n:{unused:n,data:e.raw()}}else if(t==="bmpstr"){let n=e.raw();if(n.length%2===1)return e.error("Decoding of string type: bmpstr length mismatch");let i="";for(let s=0;s<n.length/2;s++)i+=String.fromCharCode(n.readUInt16BE(s*2));return i}else if(t==="numstr"){let n=e.raw().toString("ascii");return this._isNumstr(n)?n:e.error("Decoding of string type: numstr unsupported characters")}else{if(t==="octstr")return e.raw();if(t==="objDesc")return e.raw();if(t==="printstr"){let n=e.raw().toString("ascii");return this._isPrintstr(n)?n:e.error("Decoding of string type: printstr unsupported characters")}else return/str$/.test(t)?e.raw().toString():e.error("Decoding of string type: "+t+" unsupported")}};Zt.prototype._decodeObjid=function(e,t,n){let i,s=[],o=0,a=0;for(;!e.isEmpty();)a=e.readUInt8(),o<<=7,o|=a&127,(a&128)===0&&(s.push(o),o=0);a&128&&s.push(o);let c=s[0]/40|0,l=s[0]%40;if(n?i=s:i=[c,l].concat(s.slice(1)),t){let u=t[i.join(" ")];u===void 0&&(u=t[i.join(".")]),u!==void 0&&(i=u)}return i};Zt.prototype._decodeTime=function(e,t){let n=e.raw().toString(),i,s,o,a,c,l;if(t==="gentime")i=n.slice(0,4)|0,s=n.slice(4,6)|0,o=n.slice(6,8)|0,a=n.slice(8,10)|0,c=n.slice(10,12)|0,l=n.slice(12,14)|0;else if(t==="utctime")i=n.slice(0,2)|0,s=n.slice(2,4)|0,o=n.slice(4,6)|0,a=n.slice(6,8)|0,c=n.slice(8,10)|0,l=n.slice(10,12)|0,i<70?i=2e3+i:i=1900+i;else return e.error("Decoding "+t+" time is not supported yet");return Date.UTC(i,s-1,o,a,c,l,0)};Zt.prototype._decodeNull=function(){return null};Zt.prototype._decodeBool=function(e){let t=e.readUInt8();return e.isError(t)?t:t!==0};Zt.prototype._decodeInt=function(e,t){let n=e.raw(),i=new nj(n);return t&&(i=t[i.toString(10)]||i),i};Zt.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getDecoder("der").tree};function Qh(r,e){let t=r.readUInt8(e);if(r.isError(t))return t;let n=bE.tagClass[t>>6],i=(t&32)===0;if((t&31)===31){let o=t;for(t=0;(o&128)===128;){if(o=r.readUInt8(e),r.isError(o))return o;t<<=7,t|=o&127}}else t&=31;let s=bE.tag[t];return{cls:n,primitive:i,tag:t,tagStr:s}}function EE(r,e,t){let n=r.readUInt8(t);if(r.isError(n))return n;if(!e&&n===128)return null;if((n&128)===0)return n;let i=n&127;if(i>4)return r.error("length octect is too long");n=0;for(let s=0;s<i;s++){n<<=8;let o=r.readUInt8(t);if(r.isError(o))return o;n|=o}return n}});var kE=A((fG,CE)=>{"use strict";var ij=zn(),sj=Xl().Buffer,tm=em();function rm(r){tm.call(this,r),this.enc="pem"}ij(rm,tm);CE.exports=rm;rm.prototype.decode=function(e,t){let n=e.toString().split(/[\r\n]+/g),i=t.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/,o=-1,a=-1;for(let u=0;u<n.length;u++){let f=n[u].match(s);if(f!==null&&f[2]===i)if(o===-1){if(f[1]!=="BEGIN")break;o=u}else{if(f[1]!=="END")break;a=u;break}}if(o===-1||a===-1)throw new Error("PEM section not found for: "+i);let c=n.slice(o+1,a).join("");c.replace(/[^a-z0-9+/=]+/gi,"");let l=sj.from(c,"base64");return tm.prototype.decode.call(this,l,t)}});var nm=A(RE=>{"use strict";var AE=RE;AE.der=em();AE.pem=kE()});var ME=A(OE=>{"use strict";var oj=Zh(),aj=nm(),cj=zn(),lj=OE;lj.define=function(e,t){return new js(e,t)};function js(r,e){this.name=r,this.body=e,this.decoders={},this.encoders={}}js.prototype._createNamed=function(e){let t=this.name;function n(i){this._initNamed(i,t)}return cj(n,e),n.prototype._initNamed=function(s,o){e.call(this,s,o)},new n(this)};js.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(aj[e])),this.decoders[e]};js.prototype.decode=function(e,t,n){return this._getDecoder(t).decode(e,n)};js.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(oj[e])),this.encoders[e]};js.prototype.encode=function(e,t,n){return this._getEncoder(t).encode(e,n)}});var IE=A(PE=>{"use strict";var ru=PE;ru.Reporter=Zl().Reporter;ru.DecoderBuffer=Bs().DecoderBuffer;ru.EncoderBuffer=Bs().EncoderBuffer;ru.Node=eu()});var LE=A(DE=>{"use strict";var NE=DE;NE._reverse=function(e){let t={};return Object.keys(e).forEach(function(n){(n|0)==n&&(n=n|0);let i=e[n];t[i]=n}),t};NE.der=tu()});var jE=A(BE=>{"use strict";var Fs=BE;Fs.bignum=$h();Fs.define=ME().define;Fs.base=IE();Fs.constants=LE();Fs.decoders=nm();Fs.encoders=Zh()});var Hs=A((im,HE)=>{var nu=require("buffer"),Vr=nu.Buffer;function FE(r,e){for(var t in r)e[t]=r[t]}Vr.from&&Vr.alloc&&Vr.allocUnsafe&&Vr.allocUnsafeSlow?HE.exports=nu:(FE(nu,im),im.Buffer=xi);function xi(r,e,t){return Vr(r,e,t)}xi.prototype=Object.create(Vr.prototype);FE(Vr,xi);xi.from=function(r,e,t){if(typeof r=="number")throw new TypeError("Argument must not be a number");return Vr(r,e,t)};xi.alloc=function(r,e,t){if(typeof r!="number")throw new TypeError("Argument must be a number");var n=Vr(r);return e!==void 0?typeof t=="string"?n.fill(e,t):n.fill(e):n.fill(0),n};xi.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return Vr(r)};xi.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return nu.SlowBuffer(r)}});var sm=A((yG,qE)=>{var iu=Hs().Buffer,uj=require("stream"),pj=require("util");function su(r){if(this.buffer=null,this.writable=!0,this.readable=!0,!r)return this.buffer=iu.alloc(0),this;if(typeof r.pipe=="function")return this.buffer=iu.alloc(0),r.pipe(this),this;if(r.length||typeof r=="object")return this.buffer=r,this.writable=!1,process.nextTick(function(){this.emit("end",r),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof r+")")}pj.inherits(su,uj);su.prototype.write=function(e){this.buffer=iu.concat([this.buffer,iu.from(e)]),this.emit("data",e)};su.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1};qE.exports=su});var $E=A((xG,UE)=>{"use strict";function om(r){var e=(r/8|0)+(r%8===0?0:1);return e}var fj={ES256:om(256),ES384:om(384),ES512:om(521)};function dj(r){var e=fj[r];if(e)return e;throw new Error('Unknown algorithm "'+r+'"')}UE.exports=dj});var JE=A((_G,YE)=>{"use strict";var ou=Hs().Buffer,GE=$E(),au=128,zE=0,hj=32,mj=16,gj=2,VE=mj|hj|zE<<6,cu=gj|zE<<6;function vj(r){return r.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function KE(r){if(ou.isBuffer(r))return r;if(typeof r=="string")return ou.from(r,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function yj(r,e){r=KE(r);var t=GE(e),n=t+1,i=r.length,s=0;if(r[s++]!==VE)throw new Error('Could not find expected "seq"');var o=r[s++];if(o===(au|1)&&(o=r[s++]),i-s<o)throw new Error('"seq" specified length of "'+o+'", only "'+(i-s)+'" remaining');if(r[s++]!==cu)throw new Error('Could not find expected "int" for "r"');var a=r[s++];if(i-s-2<a)throw new Error('"r" specified length of "'+a+'", only "'+(i-s-2)+'" available');if(n<a)throw new Error('"r" specified length of "'+a+'", max of "'+n+'" is acceptable');var c=s;if(s+=a,r[s++]!==cu)throw new Error('Could not find expected "int" for "s"');var l=r[s++];if(i-s!==l)throw new Error('"s" specified length of "'+l+'", expected "'+(i-s)+'"');if(n<l)throw new Error('"s" specified length of "'+l+'", max of "'+n+'" is acceptable');var u=s;if(s+=l,s!==i)throw new Error('Expected to consume entire buffer, but "'+(i-s)+'" bytes remain');var f=t-a,h=t-l,g=ou.allocUnsafe(f+a+h+l);for(s=0;s<f;++s)g[s]=0;r.copy(g,s,c+Math.max(-f,0),c+a),s=t;for(var x=s;s<x+h;++s)g[s]=0;return r.copy(g,s,u+Math.max(-h,0),u+l),g=g.toString("base64"),g=vj(g),g}function WE(r,e,t){for(var n=0;e+n<t&&r[e+n]===0;)++n;var i=r[e+n]>=au;return i&&--n,n}function xj(r,e){r=KE(r);var t=GE(e),n=r.length;if(n!==t*2)throw new TypeError('"'+e+'" signatures must be "'+t*2+'" bytes, saw "'+n+'"');var i=WE(r,0,t),s=WE(r,t,r.length),o=t-i,a=t-s,c=2+o+1+1+a,l=c<au,u=ou.allocUnsafe((l?2:3)+c),f=0;return u[f++]=VE,l?u[f++]=c:(u[f++]=au|1,u[f++]=c&255),u[f++]=cu,u[f++]=o,i<0?(u[f++]=0,f+=r.copy(u,f,0,t)):f+=r.copy(u,f,i,t),u[f++]=cu,u[f++]=a,s<0?(u[f++]=0,r.copy(u,f,t)):r.copy(u,f,t+s),u}YE.exports={derToJose:yj,joseToDer:xj}});var ZE=A((bG,XE)=>{"use strict";var na=require("buffer").Buffer,am=require("buffer").SlowBuffer;XE.exports=lu;function lu(r,e){if(!na.isBuffer(r)||!na.isBuffer(e)||r.length!==e.length)return!1;for(var t=0,n=0;n<r.length;n++)t|=r[n]^e[n];return t===0}lu.install=function(){na.prototype.equal=am.prototype.equal=function(e){return lu(this,e)}};var _j=na.prototype.equal,bj=am.prototype.equal;lu.restore=function(){na.prototype.equal=_j,am.prototype.equal=bj}});var pm=A((wG,a1)=>{var Us=Hs().Buffer,vr=require("crypto"),e1=JE(),QE=require("util"),wj=`"%s" is not a valid algorithm.
|
|
94
|
+
`),kl.add(e),r.on("close",()=>kl.delete(e))}function Bw(r,e){X(e,{...gn,...Or,desktopEnabled:$t,remoteAvailable:mh})}async function jw(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(jt(),ji)),n=await t(r,e);n&&(vn(n),X(e))}function Fw(r,e){X(e),vn({step:Zn.PREPARING,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null}),qn("restart-tunnel")}function Hw(r,e){X(e),vn({step:Zn.PREPARING,stepDesc:""}),qn("start-tunnel")}function qw(r,e){X(e),vn({step:Zn.STOPPED,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null}),qn("stop-tunnel")}function Uw(r,e){X(e),vn({step:Zn.STOPPED,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null}),qn("shutdown")}function $w(r,e){X(e),qn("update")}function Ww(r,e){X(e,{connections:[...mi.values()]})}function Gw(r,e){let t=new URL(r.url,"http://localhost"),n=parseInt(t.searchParams.get("lines")||Ip,10);X(e,{logs:$v(Number.isFinite(n)?n:Ip)})}async function zw(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(jt(),ji)),n=await t(r,e);if(!n)return;let i=!!n.enabled;if(i&&(!Or.screenRecording||!Or.accessibility)){X(e,{ok:!1,enabled:$t,reason:"permissions_required"});return}let s=Cs();$t=i,hh(),Tt("permissions",{...Or,desktopEnabled:$t}),Cs()!==s&&gh?.(),X(e,{ok:!0,enabled:$t})}function Vw(r,e){X(e,Or)}async function Kw(r,e){let t=await sh();X(e,{enabled:t})}async function Yw(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(jt(),ji)),n=await t(r,e);if(!n)return;let i=await gw(!!n.enabled),s=await sh();Tt("autostart",{enabled:s}),X(e,{ok:i,enabled:s})}async function Jw(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(jt(),ji)),n=await t(r,e);if(!n)return;let{type:i}=n;if(process.platform==="darwin"){lw(i);let s=Date.now(),o=setInterval(async()=>{((await Rl())[i]||Date.now()-s>Lv)&&clearInterval(o)},Dv)}X(e)}var Un,Sw,dh,gn,$t,mh,Or,kl,mi,Al,gh,yn=Ce(()=>{bt();Hi();bt();bs();uw();oh();jt();hl();bt();Un=require("fs"),Sw=require("path");bt();ah();dh=(0,Sw.join)(ie.STATE,"ui-state.json");gn={step:Zn.STOPPED,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null,permanentKey:"",qrUrl:"",latency:null,uptime:null,healthCheck:{running:!1,timeoutMs:0,startedAt:null,logs:[]},tunnelHealth:{status:"unknown",checkedAt:null}},$t=!1,mh=!1,Or={screenRecording:!1,accessibility:!1},kl=new Set,mi=new Map;Uv(xe);Al=null;gh=null});var Xw={};en(Xw,{ScreenHandler:()=>vh,encodeTilesBatch:()=>ks});function CB(r){let e=Buffer.alloc(28);return e.writeUInt32LE(r.tileIndex,0),e.writeUInt32LE(r.x,4),e.writeUInt32LE(r.y,8),e.writeUInt32LE(r.width,12),e.writeUInt32LE(r.height,16),e.writeUInt32LE(r.imageBuffer.length,20),e.writeUInt32LE(r.hash>>>0,24),Buffer.concat([e,r.imageBuffer])}function ks(r,e){let t=Buffer.alloc(12);return t.writeUInt32LE(r.length,0),t.writeDoubleBE(e,4),Buffer.concat([t,...r.map(CB)])}var vh,yh=Ce(()=>{eh();pt();yn();vh=class{constructor(e,t){this.resourceManager=e,this.screenUpdateHelper=t}setupScreenHandlers(e,t,n){e.on("request-screen",t(async()=>{let i=this.resourceManager.getClient(e.id);if(i)try{let s=await i.tileManager.detectChangedTiles();s.length>0&&n.sendTiles({tiles:s,timestamp:Date.now()},ks),this.resourceManager.updateClientActivity(e.id)}catch(s){ve.error("Tile capture error:",s),n.emit("screen-error",{error:s.message})}})),e.on("request-screen-with-hashes",t(async i=>{let s=this.resourceManager.getClient(e.id);if(s)try{let o=i.tileHashes||[],a=await s.tileManager.compareClientTileHashes(o);a?.tiles?.length>0&&n.sendTiles({tiles:a.tiles,timestamp:Date.now()},ks),this.resourceManager.updateClientActivity(e.id)}catch(o){ve.error("Tile capture with hashes error:",o),n.emit("screen-error",{error:o.message})}})),e.on("start-streaming",t(async()=>{let i=this.resourceManager.getClient(e.id);if(!i)return;i.streamingTimeout&&(clearTimeout(i.streamingTimeout),i.streamingTimeout=null),ve.lifecycle("\u{1F680} Remote streaming started");let{tileFormat:s,webpEffort:o,jpegQuality:a}=$.pipeline;xe(`\u{1F5BC}\uFE0F Remote stream codec: ${s.toUpperCase()}${s==="webp"?` (effort=${o})`:""} q=${a}`),i.idleFrameCount=0,i.isStreaming=!0,i.streamGen=(i.streamGen||0)+1;let c=i.streamGen;i.tileManager.lastTileChecksums.clear();try{let u=await i.tileManager.getScreenDimensions();n.emit("screen-dimensions",u)}catch(u){ve.error("Get dimensions error:",u)}let l=async()=>{if(!e.connected||!i.isStreaming||i.streamGen!==c){i.streamingTimeout=null;return}try{let u=performance.now(),f=await i.tileManager.detectChangedTilesWithHashes();if(f.tiles.length>0&&e.connected){let R=n.sendTiles({tiles:f.tiles,timestamp:Date.now(),currentHashes:f.currentHashes},ks);i.tileManager.commitHashes(R||[]),i.idleFrameCount=0}else i.idleFrameCount++;let{activeInterval:h,idleInterval:g,idleThreshold:x}=this.resourceManager.getStreamingConfig(),S=i.idleFrameCount>=x?g:h,C=Math.max(0,S-(performance.now()-u));i.streamingTimeout=setTimeout(l,C)}catch(u){ve.error("Auto streaming error:",u),i.streamingTimeout=setTimeout(l,200)}};l()})),e.on("stop-streaming",()=>{let i=this.resourceManager.getClient(e.id);i&&(i.isStreaming=!1,i.streamingTimeout&&(clearTimeout(i.streamingTimeout),i.streamingTimeout=null),i.tileManager?.clearMemory?.(),ve.lifecycle("\u23F9\uFE0F Remote streaming stopped"))}),e.on("get-screen-dimensions",t(async()=>{let i=this.resourceManager.getClient(e.id);if(i)try{let s=await i.tileManager.getScreenDimensions();n.emit("screen-dimensions",s)}catch(s){ve.error("Get dimensions error:",s),n.emit("screen-error",{error:s.message})}})),e.on("boost-stream",t(()=>{let i=this.resourceManager.getClient(e.id);i&&(i.idleFrameCount=0)})),e.on("set-focus",t(i=>{let s=this.resourceManager.getClient(e.id);if(!s)return;let o=i?.rect||null,a=typeof i?.zoom=="number"?i.zoom:1,c=typeof i?.viewerWidth=="number"?i.viewerWidth:0,l=typeof i?.dpr=="number"?i.dpr:1,u=s.tileManager.pickProfile({zoom:a,viewerWidth:c,dpr:l});if(s.tileManager.setProfile(u),s.tileManager.setFocusRect(o),o){let f=s.tileManager.activeTileSet?.size||0,h=s.tileManager.totalTiles,g=h?(f/h*100).toFixed(0):0;ve.focus(`\u{1F3AF} [Focus] rect=${o.x},${o.y} ${o.w}x${o.h} | tiles ${f}/${h} (${g}%)`)}else ve.focus("\u{1F3AF} [Focus] cleared \u2192 full screen")}))}}});function Zw(r){xh.add(r)}function As(r){xh.delete(r)}function yt(r,e,t){for(let n of xh)if(n.hasReadyAdapter?.())try{n.emit(e,t)}catch{}}var xh,gi=Ce(()=>{xh=new Set});async function hS(){if(ra)return ra;let r=await import("node-screenshots");if(ra=(r.Monitor||r.default?.Monitor).all()[0],!ra)throw new Error("No monitor found via node-screenshots");return ra}async function mS(r){Ch=r,$.pipeline.captureLib==="nodeScreenshots"&&await hS()}async function gS(){let{captureLib:r,inputFormat:e}=$.pipeline;if(r==="robotjs"){let{width:s,height:o}=Ch.getScreenSize(),a=Ch.screen.capture(0,0,s,o),c=a.byteWidth/a.bytesPerPixel;return{buffer:Buffer.from(a.image),width:c,height:a.height,channels:a.bytesPerPixel,format:e}}let n=await(await hS()).captureImage();return{buffer:await n.toRaw(),width:n.width,height:n.height,channels:4,format:e}}var Ch,ra,vS=Ce(()=>{pt();Ch=null,ra=null});function HB(r){return r==="bgra"?Ah.FORMAT_BGRA:Ah.FORMAT_RGBA}function Rh(r){let e=new Uint32Array(r.buffer,r.byteOffset,r.length>>2);for(let t=0;t<e.length;t++){let n=e[t];e[t]=n&4278255360|(n&16711680)>>16|(n&255)<<16}}async function yS(r,e,t,n=4,i,s){let{encoder:o,inputFormat:a,jpegQuality:c,tileFormat:l,webpEffort:u}=$.pipeline,f=i??c,h=s??a;if(o==="jpegTurbo"&&l!=="webp")return Ah.compressSync(r,{width:e,height:t,format:HB(h),quality:f});let g=r;h==="bgra"&&(g=Buffer.from(r),Rh(g));let x=(0,Hl.default)(g,{raw:{width:e,height:t,channels:n}});return l==="webp"?x.webp({quality:f,effort:u}).toBuffer():x.jpeg({quality:f}).toBuffer()}var Hl,kh,Ah,xS=Ce(()=>{Hl=K(require("sharp"),1),kh=K(require("@julusian/jpeg-turbo"),1);pt();Ah=kh.default.default||kh.default;Hl.default.cache(!1);Hl.default.concurrency(1)});var ql,_S=Ce(()=>{pt();yn();ql=class{constructor(){this.cfg=$.logging,this.samples=[],this.lastLogTime=Date.now()}now(){return this.cfg.metrics?performance.now():0}record({capture:e,checksum:t,encode:n,total:i,changedTiles:s,totalTiles:o,tileBytes:a,rawBytes:c}){this.cfg.metrics&&(this.samples.push({capture:e,checksum:t,encode:n,total:i,changedTiles:s,totalTiles:o,tileBytes:a,rawBytes:c}),this.samples.length>=this.cfg.metricsEveryFrames&&this._flush())}_flush(){let e=this.samples.length,t=I=>(this.samples.reduce((B,V)=>B+V[I],0)/e).toFixed(1),n=(Date.now()-this.lastLogTime)/1e3,i=(e/n).toFixed(1),s=[],o=0;for(let I of this.samples){for(let B of I.tileBytes)s.push(B);o+=I.tileBytes.reduce((B,V)=>B+V,0)}let a=(o/e/1024).toFixed(1),c=s.length?(s.reduce((I,B)=>I+B,0)/s.length/1024).toFixed(2):"0",l=s.length?(Math.min(...s)/1024).toFixed(2):"0",u=s.length?(Math.max(...s)/1024).toFixed(2):"0",f=this.samples.reduce((I,B)=>I+B.rawBytes,0)/e,h=o/e,g=h>0?(f/h).toFixed(0):"0",x=(this.samples.reduce((I,B)=>I+B.changedTiles,0)/e).toFixed(0),S=this.samples[0]?.totalTiles||0,C=S?(x/S*100).toFixed(1):"0",R=$.pipeline,M=`[Metrics] ${R.captureLib}+${R.encoder} tile=${R.tileSize} q${R.jpegQuality} scale=${R.outputScale} | fps=${i} | capture=${t("capture")}ms enc=${t("encode")}ms total=${t("total")}ms | tiles=${x}/${S} (${C}%) | data=${a}KB/frame | tileAvg=${c}KB (min ${l}, max ${u}) | compress=${g}x`;xe(M),console.log(M),this.samples=[],this.lastLogTime=Date.now()}}});var SS={};en(SS,{TileManager:()=>Oh,mapLimit:()=>yi});async function yi(r,e,t){let n=new Array(r.length),i=0,s=Math.min(e,r.length),o=Array.from({length:s},async(a,c)=>{for(;i<r.length;){let l=i++;n[l]=await t(r[l],l,c)}});return await Promise.all(o),n}var Ps,$l,bS,Ul,wS,qB,UB,Oh,ES=Ce(()=>{Ps=K(require("fs"),1),$l=K(require("path"),1),bS=K(require("sharp"),1),Ul=require("child_process"),wS=require("url");pt();vS();xS();_S();eh();qB=(0,wS.fileURLToPath)(__importMetaUrl),UB=$l.default.dirname(qB);Oh=class{constructor(e){this.robot=e,this.metrics=new ql,this.tileSize=$.pipeline.tileSize,this.lastTileChecksums=new Map,this.screenWidth=0,this.screenHeight=0,this.tilesPerRow=0,this.tilesPerColumn=0,this.totalTiles=0,this.frameCount=0,this.tempDir=$l.default.join(UB,"../../temp"),this.changeThreshold=1,this.scaledWidth=0,this.scaledHeight=0,this.isProcessing=!1,this.sharedScreenCache=null,this.lastCaptureTime=0,this.CACHE_TTL=100,this.dpiScale=1,this.captureWidth=0,this.captureHeight=0,this.scaleFactor=$.pipeline.outputScale||1,this.compressionQuality=$.pipeline.jpegQuality,this.activeTileSet=null,this.focusStats={frames:0,scanned:0,changed:0,bytes:0},this._scratchExtract=[],this._scratchSwap=[],this._prefetchCapture=null,Ps.default.existsSync(this.tempDir)||Ps.default.mkdirSync(this.tempDir,{recursive:!0}),mS(e),this.initializeScreenDimensions()}initializeScreenDimensions(){try{let{width:e,height:t}=this.robot.getScreenSize();this.screenWidth=e,this.screenHeight=t,this.detectDpiScale(),this.scaledWidth=this.captureWidth,this.scaledHeight=this.captureHeight,this.tilesPerRow=Math.ceil(this.scaledWidth/this.tileSize),this.tilesPerColumn=Math.ceil(this.scaledHeight/this.tileSize),this.totalTiles=this.tilesPerRow*this.tilesPerColumn;let n=100;if(this.totalTiles>n){let i=Math.ceil(Math.sqrt(this.scaledWidth*this.scaledHeight/n));this.tileSize=Math.max(i,120),this.tilesPerRow=Math.ceil(this.scaledWidth/this.tileSize),this.tilesPerColumn=Math.ceil(this.scaledHeight/this.tileSize),this.totalTiles=this.tilesPerRow*this.tilesPerColumn}}catch(e){ve.error("Screen dimensions error:",e),this.screenWidth=1920,this.screenHeight=1080,this.dpiScale=1,this.captureWidth=1920,this.captureHeight=1080,this.scaledWidth=1728,this.scaledHeight=972,this.tileSize=120,this.tilesPerRow=Math.ceil(this.scaledWidth/this.tileSize),this.tilesPerColumn=Math.ceil(this.scaledHeight/this.tileSize),this.totalTiles=this.tilesPerRow*this.tilesPerColumn}}detectDpiScale(){if(process.platform==="darwin"){let e=this.robot.screen.capture(0,0,this.screenWidth,this.screenHeight),n=e.byteWidth/e.bytesPerPixel/this.screenWidth;n>=1.9&&n<=2.1?this.dpiScale=2:this.dpiScale=1}else process.platform==="win32"?this.dpiScale=this._detectDpiScaleWin32():this.dpiScale=1;this.captureWidth=Math.floor(this.screenWidth*this.dpiScale),this.captureHeight=Math.floor(this.screenHeight*this.dpiScale)}_detectDpiScaleWin32(){ve.dpi(`\u{1F50D} [DPI Detection] screenWidth from robot: ${this.screenWidth}x${this.screenHeight}`);try{let e=(0,Ul.execSync)(`powershell -NonInteractive -NoProfile -WindowStyle Hidden -command "try{Get-ItemPropertyValue 'HKCU:\\Control Panel\\Desktop\\WindowMetrics' -Name AppliedDPI}catch{0}"`,{encoding:"utf8",windowsHide:!0}).trim(),t=Number(e);if(ve.dpi(`\u{1F50D} [DPI Detection] Strategy 1 (Registry AppliedDPI): ${t} DPI`),t>=96){let n=t/96;return ve.dpi(`\u2705 [DPI Detection] Using registry scale: ${n}x (${t}/96)`),n}}catch(e){ve.dpi(`\u274C [DPI Detection] Strategy 1 failed: ${e.message}`)}try{let e=(0,Ul.execSync)('powershell -NonInteractive -NoProfile -WindowStyle Hidden -command "(Get-WmiObject -Class Win32_VideoController | Select-Object -First 1).CurrentHorizontalResolution"',{encoding:"utf8",windowsHide:!0}).trim(),t=Number(e);if(ve.dpi(`\u{1F50D} [DPI Detection] Strategy 2 (WMI): physical width = ${t}px`),t>0&&t>this.screenWidth){let n=t/this.screenWidth;return ve.dpi(`\u2705 [DPI Detection] Using WMI scale: ${n}x (${t}/${this.screenWidth})`),n}}catch(e){ve.dpi(`\u274C [DPI Detection] Strategy 2 failed: ${e.message}`)}try{let e=(0,Ul.execSync)(`powershell -NonInteractive -NoProfile -WindowStyle Hidden -command "Add-Type -TypeDefinition 'using System;using System.Runtime.InteropServices;public class Disp{[DllImport(\\"user32\\")]public static extern bool EnumDisplaySettings(string d,int m,ref DEVMODE dm);[StructLayout(LayoutKind.Sequential,CharSet=CharSet.Ansi)]public struct DEVMODE{[MarshalAs(UnmanagedType.ByValTStr,SizeConst=32)]public string dmDeviceName;public short dmSpecVersion,dmDriverVersion,dmSize,dmDriverExtra;public int dmFields;public int dmPositionX,dmPositionY,dmDisplayOrientation,dmDisplayFixedOutput;public short dmColor,dmDuplex,dmYResolution,dmTTOption,dmCollate;[MarshalAs(UnmanagedType.ByValTStr,SizeConst=32)]public string dmFormName;public short dmLogPixels;public int dmBitsPerPel,dmPelsWidth,dmPelsHeight,dmDisplayFlags,dmDisplayFrequency;}}'; $dm=New-Object Disp+DEVMODE; $dm.dmSize=[System.Runtime.InteropServices.Marshal]::SizeOf($dm); [Disp]::EnumDisplaySettings($null,-1,[ref]$dm) | Out-Null; Write-Output $dm.dmPelsWidth"`,{encoding:"utf8",windowsHide:!0}).trim(),t=Number(e);if(ve.dpi(`\u{1F50D} [DPI Detection] Strategy 3 (EnumDisplaySettings): physical width = ${t}px`),t>0&&t>this.screenWidth){let n=t/this.screenWidth;return ve.dpi(`\u2705 [DPI Detection] Using EnumDisplaySettings scale: ${n}x (${t}/${this.screenWidth})`),n}}catch(e){ve.dpi(`\u274C [DPI Detection] Strategy 3 failed: ${e.message}`)}return ve.dpi("\u26A0\uFE0F [DPI Detection] All strategies failed, fallback to 1x"),1}async captureFullScreen(){let e=await gS();return{buffer:e.buffer,width:e.width,height:e.height,channels:e.channels}}async getSharedScreenCapture(){let e=Date.now();return this.sharedScreenCache&&e-this.lastCaptureTime<this.CACHE_TTL?this.sharedScreenCache:(this.sharedScreenCache=await this.captureFullScreen(),this.lastCaptureTime=e,this.sharedScreenCache)}async getCaptureForStreaming(){if(!this._prefetchCapture){let t=await this.captureFullScreen();return this._prefetchCapture=this.captureFullScreen(),t}let e=await this._prefetchCapture;return this._prefetchCapture=this.captureFullScreen(),e}clearScreenCache(){}async detectChangedTiles(){return(await this.detectChangedTilesWithHashes()).tiles}async detectChangedTilesWithHashes(){if(this.isProcessing)return{tiles:[],currentHashes:Array.from(this.lastTileChecksums.values())};this.isProcessing=!0;let e=this.metrics.now(),t=e,n=e;try{let i=await this.getCaptureForStreaming();t=this.metrics.now();let s=[],o=[],a=new Map;this.frameCount++;let c=this.activeTileSet;for(let f=0;f<this.totalTiles;f++){if(c&&!c.has(f))continue;let h=this.calculateTileChecksumDirect(i,f);a.set(f,h)}n=this.metrics.now();let l=Array.from(a.values());if(this.lastTileChecksums.size===0){let f=[];for(let g=0;g<this.totalTiles;g++)c&&!c.has(g)||f.push(g);let h=await yi(f,$.pipeline.tileConcurrency,(g,x,S)=>this.processTileAsync(i,g,null,a.get(g),S));return s.push(...h),this._recordFrame(e,t,n,s,i),{tiles:s,currentHashes:l}}for(let f=0;f<this.totalTiles;f++){if(c&&!c.has(f))continue;let h=a.get(f),g=this.lastTileChecksums.get(f);h!==g&&o.push(f)}if(o.length/this.totalTiles>this.changeThreshold){let f=[];for(let g=0;g<this.totalTiles;g++)c&&!c.has(g)||f.push(g);let h=await yi(f,$.pipeline.tileConcurrency,(g,x,S)=>this.processTileAsync(i,g,null,a.get(g),S));s.push(...h.map(g=>({...g,fullRefresh:!0})))}else if(o.length>0){let f=await yi(o,$.pipeline.tileConcurrency,(h,g,x)=>this.processTileAsync(i,h,null,a.get(h),x));s.push(...f)}return this._recordFrame(e,t,n,s,i),{tiles:s,currentHashes:l}}finally{this.isProcessing=!1}}async processTileAsync(e,t,n=null,i=null,s=null){let o=n||this.extractTile(e,t,s),a=await this.compressTileImage(o.buffer,o.width,o.height,s),{row:c,col:l}=this.getTilePosition(t);return{type:"tile-update",tileIndex:t,x:l*this.tileSize,y:c*this.tileSize,width:o.width,height:o.height,imageBuffer:a,hash:i??this.lastTileChecksums.get(t)??0,timestamp:Date.now(),frameCount:this.frameCount}}commitHashes(e){for(let t of e)this.lastTileChecksums.set(t.tileIndex,t.hash)}calculateTileChecksumDirect(e,t){let{row:n,col:i}=this.getTilePosition(t),s=i*this.tileSize,o=n*this.tileSize,a=Math.min(s+this.tileSize,e.width),c=Math.min(o+this.tileSize,e.height),l=a-s,u=c-o,f=e.channels,h=e.width*f,g=0,{rowStep:x,colStep:S}=$.pipeline.checksumSampling;for(let C=0;C<u;C+=x){let R=(o+C)*h+s*f;for(let M=0;M<l;M+=S){let I=R+M*f,B=M+1;g=g+e.buffer[I]*B>>>0,g^=e.buffer[I+1]<<1,g=g+e.buffer[I+2]*B>>>0,g^=e.buffer[I+3]<<2}}return g>>>0}setFocusRect(e){if(!e){this.activeTileSet=null;return}let t=$.focus.paddingTiles,n=Math.max(0,Math.floor(e.x/this.tileSize)-t),i=Math.max(0,Math.floor(e.y/this.tileSize)-t),s=Math.min(this.tilesPerRow-1,Math.floor((e.x+e.w)/this.tileSize)+t),o=Math.min(this.tilesPerColumn-1,Math.floor((e.y+e.h)/this.tileSize)+t),a=new Set;for(let l=i;l<=o;l++)for(let u=n;u<=s;u++)a.add(l*this.tilesPerRow+u);let c=this.activeTileSet;if(c)for(let l of a)c.has(l)||this.lastTileChecksums.delete(l);this.activeTileSet=a}getTilePosition(e){return{row:Math.floor(e/this.tilesPerRow),col:e%this.tilesPerRow}}_getScratch(e,t,n){let i=e[t];return(!i||i.length<n)&&(i=Buffer.allocUnsafe(n),e[t]=i),i.subarray(0,n)}extractTile(e,t,n=null){let{row:i,col:s}=this.getTilePosition(t),o=s*this.tileSize,a=i*this.tileSize,c=Math.min(o+this.tileSize,e.width),l=Math.min(a+this.tileSize,e.height),u=c-o,f=l-a,h=e.channels,g=u*h,x=u*f*h,S=n===null?Buffer.allocUnsafe(x):this._getScratch(this._scratchExtract,n,x);for(let C=0;C<f;C++){let R=((a+C)*e.width+o)*h,M=C*g;e.buffer.copy(S,M,R,R+g)}return{buffer:S,width:u,height:f,channels:h,tileIndex:t,x:o,y:a}}async compressTileImage(e,t,n,i=null){let s=this.scaleFactor;if(s&&s>0&&s<1){let o=Math.max(1,Math.floor(t*s)),a=Math.max(1,Math.floor(n*s)),{inputFormat:c}=$.pipeline,l=e,u=4;c==="bgra"&&(i===null?l=Buffer.from(e):(l=this._getScratch(this._scratchSwap,i,e.length),e.copy(l)),Rh(l));let{tileFormat:f,webpEffort:h}=$.pipeline,g=(0,bS.default)(l,{raw:{width:t,height:n,channels:u}}).resize(o,a,{kernel:"lanczos3",fastShrinkOnLoad:!1});return f==="webp"?g.webp({quality:this.compressionQuality,effort:h}).toBuffer():g.jpeg({quality:this.compressionQuality}).toBuffer()}return yS(e,t,n,4,this.compressionQuality)}pickProfile({zoom:e=1,viewerWidth:t=0,dpr:n=1}={}){let i=$.pipeline.adaptiveTiers||[];if(!i.length)return null;let s=this.captureWidth||this.screenWidth||1,o=t>0?t:s,a=e>0?e:1,c=n>0?n:1,l=o*a*c/s,u=$.pipeline.tierHysteresis||0,f=this._currentTier;for(let g of i){let x=f&&g===f?g.minEffective-u:g.minEffective;if(l>=x)return this._currentTier=g,g}let h=i[i.length-1];return this._currentTier=h,h}setProfile(e){if(!e)return;let t=e.outputScale??this.scaleFactor,n=e.jpegQuality??this.compressionQuality;t===this.scaleFactor&&n===this.compressionQuality||(this.scaleFactor=t,this.compressionQuality=n,this.lastTileChecksums.clear())}_recordFrame(e,t,n,i,s){if(this._recordFocusFrame(i),!this.metrics.cfg.metrics)return;let o=this.metrics.now(),a=i.map(l=>l.imageBuffer?.length||0),c=s?s.width*s.height*s.channels:0;this.metrics.record({capture:t-e,checksum:n-t,encode:o-n,total:o-e,changedTiles:i.length,totalTiles:this.totalTiles,tileBytes:a,rawBytes:c})}_recordFocusFrame(e){let t=this.focusStats;t.frames++,t.scanned+=this.activeTileSet?this.activeTileSet.size:this.totalTiles,t.changed+=e.length;for(let c of e)t.bytes+=c.imageBuffer?.length||0;if(t.frames<$.logging.focusEveryFrames)return;let n=(t.scanned/t.frames).toFixed(0),i=(t.changed/t.frames).toFixed(1),s=(t.bytes/t.frames/1024).toFixed(1),o=this.totalTiles?((1-n/this.totalTiles)*100).toFixed(0):0,a=this.activeTileSet?"focus":"full";ve.focus(`\u{1F3AF} [Focus/${a}] ${t.frames}f | scan ${n}/${this.totalTiles} tiles (saved ${o}%) | changed ${i}/f | data ${s}KB/f`),this.focusStats={frames:0,scanned:0,changed:0,bytes:0}}async getScreenDimensions(){try{let e=await this.captureFullScreen();this.scaledWidth=e.width,this.scaledHeight=e.height,this.tilesPerRow=Math.ceil(e.width/this.tileSize),this.tilesPerColumn=Math.ceil(e.height/this.tileSize),this.totalTiles=this.tilesPerRow*this.tilesPerColumn}catch(e){ve.error("Error getting dimensions:",e)}return{width:this.scaledWidth,height:this.scaledHeight,tileWidth:this.tileSize,tileHeight:this.tileSize,tileCount:this.totalTiles,scaleFactor:this.scaleFactor,originalWidth:this.screenWidth,originalHeight:this.screenHeight}}async compareClientTileHashes(e){if(this.isProcessing)return{tiles:[],currentHashes:[],changedIndices:[]};this.isProcessing=!0;try{let t=await this.getSharedScreenCapture(),n=[],i=[];this.frameCount++;let s=this.activeTileSet,o=new Map;for(let c=0;c<this.totalTiles;c++){if(s&&!s.has(c))continue;let l=this.calculateTileChecksumDirect(t,c);o.set(c,l),this.lastTileChecksums.set(c,l)}if(!e||e.length===0){let c=[];for(let u=0;u<this.totalTiles;u++)s&&!s.has(u)||c.push(u);let l=await yi(c,$.pipeline.tileConcurrency,u=>this.processTileAsync(t,u));return n.push(...l),{tiles:n,currentHashes:Array.from(o.values())}}for(let c=0;c<this.totalTiles;c++)s&&!s.has(c)||e[c]!==o.get(c)&&i.push(c);if(i.length/this.totalTiles>this.changeThreshold){let c=[];for(let u=0;u<this.totalTiles;u++)s&&!s.has(u)||c.push(u);let l=await yi(c,$.pipeline.tileConcurrency,u=>this.processTileAsync(t,u));n.push(...l.map(u=>({...u,fullRefresh:!0})))}else if(i.length>0){let c=await yi(i,$.pipeline.tileConcurrency,l=>this.processTileAsync(t,l));n.push(...c)}return this._recordFocusFrame(n),{tiles:n,currentHashes:Array.from(o.values()),changedIndices:i}}finally{this.isProcessing=!1}}clearMemory(){this.sharedScreenCache=null,this.lastCaptureTime=0,this.lastTileChecksums.clear(),this._scratchExtract=[],this._scratchSwap=[],this._traceFrames=50,this._prefetchCapture=null}reset(){this.lastTileChecksums.clear(),this.frameCount=0}cleanup(){try{Ps.default.existsSync(this.tempDir)&&Ps.default.readdirSync(this.tempDir).forEach(t=>Ps.default.unlinkSync($l.default.join(this.tempDir,t)))}catch(e){ve.warn(`Cleanup error: ${e.message}`)}}}});var TS={};en(TS,{ResourceManager:()=>Mh});var Mh,CS=Ce(()=>{pt();gi();Mh=class{constructor(){this.activeClients=new Map,this.activeTimers=new Map,this.chunkTimers=new Map,this.memoryCheckInterval=null}startResourceMonitoring(){this.memoryCheckInterval=setInterval(()=>{let e=process.memoryUsage(),t=Math.round(e.heapUsed/1024/1024);t>$.resourceManagement.memoryWarningThreshold&&(console.warn(`\u26A0\uFE0F High memory: ${t}MB`),this.cleanupInactiveClients())},$.resourceManagement.memoryCheckInterval)}stopResourceMonitoring(){this.memoryCheckInterval&&(clearInterval(this.memoryCheckInterval),this.memoryCheckInterval=null)}addClient(e,t){this.activeClients.set(e,{...t,lastActivity:Date.now()})}getClient(e){return this.activeClients.get(e)}updateClientActivity(e){let t=this.activeClients.get(e);t&&(t.lastActivity=Date.now())}cleanupInactiveClients(){let e=Date.now(),t=$.resourceManagement.inactiveTimeout;for(let[n,i]of this.activeClients.entries())e-i.lastActivity>t&&(console.log(`\u{1F9F9} Cleaning inactive client: ${n}`),this.cleanupClientResources(n,i),this.activeClients.delete(n))}cleanupClientResources(e,t){try{t.isStreaming=!1,t?.streamingTimeout&&(clearTimeout(t.streamingTimeout),t.streamingTimeout=null),t?.screenInterval&&(clearInterval(t.screenInterval),t.screenInterval=null);let n=this.activeTimers.get(e);n&&(n.forEach(s=>clearTimeout(s)),this.activeTimers.delete(e));let i=this.chunkTimers.get(e);i&&(i.forEach(s=>clearTimeout(s)),this.chunkTimers.delete(e)),t?.tileManager&&(t.tileManager.clearMemory(),t.tileManager.cleanup(),t.tileManager.reset()),t?.protocol&&(t.protocol.close(),As(t.protocol))}catch(n){console.error(`Error cleaning up ${e}:`,n.message)}}getStreamingConfig(){return $.streaming}getWebRTCConfig(){return $.webrtc}removeClient(e){let t=this.activeClients.get(e);t&&(this.cleanupClientResources(e,t),this.activeClients.delete(e))}getChunkTimers(e){return this.chunkTimers.has(e)||this.chunkTimers.set(e,new Set),this.chunkTimers.get(e)}cleanupAll(){this.stopResourceMonitoring();for(let[e,t]of this.activeClients.entries())this.cleanupClientResources(e,t);this.activeClients.clear(),this.activeTimers.clear(),this.chunkTimers.clear()}}});var kS={};en(kS,{ScreenUpdateHelper:()=>Ph});var Ph,AS=Ce(()=>{pt();Ph=class{constructor(e){this.resourceManager=e}async sendTilesInChunks(e,t,n,i=!1){if(!t||t.length===0)return;let s=$.streaming.chunkSize,o=[];for(let c=0;c<t.length;c+=s)o.push(t.slice(c,c+s));let a=this.resourceManager.getChunkTimers(e.id);for(let c=0;c<o.length;c++){let l=o[c],u=c===o.length-1,f=setTimeout(()=>{a.delete(f),e.connected&&e.emit("tiles-data",{tiles:l,timestamp:n,forceRefresh:!1,userAction:i,chunkInfo:{chunkIndex:c,totalChunks:o.length,isLastChunk:u}})},c*$.streaming.chunkDelay);a.add(f)}}}});var RS={};en(RS,{MouseHandler:()=>Ih});var Ih,OS=Ce(()=>{pt();Ih=class{constructor(e,t){this.robot=e,this.resourceManager=t,this.lastMouseMove=0}setupMouseHandlers(e,t){let n=this.robot;e.on("mouse-move",t(i=>{let s=Date.now();if(!(s-this.lastMouseMove<$.throttling.mouseThrottle)){this.lastMouseMove=s;try{let o=n.getScreenSize(),a=Math.round(i.x/100*o.width),c=Math.round(i.y/100*o.height),l=Math.max(0,Math.min(o.width-1,a)),u=Math.max(0,Math.min(o.height-1,c));n.moveMouse(l,u),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Mouse move error:",o.message)}}})),e.on("mouse-click",t(async i=>{try{let s=this.resourceManager.getClient(e.id);if(!s)return;let o=n.getScreenSize(),a=Math.round(i.x/100*o.width),c=Math.round(i.y/100*o.height),l=Math.max(0,Math.min(o.width-1,a)),u=Math.max(0,Math.min(o.height-1,c));n.moveMouse(l,u),n.mouseClick(i.button||"left",i.double||!1),s.idleFrameCount=0,this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Mouse click error:",s.message)}})),e.on("mouse-press",t(async i=>{try{if(!this.resourceManager.getClient(e.id))return;let o=n.getScreenSize(),a=Math.round(i.x/100*o.width),c=Math.round(i.y/100*o.height),l=Math.max(0,Math.min(o.width-1,a)),u=Math.max(0,Math.min(o.height-1,c));n.moveMouse(l,u),n.mouseToggle("down",i.button||"left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Mouse press error:",s.message)}})),e.on("mouse-release",t(async i=>{try{if(!this.resourceManager.getClient(e.id))return;let o=n.getScreenSize(),a=Math.round(i.x/100*o.width),c=Math.round(i.y/100*o.height),l=Math.max(0,Math.min(o.width-1,a)),u=Math.max(0,Math.min(o.height-1,c));n.moveMouse(l,u),n.mouseToggle("up",i.button||"left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Mouse release error:",s.message)}})),e.on("scroll",t(async i=>{try{let{direction:s,amount:o=60,horizontal:a=!1}=i,c=this.resourceManager.getClient(e.id);if(!c)return;let l=0,u=0;a||s==="left"||s==="right"?l=s==="right"?o:-o:u=s==="down"?-o:o,n.scrollMouse(l,u),c.idleFrameCount=0,this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Scroll error:",s.message)}})),e.on("mouse-drag-select",t(i=>{try{let{startX:s,startY:o,endX:a,endY:c}=i,l=n.getScreenSize(),u=Math.round(s/100*l.width),f=Math.round(o/100*l.height),h=Math.round(a/100*l.width),g=Math.round(c/100*l.height),x=Math.max(0,Math.min(l.width-1,u)),S=Math.max(0,Math.min(l.height-1,f)),C=Math.max(0,Math.min(l.width-1,h)),R=Math.max(0,Math.min(l.height-1,g));n.moveMouse(x,S),n.mouseToggle("down","left"),n.dragMouse(C,R),n.mouseToggle("up","left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Drag selection error:",s.message)}}))}}});var PS={};en(PS,{KeyboardHandler:()=>Nh});function $B(r){let e;r.type==="missionControl"?e='tell application "System Events" to key code 160':e=`tell application "System Events" to key code ${r.keyCode} using ${r.mods}`,(0,MS.execFile)("osascript",["-e",e],t=>{t&&console.error("osascript error:",t.message)})}var MS,Nh,IS=Ce(()=>{MS=require("child_process");pt();Nh=class{constructor(e,t){this.robot=e,this.resourceManager=t,this.lastKeyPress=0,this.lastTypeText=0}setupKeyboardHandlers(e,t){let n=this.robot;e.on("key-press",t(i=>{let s=Date.now();if(!(s-this.lastKeyPress<$.throttling.keyThrottle)){this.lastKeyPress=s;try{if(!i.key||typeof i.key!="string")return;let o=this.resourceManager.getClient(e.id),a=i.key,c=i.modifier||[];if(a.length===1)if(c.filter(u=>u!=="shift").length>0){n.keyTap(a.toLowerCase(),c);for(let u of c)n.keyToggle(u,"up")}else n.typeString(a);else{let u={return:"enter"}[a.toLowerCase()]??a.toLowerCase();n.keyTap(u,c)}o&&(o.idleFrameCount=0),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Key press error:",o.message)}}})),e.on("desktop-switch",t(i=>{try{let s=i?.direction,o=$.desktopSwitch[process.platform]?.[s];if(!o)return;process.platform==="darwin"?$B(o):n.keyTap(o[0],o[1]);let a=this.resourceManager.getClient(e.id);a&&(a.idleFrameCount=0),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Desktop switch error:",s.message)}})),e.on("type-text",t(i=>{let s=Date.now();if(!(s-this.lastTypeText<$.throttling.typeTextThrottle)){this.lastTypeText=s;try{if(!i.text||typeof i.text!="string")return;let o=i.text;o.length>$.throttling.maxTextLength&&(o=o.substring(0,$.throttling.maxTextLength));let a=o.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g,""),c=this.resourceManager.getClient(e.id);setTimeout(()=>{try{n.typeString(a),this.resourceManager.updateClientActivity(e.id),c&&(c.idleFrameCount=0,c.tileManager&&c.tileManager.clearScreenCache())}catch(l){console.error("Robot typeString error:",l.message)}},10)}catch(o){console.error("Type text error:",o.message)}}}))}}});var Kh=A((fE,Vh)=>{(function(r,e){"use strict";function t(T,p){if(!T)throw new Error(p||"Assertion failed")}function n(T,p){T.super_=p;var m=function(){};m.prototype=p.prototype,T.prototype=new m,T.prototype.constructor=T}function i(T,p,m){if(i.isBN(T))return T;this.negative=0,this.words=null,this.length=0,this.red=null,T!==null&&((p==="le"||p==="be")&&(m=p,p=10),this._init(T||0,p||10,m||"be"))}typeof r=="object"?r.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=require("buffer").Buffer}catch{}i.isBN=function(p){return p instanceof i?!0:p!==null&&typeof p=="object"&&p.constructor.wordSize===i.wordSize&&Array.isArray(p.words)},i.max=function(p,m){return p.cmp(m)>0?p:m},i.min=function(p,m){return p.cmp(m)<0?p:m},i.prototype._init=function(p,m,y){if(typeof p=="number")return this._initNumber(p,m,y);if(typeof p=="object")return this._initArray(p,m,y);m==="hex"&&(m=16),t(m===(m|0)&&m>=2&&m<=36),p=p.toString().replace(/\s+/g,"");var w=0;p[0]==="-"&&(w++,this.negative=1),w<p.length&&(m===16?this._parseHex(p,w,y):(this._parseBase(p,m,w),y==="le"&&this._initArray(this.toArray(),m,y)))},i.prototype._initNumber=function(p,m,y){p<0&&(this.negative=1,p=-p),p<67108864?(this.words=[p&67108863],this.length=1):p<4503599627370496?(this.words=[p&67108863,p/67108864&67108863],this.length=2):(t(p<9007199254740992),this.words=[p&67108863,p/67108864&67108863,1],this.length=3),y==="le"&&this._initArray(this.toArray(),m,y)},i.prototype._initArray=function(p,m,y){if(t(typeof p.length=="number"),p.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(p.length/3),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var v,_,k=0;if(y==="be")for(w=p.length-1,v=0;w>=0;w-=3)_=p[w]|p[w-1]<<8|p[w-2]<<16,this.words[v]|=_<<k&67108863,this.words[v+1]=_>>>26-k&67108863,k+=24,k>=26&&(k-=26,v++);else if(y==="le")for(w=0,v=0;w<p.length;w+=3)_=p[w]|p[w+1]<<8|p[w+2]<<16,this.words[v]|=_<<k&67108863,this.words[v+1]=_>>>26-k&67108863,k+=24,k>=26&&(k-=26,v++);return this.strip()};function o(T,p){var m=T.charCodeAt(p);return m>=65&&m<=70?m-55:m>=97&&m<=102?m-87:m-48&15}function a(T,p,m){var y=o(T,m);return m-1>=p&&(y|=o(T,m-1)<<4),y}i.prototype._parseHex=function(p,m,y){this.length=Math.ceil((p.length-m)/6),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var v=0,_=0,k;if(y==="be")for(w=p.length-1;w>=m;w-=2)k=a(p,m,w)<<v,this.words[_]|=k&67108863,v>=18?(v-=18,_+=1,this.words[_]|=k>>>26):v+=8;else{var b=p.length-m;for(w=b%2===0?m+1:m;w<p.length;w+=2)k=a(p,m,w)<<v,this.words[_]|=k&67108863,v>=18?(v-=18,_+=1,this.words[_]|=k>>>26):v+=8}this.strip()};function c(T,p,m,y){for(var w=0,v=Math.min(T.length,m),_=p;_<v;_++){var k=T.charCodeAt(_)-48;w*=y,k>=49?w+=k-49+10:k>=17?w+=k-17+10:w+=k}return w}i.prototype._parseBase=function(p,m,y){this.words=[0],this.length=1;for(var w=0,v=1;v<=67108863;v*=m)w++;w--,v=v/m|0;for(var _=p.length-y,k=_%w,b=Math.min(_,_-k)+y,d=0,E=y;E<b;E+=w)d=c(p,E,E+w,m),this.imuln(v),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(k!==0){var q=1;for(d=c(p,E,p.length,m),E=0;E<k;E++)q*=m;this.imuln(q),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}this.strip()},i.prototype.copy=function(p){p.words=new Array(this.length);for(var m=0;m<this.length;m++)p.words[m]=this.words[m];p.length=this.length,p.negative=this.negative,p.red=this.red},i.prototype.clone=function(){var p=new i(null);return this.copy(p),p},i.prototype._expand=function(p){for(;this.length<p;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(p,m){p=p||10,m=m|0||1;var y;if(p===16||p==="hex"){y="";for(var w=0,v=0,_=0;_<this.length;_++){var k=this.words[_],b=((k<<w|v)&16777215).toString(16);v=k>>>24-w&16777215,w+=2,w>=26&&(w-=26,_--),v!==0||_!==this.length-1?y=l[6-b.length]+b+y:y=b+y}for(v!==0&&(y=v.toString(16)+y);y.length%m!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}if(p===(p|0)&&p>=2&&p<=36){var d=u[p],E=f[p];y="";var q=this.clone();for(q.negative=0;!q.isZero();){var O=q.modn(E).toString(p);q=q.idivn(E),q.isZero()?y=O+y:y=l[d-O.length]+O+y}for(this.isZero()&&(y="0"+y);y.length%m!==0;)y="0"+y;return this.negative!==0&&(y="-"+y),y}t(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var p=this.words[0];return this.length===2?p+=this.words[1]*67108864:this.length===3&&this.words[2]===1?p+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-p:p},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(p,m){return t(typeof s<"u"),this.toArrayLike(s,p,m)},i.prototype.toArray=function(p,m){return this.toArrayLike(Array,p,m)},i.prototype.toArrayLike=function(p,m,y){var w=this.byteLength(),v=y||Math.max(1,w);t(w<=v,"byte array longer than desired length"),t(v>0,"Requested array length <= 0"),this.strip();var _=m==="le",k=new p(v),b,d,E=this.clone();if(_){for(d=0;!E.isZero();d++)b=E.andln(255),E.iushrn(8),k[d]=b;for(;d<v;d++)k[d]=0}else{for(d=0;d<v-w;d++)k[d]=0;for(d=0;!E.isZero();d++)b=E.andln(255),E.iushrn(8),k[v-d-1]=b}return k},Math.clz32?i.prototype._countBits=function(p){return 32-Math.clz32(p)}:i.prototype._countBits=function(p){var m=p,y=0;return m>=4096&&(y+=13,m>>>=13),m>=64&&(y+=7,m>>>=7),m>=8&&(y+=4,m>>>=4),m>=2&&(y+=2,m>>>=2),y+m},i.prototype._zeroBits=function(p){if(p===0)return 26;var m=p,y=0;return(m&8191)===0&&(y+=13,m>>>=13),(m&127)===0&&(y+=7,m>>>=7),(m&15)===0&&(y+=4,m>>>=4),(m&3)===0&&(y+=2,m>>>=2),(m&1)===0&&y++,y},i.prototype.bitLength=function(){var p=this.words[this.length-1],m=this._countBits(p);return(this.length-1)*26+m};function h(T){for(var p=new Array(T.bitLength()),m=0;m<p.length;m++){var y=m/26|0,w=m%26;p[m]=(T.words[y]&1<<w)>>>w}return p}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var p=0,m=0;m<this.length;m++){var y=this._zeroBits(this.words[m]);if(p+=y,y!==26)break}return p},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(p){return this.negative!==0?this.abs().inotn(p).iaddn(1):this.clone()},i.prototype.fromTwos=function(p){return this.testn(p-1)?this.notn(p).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(p){for(;this.length<p.length;)this.words[this.length++]=0;for(var m=0;m<p.length;m++)this.words[m]=this.words[m]|p.words[m];return this.strip()},i.prototype.ior=function(p){return t((this.negative|p.negative)===0),this.iuor(p)},i.prototype.or=function(p){return this.length>p.length?this.clone().ior(p):p.clone().ior(this)},i.prototype.uor=function(p){return this.length>p.length?this.clone().iuor(p):p.clone().iuor(this)},i.prototype.iuand=function(p){var m;this.length>p.length?m=p:m=this;for(var y=0;y<m.length;y++)this.words[y]=this.words[y]&p.words[y];return this.length=m.length,this.strip()},i.prototype.iand=function(p){return t((this.negative|p.negative)===0),this.iuand(p)},i.prototype.and=function(p){return this.length>p.length?this.clone().iand(p):p.clone().iand(this)},i.prototype.uand=function(p){return this.length>p.length?this.clone().iuand(p):p.clone().iuand(this)},i.prototype.iuxor=function(p){var m,y;this.length>p.length?(m=this,y=p):(m=p,y=this);for(var w=0;w<y.length;w++)this.words[w]=m.words[w]^y.words[w];if(this!==m)for(;w<m.length;w++)this.words[w]=m.words[w];return this.length=m.length,this.strip()},i.prototype.ixor=function(p){return t((this.negative|p.negative)===0),this.iuxor(p)},i.prototype.xor=function(p){return this.length>p.length?this.clone().ixor(p):p.clone().ixor(this)},i.prototype.uxor=function(p){return this.length>p.length?this.clone().iuxor(p):p.clone().iuxor(this)},i.prototype.inotn=function(p){t(typeof p=="number"&&p>=0);var m=Math.ceil(p/26)|0,y=p%26;this._expand(m),y>0&&m--;for(var w=0;w<m;w++)this.words[w]=~this.words[w]&67108863;return y>0&&(this.words[w]=~this.words[w]&67108863>>26-y),this.strip()},i.prototype.notn=function(p){return this.clone().inotn(p)},i.prototype.setn=function(p,m){t(typeof p=="number"&&p>=0);var y=p/26|0,w=p%26;return this._expand(y+1),m?this.words[y]=this.words[y]|1<<w:this.words[y]=this.words[y]&~(1<<w),this.strip()},i.prototype.iadd=function(p){var m;if(this.negative!==0&&p.negative===0)return this.negative=0,m=this.isub(p),this.negative^=1,this._normSign();if(this.negative===0&&p.negative!==0)return p.negative=0,m=this.isub(p),p.negative=1,m._normSign();var y,w;this.length>p.length?(y=this,w=p):(y=p,w=this);for(var v=0,_=0;_<w.length;_++)m=(y.words[_]|0)+(w.words[_]|0)+v,this.words[_]=m&67108863,v=m>>>26;for(;v!==0&&_<y.length;_++)m=(y.words[_]|0)+v,this.words[_]=m&67108863,v=m>>>26;if(this.length=y.length,v!==0)this.words[this.length]=v,this.length++;else if(y!==this)for(;_<y.length;_++)this.words[_]=y.words[_];return this},i.prototype.add=function(p){var m;return p.negative!==0&&this.negative===0?(p.negative=0,m=this.sub(p),p.negative^=1,m):p.negative===0&&this.negative!==0?(this.negative=0,m=p.sub(this),this.negative=1,m):this.length>p.length?this.clone().iadd(p):p.clone().iadd(this)},i.prototype.isub=function(p){if(p.negative!==0){p.negative=0;var m=this.iadd(p);return p.negative=1,m._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(p),this.negative=1,this._normSign();var y=this.cmp(p);if(y===0)return this.negative=0,this.length=1,this.words[0]=0,this;var w,v;y>0?(w=this,v=p):(w=p,v=this);for(var _=0,k=0;k<v.length;k++)m=(w.words[k]|0)-(v.words[k]|0)+_,_=m>>26,this.words[k]=m&67108863;for(;_!==0&&k<w.length;k++)m=(w.words[k]|0)+_,_=m>>26,this.words[k]=m&67108863;if(_===0&&k<w.length&&w!==this)for(;k<w.length;k++)this.words[k]=w.words[k];return this.length=Math.max(this.length,k),w!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(p){return this.clone().isub(p)};function g(T,p,m){m.negative=p.negative^T.negative;var y=T.length+p.length|0;m.length=y,y=y-1|0;var w=T.words[0]|0,v=p.words[0]|0,_=w*v,k=_&67108863,b=_/67108864|0;m.words[0]=k;for(var d=1;d<y;d++){for(var E=b>>>26,q=b&67108863,O=Math.min(d,p.length-1),P=Math.max(0,d-T.length+1);P<=O;P++){var j=d-P|0;w=T.words[j]|0,v=p.words[P]|0,_=w*v+q,E+=_/67108864|0,q=_&67108863}m.words[d]=q|0,b=E|0}return b!==0?m.words[d]=b|0:m.length--,m.strip()}var x=function(p,m,y){var w=p.words,v=m.words,_=y.words,k=0,b,d,E,q=w[0]|0,O=q&8191,P=q>>>13,j=w[1]|0,z=j&8191,H=j>>>13,ke=w[2]|0,ne=ke&8191,N=ke>>>13,te=w[3]|0,L=te&8191,W=te>>>13,oe=w[4]|0,Z=oe&8191,J=oe>>>13,At=w[5]|0,ae=At&8191,Ie=At>>>13,iv=w[6]|0,Ne=iv&8191,De=iv>>>13,sv=w[7]|0,Le=sv&8191,Be=sv>>>13,ov=w[8]|0,je=ov&8191,Fe=ov>>>13,av=w[9]|0,He=av&8191,qe=av>>>13,cv=v[0]|0,Ue=cv&8191,$e=cv>>>13,lv=v[1]|0,We=lv&8191,Ge=lv>>>13,uv=v[2]|0,ze=uv&8191,Ve=uv>>>13,pv=v[3]|0,Ke=pv&8191,Ye=pv>>>13,fv=v[4]|0,Je=fv&8191,Xe=fv>>>13,dv=v[5]|0,Ze=dv&8191,Qe=dv>>>13,hv=v[6]|0,et=hv&8191,tt=hv>>>13,mv=v[7]|0,rt=mv&8191,nt=mv>>>13,gv=v[8]|0,it=gv&8191,st=gv>>>13,vv=v[9]|0,ot=vv&8191,at=vv>>>13;y.negative=p.negative^m.negative,y.length=19,b=Math.imul(O,Ue),d=Math.imul(O,$e),d=d+Math.imul(P,Ue)|0,E=Math.imul(P,$e);var ap=(k+b|0)+((d&8191)<<13)|0;k=(E+(d>>>13)|0)+(ap>>>26)|0,ap&=67108863,b=Math.imul(z,Ue),d=Math.imul(z,$e),d=d+Math.imul(H,Ue)|0,E=Math.imul(H,$e),b=b+Math.imul(O,We)|0,d=d+Math.imul(O,Ge)|0,d=d+Math.imul(P,We)|0,E=E+Math.imul(P,Ge)|0;var cp=(k+b|0)+((d&8191)<<13)|0;k=(E+(d>>>13)|0)+(cp>>>26)|0,cp&=67108863,b=Math.imul(ne,Ue),d=Math.imul(ne,$e),d=d+Math.imul(N,Ue)|0,E=Math.imul(N,$e),b=b+Math.imul(z,We)|0,d=d+Math.imul(z,Ge)|0,d=d+Math.imul(H,We)|0,E=E+Math.imul(H,Ge)|0,b=b+Math.imul(O,ze)|0,d=d+Math.imul(O,Ve)|0,d=d+Math.imul(P,ze)|0,E=E+Math.imul(P,Ve)|0;var lp=(k+b|0)+((d&8191)<<13)|0;k=(E+(d>>>13)|0)+(lp>>>26)|0,lp&=67108863,b=Math.imul(L,Ue),d=Math.imul(L,$e),d=d+Math.imul(W,Ue)|0,E=Math.imul(W,$e),b=b+Math.imul(ne,We)|0,d=d+Math.imul(ne,Ge)|0,d=d+Math.imul(N,We)|0,E=E+Math.imul(N,Ge)|0,b=b+Math.imul(z,ze)|0,d=d+Math.imul(z,Ve)|0,d=d+Math.imul(H,ze)|0,E=E+Math.imul(H,Ve)|0,b=b+Math.imul(O,Ke)|0,d=d+Math.imul(O,Ye)|0,d=d+Math.imul(P,Ke)|0,E=E+Math.imul(P,Ye)|0;var up=(k+b|0)+((d&8191)<<13)|0;k=(E+(d>>>13)|0)+(up>>>26)|0,up&=67108863,b=Math.imul(Z,Ue),d=Math.imul(Z,$e),d=d+Math.imul(J,Ue)|0,E=Math.imul(J,$e),b=b+Math.imul(L,We)|0,d=d+Math.imul(L,Ge)|0,d=d+Math.imul(W,We)|0,E=E+Math.imul(W,Ge)|0,b=b+Math.imul(ne,ze)|0,d=d+Math.imul(ne,Ve)|0,d=d+Math.imul(N,ze)|0,E=E+Math.imul(N,Ve)|0,b=b+Math.imul(z,Ke)|0,d=d+Math.imul(z,Ye)|0,d=d+Math.imul(H,Ke)|0,E=E+Math.imul(H,Ye)|0,b=b+Math.imul(O,Je)|0,d=d+Math.imul(O,Xe)|0,d=d+Math.imul(P,Je)|0,E=E+Math.imul(P,Xe)|0;var pp=(k+b|0)+((d&8191)<<13)|0;k=(E+(d>>>13)|0)+(pp>>>26)|0,pp&=67108863,b=Math.imul(ae,Ue),d=Math.imul(ae,$e),d=d+Math.imul(Ie,Ue)|0,E=Math.imul(Ie,$e),b=b+Math.imul(Z,We)|0,d=d+Math.imul(Z,Ge)|0,d=d+Math.imul(J,We)|0,E=E+Math.imul(J,Ge)|0,b=b+Math.imul(L,ze)|0,d=d+Math.imul(L,Ve)|0,d=d+Math.imul(W,ze)|0,E=E+Math.imul(W,Ve)|0,b=b+Math.imul(ne,Ke)|0,d=d+Math.imul(ne,Ye)|0,d=d+Math.imul(N,Ke)|0,E=E+Math.imul(N,Ye)|0,b=b+Math.imul(z,Je)|0,d=d+Math.imul(z,Xe)|0,d=d+Math.imul(H,Je)|0,E=E+Math.imul(H,Xe)|0,b=b+Math.imul(O,Ze)|0,d=d+Math.imul(O,Qe)|0,d=d+Math.imul(P,Ze)|0,E=E+Math.imul(P,Qe)|0;var fp=(k+b|0)+((d&8191)<<13)|0;k=(E+(d>>>13)|0)+(fp>>>26)|0,fp&=67108863,b=Math.imul(Ne,Ue),d=Math.imul(Ne,$e),d=d+Math.imul(De,Ue)|0,E=Math.imul(De,$e),b=b+Math.imul(ae,We)|0,d=d+Math.imul(ae,Ge)|0,d=d+Math.imul(Ie,We)|0,E=E+Math.imul(Ie,Ge)|0,b=b+Math.imul(Z,ze)|0,d=d+Math.imul(Z,Ve)|0,d=d+Math.imul(J,ze)|0,E=E+Math.imul(J,Ve)|0,b=b+Math.imul(L,Ke)|0,d=d+Math.imul(L,Ye)|0,d=d+Math.imul(W,Ke)|0,E=E+Math.imul(W,Ye)|0,b=b+Math.imul(ne,Je)|0,d=d+Math.imul(ne,Xe)|0,d=d+Math.imul(N,Je)|0,E=E+Math.imul(N,Xe)|0,b=b+Math.imul(z,Ze)|0,d=d+Math.imul(z,Qe)|0,d=d+Math.imul(H,Ze)|0,E=E+Math.imul(H,Qe)|0,b=b+Math.imul(O,et)|0,d=d+Math.imul(O,tt)|0,d=d+Math.imul(P,et)|0,E=E+Math.imul(P,tt)|0;var dp=(k+b|0)+((d&8191)<<13)|0;k=(E+(d>>>13)|0)+(dp>>>26)|0,dp&=67108863,b=Math.imul(Le,Ue),d=Math.imul(Le,$e),d=d+Math.imul(Be,Ue)|0,E=Math.imul(Be,$e),b=b+Math.imul(Ne,We)|0,d=d+Math.imul(Ne,Ge)|0,d=d+Math.imul(De,We)|0,E=E+Math.imul(De,Ge)|0,b=b+Math.imul(ae,ze)|0,d=d+Math.imul(ae,Ve)|0,d=d+Math.imul(Ie,ze)|0,E=E+Math.imul(Ie,Ve)|0,b=b+Math.imul(Z,Ke)|0,d=d+Math.imul(Z,Ye)|0,d=d+Math.imul(J,Ke)|0,E=E+Math.imul(J,Ye)|0,b=b+Math.imul(L,Je)|0,d=d+Math.imul(L,Xe)|0,d=d+Math.imul(W,Je)|0,E=E+Math.imul(W,Xe)|0,b=b+Math.imul(ne,Ze)|0,d=d+Math.imul(ne,Qe)|0,d=d+Math.imul(N,Ze)|0,E=E+Math.imul(N,Qe)|0,b=b+Math.imul(z,et)|0,d=d+Math.imul(z,tt)|0,d=d+Math.imul(H,et)|0,E=E+Math.imul(H,tt)|0,b=b+Math.imul(O,rt)|0,d=d+Math.imul(O,nt)|0,d=d+Math.imul(P,rt)|0,E=E+Math.imul(P,nt)|0;var hp=(k+b|0)+((d&8191)<<13)|0;k=(E+(d>>>13)|0)+(hp>>>26)|0,hp&=67108863,b=Math.imul(je,Ue),d=Math.imul(je,$e),d=d+Math.imul(Fe,Ue)|0,E=Math.imul(Fe,$e),b=b+Math.imul(Le,We)|0,d=d+Math.imul(Le,Ge)|0,d=d+Math.imul(Be,We)|0,E=E+Math.imul(Be,Ge)|0,b=b+Math.imul(Ne,ze)|0,d=d+Math.imul(Ne,Ve)|0,d=d+Math.imul(De,ze)|0,E=E+Math.imul(De,Ve)|0,b=b+Math.imul(ae,Ke)|0,d=d+Math.imul(ae,Ye)|0,d=d+Math.imul(Ie,Ke)|0,E=E+Math.imul(Ie,Ye)|0,b=b+Math.imul(Z,Je)|0,d=d+Math.imul(Z,Xe)|0,d=d+Math.imul(J,Je)|0,E=E+Math.imul(J,Xe)|0,b=b+Math.imul(L,Ze)|0,d=d+Math.imul(L,Qe)|0,d=d+Math.imul(W,Ze)|0,E=E+Math.imul(W,Qe)|0,b=b+Math.imul(ne,et)|0,d=d+Math.imul(ne,tt)|0,d=d+Math.imul(N,et)|0,E=E+Math.imul(N,tt)|0,b=b+Math.imul(z,rt)|0,d=d+Math.imul(z,nt)|0,d=d+Math.imul(H,rt)|0,E=E+Math.imul(H,nt)|0,b=b+Math.imul(O,it)|0,d=d+Math.imul(O,st)|0,d=d+Math.imul(P,it)|0,E=E+Math.imul(P,st)|0;var mp=(k+b|0)+((d&8191)<<13)|0;k=(E+(d>>>13)|0)+(mp>>>26)|0,mp&=67108863,b=Math.imul(He,Ue),d=Math.imul(He,$e),d=d+Math.imul(qe,Ue)|0,E=Math.imul(qe,$e),b=b+Math.imul(je,We)|0,d=d+Math.imul(je,Ge)|0,d=d+Math.imul(Fe,We)|0,E=E+Math.imul(Fe,Ge)|0,b=b+Math.imul(Le,ze)|0,d=d+Math.imul(Le,Ve)|0,d=d+Math.imul(Be,ze)|0,E=E+Math.imul(Be,Ve)|0,b=b+Math.imul(Ne,Ke)|0,d=d+Math.imul(Ne,Ye)|0,d=d+Math.imul(De,Ke)|0,E=E+Math.imul(De,Ye)|0,b=b+Math.imul(ae,Je)|0,d=d+Math.imul(ae,Xe)|0,d=d+Math.imul(Ie,Je)|0,E=E+Math.imul(Ie,Xe)|0,b=b+Math.imul(Z,Ze)|0,d=d+Math.imul(Z,Qe)|0,d=d+Math.imul(J,Ze)|0,E=E+Math.imul(J,Qe)|0,b=b+Math.imul(L,et)|0,d=d+Math.imul(L,tt)|0,d=d+Math.imul(W,et)|0,E=E+Math.imul(W,tt)|0,b=b+Math.imul(ne,rt)|0,d=d+Math.imul(ne,nt)|0,d=d+Math.imul(N,rt)|0,E=E+Math.imul(N,nt)|0,b=b+Math.imul(z,it)|0,d=d+Math.imul(z,st)|0,d=d+Math.imul(H,it)|0,E=E+Math.imul(H,st)|0,b=b+Math.imul(O,ot)|0,d=d+Math.imul(O,at)|0,d=d+Math.imul(P,ot)|0,E=E+Math.imul(P,at)|0;var gp=(k+b|0)+((d&8191)<<13)|0;k=(E+(d>>>13)|0)+(gp>>>26)|0,gp&=67108863,b=Math.imul(He,We),d=Math.imul(He,Ge),d=d+Math.imul(qe,We)|0,E=Math.imul(qe,Ge),b=b+Math.imul(je,ze)|0,d=d+Math.imul(je,Ve)|0,d=d+Math.imul(Fe,ze)|0,E=E+Math.imul(Fe,Ve)|0,b=b+Math.imul(Le,Ke)|0,d=d+Math.imul(Le,Ye)|0,d=d+Math.imul(Be,Ke)|0,E=E+Math.imul(Be,Ye)|0,b=b+Math.imul(Ne,Je)|0,d=d+Math.imul(Ne,Xe)|0,d=d+Math.imul(De,Je)|0,E=E+Math.imul(De,Xe)|0,b=b+Math.imul(ae,Ze)|0,d=d+Math.imul(ae,Qe)|0,d=d+Math.imul(Ie,Ze)|0,E=E+Math.imul(Ie,Qe)|0,b=b+Math.imul(Z,et)|0,d=d+Math.imul(Z,tt)|0,d=d+Math.imul(J,et)|0,E=E+Math.imul(J,tt)|0,b=b+Math.imul(L,rt)|0,d=d+Math.imul(L,nt)|0,d=d+Math.imul(W,rt)|0,E=E+Math.imul(W,nt)|0,b=b+Math.imul(ne,it)|0,d=d+Math.imul(ne,st)|0,d=d+Math.imul(N,it)|0,E=E+Math.imul(N,st)|0,b=b+Math.imul(z,ot)|0,d=d+Math.imul(z,at)|0,d=d+Math.imul(H,ot)|0,E=E+Math.imul(H,at)|0;var vp=(k+b|0)+((d&8191)<<13)|0;k=(E+(d>>>13)|0)+(vp>>>26)|0,vp&=67108863,b=Math.imul(He,ze),d=Math.imul(He,Ve),d=d+Math.imul(qe,ze)|0,E=Math.imul(qe,Ve),b=b+Math.imul(je,Ke)|0,d=d+Math.imul(je,Ye)|0,d=d+Math.imul(Fe,Ke)|0,E=E+Math.imul(Fe,Ye)|0,b=b+Math.imul(Le,Je)|0,d=d+Math.imul(Le,Xe)|0,d=d+Math.imul(Be,Je)|0,E=E+Math.imul(Be,Xe)|0,b=b+Math.imul(Ne,Ze)|0,d=d+Math.imul(Ne,Qe)|0,d=d+Math.imul(De,Ze)|0,E=E+Math.imul(De,Qe)|0,b=b+Math.imul(ae,et)|0,d=d+Math.imul(ae,tt)|0,d=d+Math.imul(Ie,et)|0,E=E+Math.imul(Ie,tt)|0,b=b+Math.imul(Z,rt)|0,d=d+Math.imul(Z,nt)|0,d=d+Math.imul(J,rt)|0,E=E+Math.imul(J,nt)|0,b=b+Math.imul(L,it)|0,d=d+Math.imul(L,st)|0,d=d+Math.imul(W,it)|0,E=E+Math.imul(W,st)|0,b=b+Math.imul(ne,ot)|0,d=d+Math.imul(ne,at)|0,d=d+Math.imul(N,ot)|0,E=E+Math.imul(N,at)|0;var yp=(k+b|0)+((d&8191)<<13)|0;k=(E+(d>>>13)|0)+(yp>>>26)|0,yp&=67108863,b=Math.imul(He,Ke),d=Math.imul(He,Ye),d=d+Math.imul(qe,Ke)|0,E=Math.imul(qe,Ye),b=b+Math.imul(je,Je)|0,d=d+Math.imul(je,Xe)|0,d=d+Math.imul(Fe,Je)|0,E=E+Math.imul(Fe,Xe)|0,b=b+Math.imul(Le,Ze)|0,d=d+Math.imul(Le,Qe)|0,d=d+Math.imul(Be,Ze)|0,E=E+Math.imul(Be,Qe)|0,b=b+Math.imul(Ne,et)|0,d=d+Math.imul(Ne,tt)|0,d=d+Math.imul(De,et)|0,E=E+Math.imul(De,tt)|0,b=b+Math.imul(ae,rt)|0,d=d+Math.imul(ae,nt)|0,d=d+Math.imul(Ie,rt)|0,E=E+Math.imul(Ie,nt)|0,b=b+Math.imul(Z,it)|0,d=d+Math.imul(Z,st)|0,d=d+Math.imul(J,it)|0,E=E+Math.imul(J,st)|0,b=b+Math.imul(L,ot)|0,d=d+Math.imul(L,at)|0,d=d+Math.imul(W,ot)|0,E=E+Math.imul(W,at)|0;var xp=(k+b|0)+((d&8191)<<13)|0;k=(E+(d>>>13)|0)+(xp>>>26)|0,xp&=67108863,b=Math.imul(He,Je),d=Math.imul(He,Xe),d=d+Math.imul(qe,Je)|0,E=Math.imul(qe,Xe),b=b+Math.imul(je,Ze)|0,d=d+Math.imul(je,Qe)|0,d=d+Math.imul(Fe,Ze)|0,E=E+Math.imul(Fe,Qe)|0,b=b+Math.imul(Le,et)|0,d=d+Math.imul(Le,tt)|0,d=d+Math.imul(Be,et)|0,E=E+Math.imul(Be,tt)|0,b=b+Math.imul(Ne,rt)|0,d=d+Math.imul(Ne,nt)|0,d=d+Math.imul(De,rt)|0,E=E+Math.imul(De,nt)|0,b=b+Math.imul(ae,it)|0,d=d+Math.imul(ae,st)|0,d=d+Math.imul(Ie,it)|0,E=E+Math.imul(Ie,st)|0,b=b+Math.imul(Z,ot)|0,d=d+Math.imul(Z,at)|0,d=d+Math.imul(J,ot)|0,E=E+Math.imul(J,at)|0;var _p=(k+b|0)+((d&8191)<<13)|0;k=(E+(d>>>13)|0)+(_p>>>26)|0,_p&=67108863,b=Math.imul(He,Ze),d=Math.imul(He,Qe),d=d+Math.imul(qe,Ze)|0,E=Math.imul(qe,Qe),b=b+Math.imul(je,et)|0,d=d+Math.imul(je,tt)|0,d=d+Math.imul(Fe,et)|0,E=E+Math.imul(Fe,tt)|0,b=b+Math.imul(Le,rt)|0,d=d+Math.imul(Le,nt)|0,d=d+Math.imul(Be,rt)|0,E=E+Math.imul(Be,nt)|0,b=b+Math.imul(Ne,it)|0,d=d+Math.imul(Ne,st)|0,d=d+Math.imul(De,it)|0,E=E+Math.imul(De,st)|0,b=b+Math.imul(ae,ot)|0,d=d+Math.imul(ae,at)|0,d=d+Math.imul(Ie,ot)|0,E=E+Math.imul(Ie,at)|0;var bp=(k+b|0)+((d&8191)<<13)|0;k=(E+(d>>>13)|0)+(bp>>>26)|0,bp&=67108863,b=Math.imul(He,et),d=Math.imul(He,tt),d=d+Math.imul(qe,et)|0,E=Math.imul(qe,tt),b=b+Math.imul(je,rt)|0,d=d+Math.imul(je,nt)|0,d=d+Math.imul(Fe,rt)|0,E=E+Math.imul(Fe,nt)|0,b=b+Math.imul(Le,it)|0,d=d+Math.imul(Le,st)|0,d=d+Math.imul(Be,it)|0,E=E+Math.imul(Be,st)|0,b=b+Math.imul(Ne,ot)|0,d=d+Math.imul(Ne,at)|0,d=d+Math.imul(De,ot)|0,E=E+Math.imul(De,at)|0;var wp=(k+b|0)+((d&8191)<<13)|0;k=(E+(d>>>13)|0)+(wp>>>26)|0,wp&=67108863,b=Math.imul(He,rt),d=Math.imul(He,nt),d=d+Math.imul(qe,rt)|0,E=Math.imul(qe,nt),b=b+Math.imul(je,it)|0,d=d+Math.imul(je,st)|0,d=d+Math.imul(Fe,it)|0,E=E+Math.imul(Fe,st)|0,b=b+Math.imul(Le,ot)|0,d=d+Math.imul(Le,at)|0,d=d+Math.imul(Be,ot)|0,E=E+Math.imul(Be,at)|0;var Sp=(k+b|0)+((d&8191)<<13)|0;k=(E+(d>>>13)|0)+(Sp>>>26)|0,Sp&=67108863,b=Math.imul(He,it),d=Math.imul(He,st),d=d+Math.imul(qe,it)|0,E=Math.imul(qe,st),b=b+Math.imul(je,ot)|0,d=d+Math.imul(je,at)|0,d=d+Math.imul(Fe,ot)|0,E=E+Math.imul(Fe,at)|0;var Ep=(k+b|0)+((d&8191)<<13)|0;k=(E+(d>>>13)|0)+(Ep>>>26)|0,Ep&=67108863,b=Math.imul(He,ot),d=Math.imul(He,at),d=d+Math.imul(qe,ot)|0,E=Math.imul(qe,at);var Tp=(k+b|0)+((d&8191)<<13)|0;return k=(E+(d>>>13)|0)+(Tp>>>26)|0,Tp&=67108863,_[0]=ap,_[1]=cp,_[2]=lp,_[3]=up,_[4]=pp,_[5]=fp,_[6]=dp,_[7]=hp,_[8]=mp,_[9]=gp,_[10]=vp,_[11]=yp,_[12]=xp,_[13]=_p,_[14]=bp,_[15]=wp,_[16]=Sp,_[17]=Ep,_[18]=Tp,k!==0&&(_[19]=k,y.length++),y};Math.imul||(x=g);function S(T,p,m){m.negative=p.negative^T.negative,m.length=T.length+p.length;for(var y=0,w=0,v=0;v<m.length-1;v++){var _=w;w=0;for(var k=y&67108863,b=Math.min(v,p.length-1),d=Math.max(0,v-T.length+1);d<=b;d++){var E=v-d,q=T.words[E]|0,O=p.words[d]|0,P=q*O,j=P&67108863;_=_+(P/67108864|0)|0,j=j+k|0,k=j&67108863,_=_+(j>>>26)|0,w+=_>>>26,_&=67108863}m.words[v]=k,y=_,_=w}return y!==0?m.words[v]=y:m.length--,m.strip()}function C(T,p,m){var y=new R;return y.mulp(T,p,m)}i.prototype.mulTo=function(p,m){var y,w=this.length+p.length;return this.length===10&&p.length===10?y=x(this,p,m):w<63?y=g(this,p,m):w<1024?y=S(this,p,m):y=C(this,p,m),y};function R(T,p){this.x=T,this.y=p}R.prototype.makeRBT=function(p){for(var m=new Array(p),y=i.prototype._countBits(p)-1,w=0;w<p;w++)m[w]=this.revBin(w,y,p);return m},R.prototype.revBin=function(p,m,y){if(p===0||p===y-1)return p;for(var w=0,v=0;v<m;v++)w|=(p&1)<<m-v-1,p>>=1;return w},R.prototype.permute=function(p,m,y,w,v,_){for(var k=0;k<_;k++)w[k]=m[p[k]],v[k]=y[p[k]]},R.prototype.transform=function(p,m,y,w,v,_){this.permute(_,p,m,y,w,v);for(var k=1;k<v;k<<=1)for(var b=k<<1,d=Math.cos(2*Math.PI/b),E=Math.sin(2*Math.PI/b),q=0;q<v;q+=b)for(var O=d,P=E,j=0;j<k;j++){var z=y[q+j],H=w[q+j],ke=y[q+j+k],ne=w[q+j+k],N=O*ke-P*ne;ne=O*ne+P*ke,ke=N,y[q+j]=z+ke,w[q+j]=H+ne,y[q+j+k]=z-ke,w[q+j+k]=H-ne,j!==b&&(N=d*O-E*P,P=d*P+E*O,O=N)}},R.prototype.guessLen13b=function(p,m){var y=Math.max(m,p)|1,w=y&1,v=0;for(y=y/2|0;y;y=y>>>1)v++;return 1<<v+1+w},R.prototype.conjugate=function(p,m,y){if(!(y<=1))for(var w=0;w<y/2;w++){var v=p[w];p[w]=p[y-w-1],p[y-w-1]=v,v=m[w],m[w]=-m[y-w-1],m[y-w-1]=-v}},R.prototype.normalize13b=function(p,m){for(var y=0,w=0;w<m/2;w++){var v=Math.round(p[2*w+1]/m)*8192+Math.round(p[2*w]/m)+y;p[w]=v&67108863,v<67108864?y=0:y=v/67108864|0}return p},R.prototype.convert13b=function(p,m,y,w){for(var v=0,_=0;_<m;_++)v=v+(p[_]|0),y[2*_]=v&8191,v=v>>>13,y[2*_+1]=v&8191,v=v>>>13;for(_=2*m;_<w;++_)y[_]=0;t(v===0),t((v&-8192)===0)},R.prototype.stub=function(p){for(var m=new Array(p),y=0;y<p;y++)m[y]=0;return m},R.prototype.mulp=function(p,m,y){var w=2*this.guessLen13b(p.length,m.length),v=this.makeRBT(w),_=this.stub(w),k=new Array(w),b=new Array(w),d=new Array(w),E=new Array(w),q=new Array(w),O=new Array(w),P=y.words;P.length=w,this.convert13b(p.words,p.length,k,w),this.convert13b(m.words,m.length,E,w),this.transform(k,_,b,d,w,v),this.transform(E,_,q,O,w,v);for(var j=0;j<w;j++){var z=b[j]*q[j]-d[j]*O[j];d[j]=b[j]*O[j]+d[j]*q[j],b[j]=z}return this.conjugate(b,d,w),this.transform(b,d,P,_,w,v),this.conjugate(P,_,w),this.normalize13b(P,w),y.negative=p.negative^m.negative,y.length=p.length+m.length,y.strip()},i.prototype.mul=function(p){var m=new i(null);return m.words=new Array(this.length+p.length),this.mulTo(p,m)},i.prototype.mulf=function(p){var m=new i(null);return m.words=new Array(this.length+p.length),C(this,p,m)},i.prototype.imul=function(p){return this.clone().mulTo(p,this)},i.prototype.imuln=function(p){t(typeof p=="number"),t(p<67108864);for(var m=0,y=0;y<this.length;y++){var w=(this.words[y]|0)*p,v=(w&67108863)+(m&67108863);m>>=26,m+=w/67108864|0,m+=v>>>26,this.words[y]=v&67108863}return m!==0&&(this.words[y]=m,this.length++),this.length=p===0?1:this.length,this},i.prototype.muln=function(p){return this.clone().imuln(p)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(p){var m=h(p);if(m.length===0)return new i(1);for(var y=this,w=0;w<m.length&&m[w]===0;w++,y=y.sqr());if(++w<m.length)for(var v=y.sqr();w<m.length;w++,v=v.sqr())m[w]!==0&&(y=y.mul(v));return y},i.prototype.iushln=function(p){t(typeof p=="number"&&p>=0);var m=p%26,y=(p-m)/26,w=67108863>>>26-m<<26-m,v;if(m!==0){var _=0;for(v=0;v<this.length;v++){var k=this.words[v]&w,b=(this.words[v]|0)-k<<m;this.words[v]=b|_,_=k>>>26-m}_&&(this.words[v]=_,this.length++)}if(y!==0){for(v=this.length-1;v>=0;v--)this.words[v+y]=this.words[v];for(v=0;v<y;v++)this.words[v]=0;this.length+=y}return this.strip()},i.prototype.ishln=function(p){return t(this.negative===0),this.iushln(p)},i.prototype.iushrn=function(p,m,y){t(typeof p=="number"&&p>=0);var w;m?w=(m-m%26)/26:w=0;var v=p%26,_=Math.min((p-v)/26,this.length),k=67108863^67108863>>>v<<v,b=y;if(w-=_,w=Math.max(0,w),b){for(var d=0;d<_;d++)b.words[d]=this.words[d];b.length=_}if(_!==0)if(this.length>_)for(this.length-=_,d=0;d<this.length;d++)this.words[d]=this.words[d+_];else this.words[0]=0,this.length=1;var E=0;for(d=this.length-1;d>=0&&(E!==0||d>=w);d--){var q=this.words[d]|0;this.words[d]=E<<26-v|q>>>v,E=q&k}return b&&E!==0&&(b.words[b.length++]=E),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(p,m,y){return t(this.negative===0),this.iushrn(p,m,y)},i.prototype.shln=function(p){return this.clone().ishln(p)},i.prototype.ushln=function(p){return this.clone().iushln(p)},i.prototype.shrn=function(p){return this.clone().ishrn(p)},i.prototype.ushrn=function(p){return this.clone().iushrn(p)},i.prototype.testn=function(p){t(typeof p=="number"&&p>=0);var m=p%26,y=(p-m)/26,w=1<<m;if(this.length<=y)return!1;var v=this.words[y];return!!(v&w)},i.prototype.imaskn=function(p){t(typeof p=="number"&&p>=0);var m=p%26,y=(p-m)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=y)return this;if(m!==0&&y++,this.length=Math.min(y,this.length),m!==0){var w=67108863^67108863>>>m<<m;this.words[this.length-1]&=w}return this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.maskn=function(p){return this.clone().imaskn(p)},i.prototype.iaddn=function(p){return t(typeof p=="number"),t(p<67108864),p<0?this.isubn(-p):this.negative!==0?this.length===1&&(this.words[0]|0)<p?(this.words[0]=p-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(p),this.negative=1,this):this._iaddn(p)},i.prototype._iaddn=function(p){this.words[0]+=p;for(var m=0;m<this.length&&this.words[m]>=67108864;m++)this.words[m]-=67108864,m===this.length-1?this.words[m+1]=1:this.words[m+1]++;return this.length=Math.max(this.length,m+1),this},i.prototype.isubn=function(p){if(t(typeof p=="number"),t(p<67108864),p<0)return this.iaddn(-p);if(this.negative!==0)return this.negative=0,this.iaddn(p),this.negative=1,this;if(this.words[0]-=p,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var m=0;m<this.length&&this.words[m]<0;m++)this.words[m]+=67108864,this.words[m+1]-=1;return this.strip()},i.prototype.addn=function(p){return this.clone().iaddn(p)},i.prototype.subn=function(p){return this.clone().isubn(p)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(p,m,y){var w=p.length+y,v;this._expand(w);var _,k=0;for(v=0;v<p.length;v++){_=(this.words[v+y]|0)+k;var b=(p.words[v]|0)*m;_-=b&67108863,k=(_>>26)-(b/67108864|0),this.words[v+y]=_&67108863}for(;v<this.length-y;v++)_=(this.words[v+y]|0)+k,k=_>>26,this.words[v+y]=_&67108863;if(k===0)return this.strip();for(t(k===-1),k=0,v=0;v<this.length;v++)_=-(this.words[v]|0)+k,k=_>>26,this.words[v]=_&67108863;return this.negative=1,this.strip()},i.prototype._wordDiv=function(p,m){var y=this.length-p.length,w=this.clone(),v=p,_=v.words[v.length-1]|0,k=this._countBits(_);y=26-k,y!==0&&(v=v.ushln(y),w.iushln(y),_=v.words[v.length-1]|0);var b=w.length-v.length,d;if(m!=="mod"){d=new i(null),d.length=b+1,d.words=new Array(d.length);for(var E=0;E<d.length;E++)d.words[E]=0}var q=w.clone()._ishlnsubmul(v,1,b);q.negative===0&&(w=q,d&&(d.words[b]=1));for(var O=b-1;O>=0;O--){var P=(w.words[v.length+O]|0)*67108864+(w.words[v.length+O-1]|0);for(P=Math.min(P/_|0,67108863),w._ishlnsubmul(v,P,O);w.negative!==0;)P--,w.negative=0,w._ishlnsubmul(v,1,O),w.isZero()||(w.negative^=1);d&&(d.words[O]=P)}return d&&d.strip(),w.strip(),m!=="div"&&y!==0&&w.iushrn(y),{div:d||null,mod:w}},i.prototype.divmod=function(p,m,y){if(t(!p.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var w,v,_;return this.negative!==0&&p.negative===0?(_=this.neg().divmod(p,m),m!=="mod"&&(w=_.div.neg()),m!=="div"&&(v=_.mod.neg(),y&&v.negative!==0&&v.iadd(p)),{div:w,mod:v}):this.negative===0&&p.negative!==0?(_=this.divmod(p.neg(),m),m!=="mod"&&(w=_.div.neg()),{div:w,mod:_.mod}):(this.negative&p.negative)!==0?(_=this.neg().divmod(p.neg(),m),m!=="div"&&(v=_.mod.neg(),y&&v.negative!==0&&v.isub(p)),{div:_.div,mod:v}):p.length>this.length||this.cmp(p)<0?{div:new i(0),mod:this}:p.length===1?m==="div"?{div:this.divn(p.words[0]),mod:null}:m==="mod"?{div:null,mod:new i(this.modn(p.words[0]))}:{div:this.divn(p.words[0]),mod:new i(this.modn(p.words[0]))}:this._wordDiv(p,m)},i.prototype.div=function(p){return this.divmod(p,"div",!1).div},i.prototype.mod=function(p){return this.divmod(p,"mod",!1).mod},i.prototype.umod=function(p){return this.divmod(p,"mod",!0).mod},i.prototype.divRound=function(p){var m=this.divmod(p);if(m.mod.isZero())return m.div;var y=m.div.negative!==0?m.mod.isub(p):m.mod,w=p.ushrn(1),v=p.andln(1),_=y.cmp(w);return _<0||v===1&&_===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},i.prototype.modn=function(p){t(p<=67108863);for(var m=(1<<26)%p,y=0,w=this.length-1;w>=0;w--)y=(m*y+(this.words[w]|0))%p;return y},i.prototype.idivn=function(p){t(p<=67108863);for(var m=0,y=this.length-1;y>=0;y--){var w=(this.words[y]|0)+m*67108864;this.words[y]=w/p|0,m=w%p}return this.strip()},i.prototype.divn=function(p){return this.clone().idivn(p)},i.prototype.egcd=function(p){t(p.negative===0),t(!p.isZero());var m=this,y=p.clone();m.negative!==0?m=m.umod(p):m=m.clone();for(var w=new i(1),v=new i(0),_=new i(0),k=new i(1),b=0;m.isEven()&&y.isEven();)m.iushrn(1),y.iushrn(1),++b;for(var d=y.clone(),E=m.clone();!m.isZero();){for(var q=0,O=1;(m.words[0]&O)===0&&q<26;++q,O<<=1);if(q>0)for(m.iushrn(q);q-- >0;)(w.isOdd()||v.isOdd())&&(w.iadd(d),v.isub(E)),w.iushrn(1),v.iushrn(1);for(var P=0,j=1;(y.words[0]&j)===0&&P<26;++P,j<<=1);if(P>0)for(y.iushrn(P);P-- >0;)(_.isOdd()||k.isOdd())&&(_.iadd(d),k.isub(E)),_.iushrn(1),k.iushrn(1);m.cmp(y)>=0?(m.isub(y),w.isub(_),v.isub(k)):(y.isub(m),_.isub(w),k.isub(v))}return{a:_,b:k,gcd:y.iushln(b)}},i.prototype._invmp=function(p){t(p.negative===0),t(!p.isZero());var m=this,y=p.clone();m.negative!==0?m=m.umod(p):m=m.clone();for(var w=new i(1),v=new i(0),_=y.clone();m.cmpn(1)>0&&y.cmpn(1)>0;){for(var k=0,b=1;(m.words[0]&b)===0&&k<26;++k,b<<=1);if(k>0)for(m.iushrn(k);k-- >0;)w.isOdd()&&w.iadd(_),w.iushrn(1);for(var d=0,E=1;(y.words[0]&E)===0&&d<26;++d,E<<=1);if(d>0)for(y.iushrn(d);d-- >0;)v.isOdd()&&v.iadd(_),v.iushrn(1);m.cmp(y)>=0?(m.isub(y),w.isub(v)):(y.isub(m),v.isub(w))}var q;return m.cmpn(1)===0?q=w:q=v,q.cmpn(0)<0&&q.iadd(p),q},i.prototype.gcd=function(p){if(this.isZero())return p.abs();if(p.isZero())return this.abs();var m=this.clone(),y=p.clone();m.negative=0,y.negative=0;for(var w=0;m.isEven()&&y.isEven();w++)m.iushrn(1),y.iushrn(1);do{for(;m.isEven();)m.iushrn(1);for(;y.isEven();)y.iushrn(1);var v=m.cmp(y);if(v<0){var _=m;m=y,y=_}else if(v===0||y.cmpn(1)===0)break;m.isub(y)}while(!0);return y.iushln(w)},i.prototype.invm=function(p){return this.egcd(p).a.umod(p)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(p){return this.words[0]&p},i.prototype.bincn=function(p){t(typeof p=="number");var m=p%26,y=(p-m)/26,w=1<<m;if(this.length<=y)return this._expand(y+1),this.words[y]|=w,this;for(var v=w,_=y;v!==0&&_<this.length;_++){var k=this.words[_]|0;k+=v,v=k>>>26,k&=67108863,this.words[_]=k}return v!==0&&(this.words[_]=v,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(p){var m=p<0;if(this.negative!==0&&!m)return-1;if(this.negative===0&&m)return 1;this.strip();var y;if(this.length>1)y=1;else{m&&(p=-p),t(p<=67108863,"Number is too big");var w=this.words[0]|0;y=w===p?0:w<p?-1:1}return this.negative!==0?-y|0:y},i.prototype.cmp=function(p){if(this.negative!==0&&p.negative===0)return-1;if(this.negative===0&&p.negative!==0)return 1;var m=this.ucmp(p);return this.negative!==0?-m|0:m},i.prototype.ucmp=function(p){if(this.length>p.length)return 1;if(this.length<p.length)return-1;for(var m=0,y=this.length-1;y>=0;y--){var w=this.words[y]|0,v=p.words[y]|0;if(w!==v){w<v?m=-1:w>v&&(m=1);break}}return m},i.prototype.gtn=function(p){return this.cmpn(p)===1},i.prototype.gt=function(p){return this.cmp(p)===1},i.prototype.gten=function(p){return this.cmpn(p)>=0},i.prototype.gte=function(p){return this.cmp(p)>=0},i.prototype.ltn=function(p){return this.cmpn(p)===-1},i.prototype.lt=function(p){return this.cmp(p)===-1},i.prototype.lten=function(p){return this.cmpn(p)<=0},i.prototype.lte=function(p){return this.cmp(p)<=0},i.prototype.eqn=function(p){return this.cmpn(p)===0},i.prototype.eq=function(p){return this.cmp(p)===0},i.red=function(p){return new D(p)},i.prototype.toRed=function(p){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),p.convertTo(this)._forceRed(p)},i.prototype.fromRed=function(){return t(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(p){return this.red=p,this},i.prototype.forceRed=function(p){return t(!this.red,"Already a number in reduction context"),this._forceRed(p)},i.prototype.redAdd=function(p){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,p)},i.prototype.redIAdd=function(p){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,p)},i.prototype.redSub=function(p){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,p)},i.prototype.redISub=function(p){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,p)},i.prototype.redShl=function(p){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,p)},i.prototype.redMul=function(p){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,p),this.red.mul(this,p)},i.prototype.redIMul=function(p){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,p),this.red.imul(this,p)},i.prototype.redSqr=function(){return t(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return t(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return t(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return t(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return t(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(p){return t(this.red&&!p.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,p)};var M={k256:null,p224:null,p192:null,p25519:null};function I(T,p){this.name=T,this.p=new i(p,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}I.prototype._tmp=function(){var p=new i(null);return p.words=new Array(Math.ceil(this.n/13)),p},I.prototype.ireduce=function(p){var m=p,y;do this.split(m,this.tmp),m=this.imulK(m),m=m.iadd(this.tmp),y=m.bitLength();while(y>this.n);var w=y<this.n?-1:m.ucmp(this.p);return w===0?(m.words[0]=0,m.length=1):w>0?m.isub(this.p):m.strip!==void 0?m.strip():m._strip(),m},I.prototype.split=function(p,m){p.iushrn(this.n,0,m)},I.prototype.imulK=function(p){return p.imul(this.k)};function B(){I.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(B,I),B.prototype.split=function(p,m){for(var y=4194303,w=Math.min(p.length,9),v=0;v<w;v++)m.words[v]=p.words[v];if(m.length=w,p.length<=9){p.words[0]=0,p.length=1;return}var _=p.words[9];for(m.words[m.length++]=_&y,v=10;v<p.length;v++){var k=p.words[v]|0;p.words[v-10]=(k&y)<<4|_>>>22,_=k}_>>>=22,p.words[v-10]=_,_===0&&p.length>10?p.length-=10:p.length-=9},B.prototype.imulK=function(p){p.words[p.length]=0,p.words[p.length+1]=0,p.length+=2;for(var m=0,y=0;y<p.length;y++){var w=p.words[y]|0;m+=w*977,p.words[y]=m&67108863,m=w*64+(m/67108864|0)}return p.words[p.length-1]===0&&(p.length--,p.words[p.length-1]===0&&p.length--),p};function V(){I.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(V,I);function F(){I.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(F,I);function G(){I.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(G,I),G.prototype.imulK=function(p){for(var m=0,y=0;y<p.length;y++){var w=(p.words[y]|0)*19+m,v=w&67108863;w>>>=26,p.words[y]=v,m=w}return m!==0&&(p.words[p.length++]=m),p},i._prime=function(p){if(M[p])return M[p];var m;if(p==="k256")m=new B;else if(p==="p224")m=new V;else if(p==="p192")m=new F;else if(p==="p25519")m=new G;else throw new Error("Unknown prime "+p);return M[p]=m,m};function D(T){if(typeof T=="string"){var p=i._prime(T);this.m=p.p,this.prime=p}else t(T.gtn(1),"modulus must be greater than 1"),this.m=T,this.prime=null}D.prototype._verify1=function(p){t(p.negative===0,"red works only with positives"),t(p.red,"red works only with red numbers")},D.prototype._verify2=function(p,m){t((p.negative|m.negative)===0,"red works only with positives"),t(p.red&&p.red===m.red,"red works only with red numbers")},D.prototype.imod=function(p){return this.prime?this.prime.ireduce(p)._forceRed(this):p.umod(this.m)._forceRed(this)},D.prototype.neg=function(p){return p.isZero()?p.clone():this.m.sub(p)._forceRed(this)},D.prototype.add=function(p,m){this._verify2(p,m);var y=p.add(m);return y.cmp(this.m)>=0&&y.isub(this.m),y._forceRed(this)},D.prototype.iadd=function(p,m){this._verify2(p,m);var y=p.iadd(m);return y.cmp(this.m)>=0&&y.isub(this.m),y},D.prototype.sub=function(p,m){this._verify2(p,m);var y=p.sub(m);return y.cmpn(0)<0&&y.iadd(this.m),y._forceRed(this)},D.prototype.isub=function(p,m){this._verify2(p,m);var y=p.isub(m);return y.cmpn(0)<0&&y.iadd(this.m),y},D.prototype.shl=function(p,m){return this._verify1(p),this.imod(p.ushln(m))},D.prototype.imul=function(p,m){return this._verify2(p,m),this.imod(p.imul(m))},D.prototype.mul=function(p,m){return this._verify2(p,m),this.imod(p.mul(m))},D.prototype.isqr=function(p){return this.imul(p,p.clone())},D.prototype.sqr=function(p){return this.mul(p,p)},D.prototype.sqrt=function(p){if(p.isZero())return p.clone();var m=this.m.andln(3);if(t(m%2===1),m===3){var y=this.m.add(new i(1)).iushrn(2);return this.pow(p,y)}for(var w=this.m.subn(1),v=0;!w.isZero()&&w.andln(1)===0;)v++,w.iushrn(1);t(!w.isZero());var _=new i(1).toRed(this),k=_.redNeg(),b=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new i(2*d*d).toRed(this);this.pow(d,b).cmp(k)!==0;)d.redIAdd(k);for(var E=this.pow(d,w),q=this.pow(p,w.addn(1).iushrn(1)),O=this.pow(p,w),P=v;O.cmp(_)!==0;){for(var j=O,z=0;j.cmp(_)!==0;z++)j=j.redSqr();t(z<P);var H=this.pow(E,new i(1).iushln(P-z-1));q=q.redMul(H),E=H.redSqr(),O=O.redMul(E),P=z}return q},D.prototype.invm=function(p){var m=p._invmp(this.m);return m.negative!==0?(m.negative=0,this.imod(m).redNeg()):this.imod(m)},D.prototype.pow=function(p,m){if(m.isZero())return new i(1).toRed(this);if(m.cmpn(1)===0)return p.clone();var y=4,w=new Array(1<<y);w[0]=new i(1).toRed(this),w[1]=p;for(var v=2;v<w.length;v++)w[v]=this.mul(w[v-1],p);var _=w[0],k=0,b=0,d=m.bitLength()%26;for(d===0&&(d=26),v=m.length-1;v>=0;v--){for(var E=m.words[v],q=d-1;q>=0;q--){var O=E>>q&1;if(_!==w[0]&&(_=this.sqr(_)),O===0&&k===0){b=0;continue}k<<=1,k|=O,b++,!(b!==y&&(v!==0||q!==0))&&(_=this.mul(_,w[k]),b=0,k=0)}d=26}return _},D.prototype.convertTo=function(p){var m=p.umod(this.m);return m===p?m.clone():m},D.prototype.convertFrom=function(p){var m=p.clone();return m.red=null,m},i.mont=function(p){return new U(p)};function U(T){D.call(this,T),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(U,D),U.prototype.convertTo=function(p){return this.imod(p.ushln(this.shift))},U.prototype.convertFrom=function(p){var m=this.imod(p.mul(this.rinv));return m.red=null,m},U.prototype.imul=function(p,m){if(p.isZero()||m.isZero())return p.words[0]=0,p.length=1,p;var y=p.imul(m),w=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=y.isub(w).iushrn(this.shift),_=v;return v.cmp(this.m)>=0?_=v.isub(this.m):v.cmpn(0)<0&&(_=v.iadd(this.m)),_._forceRed(this)},U.prototype.mul=function(p,m){if(p.isZero()||m.isZero())return new i(0)._forceRed(this);var y=p.mul(m),w=y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=y.isub(w).iushrn(this.shift),_=v;return v.cmp(this.m)>=0?_=v.isub(this.m):v.cmpn(0)<0&&(_=v.iadd(this.m)),_._forceRed(this)},U.prototype.invm=function(p){var m=this.imod(p._invmp(this.m).mul(this.r2));return m._forceRed(this)}})(typeof Vh>"u"||Vh,fE)});var dE=A((pG,Yh)=>{typeof Object.create=="function"?Yh.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Yh.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}});var zn=A((fG,Xh)=>{try{if(Jh=require("util"),typeof Jh.inherits!="function")throw"";Xh.exports=Jh.inherits}catch{Xh.exports=dE()}var Jh});var Zl=A((dG,hE)=>{"use strict";var Xl=require("buffer"),Ns=Xl.Buffer,dr={},hr;for(hr in Xl)Xl.hasOwnProperty(hr)&&(hr==="SlowBuffer"||hr==="Buffer"||(dr[hr]=Xl[hr]));var Ds=dr.Buffer={};for(hr in Ns)Ns.hasOwnProperty(hr)&&(hr==="allocUnsafe"||hr==="allocUnsafeSlow"||(Ds[hr]=Ns[hr]));dr.Buffer.prototype=Ns.prototype;(!Ds.from||Ds.from===Uint8Array.from)&&(Ds.from=function(r,e,t){if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof r);if(r&&typeof r.length>"u")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);return Ns(r,e,t)});Ds.alloc||(Ds.alloc=function(r,e,t){if(typeof r!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof r);if(r<0||r>=2*(1<<30))throw new RangeError('The value "'+r+'" is invalid for option "size"');var n=Ns(r);return!e||e.length===0?n.fill(0):typeof t=="string"?n.fill(e,t):n.fill(e),n});if(!dr.kStringMaxLength)try{dr.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}dr.constants||(dr.constants={MAX_LENGTH:dr.kMaxLength},dr.kStringMaxLength&&(dr.constants.MAX_STRING_LENGTH=dr.kStringMaxLength));hE.exports=dr});var Ql=A(mE=>{"use strict";var ej=zn();function mr(r){this._reporterState={obj:null,path:[],options:r||{},errors:[]}}mE.Reporter=mr;mr.prototype.isError=function(e){return e instanceof Ls};mr.prototype.save=function(){let e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}};mr.prototype.restore=function(e){let t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)};mr.prototype.enterKey=function(e){return this._reporterState.path.push(e)};mr.prototype.exitKey=function(e){let t=this._reporterState;t.path=t.path.slice(0,e-1)};mr.prototype.leaveKey=function(e,t,n){let i=this._reporterState;this.exitKey(e),i.obj!==null&&(i.obj[t]=n)};mr.prototype.path=function(){return this._reporterState.path.join("/")};mr.prototype.enterObject=function(){let e=this._reporterState,t=e.obj;return e.obj={},t};mr.prototype.leaveObject=function(e){let t=this._reporterState,n=t.obj;return t.obj=e,n};mr.prototype.error=function(e){let t,n=this._reporterState,i=e instanceof Ls;if(i?t=e:t=new Ls(n.path.map(function(s){return"["+JSON.stringify(s)+"]"}).join(""),e.message||e,e.stack),!n.options.partial)throw t;return i||n.errors.push(t),t};mr.prototype.wrapResult=function(e){let t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e};function Ls(r,e){this.path=r,this.rethrow(e)}ej(Ls,Error);Ls.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,Ls),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}});var Fs=A(Zh=>{"use strict";var tj=zn(),eu=Ql().Reporter,Bs=Zl().Buffer;function gr(r,e){if(eu.call(this,e),!Bs.isBuffer(r)){this.error("Input not Buffer");return}this.base=r,this.offset=0,this.length=r.length}tj(gr,eu);Zh.DecoderBuffer=gr;gr.isDecoderBuffer=function(e){return e instanceof gr?!0:typeof e=="object"&&Bs.isBuffer(e.base)&&e.constructor.name==="DecoderBuffer"&&typeof e.offset=="number"&&typeof e.length=="number"&&typeof e.save=="function"&&typeof e.restore=="function"&&typeof e.isEmpty=="function"&&typeof e.readUInt8=="function"&&typeof e.skip=="function"&&typeof e.raw=="function"};gr.prototype.save=function(){return{offset:this.offset,reporter:eu.prototype.save.call(this)}};gr.prototype.restore=function(e){let t=new gr(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,eu.prototype.restore.call(this,e.reporter),t};gr.prototype.isEmpty=function(){return this.offset===this.length};gr.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")};gr.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");let n=new gr(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+e,this.offset+=e,n};gr.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)};function js(r,e){if(Array.isArray(r))this.length=0,this.value=r.map(function(t){return js.isEncoderBuffer(t)||(t=new js(t,e)),this.length+=t.length,t},this);else if(typeof r=="number"){if(!(0<=r&&r<=255))return e.error("non-byte EncoderBuffer value");this.value=r,this.length=1}else if(typeof r=="string")this.value=r,this.length=Bs.byteLength(r);else if(Bs.isBuffer(r))this.value=r,this.length=r.length;else return e.error("Unsupported type: "+typeof r)}Zh.EncoderBuffer=js;js.isEncoderBuffer=function(e){return e instanceof js?!0:typeof e=="object"&&e.constructor.name==="EncoderBuffer"&&typeof e.length=="number"&&typeof e.join=="function"};js.prototype.join=function(e,t){return e||(e=Bs.alloc(this.length)),t||(t=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(n){n.join(e,t),t+=n.length}):(typeof this.value=="number"?e[t]=this.value:typeof this.value=="string"?e.write(this.value,t):Bs.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}});var yE=A((gG,vE)=>{vE.exports=gE;function gE(r,e){if(!r)throw new Error(e||"Assertion failed")}gE.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)}});var tu=A((vG,_E)=>{"use strict";var rj=Ql().Reporter,nj=Fs().EncoderBuffer,ij=Fs().DecoderBuffer,Pt=yE(),xE=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],sj=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(xE),oj=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function me(r,e,t){let n={};this._baseState=n,n.name=t,n.enc=r,n.parent=e||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}_E.exports=me;var aj=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];me.prototype.clone=function(){let e=this._baseState,t={};aj.forEach(function(i){t[i]=e[i]});let n=new this.constructor(t.parent);return n._baseState=t,n};me.prototype._wrap=function(){let e=this._baseState;sj.forEach(function(t){this[t]=function(){let i=new this.constructor(this);return e.children.push(i),i[t].apply(i,arguments)}},this)};me.prototype._init=function(e){let t=this._baseState;Pt(t.parent===null),e.call(this),t.children=t.children.filter(function(n){return n._baseState.parent===this},this),Pt.equal(t.children.length,1,"Root node can have only one child")};me.prototype._useArgs=function(e){let t=this._baseState,n=e.filter(function(i){return i instanceof this.constructor},this);e=e.filter(function(i){return!(i instanceof this.constructor)},this),n.length!==0&&(Pt(t.children===null),t.children=n,n.forEach(function(i){i._baseState.parent=this},this)),e.length!==0&&(Pt(t.args===null),t.args=e,t.reverseArgs=e.map(function(i){if(typeof i!="object"||i.constructor!==Object)return i;let s={};return Object.keys(i).forEach(function(o){o==(o|0)&&(o|=0);let a=i[o];s[a]=o}),s}))};oj.forEach(function(r){me.prototype[r]=function(){let t=this._baseState;throw new Error(r+" not implemented for encoding: "+t.enc)}});xE.forEach(function(r){me.prototype[r]=function(){let t=this._baseState,n=Array.prototype.slice.call(arguments);return Pt(t.tag===null),t.tag=r,this._useArgs(n),this}});me.prototype.use=function(e){Pt(e);let t=this._baseState;return Pt(t.use===null),t.use=e,this};me.prototype.optional=function(){let e=this._baseState;return e.optional=!0,this};me.prototype.def=function(e){let t=this._baseState;return Pt(t.default===null),t.default=e,t.optional=!0,this};me.prototype.explicit=function(e){let t=this._baseState;return Pt(t.explicit===null&&t.implicit===null),t.explicit=e,this};me.prototype.implicit=function(e){let t=this._baseState;return Pt(t.explicit===null&&t.implicit===null),t.implicit=e,this};me.prototype.obj=function(){let e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,t.length!==0&&this._useArgs(t),this};me.prototype.key=function(e){let t=this._baseState;return Pt(t.key===null),t.key=e,this};me.prototype.any=function(){let e=this._baseState;return e.any=!0,this};me.prototype.choice=function(e){let t=this._baseState;return Pt(t.choice===null),t.choice=e,this._useArgs(Object.keys(e).map(function(n){return e[n]})),this};me.prototype.contains=function(e){let t=this._baseState;return Pt(t.use===null),t.contains=e,this};me.prototype._decode=function(e,t){let n=this._baseState;if(n.parent===null)return e.wrapResult(n.children[0]._decode(e,t));let i=n.default,s=!0,o=null;if(n.key!==null&&(o=e.enterKey(n.key)),n.optional){let c=null;if(n.explicit!==null?c=n.explicit:n.implicit!==null?c=n.implicit:n.tag!==null&&(c=n.tag),c===null&&!n.any){let l=e.save();try{n.choice===null?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t),s=!0}catch{s=!1}e.restore(l)}else if(s=this._peekTag(e,c,n.any),e.isError(s))return s}let a;if(n.obj&&s&&(a=e.enterObject()),s){if(n.explicit!==null){let l=this._decodeTag(e,n.explicit);if(e.isError(l))return l;e=l}let c=e.offset;if(n.use===null&&n.choice===null){let l;n.any&&(l=e.save());let u=this._decodeTag(e,n.implicit!==null?n.implicit:n.tag,n.any);if(e.isError(u))return u;n.any?i=e.raw(l):e=u}if(t&&t.track&&n.tag!==null&&t.track(e.path(),c,e.length,"tagged"),t&&t.track&&n.tag!==null&&t.track(e.path(),e.offset,e.length,"content"),n.any||(n.choice===null?i=this._decodeGeneric(n.tag,e,t):i=this._decodeChoice(e,t)),e.isError(i))return i;if(!n.any&&n.choice===null&&n.children!==null&&n.children.forEach(function(u){u._decode(e,t)}),n.contains&&(n.tag==="octstr"||n.tag==="bitstr")){let l=new ij(i);i=this._getUse(n.contains,e._reporterState.obj)._decode(l,t)}}return n.obj&&s&&(i=e.leaveObject(a)),n.key!==null&&(i!==null||s===!0)?e.leaveKey(o,n.key,i):o!==null&&e.exitKey(o),i};me.prototype._decodeGeneric=function(e,t,n){let i=this._baseState;return e==="seq"||e==="set"?null:e==="seqof"||e==="setof"?this._decodeList(t,e,i.args[0],n):/str$/.test(e)?this._decodeStr(t,e,n):e==="objid"&&i.args?this._decodeObjid(t,i.args[0],i.args[1],n):e==="objid"?this._decodeObjid(t,null,null,n):e==="gentime"||e==="utctime"?this._decodeTime(t,e,n):e==="null_"?this._decodeNull(t,n):e==="bool"?this._decodeBool(t,n):e==="objDesc"?this._decodeStr(t,e,n):e==="int"||e==="enum"?this._decodeInt(t,i.args&&i.args[0],n):i.use!==null?this._getUse(i.use,t._reporterState.obj)._decode(t,n):t.error("unknown tag: "+e)};me.prototype._getUse=function(e,t){let n=this._baseState;return n.useDecoder=this._use(e,t),Pt(n.useDecoder._baseState.parent===null),n.useDecoder=n.useDecoder._baseState.children[0],n.implicit!==n.useDecoder._baseState.implicit&&(n.useDecoder=n.useDecoder.clone(),n.useDecoder._baseState.implicit=n.implicit),n.useDecoder};me.prototype._decodeChoice=function(e,t){let n=this._baseState,i=null,s=!1;return Object.keys(n.choice).some(function(o){let a=e.save(),c=n.choice[o];try{let l=c._decode(e,t);if(e.isError(l))return!1;i={type:o,value:l},s=!0}catch{return e.restore(a),!1}return!0},this),s?i:e.error("Choice not matched")};me.prototype._createEncoderBuffer=function(e){return new nj(e,this.reporter)};me.prototype._encode=function(e,t,n){let i=this._baseState;if(i.default!==null&&i.default===e)return;let s=this._encodeValue(e,t,n);if(s!==void 0&&!this._skipDefault(s,t,n))return s};me.prototype._encodeValue=function(e,t,n){let i=this._baseState;if(i.parent===null)return i.children[0]._encode(e,t||new rj);let s=null;if(this.reporter=t,i.optional&&e===void 0)if(i.default!==null)e=i.default;else return;let o=null,a=!1;if(i.any)s=this._createEncoderBuffer(e);else if(i.choice)s=this._encodeChoice(e,t);else if(i.contains)o=this._getUse(i.contains,n)._encode(e,t),a=!0;else if(i.children)o=i.children.map(function(c){if(c._baseState.tag==="null_")return c._encode(null,t,e);if(c._baseState.key===null)return t.error("Child should have a key");let l=t.enterKey(c._baseState.key);if(typeof e!="object")return t.error("Child expected, but input is not object");let u=c._encode(e[c._baseState.key],t,e);return t.leaveKey(l),u},this).filter(function(c){return c}),o=this._createEncoderBuffer(o);else if(i.tag==="seqof"||i.tag==="setof"){if(!(i.args&&i.args.length===1))return t.error("Too many args for : "+i.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");let c=this.clone();c._baseState.implicit=null,o=this._createEncoderBuffer(e.map(function(l){let u=this._baseState;return this._getUse(u.args[0],e)._encode(l,t)},c))}else i.use!==null?s=this._getUse(i.use,n)._encode(e,t):(o=this._encodePrimitive(i.tag,e),a=!0);if(!i.any&&i.choice===null){let c=i.implicit!==null?i.implicit:i.tag,l=i.implicit===null?"universal":"context";c===null?i.use===null&&t.error("Tag could be omitted only for .use()"):i.use===null&&(s=this._encodeComposite(c,a,l,o))}return i.explicit!==null&&(s=this._encodeComposite(i.explicit,!1,"context",s)),s};me.prototype._encodeChoice=function(e,t){let n=this._baseState,i=n.choice[e.type];return i||Pt(!1,e.type+" not found in "+JSON.stringify(Object.keys(n.choice))),i._encode(e.value,t)};me.prototype._encodePrimitive=function(e,t){let n=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if(e==="objid"&&n.args)return this._encodeObjid(t,n.reverseArgs[0],n.args[1]);if(e==="objid")return this._encodeObjid(t,null,null);if(e==="gentime"||e==="utctime")return this._encodeTime(t,e);if(e==="null_")return this._encodeNull();if(e==="int"||e==="enum")return this._encodeInt(t,n.args&&n.reverseArgs[0]);if(e==="bool")return this._encodeBool(t);if(e==="objDesc")return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)};me.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)};me.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}});var ru=A(_i=>{"use strict";function bE(r){let e={};return Object.keys(r).forEach(function(t){(t|0)==t&&(t=t|0);let n=r[t];e[n]=t}),e}_i.tagClass={0:"universal",1:"application",2:"context",3:"private"};_i.tagClassByName=bE(_i.tagClass);_i.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"};_i.tagByName=bE(_i.tag)});var em=A((xG,EE)=>{"use strict";var cj=zn(),Sn=Zl().Buffer,wE=tu(),Qh=ru();function SE(r){this.enc="der",this.name=r.name,this.entity=r,this.tree=new Pr,this.tree._init(r.body)}EE.exports=SE;SE.prototype.encode=function(e,t){return this.tree._encode(e,t).join()};function Pr(r){wE.call(this,"der",r)}cj(Pr,wE);Pr.prototype._encodeComposite=function(e,t,n,i){let s=lj(e,t,n,this.reporter);if(i.length<128){let c=Sn.alloc(2);return c[0]=s,c[1]=i.length,this._createEncoderBuffer([c,i])}let o=1;for(let c=i.length;c>=256;c>>=8)o++;let a=Sn.alloc(2+o);a[0]=s,a[1]=128|o;for(let c=1+o,l=i.length;l>0;c--,l>>=8)a[c]=l&255;return this._createEncoderBuffer([a,i])};Pr.prototype._encodeStr=function(e,t){if(t==="bitstr")return this._createEncoderBuffer([e.unused|0,e.data]);if(t==="bmpstr"){let n=Sn.alloc(e.length*2);for(let i=0;i<e.length;i++)n.writeUInt16BE(e.charCodeAt(i),i*2);return this._createEncoderBuffer(n)}else return t==="numstr"?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):t==="printstr"?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)?this._createEncoderBuffer(e):t==="objDesc"?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported")};Pr.prototype._encodeObjid=function(e,t,n){if(typeof e=="string"){if(!t)return this.reporter.error("string objid given, but no values map found");if(!t.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=t[e].split(/[\s.]+/g);for(let a=0;a<e.length;a++)e[a]|=0}else if(Array.isArray(e)){e=e.slice();for(let a=0;a<e.length;a++)e[a]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!n){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,e[0]*40+e[1])}let i=0;for(let a=0;a<e.length;a++){let c=e[a];for(i++;c>=128;c>>=7)i++}let s=Sn.alloc(i),o=s.length-1;for(let a=e.length-1;a>=0;a--){let c=e[a];for(s[o--]=c&127;(c>>=7)>0;)s[o--]=128|c&127}return this._createEncoderBuffer(s)};function vr(r){return r<10?"0"+r:r}Pr.prototype._encodeTime=function(e,t){let n,i=new Date(e);return t==="gentime"?n=[vr(i.getUTCFullYear()),vr(i.getUTCMonth()+1),vr(i.getUTCDate()),vr(i.getUTCHours()),vr(i.getUTCMinutes()),vr(i.getUTCSeconds()),"Z"].join(""):t==="utctime"?n=[vr(i.getUTCFullYear()%100),vr(i.getUTCMonth()+1),vr(i.getUTCDate()),vr(i.getUTCHours()),vr(i.getUTCMinutes()),vr(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(n,"octstr")};Pr.prototype._encodeNull=function(){return this._createEncoderBuffer("")};Pr.prototype._encodeInt=function(e,t){if(typeof e=="string"){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if(typeof e!="number"&&!Sn.isBuffer(e)){let s=e.toArray();!e.sign&&s[0]&128&&s.unshift(0),e=Sn.from(s)}if(Sn.isBuffer(e)){let s=e.length;e.length===0&&s++;let o=Sn.alloc(s);return e.copy(o),e.length===0&&(o[0]=0),this._createEncoderBuffer(o)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let n=1;for(let s=e;s>=256;s>>=8)n++;let i=new Array(n);for(let s=i.length-1;s>=0;s--)i[s]=e&255,e>>=8;return i[0]&128&&i.unshift(0),this._createEncoderBuffer(Sn.from(i))};Pr.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)};Pr.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getEncoder("der").tree};Pr.prototype._skipDefault=function(e,t,n){let i=this._baseState,s;if(i.default===null)return!1;let o=e.join();if(i.defaultBuffer===void 0&&(i.defaultBuffer=this._encodeValue(i.default,t,n).join()),o.length!==i.defaultBuffer.length)return!1;for(s=0;s<o.length;s++)if(o[s]!==i.defaultBuffer[s])return!1;return!0};function lj(r,e,t,n){let i;if(r==="seqof"?r="seq":r==="setof"&&(r="set"),Qh.tagByName.hasOwnProperty(r))i=Qh.tagByName[r];else if(typeof r=="number"&&(r|0)===r)i=r;else return n.error("Unknown tag: "+r);return i>=31?n.error("Multi-octet tag encoding unsupported"):(e||(i|=32),i|=Qh.tagClassByName[t||"universal"]<<6,i)}});var CE=A((_G,TE)=>{"use strict";var uj=zn(),tm=em();function rm(r){tm.call(this,r),this.enc="pem"}uj(rm,tm);TE.exports=rm;rm.prototype.encode=function(e,t){let i=tm.prototype.encode.call(this,e).toString("base64"),s=["-----BEGIN "+t.label+"-----"];for(let o=0;o<i.length;o+=64)s.push(i.slice(o,o+64));return s.push("-----END "+t.label+"-----"),s.join(`
|
|
95
|
+
`)}});var nm=A(AE=>{"use strict";var kE=AE;kE.der=em();kE.pem=CE()});var sm=A((wG,NE)=>{"use strict";var pj=zn(),fj=Kh(),RE=Fs().DecoderBuffer,ME=tu(),OE=ru();function PE(r){this.enc="der",this.name=r.name,this.entity=r,this.tree=new Qt,this.tree._init(r.body)}NE.exports=PE;PE.prototype.decode=function(e,t){return RE.isDecoderBuffer(e)||(e=new RE(e,t)),this.tree._decode(e,t)};function Qt(r){ME.call(this,"der",r)}pj(Qt,ME);Qt.prototype._peekTag=function(e,t,n){if(e.isEmpty())return!1;let i=e.save(),s=im(e,'Failed to peek tag: "'+t+'"');return e.isError(s)?s:(e.restore(i),s.tag===t||s.tagStr===t||s.tagStr+"of"===t||n)};Qt.prototype._decodeTag=function(e,t,n){let i=im(e,'Failed to decode tag of "'+t+'"');if(e.isError(i))return i;let s=IE(e,i.primitive,'Failed to get length of "'+t+'"');if(e.isError(s))return s;if(!n&&i.tag!==t&&i.tagStr!==t&&i.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(i.primitive||s!==null)return e.skip(s,'Failed to match body of: "'+t+'"');let o=e.save(),a=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(a)?a:(s=e.offset-o.offset,e.restore(o),e.skip(s,'Failed to match body of: "'+t+'"'))};Qt.prototype._skipUntilEnd=function(e,t){for(;;){let n=im(e,t);if(e.isError(n))return n;let i=IE(e,n.primitive,t);if(e.isError(i))return i;let s;if(n.primitive||i!==null?s=e.skip(i):s=this._skipUntilEnd(e,t),e.isError(s))return s;if(n.tagStr==="end")break}};Qt.prototype._decodeList=function(e,t,n,i){let s=[];for(;!e.isEmpty();){let o=this._peekTag(e,"end");if(e.isError(o))return o;let a=n.decode(e,"der",i);if(e.isError(a)&&o)break;s.push(a)}return s};Qt.prototype._decodeStr=function(e,t){if(t==="bitstr"){let n=e.readUInt8();return e.isError(n)?n:{unused:n,data:e.raw()}}else if(t==="bmpstr"){let n=e.raw();if(n.length%2===1)return e.error("Decoding of string type: bmpstr length mismatch");let i="";for(let s=0;s<n.length/2;s++)i+=String.fromCharCode(n.readUInt16BE(s*2));return i}else if(t==="numstr"){let n=e.raw().toString("ascii");return this._isNumstr(n)?n:e.error("Decoding of string type: numstr unsupported characters")}else{if(t==="octstr")return e.raw();if(t==="objDesc")return e.raw();if(t==="printstr"){let n=e.raw().toString("ascii");return this._isPrintstr(n)?n:e.error("Decoding of string type: printstr unsupported characters")}else return/str$/.test(t)?e.raw().toString():e.error("Decoding of string type: "+t+" unsupported")}};Qt.prototype._decodeObjid=function(e,t,n){let i,s=[],o=0,a=0;for(;!e.isEmpty();)a=e.readUInt8(),o<<=7,o|=a&127,(a&128)===0&&(s.push(o),o=0);a&128&&s.push(o);let c=s[0]/40|0,l=s[0]%40;if(n?i=s:i=[c,l].concat(s.slice(1)),t){let u=t[i.join(" ")];u===void 0&&(u=t[i.join(".")]),u!==void 0&&(i=u)}return i};Qt.prototype._decodeTime=function(e,t){let n=e.raw().toString(),i,s,o,a,c,l;if(t==="gentime")i=n.slice(0,4)|0,s=n.slice(4,6)|0,o=n.slice(6,8)|0,a=n.slice(8,10)|0,c=n.slice(10,12)|0,l=n.slice(12,14)|0;else if(t==="utctime")i=n.slice(0,2)|0,s=n.slice(2,4)|0,o=n.slice(4,6)|0,a=n.slice(6,8)|0,c=n.slice(8,10)|0,l=n.slice(10,12)|0,i<70?i=2e3+i:i=1900+i;else return e.error("Decoding "+t+" time is not supported yet");return Date.UTC(i,s-1,o,a,c,l,0)};Qt.prototype._decodeNull=function(){return null};Qt.prototype._decodeBool=function(e){let t=e.readUInt8();return e.isError(t)?t:t!==0};Qt.prototype._decodeInt=function(e,t){let n=e.raw(),i=new fj(n);return t&&(i=t[i.toString(10)]||i),i};Qt.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getDecoder("der").tree};function im(r,e){let t=r.readUInt8(e);if(r.isError(t))return t;let n=OE.tagClass[t>>6],i=(t&32)===0;if((t&31)===31){let o=t;for(t=0;(o&128)===128;){if(o=r.readUInt8(e),r.isError(o))return o;t<<=7,t|=o&127}}else t&=31;let s=OE.tag[t];return{cls:n,primitive:i,tag:t,tagStr:s}}function IE(r,e,t){let n=r.readUInt8(t);if(r.isError(n))return n;if(!e&&n===128)return null;if((n&128)===0)return n;let i=n&127;if(i>4)return r.error("length octect is too long");n=0;for(let s=0;s<i;s++){n<<=8;let o=r.readUInt8(t);if(r.isError(o))return o;n|=o}return n}});var LE=A((SG,DE)=>{"use strict";var dj=zn(),hj=Zl().Buffer,om=sm();function am(r){om.call(this,r),this.enc="pem"}dj(am,om);DE.exports=am;am.prototype.decode=function(e,t){let n=e.toString().split(/[\r\n]+/g),i=t.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/,o=-1,a=-1;for(let u=0;u<n.length;u++){let f=n[u].match(s);if(f!==null&&f[2]===i)if(o===-1){if(f[1]!=="BEGIN")break;o=u}else{if(f[1]!=="END")break;a=u;break}}if(o===-1||a===-1)throw new Error("PEM section not found for: "+i);let c=n.slice(o+1,a).join("");c.replace(/[^a-z0-9+/=]+/gi,"");let l=hj.from(c,"base64");return om.prototype.decode.call(this,l,t)}});var cm=A(jE=>{"use strict";var BE=jE;BE.der=sm();BE.pem=LE()});var HE=A(FE=>{"use strict";var mj=nm(),gj=cm(),vj=zn(),yj=FE;yj.define=function(e,t){return new Hs(e,t)};function Hs(r,e){this.name=r,this.body=e,this.decoders={},this.encoders={}}Hs.prototype._createNamed=function(e){let t=this.name;function n(i){this._initNamed(i,t)}return vj(n,e),n.prototype._initNamed=function(s,o){e.call(this,s,o)},new n(this)};Hs.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(gj[e])),this.decoders[e]};Hs.prototype.decode=function(e,t,n){return this._getDecoder(t).decode(e,n)};Hs.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(mj[e])),this.encoders[e]};Hs.prototype.encode=function(e,t,n){return this._getEncoder(t).encode(e,n)}});var UE=A(qE=>{"use strict";var nu=qE;nu.Reporter=Ql().Reporter;nu.DecoderBuffer=Fs().DecoderBuffer;nu.EncoderBuffer=Fs().EncoderBuffer;nu.Node=tu()});var GE=A(WE=>{"use strict";var $E=WE;$E._reverse=function(e){let t={};return Object.keys(e).forEach(function(n){(n|0)==n&&(n=n|0);let i=e[n];t[i]=n}),t};$E.der=ru()});var VE=A(zE=>{"use strict";var qs=zE;qs.bignum=Kh();qs.define=HE().define;qs.base=UE();qs.constants=GE();qs.decoders=cm();qs.encoders=nm()});var Us=A((lm,YE)=>{var iu=require("buffer"),Vr=iu.Buffer;function KE(r,e){for(var t in r)e[t]=r[t]}Vr.from&&Vr.alloc&&Vr.allocUnsafe&&Vr.allocUnsafeSlow?YE.exports=iu:(KE(iu,lm),lm.Buffer=bi);function bi(r,e,t){return Vr(r,e,t)}bi.prototype=Object.create(Vr.prototype);KE(Vr,bi);bi.from=function(r,e,t){if(typeof r=="number")throw new TypeError("Argument must not be a number");return Vr(r,e,t)};bi.alloc=function(r,e,t){if(typeof r!="number")throw new TypeError("Argument must be a number");var n=Vr(r);return e!==void 0?typeof t=="string"?n.fill(e,t):n.fill(e):n.fill(0),n};bi.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return Vr(r)};bi.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return iu.SlowBuffer(r)}});var um=A((RG,JE)=>{var su=Us().Buffer,xj=require("stream"),_j=require("util");function ou(r){if(this.buffer=null,this.writable=!0,this.readable=!0,!r)return this.buffer=su.alloc(0),this;if(typeof r.pipe=="function")return this.buffer=su.alloc(0),r.pipe(this),this;if(r.length||typeof r=="object")return this.buffer=r,this.writable=!1,process.nextTick(function(){this.emit("end",r),this.readable=!1,this.emit("close")}.bind(this)),this;throw new TypeError("Unexpected data type ("+typeof r+")")}_j.inherits(ou,xj);ou.prototype.write=function(e){this.buffer=su.concat([this.buffer,su.from(e)]),this.emit("data",e)};ou.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1};JE.exports=ou});var ZE=A((OG,XE)=>{"use strict";function pm(r){var e=(r/8|0)+(r%8===0?0:1);return e}var bj={ES256:pm(256),ES384:pm(384),ES512:pm(521)};function wj(r){var e=bj[r];if(e)return e;throw new Error('Unknown algorithm "'+r+'"')}XE.exports=wj});var s1=A((MG,i1)=>{"use strict";var au=Us().Buffer,e1=ZE(),cu=128,t1=0,Sj=32,Ej=16,Tj=2,r1=Ej|Sj|t1<<6,lu=Tj|t1<<6;function Cj(r){return r.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function n1(r){if(au.isBuffer(r))return r;if(typeof r=="string")return au.from(r,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function kj(r,e){r=n1(r);var t=e1(e),n=t+1,i=r.length,s=0;if(r[s++]!==r1)throw new Error('Could not find expected "seq"');var o=r[s++];if(o===(cu|1)&&(o=r[s++]),i-s<o)throw new Error('"seq" specified length of "'+o+'", only "'+(i-s)+'" remaining');if(r[s++]!==lu)throw new Error('Could not find expected "int" for "r"');var a=r[s++];if(i-s-2<a)throw new Error('"r" specified length of "'+a+'", only "'+(i-s-2)+'" available');if(n<a)throw new Error('"r" specified length of "'+a+'", max of "'+n+'" is acceptable');var c=s;if(s+=a,r[s++]!==lu)throw new Error('Could not find expected "int" for "s"');var l=r[s++];if(i-s!==l)throw new Error('"s" specified length of "'+l+'", expected "'+(i-s)+'"');if(n<l)throw new Error('"s" specified length of "'+l+'", max of "'+n+'" is acceptable');var u=s;if(s+=l,s!==i)throw new Error('Expected to consume entire buffer, but "'+(i-s)+'" bytes remain');var f=t-a,h=t-l,g=au.allocUnsafe(f+a+h+l);for(s=0;s<f;++s)g[s]=0;r.copy(g,s,c+Math.max(-f,0),c+a),s=t;for(var x=s;s<x+h;++s)g[s]=0;return r.copy(g,s,u+Math.max(-h,0),u+l),g=g.toString("base64"),g=Cj(g),g}function QE(r,e,t){for(var n=0;e+n<t&&r[e+n]===0;)++n;var i=r[e+n]>=cu;return i&&--n,n}function Aj(r,e){r=n1(r);var t=e1(e),n=r.length;if(n!==t*2)throw new TypeError('"'+e+'" signatures must be "'+t*2+'" bytes, saw "'+n+'"');var i=QE(r,0,t),s=QE(r,t,r.length),o=t-i,a=t-s,c=2+o+1+1+a,l=c<cu,u=au.allocUnsafe((l?2:3)+c),f=0;return u[f++]=r1,l?u[f++]=c:(u[f++]=cu|1,u[f++]=c&255),u[f++]=lu,u[f++]=o,i<0?(u[f++]=0,f+=r.copy(u,f,0,t)):f+=r.copy(u,f,i,t),u[f++]=lu,u[f++]=a,s<0?(u[f++]=0,r.copy(u,f,t)):r.copy(u,f,t+s),u}i1.exports={derToJose:kj,joseToDer:Aj}});var a1=A((PG,o1)=>{"use strict";var sa=require("buffer").Buffer,fm=require("buffer").SlowBuffer;o1.exports=uu;function uu(r,e){if(!sa.isBuffer(r)||!sa.isBuffer(e)||r.length!==e.length)return!1;for(var t=0,n=0;n<r.length;n++)t|=r[n]^e[n];return t===0}uu.install=function(){sa.prototype.equal=fm.prototype.equal=function(e){return uu(this,e)}};var Rj=sa.prototype.equal,Oj=fm.prototype.equal;uu.restore=function(){sa.prototype.equal=Rj,fm.prototype.equal=Oj}});var gm=A((IG,g1)=>{var Ws=Us().Buffer,yr=require("crypto"),l1=s1(),c1=require("util"),Mj=`"%s" is not a valid algorithm.
|
|
96
96
|
Supported algorithms are:
|
|
97
|
-
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,ia="secret must be a string or buffer",qs="key must be a string or a buffer",Sj="key must be a string, a buffer or an object",lm=typeof vr.createPublicKey=="function";lm&&(qs+=" or a KeyObject",ia+="or a KeyObject");function t1(r){if(!Us.isBuffer(r)&&typeof r!="string"&&(!lm||typeof r!="object"||typeof r.type!="string"||typeof r.asymmetricKeyType!="string"||typeof r.export!="function"))throw Ir(qs)}function r1(r){if(!Us.isBuffer(r)&&typeof r!="string"&&typeof r!="object")throw Ir(Sj)}function Ej(r){if(!Us.isBuffer(r)){if(typeof r=="string")return r;if(!lm||typeof r!="object"||r.type!=="secret"||typeof r.export!="function")throw Ir(ia)}}function um(r){return r.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function n1(r){r=r.toString();var e=4-r.length%4;if(e!==4)for(var t=0;t<e;++t)r+="=";return r.replace(/\-/g,"+").replace(/_/g,"/")}function Ir(r){var e=[].slice.call(arguments,1),t=QE.format.bind(QE,r).apply(null,e);return new TypeError(t)}function Tj(r){return Us.isBuffer(r)||typeof r=="string"}function sa(r){return Tj(r)||(r=JSON.stringify(r)),r}function i1(r){return function(t,n){Ej(n),t=sa(t);var i=vr.createHmac("sha"+r,n),s=(i.update(t),i.digest("base64"));return um(s)}}var cm,Cj="timingSafeEqual"in vr?function(e,t){return e.byteLength!==t.byteLength?!1:vr.timingSafeEqual(e,t)}:function(e,t){return cm||(cm=ZE()),cm(e,t)};function kj(r){return function(t,n,i){var s=i1(r)(t,i);return Cj(Us.from(n),Us.from(s))}}function s1(r){return function(t,n){r1(n),t=sa(t);var i=vr.createSign("RSA-SHA"+r),s=(i.update(t),i.sign(n,"base64"));return um(s)}}function o1(r){return function(t,n,i){t1(i),t=sa(t),n=n1(n);var s=vr.createVerify("RSA-SHA"+r);return s.update(t),s.verify(i,n,"base64")}}function Aj(r){return function(t,n){r1(n),t=sa(t);var i=vr.createSign("RSA-SHA"+r),s=(i.update(t),i.sign({key:n,padding:vr.constants.RSA_PKCS1_PSS_PADDING,saltLength:vr.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return um(s)}}function Rj(r){return function(t,n,i){t1(i),t=sa(t),n=n1(n);var s=vr.createVerify("RSA-SHA"+r);return s.update(t),s.verify({key:i,padding:vr.constants.RSA_PKCS1_PSS_PADDING,saltLength:vr.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function Oj(r){var e=s1(r);return function(){var n=e.apply(null,arguments);return n=e1.derToJose(n,"ES"+r),n}}function Mj(r){var e=o1(r);return function(n,i,s){i=e1.joseToDer(i,"ES"+r).toString("base64");var o=e(n,i,s);return o}}function Pj(){return function(){return""}}function Ij(){return function(e,t){return t===""}}a1.exports=function(e){var t={hs:i1,rs:s1,ps:Aj,es:Oj,none:Pj},n={hs:kj,rs:o1,ps:Rj,es:Mj,none:Ij},i=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw Ir(wj,e);var s=(i[1]||i[3]).toLowerCase(),o=i[2];return{sign:t[s](o),verify:n[s](o)}}});var fm=A((SG,c1)=>{var Nj=require("buffer").Buffer;c1.exports=function(e){return typeof e=="string"?e:typeof e=="number"||Nj.isBuffer(e)?e.toString():JSON.stringify(e)}});var h1=A((EG,d1)=>{var Dj=Hs().Buffer,l1=sm(),Lj=pm(),Bj=require("stream"),u1=fm(),dm=require("util");function p1(r,e){return Dj.from(r,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function jj(r,e,t){t=t||"utf8";var n=p1(u1(r),"binary"),i=p1(u1(e),t);return dm.format("%s.%s",n,i)}function f1(r){var e=r.header,t=r.payload,n=r.secret||r.privateKey,i=r.encoding,s=Lj(e.alg),o=jj(e,t,i),a=s.sign(o,n);return dm.format("%s.%s",o,a)}function uu(r){var e=r.secret;if(e=e??r.privateKey,e=e??r.key,/^hs/i.test(r.header.alg)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var t=new l1(e);this.readable=!0,this.header=r.header,this.encoding=r.encoding,this.secret=this.privateKey=this.key=t,this.payload=new l1(r.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}dm.inherits(uu,Bj);uu.prototype.sign=function(){try{var e=f1({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(t){this.readable=!1,this.emit("error",t),this.emit("close")}};uu.sign=f1;d1.exports=uu});var E1=A((TG,S1)=>{var g1=Hs().Buffer,m1=sm(),Fj=pm(),Hj=require("stream"),v1=fm(),qj=require("util"),Uj=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function $j(r){return Object.prototype.toString.call(r)==="[object Object]"}function Wj(r){if($j(r))return r;try{return JSON.parse(r)}catch{return}}function y1(r){var e=r.split(".",1)[0];return Wj(g1.from(e,"base64").toString("binary"))}function Gj(r){return r.split(".",2).join(".")}function x1(r){return r.split(".")[2]}function zj(r,e){e=e||"utf8";var t=r.split(".")[1];return g1.from(t,"base64").toString(e)}function _1(r){return Uj.test(r)&&!!y1(r)}function b1(r,e,t){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}r=v1(r);var i=x1(r),s=Gj(r),o=Fj(e);return o.verify(s,i,t)}function w1(r,e){if(e=e||{},r=v1(r),!_1(r))return null;var t=y1(r);if(!t)return null;var n=zj(r);return(t.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:t,payload:n,signature:x1(r)}}function $s(r){r=r||{};var e=r.secret;if(e=e??r.publicKey,e=e??r.key,/^hs/i.test(r.algorithm)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var t=new m1(e);this.readable=!0,this.algorithm=r.algorithm,this.encoding=r.encoding,this.secret=this.publicKey=this.key=t,this.signature=new m1(r.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}qj.inherits($s,Hj);$s.prototype.verify=function(){try{var e=b1(this.signature.buffer,this.algorithm,this.key.buffer),t=w1(this.signature.buffer,this.encoding);return this.emit("done",e,t),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}};$s.decode=w1;$s.isValid=_1;$s.verify=b1;S1.exports=$s});var C1=A(Vn=>{var T1=h1(),pu=E1(),Vj=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Vn.ALGORITHMS=Vj;Vn.sign=T1.sign;Vn.verify=pu.verify;Vn.decode=pu.decode;Vn.isValid=pu.isValid;Vn.createSign=function(e){return new T1(e)};Vn.createVerify=function(e){return new pu(e)}});var fu=A((kG,k1)=>{"use strict";var hm={};hm.supportedContentEncodings={AES_GCM:"aesgcm",AES_128_GCM:"aes128gcm"};hm.supportedUrgency={VERY_LOW:"very-low",LOW:"low",NORMAL:"normal",HIGH:"high"};k1.exports=hm});var mm=A((AG,A1)=>{"use strict";function Kj(r){return/^[A-Za-z0-9\-_]+$/.test(r)}A1.exports={validate:Kj}});var vm=A((RG,L1)=>{"use strict";var Yj=require("crypto"),Jj=jE(),Xj=C1(),{URL:O1}=require("url"),R1=fu(),M1=mm(),Zj=720*60,Qj=1440*60,eF=Jj.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").explicit(0).objid().optional(),this.key("publicKey").explicit(1).bitstr().optional())});function tF(r){return eF.encode({version:1,privateKey:r,parameters:[1,2,840,10045,3,1,7]},"pem",{label:"EC PRIVATE KEY"})}function rF(){let r=Yj.createECDH("prime256v1");r.generateKeys();let e=r.getPublicKey(),t=r.getPrivateKey();if(t.length<32){let n=Buffer.alloc(32-t.length);n.fill(0),t=Buffer.concat([n,t])}if(e.length<65){let n=Buffer.alloc(65-e.length);n.fill(0),e=Buffer.concat([n,e])}return{publicKey:e.toString("base64url"),privateKey:t.toString("base64url")}}function P1(r){if(!r)throw new Error("No subject set in vapidDetails.subject.");if(typeof r!="string"||r.length===0)throw new Error("The subject value must be a string containing an https: URL or mailto: address. "+r);let e=null;try{e=new O1(r)}catch{throw new Error("Vapid subject is not a valid URL. "+r)}if(!["https:","mailto:"].includes(e.protocol))throw new Error("Vapid subject is not an https: or mailto: URL. "+r);e.hostname==="localhost"&&console.warn("Vapid subject points to a localhost web URI, which is unsupported by Apple's push notification server and will result in a BadJwtToken error when sending notifications.")}function I1(r){if(!r)throw new Error("No key set vapidDetails.publicKey");if(typeof r!="string")throw new Error("Vapid public key is must be a URL safe Base 64 encoded string.");if(!M1.validate(r))throw new Error('Vapid public key must be a URL safe Base 64 (without "=")');if(r=Buffer.from(r,"base64url"),r.length!==65)throw new Error("Vapid public key should be 65 bytes long when decoded.")}function N1(r){if(!r)throw new Error("No key set in vapidDetails.privateKey");if(typeof r!="string")throw new Error("Vapid private key must be a URL safe Base 64 encoded string.");if(!M1.validate(r))throw new Error('Vapid private key must be a URL safe Base 64 (without "=")');if(r=Buffer.from(r,"base64url"),r.length!==32)throw new Error("Vapid private key should be 32 bytes long when decoded.")}function gm(r){let e=new Date;return e.setSeconds(e.getSeconds()+r),Math.floor(e.getTime()/1e3)}function D1(r){if(!Number.isInteger(r))throw new Error("`expiration` value must be a number");if(r<0)throw new Error("`expiration` must be a positive integer");let e=gm(Qj);if(r>=e)throw new Error("`expiration` value is greater than maximum of 24 hours")}function nF(r,e,t,n,i,s){if(!r)throw new Error("No audience could be generated for VAPID.");if(typeof r!="string"||r.length===0)throw new Error("The audience value must be a string containing the origin of a push service. "+r);try{new O1(r)}catch{throw new Error("VAPID audience is not a url. "+r)}P1(e),I1(t),N1(n),n=Buffer.from(n,"base64url"),s?D1(s):s=gm(Zj);let o={typ:"JWT",alg:"ES256"},a={aud:r,exp:s,sub:e},c=Xj.sign({header:o,payload:a,privateKey:tF(n)});if(i===R1.supportedContentEncodings.AES_128_GCM)return{Authorization:"vapid t="+c+", k="+t};if(i===R1.supportedContentEncodings.AES_GCM)return{Authorization:"WebPush "+c,"Crypto-Key":"p256ecdsa="+t};throw new Error("Unsupported encoding type specified.")}L1.exports={generateVAPIDKeys:rF,getFutureExpirationTimestamp:gm,getVapidHeaders:nF,validateSubject:P1,validatePublicKey:I1,validatePrivateKey:N1,validateExpiration:D1}});var V1=A((OG,z1)=>{"use strict";var hu=require("crypto"),j1="aes-128-gcm",mu={aes128gcm:1,aesgcm:2},_i=16,Kr=16,iF=12,F1=32,oa="encrypt",aa="decrypt",ge;process.env.ECE_KEYLOG==="1"?ge=function(r,e){return console.warn(r+" ["+e.length+"]: "+e.toString("base64url")),e}:ge=function(r,e){return e};function du(r){return typeof r=="string"?Buffer.from(r,"base64url"):r}function H1(r,e){var t=hu.createHmac("sha256",r);return t.update(e),t.digest()}function q1(r,e){return ge("salt",r),ge("ikm",e),ge("extract",H1(r,e))}function ym(r,e,t){ge("prk",r),ge("info",e);var n=Buffer.alloc(0),i=Buffer.alloc(0);e=Buffer.from(e,"ascii");for(var s=0,o=Buffer.alloc(1);n.length<t;)o.writeUIntBE(++s,0,1),i=H1(r,Buffer.concat([i,e,o])),n=Buffer.concat([n,i]);return ge("expand",n.slice(0,t))}function U1(r,e,t,n){return ym(q1(r,e),t,n)}function xm(r,e){var t=Buffer.concat([Buffer.from("Content-Encoding: "+r+"\0","ascii"),e]);return ge("info "+r,t),t}function B1(r){var e=Buffer.concat([Buffer.alloc(2),r]);return e.writeUIntBE(r.length,0,2),e}function sF(r,e){var t=r.privateKey,n,i;if(e===oa)n=t.getPublicKey(),i=r.dh;else if(e===aa)n=r.dh,i=t.getPublicKey();else throw new Error("Unknown mode only "+oa+" and "+aa+" supported");return{secret:t.computeSecret(r.dh),context:Buffer.concat([Buffer.from(r.keylabel,"ascii"),Buffer.from([0]),B1(i),B1(n)])}}function oF(r,e){var t={secret:null,context:Buffer.alloc(0)};if(r.key){if(t.secret=r.key,t.secret.length!==Kr)throw new Error("An explicit key must be "+Kr+" bytes")}else r.dh?t=sF(r,e):typeof r.keyid!==void 0&&(t.secret=r.keymap[r.keyid]);if(!t.secret)throw new Error("Unable to determine key");return ge("secret",t.secret),ge("context",t.context),r.authSecret&&(t.secret=U1(r.authSecret,t.secret,xm("auth",Buffer.alloc(0)),F1),ge("authsecret",t.secret)),t}function aF(r,e){if(!r.authSecret)throw new Error("No authentication secret for webpush");ge("authsecret",r.authSecret);var t,n,i;if(e===oa)n=r.privateKey.getPublicKey(),t=i=r.dh;else if(e===aa)t=n=r.keyid,i=r.privateKey.getPublicKey();else throw new Error("Unknown mode only "+oa+" and "+aa+" supported");return ge("remote pubkey",t),ge("sender pubkey",n),ge("receiver pubkey",i),ge("secret dh",U1(r.authSecret,r.privateKey.computeSecret(t),Buffer.concat([Buffer.from("WebPush: info\0"),i,n]),F1))}function cF(r,e,t){if(t&&!vF(t))throw new Error("Callback is not a function");if(r.key){if(r.key.length!==Kr)throw new Error("An explicit key must be "+Kr+" bytes");return ge("secret key",r.key)}if(!r.privateKey){if(t)var n=t(r.keyid);else var n=r.keymap&&r.keymap[r.keyid];if(!n)throw new Error('No saved key (keyid: "'+r.keyid+'")');return n}return aF(r,e)}function $1(r,e,t){if(!r.salt)throw new Error("must include a salt parameter for "+r.version);var n,i,s;if(r.version==="aesgcm"){var o=oF(r,e,t);n=xm("aesgcm",o.context),i=xm("nonce",o.context),s=o.secret}else if(r.version==="aes128gcm")n=Buffer.from("Content-Encoding: aes128gcm\0"),i=Buffer.from("Content-Encoding: nonce\0"),s=cF(r,e,t);else throw new Error("Unable to set context for mode "+r.version);var a=q1(r.salt,s),c={key:ym(a,n,Kr),nonce:ym(a,i,iF)};return ge("key",c.key),ge("nonce base",c.nonce),c}function W1(r){var e={};e.version=r.version||"aes128gcm",e.rs=parseInt(r.rs,10),isNaN(e.rs)&&(e.rs=4096);var t=mu[e.version];if(e.version==="aes128gcm"&&(t+=_i),e.rs<=t)throw new Error("The rs parameter has to be greater than "+t);if(r.salt&&(e.salt=du(r.salt),e.salt.length!==Kr))throw new Error("The salt parameter must be "+Kr+" bytes");return e.keyid=r.keyid,r.key?e.key=du(r.key):(e.privateKey=r.privateKey,e.privateKey||(e.keymap=r.keymap),e.version!=="aes128gcm"&&(e.keylabel=r.keylabel||"P-256"),r.dh&&(e.dh=du(r.dh))),r.authSecret&&(e.authSecret=du(r.authSecret)),e}function G1(r,e){var t=Buffer.from(r),n=t.readUIntBE(t.length-6,6),i=((n^e)&16777215)+((n/16777216^e/16777216)&16777215)*16777216;return t.writeUIntBE(i,t.length-6,6),ge("nonce"+e,t),t}function lF(r,e){var t=r.readUIntBE(20,1);return e.salt=r.slice(0,Kr),e.rs=r.readUIntBE(Kr,4),e.keyid=r.slice(21,21+t),21+t}function uF(r,e){var t=mu[e],n=r.readUIntBE(0,t);if(n+t>r.length)throw new Error("padding exceeds block size");ge("padding",r.slice(0,t+n));var i=Buffer.alloc(n);if(i.fill(0),i.compare(r.slice(t,t+n))!==0)throw new Error("invalid padding");return r.slice(t+n)}function pF(r,e){for(var t=r.length-1;t>=0;){if(r[t]){if(e){if(r[t]!==2)throw new Error("last record needs to start padding with a 2")}else if(r[t]!==1)throw new Error("last record needs to start padding with a 2");return r.slice(0,t)}--t}throw new Error("all zero plaintext")}function fF(r,e,t,n,i){ge("decrypt",t);var s=G1(r.nonce,e),o=hu.createDecipheriv(j1,r.key,s);o.setAuthTag(t.slice(t.length-_i));var a=o.update(t.slice(0,t.length-_i));return a=Buffer.concat([a,o.final()]),ge("decrypted",a),n.version!=="aes128gcm"?uF(a,n.version):pF(a,i)}function dF(r,e,t){var n=W1(e);if(n.version==="aes128gcm"){var i=lF(r,n);r=r.slice(i)}var s=$1(n,aa,t),o=0,a=Buffer.alloc(0),c=n.rs;n.version!=="aes128gcm"&&(c+=_i);for(var l=0;o<r.length;++l){var u=o+c;if(n.version!=="aes128gcm"&&u===r.length)throw new Error("Truncated payload");if(u=Math.min(u,r.length),u-o<=_i)throw new Error("Invalid block: too small at "+l);var f=fF(s,l,r.slice(o,u),n,u>=r.length);a=Buffer.concat([a,f]),o=u}return a}function hF(r,e,t,n,i,s){ge("encrypt",t),n=n||0;var o=G1(r.nonce,e),a=hu.createCipheriv(j1,r.key,o),c=[],l=mu[i.version],u=Buffer.alloc(n+l);if(u.fill(0),i.version!=="aes128gcm"){if(u.writeUIntBE(n,0,l),ge("padding",u),c.push(a.update(u)),c.push(a.update(t)),!s&&u.length+t.length<i.rs)throw new Error("Unable to pad to record size")}else c.push(a.update(t)),u.writeUIntBE(s?2:1,0,1),ge("padding",u),c.push(a.update(u));a.final();var f=a.getAuthTag();if(f.length!==_i)throw new Error("invalid tag generated");return c.push(f),ge("encrypted",Buffer.concat(c))}function mF(r){var e=Buffer.alloc(5),t=Buffer.from(r.keyid||[]);if(t.length>255)throw new Error("keyid is too large");return e.writeUIntBE(r.rs,0,4),e.writeUIntBE(t.length,4,1),Buffer.concat([r.salt,e,t])}function gF(r,e,t){if(!Buffer.isBuffer(r))throw new Error("buffer argument must be a Buffer");var n=W1(e);n.salt||(n.salt=hu.randomBytes(Kr));var i;n.version==="aes128gcm"?(n.privateKey&&!n.keyid&&(n.keyid=n.privateKey.getPublicKey()),i=mF(n)):i=Buffer.alloc(0);var s=$1(n,oa,t),o=0,a=mu[n.version],c=a;n.version==="aes128gcm"&&(c+=_i);for(var l=isNaN(parseInt(e.pad,10))?0:parseInt(e.pad,10),u=0,f=!1;!f;){var h=Math.min(n.rs-c-1,l);n.version!=="aes128gcm"&&(h=Math.min((1<<a*8)-1,h)),l>0&&h===0&&++h,l-=h;var g=o+n.rs-c-h;n.version!=="aes128gcm"?f=g>r.length:f=g>=r.length,f=f&&l<=0;var x=hF(s,u,r.slice(o,g),h,n,f);i=Buffer.concat([i,x]),o=g,++u}return i}function vF(r){return typeof r=="function"}z1.exports={decrypt:dF,encrypt:gF}});var _m=A((MG,Y1)=>{"use strict";var K1=require("crypto"),yF=V1(),xF=function(r,e,t,n){if(!r)throw new Error("No user public key provided for encryption.");if(typeof r!="string")throw new Error("The subscription p256dh value must be a string.");if(Buffer.from(r,"base64url").length!==65)throw new Error("The subscription p256dh value should be 65 bytes long.");if(!e)throw new Error("No user auth provided for encryption.");if(typeof e!="string")throw new Error("The subscription auth key must be a string.");if(Buffer.from(e,"base64url").length<16)throw new Error("The subscription auth key should be at least 16 bytes long");if(typeof t!="string"&&!Buffer.isBuffer(t))throw new Error("Payload must be either a string or a Node Buffer.");(typeof t=="string"||t instanceof String)&&(t=Buffer.from(t));let i=K1.createECDH("prime256v1"),s=i.generateKeys(),o=K1.randomBytes(16).toString("base64url"),a=yF.encrypt(t,{version:n,dh:r,privateKey:i,salt:o,authSecret:e});return{localPublicKey:s,salt:o,cipherText:a}};Y1.exports={encrypt:xF}});var bm=A((PG,X1)=>{"use strict";function J1(r,e,t,n,i){Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.message=r,this.statusCode=e,this.headers=t,this.body=n,this.endpoint=i}require("util").inherits(J1,Error);X1.exports=J1});var eT=A($t=>{"use strict";var _F=$t&&$t.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),bF=$t&&$t.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),Z1=$t&&$t.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&_F(e,r,t);return bF(e,r),e};Object.defineProperty($t,"__esModule",{value:!0});$t.req=$t.json=$t.toBuffer=void 0;var wF=Z1(require("http")),SF=Z1(require("https"));async function Q1(r){let e=0,t=[];for await(let n of r)e+=n.length,t.push(n);return Buffer.concat(t,e)}$t.toBuffer=Q1;async function EF(r){let t=(await Q1(r)).toString("utf8");try{return JSON.parse(t)}catch(n){let i=n;throw i.message+=` (input: ${t})`,i}}$t.json=EF;function TF(r,e={}){let n=((typeof r=="string"?r:r.href).startsWith("https:")?SF:wF).request(r,e),i=new Promise((s,o)=>{n.once("response",s).once("error",o).end()});return n.then=i.then.bind(i),n}$t.req=TF});var iT=A(Qt=>{"use strict";var rT=Qt&&Qt.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),CF=Qt&&Qt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),nT=Qt&&Qt.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&rT(e,r,t);return CF(e,r),e},kF=Qt&&Qt.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&rT(e,r,t)};Object.defineProperty(Qt,"__esModule",{value:!0});Qt.Agent=void 0;var AF=nT(require("net")),tT=nT(require("http")),RF=require("https");kF(eT(),Qt);var Yr=Symbol("AgentBaseInternalState"),wm=class extends tT.Agent{constructor(e){super(e),this[Yr]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:t}=new Error;return typeof t!="string"?!1:t.split(`
|
|
98
|
-
`).some(n=>n.indexOf("(https.js:")!==-1||n.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let t=new
|
|
97
|
+
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,oa="secret must be a string or buffer",$s="key must be a string or a buffer",Pj="key must be a string, a buffer or an object",hm=typeof yr.createPublicKey=="function";hm&&($s+=" or a KeyObject",oa+="or a KeyObject");function u1(r){if(!Ws.isBuffer(r)&&typeof r!="string"&&(!hm||typeof r!="object"||typeof r.type!="string"||typeof r.asymmetricKeyType!="string"||typeof r.export!="function"))throw Ir($s)}function p1(r){if(!Ws.isBuffer(r)&&typeof r!="string"&&typeof r!="object")throw Ir(Pj)}function Ij(r){if(!Ws.isBuffer(r)){if(typeof r=="string")return r;if(!hm||typeof r!="object"||r.type!=="secret"||typeof r.export!="function")throw Ir(oa)}}function mm(r){return r.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function f1(r){r=r.toString();var e=4-r.length%4;if(e!==4)for(var t=0;t<e;++t)r+="=";return r.replace(/\-/g,"+").replace(/_/g,"/")}function Ir(r){var e=[].slice.call(arguments,1),t=c1.format.bind(c1,r).apply(null,e);return new TypeError(t)}function Nj(r){return Ws.isBuffer(r)||typeof r=="string"}function aa(r){return Nj(r)||(r=JSON.stringify(r)),r}function d1(r){return function(t,n){Ij(n),t=aa(t);var i=yr.createHmac("sha"+r,n),s=(i.update(t),i.digest("base64"));return mm(s)}}var dm,Dj="timingSafeEqual"in yr?function(e,t){return e.byteLength!==t.byteLength?!1:yr.timingSafeEqual(e,t)}:function(e,t){return dm||(dm=a1()),dm(e,t)};function Lj(r){return function(t,n,i){var s=d1(r)(t,i);return Dj(Ws.from(n),Ws.from(s))}}function h1(r){return function(t,n){p1(n),t=aa(t);var i=yr.createSign("RSA-SHA"+r),s=(i.update(t),i.sign(n,"base64"));return mm(s)}}function m1(r){return function(t,n,i){u1(i),t=aa(t),n=f1(n);var s=yr.createVerify("RSA-SHA"+r);return s.update(t),s.verify(i,n,"base64")}}function Bj(r){return function(t,n){p1(n),t=aa(t);var i=yr.createSign("RSA-SHA"+r),s=(i.update(t),i.sign({key:n,padding:yr.constants.RSA_PKCS1_PSS_PADDING,saltLength:yr.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return mm(s)}}function jj(r){return function(t,n,i){u1(i),t=aa(t),n=f1(n);var s=yr.createVerify("RSA-SHA"+r);return s.update(t),s.verify({key:i,padding:yr.constants.RSA_PKCS1_PSS_PADDING,saltLength:yr.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function Fj(r){var e=h1(r);return function(){var n=e.apply(null,arguments);return n=l1.derToJose(n,"ES"+r),n}}function Hj(r){var e=m1(r);return function(n,i,s){i=l1.joseToDer(i,"ES"+r).toString("base64");var o=e(n,i,s);return o}}function qj(){return function(){return""}}function Uj(){return function(e,t){return t===""}}g1.exports=function(e){var t={hs:d1,rs:h1,ps:Bj,es:Fj,none:qj},n={hs:Lj,rs:m1,ps:jj,es:Hj,none:Uj},i=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw Ir(Mj,e);var s=(i[1]||i[3]).toLowerCase(),o=i[2];return{sign:t[s](o),verify:n[s](o)}}});var vm=A((NG,v1)=>{var $j=require("buffer").Buffer;v1.exports=function(e){return typeof e=="string"?e:typeof e=="number"||$j.isBuffer(e)?e.toString():JSON.stringify(e)}});var S1=A((DG,w1)=>{var Wj=Us().Buffer,y1=um(),Gj=gm(),zj=require("stream"),x1=vm(),ym=require("util");function _1(r,e){return Wj.from(r,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Vj(r,e,t){t=t||"utf8";var n=_1(x1(r),"binary"),i=_1(x1(e),t);return ym.format("%s.%s",n,i)}function b1(r){var e=r.header,t=r.payload,n=r.secret||r.privateKey,i=r.encoding,s=Gj(e.alg),o=Vj(e,t,i),a=s.sign(o,n);return ym.format("%s.%s",o,a)}function pu(r){var e=r.secret;if(e=e??r.privateKey,e=e??r.key,/^hs/i.test(r.header.alg)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var t=new y1(e);this.readable=!0,this.header=r.header,this.encoding=r.encoding,this.secret=this.privateKey=this.key=t,this.payload=new y1(r.payload),this.secret.once("close",function(){!this.payload.writable&&this.readable&&this.sign()}.bind(this)),this.payload.once("close",function(){!this.secret.writable&&this.readable&&this.sign()}.bind(this))}ym.inherits(pu,zj);pu.prototype.sign=function(){try{var e=b1({header:this.header,payload:this.payload.buffer,secret:this.secret.buffer,encoding:this.encoding});return this.emit("done",e),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(t){this.readable=!1,this.emit("error",t),this.emit("close")}};pu.sign=b1;w1.exports=pu});var I1=A((LG,P1)=>{var T1=Us().Buffer,E1=um(),Kj=gm(),Yj=require("stream"),C1=vm(),Jj=require("util"),Xj=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function Zj(r){return Object.prototype.toString.call(r)==="[object Object]"}function Qj(r){if(Zj(r))return r;try{return JSON.parse(r)}catch{return}}function k1(r){var e=r.split(".",1)[0];return Qj(T1.from(e,"base64").toString("binary"))}function eF(r){return r.split(".",2).join(".")}function A1(r){return r.split(".")[2]}function tF(r,e){e=e||"utf8";var t=r.split(".")[1];return T1.from(t,"base64").toString(e)}function R1(r){return Xj.test(r)&&!!k1(r)}function O1(r,e,t){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}r=C1(r);var i=A1(r),s=eF(r),o=Kj(e);return o.verify(s,i,t)}function M1(r,e){if(e=e||{},r=C1(r),!R1(r))return null;var t=k1(r);if(!t)return null;var n=tF(r);return(t.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:t,payload:n,signature:A1(r)}}function Gs(r){r=r||{};var e=r.secret;if(e=e??r.publicKey,e=e??r.key,/^hs/i.test(r.algorithm)===!0&&e==null)throw new TypeError("secret must be a string or buffer or a KeyObject");var t=new E1(e);this.readable=!0,this.algorithm=r.algorithm,this.encoding=r.encoding,this.secret=this.publicKey=this.key=t,this.signature=new E1(r.signature),this.secret.once("close",function(){!this.signature.writable&&this.readable&&this.verify()}.bind(this)),this.signature.once("close",function(){!this.secret.writable&&this.readable&&this.verify()}.bind(this))}Jj.inherits(Gs,Yj);Gs.prototype.verify=function(){try{var e=O1(this.signature.buffer,this.algorithm,this.key.buffer),t=M1(this.signature.buffer,this.encoding);return this.emit("done",e,t),this.emit("data",e),this.emit("end"),this.readable=!1,e}catch(n){this.readable=!1,this.emit("error",n),this.emit("close")}};Gs.decode=M1;Gs.isValid=R1;Gs.verify=O1;P1.exports=Gs});var D1=A(Vn=>{var N1=S1(),fu=I1(),rF=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Vn.ALGORITHMS=rF;Vn.sign=N1.sign;Vn.verify=fu.verify;Vn.decode=fu.decode;Vn.isValid=fu.isValid;Vn.createSign=function(e){return new N1(e)};Vn.createVerify=function(e){return new fu(e)}});var du=A((jG,L1)=>{"use strict";var xm={};xm.supportedContentEncodings={AES_GCM:"aesgcm",AES_128_GCM:"aes128gcm"};xm.supportedUrgency={VERY_LOW:"very-low",LOW:"low",NORMAL:"normal",HIGH:"high"};L1.exports=xm});var _m=A((FG,B1)=>{"use strict";function nF(r){return/^[A-Za-z0-9\-_]+$/.test(r)}B1.exports={validate:nF}});var wm=A((HG,G1)=>{"use strict";var iF=require("crypto"),sF=VE(),oF=D1(),{URL:F1}=require("url"),j1=du(),H1=_m(),aF=720*60,cF=1440*60,lF=sF.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").explicit(0).objid().optional(),this.key("publicKey").explicit(1).bitstr().optional())});function uF(r){return lF.encode({version:1,privateKey:r,parameters:[1,2,840,10045,3,1,7]},"pem",{label:"EC PRIVATE KEY"})}function pF(){let r=iF.createECDH("prime256v1");r.generateKeys();let e=r.getPublicKey(),t=r.getPrivateKey();if(t.length<32){let n=Buffer.alloc(32-t.length);n.fill(0),t=Buffer.concat([n,t])}if(e.length<65){let n=Buffer.alloc(65-e.length);n.fill(0),e=Buffer.concat([n,e])}return{publicKey:e.toString("base64url"),privateKey:t.toString("base64url")}}function q1(r){if(!r)throw new Error("No subject set in vapidDetails.subject.");if(typeof r!="string"||r.length===0)throw new Error("The subject value must be a string containing an https: URL or mailto: address. "+r);let e=null;try{e=new F1(r)}catch{throw new Error("Vapid subject is not a valid URL. "+r)}if(!["https:","mailto:"].includes(e.protocol))throw new Error("Vapid subject is not an https: or mailto: URL. "+r);e.hostname==="localhost"&&console.warn("Vapid subject points to a localhost web URI, which is unsupported by Apple's push notification server and will result in a BadJwtToken error when sending notifications.")}function U1(r){if(!r)throw new Error("No key set vapidDetails.publicKey");if(typeof r!="string")throw new Error("Vapid public key is must be a URL safe Base 64 encoded string.");if(!H1.validate(r))throw new Error('Vapid public key must be a URL safe Base 64 (without "=")');if(r=Buffer.from(r,"base64url"),r.length!==65)throw new Error("Vapid public key should be 65 bytes long when decoded.")}function $1(r){if(!r)throw new Error("No key set in vapidDetails.privateKey");if(typeof r!="string")throw new Error("Vapid private key must be a URL safe Base 64 encoded string.");if(!H1.validate(r))throw new Error('Vapid private key must be a URL safe Base 64 (without "=")');if(r=Buffer.from(r,"base64url"),r.length!==32)throw new Error("Vapid private key should be 32 bytes long when decoded.")}function bm(r){let e=new Date;return e.setSeconds(e.getSeconds()+r),Math.floor(e.getTime()/1e3)}function W1(r){if(!Number.isInteger(r))throw new Error("`expiration` value must be a number");if(r<0)throw new Error("`expiration` must be a positive integer");let e=bm(cF);if(r>=e)throw new Error("`expiration` value is greater than maximum of 24 hours")}function fF(r,e,t,n,i,s){if(!r)throw new Error("No audience could be generated for VAPID.");if(typeof r!="string"||r.length===0)throw new Error("The audience value must be a string containing the origin of a push service. "+r);try{new F1(r)}catch{throw new Error("VAPID audience is not a url. "+r)}q1(e),U1(t),$1(n),n=Buffer.from(n,"base64url"),s?W1(s):s=bm(aF);let o={typ:"JWT",alg:"ES256"},a={aud:r,exp:s,sub:e},c=oF.sign({header:o,payload:a,privateKey:uF(n)});if(i===j1.supportedContentEncodings.AES_128_GCM)return{Authorization:"vapid t="+c+", k="+t};if(i===j1.supportedContentEncodings.AES_GCM)return{Authorization:"WebPush "+c,"Crypto-Key":"p256ecdsa="+t};throw new Error("Unsupported encoding type specified.")}G1.exports={generateVAPIDKeys:pF,getFutureExpirationTimestamp:bm,getVapidHeaders:fF,validateSubject:q1,validatePublicKey:U1,validatePrivateKey:$1,validateExpiration:W1}});var rT=A((qG,tT)=>{"use strict";var mu=require("crypto"),V1="aes-128-gcm",gu={aes128gcm:1,aesgcm:2},wi=16,Kr=16,dF=12,K1=32,ca="encrypt",la="decrypt",ge;process.env.ECE_KEYLOG==="1"?ge=function(r,e){return console.warn(r+" ["+e.length+"]: "+e.toString("base64url")),e}:ge=function(r,e){return e};function hu(r){return typeof r=="string"?Buffer.from(r,"base64url"):r}function Y1(r,e){var t=mu.createHmac("sha256",r);return t.update(e),t.digest()}function J1(r,e){return ge("salt",r),ge("ikm",e),ge("extract",Y1(r,e))}function Sm(r,e,t){ge("prk",r),ge("info",e);var n=Buffer.alloc(0),i=Buffer.alloc(0);e=Buffer.from(e,"ascii");for(var s=0,o=Buffer.alloc(1);n.length<t;)o.writeUIntBE(++s,0,1),i=Y1(r,Buffer.concat([i,e,o])),n=Buffer.concat([n,i]);return ge("expand",n.slice(0,t))}function X1(r,e,t,n){return Sm(J1(r,e),t,n)}function Em(r,e){var t=Buffer.concat([Buffer.from("Content-Encoding: "+r+"\0","ascii"),e]);return ge("info "+r,t),t}function z1(r){var e=Buffer.concat([Buffer.alloc(2),r]);return e.writeUIntBE(r.length,0,2),e}function hF(r,e){var t=r.privateKey,n,i;if(e===ca)n=t.getPublicKey(),i=r.dh;else if(e===la)n=r.dh,i=t.getPublicKey();else throw new Error("Unknown mode only "+ca+" and "+la+" supported");return{secret:t.computeSecret(r.dh),context:Buffer.concat([Buffer.from(r.keylabel,"ascii"),Buffer.from([0]),z1(i),z1(n)])}}function mF(r,e){var t={secret:null,context:Buffer.alloc(0)};if(r.key){if(t.secret=r.key,t.secret.length!==Kr)throw new Error("An explicit key must be "+Kr+" bytes")}else r.dh?t=hF(r,e):typeof r.keyid!==void 0&&(t.secret=r.keymap[r.keyid]);if(!t.secret)throw new Error("Unable to determine key");return ge("secret",t.secret),ge("context",t.context),r.authSecret&&(t.secret=X1(r.authSecret,t.secret,Em("auth",Buffer.alloc(0)),K1),ge("authsecret",t.secret)),t}function gF(r,e){if(!r.authSecret)throw new Error("No authentication secret for webpush");ge("authsecret",r.authSecret);var t,n,i;if(e===ca)n=r.privateKey.getPublicKey(),t=i=r.dh;else if(e===la)t=n=r.keyid,i=r.privateKey.getPublicKey();else throw new Error("Unknown mode only "+ca+" and "+la+" supported");return ge("remote pubkey",t),ge("sender pubkey",n),ge("receiver pubkey",i),ge("secret dh",X1(r.authSecret,r.privateKey.computeSecret(t),Buffer.concat([Buffer.from("WebPush: info\0"),i,n]),K1))}function vF(r,e,t){if(t&&!CF(t))throw new Error("Callback is not a function");if(r.key){if(r.key.length!==Kr)throw new Error("An explicit key must be "+Kr+" bytes");return ge("secret key",r.key)}if(!r.privateKey){if(t)var n=t(r.keyid);else var n=r.keymap&&r.keymap[r.keyid];if(!n)throw new Error('No saved key (keyid: "'+r.keyid+'")');return n}return gF(r,e)}function Z1(r,e,t){if(!r.salt)throw new Error("must include a salt parameter for "+r.version);var n,i,s;if(r.version==="aesgcm"){var o=mF(r,e,t);n=Em("aesgcm",o.context),i=Em("nonce",o.context),s=o.secret}else if(r.version==="aes128gcm")n=Buffer.from("Content-Encoding: aes128gcm\0"),i=Buffer.from("Content-Encoding: nonce\0"),s=vF(r,e,t);else throw new Error("Unable to set context for mode "+r.version);var a=J1(r.salt,s),c={key:Sm(a,n,Kr),nonce:Sm(a,i,dF)};return ge("key",c.key),ge("nonce base",c.nonce),c}function Q1(r){var e={};e.version=r.version||"aes128gcm",e.rs=parseInt(r.rs,10),isNaN(e.rs)&&(e.rs=4096);var t=gu[e.version];if(e.version==="aes128gcm"&&(t+=wi),e.rs<=t)throw new Error("The rs parameter has to be greater than "+t);if(r.salt&&(e.salt=hu(r.salt),e.salt.length!==Kr))throw new Error("The salt parameter must be "+Kr+" bytes");return e.keyid=r.keyid,r.key?e.key=hu(r.key):(e.privateKey=r.privateKey,e.privateKey||(e.keymap=r.keymap),e.version!=="aes128gcm"&&(e.keylabel=r.keylabel||"P-256"),r.dh&&(e.dh=hu(r.dh))),r.authSecret&&(e.authSecret=hu(r.authSecret)),e}function eT(r,e){var t=Buffer.from(r),n=t.readUIntBE(t.length-6,6),i=((n^e)&16777215)+((n/16777216^e/16777216)&16777215)*16777216;return t.writeUIntBE(i,t.length-6,6),ge("nonce"+e,t),t}function yF(r,e){var t=r.readUIntBE(20,1);return e.salt=r.slice(0,Kr),e.rs=r.readUIntBE(Kr,4),e.keyid=r.slice(21,21+t),21+t}function xF(r,e){var t=gu[e],n=r.readUIntBE(0,t);if(n+t>r.length)throw new Error("padding exceeds block size");ge("padding",r.slice(0,t+n));var i=Buffer.alloc(n);if(i.fill(0),i.compare(r.slice(t,t+n))!==0)throw new Error("invalid padding");return r.slice(t+n)}function _F(r,e){for(var t=r.length-1;t>=0;){if(r[t]){if(e){if(r[t]!==2)throw new Error("last record needs to start padding with a 2")}else if(r[t]!==1)throw new Error("last record needs to start padding with a 2");return r.slice(0,t)}--t}throw new Error("all zero plaintext")}function bF(r,e,t,n,i){ge("decrypt",t);var s=eT(r.nonce,e),o=mu.createDecipheriv(V1,r.key,s);o.setAuthTag(t.slice(t.length-wi));var a=o.update(t.slice(0,t.length-wi));return a=Buffer.concat([a,o.final()]),ge("decrypted",a),n.version!=="aes128gcm"?xF(a,n.version):_F(a,i)}function wF(r,e,t){var n=Q1(e);if(n.version==="aes128gcm"){var i=yF(r,n);r=r.slice(i)}var s=Z1(n,la,t),o=0,a=Buffer.alloc(0),c=n.rs;n.version!=="aes128gcm"&&(c+=wi);for(var l=0;o<r.length;++l){var u=o+c;if(n.version!=="aes128gcm"&&u===r.length)throw new Error("Truncated payload");if(u=Math.min(u,r.length),u-o<=wi)throw new Error("Invalid block: too small at "+l);var f=bF(s,l,r.slice(o,u),n,u>=r.length);a=Buffer.concat([a,f]),o=u}return a}function SF(r,e,t,n,i,s){ge("encrypt",t),n=n||0;var o=eT(r.nonce,e),a=mu.createCipheriv(V1,r.key,o),c=[],l=gu[i.version],u=Buffer.alloc(n+l);if(u.fill(0),i.version!=="aes128gcm"){if(u.writeUIntBE(n,0,l),ge("padding",u),c.push(a.update(u)),c.push(a.update(t)),!s&&u.length+t.length<i.rs)throw new Error("Unable to pad to record size")}else c.push(a.update(t)),u.writeUIntBE(s?2:1,0,1),ge("padding",u),c.push(a.update(u));a.final();var f=a.getAuthTag();if(f.length!==wi)throw new Error("invalid tag generated");return c.push(f),ge("encrypted",Buffer.concat(c))}function EF(r){var e=Buffer.alloc(5),t=Buffer.from(r.keyid||[]);if(t.length>255)throw new Error("keyid is too large");return e.writeUIntBE(r.rs,0,4),e.writeUIntBE(t.length,4,1),Buffer.concat([r.salt,e,t])}function TF(r,e,t){if(!Buffer.isBuffer(r))throw new Error("buffer argument must be a Buffer");var n=Q1(e);n.salt||(n.salt=mu.randomBytes(Kr));var i;n.version==="aes128gcm"?(n.privateKey&&!n.keyid&&(n.keyid=n.privateKey.getPublicKey()),i=EF(n)):i=Buffer.alloc(0);var s=Z1(n,ca,t),o=0,a=gu[n.version],c=a;n.version==="aes128gcm"&&(c+=wi);for(var l=isNaN(parseInt(e.pad,10))?0:parseInt(e.pad,10),u=0,f=!1;!f;){var h=Math.min(n.rs-c-1,l);n.version!=="aes128gcm"&&(h=Math.min((1<<a*8)-1,h)),l>0&&h===0&&++h,l-=h;var g=o+n.rs-c-h;n.version!=="aes128gcm"?f=g>r.length:f=g>=r.length,f=f&&l<=0;var x=SF(s,u,r.slice(o,g),h,n,f);i=Buffer.concat([i,x]),o=g,++u}return i}function CF(r){return typeof r=="function"}tT.exports={decrypt:wF,encrypt:TF}});var Tm=A((UG,iT)=>{"use strict";var nT=require("crypto"),kF=rT(),AF=function(r,e,t,n){if(!r)throw new Error("No user public key provided for encryption.");if(typeof r!="string")throw new Error("The subscription p256dh value must be a string.");if(Buffer.from(r,"base64url").length!==65)throw new Error("The subscription p256dh value should be 65 bytes long.");if(!e)throw new Error("No user auth provided for encryption.");if(typeof e!="string")throw new Error("The subscription auth key must be a string.");if(Buffer.from(e,"base64url").length<16)throw new Error("The subscription auth key should be at least 16 bytes long");if(typeof t!="string"&&!Buffer.isBuffer(t))throw new Error("Payload must be either a string or a Node Buffer.");(typeof t=="string"||t instanceof String)&&(t=Buffer.from(t));let i=nT.createECDH("prime256v1"),s=i.generateKeys(),o=nT.randomBytes(16).toString("base64url"),a=kF.encrypt(t,{version:n,dh:r,privateKey:i,salt:o,authSecret:e});return{localPublicKey:s,salt:o,cipherText:a}};iT.exports={encrypt:AF}});var Cm=A(($G,oT)=>{"use strict";function sT(r,e,t,n,i){Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.message=r,this.statusCode=e,this.headers=t,this.body=n,this.endpoint=i}require("util").inherits(sT,Error);oT.exports=sT});var lT=A(Wt=>{"use strict";var RF=Wt&&Wt.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),OF=Wt&&Wt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),aT=Wt&&Wt.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&RF(e,r,t);return OF(e,r),e};Object.defineProperty(Wt,"__esModule",{value:!0});Wt.req=Wt.json=Wt.toBuffer=void 0;var MF=aT(require("http")),PF=aT(require("https"));async function cT(r){let e=0,t=[];for await(let n of r)e+=n.length,t.push(n);return Buffer.concat(t,e)}Wt.toBuffer=cT;async function IF(r){let t=(await cT(r)).toString("utf8");try{return JSON.parse(t)}catch(n){let i=n;throw i.message+=` (input: ${t})`,i}}Wt.json=IF;function NF(r,e={}){let n=((typeof r=="string"?r:r.href).startsWith("https:")?PF:MF).request(r,e),i=new Promise((s,o)=>{n.once("response",s).once("error",o).end()});return n.then=i.then.bind(i),n}Wt.req=NF});var dT=A(er=>{"use strict";var pT=er&&er.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),DF=er&&er.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),fT=er&&er.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&pT(e,r,t);return DF(e,r),e},LF=er&&er.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&pT(e,r,t)};Object.defineProperty(er,"__esModule",{value:!0});er.Agent=void 0;var BF=fT(require("net")),uT=fT(require("http")),jF=require("https");LF(lT(),er);var Yr=Symbol("AgentBaseInternalState"),km=class extends uT.Agent{constructor(e){super(e),this[Yr]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:t}=new Error;return typeof t!="string"?!1:t.split(`
|
|
98
|
+
`).some(n=>n.indexOf("(https.js:")!==-1||n.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let t=new BF.Socket({writable:!1});return this.sockets[e].push(t),this.totalSocketCount++,t}decrementSockets(e,t){if(!this.sockets[e]||t===null)return;let n=this.sockets[e],i=n.indexOf(t);i!==-1&&(n.splice(i,1),this.totalSocketCount--,n.length===0&&delete this.sockets[e])}getName(e){return this.isSecureEndpoint(e)?jF.Agent.prototype.getName.call(this,e):super.getName(e)}createSocket(e,t,n){let i={...t,secureEndpoint:this.isSecureEndpoint(t)},s=this.getName(i),o=this.incrementSockets(s);Promise.resolve().then(()=>this.connect(e,i)).then(a=>{if(this.decrementSockets(s,o),a instanceof uT.Agent)try{return a.addRequest(e,i)}catch(c){return n(c)}this[Yr].currentSocket=a,super.createSocket(e,t,n)},a=>{this.decrementSockets(s,o),n(a)})}createConnection(){let e=this[Yr].currentSocket;if(this[Yr].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[Yr].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[Yr]&&(this[Yr].defaultPort=e)}get protocol(){return this[Yr].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[Yr]&&(this[Yr].protocol=e)}};er.Agent=km});var hT=A(zs=>{"use strict";var FF=zs&&zs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(zs,"__esModule",{value:!0});zs.parseProxyResponse=void 0;var HF=FF(Ae()),vu=(0,HF.default)("https-proxy-agent:parse-proxy-response");function qF(r){return new Promise((e,t)=>{let n=0,i=[];function s(){let u=r.read();u?l(u):r.once("readable",s)}function o(){r.removeListener("end",a),r.removeListener("error",c),r.removeListener("readable",s)}function a(){o(),vu("onend"),t(new Error("Proxy connection ended before receiving CONNECT response"))}function c(u){o(),vu("onerror %o",u),t(u)}function l(u){i.push(u),n+=u.length;let f=Buffer.concat(i,n),h=f.indexOf(`\r
|
|
99
99
|
\r
|
|
100
|
-
`);if(h===-1){
|
|
101
|
-
`),x=g.shift();if(!x)return r.destroy(),t(new Error("No header received from proxy CONNECT response"));let S=x.split(" "),
|
|
100
|
+
`);if(h===-1){vu("have not received end of HTTP headers yet..."),s();return}let g=f.slice(0,h).toString("ascii").split(`\r
|
|
101
|
+
`),x=g.shift();if(!x)return r.destroy(),t(new Error("No header received from proxy CONNECT response"));let S=x.split(" "),C=+S[1],R=S.slice(2).join(" "),M={};for(let I of g){if(!I)continue;let B=I.indexOf(":");if(B===-1)return r.destroy(),t(new Error(`Invalid header from proxy CONNECT response: "${I}"`));let V=I.slice(0,B).toLowerCase(),F=I.slice(B+1).trimStart(),G=M[V];typeof G=="string"?M[V]=[G,F]:Array.isArray(G)?G.push(F):M[V]=F}vu("got proxy server response: %o %o",x,M),o(),e({connect:{statusCode:C,statusText:R,headers:M},buffered:f})}r.on("error",c),r.on("end",a),s()})}zs.parseProxyResponse=qF});var _T=A(xr=>{"use strict";var UF=xr&&xr.__createBinding||(Object.create?(function(r,e,t,n){n===void 0&&(n=t);var i=Object.getOwnPropertyDescriptor(e,t);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(r,n,i)}):(function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]})),$F=xr&&xr.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),yT=xr&&xr.__importStar||function(r){if(r&&r.__esModule)return r;var e={};if(r!=null)for(var t in r)t!=="default"&&Object.prototype.hasOwnProperty.call(r,t)&&UF(e,r,t);return $F(e,r),e},xT=xr&&xr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(xr,"__esModule",{value:!0});xr.HttpsProxyAgent=void 0;var yu=yT(require("net")),mT=yT(require("tls")),WF=xT(require("assert")),GF=xT(Ae()),zF=dT(),VF=require("url"),KF=hT(),ua=(0,GF.default)("https-proxy-agent"),gT=r=>r.servername===void 0&&r.host&&!yu.isIP(r.host)?{...r,servername:r.host}:r,xu=class extends zF.Agent{constructor(e,t){super(t),this.options={path:void 0},this.proxy=typeof e=="string"?new VF.URL(e):e,this.proxyHeaders=t?.headers??{},ua("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),i=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...t?vT(t,"headers"):null,host:n,port:i}}async connect(e,t){let{proxy:n}=this;if(!t.host)throw new TypeError('No "host" provided');let i;n.protocol==="https:"?(ua("Creating `tls.Socket`: %o",this.connectOpts),i=mT.connect(gT(this.connectOpts))):(ua("Creating `net.Socket`: %o",this.connectOpts),i=yu.connect(this.connectOpts));let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},o=yu.isIPv6(t.host)?`[${t.host}]`:t.host,a=`CONNECT ${o}:${t.port} HTTP/1.1\r
|
|
102
102
|
`;if(n.username||n.password){let h=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(h).toString("base64")}`}s.Host=`${o}:${t.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let h of Object.keys(s))a+=`${h}: ${s[h]}\r
|
|
103
|
-
`;let c=(0,
|
|
104
|
-
`);let{connect:l,buffered:u}=await c;if(e.emit("proxyConnect",l),this.emit("proxyConnect",l,e),l.statusCode===200)return e.once("socket",HF),t.secureEndpoint?(ca("Upgrading socket connection to TLS"),oT.connect({...cT(aT(t),"host","path","port"),socket:i})):i;i.destroy();let f=new vu.Socket({writable:!1});return f.readable=!0,e.once("socket",h=>{ca("Replaying proxy buffer for failed request"),(0,DF.default)(h.listenerCount("data")>0),h.push(u),h.push(null)}),f}};yu.protocols=["http","https"];yr.HttpsProxyAgent=yu;function HF(r){r.resume()}function cT(r,...e){let t={},n;for(n in r)e.includes(n)||(t[n]=r[n]);return t}});var gT=A((BG,mT)=>{"use strict";var dT=require("url"),hT=require("https"),qF=bm(),xu=vm(),UF=_m(),er=fu(),$F=mm(),fT=2419200,Sm="",Em;function la(){}la.prototype.setGCMAPIKey=function(r){if(r===null){Sm=null;return}if(typeof r>"u"||typeof r!="string"||r.length===0)throw new Error("The GCM API Key should be a non-empty string or null.");Sm=r};la.prototype.setVapidDetails=function(r,e,t){if(arguments.length===1&&arguments[0]===null){Em=null;return}xu.validateSubject(r),xu.validatePublicKey(e),xu.validatePrivateKey(t),Em={subject:r,publicKey:e,privateKey:t}};la.prototype.generateRequestDetails=function(r,e,t){if(!r||!r.endpoint)throw new Error("You must pass in a subscription with at least an endpoint.");if(typeof r.endpoint!="string"||r.endpoint.length===0)throw new Error("The subscription endpoint must be a string with a valid URL.");if(e&&(typeof r!="object"||!r.keys||!r.keys.p256dh||!r.keys.auth))throw new Error("To send a message with a payload, the subscription must have 'auth' and 'p256dh' keys.");let n=Sm,i=Em,s=fT,o={},a=er.supportedContentEncodings.AES_128_GCM,c=er.supportedUrgency.NORMAL,l,u,f,h;if(t){let R=["headers","gcmAPIKey","vapidDetails","TTL","contentEncoding","urgency","topic","proxy","agent","timeout"],M=Object.keys(t);for(let I=0;I<M.length;I+=1){let B=M[I];if(!R.includes(B))throw new Error("'"+B+"' is an invalid option. The valid options are ['"+R.join("', '")+"'].")}if(t.headers){o=t.headers;let I=Object.keys(o).filter(function(B){return typeof t[B]<"u"});if(I.length>0)throw new Error("Duplicated headers defined ["+I.join(",")+"]. Please either define the header in thetop level options OR in the 'headers' key.")}if(t.gcmAPIKey&&(n=t.gcmAPIKey),t.vapidDetails!==void 0&&(i=t.vapidDetails),t.TTL!==void 0&&(s=Number(t.TTL),s<0))throw new Error("TTL should be a number and should be at least 0");if(t.contentEncoding)if(t.contentEncoding===er.supportedContentEncodings.AES_128_GCM||t.contentEncoding===er.supportedContentEncodings.AES_GCM)a=t.contentEncoding;else throw new Error("Unsupported content encoding specified.");if(t.urgency)if(t.urgency===er.supportedUrgency.VERY_LOW||t.urgency===er.supportedUrgency.LOW||t.urgency===er.supportedUrgency.NORMAL||t.urgency===er.supportedUrgency.HIGH)c=t.urgency;else throw new Error("Unsupported urgency specified.");if(t.topic){if(!$F.validate(t.topic))throw new Error("Unsupported characters set use the URL or filename-safe Base64 characters set");if(t.topic.length>32)throw new Error("use maximum of 32 characters from the URL or filename-safe Base64 characters set");l=t.topic}t.proxy&&(typeof t.proxy=="string"||typeof t.proxy.host=="string"?u=t.proxy:console.warn("Attempt to use proxy option, but invalid type it should be a string or proxy options object.")),t.agent&&(t.agent instanceof hT.Agent?(u&&console.warn("Agent option will be ignored because proxy option is defined."),f=t.agent):console.warn("Wrong type for the agent option, it should be an instance of https.Agent.")),typeof t.timeout=="number"&&(h=t.timeout)}typeof s>"u"&&(s=fT);let g={method:"POST",headers:{TTL:s}};Object.keys(o).forEach(function(R){g.headers[R]=o[R]});let x=null;if(e){let R=UF.encrypt(r.keys.p256dh,r.keys.auth,e,a);g.headers["Content-Length"]=R.cipherText.length,g.headers["Content-Type"]="application/octet-stream",a===er.supportedContentEncodings.AES_128_GCM?g.headers["Content-Encoding"]=er.supportedContentEncodings.AES_128_GCM:a===er.supportedContentEncodings.AES_GCM&&(g.headers["Content-Encoding"]=er.supportedContentEncodings.AES_GCM,g.headers.Encryption="salt="+R.salt,g.headers["Crypto-Key"]="dh="+R.localPublicKey.toString("base64url")),x=R.cipherText}else g.headers["Content-Length"]=0;let S=r.endpoint.startsWith("https://android.googleapis.com/gcm/send"),k=r.endpoint.startsWith("https://fcm.googleapis.com/fcm/send");if(S)n?g.headers.Authorization="key="+n:console.warn("Attempt to send push notification to GCM endpoint, but no GCM key is defined. Please use setGCMApiKey() or add 'gcmAPIKey' as an option.");else if(i){let R=dT.parse(r.endpoint),M=R.protocol+"//"+R.host,I=xu.getVapidHeaders(M,i.subject,i.publicKey,i.privateKey,a);g.headers.Authorization=I.Authorization,a===er.supportedContentEncodings.AES_GCM&&(g.headers["Crypto-Key"]?g.headers["Crypto-Key"]+=";"+I["Crypto-Key"]:g.headers["Crypto-Key"]=I["Crypto-Key"])}else k&&n&&(g.headers.Authorization="key="+n);return g.headers.Urgency=c,l&&(g.headers.Topic=l),g.body=x,g.endpoint=r.endpoint,u&&(g.proxy=u),f&&(g.agent=f),h&&(g.timeout=h),g};la.prototype.sendNotification=function(r,e,t){let n;try{n=this.generateRequestDetails(r,e,t)}catch(i){return Promise.reject(i)}return new Promise(function(i,s){let o={},a=dT.parse(n.endpoint);if(o.hostname=a.hostname,o.port=a.port,o.path=a.path,o.headers=n.headers,o.method=n.method,n.timeout&&(o.timeout=n.timeout),n.agent&&(o.agent=n.agent),n.proxy){let{HttpsProxyAgent:l}=pT();o.agent=new l(n.proxy)}let c=hT.request(o,function(l){let u="";l.on("data",function(f){u+=f}),l.on("end",function(){l.statusCode<200||l.statusCode>299?s(new qF("Received unexpected response code",l.statusCode,l.headers,u,n.endpoint)):i({statusCode:l.statusCode,body:u,headers:l.headers})})});n.timeout&&c.on("timeout",function(){c.destroy(new Error("Socket timeout"))}),c.on("error",function(l){s(l)}),n.body&&c.write(n.body),c.end()})};mT.exports=la});var xT=A((jG,yT)=>{"use strict";var vT=vm(),WF=_m(),GF=gT(),zF=bm(),VF=fu(),ua=new GF;yT.exports={WebPushError:zF,supportedContentEncodings:VF.supportedContentEncodings,encrypt:WF.encrypt,getVapidHeaders:vT.getVapidHeaders,generateVAPIDKeys:vT.generateVAPIDKeys,setGCMAPIKey:ua.setGCMAPIKey,setVapidDetails:ua.setVapidDetails,generateRequestDetails:ua.generateRequestDetails,sendNotification:ua.sendNotification.bind(ua)}});var ma=A((mz,sC)=>{"use strict";var F3=require("path"),Zr="\\\\/",tC=`[^${Zr}]`,H3=0,Sn="\\.",q3="\\+",U3="\\?",Cu="\\/",$3="(?=.)",rC="[^/]",Rm=`(?:${Cu}|$)`,nC=`(?:^|${Cu})`,Om=`${Sn}{1,2}${Rm}`,W3=`(?!${Sn})`,G3=`(?!${nC}${Om})`,z3=`(?!${Sn}{0,1}${Rm})`,V3=`(?!${Om})`,K3=`[^.${Cu}]`,Y3=`${rC}*?`,iC={DOT_LITERAL:Sn,PLUS_LITERAL:q3,QMARK_LITERAL:U3,SLASH_LITERAL:Cu,ONE_CHAR:$3,QMARK:rC,END_ANCHOR:Rm,DOTS_SLASH:Om,NO_DOT:W3,NO_DOTS:G3,NO_DOT_SLASH:z3,NO_DOTS_SLASH:V3,QMARK_NO_DOT:K3,STAR:Y3,START_ANCHOR:nC},J3={...iC,SLASH_LITERAL:`[${Zr}]`,QMARK:tC,STAR:`${tC}*?`,DOTS_SLASH:`${Sn}{1,2}(?:[${Zr}]|$)`,NO_DOT:`(?!${Sn})`,NO_DOTS:`(?!(?:^|[${Zr}])${Sn}{1,2}(?:[${Zr}]|$))`,NO_DOT_SLASH:`(?!${Sn}{0,1}(?:[${Zr}]|$))`,NO_DOTS_SLASH:`(?!${Sn}{1,2}(?:[${Zr}]|$))`,QMARK_NO_DOT:`[^.${Zr}]`,START_ANCHOR:`(?:^|[${Zr}])`,END_ANCHOR:`(?:[${Zr}]|$)`},X3={__proto__:null,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"};sC.exports={DEFAULT_MAX_EXTGLOB_RECURSION:H3,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:X3,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:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},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:F3.sep,extglobChars(r){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${r.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(r){return r===!0?J3:iC}}});var ku=A(Wt=>{"use strict";var Z3=require("path"),Q3=process.platform==="win32",{REGEX_BACKSLASH:eH,REGEX_REMOVE_BACKSLASH:tH,REGEX_SPECIAL_CHARS:rH,REGEX_SPECIAL_CHARS_GLOBAL:nH}=ma();Wt.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r);Wt.hasRegexChars=r=>rH.test(r);Wt.isRegexChar=r=>r.length===1&&Wt.hasRegexChars(r);Wt.escapeRegex=r=>r.replace(nH,"\\$1");Wt.toPosixSlashes=r=>r.replace(eH,"/");Wt.removeBackslashes=r=>r.replace(tH,e=>e==="\\"?"":e);Wt.supportsLookbehinds=()=>{let r=process.version.slice(1).split(".").map(Number);return r.length===3&&r[0]>=9||r[0]===8&&r[1]>=10};Wt.isWindows=r=>r&&typeof r.windows=="boolean"?r.windows:Q3===!0||Z3.sep==="\\";Wt.escapeLast=(r,e,t)=>{let n=r.lastIndexOf(e,t);return n===-1?r:r[n-1]==="\\"?Wt.escapeLast(r,e,n-1):`${r.slice(0,n)}\\${r.slice(n)}`};Wt.removePrefix=(r,e={})=>{let t=r;return t.startsWith("./")&&(t=t.slice(2),e.prefix="./"),t};Wt.wrapOutput=(r,e={},t={})=>{let n=t.contains?"":"^",i=t.contains?"":"$",s=`${n}(?:${r})${i}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}});var dC=A((vz,fC)=>{"use strict";var oC=ku(),{CHAR_ASTERISK:Mm,CHAR_AT:iH,CHAR_BACKWARD_SLASH:ga,CHAR_COMMA:sH,CHAR_DOT:Pm,CHAR_EXCLAMATION_MARK:Im,CHAR_FORWARD_SLASH:pC,CHAR_LEFT_CURLY_BRACE:Nm,CHAR_LEFT_PARENTHESES:Dm,CHAR_LEFT_SQUARE_BRACKET:oH,CHAR_PLUS:aH,CHAR_QUESTION_MARK:aC,CHAR_RIGHT_CURLY_BRACE:cH,CHAR_RIGHT_PARENTHESES:cC,CHAR_RIGHT_SQUARE_BRACKET:lH}=ma(),lC=r=>r===pC||r===ga,uC=r=>{r.isPrefix!==!0&&(r.depth=r.isGlobstar?1/0:1)},uH=(r,e)=>{let t=e||{},n=r.length-1,i=t.parts===!0||t.scanToEnd===!0,s=[],o=[],a=[],c=r,l=-1,u=0,f=0,h=!1,g=!1,x=!1,S=!1,k=!1,R=!1,M=!1,I=!1,B=!1,V=!1,F=0,G,D,U={value:"",depth:0,isGlob:!1},T=()=>l>=n,p=()=>c.charCodeAt(l+1),m=()=>(G=D,c.charCodeAt(++l));for(;l<n;){D=m();let C;if(D===ga){M=U.backslashes=!0,D=m(),D===Nm&&(R=!0);continue}if(R===!0||D===Nm){for(F++;T()!==!0&&(D=m());){if(D===ga){M=U.backslashes=!0,m();continue}if(D===Nm){F++;continue}if(R!==!0&&D===Pm&&(D=m())===Pm){if(h=U.isBrace=!0,x=U.isGlob=!0,V=!0,i===!0)continue;break}if(R!==!0&&D===sH){if(h=U.isBrace=!0,x=U.isGlob=!0,V=!0,i===!0)continue;break}if(D===cH&&(F--,F===0)){R=!1,h=U.isBrace=!0,V=!0;break}}if(i===!0)continue;break}if(D===pC){if(s.push(l),o.push(U),U={value:"",depth:0,isGlob:!1},V===!0)continue;if(G===Pm&&l===u+1){u+=2;continue}f=l+1;continue}if(t.noext!==!0&&(D===aH||D===iH||D===Mm||D===aC||D===Im)===!0&&p()===Dm){if(x=U.isGlob=!0,S=U.isExtglob=!0,V=!0,D===Im&&l===u&&(B=!0),i===!0){for(;T()!==!0&&(D=m());){if(D===ga){M=U.backslashes=!0,D=m();continue}if(D===cC){x=U.isGlob=!0,V=!0;break}}continue}break}if(D===Mm){if(G===Mm&&(k=U.isGlobstar=!0),x=U.isGlob=!0,V=!0,i===!0)continue;break}if(D===aC){if(x=U.isGlob=!0,V=!0,i===!0)continue;break}if(D===oH){for(;T()!==!0&&(C=m());){if(C===ga){M=U.backslashes=!0,m();continue}if(C===lH){g=U.isBracket=!0,x=U.isGlob=!0,V=!0;break}}if(i===!0)continue;break}if(t.nonegate!==!0&&D===Im&&l===u){I=U.negated=!0,u++;continue}if(t.noparen!==!0&&D===Dm){if(x=U.isGlob=!0,i===!0){for(;T()!==!0&&(D=m());){if(D===Dm){M=U.backslashes=!0,D=m();continue}if(D===cC){V=!0;break}}continue}break}if(x===!0){if(V=!0,i===!0)continue;break}}t.noext===!0&&(S=!1,x=!1);let y=c,w="",v="";u>0&&(w=c.slice(0,u),c=c.slice(u),f-=u),y&&x===!0&&f>0?(y=c.slice(0,f),v=c.slice(f)):x===!0?(y="",v=c):y=c,y&&y!==""&&y!=="/"&&y!==c&&lC(y.charCodeAt(y.length-1))&&(y=y.slice(0,-1)),t.unescape===!0&&(v&&(v=oC.removeBackslashes(v)),y&&M===!0&&(y=oC.removeBackslashes(y)));let _={prefix:w,input:r,start:u,base:y,glob:v,isBrace:h,isBracket:g,isGlob:x,isExtglob:S,isGlobstar:k,negated:I,negatedExtglob:B};if(t.tokens===!0&&(_.maxDepth=0,lC(D)||o.push(U),_.tokens=o),t.parts===!0||t.tokens===!0){let C;for(let b=0;b<s.length;b++){let d=C?C+1:u,E=s[b],q=r.slice(d,E);t.tokens&&(b===0&&u!==0?(o[b].isPrefix=!0,o[b].value=w):o[b].value=q,uC(o[b]),_.maxDepth+=o[b].depth),(b!==0||q!=="")&&a.push(q),C=E}if(C&&C+1<r.length){let b=r.slice(C+1);a.push(b),t.tokens&&(o[o.length-1].value=b,uC(o[o.length-1]),_.maxDepth+=o[o.length-1].depth)}_.slashes=s,_.parts=a}return _};fC.exports=uH});var yC=A((yz,vC)=>{"use strict";var va=ma(),Tt=ku(),{MAX_LENGTH:Au,POSIX_REGEX_SOURCE:pH,REGEX_NON_SPECIAL_CHARS:fH,REGEX_SPECIAL_CHARS_BACKREF:dH,REPLACEMENTS:hC}=va,hH=(r,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...r,e);r.sort();let t=`[${r.join("-")}]`;try{new RegExp(t)}catch{return r.map(i=>Tt.escapeRegex(i)).join("..")}return t},zs=(r,e)=>`Missing ${r}: "${e}" - use "\\\\${e}" to match literal characters`,mC=r=>{let e=[],t=0,n=0,i=0,s="",o=!1;for(let a of r){if(o===!0){s+=a,o=!1;continue}if(a==="\\"){s+=a,o=!0;continue}if(a==='"'){i=i===1?0:1,s+=a;continue}if(i===0){if(a==="[")t++;else if(a==="]"&&t>0)t--;else if(t===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(s),s="";continue}}}s+=a}return e.push(s),e},mH=r=>{let e=!1;for(let t of r){if(e===!0){e=!1;continue}if(t==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(t))return!1}return!0},gC=r=>{let e=r.trim(),t=!0;for(;t===!0;)t=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),t=!0);if(mH(e))return e.replace(/\\(.)/g,"$1")},gH=r=>{let e=r.map(gC).filter(Boolean);for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++){let i=e[t],s=e[n],o=i[0];if(!(!o||i!==o.repeat(i.length)||s!==o.repeat(s.length))&&(i===s||i.startsWith(s)||s.startsWith(i)))return!0}return!1},Lm=(r,e=!0)=>{if(r[0]!=="+"&&r[0]!=="*"||r[1]!=="(")return;let t=0,n=0,i=0,s=!1;for(let o=1;o<r.length;o++){let a=r[o];if(s===!0){s=!1;continue}if(a==="\\"){s=!0;continue}if(a==='"'){i=i===1?0:1;continue}if(i!==1){if(a==="["){t++;continue}if(a==="]"&&t>0){t--;continue}if(!(t>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&o!==r.length-1?void 0:{type:r[0],body:r.slice(2,o),end:o}}}}},vH=r=>{let e=0,t=[];for(;e<r.length;){let i=Lm(r.slice(e),!1);if(!i||i.type!=="*")return;let s=mC(i.body).map(a=>a.trim());if(s.length!==1)return;let o=gC(s[0]);if(!o||o.length!==1)return;t.push(o),e+=i.end+1}return t.length<1?void 0:`${t.length===1?Tt.escapeRegex(t[0]):`[${t.map(i=>Tt.escapeRegex(i)).join("")}]`}*`},yH=r=>{let e=0,t=r.trim(),n=Lm(t);for(;n;)e++,t=n.body.trim(),n=Lm(t);return e},xH=(r,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let t=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:va.DEFAULT_MAX_EXTGLOB_RECURSION,n=mC(r).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||gH(n)))return{risky:!0};for(let i of n){let s=vH(i);if(s)return{risky:!0,safeOutput:s};if(yH(i)>t)return{risky:!0}}return{risky:!1}},Bm=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a string");r=hC[r]||r;let t={...e},n=typeof t.maxLength=="number"?Math.min(Au,t.maxLength):Au,i=r.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let s={type:"bos",value:"",output:t.prepend||""},o=[s],a=t.capture?"":"?:",c=Tt.isWindows(e),l=va.globChars(c),u=va.extglobChars(l),{DOT_LITERAL:f,PLUS_LITERAL:h,SLASH_LITERAL:g,ONE_CHAR:x,DOTS_SLASH:S,NO_DOT:k,NO_DOT_SLASH:R,NO_DOTS_SLASH:M,QMARK:I,QMARK_NO_DOT:B,STAR:V,START_ANCHOR:F}=l,G=N=>`(${a}(?:(?!${F}${N.dot?S:f}).)*?)`,D=t.dot?"":k,U=t.dot?I:B,T=t.bash===!0?G(t):V;t.capture&&(T=`(${T})`),typeof t.noext=="boolean"&&(t.noextglob=t.noext);let p={input:r,index:-1,start:0,dot:t.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};r=Tt.removePrefix(r,p),i=r.length;let m=[],y=[],w=[],v=s,_,C=()=>p.index===i-1,b=p.peek=(N=1)=>r[p.index+N],d=p.advance=()=>r[++p.index]||"",E=()=>r.slice(p.index+1),q=(N="",te=0)=>{p.consumed+=N,p.index+=te},O=N=>{p.output+=N.output!=null?N.output:N.value,q(N.value)},P=()=>{let N=1;for(;b()==="!"&&(b(2)!=="("||b(3)==="?");)d(),p.start++,N++;return N%2===0?!1:(p.negated=!0,p.start++,!0)},j=N=>{p[N]++,w.push(N)},z=N=>{p[N]--,w.pop()},H=N=>{if(v.type==="globstar"){let te=p.braces>0&&(N.type==="comma"||N.type==="brace"),L=N.extglob===!0||m.length&&(N.type==="pipe"||N.type==="paren");N.type!=="slash"&&N.type!=="paren"&&!te&&!L&&(p.output=p.output.slice(0,-v.output.length),v.type="star",v.value="*",v.output=T,p.output+=v.output)}if(m.length&&N.type!=="paren"&&(m[m.length-1].inner+=N.value),(N.value||N.output)&&O(N),v&&v.type==="text"&&N.type==="text"){v.value+=N.value,v.output=(v.output||"")+N.value;return}N.prev=v,o.push(N),v=N},ke=(N,te)=>{let L={...u[te],conditions:1,inner:""};L.prev=v,L.parens=p.parens,L.output=p.output,L.startIndex=p.index,L.tokensIndex=o.length;let W=(t.capture?"(":"")+L.open;j("parens"),H({type:N,value:te,output:p.output?"":x}),H({type:"paren",extglob:!0,value:d(),output:W}),m.push(L)},ne=N=>{let te=r.slice(N.startIndex,p.index+1),L=r.slice(N.startIndex+2,p.index),W=xH(L,t);if((N.type==="plus"||N.type==="star")&&W.risky){let J=W.safeOutput?(N.output?"":x)+(t.capture?`(${W.safeOutput})`:W.safeOutput):void 0,kt=o[N.tokensIndex];kt.type="text",kt.value=te,kt.output=J||Tt.escapeRegex(te);for(let ae=N.tokensIndex+1;ae<o.length;ae++)o[ae].value="",o[ae].output="",delete o[ae].suffix;p.output=N.output+kt.output,p.backtrack=!0,H({type:"paren",extglob:!0,value:_,output:""}),z("parens");return}let oe=N.close+(t.capture?")":""),Z;if(N.type==="negate"){let J=T;if(N.inner&&N.inner.length>1&&N.inner.includes("/")&&(J=G(t)),(J!==T||C()||/^\)+$/.test(E()))&&(oe=N.close=`)$))${J}`),N.inner.includes("*")&&(Z=E())&&/^\.[^\\/.]+$/.test(Z)){let kt=Bm(Z,{...e,fastpaths:!1}).output;oe=N.close=`)${kt})${J})`}N.prev.type==="bos"&&(p.negatedExtglob=!0)}H({type:"paren",extglob:!0,value:_,output:oe}),z("parens")};if(t.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(r)){let N=!1,te=r.replace(dH,(L,W,oe,Z,J,kt)=>Z==="\\"?(N=!0,L):Z==="?"?W?W+Z+(J?I.repeat(J.length):""):kt===0?U+(J?I.repeat(J.length):""):I.repeat(oe.length):Z==="."?f.repeat(oe.length):Z==="*"?W?W+Z+(J?T:""):T:W?L:`\\${L}`);return N===!0&&(t.unescape===!0?te=te.replace(/\\/g,""):te=te.replace(/\\+/g,L=>L.length%2===0?"\\\\":L?"\\":"")),te===r&&t.contains===!0?(p.output=r,p):(p.output=Tt.wrapOutput(te,p,e),p)}for(;!C();){if(_=d(),_==="\0")continue;if(_==="\\"){let L=b();if(L==="/"&&t.bash!==!0||L==="."||L===";")continue;if(!L){_+="\\",H({type:"text",value:_});continue}let W=/^\\+/.exec(E()),oe=0;if(W&&W[0].length>2&&(oe=W[0].length,p.index+=oe,oe%2!==0&&(_+="\\")),t.unescape===!0?_=d():_+=d(),p.brackets===0){H({type:"text",value:_});continue}}if(p.brackets>0&&(_!=="]"||v.value==="["||v.value==="[^")){if(t.posix!==!1&&_===":"){let L=v.value.slice(1);if(L.includes("[")&&(v.posix=!0,L.includes(":"))){let W=v.value.lastIndexOf("["),oe=v.value.slice(0,W),Z=v.value.slice(W+2),J=pH[Z];if(J){v.value=oe+J,p.backtrack=!0,d(),!s.output&&o.indexOf(v)===1&&(s.output=x);continue}}}(_==="["&&b()!==":"||_==="-"&&b()==="]")&&(_=`\\${_}`),_==="]"&&(v.value==="["||v.value==="[^")&&(_=`\\${_}`),t.posix===!0&&_==="!"&&v.value==="["&&(_="^"),v.value+=_,O({value:_});continue}if(p.quotes===1&&_!=='"'){_=Tt.escapeRegex(_),v.value+=_,O({value:_});continue}if(_==='"'){p.quotes=p.quotes===1?0:1,t.keepQuotes===!0&&H({type:"text",value:_});continue}if(_==="("){j("parens"),H({type:"paren",value:_});continue}if(_===")"){if(p.parens===0&&t.strictBrackets===!0)throw new SyntaxError(zs("opening","("));let L=m[m.length-1];if(L&&p.parens===L.parens+1){ne(m.pop());continue}H({type:"paren",value:_,output:p.parens?")":"\\)"}),z("parens");continue}if(_==="["){if(t.nobracket===!0||!E().includes("]")){if(t.nobracket!==!0&&t.strictBrackets===!0)throw new SyntaxError(zs("closing","]"));_=`\\${_}`}else j("brackets");H({type:"bracket",value:_});continue}if(_==="]"){if(t.nobracket===!0||v&&v.type==="bracket"&&v.value.length===1){H({type:"text",value:_,output:`\\${_}`});continue}if(p.brackets===0){if(t.strictBrackets===!0)throw new SyntaxError(zs("opening","["));H({type:"text",value:_,output:`\\${_}`});continue}z("brackets");let L=v.value.slice(1);if(v.posix!==!0&&L[0]==="^"&&!L.includes("/")&&(_=`/${_}`),v.value+=_,O({value:_}),t.literalBrackets===!1||Tt.hasRegexChars(L))continue;let W=Tt.escapeRegex(v.value);if(p.output=p.output.slice(0,-v.value.length),t.literalBrackets===!0){p.output+=W,v.value=W;continue}v.value=`(${a}${W}|${v.value})`,p.output+=v.value;continue}if(_==="{"&&t.nobrace!==!0){j("braces");let L={type:"brace",value:_,output:"(",outputIndex:p.output.length,tokensIndex:p.tokens.length};y.push(L),H(L);continue}if(_==="}"){let L=y[y.length-1];if(t.nobrace===!0||!L){H({type:"text",value:_,output:_});continue}let W=")";if(L.dots===!0){let oe=o.slice(),Z=[];for(let J=oe.length-1;J>=0&&(o.pop(),oe[J].type!=="brace");J--)oe[J].type!=="dots"&&Z.unshift(oe[J].value);W=hH(Z,t),p.backtrack=!0}if(L.comma!==!0&&L.dots!==!0){let oe=p.output.slice(0,L.outputIndex),Z=p.tokens.slice(L.tokensIndex);L.value=L.output="\\{",_=W="\\}",p.output=oe;for(let J of Z)p.output+=J.output||J.value}H({type:"brace",value:_,output:W}),z("braces"),y.pop();continue}if(_==="|"){m.length>0&&m[m.length-1].conditions++,H({type:"text",value:_});continue}if(_===","){let L=_,W=y[y.length-1];W&&w[w.length-1]==="braces"&&(W.comma=!0,L="|"),H({type:"comma",value:_,output:L});continue}if(_==="/"){if(v.type==="dot"&&p.index===p.start+1){p.start=p.index+1,p.consumed="",p.output="",o.pop(),v=s;continue}H({type:"slash",value:_,output:g});continue}if(_==="."){if(p.braces>0&&v.type==="dot"){v.value==="."&&(v.output=f);let L=y[y.length-1];v.type="dots",v.output+=_,v.value+=_,L.dots=!0;continue}if(p.braces+p.parens===0&&v.type!=="bos"&&v.type!=="slash"){H({type:"text",value:_,output:f});continue}H({type:"dot",value:_,output:f});continue}if(_==="?"){if(!(v&&v.value==="(")&&t.noextglob!==!0&&b()==="("&&b(2)!=="?"){ke("qmark",_);continue}if(v&&v.type==="paren"){let W=b(),oe=_;if(W==="<"&&!Tt.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(v.value==="("&&!/[!=<:]/.test(W)||W==="<"&&!/<([!=]|\w+>)/.test(E()))&&(oe=`\\${_}`),H({type:"text",value:_,output:oe});continue}if(t.dot!==!0&&(v.type==="slash"||v.type==="bos")){H({type:"qmark",value:_,output:B});continue}H({type:"qmark",value:_,output:I});continue}if(_==="!"){if(t.noextglob!==!0&&b()==="("&&(b(2)!=="?"||!/[!=<:]/.test(b(3)))){ke("negate",_);continue}if(t.nonegate!==!0&&p.index===0){P();continue}}if(_==="+"){if(t.noextglob!==!0&&b()==="("&&b(2)!=="?"){ke("plus",_);continue}if(v&&v.value==="("||t.regex===!1){H({type:"plus",value:_,output:h});continue}if(v&&(v.type==="bracket"||v.type==="paren"||v.type==="brace")||p.parens>0){H({type:"plus",value:_});continue}H({type:"plus",value:h});continue}if(_==="@"){if(t.noextglob!==!0&&b()==="("&&b(2)!=="?"){H({type:"at",extglob:!0,value:_,output:""});continue}H({type:"text",value:_});continue}if(_!=="*"){(_==="$"||_==="^")&&(_=`\\${_}`);let L=fH.exec(E());L&&(_+=L[0],p.index+=L[0].length),H({type:"text",value:_});continue}if(v&&(v.type==="globstar"||v.star===!0)){v.type="star",v.star=!0,v.value+=_,v.output=T,p.backtrack=!0,p.globstar=!0,q(_);continue}let N=E();if(t.noextglob!==!0&&/^\([^?]/.test(N)){ke("star",_);continue}if(v.type==="star"){if(t.noglobstar===!0){q(_);continue}let L=v.prev,W=L.prev,oe=L.type==="slash"||L.type==="bos",Z=W&&(W.type==="star"||W.type==="globstar");if(t.bash===!0&&(!oe||N[0]&&N[0]!=="/")){H({type:"star",value:_,output:""});continue}let J=p.braces>0&&(L.type==="comma"||L.type==="brace"),kt=m.length&&(L.type==="pipe"||L.type==="paren");if(!oe&&L.type!=="paren"&&!J&&!kt){H({type:"star",value:_,output:""});continue}for(;N.slice(0,3)==="/**";){let ae=r[p.index+4];if(ae&&ae!=="/")break;N=N.slice(3),q("/**",3)}if(L.type==="bos"&&C()){v.type="globstar",v.value+=_,v.output=G(t),p.output=v.output,p.globstar=!0,q(_);continue}if(L.type==="slash"&&L.prev.type!=="bos"&&!Z&&C()){p.output=p.output.slice(0,-(L.output+v.output).length),L.output=`(?:${L.output}`,v.type="globstar",v.output=G(t)+(t.strictSlashes?")":"|$)"),v.value+=_,p.globstar=!0,p.output+=L.output+v.output,q(_);continue}if(L.type==="slash"&&L.prev.type!=="bos"&&N[0]==="/"){let ae=N[1]!==void 0?"|$":"";p.output=p.output.slice(0,-(L.output+v.output).length),L.output=`(?:${L.output}`,v.type="globstar",v.output=`${G(t)}${g}|${g}${ae})`,v.value+=_,p.output+=L.output+v.output,p.globstar=!0,q(_+d()),H({type:"slash",value:"/",output:""});continue}if(L.type==="bos"&&N[0]==="/"){v.type="globstar",v.value+=_,v.output=`(?:^|${g}|${G(t)}${g})`,p.output=v.output,p.globstar=!0,q(_+d()),H({type:"slash",value:"/",output:""});continue}p.output=p.output.slice(0,-v.output.length),v.type="globstar",v.output=G(t),v.value+=_,p.output+=v.output,p.globstar=!0,q(_);continue}let te={type:"star",value:_,output:T};if(t.bash===!0){te.output=".*?",(v.type==="bos"||v.type==="slash")&&(te.output=D+te.output),H(te);continue}if(v&&(v.type==="bracket"||v.type==="paren")&&t.regex===!0){te.output=_,H(te);continue}(p.index===p.start||v.type==="slash"||v.type==="dot")&&(v.type==="dot"?(p.output+=R,v.output+=R):t.dot===!0?(p.output+=M,v.output+=M):(p.output+=D,v.output+=D),b()!=="*"&&(p.output+=x,v.output+=x)),H(te)}for(;p.brackets>0;){if(t.strictBrackets===!0)throw new SyntaxError(zs("closing","]"));p.output=Tt.escapeLast(p.output,"["),z("brackets")}for(;p.parens>0;){if(t.strictBrackets===!0)throw new SyntaxError(zs("closing",")"));p.output=Tt.escapeLast(p.output,"("),z("parens")}for(;p.braces>0;){if(t.strictBrackets===!0)throw new SyntaxError(zs("closing","}"));p.output=Tt.escapeLast(p.output,"{"),z("braces")}if(t.strictSlashes!==!0&&(v.type==="star"||v.type==="bracket")&&H({type:"maybe_slash",value:"",output:`${g}?`}),p.backtrack===!0){p.output="";for(let N of p.tokens)p.output+=N.output!=null?N.output:N.value,N.suffix&&(p.output+=N.suffix)}return p};Bm.fastpaths=(r,e)=>{let t={...e},n=typeof t.maxLength=="number"?Math.min(Au,t.maxLength):Au,i=r.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);r=hC[r]||r;let s=Tt.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:l,NO_DOT:u,NO_DOTS:f,NO_DOTS_SLASH:h,STAR:g,START_ANCHOR:x}=va.globChars(s),S=t.dot?f:u,k=t.dot?h:u,R=t.capture?"":"?:",M={negated:!1,prefix:""},I=t.bash===!0?".*?":g;t.capture&&(I=`(${I})`);let B=D=>D.noglobstar===!0?I:`(${R}(?:(?!${x}${D.dot?l:o}).)*?)`,V=D=>{switch(D){case"*":return`${S}${c}${I}`;case".*":return`${o}${c}${I}`;case"*.*":return`${S}${I}${o}${c}${I}`;case"*/*":return`${S}${I}${a}${c}${k}${I}`;case"**":return S+B(t);case"**/*":return`(?:${S}${B(t)}${a})?${k}${c}${I}`;case"**/*.*":return`(?:${S}${B(t)}${a})?${k}${I}${o}${c}${I}`;case"**/.*":return`(?:${S}${B(t)}${a})?${o}${c}${I}`;default:{let U=/^(.*?)\.(\w+)$/.exec(D);if(!U)return;let T=V(U[1]);return T?T+o+U[2]:void 0}}},F=Tt.removePrefix(r,M),G=V(F);return G&&t.strictSlashes!==!0&&(G+=`${a}?`),G};vC.exports=Bm});var _C=A((xz,xC)=>{"use strict";var _H=require("path"),bH=dC(),jm=yC(),Fm=ku(),wH=ma(),SH=r=>r&&typeof r=="object"&&!Array.isArray(r),Pe=(r,e,t=!1)=>{if(Array.isArray(r)){let u=r.map(h=>Pe(h,e,t));return h=>{for(let g of u){let x=g(h);if(x)return x}return!1}}let n=SH(r)&&r.tokens&&r.input;if(r===""||typeof r!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},s=Fm.isWindows(e),o=n?Pe.compileRe(r,e):Pe.makeRe(r,e,!1,!0),a=o.state;delete o.state;let c=()=>!1;if(i.ignore){let u={...e,ignore:null,onMatch:null,onResult:null};c=Pe(i.ignore,u,t)}let l=(u,f=!1)=>{let{isMatch:h,match:g,output:x}=Pe.test(u,o,e,{glob:r,posix:s}),S={glob:r,state:a,regex:o,posix:s,input:u,output:x,match:g,isMatch:h};return typeof i.onResult=="function"&&i.onResult(S),h===!1?(S.isMatch=!1,f?S:!1):c(u)?(typeof i.onIgnore=="function"&&i.onIgnore(S),S.isMatch=!1,f?S:!1):(typeof i.onMatch=="function"&&i.onMatch(S),f?S:!0)};return t&&(l.state=a),l};Pe.test=(r,e,t,{glob:n,posix:i}={})=>{if(typeof r!="string")throw new TypeError("Expected input to be a string");if(r==="")return{isMatch:!1,output:""};let s=t||{},o=s.format||(i?Fm.toPosixSlashes:null),a=r===n,c=a&&o?o(r):r;return a===!1&&(c=o?o(r):r,a=c===n),(a===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?a=Pe.matchBase(r,e,t,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Pe.matchBase=(r,e,t,n=Fm.isWindows(t))=>(e instanceof RegExp?e:Pe.makeRe(e,t)).test(_H.basename(r));Pe.isMatch=(r,e,t)=>Pe(e,t)(r);Pe.parse=(r,e)=>Array.isArray(r)?r.map(t=>Pe.parse(t,e)):jm(r,{...e,fastpaths:!1});Pe.scan=(r,e)=>bH(r,e);Pe.compileRe=(r,e,t=!1,n=!1)=>{if(t===!0)return r.output;let i=e||{},s=i.contains?"":"^",o=i.contains?"":"$",a=`${s}(?:${r.output})${o}`;r&&r.negated===!0&&(a=`^(?!${a}).*$`);let c=Pe.toRegex(a,e);return n===!0&&(c.state=r),c};Pe.makeRe=(r,e={},t=!1,n=!1)=>{if(!r||typeof r!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(r[0]==="."||r[0]==="*")&&(i.output=jm.fastpaths(r,e)),i.output||(i=jm(r,e)),Pe.compileRe(i,e,t,n)};Pe.toRegex=(r,e)=>{try{let t=e||{};return new RegExp(r,t.flags||(t.nocase?"i":""))}catch(t){if(e&&e.debug===!0)throw t;return/$^/}};Pe.constants=wH;xC.exports=Pe});var Hm=A((_z,bC)=>{"use strict";bC.exports=_C()});var RC=A((bz,AC)=>{"use strict";var xa=require("fs"),{Readable:EH}=require("stream"),ya=require("path"),{promisify:Pu}=require("util"),qm=Hm(),TH=Pu(xa.readdir),CH=Pu(xa.stat),wC=Pu(xa.lstat),kH=Pu(xa.realpath),AH="!",CC="READDIRP_RECURSIVE_ERROR",RH=new Set(["ENOENT","EPERM","EACCES","ELOOP",CC]),Um="files",kC="directories",Ou="files_directories",Ru="all",SC=[Um,kC,Ou,Ru],OH=r=>RH.has(r.code),[EC,MH]=process.versions.node.split(".").slice(0,2).map(r=>Number.parseInt(r,10)),PH=process.platform==="win32"&&(EC>10||EC===10&&MH>=5),TC=r=>{if(r!==void 0){if(typeof r=="function")return r;if(typeof r=="string"){let e=qm(r.trim());return t=>e(t.basename)}if(Array.isArray(r)){let e=[],t=[];for(let n of r){let i=n.trim();i.charAt(0)===AH?t.push(qm(i.slice(1))):e.push(qm(i))}return t.length>0?e.length>0?n=>e.some(i=>i(n.basename))&&!t.some(i=>i(n.basename)):n=>!t.some(i=>i(n.basename)):n=>e.some(i=>i(n.basename))}}},Mu=class r extends EH{static get defaultOptions(){return{root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:Um,lstat:!1,depth:2147483648,alwaysStat:!1}}constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark||4096});let t={...r.defaultOptions,...e},{root:n,type:i}=t;this._fileFilter=TC(t.fileFilter),this._directoryFilter=TC(t.directoryFilter);let s=t.lstat?wC:CH;PH?this._stat=o=>s(o,{bigint:!0}):this._stat=s,this._maxDepth=t.depth,this._wantsDir=[kC,Ou,Ru].includes(i),this._wantsFile=[Um,Ou,Ru].includes(i),this._wantsEverything=i===Ru,this._root=ya.resolve(n),this._isDirent="Dirent"in xa&&!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;){let{path:t,depth:n,files:i=[]}=this.parent||{};if(i.length>0){let s=i.splice(0,e).map(o=>this._formatEntry(o,t));for(let o of await Promise.all(s)){if(this.destroyed)return;let a=await this._getEntryType(o);a==="directory"&&this._directoryFilter(o)?(n<=this._maxDepth&&this.parents.push(this._exploreDir(o.fullPath,n+1)),this._wantsDir&&(this.push(o),e--)):(a==="file"||this._includeAsFile(o))&&this._fileFilter(o)&&this._wantsFile&&(this.push(o),e--)}}else{let s=this.parents.pop();if(!s){this.push(null);break}if(this.parent=await s,this.destroyed)return}}}catch(t){this.destroy(t)}finally{this.reading=!1}}}async _exploreDir(e,t){let n;try{n=await TH(e,this._rdOptions)}catch(i){this._onError(i)}return{files:n,depth:t,path:e}}async _formatEntry(e,t){let n;try{let i=this._isDirent?e.name:e,s=ya.resolve(ya.join(t,i));n={path:ya.relative(this._root,s),fullPath:s,basename:i},n[this._statsProp]=this._isDirent?e:await this._stat(s)}catch(i){this._onError(i)}return n}_onError(e){OH(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){let t=e&&e[this._statsProp];if(t){if(t.isFile())return"file";if(t.isDirectory())return"directory";if(t&&t.isSymbolicLink()){let n=e.fullPath;try{let i=await kH(n),s=await wC(i);if(s.isFile())return"file";if(s.isDirectory()){let o=i.length;if(n.startsWith(i)&&n.substr(o,1)===ya.sep){let a=new Error(`Circular symlink detected: "${n}" points to "${i}"`);return a.code=CC,this._onError(a)}return"directory"}}catch(i){this._onError(i)}}}}_includeAsFile(e){let t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}},Vs=(r,e={})=>{let t=e.entryType||e.type;if(t==="both"&&(t=Ou),t&&(e.type=t),r){if(typeof r!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(t&&!SC.includes(t))throw new Error(`readdirp: Invalid type passed. Use one of ${SC.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=r,new Mu(e)},IH=(r,e={})=>new Promise((t,n)=>{let i=[];Vs(r,e).on("data",s=>i.push(s)).on("end",()=>t(i)).on("error",s=>n(s))});Vs.promise=IH;Vs.ReaddirpStream=Mu;Vs.default=Vs;AC.exports=Vs});var $m=A((wz,OC)=>{OC.exports=function(r,e){if(typeof r!="string")throw new TypeError("expected path to be a string");if(r==="\\"||r==="/")return"/";var t=r.length;if(t<=1)return r;var n="";if(t>4&&r[3]==="\\"){var i=r[2];(i==="?"||i===".")&&r.slice(0,2)==="\\\\"&&(r=r.slice(2),n="//")}var s=r.split(/[/\\]+/);return e!==!1&&s[s.length-1]===""&&s.pop(),n+s.join("/")}});var LC=A((NC,DC)=>{"use strict";Object.defineProperty(NC,"__esModule",{value:!0});var IC=Hm(),NH=$m(),MC="!",DH={returnIndex:!1},LH=r=>Array.isArray(r)?r:[r],BH=(r,e)=>{if(typeof r=="function")return r;if(typeof r=="string"){let t=IC(r,e);return n=>r===n||t(n)}return r instanceof RegExp?t=>r.test(t):t=>!1},PC=(r,e,t,n)=>{let i=Array.isArray(t),s=i?t[0]:t;if(!i&&typeof s!="string")throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(s));let o=NH(s,!1);for(let c=0;c<e.length;c++){let l=e[c];if(l(o))return n?-1:!1}let a=i&&[o].concat(t.slice(1));for(let c=0;c<r.length;c++){let l=r[c];if(i?l(...a):l(o))return n?c:!0}return n?-1:!1},Wm=(r,e,t=DH)=>{if(r==null)throw new TypeError("anymatch: specify first argument");let n=typeof t=="boolean"?{returnIndex:t}:t,i=n.returnIndex||!1,s=LH(r),o=s.filter(c=>typeof c=="string"&&c.charAt(0)===MC).map(c=>c.slice(1)).map(c=>IC(c,n)),a=s.filter(c=>typeof c!="string"||typeof c=="string"&&c.charAt(0)!==MC).map(c=>BH(c,n));return e==null?(c,l=!1)=>PC(a,o,c,typeof l=="boolean"?l:!1):PC(a,o,e,i)};Wm.default=Wm;DC.exports=Wm});var jC=A((Sz,BC)=>{BC.exports=function(e){if(typeof e!="string"||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}});var Gm=A((Ez,HC)=>{var jH=jC(),FC={"{":"}","(":")","[":"]"},FH=function(r){if(r[0]==="!")return!0;for(var e=0,t=-2,n=-2,i=-2,s=-2,o=-2;e<r.length;){if(r[e]==="*"||r[e+1]==="?"&&/[\].+)]/.test(r[e])||n!==-1&&r[e]==="["&&r[e+1]!=="]"&&(n<e&&(n=r.indexOf("]",e)),n>e&&(o===-1||o>n||(o=r.indexOf("\\",e),o===-1||o>n)))||i!==-1&&r[e]==="{"&&r[e+1]!=="}"&&(i=r.indexOf("}",e),i>e&&(o=r.indexOf("\\",e),o===-1||o>i))||s!==-1&&r[e]==="("&&r[e+1]==="?"&&/[:!=]/.test(r[e+2])&&r[e+3]!==")"&&(s=r.indexOf(")",e),s>e&&(o=r.indexOf("\\",e),o===-1||o>s))||t!==-1&&r[e]==="("&&r[e+1]!=="|"&&(t<e&&(t=r.indexOf("|",e)),t!==-1&&r[t+1]!==")"&&(s=r.indexOf(")",t),s>t&&(o=r.indexOf("\\",t),o===-1||o>s))))return!0;if(r[e]==="\\"){var a=r[e+1];e+=2;var c=FC[a];if(c){var l=r.indexOf(c,e);l!==-1&&(e=l+1)}if(r[e]==="!")return!0}else e++}return!1},HH=function(r){if(r[0]==="!")return!0;for(var e=0;e<r.length;){if(/[*?{}()[\]]/.test(r[e]))return!0;if(r[e]==="\\"){var t=r[e+1];e+=2;var n=FC[t];if(n){var i=r.indexOf(n,e);i!==-1&&(e=i+1)}if(r[e]==="!")return!0}else e++}return!1};HC.exports=function(e,t){if(typeof e!="string"||e==="")return!1;if(jH(e))return!0;var n=FH;return t&&t.strict===!1&&(n=HH),n(e)}});var UC=A((Tz,qC)=>{"use strict";var qH=Gm(),UH=require("path").posix.dirname,$H=require("os").platform()==="win32",zm="/",WH=/\\/g,GH=/[\{\[].*[\}\]]$/,zH=/(^|[^\\])([\{\[]|\([^\)]+$)/,VH=/\\([\!\*\?\|\[\]\(\)\{\}])/g;qC.exports=function(e,t){var n=Object.assign({flipBackslashes:!0},t);n.flipBackslashes&&$H&&e.indexOf(zm)<0&&(e=e.replace(WH,zm)),GH.test(e)&&(e+=zm),e+="a";do e=UH(e);while(qH(e)||zH.test(e));return e.replace(VH,"$1")}});var Iu=A(_r=>{"use strict";_r.isInteger=r=>typeof r=="number"?Number.isInteger(r):typeof r=="string"&&r.trim()!==""?Number.isInteger(Number(r)):!1;_r.find=(r,e)=>r.nodes.find(t=>t.type===e);_r.exceedsLimit=(r,e,t=1,n)=>n===!1||!_r.isInteger(r)||!_r.isInteger(e)?!1:(Number(e)-Number(r))/Number(t)>=n;_r.escapeNode=(r,e=0,t)=>{let n=r.nodes[e];n&&(t&&n.type===t||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};_r.encloseBrace=r=>r.type!=="brace"?!1:r.commas>>0+r.ranges>>0===0?(r.invalid=!0,!0):!1;_r.isInvalidBrace=r=>r.type!=="brace"?!1:r.invalid===!0||r.dollar?!0:r.commas>>0+r.ranges>>0===0||r.open!==!0||r.close!==!0?(r.invalid=!0,!0):!1;_r.isOpenOrClose=r=>r.type==="open"||r.type==="close"?!0:r.open===!0||r.close===!0;_r.reduce=r=>r.reduce((e,t)=>(t.type==="text"&&e.push(t.value),t.type==="range"&&(t.type="text"),e),[]);_r.flatten=(...r)=>{let e=[],t=n=>{for(let i=0;i<n.length;i++){let s=n[i];if(Array.isArray(s)){t(s);continue}s!==void 0&&e.push(s)}return e};return t(r),e}});var Nu=A((kz,WC)=>{"use strict";var $C=Iu();WC.exports=(r,e={})=>{let t=(n,i={})=>{let s=e.escapeInvalid&&$C.isInvalidBrace(i),o=n.invalid===!0&&e.escapeInvalid===!0,a="";if(n.value)return(s||o)&&$C.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let c of n.nodes)a+=t(c);return a};return t(r)}});var zC=A((Az,GC)=>{"use strict";GC.exports=function(r){return typeof r=="number"?r-r===0:typeof r=="string"&&r.trim()!==""?Number.isFinite?Number.isFinite(+r):isFinite(+r):!1}});var tk=A((Rz,ek)=>{"use strict";var VC=zC(),Si=(r,e,t)=>{if(VC(r)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||r===e)return String(r);if(VC(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...t};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let i=String(n.relaxZeros),s=String(n.shorthand),o=String(n.capture),a=String(n.wrap),c=r+":"+e+"="+i+s+o+a;if(Si.cache.hasOwnProperty(c))return Si.cache[c].result;let l=Math.min(r,e),u=Math.max(r,e);if(Math.abs(l-u)===1){let S=r+"|"+e;return n.capture?`(${S})`:n.wrap===!1?S:`(?:${S})`}let f=QC(r)||QC(e),h={min:r,max:e,a:l,b:u},g=[],x=[];if(f&&(h.isPadded=f,h.maxLen=String(h.max).length),l<0){let S=u<0?Math.abs(u):1;x=KC(S,Math.abs(l),h,n),l=h.a=0}return u>=0&&(g=KC(l,u,h,n)),h.negatives=x,h.positives=g,h.result=KH(x,g,n),n.capture===!0?h.result=`(${h.result})`:n.wrap!==!1&&g.length+x.length>1&&(h.result=`(?:${h.result})`),Si.cache[c]=h,h.result};function KH(r,e,t){let n=Vm(r,e,"-",!1,t)||[],i=Vm(e,r,"",!1,t)||[],s=Vm(r,e,"-?",!0,t)||[];return n.concat(s).concat(i).join("|")}function YH(r,e){let t=1,n=1,i=JC(r,t),s=new Set([e]);for(;r<=i&&i<=e;)s.add(i),t+=1,i=JC(r,t);for(i=XC(e+1,n)-1;r<i&&i<=e;)s.add(i),n+=1,i=XC(e+1,n)-1;return s=[...s],s.sort(ZH),s}function JH(r,e,t){if(r===e)return{pattern:r,count:[],digits:0};let n=XH(r,e),i=n.length,s="",o=0;for(let a=0;a<i;a++){let[c,l]=n[a];c===l?s+=c:c!=="0"||l!=="9"?s+=QH(c,l,t):o++}return o&&(s+=t.shorthand===!0?"\\d":"[0-9]"),{pattern:s,count:[o],digits:i}}function KC(r,e,t,n){let i=YH(r,e),s=[],o=r,a;for(let c=0;c<i.length;c++){let l=i[c],u=JH(String(o),String(l),n),f="";if(!t.isPadded&&a&&a.pattern===u.pattern){a.count.length>1&&a.count.pop(),a.count.push(u.count[0]),a.string=a.pattern+ZC(a.count),o=l+1;continue}t.isPadded&&(f=eq(l,t,n)),u.string=f+u.pattern+ZC(u.count),s.push(u),o=l+1,a=u}return s}function Vm(r,e,t,n,i){let s=[];for(let o of r){let{string:a}=o;!n&&!YC(e,"string",a)&&s.push(t+a),n&&YC(e,"string",a)&&s.push(t+a)}return s}function XH(r,e){let t=[];for(let n=0;n<r.length;n++)t.push([r[n],e[n]]);return t}function ZH(r,e){return r>e?1:e>r?-1:0}function YC(r,e,t){return r.some(n=>n[e]===t)}function JC(r,e){return Number(String(r).slice(0,-e)+"9".repeat(e))}function XC(r,e){return r-r%Math.pow(10,e)}function ZC(r){let[e=0,t=""]=r;return t||e>1?`{${e+(t?","+t:"")}}`:""}function QH(r,e,t){return`[${r}${e-r===1?"":"-"}${e}]`}function QC(r){return/^-?(0+)\d/.test(r)}function eq(r,e,t){if(!e.isPadded)return r;let n=Math.abs(e.maxLen-String(r).length),i=t.relaxZeros!==!1;switch(n){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:return i?`0{0,${n}}`:`0{${n}}`}}Si.cache={};Si.clearCache=()=>Si.cache={};ek.exports=Si});var Jm=A((Oz,ck)=>{"use strict";var tq=require("util"),nk=tk(),rk=r=>r!==null&&typeof r=="object"&&!Array.isArray(r),rq=r=>e=>r===!0?Number(e):String(e),Km=r=>typeof r=="number"||typeof r=="string"&&r!=="",_a=r=>Number.isInteger(+r),Ym=r=>{let e=`${r}`,t=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++t]==="0";);return t>0},nq=(r,e,t)=>typeof r=="string"||typeof e=="string"?!0:t.stringify===!0,iq=(r,e,t)=>{if(e>0){let n=r[0]==="-"?"-":"";n&&(r=r.slice(1)),r=n+r.padStart(n?e-1:e,"0")}return t===!1?String(r):r},Lu=(r,e)=>{let t=r[0]==="-"?"-":"";for(t&&(r=r.slice(1),e--);r.length<e;)r="0"+r;return t?"-"+r:r},sq=(r,e,t)=>{r.negatives.sort((a,c)=>a<c?-1:a>c?1:0),r.positives.sort((a,c)=>a<c?-1:a>c?1:0);let n=e.capture?"":"?:",i="",s="",o;return r.positives.length&&(i=r.positives.map(a=>Lu(String(a),t)).join("|")),r.negatives.length&&(s=`-(${n}${r.negatives.map(a=>Lu(String(a),t)).join("|")})`),i&&s?o=`${i}|${s}`:o=i||s,e.wrap?`(${n}${o})`:o},ik=(r,e,t,n)=>{if(t)return nk(r,e,{wrap:!1,...n});let i=String.fromCharCode(r);if(r===e)return i;let s=String.fromCharCode(e);return`[${i}-${s}]`},sk=(r,e,t)=>{if(Array.isArray(r)){let n=t.wrap===!0,i=t.capture?"":"?:";return n?`(${i}${r.join("|")})`:r.join("|")}return nk(r,e,t)},ok=(...r)=>new RangeError("Invalid range arguments: "+tq.inspect(...r)),ak=(r,e,t)=>{if(t.strictRanges===!0)throw ok([r,e]);return[]},oq=(r,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${r}" to be a number`);return[]},aq=(r,e,t=1,n={})=>{let i=Number(r),s=Number(e);if(!Number.isInteger(i)||!Number.isInteger(s)){if(n.strictRanges===!0)throw ok([r,e]);return[]}i===0&&(i=0),s===0&&(s=0);let o=i>s,a=String(r),c=String(e),l=String(t);t=Math.max(Math.abs(t),1);let u=Ym(a)||Ym(c)||Ym(l),f=u?Math.max(a.length,c.length,l.length):0,h=u===!1&&nq(r,e,n)===!1,g=n.transform||rq(h);if(n.toRegex&&t===1)return ik(Lu(r,f),Lu(e,f),!0,n);let x={negatives:[],positives:[]},S=M=>x[M<0?"negatives":"positives"].push(Math.abs(M)),k=[],R=0;for(;o?i>=s:i<=s;)n.toRegex===!0&&t>1?S(i):k.push(iq(g(i,R),f,h)),i=o?i-t:i+t,R++;return n.toRegex===!0?t>1?sq(x,n,f):sk(k,null,{wrap:!1,...n}):k},cq=(r,e,t=1,n={})=>{if(!_a(r)&&r.length>1||!_a(e)&&e.length>1)return ak(r,e,n);let i=n.transform||(h=>String.fromCharCode(h)),s=`${r}`.charCodeAt(0),o=`${e}`.charCodeAt(0),a=s>o,c=Math.min(s,o),l=Math.max(s,o);if(n.toRegex&&t===1)return ik(c,l,!1,n);let u=[],f=0;for(;a?s>=o:s<=o;)u.push(i(s,f)),s=a?s-t:s+t,f++;return n.toRegex===!0?sk(u,null,{wrap:!1,options:n}):u},Du=(r,e,t,n={})=>{if(e==null&&Km(r))return[r];if(!Km(r)||!Km(e))return ak(r,e,n);if(typeof t=="function")return Du(r,e,1,{transform:t});if(rk(t))return Du(r,e,0,t);let i={...n};return i.capture===!0&&(i.wrap=!0),t=t||i.step||1,_a(t)?_a(r)&&_a(e)?aq(r,e,t,i):cq(r,e,Math.max(Math.abs(t),1),i):t!=null&&!rk(t)?oq(t,i):Du(r,e,1,t)};ck.exports=Du});var pk=A((Mz,uk)=>{"use strict";var lq=Jm(),lk=Iu(),uq=(r,e={})=>{let t=(n,i={})=>{let s=lk.isInvalidBrace(i),o=n.invalid===!0&&e.escapeInvalid===!0,a=s===!0||o===!0,c=e.escapeInvalid===!0?"\\":"",l="";if(n.isOpen===!0)return c+n.value;if(n.isClose===!0)return console.log("node.isClose",c,n.value),c+n.value;if(n.type==="open")return a?c+n.value:"(";if(n.type==="close")return a?c+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let u=lk.reduce(n.nodes),f=lq(...u,{...e,wrap:!1,toRegex:!0,strictZeros:!0});if(f.length!==0)return u.length>1&&f.length>1?`(${f})`:f}if(n.nodes)for(let u of n.nodes)l+=t(u,n);return l};return t(r)};uk.exports=uq});var hk=A((Pz,dk)=>{"use strict";var pq=Jm(),fk=Nu(),Ks=Iu(),Ei=(r="",e="",t=!1)=>{let n=[];if(r=[].concat(r),e=[].concat(e),!e.length)return r;if(!r.length)return t?Ks.flatten(e).map(i=>`{${i}}`):e;for(let i of r)if(Array.isArray(i))for(let s of i)n.push(Ei(s,e,t));else for(let s of e)t===!0&&typeof s=="string"&&(s=`{${s}}`),n.push(Array.isArray(s)?Ei(i,s,t):i+s);return Ks.flatten(n)},fq=(r,e={})=>{let t=e.rangeLimit===void 0?1e3:e.rangeLimit,n=(i,s={})=>{i.queue=[];let o=s,a=s.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,a=o.queue;if(i.invalid||i.dollar){a.push(Ei(a.pop(),fk(i,e)));return}if(i.type==="brace"&&i.invalid!==!0&&i.nodes.length===2){a.push(Ei(a.pop(),["{}"]));return}if(i.nodes&&i.ranges>0){let f=Ks.reduce(i.nodes);if(Ks.exceedsLimit(...f,e.step,t))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let h=pq(...f,e);h.length===0&&(h=fk(i,e)),a.push(Ei(a.pop(),h)),i.nodes=[];return}let c=Ks.encloseBrace(i),l=i.queue,u=i;for(;u.type!=="brace"&&u.type!=="root"&&u.parent;)u=u.parent,l=u.queue;for(let f=0;f<i.nodes.length;f++){let h=i.nodes[f];if(h.type==="comma"&&i.type==="brace"){f===1&&l.push(""),l.push("");continue}if(h.type==="close"){a.push(Ei(a.pop(),l,c));continue}if(h.value&&h.type!=="open"){l.push(Ei(l.pop(),h.value));continue}h.nodes&&n(h,i)}return l};return Ks.flatten(n(r))};dk.exports=fq});var gk=A((Iz,mk)=>{"use strict";mk.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
|
|
105
|
-
`,CHAR_NO_BREAK_SPACE:"\xA0",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:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var bk=A((Nz,_k)=>{"use strict";var dq=Nu(),{MAX_LENGTH:vk,CHAR_BACKSLASH:Xm,CHAR_BACKTICK:hq,CHAR_COMMA:mq,CHAR_DOT:gq,CHAR_LEFT_PARENTHESES:vq,CHAR_RIGHT_PARENTHESES:yq,CHAR_LEFT_CURLY_BRACE:xq,CHAR_RIGHT_CURLY_BRACE:_q,CHAR_LEFT_SQUARE_BRACKET:yk,CHAR_RIGHT_SQUARE_BRACKET:xk,CHAR_DOUBLE_QUOTE:bq,CHAR_SINGLE_QUOTE:wq,CHAR_NO_BREAK_SPACE:Sq,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Eq}=gk(),Tq=(r,e={})=>{if(typeof r!="string")throw new TypeError("Expected a string");let t=e||{},n=typeof t.maxLength=="number"?Math.min(vk,t.maxLength):vk;if(r.length>n)throw new SyntaxError(`Input length (${r.length}), exceeds max characters (${n})`);let i={type:"root",input:r,nodes:[]},s=[i],o=i,a=i,c=0,l=r.length,u=0,f=0,h,g=()=>r[u++],x=S=>{if(S.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&S.type==="text"){a.value+=S.value;return}return o.nodes.push(S),S.parent=o,S.prev=a,a=S,S};for(x({type:"bos"});u<l;)if(o=s[s.length-1],h=g(),!(h===Eq||h===Sq)){if(h===Xm){x({type:"text",value:(e.keepEscaping?h:"")+g()});continue}if(h===xk){x({type:"text",value:"\\"+h});continue}if(h===yk){c++;let S;for(;u<l&&(S=g());){if(h+=S,S===yk){c++;continue}if(S===Xm){h+=g();continue}if(S===xk&&(c--,c===0))break}x({type:"text",value:h});continue}if(h===vq){o=x({type:"paren",nodes:[]}),s.push(o),x({type:"text",value:h});continue}if(h===yq){if(o.type!=="paren"){x({type:"text",value:h});continue}o=s.pop(),x({type:"text",value:h}),o=s[s.length-1];continue}if(h===bq||h===wq||h===hq){let S=h,k;for(e.keepQuotes!==!0&&(h="");u<l&&(k=g());){if(k===Xm){h+=k+g();continue}if(k===S){e.keepQuotes===!0&&(h+=k);break}h+=k}x({type:"text",value:h});continue}if(h===xq){f++;let k={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||o.dollar===!0,depth:f,commas:0,ranges:0,nodes:[]};o=x(k),s.push(o),x({type:"open",value:h});continue}if(h===_q){if(o.type!=="brace"){x({type:"text",value:h});continue}let S="close";o=s.pop(),o.close=!0,x({type:S,value:h}),f--,o=s[s.length-1];continue}if(h===mq&&f>0){if(o.ranges>0){o.ranges=0;let S=o.nodes.shift();o.nodes=[S,{type:"text",value:dq(o)}]}x({type:"comma",value:h}),o.commas++;continue}if(h===gq&&f>0&&o.commas===0){let S=o.nodes;if(f===0||S.length===0){x({type:"text",value:h});continue}if(a.type==="dot"){if(o.range=[],a.value+=h,a.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if(a.type==="range"){S.pop();let k=S[S.length-1];k.value+=a.value+h,a=k,o.ranges--;continue}x({type:"dot",value:h});continue}x({type:"text",value:h})}do if(o=s.pop(),o.type!=="root"){o.nodes.forEach(R=>{R.nodes||(R.type==="open"&&(R.isOpen=!0),R.type==="close"&&(R.isClose=!0),R.nodes||(R.type="text"),R.invalid=!0)});let S=s[s.length-1],k=S.nodes.indexOf(o);S.nodes.splice(k,1,...o.nodes)}while(s.length>0);return x({type:"eos"}),i};_k.exports=Tq});var Ek=A((Dz,Sk)=>{"use strict";var wk=Nu(),Cq=pk(),kq=hk(),Aq=bk(),tr=(r,e={})=>{let t=[];if(Array.isArray(r))for(let n of r){let i=tr.create(n,e);Array.isArray(i)?t.push(...i):t.push(i)}else t=[].concat(tr.create(r,e));return e&&e.expand===!0&&e.nodupes===!0&&(t=[...new Set(t)]),t};tr.parse=(r,e={})=>Aq(r,e);tr.stringify=(r,e={})=>wk(typeof r=="string"?tr.parse(r,e):r,e);tr.compile=(r,e={})=>(typeof r=="string"&&(r=tr.parse(r,e)),Cq(r,e));tr.expand=(r,e={})=>{typeof r=="string"&&(r=tr.parse(r,e));let t=kq(r,e);return e.noempty===!0&&(t=t.filter(Boolean)),e.nodupes===!0&&(t=[...new Set(t)]),t};tr.create=(r,e={})=>r===""||r.length<3?[r]:e.expand!==!0?tr.compile(r,e):tr.expand(r,e);Sk.exports=tr});var Tk=A((Lz,Rq)=>{Rq.exports=["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 kk=A((Bz,Ck)=>{Ck.exports=Tk()});var Rk=A((jz,Ak)=>{"use strict";var Oq=require("path"),Mq=kk(),Pq=new Set(Mq);Ak.exports=r=>Pq.has(Oq.extname(r).slice(1).toLowerCase())});var Bu=A(Y=>{"use strict";var{sep:Iq}=require("path"),{platform:Zm}=process,Nq=require("os");Y.EV_ALL="all";Y.EV_READY="ready";Y.EV_ADD="add";Y.EV_CHANGE="change";Y.EV_ADD_DIR="addDir";Y.EV_UNLINK="unlink";Y.EV_UNLINK_DIR="unlinkDir";Y.EV_RAW="raw";Y.EV_ERROR="error";Y.STR_DATA="data";Y.STR_END="end";Y.STR_CLOSE="close";Y.FSEVENT_CREATED="created";Y.FSEVENT_MODIFIED="modified";Y.FSEVENT_DELETED="deleted";Y.FSEVENT_MOVED="moved";Y.FSEVENT_CLONED="cloned";Y.FSEVENT_UNKNOWN="unknown";Y.FSEVENT_FLAG_MUST_SCAN_SUBDIRS=1;Y.FSEVENT_TYPE_FILE="file";Y.FSEVENT_TYPE_DIRECTORY="directory";Y.FSEVENT_TYPE_SYMLINK="symlink";Y.KEY_LISTENERS="listeners";Y.KEY_ERR="errHandlers";Y.KEY_RAW="rawEmitters";Y.HANDLER_KEYS=[Y.KEY_LISTENERS,Y.KEY_ERR,Y.KEY_RAW];Y.DOT_SLASH=`.${Iq}`;Y.BACK_SLASH_RE=/\\/g;Y.DOUBLE_SLASH_RE=/\/\//;Y.SLASH_OR_BACK_SLASH_RE=/[/\\]/;Y.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/;Y.REPLACER_RE=/^\.[/\\]/;Y.SLASH="/";Y.SLASH_SLASH="//";Y.BRACE_START="{";Y.BANG="!";Y.ONE_DOT=".";Y.TWO_DOTS="..";Y.STAR="*";Y.GLOBSTAR="**";Y.ROOT_GLOBSTAR="/**/*";Y.SLASH_GLOBSTAR="/**";Y.DIR_SUFFIX="Dir";Y.ANYMATCH_OPTS={dot:!0};Y.STRING_TYPE="string";Y.FUNCTION_TYPE="function";Y.EMPTY_STR="";Y.EMPTY_FN=()=>{};Y.IDENTITY_FN=r=>r;Y.isWindows=Zm==="win32";Y.isMacos=Zm==="darwin";Y.isLinux=Zm==="linux";Y.isIBMi=Nq.type()==="OS400"});var Dk=A((Hz,Nk)=>{"use strict";var En=require("fs"),xt=require("path"),{promisify:Ea}=require("util"),Dq=Rk(),{isWindows:Lq,isLinux:Bq,EMPTY_FN:jq,EMPTY_STR:Fq,KEY_LISTENERS:Ys,KEY_ERR:Qm,KEY_RAW:ba,HANDLER_KEYS:Hq,EV_CHANGE:Fu,EV_ADD:ju,EV_ADD_DIR:qq,EV_ERROR:Mk,STR_DATA:Uq,STR_END:$q,BRACE_START:Wq,STAR:Gq}=Bu(),zq="watch",Vq=Ea(En.open),Pk=Ea(En.stat),Kq=Ea(En.lstat),Yq=Ea(En.close),eg=Ea(En.realpath),Jq={lstat:Kq,stat:Pk},rg=(r,e)=>{r instanceof Set?r.forEach(e):e(r)},wa=(r,e,t)=>{let n=r[e];n instanceof Set||(r[e]=n=new Set([n])),n.add(t)},Xq=r=>e=>{let t=r[e];t instanceof Set?t.clear():delete r[e]},Sa=(r,e,t)=>{let n=r[e];n instanceof Set?n.delete(t):n===t&&delete r[e]},Ik=r=>r instanceof Set?r.size===0:!r,Hu=new Map;function Ok(r,e,t,n,i){let s=(o,a)=>{t(r),i(o,a,{watchedPath:r}),a&&r!==a&&qu(xt.resolve(r,a),Ys,xt.join(r,a))};try{return En.watch(r,e,s)}catch(o){n(o)}}var qu=(r,e,t,n,i)=>{let s=Hu.get(r);s&&rg(s[e],o=>{o(t,n,i)})},Zq=(r,e,t,n)=>{let{listener:i,errHandler:s,rawEmitter:o}=n,a=Hu.get(e),c;if(!t.persistent)return c=Ok(r,t,i,s,o),c.close.bind(c);if(a)wa(a,Ys,i),wa(a,Qm,s),wa(a,ba,o);else{if(c=Ok(r,t,qu.bind(null,e,Ys),s,qu.bind(null,e,ba)),!c)return;c.on(Mk,async l=>{let u=qu.bind(null,e,Qm);if(a.watcherUnusable=!0,Lq&&l.code==="EPERM")try{let f=await Vq(r,"r");await Yq(f),u(l)}catch{}else u(l)}),a={listeners:i,errHandlers:s,rawEmitters:o,watcher:c},Hu.set(e,a)}return()=>{Sa(a,Ys,i),Sa(a,Qm,s),Sa(a,ba,o),Ik(a.listeners)&&(a.watcher.close(),Hu.delete(e),Hq.forEach(Xq(a)),a.watcher=void 0,Object.freeze(a))}},tg=new Map,Qq=(r,e,t,n)=>{let{listener:i,rawEmitter:s}=n,o=tg.get(e),a=new Set,c=new Set,l=o&&o.options;return l&&(l.persistent<t.persistent||l.interval>t.interval)&&(a=o.listeners,c=o.rawEmitters,En.unwatchFile(e),o=void 0),o?(wa(o,Ys,i),wa(o,ba,s)):(o={listeners:i,rawEmitters:s,options:t,watcher:En.watchFile(e,t,(u,f)=>{rg(o.rawEmitters,g=>{g(Fu,e,{curr:u,prev:f})});let h=u.mtimeMs;(u.size!==f.size||h>f.mtimeMs||h===0)&&rg(o.listeners,g=>g(r,u))})},tg.set(e,o)),()=>{Sa(o,Ys,i),Sa(o,ba,s),Ik(o.listeners)&&(tg.delete(e),En.unwatchFile(e),o.options=o.watcher=void 0,Object.freeze(o))}},ng=class{constructor(e){this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){let n=this.fsw.options,i=xt.dirname(e),s=xt.basename(e);this.fsw._getWatchedDir(i).add(s);let a=xt.resolve(e),c={persistent:n.persistent};t||(t=jq);let l;return n.usePolling?(c.interval=n.enableBinaryInterval&&Dq(s)?n.binaryInterval:n.interval,l=Qq(e,a,c,{listener:t,rawEmitter:this.fsw._emitRaw})):l=Zq(e,a,c,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),l}_handleFile(e,t,n){if(this.fsw.closed)return;let i=xt.dirname(e),s=xt.basename(e),o=this.fsw._getWatchedDir(i),a=t;if(o.has(s))return;let c=async(u,f)=>{if(this.fsw._throttle(zq,e,5)){if(!f||f.mtimeMs===0)try{let h=await Pk(e);if(this.fsw.closed)return;let g=h.atimeMs,x=h.mtimeMs;(!g||g<=x||x!==a.mtimeMs)&&this.fsw._emit(Fu,e,h),Bq&&a.ino!==h.ino?(this.fsw._closeFile(u),a=h,this.fsw._addPathCloser(u,this._watchWithNodeFs(e,c))):a=h}catch{this.fsw._remove(i,s)}else if(o.has(s)){let h=f.atimeMs,g=f.mtimeMs;(!h||h<=g||g!==a.mtimeMs)&&this.fsw._emit(Fu,e,f),a=f}}},l=this._watchWithNodeFs(e,c);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(ju,e,0))return;this.fsw._emit(ju,e,t)}return l}async _handleSymlink(e,t,n,i){if(this.fsw.closed)return;let s=e.fullPath,o=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let a;try{a=await eg(n)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(o.has(i)?this.fsw._symlinkPaths.get(s)!==a&&(this.fsw._symlinkPaths.set(s,a),this.fsw._emit(Fu,n,e.stats)):(o.add(i),this.fsw._symlinkPaths.set(s,a),this.fsw._emit(ju,n,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(s))return!0;this.fsw._symlinkPaths.set(s,!0)}_handleRead(e,t,n,i,s,o,a){if(e=xt.join(e,Fq),!n.hasGlob&&(a=this.fsw._throttle("readdir",e,1e3),!a))return;let c=this.fsw._getWatchedDir(n.path),l=new Set,u=this.fsw._readdirp(e,{fileFilter:f=>n.filterPath(f),directoryFilter:f=>n.filterDir(f),depth:0}).on(Uq,async f=>{if(this.fsw.closed){u=void 0;return}let h=f.path,g=xt.join(e,h);if(l.add(h),!(f.stats.isSymbolicLink()&&await this._handleSymlink(f,e,g,h))){if(this.fsw.closed){u=void 0;return}(h===i||!i&&!c.has(h))&&(this.fsw._incrReadyCount(),g=xt.join(s,xt.relative(s,g)),this._addToNodeFs(g,t,n,o+1))}}).on(Mk,this._boundHandleError);return new Promise(f=>u.once($q,()=>{if(this.fsw.closed){u=void 0;return}let h=a?a.clear():!1;f(),c.getChildren().filter(g=>g!==e&&!l.has(g)&&(!n.hasGlob||n.filterPath({fullPath:xt.resolve(e,g)}))).forEach(g=>{this.fsw._remove(e,g)}),u=void 0,h&&this._handleRead(e,!1,n,i,s,o,a)}))}async _handleDir(e,t,n,i,s,o,a){let c=this.fsw._getWatchedDir(xt.dirname(e)),l=c.has(xt.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!s&&!l&&(!o.hasGlob||o.globFilter(e))&&this.fsw._emit(qq,e,t),c.add(xt.basename(e)),this.fsw._getWatchedDir(e);let u,f,h=this.fsw.options.depth;if((h==null||i<=h)&&!this.fsw._symlinkPaths.has(a)){if(!s&&(await this._handleRead(e,n,o,s,e,i,u),this.fsw.closed))return;f=this._watchWithNodeFs(e,(g,x)=>{x&&x.mtimeMs===0||this._handleRead(g,!1,o,s,e,i,u)})}return f}async _addToNodeFs(e,t,n,i,s){let o=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return o(),!1;let a=this.fsw._getWatchHelpers(e,i);!a.hasGlob&&n&&(a.hasGlob=n.hasGlob,a.globFilter=n.globFilter,a.filterPath=c=>n.filterPath(c),a.filterDir=c=>n.filterDir(c));try{let c=await Jq[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))return o(),!1;let l=this.fsw.options.followSymlinks&&!e.includes(Gq)&&!e.includes(Wq),u;if(c.isDirectory()){let f=xt.resolve(e),h=l?await eg(e):e;if(this.fsw.closed||(u=await this._handleDir(a.watchPath,c,t,i,s,a,h),this.fsw.closed))return;f!==h&&h!==void 0&&this.fsw._symlinkPaths.set(f,h)}else if(c.isSymbolicLink()){let f=l?await eg(e):e;if(this.fsw.closed)return;let h=xt.dirname(a.watchPath);if(this.fsw._getWatchedDir(h).add(a.watchPath),this.fsw._emit(ju,a.watchPath,c),u=await this._handleDir(h,c,t,i,e,a,f),this.fsw.closed)return;f!==void 0&&this.fsw._symlinkPaths.set(xt.resolve(e),f)}else u=this._handleFile(a.watchPath,c,t);return o(),this.fsw._addPathCloser(e,u),!1}catch(c){if(this.fsw._handleError(c))return o(),e}}};Nk.exports=ng});var Uk=A((qz,pg)=>{"use strict";var lg=require("fs"),_t=require("path"),{promisify:ug}=require("util"),Js;try{Js=require("fsevents")}catch(r){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(r)}if(Js){let r=process.version.match(/v(\d+)\.(\d+)/);if(r&&r[1]&&r[2]){let e=Number.parseInt(r[1],10),t=Number.parseInt(r[2],10);e===8&&t<16&&(Js=void 0)}}var{EV_ADD:ig,EV_CHANGE:eU,EV_ADD_DIR:Lk,EV_UNLINK:Uu,EV_ERROR:tU,STR_DATA:rU,STR_END:nU,FSEVENT_CREATED:iU,FSEVENT_MODIFIED:sU,FSEVENT_DELETED:oU,FSEVENT_MOVED:aU,FSEVENT_UNKNOWN:cU,FSEVENT_FLAG_MUST_SCAN_SUBDIRS:lU,FSEVENT_TYPE_FILE:uU,FSEVENT_TYPE_DIRECTORY:Ta,FSEVENT_TYPE_SYMLINK:qk,ROOT_GLOBSTAR:Bk,DIR_SUFFIX:pU,DOT_SLASH:jk,FUNCTION_TYPE:sg,EMPTY_FN:fU,IDENTITY_FN:dU}=Bu(),hU=r=>isNaN(r)?{}:{depth:r},ag=ug(lg.stat),mU=ug(lg.lstat),Fk=ug(lg.realpath),gU={stat:ag,lstat:mU},Ti=new Map,vU=10,yU=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),xU=(r,e)=>({stop:Js.watch(r,e)});function _U(r,e,t,n){let i=_t.extname(e)?_t.dirname(e):e,s=_t.dirname(i),o=Ti.get(i);bU(s)&&(i=s);let a=_t.resolve(r),c=a!==e,l=(f,h,g)=>{c&&(f=f.replace(e,a)),(f===a||!f.indexOf(a+_t.sep))&&t(f,h,g)},u=!1;for(let f of Ti.keys())if(e.indexOf(_t.resolve(f)+_t.sep)===0){i=f,o=Ti.get(i),u=!0;break}return o||u?o.listeners.add(l):(o={listeners:new Set([l]),rawEmitter:n,watcher:xU(i,(f,h)=>{if(!o.listeners.size||h&lU)return;let g=Js.getInfo(f,h);o.listeners.forEach(x=>{x(f,h,g)}),o.rawEmitter(g.event,f,g)})},Ti.set(i,o)),()=>{let f=o.listeners;if(f.delete(l),!f.size&&(Ti.delete(i),o.watcher))return o.watcher.stop().then(()=>{o.rawEmitter=o.watcher=void 0,Object.freeze(o)})}}var bU=r=>{let e=0;for(let t of Ti.keys())if(t.indexOf(r)===0&&(e++,e>=vU))return!0;return!1},wU=()=>Js&&Ti.size<128,og=(r,e)=>{let t=0;for(;!r.indexOf(e)&&(r=_t.dirname(r))!==e;)t++;return t},Hk=(r,e)=>r.type===Ta&&e.isDirectory()||r.type===qk&&e.isSymbolicLink()||r.type===uU&&e.isFile(),cg=class{constructor(e){this.fsw=e}checkIgnored(e,t){let n=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,t))return n.add(e),t&&t.isDirectory()&&n.add(e+Bk),!0;n.delete(e),n.delete(e+Bk)}addOrChange(e,t,n,i,s,o,a,c){let l=s.has(o)?eU:ig;this.handleEvent(l,e,t,n,i,s,o,a,c)}async checkExists(e,t,n,i,s,o,a,c){try{let l=await ag(e);if(this.fsw.closed)return;Hk(a,l)?this.addOrChange(e,t,n,i,s,o,a,c):this.handleEvent(Uu,e,t,n,i,s,o,a,c)}catch(l){l.code==="EACCES"?this.addOrChange(e,t,n,i,s,o,a,c):this.handleEvent(Uu,e,t,n,i,s,o,a,c)}}handleEvent(e,t,n,i,s,o,a,c,l){if(!(this.fsw.closed||this.checkIgnored(t)))if(e===Uu){let u=c.type===Ta;(u||o.has(a))&&this.fsw._remove(s,a,u)}else{if(e===ig){if(c.type===Ta&&this.fsw._getWatchedDir(t),c.type===qk&&l.followSymlinks){let f=l.depth===void 0?void 0:og(n,i)+1;return this._addToFsEvents(t,!1,!0,f)}this.fsw._getWatchedDir(s).add(a)}let u=c.type===Ta?e+pU:e;this.fsw._emit(u,t),u===Lk&&this._addToFsEvents(t,!1,!0)}}_watchWithFsEvents(e,t,n,i){if(this.fsw.closed||this.fsw._isIgnored(e))return;let s=this.fsw.options,a=_U(e,t,async(c,l,u)=>{if(this.fsw.closed||s.depth!==void 0&&og(c,t)>s.depth)return;let f=n(_t.join(e,_t.relative(e,c)));if(i&&!i(f))return;let h=_t.dirname(f),g=_t.basename(f),x=this.fsw._getWatchedDir(u.type===Ta?f:h);if(yU.has(l)||u.event===cU)if(typeof s.ignored===sg){let S;try{S=await ag(f)}catch{}if(this.fsw.closed||this.checkIgnored(f,S))return;Hk(u,S)?this.addOrChange(f,c,t,h,x,g,u,s):this.handleEvent(Uu,f,c,t,h,x,g,u,s)}else this.checkExists(f,c,t,h,x,g,u,s);else switch(u.event){case iU:case sU:return this.addOrChange(f,c,t,h,x,g,u,s);case oU:case aU:return this.checkExists(f,c,t,h,x,g,u,s)}},this.fsw._emitRaw);return this.fsw._emitReady(),a}async _handleFsEventsSymlink(e,t,n,i){if(!(this.fsw.closed||this.fsw._symlinkPaths.has(t))){this.fsw._symlinkPaths.set(t,!0),this.fsw._incrReadyCount();try{let s=await Fk(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(s))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(s||e,o=>{let a=e;return s&&s!==jk?a=o.replace(s,e):o!==jk&&(a=_t.join(e,o)),n(a)},!1,i)}catch(s){if(this.fsw._handleError(s))return this.fsw._emitReady()}}}emitAdd(e,t,n,i,s){let o=n(e),a=t.isDirectory(),c=this.fsw._getWatchedDir(_t.dirname(o)),l=_t.basename(o);a&&this.fsw._getWatchedDir(o),!c.has(l)&&(c.add(l),(!i.ignoreInitial||s===!0)&&this.fsw._emit(a?Lk:ig,o,t))}initWatch(e,t,n,i){if(this.fsw.closed)return;let s=this._watchWithFsEvents(n.watchPath,_t.resolve(e||n.watchPath),i,n.globFilter);this.fsw._addPathCloser(t,s)}async _addToFsEvents(e,t,n,i){if(this.fsw.closed)return;let s=this.fsw.options,o=typeof t===sg?t:dU,a=this.fsw._getWatchHelpers(e);try{let c=await gU[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))throw null;if(c.isDirectory()){if(a.globFilter||this.emitAdd(o(e),c,o,s,n),i&&i>s.depth)return;this.fsw._readdirp(a.watchPath,{fileFilter:l=>a.filterPath(l),directoryFilter:l=>a.filterDir(l),...hU(s.depth-(i||0))}).on(rU,l=>{if(this.fsw.closed||l.stats.isDirectory()&&!a.filterPath(l))return;let u=_t.join(a.watchPath,l.path),{fullPath:f}=l;if(a.followSymlinks&&l.stats.isSymbolicLink()){let h=s.depth===void 0?void 0:og(u,_t.resolve(a.watchPath))+1;this._handleFsEventsSymlink(u,f,o,h)}else this.emitAdd(u,l.stats,o,s,n)}).on(tU,fU).on(nU,()=>{this.fsw._emitReady()})}else this.emitAdd(a.watchPath,c,o,s,n),this.fsw._emitReady()}catch(c){(!c||this.fsw._handleError(c))&&(this.fsw._emitReady(),this.fsw._emitReady())}if(s.persistent&&n!==!0)if(typeof t===sg)this.initWatch(void 0,e,a,o);else{let c;try{c=await Fk(a.watchPath)}catch{}this.initWatch(c,e,a,o)}}};pg.exports=cg;pg.exports.canUse=wU});var Qk=A(Cg=>{"use strict";var{EventEmitter:SU}=require("events"),Eg=require("fs"),ue=require("path"),{promisify:Yk}=require("util"),EU=RC(),vg=LC().default,TU=UC(),fg=Gm(),CU=Ek(),kU=$m(),AU=Dk(),$k=Uk(),{EV_ALL:dg,EV_READY:RU,EV_ADD:$u,EV_CHANGE:Ca,EV_UNLINK:Wk,EV_ADD_DIR:OU,EV_UNLINK_DIR:MU,EV_RAW:PU,EV_ERROR:hg,STR_CLOSE:IU,STR_END:NU,BACK_SLASH_RE:DU,DOUBLE_SLASH_RE:Gk,SLASH_OR_BACK_SLASH_RE:LU,DOT_RE:BU,REPLACER_RE:jU,SLASH:mg,SLASH_SLASH:FU,BRACE_START:HU,BANG:yg,ONE_DOT:Jk,TWO_DOTS:qU,GLOBSTAR:UU,SLASH_GLOBSTAR:gg,ANYMATCH_OPTS:xg,STRING_TYPE:Tg,FUNCTION_TYPE:$U,EMPTY_STR:_g,EMPTY_FN:WU,isWindows:GU,isMacos:zU,isIBMi:VU}=Bu(),KU=Yk(Eg.stat),YU=Yk(Eg.readdir),bg=(r=[])=>Array.isArray(r)?r:[r],Xk=(r,e=[])=>(r.forEach(t=>{Array.isArray(t)?Xk(t,e):e.push(t)}),e),zk=r=>{let e=Xk(bg(r));if(!e.every(t=>typeof t===Tg))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(Zk)},Vk=r=>{let e=r.replace(DU,mg),t=!1;for(e.startsWith(FU)&&(t=!0);e.match(Gk);)e=e.replace(Gk,mg);return t&&(e=mg+e),e},Zk=r=>Vk(ue.normalize(Vk(r))),Kk=(r=_g)=>e=>typeof e!==Tg?e:Zk(ue.isAbsolute(e)?e:ue.join(r,e)),JU=(r,e)=>ue.isAbsolute(r)?r:r.startsWith(yg)?yg+ue.join(e,r.slice(1)):ue.join(e,r),Dr=(r,e)=>r[e]===void 0,wg=class{constructor(e,t){this.path=e,this._removeWatcher=t,this.items=new Set}add(e){let{items:t}=this;t&&e!==Jk&&e!==qU&&t.add(e)}async remove(e){let{items:t}=this;if(!t||(t.delete(e),t.size>0))return;let n=this.path;try{await YU(n)}catch{this._removeWatcher&&this._removeWatcher(ue.dirname(n),ue.basename(n))}}has(e){let{items:t}=this;if(t)return t.has(e)}getChildren(){let{items:e}=this;if(e)return[...e.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this)}},XU="stat",ZU="lstat",Sg=class{constructor(e,t,n,i){this.fsw=i,this.path=e=e.replace(jU,_g),this.watchPath=t,this.fullWatchPath=ue.resolve(t),this.hasGlob=t!==e,e===_g&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&n?void 0:!1,this.globFilter=this.hasGlob?vg(e,void 0,xg):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(s=>{s.length>1&&s.pop()}),this.followSymlinks=n,this.statMethod=n?XU:ZU}checkGlobSymlink(e){return this.globSymlink===void 0&&(this.globSymlink=e.fullParentDir===this.fullWatchPath?!1:{realPath:e.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):e.fullPath}entryPath(e){return ue.join(this.watchPath,ue.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){let{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);let n=this.entryPath(e);return(this.hasGlob&&typeof this.globFilter===$U?this.globFilter(n):!0)&&this.fsw._isntIgnored(n,t)&&this.fsw._hasReadPermissions(t)}getDirParts(e){if(!this.hasGlob)return[];let t=[];return(e.includes(HU)?CU.expand(e):[e]).forEach(i=>{t.push(ue.relative(this.watchPath,i).split(LU))}),t}filterDir(e){if(this.hasGlob){let t=this.getDirParts(this.checkGlobSymlink(e)),n=!1;this.unmatchedGlob=!this.dirParts.some(i=>i.every((s,o)=>(s===UU&&(n=!0),n||!t[0][o]||vg(s,t[0][o],xg))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}},Wu=class extends SU{constructor(e){super();let 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,Dr(t,"persistent")&&(t.persistent=!0),Dr(t,"ignoreInitial")&&(t.ignoreInitial=!1),Dr(t,"ignorePermissionErrors")&&(t.ignorePermissionErrors=!1),Dr(t,"interval")&&(t.interval=100),Dr(t,"binaryInterval")&&(t.binaryInterval=300),Dr(t,"disableGlobbing")&&(t.disableGlobbing=!1),t.enableBinaryInterval=t.binaryInterval!==t.interval,Dr(t,"useFsEvents")&&(t.useFsEvents=!t.usePolling),$k.canUse()||(t.useFsEvents=!1),Dr(t,"usePolling")&&!t.useFsEvents&&(t.usePolling=zU),VU&&(t.usePolling=!0);let i=process.env.CHOKIDAR_USEPOLLING;if(i!==void 0){let c=i.toLowerCase();c==="false"||c==="0"?t.usePolling=!1:c==="true"||c==="1"?t.usePolling=!0:t.usePolling=!!c}let s=process.env.CHOKIDAR_INTERVAL;s&&(t.interval=Number.parseInt(s,10)),Dr(t,"atomic")&&(t.atomic=!t.usePolling&&!t.useFsEvents),t.atomic&&(this._pendingUnlinks=new Map),Dr(t,"followSymlinks")&&(t.followSymlinks=!0),Dr(t,"awaitWriteFinish")&&(t.awaitWriteFinish=!1),t.awaitWriteFinish===!0&&(t.awaitWriteFinish={});let o=t.awaitWriteFinish;o&&(o.stabilityThreshold||(o.stabilityThreshold=2e3),o.pollInterval||(o.pollInterval=100),this._pendingWrites=new Map),t.ignored&&(t.ignored=bg(t.ignored));let a=0;this._emitReady=()=>{a++,a>=this._readyCount&&(this._emitReady=WU,this._readyEmitted=!0,process.nextTick(()=>this.emit(RU)))},this._emitRaw=(...c)=>this.emit(PU,...c),this._readyEmitted=!1,this.options=t,t.useFsEvents?this._fsEventsHandler=new $k(this):this._nodeFsHandler=new AU(this),Object.freeze(t)}add(e,t,n){let{cwd:i,disableGlobbing:s}=this.options;this.closed=!1;let o=zk(e);return i&&(o=o.map(a=>{let c=JU(a,i);return s||!fg(a)?c:kU(c)})),o=o.filter(a=>a.startsWith(yg)?(this._ignoredPaths.add(a.slice(1)),!1):(this._ignoredPaths.delete(a),this._ignoredPaths.delete(a+gg),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=o.length),this.options.persistent&&(this._readyCount+=o.length),o.forEach(a=>this._fsEventsHandler._addToFsEvents(a))):(this._readyCount||(this._readyCount=0),this._readyCount+=o.length,Promise.all(o.map(async a=>{let c=await this._nodeFsHandler._addToNodeFs(a,!n,0,0,t);return c&&this._emitReady(),c})).then(a=>{this.closed||a.filter(c=>c).forEach(c=>{this.add(ue.dirname(c),ue.basename(t||c))})})),this}unwatch(e){if(this.closed)return this;let t=zk(e),{cwd:n}=this.options;return t.forEach(i=>{!ue.isAbsolute(i)&&!this._closers.has(i)&&(n&&(i=ue.join(n,i)),i=ue.resolve(i)),this._closePath(i),this._ignoredPaths.add(i),this._watched.has(i)&&this._ignoredPaths.add(i+gg),this._userIgnored=void 0}),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(t=>t.forEach(n=>{let i=n();i instanceof Promise&&e.push(i)})),this._streams.forEach(t=>t.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(t=>t.dispose()),["closers","watched","streams","symlinkPaths","throttled"].forEach(t=>{this[`_${t}`].clear()}),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((t,n)=>{let i=this.options.cwd?ue.relative(this.options.cwd,n):n;e[i||Jk]=t.getChildren().sort()}),e}emitWithAll(e,t){this.emit(...t),e!==hg&&this.emit(dg,...t)}async _emit(e,t,n,i,s){if(this.closed)return;let o=this.options;GU&&(t=ue.normalize(t)),o.cwd&&(t=ue.relative(o.cwd,t));let a=[e,t];s!==void 0?a.push(n,i,s):i!==void 0?a.push(n,i):n!==void 0&&a.push(n);let c=o.awaitWriteFinish,l;if(c&&(l=this._pendingWrites.get(t)))return l.lastChange=new Date,this;if(o.atomic){if(e===Wk)return this._pendingUnlinks.set(t,a),setTimeout(()=>{this._pendingUnlinks.forEach((u,f)=>{this.emit(...u),this.emit(dg,...u),this._pendingUnlinks.delete(f)})},typeof o.atomic=="number"?o.atomic:100),this;e===$u&&this._pendingUnlinks.has(t)&&(e=a[0]=Ca,this._pendingUnlinks.delete(t))}if(c&&(e===$u||e===Ca)&&this._readyEmitted){let u=(f,h)=>{f?(e=a[0]=hg,a[1]=f,this.emitWithAll(e,a)):h&&(a.length>2?a[2]=h:a.push(h),this.emitWithAll(e,a))};return this._awaitWriteFinish(t,c.stabilityThreshold,e,u),this}if(e===Ca&&!this._throttle(Ca,t,50))return this;if(o.alwaysStat&&n===void 0&&(e===$u||e===OU||e===Ca)){let u=o.cwd?ue.join(o.cwd,t):t,f;try{f=await KU(u)}catch{}if(!f||this.closed)return;a.push(f)}return this.emitWithAll(e,a),this}_handleError(e){let t=e&&e.code;return e&&t!=="ENOENT"&&t!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||t!=="EPERM"&&t!=="EACCES")&&this.emit(hg,e),e||this.closed}_throttle(e,t,n){this._throttled.has(e)||this._throttled.set(e,new Map);let i=this._throttled.get(e),s=i.get(t);if(s)return s.count++,!1;let o,a=()=>{let l=i.get(t),u=l?l.count:0;return i.delete(t),clearTimeout(o),l&&clearTimeout(l.timeoutObject),u};o=setTimeout(a,n);let c={timeoutObject:o,clear:a,count:0};return i.set(t,c),c}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,n,i){let s,o=e;this.options.cwd&&!ue.isAbsolute(e)&&(o=ue.join(this.options.cwd,e));let a=new Date,c=l=>{Eg.stat(o,(u,f)=>{if(u||!this._pendingWrites.has(e)){u&&u.code!=="ENOENT"&&i(u);return}let h=Number(new Date);l&&f.size!==l.size&&(this._pendingWrites.get(e).lastChange=h);let g=this._pendingWrites.get(e);h-g.lastChange>=t?(this._pendingWrites.delete(e),i(void 0,f)):s=setTimeout(c,this.options.awaitWriteFinish.pollInterval,f)})};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:a,cancelWait:()=>(this._pendingWrites.delete(e),clearTimeout(s),n)}),s=setTimeout(c,this.options.awaitWriteFinish.pollInterval))}_getGlobIgnored(){return[...this._ignoredPaths.values()]}_isIgnored(e,t){if(this.options.atomic&&BU.test(e))return!0;if(!this._userIgnored){let{cwd:n}=this.options,i=this.options.ignored,s=i&&i.map(Kk(n)),o=bg(s).filter(c=>typeof c===Tg&&!fg(c)).map(c=>c+gg),a=this._getGlobIgnored().map(Kk(n)).concat(s,o);this._userIgnored=vg(a,void 0,xg)}return this._userIgnored([e,t])}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e,t){let n=t||this.options.disableGlobbing||!fg(e)?e:TU(e),i=this.options.followSymlinks;return new Sg(e,n,i,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));let t=ue.resolve(e);return this._watched.has(t)||this._watched.set(t,new wg(t,this._boundRemove)),this._watched.get(t)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return!0;let n=(e&&Number.parseInt(e.mode,10))&511;return!!(4&Number.parseInt(n.toString(8)[0],10))}_remove(e,t,n){let i=ue.join(e,t),s=ue.resolve(i);if(n=n??(this._watched.has(i)||this._watched.has(s)),!this._throttle("remove",i,100))return;!n&&!this.options.useFsEvents&&this._watched.size===1&&this.add(e,t,!0),this._getWatchedDir(i).getChildren().forEach(h=>this._remove(i,h));let c=this._getWatchedDir(e),l=c.has(t);c.remove(t),this._symlinkPaths.has(s)&&this._symlinkPaths.delete(s);let u=i;if(this.options.cwd&&(u=ue.relative(this.options.cwd,i)),this.options.awaitWriteFinish&&this._pendingWrites.has(u)&&this._pendingWrites.get(u).cancelWait()===$u)return;this._watched.delete(i),this._watched.delete(s);let f=n?MU:Wk;l&&!this._isIgnored(i)&&this._emit(f,i),this.options.useFsEvents||this._closePath(i)}_closePath(e){this._closeFile(e);let t=ue.dirname(e);this._getWatchedDir(t).remove(ue.basename(e))}_closeFile(e){let t=this._closers.get(e);t&&(t.forEach(n=>n()),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;let n={type:dg,alwaysStat:!0,lstat:!0,...t},i=EU(e,n);return this._streams.add(i),i.once(IU,()=>{i=void 0}),i.once(NU,()=>{i&&(this._streams.delete(i),i=void 0)}),i}};Cg.FSWatcher=Wu;var QU=(r,e)=>{let t=new Wu(e);return t.add(r),t};Cg.watch=QU});var UA=A((gV,Mg)=>{"use strict";var o$=Object.prototype.hasOwnProperty,Nt="~";function Pa(){}Object.create&&(Pa.prototype=Object.create(null),new Pa().__proto__||(Nt=!1));function a$(r,e,t){this.fn=r,this.context=e,this.once=t||!1}function qA(r,e,t,n,i){if(typeof t!="function")throw new TypeError("The listener must be a function");var s=new a$(t,n||r,i),o=Nt?Nt+e:e;return r._events[o]?r._events[o].fn?r._events[o]=[r._events[o],s]:r._events[o].push(s):(r._events[o]=s,r._eventsCount++),r}function Zu(r,e){--r._eventsCount===0?r._events=new Pa:delete r._events[e]}function Ct(){this._events=new Pa,this._eventsCount=0}Ct.prototype.eventNames=function(){var e=[],t,n;if(this._eventsCount===0)return e;for(n in t=this._events)o$.call(t,n)&&e.push(Nt?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};Ct.prototype.listeners=function(e){var t=Nt?Nt+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,s=n.length,o=new Array(s);i<s;i++)o[i]=n[i].fn;return o};Ct.prototype.listenerCount=function(e){var t=Nt?Nt+e:e,n=this._events[t];return n?n.fn?1:n.length:0};Ct.prototype.emit=function(e,t,n,i,s,o){var a=Nt?Nt+e:e;if(!this._events[a])return!1;var c=this._events[a],l=arguments.length,u,f;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,s),!0;case 6:return c.fn.call(c.context,t,n,i,s,o),!0}for(f=1,u=new Array(l-1);f<l;f++)u[f-1]=arguments[f];c.fn.apply(c.context,u)}else{var h=c.length,g;for(f=0;f<h;f++)switch(c[f].once&&this.removeListener(e,c[f].fn,void 0,!0),l){case 1:c[f].fn.call(c[f].context);break;case 2:c[f].fn.call(c[f].context,t);break;case 3:c[f].fn.call(c[f].context,t,n);break;case 4:c[f].fn.call(c[f].context,t,n,i);break;default:if(!u)for(g=1,u=new Array(l-1);g<l;g++)u[g-1]=arguments[g];c[f].fn.apply(c[f].context,u)}}return!0};Ct.prototype.on=function(e,t,n){return qA(this,e,t,n,!1)};Ct.prototype.once=function(e,t,n){return qA(this,e,t,n,!0)};Ct.prototype.removeListener=function(e,t,n,i){var s=Nt?Nt+e:e;if(!this._events[s])return this;if(!t)return Zu(this,s),this;var o=this._events[s];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&Zu(this,s);else{for(var a=0,c=[],l=o.length;a<l;a++)(o[a].fn!==t||i&&!o[a].once||n&&o[a].context!==n)&&c.push(o[a]);c.length?this._events[s]=c.length===1?c[0]:c:Zu(this,s)}return this};Ct.prototype.removeAllListeners=function(e){var t;return e?(t=Nt?Nt+e:e,this._events[t]&&Zu(this,t)):(this._events=new Pa,this._eventsCount=0),this};Ct.prototype.off=Ct.prototype.removeListener;Ct.prototype.addListener=Ct.prototype.on;Ct.prefixed=Nt;Ct.EventEmitter=Ct;typeof Mg<"u"&&(Mg.exports=Ct)});var WA=A((vV,$A)=>{"use strict";$A.exports=function(e,t){if(t=t.split(":")[0],e=+e,!e)return!1;switch(t){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443;case"ftp":return e!==21;case"gopher":return e!==70;case"file":return!1}return e!==0}});var Qu=A(zA=>{var kn=zA,c$=require("url"),GA=require("util")._extend,l$=WA(),u$=/(^|,)\s*upgrade\s*($|,)/i,Pg=/^https|wss/;kn.isSSL=Pg;kn.setupOutgoing=function(r,e,t,n){r.port=e[n||"target"].port||(Pg.test(e[n||"target"].protocol)?443:80),["host","hostname","socketPath","pfx","key","passphrase","cert","ca","ciphers","secureProtocol"].forEach(function(a){r[a]=e[n||"target"][a]}),r.method=e.method||t.method,r.headers=GA({},t.headers),e.headers&&GA(r.headers,e.headers),e.auth&&(r.auth=e.auth),e.ca&&(r.ca=e.ca),Pg.test(e[n||"target"].protocol)&&(r.rejectUnauthorized=typeof e.secure>"u"?!0:e.secure),r.agent=e.agent||!1,r.localAddress=e.localAddress,r.agent||(r.headers=r.headers||{},(typeof r.headers.connection!="string"||!u$.test(r.headers.connection))&&(r.headers.connection="close"));var i=e[n||"target"],s=i&&e.prependPath!==!1&&i.path||"",o=e.toProxy?t.url:c$.parse(t.url).path||"";return o=e.ignorePath?"":o,r.path=kn.urlJoin(s,o),e.changeOrigin&&(r.headers.host=l$(r.port,e[n||"target"].protocol)&&!p$(r.host)?r.host+":"+r.port:r.host),r};kn.setupSocket=function(r){return r.setTimeout(0),r.setNoDelay(!0),r.setKeepAlive(!0,0),r};kn.getPort=function(r){var e=r.headers.host?r.headers.host.match(/:(\d+)/):"";return e?e[1]:kn.hasEncryptedConnection(r)?"443":"80"};kn.hasEncryptedConnection=function(r){return!!(r.connection.encrypted||r.connection.pair)};kn.urlJoin=function(){var r=Array.prototype.slice.call(arguments),e=r.length-1,t=r[e],n=t.split("?"),i;return r[e]=n.shift(),i=[r.filter(Boolean).join("/").replace(/\/+/g,"/").replace("http:/","http://").replace("https:/","https://")],i.push.apply(i,n),i.join("?")};kn.rewriteCookieProperty=function r(e,t,n){return Array.isArray(e)?e.map(function(i){return r(i,t,n)}):e.replace(new RegExp("(;\\s*"+n+"=)([^;]+)","i"),function(i,s,o){var a;if(o in t)a=t[o];else if("*"in t)a=t["*"];else return i;return a?s+a:""})};function p$(r){return!!~r.indexOf(":")}});var JA=A((xV,YA)=>{var VA=require("url"),KA=Qu(),f$=/^201|30(1|2|7|8)$/;YA.exports={removeChunked:function(e,t,n){e.httpVersion==="1.0"&&delete n.headers["transfer-encoding"]},setConnection:function(e,t,n){e.httpVersion==="1.0"?n.headers.connection=e.headers.connection||"close":e.httpVersion!=="2.0"&&!n.headers.connection&&(n.headers.connection=e.headers.connection||"keep-alive")},setRedirectHostRewrite:function(e,t,n,i){if((i.hostRewrite||i.autoRewrite||i.protocolRewrite)&&n.headers.location&&f$.test(n.statusCode)){var s=VA.parse(i.target),o=VA.parse(n.headers.location);if(s.host!=o.host)return;i.hostRewrite?o.host=i.hostRewrite:i.autoRewrite&&(o.host=e.headers.host),i.protocolRewrite&&(o.protocol=i.protocolRewrite),n.headers.location=o.format()}},writeHeaders:function(e,t,n,i){var s=i.cookieDomainRewrite,o=i.cookiePathRewrite,a=i.preserveHeaderKeyCase,c,l=function(h,g){g!=null&&(s&&h.toLowerCase()==="set-cookie"&&(g=KA.rewriteCookieProperty(g,s,"domain")),o&&h.toLowerCase()==="set-cookie"&&(g=KA.rewriteCookieProperty(g,o,"path")),t.setHeader(String(h).trim(),g))};if(typeof s=="string"&&(s={"*":s}),typeof o=="string"&&(o={"*":o}),a&&n.rawHeaders!=null){c={};for(var u=0;u<n.rawHeaders.length;u+=2){var f=n.rawHeaders[u];c[f.toLowerCase()]=f}}Object.keys(n.headers).forEach(function(h){var g=n.headers[h];a&&c&&(h=c[h]||h),l(h,g)})},writeStatusCode:function(e,t,n){n.statusMessage?(t.statusCode=n.statusCode,t.statusMessage=n.statusMessage):t.statusCode=n.statusCode}}});var ZA=A((_V,XA)=>{var Ia;XA.exports=function(){if(!Ia){try{Ia=Ae()("follow-redirects")}catch{}typeof Ia!="function"&&(Ia=function(){})}Ia.apply(null,arguments)}});var nR=A((bV,Wg)=>{var Da=require("url"),Na=Da.URL,d$=require("http"),h$=require("https"),Bg=require("stream").Writable,jg=require("assert"),QA=ZA();(function(){var e=typeof process<"u",t=typeof window<"u"&&typeof document<"u",n=Oi(Error.captureStackTrace);!e&&(t||!n)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var Fg=!1;try{jg(new Na(""))}catch(r){Fg=r.code==="ERR_INVALID_URL"}var m$=["Authorization","Proxy-Authorization","Cookie"],g$=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],Hg=["abort","aborted","connect","error","socket","timeout"],qg=Object.create(null);Hg.forEach(function(r){qg[r]=function(e,t,n){this._redirectable.emit(r,e,t,n)}});var Ng=La("ERR_INVALID_URL","Invalid URL",TypeError),Dg=La("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),v$=La("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",Dg),y$=La("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),x$=La("ERR_STREAM_WRITE_AFTER_END","write after end"),_$=Bg.prototype.destroy||tR;function zt(r,e){Bg.call(this),this._sanitizeOptions(r),this._options=r,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],e&&this.on("response",e);var t=this;this._onNativeResponse=function(n){try{t._processResponse(n)}catch(i){t.emit("error",i instanceof Dg?i:new Dg({cause:i}))}},this._headerFilter=new RegExp("^(?:"+m$.concat(r.sensitiveHeaders).map(C$).join("|")+")$","i"),this._performRequest()}zt.prototype=Object.create(Bg.prototype);zt.prototype.abort=function(){$g(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};zt.prototype.destroy=function(r){return $g(this._currentRequest,r),_$.call(this,r),this};zt.prototype.write=function(r,e,t){if(this._ending)throw new x$;if(!Ri(r)&&!E$(r))throw new TypeError("data should be a string, Buffer or Uint8Array");if(Oi(e)&&(t=e,e=null),r.length===0){t&&t();return}this._requestBodyLength+r.length<=this._options.maxBodyLength?(this._requestBodyLength+=r.length,this._requestBodyBuffers.push({data:r,encoding:e}),this._currentRequest.write(r,e,t)):(this.emit("error",new y$),this.abort())};zt.prototype.end=function(r,e,t){if(Oi(r)?(t=r,r=e=null):Oi(e)&&(t=e,e=null),!r)this._ended=this._ending=!0,this._currentRequest.end(null,null,t);else{var n=this,i=this._currentRequest;this.write(r,e,function(){n._ended=!0,i.end(null,null,t)}),this._ending=!0}};zt.prototype.setHeader=function(r,e){this._options.headers[r]=e,this._currentRequest.setHeader(r,e)};zt.prototype.removeHeader=function(r){delete this._options.headers[r],this._currentRequest.removeHeader(r)};zt.prototype.setTimeout=function(r,e){var t=this;function n(o){o.setTimeout(r),o.removeListener("timeout",o.destroy),o.addListener("timeout",o.destroy)}function i(o){t._timeout&&clearTimeout(t._timeout),t._timeout=setTimeout(function(){t.emit("timeout"),s()},r),n(o)}function s(){t._timeout&&(clearTimeout(t._timeout),t._timeout=null),t.removeListener("abort",s),t.removeListener("error",s),t.removeListener("response",s),t.removeListener("close",s),e&&t.removeListener("timeout",e),t.socket||t._currentRequest.removeListener("socket",i)}return e&&this.on("timeout",e),this.socket?i(this.socket):this._currentRequest.once("socket",i),this.on("socket",n),this.on("abort",s),this.on("error",s),this.on("response",s),this.on("close",s),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(r){zt.prototype[r]=function(e,t){return this._currentRequest[r](e,t)}});["aborted","connection","socket"].forEach(function(r){Object.defineProperty(zt.prototype,r,{get:function(){return this._currentRequest[r]}})});zt.prototype._sanitizeOptions=function(r){if(r.headers||(r.headers={}),S$(r.sensitiveHeaders)||(r.sensitiveHeaders=[]),r.host&&(r.hostname||(r.hostname=r.host),delete r.host),!r.pathname&&r.path){var e=r.path.indexOf("?");e<0?r.pathname=r.path:(r.pathname=r.path.substring(0,e),r.search=r.path.substring(e))}};zt.prototype._performRequest=function(){var r=this._options.protocol,e=this._options.nativeProtocols[r];if(!e)throw new TypeError("Unsupported protocol "+r);if(this._options.agents){var t=r.slice(0,-1);this._options.agent=this._options.agents[t]}var n=this._currentRequest=e.request(this._options,this._onNativeResponse);n._redirectable=this;for(var i of Hg)n.on(i,qg[i]);if(this._currentUrl=/^\//.test(this._options.path)?Da.format(this._options):this._options.path,this._isRedirect){var s=0,o=this,a=this._requestBodyBuffers;(function c(l){if(n===o._currentRequest)if(l)o.emit("error",l);else if(s<a.length){var u=a[s++];n.finished||n.write(u.data,u.encoding,c)}else o._ended&&n.end()})()}};zt.prototype._processResponse=function(r){var e=r.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:r.headers,statusCode:e});var t=r.headers.location;if(!t||this._options.followRedirects===!1||e<300||e>=400){r.responseUrl=this._currentUrl,r.redirects=this._redirects,this.emit("response",r),this._requestBodyBuffers=[];return}if($g(this._currentRequest),r.destroy(),++this._redirectCount>this._options.maxRedirects)throw new v$;var n,i=this._options.beforeRedirect;i&&(n=Object.assign({Host:r.req.getHeader("host")},this._options.headers));var s=this._options.method;((e===301||e===302)&&this._options.method==="POST"||e===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],Ig(/^content-/i,this._options.headers));var o=Ig(/^host$/i,this._options.headers),a=Ug(this._currentUrl),c=o||a.host,l=/^\w+:/.test(t)?this._currentUrl:Da.format(Object.assign(a,{host:c})),u=b$(t,l);if(QA("redirecting to",u.href),this._isRedirect=!0,Lg(u,this._options),(u.protocol!==a.protocol&&u.protocol!=="https:"||u.host!==c&&!w$(u.host,c))&&Ig(this._headerFilter,this._options.headers),Oi(i)){var f={headers:r.headers,statusCode:e},h={url:l,method:s,headers:n};i(this._options,f,h),this._sanitizeOptions(this._options)}this._performRequest()};function eR(r){var e={maxRedirects:21,maxBodyLength:10485760},t={};return Object.keys(r).forEach(function(n){var i=n+":",s=t[i]=r[n],o=e[n]=Object.create(s);function a(l,u,f){return T$(l)?l=Lg(l):Ri(l)?l=Lg(Ug(l)):(f=u,u=rR(l),l={protocol:i}),Oi(u)&&(f=u,u=null),u=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},l,u),u.nativeProtocols=t,!Ri(u.host)&&!Ri(u.hostname)&&(u.hostname="::1"),jg.equal(u.protocol,i,"protocol mismatch"),QA("options",u),new zt(u,f)}function c(l,u,f){var h=o.request(l,u,f);return h.end(),h}Object.defineProperties(o,{request:{value:a,configurable:!0,enumerable:!0,writable:!0},get:{value:c,configurable:!0,enumerable:!0,writable:!0}})}),e}function tR(){}function Ug(r){var e;if(Fg)e=new Na(r);else if(e=rR(Da.parse(r)),!Ri(e.protocol))throw new Ng({input:r});return e}function b$(r,e){return Fg?new Na(r,e):Ug(Da.resolve(e,r))}function rR(r){if(/^\[/.test(r.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(r.hostname))throw new Ng({input:r.href||r});if(/^\[/.test(r.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(r.host))throw new Ng({input:r.href||r});return r}function Lg(r,e){var t=e||{};for(var n of g$)t[n]=r[n];return t.hostname.startsWith("[")&&(t.hostname=t.hostname.slice(1,-1)),t.port!==""&&(t.port=Number(t.port)),t.path=t.search?t.pathname+t.search:t.pathname,t}function Ig(r,e){var t;for(var n in e)r.test(n)&&(t=e[n],delete e[n]);return t===null||typeof t>"u"?void 0:String(t).trim()}function La(r,e,t){function n(i){Oi(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,i||{}),this.code=r,this.message=this.cause?e+": "+this.cause.message:e}return n.prototype=new(t||Error),Object.defineProperties(n.prototype,{constructor:{value:n,enumerable:!1},name:{value:"Error ["+r+"]",enumerable:!1}}),n}function $g(r,e){for(var t of Hg)r.removeListener(t,qg[t]);r.on("error",tR),r.destroy(e)}function w$(r,e){jg(Ri(r)&&Ri(e));var t=r.length-e.length-1;return t>0&&r[t]==="."&&r.endsWith(e)}function S$(r){return r instanceof Array}function Ri(r){return typeof r=="string"||r instanceof String}function Oi(r){return typeof r=="function"}function E$(r){return typeof r=="object"&&"length"in r}function T$(r){return Na&&r instanceof Na}function C$(r){return r.replace(/[\]\\/()*+?.$]/g,"\\$&")}Wg.exports=eR({http:d$,https:h$});Wg.exports.wrap=eR});var sR=A((wV,iR)=>{var k$=require("http"),A$=require("https"),Ba=JA(),ep=Qu(),R$=nR();Ba=Object.keys(Ba).map(function(r){return Ba[r]});var O$={http:k$,https:A$};iR.exports={deleteLength:function(e,t,n){(e.method==="DELETE"||e.method==="OPTIONS")&&!e.headers["content-length"]&&(e.headers["content-length"]="0",delete e.headers["transfer-encoding"])},timeout:function(e,t,n){n.timeout&&e.socket.setTimeout(n.timeout)},XHeaders:function(e,t,n){if(n.xfwd){var i=e.isSpdy||ep.hasEncryptedConnection(e),s={for:e.connection.remoteAddress||e.socket.remoteAddress,port:ep.getPort(e),proto:i?"https":"http"};["for","port","proto"].forEach(function(o){e.headers["x-forwarded-"+o]=(e.headers["x-forwarded-"+o]||"")+(e.headers["x-forwarded-"+o]?",":"")+s[o]}),e.headers["x-forwarded-host"]=e.headers["x-forwarded-host"]||e.headers.host||""}},stream:function(e,t,n,i,s,o){s.emit("start",e,t,n.target||n.forward);var a=n.followRedirects?R$:O$,c=a.http,l=a.https;if(n.forward){var u=(n.forward.protocol==="https:"?l:c).request(ep.setupOutgoing(n.ssl||{},n,e,"forward")),f=x(u,n.forward);if(e.on("error",f),u.on("error",f),(n.buffer||e).pipe(u),!n.target)return t.end()}var h=(n.target.protocol==="https:"?l:c).request(ep.setupOutgoing(n.ssl||{},n,e));h.on("socket",function(S){s&&!h.getHeader("expect")&&s.emit("proxyReq",h,e,t,n)}),n.proxyTimeout&&h.setTimeout(n.proxyTimeout,function(){h.abort()}),e.on("aborted",function(){h.abort()});var g=x(h,n.target);e.on("error",g),h.on("error",g);function x(S,k){return function(M){if(e.socket.destroyed&&M.code==="ECONNRESET")return s.emit("econnreset",M,e,t,k),S.abort();o?o(M,e,t,k):s.emit("error",M,e,t,k)}}(n.buffer||e).pipe(h),h.on("response",function(S){if(s&&s.emit("proxyRes",S,e,t),!t.headersSent&&!n.selfHandleResponse)for(var k=0;k<Ba.length&&!Ba[k](e,t,S,n);k++);t.finished?s&&s.emit("end",e,t,S):(S.on("end",function(){s&&s.emit("end",e,t,S)}),n.selfHandleResponse||S.pipe(t))})}}});var aR=A((SV,oR)=>{var M$=require("http"),P$=require("https"),no=Qu();oR.exports={checkMethodAndHeader:function(e,t){if(e.method!=="GET"||!e.headers.upgrade||e.headers.upgrade.toLowerCase()!=="websocket")return t.destroy(),!0},XHeaders:function(e,t,n){if(n.xfwd){var i={for:e.connection.remoteAddress||e.socket.remoteAddress,port:no.getPort(e),proto:no.hasEncryptedConnection(e)?"wss":"ws"};["for","port","proto"].forEach(function(s){e.headers["x-forwarded-"+s]=(e.headers["x-forwarded-"+s]||"")+(e.headers["x-forwarded-"+s]?",":"")+i[s]})}},stream:function(e,t,n,i,s,o){var a=function(u,f){return Object.keys(f).reduce(function(h,g){var x=f[g];if(!Array.isArray(x))return h.push(g+": "+x),h;for(var S=0;S<x.length;S++)h.push(g+": "+x[S]);return h},[u]).join(`\r
|
|
103
|
+
`;let c=(0,KF.parseProxyResponse)(i);i.write(`${a}\r
|
|
104
|
+
`);let{connect:l,buffered:u}=await c;if(e.emit("proxyConnect",l),this.emit("proxyConnect",l,e),l.statusCode===200)return e.once("socket",YF),t.secureEndpoint?(ua("Upgrading socket connection to TLS"),mT.connect({...vT(gT(t),"host","path","port"),socket:i})):i;i.destroy();let f=new yu.Socket({writable:!1});return f.readable=!0,e.once("socket",h=>{ua("Replaying proxy buffer for failed request"),(0,WF.default)(h.listenerCount("data")>0),h.push(u),h.push(null)}),f}};xu.protocols=["http","https"];xr.HttpsProxyAgent=xu;function YF(r){r.resume()}function vT(r,...e){let t={},n;for(n in r)e.includes(n)||(t[n]=r[n]);return t}});var TT=A((KG,ET)=>{"use strict";var wT=require("url"),ST=require("https"),JF=Cm(),_u=wm(),XF=Tm(),tr=du(),ZF=_m(),bT=2419200,Am="",Rm;function pa(){}pa.prototype.setGCMAPIKey=function(r){if(r===null){Am=null;return}if(typeof r>"u"||typeof r!="string"||r.length===0)throw new Error("The GCM API Key should be a non-empty string or null.");Am=r};pa.prototype.setVapidDetails=function(r,e,t){if(arguments.length===1&&arguments[0]===null){Rm=null;return}_u.validateSubject(r),_u.validatePublicKey(e),_u.validatePrivateKey(t),Rm={subject:r,publicKey:e,privateKey:t}};pa.prototype.generateRequestDetails=function(r,e,t){if(!r||!r.endpoint)throw new Error("You must pass in a subscription with at least an endpoint.");if(typeof r.endpoint!="string"||r.endpoint.length===0)throw new Error("The subscription endpoint must be a string with a valid URL.");if(e&&(typeof r!="object"||!r.keys||!r.keys.p256dh||!r.keys.auth))throw new Error("To send a message with a payload, the subscription must have 'auth' and 'p256dh' keys.");let n=Am,i=Rm,s=bT,o={},a=tr.supportedContentEncodings.AES_128_GCM,c=tr.supportedUrgency.NORMAL,l,u,f,h;if(t){let R=["headers","gcmAPIKey","vapidDetails","TTL","contentEncoding","urgency","topic","proxy","agent","timeout"],M=Object.keys(t);for(let I=0;I<M.length;I+=1){let B=M[I];if(!R.includes(B))throw new Error("'"+B+"' is an invalid option. The valid options are ['"+R.join("', '")+"'].")}if(t.headers){o=t.headers;let I=Object.keys(o).filter(function(B){return typeof t[B]<"u"});if(I.length>0)throw new Error("Duplicated headers defined ["+I.join(",")+"]. Please either define the header in thetop level options OR in the 'headers' key.")}if(t.gcmAPIKey&&(n=t.gcmAPIKey),t.vapidDetails!==void 0&&(i=t.vapidDetails),t.TTL!==void 0&&(s=Number(t.TTL),s<0))throw new Error("TTL should be a number and should be at least 0");if(t.contentEncoding)if(t.contentEncoding===tr.supportedContentEncodings.AES_128_GCM||t.contentEncoding===tr.supportedContentEncodings.AES_GCM)a=t.contentEncoding;else throw new Error("Unsupported content encoding specified.");if(t.urgency)if(t.urgency===tr.supportedUrgency.VERY_LOW||t.urgency===tr.supportedUrgency.LOW||t.urgency===tr.supportedUrgency.NORMAL||t.urgency===tr.supportedUrgency.HIGH)c=t.urgency;else throw new Error("Unsupported urgency specified.");if(t.topic){if(!ZF.validate(t.topic))throw new Error("Unsupported characters set use the URL or filename-safe Base64 characters set");if(t.topic.length>32)throw new Error("use maximum of 32 characters from the URL or filename-safe Base64 characters set");l=t.topic}t.proxy&&(typeof t.proxy=="string"||typeof t.proxy.host=="string"?u=t.proxy:console.warn("Attempt to use proxy option, but invalid type it should be a string or proxy options object.")),t.agent&&(t.agent instanceof ST.Agent?(u&&console.warn("Agent option will be ignored because proxy option is defined."),f=t.agent):console.warn("Wrong type for the agent option, it should be an instance of https.Agent.")),typeof t.timeout=="number"&&(h=t.timeout)}typeof s>"u"&&(s=bT);let g={method:"POST",headers:{TTL:s}};Object.keys(o).forEach(function(R){g.headers[R]=o[R]});let x=null;if(e){let R=XF.encrypt(r.keys.p256dh,r.keys.auth,e,a);g.headers["Content-Length"]=R.cipherText.length,g.headers["Content-Type"]="application/octet-stream",a===tr.supportedContentEncodings.AES_128_GCM?g.headers["Content-Encoding"]=tr.supportedContentEncodings.AES_128_GCM:a===tr.supportedContentEncodings.AES_GCM&&(g.headers["Content-Encoding"]=tr.supportedContentEncodings.AES_GCM,g.headers.Encryption="salt="+R.salt,g.headers["Crypto-Key"]="dh="+R.localPublicKey.toString("base64url")),x=R.cipherText}else g.headers["Content-Length"]=0;let S=r.endpoint.startsWith("https://android.googleapis.com/gcm/send"),C=r.endpoint.startsWith("https://fcm.googleapis.com/fcm/send");if(S)n?g.headers.Authorization="key="+n:console.warn("Attempt to send push notification to GCM endpoint, but no GCM key is defined. Please use setGCMApiKey() or add 'gcmAPIKey' as an option.");else if(i){let R=wT.parse(r.endpoint),M=R.protocol+"//"+R.host,I=_u.getVapidHeaders(M,i.subject,i.publicKey,i.privateKey,a);g.headers.Authorization=I.Authorization,a===tr.supportedContentEncodings.AES_GCM&&(g.headers["Crypto-Key"]?g.headers["Crypto-Key"]+=";"+I["Crypto-Key"]:g.headers["Crypto-Key"]=I["Crypto-Key"])}else C&&n&&(g.headers.Authorization="key="+n);return g.headers.Urgency=c,l&&(g.headers.Topic=l),g.body=x,g.endpoint=r.endpoint,u&&(g.proxy=u),f&&(g.agent=f),h&&(g.timeout=h),g};pa.prototype.sendNotification=function(r,e,t){let n;try{n=this.generateRequestDetails(r,e,t)}catch(i){return Promise.reject(i)}return new Promise(function(i,s){let o={},a=wT.parse(n.endpoint);if(o.hostname=a.hostname,o.port=a.port,o.path=a.path,o.headers=n.headers,o.method=n.method,n.timeout&&(o.timeout=n.timeout),n.agent&&(o.agent=n.agent),n.proxy){let{HttpsProxyAgent:l}=_T();o.agent=new l(n.proxy)}let c=ST.request(o,function(l){let u="";l.on("data",function(f){u+=f}),l.on("end",function(){l.statusCode<200||l.statusCode>299?s(new JF("Received unexpected response code",l.statusCode,l.headers,u,n.endpoint)):i({statusCode:l.statusCode,body:u,headers:l.headers})})});n.timeout&&c.on("timeout",function(){c.destroy(new Error("Socket timeout"))}),c.on("error",function(l){s(l)}),n.body&&c.write(n.body),c.end()})};ET.exports=pa});var AT=A((YG,kT)=>{"use strict";var CT=wm(),QF=Tm(),e3=TT(),t3=Cm(),r3=du(),fa=new e3;kT.exports={WebPushError:t3,supportedContentEncodings:r3.supportedContentEncodings,encrypt:QF.encrypt,getVapidHeaders:CT.getVapidHeaders,generateVAPIDKeys:CT.generateVAPIDKeys,setGCMAPIKey:fa.setGCMAPIKey,setVapidDetails:fa.setVapidDetails,generateRequestDetails:fa.generateRequestDetails,sendNotification:fa.sendNotification.bind(fa)}});var va=A((Cz,hC)=>{"use strict";var K3=require("path"),Zr="\\\\/",uC=`[^${Zr}]`,Y3=0,En="\\.",J3="\\+",X3="\\?",ku="\\/",Z3="(?=.)",pC="[^/]",Nm=`(?:${ku}|$)`,fC=`(?:^|${ku})`,Dm=`${En}{1,2}${Nm}`,Q3=`(?!${En})`,eH=`(?!${fC}${Dm})`,tH=`(?!${En}{0,1}${Nm})`,rH=`(?!${Dm})`,nH=`[^.${ku}]`,iH=`${pC}*?`,dC={DOT_LITERAL:En,PLUS_LITERAL:J3,QMARK_LITERAL:X3,SLASH_LITERAL:ku,ONE_CHAR:Z3,QMARK:pC,END_ANCHOR:Nm,DOTS_SLASH:Dm,NO_DOT:Q3,NO_DOTS:eH,NO_DOT_SLASH:tH,NO_DOTS_SLASH:rH,QMARK_NO_DOT:nH,STAR:iH,START_ANCHOR:fC},sH={...dC,SLASH_LITERAL:`[${Zr}]`,QMARK:uC,STAR:`${uC}*?`,DOTS_SLASH:`${En}{1,2}(?:[${Zr}]|$)`,NO_DOT:`(?!${En})`,NO_DOTS:`(?!(?:^|[${Zr}])${En}{1,2}(?:[${Zr}]|$))`,NO_DOT_SLASH:`(?!${En}{0,1}(?:[${Zr}]|$))`,NO_DOTS_SLASH:`(?!${En}{1,2}(?:[${Zr}]|$))`,QMARK_NO_DOT:`[^.${Zr}]`,START_ANCHOR:`(?:^|[${Zr}])`,END_ANCHOR:`(?:[${Zr}]|$)`},oH={__proto__:null,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"};hC.exports={DEFAULT_MAX_EXTGLOB_RECURSION:Y3,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:oH,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:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},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:K3.sep,extglobChars(r){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${r.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(r){return r===!0?sH:dC}}});var Au=A(Gt=>{"use strict";var aH=require("path"),cH=process.platform==="win32",{REGEX_BACKSLASH:lH,REGEX_REMOVE_BACKSLASH:uH,REGEX_SPECIAL_CHARS:pH,REGEX_SPECIAL_CHARS_GLOBAL:fH}=va();Gt.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r);Gt.hasRegexChars=r=>pH.test(r);Gt.isRegexChar=r=>r.length===1&&Gt.hasRegexChars(r);Gt.escapeRegex=r=>r.replace(fH,"\\$1");Gt.toPosixSlashes=r=>r.replace(lH,"/");Gt.removeBackslashes=r=>r.replace(uH,e=>e==="\\"?"":e);Gt.supportsLookbehinds=()=>{let r=process.version.slice(1).split(".").map(Number);return r.length===3&&r[0]>=9||r[0]===8&&r[1]>=10};Gt.isWindows=r=>r&&typeof r.windows=="boolean"?r.windows:cH===!0||aH.sep==="\\";Gt.escapeLast=(r,e,t)=>{let n=r.lastIndexOf(e,t);return n===-1?r:r[n-1]==="\\"?Gt.escapeLast(r,e,n-1):`${r.slice(0,n)}\\${r.slice(n)}`};Gt.removePrefix=(r,e={})=>{let t=r;return t.startsWith("./")&&(t=t.slice(2),e.prefix="./"),t};Gt.wrapOutput=(r,e={},t={})=>{let n=t.contains?"":"^",i=t.contains?"":"$",s=`${n}(?:${r})${i}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}});var wC=A((Az,bC)=>{"use strict";var mC=Au(),{CHAR_ASTERISK:Lm,CHAR_AT:dH,CHAR_BACKWARD_SLASH:ya,CHAR_COMMA:hH,CHAR_DOT:Bm,CHAR_EXCLAMATION_MARK:jm,CHAR_FORWARD_SLASH:_C,CHAR_LEFT_CURLY_BRACE:Fm,CHAR_LEFT_PARENTHESES:Hm,CHAR_LEFT_SQUARE_BRACKET:mH,CHAR_PLUS:gH,CHAR_QUESTION_MARK:gC,CHAR_RIGHT_CURLY_BRACE:vH,CHAR_RIGHT_PARENTHESES:vC,CHAR_RIGHT_SQUARE_BRACKET:yH}=va(),yC=r=>r===_C||r===ya,xC=r=>{r.isPrefix!==!0&&(r.depth=r.isGlobstar?1/0:1)},xH=(r,e)=>{let t=e||{},n=r.length-1,i=t.parts===!0||t.scanToEnd===!0,s=[],o=[],a=[],c=r,l=-1,u=0,f=0,h=!1,g=!1,x=!1,S=!1,C=!1,R=!1,M=!1,I=!1,B=!1,V=!1,F=0,G,D,U={value:"",depth:0,isGlob:!1},T=()=>l>=n,p=()=>c.charCodeAt(l+1),m=()=>(G=D,c.charCodeAt(++l));for(;l<n;){D=m();let k;if(D===ya){M=U.backslashes=!0,D=m(),D===Fm&&(R=!0);continue}if(R===!0||D===Fm){for(F++;T()!==!0&&(D=m());){if(D===ya){M=U.backslashes=!0,m();continue}if(D===Fm){F++;continue}if(R!==!0&&D===Bm&&(D=m())===Bm){if(h=U.isBrace=!0,x=U.isGlob=!0,V=!0,i===!0)continue;break}if(R!==!0&&D===hH){if(h=U.isBrace=!0,x=U.isGlob=!0,V=!0,i===!0)continue;break}if(D===vH&&(F--,F===0)){R=!1,h=U.isBrace=!0,V=!0;break}}if(i===!0)continue;break}if(D===_C){if(s.push(l),o.push(U),U={value:"",depth:0,isGlob:!1},V===!0)continue;if(G===Bm&&l===u+1){u+=2;continue}f=l+1;continue}if(t.noext!==!0&&(D===gH||D===dH||D===Lm||D===gC||D===jm)===!0&&p()===Hm){if(x=U.isGlob=!0,S=U.isExtglob=!0,V=!0,D===jm&&l===u&&(B=!0),i===!0){for(;T()!==!0&&(D=m());){if(D===ya){M=U.backslashes=!0,D=m();continue}if(D===vC){x=U.isGlob=!0,V=!0;break}}continue}break}if(D===Lm){if(G===Lm&&(C=U.isGlobstar=!0),x=U.isGlob=!0,V=!0,i===!0)continue;break}if(D===gC){if(x=U.isGlob=!0,V=!0,i===!0)continue;break}if(D===mH){for(;T()!==!0&&(k=m());){if(k===ya){M=U.backslashes=!0,m();continue}if(k===yH){g=U.isBracket=!0,x=U.isGlob=!0,V=!0;break}}if(i===!0)continue;break}if(t.nonegate!==!0&&D===jm&&l===u){I=U.negated=!0,u++;continue}if(t.noparen!==!0&&D===Hm){if(x=U.isGlob=!0,i===!0){for(;T()!==!0&&(D=m());){if(D===Hm){M=U.backslashes=!0,D=m();continue}if(D===vC){V=!0;break}}continue}break}if(x===!0){if(V=!0,i===!0)continue;break}}t.noext===!0&&(S=!1,x=!1);let y=c,w="",v="";u>0&&(w=c.slice(0,u),c=c.slice(u),f-=u),y&&x===!0&&f>0?(y=c.slice(0,f),v=c.slice(f)):x===!0?(y="",v=c):y=c,y&&y!==""&&y!=="/"&&y!==c&&yC(y.charCodeAt(y.length-1))&&(y=y.slice(0,-1)),t.unescape===!0&&(v&&(v=mC.removeBackslashes(v)),y&&M===!0&&(y=mC.removeBackslashes(y)));let _={prefix:w,input:r,start:u,base:y,glob:v,isBrace:h,isBracket:g,isGlob:x,isExtglob:S,isGlobstar:C,negated:I,negatedExtglob:B};if(t.tokens===!0&&(_.maxDepth=0,yC(D)||o.push(U),_.tokens=o),t.parts===!0||t.tokens===!0){let k;for(let b=0;b<s.length;b++){let d=k?k+1:u,E=s[b],q=r.slice(d,E);t.tokens&&(b===0&&u!==0?(o[b].isPrefix=!0,o[b].value=w):o[b].value=q,xC(o[b]),_.maxDepth+=o[b].depth),(b!==0||q!=="")&&a.push(q),k=E}if(k&&k+1<r.length){let b=r.slice(k+1);a.push(b),t.tokens&&(o[o.length-1].value=b,xC(o[o.length-1]),_.maxDepth+=o[o.length-1].depth)}_.slashes=s,_.parts=a}return _};bC.exports=xH});var kC=A((Rz,CC)=>{"use strict";var xa=va(),Ct=Au(),{MAX_LENGTH:Ru,POSIX_REGEX_SOURCE:_H,REGEX_NON_SPECIAL_CHARS:bH,REGEX_SPECIAL_CHARS_BACKREF:wH,REPLACEMENTS:SC}=xa,SH=(r,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...r,e);r.sort();let t=`[${r.join("-")}]`;try{new RegExp(t)}catch{return r.map(i=>Ct.escapeRegex(i)).join("..")}return t},Ks=(r,e)=>`Missing ${r}: "${e}" - use "\\\\${e}" to match literal characters`,EC=r=>{let e=[],t=0,n=0,i=0,s="",o=!1;for(let a of r){if(o===!0){s+=a,o=!1;continue}if(a==="\\"){s+=a,o=!0;continue}if(a==='"'){i=i===1?0:1,s+=a;continue}if(i===0){if(a==="[")t++;else if(a==="]"&&t>0)t--;else if(t===0){if(a==="(")n++;else if(a===")"&&n>0)n--;else if(a==="|"&&n===0){e.push(s),s="";continue}}}s+=a}return e.push(s),e},EH=r=>{let e=!1;for(let t of r){if(e===!0){e=!1;continue}if(t==="\\"){e=!0;continue}if(/[?*+@!()[\]{}]/.test(t))return!1}return!0},TC=r=>{let e=r.trim(),t=!0;for(;t===!0;)t=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),t=!0);if(EH(e))return e.replace(/\\(.)/g,"$1")},TH=r=>{let e=r.map(TC).filter(Boolean);for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++){let i=e[t],s=e[n],o=i[0];if(!(!o||i!==o.repeat(i.length)||s!==o.repeat(s.length))&&(i===s||i.startsWith(s)||s.startsWith(i)))return!0}return!1},qm=(r,e=!0)=>{if(r[0]!=="+"&&r[0]!=="*"||r[1]!=="(")return;let t=0,n=0,i=0,s=!1;for(let o=1;o<r.length;o++){let a=r[o];if(s===!0){s=!1;continue}if(a==="\\"){s=!0;continue}if(a==='"'){i=i===1?0:1;continue}if(i!==1){if(a==="["){t++;continue}if(a==="]"&&t>0){t--;continue}if(!(t>0)){if(a==="("){n++;continue}if(a===")"&&(n--,n===0))return e===!0&&o!==r.length-1?void 0:{type:r[0],body:r.slice(2,o),end:o}}}}},CH=r=>{let e=0,t=[];for(;e<r.length;){let i=qm(r.slice(e),!1);if(!i||i.type!=="*")return;let s=EC(i.body).map(a=>a.trim());if(s.length!==1)return;let o=TC(s[0]);if(!o||o.length!==1)return;t.push(o),e+=i.end+1}return t.length<1?void 0:`${t.length===1?Ct.escapeRegex(t[0]):`[${t.map(i=>Ct.escapeRegex(i)).join("")}]`}*`},kH=r=>{let e=0,t=r.trim(),n=qm(t);for(;n;)e++,t=n.body.trim(),n=qm(t);return e},AH=(r,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let t=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:xa.DEFAULT_MAX_EXTGLOB_RECURSION,n=EC(r).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||TH(n)))return{risky:!0};for(let i of n){let s=CH(i);if(s)return{risky:!0,safeOutput:s};if(kH(i)>t)return{risky:!0}}return{risky:!1}},Um=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a string");r=SC[r]||r;let t={...e},n=typeof t.maxLength=="number"?Math.min(Ru,t.maxLength):Ru,i=r.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let s={type:"bos",value:"",output:t.prepend||""},o=[s],a=t.capture?"":"?:",c=Ct.isWindows(e),l=xa.globChars(c),u=xa.extglobChars(l),{DOT_LITERAL:f,PLUS_LITERAL:h,SLASH_LITERAL:g,ONE_CHAR:x,DOTS_SLASH:S,NO_DOT:C,NO_DOT_SLASH:R,NO_DOTS_SLASH:M,QMARK:I,QMARK_NO_DOT:B,STAR:V,START_ANCHOR:F}=l,G=N=>`(${a}(?:(?!${F}${N.dot?S:f}).)*?)`,D=t.dot?"":C,U=t.dot?I:B,T=t.bash===!0?G(t):V;t.capture&&(T=`(${T})`),typeof t.noext=="boolean"&&(t.noextglob=t.noext);let p={input:r,index:-1,start:0,dot:t.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};r=Ct.removePrefix(r,p),i=r.length;let m=[],y=[],w=[],v=s,_,k=()=>p.index===i-1,b=p.peek=(N=1)=>r[p.index+N],d=p.advance=()=>r[++p.index]||"",E=()=>r.slice(p.index+1),q=(N="",te=0)=>{p.consumed+=N,p.index+=te},O=N=>{p.output+=N.output!=null?N.output:N.value,q(N.value)},P=()=>{let N=1;for(;b()==="!"&&(b(2)!=="("||b(3)==="?");)d(),p.start++,N++;return N%2===0?!1:(p.negated=!0,p.start++,!0)},j=N=>{p[N]++,w.push(N)},z=N=>{p[N]--,w.pop()},H=N=>{if(v.type==="globstar"){let te=p.braces>0&&(N.type==="comma"||N.type==="brace"),L=N.extglob===!0||m.length&&(N.type==="pipe"||N.type==="paren");N.type!=="slash"&&N.type!=="paren"&&!te&&!L&&(p.output=p.output.slice(0,-v.output.length),v.type="star",v.value="*",v.output=T,p.output+=v.output)}if(m.length&&N.type!=="paren"&&(m[m.length-1].inner+=N.value),(N.value||N.output)&&O(N),v&&v.type==="text"&&N.type==="text"){v.value+=N.value,v.output=(v.output||"")+N.value;return}N.prev=v,o.push(N),v=N},ke=(N,te)=>{let L={...u[te],conditions:1,inner:""};L.prev=v,L.parens=p.parens,L.output=p.output,L.startIndex=p.index,L.tokensIndex=o.length;let W=(t.capture?"(":"")+L.open;j("parens"),H({type:N,value:te,output:p.output?"":x}),H({type:"paren",extglob:!0,value:d(),output:W}),m.push(L)},ne=N=>{let te=r.slice(N.startIndex,p.index+1),L=r.slice(N.startIndex+2,p.index),W=AH(L,t);if((N.type==="plus"||N.type==="star")&&W.risky){let J=W.safeOutput?(N.output?"":x)+(t.capture?`(${W.safeOutput})`:W.safeOutput):void 0,At=o[N.tokensIndex];At.type="text",At.value=te,At.output=J||Ct.escapeRegex(te);for(let ae=N.tokensIndex+1;ae<o.length;ae++)o[ae].value="",o[ae].output="",delete o[ae].suffix;p.output=N.output+At.output,p.backtrack=!0,H({type:"paren",extglob:!0,value:_,output:""}),z("parens");return}let oe=N.close+(t.capture?")":""),Z;if(N.type==="negate"){let J=T;if(N.inner&&N.inner.length>1&&N.inner.includes("/")&&(J=G(t)),(J!==T||k()||/^\)+$/.test(E()))&&(oe=N.close=`)$))${J}`),N.inner.includes("*")&&(Z=E())&&/^\.[^\\/.]+$/.test(Z)){let At=Um(Z,{...e,fastpaths:!1}).output;oe=N.close=`)${At})${J})`}N.prev.type==="bos"&&(p.negatedExtglob=!0)}H({type:"paren",extglob:!0,value:_,output:oe}),z("parens")};if(t.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(r)){let N=!1,te=r.replace(wH,(L,W,oe,Z,J,At)=>Z==="\\"?(N=!0,L):Z==="?"?W?W+Z+(J?I.repeat(J.length):""):At===0?U+(J?I.repeat(J.length):""):I.repeat(oe.length):Z==="."?f.repeat(oe.length):Z==="*"?W?W+Z+(J?T:""):T:W?L:`\\${L}`);return N===!0&&(t.unescape===!0?te=te.replace(/\\/g,""):te=te.replace(/\\+/g,L=>L.length%2===0?"\\\\":L?"\\":"")),te===r&&t.contains===!0?(p.output=r,p):(p.output=Ct.wrapOutput(te,p,e),p)}for(;!k();){if(_=d(),_==="\0")continue;if(_==="\\"){let L=b();if(L==="/"&&t.bash!==!0||L==="."||L===";")continue;if(!L){_+="\\",H({type:"text",value:_});continue}let W=/^\\+/.exec(E()),oe=0;if(W&&W[0].length>2&&(oe=W[0].length,p.index+=oe,oe%2!==0&&(_+="\\")),t.unescape===!0?_=d():_+=d(),p.brackets===0){H({type:"text",value:_});continue}}if(p.brackets>0&&(_!=="]"||v.value==="["||v.value==="[^")){if(t.posix!==!1&&_===":"){let L=v.value.slice(1);if(L.includes("[")&&(v.posix=!0,L.includes(":"))){let W=v.value.lastIndexOf("["),oe=v.value.slice(0,W),Z=v.value.slice(W+2),J=_H[Z];if(J){v.value=oe+J,p.backtrack=!0,d(),!s.output&&o.indexOf(v)===1&&(s.output=x);continue}}}(_==="["&&b()!==":"||_==="-"&&b()==="]")&&(_=`\\${_}`),_==="]"&&(v.value==="["||v.value==="[^")&&(_=`\\${_}`),t.posix===!0&&_==="!"&&v.value==="["&&(_="^"),v.value+=_,O({value:_});continue}if(p.quotes===1&&_!=='"'){_=Ct.escapeRegex(_),v.value+=_,O({value:_});continue}if(_==='"'){p.quotes=p.quotes===1?0:1,t.keepQuotes===!0&&H({type:"text",value:_});continue}if(_==="("){j("parens"),H({type:"paren",value:_});continue}if(_===")"){if(p.parens===0&&t.strictBrackets===!0)throw new SyntaxError(Ks("opening","("));let L=m[m.length-1];if(L&&p.parens===L.parens+1){ne(m.pop());continue}H({type:"paren",value:_,output:p.parens?")":"\\)"}),z("parens");continue}if(_==="["){if(t.nobracket===!0||!E().includes("]")){if(t.nobracket!==!0&&t.strictBrackets===!0)throw new SyntaxError(Ks("closing","]"));_=`\\${_}`}else j("brackets");H({type:"bracket",value:_});continue}if(_==="]"){if(t.nobracket===!0||v&&v.type==="bracket"&&v.value.length===1){H({type:"text",value:_,output:`\\${_}`});continue}if(p.brackets===0){if(t.strictBrackets===!0)throw new SyntaxError(Ks("opening","["));H({type:"text",value:_,output:`\\${_}`});continue}z("brackets");let L=v.value.slice(1);if(v.posix!==!0&&L[0]==="^"&&!L.includes("/")&&(_=`/${_}`),v.value+=_,O({value:_}),t.literalBrackets===!1||Ct.hasRegexChars(L))continue;let W=Ct.escapeRegex(v.value);if(p.output=p.output.slice(0,-v.value.length),t.literalBrackets===!0){p.output+=W,v.value=W;continue}v.value=`(${a}${W}|${v.value})`,p.output+=v.value;continue}if(_==="{"&&t.nobrace!==!0){j("braces");let L={type:"brace",value:_,output:"(",outputIndex:p.output.length,tokensIndex:p.tokens.length};y.push(L),H(L);continue}if(_==="}"){let L=y[y.length-1];if(t.nobrace===!0||!L){H({type:"text",value:_,output:_});continue}let W=")";if(L.dots===!0){let oe=o.slice(),Z=[];for(let J=oe.length-1;J>=0&&(o.pop(),oe[J].type!=="brace");J--)oe[J].type!=="dots"&&Z.unshift(oe[J].value);W=SH(Z,t),p.backtrack=!0}if(L.comma!==!0&&L.dots!==!0){let oe=p.output.slice(0,L.outputIndex),Z=p.tokens.slice(L.tokensIndex);L.value=L.output="\\{",_=W="\\}",p.output=oe;for(let J of Z)p.output+=J.output||J.value}H({type:"brace",value:_,output:W}),z("braces"),y.pop();continue}if(_==="|"){m.length>0&&m[m.length-1].conditions++,H({type:"text",value:_});continue}if(_===","){let L=_,W=y[y.length-1];W&&w[w.length-1]==="braces"&&(W.comma=!0,L="|"),H({type:"comma",value:_,output:L});continue}if(_==="/"){if(v.type==="dot"&&p.index===p.start+1){p.start=p.index+1,p.consumed="",p.output="",o.pop(),v=s;continue}H({type:"slash",value:_,output:g});continue}if(_==="."){if(p.braces>0&&v.type==="dot"){v.value==="."&&(v.output=f);let L=y[y.length-1];v.type="dots",v.output+=_,v.value+=_,L.dots=!0;continue}if(p.braces+p.parens===0&&v.type!=="bos"&&v.type!=="slash"){H({type:"text",value:_,output:f});continue}H({type:"dot",value:_,output:f});continue}if(_==="?"){if(!(v&&v.value==="(")&&t.noextglob!==!0&&b()==="("&&b(2)!=="?"){ke("qmark",_);continue}if(v&&v.type==="paren"){let W=b(),oe=_;if(W==="<"&&!Ct.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(v.value==="("&&!/[!=<:]/.test(W)||W==="<"&&!/<([!=]|\w+>)/.test(E()))&&(oe=`\\${_}`),H({type:"text",value:_,output:oe});continue}if(t.dot!==!0&&(v.type==="slash"||v.type==="bos")){H({type:"qmark",value:_,output:B});continue}H({type:"qmark",value:_,output:I});continue}if(_==="!"){if(t.noextglob!==!0&&b()==="("&&(b(2)!=="?"||!/[!=<:]/.test(b(3)))){ke("negate",_);continue}if(t.nonegate!==!0&&p.index===0){P();continue}}if(_==="+"){if(t.noextglob!==!0&&b()==="("&&b(2)!=="?"){ke("plus",_);continue}if(v&&v.value==="("||t.regex===!1){H({type:"plus",value:_,output:h});continue}if(v&&(v.type==="bracket"||v.type==="paren"||v.type==="brace")||p.parens>0){H({type:"plus",value:_});continue}H({type:"plus",value:h});continue}if(_==="@"){if(t.noextglob!==!0&&b()==="("&&b(2)!=="?"){H({type:"at",extglob:!0,value:_,output:""});continue}H({type:"text",value:_});continue}if(_!=="*"){(_==="$"||_==="^")&&(_=`\\${_}`);let L=bH.exec(E());L&&(_+=L[0],p.index+=L[0].length),H({type:"text",value:_});continue}if(v&&(v.type==="globstar"||v.star===!0)){v.type="star",v.star=!0,v.value+=_,v.output=T,p.backtrack=!0,p.globstar=!0,q(_);continue}let N=E();if(t.noextglob!==!0&&/^\([^?]/.test(N)){ke("star",_);continue}if(v.type==="star"){if(t.noglobstar===!0){q(_);continue}let L=v.prev,W=L.prev,oe=L.type==="slash"||L.type==="bos",Z=W&&(W.type==="star"||W.type==="globstar");if(t.bash===!0&&(!oe||N[0]&&N[0]!=="/")){H({type:"star",value:_,output:""});continue}let J=p.braces>0&&(L.type==="comma"||L.type==="brace"),At=m.length&&(L.type==="pipe"||L.type==="paren");if(!oe&&L.type!=="paren"&&!J&&!At){H({type:"star",value:_,output:""});continue}for(;N.slice(0,3)==="/**";){let ae=r[p.index+4];if(ae&&ae!=="/")break;N=N.slice(3),q("/**",3)}if(L.type==="bos"&&k()){v.type="globstar",v.value+=_,v.output=G(t),p.output=v.output,p.globstar=!0,q(_);continue}if(L.type==="slash"&&L.prev.type!=="bos"&&!Z&&k()){p.output=p.output.slice(0,-(L.output+v.output).length),L.output=`(?:${L.output}`,v.type="globstar",v.output=G(t)+(t.strictSlashes?")":"|$)"),v.value+=_,p.globstar=!0,p.output+=L.output+v.output,q(_);continue}if(L.type==="slash"&&L.prev.type!=="bos"&&N[0]==="/"){let ae=N[1]!==void 0?"|$":"";p.output=p.output.slice(0,-(L.output+v.output).length),L.output=`(?:${L.output}`,v.type="globstar",v.output=`${G(t)}${g}|${g}${ae})`,v.value+=_,p.output+=L.output+v.output,p.globstar=!0,q(_+d()),H({type:"slash",value:"/",output:""});continue}if(L.type==="bos"&&N[0]==="/"){v.type="globstar",v.value+=_,v.output=`(?:^|${g}|${G(t)}${g})`,p.output=v.output,p.globstar=!0,q(_+d()),H({type:"slash",value:"/",output:""});continue}p.output=p.output.slice(0,-v.output.length),v.type="globstar",v.output=G(t),v.value+=_,p.output+=v.output,p.globstar=!0,q(_);continue}let te={type:"star",value:_,output:T};if(t.bash===!0){te.output=".*?",(v.type==="bos"||v.type==="slash")&&(te.output=D+te.output),H(te);continue}if(v&&(v.type==="bracket"||v.type==="paren")&&t.regex===!0){te.output=_,H(te);continue}(p.index===p.start||v.type==="slash"||v.type==="dot")&&(v.type==="dot"?(p.output+=R,v.output+=R):t.dot===!0?(p.output+=M,v.output+=M):(p.output+=D,v.output+=D),b()!=="*"&&(p.output+=x,v.output+=x)),H(te)}for(;p.brackets>0;){if(t.strictBrackets===!0)throw new SyntaxError(Ks("closing","]"));p.output=Ct.escapeLast(p.output,"["),z("brackets")}for(;p.parens>0;){if(t.strictBrackets===!0)throw new SyntaxError(Ks("closing",")"));p.output=Ct.escapeLast(p.output,"("),z("parens")}for(;p.braces>0;){if(t.strictBrackets===!0)throw new SyntaxError(Ks("closing","}"));p.output=Ct.escapeLast(p.output,"{"),z("braces")}if(t.strictSlashes!==!0&&(v.type==="star"||v.type==="bracket")&&H({type:"maybe_slash",value:"",output:`${g}?`}),p.backtrack===!0){p.output="";for(let N of p.tokens)p.output+=N.output!=null?N.output:N.value,N.suffix&&(p.output+=N.suffix)}return p};Um.fastpaths=(r,e)=>{let t={...e},n=typeof t.maxLength=="number"?Math.min(Ru,t.maxLength):Ru,i=r.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);r=SC[r]||r;let s=Ct.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:l,NO_DOT:u,NO_DOTS:f,NO_DOTS_SLASH:h,STAR:g,START_ANCHOR:x}=xa.globChars(s),S=t.dot?f:u,C=t.dot?h:u,R=t.capture?"":"?:",M={negated:!1,prefix:""},I=t.bash===!0?".*?":g;t.capture&&(I=`(${I})`);let B=D=>D.noglobstar===!0?I:`(${R}(?:(?!${x}${D.dot?l:o}).)*?)`,V=D=>{switch(D){case"*":return`${S}${c}${I}`;case".*":return`${o}${c}${I}`;case"*.*":return`${S}${I}${o}${c}${I}`;case"*/*":return`${S}${I}${a}${c}${C}${I}`;case"**":return S+B(t);case"**/*":return`(?:${S}${B(t)}${a})?${C}${c}${I}`;case"**/*.*":return`(?:${S}${B(t)}${a})?${C}${I}${o}${c}${I}`;case"**/.*":return`(?:${S}${B(t)}${a})?${o}${c}${I}`;default:{let U=/^(.*?)\.(\w+)$/.exec(D);if(!U)return;let T=V(U[1]);return T?T+o+U[2]:void 0}}},F=Ct.removePrefix(r,M),G=V(F);return G&&t.strictSlashes!==!0&&(G+=`${a}?`),G};CC.exports=Um});var RC=A((Oz,AC)=>{"use strict";var RH=require("path"),OH=wC(),$m=kC(),Wm=Au(),MH=va(),PH=r=>r&&typeof r=="object"&&!Array.isArray(r),Pe=(r,e,t=!1)=>{if(Array.isArray(r)){let u=r.map(h=>Pe(h,e,t));return h=>{for(let g of u){let x=g(h);if(x)return x}return!1}}let n=PH(r)&&r.tokens&&r.input;if(r===""||typeof r!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},s=Wm.isWindows(e),o=n?Pe.compileRe(r,e):Pe.makeRe(r,e,!1,!0),a=o.state;delete o.state;let c=()=>!1;if(i.ignore){let u={...e,ignore:null,onMatch:null,onResult:null};c=Pe(i.ignore,u,t)}let l=(u,f=!1)=>{let{isMatch:h,match:g,output:x}=Pe.test(u,o,e,{glob:r,posix:s}),S={glob:r,state:a,regex:o,posix:s,input:u,output:x,match:g,isMatch:h};return typeof i.onResult=="function"&&i.onResult(S),h===!1?(S.isMatch=!1,f?S:!1):c(u)?(typeof i.onIgnore=="function"&&i.onIgnore(S),S.isMatch=!1,f?S:!1):(typeof i.onMatch=="function"&&i.onMatch(S),f?S:!0)};return t&&(l.state=a),l};Pe.test=(r,e,t,{glob:n,posix:i}={})=>{if(typeof r!="string")throw new TypeError("Expected input to be a string");if(r==="")return{isMatch:!1,output:""};let s=t||{},o=s.format||(i?Wm.toPosixSlashes:null),a=r===n,c=a&&o?o(r):r;return a===!1&&(c=o?o(r):r,a=c===n),(a===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?a=Pe.matchBase(r,e,t,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Pe.matchBase=(r,e,t,n=Wm.isWindows(t))=>(e instanceof RegExp?e:Pe.makeRe(e,t)).test(RH.basename(r));Pe.isMatch=(r,e,t)=>Pe(e,t)(r);Pe.parse=(r,e)=>Array.isArray(r)?r.map(t=>Pe.parse(t,e)):$m(r,{...e,fastpaths:!1});Pe.scan=(r,e)=>OH(r,e);Pe.compileRe=(r,e,t=!1,n=!1)=>{if(t===!0)return r.output;let i=e||{},s=i.contains?"":"^",o=i.contains?"":"$",a=`${s}(?:${r.output})${o}`;r&&r.negated===!0&&(a=`^(?!${a}).*$`);let c=Pe.toRegex(a,e);return n===!0&&(c.state=r),c};Pe.makeRe=(r,e={},t=!1,n=!1)=>{if(!r||typeof r!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(r[0]==="."||r[0]==="*")&&(i.output=$m.fastpaths(r,e)),i.output||(i=$m(r,e)),Pe.compileRe(i,e,t,n)};Pe.toRegex=(r,e)=>{try{let t=e||{};return new RegExp(r,t.flags||(t.nocase?"i":""))}catch(t){if(e&&e.debug===!0)throw t;return/$^/}};Pe.constants=MH;AC.exports=Pe});var Gm=A((Mz,OC)=>{"use strict";OC.exports=RC()});var jC=A((Pz,BC)=>{"use strict";var ba=require("fs"),{Readable:IH}=require("stream"),_a=require("path"),{promisify:Iu}=require("util"),zm=Gm(),NH=Iu(ba.readdir),DH=Iu(ba.stat),MC=Iu(ba.lstat),LH=Iu(ba.realpath),BH="!",DC="READDIRP_RECURSIVE_ERROR",jH=new Set(["ENOENT","EPERM","EACCES","ELOOP",DC]),Vm="files",LC="directories",Mu="files_directories",Ou="all",PC=[Vm,LC,Mu,Ou],FH=r=>jH.has(r.code),[IC,HH]=process.versions.node.split(".").slice(0,2).map(r=>Number.parseInt(r,10)),qH=process.platform==="win32"&&(IC>10||IC===10&&HH>=5),NC=r=>{if(r!==void 0){if(typeof r=="function")return r;if(typeof r=="string"){let e=zm(r.trim());return t=>e(t.basename)}if(Array.isArray(r)){let e=[],t=[];for(let n of r){let i=n.trim();i.charAt(0)===BH?t.push(zm(i.slice(1))):e.push(zm(i))}return t.length>0?e.length>0?n=>e.some(i=>i(n.basename))&&!t.some(i=>i(n.basename)):n=>!t.some(i=>i(n.basename)):n=>e.some(i=>i(n.basename))}}},Pu=class r extends IH{static get defaultOptions(){return{root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:Vm,lstat:!1,depth:2147483648,alwaysStat:!1}}constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark||4096});let t={...r.defaultOptions,...e},{root:n,type:i}=t;this._fileFilter=NC(t.fileFilter),this._directoryFilter=NC(t.directoryFilter);let s=t.lstat?MC:DH;qH?this._stat=o=>s(o,{bigint:!0}):this._stat=s,this._maxDepth=t.depth,this._wantsDir=[LC,Mu,Ou].includes(i),this._wantsFile=[Vm,Mu,Ou].includes(i),this._wantsEverything=i===Ou,this._root=_a.resolve(n),this._isDirent="Dirent"in ba&&!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;){let{path:t,depth:n,files:i=[]}=this.parent||{};if(i.length>0){let s=i.splice(0,e).map(o=>this._formatEntry(o,t));for(let o of await Promise.all(s)){if(this.destroyed)return;let a=await this._getEntryType(o);a==="directory"&&this._directoryFilter(o)?(n<=this._maxDepth&&this.parents.push(this._exploreDir(o.fullPath,n+1)),this._wantsDir&&(this.push(o),e--)):(a==="file"||this._includeAsFile(o))&&this._fileFilter(o)&&this._wantsFile&&(this.push(o),e--)}}else{let s=this.parents.pop();if(!s){this.push(null);break}if(this.parent=await s,this.destroyed)return}}}catch(t){this.destroy(t)}finally{this.reading=!1}}}async _exploreDir(e,t){let n;try{n=await NH(e,this._rdOptions)}catch(i){this._onError(i)}return{files:n,depth:t,path:e}}async _formatEntry(e,t){let n;try{let i=this._isDirent?e.name:e,s=_a.resolve(_a.join(t,i));n={path:_a.relative(this._root,s),fullPath:s,basename:i},n[this._statsProp]=this._isDirent?e:await this._stat(s)}catch(i){this._onError(i)}return n}_onError(e){FH(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e)}async _getEntryType(e){let t=e&&e[this._statsProp];if(t){if(t.isFile())return"file";if(t.isDirectory())return"directory";if(t&&t.isSymbolicLink()){let n=e.fullPath;try{let i=await LH(n),s=await MC(i);if(s.isFile())return"file";if(s.isDirectory()){let o=i.length;if(n.startsWith(i)&&n.substr(o,1)===_a.sep){let a=new Error(`Circular symlink detected: "${n}" points to "${i}"`);return a.code=DC,this._onError(a)}return"directory"}}catch(i){this._onError(i)}}}}_includeAsFile(e){let t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}},Ys=(r,e={})=>{let t=e.entryType||e.type;if(t==="both"&&(t=Mu),t&&(e.type=t),r){if(typeof r!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(t&&!PC.includes(t))throw new Error(`readdirp: Invalid type passed. Use one of ${PC.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=r,new Pu(e)},UH=(r,e={})=>new Promise((t,n)=>{let i=[];Ys(r,e).on("data",s=>i.push(s)).on("end",()=>t(i)).on("error",s=>n(s))});Ys.promise=UH;Ys.ReaddirpStream=Pu;Ys.default=Ys;BC.exports=Ys});var Km=A((Iz,FC)=>{FC.exports=function(r,e){if(typeof r!="string")throw new TypeError("expected path to be a string");if(r==="\\"||r==="/")return"/";var t=r.length;if(t<=1)return r;var n="";if(t>4&&r[3]==="\\"){var i=r[2];(i==="?"||i===".")&&r.slice(0,2)==="\\\\"&&(r=r.slice(2),n="//")}var s=r.split(/[/\\]+/);return e!==!1&&s[s.length-1]===""&&s.pop(),n+s.join("/")}});var GC=A(($C,WC)=>{"use strict";Object.defineProperty($C,"__esModule",{value:!0});var UC=Gm(),$H=Km(),HC="!",WH={returnIndex:!1},GH=r=>Array.isArray(r)?r:[r],zH=(r,e)=>{if(typeof r=="function")return r;if(typeof r=="string"){let t=UC(r,e);return n=>r===n||t(n)}return r instanceof RegExp?t=>r.test(t):t=>!1},qC=(r,e,t,n)=>{let i=Array.isArray(t),s=i?t[0]:t;if(!i&&typeof s!="string")throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(s));let o=$H(s,!1);for(let c=0;c<e.length;c++){let l=e[c];if(l(o))return n?-1:!1}let a=i&&[o].concat(t.slice(1));for(let c=0;c<r.length;c++){let l=r[c];if(i?l(...a):l(o))return n?c:!0}return n?-1:!1},Ym=(r,e,t=WH)=>{if(r==null)throw new TypeError("anymatch: specify first argument");let n=typeof t=="boolean"?{returnIndex:t}:t,i=n.returnIndex||!1,s=GH(r),o=s.filter(c=>typeof c=="string"&&c.charAt(0)===HC).map(c=>c.slice(1)).map(c=>UC(c,n)),a=s.filter(c=>typeof c!="string"||typeof c=="string"&&c.charAt(0)!==HC).map(c=>zH(c,n));return e==null?(c,l=!1)=>qC(a,o,c,typeof l=="boolean"?l:!1):qC(a,o,e,i)};Ym.default=Ym;WC.exports=Ym});var VC=A((Nz,zC)=>{zC.exports=function(e){if(typeof e!="string"||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}});var Jm=A((Dz,YC)=>{var VH=VC(),KC={"{":"}","(":")","[":"]"},KH=function(r){if(r[0]==="!")return!0;for(var e=0,t=-2,n=-2,i=-2,s=-2,o=-2;e<r.length;){if(r[e]==="*"||r[e+1]==="?"&&/[\].+)]/.test(r[e])||n!==-1&&r[e]==="["&&r[e+1]!=="]"&&(n<e&&(n=r.indexOf("]",e)),n>e&&(o===-1||o>n||(o=r.indexOf("\\",e),o===-1||o>n)))||i!==-1&&r[e]==="{"&&r[e+1]!=="}"&&(i=r.indexOf("}",e),i>e&&(o=r.indexOf("\\",e),o===-1||o>i))||s!==-1&&r[e]==="("&&r[e+1]==="?"&&/[:!=]/.test(r[e+2])&&r[e+3]!==")"&&(s=r.indexOf(")",e),s>e&&(o=r.indexOf("\\",e),o===-1||o>s))||t!==-1&&r[e]==="("&&r[e+1]!=="|"&&(t<e&&(t=r.indexOf("|",e)),t!==-1&&r[t+1]!==")"&&(s=r.indexOf(")",t),s>t&&(o=r.indexOf("\\",t),o===-1||o>s))))return!0;if(r[e]==="\\"){var a=r[e+1];e+=2;var c=KC[a];if(c){var l=r.indexOf(c,e);l!==-1&&(e=l+1)}if(r[e]==="!")return!0}else e++}return!1},YH=function(r){if(r[0]==="!")return!0;for(var e=0;e<r.length;){if(/[*?{}()[\]]/.test(r[e]))return!0;if(r[e]==="\\"){var t=r[e+1];e+=2;var n=KC[t];if(n){var i=r.indexOf(n,e);i!==-1&&(e=i+1)}if(r[e]==="!")return!0}else e++}return!1};YC.exports=function(e,t){if(typeof e!="string"||e==="")return!1;if(VH(e))return!0;var n=KH;return t&&t.strict===!1&&(n=YH),n(e)}});var XC=A((Lz,JC)=>{"use strict";var JH=Jm(),XH=require("path").posix.dirname,ZH=require("os").platform()==="win32",Xm="/",QH=/\\/g,eq=/[\{\[].*[\}\]]$/,tq=/(^|[^\\])([\{\[]|\([^\)]+$)/,rq=/\\([\!\*\?\|\[\]\(\)\{\}])/g;JC.exports=function(e,t){var n=Object.assign({flipBackslashes:!0},t);n.flipBackslashes&&ZH&&e.indexOf(Xm)<0&&(e=e.replace(QH,Xm)),eq.test(e)&&(e+=Xm),e+="a";do e=XH(e);while(JH(e)||tq.test(e));return e.replace(rq,"$1")}});var Nu=A(br=>{"use strict";br.isInteger=r=>typeof r=="number"?Number.isInteger(r):typeof r=="string"&&r.trim()!==""?Number.isInteger(Number(r)):!1;br.find=(r,e)=>r.nodes.find(t=>t.type===e);br.exceedsLimit=(r,e,t=1,n)=>n===!1||!br.isInteger(r)||!br.isInteger(e)?!1:(Number(e)-Number(r))/Number(t)>=n;br.escapeNode=(r,e=0,t)=>{let n=r.nodes[e];n&&(t&&n.type===t||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};br.encloseBrace=r=>r.type!=="brace"?!1:r.commas>>0+r.ranges>>0===0?(r.invalid=!0,!0):!1;br.isInvalidBrace=r=>r.type!=="brace"?!1:r.invalid===!0||r.dollar?!0:r.commas>>0+r.ranges>>0===0||r.open!==!0||r.close!==!0?(r.invalid=!0,!0):!1;br.isOpenOrClose=r=>r.type==="open"||r.type==="close"?!0:r.open===!0||r.close===!0;br.reduce=r=>r.reduce((e,t)=>(t.type==="text"&&e.push(t.value),t.type==="range"&&(t.type="text"),e),[]);br.flatten=(...r)=>{let e=[],t=n=>{for(let i=0;i<n.length;i++){let s=n[i];if(Array.isArray(s)){t(s);continue}s!==void 0&&e.push(s)}return e};return t(r),e}});var Du=A((jz,QC)=>{"use strict";var ZC=Nu();QC.exports=(r,e={})=>{let t=(n,i={})=>{let s=e.escapeInvalid&&ZC.isInvalidBrace(i),o=n.invalid===!0&&e.escapeInvalid===!0,a="";if(n.value)return(s||o)&&ZC.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let c of n.nodes)a+=t(c);return a};return t(r)}});var tk=A((Fz,ek)=>{"use strict";ek.exports=function(r){return typeof r=="number"?r-r===0:typeof r=="string"&&r.trim()!==""?Number.isFinite?Number.isFinite(+r):isFinite(+r):!1}});var uk=A((Hz,lk)=>{"use strict";var rk=tk(),Ti=(r,e,t)=>{if(rk(r)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||r===e)return String(r);if(rk(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...t};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let i=String(n.relaxZeros),s=String(n.shorthand),o=String(n.capture),a=String(n.wrap),c=r+":"+e+"="+i+s+o+a;if(Ti.cache.hasOwnProperty(c))return Ti.cache[c].result;let l=Math.min(r,e),u=Math.max(r,e);if(Math.abs(l-u)===1){let S=r+"|"+e;return n.capture?`(${S})`:n.wrap===!1?S:`(?:${S})`}let f=ck(r)||ck(e),h={min:r,max:e,a:l,b:u},g=[],x=[];if(f&&(h.isPadded=f,h.maxLen=String(h.max).length),l<0){let S=u<0?Math.abs(u):1;x=nk(S,Math.abs(l),h,n),l=h.a=0}return u>=0&&(g=nk(l,u,h,n)),h.negatives=x,h.positives=g,h.result=nq(x,g,n),n.capture===!0?h.result=`(${h.result})`:n.wrap!==!1&&g.length+x.length>1&&(h.result=`(?:${h.result})`),Ti.cache[c]=h,h.result};function nq(r,e,t){let n=Zm(r,e,"-",!1,t)||[],i=Zm(e,r,"",!1,t)||[],s=Zm(r,e,"-?",!0,t)||[];return n.concat(s).concat(i).join("|")}function iq(r,e){let t=1,n=1,i=sk(r,t),s=new Set([e]);for(;r<=i&&i<=e;)s.add(i),t+=1,i=sk(r,t);for(i=ok(e+1,n)-1;r<i&&i<=e;)s.add(i),n+=1,i=ok(e+1,n)-1;return s=[...s],s.sort(aq),s}function sq(r,e,t){if(r===e)return{pattern:r,count:[],digits:0};let n=oq(r,e),i=n.length,s="",o=0;for(let a=0;a<i;a++){let[c,l]=n[a];c===l?s+=c:c!=="0"||l!=="9"?s+=cq(c,l,t):o++}return o&&(s+=t.shorthand===!0?"\\d":"[0-9]"),{pattern:s,count:[o],digits:i}}function nk(r,e,t,n){let i=iq(r,e),s=[],o=r,a;for(let c=0;c<i.length;c++){let l=i[c],u=sq(String(o),String(l),n),f="";if(!t.isPadded&&a&&a.pattern===u.pattern){a.count.length>1&&a.count.pop(),a.count.push(u.count[0]),a.string=a.pattern+ak(a.count),o=l+1;continue}t.isPadded&&(f=lq(l,t,n)),u.string=f+u.pattern+ak(u.count),s.push(u),o=l+1,a=u}return s}function Zm(r,e,t,n,i){let s=[];for(let o of r){let{string:a}=o;!n&&!ik(e,"string",a)&&s.push(t+a),n&&ik(e,"string",a)&&s.push(t+a)}return s}function oq(r,e){let t=[];for(let n=0;n<r.length;n++)t.push([r[n],e[n]]);return t}function aq(r,e){return r>e?1:e>r?-1:0}function ik(r,e,t){return r.some(n=>n[e]===t)}function sk(r,e){return Number(String(r).slice(0,-e)+"9".repeat(e))}function ok(r,e){return r-r%Math.pow(10,e)}function ak(r){let[e=0,t=""]=r;return t||e>1?`{${e+(t?","+t:"")}}`:""}function cq(r,e,t){return`[${r}${e-r===1?"":"-"}${e}]`}function ck(r){return/^-?(0+)\d/.test(r)}function lq(r,e,t){if(!e.isPadded)return r;let n=Math.abs(e.maxLen-String(r).length),i=t.relaxZeros!==!1;switch(n){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:return i?`0{0,${n}}`:`0{${n}}`}}Ti.cache={};Ti.clearCache=()=>Ti.cache={};lk.exports=Ti});var tg=A((qz,vk)=>{"use strict";var uq=require("util"),fk=uk(),pk=r=>r!==null&&typeof r=="object"&&!Array.isArray(r),pq=r=>e=>r===!0?Number(e):String(e),Qm=r=>typeof r=="number"||typeof r=="string"&&r!=="",wa=r=>Number.isInteger(+r),eg=r=>{let e=`${r}`,t=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++t]==="0";);return t>0},fq=(r,e,t)=>typeof r=="string"||typeof e=="string"?!0:t.stringify===!0,dq=(r,e,t)=>{if(e>0){let n=r[0]==="-"?"-":"";n&&(r=r.slice(1)),r=n+r.padStart(n?e-1:e,"0")}return t===!1?String(r):r},Bu=(r,e)=>{let t=r[0]==="-"?"-":"";for(t&&(r=r.slice(1),e--);r.length<e;)r="0"+r;return t?"-"+r:r},hq=(r,e,t)=>{r.negatives.sort((a,c)=>a<c?-1:a>c?1:0),r.positives.sort((a,c)=>a<c?-1:a>c?1:0);let n=e.capture?"":"?:",i="",s="",o;return r.positives.length&&(i=r.positives.map(a=>Bu(String(a),t)).join("|")),r.negatives.length&&(s=`-(${n}${r.negatives.map(a=>Bu(String(a),t)).join("|")})`),i&&s?o=`${i}|${s}`:o=i||s,e.wrap?`(${n}${o})`:o},dk=(r,e,t,n)=>{if(t)return fk(r,e,{wrap:!1,...n});let i=String.fromCharCode(r);if(r===e)return i;let s=String.fromCharCode(e);return`[${i}-${s}]`},hk=(r,e,t)=>{if(Array.isArray(r)){let n=t.wrap===!0,i=t.capture?"":"?:";return n?`(${i}${r.join("|")})`:r.join("|")}return fk(r,e,t)},mk=(...r)=>new RangeError("Invalid range arguments: "+uq.inspect(...r)),gk=(r,e,t)=>{if(t.strictRanges===!0)throw mk([r,e]);return[]},mq=(r,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${r}" to be a number`);return[]},gq=(r,e,t=1,n={})=>{let i=Number(r),s=Number(e);if(!Number.isInteger(i)||!Number.isInteger(s)){if(n.strictRanges===!0)throw mk([r,e]);return[]}i===0&&(i=0),s===0&&(s=0);let o=i>s,a=String(r),c=String(e),l=String(t);t=Math.max(Math.abs(t),1);let u=eg(a)||eg(c)||eg(l),f=u?Math.max(a.length,c.length,l.length):0,h=u===!1&&fq(r,e,n)===!1,g=n.transform||pq(h);if(n.toRegex&&t===1)return dk(Bu(r,f),Bu(e,f),!0,n);let x={negatives:[],positives:[]},S=M=>x[M<0?"negatives":"positives"].push(Math.abs(M)),C=[],R=0;for(;o?i>=s:i<=s;)n.toRegex===!0&&t>1?S(i):C.push(dq(g(i,R),f,h)),i=o?i-t:i+t,R++;return n.toRegex===!0?t>1?hq(x,n,f):hk(C,null,{wrap:!1,...n}):C},vq=(r,e,t=1,n={})=>{if(!wa(r)&&r.length>1||!wa(e)&&e.length>1)return gk(r,e,n);let i=n.transform||(h=>String.fromCharCode(h)),s=`${r}`.charCodeAt(0),o=`${e}`.charCodeAt(0),a=s>o,c=Math.min(s,o),l=Math.max(s,o);if(n.toRegex&&t===1)return dk(c,l,!1,n);let u=[],f=0;for(;a?s>=o:s<=o;)u.push(i(s,f)),s=a?s-t:s+t,f++;return n.toRegex===!0?hk(u,null,{wrap:!1,options:n}):u},Lu=(r,e,t,n={})=>{if(e==null&&Qm(r))return[r];if(!Qm(r)||!Qm(e))return gk(r,e,n);if(typeof t=="function")return Lu(r,e,1,{transform:t});if(pk(t))return Lu(r,e,0,t);let i={...n};return i.capture===!0&&(i.wrap=!0),t=t||i.step||1,wa(t)?wa(r)&&wa(e)?gq(r,e,t,i):vq(r,e,Math.max(Math.abs(t),1),i):t!=null&&!pk(t)?mq(t,i):Lu(r,e,1,t)};vk.exports=Lu});var _k=A((Uz,xk)=>{"use strict";var yq=tg(),yk=Nu(),xq=(r,e={})=>{let t=(n,i={})=>{let s=yk.isInvalidBrace(i),o=n.invalid===!0&&e.escapeInvalid===!0,a=s===!0||o===!0,c=e.escapeInvalid===!0?"\\":"",l="";if(n.isOpen===!0)return c+n.value;if(n.isClose===!0)return console.log("node.isClose",c,n.value),c+n.value;if(n.type==="open")return a?c+n.value:"(";if(n.type==="close")return a?c+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let u=yk.reduce(n.nodes),f=yq(...u,{...e,wrap:!1,toRegex:!0,strictZeros:!0});if(f.length!==0)return u.length>1&&f.length>1?`(${f})`:f}if(n.nodes)for(let u of n.nodes)l+=t(u,n);return l};return t(r)};xk.exports=xq});var Sk=A(($z,wk)=>{"use strict";var _q=tg(),bk=Du(),Js=Nu(),Ci=(r="",e="",t=!1)=>{let n=[];if(r=[].concat(r),e=[].concat(e),!e.length)return r;if(!r.length)return t?Js.flatten(e).map(i=>`{${i}}`):e;for(let i of r)if(Array.isArray(i))for(let s of i)n.push(Ci(s,e,t));else for(let s of e)t===!0&&typeof s=="string"&&(s=`{${s}}`),n.push(Array.isArray(s)?Ci(i,s,t):i+s);return Js.flatten(n)},bq=(r,e={})=>{let t=e.rangeLimit===void 0?1e3:e.rangeLimit,n=(i,s={})=>{i.queue=[];let o=s,a=s.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,a=o.queue;if(i.invalid||i.dollar){a.push(Ci(a.pop(),bk(i,e)));return}if(i.type==="brace"&&i.invalid!==!0&&i.nodes.length===2){a.push(Ci(a.pop(),["{}"]));return}if(i.nodes&&i.ranges>0){let f=Js.reduce(i.nodes);if(Js.exceedsLimit(...f,e.step,t))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let h=_q(...f,e);h.length===0&&(h=bk(i,e)),a.push(Ci(a.pop(),h)),i.nodes=[];return}let c=Js.encloseBrace(i),l=i.queue,u=i;for(;u.type!=="brace"&&u.type!=="root"&&u.parent;)u=u.parent,l=u.queue;for(let f=0;f<i.nodes.length;f++){let h=i.nodes[f];if(h.type==="comma"&&i.type==="brace"){f===1&&l.push(""),l.push("");continue}if(h.type==="close"){a.push(Ci(a.pop(),l,c));continue}if(h.value&&h.type!=="open"){l.push(Ci(l.pop(),h.value));continue}h.nodes&&n(h,i)}return l};return Js.flatten(n(r))};wk.exports=bq});var Tk=A((Wz,Ek)=>{"use strict";Ek.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
|
|
105
|
+
`,CHAR_NO_BREAK_SPACE:"\xA0",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:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var Ok=A((Gz,Rk)=>{"use strict";var wq=Du(),{MAX_LENGTH:Ck,CHAR_BACKSLASH:rg,CHAR_BACKTICK:Sq,CHAR_COMMA:Eq,CHAR_DOT:Tq,CHAR_LEFT_PARENTHESES:Cq,CHAR_RIGHT_PARENTHESES:kq,CHAR_LEFT_CURLY_BRACE:Aq,CHAR_RIGHT_CURLY_BRACE:Rq,CHAR_LEFT_SQUARE_BRACKET:kk,CHAR_RIGHT_SQUARE_BRACKET:Ak,CHAR_DOUBLE_QUOTE:Oq,CHAR_SINGLE_QUOTE:Mq,CHAR_NO_BREAK_SPACE:Pq,CHAR_ZERO_WIDTH_NOBREAK_SPACE:Iq}=Tk(),Nq=(r,e={})=>{if(typeof r!="string")throw new TypeError("Expected a string");let t=e||{},n=typeof t.maxLength=="number"?Math.min(Ck,t.maxLength):Ck;if(r.length>n)throw new SyntaxError(`Input length (${r.length}), exceeds max characters (${n})`);let i={type:"root",input:r,nodes:[]},s=[i],o=i,a=i,c=0,l=r.length,u=0,f=0,h,g=()=>r[u++],x=S=>{if(S.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&S.type==="text"){a.value+=S.value;return}return o.nodes.push(S),S.parent=o,S.prev=a,a=S,S};for(x({type:"bos"});u<l;)if(o=s[s.length-1],h=g(),!(h===Iq||h===Pq)){if(h===rg){x({type:"text",value:(e.keepEscaping?h:"")+g()});continue}if(h===Ak){x({type:"text",value:"\\"+h});continue}if(h===kk){c++;let S;for(;u<l&&(S=g());){if(h+=S,S===kk){c++;continue}if(S===rg){h+=g();continue}if(S===Ak&&(c--,c===0))break}x({type:"text",value:h});continue}if(h===Cq){o=x({type:"paren",nodes:[]}),s.push(o),x({type:"text",value:h});continue}if(h===kq){if(o.type!=="paren"){x({type:"text",value:h});continue}o=s.pop(),x({type:"text",value:h}),o=s[s.length-1];continue}if(h===Oq||h===Mq||h===Sq){let S=h,C;for(e.keepQuotes!==!0&&(h="");u<l&&(C=g());){if(C===rg){h+=C+g();continue}if(C===S){e.keepQuotes===!0&&(h+=C);break}h+=C}x({type:"text",value:h});continue}if(h===Aq){f++;let C={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||o.dollar===!0,depth:f,commas:0,ranges:0,nodes:[]};o=x(C),s.push(o),x({type:"open",value:h});continue}if(h===Rq){if(o.type!=="brace"){x({type:"text",value:h});continue}let S="close";o=s.pop(),o.close=!0,x({type:S,value:h}),f--,o=s[s.length-1];continue}if(h===Eq&&f>0){if(o.ranges>0){o.ranges=0;let S=o.nodes.shift();o.nodes=[S,{type:"text",value:wq(o)}]}x({type:"comma",value:h}),o.commas++;continue}if(h===Tq&&f>0&&o.commas===0){let S=o.nodes;if(f===0||S.length===0){x({type:"text",value:h});continue}if(a.type==="dot"){if(o.range=[],a.value+=h,a.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if(a.type==="range"){S.pop();let C=S[S.length-1];C.value+=a.value+h,a=C,o.ranges--;continue}x({type:"dot",value:h});continue}x({type:"text",value:h})}do if(o=s.pop(),o.type!=="root"){o.nodes.forEach(R=>{R.nodes||(R.type==="open"&&(R.isOpen=!0),R.type==="close"&&(R.isClose=!0),R.nodes||(R.type="text"),R.invalid=!0)});let S=s[s.length-1],C=S.nodes.indexOf(o);S.nodes.splice(C,1,...o.nodes)}while(s.length>0);return x({type:"eos"}),i};Rk.exports=Nq});var Ik=A((zz,Pk)=>{"use strict";var Mk=Du(),Dq=_k(),Lq=Sk(),Bq=Ok(),rr=(r,e={})=>{let t=[];if(Array.isArray(r))for(let n of r){let i=rr.create(n,e);Array.isArray(i)?t.push(...i):t.push(i)}else t=[].concat(rr.create(r,e));return e&&e.expand===!0&&e.nodupes===!0&&(t=[...new Set(t)]),t};rr.parse=(r,e={})=>Bq(r,e);rr.stringify=(r,e={})=>Mk(typeof r=="string"?rr.parse(r,e):r,e);rr.compile=(r,e={})=>(typeof r=="string"&&(r=rr.parse(r,e)),Dq(r,e));rr.expand=(r,e={})=>{typeof r=="string"&&(r=rr.parse(r,e));let t=Lq(r,e);return e.noempty===!0&&(t=t.filter(Boolean)),e.nodupes===!0&&(t=[...new Set(t)]),t};rr.create=(r,e={})=>r===""||r.length<3?[r]:e.expand!==!0?rr.compile(r,e):rr.expand(r,e);Pk.exports=rr});var Nk=A((Vz,jq)=>{jq.exports=["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 Lk=A((Kz,Dk)=>{Dk.exports=Nk()});var jk=A((Yz,Bk)=>{"use strict";var Fq=require("path"),Hq=Lk(),qq=new Set(Hq);Bk.exports=r=>qq.has(Fq.extname(r).slice(1).toLowerCase())});var ju=A(Y=>{"use strict";var{sep:Uq}=require("path"),{platform:ng}=process,$q=require("os");Y.EV_ALL="all";Y.EV_READY="ready";Y.EV_ADD="add";Y.EV_CHANGE="change";Y.EV_ADD_DIR="addDir";Y.EV_UNLINK="unlink";Y.EV_UNLINK_DIR="unlinkDir";Y.EV_RAW="raw";Y.EV_ERROR="error";Y.STR_DATA="data";Y.STR_END="end";Y.STR_CLOSE="close";Y.FSEVENT_CREATED="created";Y.FSEVENT_MODIFIED="modified";Y.FSEVENT_DELETED="deleted";Y.FSEVENT_MOVED="moved";Y.FSEVENT_CLONED="cloned";Y.FSEVENT_UNKNOWN="unknown";Y.FSEVENT_FLAG_MUST_SCAN_SUBDIRS=1;Y.FSEVENT_TYPE_FILE="file";Y.FSEVENT_TYPE_DIRECTORY="directory";Y.FSEVENT_TYPE_SYMLINK="symlink";Y.KEY_LISTENERS="listeners";Y.KEY_ERR="errHandlers";Y.KEY_RAW="rawEmitters";Y.HANDLER_KEYS=[Y.KEY_LISTENERS,Y.KEY_ERR,Y.KEY_RAW];Y.DOT_SLASH=`.${Uq}`;Y.BACK_SLASH_RE=/\\/g;Y.DOUBLE_SLASH_RE=/\/\//;Y.SLASH_OR_BACK_SLASH_RE=/[/\\]/;Y.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/;Y.REPLACER_RE=/^\.[/\\]/;Y.SLASH="/";Y.SLASH_SLASH="//";Y.BRACE_START="{";Y.BANG="!";Y.ONE_DOT=".";Y.TWO_DOTS="..";Y.STAR="*";Y.GLOBSTAR="**";Y.ROOT_GLOBSTAR="/**/*";Y.SLASH_GLOBSTAR="/**";Y.DIR_SUFFIX="Dir";Y.ANYMATCH_OPTS={dot:!0};Y.STRING_TYPE="string";Y.FUNCTION_TYPE="function";Y.EMPTY_STR="";Y.EMPTY_FN=()=>{};Y.IDENTITY_FN=r=>r;Y.isWindows=ng==="win32";Y.isMacos=ng==="darwin";Y.isLinux=ng==="linux";Y.isIBMi=$q.type()==="OS400"});var Wk=A((Xz,$k)=>{"use strict";var Tn=require("fs"),xt=require("path"),{promisify:Ca}=require("util"),Wq=jk(),{isWindows:Gq,isLinux:zq,EMPTY_FN:Vq,EMPTY_STR:Kq,KEY_LISTENERS:Xs,KEY_ERR:ig,KEY_RAW:Sa,HANDLER_KEYS:Yq,EV_CHANGE:Hu,EV_ADD:Fu,EV_ADD_DIR:Jq,EV_ERROR:Hk,STR_DATA:Xq,STR_END:Zq,BRACE_START:Qq,STAR:eU}=ju(),tU="watch",rU=Ca(Tn.open),qk=Ca(Tn.stat),nU=Ca(Tn.lstat),iU=Ca(Tn.close),sg=Ca(Tn.realpath),sU={lstat:nU,stat:qk},ag=(r,e)=>{r instanceof Set?r.forEach(e):e(r)},Ea=(r,e,t)=>{let n=r[e];n instanceof Set||(r[e]=n=new Set([n])),n.add(t)},oU=r=>e=>{let t=r[e];t instanceof Set?t.clear():delete r[e]},Ta=(r,e,t)=>{let n=r[e];n instanceof Set?n.delete(t):n===t&&delete r[e]},Uk=r=>r instanceof Set?r.size===0:!r,qu=new Map;function Fk(r,e,t,n,i){let s=(o,a)=>{t(r),i(o,a,{watchedPath:r}),a&&r!==a&&Uu(xt.resolve(r,a),Xs,xt.join(r,a))};try{return Tn.watch(r,e,s)}catch(o){n(o)}}var Uu=(r,e,t,n,i)=>{let s=qu.get(r);s&&ag(s[e],o=>{o(t,n,i)})},aU=(r,e,t,n)=>{let{listener:i,errHandler:s,rawEmitter:o}=n,a=qu.get(e),c;if(!t.persistent)return c=Fk(r,t,i,s,o),c.close.bind(c);if(a)Ea(a,Xs,i),Ea(a,ig,s),Ea(a,Sa,o);else{if(c=Fk(r,t,Uu.bind(null,e,Xs),s,Uu.bind(null,e,Sa)),!c)return;c.on(Hk,async l=>{let u=Uu.bind(null,e,ig);if(a.watcherUnusable=!0,Gq&&l.code==="EPERM")try{let f=await rU(r,"r");await iU(f),u(l)}catch{}else u(l)}),a={listeners:i,errHandlers:s,rawEmitters:o,watcher:c},qu.set(e,a)}return()=>{Ta(a,Xs,i),Ta(a,ig,s),Ta(a,Sa,o),Uk(a.listeners)&&(a.watcher.close(),qu.delete(e),Yq.forEach(oU(a)),a.watcher=void 0,Object.freeze(a))}},og=new Map,cU=(r,e,t,n)=>{let{listener:i,rawEmitter:s}=n,o=og.get(e),a=new Set,c=new Set,l=o&&o.options;return l&&(l.persistent<t.persistent||l.interval>t.interval)&&(a=o.listeners,c=o.rawEmitters,Tn.unwatchFile(e),o=void 0),o?(Ea(o,Xs,i),Ea(o,Sa,s)):(o={listeners:i,rawEmitters:s,options:t,watcher:Tn.watchFile(e,t,(u,f)=>{ag(o.rawEmitters,g=>{g(Hu,e,{curr:u,prev:f})});let h=u.mtimeMs;(u.size!==f.size||h>f.mtimeMs||h===0)&&ag(o.listeners,g=>g(r,u))})},og.set(e,o)),()=>{Ta(o,Xs,i),Ta(o,Sa,s),Uk(o.listeners)&&(og.delete(e),Tn.unwatchFile(e),o.options=o.watcher=void 0,Object.freeze(o))}},cg=class{constructor(e){this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){let n=this.fsw.options,i=xt.dirname(e),s=xt.basename(e);this.fsw._getWatchedDir(i).add(s);let a=xt.resolve(e),c={persistent:n.persistent};t||(t=Vq);let l;return n.usePolling?(c.interval=n.enableBinaryInterval&&Wq(s)?n.binaryInterval:n.interval,l=cU(e,a,c,{listener:t,rawEmitter:this.fsw._emitRaw})):l=aU(e,a,c,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),l}_handleFile(e,t,n){if(this.fsw.closed)return;let i=xt.dirname(e),s=xt.basename(e),o=this.fsw._getWatchedDir(i),a=t;if(o.has(s))return;let c=async(u,f)=>{if(this.fsw._throttle(tU,e,5)){if(!f||f.mtimeMs===0)try{let h=await qk(e);if(this.fsw.closed)return;let g=h.atimeMs,x=h.mtimeMs;(!g||g<=x||x!==a.mtimeMs)&&this.fsw._emit(Hu,e,h),zq&&a.ino!==h.ino?(this.fsw._closeFile(u),a=h,this.fsw._addPathCloser(u,this._watchWithNodeFs(e,c))):a=h}catch{this.fsw._remove(i,s)}else if(o.has(s)){let h=f.atimeMs,g=f.mtimeMs;(!h||h<=g||g!==a.mtimeMs)&&this.fsw._emit(Hu,e,f),a=f}}},l=this._watchWithNodeFs(e,c);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(Fu,e,0))return;this.fsw._emit(Fu,e,t)}return l}async _handleSymlink(e,t,n,i){if(this.fsw.closed)return;let s=e.fullPath,o=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let a;try{a=await sg(n)}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(o.has(i)?this.fsw._symlinkPaths.get(s)!==a&&(this.fsw._symlinkPaths.set(s,a),this.fsw._emit(Hu,n,e.stats)):(o.add(i),this.fsw._symlinkPaths.set(s,a),this.fsw._emit(Fu,n,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(s))return!0;this.fsw._symlinkPaths.set(s,!0)}_handleRead(e,t,n,i,s,o,a){if(e=xt.join(e,Kq),!n.hasGlob&&(a=this.fsw._throttle("readdir",e,1e3),!a))return;let c=this.fsw._getWatchedDir(n.path),l=new Set,u=this.fsw._readdirp(e,{fileFilter:f=>n.filterPath(f),directoryFilter:f=>n.filterDir(f),depth:0}).on(Xq,async f=>{if(this.fsw.closed){u=void 0;return}let h=f.path,g=xt.join(e,h);if(l.add(h),!(f.stats.isSymbolicLink()&&await this._handleSymlink(f,e,g,h))){if(this.fsw.closed){u=void 0;return}(h===i||!i&&!c.has(h))&&(this.fsw._incrReadyCount(),g=xt.join(s,xt.relative(s,g)),this._addToNodeFs(g,t,n,o+1))}}).on(Hk,this._boundHandleError);return new Promise(f=>u.once(Zq,()=>{if(this.fsw.closed){u=void 0;return}let h=a?a.clear():!1;f(),c.getChildren().filter(g=>g!==e&&!l.has(g)&&(!n.hasGlob||n.filterPath({fullPath:xt.resolve(e,g)}))).forEach(g=>{this.fsw._remove(e,g)}),u=void 0,h&&this._handleRead(e,!1,n,i,s,o,a)}))}async _handleDir(e,t,n,i,s,o,a){let c=this.fsw._getWatchedDir(xt.dirname(e)),l=c.has(xt.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!s&&!l&&(!o.hasGlob||o.globFilter(e))&&this.fsw._emit(Jq,e,t),c.add(xt.basename(e)),this.fsw._getWatchedDir(e);let u,f,h=this.fsw.options.depth;if((h==null||i<=h)&&!this.fsw._symlinkPaths.has(a)){if(!s&&(await this._handleRead(e,n,o,s,e,i,u),this.fsw.closed))return;f=this._watchWithNodeFs(e,(g,x)=>{x&&x.mtimeMs===0||this._handleRead(g,!1,o,s,e,i,u)})}return f}async _addToNodeFs(e,t,n,i,s){let o=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return o(),!1;let a=this.fsw._getWatchHelpers(e,i);!a.hasGlob&&n&&(a.hasGlob=n.hasGlob,a.globFilter=n.globFilter,a.filterPath=c=>n.filterPath(c),a.filterDir=c=>n.filterDir(c));try{let c=await sU[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))return o(),!1;let l=this.fsw.options.followSymlinks&&!e.includes(eU)&&!e.includes(Qq),u;if(c.isDirectory()){let f=xt.resolve(e),h=l?await sg(e):e;if(this.fsw.closed||(u=await this._handleDir(a.watchPath,c,t,i,s,a,h),this.fsw.closed))return;f!==h&&h!==void 0&&this.fsw._symlinkPaths.set(f,h)}else if(c.isSymbolicLink()){let f=l?await sg(e):e;if(this.fsw.closed)return;let h=xt.dirname(a.watchPath);if(this.fsw._getWatchedDir(h).add(a.watchPath),this.fsw._emit(Fu,a.watchPath,c),u=await this._handleDir(h,c,t,i,e,a,f),this.fsw.closed)return;f!==void 0&&this.fsw._symlinkPaths.set(xt.resolve(e),f)}else u=this._handleFile(a.watchPath,c,t);return o(),this.fsw._addPathCloser(e,u),!1}catch(c){if(this.fsw._handleError(c))return o(),e}}};$k.exports=cg});var Xk=A((Zz,gg)=>{"use strict";var hg=require("fs"),_t=require("path"),{promisify:mg}=require("util"),Zs;try{Zs=require("fsevents")}catch(r){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(r)}if(Zs){let r=process.version.match(/v(\d+)\.(\d+)/);if(r&&r[1]&&r[2]){let e=Number.parseInt(r[1],10),t=Number.parseInt(r[2],10);e===8&&t<16&&(Zs=void 0)}}var{EV_ADD:lg,EV_CHANGE:lU,EV_ADD_DIR:Gk,EV_UNLINK:$u,EV_ERROR:uU,STR_DATA:pU,STR_END:fU,FSEVENT_CREATED:dU,FSEVENT_MODIFIED:hU,FSEVENT_DELETED:mU,FSEVENT_MOVED:gU,FSEVENT_UNKNOWN:vU,FSEVENT_FLAG_MUST_SCAN_SUBDIRS:yU,FSEVENT_TYPE_FILE:xU,FSEVENT_TYPE_DIRECTORY:ka,FSEVENT_TYPE_SYMLINK:Jk,ROOT_GLOBSTAR:zk,DIR_SUFFIX:_U,DOT_SLASH:Vk,FUNCTION_TYPE:ug,EMPTY_FN:bU,IDENTITY_FN:wU}=ju(),SU=r=>isNaN(r)?{}:{depth:r},fg=mg(hg.stat),EU=mg(hg.lstat),Kk=mg(hg.realpath),TU={stat:fg,lstat:EU},ki=new Map,CU=10,kU=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),AU=(r,e)=>({stop:Zs.watch(r,e)});function RU(r,e,t,n){let i=_t.extname(e)?_t.dirname(e):e,s=_t.dirname(i),o=ki.get(i);OU(s)&&(i=s);let a=_t.resolve(r),c=a!==e,l=(f,h,g)=>{c&&(f=f.replace(e,a)),(f===a||!f.indexOf(a+_t.sep))&&t(f,h,g)},u=!1;for(let f of ki.keys())if(e.indexOf(_t.resolve(f)+_t.sep)===0){i=f,o=ki.get(i),u=!0;break}return o||u?o.listeners.add(l):(o={listeners:new Set([l]),rawEmitter:n,watcher:AU(i,(f,h)=>{if(!o.listeners.size||h&yU)return;let g=Zs.getInfo(f,h);o.listeners.forEach(x=>{x(f,h,g)}),o.rawEmitter(g.event,f,g)})},ki.set(i,o)),()=>{let f=o.listeners;if(f.delete(l),!f.size&&(ki.delete(i),o.watcher))return o.watcher.stop().then(()=>{o.rawEmitter=o.watcher=void 0,Object.freeze(o)})}}var OU=r=>{let e=0;for(let t of ki.keys())if(t.indexOf(r)===0&&(e++,e>=CU))return!0;return!1},MU=()=>Zs&&ki.size<128,pg=(r,e)=>{let t=0;for(;!r.indexOf(e)&&(r=_t.dirname(r))!==e;)t++;return t},Yk=(r,e)=>r.type===ka&&e.isDirectory()||r.type===Jk&&e.isSymbolicLink()||r.type===xU&&e.isFile(),dg=class{constructor(e){this.fsw=e}checkIgnored(e,t){let n=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,t))return n.add(e),t&&t.isDirectory()&&n.add(e+zk),!0;n.delete(e),n.delete(e+zk)}addOrChange(e,t,n,i,s,o,a,c){let l=s.has(o)?lU:lg;this.handleEvent(l,e,t,n,i,s,o,a,c)}async checkExists(e,t,n,i,s,o,a,c){try{let l=await fg(e);if(this.fsw.closed)return;Yk(a,l)?this.addOrChange(e,t,n,i,s,o,a,c):this.handleEvent($u,e,t,n,i,s,o,a,c)}catch(l){l.code==="EACCES"?this.addOrChange(e,t,n,i,s,o,a,c):this.handleEvent($u,e,t,n,i,s,o,a,c)}}handleEvent(e,t,n,i,s,o,a,c,l){if(!(this.fsw.closed||this.checkIgnored(t)))if(e===$u){let u=c.type===ka;(u||o.has(a))&&this.fsw._remove(s,a,u)}else{if(e===lg){if(c.type===ka&&this.fsw._getWatchedDir(t),c.type===Jk&&l.followSymlinks){let f=l.depth===void 0?void 0:pg(n,i)+1;return this._addToFsEvents(t,!1,!0,f)}this.fsw._getWatchedDir(s).add(a)}let u=c.type===ka?e+_U:e;this.fsw._emit(u,t),u===Gk&&this._addToFsEvents(t,!1,!0)}}_watchWithFsEvents(e,t,n,i){if(this.fsw.closed||this.fsw._isIgnored(e))return;let s=this.fsw.options,a=RU(e,t,async(c,l,u)=>{if(this.fsw.closed||s.depth!==void 0&&pg(c,t)>s.depth)return;let f=n(_t.join(e,_t.relative(e,c)));if(i&&!i(f))return;let h=_t.dirname(f),g=_t.basename(f),x=this.fsw._getWatchedDir(u.type===ka?f:h);if(kU.has(l)||u.event===vU)if(typeof s.ignored===ug){let S;try{S=await fg(f)}catch{}if(this.fsw.closed||this.checkIgnored(f,S))return;Yk(u,S)?this.addOrChange(f,c,t,h,x,g,u,s):this.handleEvent($u,f,c,t,h,x,g,u,s)}else this.checkExists(f,c,t,h,x,g,u,s);else switch(u.event){case dU:case hU:return this.addOrChange(f,c,t,h,x,g,u,s);case mU:case gU:return this.checkExists(f,c,t,h,x,g,u,s)}},this.fsw._emitRaw);return this.fsw._emitReady(),a}async _handleFsEventsSymlink(e,t,n,i){if(!(this.fsw.closed||this.fsw._symlinkPaths.has(t))){this.fsw._symlinkPaths.set(t,!0),this.fsw._incrReadyCount();try{let s=await Kk(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(s))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(s||e,o=>{let a=e;return s&&s!==Vk?a=o.replace(s,e):o!==Vk&&(a=_t.join(e,o)),n(a)},!1,i)}catch(s){if(this.fsw._handleError(s))return this.fsw._emitReady()}}}emitAdd(e,t,n,i,s){let o=n(e),a=t.isDirectory(),c=this.fsw._getWatchedDir(_t.dirname(o)),l=_t.basename(o);a&&this.fsw._getWatchedDir(o),!c.has(l)&&(c.add(l),(!i.ignoreInitial||s===!0)&&this.fsw._emit(a?Gk:lg,o,t))}initWatch(e,t,n,i){if(this.fsw.closed)return;let s=this._watchWithFsEvents(n.watchPath,_t.resolve(e||n.watchPath),i,n.globFilter);this.fsw._addPathCloser(t,s)}async _addToFsEvents(e,t,n,i){if(this.fsw.closed)return;let s=this.fsw.options,o=typeof t===ug?t:wU,a=this.fsw._getWatchHelpers(e);try{let c=await TU[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))throw null;if(c.isDirectory()){if(a.globFilter||this.emitAdd(o(e),c,o,s,n),i&&i>s.depth)return;this.fsw._readdirp(a.watchPath,{fileFilter:l=>a.filterPath(l),directoryFilter:l=>a.filterDir(l),...SU(s.depth-(i||0))}).on(pU,l=>{if(this.fsw.closed||l.stats.isDirectory()&&!a.filterPath(l))return;let u=_t.join(a.watchPath,l.path),{fullPath:f}=l;if(a.followSymlinks&&l.stats.isSymbolicLink()){let h=s.depth===void 0?void 0:pg(u,_t.resolve(a.watchPath))+1;this._handleFsEventsSymlink(u,f,o,h)}else this.emitAdd(u,l.stats,o,s,n)}).on(uU,bU).on(fU,()=>{this.fsw._emitReady()})}else this.emitAdd(a.watchPath,c,o,s,n),this.fsw._emitReady()}catch(c){(!c||this.fsw._handleError(c))&&(this.fsw._emitReady(),this.fsw._emitReady())}if(s.persistent&&n!==!0)if(typeof t===ug)this.initWatch(void 0,e,a,o);else{let c;try{c=await Kk(a.watchPath)}catch{}this.initWatch(c,e,a,o)}}};gg.exports=dg;gg.exports.canUse=MU});var cA=A(Mg=>{"use strict";var{EventEmitter:PU}=require("events"),Rg=require("fs"),ue=require("path"),{promisify:iA}=require("util"),IU=jC(),wg=GC().default,NU=XC(),vg=Jm(),DU=Ik(),LU=Km(),BU=Wk(),Zk=Xk(),{EV_ALL:yg,EV_READY:jU,EV_ADD:Wu,EV_CHANGE:Aa,EV_UNLINK:Qk,EV_ADD_DIR:FU,EV_UNLINK_DIR:HU,EV_RAW:qU,EV_ERROR:xg,STR_CLOSE:UU,STR_END:$U,BACK_SLASH_RE:WU,DOUBLE_SLASH_RE:eA,SLASH_OR_BACK_SLASH_RE:GU,DOT_RE:zU,REPLACER_RE:VU,SLASH:_g,SLASH_SLASH:KU,BRACE_START:YU,BANG:Sg,ONE_DOT:sA,TWO_DOTS:JU,GLOBSTAR:XU,SLASH_GLOBSTAR:bg,ANYMATCH_OPTS:Eg,STRING_TYPE:Og,FUNCTION_TYPE:ZU,EMPTY_STR:Tg,EMPTY_FN:QU,isWindows:e$,isMacos:t$,isIBMi:r$}=ju(),n$=iA(Rg.stat),i$=iA(Rg.readdir),Cg=(r=[])=>Array.isArray(r)?r:[r],oA=(r,e=[])=>(r.forEach(t=>{Array.isArray(t)?oA(t,e):e.push(t)}),e),tA=r=>{let e=oA(Cg(r));if(!e.every(t=>typeof t===Og))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(aA)},rA=r=>{let e=r.replace(WU,_g),t=!1;for(e.startsWith(KU)&&(t=!0);e.match(eA);)e=e.replace(eA,_g);return t&&(e=_g+e),e},aA=r=>rA(ue.normalize(rA(r))),nA=(r=Tg)=>e=>typeof e!==Og?e:aA(ue.isAbsolute(e)?e:ue.join(r,e)),s$=(r,e)=>ue.isAbsolute(r)?r:r.startsWith(Sg)?Sg+ue.join(e,r.slice(1)):ue.join(e,r),Dr=(r,e)=>r[e]===void 0,kg=class{constructor(e,t){this.path=e,this._removeWatcher=t,this.items=new Set}add(e){let{items:t}=this;t&&e!==sA&&e!==JU&&t.add(e)}async remove(e){let{items:t}=this;if(!t||(t.delete(e),t.size>0))return;let n=this.path;try{await i$(n)}catch{this._removeWatcher&&this._removeWatcher(ue.dirname(n),ue.basename(n))}}has(e){let{items:t}=this;if(t)return t.has(e)}getChildren(){let{items:e}=this;if(e)return[...e.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this)}},o$="stat",a$="lstat",Ag=class{constructor(e,t,n,i){this.fsw=i,this.path=e=e.replace(VU,Tg),this.watchPath=t,this.fullWatchPath=ue.resolve(t),this.hasGlob=t!==e,e===Tg&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&n?void 0:!1,this.globFilter=this.hasGlob?wg(e,void 0,Eg):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(s=>{s.length>1&&s.pop()}),this.followSymlinks=n,this.statMethod=n?o$:a$}checkGlobSymlink(e){return this.globSymlink===void 0&&(this.globSymlink=e.fullParentDir===this.fullWatchPath?!1:{realPath:e.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):e.fullPath}entryPath(e){return ue.join(this.watchPath,ue.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){let{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);let n=this.entryPath(e);return(this.hasGlob&&typeof this.globFilter===ZU?this.globFilter(n):!0)&&this.fsw._isntIgnored(n,t)&&this.fsw._hasReadPermissions(t)}getDirParts(e){if(!this.hasGlob)return[];let t=[];return(e.includes(YU)?DU.expand(e):[e]).forEach(i=>{t.push(ue.relative(this.watchPath,i).split(GU))}),t}filterDir(e){if(this.hasGlob){let t=this.getDirParts(this.checkGlobSymlink(e)),n=!1;this.unmatchedGlob=!this.dirParts.some(i=>i.every((s,o)=>(s===XU&&(n=!0),n||!t[0][o]||wg(s,t[0][o],Eg))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}},Gu=class extends PU{constructor(e){super();let 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,Dr(t,"persistent")&&(t.persistent=!0),Dr(t,"ignoreInitial")&&(t.ignoreInitial=!1),Dr(t,"ignorePermissionErrors")&&(t.ignorePermissionErrors=!1),Dr(t,"interval")&&(t.interval=100),Dr(t,"binaryInterval")&&(t.binaryInterval=300),Dr(t,"disableGlobbing")&&(t.disableGlobbing=!1),t.enableBinaryInterval=t.binaryInterval!==t.interval,Dr(t,"useFsEvents")&&(t.useFsEvents=!t.usePolling),Zk.canUse()||(t.useFsEvents=!1),Dr(t,"usePolling")&&!t.useFsEvents&&(t.usePolling=t$),r$&&(t.usePolling=!0);let i=process.env.CHOKIDAR_USEPOLLING;if(i!==void 0){let c=i.toLowerCase();c==="false"||c==="0"?t.usePolling=!1:c==="true"||c==="1"?t.usePolling=!0:t.usePolling=!!c}let s=process.env.CHOKIDAR_INTERVAL;s&&(t.interval=Number.parseInt(s,10)),Dr(t,"atomic")&&(t.atomic=!t.usePolling&&!t.useFsEvents),t.atomic&&(this._pendingUnlinks=new Map),Dr(t,"followSymlinks")&&(t.followSymlinks=!0),Dr(t,"awaitWriteFinish")&&(t.awaitWriteFinish=!1),t.awaitWriteFinish===!0&&(t.awaitWriteFinish={});let o=t.awaitWriteFinish;o&&(o.stabilityThreshold||(o.stabilityThreshold=2e3),o.pollInterval||(o.pollInterval=100),this._pendingWrites=new Map),t.ignored&&(t.ignored=Cg(t.ignored));let a=0;this._emitReady=()=>{a++,a>=this._readyCount&&(this._emitReady=QU,this._readyEmitted=!0,process.nextTick(()=>this.emit(jU)))},this._emitRaw=(...c)=>this.emit(qU,...c),this._readyEmitted=!1,this.options=t,t.useFsEvents?this._fsEventsHandler=new Zk(this):this._nodeFsHandler=new BU(this),Object.freeze(t)}add(e,t,n){let{cwd:i,disableGlobbing:s}=this.options;this.closed=!1;let o=tA(e);return i&&(o=o.map(a=>{let c=s$(a,i);return s||!vg(a)?c:LU(c)})),o=o.filter(a=>a.startsWith(Sg)?(this._ignoredPaths.add(a.slice(1)),!1):(this._ignoredPaths.delete(a),this._ignoredPaths.delete(a+bg),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=o.length),this.options.persistent&&(this._readyCount+=o.length),o.forEach(a=>this._fsEventsHandler._addToFsEvents(a))):(this._readyCount||(this._readyCount=0),this._readyCount+=o.length,Promise.all(o.map(async a=>{let c=await this._nodeFsHandler._addToNodeFs(a,!n,0,0,t);return c&&this._emitReady(),c})).then(a=>{this.closed||a.filter(c=>c).forEach(c=>{this.add(ue.dirname(c),ue.basename(t||c))})})),this}unwatch(e){if(this.closed)return this;let t=tA(e),{cwd:n}=this.options;return t.forEach(i=>{!ue.isAbsolute(i)&&!this._closers.has(i)&&(n&&(i=ue.join(n,i)),i=ue.resolve(i)),this._closePath(i),this._ignoredPaths.add(i),this._watched.has(i)&&this._ignoredPaths.add(i+bg),this._userIgnored=void 0}),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(t=>t.forEach(n=>{let i=n();i instanceof Promise&&e.push(i)})),this._streams.forEach(t=>t.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(t=>t.dispose()),["closers","watched","streams","symlinkPaths","throttled"].forEach(t=>{this[`_${t}`].clear()}),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((t,n)=>{let i=this.options.cwd?ue.relative(this.options.cwd,n):n;e[i||sA]=t.getChildren().sort()}),e}emitWithAll(e,t){this.emit(...t),e!==xg&&this.emit(yg,...t)}async _emit(e,t,n,i,s){if(this.closed)return;let o=this.options;e$&&(t=ue.normalize(t)),o.cwd&&(t=ue.relative(o.cwd,t));let a=[e,t];s!==void 0?a.push(n,i,s):i!==void 0?a.push(n,i):n!==void 0&&a.push(n);let c=o.awaitWriteFinish,l;if(c&&(l=this._pendingWrites.get(t)))return l.lastChange=new Date,this;if(o.atomic){if(e===Qk)return this._pendingUnlinks.set(t,a),setTimeout(()=>{this._pendingUnlinks.forEach((u,f)=>{this.emit(...u),this.emit(yg,...u),this._pendingUnlinks.delete(f)})},typeof o.atomic=="number"?o.atomic:100),this;e===Wu&&this._pendingUnlinks.has(t)&&(e=a[0]=Aa,this._pendingUnlinks.delete(t))}if(c&&(e===Wu||e===Aa)&&this._readyEmitted){let u=(f,h)=>{f?(e=a[0]=xg,a[1]=f,this.emitWithAll(e,a)):h&&(a.length>2?a[2]=h:a.push(h),this.emitWithAll(e,a))};return this._awaitWriteFinish(t,c.stabilityThreshold,e,u),this}if(e===Aa&&!this._throttle(Aa,t,50))return this;if(o.alwaysStat&&n===void 0&&(e===Wu||e===FU||e===Aa)){let u=o.cwd?ue.join(o.cwd,t):t,f;try{f=await n$(u)}catch{}if(!f||this.closed)return;a.push(f)}return this.emitWithAll(e,a),this}_handleError(e){let t=e&&e.code;return e&&t!=="ENOENT"&&t!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||t!=="EPERM"&&t!=="EACCES")&&this.emit(xg,e),e||this.closed}_throttle(e,t,n){this._throttled.has(e)||this._throttled.set(e,new Map);let i=this._throttled.get(e),s=i.get(t);if(s)return s.count++,!1;let o,a=()=>{let l=i.get(t),u=l?l.count:0;return i.delete(t),clearTimeout(o),l&&clearTimeout(l.timeoutObject),u};o=setTimeout(a,n);let c={timeoutObject:o,clear:a,count:0};return i.set(t,c),c}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,n,i){let s,o=e;this.options.cwd&&!ue.isAbsolute(e)&&(o=ue.join(this.options.cwd,e));let a=new Date,c=l=>{Rg.stat(o,(u,f)=>{if(u||!this._pendingWrites.has(e)){u&&u.code!=="ENOENT"&&i(u);return}let h=Number(new Date);l&&f.size!==l.size&&(this._pendingWrites.get(e).lastChange=h);let g=this._pendingWrites.get(e);h-g.lastChange>=t?(this._pendingWrites.delete(e),i(void 0,f)):s=setTimeout(c,this.options.awaitWriteFinish.pollInterval,f)})};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:a,cancelWait:()=>(this._pendingWrites.delete(e),clearTimeout(s),n)}),s=setTimeout(c,this.options.awaitWriteFinish.pollInterval))}_getGlobIgnored(){return[...this._ignoredPaths.values()]}_isIgnored(e,t){if(this.options.atomic&&zU.test(e))return!0;if(!this._userIgnored){let{cwd:n}=this.options,i=this.options.ignored,s=i&&i.map(nA(n)),o=Cg(s).filter(c=>typeof c===Og&&!vg(c)).map(c=>c+bg),a=this._getGlobIgnored().map(nA(n)).concat(s,o);this._userIgnored=wg(a,void 0,Eg)}return this._userIgnored([e,t])}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e,t){let n=t||this.options.disableGlobbing||!vg(e)?e:NU(e),i=this.options.followSymlinks;return new Ag(e,n,i,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));let t=ue.resolve(e);return this._watched.has(t)||this._watched.set(t,new kg(t,this._boundRemove)),this._watched.get(t)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return!0;let n=(e&&Number.parseInt(e.mode,10))&511;return!!(4&Number.parseInt(n.toString(8)[0],10))}_remove(e,t,n){let i=ue.join(e,t),s=ue.resolve(i);if(n=n??(this._watched.has(i)||this._watched.has(s)),!this._throttle("remove",i,100))return;!n&&!this.options.useFsEvents&&this._watched.size===1&&this.add(e,t,!0),this._getWatchedDir(i).getChildren().forEach(h=>this._remove(i,h));let c=this._getWatchedDir(e),l=c.has(t);c.remove(t),this._symlinkPaths.has(s)&&this._symlinkPaths.delete(s);let u=i;if(this.options.cwd&&(u=ue.relative(this.options.cwd,i)),this.options.awaitWriteFinish&&this._pendingWrites.has(u)&&this._pendingWrites.get(u).cancelWait()===Wu)return;this._watched.delete(i),this._watched.delete(s);let f=n?HU:Qk;l&&!this._isIgnored(i)&&this._emit(f,i),this.options.useFsEvents||this._closePath(i)}_closePath(e){this._closeFile(e);let t=ue.dirname(e);this._getWatchedDir(t).remove(ue.basename(e))}_closeFile(e){let t=this._closers.get(e);t&&(t.forEach(n=>n()),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;let n={type:yg,alwaysStat:!0,lstat:!0,...t},i=IU(e,n);return this._streams.add(i),i.once(UU,()=>{i=void 0}),i.once($U,()=>{i&&(this._streams.delete(i),i=void 0)}),i}};Mg.FSWatcher=Gu;var c$=(r,e)=>{let t=new Gu(e);return t.add(r),t};Mg.watch=c$});var XA=A((MV,Bg)=>{"use strict";var v$=Object.prototype.hasOwnProperty,Lt="~";function Ia(){}Object.create&&(Ia.prototype=Object.create(null),new Ia().__proto__||(Lt=!1));function y$(r,e,t){this.fn=r,this.context=e,this.once=t||!1}function JA(r,e,t,n,i){if(typeof t!="function")throw new TypeError("The listener must be a function");var s=new y$(t,n||r,i),o=Lt?Lt+e:e;return r._events[o]?r._events[o].fn?r._events[o]=[r._events[o],s]:r._events[o].push(s):(r._events[o]=s,r._eventsCount++),r}function ep(r,e){--r._eventsCount===0?r._events=new Ia:delete r._events[e]}function kt(){this._events=new Ia,this._eventsCount=0}kt.prototype.eventNames=function(){var e=[],t,n;if(this._eventsCount===0)return e;for(n in t=this._events)v$.call(t,n)&&e.push(Lt?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};kt.prototype.listeners=function(e){var t=Lt?Lt+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,s=n.length,o=new Array(s);i<s;i++)o[i]=n[i].fn;return o};kt.prototype.listenerCount=function(e){var t=Lt?Lt+e:e,n=this._events[t];return n?n.fn?1:n.length:0};kt.prototype.emit=function(e,t,n,i,s,o){var a=Lt?Lt+e:e;if(!this._events[a])return!1;var c=this._events[a],l=arguments.length,u,f;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,s),!0;case 6:return c.fn.call(c.context,t,n,i,s,o),!0}for(f=1,u=new Array(l-1);f<l;f++)u[f-1]=arguments[f];c.fn.apply(c.context,u)}else{var h=c.length,g;for(f=0;f<h;f++)switch(c[f].once&&this.removeListener(e,c[f].fn,void 0,!0),l){case 1:c[f].fn.call(c[f].context);break;case 2:c[f].fn.call(c[f].context,t);break;case 3:c[f].fn.call(c[f].context,t,n);break;case 4:c[f].fn.call(c[f].context,t,n,i);break;default:if(!u)for(g=1,u=new Array(l-1);g<l;g++)u[g-1]=arguments[g];c[f].fn.apply(c[f].context,u)}}return!0};kt.prototype.on=function(e,t,n){return JA(this,e,t,n,!1)};kt.prototype.once=function(e,t,n){return JA(this,e,t,n,!0)};kt.prototype.removeListener=function(e,t,n,i){var s=Lt?Lt+e:e;if(!this._events[s])return this;if(!t)return ep(this,s),this;var o=this._events[s];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&ep(this,s);else{for(var a=0,c=[],l=o.length;a<l;a++)(o[a].fn!==t||i&&!o[a].once||n&&o[a].context!==n)&&c.push(o[a]);c.length?this._events[s]=c.length===1?c[0]:c:ep(this,s)}return this};kt.prototype.removeAllListeners=function(e){var t;return e?(t=Lt?Lt+e:e,this._events[t]&&ep(this,t)):(this._events=new Ia,this._eventsCount=0),this};kt.prototype.off=kt.prototype.removeListener;kt.prototype.addListener=kt.prototype.on;kt.prefixed=Lt;kt.EventEmitter=kt;typeof Bg<"u"&&(Bg.exports=kt)});var QA=A((PV,ZA)=>{"use strict";ZA.exports=function(e,t){if(t=t.split(":")[0],e=+e,!e)return!1;switch(t){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443;case"ftp":return e!==21;case"gopher":return e!==70;case"file":return!1}return e!==0}});var tp=A(tR=>{var kn=tR,x$=require("url"),eR=require("util")._extend,_$=QA(),b$=/(^|,)\s*upgrade\s*($|,)/i,jg=/^https|wss/;kn.isSSL=jg;kn.setupOutgoing=function(r,e,t,n){r.port=e[n||"target"].port||(jg.test(e[n||"target"].protocol)?443:80),["host","hostname","socketPath","pfx","key","passphrase","cert","ca","ciphers","secureProtocol"].forEach(function(a){r[a]=e[n||"target"][a]}),r.method=e.method||t.method,r.headers=eR({},t.headers),e.headers&&eR(r.headers,e.headers),e.auth&&(r.auth=e.auth),e.ca&&(r.ca=e.ca),jg.test(e[n||"target"].protocol)&&(r.rejectUnauthorized=typeof e.secure>"u"?!0:e.secure),r.agent=e.agent||!1,r.localAddress=e.localAddress,r.agent||(r.headers=r.headers||{},(typeof r.headers.connection!="string"||!b$.test(r.headers.connection))&&(r.headers.connection="close"));var i=e[n||"target"],s=i&&e.prependPath!==!1&&i.path||"",o=e.toProxy?t.url:x$.parse(t.url).path||"";return o=e.ignorePath?"":o,r.path=kn.urlJoin(s,o),e.changeOrigin&&(r.headers.host=_$(r.port,e[n||"target"].protocol)&&!w$(r.host)?r.host+":"+r.port:r.host),r};kn.setupSocket=function(r){return r.setTimeout(0),r.setNoDelay(!0),r.setKeepAlive(!0,0),r};kn.getPort=function(r){var e=r.headers.host?r.headers.host.match(/:(\d+)/):"";return e?e[1]:kn.hasEncryptedConnection(r)?"443":"80"};kn.hasEncryptedConnection=function(r){return!!(r.connection.encrypted||r.connection.pair)};kn.urlJoin=function(){var r=Array.prototype.slice.call(arguments),e=r.length-1,t=r[e],n=t.split("?"),i;return r[e]=n.shift(),i=[r.filter(Boolean).join("/").replace(/\/+/g,"/").replace("http:/","http://").replace("https:/","https://")],i.push.apply(i,n),i.join("?")};kn.rewriteCookieProperty=function r(e,t,n){return Array.isArray(e)?e.map(function(i){return r(i,t,n)}):e.replace(new RegExp("(;\\s*"+n+"=)([^;]+)","i"),function(i,s,o){var a;if(o in t)a=t[o];else if("*"in t)a=t["*"];else return i;return a?s+a:""})};function w$(r){return!!~r.indexOf(":")}});var sR=A((NV,iR)=>{var rR=require("url"),nR=tp(),S$=/^201|30(1|2|7|8)$/;iR.exports={removeChunked:function(e,t,n){e.httpVersion==="1.0"&&delete n.headers["transfer-encoding"]},setConnection:function(e,t,n){e.httpVersion==="1.0"?n.headers.connection=e.headers.connection||"close":e.httpVersion!=="2.0"&&!n.headers.connection&&(n.headers.connection=e.headers.connection||"keep-alive")},setRedirectHostRewrite:function(e,t,n,i){if((i.hostRewrite||i.autoRewrite||i.protocolRewrite)&&n.headers.location&&S$.test(n.statusCode)){var s=rR.parse(i.target),o=rR.parse(n.headers.location);if(s.host!=o.host)return;i.hostRewrite?o.host=i.hostRewrite:i.autoRewrite&&(o.host=e.headers.host),i.protocolRewrite&&(o.protocol=i.protocolRewrite),n.headers.location=o.format()}},writeHeaders:function(e,t,n,i){var s=i.cookieDomainRewrite,o=i.cookiePathRewrite,a=i.preserveHeaderKeyCase,c,l=function(h,g){g!=null&&(s&&h.toLowerCase()==="set-cookie"&&(g=nR.rewriteCookieProperty(g,s,"domain")),o&&h.toLowerCase()==="set-cookie"&&(g=nR.rewriteCookieProperty(g,o,"path")),t.setHeader(String(h).trim(),g))};if(typeof s=="string"&&(s={"*":s}),typeof o=="string"&&(o={"*":o}),a&&n.rawHeaders!=null){c={};for(var u=0;u<n.rawHeaders.length;u+=2){var f=n.rawHeaders[u];c[f.toLowerCase()]=f}}Object.keys(n.headers).forEach(function(h){var g=n.headers[h];a&&c&&(h=c[h]||h),l(h,g)})},writeStatusCode:function(e,t,n){n.statusMessage?(t.statusCode=n.statusCode,t.statusMessage=n.statusMessage):t.statusCode=n.statusCode}}});var aR=A((DV,oR)=>{var Na;oR.exports=function(){if(!Na){try{Na=Ae()("follow-redirects")}catch{}typeof Na!="function"&&(Na=function(){})}Na.apply(null,arguments)}});var fR=A((LV,Jg)=>{var La=require("url"),Da=La.URL,E$=require("http"),T$=require("https"),$g=require("stream").Writable,Wg=require("assert"),cR=aR();(function(){var e=typeof process<"u",t=typeof window<"u"&&typeof document<"u",n=Pi(Error.captureStackTrace);!e&&(t||!n)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var Gg=!1;try{Wg(new Da(""))}catch(r){Gg=r.code==="ERR_INVALID_URL"}var C$=["Authorization","Proxy-Authorization","Cookie"],k$=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],zg=["abort","aborted","connect","error","socket","timeout"],Vg=Object.create(null);zg.forEach(function(r){Vg[r]=function(e,t,n){this._redirectable.emit(r,e,t,n)}});var Hg=Ba("ERR_INVALID_URL","Invalid URL",TypeError),qg=Ba("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),A$=Ba("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",qg),R$=Ba("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),O$=Ba("ERR_STREAM_WRITE_AFTER_END","write after end"),M$=$g.prototype.destroy||uR;function Vt(r,e){$g.call(this),this._sanitizeOptions(r),this._options=r,this._ended=!1,this._ending=!1,this._redirectCount=0,this._redirects=[],this._requestBodyLength=0,this._requestBodyBuffers=[],e&&this.on("response",e);var t=this;this._onNativeResponse=function(n){try{t._processResponse(n)}catch(i){t.emit("error",i instanceof qg?i:new qg({cause:i}))}},this._headerFilter=new RegExp("^(?:"+C$.concat(r.sensitiveHeaders).map(B$).join("|")+")$","i"),this._performRequest()}Vt.prototype=Object.create($g.prototype);Vt.prototype.abort=function(){Yg(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};Vt.prototype.destroy=function(r){return Yg(this._currentRequest,r),M$.call(this,r),this};Vt.prototype.write=function(r,e,t){if(this._ending)throw new O$;if(!Mi(r)&&!D$(r))throw new TypeError("data should be a string, Buffer or Uint8Array");if(Pi(e)&&(t=e,e=null),r.length===0){t&&t();return}this._requestBodyLength+r.length<=this._options.maxBodyLength?(this._requestBodyLength+=r.length,this._requestBodyBuffers.push({data:r,encoding:e}),this._currentRequest.write(r,e,t)):(this.emit("error",new R$),this.abort())};Vt.prototype.end=function(r,e,t){if(Pi(r)?(t=r,r=e=null):Pi(e)&&(t=e,e=null),!r)this._ended=this._ending=!0,this._currentRequest.end(null,null,t);else{var n=this,i=this._currentRequest;this.write(r,e,function(){n._ended=!0,i.end(null,null,t)}),this._ending=!0}};Vt.prototype.setHeader=function(r,e){this._options.headers[r]=e,this._currentRequest.setHeader(r,e)};Vt.prototype.removeHeader=function(r){delete this._options.headers[r],this._currentRequest.removeHeader(r)};Vt.prototype.setTimeout=function(r,e){var t=this;function n(o){o.setTimeout(r),o.removeListener("timeout",o.destroy),o.addListener("timeout",o.destroy)}function i(o){t._timeout&&clearTimeout(t._timeout),t._timeout=setTimeout(function(){t.emit("timeout"),s()},r),n(o)}function s(){t._timeout&&(clearTimeout(t._timeout),t._timeout=null),t.removeListener("abort",s),t.removeListener("error",s),t.removeListener("response",s),t.removeListener("close",s),e&&t.removeListener("timeout",e),t.socket||t._currentRequest.removeListener("socket",i)}return e&&this.on("timeout",e),this.socket?i(this.socket):this._currentRequest.once("socket",i),this.on("socket",n),this.on("abort",s),this.on("error",s),this.on("response",s),this.on("close",s),this};["flushHeaders","getHeader","setNoDelay","setSocketKeepAlive"].forEach(function(r){Vt.prototype[r]=function(e,t){return this._currentRequest[r](e,t)}});["aborted","connection","socket"].forEach(function(r){Object.defineProperty(Vt.prototype,r,{get:function(){return this._currentRequest[r]}})});Vt.prototype._sanitizeOptions=function(r){if(r.headers||(r.headers={}),N$(r.sensitiveHeaders)||(r.sensitiveHeaders=[]),r.host&&(r.hostname||(r.hostname=r.host),delete r.host),!r.pathname&&r.path){var e=r.path.indexOf("?");e<0?r.pathname=r.path:(r.pathname=r.path.substring(0,e),r.search=r.path.substring(e))}};Vt.prototype._performRequest=function(){var r=this._options.protocol,e=this._options.nativeProtocols[r];if(!e)throw new TypeError("Unsupported protocol "+r);if(this._options.agents){var t=r.slice(0,-1);this._options.agent=this._options.agents[t]}var n=this._currentRequest=e.request(this._options,this._onNativeResponse);n._redirectable=this;for(var i of zg)n.on(i,Vg[i]);if(this._currentUrl=/^\//.test(this._options.path)?La.format(this._options):this._options.path,this._isRedirect){var s=0,o=this,a=this._requestBodyBuffers;(function c(l){if(n===o._currentRequest)if(l)o.emit("error",l);else if(s<a.length){var u=a[s++];n.finished||n.write(u.data,u.encoding,c)}else o._ended&&n.end()})()}};Vt.prototype._processResponse=function(r){var e=r.statusCode;this._options.trackRedirects&&this._redirects.push({url:this._currentUrl,headers:r.headers,statusCode:e});var t=r.headers.location;if(!t||this._options.followRedirects===!1||e<300||e>=400){r.responseUrl=this._currentUrl,r.redirects=this._redirects,this.emit("response",r),this._requestBodyBuffers=[];return}if(Yg(this._currentRequest),r.destroy(),++this._redirectCount>this._options.maxRedirects)throw new A$;var n,i=this._options.beforeRedirect;i&&(n=Object.assign({Host:r.req.getHeader("host")},this._options.headers));var s=this._options.method;((e===301||e===302)&&this._options.method==="POST"||e===303&&!/^(?:GET|HEAD)$/.test(this._options.method))&&(this._options.method="GET",this._requestBodyBuffers=[],Fg(/^content-/i,this._options.headers));var o=Fg(/^host$/i,this._options.headers),a=Kg(this._currentUrl),c=o||a.host,l=/^\w+:/.test(t)?this._currentUrl:La.format(Object.assign(a,{host:c})),u=P$(t,l);if(cR("redirecting to",u.href),this._isRedirect=!0,Ug(u,this._options),(u.protocol!==a.protocol&&u.protocol!=="https:"||u.host!==c&&!I$(u.host,c))&&Fg(this._headerFilter,this._options.headers),Pi(i)){var f={headers:r.headers,statusCode:e},h={url:l,method:s,headers:n};i(this._options,f,h),this._sanitizeOptions(this._options)}this._performRequest()};function lR(r){var e={maxRedirects:21,maxBodyLength:10485760},t={};return Object.keys(r).forEach(function(n){var i=n+":",s=t[i]=r[n],o=e[n]=Object.create(s);function a(l,u,f){return L$(l)?l=Ug(l):Mi(l)?l=Ug(Kg(l)):(f=u,u=pR(l),l={protocol:i}),Pi(u)&&(f=u,u=null),u=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},l,u),u.nativeProtocols=t,!Mi(u.host)&&!Mi(u.hostname)&&(u.hostname="::1"),Wg.equal(u.protocol,i,"protocol mismatch"),cR("options",u),new Vt(u,f)}function c(l,u,f){var h=o.request(l,u,f);return h.end(),h}Object.defineProperties(o,{request:{value:a,configurable:!0,enumerable:!0,writable:!0},get:{value:c,configurable:!0,enumerable:!0,writable:!0}})}),e}function uR(){}function Kg(r){var e;if(Gg)e=new Da(r);else if(e=pR(La.parse(r)),!Mi(e.protocol))throw new Hg({input:r});return e}function P$(r,e){return Gg?new Da(r,e):Kg(La.resolve(e,r))}function pR(r){if(/^\[/.test(r.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(r.hostname))throw new Hg({input:r.href||r});if(/^\[/.test(r.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(r.host))throw new Hg({input:r.href||r});return r}function Ug(r,e){var t=e||{};for(var n of k$)t[n]=r[n];return t.hostname.startsWith("[")&&(t.hostname=t.hostname.slice(1,-1)),t.port!==""&&(t.port=Number(t.port)),t.path=t.search?t.pathname+t.search:t.pathname,t}function Fg(r,e){var t;for(var n in e)r.test(n)&&(t=e[n],delete e[n]);return t===null||typeof t>"u"?void 0:String(t).trim()}function Ba(r,e,t){function n(i){Pi(Error.captureStackTrace)&&Error.captureStackTrace(this,this.constructor),Object.assign(this,i||{}),this.code=r,this.message=this.cause?e+": "+this.cause.message:e}return n.prototype=new(t||Error),Object.defineProperties(n.prototype,{constructor:{value:n,enumerable:!1},name:{value:"Error ["+r+"]",enumerable:!1}}),n}function Yg(r,e){for(var t of zg)r.removeListener(t,Vg[t]);r.on("error",uR),r.destroy(e)}function I$(r,e){Wg(Mi(r)&&Mi(e));var t=r.length-e.length-1;return t>0&&r[t]==="."&&r.endsWith(e)}function N$(r){return r instanceof Array}function Mi(r){return typeof r=="string"||r instanceof String}function Pi(r){return typeof r=="function"}function D$(r){return typeof r=="object"&&"length"in r}function L$(r){return Da&&r instanceof Da}function B$(r){return r.replace(/[\]\\/()*+?.$]/g,"\\$&")}Jg.exports=lR({http:E$,https:T$});Jg.exports.wrap=lR});var hR=A((BV,dR)=>{var j$=require("http"),F$=require("https"),ja=sR(),rp=tp(),H$=fR();ja=Object.keys(ja).map(function(r){return ja[r]});var q$={http:j$,https:F$};dR.exports={deleteLength:function(e,t,n){(e.method==="DELETE"||e.method==="OPTIONS")&&!e.headers["content-length"]&&(e.headers["content-length"]="0",delete e.headers["transfer-encoding"])},timeout:function(e,t,n){n.timeout&&e.socket.setTimeout(n.timeout)},XHeaders:function(e,t,n){if(n.xfwd){var i=e.isSpdy||rp.hasEncryptedConnection(e),s={for:e.connection.remoteAddress||e.socket.remoteAddress,port:rp.getPort(e),proto:i?"https":"http"};["for","port","proto"].forEach(function(o){e.headers["x-forwarded-"+o]=(e.headers["x-forwarded-"+o]||"")+(e.headers["x-forwarded-"+o]?",":"")+s[o]}),e.headers["x-forwarded-host"]=e.headers["x-forwarded-host"]||e.headers.host||""}},stream:function(e,t,n,i,s,o){s.emit("start",e,t,n.target||n.forward);var a=n.followRedirects?H$:q$,c=a.http,l=a.https;if(n.forward){var u=(n.forward.protocol==="https:"?l:c).request(rp.setupOutgoing(n.ssl||{},n,e,"forward")),f=x(u,n.forward);if(e.on("error",f),u.on("error",f),(n.buffer||e).pipe(u),!n.target)return t.end()}var h=(n.target.protocol==="https:"?l:c).request(rp.setupOutgoing(n.ssl||{},n,e));h.on("socket",function(S){s&&!h.getHeader("expect")&&s.emit("proxyReq",h,e,t,n)}),n.proxyTimeout&&h.setTimeout(n.proxyTimeout,function(){h.abort()}),e.on("aborted",function(){h.abort()});var g=x(h,n.target);e.on("error",g),h.on("error",g);function x(S,C){return function(M){if(e.socket.destroyed&&M.code==="ECONNRESET")return s.emit("econnreset",M,e,t,C),S.abort();o?o(M,e,t,C):s.emit("error",M,e,t,C)}}(n.buffer||e).pipe(h),h.on("response",function(S){if(s&&s.emit("proxyRes",S,e,t),!t.headersSent&&!n.selfHandleResponse)for(var C=0;C<ja.length&&!ja[C](e,t,S,n);C++);t.finished?s&&s.emit("end",e,t,S):(S.on("end",function(){s&&s.emit("end",e,t,S)}),n.selfHandleResponse||S.pipe(t))})}}});var gR=A((jV,mR)=>{var U$=require("http"),$$=require("https"),oo=tp();mR.exports={checkMethodAndHeader:function(e,t){if(e.method!=="GET"||!e.headers.upgrade||e.headers.upgrade.toLowerCase()!=="websocket")return t.destroy(),!0},XHeaders:function(e,t,n){if(n.xfwd){var i={for:e.connection.remoteAddress||e.socket.remoteAddress,port:oo.getPort(e),proto:oo.hasEncryptedConnection(e)?"wss":"ws"};["for","port","proto"].forEach(function(s){e.headers["x-forwarded-"+s]=(e.headers["x-forwarded-"+s]||"")+(e.headers["x-forwarded-"+s]?",":"")+i[s]})}},stream:function(e,t,n,i,s,o){var a=function(u,f){return Object.keys(f).reduce(function(h,g){var x=f[g];if(!Array.isArray(x))return h.push(g+": "+x),h;for(var S=0;S<x.length;S++)h.push(g+": "+x[S]);return h},[u]).join(`\r
|
|
106
106
|
`)+`\r
|
|
107
107
|
\r
|
|
108
|
-
`};no.setupSocket(t),i&&i.length&&t.unshift(i);var c=(no.isSSL.test(n.target.protocol)?P$:M$).request(no.setupOutgoing(n.ssl||{},n,e));return s&&s.emit("proxyReqWs",c,e,t,n,i),c.on("error",l),c.on("response",function(u){u.upgrade||(t.write(a("HTTP/"+u.httpVersion+" "+u.statusCode+" "+u.statusMessage,u.headers)),u.pipe(t))}),c.on("upgrade",function(u,f,h){f.on("error",l),f.on("end",function(){s.emit("close",u,f,h)}),t.on("error",function(){f.end()}),no.setupSocket(f),h&&h.length&&f.unshift(h),t.write(a("HTTP/1.1 101 Switching Protocols",u.headers)),f.pipe(t).pipe(f),s.emit("open",f),s.emit("proxySocket",f)}),c.end();function l(u){o?o(u,e,t):s.emit("error",u,e,t),t.end()}}}});var hR=A((EV,dR)=>{var pR=dR.exports,cR=require("util")._extend,I$=require("url").parse,fR=UA(),N$=require("http"),D$=require("https"),lR=sR(),uR=aR();pR.Server=Mi;function Gg(r){return function(e){return function(t,n){var i=r==="ws"?this.wsPasses:this.webPasses,s=[].slice.call(arguments),o=s.length-1,a,c;typeof s[o]=="function"&&(c=s[o],o--);var l=e;if(!(s[o]instanceof Buffer)&&s[o]!==n&&(l=cR({},e),cR(l,s[o]),o--),s[o]instanceof Buffer&&(a=s[o]),["target","forward"].forEach(function(f){typeof l[f]=="string"&&(l[f]=I$(l[f]))}),!l.target&&!l.forward)return this.emit("error",new Error("Must provide a proper URL as target"));for(var u=0;u<i.length&&!i[u](t,n,l,a,this,c);u++);}}}pR.createRightProxy=Gg;function Mi(r){fR.call(this),r=r||{},r.prependPath=r.prependPath!==!1,this.web=this.proxyRequest=Gg("web")(r),this.ws=this.proxyWebsocketRequest=Gg("ws")(r),this.options=r,this.webPasses=Object.keys(lR).map(function(e){return lR[e]}),this.wsPasses=Object.keys(uR).map(function(e){return uR[e]}),this.on("error",this.onError,this)}require("util").inherits(Mi,fR);Mi.prototype.onError=function(r){if(this.listeners("error").length===1)throw r};Mi.prototype.listen=function(r,e){var t=this,n=function(i,s){t.web(i,s)};return this._server=this.options.ssl?D$.createServer(this.options.ssl,n):N$.createServer(n),this.options.ws&&this._server.on("upgrade",function(i,s,o){t.ws(i,s,o)}),this._server.listen(r,e),this};Mi.prototype.close=function(r){var e=this;this._server&&this._server.close(t);function t(){e._server=null,r&&r.apply(null,arguments)}};Mi.prototype.before=function(r,e,t){if(r!=="ws"&&r!=="web")throw new Error("type must be `web` or `ws`");var n=r==="ws"?this.wsPasses:this.webPasses,i=!1;if(n.forEach(function(s,o){s.name===e&&(i=o)}),i===!1)throw new Error("No such pass");n.splice(i,0,t)};Mi.prototype.after=function(r,e,t){if(r!=="ws"&&r!=="web")throw new Error("type must be `web` or `ws`");var n=r==="ws"?this.wsPasses:this.webPasses,i=!1;if(n.forEach(function(s,o){s.name===e&&(i=o)}),i===!1)throw new Error("No such pass");n.splice(i++,0,t)}});var gR=A((TV,mR)=>{var ja=hR().Server;function zg(r){return new ja(r)}ja.createProxyServer=zg;ja.createServer=zg;ja.createProxy=zg;mR.exports=ja});var yR=A((CV,vR)=>{vR.exports=gR()});var qR=A((Ha,Kg)=>{(function(r,e){typeof Ha=="object"&&typeof Kg=="object"?Kg.exports=e(require("child_process"),require("crypto")):typeof define=="function"&&define.amd?define(["child_process","crypto"],e):typeof Ha=="object"?Ha["electron-machine-id"]=e(require("child_process"),require("crypto")):r["electron-machine-id"]=e(r.child_process,r.crypto)})(Ha,function(r,e){return(function(t){function n(s){if(i[s])return i[s].exports;var o=i[s]={exports:{},id:s,loaded:!1};return t[s].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var i={};return n.m=t,n.c=i,n.p="",n(0)})([function(t,n,i){t.exports=i(34)},function(t,n,i){var s=i(29)("wks"),o=i(33),a=i(2).Symbol,c=typeof a=="function",l=t.exports=function(u){return s[u]||(s[u]=c&&a[u]||(c?a:o)("Symbol."+u))};l.store=s},function(t,n){var i=t.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=i)},function(t,n,i){var s=i(9);t.exports=function(o){if(!s(o))throw TypeError(o+" is not an object!");return o}},function(t,n,i){t.exports=!i(24)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},function(t,n,i){var s=i(12),o=i(17);t.exports=i(4)?function(a,c,l){return s.f(a,c,o(1,l))}:function(a,c,l){return a[c]=l,a}},function(t,n){var i=t.exports={version:"2.4.0"};typeof __e=="number"&&(__e=i)},function(t,n,i){var s=i(14);t.exports=function(o,a,c){if(s(o),a===void 0)return o;switch(c){case 1:return function(l){return o.call(a,l)};case 2:return function(l,u){return o.call(a,l,u)};case 3:return function(l,u,f){return o.call(a,l,u,f)}}return function(){return o.apply(a,arguments)}}},function(t,n){var i={}.hasOwnProperty;t.exports=function(s,o){return i.call(s,o)}},function(t,n){t.exports=function(i){return typeof i=="object"?i!==null:typeof i=="function"}},function(t,n){t.exports={}},function(t,n){var i={}.toString;t.exports=function(s){return i.call(s).slice(8,-1)}},function(t,n,i){var s=i(3),o=i(26),a=i(32),c=Object.defineProperty;n.f=i(4)?Object.defineProperty:function(l,u,f){if(s(l),u=a(u,!0),s(f),o)try{return c(l,u,f)}catch{}if("get"in f||"set"in f)throw TypeError("Accessors not supported!");return"value"in f&&(l[u]=f.value),l}},function(t,n,i){var s=i(42),o=i(15);t.exports=function(a){return s(o(a))}},function(t,n){t.exports=function(i){if(typeof i!="function")throw TypeError(i+" is not a function!");return i}},function(t,n){t.exports=function(i){if(i==null)throw TypeError("Can't call method on "+i);return i}},function(t,n,i){var s=i(9),o=i(2).document,a=s(o)&&s(o.createElement);t.exports=function(c){return a?o.createElement(c):{}}},function(t,n){t.exports=function(i,s){return{enumerable:!(1&i),configurable:!(2&i),writable:!(4&i),value:s}}},function(t,n,i){var s=i(12).f,o=i(8),a=i(1)("toStringTag");t.exports=function(c,l,u){c&&!o(c=u?c:c.prototype,a)&&s(c,a,{configurable:!0,value:l})}},function(t,n,i){var s=i(29)("keys"),o=i(33);t.exports=function(a){return s[a]||(s[a]=o(a))}},function(t,n){var i=Math.ceil,s=Math.floor;t.exports=function(o){return isNaN(o=+o)?0:(o>0?s:i)(o)}},function(t,n,i){var s=i(11),o=i(1)("toStringTag"),a=s((function(){return arguments})())=="Arguments",c=function(l,u){try{return l[u]}catch{}};t.exports=function(l){var u,f,h;return l===void 0?"Undefined":l===null?"Null":typeof(f=c(u=Object(l),o))=="string"?f:a?s(u):(h=s(u))=="Object"&&typeof u.callee=="function"?"Arguments":h}},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n,i){var s=i(2),o=i(6),a=i(7),c=i(5),l="prototype",u=function(f,h,g){var x,S,k,R=f&u.F,M=f&u.G,I=f&u.S,B=f&u.P,V=f&u.B,F=f&u.W,G=M?o:o[h]||(o[h]={}),D=G[l],U=M?s:I?s[h]:(s[h]||{})[l];M&&(g=h);for(x in g)S=!R&&U&&U[x]!==void 0,S&&x in G||(k=S?U[x]:g[x],G[x]=M&&typeof U[x]!="function"?g[x]:V&&S?a(k,s):F&&U[x]==k?(function(T){var p=function(m,y,w){if(this instanceof T){switch(arguments.length){case 0:return new T;case 1:return new T(m);case 2:return new T(m,y)}return new T(m,y,w)}return T.apply(this,arguments)};return p[l]=T[l],p})(k):B&&typeof k=="function"?a(Function.call,k):k,B&&((G.virtual||(G.virtual={}))[x]=k,f&u.R&&D&&!D[x]&&c(D,x,k)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,n){t.exports=function(i){try{return!!i()}catch{return!0}}},function(t,n,i){t.exports=i(2).document&&document.documentElement},function(t,n,i){t.exports=!i(4)&&!i(24)(function(){return Object.defineProperty(i(16)("div"),"a",{get:function(){return 7}}).a!=7})},function(t,n,i){"use strict";var s=i(28),o=i(23),a=i(57),c=i(5),l=i(8),u=i(10),f=i(45),h=i(18),g=i(52),x=i(1)("iterator"),S=!([].keys&&"next"in[].keys()),k="@@iterator",R="keys",M="values",I=function(){return this};t.exports=function(B,V,F,G,D,U,T){f(F,V,G);var p,m,y,w=function(P){if(!S&&P in b)return b[P];switch(P){case R:return function(){return new F(this,P)};case M:return function(){return new F(this,P)}}return function(){return new F(this,P)}},v=V+" Iterator",_=D==M,C=!1,b=B.prototype,d=b[x]||b[k]||D&&b[D],E=d||w(D),q=D?_?w("entries"):E:void 0,O=V=="Array"&&b.entries||d;if(O&&(y=g(O.call(new B)),y!==Object.prototype&&(h(y,v,!0),s||l(y,x)||c(y,x,I))),_&&d&&d.name!==M&&(C=!0,E=function(){return d.call(this)}),s&&!T||!S&&!C&&b[x]||c(b,x,E),u[V]=E,u[v]=I,D)if(p={values:_?E:w(M),keys:U?E:w(R),entries:q},T)for(m in p)m in b||a(b,m,p[m]);else o(o.P+o.F*(S||C),V,p);return p}},function(t,n){t.exports=!0},function(t,n,i){var s=i(2),o="__core-js_shared__",a=s[o]||(s[o]={});t.exports=function(c){return a[c]||(a[c]={})}},function(t,n,i){var s,o,a,c=i(7),l=i(41),u=i(25),f=i(16),h=i(2),g=h.process,x=h.setImmediate,S=h.clearImmediate,k=h.MessageChannel,R=0,M={},I="onreadystatechange",B=function(){var F=+this;if(M.hasOwnProperty(F)){var G=M[F];delete M[F],G()}},V=function(F){B.call(F.data)};x&&S||(x=function(F){for(var G=[],D=1;arguments.length>D;)G.push(arguments[D++]);return M[++R]=function(){l(typeof F=="function"?F:Function(F),G)},s(R),R},S=function(F){delete M[F]},i(11)(g)=="process"?s=function(F){g.nextTick(c(B,F,1))}:k?(o=new k,a=o.port2,o.port1.onmessage=V,s=c(a.postMessage,a,1)):h.addEventListener&&typeof postMessage=="function"&&!h.importScripts?(s=function(F){h.postMessage(F+"","*")},h.addEventListener("message",V,!1)):s=I in f("script")?function(F){u.appendChild(f("script"))[I]=function(){u.removeChild(this),B.call(F)}}:function(F){setTimeout(c(B,F,1),0)}),t.exports={set:x,clear:S}},function(t,n,i){var s=i(20),o=Math.min;t.exports=function(a){return a>0?o(s(a),9007199254740991):0}},function(t,n,i){var s=i(9);t.exports=function(o,a){if(!s(o))return o;var c,l;if(a&&typeof(c=o.toString)=="function"&&!s(l=c.call(o))||typeof(c=o.valueOf)=="function"&&!s(l=c.call(o))||!a&&typeof(c=o.toString)=="function"&&!s(l=c.call(o)))return l;throw TypeError("Can't convert object to primitive value")}},function(t,n){var i=0,s=Math.random();t.exports=function(o){return"Symbol(".concat(o===void 0?"":o,")_",(++i+s).toString(36))}},function(t,n,i){"use strict";function s(I){return I&&I.__esModule?I:{default:I}}function o(){return process.platform!=="win32"?"":process.arch==="ia32"&&process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432")?"mixed":"native"}function a(I){return(0,x.createHash)("sha256").update(I).digest("hex")}function c(I){switch(k){case"darwin":return I.split("IOPlatformUUID")[1].split(`
|
|
109
|
-
`)[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return I.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":return I.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"freebsd":return I.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw new Error("Unsupported platform: "+process.platform)}}function l(I){var B=c((0,g.execSync)(M[k]).toString());return I?B:a(B)}function u(I){return new h.default(function(B,V){return(0,g.exec)(M[k],{},function(F,G,D){if(F)return V(new Error("Error while obtaining machine id: "+F.stack));var U=c(G.toString());return B(I?U:a(U))})})}Object.defineProperty(n,"__esModule",{value:!0});var f=i(35),h=s(f);n.machineIdSync=l,n.machineId=u;var g=i(70),x=i(71),S=process,k=S.platform,R={native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"},M={darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:R[o()]+"\\REG.exe QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",linux:"( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :",freebsd:"kenv -q smbios.system.uuid || sysctl -n kern.hostuuid"}},function(t,n,i){t.exports={default:i(36),__esModule:!0}},function(t,n,i){i(66),i(68),i(69),i(67),t.exports=i(6).Promise},function(t,n){t.exports=function(){}},function(t,n){t.exports=function(i,s,o,a){if(!(i instanceof s)||a!==void 0&&a in i)throw TypeError(o+": incorrect invocation!");return i}},function(t,n,i){var s=i(13),o=i(31),a=i(62);t.exports=function(c){return function(l,u,f){var h,g=s(l),x=o(g.length),S=a(f,x);if(c&&u!=u){for(;x>S;)if(h=g[S++],h!=h)return!0}else for(;x>S;S++)if((c||S in g)&&g[S]===u)return c||S||0;return!c&&-1}}},function(t,g,i){var s=i(7),o=i(44),a=i(43),c=i(3),l=i(31),u=i(64),f={},h={},g=t.exports=function(x,S,k,R,M){var I,B,V,F,G=M?function(){return x}:u(x),D=s(k,R,S?2:1),U=0;if(typeof G!="function")throw TypeError(x+" is not iterable!");if(a(G)){for(I=l(x.length);I>U;U++)if(F=S?D(c(B=x[U])[0],B[1]):D(x[U]),F===f||F===h)return F}else for(V=G.call(x);!(B=V.next()).done;)if(F=o(V,D,B.value,S),F===f||F===h)return F};g.BREAK=f,g.RETURN=h},function(t,n){t.exports=function(i,s,o){var a=o===void 0;switch(s.length){case 0:return a?i():i.call(o);case 1:return a?i(s[0]):i.call(o,s[0]);case 2:return a?i(s[0],s[1]):i.call(o,s[0],s[1]);case 3:return a?i(s[0],s[1],s[2]):i.call(o,s[0],s[1],s[2]);case 4:return a?i(s[0],s[1],s[2],s[3]):i.call(o,s[0],s[1],s[2],s[3])}return i.apply(o,s)}},function(t,n,i){var s=i(11);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(o){return s(o)=="String"?o.split(""):Object(o)}},function(t,n,i){var s=i(10),o=i(1)("iterator"),a=Array.prototype;t.exports=function(c){return c!==void 0&&(s.Array===c||a[o]===c)}},function(t,n,i){var s=i(3);t.exports=function(o,a,c,l){try{return l?a(s(c)[0],c[1]):a(c)}catch(f){var u=o.return;throw u!==void 0&&s(u.call(o)),f}}},function(t,n,i){"use strict";var s=i(49),o=i(17),a=i(18),c={};i(5)(c,i(1)("iterator"),function(){return this}),t.exports=function(l,u,f){l.prototype=s(c,{next:o(1,f)}),a(l,u+" Iterator")}},function(t,n,i){var s=i(1)("iterator"),o=!1;try{var a=[7][s]();a.return=function(){o=!0},Array.from(a,function(){throw 2})}catch{}t.exports=function(c,l){if(!l&&!o)return!1;var u=!1;try{var f=[7],h=f[s]();h.next=function(){return{done:u=!0}},f[s]=function(){return h},c(f)}catch{}return u}},function(t,n){t.exports=function(i,s){return{value:s,done:!!i}}},function(t,n,i){var s=i(2),o=i(30).set,a=s.MutationObserver||s.WebKitMutationObserver,c=s.process,l=s.Promise,u=i(11)(c)=="process";t.exports=function(){var f,h,g,x=function(){var M,I;for(u&&(M=c.domain)&&M.exit();f;){I=f.fn,f=f.next;try{I()}catch(B){throw f?g():h=void 0,B}}h=void 0,M&&M.enter()};if(u)g=function(){c.nextTick(x)};else if(a){var S=!0,k=document.createTextNode("");new a(x).observe(k,{characterData:!0}),g=function(){k.data=S=!S}}else if(l&&l.resolve){var R=l.resolve();g=function(){R.then(x)}}else g=function(){o.call(s,x)};return function(M){var I={fn:M,next:void 0};h&&(h.next=I),f||(f=I,g()),h=I}}},function(t,n,i){var s=i(3),o=i(50),a=i(22),c=i(19)("IE_PROTO"),l=function(){},u="prototype",f=function(){var h,g=i(16)("iframe"),x=a.length,S=">";for(g.style.display="none",i(25).appendChild(g),g.src="javascript:",h=g.contentWindow.document,h.open(),h.write("<script>document.F=Object</script"+S),h.close(),f=h.F;x--;)delete f[u][a[x]];return f()};t.exports=Object.create||function(h,g){var x;return h!==null?(l[u]=s(h),x=new l,l[u]=null,x[c]=h):x=f(),g===void 0?x:o(x,g)}},function(t,n,i){var s=i(12),o=i(3),a=i(54);t.exports=i(4)?Object.defineProperties:function(c,l){o(c);for(var u,f=a(l),h=f.length,g=0;h>g;)s.f(c,u=f[g++],l[u]);return c}},function(t,n,i){var s=i(55),o=i(17),a=i(13),c=i(32),l=i(8),u=i(26),f=Object.getOwnPropertyDescriptor;n.f=i(4)?f:function(h,g){if(h=a(h),g=c(g,!0),u)try{return f(h,g)}catch{}if(l(h,g))return o(!s.f.call(h,g),h[g])}},function(t,n,i){var s=i(8),o=i(63),a=i(19)("IE_PROTO"),c=Object.prototype;t.exports=Object.getPrototypeOf||function(l){return l=o(l),s(l,a)?l[a]:typeof l.constructor=="function"&&l instanceof l.constructor?l.constructor.prototype:l instanceof Object?c:null}},function(t,n,i){var s=i(8),o=i(13),a=i(39)(!1),c=i(19)("IE_PROTO");t.exports=function(l,u){var f,h=o(l),g=0,x=[];for(f in h)f!=c&&s(h,f)&&x.push(f);for(;u.length>g;)s(h,f=u[g++])&&(~a(x,f)||x.push(f));return x}},function(t,n,i){var s=i(53),o=i(22);t.exports=Object.keys||function(a){return s(a,o)}},function(t,n){n.f={}.propertyIsEnumerable},function(t,n,i){var s=i(5);t.exports=function(o,a,c){for(var l in a)c&&o[l]?o[l]=a[l]:s(o,l,a[l]);return o}},function(t,n,i){t.exports=i(5)},function(t,n,i){var s=i(9),o=i(3),a=function(c,l){if(o(c),!s(l)&&l!==null)throw TypeError(l+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?(function(c,l,u){try{u=i(7)(Function.call,i(51).f(Object.prototype,"__proto__").set,2),u(c,[]),l=!(c instanceof Array)}catch{l=!0}return function(f,h){return a(f,h),l?f.__proto__=h:u(f,h),f}})({},!1):void 0),check:a}},function(t,n,i){"use strict";var s=i(2),o=i(6),a=i(12),c=i(4),l=i(1)("species");t.exports=function(u){var f=typeof o[u]=="function"?o[u]:s[u];c&&f&&!f[l]&&a.f(f,l,{configurable:!0,get:function(){return this}})}},function(t,n,i){var s=i(3),o=i(14),a=i(1)("species");t.exports=function(c,l){var u,f=s(c).constructor;return f===void 0||(u=s(f)[a])==null?l:o(u)}},function(t,n,i){var s=i(20),o=i(15);t.exports=function(a){return function(c,l){var u,f,h=String(o(c)),g=s(l),x=h.length;return g<0||g>=x?a?"":void 0:(u=h.charCodeAt(g),u<55296||u>56319||g+1===x||(f=h.charCodeAt(g+1))<56320||f>57343?a?h.charAt(g):u:a?h.slice(g,g+2):(u-55296<<10)+(f-56320)+65536)}}},function(t,n,i){var s=i(20),o=Math.max,a=Math.min;t.exports=function(c,l){return c=s(c),c<0?o(c+l,0):a(c,l)}},function(t,n,i){var s=i(15);t.exports=function(o){return Object(s(o))}},function(t,n,i){var s=i(21),o=i(1)("iterator"),a=i(10);t.exports=i(6).getIteratorMethod=function(c){if(c!=null)return c[o]||c["@@iterator"]||a[s(c)]}},function(t,n,i){"use strict";var s=i(37),o=i(47),a=i(10),c=i(13);t.exports=i(27)(Array,"Array",function(l,u){this._t=c(l),this._i=0,this._k=u},function(){var l=this._t,u=this._k,f=this._i++;return!l||f>=l.length?(this._t=void 0,o(1)):u=="keys"?o(0,f):u=="values"?o(0,l[f]):o(0,[f,l[f]])},"values"),a.Arguments=a.Array,s("keys"),s("values"),s("entries")},function(t,n){},function(t,n,i){"use strict";var s,o,a,c=i(28),l=i(2),u=i(7),f=i(21),h=i(23),g=i(9),x=(i(3),i(14)),S=i(38),k=i(40),R=(i(58).set,i(60)),M=i(30).set,I=i(48)(),B="Promise",V=l.TypeError,G=l.process,F=l[B],G=l.process,D=f(G)=="process",U=function(){},T=!!(function(){try{var O=F.resolve(1),P=(O.constructor={})[i(1)("species")]=function(j){j(U,U)};return(D||typeof PromiseRejectionEvent=="function")&&O.then(U)instanceof P}catch{}})(),p=function(O,P){return O===P||O===F&&P===a},m=function(O){var P;return!(!g(O)||typeof(P=O.then)!="function")&&P},y=function(O){return p(F,O)?new w(O):new o(O)},w=o=function(O){var P,j;this.promise=new O(function(z,H){if(P!==void 0||j!==void 0)throw V("Bad Promise constructor");P=z,j=H}),this.resolve=x(P),this.reject=x(j)},v=function(O){try{O()}catch(P){return{error:P}}},_=function(O,P){if(!O._n){O._n=!0;var j=O._c;I(function(){for(var z=O._v,H=O._s==1,ke=0,ne=function(N){var te,L,W=H?N.ok:N.fail,oe=N.resolve,Z=N.reject,J=N.domain;try{W?(H||(O._h==2&&d(O),O._h=1),W===!0?te=z:(J&&J.enter(),te=W(z),J&&J.exit()),te===N.promise?Z(V("Promise-chain cycle")):(L=m(te))?L.call(te,oe,Z):oe(te)):Z(z)}catch(kt){Z(kt)}};j.length>ke;)ne(j[ke++]);O._c=[],O._n=!1,P&&!O._h&&C(O)})}},C=function(O){M.call(l,function(){var P,j,z,H=O._v;if(b(O)&&(P=v(function(){D?G.emit("unhandledRejection",H,O):(j=l.onunhandledrejection)?j({promise:O,reason:H}):(z=l.console)&&z.error&&z.error("Unhandled promise rejection",H)}),O._h=D||b(O)?2:1),O._a=void 0,P)throw P.error})},b=function(O){if(O._h==1)return!1;for(var P,j=O._a||O._c,z=0;j.length>z;)if(P=j[z++],P.fail||!b(P.promise))return!1;return!0},d=function(O){M.call(l,function(){var P;D?G.emit("rejectionHandled",O):(P=l.onrejectionhandled)&&P({promise:O,reason:O._v})})},E=function(O){var P=this;P._d||(P._d=!0,P=P._w||P,P._v=O,P._s=2,P._a||(P._a=P._c.slice()),_(P,!0))},q=function(O){var P,j=this;if(!j._d){j._d=!0,j=j._w||j;try{if(j===O)throw V("Promise can't be resolved itself");(P=m(O))?I(function(){var z={_w:j,_d:!1};try{P.call(O,u(q,z,1),u(E,z,1))}catch(H){E.call(z,H)}}):(j._v=O,j._s=1,_(j,!1))}catch(z){E.call({_w:j,_d:!1},z)}}};T||(F=function(O){S(this,F,B,"_h"),x(O),s.call(this);try{O(u(q,this,1),u(E,this,1))}catch(P){E.call(this,P)}},s=function(O){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},s.prototype=i(56)(F.prototype,{then:function(O,P){var j=y(R(this,F));return j.ok=typeof O!="function"||O,j.fail=typeof P=="function"&&P,j.domain=D?G.domain:void 0,this._c.push(j),this._a&&this._a.push(j),this._s&&_(this,!1),j.promise},catch:function(O){return this.then(void 0,O)}}),w=function(){var O=new s;this.promise=O,this.resolve=u(q,O,1),this.reject=u(E,O,1)}),h(h.G+h.W+h.F*!T,{Promise:F}),i(18)(F,B),i(59)(B),a=i(6)[B],h(h.S+h.F*!T,B,{reject:function(O){var P=y(this),j=P.reject;return j(O),P.promise}}),h(h.S+h.F*(c||!T),B,{resolve:function(O){if(O instanceof F&&p(O.constructor,this))return O;var P=y(this),j=P.resolve;return j(O),P.promise}}),h(h.S+h.F*!(T&&i(46)(function(O){F.all(O).catch(U)})),B,{all:function(O){var P=this,j=y(P),z=j.resolve,H=j.reject,ke=v(function(){var ne=[],N=0,te=1;k(O,!1,function(L){var W=N++,oe=!1;ne.push(void 0),te++,P.resolve(L).then(function(Z){oe||(oe=!0,ne[W]=Z,--te||z(ne))},H)}),--te||z(ne)});return ke&&H(ke.error),j.promise},race:function(O){var P=this,j=y(P),z=j.reject,H=v(function(){k(O,!1,function(ke){P.resolve(ke).then(j.resolve,z)})});return H&&z(H.error),j.promise}})},function(t,n,i){"use strict";var s=i(61)(!0);i(27)(String,"String",function(o){this._t=String(o),this._i=0},function(){var o,a=this._t,c=this._i;return c>=a.length?{value:void 0,done:!0}:(o=s(a,c),this._i+=o.length,{value:o,done:!1})})},function(t,n,i){i(65);for(var s=i(2),o=i(5),a=i(10),c=i(1)("toStringTag"),l=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],u=0;u<5;u++){var f=l[u],h=s[f],g=h&&h.prototype;g&&!g[c]&&o(g,c,f),a[f]=a.Array}},function(t,n){t.exports=require("child_process")},function(t,n){t.exports=require("crypto")}])})});var l4={};en(l4,{startServer:()=>bO});module.exports=kO(l4);var ip=require("http"),Pi=require("child_process"),Ii=require("fs"),rr=require("path"),yO=require("url");var dv=(r=0)=>e=>`\x1B[${e+r}m`,hv=(r=0)=>e=>`\x1B[${38+r};5;${e}m`,mv=(r=0)=>(e,t,n)=>`\x1B[${38+r};2;${e};${t};${n}m`,_e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},p4=Object.keys(_e.modifier),AO=Object.keys(_e.color),RO=Object.keys(_e.bgColor),f4=[...AO,...RO];function OO(){let r=new Map;for(let[e,t]of Object.entries(_e)){for(let[n,i]of Object.entries(t))_e[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[n]=_e[n],r.set(i[0],i[1]);Object.defineProperty(_e,e,{value:t,enumerable:!1})}return Object.defineProperty(_e,"codes",{value:r,enumerable:!1}),_e.color.close="\x1B[39m",_e.bgColor.close="\x1B[49m",_e.color.ansi=dv(),_e.color.ansi256=hv(),_e.color.ansi16m=mv(),_e.bgColor.ansi=dv(10),_e.bgColor.ansi256=hv(10),_e.bgColor.ansi16m=mv(10),Object.defineProperties(_e,{rgbToAnsi256:{value(e,t,n){return e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(s=>s+s).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>_e.rgbToAnsi256(..._e.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,i;if(e>=232)t=((e-232)*10+8)/255,n=t,i=t;else{e-=16;let a=e%36;t=Math.floor(e/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let s=Math.max(t,n,i)*2;if(s===0)return 30;let o=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(t));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>_e.ansi256ToAnsi(_e.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>_e.ansi256ToAnsi(_e.hexToAnsi256(e)),enumerable:!1}}),_e}var MO=OO(),Sr=MO;var Wa=K(require("node:process"),1),vv=K(require("node:os"),1),Ep=K(require("node:tty"),1);function nr(r,e=globalThis.Deno?globalThis.Deno.args:Wa.default.argv){let t=r.startsWith("-")?"":r.length===1?"-":"--",n=e.indexOf(t+r),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}var{env:be}=Wa.default,$a;nr("no-color")||nr("no-colors")||nr("color=false")||nr("color=never")?$a=0:(nr("color")||nr("colors")||nr("color=true")||nr("color=always"))&&($a=1);function PO(){if("FORCE_COLOR"in be)return be.FORCE_COLOR==="true"?1:be.FORCE_COLOR==="false"?0:be.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(be.FORCE_COLOR,10),3)}function IO(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function NO(r,{streamIsTTY:e,sniffFlags:t=!0}={}){let n=PO();n!==void 0&&($a=n);let i=t?$a:n;if(i===0)return 0;if(t){if(nr("color=16m")||nr("color=full")||nr("color=truecolor"))return 3;if(nr("color=256"))return 2}if("TF_BUILD"in be&&"AGENT_NAME"in be)return 1;if(r&&!e&&i===void 0)return 0;let s=i||0;if(be.TERM==="dumb")return s;if(Wa.default.platform==="win32"){let o=vv.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in be)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>o in be)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in be)||be.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in be)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(be.TEAMCITY_VERSION)?1:0;if(be.COLORTERM==="truecolor"||be.TERM==="xterm-kitty"||be.TERM==="xterm-ghostty"||be.TERM==="wezterm")return 3;if("TERM_PROGRAM"in be){let o=Number.parseInt((be.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(be.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(be.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(be.TERM)||"COLORTERM"in be?1:s}function gv(r,e={}){let t=NO(r,{streamIsTTY:r&&r.isTTY,...e});return IO(t)}var DO={stdout:gv({isTTY:Ep.default.isatty(1)}),stderr:gv({isTTY:Ep.default.isatty(2)})},yv=DO;function xv(r,e,t){let n=r.indexOf(e);if(n===-1)return r;let i=e.length,s=0,o="";do o+=r.slice(s,n)+e+t,s=n+i,n=r.indexOf(e,s);while(n!==-1);return o+=r.slice(s),o}function _v(r,e,t,n){let i=0,s="";do{let o=r[n-1]==="\r";s+=r.slice(i,o?n-1:n)+e+(o?`\r
|
|
108
|
+
`};oo.setupSocket(t),i&&i.length&&t.unshift(i);var c=(oo.isSSL.test(n.target.protocol)?$$:U$).request(oo.setupOutgoing(n.ssl||{},n,e));return s&&s.emit("proxyReqWs",c,e,t,n,i),c.on("error",l),c.on("response",function(u){u.upgrade||(t.write(a("HTTP/"+u.httpVersion+" "+u.statusCode+" "+u.statusMessage,u.headers)),u.pipe(t))}),c.on("upgrade",function(u,f,h){f.on("error",l),f.on("end",function(){s.emit("close",u,f,h)}),t.on("error",function(){f.end()}),oo.setupSocket(f),h&&h.length&&f.unshift(h),t.write(a("HTTP/1.1 101 Switching Protocols",u.headers)),f.pipe(t).pipe(f),s.emit("open",f),s.emit("proxySocket",f)}),c.end();function l(u){o?o(u,e,t):s.emit("error",u,e,t),t.end()}}}});var SR=A((FV,wR)=>{var _R=wR.exports,vR=require("util")._extend,W$=require("url").parse,bR=XA(),G$=require("http"),z$=require("https"),yR=hR(),xR=gR();_R.Server=Ii;function Xg(r){return function(e){return function(t,n){var i=r==="ws"?this.wsPasses:this.webPasses,s=[].slice.call(arguments),o=s.length-1,a,c;typeof s[o]=="function"&&(c=s[o],o--);var l=e;if(!(s[o]instanceof Buffer)&&s[o]!==n&&(l=vR({},e),vR(l,s[o]),o--),s[o]instanceof Buffer&&(a=s[o]),["target","forward"].forEach(function(f){typeof l[f]=="string"&&(l[f]=W$(l[f]))}),!l.target&&!l.forward)return this.emit("error",new Error("Must provide a proper URL as target"));for(var u=0;u<i.length&&!i[u](t,n,l,a,this,c);u++);}}}_R.createRightProxy=Xg;function Ii(r){bR.call(this),r=r||{},r.prependPath=r.prependPath!==!1,this.web=this.proxyRequest=Xg("web")(r),this.ws=this.proxyWebsocketRequest=Xg("ws")(r),this.options=r,this.webPasses=Object.keys(yR).map(function(e){return yR[e]}),this.wsPasses=Object.keys(xR).map(function(e){return xR[e]}),this.on("error",this.onError,this)}require("util").inherits(Ii,bR);Ii.prototype.onError=function(r){if(this.listeners("error").length===1)throw r};Ii.prototype.listen=function(r,e){var t=this,n=function(i,s){t.web(i,s)};return this._server=this.options.ssl?z$.createServer(this.options.ssl,n):G$.createServer(n),this.options.ws&&this._server.on("upgrade",function(i,s,o){t.ws(i,s,o)}),this._server.listen(r,e),this};Ii.prototype.close=function(r){var e=this;this._server&&this._server.close(t);function t(){e._server=null,r&&r.apply(null,arguments)}};Ii.prototype.before=function(r,e,t){if(r!=="ws"&&r!=="web")throw new Error("type must be `web` or `ws`");var n=r==="ws"?this.wsPasses:this.webPasses,i=!1;if(n.forEach(function(s,o){s.name===e&&(i=o)}),i===!1)throw new Error("No such pass");n.splice(i,0,t)};Ii.prototype.after=function(r,e,t){if(r!=="ws"&&r!=="web")throw new Error("type must be `web` or `ws`");var n=r==="ws"?this.wsPasses:this.webPasses,i=!1;if(n.forEach(function(s,o){s.name===e&&(i=o)}),i===!1)throw new Error("No such pass");n.splice(i++,0,t)}});var TR=A((HV,ER)=>{var Fa=SR().Server;function Zg(r){return new Fa(r)}Fa.createProxyServer=Zg;Fa.createServer=Zg;Fa.createProxy=Zg;ER.exports=Fa});var kR=A((qV,CR)=>{CR.exports=TR()});var JR=A((qa,ev)=>{(function(r,e){typeof qa=="object"&&typeof ev=="object"?ev.exports=e(require("child_process"),require("crypto")):typeof define=="function"&&define.amd?define(["child_process","crypto"],e):typeof qa=="object"?qa["electron-machine-id"]=e(require("child_process"),require("crypto")):r["electron-machine-id"]=e(r.child_process,r.crypto)})(qa,function(r,e){return(function(t){function n(s){if(i[s])return i[s].exports;var o=i[s]={exports:{},id:s,loaded:!1};return t[s].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var i={};return n.m=t,n.c=i,n.p="",n(0)})([function(t,n,i){t.exports=i(34)},function(t,n,i){var s=i(29)("wks"),o=i(33),a=i(2).Symbol,c=typeof a=="function",l=t.exports=function(u){return s[u]||(s[u]=c&&a[u]||(c?a:o)("Symbol."+u))};l.store=s},function(t,n){var i=t.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=i)},function(t,n,i){var s=i(9);t.exports=function(o){if(!s(o))throw TypeError(o+" is not an object!");return o}},function(t,n,i){t.exports=!i(24)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},function(t,n,i){var s=i(12),o=i(17);t.exports=i(4)?function(a,c,l){return s.f(a,c,o(1,l))}:function(a,c,l){return a[c]=l,a}},function(t,n){var i=t.exports={version:"2.4.0"};typeof __e=="number"&&(__e=i)},function(t,n,i){var s=i(14);t.exports=function(o,a,c){if(s(o),a===void 0)return o;switch(c){case 1:return function(l){return o.call(a,l)};case 2:return function(l,u){return o.call(a,l,u)};case 3:return function(l,u,f){return o.call(a,l,u,f)}}return function(){return o.apply(a,arguments)}}},function(t,n){var i={}.hasOwnProperty;t.exports=function(s,o){return i.call(s,o)}},function(t,n){t.exports=function(i){return typeof i=="object"?i!==null:typeof i=="function"}},function(t,n){t.exports={}},function(t,n){var i={}.toString;t.exports=function(s){return i.call(s).slice(8,-1)}},function(t,n,i){var s=i(3),o=i(26),a=i(32),c=Object.defineProperty;n.f=i(4)?Object.defineProperty:function(l,u,f){if(s(l),u=a(u,!0),s(f),o)try{return c(l,u,f)}catch{}if("get"in f||"set"in f)throw TypeError("Accessors not supported!");return"value"in f&&(l[u]=f.value),l}},function(t,n,i){var s=i(42),o=i(15);t.exports=function(a){return s(o(a))}},function(t,n){t.exports=function(i){if(typeof i!="function")throw TypeError(i+" is not a function!");return i}},function(t,n){t.exports=function(i){if(i==null)throw TypeError("Can't call method on "+i);return i}},function(t,n,i){var s=i(9),o=i(2).document,a=s(o)&&s(o.createElement);t.exports=function(c){return a?o.createElement(c):{}}},function(t,n){t.exports=function(i,s){return{enumerable:!(1&i),configurable:!(2&i),writable:!(4&i),value:s}}},function(t,n,i){var s=i(12).f,o=i(8),a=i(1)("toStringTag");t.exports=function(c,l,u){c&&!o(c=u?c:c.prototype,a)&&s(c,a,{configurable:!0,value:l})}},function(t,n,i){var s=i(29)("keys"),o=i(33);t.exports=function(a){return s[a]||(s[a]=o(a))}},function(t,n){var i=Math.ceil,s=Math.floor;t.exports=function(o){return isNaN(o=+o)?0:(o>0?s:i)(o)}},function(t,n,i){var s=i(11),o=i(1)("toStringTag"),a=s((function(){return arguments})())=="Arguments",c=function(l,u){try{return l[u]}catch{}};t.exports=function(l){var u,f,h;return l===void 0?"Undefined":l===null?"Null":typeof(f=c(u=Object(l),o))=="string"?f:a?s(u):(h=s(u))=="Object"&&typeof u.callee=="function"?"Arguments":h}},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n,i){var s=i(2),o=i(6),a=i(7),c=i(5),l="prototype",u=function(f,h,g){var x,S,C,R=f&u.F,M=f&u.G,I=f&u.S,B=f&u.P,V=f&u.B,F=f&u.W,G=M?o:o[h]||(o[h]={}),D=G[l],U=M?s:I?s[h]:(s[h]||{})[l];M&&(g=h);for(x in g)S=!R&&U&&U[x]!==void 0,S&&x in G||(C=S?U[x]:g[x],G[x]=M&&typeof U[x]!="function"?g[x]:V&&S?a(C,s):F&&U[x]==C?(function(T){var p=function(m,y,w){if(this instanceof T){switch(arguments.length){case 0:return new T;case 1:return new T(m);case 2:return new T(m,y)}return new T(m,y,w)}return T.apply(this,arguments)};return p[l]=T[l],p})(C):B&&typeof C=="function"?a(Function.call,C):C,B&&((G.virtual||(G.virtual={}))[x]=C,f&u.R&&D&&!D[x]&&c(D,x,C)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,n){t.exports=function(i){try{return!!i()}catch{return!0}}},function(t,n,i){t.exports=i(2).document&&document.documentElement},function(t,n,i){t.exports=!i(4)&&!i(24)(function(){return Object.defineProperty(i(16)("div"),"a",{get:function(){return 7}}).a!=7})},function(t,n,i){"use strict";var s=i(28),o=i(23),a=i(57),c=i(5),l=i(8),u=i(10),f=i(45),h=i(18),g=i(52),x=i(1)("iterator"),S=!([].keys&&"next"in[].keys()),C="@@iterator",R="keys",M="values",I=function(){return this};t.exports=function(B,V,F,G,D,U,T){f(F,V,G);var p,m,y,w=function(P){if(!S&&P in b)return b[P];switch(P){case R:return function(){return new F(this,P)};case M:return function(){return new F(this,P)}}return function(){return new F(this,P)}},v=V+" Iterator",_=D==M,k=!1,b=B.prototype,d=b[x]||b[C]||D&&b[D],E=d||w(D),q=D?_?w("entries"):E:void 0,O=V=="Array"&&b.entries||d;if(O&&(y=g(O.call(new B)),y!==Object.prototype&&(h(y,v,!0),s||l(y,x)||c(y,x,I))),_&&d&&d.name!==M&&(k=!0,E=function(){return d.call(this)}),s&&!T||!S&&!k&&b[x]||c(b,x,E),u[V]=E,u[v]=I,D)if(p={values:_?E:w(M),keys:U?E:w(R),entries:q},T)for(m in p)m in b||a(b,m,p[m]);else o(o.P+o.F*(S||k),V,p);return p}},function(t,n){t.exports=!0},function(t,n,i){var s=i(2),o="__core-js_shared__",a=s[o]||(s[o]={});t.exports=function(c){return a[c]||(a[c]={})}},function(t,n,i){var s,o,a,c=i(7),l=i(41),u=i(25),f=i(16),h=i(2),g=h.process,x=h.setImmediate,S=h.clearImmediate,C=h.MessageChannel,R=0,M={},I="onreadystatechange",B=function(){var F=+this;if(M.hasOwnProperty(F)){var G=M[F];delete M[F],G()}},V=function(F){B.call(F.data)};x&&S||(x=function(F){for(var G=[],D=1;arguments.length>D;)G.push(arguments[D++]);return M[++R]=function(){l(typeof F=="function"?F:Function(F),G)},s(R),R},S=function(F){delete M[F]},i(11)(g)=="process"?s=function(F){g.nextTick(c(B,F,1))}:C?(o=new C,a=o.port2,o.port1.onmessage=V,s=c(a.postMessage,a,1)):h.addEventListener&&typeof postMessage=="function"&&!h.importScripts?(s=function(F){h.postMessage(F+"","*")},h.addEventListener("message",V,!1)):s=I in f("script")?function(F){u.appendChild(f("script"))[I]=function(){u.removeChild(this),B.call(F)}}:function(F){setTimeout(c(B,F,1),0)}),t.exports={set:x,clear:S}},function(t,n,i){var s=i(20),o=Math.min;t.exports=function(a){return a>0?o(s(a),9007199254740991):0}},function(t,n,i){var s=i(9);t.exports=function(o,a){if(!s(o))return o;var c,l;if(a&&typeof(c=o.toString)=="function"&&!s(l=c.call(o))||typeof(c=o.valueOf)=="function"&&!s(l=c.call(o))||!a&&typeof(c=o.toString)=="function"&&!s(l=c.call(o)))return l;throw TypeError("Can't convert object to primitive value")}},function(t,n){var i=0,s=Math.random();t.exports=function(o){return"Symbol(".concat(o===void 0?"":o,")_",(++i+s).toString(36))}},function(t,n,i){"use strict";function s(I){return I&&I.__esModule?I:{default:I}}function o(){return process.platform!=="win32"?"":process.arch==="ia32"&&process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432")?"mixed":"native"}function a(I){return(0,x.createHash)("sha256").update(I).digest("hex")}function c(I){switch(C){case"darwin":return I.split("IOPlatformUUID")[1].split(`
|
|
109
|
+
`)[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return I.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":return I.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"freebsd":return I.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw new Error("Unsupported platform: "+process.platform)}}function l(I){var B=c((0,g.execSync)(M[C]).toString());return I?B:a(B)}function u(I){return new h.default(function(B,V){return(0,g.exec)(M[C],{},function(F,G,D){if(F)return V(new Error("Error while obtaining machine id: "+F.stack));var U=c(G.toString());return B(I?U:a(U))})})}Object.defineProperty(n,"__esModule",{value:!0});var f=i(35),h=s(f);n.machineIdSync=l,n.machineId=u;var g=i(70),x=i(71),S=process,C=S.platform,R={native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"},M={darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:R[o()]+"\\REG.exe QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",linux:"( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :",freebsd:"kenv -q smbios.system.uuid || sysctl -n kern.hostuuid"}},function(t,n,i){t.exports={default:i(36),__esModule:!0}},function(t,n,i){i(66),i(68),i(69),i(67),t.exports=i(6).Promise},function(t,n){t.exports=function(){}},function(t,n){t.exports=function(i,s,o,a){if(!(i instanceof s)||a!==void 0&&a in i)throw TypeError(o+": incorrect invocation!");return i}},function(t,n,i){var s=i(13),o=i(31),a=i(62);t.exports=function(c){return function(l,u,f){var h,g=s(l),x=o(g.length),S=a(f,x);if(c&&u!=u){for(;x>S;)if(h=g[S++],h!=h)return!0}else for(;x>S;S++)if((c||S in g)&&g[S]===u)return c||S||0;return!c&&-1}}},function(t,g,i){var s=i(7),o=i(44),a=i(43),c=i(3),l=i(31),u=i(64),f={},h={},g=t.exports=function(x,S,C,R,M){var I,B,V,F,G=M?function(){return x}:u(x),D=s(C,R,S?2:1),U=0;if(typeof G!="function")throw TypeError(x+" is not iterable!");if(a(G)){for(I=l(x.length);I>U;U++)if(F=S?D(c(B=x[U])[0],B[1]):D(x[U]),F===f||F===h)return F}else for(V=G.call(x);!(B=V.next()).done;)if(F=o(V,D,B.value,S),F===f||F===h)return F};g.BREAK=f,g.RETURN=h},function(t,n){t.exports=function(i,s,o){var a=o===void 0;switch(s.length){case 0:return a?i():i.call(o);case 1:return a?i(s[0]):i.call(o,s[0]);case 2:return a?i(s[0],s[1]):i.call(o,s[0],s[1]);case 3:return a?i(s[0],s[1],s[2]):i.call(o,s[0],s[1],s[2]);case 4:return a?i(s[0],s[1],s[2],s[3]):i.call(o,s[0],s[1],s[2],s[3])}return i.apply(o,s)}},function(t,n,i){var s=i(11);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(o){return s(o)=="String"?o.split(""):Object(o)}},function(t,n,i){var s=i(10),o=i(1)("iterator"),a=Array.prototype;t.exports=function(c){return c!==void 0&&(s.Array===c||a[o]===c)}},function(t,n,i){var s=i(3);t.exports=function(o,a,c,l){try{return l?a(s(c)[0],c[1]):a(c)}catch(f){var u=o.return;throw u!==void 0&&s(u.call(o)),f}}},function(t,n,i){"use strict";var s=i(49),o=i(17),a=i(18),c={};i(5)(c,i(1)("iterator"),function(){return this}),t.exports=function(l,u,f){l.prototype=s(c,{next:o(1,f)}),a(l,u+" Iterator")}},function(t,n,i){var s=i(1)("iterator"),o=!1;try{var a=[7][s]();a.return=function(){o=!0},Array.from(a,function(){throw 2})}catch{}t.exports=function(c,l){if(!l&&!o)return!1;var u=!1;try{var f=[7],h=f[s]();h.next=function(){return{done:u=!0}},f[s]=function(){return h},c(f)}catch{}return u}},function(t,n){t.exports=function(i,s){return{value:s,done:!!i}}},function(t,n,i){var s=i(2),o=i(30).set,a=s.MutationObserver||s.WebKitMutationObserver,c=s.process,l=s.Promise,u=i(11)(c)=="process";t.exports=function(){var f,h,g,x=function(){var M,I;for(u&&(M=c.domain)&&M.exit();f;){I=f.fn,f=f.next;try{I()}catch(B){throw f?g():h=void 0,B}}h=void 0,M&&M.enter()};if(u)g=function(){c.nextTick(x)};else if(a){var S=!0,C=document.createTextNode("");new a(x).observe(C,{characterData:!0}),g=function(){C.data=S=!S}}else if(l&&l.resolve){var R=l.resolve();g=function(){R.then(x)}}else g=function(){o.call(s,x)};return function(M){var I={fn:M,next:void 0};h&&(h.next=I),f||(f=I,g()),h=I}}},function(t,n,i){var s=i(3),o=i(50),a=i(22),c=i(19)("IE_PROTO"),l=function(){},u="prototype",f=function(){var h,g=i(16)("iframe"),x=a.length,S=">";for(g.style.display="none",i(25).appendChild(g),g.src="javascript:",h=g.contentWindow.document,h.open(),h.write("<script>document.F=Object</script"+S),h.close(),f=h.F;x--;)delete f[u][a[x]];return f()};t.exports=Object.create||function(h,g){var x;return h!==null?(l[u]=s(h),x=new l,l[u]=null,x[c]=h):x=f(),g===void 0?x:o(x,g)}},function(t,n,i){var s=i(12),o=i(3),a=i(54);t.exports=i(4)?Object.defineProperties:function(c,l){o(c);for(var u,f=a(l),h=f.length,g=0;h>g;)s.f(c,u=f[g++],l[u]);return c}},function(t,n,i){var s=i(55),o=i(17),a=i(13),c=i(32),l=i(8),u=i(26),f=Object.getOwnPropertyDescriptor;n.f=i(4)?f:function(h,g){if(h=a(h),g=c(g,!0),u)try{return f(h,g)}catch{}if(l(h,g))return o(!s.f.call(h,g),h[g])}},function(t,n,i){var s=i(8),o=i(63),a=i(19)("IE_PROTO"),c=Object.prototype;t.exports=Object.getPrototypeOf||function(l){return l=o(l),s(l,a)?l[a]:typeof l.constructor=="function"&&l instanceof l.constructor?l.constructor.prototype:l instanceof Object?c:null}},function(t,n,i){var s=i(8),o=i(13),a=i(39)(!1),c=i(19)("IE_PROTO");t.exports=function(l,u){var f,h=o(l),g=0,x=[];for(f in h)f!=c&&s(h,f)&&x.push(f);for(;u.length>g;)s(h,f=u[g++])&&(~a(x,f)||x.push(f));return x}},function(t,n,i){var s=i(53),o=i(22);t.exports=Object.keys||function(a){return s(a,o)}},function(t,n){n.f={}.propertyIsEnumerable},function(t,n,i){var s=i(5);t.exports=function(o,a,c){for(var l in a)c&&o[l]?o[l]=a[l]:s(o,l,a[l]);return o}},function(t,n,i){t.exports=i(5)},function(t,n,i){var s=i(9),o=i(3),a=function(c,l){if(o(c),!s(l)&&l!==null)throw TypeError(l+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?(function(c,l,u){try{u=i(7)(Function.call,i(51).f(Object.prototype,"__proto__").set,2),u(c,[]),l=!(c instanceof Array)}catch{l=!0}return function(f,h){return a(f,h),l?f.__proto__=h:u(f,h),f}})({},!1):void 0),check:a}},function(t,n,i){"use strict";var s=i(2),o=i(6),a=i(12),c=i(4),l=i(1)("species");t.exports=function(u){var f=typeof o[u]=="function"?o[u]:s[u];c&&f&&!f[l]&&a.f(f,l,{configurable:!0,get:function(){return this}})}},function(t,n,i){var s=i(3),o=i(14),a=i(1)("species");t.exports=function(c,l){var u,f=s(c).constructor;return f===void 0||(u=s(f)[a])==null?l:o(u)}},function(t,n,i){var s=i(20),o=i(15);t.exports=function(a){return function(c,l){var u,f,h=String(o(c)),g=s(l),x=h.length;return g<0||g>=x?a?"":void 0:(u=h.charCodeAt(g),u<55296||u>56319||g+1===x||(f=h.charCodeAt(g+1))<56320||f>57343?a?h.charAt(g):u:a?h.slice(g,g+2):(u-55296<<10)+(f-56320)+65536)}}},function(t,n,i){var s=i(20),o=Math.max,a=Math.min;t.exports=function(c,l){return c=s(c),c<0?o(c+l,0):a(c,l)}},function(t,n,i){var s=i(15);t.exports=function(o){return Object(s(o))}},function(t,n,i){var s=i(21),o=i(1)("iterator"),a=i(10);t.exports=i(6).getIteratorMethod=function(c){if(c!=null)return c[o]||c["@@iterator"]||a[s(c)]}},function(t,n,i){"use strict";var s=i(37),o=i(47),a=i(10),c=i(13);t.exports=i(27)(Array,"Array",function(l,u){this._t=c(l),this._i=0,this._k=u},function(){var l=this._t,u=this._k,f=this._i++;return!l||f>=l.length?(this._t=void 0,o(1)):u=="keys"?o(0,f):u=="values"?o(0,l[f]):o(0,[f,l[f]])},"values"),a.Arguments=a.Array,s("keys"),s("values"),s("entries")},function(t,n){},function(t,n,i){"use strict";var s,o,a,c=i(28),l=i(2),u=i(7),f=i(21),h=i(23),g=i(9),x=(i(3),i(14)),S=i(38),C=i(40),R=(i(58).set,i(60)),M=i(30).set,I=i(48)(),B="Promise",V=l.TypeError,G=l.process,F=l[B],G=l.process,D=f(G)=="process",U=function(){},T=!!(function(){try{var O=F.resolve(1),P=(O.constructor={})[i(1)("species")]=function(j){j(U,U)};return(D||typeof PromiseRejectionEvent=="function")&&O.then(U)instanceof P}catch{}})(),p=function(O,P){return O===P||O===F&&P===a},m=function(O){var P;return!(!g(O)||typeof(P=O.then)!="function")&&P},y=function(O){return p(F,O)?new w(O):new o(O)},w=o=function(O){var P,j;this.promise=new O(function(z,H){if(P!==void 0||j!==void 0)throw V("Bad Promise constructor");P=z,j=H}),this.resolve=x(P),this.reject=x(j)},v=function(O){try{O()}catch(P){return{error:P}}},_=function(O,P){if(!O._n){O._n=!0;var j=O._c;I(function(){for(var z=O._v,H=O._s==1,ke=0,ne=function(N){var te,L,W=H?N.ok:N.fail,oe=N.resolve,Z=N.reject,J=N.domain;try{W?(H||(O._h==2&&d(O),O._h=1),W===!0?te=z:(J&&J.enter(),te=W(z),J&&J.exit()),te===N.promise?Z(V("Promise-chain cycle")):(L=m(te))?L.call(te,oe,Z):oe(te)):Z(z)}catch(At){Z(At)}};j.length>ke;)ne(j[ke++]);O._c=[],O._n=!1,P&&!O._h&&k(O)})}},k=function(O){M.call(l,function(){var P,j,z,H=O._v;if(b(O)&&(P=v(function(){D?G.emit("unhandledRejection",H,O):(j=l.onunhandledrejection)?j({promise:O,reason:H}):(z=l.console)&&z.error&&z.error("Unhandled promise rejection",H)}),O._h=D||b(O)?2:1),O._a=void 0,P)throw P.error})},b=function(O){if(O._h==1)return!1;for(var P,j=O._a||O._c,z=0;j.length>z;)if(P=j[z++],P.fail||!b(P.promise))return!1;return!0},d=function(O){M.call(l,function(){var P;D?G.emit("rejectionHandled",O):(P=l.onrejectionhandled)&&P({promise:O,reason:O._v})})},E=function(O){var P=this;P._d||(P._d=!0,P=P._w||P,P._v=O,P._s=2,P._a||(P._a=P._c.slice()),_(P,!0))},q=function(O){var P,j=this;if(!j._d){j._d=!0,j=j._w||j;try{if(j===O)throw V("Promise can't be resolved itself");(P=m(O))?I(function(){var z={_w:j,_d:!1};try{P.call(O,u(q,z,1),u(E,z,1))}catch(H){E.call(z,H)}}):(j._v=O,j._s=1,_(j,!1))}catch(z){E.call({_w:j,_d:!1},z)}}};T||(F=function(O){S(this,F,B,"_h"),x(O),s.call(this);try{O(u(q,this,1),u(E,this,1))}catch(P){E.call(this,P)}},s=function(O){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},s.prototype=i(56)(F.prototype,{then:function(O,P){var j=y(R(this,F));return j.ok=typeof O!="function"||O,j.fail=typeof P=="function"&&P,j.domain=D?G.domain:void 0,this._c.push(j),this._a&&this._a.push(j),this._s&&_(this,!1),j.promise},catch:function(O){return this.then(void 0,O)}}),w=function(){var O=new s;this.promise=O,this.resolve=u(q,O,1),this.reject=u(E,O,1)}),h(h.G+h.W+h.F*!T,{Promise:F}),i(18)(F,B),i(59)(B),a=i(6)[B],h(h.S+h.F*!T,B,{reject:function(O){var P=y(this),j=P.reject;return j(O),P.promise}}),h(h.S+h.F*(c||!T),B,{resolve:function(O){if(O instanceof F&&p(O.constructor,this))return O;var P=y(this),j=P.resolve;return j(O),P.promise}}),h(h.S+h.F*!(T&&i(46)(function(O){F.all(O).catch(U)})),B,{all:function(O){var P=this,j=y(P),z=j.resolve,H=j.reject,ke=v(function(){var ne=[],N=0,te=1;C(O,!1,function(L){var W=N++,oe=!1;ne.push(void 0),te++,P.resolve(L).then(function(Z){oe||(oe=!0,ne[W]=Z,--te||z(ne))},H)}),--te||z(ne)});return ke&&H(ke.error),j.promise},race:function(O){var P=this,j=y(P),z=j.reject,H=v(function(){C(O,!1,function(ke){P.resolve(ke).then(j.resolve,z)})});return H&&z(H.error),j.promise}})},function(t,n,i){"use strict";var s=i(61)(!0);i(27)(String,"String",function(o){this._t=String(o),this._i=0},function(){var o,a=this._t,c=this._i;return c>=a.length?{value:void 0,done:!0}:(o=s(a,c),this._i+=o.length,{value:o,done:!1})})},function(t,n,i){i(65);for(var s=i(2),o=i(5),a=i(10),c=i(1)("toStringTag"),l=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],u=0;u<5;u++){var f=l[u],h=s[f],g=h&&h.prototype;g&&!g[c]&&o(g,c,f),a[f]=a.Array}},function(t,n){t.exports=require("child_process")},function(t,n){t.exports=require("crypto")}])})});var _4={};en(_4,{startServer:()=>OO});module.exports=LO(_4);var op=require("http"),Ni=require("child_process"),Di=require("fs"),nr=require("path"),kO=require("url");var xv=(r=0)=>e=>`\x1B[${e+r}m`,_v=(r=0)=>e=>`\x1B[${38+r};5;${e}m`,bv=(r=0)=>(e,t,n)=>`\x1B[${38+r};2;${e};${t};${n}m`,_e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},w4=Object.keys(_e.modifier),BO=Object.keys(_e.color),jO=Object.keys(_e.bgColor),S4=[...BO,...jO];function FO(){let r=new Map;for(let[e,t]of Object.entries(_e)){for(let[n,i]of Object.entries(t))_e[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[n]=_e[n],r.set(i[0],i[1]);Object.defineProperty(_e,e,{value:t,enumerable:!1})}return Object.defineProperty(_e,"codes",{value:r,enumerable:!1}),_e.color.close="\x1B[39m",_e.bgColor.close="\x1B[49m",_e.color.ansi=xv(),_e.color.ansi256=_v(),_e.color.ansi16m=bv(),_e.bgColor.ansi=xv(10),_e.bgColor.ansi256=_v(10),_e.bgColor.ansi16m=bv(10),Object.defineProperties(_e,{rgbToAnsi256:{value(e,t,n){return e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(s=>s+s).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>_e.rgbToAnsi256(..._e.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,i;if(e>=232)t=((e-232)*10+8)/255,n=t,i=t;else{e-=16;let a=e%36;t=Math.floor(e/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let s=Math.max(t,n,i)*2;if(s===0)return 30;let o=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(t));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>_e.ansi256ToAnsi(_e.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>_e.ansi256ToAnsi(_e.hexToAnsi256(e)),enumerable:!1}}),_e}var HO=FO(),Sr=HO;var Ga=K(require("node:process"),1),Sv=K(require("node:os"),1),Cp=K(require("node:tty"),1);function ir(r,e=globalThis.Deno?globalThis.Deno.args:Ga.default.argv){let t=r.startsWith("-")?"":r.length===1?"-":"--",n=e.indexOf(t+r),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}var{env:be}=Ga.default,Wa;ir("no-color")||ir("no-colors")||ir("color=false")||ir("color=never")?Wa=0:(ir("color")||ir("colors")||ir("color=true")||ir("color=always"))&&(Wa=1);function qO(){if("FORCE_COLOR"in be)return be.FORCE_COLOR==="true"?1:be.FORCE_COLOR==="false"?0:be.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(be.FORCE_COLOR,10),3)}function UO(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function $O(r,{streamIsTTY:e,sniffFlags:t=!0}={}){let n=qO();n!==void 0&&(Wa=n);let i=t?Wa:n;if(i===0)return 0;if(t){if(ir("color=16m")||ir("color=full")||ir("color=truecolor"))return 3;if(ir("color=256"))return 2}if("TF_BUILD"in be&&"AGENT_NAME"in be)return 1;if(r&&!e&&i===void 0)return 0;let s=i||0;if(be.TERM==="dumb")return s;if(Ga.default.platform==="win32"){let o=Sv.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in be)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>o in be)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in be)||be.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in be)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(be.TEAMCITY_VERSION)?1:0;if(be.COLORTERM==="truecolor"||be.TERM==="xterm-kitty"||be.TERM==="xterm-ghostty"||be.TERM==="wezterm")return 3;if("TERM_PROGRAM"in be){let o=Number.parseInt((be.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(be.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(be.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(be.TERM)||"COLORTERM"in be?1:s}function wv(r,e={}){let t=$O(r,{streamIsTTY:r&&r.isTTY,...e});return UO(t)}var WO={stdout:wv({isTTY:Cp.default.isatty(1)}),stderr:wv({isTTY:Cp.default.isatty(2)})},Ev=WO;function Tv(r,e,t){let n=r.indexOf(e);if(n===-1)return r;let i=e.length,s=0,o="";do o+=r.slice(s,n)+e+t,s=n+i,n=r.indexOf(e,s);while(n!==-1);return o+=r.slice(s),o}function Cv(r,e,t,n){let i=0,s="";do{let o=r[n-1]==="\r";s+=r.slice(i,o?n-1:n)+e+(o?`\r
|
|
110
110
|
`:`
|
|
111
111
|
`)+t,i=n+1,n=r.indexOf(`
|
|
112
|
-
`,i)}while(n!==-1);return s+=r.slice(i),s}var{stdout:
|
|
113
|
-
`);return s!==-1&&(e=_v(e,i,n,s)),n+e+i};Object.defineProperties(oo.prototype,Di);var qO=oo(),x4=oo({level:wv?wv.level:0});var ao=qO;Lt();bt();ji();var jb=K(Bb(),1),{Server:Fb,Namespace:h8,Socket:m8}=jb.default;var IA=require("fs"),NA=require("path");bt();dl();var ct={control:"control",binary:"binary"},lt={idle:"idle",connecting:"connecting",open:"open",degraded:"degraded",closed:"closed"},$b={clientApp:{enabled:["ws","rtc"],channels:{control:{strategy:"priority",prefer:"rtc"},binary:{strategy:"priority",prefer:"rtc"}}},remoteDesktop:{enabled:["ws","rtc"],channels:{control:{strategy:"priority",prefer:"ws"},binary:{strategy:"priority",prefer:"rtc"}}}};var ys=class{static id="base";static capabilities={control:!1,binary:!1,signaling:"none"};static priority={control:0,binary:0};constructor(){this._listeners=new Map,this._state=lt.idle}get state(){return this._state}get ready(){return this._state===lt.open}supports(e){return!!this.constructor.capabilities[e]}on(e,t){this._listeners.has(e)||this._listeners.set(e,new Set),this._listeners.get(e).add(t)}off(e,t){this._listeners.get(e)?.delete(t)}_emit(e,...t){let n=this._listeners.get(e);if(n)for(let i of n)i(...t)}_setState(e){this._state!==e&&(this._state=e,this._emit("stateChange",e))}connect(e){throw new Error("Not implemented: connect")}disconnect(){throw new Error("Not implemented: disconnect")}send(e,t){throw new Error("Not implemented: send")}};var hl=class extends ys{static id="ws";static capabilities={control:!0,binary:!0,signaling:"ws"};static priority={control:100,binary:10};constructor(){super(),this._socket=null}get socket(){return this._socket}connect(e){this._socket=e.socket,this._setState(e.socket.connected?lt.open:lt.connecting),e.socket.on("connect",()=>this._setState(lt.open)),e.socket.on("disconnect",()=>this._setState(lt.closed)),e.socket.onAny?.((t,n)=>this._emit("message",{event:t,data:n,source:"ws"}))}disconnect(){this._socket=null,this._setState(lt.closed)}send(e,t){if(!this._socket?.connected)return!1;let n=this._socket._rawEmit||this._socket.emit.bind(this._socket);if(e===ct.control){let{event:i,args:s=[]}=t;return n(i,...s),!0}if(e===ct.binary){let i=this._socket.conn?.transport;return i&&i.writable===!1?!1:(n("tiles-bin-v2",t),!0)}return!1}};var Jb=K(require("node-datachannel"),1);function B2(r,e){return e&&typeof e=="object"&&e.type==="Buffer"&&Array.isArray(e.data)?{__b:Buffer.from(e.data).toString("base64")}:e}function j2(r,e){return e&&typeof e=="object"&&typeof e.__b=="string"?Buffer.from(e.__b,"base64"):e}function Wb(r){return JSON.stringify(r,B2)}function Gb(r){return JSON.parse(typeof r=="string"?r:Buffer.from(r).toString("utf8"),j2)}pt();var Kb=K(require("node:dns/promises"),1),F2=3e4,H2=/\s([0-9a-f-]{8,}\.local)\s/i,Vb=new Map;async function q2(r){let e=Vb.get(r);if(e&&Date.now()-e.ts<F2)return e.ip;try{let{address:t}=await Kb.default.lookup(r);return Vb.set(r,{ip:t,ts:Date.now()}),t}catch{return null}}async function Yb(r){let e=r.match(H2);if(!e)return r;let t=await q2(e[1]);return t?r.replace(e[1],t):null}var{PeerConnection:U2}=Jb.default,$2=[{hostname:"stun.l.google.com",port:19302,type:"Stun"},{hostname:"stun1.l.google.com",port:19302,type:"Stun"},{hostname:"stun2.l.google.com",port:19302,type:"Stun"},{hostname:"stun3.l.google.com",port:19302,type:"Stun"},{hostname:"stun4.l.google.com",port:19302,type:"Stun"},{hostname:"global.stun.twilio.com",port:3478,type:"Stun"},{hostname:"stun.cloudflare.com",port:3478,type:"Stun"}];async function W2(r,e){try{let t=await fetch(r,{headers:{"X-API-Key":e}});if(!t.ok)throw new Error(`HTTP ${t.status}`);let{iceServers:n}=await t.json(),i=[];for(let s of n)for(let o of s.urls)if(o.startsWith("stun:")){let a=o.replace("stun:","").split(":")[0],c=parseInt(o.split(":")[2]||"3478");i.push({hostname:a,port:c,type:"Stun"})}else if(o.startsWith("turn:")||o.startsWith("turns:")){let a=o.startsWith("turns:"),l=o.replace(/^turns?:/,"").split("?")[0],u=l.split(":")[0],f=parseInt(l.split(":")[1]||(a?"5349":"3478")),h=o.includes("transport=tcp")?"Tcp":"Udp";i.push({hostname:u,port:f,type:a?"Tls":"Turn",relayType:h,username:s.username,password:s.credential})}return i}catch(t){return console.error("[WebRtcProtocol] TURN fetch failed:",t.message),null}}var gl=class extends ys{static id="rtc";static capabilities={control:!0,binary:!0,signaling:"external"};static priority={control:50,binary:100};constructor(){super(),this._pc=null,this._dcControl=null,this._dcBinary=null,this._iceServers=$2,this._refreshTimer=null,this._remoteSet=!1,this._pendingCandidates=[],this._signaling=null,this._iceGraceTimer=null}async connect(e){this._ctx=e,this._setState(lt.connecting);let t=e.profile?.rtc||{};t.enableTurn&&e.auth?.apiKey&&t.turnApiUrl&&await this._refreshTurn(t),this._signaling=e.signaling,this._signaling?.on?.(n=>this._handleSignal(n,t))}disconnect(){clearTimeout(this._refreshTimer),this._signaling?.off?.(),this._signaling=null,this._cleanupPeer(),this._setState(lt.closed)}send(e,t){if(e===ct.control){if(!this._dcControl)return!1;try{return this._dcControl.sendMessage(Wb({event:t.event,args:t.args||[],ackId:t.ackId||null})),!0}catch(n){return console.error("[WebRtcProtocol] send control:",n.message),!1}}if(e===ct.binary){if(!this._dcBinary)return!1;try{let n=Array.isArray(t)?t[0]:t,i=$.webrtc.dcBufferThreshold;return this._dcBinary.bufferedAmount()>i?!1:this._dcBinary.sendMessageBinary(n)}catch(n){return console.error("[WebRtcProtocol] send binary:",n.message),!1}}return!1}_handleSignal(e,t){if(e.type==="offer")this._processOffer(e.sdp,t);else if(e.type==="ice"){if(!this._remoteSet||!this._pc){this._pendingCandidates.push({candidate:e.candidate,mid:e.mid||"0"});return}this._addRemoteCandidate(e.candidate,e.mid||"0")}}async _addRemoteCandidate(e,t){try{let n=await Yb(e);if(!n||!this._pc)return;this._pc.addRemoteCandidate(n,t)}catch(n){console.error("[WebRtcProtocol] addRemoteCandidate:",n.message)}}_createPeer(e){try{this._pc?.close()}catch{}this._pc=null,this._dcControl=null,this._dcBinary=null,this._remoteSet=!1,this._pendingCandidates=[],this._iceGraceTimer&&(clearTimeout(this._iceGraceTimer),this._iceGraceTimer=null);let t=this._ctx?.auth?.socketId||"anon",n=new U2(`peer-${t}`,{iceServers:this._iceServers});this._pcState="new",n.onStateChange(i=>{if(this._pcState=i,i==="failed"||i==="closed")this._iceGraceTimer&&(clearTimeout(this._iceGraceTimer),this._iceGraceTimer=null),this._setState(lt.closed);else if(i==="disconnected"){if(this._iceGraceTimer)return;this._iceGraceTimer=setTimeout(()=>{this._iceGraceTimer=null,this._pcState!=="connected"&&this._setState(lt.closed)},$.webrtc.iceDisconnectGraceMs)}else i==="connected"&&this._iceGraceTimer&&(clearTimeout(this._iceGraceTimer),this._iceGraceTimer=null)}),n.onDataChannel(i=>{let s=i.getLabel?.()||"",o=()=>{s==="control"?this._dcControl=i:s==="binary"&&(this._dcBinary=i),this._dcControl&&this._dcBinary&&this._setState(lt.open)};i.onOpen(o),i.onClosed(()=>{s==="control"&&(this._dcControl=null),s==="binary"&&(this._dcBinary=null),!this._dcControl&&!this._dcBinary&&this._setState(lt.closed)}),i.onError(a=>console.error(`[WebRtcProtocol] DC[${s}] error:`,a)),i.onMessage(a=>{if(s!=="control")return;let c;try{c=Gb(a)}catch(l){console.error("[WebRtcProtocol] control parse:",l.message);return}try{this._emit("message",{event:c.event,data:c,source:"rtc"})}catch(l){console.error(`[WebRtcProtocol] handler error event=${c.event}:`,l.message)}})}),this._pc=n}_processOffer(e,t){return this._createPeer(t),new Promise((n,i)=>{this._pc.onLocalDescription((o,a)=>{a==="answer"&&(this._signaling?.send?.({type:"answer",sdp:o}),n())}),this._pc.onLocalCandidate((o,a)=>{o&&this._signaling?.send?.({type:"ice",candidate:o,mid:a})});try{this._pc.setRemoteDescription(e,"offer"),this._remoteSet=!0;for(let{candidate:o,mid:a}of this._pendingCandidates)this._addRemoteCandidate(o,a);this._pendingCandidates=[],this._pc.setLocalDescription()}catch(o){this._signaling?.send?.({type:"error",message:o.message}),i(o)}let s=t?.answerTimeout||1e4;setTimeout(()=>i(new Error("Answer timeout")),s)})}_cleanupPeer(){this._iceGraceTimer&&(clearTimeout(this._iceGraceTimer),this._iceGraceTimer=null);try{this._pc?.close()}catch{}this._pc=null,this._dcControl=null,this._dcBinary=null}async _refreshTurn(e){let t=await W2(e.turnApiUrl,this._ctx.auth.apiKey);t?.length&&(this._iceServers=t,$.logging?.webrtc&&console.log(`[WebRtcProtocol] TURN credentials loaded (${t.length} servers)`)),clearTimeout(this._refreshTimer),this._refreshTimer=setTimeout(()=>this._refreshTurn(e),e.turnRefreshInterval)}};var Xb=new Map;function Jd(r){if(!r?.id)throw new Error("Adapter missing static id");Xb.set(r.id,r)}function Zb(r){return Xb.get(r)}mh();Jd(hl);Jd(gl);var Rl=class{constructor(e,t){let n=t.enableWebRTC?"remoteDesktop":"clientApp",i={...$b[n]};t.enableWebRTC||(i.enabled=["ws"]),i.rtc={enableTurn:!!(t.apiKey&&t.turnApiUrl),turnApiUrl:t.turnApiUrl||null,turnRefreshInterval:t.turnRefreshInterval,dcMaxMessageSize:t.dcMaxMessageSize,answerTimeout:t.answerTimeout},this._profile=i,this._auth={apiKey:t.apiKey||null,socketId:e.id},this._socket=e,this._wsChunkSize=t.wsChunkSize,this._dcChunkSize=t.dcChunkSize,this._dcMaxTilesPerFrame=t.dcMaxTilesPerFrame,this._maxControlBuffer=t.maxControlBuffer,this._adapters=new Map,this._listeners=new Map,this._buffer=[],this._rtcSignalingHandler=null,this._sigListeners=null,this._chunkOffset=0,this._wsPendingSince=new Map}get type(){return this._pickAdapter(ct.binary)?.constructor.id==="rtc"?"dc":"ws"}async init(){for(let e of this._profile.enabled){let t=Zb(e);if(!t)continue;let n=new t;n.on("stateChange",s=>this._onAdapterStateChange(e,s)),n.on("message",({event:s,data:o,source:a})=>this._dispatch(s,o,a)),this._adapters.set(e,n);let i=this._buildCtx(e);await n.connect(i)}}setupSignaling(e){this._installSignalingListeners()}emit(e,...t){this._sendControl(e,t)}sendTiles(e,t){let{tiles:n,timestamp:i}=e;if(!n?.length)return[];let s=this._pickAdapter(ct.binary),o=i??Date.now();return s?.constructor.id==="rtc"&&t?this._emitTilesRtc(s,n,o,t):this._emitTilesChunked(n,o)}close(){for(let e of this._adapters.values())try{e.disconnect()}catch{}this._adapters.clear(),this._buffer=[]}attachAsBus(e){if(e._rawEmit)return;let t=e.emit.bind(e);e._rawEmit=t;let n=new Set(["error","disconnect","disconnecting","connect","newListener","removeListener"]);e.emit=(i,...s)=>n.has(i)?t(i,...s):(this._sendControl(i,s),!0)}_emitTilesChunked(e,t){let n=this._adapters.get("ws");if(!n?.ready)return[];let i=this._wsChunkSize,s=this._wsPendingSince,o=t??Date.now(),a=[...e].sort((l,u)=>{let f=s.get(l.tileIndex)??1/0,h=s.get(u.tileIndex)??1/0;return f!==h?f-h:l.tileIndex-u.tileIndex}),c=[];for(let l=0;l<a.length;l+=i){let u=a.slice(l,l+i);if(n.send(ct.binary,Ts(u,t))===!1){for(let f=l;f<a.length;f++){let h=a[f].tileIndex;s.has(h)||s.set(h,o)}break}for(let f of u)s.delete(f.tileIndex);c.push(...u)}return c}_emitTilesRtc(e,t,n,i){let s=this._profile.rtc?.dcMaxMessageSize??65536,o=t.length,a=o>this._dcChunkSize?this._chunkOffset%o:0,c=h=>{let g=[];for(let x=0;x<h;x++)g.push(t[(a+x)%o]);return g},l=Math.min(this._dcChunkSize,o);for(;l>1&&i(c(l),n).length>s;)l=Math.floor(l/2);o>l&&(this._chunkOffset=(a+l)%o);let u=this._adapters.get("ws"),f=[];for(let h=0;h<o;h+=l){let g=[];for(let S=0;S<l&&h+S<o;S++)g.push(t[(a+h+S)%o]);let x=i(g,n);if(x.length>s){g.length===1&&u?.ready&&u.send(ct.binary,x)!==!1&&f.push(...g);continue}if(e.send(ct.binary,x)===!1)return f;f.push(...g)}return f}_buildCtx(e){let t={auth:this._auth,profile:this._profile};return e==="ws"&&(t.socket=this._socket),e==="rtc"&&(t.signaling={send:n=>this._sendSignaling(n),on:n=>{this._rtcSignalingHandler=n,this._installSignalingListeners()},off:()=>{this._rtcSignalingHandler=null,this._removeSignalingListeners()}}),t}_onAdapterStateChange(e,t){t===lt.open&&this._flushBuffer()}_pickAdapter(e){let t=this._profile.channels[e];if(!t)return null;let n=[...this._adapters.values()].filter(i=>i.supports(e)&&i.ready);if(t.prefer){let i=n.find(s=>s.constructor.id===t.prefer);if(i)return i}return n.sort((i,s)=>(s.constructor.priority[e]??0)-(i.constructor.priority[e]??0)),n[0]||null}hasReadyAdapter(){return!!(this._pickAdapter(ct.control)||this._pickAdapter(ct.binary))}_sendControl(e,t,n){let i=this._pickAdapter(ct.control);if(!i){this._buffer.push({event:e,args:t,ackId:n}),this._buffer.length>this._maxControlBuffer&&this._buffer.shift();return}i.constructor.id==="rtc"?i.send(ct.control,{event:e,args:t,ackId:n}):i.send(ct.control,{event:e,args:t})}_flushBuffer(){if(!(!this._buffer.length||!this._pickAdapter(ct.control)))for(;this._buffer.length;){let{event:t,args:n,ackId:i}=this._buffer.shift();this._sendControl(t,n,i)}}_dispatch(e,t,n){if(n==="rtc"){let s=Array.isArray(t?.args)?[...t.args]:[],o=t?.ackId;o&&s.push((...l)=>this._sendAck(o,l));let a=this._listeners.get(e);if(a)for(let l of a)l(...s);let c=this._socket.listeners?.(e)||[];for(let l of c)l(...s);return}let i=this._listeners.get(e);if(i)for(let s of i)s(t)}_sendAck(e,t){let n=this._adapters.get("rtc");n?.ready&&n.send(ct.control,{event:"__ack",args:t,ackId:e})}_sendSignaling(e){let t=this._adapters.get("ws");if(t?.ready){t.send(ct.control,{event:this._sigEvent(e.type),args:[this._sigData(e)]});return}console.warn("[ProtocolManager] signaling unavailable (ws down)")}_sigEvent(e){return e==="offer"?"webrtc:offer":e==="answer"?"webrtc:answer":e==="ice"?"webrtc:ice-candidate":"webrtc:error"}_sigData(e){return e.type==="offer"||e.type==="answer"?{sdp:e.sdp}:e.type==="ice"?{candidate:e.candidate,mid:e.mid}:e}_installSignalingListeners(){if(!this._rtcSignalingHandler||this._sigListeners)return;let e=({sdp:n})=>this._rtcSignalingHandler?.({type:"offer",sdp:n}),t=({candidate:n,mid:i})=>this._rtcSignalingHandler?.({type:"ice",candidate:n,mid:i});this._sigListeners={onOffer:e,onIce:t},this._socket.on("webrtc:offer",e),this._socket.on("webrtc:ice-candidate",t)}_removeSignalingListeners(){this._sigListeners&&(this._socket.off("webrtc:offer",this._sigListeners.onOffer),this._socket.off("webrtc:ice-candidate",this._sigListeners.onIce),this._sigListeners=null)}};hi();pt();var GT=require("path"),zT=require("url");var Nl=K(require("net"),1),ce=K(require("fs"),1),he=K(require("path"),1),Jw=K(require("os"),1),Xw=require("child_process"),Zw=require("url");var vh={win32:[{id:"cmd",label:"Command Prompt",path:"cmd.exe",args:[]},{id:"powershell",label:"PowerShell",path:"powershell.exe",args:["-NoLogo"]},{id:"pwsh",label:"PowerShell Core",path:"pwsh.exe",args:["-NoLogo"]}],unix:[{id:"bash",label:"Bash",path:"/bin/bash",args:["-l"]},{id:"zsh",label:"Zsh",path:"/bin/zsh",args:["-l"]},{id:"sh",label:"Sh",path:"/bin/sh",args:["-l"]}]};function Vw(){return process.platform==="win32"?vh.win32:[]}function yh(r){if(process.platform==="win32"){let n=r?vh.win32.find(s=>s.id===r):null;if(n)return n;let i=process.env.COMSPEC;return i?{id:"cmd",label:"Command Prompt",path:i,args:[]}:vh.win32[0]}let e=process.env.SHELL||"/bin/bash",t=e.split("/").pop();return{id:t,label:t,path:e,args:["-l"]}}var _h=he.default.dirname((0,Zw.fileURLToPath)(__importMetaUrl)),xn=he.default.join(Jw.default.homedir(),".9remote"),Jo=process.platform==="win32"?"\\\\.\\pipe\\9remote-pty":he.default.join(xn,"pty-daemon.sock"),Kw=he.default.join(_h,"ptyDaemon.js"),Yw=he.default.join(_h,"ptyDaemon.cjs"),Ol=he.default.join(xn,"daemon");function Qw(r,e){if(ce.default.existsSync(r)){ce.default.mkdirSync(e,{recursive:!0});for(let t of ce.default.readdirSync(r,{withFileTypes:!0})){let n=he.default.join(r,t.name),i=he.default.join(e,t.name);t.isDirectory()?Qw(n,i):t.isFile()&&ce.default.copyFileSync(n,i)}}}function yB(r,e){let t=r;for(let n=0;n<6;n++){let i=he.default.join(t,"node_modules",e);if(ce.default.existsSync(i))return i;let s=he.default.dirname(t);if(s===t)break;t=s}return null}var xB=r=>yB(r,"node-pty");function _B(r){try{if(!ce.default.existsSync(Ol))return;let e=he.default.join(xn,"pids","ptyDaemon.pid"),t=!1;try{let n=parseInt(ce.default.readFileSync(e,"utf8").trim(),10);if(Number.isFinite(n)&&n>0)try{process.kill(n,0),t=!0}catch{}}catch{}if(t)return;for(let n of ce.default.readdirSync(Ol))if(n!==`v${r}`)try{ce.default.rmSync(he.default.join(Ol,n),{recursive:!0,force:!0})}catch{}}catch{}}function bB(r){_B("28");let e=he.default.join(Ol,`v${"28"}`),t=r.endsWith(".js"),n=t?he.default.join(e,"features","terminal"):e,i=he.default.join(n,he.default.basename(r)),s=he.default.join(n,"node_modules","node-pty");if(ce.default.existsSync(i)&&ce.default.existsSync(s))return{script:i,cwd:n};try{if(ce.default.mkdirSync(n,{recursive:!0}),ce.default.copyFileSync(r,i),t){let a=he.default.dirname(r);ce.default.copyFileSync(he.default.join(a,"constants.js"),he.default.join(n,"constants.js"));let c=he.default.join(e,"lib");ce.default.mkdirSync(c,{recursive:!0}),ce.default.copyFileSync(he.default.resolve(a,"..","..","lib","constants.js"),he.default.join(c,"constants.js"))}let o=xB(he.default.dirname(r));return o?(Qw(o,s),{script:i,cwd:n}):null}catch{return null}}var Wr=null,ks=!1,$n=!1,xh="",wB=0,As=new Map,Ml=new Map;function SB(){return++wB}function Zo(r,e){Ml.has(r)||Ml.set(r,[]),Ml.get(r).push(e)}function Xo(r,e){let t=Ml.get(r);if(t)for(let n of t)try{n(e)}catch(i){console.error(`[DaemonClient] Error in ${r} handler:`,i)}}function bh(r){if(!Wr||!ks)return!1;try{return Wr.write(JSON.stringify(r)+`
|
|
114
|
-
`),!0}catch(e){return console.error("[DaemonClient] Send error:",e),!1}}function
|
|
112
|
+
`,i)}while(n!==-1);return s+=r.slice(i),s}var{stdout:kv,stderr:Av}=Ev,kp=Symbol("GENERATOR"),Li=Symbol("STYLER"),co=Symbol("IS_EMPTY"),Rv=["ansi","ansi","ansi256","ansi16m"],Bi=Object.create(null),GO=(r,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let t=kv?kv.level:0;r.level=e.level===void 0?t:e.level};var zO=r=>{let e=(...t)=>t.join(" ");return GO(e,r),Object.setPrototypeOf(e,lo.prototype),e};function lo(r){return zO(r)}Object.setPrototypeOf(lo.prototype,Function.prototype);for(let[r,e]of Object.entries(Sr))Bi[r]={get(){let t=za(this,Rp(e.open,e.close,this[Li]),this[co]);return Object.defineProperty(this,r,{value:t}),t}};Bi.visible={get(){let r=za(this,this[Li],!0);return Object.defineProperty(this,"visible",{value:r}),r}};var Ap=(r,e,t,...n)=>r==="rgb"?e==="ansi16m"?Sr[t].ansi16m(...n):e==="ansi256"?Sr[t].ansi256(Sr.rgbToAnsi256(...n)):Sr[t].ansi(Sr.rgbToAnsi(...n)):r==="hex"?Ap("rgb",e,t,...Sr.hexToRgb(...n)):Sr[t][r](...n),VO=["rgb","hex","ansi256"];for(let r of VO){Bi[r]={get(){let{level:t}=this;return function(...n){let i=Rp(Ap(r,Rv[t],"color",...n),Sr.color.close,this[Li]);return za(this,i,this[co])}}};let e="bg"+r[0].toUpperCase()+r.slice(1);Bi[e]={get(){let{level:t}=this;return function(...n){let i=Rp(Ap(r,Rv[t],"bgColor",...n),Sr.bgColor.close,this[Li]);return za(this,i,this[co])}}}}var KO=Object.defineProperties(()=>{},{...Bi,level:{enumerable:!0,get(){return this[kp].level},set(r){this[kp].level=r}}}),Rp=(r,e,t)=>{let n,i;return t===void 0?(n=r,i=e):(n=t.openAll+r,i=e+t.closeAll),{open:r,close:e,openAll:n,closeAll:i,parent:t}},za=(r,e,t)=>{let n=(...i)=>YO(n,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(n,KO),n[kp]=r,n[Li]=e,n[co]=t,n},YO=(r,e)=>{if(r.level<=0||!e)return r[co]?"":e;let t=r[Li];if(t===void 0)return e;let{openAll:n,closeAll:i}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=Tv(e,t.close,t.open),t=t.parent;let s=e.indexOf(`
|
|
113
|
+
`);return s!==-1&&(e=Cv(e,i,n,s)),n+e+i};Object.defineProperties(lo.prototype,Bi);var JO=lo(),O4=lo({level:Av?Av.level:0});var uo=JO;jt();bt();Hi();var Wb=K($b(),1),{Server:Gb,Namespace:T8,Socket:C8}=Wb.default;var UA=require("fs"),$A=require("path");bt();hl();var ct={control:"control",binary:"binary"},lt={idle:"idle",connecting:"connecting",open:"open",degraded:"degraded",closed:"closed"},Yb={clientApp:{enabled:["ws","rtc"],channels:{control:{strategy:"priority",prefer:"rtc"},binary:{strategy:"priority",prefer:"rtc"}}},remoteDesktop:{enabled:["ws","rtc"],channels:{control:{strategy:"priority",prefer:"rtc"},binary:{strategy:"priority",prefer:"rtc"}}}};var _s=class{static id="base";static capabilities={control:!1,binary:!1,signaling:"none"};static priority={control:0,binary:0};constructor(){this._listeners=new Map,this._state=lt.idle}get state(){return this._state}get ready(){return this._state===lt.open}supports(e){return!!this.constructor.capabilities[e]}on(e,t){this._listeners.has(e)||this._listeners.set(e,new Set),this._listeners.get(e).add(t)}off(e,t){this._listeners.get(e)?.delete(t)}_emit(e,...t){let n=this._listeners.get(e);if(n)for(let i of n)i(...t)}_setState(e){this._state!==e&&(this._state=e,this._emit("stateChange",e))}connect(e){throw new Error("Not implemented: connect")}disconnect(){throw new Error("Not implemented: disconnect")}send(e,t){throw new Error("Not implemented: send")}};var ml=class extends _s{static id="ws";static capabilities={control:!0,binary:!0,signaling:"ws"};static priority={control:100,binary:10};constructor(){super(),this._socket=null}get socket(){return this._socket}connect(e){this._socket=e.socket,this._setState(e.socket.connected?lt.open:lt.connecting),e.socket.on("connect",()=>this._setState(lt.open)),e.socket.on("disconnect",()=>this._setState(lt.closed)),e.socket.onAny?.((t,n)=>this._emit("message",{event:t,data:n,source:"ws"}))}disconnect(){this._socket=null,this._setState(lt.closed)}send(e,t){if(!this._socket?.connected)return!1;let n=this._socket._rawEmit||this._socket.emit.bind(this._socket);if(e===ct.control){let{event:i,args:s=[]}=t;return n(i,...s),!0}if(e===ct.binary){let i=this._socket.conn?.transport;return i&&i.writable===!1?!1:(n("tiles-bin-v2",t),!0)}return!1}};var rw=K(require("node-datachannel"),1);function z2(r,e){return e&&typeof e=="object"&&e.type==="Buffer"&&Array.isArray(e.data)?{__b:Buffer.from(e.data).toString("base64")}:e}function V2(r,e){return e&&typeof e=="object"&&typeof e.__b=="string"?Buffer.from(e.__b,"base64"):e}function Jb(r){return JSON.stringify(r,z2)}function Xb(r){return JSON.parse(typeof r=="string"?r:Buffer.from(r).toString("utf8"),V2)}pt();var ew=K(require("node:dns/promises"),1),K2=3e4,Y2=/\s([0-9a-f-]{8,}\.local)\s/i,Qb=new Map;async function J2(r){let e=Qb.get(r);if(e&&Date.now()-e.ts<K2)return e.ip;try{let{address:t}=await ew.default.lookup(r);return Qb.set(r,{ip:t,ts:Date.now()}),t}catch{return null}}async function tw(r){let e=r.match(Y2);if(!e)return r;let t=await J2(e[1]);return t?r.replace(e[1],t):null}var{PeerConnection:X2}=rw.default,Z2=[{hostname:"stun.l.google.com",port:19302,type:"Stun"},{hostname:"stun1.l.google.com",port:19302,type:"Stun"},{hostname:"stun2.l.google.com",port:19302,type:"Stun"},{hostname:"stun3.l.google.com",port:19302,type:"Stun"},{hostname:"stun4.l.google.com",port:19302,type:"Stun"},{hostname:"global.stun.twilio.com",port:3478,type:"Stun"},{hostname:"stun.cloudflare.com",port:3478,type:"Stun"}],Zd="";async function Q2(r,e){try{let t=await fetch(r,{headers:{"X-API-Key":e}});if(!t.ok)throw new Error(`HTTP ${t.status}`);let{iceServers:n}=await t.json();Zd="";let i=[];for(let s of n)for(let o of s.urls)if(o.startsWith("stun:")){let a=o.replace("stun:","").split(":")[0],c=parseInt(o.split(":")[2]||"3478");i.push({hostname:a,port:c,type:"Stun"})}else if(o.startsWith("turn:")||o.startsWith("turns:")){let a=o.startsWith("turns:"),l=o.replace(/^turns?:/,"").split("?")[0],u=l.split(":")[0],f=parseInt(l.split(":")[1]||(a?"5349":"3478")),h=o.includes("transport=tcp")?"Tcp":"Udp";i.push({hostname:u,port:f,type:a?"Tls":"Turn",relayType:h,username:s.username,password:s.credential})}return i}catch(t){return Zd!==t.message&&(Zd=t.message,console.warn(`[WebRtcProtocol] TURN fetch failed (${t.message}) \u2014 using STUN-only fallback. Will retry on next connection.`)),null}}var vl=class extends _s{static id="rtc";static capabilities={control:!0,binary:!0,signaling:"external"};static priority={control:50,binary:100};constructor(){super(),this._pc=null,this._dcControl=null,this._dcBinary=null,this._iceServers=Z2,this._refreshTimer=null,this._remoteSet=!1,this._pendingCandidates=[],this._signaling=null,this._iceGraceTimer=null}async connect(e){this._ctx=e,this._setState(lt.connecting);let t=e.profile?.rtc||{};t.enableTurn&&e.auth?.apiKey&&t.turnApiUrl&&await this._refreshTurn(t),this._signaling=e.signaling,this._signaling?.on?.(n=>this._handleSignal(n,t))}disconnect(){clearTimeout(this._refreshTimer),this._signaling?.off?.(),this._signaling=null,this._cleanupPeer(),this._setState(lt.closed)}send(e,t){if(e===ct.control){if(!this._dcControl)return!1;try{return this._dcControl.sendMessage(Jb({event:t.event,args:t.args||[],ackId:t.ackId||null})),!0}catch(n){return console.error("[WebRtcProtocol] send control:",n.message),!1}}if(e===ct.binary){if(!this._dcBinary)return!1;try{let n=Array.isArray(t)?t[0]:t,i=$.webrtc.dcBufferThreshold;return this._dcBinary.bufferedAmount()>i?!1:this._dcBinary.sendMessageBinary(n)}catch(n){return console.error("[WebRtcProtocol] send binary:",n.message),!1}}return!1}_handleSignal(e,t){if(e.type==="offer")this._processOffer(e.sdp,t);else if(e.type==="ice"){if(!this._remoteSet||!this._pc){this._pendingCandidates.push({candidate:e.candidate,mid:e.mid||"0"});return}this._addRemoteCandidate(e.candidate,e.mid||"0")}}async _addRemoteCandidate(e,t){try{let n=await tw(e);if(!n||!this._pc)return;this._pc.addRemoteCandidate(n,t)}catch(n){console.error("[WebRtcProtocol] addRemoteCandidate:",n.message)}}_createPeer(e){try{this._pc?.close()}catch{}this._pc=null,this._dcControl=null,this._dcBinary=null,this._remoteSet=!1,this._pendingCandidates=[],this._iceGraceTimer&&(clearTimeout(this._iceGraceTimer),this._iceGraceTimer=null);let t=this._ctx?.auth?.socketId||"anon",n=new X2(`peer-${t}`,{iceServers:this._iceServers});this._pcState="new",n.onStateChange(i=>{if(this._pcState=i,i==="failed"||i==="closed")this._iceGraceTimer&&(clearTimeout(this._iceGraceTimer),this._iceGraceTimer=null),this._setState(lt.closed);else if(i==="disconnected"){if(this._iceGraceTimer)return;this._iceGraceTimer=setTimeout(()=>{this._iceGraceTimer=null,this._pcState!=="connected"&&this._setState(lt.closed)},$.webrtc.iceDisconnectGraceMs)}else i==="connected"&&this._iceGraceTimer&&(clearTimeout(this._iceGraceTimer),this._iceGraceTimer=null)}),n.onDataChannel(i=>{let s=i.getLabel?.()||"",o=()=>{s==="control"?this._dcControl=i:s==="binary"&&(this._dcBinary=i),this._dcControl&&this._dcBinary&&this._setState(lt.open)};i.onOpen(o),i.onClosed(()=>{s==="control"&&(this._dcControl=null),s==="binary"&&(this._dcBinary=null),!this._dcControl&&!this._dcBinary&&this._setState(lt.closed)}),i.onError(a=>console.error(`[WebRtcProtocol] DC[${s}] error:`,a)),i.onMessage(a=>{if(s!=="control")return;let c;try{c=Xb(a)}catch(l){console.error("[WebRtcProtocol] control parse:",l.message);return}try{this._emit("message",{event:c.event,data:c,source:"rtc"})}catch(l){console.error(`[WebRtcProtocol] handler error event=${c.event}:`,l.message)}})}),this._pc=n}_processOffer(e,t){return this._createPeer(t),new Promise((n,i)=>{this._pc.onLocalDescription((o,a)=>{a==="answer"&&(this._signaling?.send?.({type:"answer",sdp:o}),n())}),this._pc.onLocalCandidate((o,a)=>{o&&this._signaling?.send?.({type:"ice",candidate:o,mid:a})});try{this._pc.setRemoteDescription(e,"offer"),this._remoteSet=!0;for(let{candidate:o,mid:a}of this._pendingCandidates)this._addRemoteCandidate(o,a);this._pendingCandidates=[],this._pc.setLocalDescription()}catch(o){this._signaling?.send?.({type:"error",message:o.message}),i(o)}let s=t?.answerTimeout||1e4;setTimeout(()=>i(new Error("Answer timeout")),s)})}_cleanupPeer(){this._iceGraceTimer&&(clearTimeout(this._iceGraceTimer),this._iceGraceTimer=null);try{this._pc?.close()}catch{}this._pc=null,this._dcControl=null,this._dcBinary=null}async _refreshTurn(e){let t=await Q2(e.turnApiUrl,this._ctx.auth.apiKey);t?.length&&(this._iceServers=t,$.logging?.webrtc&&console.log(`[WebRtcProtocol] TURN credentials loaded (${t.length} servers)`)),clearTimeout(this._refreshTimer),this._refreshTimer=setTimeout(()=>this._refreshTurn(e),e.turnRefreshInterval)}};var nw=new Map;function Qd(r){if(!r?.id)throw new Error("Adapter missing static id");nw.set(r.id,r)}function iw(r){return nw.get(r)}yh();Qd(ml);Qd(vl);var Ol=class{constructor(e,t){let n=t.enableWebRTC?"remoteDesktop":"clientApp",i={...Yb[n]};t.enableWebRTC||(i.enabled=["ws"]),i.rtc={enableTurn:!!(t.apiKey&&t.turnApiUrl),turnApiUrl:t.turnApiUrl||null,turnRefreshInterval:t.turnRefreshInterval,dcMaxMessageSize:t.dcMaxMessageSize,answerTimeout:t.answerTimeout},this._profile=i,this._auth={apiKey:t.apiKey||null,socketId:e.id},this._socket=e,this._wsChunkSize=t.wsChunkSize,this._dcChunkSize=t.dcChunkSize,this._dcMaxTilesPerFrame=t.dcMaxTilesPerFrame,this._maxControlBuffer=t.maxControlBuffer,this._adapters=new Map,this._listeners=new Map,this._buffer=[],this._rtcSignalingHandler=null,this._sigListeners=null,this._wsPendingSince=new Map,this._rtcPendingSince=new Map}get type(){return this._pickAdapter(ct.binary)?.constructor.id==="rtc"?"dc":"ws"}async init(){for(let e of this._profile.enabled){let t=iw(e);if(!t)continue;let n=new t;n.on("stateChange",s=>this._onAdapterStateChange(e,s)),n.on("message",({event:s,data:o,source:a})=>this._dispatch(s,o,a)),this._adapters.set(e,n);let i=this._buildCtx(e);await n.connect(i)}}setupSignaling(e){this._installSignalingListeners()}emit(e,...t){this._sendControl(e,t)}sendTiles(e,t){let{tiles:n,timestamp:i}=e;if(!n?.length)return[];let s=this._pickAdapter(ct.binary),o=i??Date.now();return s?.constructor.id==="rtc"&&t?this._emitTilesRtc(s,n,o,t):this._emitTilesChunked(n,o)}close(){for(let e of this._adapters.values())try{e.disconnect()}catch{}this._adapters.clear(),this._buffer=[]}attachAsBus(e){if(e._rawEmit)return;let t=e.emit.bind(e);e._rawEmit=t;let n=new Set(["error","disconnect","disconnecting","connect","newListener","removeListener"]);e.emit=(i,...s)=>n.has(i)?t(i,...s):(this._sendControl(i,s),!0)}_emitTilesChunked(e,t){let n=this._adapters.get("ws");if(!n?.ready)return[];let i=this._wsChunkSize,s=this._wsPendingSince,o=t??Date.now(),a=[...e].sort((l,u)=>{let f=s.get(l.tileIndex)??1/0,h=s.get(u.tileIndex)??1/0;return f!==h?f-h:l.tileIndex-u.tileIndex}),c=[];for(let l=0;l<a.length;l+=i){let u=a.slice(l,l+i);if(n.send(ct.binary,ks(u,t))===!1){for(let f=l;f<a.length;f++){let h=a[f].tileIndex;s.has(h)||s.set(h,o)}break}for(let f of u)s.delete(f.tileIndex);c.push(...u)}return c}_emitTilesRtc(e,t,n,i){let s=this._profile.rtc?.dcMaxMessageSize??65536,o=t.length,a=this._rtcPendingSince,c=n??Date.now(),l=[...t].sort((x,S)=>{let C=a.get(x.tileIndex)??1/0,R=a.get(S.tileIndex)??1/0;return C!==R?C-R:x.tileIndex-S.tileIndex}),u=x=>l.slice(0,x),f=Math.min(this._dcChunkSize,o);for(;f>1&&i(u(f),n).length>s;)f=Math.floor(f/2);let h=this._adapters.get("ws"),g=[];for(let x=0;x<o;x+=f){let S=l.slice(x,x+f),C=i(S,n);if(C.length>s){S.length===1&&h?.ready&&h.send(ct.binary,C)!==!1&&(a.delete(S[0].tileIndex),g.push(...S));continue}if(e.send(ct.binary,C)===!1){for(let R=x;R<o;R++){let M=l[R].tileIndex;a.has(M)||a.set(M,c)}return g}for(let R of S)a.delete(R.tileIndex);g.push(...S)}return g}_buildCtx(e){let t={auth:this._auth,profile:this._profile};return e==="ws"&&(t.socket=this._socket),e==="rtc"&&(t.signaling={send:n=>this._sendSignaling(n),on:n=>{this._rtcSignalingHandler=n,this._installSignalingListeners()},off:()=>{this._rtcSignalingHandler=null,this._removeSignalingListeners()}}),t}_onAdapterStateChange(e,t){t===lt.open&&this._flushBuffer()}_pickAdapter(e){let t=this._profile.channels[e];if(!t)return null;let n=[...this._adapters.values()].filter(i=>i.supports(e)&&i.ready);if(t.prefer){let i=n.find(s=>s.constructor.id===t.prefer);if(i)return i}return n.sort((i,s)=>(s.constructor.priority[e]??0)-(i.constructor.priority[e]??0)),n[0]||null}hasReadyAdapter(){return!!(this._pickAdapter(ct.control)||this._pickAdapter(ct.binary))}_sendControl(e,t,n){let i=this._pickAdapter(ct.control);if(!i){this._buffer.push({event:e,args:t,ackId:n}),this._buffer.length>this._maxControlBuffer&&this._buffer.shift();return}i.constructor.id==="rtc"?i.send(ct.control,{event:e,args:t,ackId:n}):i.send(ct.control,{event:e,args:t})}_flushBuffer(){if(!(!this._buffer.length||!this._pickAdapter(ct.control)))for(;this._buffer.length;){let{event:t,args:n,ackId:i}=this._buffer.shift();this._sendControl(t,n,i)}}_dispatch(e,t,n){if(n==="rtc"){let s=Array.isArray(t?.args)?[...t.args]:[],o=t?.ackId;o&&s.push((...l)=>this._sendAck(o,l));let a=this._listeners.get(e);if(a)for(let l of a)l(...s);let c=this._socket.listeners?.(e)||[];for(let l of c)l(...s);return}let i=this._listeners.get(e);if(i)for(let s of i)s(t)}_sendAck(e,t){let n=this._adapters.get("rtc");n?.ready&&n.send(ct.control,{event:"__ack",args:t,ackId:e})}_sendSignaling(e){let t=this._adapters.get("ws");if(t?.ready){t.send(ct.control,{event:this._sigEvent(e.type),args:[this._sigData(e)]});return}console.warn("[ProtocolManager] signaling unavailable (ws down)")}_sigEvent(e){return e==="offer"?"webrtc:offer":e==="answer"?"webrtc:answer":e==="ice"?"webrtc:ice-candidate":"webrtc:error"}_sigData(e){return e.type==="offer"||e.type==="answer"?{sdp:e.sdp}:e.type==="ice"?{candidate:e.candidate,mid:e.mid}:e}_installSignalingListeners(){if(!this._rtcSignalingHandler||this._sigListeners)return;let e=({sdp:n})=>this._rtcSignalingHandler?.({type:"offer",sdp:n}),t=({candidate:n,mid:i})=>this._rtcSignalingHandler?.({type:"ice",candidate:n,mid:i});this._sigListeners={onOffer:e,onIce:t},this._socket.on("webrtc:offer",e),this._socket.on("webrtc:ice-candidate",t)}_removeSignalingListeners(){this._sigListeners&&(this._socket.off("webrtc:offer",this._sigListeners.onOffer),this._socket.off("webrtc:ice-candidate",this._sigListeners.onIce),this._sigListeners=null)}};gi();pt();var eC=require("path"),tC=require("url");var Dl=K(require("net"),1),ce=K(require("fs"),1),he=K(require("path"),1),rS=K(require("os"),1),nS=require("child_process"),iS=require("url");var _h={win32:[{id:"cmd",label:"Command Prompt",path:"cmd.exe",args:[]},{id:"powershell",label:"PowerShell",path:"powershell.exe",args:["-NoLogo"]},{id:"pwsh",label:"PowerShell Core",path:"pwsh.exe",args:["-NoLogo"]}],unix:[{id:"bash",label:"Bash",path:"/bin/bash",args:["-l"]},{id:"zsh",label:"Zsh",path:"/bin/zsh",args:["-l"]},{id:"sh",label:"Sh",path:"/bin/sh",args:["-l"]}]};function Qw(){return process.platform==="win32"?_h.win32:[]}function bh(r){if(process.platform==="win32"){let n=r?_h.win32.find(s=>s.id===r):null;if(n)return n;let i=process.env.COMSPEC;return i?{id:"cmd",label:"Command Prompt",path:i,args:[]}:_h.win32[0]}let e=process.env.SHELL||"/bin/bash",t=e.split("/").pop();return{id:t,label:t,path:e,args:["-l"]}}var Sh=he.default.dirname((0,iS.fileURLToPath)(__importMetaUrl)),xn=he.default.join(rS.default.homedir(),".9remote"),Qo=process.platform==="win32"?"\\\\.\\pipe\\9remote-pty":he.default.join(xn,"pty-daemon.sock"),eS=he.default.join(Sh,"ptyDaemon.js"),tS=he.default.join(Sh,"ptyDaemon.cjs"),Ml=he.default.join(xn,"daemon");function sS(r,e){if(ce.default.existsSync(r)){ce.default.mkdirSync(e,{recursive:!0});for(let t of ce.default.readdirSync(r,{withFileTypes:!0})){let n=he.default.join(r,t.name),i=he.default.join(e,t.name);t.isDirectory()?sS(n,i):t.isFile()&&ce.default.copyFileSync(n,i)}}}function kB(r,e){let t=r;for(let n=0;n<6;n++){let i=he.default.join(t,"node_modules",e);if(ce.default.existsSync(i))return i;let s=he.default.dirname(t);if(s===t)break;t=s}return null}var AB=r=>kB(r,"node-pty");function RB(r){try{if(!ce.default.existsSync(Ml))return;let e=he.default.join(xn,"pids","ptyDaemon.pid"),t=!1;try{let n=parseInt(ce.default.readFileSync(e,"utf8").trim(),10);if(Number.isFinite(n)&&n>0)try{process.kill(n,0),t=!0}catch{}}catch{}if(t)return;for(let n of ce.default.readdirSync(Ml))if(n!==`v${r}`)try{ce.default.rmSync(he.default.join(Ml,n),{recursive:!0,force:!0})}catch{}}catch{}}function OB(r){RB("37");let e=he.default.join(Ml,`v${"37"}`),t=r.endsWith(".js"),n=t?he.default.join(e,"features","terminal"):e,i=he.default.join(n,he.default.basename(r)),s=he.default.join(n,"node_modules","node-pty");if(ce.default.existsSync(i)&&ce.default.existsSync(s))return{script:i,cwd:n};try{if(ce.default.mkdirSync(n,{recursive:!0}),ce.default.copyFileSync(r,i),t){let a=he.default.dirname(r);ce.default.copyFileSync(he.default.join(a,"constants.js"),he.default.join(n,"constants.js"));let c=he.default.join(e,"lib");ce.default.mkdirSync(c,{recursive:!0}),ce.default.copyFileSync(he.default.resolve(a,"..","..","lib","constants.js"),he.default.join(c,"constants.js"))}let o=AB(he.default.dirname(r));return o?(sS(o,s),{script:i,cwd:n}):null}catch{return null}}var Wr=null,Rs=!1,$n=!1,wh="",MB=0,Os=new Map,Pl=new Map;function PB(){return++MB}function ta(r,e){Pl.has(r)||Pl.set(r,[]),Pl.get(r).push(e)}function ea(r,e){let t=Pl.get(r);if(t)for(let n of t)try{n(e)}catch(i){console.error(`[DaemonClient] Error in ${r} handler:`,i)}}function Eh(r){if(!Wr||!Rs)return!1;try{return Wr.write(JSON.stringify(r)+`
|
|
114
|
+
`),!0}catch(e){return console.error("[DaemonClient] Send error:",e),!1}}function Ms(r,e=5e3){return new Promise((t,n)=>{let i=PB();r.requestId=i;let s=setTimeout(()=>{Os.delete(i),n(new Error("Request timeout"))},e);Os.set(i,{resolve:t,reject:n,timer:s}),Eh(r)||(clearTimeout(s),Os.delete(i),n(new Error("Not connected to daemon")))})}function IB(r){let{type:e,requestId:t,...n}=r;if(t&&Os.has(t)){let{resolve:i,timer:s}=Os.get(t);clearTimeout(s),Os.delete(t),i({type:e,...n});return}switch(e){case"output":ea("output",{sessionId:n.sessionId,enc:n.enc,data:n.enc==="b64"?n.data:Buffer.from(n.data,"base64")});break;case"sessionClosed":ea("sessionClosed",n.sessionId);break;case"cwdChange":ea("cwdChange",{sessionId:n.sessionId,cwd:n.cwd});break;case"pong":break;default:console.log("[DaemonClient] Unknown message:",e)}}function Nl(){return new Promise(r=>{let e=Dl.default.connect(Qo),t=setTimeout(()=>{e.destroy(),r(!1)},1e3);e.on("connect",()=>{clearTimeout(t),e.destroy(),r(!0)}),e.on("error",()=>{if(clearTimeout(t),process.platform!=="win32"&&ce.default.existsSync(Qo))try{ce.default.unlinkSync(Qo)}catch{}r(!1)})})}function NB(){ce.default.existsSync(xn)||ce.default.mkdirSync(xn,{recursive:!0});let r=ce.default.existsSync(eS)?eS:ce.default.existsSync(tS)?tS:null;if(!r)return console.error("[DaemonClient] \u274C Daemon script not found"),null;let e=OB(r);return e||{script:r,cwd:Sh}}async function DB(){if(!ce.default.existsSync(xn))try{ce.default.mkdirSync(xn,{recursive:!0})}catch(a){return console.error("[DaemonClient] Failed to create socket directory:",a.message),!1}let r=NB();if(!r)return!1;let{script:e,cwd:t}=r,n=he.default.join(xn,"logs");try{ce.default.mkdirSync(n,{recursive:!0})}catch{}let i=he.default.join(n,"daemon.log"),s;try{s=ce.default.openSync(i,"w")}catch(a){console.error("[DaemonClient] Failed to open log file:",a.message),s="ignore"}if((0,nS.spawn)("node",[e],{detached:!0,stdio:["ignore",s,s],cwd:t}).unref(),typeof s=="number")try{ce.default.closeSync(s)}catch{}for(let a=0;a<20;a++)if(await new Promise(c=>setTimeout(c,100)),await Nl())return!0;console.error("[DaemonClient] \u274C Failed to start daemon");try{let a=ce.default.readFileSync(i,"utf8");a.trim()&&(console.error("[DaemonClient] Daemon log:"),console.error(a))}catch{}return!1}function LB(){return new Promise(r=>{let e=Dl.default.connect(Qo),t="",n=s=>{try{e.destroy()}catch{}r(s)},i=setTimeout(()=>n(null),2e3);e.on("connect",()=>e.write(JSON.stringify({type:"ping",requestId:-1})+`
|
|
115
115
|
`)),e.on("data",s=>{t+=s.toString();let o=t.indexOf(`
|
|
116
|
-
`);if(o!==-1){clearTimeout(i);try{let a=JSON.parse(t.slice(0,o));n(a.version||"unknown")}catch{n(null)}}}),e.on("error",()=>{clearTimeout(i),n(null)})})}async function
|
|
117
|
-
`);xh=n.pop()||"";for(let i of n)if(i.trim())try{EB(JSON.parse(i))}catch{console.error("[DaemonClient] Invalid message:",i)}}),Wr.on("close",()=>{ks=!1,Wr=null,Xo("disconnected"),setTimeout(()=>{!ks&&!$n&&eS()},2e3)}),Wr.on("error",t=>{clearTimeout(e),console.error("[DaemonClient] \u274C Connection error:",t.message),console.error("[DaemonClient] Error code:",t.code),$n=!1,r(!1)})})}catch(r){return console.error("[DaemonClient] \u274C Connect error:",r),$n=!1,!1}}}async function tS(){return eS()}function Ut(){return ks}async function Dl(){return(await Qo({type:"listSessions"})).sessions||[]}async function Ll(r,e=80,t=24,n=null,i=`session-${Date.now()}`,s=null){return await Qo({type:"createSession",sessionId:i,name:r,cols:e,rows:t,shellId:n,cwd:s})}async function rS(r){try{return(await Qo({type:"getCwd",sessionId:r})).cwd||null}catch{return null}}async function wh(r){return await Qo({type:"joinSession",sessionId:r})}function Bl(r,e){return bh({type:"input",sessionId:r,data:e})}function nS(r,e,t){return bh({type:"resize",sessionId:r,cols:e,rows:t})}async function mi(r){return await Qo({type:"deleteSession",sessionId:r})}hi();ji();var sS=require("child_process");pt();var RB={darwin:()=>({cmd:"caffeinate",args:["-u","-t",String($.displayWake.macDurationSec)]}),linux:()=>({cmd:"xset",args:["dpms","force","on"]}),win32:()=>({cmd:"powershell.exe",args:["-NonInteractive","-NoProfile","-WindowStyle","Hidden","-Command",`Add-Type -Name K -Namespace W -MemberDefinition '[System.Runtime.InteropServices.DllImport("kernel32")]public static extern uint SetThreadExecutionState(uint e);'; [void][W.K]::SetThreadExecutionState(0x80000003)`]})},iS=0;function oS(){let r=$.displayWake;if(!r?.enabled)return;let e=Date.now();if(e-iS<r.throttleMs)return;iS=e;let t=RB[process.platform];if(t)try{let{cmd:n,args:i}=t(),s=(0,sS.spawn)(n,i,{detached:!0,stdio:"ignore",windowsHide:!0});s.on("error",()=>{}),s.unref()}catch{}}pt();var kS=On("remote"),_n=null;function DB(){return process.env.CODESPACES==="true"||process.env.GITPOD_WORKSPACE_ID||process.platform==="linux"&&!process.env.DISPLAY}async function PS(){if(_n!==null)return _n;if(DB())return _n=!1,kS.info("\u2705 Remote desktop not available (headless environment)"),_n;try{let r=await import("@hurdlegroup/robotjs");(r.default||r).getScreenSize(),_n=!0}catch{_n=!1,kS.info("\u2705 Remote desktop not available (no display or robotjs not installed)")}return _n}function $l(){return _n===!0}function IS(){return Gr}var vi=null,Ph=null,Ih=null,NS=null,DS=null,LS=null,BS=null,Gr=null,AS=null,RS=null,OS=null,MS=null;async function LB(){if(vi&&Ph&&Ih)return!0;try{let r=await import("@hurdlegroup/robotjs");vi=r.default||r;let{TileManager:e}=await Promise.resolve().then(()=>(vS(),gS)),{ResourceManager:t}=await Promise.resolve().then(()=>(xS(),yS)),{ScreenUpdateHelper:n}=await Promise.resolve().then(()=>(bS(),_S)),{MouseHandler:i}=await Promise.resolve().then(()=>(SS(),wS)),{KeyboardHandler:s}=await Promise.resolve().then(()=>(CS(),TS)),{ScreenHandler:o}=await Promise.resolve().then(()=>(mh(),Gw));return Ph=e,Ih=t,NS=n,DS=i,LS=s,BS=o,vi.setMouseDelay(2),vi.setKeyboardDelay(2),!0}catch(r){return console.error("\u274C Failed to load remote modules:",r.message),!1}}async function jS(r,e){if(!_n){r.emit("remote:unavailable");return}if(!await LB()){r.emit("remote:unavailable");return}Gr||(Gr=new Ih,AS=new NS(Gr),RS=new DS(vi,Gr),OS=new LS(vi,Gr),MS=new BS(Gr,AS),Gr.startResourceMonitoring());let n=r.data.protocol;if(!n){r.emit("remote:unavailable");return}let i=r.handshake.auth?.apiKey,s=new Ph(vi);Gr.addClient(r.id,{tileManager:s,protocol:n,screenInterval:null,authenticated:!0,apiKey:i}),r.data.remoteAttached=!0;let o=a=>(...c)=>(oS(),a(...c));RS.setupMouseHandlers(r,o),OS.setupKeyboardHandlers(r,o),MS.setupScreenHandlers(r,o,n),r.on("disconnect",()=>{let a=n._adapters?.get("rtc"),c=!1,l=null,u=null,f=()=>{c||(c=!0,l&&(clearTimeout(l),l=null),a&&u&&a.off("stateChange",u),Gr.removeClient(r.id),n.close(),Cs(n))};if(!a?.ready)return f();u=h=>{h===lt.closed&&f()},a.on("stateChange",u),l=setTimeout(f,$.resourceManagement.disconnectGraceMs)}),r.emit("remote:ready")}yn();var Wn=K(require("fs"),1),Nh=K(require("path"),1),Wl=0,ta=null,BB=6e4,jB={name:"9Remote",postCreateCommand:"npm install -g 9remote@latest",postAttachCommand:"9remote start",forwardPorts:[2208],portsAttributes:{2208:{label:"9Remote Server",onAutoForward:"notify"}}};function zr(){return process.env.CODESPACES==="true"}function FS(){return zr()?{isCodespaces:!0,codespaceName:process.env.CODESPACE_NAME||"unknown",workspacePath:process.env.CODESPACE_VSCODE_FOLDER||process.cwd()}:null}function HS(){Wl++,zr()&&Wl===1&&FB()}function qS(){Wl--,zr()&&Wl===0&&HB()}function FB(){ta||(ta=setInterval(()=>{process.memoryUsage()},BB))}function HB(){ta&&(console.log("\u23F8\uFE0F Stopping Codespaces heartbeat"),clearInterval(ta),ta=null)}function US(r){return Nh.default.join(r,".devcontainer","devcontainer.json")}function $S(r){try{let e=US(r);if(!Wn.default.existsSync(e))return{enabled:!1,exists:!1};let t=JSON.parse(Wn.default.readFileSync(e,"utf8"));return{enabled:t.postAttachCommand==="9remote start"||t.postAttachCommand==="9remote",exists:!0}}catch{return{enabled:!1,exists:!1,error:"Failed to read config"}}}function WS(r,e){try{let t=Nh.default.join(r,".devcontainer"),n=US(r);Wn.default.existsSync(t)||Wn.default.mkdirSync(t,{recursive:!0});let i={...jB};if(Wn.default.existsSync(n))try{i={...JSON.parse(Wn.default.readFileSync(n,"utf8"))}}catch{}return e?(i.postAttachCommand="9remote start",i.postCreateCommand||(i.postCreateCommand="npm install -g 9remote@latest")):delete i.postAttachCommand,Wn.default.writeFileSync(n,JSON.stringify(i,null,2)),{success:!0,enabled:e}}catch(t){return{success:!1,error:t.message}}}var Gl=K(require("os"),1),Oe=K(require("fs"),1),Gn=K(require("path"),1);bt();var Os=ie.BUFFERS,zl=Gn.default.join(ie.STATE,"sessions.json"),Vl=Gn.default.join(ie.STATE,"terminalGroups.json"),ra="/tmp/9remote-uploads";Oe.default.existsSync(ra)||Oe.default.mkdirSync(ra,{recursive:!0});function Dh(){return process.platform==="win32"?process.env.COMSPEC||"powershell.exe":process.env.SHELL||"/bin/zsh"}function Kl(r){return r?"/workspaces":Gl.default.homedir()}function Lh(){let r=Gl.default.homedir(),e=Gl.default.userInfo().username,t=Dh(),n={...process.env};if(delete n.PORT,Object.assign(n,{HOME:r,USER:e,LOGNAME:e,SHELL:t,TERM:"xterm-256color",COLORTERM:"truecolor",LANG:"en_US.UTF-8",LC_ALL:"en_US.UTF-8",LC_CTYPE:"en_US.UTF-8",PWD:r,OLDPWD:r,TMPDIR:n.TMPDIR||(process.platform==="win32"?n.TEMP||n.TMP:"/tmp"),__CF_USER_TEXT_ENCODING:n.__CF_USER_TEXT_ENCODING,XPC_FLAGS:n.XPC_FLAGS,XPC_SERVICE_NAME:n.XPC_SERVICE_NAME,SSH_AUTH_SOCK:n.SSH_AUTH_SOCK,TERM_PROGRAM:"9Remote",TERM_PROGRAM_VERSION:"1.0.0",ITERM_SESSION_ID:`9remote-${Date.now()}`,SHLVL:"1"}),t.includes("bash")){let i=n.PROMPT_COMMAND||"";n.PROMPT_COMMAND=`printf "\\e]7;file://%s\\a" "\${HOSTNAME}\${PWD}"${i?`; ${i}`:""}`}return n}function GS(){Oe.default.existsSync(Os)||Oe.default.mkdirSync(Os,{recursive:!0})}function Bh(r,e,t){if(t==="buffer"){GS();try{Oe.default.writeFileSync(Gn.default.join(Os,`${r}.buf`),e.join(""),"utf8")}catch(n){console.log(`\u26A0\uFE0F Failed to save buffer for ${r}:`,n.message)}}}function zS(r,e){if(e!=="buffer")return null;let t=Gn.default.join(Os,`${r}.buf`);try{if(Oe.default.existsSync(t))return Oe.default.readFileSync(t,"utf8")}catch(n){console.log(`\u26A0\uFE0F Failed to load buffer for ${r}:`,n.message)}return null}function Yl(r){let e=Gn.default.join(Os,`${r}.buf`);try{Oe.default.existsSync(e)&&Oe.default.unlinkSync(e)}catch{}}function VS(){GS();try{return Oe.default.readdirSync(Os).filter(r=>r.endsWith(".buf")).map(r=>r.replace(".buf",""))}catch{return[]}}function jh(){try{if(Oe.default.existsSync(zl))return JSON.parse(Oe.default.readFileSync(zl,"utf8"))}catch(r){console.log("\u26A0\uFE0F Failed to load session metadata:",r.message)}return{}}function Mr(r){try{let e={};for(let[n,i]of r)e[n]={name:i.name,createdAt:i.createdAt,shellId:i.shellId,cwd:i.cwd};let t=Gn.default.dirname(zl);Oe.default.existsSync(t)||Oe.default.mkdirSync(t,{recursive:!0}),Oe.default.writeFileSync(zl,JSON.stringify(e,null,2),"utf8")}catch(e){console.log("\u26A0\uFE0F Failed to save session metadata:",e.message)}}function KS(){try{if(Oe.default.existsSync(Vl)){let r=JSON.parse(Oe.default.readFileSync(Vl,"utf8"));return{groups:r.groups||[],sessionGroups:r.sessionGroups||{},sessionOrder:r.sessionOrder||[]}}}catch(r){console.log("\u26A0\uFE0F Failed to load groups:",r.message)}return{groups:[],sessionGroups:{},sessionOrder:[]}}function YS(r,e,t=[]){try{let n=Gn.default.dirname(Vl);Oe.default.existsSync(n)||Oe.default.mkdirSync(n,{recursive:!0});let i={groups:Array.from(r.values()),sessionGroups:e,sessionOrder:t};Oe.default.writeFileSync(Vl,JSON.stringify(i,null,2),"utf8")}catch(n){console.log("\u26A0\uFE0F Failed to save groups:",n.message)}}var Fh=K(require("node-pty"),1);hi();var JS=2*1024*1024,qB=256*1024,bn="daemon";function ZS(r,e){if(!r?.length||e<=0)return"";let t=e,n=[];for(let i=r.length-1;i>=0&&t>0;i--){let s=r[i];s.length<=t?(n.push(s),t-=s.length):(n.push(s.slice(s.length-t)),t=0)}return n.reverse(),n.join("")}function XS(r,e,t,n,i){let s=null;r.onData(o=>{t.buffer.push(o),t.buffer.reduce((c,l)=>c+l.length,0)>JS&&(t.buffer=[ZS(t.buffer,JS)]),yt(n,"output",{sessionId:e,data:Buffer.from(o,"utf-8")}),bn==="buffer"&&(s&&clearTimeout(s),s=setTimeout(()=>Bh(e,t.buffer,bn),2e3))}),r.onExit(({exitCode:o})=>{console.log(`PTY exited: sessionId=${e}, code=${o}`),bn==="buffer"&&t.buffer.length>0&&Bh(e,t.buffer,bn),i.delete(e),Yl(e),yt(n,"sessionClosed",e)})}function QS(r,e,t,n,i,s=[]){let o=()=>YS(n,i,s);r.on("getSessions",async a=>{let c=[],l=bn==="daemon"&&Ut();for(let[f,h]of t){let g=h.cwd;if(l&&h.daemon){let x=await rS(f);x&&(g=x,h.cwd!==x&&(h.cwd=x))}c.push({id:f,name:h.name,createdAt:h.createdAt,restored:h.restored||!1,shellId:h.shellId,shellLabel:h.shellLabel,groupId:i[f]||null,cwd:g})}let u=new Map(s.map((f,h)=>[f,h]));c.sort((f,h)=>(u.has(f.id)?u.get(f.id):1/0)-(u.has(h.id)?u.get(h.id):1/0)),a(c)}),r.on("getShells",a=>{a({platform:process.platform,shells:Vw()})}),r.on("getGroups",a=>{a(Array.from(n.values()))}),r.on("createGroup",({name:a},c)=>{let l=`group-${Date.now()}`,u={id:l,name:a||"Group",createdAt:Date.now()};n.set(l,u),o(),yt(e,"groupsChanged"),c({success:!0,group:u})}),r.on("renameGroup",({groupId:a,name:c},l)=>{let u=n.get(a);if(!u)return l({success:!1,error:"Group not found"});u.name=c,o(),yt(e,"groupsChanged"),l({success:!0})}),r.on("deleteGroup",async({groupId:a},c)=>{if(!n.delete(a))return c({success:!1,error:"Group not found"});let l=Object.keys(i).filter(u=>i[u]===a);for(let u of l){let f=t.get(u);if(f){if(f.daemon&&Ut())try{await mi(u)}catch{}else f.pty&&(f.pty.kill(),Yl(u));t.delete(u),yt(e,"sessionClosed",u)}delete i[u]}o(),yt(e,"groupsChanged"),c({success:!0})}),r.on("moveSession",({sessionId:a,groupId:c},l)=>{c&&n.has(c)?i[a]=c:delete i[a],o(),yt(e,"groupsChanged"),l({success:!0})}),r.on("reorderSession",({orderedIds:a},c)=>{if(!Array.isArray(a))return c?.({success:!1,error:"orderedIds required"});let l=new Set(a),u=s.filter(h=>!l.has(h)),f=[...t.keys()].filter(h=>!l.has(h)&&!u.includes(h));s.length=0,s.push(...u,...f,...a),o(),yt(e,"groupsChanged"),c?.({success:!0})}),r.on("createSession",async({name:a,shellId:c,groupId:l},u)=>{let f=`session-${Date.now()}`,h=yh(c),g=Lh();g.NINE_REMOTE_SESSION_ID=f;let x=Kl(zr());try{let S=a||`${h.label} ${t.size+1}`;if(bn==="daemon"&&Ut()){let M=await Ll(S,80,24,c,f,x);M.success?(t.set(M.sessionId,{daemon:!0,name:S,createdAt:Date.now(),cwd:M.cwd,shellId:M.shellId,shellLabel:M.shellLabel}),l&&n.has(l)&&(i[M.sessionId]=l,o()),Mr(t),u({success:!0,sessionId:M.sessionId,shellLabel:M.shellLabel})):u({success:!1,error:M.error});return}let k=Fh.default.spawn(h.path,h.args,{name:"xterm-256color",cols:80,rows:24,cwd:x,env:g,useConpty:!1}),R={pty:k,name:S,createdAt:Date.now(),buffer:[],cwd:x,shellId:h.id,shellLabel:h.label};XS(k,f,R,e,t),t.set(f,R),l&&n.has(l)&&(i[f]=l,o()),u({success:!0,sessionId:f,shellLabel:h.label})}catch(S){console.error("Failed to create session:",S),u({success:!1,error:S.message})}}),r.on("joinSession",async(a,c)=>{let l=t.get(a);if(!l&&bn==="daemon"&&Ut()){let u=`${yh().label} ${t.size+1}`,f=Kl(zr()),h=await Ll(u,80,24,void 0,a,f);if(!h.success)return c({success:!1,error:h.error});l={daemon:!0,name:u,createdAt:Date.now(),cwd:h.cwd,shellId:h.shellId,shellLabel:h.shellLabel},t.set(a,l),Mr(t);let g=await wh(a);return c({success:g.success,name:l.name,cwd:g.cwd||l.cwd,recreated:!0,error:g.error})}if(!l)return c({success:!1,error:"Session not found"});if(l.daemon&&Ut()){try{if(l.needsRespawn){let f=await Ll(l.name,80,24,l.shellId,a,l.cwd);if(!f.success)return c({success:!1,error:f.error});delete l.needsRespawn,l.cwd=f.cwd,l.shellLabel=f.shellLabel,Mr(t)}let u=await wh(a);u.cwd&&u.cwd!==l.cwd&&(l.cwd=u.cwd,Mr(t)),c({success:u.success,name:l.name,cwd:u.cwd||l.cwd,error:u.error})}catch(u){c({success:!1,error:u.message})}return}if(l.needsRestore&&bn==="buffer")try{let u=Dh(),f=process.platform==="win32"?[]:["-l"],h=Kl(zr()),g=Fh.default.spawn(u,f,{name:"xterm-256color",cols:80,rows:24,cwd:h,env:Lh(),useConpty:!1});l.pty=g,l.needsRestore=!1,l.cwd=h;let x=zS(a,bn);x&&(l.buffer=[x]),XS(g,a,l,e,t),console.log(`\u2705 Restored PTY session: ${a}`)}catch(u){return console.error("Failed to restore session:",u),c({success:!1,error:"Failed to restore session"})}l.buffer?.length>0&&r.emit("output",{sessionId:a,data:Buffer.from(ZS(l.buffer,qB),"utf-8")}),c({success:!0,name:l.name,cwd:l.cwd})}),r.on("deleteSession",async(a,c)=>{let l=t.get(a);if(!l)return c({success:!1,error:"Session not found"});if(l.daemon&&Ut()){try{await mi(a),t.delete(a),i[a]&&(delete i[a],o()),Mr(t),c({success:!0})}catch(u){c({success:!1,error:u.message})}return}l.pty&&l.pty.kill(),t.delete(a),i[a]&&(delete i[a],o()),Yl(a),yt(e,"sessionClosed",a),Mr(t),c({success:!0})}),r.on("renameSession",async({sessionId:a,name:c},l)=>{let u=t.get(a);if(!u)return l({success:!1,error:"Session not found"});u.name=c,yt(e,"session-renamed",{sessionId:a,name:c}),Mr(t),l({success:!0})})}var eE=require("child_process");function Ms(r,e,t){return new Promise((n,i)=>{let s=(0,eE.spawn)(r,e,{stdio:["pipe","ignore","pipe"]}),o="";s.stderr&&s.stderr.on("data",a=>{o+=a.toString()}),s.on("error",i),s.on("close",a=>a===0?n():i(new Error(o.trim()||`${r} exited ${a}`))),t!=null&&s.stdin.write(t),s.stdin.end()})}var UB=r=>typeof r=="string"&&r.startsWith("image/"),$B={darwin:{image:r=>Ms("osascript",["-e",`set the clipboard to (read (POSIX file ${JSON.stringify(r)}) as \xABclass PNGf\xBB)`]),file:r=>Ms("osascript",["-e",`set the clipboard to POSIX file ${JSON.stringify(r)}`])},linux:{image:r=>Ms("xclip",["-selection","clipboard","-t","image/png","-i",r]),file:r=>Ms("xclip",["-selection","clipboard","-t","text/uri-list","-i"],`file://${r}
|
|
118
|
-
`)},win32:{image:r=>
|
|
116
|
+
`);if(o!==-1){clearTimeout(i);try{let a=JSON.parse(t.slice(0,o));n(a.version||"unknown")}catch{n(null)}}}),e.on("error",()=>{clearTimeout(i),n(null)})})}async function BB(){try{let r=he.default.join(xn,"pids","ptyDaemon.pid"),e=parseInt(ce.default.readFileSync(r,"utf8").trim(),10);Number.isFinite(e)&&e>0&&process.kill(e,"SIGTERM")}catch{}for(let r=0;r<20;r++){if(!await Nl())return;await new Promise(e=>setTimeout(e,100))}}async function oS(){if(!(Rs||$n)){$n=!0;try{if(await Nl()){let r=await LB();r!=="37"&&(console.log(`[DaemonClient] Daemon v${r} != v${"37"}, restarting`),await BB())}return!await Nl()&&!await DB()?(console.error("[DaemonClient] \u274C Failed to start daemon"),$n=!1,!1):new Promise(r=>{let e=setTimeout(()=>{console.error("[DaemonClient] \u274C Connection timeout after 5s"),Wr&&Wr.destroy(),$n=!1,r(!1)},5e3);Wr=Dl.default.connect(Qo),Wr.on("connect",()=>{clearTimeout(e),Rs=!0,$n=!1,ea("connected"),r(!0)}),Wr.on("data",t=>{wh+=t.toString();let n=wh.split(`
|
|
117
|
+
`);wh=n.pop()||"";for(let i of n)if(i.trim())try{IB(JSON.parse(i))}catch{console.error("[DaemonClient] Invalid message:",i)}}),Wr.on("close",()=>{Rs=!1,Wr=null,ea("disconnected"),setTimeout(()=>{!Rs&&!$n&&oS()},2e3)}),Wr.on("error",t=>{clearTimeout(e),console.error("[DaemonClient] \u274C Connection error:",t.message),console.error("[DaemonClient] Error code:",t.code),$n=!1,r(!1)})})}catch(r){return console.error("[DaemonClient] \u274C Connect error:",r),$n=!1,!1}}}async function aS(){return oS()}function Mt(){return Rs}async function Ll(){return(await Ms({type:"listSessions"})).sessions||[]}async function Bl(r,e=80,t=24,n=null,i=`session-${Date.now()}`,s=null){return await Ms({type:"createSession",sessionId:i,name:r,cols:e,rows:t,shellId:n,cwd:s})}async function cS(r){try{return(await Ms({type:"getCwd",sessionId:r})).cwd||null}catch{return null}}async function Th(r){return await Ms({type:"joinSession",sessionId:r})}async function lS(r,e){return await Ms({type:"requestHistory",sessionId:r,have:e})}function jl(r,e){return Eh({type:"input",sessionId:r,data:e})}function uS(r,e,t){return Eh({type:"resize",sessionId:r,cols:e,rows:t})}async function vi(r){return await Ms({type:"deleteSession",sessionId:r})}gi();Hi();var fS=require("child_process");pt();var jB={darwin:()=>({cmd:"caffeinate",args:["-u","-t",String($.displayWake.macDurationSec)]}),linux:()=>({cmd:"xset",args:["dpms","force","on"]}),win32:()=>({cmd:"powershell.exe",args:["-NonInteractive","-NoProfile","-WindowStyle","Hidden","-Command",`Add-Type -Name K -Namespace W -MemberDefinition '[System.Runtime.InteropServices.DllImport("kernel32")]public static extern uint SetThreadExecutionState(uint e);'; [void][W.K]::SetThreadExecutionState(0x80000003)`]})},pS=0;function dS(){let r=$.displayWake;if(!r?.enabled)return;let e=Date.now();if(e-pS<r.throttleMs)return;pS=e;let t=jB[process.platform];if(t)try{let{cmd:n,args:i}=t(),s=(0,fS.spawn)(n,i,{detached:!0,stdio:"ignore",windowsHide:!0});s.on("error",()=>{}),s.unref()}catch{}}pt();var NS=On("remote"),_n=null;function WB(){return process.env.CODESPACES==="true"||process.env.GITPOD_WORKSPACE_ID||process.platform==="linux"&&!process.env.DISPLAY}async function FS(){if(_n!==null)return _n;if(WB())return _n=!1,NS.info("\u2705 Remote desktop not available (headless environment)"),_n;try{let r=await import("@hurdlegroup/robotjs");(r.default||r).getScreenSize(),_n=!0}catch{_n=!1,NS.info("\u2705 Remote desktop not available (no display or robotjs not installed)")}return _n}function Wl(){return _n===!0}function HS(){return Gr}var xi=null,Dh=null,Lh=null,qS=null,US=null,$S=null,WS=null,Gr=null,DS=null,LS=null,BS=null,jS=null;async function GB(){if(xi&&Dh&&Lh)return!0;try{let r=await import("@hurdlegroup/robotjs");xi=r.default||r;let{TileManager:e}=await Promise.resolve().then(()=>(ES(),SS)),{ResourceManager:t}=await Promise.resolve().then(()=>(CS(),TS)),{ScreenUpdateHelper:n}=await Promise.resolve().then(()=>(AS(),kS)),{MouseHandler:i}=await Promise.resolve().then(()=>(OS(),RS)),{KeyboardHandler:s}=await Promise.resolve().then(()=>(IS(),PS)),{ScreenHandler:o}=await Promise.resolve().then(()=>(yh(),Xw));return Dh=e,Lh=t,qS=n,US=i,$S=s,WS=o,xi.setMouseDelay(2),xi.setKeyboardDelay(2),!0}catch(r){return console.error("\u274C Failed to load remote modules:",r.message),!1}}async function GS(r,e){if(!_n){r.emit("remote:unavailable");return}if(!await GB()){r.emit("remote:unavailable");return}Gr||(Gr=new Lh,DS=new qS(Gr),LS=new US(xi,Gr),BS=new $S(xi,Gr),jS=new WS(Gr,DS),Gr.startResourceMonitoring());let n=r.data.protocol;if(!n){r.emit("remote:unavailable");return}let i=r.handshake.auth?.apiKey,s=new Dh(xi);Gr.addClient(r.id,{tileManager:s,protocol:n,screenInterval:null,authenticated:!0,apiKey:i}),r.data.remoteAttached=!0;let o=a=>(...c)=>(dS(),a(...c));LS.setupMouseHandlers(r,o),BS.setupKeyboardHandlers(r,o),jS.setupScreenHandlers(r,o,n),r.on("disconnect",()=>{let a=n._adapters?.get("rtc"),c=!1,l=null,u=null,f=()=>{c||(c=!0,l&&(clearTimeout(l),l=null),a&&u&&a.off("stateChange",u),Gr.removeClient(r.id),n.close(),As(n))};if(!a?.ready)return f();u=h=>{h===lt.closed&&f()},a.on("stateChange",u),l=setTimeout(f,$.resourceManagement.disconnectGraceMs)}),r.emit("remote:ready")}yn();var Wn=K(require("fs"),1),Bh=K(require("path"),1),Gl=0,na=null,zB=6e4,VB={name:"9Remote",postCreateCommand:"npm install -g 9remote@latest",postAttachCommand:"9remote start",forwardPorts:[2208],portsAttributes:{2208:{label:"9Remote Server",onAutoForward:"notify"}}};function zr(){return process.env.CODESPACES==="true"}function zS(){return zr()?{isCodespaces:!0,codespaceName:process.env.CODESPACE_NAME||"unknown",workspacePath:process.env.CODESPACE_VSCODE_FOLDER||process.cwd()}:null}function VS(){Gl++,zr()&&Gl===1&&KB()}function KS(){Gl--,zr()&&Gl===0&&YB()}function KB(){na||(na=setInterval(()=>{process.memoryUsage()},zB))}function YB(){na&&(console.log("\u23F8\uFE0F Stopping Codespaces heartbeat"),clearInterval(na),na=null)}function YS(r){return Bh.default.join(r,".devcontainer","devcontainer.json")}function JS(r){try{let e=YS(r);if(!Wn.default.existsSync(e))return{enabled:!1,exists:!1};let t=JSON.parse(Wn.default.readFileSync(e,"utf8"));return{enabled:t.postAttachCommand==="9remote start"||t.postAttachCommand==="9remote",exists:!0}}catch{return{enabled:!1,exists:!1,error:"Failed to read config"}}}function XS(r,e){try{let t=Bh.default.join(r,".devcontainer"),n=YS(r);Wn.default.existsSync(t)||Wn.default.mkdirSync(t,{recursive:!0});let i={...VB};if(Wn.default.existsSync(n))try{i={...JSON.parse(Wn.default.readFileSync(n,"utf8"))}}catch{}return e?(i.postAttachCommand="9remote start",i.postCreateCommand||(i.postCreateCommand="npm install -g 9remote@latest")):delete i.postAttachCommand,Wn.default.writeFileSync(n,JSON.stringify(i,null,2)),{success:!0,enabled:e}}catch(t){return{success:!1,error:t.message}}}var zl=K(require("os"),1),Oe=K(require("fs"),1),Gn=K(require("path"),1);bt();var Is=ie.BUFFERS,Vl=Gn.default.join(ie.STATE,"sessions.json"),Kl=Gn.default.join(ie.STATE,"terminalGroups.json"),ia="/tmp/9remote-uploads";Oe.default.existsSync(ia)||Oe.default.mkdirSync(ia,{recursive:!0});function jh(){return process.platform==="win32"?process.env.COMSPEC||"powershell.exe":process.env.SHELL||"/bin/zsh"}function Yl(r){return r?"/workspaces":zl.default.homedir()}function Fh(){let r=zl.default.homedir(),e=zl.default.userInfo().username,t=jh(),n={...process.env};if(delete n.PORT,Object.assign(n,{HOME:r,USER:e,LOGNAME:e,SHELL:t,TERM:"xterm-256color",COLORTERM:"truecolor",LANG:"en_US.UTF-8",LC_ALL:"en_US.UTF-8",LC_CTYPE:"en_US.UTF-8",PWD:r,OLDPWD:r,TMPDIR:n.TMPDIR||(process.platform==="win32"?n.TEMP||n.TMP:"/tmp"),__CF_USER_TEXT_ENCODING:n.__CF_USER_TEXT_ENCODING,XPC_FLAGS:n.XPC_FLAGS,XPC_SERVICE_NAME:n.XPC_SERVICE_NAME,SSH_AUTH_SOCK:n.SSH_AUTH_SOCK,TERM_PROGRAM:"9Remote",TERM_PROGRAM_VERSION:"1.0.0",ITERM_SESSION_ID:`9remote-${Date.now()}`,SHLVL:"1"}),t.includes("bash")){let i=n.PROMPT_COMMAND||"";n.PROMPT_COMMAND=`printf "\\e]7;file://%s\\a" "\${HOSTNAME}\${PWD}"${i?`; ${i}`:""}`}return n}function ZS(){Oe.default.existsSync(Is)||Oe.default.mkdirSync(Is,{recursive:!0})}function Hh(r,e,t){if(t==="buffer"){ZS();try{Oe.default.writeFileSync(Gn.default.join(Is,`${r}.buf`),e.join(""),"utf8")}catch(n){console.log(`\u26A0\uFE0F Failed to save buffer for ${r}:`,n.message)}}}function QS(r,e){if(e!=="buffer")return null;let t=Gn.default.join(Is,`${r}.buf`);try{if(Oe.default.existsSync(t))return Oe.default.readFileSync(t,"utf8")}catch(n){console.log(`\u26A0\uFE0F Failed to load buffer for ${r}:`,n.message)}return null}function Jl(r){let e=Gn.default.join(Is,`${r}.buf`);try{Oe.default.existsSync(e)&&Oe.default.unlinkSync(e)}catch{}}function eE(){ZS();try{return Oe.default.readdirSync(Is).filter(r=>r.endsWith(".buf")).map(r=>r.replace(".buf",""))}catch{return[]}}function qh(){try{if(Oe.default.existsSync(Vl))return JSON.parse(Oe.default.readFileSync(Vl,"utf8"))}catch(r){console.log("\u26A0\uFE0F Failed to load session metadata:",r.message)}return{}}function Mr(r){try{let e={};for(let[n,i]of r)e[n]={name:i.name,createdAt:i.createdAt,shellId:i.shellId,cwd:i.cwd};let t=Gn.default.dirname(Vl);Oe.default.existsSync(t)||Oe.default.mkdirSync(t,{recursive:!0}),Oe.default.writeFileSync(Vl,JSON.stringify(e,null,2),"utf8")}catch(e){console.log("\u26A0\uFE0F Failed to save session metadata:",e.message)}}function tE(){try{if(Oe.default.existsSync(Kl)){let r=JSON.parse(Oe.default.readFileSync(Kl,"utf8"));return{groups:r.groups||[],sessionGroups:r.sessionGroups||{},sessionOrder:r.sessionOrder||[]}}}catch(r){console.log("\u26A0\uFE0F Failed to load groups:",r.message)}return{groups:[],sessionGroups:{},sessionOrder:[]}}function rE(r,e,t=[]){try{let n=Gn.default.dirname(Kl);Oe.default.existsSync(n)||Oe.default.mkdirSync(n,{recursive:!0});let i={groups:Array.from(r.values()),sessionGroups:e,sessionOrder:t};Oe.default.writeFileSync(Kl,JSON.stringify(i,null,2),"utf8")}catch(n){console.log("\u26A0\uFE0F Failed to save groups:",n.message)}}var Uh=K(require("node-pty"),1);gi();var nE=2*1024*1024,JB=256*1024,bn="daemon";function sE(r,e){if(!r?.length||e<=0)return"";let t=e,n=[];for(let i=r.length-1;i>=0&&t>0;i--){let s=r[i];s.length<=t?(n.push(s),t-=s.length):(n.push(s.slice(s.length-t)),t=0)}return n.reverse(),n.join("")}function iE(r,e,t,n,i){let s=null;r.onData(o=>{t.buffer.push(o),t.buffer.reduce((c,l)=>c+l.length,0)>nE&&(t.buffer=[sE(t.buffer,nE)]),yt(n,"output",{sessionId:e,data:Buffer.from(o,"utf-8")}),bn==="buffer"&&(s&&clearTimeout(s),s=setTimeout(()=>Hh(e,t.buffer,bn),2e3))}),r.onExit(({exitCode:o})=>{console.log(`PTY exited: sessionId=${e}, code=${o}`),bn==="buffer"&&t.buffer.length>0&&Hh(e,t.buffer,bn),i.delete(e),Jl(e),yt(n,"sessionClosed",e)})}function oE(r,e,t,n,i,s=[]){let o=()=>rE(n,i,s);r.on("getSessions",async a=>{let c=[],l=bn==="daemon"&&Mt();for(let[f,h]of t){let g=h.cwd;if(l&&h.daemon){let x=await cS(f);x&&(g=x,h.cwd!==x&&(h.cwd=x))}c.push({id:f,name:h.name,createdAt:h.createdAt,restored:h.restored||!1,shellId:h.shellId,shellLabel:h.shellLabel,groupId:i[f]||null,cwd:g})}let u=new Map(s.map((f,h)=>[f,h]));c.sort((f,h)=>(u.has(f.id)?u.get(f.id):1/0)-(u.has(h.id)?u.get(h.id):1/0)),a(c)}),r.on("getShells",a=>{a({platform:process.platform,shells:Qw()})}),r.on("getGroups",a=>{a(Array.from(n.values()))}),r.on("createGroup",({name:a},c)=>{let l=`group-${Date.now()}`,u={id:l,name:a||"Group",createdAt:Date.now()};n.set(l,u),o(),yt(e,"groupsChanged"),c({success:!0,group:u})}),r.on("renameGroup",({groupId:a,name:c},l)=>{let u=n.get(a);if(!u)return l({success:!1,error:"Group not found"});u.name=c,o(),yt(e,"groupsChanged"),l({success:!0})}),r.on("deleteGroup",async({groupId:a},c)=>{if(!n.delete(a))return c({success:!1,error:"Group not found"});let l=Object.keys(i).filter(u=>i[u]===a);for(let u of l){let f=t.get(u);if(f){if(f.daemon&&Mt())try{await vi(u)}catch{}else f.pty&&(f.pty.kill(),Jl(u));t.delete(u),yt(e,"sessionClosed",u)}delete i[u]}o(),yt(e,"groupsChanged"),c({success:!0})}),r.on("moveSession",({sessionId:a,groupId:c},l)=>{c&&n.has(c)?i[a]=c:delete i[a],o(),yt(e,"groupsChanged"),l({success:!0})}),r.on("reorderSession",({orderedIds:a},c)=>{if(!Array.isArray(a))return c?.({success:!1,error:"orderedIds required"});let l=new Set(a),u=s.filter(h=>!l.has(h)),f=[...t.keys()].filter(h=>!l.has(h)&&!u.includes(h));s.length=0,s.push(...u,...f,...a),o(),yt(e,"groupsChanged"),c?.({success:!0})}),r.on("createSession",async({name:a,shellId:c,groupId:l},u)=>{let f=`session-${Date.now()}`,h=bh(c),g=Fh();g.NINE_REMOTE_SESSION_ID=f;let x=Yl(zr());try{let S=a||`${h.label} ${t.size+1}`;if(bn==="daemon"&&Mt()){let M=await Bl(S,80,24,c,f,x);M.success?(t.set(M.sessionId,{daemon:!0,name:S,createdAt:Date.now(),cwd:M.cwd,shellId:M.shellId,shellLabel:M.shellLabel}),l&&n.has(l)&&(i[M.sessionId]=l,o()),Mr(t),u({success:!0,sessionId:M.sessionId,shellLabel:M.shellLabel})):u({success:!1,error:M.error});return}let C=Uh.default.spawn(h.path,h.args,{name:"xterm-256color",cols:80,rows:24,cwd:x,env:g,useConpty:!1}),R={pty:C,name:S,createdAt:Date.now(),buffer:[],cwd:x,shellId:h.id,shellLabel:h.label};iE(C,f,R,e,t),t.set(f,R),l&&n.has(l)&&(i[f]=l,o()),u({success:!0,sessionId:f,shellLabel:h.label})}catch(S){console.error("Failed to create session:",S),u({success:!1,error:S.message})}}),r.on("joinSession",async(a,c)=>{let l=t.get(a);if(!l&&bn==="daemon"&&Mt()){let u=`${bh().label} ${t.size+1}`,f=Yl(zr()),h=await Bl(u,80,24,void 0,a,f);if(!h.success)return c({success:!1,error:h.error});l={daemon:!0,name:u,createdAt:Date.now(),cwd:h.cwd,shellId:h.shellId,shellLabel:h.shellLabel},t.set(a,l),Mr(t);let g=await Th(a);return c({success:g.success,name:l.name,cwd:g.cwd||l.cwd,recreated:!0,error:g.error})}if(!l)return c({success:!1,error:"Session not found"});if(l.daemon&&Mt()){try{if(l.needsRespawn){let f=await Bl(l.name,80,24,l.shellId,a,l.cwd);if(!f.success)return c({success:!1,error:f.error});delete l.needsRespawn,l.cwd=f.cwd,l.shellLabel=f.shellLabel,Mr(t)}let u=await Th(a);u.cwd&&u.cwd!==l.cwd&&(l.cwd=u.cwd,Mr(t)),c({success:u.success,name:l.name,cwd:u.cwd||l.cwd,total:u.total||0,replaySize:u.replaySize||0,error:u.error})}catch(u){c({success:!1,error:u.message})}return}if(l.needsRestore&&bn==="buffer")try{let u=jh(),f=process.platform==="win32"?[]:["-l"],h=Yl(zr()),g=Uh.default.spawn(u,f,{name:"xterm-256color",cols:80,rows:24,cwd:h,env:Fh(),useConpty:!1});l.pty=g,l.needsRestore=!1,l.cwd=h;let x=QS(a,bn);x&&(l.buffer=[x]),iE(g,a,l,e,t),console.log(`\u2705 Restored PTY session: ${a}`)}catch(u){return console.error("Failed to restore session:",u),c({success:!1,error:"Failed to restore session"})}l.buffer?.length>0&&r.emit("output",{sessionId:a,data:Buffer.from(sE(l.buffer,JB),"utf-8")}),c({success:!0,name:l.name,cwd:l.cwd})}),r.on("requestHistory",async({sessionId:a,have:c}={},l)=>{let u=t.get(a);if(!u)return l?.({success:!1,error:"Session not found"});if(!u.daemon||!Mt())return l?.({success:!1,error:"History unavailable"});try{let f=await lS(a,c||0);if(!f.success)return l?.({success:!1,error:f.error});f.prefix&&r.emit("output",{sessionId:a,enc:"b64",isHistoryPrefix:!0,data:f.prefix}),l?.({success:!0,prefixLen:f.prefixLen||0,total:f.total||0,remaining:f.remaining||0})}catch(f){l?.({success:!1,error:f.message})}}),r.on("deleteSession",async(a,c)=>{let l=t.get(a);if(!l)return c({success:!1,error:"Session not found"});if(l.daemon&&Mt()){try{await vi(a),t.delete(a),i[a]&&(delete i[a],o()),Mr(t),c({success:!0})}catch(u){c({success:!1,error:u.message})}return}l.pty&&l.pty.kill(),t.delete(a),i[a]&&(delete i[a],o()),Jl(a),yt(e,"sessionClosed",a),Mr(t),c({success:!0})}),r.on("renameSession",async({sessionId:a,name:c},l)=>{let u=t.get(a);if(!u)return l({success:!1,error:"Session not found"});u.name=c,yt(e,"session-renamed",{sessionId:a,name:c}),Mr(t),l({success:!0})})}var Wh=require("child_process");function wn(r,e,t){return new Promise((n,i)=>{let s=(0,Wh.spawn)(r,e,{stdio:["pipe","ignore","pipe"]}),o="";s.stderr&&s.stderr.on("data",a=>{o+=a.toString()}),s.on("error",i),s.on("close",a=>a===0?n():i(new Error(o.trim()||`${r} exited ${a}`))),t!=null&&s.stdin.write(t),s.stdin.end()})}function $h(r,e){return new Promise((t,n)=>{let i=(0,Wh.spawn)(r,e,{stdio:["ignore","pipe","pipe"]}),s="",o="";i.stdout&&i.stdout.on("data",a=>{s+=a.toString()}),i.stderr&&i.stderr.on("data",a=>{o+=a.toString()}),i.on("error",n),i.on("close",a=>a===0?t(s):n(new Error(o.trim()||`${r} exited ${a}`)))})}var XB=r=>typeof r=="string"&&r.startsWith("image/"),ZB={darwin:{image:r=>wn("osascript",["-e",`set the clipboard to (read (POSIX file ${JSON.stringify(r)}) as \xABclass PNGf\xBB)`]),file:r=>wn("osascript",["-e",`set the clipboard to POSIX file ${JSON.stringify(r)}`])},linux:{image:r=>wn("xclip",["-selection","clipboard","-t","image/png","-i",r]),file:r=>wn("xclip",["-selection","clipboard","-t","text/uri-list","-i"],`file://${r}
|
|
118
|
+
`)},win32:{image:r=>wn("powershell.exe",["-NonInteractive","-NoProfile","-STA","-Command",`Add-Type -AssemblyName System.Windows.Forms,System.Drawing; [System.Windows.Forms.Clipboard]::SetImage([System.Drawing.Image]::FromFile(${JSON.stringify(r)}))`]),file:r=>wn("powershell.exe",["-NonInteractive","-NoProfile","-STA","-Command",`Set-Clipboard -Path ${JSON.stringify(r)}`])}};async function aE(r,e){let t=ZB[process.platform];if(!t)throw new Error(`clipboard unsupported on ${process.platform}`);return XB(e)?t.image(r):t.file(r)}var cE={darwin:{get:()=>$h("pbpaste",[]),set:r=>wn("pbcopy",[],r)},linux:{get:()=>$h("xclip",["-selection","clipboard","-o"]),set:r=>wn("xclip",["-selection","clipboard"],r)},win32:{get:()=>$h("powershell.exe",["-NonInteractive","-NoProfile","-STA","-Command","Get-Clipboard -Raw"]),set:r=>wn("powershell.exe",["-NonInteractive","-NoProfile","-STA","-Command","$Input | Set-Clipboard"],r)}};async function lE(){let r=cE[process.platform];if(!r)throw new Error(`clipboard unsupported on ${process.platform}`);return(await r.get()).replace(/\r\n/g,`
|
|
119
|
+
`)}async function uE(r){let e=cE[process.platform];if(!e)throw new Error(`clipboard unsupported on ${process.platform}`);return e.set(r)}var Gh=K(require("fs"),1),zh=K(require("path"),1);var QB="";function pE(r,e){r.on("input",({sessionId:t,data:n})=>{if(!t)return;let i=e.get(t);if(i){if(i.daemon&&Mt())return jl(t,n);i.pty&&i.pty.write(Buffer.isBuffer(n)?n.toString("utf-8"):n)}}),r.on("resize",({sessionId:t,cols:n,rows:i})=>{if(!t)return;let s=e.get(t);if(s){if(s.daemon&&Mt())return uS(t,n,i);if(s.pty)try{s.pty.resize(n,i)}catch(o){console.log(`Resize failed for ${t}: ${o.message}`)}}}),r.on("upload-file",({sessionId:t,filename:n,size:i,content:s})=>{if(!t)return;let o=e.get(t);if(o)try{let a=n.replace(/[^a-zA-Z0-9._-]/g,"_"),c=zh.default.join(ia,`${Date.now()}_${a}`);Gh.default.writeFileSync(c,Buffer.from(s,"base64")),console.log(`\u{1F4CE} File uploaded: ${c} (${i} bytes)`),o.daemon&&Mt()?jl(t,c):o.pty&&o.pty.write(c)}catch(a){console.error("File upload error:",a),r.emit("output",{sessionId:t,data:Buffer.from(`\r
|
|
119
120
|
Error uploading file: ${a.message}\r
|
|
120
|
-
`,"utf-8")})}}),r.on("clipboard-attach",async({sessionId:t,filename:n,type:i,content:s},o)=>{if(!t)return o?.({success:!1,error:"no session"});let a=e.get(t);if(!a)return o?.({success:!1,error:"no session"});try{let c=(n||"paste").replace(/[^a-zA-Z0-9._-]/g,"_"),l=
|
|
121
|
+
`,"utf-8")})}}),r.on("clipboard-attach",async({sessionId:t,filename:n,type:i,content:s},o)=>{if(!t)return o?.({success:!1,error:"no session"});let a=e.get(t);if(!a)return o?.({success:!1,error:"no session"});try{let c=(n||"paste").replace(/[^a-zA-Z0-9._-]/g,"_"),l=zh.default.join(ia,`${Date.now()}_${c}`);Gh.default.writeFileSync(l,Buffer.from(s,"base64"));let u=typeof i=="string"&&i.startsWith("image/"),f;u?(await aE(l,i),f=QB):f=`${l} `,a.daemon&&Mt()?jl(t,f):a.pty&&a.pty.write(f),o?.({success:!0})}catch(c){console.error("Clipboard attach error:",c),o?.({success:!1,error:c.message})}})}var Nr=K(require("fs"),1),da=K(require("path"),1),bu=K(AT(),1);bt();yn();var wu=da.default.join(ie.CONFIG,"vapid.json"),Su=da.default.join(ie.CONFIG,"push-subscriptions.json"),ZG=1800*1e3,It=[];function n3(){try{if(Nr.default.existsSync(wu))return JSON.parse(Nr.default.readFileSync(wu,"utf8"))}catch{}return null}function i3(r){let e=da.default.dirname(wu);Nr.default.existsSync(e)||Nr.default.mkdirSync(e,{recursive:!0}),Nr.default.writeFileSync(wu,JSON.stringify(r,null,2),"utf8")}function s3(){let r=n3();if(!r){let e=bu.default.generateVAPIDKeys();r={publicKey:e.publicKey,privateKey:e.privateKey},i3(r)}return bu.default.setVapidDetails("mailto:admin@9remote.cc",r.publicKey,r.privateKey),r}function o3(){try{Nr.default.existsSync(Su)&&(It=JSON.parse(Nr.default.readFileSync(Su,"utf8")))}catch{It=[]}}function ha(){try{let r=da.default.dirname(Su);Nr.default.existsSync(r)||Nr.default.mkdirSync(r,{recursive:!0}),Nr.default.writeFileSync(Su,JSON.stringify(It,null,2),"utf8")}catch(r){xe(`Failed to save push subscriptions: ${r.message}`)}}function Si(r){return r.type==="expo"?r.token:r.endpoint}function RT(r,e,t){let n=Si(r),i=It.find(s=>t?s.deviceId===t:Si(s)===n);It=It.filter(s=>t?s.deviceId&&s.deviceId!==t:Si(s)!==n),It.push({...r,deviceId:t,socketId:e,lastConnectedAt:Date.now(),hidden:i?.hidden??!1}),ha()}function OT(r,e){for(let t of It)t.socketId===r&&(t.hidden=!!e,e||(t.disconnectedAt=null))}function MT(r){It=It.filter(e=>Si(e)!==r),ha()}function PT(r){for(let e of It)e.socketId===r&&(e.disconnectedAt=Date.now());ha()}function IT(r,e){for(let t of It)Si(t)===e&&(t.socketId=r,t.disconnectedAt=null,t.lastConnectedAt=Date.now());ha()}async function a3(r,e,t){let n={to:r.token,sound:"default",title:t.type==="stop"?`${e} \u2705`:`${e} \u{1F514}`,body:t.type==="stop"?`${e} completed the task`:`${e} needs your input`,data:{url:`/workspace?t=${t.sessionId}`,sessionId:t.sessionId,type:t.type}},s=await(await fetch("https://exp.host/--/api/v2/push/send",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)})).json();if(s.data?.status==="error")throw new Error(s.data.message);xe(`Expo push sent to ${r.token.slice(0,30)}...`)}async function NT(r){let e=jv[r.tool]||"AI",t=It.filter(i=>i.disconnectedAt!=null||i.hidden);if(t.length===0)return;let n=[];await Promise.all(t.map(async i=>{try{if(i.type==="expo")await a3(i,e,r);else{let s=JSON.stringify({title:r.type==="stop"?`${e} \u2705`:`${e} \u{1F514}`,body:r.type==="stop"?`${e} completed the task`:`${e} needs your input`,data:{url:`/workspace?t=${r.sessionId}`,sessionId:r.sessionId,type:r.type}});await bu.default.sendNotification({endpoint:i.endpoint,keys:i.keys},s),xe(`WebPush sent to ${i.endpoint.slice(0,50)}...`)}}catch(s){xe(`Push failed: ${s.statusCode||s.message}`),(s.statusCode===410||s.statusCode===404||s.message?.includes("DeviceNotRegistered"))&&n.push(Si(i))}})),n.length&&(It=It.filter(i=>!n.includes(Si(i))),ha())}var c3=s3();o3();function DT(){return c3.publicKey}var Om={};function LT(r,e){Om[r]=e}function Eu(r){delete Om[r]}function BT(){return{...Om}}bs();function jT(r){r.on("getNotificationState",()=>{r.emit("notificationState",BT())}),r.on("requestUpdate",()=>qn("update")),r.on("clearNotification",e=>{e&&(Eu(e),r.broadcast.emit("notificationCleared",e))}),r.on("getVapidKey",e=>e(DT())),r.on("pushSubscribe",e=>{let t=e?.type==="expo"?e.token:e?.endpoint;t&&(IT(r.id,t),RT(e,r.id,r.handshake.auth?.deviceId))}),r.on("pushUnsubscribe",e=>{e&&MT(e)}),r.on("visibilityChange",e=>OT(r.id,e)),r.on("getAutoStartStatus",e=>{if(!zr())return e({success:!1,error:"Not in Codespaces"});let t=process.env.CODESPACE_VSCODE_FOLDER||process.cwd();e({success:!0,...JS(t)})}),r.on("setAutoStart",({enabled:e},t)=>{if(!zr())return t({success:!1,error:"Not in Codespaces"});let n=process.env.CODESPACE_VSCODE_FOLDER||process.cwd();t(XS(n,e))})}var WT=K(require("os"),1),se=K(require("fs"),1),Me=K(require("path"),1);bt();var Pm=`http://localhost:${Va}/api/notify`,GT="nineRemoteNotify",l3=Me.default.join(ie.STATE,"claudeEnvBackup.json"),Nt=(...r)=>Me.default.join(WT.default.homedir(),...r),Ei=(r,...e)=>{let t=process.env[r];return t&&t.trim()?t.trim():Nt(...e)},Te={claude:()=>Nt(".claude","settings.json"),codex:()=>Nt(".codex","config.toml"),gemini:()=>Nt(".gemini","settings.json"),opencode:()=>Nt(".config","opencode","plugin",`${GT}.js`),grok:()=>Me.default.join(Ei("GROK_HOME",".grok"),"hooks","9remote.json"),cursor:()=>Nt(".cursor","hooks.json"),antigravity:()=>Nt(".gemini","config","hooks.json"),kiro:()=>Me.default.join(Ei("KIRO_HOME",".kiro"),"agents","9remote.json"),copilot:()=>Me.default.join(Ei("COPILOT_HOME",".copilot"),"config.json"),codebuddy:()=>Me.default.join(Ei("CODEBUDDY_CONFIG_DIR",".codebuddy"),"settings.json"),factory:()=>Nt(".factory","settings.json"),qoder:()=>Me.default.join(Ei("QODER_CONFIG_DIR",".qoder"),"settings.json"),rovodev:()=>Nt(".rovodev","config.yml"),hermes:()=>Me.default.join(Ei("HERMES_HOME",".hermes"),"config.yaml"),amp:()=>Nt(".config","amp","plugins","9remote.ts"),pi:()=>Me.default.join(Ei("PI_CODING_AGENT_DIR",".pi","agent"),"extensions","9remote.ts")},u3={claude:"claude",codex:"codex",gemini:"gemini",opencode:"opencode",grok:"grok",cursor:"cursor-agent",antigravity:"agy",kiro:"kiro-cli",copilot:"copilot",codebuddy:"codebuddy",factory:"droid",qoder:"qodercli",rovodev:"acli",hermes:"hermes",amp:"amp",pi:"pi"},Dt=(r,e)=>`command -v curl >/dev/null 2>&1 && curl -s --connect-timeout 1 --max-time 2 "${Pm}?type=${r}&sessionId=$NINE_REMOTE_SESSION_ID&tool=${e}" > /dev/null 2>&1 & true`,p3={claude:()=>Nt(".claude"),codex:()=>Nt(".codex"),gemini:()=>Nt(".gemini"),opencode:()=>[Nt(".config","opencode"),Nt(".opencode")]},Mm=r=>Math.ceil(r/1e3),ma=5e3,Tu=r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),zT=r=>`"${r.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`;function f3(r,e,t,n){let i=se.default.existsSync(r)?se.default.readFileSync(r,"utf8"):"";i=i.replace(new RegExp(`${Tu(e)}[\\s\\S]*?${Tu(t)}\\n?`,"g"),""),i.length&&!i.endsWith(`
|
|
121
122
|
`)&&(i+=`
|
|
122
123
|
`),i+=`${n}
|
|
123
|
-
`;let s=Me.default.dirname(r);se.default.existsSync(s)||se.default.mkdirSync(s,{recursive:!0}),se.default.writeFileSync(r,i,"utf8")}function
|
|
124
|
+
`;let s=Me.default.dirname(r);se.default.existsSync(s)||se.default.mkdirSync(s,{recursive:!0}),se.default.writeFileSync(r,i,"utf8")}function _r(r){try{if(se.default.existsSync(r))return JSON.parse(se.default.readFileSync(r,"utf8"))}catch{}return{}}function Jr(r,e){let t=Me.default.dirname(r);se.default.existsSync(t)||se.default.mkdirSync(t,{recursive:!0}),se.default.writeFileSync(r,JSON.stringify(e,null,2),"utf8")}function VT(r){let e={},t=r.env||{};for(let n of Object.keys(ho))e[n]=t[n]??null;Jr(l3,e),r.env={...t,...ho}}function d3(){let r=Te.claude(),e=_r(r),t=Dt("stop","claude"),n=Dt("notification","claude");return e.hooks={...e.hooks||{},Stop:[{matcher:"",hooks:[{type:"command",command:t}]}],Notification:[{matcher:"permission_prompt",hooks:[{type:"command",command:n}]}]},VT(e),Jr(r,e),{success:!0}}var h3=/# 9Remote notification\nnotify\s*=.*\n?/g,m3="# 9Remote-saved: ";function g3(r){let e=r.search(/^\[/m);return e===-1?[r,""]:[r.slice(0,e),r.slice(e)]}var FT=/^notify\s*=\s*(\[[^\n]*\])\s*$/m;function v3(){let r=Te.codex(),e=Me.default.dirname(r);se.default.existsSync(e)||se.default.mkdirSync(e,{recursive:!0});let t=se.default.existsSync(r)?se.default.readFileSync(r,"utf8"):"";t=t.replace(h3,"");let[n,i]=g3(t),s="",o=n.match(FT);if(o){try{let l=JSON.parse(o[1]);Array.isArray(l)&&l.length&&(s=` ; exec ${l.map(u=>`'${String(u).replace(/'/g,"'\\''")}'`).join(" ")} "$@"`)}catch{}n=n.replace(FT,`${m3}$&`)}let a=`${Dt("stop","codex")}${s}`,c=`# 9Remote notification
|
|
124
125
|
notify = ["bash", "-c", ${JSON.stringify(a)}, "9remote"]
|
|
125
126
|
`;return n.length&&!n.endsWith(`
|
|
126
127
|
`)&&(n+=`
|
|
127
|
-
`),se.default.writeFileSync(r,n+c+i,"utf8"),{success:!0}}function
|
|
128
|
-
const base = ${JSON.stringify(
|
|
128
|
+
`),se.default.writeFileSync(r,n+c+i,"utf8"),{success:!0}}function y3(){let r=Te.gemini(),e=_r(r),t=Dt("stop","gemini"),n=Dt("notification","gemini");return e.hooks={...e.hooks||{},enabled:!0,AfterAgent:[{matcher:"",hooks:[{name:"9remote-stop",type:"command",command:t,description:"9Remote stop notify"}]}],Notification:[{matcher:"",hooks:[{name:"9remote-notification",type:"command",command:n,description:"9Remote input-needed notify"}]}]},e.tools={...e.tools||{},enableHooks:!0},Jr(r,e),{success:!0}}function x3(){return`// 9Remote OpenCode notify plugin (auto-generated)
|
|
129
|
+
const base = ${JSON.stringify(Pm)};
|
|
129
130
|
const post = (type) => {
|
|
130
131
|
const sid = process.env.NINE_REMOTE_SESSION_ID || "";
|
|
131
132
|
if (!sid) return;
|
|
132
133
|
const url = base + "?type=" + type + "&sessionId=" + encodeURIComponent(sid) + "&tool=opencode";
|
|
133
134
|
try { fetch(url, { signal: AbortSignal.timeout(2000) }).catch(() => {}); } catch {}
|
|
134
135
|
};
|
|
135
|
-
export const ${
|
|
136
|
+
export const ${GT} = async () => ({
|
|
136
137
|
event: async ({ event }) => {
|
|
137
138
|
if (event.type === "session.idle") post("stop");
|
|
138
139
|
else if (event.type === "permission.asked") post("notification");
|
|
139
140
|
},
|
|
140
141
|
});
|
|
141
|
-
`}function
|
|
142
|
+
`}function _3(){let r=Te.opencode(),e=Me.default.dirname(r);return se.default.existsSync(e)||se.default.mkdirSync(e,{recursive:!0}),se.default.writeFileSync(r,x3(),"utf8"),{success:!0}}function ga(r,e,t){let n=`9remote-${r}`,i=o=>({hooks:[{type:"command",command:Dt(o,r),timeout:t(ma)}]}),s=o=>o?.hooks?.some(a=>typeof a.command=="string"&&a.command.includes(`&tool=${r}`));return{enable(o,a){let c=_r(o),l={...c.hooks||{}};for(let[u,f]of Object.entries(e))l[u]=[...(l[u]||[]).filter(h=>!s(h)),i(f)];return c.hooks=l,a&&a(c),Jr(o,c),{success:!0}},disable(o,a){let c=_r(o);if(c.hooks){for(let l of Object.keys(e))c.hooks[l]=(c.hooks[l]||[]).filter(u=>!s(u)),c.hooks[l].length===0&&delete c.hooks[l];Object.keys(c.hooks).length===0&&delete c.hooks}return a&&a(c),Jr(o,c),{success:!0}},isEnabled(o){let a=_r(o);return Object.keys(e).some(c=>(a.hooks?.[c]||[]).some(s))},marker:n}}var b3=ga("grok",{Stop:"stop",Notification:"notification"},Mm);function w3(){return b3.enable(Te.grok())}var Cu={Stop:"stop",PreToolUse:"notification"},S3=ga("copilot",Cu,r=>r),E3=ga("codebuddy",Cu,r=>r),T3=ga("factory",Cu,r=>r),C3=ga("qoder",Cu,r=>r);function k3(){return S3.enable(Te.copilot())}function A3(){return E3.enable(Te.codebuddy())}function R3(){return T3.enable(Te.factory())}function O3(){return C3.enable(Te.qoder())}function M3(){let r=Te.cursor(),e=_r(r),t=i=>typeof i.command=="string"&&i.command.includes("&tool=cursor"),n={...e.hooks||{}};return n.stop=[...(n.stop||[]).filter(i=>!t(i)),{command:Dt("stop","cursor")}],n.beforeShellExecution=[...(n.beforeShellExecution||[]).filter(i=>!t(i)),{command:Dt("notification","cursor")}],e.hooks=n,e.version=e.version||1,Jr(r,e),{success:!0}}var P3="9remote";function I3(){let r=Te.antigravity(),e=_r(r);return e[P3]={Stop:[{type:"command",command:Dt("stop","antigravity"),timeout:Mm(ma)}],Notification:[{type:"command",command:Dt("notification","antigravity"),timeout:Mm(ma)}]},Jr(r,e),{success:!0}}function N3(){let r=Te.kiro(),e=_r(r);return e.name=e.name||"9remote",e.description=e.description||"9Remote notification hooks for Kiro CLI.",Array.isArray(e.tools)||(e.tools=["*"]),e.hooks={...e.hooks||{},stop:[{command:Dt("stop","kiro"),timeout_ms:ma}],preToolUse:[{command:Dt("notification","kiro"),timeout_ms:ma}]},Jr(r,e),{success:!0}}var KT=" # 9remote hooks begin",YT=" # 9remote hooks end";function D3(){let r=(e,t)=>` - name: ${e}
|
|
142
143
|
commands:
|
|
143
|
-
- command: ${
|
|
144
|
-
`)}function
|
|
144
|
+
- command: ${zT(Dt(t,"rovodev"))}`;return[KT,r("on_complete","stop"),r("on_error","stop"),r("on_tool_permission","notification"),YT].join(`
|
|
145
|
+
`)}function L3(){let r=Te.rovodev(),e=se.default.existsSync(r)?se.default.readFileSync(r,"utf8"):"";e=e.replace(new RegExp(`${Tu(KT)}[\\s\\S]*?${Tu(YT)}\\n?`,"g"),""),/^eventHooks:/m.test(e)?/^\s+events:/m.test(e)||(e=e.replace(/^eventHooks:.*$/m,n=>`${n}
|
|
145
146
|
events:`)):(e.length&&!e.endsWith(`
|
|
146
147
|
`)&&(e+=`
|
|
147
148
|
`),e+=`eventHooks:
|
|
148
149
|
events:
|
|
149
150
|
`),e=e.replace(/^(\s*)events:.*$/m,n=>`${n}
|
|
150
|
-
${
|
|
151
|
-
- command: ${
|
|
152
|
-
timeout: 5`),
|
|
153
|
-
`);
|
|
151
|
+
${D3()}`);let t=Me.default.dirname(r);return se.default.existsSync(t)||se.default.mkdirSync(t,{recursive:!0}),se.default.writeFileSync(r,e,"utf8"),{success:!0}}var HT="# 9remote hooks begin",qT="# 9remote hooks end",B3=()=>Me.default.join(Me.default.dirname(Te.hermes()),"shell-hooks-allowlist.json"),UT=[{event:"post_llm_call",type:"stop"},{event:"pre_approval_request",type:"notification"}];function j3(){let r=Te.hermes(),e=[HT,"hooks:",...UT.map(({event:s,type:o})=>` ${s}:
|
|
152
|
+
- command: ${zT(Dt(o,"hermes"))}
|
|
153
|
+
timeout: 5`),qT].join(`
|
|
154
|
+
`);f3(r,HT,qT,e);let t=B3(),n=_r(t),i=(n.approvals||[]).filter(s=>!(typeof s.command=="string"&&s.command.includes("&tool=hermes")));return n.approvals=[...i,...UT.map(({event:s,type:o})=>({event:s,command:Dt(o,"hermes"),approved_at:"2020-01-01T00:00:00Z"}))],Jr(t,n),{success:!0}}function JT(r,e,t){return`// 9Remote ${r} notify plugin (auto-generated)
|
|
154
155
|
function post(type) {
|
|
155
156
|
const sid = process.env.NINE_REMOTE_SESSION_ID || "";
|
|
156
157
|
if (!sid) return;
|
|
157
|
-
const url = ${JSON.stringify(
|
|
158
|
+
const url = ${JSON.stringify(Pm)} + "?type=" + type + "&sessionId=" + encodeURIComponent(sid) + "&tool=${r}";
|
|
158
159
|
try { fetch(url, { signal: AbortSignal.timeout(2000) }).catch(() => {}); } catch (_) {}
|
|
159
160
|
}
|
|
160
161
|
export default function (${e}) {
|
|
161
162
|
${e}.on(${JSON.stringify(t)}, async () => post("stop"));
|
|
162
163
|
}
|
|
163
|
-
`}function
|
|
164
|
-
`),g=[];for(let x=0;x<h.length&&g.length<10;x++){let S=h[x],
|
|
164
|
+
`}function F3(){let r=Te.amp(),e=Me.default.dirname(r);return se.default.existsSync(e)||se.default.mkdirSync(e,{recursive:!0}),se.default.writeFileSync(r,JT("amp","amp","agent.end"),"utf8"),{success:!0}}function H3(){let r=Te.pi(),e=Me.default.dirname(r);return se.default.existsSync(e)||se.default.mkdirSync(e,{recursive:!0}),se.default.writeFileSync(r,JT("pi","pi","agent_end"),"utf8"),{success:!0}}function $T(r,e){try{return se.default.existsSync(r)&&se.default.readFileSync(r,"utf8").includes(e)}catch{return!1}}function q3(r){switch(r){case"claude":{let e=_r(Te.claude());return!!(e.hooks?.Stop||e.hooks?.Notification)}case"codex":return $T(Te.codex(),"# 9Remote notification");case"gemini":{let e=_r(Te.gemini());return!!(e.hooks?.AfterAgent||e.hooks?.Notification)}case"opencode":case"amp":case"pi":return se.default.existsSync(Te[r]());case"kiro":case"antigravity":case"cursor":case"grok":case"copilot":case"codebuddy":case"factory":case"qoder":case"rovodev":case"hermes":return $T(Te[r](),`&tool=${r}`);default:return!1}}function U3(r){let e=(process.env.PATH||"").split(Me.default.delimiter).filter(Boolean),t=process.platform==="win32"?(process.env.PATHEXT||".EXE;.CMD;.BAT").split(";"):[""];return e.some(n=>t.some(i=>{try{return se.default.existsSync(Me.default.join(n,r+i))}catch{return!1}}))}function $3(r){let e=u3[r];if(e&&U3(e))return!0;let t=p3[r]?.();return t?(Array.isArray(t)?t:[t]).some(n=>se.default.existsSync(n)):!1}var W3={claude:d3,codex:v3,gemini:y3,opencode:_3,grok:w3,cursor:M3,antigravity:I3,kiro:N3,copilot:k3,codebuddy:A3,factory:R3,qoder:O3,rovodev:L3,hermes:j3,amp:F3,pi:H3};var G3=Bv;function z3(r){return W3[r]?.()||{success:!1,error:"Unknown tool"}}function XT(){let r={};for(let e of G3)if(!(!$3(e)||q3(e)))try{r[e]=z3(e).success}catch{r[e]=!1}return r}function ZT(){let r=Te.claude(),e=_r(r);if(!e.hooks?.Stop&&!e.hooks?.Notification)return;let t=e.env||{};Object.keys(ho).some(i=>t[i]!==ho[i])&&(VT(e),Jr(r,e))}gi();var Sz=(0,eC.dirname)((0,tC.fileURLToPath)(__importMetaUrl)),Ez=uo.rgb(230,138,110),Im="daemon",V3="2.1.1",Xr=new Map,rC=new Map,nC={},iC=[];async function QT(){let r=await Ll(),e=new Map(r.map(n=>[n.id,n])),t=qh();for(let n of r)if(!t[n.id])try{await vi(n.id)}catch{}Xr.clear();for(let[n,i]of Object.entries(t)){let s=e.get(n);Xr.set(n,{daemon:!0,name:i.name,createdAt:i.createdAt,shellId:i.shellId,cwd:s?.cwd||i.cwd,needsRespawn:!s})}Mr(Xr)}async function sC(){let r=tE();for(let n of r.groups)rC.set(n.id,n);Object.assign(nC,r.sessionGroups),iC.push(...r.sessionOrder);try{ZT()}catch{}try{XT()}catch{}if(Im==="daemon")if(!await aS())console.error("\u274C Failed to connect to PTY daemon, falling back to buffer mode");else{await QT(),ta("connected",()=>{QT().catch(()=>{})});return}console.log("\u{1F4E6} Buffer persistence mode - scrollback enabled");let e=eE(),t=qh();for(let n of e){let i=t[n]||{};Xr.set(n,{pty:null,name:i.name||`Terminal ${Xr.size+1}`,createdAt:i.createdAt||Date.now(),buffer:[],needsRestore:!0}),console.log(`\u{1F504} Found saved session: ${n}`)}e.length>0&&console.log(`\u2705 Found ${e.length} saved session(s)`)}function Vs(r,e){Im==="daemon"&&(ta("output",({sessionId:i,enc:s,data:o})=>{yt(r,"output",{sessionId:i,enc:s,data:o})}),ta("cwdChange",({sessionId:i,cwd:s})=>{let o=Xr.get(i);o&&s&&o.cwd!==s&&(o.cwd=s,Mr(Xr)),yt(r,"cwdChange",{sessionId:i,cwd:s})}),ta("sessionClosed",i=>{Xr.delete(i),Eu(i),yt(r,"sessionClosed",i),yt(r,"notificationCleared",i)}));let t=()=>({version:V3,remoteAvailable:Cs(),daemonMode:Im==="daemon"&&Mt(),platform:process.platform,updateAvailable:Aw(),canSelfUpdate:!0,...zS()}),n=()=>{let i=t();for(let s of r.sockets.sockets.values())s.data?.approved&&s.emit("serverInfo",i)};Mw(n),Vs._buildServerInfo=t,Vs._emitServerInfo=n}function oC(){Vs._emitServerInfo?.()}var aC=null;function cC(r){aC=r}async function lC(r,e,t){VS(),aC?.(),r.emit("serverInfo",Vs._buildServerInfo?.()),oE(r,e,Xr,rC,nC,iC),pE(r,Xr),jT(r),Wl()&&await GS(r,t).catch(n=>{console.error("\u274C Failed to setup remote handlers:",n.message)}),r.on("disconnect",()=>{PT(r.id),KS()})}var re=K(require("fs"),1),wr=K(require("path"),1),Qr=K(require("os"),1),eo=require("child_process"),gA=K(cA(),1);var Pg=["node_modules",".git","dist","build",".next","coverage","__pycache__",".cache",".vscode",".idea",".turbo",".vercel",".output","out",".nuxt",".svelte-kit","target","vendor",".gradle",".pytest_cache",".mypy_cache",".tox",".venv","venv","env",".DS_Store",".parcel-cache",".rollup.cache"],zu=[".png",".jpg",".jpeg",".gif",".webp",".ico",".svg",".bmp",".pdf",".zip",".tar",".gz",".rar",".7z",".exe",".dll",".so",".dylib",".mp3",".mp4",".wav",".avi",".mov",".webm",".woff",".woff2",".ttf",".eot",".otf",".sqlite",".db"];var lA=[".ssh",".aws",".gnupg",".kube",".docker",".cargo",".npmrc",".netrc",".pypirc",".config/gh",".config/gcloud"],uA=["/etc/shadow","/etc/sudoers","/etc/ssh","/root","/private/etc/sudoers"];var Vu=K(require("fs"),1),Kn=K(require("path"),1),pA=K(require("os"),1);var fA=pA.default.homedir();function l$(r){if(!r)return null;let e=r.startsWith("~")?r.replace(/^~/,fA):r,t=Kn.default.resolve(e);try{return Vu.default.realpathSync(t)}catch{let n=t,i=[];for(;!Vu.default.existsSync(n);){i.unshift(Kn.default.basename(n));let s=Kn.default.dirname(n);if(s===n)return t;n=s}try{return Kn.default.join(Vu.default.realpathSync(n),...i)}catch{return t}}}function wt(r){let e=l$(r);if(!e)return!1;for(let t of uA)if(e===t||e.startsWith(t+Kn.default.sep))return!0;for(let t of lA){let n=Kn.default.join(fA,t);if(e===n||e.startsWith(n+Kn.default.sep))return!0}return!1}function Ku(r){return Pg.includes(r)}function to(r){return zu.includes(wr.default.extname(r).toLowerCase())}function p$(r,e){return r.isDirectory()?"folder":to(e)?"binary":"file"}function Ra(r){return r<1024?`${r}B`:r<1024*1024?`${(r/1024).toFixed(1)}KB`:`${(r/(1024*1024)).toFixed(1)}MB`}function vA(r,e,t,n=50){if(!(t.length>=n))try{for(let i of re.default.readdirSync(r)){if(t.length>=n)return;if(i.startsWith(".")||Ku(i))continue;let s=wr.default.join(r,i);try{let o=re.default.statSync(s);o.isDirectory()?vA(s,e,t,n):i.toLowerCase().includes(e.toLowerCase())&&t.push({name:i,path:s,type:to(i)?"binary":"file",size:o.size,sizeFormatted:Ra(o.size)})}catch{}}}catch{}}function mA(r){if(!r)return null;let e=r.replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*/g,"::ANY::").replace(/\*/g,"[^/]*").replace(/::ANY::/g,".*").replace(/\?/g,".");return new RegExp(`^${e}$`)}function yA(r,e,t,n,i,s){if(s.length>=200)return;let o;try{o=re.default.readdirSync(r,{withFileTypes:!0})}catch{return}for(let a of o){if(s.length>=200)return;if(Ku(a.name))continue;let c=wr.default.join(r,a.name),l=wr.default.relative(e,c);if(a.isDirectory()){yA(c,e,t,n,i,s);continue}if(a.isFile()&&!to(a.name)&&!wt(c)&&!(i&&i.test(l))&&!(n&&!n.test(l)))try{if(re.default.statSync(c).size>512e3)continue;let h=re.default.readFileSync(c,"utf-8").split(`
|
|
165
|
+
`),g=[];for(let x=0;x<h.length&&g.length<10;x++){let S=h[x],C=t(S);for(let R of C){if(g.length>=10)break;g.push({line:x+1,column:R.column+1,lineText:S,matchLength:R.length})}}g.length&&s.push({path:c,matches:g})}catch{}}}function xA(r,e,t){let n;try{n=re.default.readdirSync(r,{withFileTypes:!0})}catch{return[]}let i=[];for(let s of n){if(!t&&s.name.startsWith(".")&&s.name!==".env"&&s.name!==".env.example"||Ku(s.name))continue;let o=wr.default.join(r,s.name);if(s.isDirectory()){let a={name:s.name,path:o,type:"folder"};e>0&&(a.children=xA(o,e-1,t)),i.push(a)}else s.isFile()&&i.push({name:s.name,path:o,type:to(s.name)?"binary":"file"})}return i.sort((s,o)=>s.type==="folder"&&o.type!=="folder"?-1:s.type!=="folder"&&o.type==="folder"?1:s.name.localeCompare(o.name)),i}function f$(){if(process.platform!=="win32")return[];try{return(0,eo.execSync)("wmic logicaldisk get name",{encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}).split(/\r?\n/).map(e=>e.trim()).filter(e=>/^[A-Z]:$/.test(e)).map(e=>({letter:e[0],path:e+"\\"}))}catch{return"CDEFGHIJ".split("").map(r=>`${r}:\\`).filter(r=>re.default.existsSync(r)).map(r=>({letter:r[0],path:r}))}}function _A(r){r.on("getSystemInfo",t=>{let n=process.platform;t({success:!0,platform:n,isWindows:n==="win32",drives:n==="win32"?f$():[],homedir:Qr.default.homedir()})}),r.on("getFiles",({dirPath:t,showHidden:n},i)=>{try{let s=t||Qr.default.homedir(),o=s.startsWith("~")?s.replace("~",Qr.default.homedir()):s;if(wt(o))return i({success:!1,error:"Access denied"});if(!re.default.existsSync(o))return i({success:!1,error:"Directory not found"});let a=[];for(let c of re.default.readdirSync(o))if(!(!n&&c.startsWith(".")&&c!==".env"&&c!==".env.example")&&!Ku(c))try{let l=wr.default.join(o,c),u=re.default.statSync(l);a.push({name:c,path:l,type:p$(u,c),size:u.isFile()?u.size:null,sizeFormatted:u.isFile()?Ra(u.size):null,modified:u.mtime.getTime()})}catch{}a.sort((c,l)=>c.type==="folder"&&l.type!=="folder"?-1:c.type!=="folder"&&l.type==="folder"?1:c.name.localeCompare(l.name)),i({success:!0,files:a,currentPath:o,parentPath:wr.default.dirname(o)})}catch(s){i({success:!1,error:s.message})}}),r.on("searchFiles",({workspace:t,query:n},i)=>{try{if(!n||n.length<2)return i({success:!0,files:[]});let s=(t||Qr.default.homedir()).replace(/^~/,Qr.default.homedir());if(!re.default.existsSync(s))return i({success:!1,error:"Workspace not found"});let o=[];vA(s,n,o,50),o.sort((a,c)=>{let l=a.name.toLowerCase()===n.toLowerCase(),u=c.name.toLowerCase()===n.toLowerCase();return l&&!u?-1:!l&&u?1:a.path.length-c.path.length}),i({success:!0,files:o})}catch(s){i({success:!1,error:s.message})}}),r.on("readFile",({filePath:t},n)=>{try{if(wt(t))return n({success:!1,error:"Access denied"});if(!re.default.existsSync(t))return n({success:!1,error:"File not found"});let i=re.default.statSync(t);if(i.size>512e3)return n({success:!1,error:`File too large (${Ra(i.size)}). Max ${Ra(512e3)}`});if(to(t))return n({success:!1,error:"Cannot open binary file"});n({success:!0,content:re.default.readFileSync(t,"utf-8")})}catch(i){n({success:!1,error:i.message})}}),r.on("readImage",({filePath:t},n)=>{try{if(wt(t))return n({success:!1,error:"Access denied"});if(!re.default.existsSync(t))return n({success:!1,error:"File not found"});let i=re.default.statSync(t),s=10*1024*1024;if(i.size>s)return n({success:!1,error:`Image too large (${Ra(i.size)})`});let o=wr.default.extname(t).toLowerCase().slice(1),c={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",ico:"image/x-icon",bmp:"image/bmp"}[o]||"application/octet-stream",l=re.default.readFileSync(t),u=`data:${c};base64,${l.toString("base64")}`;n({success:!0,dataUrl:u,size:i.size,mime:c})}catch(i){n({success:!1,error:i.message})}}),r.on("writeFile",({filePath:t,content:n},i)=>{try{if(wt(t))return i({success:!1,error:"Access denied"});re.default.writeFileSync(t,n,"utf-8"),i({success:!0})}catch(s){i({success:!1,error:s.message})}}),r.on("createItem",({itemPath:t,type:n},i)=>{try{if(wt(t))return i({success:!1,error:"Access denied"});if(re.default.existsSync(t))return i({success:!1,error:"Item already exists"});n==="folder"?re.default.mkdirSync(t,{recursive:!0}):re.default.writeFileSync(t,"","utf-8"),i({success:!0})}catch(s){i({success:!1,error:s.message})}}),r.on("deleteItem",({itemPath:t},n)=>{try{if(wt(t))return n({success:!1,error:"Access denied"});if(!re.default.existsSync(t))return n({success:!1,error:"Item not found"});re.default.statSync(t).isDirectory()?re.default.rmSync(t,{recursive:!0}):re.default.unlinkSync(t),n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.on("renameItem",({oldPath:t,newPath:n},i)=>{try{if(wt(t)||wt(n))return i({success:!1,error:"Access denied"});if(!re.default.existsSync(t))return i({success:!1,error:"Item not found"});if(re.default.existsSync(n))return i({success:!1,error:"Target already exists"});re.default.renameSync(t,n),i({success:!0})}catch(s){i({success:!1,error:s.message})}}),r.on("searchInFiles",({workspace:t,query:n,caseSensitive:i,regex:s,includeGlob:o,excludeGlob:a},c)=>{try{if(!n)return c({success:!0,results:[]});let l=(t||Qr.default.homedir()).replace(/^~/,Qr.default.homedir());if(!re.default.existsSync(l))return c({success:!1,error:"Workspace not found"});let u;if(s){let x;try{x=new RegExp(n,i?"g":"gi")}catch(S){return c({success:!1,error:`Invalid regex: ${S.message}`})}u=S=>{let C=[],R;for(x.lastIndex=0;(R=x.exec(S))!==null;)C.push({column:R.index,length:R[0].length}),R.index===x.lastIndex&&x.lastIndex++;return C}}else{let x=i?n:n.toLowerCase();u=S=>{let C=i?S:S.toLowerCase(),R=[],M=0;for(;(M=C.indexOf(x,M))!==-1;)R.push({column:M,length:x.length}),M+=x.length||1;return R}}let f=mA(o),h=mA(a),g=[];yA(l,l,u,f,h,g),c({success:!0,results:g})}catch(l){c({success:!1,error:l.message})}}),r.on("replaceInFiles",({workspace:t,query:n,replacement:i,caseSensitive:s,regex:o,files:a},c)=>{try{if(!n||!Array.isArray(a)||!a.length)return c({success:!0,replacedCount:0,fileCount:0});let l;if(o){let h;try{h=new RegExp(n,s?"g":"gi")}catch(g){return c({success:!1,error:`Invalid regex: ${g.message}`})}l=g=>{let x=0;return{next:g.replace(h,C=>(x++,i)),count:x}}}else l=h=>{let g=0,x=s?"g":"gi",S=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),C=new RegExp(S,x);return{next:h.replace(C,()=>(g++,i)),count:g}};let u=0,f=0;for(let h of a)try{if(!re.default.existsSync(h)||to(h)||wt(h))continue;let g=re.default.statSync(h);if(!g.isFile()||g.size>512e3)continue;let x=re.default.readFileSync(h,"utf-8"),{next:S,count:C}=l(x);C>0&&(re.default.writeFileSync(h,S,"utf-8"),u+=C,f++)}catch{}c({success:!0,replacedCount:u,fileCount:f})}catch(l){c({success:!1,error:l.message})}});let e=new Map;r.on("watchDir",({dirPath:t},n)=>{try{if(!t||!re.default.existsSync(t))return n({success:!1,error:"Directory not found"});let i=e.get(t);if(i)return i.count++,n({success:!0});let s=gA.default.watch(t,{depth:0,ignoreInitial:!0,persistent:!0,ignored:a=>Pg.includes(wr.default.basename(a))}),o=a=>c=>r.emit("fileChange",{type:a,path:c});s.on("add",o("add")).on("change",o("change")).on("unlink",o("unlink")).on("addDir",o("addDir")).on("unlinkDir",o("unlinkDir")),e.set(t,{w:s,count:1}),n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.on("unwatchDir",({dirPath:t},n)=>{try{let i=e.get(t);i&&--i.count<=0&&(i.w.close(),e.delete(t)),n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.once("disconnect",()=>{for(let{w:t}of e.values())try{t.close()}catch{}e.clear()}),r.on("revealInOS",({filePath:t},n)=>{try{if(!t)return n({success:!1,error:"No path"});let i=process.platform,s,o;i==="darwin"?(s="open",o=["-R",t]):i==="win32"?(s="explorer",o=[`/select,${t}`]):(s="xdg-open",o=[wr.default.dirname(t)]);let a=(0,eo.spawn)(s,o,{detached:!0,stdio:"ignore",windowsHide:!0});a.on("error",c=>n({success:!1,error:c.message})),a.unref(),n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.on("openInTerminal",({dirPath:t},n)=>{try{if(!t||!re.default.existsSync(t))return n({success:!1,error:"Directory not found"});let i=process.platform,s,o,a={detached:!0,stdio:"ignore",windowsHide:!0};i==="darwin"?(s="open",o=["-a","Terminal",t]):i==="win32"?(s="cmd",o=["/C","start",'"9Remote"',"cmd","/K"],a.shell=!1,a.cwd=t):(s="gnome-terminal",o=["--working-directory",t]);let c=(0,eo.spawn)(s,o,a);c.on("error",()=>{if(i==="linux"){let l=(0,eo.spawn)("xterm",["-e","bash"],{...a,cwd:t});l.on("error",u=>n({success:!1,error:u.message})),l.unref()}else n({success:!1,error:"Failed to open terminal"})}),c.unref(),n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.on("getFileTree",({dirPath:t,depth:n,showHidden:i},s)=>{try{let o=(t||Qr.default.homedir()).replace(/^~/,Qr.default.homedir());if(!re.default.existsSync(o))return s({success:!1,error:"Directory not found"});let c=xA(o,typeof n=="number"?n:3,!!i);s({success:!0,tree:{name:wr.default.basename(o)||o,path:o,type:"folder",children:c}})}catch(o){s({success:!1,error:o.message})}})}var zt=K(require("fs"),1),Ai=K(require("path"),1),Ri=require("child_process");var h$=5e3,Ig=new Map;function Yn(r,e){return new Promise(t=>{let n=(0,Ri.spawn)("git",r,{cwd:e,windowsHide:!0}),i="",s="";n.stdout.on("data",o=>{i+=o.toString()}),n.stderr.on("data",o=>{s+=o.toString()}),n.on("error",o=>t({code:-1,stdout:i,stderr:o.message})),n.on("close",o=>t({code:o,stdout:i,stderr:s}))})}function ro(r,e){try{return(0,Ri.spawnSync)("git",r,{cwd:e,encoding:"utf-8",windowsHide:!0}).stdout??""}catch{return""}}function bA(r){return zu.includes(Ai.default.extname(r).toLowerCase())}function wA(r){r.on("gitStatus",({repoPath:e},t)=>{try{let n=(0,Ri.execSync)("git status --porcelain",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}),i={};try{(0,Ri.execSync)("git diff HEAD --numstat",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}).trim().split(`
|
|
165
166
|
`).filter(Boolean).forEach(a=>{let c=a.split(" ");c.length>=3&&(i[c[2]]={added:c[0]==="-"?0:parseInt(c[0],10)||0,deleted:c[1]==="-"?0:parseInt(c[1],10)||0})})}catch{}let s=[];for(let o of n.trim().split(`
|
|
166
|
-
`).filter(Boolean)){let a=o.match(/^([MADRCU?! ]{1,2})\s+(.+)$/);if(!a)continue;let c=a[1],l=a[2];if(!l)continue;let u;c.includes("?")?u="?":c.includes("A")?u="A":c.includes("D")?u="D":c.includes("M")?u="M":c.includes("R")?u="R":u=c.trim()[0]||"?";let f=i[l]||{added:0,deleted:0};if(u==="?")try{let h=
|
|
167
|
-
`).length,f.deleted=0}}catch{}s.push({status:u,path:l,added:f.added,deleted:f.deleted})}t({success:!0,files:s})}catch{t({success:!1,error:"Not a git repository or git not available"})}}),r.on("gitChangedCount",({repoPath:e},t)=>{
|
|
168
|
-
`).length:0
|
|
167
|
+
`).filter(Boolean)){let a=o.match(/^([MADRCU?! ]{1,2})\s+(.+)$/);if(!a)continue;let c=a[1],l=a[2];if(!l)continue;let u;c.includes("?")?u="?":c.includes("A")?u="A":c.includes("D")?u="D":c.includes("M")?u="M":c.includes("R")?u="R":u=c.trim()[0]||"?";let f=i[l]||{added:0,deleted:0};if(u==="?")try{let h=Ai.default.join(e,l);if(zt.default.existsSync(h)&&!bA(l)&&!wt(h)){let g=zt.default.readFileSync(h,"utf-8");f.added=g.split(`
|
|
168
|
+
`).length,f.deleted=0}}catch{}s.push({status:u,path:l,added:f.added,deleted:f.deleted})}t({success:!0,files:s})}catch{t({success:!1,error:"Not a git repository or git not available"})}}),r.on("gitChangedCount",async({repoPath:e},t)=>{let n=Ig.get(e),i=Date.now();if(n&&i-n.ts<h$){t(n.value);return}if(n?.pending){try{t(await n.pending)}catch{t({success:!1})}return}let s=Yn(["status","--porcelain"],e).then(o=>{let a=o.code===0?{success:!0,count:o.stdout.trim()?o.stdout.trim().split(`
|
|
169
|
+
`).length:0}:{success:!1,error:"Not a git repository or git not available"};return Ig.set(e,{ts:Date.now(),value:a,pending:null}),a}).catch(()=>({success:!1}));Ig.set(e,{ts:i,value:{success:!1},pending:s});try{t(await s)}catch{t({success:!1})}}),r.on("gitFileStatus",({repoPath:e,filePath:t},n)=>{try{let i=Ai.default.relative(e,t),o=ro(["status","--porcelain","--",i],e).trim();if(!o)return n({success:!0,status:null});let a=o.match(/^([MADRCU?! ]{1,2})\s+(.+)$/);if(!a)return n({success:!0,status:null});let c=a[1],l;c.includes("?")?l="?":c.includes("A")?l="A":c.includes("D")?l="D":c.includes("M")?l="M":c.includes("R")?l="R":l=c.trim()[0]||"?",n({success:!0,status:l,file:i})}catch{n({success:!0,status:null})}}),r.on("gitDiff",({repoPath:e,file:t,status:n},i)=>{try{let s="";if(t&&n==="?"){let o=Ai.default.join(e,t);if(zt.default.existsSync(o)&&!wt(o)){let c=zt.default.readFileSync(o,"utf-8").split(`
|
|
169
170
|
`);s=`diff --git a/${t} b/${t}
|
|
170
171
|
new file mode 100644
|
|
171
172
|
--- /dev/null
|
|
172
173
|
+++ b/${t}
|
|
173
174
|
@@ -0,0 +1,${c.length} @@
|
|
174
175
|
${c.map(l=>`+${l}`).join(`
|
|
175
|
-
`)}`}}else if(t)s=(
|
|
176
|
-
`).filter(c=>c.startsWith("??")).map(c=>c.substring(3));for(let c of a){let l=
|
|
176
|
+
`)}`}}else if(t)s=ro(["diff","HEAD","--",t],e);else{s=ro(["diff","HEAD"],e);let a=ro(["status","--porcelain"],e).trim().split(`
|
|
177
|
+
`).filter(c=>c.startsWith("??")).map(c=>c.substring(3));for(let c of a){let l=Ai.default.join(e,c);if(zt.default.existsSync(l)&&!bA(c)&&!wt(l))try{if(zt.default.statSync(l).size<=512e3){let h=zt.default.readFileSync(l,"utf-8").split(`
|
|
177
178
|
`);s+=`
|
|
178
179
|
diff --git a/${c} b/${c}
|
|
179
180
|
new file mode 100644
|
|
@@ -181,8 +182,8 @@ new file mode 100644
|
|
|
181
182
|
+++ b/${c}
|
|
182
183
|
@@ -0,0 +1,${h.length} @@
|
|
183
184
|
${h.map(g=>`+${g}`).join(`
|
|
184
|
-
`)}`}}catch{}}}i({success:!0,diff:s})}catch(s){i({success:!1,error:s.message})}}),r.on("gitBranch",async({repoPath:e},t)=>{let n=await
|
|
185
|
-
`).filter(Boolean).map(a=>{let[c,...l]=a.split(" ");return{hash:c,message:l.join(" ")}});n({success:!0,commits:o})}catch(i){n({success:!1,error:i.message})}}),r.on("gitDiscard",({repoPath:e,file:t,status:n},i)=>{try{if(!t)return i({success:!1,error:"No file specified"});let s=
|
|
185
|
+
`)}`}}catch{}}}i({success:!0,diff:s})}catch(s){i({success:!1,error:s.message})}}),r.on("gitBranch",async({repoPath:e},t)=>{let n=await Yn(["branch","--show-current"],e);if(n.code!==0)return t({success:!1});t({success:!0,branch:n.stdout.trim()})}),r.on("gitAdd",async({repoPath:e,files:t},n)=>{try{let i=Array.isArray(t)&&t.length?t:["."],s=await Yn(["add","--",...i],e);if(s.code!==0)return n({success:!1,error:s.stderr.trim()});n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.on("gitReset",async({repoPath:e,files:t},n)=>{try{let i=Array.isArray(t)&&t.length?t:["."],s=await Yn(["reset","HEAD","--",...i],e);n({success:s.code===0,error:s.code===0?void 0:s.stderr.trim()})}catch(i){n({success:!1,error:i.message})}}),r.on("gitCommit",async({repoPath:e,message:t},n)=>{try{if(!t)return n({success:!1,error:"Empty message"});let i=await Yn(["commit","-m",t],e),s=(i.stdout+i.stderr).trim();if(i.code!==0)return n({success:!1,output:s,error:i.stderr.trim()});n({success:!0,output:s})}catch(i){n({success:!1,error:i.message})}}),r.on("gitPush",async({repoPath:e},t)=>{try{let n=await Yn(["push"],e),i=(n.stdout+n.stderr).trim();if(n.code!==0)return t({success:!1,output:i,error:n.stderr.trim()});t({success:!0,output:i})}catch(n){t({success:!1,error:n.message})}}),r.on("gitPull",async({repoPath:e},t)=>{try{let n=await Yn(["pull"],e),i=(n.stdout+n.stderr).trim();if(n.code!==0)return t({success:!1,output:i,error:n.stderr.trim()});t({success:!0,output:i})}catch(n){t({success:!1,error:n.message})}}),r.on("gitLog",async({repoPath:e,limit:t},n)=>{try{let i=typeof t=="number"&&t>0?t:20,s=await Yn(["log","-n",String(i),"--pretty=format:%h%x09%s"],e);if(s.code!==0)return n({success:!1,error:s.stderr.trim()});let o=s.stdout.split(`
|
|
186
|
+
`).filter(Boolean).map(a=>{let[c,...l]=a.split(" ");return{hash:c,message:l.join(" ")}});n({success:!0,commits:o})}catch(i){n({success:!1,error:i.message})}}),r.on("gitDiscard",({repoPath:e,file:t,status:n},i)=>{try{if(!t)return i({success:!1,error:"No file specified"});let s=Ai.default.join(e,t);if(wt(s))return i({success:!1,error:"Access denied"});n==="?"?zt.default.existsSync(s)&&(zt.default.statSync(s).isDirectory()?zt.default.rmSync(s,{recursive:!0}):zt.default.unlinkSync(s)):n==="A"?(ro(["reset","HEAD","--",t],e),zt.default.existsSync(s)&&!wt(s)&&zt.default.unlinkSync(s)):ro(["checkout","HEAD","--",t],e),i({success:!0})}catch(s){i({success:!1,error:s.message})}})}function SA(r){_A(r),wA(r)}var m$=1e3;function EA(r){let e=null,t=null,n=!1,i=async()=>{if(!n){n=!0;try{let s=await lE();s!==e&&(e=s,r.emit("clipboard:sync",{text:s,origin:"host"}))}catch{}finally{n=!1}}};r.on("clipboard:set",async({text:s,origin:o})=>{if(typeof s=="string"&&s!==e)try{await uE(s),e=s}catch(a){console.error("[clipboard] set failed:",a.message)}}),t=setInterval(i,m$),i(),r.on("disconnect",()=>{t&&clearInterval(t)})}yn();var Cn=require("fs"),CA=require("path");bt();ah();var TA=ie.CONFIG,Ng=(0,CA.join)(ie.CONFIG,"approvedDevices.json"),Lr=new Map,no=!1,Oa=new Map,io=new Map;function kA(){(0,Cn.existsSync)(TA)||(0,Cn.mkdirSync)(TA,{recursive:!0})}function AA(){try{if(kA(),(0,Cn.existsSync)(Ng)){let r=JSON.parse((0,Cn.readFileSync)(Ng,"utf8"));Array.isArray(r)?Lr=new Map(r.map(e=>[e,{approvedAt:null}])):Lr=new Map(Object.entries(r)),Lr.delete(po)&&Yu()}}catch{Lr=new Map}}function Yu(){try{kA(),(0,Cn.writeFileSync)(Ng,JSON.stringify(Object.fromEntries(Lr),null,2))}catch{}}function RA(r){return r?Lr.has(r):!1}function Ju(r){!r||r===po||(Lr.set(r,{approvedAt:new Date().toISOString()}),Yu())}function OA(r){Lr.delete(r),Yu()}function MA(r,e){let t=Lr.get(r);return t?(Lr.set(r,{...t,label:e||""}),Yu(),!0):!1}function PA(){return[...Lr.entries()].map(([r,e])=>({deviceId:r,...e}))}function IA(r,e){Oa.set(r,e)}function Dg(r){return Oa.get(r)||null}function Xu(r){Oa.delete(r)}function NA(r){if(!r)return!1;for(let e of Oa.values())if(e.deviceId===r)return!0;return!1}function DA(){return[...Oa.entries()].map(([r,e])=>({socketId:r,...e}))}function LA(r,e){r&&io.set(r,{...e,rejectedAt:new Date().toISOString()})}function BA(r){return r?io.has(r):!1}function jA(r,e,t){let n=io.get(r);n&&io.set(r,{...n,socketId:e,ip:t})}function FA(){return[...io.entries()].map(([r,e])=>({deviceId:r,...e}))}function so(r){io.delete(r)}function HA(){return no=!!Yo().autoApprove,no}function Zu(){return no}function qA(r){return no=!!r,wl({autoApprove:no}),no}function Lg(){try{let r=(0,$A.join)(ie.ROOT,"keys.json");return JSON.parse((0,UA.readFileSync)(r,"utf8")).key||null}catch{return null}}var Oi=null;function Pa(){return Oi}async function Ma(r){r.handshake.auth?.tempKey&&(xe("One-time key used \u2014 clearing from UI"),kw()),await g$(r),SA(r),EA(r),await lC(r,Oi,Lg()),r.emit("terminal:ready")}async function g$(r){if(r.data.protocol)return;let{webrtc:e,streaming:t}=$,n=new Ol(r,{enableWebRTC:e.enableWebRTC,apiKey:e.enableTurn?Lg():null,turnApiUrl:e.enableTurn?e.turnApiUrl:null,turnRefreshInterval:e.turnRefreshInterval,dcMaxMessageSize:e.dcMaxMessageSize,dcChunkSize:e.dcChunkSize,dcMaxTilesPerFrame:e.dcMaxTilesPerFrame,answerTimeout:e.answerTimeout,maxControlBuffer:e.maxControlBuffer,wsChunkSize:t.chunkSize});r.data.protocol=n,Zw(n),n.attachAsBus(r);try{await n.init(),n.setupSignaling(r)}catch(i){console.error("[transport] pm init failed:",i.message)}}function WA(r){let e=Oi;if(!e)return!1;let t=e.sockets.sockets.get(r),n=Dg(r);return!t||!n?!1:(Ju(n.deviceId),Xu(r),so(n.deviceId),t.data.approved=!0,t.emit("device:approved"),Ma(t),xe(`Device approved: ${n.deviceId.slice(0,8)}...`),!0)}function GA(r){let e=Oi;if(!e||!r)return!1;Ju(r),so(r);for(let t of e.sockets.sockets.values())t.handshake.auth?.deviceId===r&&(t.data.approved=!0,t.emit("device:approved"),Ma(t));return xe(`Device approved from pending: ${r.slice(0,8)}...`),!0}function Qu(r){let e=Oi;if(!e||!r)return 0;let t=0;for(let n of e.sockets.sockets.values())n.handshake.auth?.deviceId===r&&(n.disconnect(!0),t++);return t&&xe(`Disconnected ${t} socket(s) for device ${r.slice(0,8)}...`),t}function zA(r){let e=Oi;if(!e)return!1;let t=Dg(r),n=e.sockets.sockets.get(r);return Xu(r),t?.deviceId&&LA(t.deviceId,{ip:t.ip,socketId:r}),n&&(n.emit("device:rejected"),n.disconnect(!0)),Tt("deviceApproval",{action:"refresh"}),xe(`Device rejected: ${t?.deviceId?.slice(0,8)||"unknown"}...`),!0}async function VA(r){AA(),HA();let e=new Gb(r,{cors:{origin:"*",methods:["GET","POST"],credentials:!0,allowedHeaders:["*"]},transports:["websocket","polling"],allowEIO3:!0,allowUpgrades:!0,pingTimeout:6e4,pingInterval:25e3,maxHttpBufferSize:1e8,perMessageDeflate:{threshold:1024}}),t=await FS();return Ow(t),e.on("connection",n=>{let i=n.handshake.headers["x-forwarded-for"]||n.handshake.address||"unknown",s=n.handshake.auth?.deviceId||null;n.data.approved=!1,n.use((f,h)=>{if(n.data.approved)return h();let g=f[0];return g==="device:clientReady"||g==="disconnect"?h():h(new Error("Device not approved"))});let o=n.handshake.address||"",a=o==="127.0.0.1"||o==="::1"||o==="::ffff:127.0.0.1",c=!!n.handshake.headers["cf-connecting-ip"],l=n.handshake.headers.origin,u=!l||Ya.includes(l);if(!c&&a&&u&&Kb(n.handshake.auth?.localToken)){n.data.approved=!0,n.data.localUi=!0,xe("Local UI connected \u2014 trusted (token)"),Ma(n);return}if(s===po){xe(`Rejected untrusted local-ui socket from ${i}`),n.disconnect(!0);return}if(Iw(n.id,i,s),xe(`Client connected: ${i} (device: ${s?.slice(0,8)||"none"})`),n.on("disconnect",f=>{Nw(n.id),Xu(n.id),xe(`Client disconnected: ${i} (${f})`);let h=n.data?.protocol;if(h&&!n.data?.remoteAttached){try{h.close()}catch{}As(h)}}),s&&RA(s))xe(`Device recognized: ${s.slice(0,8)}...`),n.data.approved=!0,Ma(n),n.once("device:clientReady",()=>n.emit("device:approved"));else if(s&&BA(s))jA(s,n.id,i),xe(`Rejected device reconnected: ${s.slice(0,8)} \u2014 waiting in Clients list`),n.emit("device:rejected"),Tt("deviceApproval",{action:"refresh"});else if(s&&Zu())Ju(s),so(s),n.data.approved=!0,xe(`Auto-approved device: ${s.slice(0,8)}...`),Ma(n),n.once("device:clientReady",()=>n.emit("device:approved")),Tt("deviceApproval",{action:"refresh"});else{if(xe(`Unknown device: ${s?.slice(0,8)||"no-id"} \u2014 waiting for approval`),NA(s)){xe(`Device ${s?.slice(0,8)} already pending, ignoring duplicate`),n.disconnect(!0);return}IA(n.id,{deviceId:s,ip:i}),n.once("device:clientReady",()=>{n.emit("device:pendingApproval"),Tt("deviceApproval",{socketId:n.id,deviceId:s,ip:i,action:"pending"})})}}),Vs(e,Lg()),Oi=e,e}function KA(r){r.setHeader("Access-Control-Allow-Origin","*"),r.setHeader("Access-Control-Allow-Methods","GET, POST, PUT, DELETE, OPTIONS"),r.setHeader("Access-Control-Allow-Headers","Authorization, Content-Type"),r.setHeader("Access-Control-Max-Age","86400")}function YA(r,e){return r.method==="OPTIONS"?(e.writeHead(200),e.end(),!0):!1}var ao=require("zlib"),MR=K(kR(),1);var V$=["data:","javascript:","#","mailto:","blob:"],K$=["href","src","action","srcset","poster","data","formaction","data-src","data-href","data-url","data-background"];function np(r,e){return!r||V$.some(t=>r.startsWith(t))||r.startsWith("/proxy/")?r:r.startsWith(`http://localhost:${e}`)?r.replace(`http://localhost:${e}`,`/proxy/${e}`):r.startsWith("/")&&!r.startsWith("//")?`/proxy/${e}${r}`:r}function AR(r,e){let t=`/proxy/${e}`,n=new RegExp(`(${K$.join("|")})=(["'])([^"']*?)\\2`,"gi");return r=r.replace(n,(i,s,o,a)=>{if(s.toLowerCase()==="srcset"){let c=a.split(",").map(l=>{let[u,...f]=l.trim().split(/\s+/),h=np(u,e);return f.length?`${h} ${f.join(" ")}`:h}).join(", ");return`${s}=${o}${c}${o}`}return`${s}=${o}${np(a,e)}${o}`}),r=r.replace(/url\(\s*(["']?)(\/_next\/[^)"']+)\1\s*\)/gi,(i,s,o)=>`url(${s}${t}${o}${s})`),r=r.replace(/"(\/_next\/[^"]+)"/g,(i,s)=>`"${t}${s}"`),r}function RR(r){let e=`/proxy/${r}`;return`
|
|
186
187
|
// Service Worker for 9Remote Proxy - Port ${r}
|
|
187
188
|
const PROXY_BASE = '${e}';
|
|
188
189
|
const TARGET_PORT = ${r};
|
|
@@ -237,7 +238,7 @@ self.addEventListener('fetch', (event) => {
|
|
|
237
238
|
|
|
238
239
|
event.respondWith(fetch(new Request(newUrl, requestInit)));
|
|
239
240
|
});
|
|
240
|
-
`}function
|
|
241
|
+
`}function OR(r){return`
|
|
241
242
|
<script data-proxy-injected="true">
|
|
242
243
|
(function() {
|
|
243
244
|
if (window.__proxySwRegistered) return;
|
|
@@ -279,7 +280,7 @@ self.addEventListener('fetch', (event) => {
|
|
|
279
280
|
});
|
|
280
281
|
}
|
|
281
282
|
})();
|
|
282
|
-
</script>`}var
|
|
283
|
+
</script>`}var Qg=new Set;function PR(r){Qg.add(String(r))}function IR(r){Qg.delete(String(r))}function Y$(r){return Qg.has(String(r))}function J$(r){switch(r){case"gzip":return(0,ao.createGunzip)();case"deflate":return(0,ao.createInflate)();case"br":return(0,ao.createBrotliDecompress)();default:return null}}function X$(r,e){if(r.includes("<head>"))return r.replace("<head>","<head>"+e);if(r.includes("<HEAD>"))return r.replace("<HEAD>","<HEAD>"+e);let t=r.match(/<head[^>]*>/i);return t?r.replace(t[0],t[0]+e):e+r}function NR(){"";let r=MR.default.createProxyServer({selfHandleResponse:!0});return r.on("proxyRes",(e,t,n)=>{let i=t._proxyTargetPort,s=e.headers["content-type"]||"",o=e.headers["content-encoding"]||"",a=s.includes("text/html"),c={...e.headers};if(c.location&&(c.location=np(c.location,i)),s.includes("application/json")||s.includes("text/x-component")){n.writeHead(e.statusCode,c),e.pipe(n);return}if(s.includes("javascript")||s.includes("text/javascript")){n.writeHead(e.statusCode,c),e.pipe(n);return}if(!a){n.writeHead(e.statusCode,c),e.pipe(n);return}delete c["content-length"],delete c["content-encoding"];let f=J$(o),h=f?e.pipe(f):e,g=[];h.on("data",x=>g.push(x)),h.on("error",x=>{console.error("[Proxy] Decompress error:",x.message),n.writeHead(502),n.end("Bad Gateway: Decompression failed")}),h.on("end",()=>{let x=Buffer.concat(g).toString("utf8");x=AR(x,i);let S=OR(i);x=X$(x,S),n.writeHead(e.statusCode,c),n.end(x)})}),r}function DR(r,e,t,n,i,s){if(i==="/sw.js"){let o=RR(n);t.writeHead(200,{"Content-Type":"application/javascript; charset=utf-8","Service-Worker-Allowed":"/","Cache-Control":"no-store, no-cache, must-revalidate"}),t.end(o);return}if(!Y$(n)){t.writeHead(401,{"Content-Type":"text/html"}),t.end(`
|
|
283
284
|
<!DOCTYPE html>
|
|
284
285
|
<html>
|
|
285
286
|
<head><title>Unauthorized</title></head>
|
|
@@ -290,9 +291,9 @@ self.addEventListener('fetch', (event) => {
|
|
|
290
291
|
</div>
|
|
291
292
|
</body>
|
|
292
293
|
</html>
|
|
293
|
-
`);return}e._proxyTargetPort=n,e.url=i+(s||""),r.web(e,t,{target:`http://localhost:${n}`,changeOrigin:!0},o=>{t.writeHead(502),t.end(`Bad Gateway: ${o.message}`)})}var
|
|
294
|
-
`);for(let s of i){let o=s.match(/[:\*\]](\d{2,5})(?:\s|$)/g);if(o)for(let a of o){let c=parseInt(a.replace(/[:\*\]\s]/g,""),10);c>0&&c<=65535&&(c===80||c===443||c>=1024)&&e.add(c)}}return Array.from(e)}catch(t){return console.error("Failed to get listening ports:",t.message),[80,443,3e3,3001,4200,5e3,5173,8e3,8080,9e3]}}function $$(r,e=2e3){return new Promise(t=>{let n=kR.default.request({host:"localhost",port:r,method:"GET",path:"/",timeout:e},i=>{i.on("data",()=>{}),i.on("end",()=>{}),t({active:!0,protocol:"http",status:i.statusCode})});n.on("error",i=>{t({active:!1,error:i.message})}),n.on("timeout",()=>{n.destroy(),t({active:!1,error:"timeout"})}),n.end()})}function W$(r,e=2e3){return new Promise(t=>{let n=AR.default.request({host:"localhost",port:r,method:"GET",path:"/",timeout:e,rejectUnauthorized:!1},i=>{i.on("data",()=>{}),i.on("end",()=>{}),t({active:!0,protocol:"https",status:i.statusCode})});n.on("error",i=>{t({active:!1,error:i.message})}),n.on("timeout",()=>{n.destroy(),t({active:!1,error:"timeout"})}),n.end()})}async function G$(r){let[e,t]=await Promise.all([$$(r),W$(r)]);return t.active?{port:r,...t}:e.active?{port:r,...e}:{port:r,active:!1}}async function MR(){let r=await U$();return(await Promise.all(r.map(t=>G$(t)))).filter(t=>t.active).map(t=>({port:t.port,protocol:t.protocol,url:`${t.protocol}://localhost:${t.port}`,name:`localhost:${t.port}`,status:t.status})).sort((t,n)=>t.port-n.port)}var PR=K(require("crypto"),1),z$=process.env.API_KEY_SECRET||"9remote-api-key-secret";function V$(){let r="abcdefghijklmnopqrstuvwxyz0123456789",e="";for(let t=0;t<4;t++)e+=r.charAt(Math.floor(Math.random()*r.length));return e}function IR(r,e){return PR.default.createHmac("sha256",z$).update(r+e).digest("hex").slice(0,6)}function NR(r){let e=r.slice(0,8),t=V$(),n=IR(e,t);return{key:`sk-${e}-${t}-${n}`,keyId:t}}function K$(r){if(!r||!r.startsWith("sk-"))return null;let e=r.split("-");if(e.length===4){let[,t,n,i]=e,s=IR(t,n);return i!==s?null:{machineId:t,keyId:n}}return null}function rp(r){return K$(r)!==null}async function DR(r,e){let t=r.headers.authorization;if(!t||!t.startsWith("Bearer ")){e.setHeader("Content-Type","application/json"),e.writeHead(401),e.end(JSON.stringify({error:"Unauthorized: Missing API key"}));return}let n=t.slice(7);if(!rp(n)){e.setHeader("Content-Type","application/json"),e.writeHead(401),e.end(JSON.stringify({error:"Unauthorized: Invalid API key"}));return}let i=await MR();e.setHeader("Content-Type","application/json"),e.writeHead(200),e.end(JSON.stringify(i))}dl();var jR=require("url");var np=K(require("path"),1),FR=K(require("os"),1);bt();var LR=K(require("path"),1),BR=K(require("os"),1);var HV=LR.default.join(BR.default.homedir(),".9remote","pids");nh();var Fa={checkIntervalMs:36e5,connectCheckDebounceMs:9e5,maxRetry:3,retryDelayMs:3e3,verifyTimeoutMs:15e3,lockTtlMs:3e5,lockFile:"update.lock"};var $V={orange:ao.rgb(230,138,110),orangeDim:ao.rgb(200,120,95)};var XV=np.default.dirname((0,jR.fileURLToPath)(__importMetaUrl));var ZV=np.default.join(FR.default.homedir(),".9remote","cloudflared.pid");function HR(r,e){let t=r.split(".").map(Number),n=e.split(".").map(Number);for(let i=0;i<3;i++){if(n[i]>t[i])return!0;if(n[i]<t[i])return!1}return!1}var QV=np.default.join(ie.STATE,Fa.lockFile);yn();Lt();bt();xs();var UR=K(qR(),1),Yg=K(require("crypto"),1),{machineIdSync:Y$}=UR.default;async function $R(r=null){let e=r||process.env.MACHINE_ID_SALT||"9remote-salt";try{let t=Y$();return Yg.default.createHash("sha256").update(t+e).digest("hex").substring(0,16)}catch(t){return console.error("Error getting machine ID:",t),Yg.default.randomUUID().replace(/-/g,"").substring(0,16)}}yn();async function WR(r,e){let t=_w(),n=t.workerUrl||"https://9remote.cc";if(!t.permanentKey){le(e,400,"No permanent key set");return}try{let s=await(await po(`${n}/api/temp-key/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:t.permanentKey,expiryMinutes:30})})).json(),o=`${n}/login?k=${s.tempKey}`;vn({oneTimeKey:s.tempKey,oneTimeKeyExpiresAt:s.expiresAt,qrUrl:o}),X(e,{oneTimeKey:s.tempKey,expiresAt:s.expiresAt,qrUrl:o})}catch(i){le(e,500,i.message)}}async function GR(r,e){try{let t=await $R(),{key:n}=NR(t),i=ew();tw(t,n,i?.name||"Default"),vn({permanentKey:n}),X(e,{ok:!0,permanentKey:n})}catch(t){le(e,500,t.message)}}Lt();async function zR(r,e){let t=await Dt(r,e);if(!t)return;let n=DA(t.socketId);X(e,{ok:n})}async function VR(r,e){let t=await Dt(r,e);if(!t)return;let n=BA(t.socketId);X(e,{ok:n})}function KR(r,e){X(e,{pending:CA()})}function YR(r,e){X(e,{devices:SA()})}function JR(r,e){X(e,{rejected:OA()})}async function XR(r,e){let t=await Dt(r,e);if(!t)return;let n=LA(t.deviceId);X(e,{ok:n})}async function ZR(r,e){let t=await Dt(r,e);t&&(Xu(t.deviceId),ro(t.deviceId),X(e))}async function QR(r,e){let t=await Dt(r,e);t&&(Xu(t.deviceId),bA(t.deviceId),X(e))}async function eO(r,e){let t=await Dt(r,e);if(!t)return;let n=Xu(t.deviceId);X(e,{disconnected:n})}function tO(r,e){X(e,{enabled:Ju()})}async function rO(r,e){let t=await Dt(r,e);if(!t)return;let n=wA(t.deviceId,t.label);X(e,{ok:n})}async function nO(r,e){let t=await Dt(r,e);if(!t)return;let n=PA(!!t.enabled);X(e,{enabled:n})}Lt();hi();var iO={},J$=1e4;function sO(r,e){if(e)return{type:e.type||"stop",sessionId:e.sessionId||"",tool:e.tool||"claude"};let t=JSON.parse(r||"{}");return{type:t.type||"stop",sessionId:t.sessionId||"",tool:t.tool||"claude"}}async function oO(r,e){let t="";await new Promise(n=>{r.on("data",i=>t+=i),r.on("end",n)});try{cO(sO(t,null)),X(e,{success:!0})}catch{le(e,400,"Invalid JSON")}}function aO(r,e,{query:t}){cO(sO(null,t)),X(e,{success:!0})}function cO({type:r,sessionId:e,tool:t}){let n=Date.now(),i=Ma();if(!i||!e)return;let s={type:r,sessionId:e,tool:t,timestamp:n};kT(e,s),yt(i,"chatNotification",s);let o=`${e}:${r}`;n-(iO[o]||0)<J$||(iO[o]=n,TT(s))}Lt();Tl();xs();pt();yn();function lO(){return{mode:lh(),active:ch(),presets:Object.keys($.sleepInhibit?.presets||{})}}function uO(r,e){X(e,lO())}async function pO(r,e){let t=await Dt(r,e);if(!t)return;let n=Yo(t.mode);Qb({sleepInhibitMode:n});let i=lO();Et("sleepInhibit",i),X(e,i)}Lt();async function fO(r,e){try{let t=await Dl();X(e,{sessions:t})}catch(t){le(e,500,t.message)}}async function dO(r,e){let t=await Dt(r,e);if(t){if(!t.sessionId)return le(e,400,"sessionId required");try{await mi(t.sessionId),X(e)}catch(n){le(e,500,n.message)}}}var An=K(require("os"),1);pt();Lt();function X$(){let r=IS();if(!r?.activeClients)return{total:0,streaming:0};let e=0;for(let t of r.activeClients.values())t.isStreaming&&e++;return{total:r.activeClients.size,streaming:e}}function Z$(){let r=process.memoryUsage(),e=An.default.cpus();return{agent:{pid:process.pid,version:"2.0.82",nodeVersion:process.version,platform:`${process.platform}/${process.arch}`,uptimeSec:Math.round(process.uptime()),memory:{heapUsedMB:Math.round(r.heapUsed/1048576*10)/10,heapTotalMB:Math.round(r.heapTotal/1048576*10)/10,rssMB:Math.round(r.rss/1048576*10)/10,externalMB:Math.round(r.external/1048576*10)/10}},os:{hostname:An.default.hostname(),platform:An.default.platform(),arch:An.default.arch(),uptimeSec:Math.round(An.default.uptime()),loadAvg:An.default.loadavg(),cpuModel:e?.[0]?.model||"unknown",cpuCount:e.length,totalMemMB:Math.round(An.default.totalmem()/1048576),freeMemMB:Math.round(An.default.freemem()/1048576)},remote:{available:$l(),...X$(),memoryWarningThresholdMB:$.resourceManagement.memoryWarningThreshold},timestamp:Date.now()}}function hO(r,e){try{X(e,Z$())}catch(t){le(e,500,"stats error",t.message)}}Tl();xs();pt();Dv();var Kn=On("server"),Yn=(0,yO.fileURLToPath)(new URL(".",__importMetaUrl)),xO=process.env.NODE_ENV==="development",Q$=5173,Jg=(0,Ii.existsSync)((0,rr.join)(Yn,"ui","dist"))?(0,rr.join)(Yn,"ui","dist"):(0,rr.join)(Yn,"ui"),e4={".html":"text/html",".js":"application/javascript",".css":"text/css",".svg":"image/svg+xml",".png":"image/png",".ico":"image/x-icon",".woff2":"font/woff2",".woff":"font/woff"};function t4(r,e,t){let n=(0,ip.request)({hostname:"localhost",port:Q$,path:r.url,method:r.method,headers:r.headers},i=>{e.writeHead(i.statusCode,i.headers),i.pipe(e)});n.on("error",()=>t?t():void(e.writeHead(502),e.end("Vite dev server not ready"))),r.pipe(n)}function mO(r,e){if(!(0,Ii.existsSync)(e))return!1;let t=e4[(0,rr.extname)(e)]||"application/octet-stream";return r.setHeader("Content-Type",t),r.writeHead(200),r.end((0,Ii.readFileSync)(e)),!0}async function Xg(r){try{let e=await po(Op);if(!e.ok)return;let{version:t}=await e.json();t&&HR(r,t)&&(Sw({version:t}),Et("updateAvailable",{version:t}),XT())}catch{}}var gO=0;function r4(r){let e=Date.now();e-gO<Fa.connectCheckDebounceMs||(gO=e,Xg(r))}function n4(r,e){if(process.env.CODESPACES!=="true"){le(e,400,"Not running on Codespaces");return}let t=process.env.CODESPACE_NAME;if(!t){le(e,400,"Codespace name not found");return}let n=Ma();n&&n.emit("codespace:stopping"),X(e,{success:!0,message:"Stopping codespace..."}),setTimeout(()=>(0,Pi.execFile)("gh",["codespace","stop","-c",t],{windowsHide:!0}),500)}var _O;async function vO(r,e,{pathname:t}){let n=r.headers.authorization;if(!n||!n.startsWith("Bearer ")||!rp(n.slice(7))){le(e,401,"Unauthorized");return}let{parseJsonBody:i}=await Promise.resolve().then(()=>(Lt(),Li)),s=await i(r,e);if(s){if(!s.port){le(e,400,"Port required");return}t.endsWith("start")?SR(s.port):ER(s.port),X(e,{success:!0})}}function i4(r,e,{pathname:t,search:n}){let i=t.match(/^\/proxy\/(\d+)(\/.*)?$/);i?CR(_O,r,e,i[1],i[2]||"/",n):le(e,404,"Not found")}var s4=[{path:"/api/health",method:"GET",public:!0,handler:(r,e)=>X(e,{status:"ok",timestamp:Date.now()})},{path:"/api/version",method:"GET",public:!0,handler:(r,e)=>{X(e,{version:"2.0.82"})}},{path:"/api/notify",method:"POST",public:!0,handler:oO},{path:"/api/notify",method:"GET",public:!0,handler:aO},{path:"/proxy/*",method:"*",public:!0,handler:i4},{path:"/api/ui/events",method:"GET",handler:Ow},{path:"/api/local-token",method:"GET",handler:Cw},{path:"/api/ui/state",method:"GET",handler:Mw},{path:"/api/ui/state",method:"POST",handler:Pw},{path:"/api/ui/stop",method:"POST",handler:Iw},{path:"/api/ui/start",method:"POST",handler:Nw},{path:"/api/ui/stop-tunnel",method:"POST",handler:Dw},{path:"/api/ui/shutdown",method:"POST",handler:Lw},{path:"/api/update",method:"POST",handler:Bw},{path:"/api/system/stats",method:"GET",handler:hO},{path:"/api/key/one-time",method:"POST",handler:WR},{path:"/api/key/regenerate",method:"POST",handler:GR},{path:"/api/device/approve",method:"POST",handler:zR},{path:"/api/device/reject",method:"POST",handler:VR},{path:"/api/device/pending",method:"GET",handler:KR},{path:"/api/device/approved",method:"GET",handler:YR},{path:"/api/device/rejected",method:"GET",handler:JR},{path:"/api/device/approve-rejected",method:"POST",handler:XR},{path:"/api/device/clear-rejected",method:"POST",handler:ZR},{path:"/api/device/remove",method:"POST",handler:QR},{path:"/api/device/label",method:"POST",handler:rO},{path:"/api/device/disconnect",method:"POST",handler:eO},{path:"/api/device/auto-approve",method:"GET",handler:tO},{path:"/api/device/auto-approve",method:"POST",handler:nO},{path:"/api/connections",method:"GET",handler:jw},{path:"/api/logs",method:"GET",handler:Fw},{path:"/api/permissions",method:"GET",handler:qw},{path:"/api/permissions/request",method:"POST",handler:Ww},{path:"/api/desktop/toggle",method:"POST",handler:Hw},{path:"/api/autostart",method:"GET",handler:Uw},{path:"/api/autostart",method:"POST",handler:$w},{path:"/api/sleep-inhibit",method:"GET",handler:uO},{path:"/api/sleep-inhibit",method:"POST",handler:pO},{path:"/api/sessions",method:"GET",handler:fO},{path:"/api/sessions/delete",method:"POST",handler:dO},{path:"/api/local-sites",method:"*",public:!0,handler:DR},{path:"/api/codespace/stop",method:"POST",handler:n4},{path:"/api/proxy/start",method:"POST",public:!0,handler:vO},{path:"/api/proxy/end",method:"POST",public:!0,handler:vO}];var o4=parseInt(process.env.PORT||"2208",10),qa=null;function a4(r){if(process.platform!=="win32")try{let e=(0,Pi.execSync)(`pgrep -f "vite --config ${r}"`,{encoding:"utf8"}).trim();for(let t of e.split(`
|
|
295
|
-
`).filter(Boolean))if((0,
|
|
294
|
+
`);return}e._proxyTargetPort=n,e.url=i+(s||""),r.web(e,t,{target:`http://localhost:${n}`,changeOrigin:!0},o=>{t.writeHead(502),t.end(`Bad Gateway: ${o.message}`)})}var LR=K(require("http"),1),BR=K(require("https"),1),jR=require("child_process"),FR=require("util"),Z$=(0,FR.promisify)(jR.exec);async function Q$(){let r=process.platform,e=new Set([80,443]);try{let t;if(r==="win32")t="netstat -ano | findstr LISTENING";else{let s="/dev/null";t=`lsof -iTCP -sTCP:LISTEN -P -n 2>${s} || netstat -tlnp 2>${s}`}let{stdout:n}=await Z$(t),i=n.split(`
|
|
295
|
+
`);for(let s of i){let o=s.match(/[:\*\]](\d{2,5})(?:\s|$)/g);if(o)for(let a of o){let c=parseInt(a.replace(/[:\*\]\s]/g,""),10);c>0&&c<=65535&&(c===80||c===443||c>=1024)&&e.add(c)}}return Array.from(e)}catch(t){return console.error("Failed to get listening ports:",t.message),[80,443,3e3,3001,4200,5e3,5173,8e3,8080,9e3]}}function e4(r,e=2e3){return new Promise(t=>{let n=LR.default.request({host:"localhost",port:r,method:"GET",path:"/",timeout:e},i=>{i.on("data",()=>{}),i.on("end",()=>{}),t({active:!0,protocol:"http",status:i.statusCode})});n.on("error",i=>{t({active:!1,error:i.message})}),n.on("timeout",()=>{n.destroy(),t({active:!1,error:"timeout"})}),n.end()})}function t4(r,e=2e3){return new Promise(t=>{let n=BR.default.request({host:"localhost",port:r,method:"GET",path:"/",timeout:e,rejectUnauthorized:!1},i=>{i.on("data",()=>{}),i.on("end",()=>{}),t({active:!0,protocol:"https",status:i.statusCode})});n.on("error",i=>{t({active:!1,error:i.message})}),n.on("timeout",()=>{n.destroy(),t({active:!1,error:"timeout"})}),n.end()})}async function r4(r){let[e,t]=await Promise.all([e4(r),t4(r)]);return t.active?{port:r,...t}:e.active?{port:r,...e}:{port:r,active:!1}}async function HR(){let r=await Q$();return(await Promise.all(r.map(t=>r4(t)))).filter(t=>t.active).map(t=>({port:t.port,protocol:t.protocol,url:`${t.protocol}://localhost:${t.port}`,name:`localhost:${t.port}`,status:t.status})).sort((t,n)=>t.port-n.port)}var qR=K(require("crypto"),1),n4=process.env.API_KEY_SECRET||"9remote-api-key-secret";function i4(){let r="abcdefghijklmnopqrstuvwxyz0123456789",e="";for(let t=0;t<4;t++)e+=r.charAt(Math.floor(Math.random()*r.length));return e}function UR(r,e){return qR.default.createHmac("sha256",n4).update(r+e).digest("hex").slice(0,6)}function $R(r){let e=r.slice(0,8),t=i4(),n=UR(e,t);return{key:`sk-${e}-${t}-${n}`,keyId:t}}function s4(r){if(!r||!r.startsWith("sk-"))return null;let e=r.split("-");if(e.length===4){let[,t,n,i]=e,s=UR(t,n);return i!==s?null:{machineId:t,keyId:n}}return null}function ip(r){return s4(r)!==null}async function WR(r,e){let t=r.headers.authorization;if(!t||!t.startsWith("Bearer ")){e.setHeader("Content-Type","application/json"),e.writeHead(401),e.end(JSON.stringify({error:"Unauthorized: Missing API key"}));return}let n=t.slice(7);if(!ip(n)){e.setHeader("Content-Type","application/json"),e.writeHead(401),e.end(JSON.stringify({error:"Unauthorized: Invalid API key"}));return}let i=await HR();e.setHeader("Content-Type","application/json"),e.writeHead(200),e.end(JSON.stringify(i))}hl();var VR=require("url");var sp=K(require("path"),1),KR=K(require("os"),1);bt();var GR=K(require("path"),1),zR=K(require("os"),1);var t5=GR.default.join(zR.default.homedir(),".9remote","pids");oh();var Ha={checkIntervalMs:36e5,connectCheckDebounceMs:9e5,maxRetry:3,retryDelayMs:3e3,verifyTimeoutMs:15e3,lockTtlMs:3e5,lockFile:"update.lock"};var i5={orange:uo.rgb(230,138,110),orangeDim:uo.rgb(200,120,95)};var f5=sp.default.dirname((0,VR.fileURLToPath)(__importMetaUrl));var d5=sp.default.join(KR.default.homedir(),".9remote","cloudflared.pid");function YR(r,e){let t=r.split(".").map(Number),n=e.split(".").map(Number);for(let i=0;i<3;i++){if(n[i]>t[i])return!0;if(n[i]<t[i])return!1}return!1}var h5=sp.default.join(ie.STATE,Ha.lockFile);yn();jt();bt();bs();var XR=K(JR(),1),tv=K(require("crypto"),1),{machineIdSync:o4}=XR.default;async function ZR(r=null){let e=r||process.env.MACHINE_ID_SALT||"9remote-salt";try{let t=o4();return tv.default.createHash("sha256").update(t+e).digest("hex").substring(0,16)}catch(t){return console.error("Error getting machine ID:",t),tv.default.randomUUID().replace(/-/g,"").substring(0,16)}}yn();async function QR(r,e){let t=Cw(),n=t.workerUrl||"https://9remote.cc";if(!t.permanentKey){le(e,400,"No permanent key set");return}try{let s=await(await mo(`${n}/api/temp-key/create`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:t.permanentKey,expiryMinutes:30})})).json(),o=`${n}/login?k=${s.tempKey}`;vn({oneTimeKey:s.tempKey,oneTimeKeyExpiresAt:s.expiresAt,qrUrl:o}),X(e,{oneTimeKey:s.tempKey,expiresAt:s.expiresAt,qrUrl:o})}catch(i){le(e,500,i.message)}}async function eO(r,e){try{let t=await ZR(),{key:n}=$R(t),i=ow();aw(t,n,i?.name||"Default"),vn({permanentKey:n}),X(e,{ok:!0,permanentKey:n})}catch(t){le(e,500,t.message)}}jt();async function tO(r,e){let t=await Bt(r,e);if(!t)return;let n=WA(t.socketId);X(e,{ok:n})}async function rO(r,e){let t=await Bt(r,e);if(!t)return;let n=zA(t.socketId);X(e,{ok:n})}function nO(r,e){X(e,{pending:DA()})}function iO(r,e){X(e,{devices:PA()})}function sO(r,e){X(e,{rejected:FA()})}async function oO(r,e){let t=await Bt(r,e);if(!t)return;let n=GA(t.deviceId);X(e,{ok:n})}async function aO(r,e){let t=await Bt(r,e);t&&(Qu(t.deviceId),so(t.deviceId),X(e))}async function cO(r,e){let t=await Bt(r,e);t&&(Qu(t.deviceId),OA(t.deviceId),X(e))}async function lO(r,e){let t=await Bt(r,e);if(!t)return;let n=Qu(t.deviceId);X(e,{disconnected:n})}function uO(r,e){X(e,{enabled:Zu()})}async function pO(r,e){let t=await Bt(r,e);if(!t)return;let n=MA(t.deviceId,t.label);X(e,{ok:n})}async function fO(r,e){let t=await Bt(r,e);if(!t)return;let n=qA(!!t.enabled);X(e,{enabled:n})}jt();gi();var dO={},a4=1e4;function hO(r,e){if(e)return{type:e.type||"stop",sessionId:e.sessionId||"",tool:e.tool||"claude"};let t=JSON.parse(r||"{}");return{type:t.type||"stop",sessionId:t.sessionId||"",tool:t.tool||"claude"}}async function mO(r,e){let t="";await new Promise(n=>{r.on("data",i=>t+=i),r.on("end",n)});try{vO(hO(t,null)),X(e,{success:!0})}catch{le(e,400,"Invalid JSON")}}function gO(r,e,{query:t}){vO(hO(null,t)),X(e,{success:!0})}function vO({type:r,sessionId:e,tool:t}){let n=Date.now(),i=Pa();if(!i||!e)return;let s={type:r,sessionId:e,tool:t,timestamp:n};LT(e,s),yt(i,"chatNotification",s);let o=`${e}:${r}`;n-(dO[o]||0)<a4||(dO[o]=n,NT(s))}jt();Cl();bs();pt();yn();function yO(){return{mode:fh(),active:ph(),presets:Object.keys($.sleepInhibit?.presets||{})}}function xO(r,e){X(e,yO())}async function _O(r,e){let t=await Bt(r,e);if(!t)return;let n=Zo(t.mode);sw({sleepInhibitMode:n});let i=yO();Tt("sleepInhibit",i),X(e,i)}jt();async function bO(r,e){try{let t=await Ll();X(e,{sessions:t})}catch(t){le(e,500,t.message)}}async function wO(r,e){let t=await Bt(r,e);if(t){if(!t.sessionId)return le(e,400,"sessionId required");try{await vi(t.sessionId),X(e)}catch(n){le(e,500,n.message)}}}var An=K(require("os"),1);pt();jt();function c4(){let r=HS();if(!r?.activeClients)return{total:0,streaming:0};let e=0;for(let t of r.activeClients.values())t.isStreaming&&e++;return{total:r.activeClients.size,streaming:e}}function l4(){let r=process.memoryUsage(),e=An.default.cpus();return{agent:{pid:process.pid,version:"2.1.1",nodeVersion:process.version,platform:`${process.platform}/${process.arch}`,uptimeSec:Math.round(process.uptime()),memory:{heapUsedMB:Math.round(r.heapUsed/1048576*10)/10,heapTotalMB:Math.round(r.heapTotal/1048576*10)/10,rssMB:Math.round(r.rss/1048576*10)/10,externalMB:Math.round(r.external/1048576*10)/10}},os:{hostname:An.default.hostname(),platform:An.default.platform(),arch:An.default.arch(),uptimeSec:Math.round(An.default.uptime()),loadAvg:An.default.loadavg(),cpuModel:e?.[0]?.model||"unknown",cpuCount:e.length,totalMemMB:Math.round(An.default.totalmem()/1048576),freeMemMB:Math.round(An.default.freemem()/1048576)},remote:{available:Wl(),...c4(),memoryWarningThresholdMB:$.resourceManagement.memoryWarningThreshold},timestamp:Date.now()}}function SO(r,e){try{X(e,l4())}catch(t){le(e,500,"stats error",t.message)}}Cl();bs();pt();qv();var Jn=On("server"),Xn=(0,kO.fileURLToPath)(new URL(".",__importMetaUrl)),AO=process.env.NODE_ENV==="development",u4=5173,rv=(0,Di.existsSync)((0,nr.join)(Xn,"ui","dist"))?(0,nr.join)(Xn,"ui","dist"):(0,nr.join)(Xn,"ui"),p4={".html":"text/html",".js":"application/javascript",".css":"text/css",".svg":"image/svg+xml",".png":"image/png",".ico":"image/x-icon",".woff2":"font/woff2",".woff":"font/woff"};function f4(r,e,t){let n=(0,op.request)({hostname:"localhost",port:u4,path:r.url,method:r.method,headers:r.headers},i=>{e.writeHead(i.statusCode,i.headers),i.pipe(e)});n.on("error",()=>t?t():void(e.writeHead(502),e.end("Vite dev server not ready"))),r.pipe(n)}function EO(r,e){if(!(0,Di.existsSync)(e))return!1;let t=p4[(0,nr.extname)(e)]||"application/octet-stream";return r.setHeader("Content-Type",t),r.writeHead(200),r.end((0,Di.readFileSync)(e)),!0}async function nv(r){try{let e=await mo(Pp);if(!e.ok)return;let{version:t}=await e.json();t&&YR(r,t)&&(Rw({version:t}),Tt("updateAvailable",{version:t}),oC())}catch{}}var TO=0;function d4(r){let e=Date.now();e-TO<Ha.connectCheckDebounceMs||(TO=e,nv(r))}function h4(r,e){if(process.env.CODESPACES!=="true"){le(e,400,"Not running on Codespaces");return}let t=process.env.CODESPACE_NAME;if(!t){le(e,400,"Codespace name not found");return}let n=Pa();n&&n.emit("codespace:stopping"),X(e,{success:!0,message:"Stopping codespace..."}),setTimeout(()=>(0,Ni.execFile)("gh",["codespace","stop","-c",t],{windowsHide:!0}),500)}var RO;async function CO(r,e,{pathname:t}){let n=r.headers.authorization;if(!n||!n.startsWith("Bearer ")||!ip(n.slice(7))){le(e,401,"Unauthorized");return}let{parseJsonBody:i}=await Promise.resolve().then(()=>(jt(),ji)),s=await i(r,e);if(s){if(!s.port){le(e,400,"Port required");return}t.endsWith("start")?PR(s.port):IR(s.port),X(e,{success:!0})}}function m4(r,e,{pathname:t,search:n}){let i=t.match(/^\/proxy\/(\d+)(\/.*)?$/);i?DR(RO,r,e,i[1],i[2]||"/",n):le(e,404,"Not found")}var g4=[{path:"/api/health",method:"GET",public:!0,handler:(r,e)=>X(e,{status:"ok",timestamp:Date.now()})},{path:"/api/version",method:"GET",public:!0,handler:(r,e)=>{X(e,{version:"2.1.1"})}},{path:"/api/notify",method:"POST",public:!0,handler:mO},{path:"/api/notify",method:"GET",public:!0,handler:gO},{path:"/proxy/*",method:"*",public:!0,handler:m4},{path:"/api/ui/events",method:"GET",handler:Lw},{path:"/api/local-token",method:"GET",handler:Pw},{path:"/api/ui/state",method:"GET",handler:Bw},{path:"/api/ui/state",method:"POST",handler:jw},{path:"/api/ui/stop",method:"POST",handler:Fw},{path:"/api/ui/start",method:"POST",handler:Hw},{path:"/api/ui/stop-tunnel",method:"POST",handler:qw},{path:"/api/ui/shutdown",method:"POST",handler:Uw},{path:"/api/update",method:"POST",handler:$w},{path:"/api/system/stats",method:"GET",handler:SO},{path:"/api/key/one-time",method:"POST",handler:QR},{path:"/api/key/regenerate",method:"POST",handler:eO},{path:"/api/device/approve",method:"POST",handler:tO},{path:"/api/device/reject",method:"POST",handler:rO},{path:"/api/device/pending",method:"GET",handler:nO},{path:"/api/device/approved",method:"GET",handler:iO},{path:"/api/device/rejected",method:"GET",handler:sO},{path:"/api/device/approve-rejected",method:"POST",handler:oO},{path:"/api/device/clear-rejected",method:"POST",handler:aO},{path:"/api/device/remove",method:"POST",handler:cO},{path:"/api/device/label",method:"POST",handler:pO},{path:"/api/device/disconnect",method:"POST",handler:lO},{path:"/api/device/auto-approve",method:"GET",handler:uO},{path:"/api/device/auto-approve",method:"POST",handler:fO},{path:"/api/connections",method:"GET",handler:Ww},{path:"/api/logs",method:"GET",handler:Gw},{path:"/api/permissions",method:"GET",handler:Vw},{path:"/api/permissions/request",method:"POST",handler:Jw},{path:"/api/desktop/toggle",method:"POST",handler:zw},{path:"/api/autostart",method:"GET",handler:Kw},{path:"/api/autostart",method:"POST",handler:Yw},{path:"/api/sleep-inhibit",method:"GET",handler:xO},{path:"/api/sleep-inhibit",method:"POST",handler:_O},{path:"/api/sessions",method:"GET",handler:bO},{path:"/api/sessions/delete",method:"POST",handler:wO},{path:"/api/local-sites",method:"*",public:!0,handler:WR},{path:"/api/codespace/stop",method:"POST",handler:h4},{path:"/api/proxy/start",method:"POST",public:!0,handler:CO},{path:"/api/proxy/end",method:"POST",public:!0,handler:CO}];var v4=parseInt(process.env.PORT||"2208",10),Ua=null;function y4(r){if(process.platform!=="win32")try{let e=(0,Ni.execSync)(`pgrep -f "vite --config ${r}"`,{encoding:"utf8"}).trim();for(let t of e.split(`
|
|
296
|
+
`).filter(Boolean))if((0,Ni.execSync)(`ps -o ppid= -p ${t}`,{encoding:"utf8"}).trim()==="1")try{process.kill(Number(t))}catch{}}catch{}}function x4(){if(!AO)return;let r=(0,nr.join)(Xn,"vite.config.js");if(!(0,Di.existsSync)(r))return;y4(r);let e=(0,Di.existsSync)((0,nr.join)(Xn,"node_modules",".bin","vite"))?(0,nr.join)(Xn,"node_modules",".bin","vite"):(0,nr.join)(Xn,"..","node_modules",".bin","vite");Ua=(0,Ni.spawn)("node",[e,"--config",r],{cwd:Xn,stdio:"ignore",detached:!1}),Ua.on("error",()=>{}),Ua.unref()}async function OO(){let r=nh(),e=r.sleepInhibitMode;e||(r.sleepInhibit===!1?e="never":e=$.sleepInhibit?.defaultMode||"never"),Zo(e),await sC(),RO=NR(),x4();let n=Op(g4,{fallback:(a,c,{pathname:l})=>{if(l.startsWith("/api/")||l.startsWith("/socket.io")){le(c,404,"Not found");return}let u=!!a.headers["cf-connecting-ip"],f=a.socket.remoteAddress==="127.0.0.1"||a.socket.remoteAddress==="::1";if(u||!f){le(c,403,"Forbidden");return}let h=()=>{let g=l==="/"||l===""?(0,nr.join)(rv,"index.html"):(0,nr.join)(rv,l);EO(c,g)||EO(c,(0,nr.join)(rv,"index.html"))};if(AO){f4(a,c,h);return}h()}}),i=(0,op.createServer)(async(a,c)=>{KA(c),!YA(a,c)&&await n(a,c)});Xd(),Ew(),Tw(),Rl(),process.platform==="darwin"&&setInterval(Rl,Nv),await VA(i),i.listen(v4,a=>{if(a)throw a;let c="2.1.1";nv(c),setInterval(()=>nv(c),Ha.checkIntervalMs),cC(()=>d4(c))});let s=!1,o=async a=>{if(s)return;s=!0,uh(),Jn.info(`\u{1F6D1} Received ${a}, shutting down gracefully...`);let c=setTimeout(()=>{Jn.error("\u26A0\uFE0F Forced exit"),process.exit(1)},5e3);try{if(i.close(()=>Jn.info("\u2713 HTTP server closed")),Ua)try{Ua.kill()}catch{}let l=Pa();l&&(l.emit("server:shutdown"),l.close(()=>Jn.info("\u2713 Socket.IO closed"))),await new Promise(u=>setTimeout(u,500)),clearTimeout(c),Jn.info("\u2705 Server stopped cleanly"),process.exit(0)}catch(l){Jn.error(`\u274C Error during shutdown: ${l?.message||l}`),clearTimeout(c),process.exit(1)}};return process.on("SIGINT",()=>o("SIGINT")),process.on("SIGTERM",()=>o("SIGTERM")),process.platform==="win32"&&process.on("SIGBREAK",()=>o("SIGBREAK")),process.on("uncaughtException",a=>{Jn.error(`\u26A0\uFE0F uncaughtException: ${a?.stack||a}`)}),process.on("unhandledRejection",a=>{Jn.error(`\u26A0\uFE0F unhandledRejection: ${a?.stack||a}`)}),i}OO();0&&(module.exports={startServer});
|
|
296
297
|
/*! Bundled license information:
|
|
297
298
|
|
|
298
299
|
negotiator/index.js:
|