9remote 2.0.22 → 2.0.26
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/cli.cjs +86 -55
- package/dist/ptyDaemon.cjs +7 -7
- package/dist/server.cjs +76 -71
- package/dist/ui/assets/index-BZm3GUhX.js +47 -0
- package/dist/ui/assets/index-UgZubVKT.css +32 -0
- package/dist/ui/index.html +2 -2
- package/package.json +6 -3
- package/dist/ui/assets/index-D646KQwB.css +0 -1
- package/dist/ui/assets/index-K-xvZBoY.js +0 -8
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 En(r){return{info:(...e)=>Zs(r,"info",op(e)),warn:(...e)=>Zs(r,"warn",op(e)),error:(...e)=>Zs(r,"error",op(e))}}var Nr,cp,Oa,Pa,Ma,fv,ap,AO,RO,Ri=st(()=>{Nr=X(require("fs"),1),cp=X(require("path"),1);gt();Oa=oe.LOGS,Pa=cp.default.join(Oa,Js.fileName),Ma=cp.default.join(Oa,Js.rotatedName),fv=!1,ap=null;AO=/\x1b\[[0-9;]*m/g,RO=/https?:\/\/[^\s]+/g});var _v=O((p4,up)=>{"use strict";up.exports=yv;up.exports.preferredCharsets=yv;var PO=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function MO(r){for(var e=r.split(","),t=0,n=0;t<e.length;t++){var i=IO(e[t].trim(),t);i&&(e[n++]=i)}return e.length=n,e}function IO(r,e){var t=PO.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 NO(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=LO(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function LO(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 yv(r,e){var t=MO(r===void 0?"*":r||"");if(!e)return t.filter(xv).sort(vv).map(DO);var n=e.map(function(s,o){return NO(s,t,o)});return n.filter(xv).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 DO(r){return r.charset}function xv(r){return r.q>0}});var Tv=O((f4,pp)=>{"use strict";pp.exports=Ev;pp.exports.preferredEncodings=Ev;var BO=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function jO(r){for(var e=r.split(","),t=!1,n=1,i=0,s=0;i<e.length;i++){var o=FO(e[i].trim(),i);o&&(e[s++]=o,t=t||Sv("identity",o),n=Math.min(n,o.q||1))}return t||(e[s++]={encoding:"identity",q:n,i}),e.length=s,e}function FO(r,e){var t=BO.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 HO(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=Sv(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function Sv(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 Ev(r,e){var t=jO(r||"");if(!e)return t.filter(wv).sort(bv).map($O);var n=e.map(function(s,o){return HO(s,t,o)});return n.filter(wv).sort(bv).map(function(s){return e[n.indexOf(s)]})}function bv(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function $O(r){return r.encoding}function wv(r){return r.q>0}});var Ov=O((d4,fp)=>{"use strict";fp.exports=kv;fp.exports.preferredLanguages=kv;var qO=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function UO(r){for(var e=r.split(","),t=0,n=0;t<e.length;t++){var i=Rv(e[t].trim(),t);i&&(e[n++]=i)}return e.length=n,e}function Rv(r,e){var t=qO.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 u=a[c].split("=");u[0]==="q"&&(o=parseFloat(u[1]))}return{prefix:n,suffix:i,q:o,i:e,full:s}}function WO(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=GO(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function GO(r,e,t){var n=Rv(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 kv(r,e){var t=UO(r===void 0?"*":r||"");if(!e)return t.filter(Av).sort(Cv).map(zO);var n=e.map(function(s,o){return WO(s,t,o)});return n.filter(Av).sort(Cv).map(function(s){return e[n.indexOf(s)]})}function Cv(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function zO(r){return r.full}function Av(r){return r.q>0}});var Dv=O((h4,dp)=>{"use strict";dp.exports=Nv;dp.exports.preferredMediaTypes=Nv;var KO=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function VO(r){for(var e=ZO(r),t=0,n=0;t<e.length;t++){var i=Iv(e[t].trim(),t);i&&(e[n++]=i)}return e.length=n,e}function Iv(r,e){var t=KO.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=eP(t[3]).map(QO),c=0;c<a.length;c++){var u=a[c],p=u[0].toLowerCase(),f=u[1],g=f&&f[0]==='"'&&f[f.length-1]==='"'?f.substr(1,f.length-2):f;if(p==="q"){i=parseFloat(g);break}n[p]=g}return{type:o,subtype:s,params:n,q:i,i:e}}function YO(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=XO(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function XO(r,e,t){var n=Iv(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 Nv(r,e){var t=VO(r===void 0?"*/*":r||"");if(!e)return t.filter(Mv).sort(Pv).map(JO);var n=e.map(function(s,o){return YO(s,t,o)});return n.filter(Mv).sort(Pv).map(function(s){return e[n.indexOf(s)]})}function Pv(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function JO(r){return r.type+"/"+r.subtype}function Mv(r){return r.q>0}function Lv(r){for(var e=0,t=0;(t=r.indexOf('"',t))!==-1;)e++,t++;return e}function QO(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 ZO(r){for(var e=r.split(","),t=1,n=0;t<e.length;t++)Lv(e[n])%2==0?e[++n]=e[t]:e[n]+=","+e[t];return e.length=n+1,e}function eP(r){for(var e=r.split(";"),t=1,n=0;t<e.length;t++)Lv(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 Bv=O((m4,hp)=>{"use strict";var tP=_v(),rP=Tv(),nP=Ov(),iP=Dv();hp.exports=ce;hp.exports.Negotiator=ce;function ce(r){if(!(this instanceof ce))return new ce(r);this.request=r}ce.prototype.charset=function(e){var t=this.charsets(e);return t&&t[0]};ce.prototype.charsets=function(e){return tP(this.request.headers["accept-charset"],e)};ce.prototype.encoding=function(e){var t=this.encodings(e);return t&&t[0]};ce.prototype.encodings=function(e){return rP(this.request.headers["accept-encoding"],e)};ce.prototype.language=function(e){var t=this.languages(e);return t&&t[0]};ce.prototype.languages=function(e){return nP(this.request.headers["accept-language"],e)};ce.prototype.mediaType=function(e){var t=this.mediaTypes(e);return t&&t[0]};ce.prototype.mediaTypes=function(e){return iP(this.request.headers.accept,e)};ce.prototype.preferredCharset=ce.prototype.charset;ce.prototype.preferredCharsets=ce.prototype.charsets;ce.prototype.preferredEncoding=ce.prototype.encoding;ce.prototype.preferredEncodings=ce.prototype.encodings;ce.prototype.preferredLanguage=ce.prototype.language;ce.prototype.preferredLanguages=ce.prototype.languages;ce.prototype.preferredMediaType=ce.prototype.mediaType;ce.prototype.preferredMediaTypes=ce.prototype.mediaTypes});var jv=O((g4,sP)=>{sP.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 Hv=O((v4,Fv)=>{Fv.exports=jv()});var Uv=O(Pt=>{"use strict";var Ia=Hv(),oP=require("path").extname,$v=/^\s*([^;\s]*)(?:;|\s|$)/,aP=/^text\//i;Pt.charset=qv;Pt.charsets={lookup:qv};Pt.contentType=cP;Pt.extension=lP;Pt.extensions=Object.create(null);Pt.lookup=uP;Pt.types=Object.create(null);pP(Pt.extensions,Pt.types);function qv(r){if(!r||typeof r!="string")return!1;var e=$v.exec(r),t=e&&Ia[e[1].toLowerCase()];return t&&t.charset?t.charset:e&&aP.test(e[1])?"UTF-8":!1}function cP(r){if(!r||typeof r!="string")return!1;var e=r.indexOf("/")===-1?Pt.lookup(r):r;if(!e)return!1;if(e.indexOf("charset")===-1){var t=Pt.charset(e);t&&(e+="; charset="+t.toLowerCase())}return e}function lP(r){if(!r||typeof r!="string")return!1;var e=$v.exec(r),t=e&&Pt.extensions[e[1].toLowerCase()];return!t||!t.length?!1:t[0]}function uP(r){if(!r||typeof r!="string")return!1;var e=oP("x."+r).toLowerCase().substr(1);return e&&Pt.types[e]||!1}function pP(r,e){var t=["nginx","apache",void 0,"iana"];Object.keys(Ia).forEach(function(i){var s=Ia[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 u=t.indexOf(Ia[e[c]].source),p=t.indexOf(s.source);if(e[c]!=="application/octet-stream"&&(u>p||u===p&&e[c].substr(0,12)==="application/"))continue}e[c]=i}}})}});var Na=O((y4,Wv)=>{"use strict";var fP=Bv(),dP=Uv();Wv.exports=qt;function qt(r){if(!(this instanceof qt))return new qt(r);this.headers=r.headers,this.negotiator=new fP(r)}qt.prototype.type=qt.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(hP),i=this.negotiator.mediaTypes(n.filter(mP)),s=i[0];return s?e[n.indexOf(s)]:!1};qt.prototype.encoding=qt.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};qt.prototype.charset=qt.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};qt.prototype.lang=qt.prototype.langs=qt.prototype.language=qt.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 hP(r){return r.indexOf("/")===-1?dP.lookup(r):r}function mP(r){return typeof r=="string"}});var gp=O((Gv,zv)=>{var eo=require("crypto"),mp=function(){};mp.prototype.getRandomBytes=function(r){var e=4096,t=this;if(r=r||12,r>e)return eo.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,eo.randomBytes(e,function(o,a){t.bytesBuffer=a,t.bytesBufferIndex=0,t.isGeneratingBytes=!1})),this.bytesBufferIndex==-1)))return eo.randomBytes(r);var s=this.bytesBuffer.slice(r*this.bytesBufferIndex,r*(this.bytesBufferIndex+1));return this.bytesBufferIndex++,s};mp.prototype.generateId=function(){var r=Buffer.alloc(15);return r.writeInt32BE?(this.sequenceNumber=this.sequenceNumber+1|0,r.writeInt32BE(this.sequenceNumber,11),eo.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()};Gv=zv.exports=new mp});var La=O(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.ERROR_PACKET=Tn.PACKET_TYPES_REVERSE=Tn.PACKET_TYPES=void 0;var Lr=Object.create(null);Tn.PACKET_TYPES=Lr;Lr.open="0";Lr.close="1";Lr.ping="2";Lr.pong="3";Lr.message="4";Lr.upgrade="5";Lr.noop="6";var Kv=Object.create(null);Tn.PACKET_TYPES_REVERSE=Kv;Object.keys(Lr).forEach(r=>{Kv[Lr[r]]=r});var gP={type:"error",data:"parser error"};Tn.ERROR_PACKET=gP});var Yv=O(ki=>{"use strict";Object.defineProperty(ki,"__esModule",{value:!0});ki.encodePacket=void 0;ki.encodePacketToBinary=yP;var vP=La(),xP=({type:r,data:e},t,n)=>e instanceof ArrayBuffer||ArrayBuffer.isView(e)?n(t?e:"b"+Vv(e,!0).toString("base64")):n(vP.PACKET_TYPES[r]+(e||""));ki.encodePacket=xP;var Vv=(r,e)=>Buffer.isBuffer(r)||r instanceof Uint8Array&&!e?r:r instanceof ArrayBuffer?Buffer.from(r):Buffer.from(r.buffer,r.byteOffset,r.byteLength),vp;function yP(r,e){if(r.data instanceof ArrayBuffer||ArrayBuffer.isView(r.data))return e(Vv(r.data,!1));(0,ki.encodePacket)(r,!0,t=>{vp||(vp=new TextEncoder),e(vp.encode(t))})}});var Jv=O(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.decodePacket=void 0;var Da=La(),_P=(r,e)=>{if(typeof r!="string")return{type:"message",data:Xv(r,e)};let t=r.charAt(0);if(t==="b"){let n=Buffer.from(r.substring(1),"base64");return{type:"message",data:Xv(n,e)}}return Da.PACKET_TYPES_REVERSE[t]?r.length>1?{type:Da.PACKET_TYPES_REVERSE[t],data:r.substring(1)}:{type:Da.PACKET_TYPES_REVERSE[t]}:Da.ERROR_PACKET};Ba.decodePacket=_P;var Xv=(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 to=O(Mt=>{"use strict";Object.defineProperty(Mt,"__esModule",{value:!0});Mt.decodePayload=Mt.decodePacket=Mt.encodePayload=Mt.encodePacket=Mt.protocol=void 0;Mt.createPacketEncoderStream=SP;Mt.createPacketDecoderStream=EP;var yp=Yv();Object.defineProperty(Mt,"encodePacket",{enumerable:!0,get:function(){return yp.encodePacket}});var _p=Jv();Object.defineProperty(Mt,"decodePacket",{enumerable:!0,get:function(){return _p.decodePacket}});var Qv=La(),Zv="",bP=(r,e)=>{let t=r.length,n=new Array(t),i=0;r.forEach((s,o)=>{(0,yp.encodePacket)(s,!1,a=>{n[o]=a,++i===t&&e(n.join(Zv))})})};Mt.encodePayload=bP;var wP=(r,e)=>{let t=r.split(Zv),n=[];for(let i=0;i<t.length;i++){let s=(0,_p.decodePacket)(t[i],e);if(n.push(s),s.type==="error")break}return n};Mt.decodePayload=wP;function SP(){return new TransformStream({transform(r,e){(0,yp.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 xp;function ja(r){return r.reduce((e,t)=>e+t.length,0)}function Fa(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 EP(r,e){xp||(xp=new TextDecoder);let t=[],n=0,i=-1,s=!1;return new TransformStream({transform(o,a){for(t.push(o);;){if(n===0){if(ja(t)<1)break;let c=Fa(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(ja(t)<2)break;let c=Fa(t,2);i=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),n=3}else if(n===2){if(ja(t)<8)break;let c=Fa(t,8),u=new DataView(c.buffer,c.byteOffset,c.length),p=u.getUint32(0);if(p>Math.pow(2,21)-1){a.enqueue(Qv.ERROR_PACKET);break}i=p*Math.pow(2,32)+u.getUint32(4),n=3}else{if(ja(t)<i)break;let c=Fa(t,i);a.enqueue((0,_p.decodePacket)(s?c:xp.decode(c),e)),n=0}if(i===0||i>r){a.enqueue(Qv.ERROR_PACKET);break}}}})}Mt.protocol=4});var nx=O((E4,rx)=>{var Cn=String.fromCharCode;function ex(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 TP(r){for(var e=r.length,t=-1,n,i="";++t<e;)n=r[t],n>65535&&(n-=65536,i+=Cn(n>>>10&1023|55296),n=56320|n&1023),i+=Cn(n);return i}function tx(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 bp(r,e){return Cn(r>>e&63|128)}function CP(r,e){if((r&4294967168)==0)return Cn(r);var t="";return(r&4294965248)==0?t=Cn(r>>6&31|192):(r&4294901760)==0?(tx(r,e)||(r=65533),t=Cn(r>>12&15|224),t+=bp(r,6)):(r&4292870144)==0&&(t=Cn(r>>18&7|240),t+=bp(r,12),t+=bp(r,6)),t+=Cn(r&63|128),t}function AP(r,e){e=e||{};for(var t=e.strict!==!1,n=ex(r),i=n.length,s=-1,o,a="";++s<i;)o=n[s],a+=CP(o,t);return a}function Oi(){if(An>=$a)throw Error("Invalid byte index");var r=Ha[An]&255;if(An++,(r&192)==128)return r&63;throw Error("Invalid continuation byte")}function RP(r){var e,t,n,i,s;if(An>$a)throw Error("Invalid byte index");if(An==$a)return!1;if(e=Ha[An]&255,An++,(e&128)==0)return e;if((e&224)==192){if(t=Oi(),s=(e&31)<<6|t,s>=128)return s;throw Error("Invalid continuation byte")}if((e&240)==224){if(t=Oi(),n=Oi(),s=(e&15)<<12|t<<6|n,s>=2048)return tx(s,r)?s:65533;throw Error("Invalid continuation byte")}if((e&248)==240&&(t=Oi(),n=Oi(),i=Oi(),s=(e&7)<<18|t<<12|n<<6|i,s>=65536&&s<=1114111))return s;throw Error("Invalid UTF-8 detected")}var Ha,$a,An;function kP(r,e){e=e||{};var t=e.strict!==!1;Ha=ex(r),$a=Ha.length,An=0;for(var n=[],i;(i=RP(t))!==!1;)n.push(i);return TP(n)}rx.exports={version:"2.1.2",encode:AP,decode:kP}});var px=O(ot=>{"use strict";Object.defineProperty(ot,"__esModule",{value:!0});ot.packets=ot.protocol=void 0;ot.encodePacket=wp;ot.encodeBase64Packet=ox;ot.decodePacket=Sp;ot.decodeBase64Packet=ax;ot.encodePayload=IP;ot.decodePayload=LP;ot.encodePayloadAsBinary=lx;ot.decodePayloadAsBinary=ux;var sx=nx();ot.protocol=3;var OP=r=>{for(let e of r)if(e.data instanceof ArrayBuffer||ArrayBuffer.isView(e.data))return!0;return!1};ot.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6};var Pi=Object.keys(ot.packets),br={type:"error",data:"parser error"},PP=Buffer.concat([]);function wp(r,e,t,n){if(typeof e=="function"&&(n=e,e=null),typeof t=="function"&&(n=t,t=null),Buffer.isBuffer(r.data))return ix(r,e,n);if(r.data&&(r.data.buffer||r.data)instanceof ArrayBuffer)return ix({type:r.type,data:Ep(r.data)},e,n);var i=ot.packets[r.type];return r.data!==void 0&&(i+=t?sx.encode(String(r.data),{strict:!1}):String(r.data)),n(""+i)}function ix(r,e,t){if(!e)return ox(r,t);var n=r.data,i=Buffer.allocUnsafe(1);return i[0]=ot.packets[r.type],t(Buffer.concat([i,n]))}function ox(r,e){var t=Buffer.isBuffer(r.data)?r.data:Ep(r.data),n="b"+ot.packets[r.type];return n+=t.toString("base64"),e(n)}function Sp(r,e,t){if(r===void 0)return br;let n;if(typeof r=="string")return n=r.charAt(0),n==="b"?ax(r.slice(1),e):t&&(r=MP(r),r===!1)||Number(n)!=n||!Pi[n]?br:r.length>1?{type:Pi[n],data:r.slice(1)}:{type:Pi[n]};if(e==="arraybuffer"){var i=new Uint8Array(r);return n=i[0],{type:Pi[n],data:i.buffer.slice(1)}}return r instanceof ArrayBuffer&&(r=Ep(r)),n=r[0],{type:Pi[n],data:r.slice(1)}}function MP(r){try{r=sx.decode(r,{strict:!1})}catch{return!1}return r}function ax(r,e){var t=Pi[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 IP(r,e,t){if(typeof e=="function"&&(t=e,e=null),e&&OP(r))return lx(r,t);if(!r.length)return t("0:");function n(i,s){wp(i,e,!1,function(o){s(null,NP(o))})}cx(r,n,function(i,s){return t(s.join(""))})}function NP(r){return r.length+":"+r}function cx(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 LP(r,e,t){if(typeof r!="string")return ux(r,e,t);if(typeof e=="function"&&(t=e,e=null),r==="")return t(br,0,1);for(var n="",i,s,o,a=0,c=r.length;a<c;a++){var u=r.charAt(a);if(u!==":"){n+=u;continue}if(n===""||n!=(i=Number(n))||(s=r.slice(a+1,a+1+i),n!=s.length))return t(br,0,1);if(s.length){if(o=Sp(s,e,!1),br.type===o.type&&br.data===o.data)return t(br,0,1);var p=t(o,a+i,c);if(p===!1)return}a+=i,n=""}if(n!=="")return t(br,0,1)}function DP(r){for(var e="",t=0,n=r.length;t<n;t++)e+=String.fromCharCode(r[t]);return e}function BP(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 Ep(r){var e=r.byteLength||r.length,t=r.byteOffset||0;return Buffer.from(r.buffer||r,t,e)}function lx(r,e){if(!r.length)return e(PP);cx(r,jP,function(t,n){return e(Buffer.concat(n))})}function jP(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,BP(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]))}wp(r,!0,!0,t)}function ux(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(br,0,1);o+=""+n[s]}n=n.slice(o.length+1);var c=parseInt(o,10),u=n.slice(1,c+1);a&&(u=DP(u)),i.push(u),n=n.slice(c+1)}var p=i.length;for(s=0;s<p;s++){var f=i[s];t(Sp(f,e,!0),s,p)}}});var dx=O((C4,fx)=>{var Mi=1e3,Ii=Mi*60,Ni=Ii*60,Gn=Ni*24,FP=Gn*7,HP=Gn*365.25;fx.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return $P(r);if(t==="number"&&isFinite(r))return e.long?UP(r):qP(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function $P(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*HP;case"weeks":case"week":case"w":return t*FP;case"days":case"day":case"d":return t*Gn;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Ni;case"minutes":case"minute":case"mins":case"min":case"m":return t*Ii;case"seconds":case"second":case"secs":case"sec":case"s":return t*Mi;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function qP(r){var e=Math.abs(r);return e>=Gn?Math.round(r/Gn)+"d":e>=Ni?Math.round(r/Ni)+"h":e>=Ii?Math.round(r/Ii)+"m":e>=Mi?Math.round(r/Mi)+"s":r+"ms"}function UP(r){var e=Math.abs(r);return e>=Gn?qa(r,e,Gn,"day"):e>=Ni?qa(r,e,Ni,"hour"):e>=Ii?qa(r,e,Ii,"minute"):e>=Mi?qa(r,e,Mi,"second"):r+" ms"}function qa(r,e,t,n){var i=e>=t*1.5;return Math.round(r/t)+" "+n+(i?"s":"")}});var Tp=O((A4,hx)=>{function WP(r){t.debug=t,t.default=t,t.coerce=c,t.disable=o,t.enable=i,t.enabled=a,t.humanize=dx(),t.destroy=u,Object.keys(r).forEach(p=>{t[p]=r[p]}),t.names=[],t.skips=[],t.formatters={};function e(p){let f=0;for(let g=0;g<p.length;g++)f=(f<<5)-f+p.charCodeAt(g),f|=0;return t.colors[Math.abs(f)%t.colors.length]}t.selectColor=e;function t(p){let f,g=null,y,b;function S(...R){if(!S.enabled)return;let I=S,L=Number(new Date),N=L-(f||L);I.diff=N,I.prev=f,I.curr=L,f=L,R[0]=t.coerce(R[0]),typeof R[0]!="string"&&R.unshift("%O");let H=0;R[0]=R[0].replace(/%([a-zA-Z%])/g,(U,G)=>{if(U==="%%")return"%";H++;let P=t.formatters[G];if(typeof P=="function"){let F=R[H];U=P.call(I,F),R.splice(H,1),H--}return U}),t.formatArgs.call(I,R),(I.log||t.log).apply(I,R)}return S.namespace=p,S.useColors=t.useColors(),S.color=t.selectColor(p),S.extend=n,S.destroy=t.destroy,Object.defineProperty(S,"enabled",{enumerable:!0,configurable:!1,get:()=>g!==null?g:(y!==t.namespaces&&(y=t.namespaces,b=t.enabled(p)),b),set:R=>{g=R}}),typeof t.init=="function"&&t.init(S),S}function n(p,f){let g=t(this.namespace+(typeof f>"u"?":":f)+p);return g.log=this.log,g}function i(p){t.save(p),t.namespaces=p,t.names=[],t.skips=[];let f=(typeof p=="string"?p:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let g of f)g[0]==="-"?t.skips.push(g.slice(1)):t.names.push(g)}function s(p,f){let g=0,y=0,b=-1,S=0;for(;g<p.length;)if(y<f.length&&(f[y]===p[g]||f[y]==="*"))f[y]==="*"?(b=y,S=g,y++):(g++,y++);else if(b!==-1)y=b+1,S++,g=S;else return!1;for(;y<f.length&&f[y]==="*";)y++;return y===f.length}function o(){let p=[...t.names,...t.skips.map(f=>"-"+f)].join(",");return t.enable(""),p}function a(p){for(let f of t.skips)if(s(p,f))return!1;for(let f of t.names)if(s(p,f))return!0;return!1}function c(p){return p instanceof Error?p.stack||p.message:p}function u(){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}hx.exports=WP});var mx=O((It,Ua)=>{It.formatArgs=zP;It.save=KP;It.load=VP;It.useColors=GP;It.storage=YP();It.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`."))}})();It.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 GP(){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 zP(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+Ua.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)}It.log=console.debug||console.log||(()=>{});function KP(r){try{r?It.storage.setItem("debug",r):It.storage.removeItem("debug")}catch{}}function VP(){let r;try{r=It.storage.getItem("debug")||It.storage.getItem("DEBUG")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function YP(){try{return localStorage}catch{}}Ua.exports=Tp()(It);var{formatters:XP}=Ua.exports;XP.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var vx=O((R4,gx)=>{"use strict";gx.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 _x=O((k4,yx)=>{"use strict";var JP=require("os"),xx=require("tty"),tr=vx(),{env:at}=process,Rn;tr("no-color")||tr("no-colors")||tr("color=false")||tr("color=never")?Rn=0:(tr("color")||tr("colors")||tr("color=true")||tr("color=always"))&&(Rn=1);"FORCE_COLOR"in at&&(at.FORCE_COLOR==="true"?Rn=1:at.FORCE_COLOR==="false"?Rn=0:Rn=at.FORCE_COLOR.length===0?1:Math.min(parseInt(at.FORCE_COLOR,10),3));function Cp(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function Ap(r,e){if(Rn===0)return 0;if(tr("color=16m")||tr("color=full")||tr("color=truecolor"))return 3;if(tr("color=256"))return 2;if(r&&!e&&Rn===void 0)return 0;let t=Rn||0;if(at.TERM==="dumb")return t;if(process.platform==="win32"){let n=JP.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in at)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in at)||at.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in at)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(at.TEAMCITY_VERSION)?1:0;if(at.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in at){let n=parseInt((at.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(at.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(at.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(at.TERM)||"COLORTERM"in at?1:t}function QP(r){let e=Ap(r,r&&r.isTTY);return Cp(e)}yx.exports={supportsColor:QP,stdout:Cp(Ap(!0,xx.isatty(1))),stderr:Cp(Ap(!0,xx.isatty(2)))}});var wx=O((ct,Ga)=>{var ZP=require("tty"),Wa=require("util");ct.init=oM;ct.log=nM;ct.formatArgs=tM;ct.save=iM;ct.load=sM;ct.useColors=eM;ct.destroy=Wa.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");ct.colors=[6,2,3,4,5,1];try{let r=_x();r&&(r.stderr||r).level>=2&&(ct.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{}ct.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 eM(){return"colors"in ct.inspectOpts?!!ct.inspectOpts.colors:ZP.isatty(process.stderr.fd)}function tM(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 TO=Object.create;var ka=Object.defineProperty;var CO=Object.getOwnPropertyDescriptor;var AO=Object.getOwnPropertyNames;var RO=Object.getPrototypeOf,kO=Object.prototype.hasOwnProperty;var Te=(r,e)=>()=>(r&&(e=r(r=0)),e);var O=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),Xr=(r,e)=>{for(var t in e)ka(r,t,{get:e[t],enumerable:!0})},ov=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of AO(e))!kO.call(r,i)&&i!==t&&ka(r,i,{get:()=>e[i],enumerable:!(n=CO(e,i))||n.enumerable});return r};var X=(r,e,t)=>(t=r!=null?TO(RO(r)):{},ov(e||!r||!r.__esModule?ka(t,"default",{value:r,enumerable:!0}):t,r)),OO=r=>ov(ka({},"__esModule",{value:!0}),r);var ki={};Xr(ki,{createRouter:()=>vp,jsonErr:()=>he,jsonOk:()=>ee,parseJsonBody:()=>It});function GO(r){return new Promise(e=>{let t="";r.on("data",n=>t+=n),r.on("end",()=>e(t))})}function ee(r,e={ok:!0}){r.setHeader("Content-Type","application/json"),r.writeHead(200),r.end(JSON.stringify(e))}function he(r,e,t){r.setHeader("Content-Type","application/json"),r.writeHead(e),r.end(JSON.stringify({error:t}))}async function It(r,e){try{let t=await GO(r);return JSON.parse(t||"{}")}catch{return he(e,400,"Invalid JSON"),null}}function vp(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 u of c)a.path.endsWith("/*")?n.push({...a,prefix:a.path.slice(0,-2),method:u}):t.set(`${u}:${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 u=(0,yv.parse)(a.url,!0),{pathname:p,search:f}=u,m=!!a.headers["cf-connecting-ip"],y=a.socket.remoteAddress==="127.0.0.1"||a.socket.remoteAddress==="::1";if(!o(p)&&(m||!y)){he(c,403,"Forbidden");return}let _=`${a.method}:${p}`,S=t.get(_);if(S){try{await S.handler(a,c,{pathname:p,query:u.query,search:f})}catch(A){console.error("Error:",a.url,A),he(c,500,A.message)}return}for(let A of n)if(A.method===a.method&&p.startsWith(A.prefix)){try{await A.handler(a,c,{pathname:p,query:u.query,search:f})}catch(P){console.error("Error:",a.url,P),he(c,500,P.message)}return}if(e){try{await e(a,c,{pathname:p,search:f})}catch(A){console.error("Error:",a.url,A),he(c,500,A.message)}return}he(c,404,"Not found")}}var yv,Gt=Te(()=>{yv=require("url")});function eo(r,e={}){return fetch(r,{...e,headers:{...KO,...e.headers}})}var Na,Jr,bv,Cn,oe,wv,xp,zO,Ia,_v,La,Qs,yp,Oi,Sv,Ev,Tv,Zs,Cv,Av,KO,gt=Te(()=>{Na=X(require("dns"),1),Jr=X(require("path"),1),bv=X(require("os"),1),Cn=Jr.default.join(bv.default.homedir(),".9remote"),oe={ROOT:Cn,LOGS:Jr.default.join(Cn,"logs"),STATE:Jr.default.join(Cn,"state"),CONFIG:Jr.default.join(Cn,"config"),BIN:Jr.default.join(Cn,"bin"),PIDS:Jr.default.join(Cn,"pids"),BUFFERS:Jr.default.join(Cn,"buffers"),DAEMON:Jr.default.join(Cn,"daemon")},wv=new Na.default.promises.Resolver;wv.setServers(["1.1.1.1","1.0.0.1","8.8.8.8"]);xp=Na.default.lookup,zO=/^(\d{1,3}\.){3}\d{1,3}$|^::1$|^[0-9a-f:]+$/i;Na.default.lookup=(r,e,t)=>{if(typeof e=="function"&&(t=e,e={}),r==="localhost"||zO.test(r))return xp(r,e,t);wv.resolve4(r).then(n=>{if(!n?.length)return xp(r,e,t);e.all?t(null,n.map(i=>({address:i,family:4}))):t(null,n[0],4)}).catch(()=>xp(r,e,t))};Ia=2208,_v=5173,La=[`http://localhost:${Ia}`,`http://127.0.0.1:${Ia}`,`http://localhost:${_v}`,`http://127.0.0.1:${_v}`],Qs={fileName:"agent.log",rotatedName:"agent.log.1",maxBytes:2*1024*1024,cleanupAfterDays:7},yp=60,Oi={STOPPED:0,PREPARING:1,CONNECTING:2,TUNNELING:3,VERIFYING:4,READY:5},Sv=5e3,Ev=1e3,Tv=6e4,Zs={CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN:"1"},Cv=["claude","codex","gemini","opencode"],Av={claude:"Claude",codex:"Codex",gemini:"Gemini",opencode:"OpenCode"},KO={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 VO(){Ir.default.existsSync(Da)||Ir.default.mkdirSync(Da,{recursive:!0})}function YO(){try{if(Ir.default.statSync(Ba).size<Qs.maxBytes)return;try{Ir.default.rmSync(ja,{force:!0})}catch{}Ir.default.renameSync(Ba,ja)}catch{}}function XO(){try{let r=Ir.default.statSync(ja);Date.now()-r.mtimeMs>Qs.cleanupAfterDays*864e5&&Ir.default.rmSync(ja,{force:!0})}catch{}}function Sp(r){try{YO(),Ir.default.appendFileSync(Ba,r+`
|
|
3
|
+
`)}catch{}}function _p(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 kv(){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 ZO(r){return String(r).replace(JO,"").replace(QO,"").replace(/\s+$/g,"")}function to(r,e,t){let n=ZO(t);if(!n)return;let i=e==="info"?r:`${r}:${e}`,s=`${kv()} [${i}] ${n}`;if(Sp(s),bp)try{bp(s)}catch{}}function eP(){process.on("uncaughtException",r=>to("crash","error",`uncaughtException: ${r?.stack||r?.message||r}`)),process.on("unhandledRejection",r=>{let e=r instanceof Error?r.stack||r.message:String(r);to("crash","error",`unhandledRejection: ${e}`)}),process.on("exit",r=>Sp(`${kv()} [exit] code=${r} pid=${process.pid}`))}function Ov(){Rv||(Rv=!0,VO(),XO(),Sp(`
|
|
4
|
+
=== SESSION ${new Date().toISOString()} pid=${process.pid} argv=${process.argv.slice(2).join(" ")} ===`),eP())}function Pv(r){bp=r}function Mv(r=60){try{return Ir.default.readFileSync(Ba,"utf8").split(`
|
|
5
|
+
`).filter(Boolean).slice(-r)}catch{return[]}}function An(r){return{info:(...e)=>to(r,"info",_p(e)),warn:(...e)=>to(r,"warn",_p(e)),error:(...e)=>to(r,"error",_p(e))}}var Ir,wp,Da,Ba,ja,Rv,bp,JO,QO,Pi=Te(()=>{Ir=X(require("fs"),1),wp=X(require("path"),1);gt();Da=oe.LOGS,Ba=wp.default.join(Da,Qs.fileName),ja=wp.default.join(Da,Qs.rotatedName),Rv=!1,bp=null;JO=/\x1b\[[0-9;]*m/g,QO=/https?:\/\/[^\s]+/g});var Dv=O((D4,Ep)=>{"use strict";Ep.exports=Lv;Ep.exports.preferredCharsets=Lv;var tP=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function rP(r){for(var e=r.split(","),t=0,n=0;t<e.length;t++){var i=nP(e[t].trim(),t);i&&(e[n++]=i)}return e.length=n,e}function nP(r,e){var t=tP.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 iP(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=sP(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function sP(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 Lv(r,e){var t=rP(r===void 0?"*":r||"");if(!e)return t.filter(Nv).sort(Iv).map(oP);var n=e.map(function(s,o){return iP(s,t,o)});return n.filter(Nv).sort(Iv).map(function(s){return e[n.indexOf(s)]})}function Iv(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function oP(r){return r.charset}function Nv(r){return r.q>0}});var $v=O((B4,Tp)=>{"use strict";Tp.exports=Hv;Tp.exports.preferredEncodings=Hv;var aP=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function cP(r){for(var e=r.split(","),t=!1,n=1,i=0,s=0;i<e.length;i++){var o=lP(e[i].trim(),i);o&&(e[s++]=o,t=t||Fv("identity",o),n=Math.min(n,o.q||1))}return t||(e[s++]={encoding:"identity",q:n,i}),e.length=s,e}function lP(r,e){var t=aP.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 uP(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=Fv(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function Fv(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 Hv(r,e){var t=cP(r||"");if(!e)return t.filter(jv).sort(Bv).map(pP);var n=e.map(function(s,o){return uP(s,t,o)});return n.filter(jv).sort(Bv).map(function(s){return e[n.indexOf(s)]})}function Bv(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function pP(r){return r.encoding}function jv(r){return r.q>0}});var zv=O((j4,Cp)=>{"use strict";Cp.exports=Gv;Cp.exports.preferredLanguages=Gv;var fP=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function dP(r){for(var e=r.split(","),t=0,n=0;t<e.length;t++){var i=Wv(e[t].trim(),t);i&&(e[n++]=i)}return e.length=n,e}function Wv(r,e){var t=fP.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 u=a[c].split("=");u[0]==="q"&&(o=parseFloat(u[1]))}return{prefix:n,suffix:i,q:o,i:e,full:s}}function hP(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=mP(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function mP(r,e,t){var n=Wv(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 Gv(r,e){var t=dP(r===void 0?"*":r||"");if(!e)return t.filter(Uv).sort(qv).map(gP);var n=e.map(function(s,o){return hP(s,t,o)});return n.filter(Uv).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 gP(r){return r.full}function Uv(r){return r.q>0}});var Qv=O((F4,Ap)=>{"use strict";Ap.exports=Xv;Ap.exports.preferredMediaTypes=Xv;var vP=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function xP(r){for(var e=SP(r),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=vP.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=EP(t[3]).map(wP),c=0;c<a.length;c++){var u=a[c],p=u[0].toLowerCase(),f=u[1],m=f&&f[0]==='"'&&f[f.length-1]==='"'?f.substr(1,f.length-2):f;if(p==="q"){i=parseFloat(m);break}n[p]=m}return{type:o,subtype:s,params:n,q:i,i:e}}function yP(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=_P(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function _P(r,e,t){var n=Yv(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 Xv(r,e){var t=xP(r===void 0?"*/*":r||"");if(!e)return t.filter(Vv).sort(Kv).map(bP);var n=e.map(function(s,o){return yP(s,t,o)});return n.filter(Vv).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 bP(r){return r.type+"/"+r.subtype}function Vv(r){return r.q>0}function Jv(r){for(var e=0,t=0;(t=r.indexOf('"',t))!==-1;)e++,t++;return e}function wP(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 SP(r){for(var e=r.split(","),t=1,n=0;t<e.length;t++)Jv(e[n])%2==0?e[++n]=e[t]:e[n]+=","+e[t];return e.length=n+1,e}function EP(r){for(var e=r.split(";"),t=1,n=0;t<e.length;t++)Jv(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 Zv=O((H4,Rp)=>{"use strict";var TP=Dv(),CP=$v(),AP=zv(),RP=Qv();Rp.exports=le;Rp.exports.Negotiator=le;function le(r){if(!(this instanceof le))return new le(r);this.request=r}le.prototype.charset=function(e){var t=this.charsets(e);return t&&t[0]};le.prototype.charsets=function(e){return TP(this.request.headers["accept-charset"],e)};le.prototype.encoding=function(e){var t=this.encodings(e);return t&&t[0]};le.prototype.encodings=function(e){return CP(this.request.headers["accept-encoding"],e)};le.prototype.language=function(e){var t=this.languages(e);return t&&t[0]};le.prototype.languages=function(e){return AP(this.request.headers["accept-language"],e)};le.prototype.mediaType=function(e){var t=this.mediaTypes(e);return t&&t[0]};le.prototype.mediaTypes=function(e){return RP(this.request.headers.accept,e)};le.prototype.preferredCharset=le.prototype.charset;le.prototype.preferredCharsets=le.prototype.charsets;le.prototype.preferredEncoding=le.prototype.encoding;le.prototype.preferredEncodings=le.prototype.encodings;le.prototype.preferredLanguage=le.prototype.language;le.prototype.preferredLanguages=le.prototype.languages;le.prototype.preferredMediaType=le.prototype.mediaType;le.prototype.preferredMediaTypes=le.prototype.mediaTypes});var ex=O(($4,kP)=>{kP.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 rx=O((q4,tx)=>{tx.exports=ex()});var sx=O(Nt=>{"use strict";var Fa=rx(),OP=require("path").extname,nx=/^\s*([^;\s]*)(?:;|\s|$)/,PP=/^text\//i;Nt.charset=ix;Nt.charsets={lookup:ix};Nt.contentType=MP;Nt.extension=IP;Nt.extensions=Object.create(null);Nt.lookup=NP;Nt.types=Object.create(null);LP(Nt.extensions,Nt.types);function ix(r){if(!r||typeof r!="string")return!1;var e=nx.exec(r),t=e&&Fa[e[1].toLowerCase()];return t&&t.charset?t.charset:e&&PP.test(e[1])?"UTF-8":!1}function MP(r){if(!r||typeof r!="string")return!1;var e=r.indexOf("/")===-1?Nt.lookup(r):r;if(!e)return!1;if(e.indexOf("charset")===-1){var t=Nt.charset(e);t&&(e+="; charset="+t.toLowerCase())}return e}function IP(r){if(!r||typeof r!="string")return!1;var e=nx.exec(r),t=e&&Nt.extensions[e[1].toLowerCase()];return!t||!t.length?!1:t[0]}function NP(r){if(!r||typeof r!="string")return!1;var e=OP("x."+r).toLowerCase().substr(1);return e&&Nt.types[e]||!1}function LP(r,e){var t=["nginx","apache",void 0,"iana"];Object.keys(Fa).forEach(function(i){var s=Fa[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 u=t.indexOf(Fa[e[c]].source),p=t.indexOf(s.source);if(e[c]!=="application/octet-stream"&&(u>p||u===p&&e[c].substr(0,12)==="application/"))continue}e[c]=i}}})}});var Ha=O((W4,ox)=>{"use strict";var DP=Zv(),BP=sx();ox.exports=zt;function zt(r){if(!(this instanceof zt))return new zt(r);this.headers=r.headers,this.negotiator=new DP(r)}zt.prototype.type=zt.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(jP),i=this.negotiator.mediaTypes(n.filter(FP)),s=i[0];return s?e[n.indexOf(s)]:!1};zt.prototype.encoding=zt.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};zt.prototype.charset=zt.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};zt.prototype.lang=zt.prototype.langs=zt.prototype.language=zt.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 jP(r){return r.indexOf("/")===-1?BP.lookup(r):r}function FP(r){return typeof r=="string"}});var Op=O((ax,cx)=>{var ro=require("crypto"),kp=function(){};kp.prototype.getRandomBytes=function(r){var e=4096,t=this;if(r=r||12,r>e)return ro.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,ro.randomBytes(e,function(o,a){t.bytesBuffer=a,t.bytesBufferIndex=0,t.isGeneratingBytes=!1})),this.bytesBufferIndex==-1)))return ro.randomBytes(r);var s=this.bytesBuffer.slice(r*this.bytesBufferIndex,r*(this.bytesBufferIndex+1));return this.bytesBufferIndex++,s};kp.prototype.generateId=function(){var r=Buffer.alloc(15);return r.writeInt32BE?(this.sequenceNumber=this.sequenceNumber+1|0,r.writeInt32BE(this.sequenceNumber,11),ro.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()};ax=cx.exports=new kp});var $a=O(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.ERROR_PACKET=Rn.PACKET_TYPES_REVERSE=Rn.PACKET_TYPES=void 0;var Nr=Object.create(null);Rn.PACKET_TYPES=Nr;Nr.open="0";Nr.close="1";Nr.ping="2";Nr.pong="3";Nr.message="4";Nr.upgrade="5";Nr.noop="6";var lx=Object.create(null);Rn.PACKET_TYPES_REVERSE=lx;Object.keys(Nr).forEach(r=>{lx[Nr[r]]=r});var HP={type:"error",data:"parser error"};Rn.ERROR_PACKET=HP});var px=O(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.encodePacket=void 0;Mi.encodePacketToBinary=UP;var $P=$a(),qP=({type:r,data:e},t,n)=>e instanceof ArrayBuffer||ArrayBuffer.isView(e)?n(t?e:"b"+ux(e,!0).toString("base64")):n($P.PACKET_TYPES[r]+(e||""));Mi.encodePacket=qP;var ux=(r,e)=>Buffer.isBuffer(r)||r instanceof Uint8Array&&!e?r:r instanceof ArrayBuffer?Buffer.from(r):Buffer.from(r.buffer,r.byteOffset,r.byteLength),Pp;function UP(r,e){if(r.data instanceof ArrayBuffer||ArrayBuffer.isView(r.data))return e(ux(r.data,!1));(0,Mi.encodePacket)(r,!0,t=>{Pp||(Pp=new TextEncoder),e(Pp.encode(t))})}});var dx=O(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});Ua.decodePacket=void 0;var qa=$a(),WP=(r,e)=>{if(typeof r!="string")return{type:"message",data:fx(r,e)};let t=r.charAt(0);if(t==="b"){let n=Buffer.from(r.substring(1),"base64");return{type:"message",data:fx(n,e)}}return qa.PACKET_TYPES_REVERSE[t]?r.length>1?{type:qa.PACKET_TYPES_REVERSE[t],data:r.substring(1)}:{type:qa.PACKET_TYPES_REVERSE[t]}:qa.ERROR_PACKET};Ua.decodePacket=WP;var fx=(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 no=O(Lt=>{"use strict";Object.defineProperty(Lt,"__esModule",{value:!0});Lt.decodePayload=Lt.decodePacket=Lt.encodePayload=Lt.encodePacket=Lt.protocol=void 0;Lt.createPacketEncoderStream=KP;Lt.createPacketDecoderStream=VP;var Ip=px();Object.defineProperty(Lt,"encodePacket",{enumerable:!0,get:function(){return Ip.encodePacket}});var Np=dx();Object.defineProperty(Lt,"decodePacket",{enumerable:!0,get:function(){return Np.decodePacket}});var hx=$a(),mx="",GP=(r,e)=>{let t=r.length,n=new Array(t),i=0;r.forEach((s,o)=>{(0,Ip.encodePacket)(s,!1,a=>{n[o]=a,++i===t&&e(n.join(mx))})})};Lt.encodePayload=GP;var zP=(r,e)=>{let t=r.split(mx),n=[];for(let i=0;i<t.length;i++){let s=(0,Np.decodePacket)(t[i],e);if(n.push(s),s.type==="error")break}return n};Lt.decodePayload=zP;function KP(){return new TransformStream({transform(r,e){(0,Ip.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 Mp;function Wa(r){return r.reduce((e,t)=>e+t.length,0)}function Ga(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 VP(r,e){Mp||(Mp=new TextDecoder);let t=[],n=0,i=-1,s=!1;return new TransformStream({transform(o,a){for(t.push(o);;){if(n===0){if(Wa(t)<1)break;let c=Ga(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(Wa(t)<2)break;let c=Ga(t,2);i=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),n=3}else if(n===2){if(Wa(t)<8)break;let c=Ga(t,8),u=new DataView(c.buffer,c.byteOffset,c.length),p=u.getUint32(0);if(p>Math.pow(2,21)-1){a.enqueue(hx.ERROR_PACKET);break}i=p*Math.pow(2,32)+u.getUint32(4),n=3}else{if(Wa(t)<i)break;let c=Ga(t,i);a.enqueue((0,Np.decodePacket)(s?c:Mp.decode(c),e)),n=0}if(i===0||i>r){a.enqueue(hx.ERROR_PACKET);break}}}})}Lt.protocol=4});var yx=O((Y4,xx)=>{var kn=String.fromCharCode;function gx(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 YP(r){for(var e=r.length,t=-1,n,i="";++t<e;)n=r[t],n>65535&&(n-=65536,i+=kn(n>>>10&1023|55296),n=56320|n&1023),i+=kn(n);return i}function vx(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 Lp(r,e){return kn(r>>e&63|128)}function XP(r,e){if((r&4294967168)==0)return kn(r);var t="";return(r&4294965248)==0?t=kn(r>>6&31|192):(r&4294901760)==0?(vx(r,e)||(r=65533),t=kn(r>>12&15|224),t+=Lp(r,6)):(r&4292870144)==0&&(t=kn(r>>18&7|240),t+=Lp(r,12),t+=Lp(r,6)),t+=kn(r&63|128),t}function JP(r,e){e=e||{};for(var t=e.strict!==!1,n=gx(r),i=n.length,s=-1,o,a="";++s<i;)o=n[s],a+=XP(o,t);return a}function Ii(){if(On>=Ka)throw Error("Invalid byte index");var r=za[On]&255;if(On++,(r&192)==128)return r&63;throw Error("Invalid continuation byte")}function QP(r){var e,t,n,i,s;if(On>Ka)throw Error("Invalid byte index");if(On==Ka)return!1;if(e=za[On]&255,On++,(e&128)==0)return e;if((e&224)==192){if(t=Ii(),s=(e&31)<<6|t,s>=128)return s;throw Error("Invalid continuation byte")}if((e&240)==224){if(t=Ii(),n=Ii(),s=(e&15)<<12|t<<6|n,s>=2048)return vx(s,r)?s:65533;throw Error("Invalid continuation byte")}if((e&248)==240&&(t=Ii(),n=Ii(),i=Ii(),s=(e&7)<<18|t<<12|n<<6|i,s>=65536&&s<=1114111))return s;throw Error("Invalid UTF-8 detected")}var za,Ka,On;function ZP(r,e){e=e||{};var t=e.strict!==!1;za=gx(r),Ka=za.length,On=0;for(var n=[],i;(i=QP(t))!==!1;)n.push(i);return YP(n)}xx.exports={version:"2.1.2",encode:JP,decode:ZP}});var Ax=O(ot=>{"use strict";Object.defineProperty(ot,"__esModule",{value:!0});ot.packets=ot.protocol=void 0;ot.encodePacket=Dp;ot.encodeBase64Packet=wx;ot.decodePacket=Bp;ot.decodeBase64Packet=Sx;ot.encodePayload=nM;ot.decodePayload=sM;ot.encodePayloadAsBinary=Tx;ot.decodePayloadAsBinary=Cx;var bx=yx();ot.protocol=3;var eM=r=>{for(let e of r)if(e.data instanceof ArrayBuffer||ArrayBuffer.isView(e.data))return!0;return!1};ot.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6};var Ni=Object.keys(ot.packets),br={type:"error",data:"parser error"},tM=Buffer.concat([]);function Dp(r,e,t,n){if(typeof e=="function"&&(n=e,e=null),typeof t=="function"&&(n=t,t=null),Buffer.isBuffer(r.data))return _x(r,e,n);if(r.data&&(r.data.buffer||r.data)instanceof ArrayBuffer)return _x({type:r.type,data:jp(r.data)},e,n);var i=ot.packets[r.type];return r.data!==void 0&&(i+=t?bx.encode(String(r.data),{strict:!1}):String(r.data)),n(""+i)}function _x(r,e,t){if(!e)return wx(r,t);var n=r.data,i=Buffer.allocUnsafe(1);return i[0]=ot.packets[r.type],t(Buffer.concat([i,n]))}function wx(r,e){var t=Buffer.isBuffer(r.data)?r.data:jp(r.data),n="b"+ot.packets[r.type];return n+=t.toString("base64"),e(n)}function Bp(r,e,t){if(r===void 0)return br;let n;if(typeof r=="string")return n=r.charAt(0),n==="b"?Sx(r.slice(1),e):t&&(r=rM(r),r===!1)||Number(n)!=n||!Ni[n]?br:r.length>1?{type:Ni[n],data:r.slice(1)}:{type:Ni[n]};if(e==="arraybuffer"){var i=new Uint8Array(r);return n=i[0],{type:Ni[n],data:i.buffer.slice(1)}}return r instanceof ArrayBuffer&&(r=jp(r)),n=r[0],{type:Ni[n],data:r.slice(1)}}function rM(r){try{r=bx.decode(r,{strict:!1})}catch{return!1}return r}function Sx(r,e){var t=Ni[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 nM(r,e,t){if(typeof e=="function"&&(t=e,e=null),e&&eM(r))return Tx(r,t);if(!r.length)return t("0:");function n(i,s){Dp(i,e,!1,function(o){s(null,iM(o))})}Ex(r,n,function(i,s){return t(s.join(""))})}function iM(r){return r.length+":"+r}function Ex(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 sM(r,e,t){if(typeof r!="string")return Cx(r,e,t);if(typeof e=="function"&&(t=e,e=null),r==="")return t(br,0,1);for(var n="",i,s,o,a=0,c=r.length;a<c;a++){var u=r.charAt(a);if(u!==":"){n+=u;continue}if(n===""||n!=(i=Number(n))||(s=r.slice(a+1,a+1+i),n!=s.length))return t(br,0,1);if(s.length){if(o=Bp(s,e,!1),br.type===o.type&&br.data===o.data)return t(br,0,1);var p=t(o,a+i,c);if(p===!1)return}a+=i,n=""}if(n!=="")return t(br,0,1)}function oM(r){for(var e="",t=0,n=r.length;t<n;t++)e+=String.fromCharCode(r[t]);return e}function aM(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 Tx(r,e){if(!r.length)return e(tM);Ex(r,cM,function(t,n){return e(Buffer.concat(n))})}function cM(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,aM(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]))}Dp(r,!0,!0,t)}function Cx(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(br,0,1);o+=""+n[s]}n=n.slice(o.length+1);var c=parseInt(o,10),u=n.slice(1,c+1);a&&(u=oM(u)),i.push(u),n=n.slice(c+1)}var p=i.length;for(s=0;s<p;s++){var f=i[s];t(Bp(f,e,!0),s,p)}}});var kx=O((J4,Rx)=>{var Li=1e3,Di=Li*60,Bi=Di*60,Vn=Bi*24,lM=Vn*7,uM=Vn*365.25;Rx.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return pM(r);if(t==="number"&&isFinite(r))return e.long?dM(r):fM(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function pM(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*uM;case"weeks":case"week":case"w":return t*lM;case"days":case"day":case"d":return t*Vn;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Bi;case"minutes":case"minute":case"mins":case"min":case"m":return t*Di;case"seconds":case"second":case"secs":case"sec":case"s":return t*Li;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function fM(r){var e=Math.abs(r);return e>=Vn?Math.round(r/Vn)+"d":e>=Bi?Math.round(r/Bi)+"h":e>=Di?Math.round(r/Di)+"m":e>=Li?Math.round(r/Li)+"s":r+"ms"}function dM(r){var e=Math.abs(r);return e>=Vn?Va(r,e,Vn,"day"):e>=Bi?Va(r,e,Bi,"hour"):e>=Di?Va(r,e,Di,"minute"):e>=Li?Va(r,e,Li,"second"):r+" ms"}function Va(r,e,t,n){var i=e>=t*1.5;return Math.round(r/t)+" "+n+(i?"s":"")}});var Fp=O((Q4,Ox)=>{function hM(r){t.debug=t,t.default=t,t.coerce=c,t.disable=o,t.enable=i,t.enabled=a,t.humanize=kx(),t.destroy=u,Object.keys(r).forEach(p=>{t[p]=r[p]}),t.names=[],t.skips=[],t.formatters={};function e(p){let f=0;for(let m=0;m<p.length;m++)f=(f<<5)-f+p.charCodeAt(m),f|=0;return t.colors[Math.abs(f)%t.colors.length]}t.selectColor=e;function t(p){let f,m=null,y,_;function S(...A){if(!S.enabled)return;let P=S,L=Number(new Date),N=L-(f||L);P.diff=N,P.prev=f,P.curr=L,f=L,A[0]=t.coerce(A[0]),typeof A[0]!="string"&&A.unshift("%O");let H=0;A[0]=A[0].replace(/%([a-zA-Z%])/g,(U,G)=>{if(U==="%%")return"%";H++;let M=t.formatters[G];if(typeof M=="function"){let F=A[H];U=M.call(P,F),A.splice(H,1),H--}return U}),t.formatArgs.call(P,A),(P.log||t.log).apply(P,A)}return S.namespace=p,S.useColors=t.useColors(),S.color=t.selectColor(p),S.extend=n,S.destroy=t.destroy,Object.defineProperty(S,"enabled",{enumerable:!0,configurable:!1,get:()=>m!==null?m:(y!==t.namespaces&&(y=t.namespaces,_=t.enabled(p)),_),set:A=>{m=A}}),typeof t.init=="function"&&t.init(S),S}function n(p,f){let m=t(this.namespace+(typeof f>"u"?":":f)+p);return m.log=this.log,m}function i(p){t.save(p),t.namespaces=p,t.names=[],t.skips=[];let f=(typeof p=="string"?p:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let m of f)m[0]==="-"?t.skips.push(m.slice(1)):t.names.push(m)}function s(p,f){let m=0,y=0,_=-1,S=0;for(;m<p.length;)if(y<f.length&&(f[y]===p[m]||f[y]==="*"))f[y]==="*"?(_=y,S=m,y++):(m++,y++);else if(_!==-1)y=_+1,S++,m=S;else return!1;for(;y<f.length&&f[y]==="*";)y++;return y===f.length}function o(){let p=[...t.names,...t.skips.map(f=>"-"+f)].join(",");return t.enable(""),p}function a(p){for(let f of t.skips)if(s(p,f))return!1;for(let f of t.names)if(s(p,f))return!0;return!1}function c(p){return p instanceof Error?p.stack||p.message:p}function u(){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}Ox.exports=hM});var Px=O((Dt,Ya)=>{Dt.formatArgs=gM;Dt.save=vM;Dt.load=xM;Dt.useColors=mM;Dt.storage=yM();Dt.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`."))}})();Dt.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 mM(){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 gM(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+Ya.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)}Dt.log=console.debug||console.log||(()=>{});function vM(r){try{r?Dt.storage.setItem("debug",r):Dt.storage.removeItem("debug")}catch{}}function xM(){let r;try{r=Dt.storage.getItem("debug")||Dt.storage.getItem("DEBUG")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function yM(){try{return localStorage}catch{}}Ya.exports=Fp()(Dt);var{formatters:_M}=Ya.exports;_M.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Ix=O((Z4,Mx)=>{"use strict";Mx.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 Dx=O((e6,Lx)=>{"use strict";var bM=require("os"),Nx=require("tty"),nr=Ix(),{env:at}=process,Pn;nr("no-color")||nr("no-colors")||nr("color=false")||nr("color=never")?Pn=0:(nr("color")||nr("colors")||nr("color=true")||nr("color=always"))&&(Pn=1);"FORCE_COLOR"in at&&(at.FORCE_COLOR==="true"?Pn=1:at.FORCE_COLOR==="false"?Pn=0:Pn=at.FORCE_COLOR.length===0?1:Math.min(parseInt(at.FORCE_COLOR,10),3));function Hp(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function $p(r,e){if(Pn===0)return 0;if(nr("color=16m")||nr("color=full")||nr("color=truecolor"))return 3;if(nr("color=256"))return 2;if(r&&!e&&Pn===void 0)return 0;let t=Pn||0;if(at.TERM==="dumb")return t;if(process.platform==="win32"){let n=bM.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in at)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in at)||at.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in at)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(at.TEAMCITY_VERSION)?1:0;if(at.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in at){let n=parseInt((at.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(at.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(at.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(at.TERM)||"COLORTERM"in at?1:t}function wM(r){let e=$p(r,r&&r.isTTY);return Hp(e)}Lx.exports={supportsColor:wM,stdout:Hp($p(!0,Nx.isatty(1))),stderr:Hp($p(!0,Nx.isatty(2)))}});var jx=O((ct,Ja)=>{var SM=require("tty"),Xa=require("util");ct.init=OM;ct.log=AM;ct.formatArgs=TM;ct.save=RM;ct.load=kM;ct.useColors=EM;ct.destroy=Xa.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");ct.colors=[6,2,3,4,5,1];try{let r=Dx();r&&(r.stderr||r).level>=2&&(ct.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{}ct.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 EM(){return"colors"in ct.inspectOpts?!!ct.inspectOpts.colors:SM.isatty(process.stderr.fd)}function TM(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(xM,"\\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)}};Ya.JSONP=Pp});var Ax=O(Xa=>{"use strict";Object.defineProperty(Xa,"__esModule",{value:!0});Xa.WebSocket=void 0;var _M=zn(),bM=Te(),Cx=(0,bM.default)("engine:ws"),Mp=class extends _M.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();Cx('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){Cx("closing"),this.socket.close(),e&&e()}};Xa.WebSocket=Mp});var Np=O(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});Ja.WebTransport=void 0;var wM=zn(),SM=Te(),EM=to(),Li=(0,SM.default)("engine:webtransport"),Ip=class extends wM.Transport{constructor(e,t,n){super({_query:{EIO:"4"}}),this.session=e;let i=(0,EM.createPacketEncoderStream)();i.readable.pipeTo(t.writable).catch(()=>{Li("the stream was closed")}),this.writer=i.writable.getWriter(),(async()=>{try{for(;;){let{value:s,done:o}=await n.read();if(o){Li("session is closed");break}Li("received chunk: %o",s),this.onPacket(s)}}catch(s){Li("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){Li("error while writing: %s",t.message)}this.emit("drain"),this.writable=!0,this.emit("ready")}doClose(e){Li("closing WebTransport session"),this.session.close(),e&&e()}};Ja.WebTransport=Ip});var Dp=O(Lp=>{"use strict";Object.defineProperty(Lp,"__esModule",{value:!0});var TM=Op(),CM=Tx(),AM=Ax(),RM=Np();Lp.default={polling:Rx,websocket:AM.WebSocket,webtransport:RM.WebTransport};function Rx(r){return typeof r._query.j=="string"?new CM.JSONP(r):new TM.Polling(r)}Rx.upgradesTo=["websocket","webtransport"]});var jp=O(Qa=>{"use strict";Object.defineProperty(Qa,"__esModule",{value:!0});Qa.Socket=void 0;var kM=require("events"),OM=Te(),Qr=require("timers"),Ce=(0,OM.default)("engine:socket"),Bp=class extends kM.EventEmitter{get readyState(){return this._readyState}set readyState(e){Ce("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 Ce("packet received with closed socket");switch(Ce(`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}Ce("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}Ce("got pong"),(0,Qr.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){Ce("transport error"),this.onClose("transport error",e)}schedulePing(){this.pingIntervalTimer=(0,Qr.setTimeout)(()=>{Ce("writing ping packet - expecting pong within %sms",this.server.opts.pingTimeout),this.sendPacket("ping"),this.resetPingTimeout()},this.server.opts.pingInterval)}resetPingTimeout(){(0,Qr.clearTimeout)(this.pingTimeoutTimer),this.pingTimeoutTimer=(0,Qr.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){Ce("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){Ce('might upgrade socket transport from "%s" to "%s"',this.transport.name,e.name),this.upgrading=!0;let t=(0,Qr.setTimeout)(()=>{Ce("client did not complete upgrade - closing transport"),o(),e.readyState==="open"&&e.close()},this.server.opts.upgradeTimeout),n,i=p=>{p.type==="ping"&&p.data==="probe"?(Ce("got probe ping packet, sending pong"),e.send([{type:"pong",data:"probe"}]),this.emit("upgrading",e),clearInterval(n),n=setInterval(s,100)):p.type==="upgrade"&&this.readyState!=="closed"?(Ce("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&&(Ce("writing a noop packet to polling for fast upgrade"),this.transport.send([{type:"noop"}]))},o=()=>{this.upgrading=!1,clearInterval(n),(0,Qr.clearTimeout)(t),e.removeListener("packet",i),e.removeListener("close",c),e.removeListener("error",a),this.removeListener("close",u)},a=p=>{Ce("client did not complete upgrade - %s",p),o(),e.close(),e=null},c=()=>{a("transport closed")},u=()=>{a("socket closed")};e.on("packet",i),e.once("close",c),e.once("error",a),this.once("close",u)}clearTransport(){let e,t=this.cleanupFn.length;for(let n=0;n<t;n++)e=this.cleanupFn.shift(),e();this.transport.on("error",function(){Ce("error triggered by discarded transport")}),this.transport.close(),(0,Qr.clearTimeout)(this.pingTimeoutTimer)}onClose(e,t){this.readyState!=="closed"&&(this.readyState="closed",(0,Qr.clearTimeout)(this.pingIntervalTimer),(0,Qr.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"){Ce('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){Ce("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){Ce("there are %d remaining packets in the buffer, waiting for the 'drain' event",this.writeBuffer.length),this.once("drain",()=>{Ce("all packets have been sent, closing the transport"),this.closeTransport(e)});return}Ce("the buffer is empty, closing the transport right away"),this.closeTransport(e)}}closeTransport(e){Ce("closing the transport (discard? %s)",!!e),e&&this.transport.discard(),this.transport.close(this.onClose.bind(this,"forced close"))}};Qa.Socket=Bp});var Px=O(Fp=>{"use strict";Fp.parse=BM;Fp.serialize=jM;var PM=Object.prototype.toString,MM=Object.prototype.hasOwnProperty,IM=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,NM=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,LM=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,DM=/^[\u0020-\u003A\u003D-\u007E]*$/;function BM(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||FM,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=kx(r,s,o),u=Ox(r,o,c),p=r.slice(c,u);if(!MM.call(t,p)){var f=kx(r,o+1,a),g=Ox(r,a,f);r.charCodeAt(f)===34&&r.charCodeAt(g-1)===34&&(f++,g--);var y=r.slice(f,g);t[p]=$M(y,i)}s=a+1}while(s<n);return t}function kx(r,e,t){do{var n=r.charCodeAt(e);if(n!==32&&n!==9)return e}while(++e<t);return t}function Ox(r,e,t){for(;e>t;){var n=r.charCodeAt(--e);if(n!==32&&n!==9)return e+1}return t}function jM(r,e,t){var n=t&&t.encode||encodeURIComponent;if(typeof n!="function")throw new TypeError("option encode is invalid");if(!IM.test(r))throw new TypeError("argument name is invalid");var i=n(e);if(!NM.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(!LM.test(t.domain))throw new TypeError("option domain is invalid");s+="; Domain="+t.domain}if(t.path){if(!DM.test(t.path))throw new TypeError("option path is invalid");s+="; Path="+t.path}if(t.expires){var a=t.expires;if(!HM(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 u=typeof t.sameSite=="string"?t.sameSite.toLowerCase():t.sameSite;switch(u){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 FM(r){return r.indexOf("%")!==-1?decodeURIComponent(r):r}function HM(r){return PM.call(r)==="[object Date]"}function $M(r,e){try{return e(r)}catch{return r}}});var Zr=O((F4,Nx)=>{"use strict";var Mx=["nodebuffer","arraybuffer","fragments"],Ix=typeof Blob<"u";Ix&&Mx.push("blob");Nx.exports={BINARY_TYPES:Mx,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:Ix,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Xx=O((H4,Yx)=>{var jx=require("fs"),en=require("path"),Fx=require("os"),Hx=typeof __webpack_require__=="function"?__non_webpack_require__:require,qM=process.config&&process.config.variables||{},UM=!!process.env.PREBUILDS_ONLY,Lx=process.versions.modules,Hp=zM()?"electron":GM()?"node-webkit":"node",$p=process.env.npm_config_arch||Fx.arch(),qp=process.env.npm_config_platform||Fx.platform(),$x=process.env.LIBC||(KM(qp)?"musl":"glibc"),Up=process.env.ARM_VERSION||($p==="arm64"?"8":qM.arm_version)||"",qx=(process.versions.uv||"").split(".")[0];Yx.exports=Dr;function Dr(r){return Hx(Dr.resolve(r))}Dr.resolve=Dr.path=function(r){r=en.resolve(r||".");try{var e=Hx(en.join(r,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[e+"_PREBUILD"]&&(r=process.env[e+"_PREBUILD"])}catch{}if(!UM){var t=Dx(en.join(r,"build/Release"),Bx);if(t)return t;var n=Dx(en.join(r,"build/Debug"),Bx);if(n)return n}var i=a(r);if(i)return i;var s=a(en.dirname(process.execPath));if(s)return s;var o=["platform="+qp,"arch="+$p,"runtime="+Hp,"abi="+Lx,"uv="+qx,Up?"armv="+Up:"","libc="+$x,"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+"+Ja.exports.humanize(this.diff)+"\x1B[0m")}else r[0]=CM()+e+" "+r[0]}function CM(){return ct.inspectOpts.hideDate?"":new Date().toISOString()+" "}function AM(...r){return process.stderr.write(Xa.formatWithOptions(ct.inspectOpts,...r)+`
|
|
8
|
+
`)}function RM(r){r?process.env.DEBUG=r:delete process.env.DEBUG}function kM(){return process.env.DEBUG}function OM(r){r.inspectOpts={};let e=Object.keys(ct.inspectOpts);for(let t=0;t<e.length;t++)r.inspectOpts[e[t]]=ct.inspectOpts[e[t]]}Ja.exports=Fp()(ct);var{formatters:Bx}=Ja.exports;Bx.o=function(r){return this.inspectOpts.colors=this.useColors,Xa.inspect(r,this.inspectOpts).split(`
|
|
9
|
+
`).map(e=>e.trim()).join(" ")};Bx.O=function(r){return this.inspectOpts.colors=this.useColors,Xa.inspect(r,this.inspectOpts)}});var Ce=O((t6,qp)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?qp.exports=Px():qp.exports=jx()});var Yn=O(Za=>{"use strict";Object.defineProperty(Za,"__esModule",{value:!0});Za.Transport=void 0;var PM=require("events"),MM=no(),IM=Ax(),NM=Ce(),Fx=(0,NM.default)("engine:transport");function LM(){}var Qa=class extends PM.EventEmitter{get readyState(){return this._readyState}set readyState(e){Fx("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?MM:IM,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||LM))}onError(e,t){if(this.listeners("error").length){let n=new Error(e);n.type="TransportError",n.description=t,this.emit("error",n)}else Fx("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")}};Za.Transport=Qa;Qa.upgradesTo=[]});var Wp=O(ec=>{"use strict";Object.defineProperty(ec,"__esModule",{value:!0});ec.Polling=void 0;var DM=Yn(),Hx=require("zlib"),BM=Ha(),jM=Ce(),Kt=(0,jM.default)("engine:polling"),FM={gzip:Hx.createGzip,deflate:Hx.createDeflate},Up=class extends DM.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){Kt("request overlap"),this.onError("overlap from client"),t.writeHead(400),t.end();return}Kt("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&&(Kt("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=u=>{let p;n?(i=Buffer.concat([i,u]),p=i.length):(i+=u,p=Buffer.byteLength(i)),p>this.maxHttpBufferSize&&(t.writeHead(413).end(),s())},c=()=>{this.onData(i);let u={"Content-Type":"text/html","Content-Length":"2"};t.writeHead(200,this.headers(e,u)),t.end("ok"),s()};e.on("close",o),n||e.setEncoding("utf8"),e.on("data",a),e.on("end",c)}onData(e){Kt('received "%s"',e);let t=n=>{if(n.type==="close")return Kt("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&&(Kt("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){Kt('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=p=>{o["Content-Length"]=typeof p=="string"?Buffer.byteLength(p):p.length,this.res.writeHead(200,this.headers(this.req,o)),this.res.end(p),n()};if(!this.httpCompression||!t.compress){a(e);return}if((i?Buffer.byteLength(e):e.length)<this.httpCompression.threshold){a(e);return}let u=BM(this.req).encodings(["gzip","deflate"]);if(!u){a(e);return}this.compress(e,u,(p,f)=>{if(p){this.res.writeHead(500),this.res.end(),n(p);return}o["Content-Encoding"]=u,a(f)})}compress(e,t,n){Kt("compressing");let i=[],s=0;FM[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){Kt("closing");let t;this.dataReq&&(Kt("aborting ongoing data request"),this.dataReq.destroy());let n=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(Kt("transport writable - closing right away"),this.send([{type:"close"}]),n()):this.discarded?(Kt("transport discarded - closing right away"),n()):(Kt("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}};ec.Polling=Up});var $x=O(tc=>{"use strict";Object.defineProperty(tc,"__esModule",{value:!0});tc.JSONP=void 0;var HM=Wp(),$M=require("querystring"),qM=/\\\\n/g,UM=/(\\)?\\n/g,Gp=class extends HM.Polling{constructor(e){super(e),this.head="___eio["+(e._query.j||"").replace(/[^0-9]/g,"")+"](",this.foot=");"}onData(e){e=$M.parse(e).d,typeof e=="string"&&(e=e.replace(UM,function(t,n){return n?t:`
|
|
10
|
+
`}),super.onData(e.replace(qM,"\\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)}};tc.JSONP=Gp});var Ux=O(rc=>{"use strict";Object.defineProperty(rc,"__esModule",{value:!0});rc.WebSocket=void 0;var WM=Yn(),GM=Ce(),qx=(0,GM.default)("engine:ws"),zp=class extends WM.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();qx('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){qx("closing"),this.socket.close(),e&&e()}};rc.WebSocket=zp});var Vp=O(nc=>{"use strict";Object.defineProperty(nc,"__esModule",{value:!0});nc.WebTransport=void 0;var zM=Yn(),KM=Ce(),VM=no(),ji=(0,KM.default)("engine:webtransport"),Kp=class extends zM.Transport{constructor(e,t,n){super({_query:{EIO:"4"}}),this.session=e;let i=(0,VM.createPacketEncoderStream)();i.readable.pipeTo(t.writable).catch(()=>{ji("the stream was closed")}),this.writer=i.writable.getWriter(),(async()=>{try{for(;;){let{value:s,done:o}=await n.read();if(o){ji("session is closed");break}ji("received chunk: %o",s),this.onPacket(s)}}catch(s){ji("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){ji("error while writing: %s",t.message)}this.emit("drain"),this.writable=!0,this.emit("ready")}doClose(e){ji("closing WebTransport session"),this.session.close(),e&&e()}};nc.WebTransport=Kp});var Xp=O(Yp=>{"use strict";Object.defineProperty(Yp,"__esModule",{value:!0});var YM=Wp(),XM=$x(),JM=Ux(),QM=Vp();Yp.default={polling:Wx,websocket:JM.WebSocket,webtransport:QM.WebTransport};function Wx(r){return typeof r._query.j=="string"?new XM.JSONP(r):new YM.Polling(r)}Wx.upgradesTo=["websocket","webtransport"]});var Qp=O(ic=>{"use strict";Object.defineProperty(ic,"__esModule",{value:!0});ic.Socket=void 0;var ZM=require("events"),eI=Ce(),Qr=require("timers"),Ae=(0,eI.default)("engine:socket"),Jp=class extends ZM.EventEmitter{get readyState(){return this._readyState}set readyState(e){Ae("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 Ae("packet received with closed socket");switch(Ae(`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}Ae("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}Ae("got pong"),(0,Qr.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){Ae("transport error"),this.onClose("transport error",e)}schedulePing(){this.pingIntervalTimer=(0,Qr.setTimeout)(()=>{Ae("writing ping packet - expecting pong within %sms",this.server.opts.pingTimeout),this.sendPacket("ping"),this.resetPingTimeout()},this.server.opts.pingInterval)}resetPingTimeout(){(0,Qr.clearTimeout)(this.pingTimeoutTimer),this.pingTimeoutTimer=(0,Qr.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){Ae("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){Ae('might upgrade socket transport from "%s" to "%s"',this.transport.name,e.name),this.upgrading=!0;let t=(0,Qr.setTimeout)(()=>{Ae("client did not complete upgrade - closing transport"),o(),e.readyState==="open"&&e.close()},this.server.opts.upgradeTimeout),n,i=p=>{p.type==="ping"&&p.data==="probe"?(Ae("got probe ping packet, sending pong"),e.send([{type:"pong",data:"probe"}]),this.emit("upgrading",e),clearInterval(n),n=setInterval(s,100)):p.type==="upgrade"&&this.readyState!=="closed"?(Ae("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&&(Ae("writing a noop packet to polling for fast upgrade"),this.transport.send([{type:"noop"}]))},o=()=>{this.upgrading=!1,clearInterval(n),(0,Qr.clearTimeout)(t),e.removeListener("packet",i),e.removeListener("close",c),e.removeListener("error",a),this.removeListener("close",u)},a=p=>{Ae("client did not complete upgrade - %s",p),o(),e.close(),e=null},c=()=>{a("transport closed")},u=()=>{a("socket closed")};e.on("packet",i),e.once("close",c),e.once("error",a),this.once("close",u)}clearTransport(){let e,t=this.cleanupFn.length;for(let n=0;n<t;n++)e=this.cleanupFn.shift(),e();this.transport.on("error",function(){Ae("error triggered by discarded transport")}),this.transport.close(),(0,Qr.clearTimeout)(this.pingTimeoutTimer)}onClose(e,t){this.readyState!=="closed"&&(this.readyState="closed",(0,Qr.clearTimeout)(this.pingIntervalTimer),(0,Qr.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"){Ae('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){Ae("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){Ae("there are %d remaining packets in the buffer, waiting for the 'drain' event",this.writeBuffer.length),this.once("drain",()=>{Ae("all packets have been sent, closing the transport"),this.closeTransport(e)});return}Ae("the buffer is empty, closing the transport right away"),this.closeTransport(e)}}closeTransport(e){Ae("closing the transport (discard? %s)",!!e),e&&this.transport.discard(),this.transport.close(this.onClose.bind(this,"forced close"))}};ic.Socket=Jp});var Kx=O(Zp=>{"use strict";Zp.parse=aI;Zp.serialize=cI;var tI=Object.prototype.toString,rI=Object.prototype.hasOwnProperty,nI=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,iI=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,sI=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,oI=/^[\u0020-\u003A\u003D-\u007E]*$/;function aI(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||lI,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=Gx(r,s,o),u=zx(r,o,c),p=r.slice(c,u);if(!rI.call(t,p)){var f=Gx(r,o+1,a),m=zx(r,a,f);r.charCodeAt(f)===34&&r.charCodeAt(m-1)===34&&(f++,m--);var y=r.slice(f,m);t[p]=pI(y,i)}s=a+1}while(s<n);return t}function Gx(r,e,t){do{var n=r.charCodeAt(e);if(n!==32&&n!==9)return e}while(++e<t);return t}function zx(r,e,t){for(;e>t;){var n=r.charCodeAt(--e);if(n!==32&&n!==9)return e+1}return t}function cI(r,e,t){var n=t&&t.encode||encodeURIComponent;if(typeof n!="function")throw new TypeError("option encode is invalid");if(!nI.test(r))throw new TypeError("argument name is invalid");var i=n(e);if(!iI.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(!sI.test(t.domain))throw new TypeError("option domain is invalid");s+="; Domain="+t.domain}if(t.path){if(!oI.test(t.path))throw new TypeError("option path is invalid");s+="; Path="+t.path}if(t.expires){var a=t.expires;if(!uI(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 u=typeof t.sameSite=="string"?t.sameSite.toLowerCase():t.sameSite;switch(u){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 lI(r){return r.indexOf("%")!==-1?decodeURIComponent(r):r}function uI(r){return tI.call(r)==="[object Date]"}function pI(r,e){try{return e(r)}catch{return r}}});var Zr=O((u6,Xx)=>{"use strict";var Vx=["nodebuffer","arraybuffer","fragments"],Yx=typeof Blob<"u";Yx&&Vx.push("blob");Xx.exports={BINARY_TYPES:Vx,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:Yx,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var fy=O((p6,py)=>{var ey=require("fs"),en=require("path"),ty=require("os"),ry=typeof __webpack_require__=="function"?__non_webpack_require__:require,fI=process.config&&process.config.variables||{},dI=!!process.env.PREBUILDS_ONLY,Jx=process.versions.modules,ef=gI()?"electron":mI()?"node-webkit":"node",tf=process.env.npm_config_arch||ty.arch(),rf=process.env.npm_config_platform||ty.platform(),ny=process.env.LIBC||(vI(rf)?"musl":"glibc"),nf=process.env.ARM_VERSION||(tf==="arm64"?"8":fI.arm_version)||"",iy=(process.versions.uv||"").split(".")[0];py.exports=Lr;function Lr(r){return ry(Lr.resolve(r))}Lr.resolve=Lr.path=function(r){r=en.resolve(r||".");try{var e=ry(en.join(r,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[e+"_PREBUILD"]&&(r=process.env[e+"_PREBUILD"])}catch{}if(!dI){var t=Qx(en.join(r,"build/Release"),Zx);if(t)return t;var n=Qx(en.join(r,"build/Debug"),Zx);if(n)return n}var i=a(r);if(i)return i;var s=a(en.dirname(process.execPath));if(s)return s;var o=["platform="+rf,"arch="+tf,"runtime="+ef,"abi="+Jx,"uv="+iy,nf?"armv="+nf:"","libc="+ny,"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 u=Wp(en.join(c,"prebuilds")).map(Ux),p=u.filter(Wx(qp,$p)).sort(Gx)[0];if(p){var f=en.join(c,"prebuilds",p.name),g=Wp(f).map(zx),y=g.filter(Kx(Hp,Lx)),b=y.sort(Vx(Hp))[0];if(b)return en.join(f,b.file)}}};function Wp(r){try{return jx.readdirSync(r)}catch{return[]}}function Dx(r,e){var t=Wp(r).filter(e);return t[0]&&en.join(r,t[0])}function Bx(r){return/\.node$/.test(r)}function Ux(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 Wx(r,e){return function(t){return t==null||t.platform!==r?!1:t.architectures.includes(e)}}function Gx(r,e){return r.architectures.length-e.architectures.length}function zx(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 Kx(r,e){return function(t){return!(t==null||t.runtime&&t.runtime!==r&&!WM(t)||t.abi&&t.abi!==e&&!t.napi||t.uv&&t.uv!==qx||t.armv&&t.armv!==Up||t.libc&&t.libc!==$x)}}function WM(r){return r.runtime==="node"&&r.napi}function Vx(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 GM(){return!!(process.versions&&process.versions.nw)}function zM(){return process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE?!0:typeof window<"u"&&window.process&&window.process.type==="renderer"}function KM(r){return r==="linux"&&jx.existsSync("/etc/alpine-release")}Dr.parseTags=zx;Dr.matchTags=Kx;Dr.compareTags=Vx;Dr.parseTuple=Ux;Dr.matchTuple=Wx;Dr.compareTuples=Gx});var Kp=O(($4,zp)=>{var Gp=typeof __webpack_require__=="function"?__non_webpack_require__:require;typeof Gp.addon=="function"?zp.exports=Gp.addon.bind(Gp):zp.exports=Xx()});var Qx=O((q4,Jx)=>{"use strict";var VM=(r,e,t,n,i)=>{for(var s=0;s<i;s++)t[n+s]=r[s]^e[s&3]},YM=(r,e)=>{let t=r.length;for(var n=0;n<t;n++)r[n]^=e[n&3]};Jx.exports={mask:VM,unmask:YM}});var Yp=O((U4,Vp)=>{"use strict";try{Vp.exports=Kp()(__dirname)}catch{Vp.exports=Qx()}});var ro=O((W4,Za)=>{"use strict";var{EMPTY_BUFFER:XM}=Zr(),Xp=Buffer[Symbol.species];function JM(r,e){if(r.length===0)return XM;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 Xp(t.buffer,t.byteOffset,n):t}function Zx(r,e,t,n,i){for(let s=0;s<i;s++)t[n+s]=r[s]^e[s&3]}function ey(r,e){for(let t=0;t<r.length;t++)r[t]^=e[t&3]}function QM(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function Jp(r){if(Jp.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new Xp(r):ArrayBuffer.isView(r)?e=new Xp(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),Jp.readOnly=!1),e}Za.exports={concat:JM,mask:Zx,toArrayBuffer:QM,toBuffer:Jp,unmask:ey};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=Yp();Za.exports.mask=function(e,t,n,i,s){s<48?Zx(e,t,n,i,s):r.mask(e,t,n,i,s)},Za.exports.unmask=function(e,t){e.length<32?ey(e,t):r.unmask(e,t)}}catch{}});var ny=O((G4,ry)=>{"use strict";var ty=Symbol("kDone"),Qp=Symbol("kRun"),Zp=class{constructor(e){this[ty]=()=>{this.pending--,this[Qp]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[Qp]()}[Qp](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[ty])}}};ry.exports=Zp});var io=O((z4,ay)=>{"use strict";var no=require("zlib"),iy=ro(),ZM=ny(),{kStatusCode:sy}=Zr(),eI=Buffer[Symbol.species],tI=Buffer.from([0,0,255,255]),tc=Symbol("permessage-deflate"),tn=Symbol("total-length"),Di=Symbol("callback"),kn=Symbol("buffers"),Bi=Symbol("error"),ec,ef=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,!ec){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;ec=new ZM(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[Di];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){ec.add(i=>{this._decompress(e,t,(s,o)=>{i(),n(s,o)})})}compress(e,t,n){ec.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"?no.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=no.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[tc]=this,this._inflate[tn]=0,this._inflate[kn]=[],this._inflate.on("error",nI),this._inflate.on("data",oy)}this._inflate[Di]=n,this._inflate.write(e),t&&this._inflate.write(tI),this._inflate.flush(()=>{let s=this._inflate[Bi];if(s){this._inflate.close(),this._inflate=null,n(s);return}let o=iy.concat(this._inflate[kn],this._inflate[tn]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[tn]=0,this._inflate[kn]=[],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"?no.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=no.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[tn]=0,this._deflate[kn]=[],this._deflate.on("data",rI)}this._deflate[Di]=n,this._deflate.write(e),this._deflate.flush(no.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=iy.concat(this._deflate[kn],this._deflate[tn]);t&&(s=new eI(s.buffer,s.byteOffset,s.length-4)),this._deflate[Di]=null,this._deflate[tn]=0,this._deflate[kn]=[],t&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,s)})}};ay.exports=ef;function rI(r){this[kn].push(r),this[tn]+=r.length}function oy(r){if(this[tn]+=r.length,this[tc]._maxPayload<1||this[tn]<=this[tc]._maxPayload){this[kn].push(r);return}this[Bi]=new RangeError("Max payload size exceeded"),this[Bi].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Bi][sy]=1009,this.removeListener("data",oy),this.reset()}function nI(r){if(this[tc]._inflate=null,this[Bi]){this[Di](this[Bi]);return}r[sy]=1007,this[Di](r)}});var ly=O((K4,cy)=>{"use strict";function iI(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}cy.exports=iI});var rf=O((V4,tf)=>{"use strict";try{tf.exports=Kp()(__dirname)}catch{tf.exports=ly()}});var ji=O((Y4,rc)=>{"use strict";var{isUtf8:uy}=require("buffer"),{hasBlob:sI}=Zr(),oI=[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 aI(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function nf(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 cI(r){return sI&&typeof r=="object"&&typeof r.arrayBuffer=="function"&&typeof r.type=="string"&&typeof r.stream=="function"&&(r[Symbol.toStringTag]==="Blob"||r[Symbol.toStringTag]==="File")}rc.exports={isBlob:cI,isValidStatusCode:aI,isValidUTF8:nf,tokenChars:oI};if(uy)rc.exports.isValidUTF8=function(r){return r.length<24?nf(r):uy(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=rf();rc.exports.isValidUTF8=function(e){return e.length<32?nf(e):r(e)}}catch{}});var lf=O((X4,vy)=>{"use strict";var{Writable:lI}=require("stream"),py=io(),{BINARY_TYPES:uI,EMPTY_BUFFER:fy,kStatusCode:pI,kWebSocket:fI}=Zr(),{concat:sf,toArrayBuffer:dI,unmask:hI}=ro(),{isValidStatusCode:mI,isValidUTF8:dy}=ji(),nc=Buffer[Symbol.species],rr=0,hy=1,my=2,gy=3,of=4,af=5,ic=6,cf=class extends lI{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||uI[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[fI]=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=rr}_write(e,t,n){if(this._opcode===8&&this._state==rr)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 nc(n.buffer,n.byteOffset+e,n.length-e),new nc(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 nc(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 rr:this.getInfo(e);break;case hy:this.getPayloadLength16(e);break;case my:this.getPayloadLength64(e);break;case gy:this.getMask();break;case of:this.getData(e);break;case af:case ic: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[py.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=hy:this._payloadLength===127?this._state=my: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=gy:this._state=of}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=of}getData(e){let t=fy;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&&hI(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=af,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[py.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===rr&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=rr;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=sf(n,t):this._binaryType==="arraybuffer"?i=dI(sf(n,t)):this._binaryType==="blob"?i=new Blob(n):i=n,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=rr):(this._state=ic,setImmediate(()=>{this.emit("message",i,!0),this._state=rr,this.startLoop(e)}))}else{let i=sf(n,t);if(!this._skipUTF8Validation&&!dy(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(s);return}this._state===af||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=rr):(this._state=ic,setImmediate(()=>{this.emit("message",i,!1),this._state=rr,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,fy),this.end();else{let n=e.readUInt16BE(0);if(!mI(n)){let s=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(s);return}let i=new nc(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!dy(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=rr;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=rr):(this._state=ic,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=rr,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[pI]=i,o}};vy.exports=cf});var ff=O((Q4,_y)=>{"use strict";var{Duplex:J4}=require("stream"),{randomFillSync:gI}=require("crypto"),xy=io(),{EMPTY_BUFFER:vI,kWebSocket:xI,NOOP:yI}=Zr(),{isBlob:Fi,isValidStatusCode:_I}=ji(),{mask:yy,toBuffer:Kn}=ro(),nr=Symbol("kByteLength"),bI=Buffer.alloc(4),sc=8*1024,Vn,Hi=sc,wr=0,wI=1,SI=2,uf=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=wr,this.onerror=yI,this[xI]=void 0}static frame(e,t){let n,i=!1,s=2,o=!1;t.mask&&(n=t.maskBuffer||bI,t.generateMask?t.generateMask(n):(Hi===sc&&(Vn===void 0&&(Vn=Buffer.alloc(sc)),gI(Vn,0,sc),Hi=0),n[0]=Vn[Hi++],n[1]=Vn[Hi++],n[2]=Vn[Hi++],n[3]=Vn[Hi++]),o=(n[0]|n[1]|n[2]|n[3])===0,s=6);let a;typeof e=="string"?(!t.mask||o)&&t[nr]!==void 0?a=t[nr]:(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 u=Buffer.allocUnsafe(i?a+s:s);return u[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(u[0]|=64),u[1]=c,c===126?u.writeUInt16BE(a,2):c===127&&(u[2]=u[3]=0,u.writeUIntBE(a,4,6)),t.mask?(u[1]|=128,u[s-4]=n[0],u[s-3]=n[1],u[s-2]=n[2],u[s-1]=n[3],o?[u,e]:i?(yy(e,n,u,s,a),[u]):(yy(e,n,e,0,a),[u,e])):[u,e]}close(e,t,n,i){let s;if(e===void 0)s=vI;else{if(typeof e!="number"||!_I(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={[nr]:s.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==wr?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):Fi(e)?(i=e.size,s=!1):(e=Kn(e),i=e.length,s=Kn.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[nr]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};Fi(e)?this._state!==wr?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==wr?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):Fi(e)?(i=e.size,s=!1):(e=Kn(e),i=e.length,s=Kn.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[nr]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};Fi(e)?this._state!==wr?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==wr?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}send(e,t,n){let i=this._extensions[xy.extensionName],s=t.binary?2:1,o=t.compress,a,c;typeof e=="string"?(a=Buffer.byteLength(e),c=!1):Fi(e)?(a=e.size,c=!1):(e=Kn(e),a=e.length,c=Kn.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 u={[nr]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:c,rsv1:o};Fi(e)?this._state!==wr?this.enqueue([this.getBlobData,e,this._compress,u,n]):this.getBlobData(e,this._compress,u,n):this._state!==wr?this.enqueue([this.dispatch,e,this._compress,u,n]):this.dispatch(e,this._compress,u,n)}getBlobData(e,t,n,i){this._bufferedBytes+=n[nr],this._state=SI,e.arrayBuffer().then(s=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(pf,this,a,i);return}this._bufferedBytes-=n[nr];let o=Kn(s);t?this.dispatch(o,t,n,i):(this._state=wr,this.sendFrame(r.frame(o,n),i),this.dequeue())}).catch(s=>{process.nextTick(EI,this,s,i)})}dispatch(e,t,n,i){if(!t){this.sendFrame(r.frame(e,n),i);return}let s=this._extensions[xy.extensionName];this._bufferedBytes+=n[nr],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");pf(this,c,i);return}this._bufferedBytes-=n[nr],this._state=wr,n.readOnly=!1,this.sendFrame(r.frame(a,n),i),this.dequeue()})}dequeue(){for(;this._state===wr&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][nr],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][nr],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)}};_y.exports=uf;function pf(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 EI(r,e,t){pf(r,e,t),r.onerror(e)}});var ky=O((Z4,Ry)=>{"use strict";var{kForOnEventAttribute:so,kListener:df}=Zr(),by=Symbol("kCode"),wy=Symbol("kData"),Sy=Symbol("kError"),Ey=Symbol("kMessage"),Ty=Symbol("kReason"),$i=Symbol("kTarget"),Cy=Symbol("kType"),Ay=Symbol("kWasClean"),rn=class{constructor(e){this[$i]=null,this[Cy]=e}get target(){return this[$i]}get type(){return this[Cy]}};Object.defineProperty(rn.prototype,"target",{enumerable:!0});Object.defineProperty(rn.prototype,"type",{enumerable:!0});var Yn=class extends rn{constructor(e,t={}){super(e),this[by]=t.code===void 0?0:t.code,this[Ty]=t.reason===void 0?"":t.reason,this[Ay]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[by]}get reason(){return this[Ty]}get wasClean(){return this[Ay]}};Object.defineProperty(Yn.prototype,"code",{enumerable:!0});Object.defineProperty(Yn.prototype,"reason",{enumerable:!0});Object.defineProperty(Yn.prototype,"wasClean",{enumerable:!0});var qi=class extends rn{constructor(e,t={}){super(e),this[Sy]=t.error===void 0?null:t.error,this[Ey]=t.message===void 0?"":t.message}get error(){return this[Sy]}get message(){return this[Ey]}};Object.defineProperty(qi.prototype,"error",{enumerable:!0});Object.defineProperty(qi.prototype,"message",{enumerable:!0});var oo=class extends rn{constructor(e,t={}){super(e),this[wy]=t.data===void 0?null:t.data}get data(){return this[wy]}};Object.defineProperty(oo.prototype,"data",{enumerable:!0});var TI={addEventListener(r,e,t={}){for(let i of this.listeners(r))if(!t[so]&&i[df]===e&&!i[so])return;let n;if(r==="message")n=function(s,o){let a=new oo("message",{data:o?s:s.toString()});a[$i]=this,oc(e,this,a)};else if(r==="close")n=function(s,o){let a=new Yn("close",{code:s,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[$i]=this,oc(e,this,a)};else if(r==="error")n=function(s){let o=new qi("error",{error:s,message:s.message});o[$i]=this,oc(e,this,o)};else if(r==="open")n=function(){let s=new rn("open");s[$i]=this,oc(e,this,s)};else return;n[so]=!!t[so],n[df]=e,t.once?this.once(r,n):this.on(r,n)},removeEventListener(r,e){for(let t of this.listeners(r))if(t[df]===e&&!t[so]){this.removeListener(r,t);break}}};Ry.exports={CloseEvent:Yn,ErrorEvent:qi,Event:rn,EventTarget:TI,MessageEvent:oo};function oc(r,e,t){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,t):r.call(e,t)}});var hf=O((e6,Oy)=>{"use strict";var{tokenChars:ao}=ji();function Br(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}function CI(r){let e=Object.create(null),t=Object.create(null),n=!1,i=!1,s=!1,o,a,c=-1,u=-1,p=-1,f=0;for(;f<r.length;f++)if(u=r.charCodeAt(f),o===void 0)if(p===-1&&ao[u]===1)c===-1&&(c=f);else if(f!==0&&(u===32||u===9))p===-1&&c!==-1&&(p=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f);let y=r.slice(c,p);u===44?(Br(e,y,t),t=Object.create(null)):o=y,c=p=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);else if(a===void 0)if(p===-1&&ao[u]===1)c===-1&&(c=f);else if(u===32||u===9)p===-1&&c!==-1&&(p=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f),Br(t,r.slice(c,p),!0),u===44&&(Br(e,o,t),t=Object.create(null),o=void 0),c=p=-1}else if(u===61&&c!==-1&&p===-1)a=r.slice(c,f),c=p=-1;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(i){if(ao[u]!==1)throw new SyntaxError(`Unexpected character at index ${f}`);c===-1?c=f:n||(n=!0),i=!1}else if(s)if(ao[u]===1)c===-1&&(c=f);else if(u===34&&c!==-1)s=!1,p=f;else if(u===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(u===34&&r.charCodeAt(f-1)===61)s=!0;else if(p===-1&&ao[u]===1)c===-1&&(c=f);else if(c!==-1&&(u===32||u===9))p===-1&&(p=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f);let y=r.slice(c,p);n&&(y=y.replace(/\\/g,""),n=!1),Br(t,a,y),u===44&&(Br(e,o,t),t=Object.create(null),o=void 0),a=void 0,c=p=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);if(c===-1||s||u===32||u===9)throw new SyntaxError("Unexpected end of input");p===-1&&(p=f);let g=r.slice(c,p);return o===void 0?Br(e,g,t):(a===void 0?Br(t,g,!0):n?Br(t,a,g.replace(/\\/g,"")):Br(t,a,g),Br(e,o,t)),e}function AI(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(", ")}Oy.exports={format:AI,parse:CI}});var uc=O((n6,qy)=>{"use strict";var RI=require("events"),kI=require("https"),OI=require("http"),Iy=require("net"),PI=require("tls"),{randomBytes:MI,createHash:II}=require("crypto"),{Duplex:t6,Readable:r6}=require("stream"),{URL:mf}=require("url"),On=io(),NI=lf(),LI=ff(),{isBlob:DI}=ji(),{BINARY_TYPES:Py,EMPTY_BUFFER:ac,GUID:BI,kForOnEventAttribute:gf,kListener:jI,kStatusCode:FI,kWebSocket:lt,NOOP:Ny}=Zr(),{EventTarget:{addEventListener:HI,removeEventListener:$I}}=ky(),{format:qI,parse:UI}=hf(),{toBuffer:WI}=ro(),GI=30*1e3,Ly=Symbol("kAborted"),vf=[8,13],nn=["CONNECTING","OPEN","CLOSING","CLOSED"],zI=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,ye=class r extends RI{constructor(e,t,n){super(),this._binaryType=Py[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=ac,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]),Dy(this,e,t,n)):(this._autoPong=n.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){Py.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 NI({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),s=new LI(e,this._extensions,n.generateMask);this._receiver=i,this._sender=s,this._socket=e,i[lt]=this,s[lt]=this,e[lt]=this,i.on("conclude",YI),i.on("drain",XI),i.on("error",JI),i.on("message",QI),i.on("ping",ZI),i.on("pong",eN),s.onerror=tN,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",Fy),e.on("data",lc),e.on("end",Hy),e.on("error",$y),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[On.extensionName]&&this._extensions[On.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){Wt(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())}),jy(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){xf(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||ac,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){xf(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||ac,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){xf(this,e,n);return}let i={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[On.extensionName]||(i.compress=!1),this._sender.send(e||ac,i,n)}terminate(){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){Wt(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=r.CLOSING,this._socket.destroy())}}};Object.defineProperty(ye,"CONNECTING",{enumerable:!0,value:nn.indexOf("CONNECTING")});Object.defineProperty(ye.prototype,"CONNECTING",{enumerable:!0,value:nn.indexOf("CONNECTING")});Object.defineProperty(ye,"OPEN",{enumerable:!0,value:nn.indexOf("OPEN")});Object.defineProperty(ye.prototype,"OPEN",{enumerable:!0,value:nn.indexOf("OPEN")});Object.defineProperty(ye,"CLOSING",{enumerable:!0,value:nn.indexOf("CLOSING")});Object.defineProperty(ye.prototype,"CLOSING",{enumerable:!0,value:nn.indexOf("CLOSING")});Object.defineProperty(ye,"CLOSED",{enumerable:!0,value:nn.indexOf("CLOSED")});Object.defineProperty(ye.prototype,"CLOSED",{enumerable:!0,value:nn.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(ye.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(ye.prototype,`on${r}`,{enumerable:!0,get(){for(let e of this.listeners(r))if(e[gf])return e[jI];return null},set(e){for(let t of this.listeners(r))if(t[gf]){this.removeListener(r,t);break}typeof e=="function"&&this.addEventListener(r,e,{[gf]:!0})}})});ye.prototype.addEventListener=HI;ye.prototype.removeEventListener=$I;qy.exports=ye;function Dy(r,e,t,n){let i={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:vf[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,!vf.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${vf.join(", ")})`);let s;if(e instanceof mf)s=e;else try{s=new mf(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;cc(r,S);return}let u=o?443:80,p=MI(16).toString("base64"),f=o?kI.request:OI.request,g=new Set,y;if(i.createConnection=i.createConnection||(o?VI:KI),i.defaultPort=i.defaultPort||u,i.port=s.port||u,i.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":p,Connection:"Upgrade",Upgrade:"websocket"},i.path=s.pathname+s.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(y=new On(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=qI({[On.extensionName]:y.offer()})),t.length){for(let S of t){if(typeof S!="string"||!zI.test(S)||g.has(S))throw new SyntaxError("An invalid or duplicated subprotocol was specified");g.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 b;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[R,I]of Object.entries(S))n.headers[R.toLowerCase()]=I}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")),b=r._req=f(i),r._redirects&&r.emit("redirect",r.url,b)}else b=r._req=f(i);i.timeout&&b.on("timeout",()=>{Wt(r,b,"Opening handshake has timed out")}),b.on("error",S=>{b===null||b[Ly]||(b=r._req=null,cc(r,S))}),b.on("response",S=>{let R=S.headers.location,I=S.statusCode;if(R&&i.followRedirects&&I>=300&&I<400){if(++r._redirects>i.maxRedirects){Wt(r,b,"Maximum redirects exceeded");return}b.abort();let L;try{L=new mf(R,e)}catch{let H=new SyntaxError(`Invalid URL: ${R}`);cc(r,H);return}Dy(r,L,t,n)}else r.emit("unexpected-response",b,S)||Wt(r,b,`Unexpected server response: ${S.statusCode}`)}),b.on("upgrade",(S,R,I)=>{if(r.emit("upgrade",S),r.readyState!==ye.CONNECTING)return;b=r._req=null;let L=S.headers.upgrade;if(L===void 0||L.toLowerCase()!=="websocket"){Wt(r,R,"Invalid Upgrade header");return}let N=II("sha1").update(p+BI).digest("base64");if(S.headers["sec-websocket-accept"]!==N){Wt(r,R,"Invalid Sec-WebSocket-Accept header");return}let H=S.headers["sec-websocket-protocol"],W;if(H!==void 0?g.size?g.has(H)||(W="Server sent an invalid subprotocol"):W="Server sent a subprotocol but none was requested":g.size&&(W="Server sent no subprotocol"),W){Wt(r,R,W);return}H&&(r._protocol=H);let U=S.headers["sec-websocket-extensions"];if(U!==void 0){if(!y){Wt(r,R,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let G;try{G=UI(U)}catch{Wt(r,R,"Invalid Sec-WebSocket-Extensions header");return}let P=Object.keys(G);if(P.length!==1||P[0]!==On.extensionName){Wt(r,R,"Server indicated an extension that was not requested");return}try{y.accept(G[On.extensionName])}catch{Wt(r,R,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[On.extensionName]=y}r.setSocket(R,I,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(b,r):b.end()}function cc(r,e){r._readyState=ye.CLOSING,r._errorEmitted=!0,r.emit("error",e),r.emitClose()}function KI(r){return r.path=r.socketPath,Iy.connect(r)}function VI(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=Iy.isIP(r.host)?"":r.host),PI.connect(r)}function Wt(r,e,t){r._readyState=ye.CLOSING;let n=new Error(t);Error.captureStackTrace(n,Wt),e.setHeader?(e[Ly]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(cc,r,n)):(e.destroy(n),e.once("error",r.emit.bind(r,"error")),e.once("close",r.emitClose.bind(r)))}function xf(r,e,t){if(e){let n=DI(e)?e.size:WI(e).length;r._socket?r._sender._bufferedBytes+=n:r._bufferedAmount+=n}if(t){let n=new Error(`WebSocket is not open: readyState ${r.readyState} (${nn[r.readyState]})`);process.nextTick(t,n)}}function YI(r,e){let t=this[lt];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=r,t._socket[lt]!==void 0&&(t._socket.removeListener("data",lc),process.nextTick(By,t._socket),r===1005?t.close():t.close(r,e))}function XI(){let r=this[lt];r.isPaused||r._socket.resume()}function JI(r){let e=this[lt];e._socket[lt]!==void 0&&(e._socket.removeListener("data",lc),process.nextTick(By,e._socket),e.close(r[FI])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r))}function My(){this[lt].emitClose()}function QI(r,e){this[lt].emit("message",r,e)}function ZI(r){let e=this[lt];e._autoPong&&e.pong(r,!this._isServer,Ny),e.emit("ping",r)}function eN(r){this[lt].emit("pong",r)}function By(r){r.resume()}function tN(r){let e=this[lt];e.readyState!==ye.CLOSED&&(e.readyState===ye.OPEN&&(e._readyState=ye.CLOSING,jy(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r)))}function jy(r){r._closeTimer=setTimeout(r._socket.destroy.bind(r._socket),GI)}function Fy(){let r=this[lt];this.removeListener("close",Fy),this.removeListener("data",lc),this.removeListener("end",Hy),r._readyState=ye.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[lt]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",My),r._receiver.on("finish",My))}function lc(r){this[lt]._receiver.write(r)||this.pause()}function Hy(){let r=this[lt];r._readyState=ye.CLOSING,r._receiver.end(),this.end()}function $y(){let r=this[lt];this.removeListener("error",$y),this.on("error",Ny),r&&(r._readyState=ye.CLOSING,this.destroy())}});var zy=O((s6,Gy)=>{"use strict";var i6=uc(),{Duplex:rN}=require("stream");function Uy(r){r.emit("close")}function nN(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Wy(r){this.removeListener("error",Wy),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function iN(r,e){let t=!0,n=new rN({...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(Uy,n);return}let o=!1;r.once("error",function(c){o=!0,s(c)}),r.once("close",function(){o||s(i),process.nextTick(Uy,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",Wy),n}Gy.exports=iN});var Vy=O((o6,Ky)=>{"use strict";var{tokenChars:sN}=ji();function oN(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&&sN[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}Ky.exports={parse:oN}});var t0=O((c6,e0)=>{"use strict";var aN=require("events"),pc=require("http"),{Duplex:a6}=require("stream"),{createHash:cN}=require("crypto"),Yy=hf(),Xn=io(),lN=Vy(),uN=uc(),{GUID:pN,kWebSocket:fN}=Zr(),dN=/^[+/0-9A-Za-z]{22}==$/,Xy=0,Jy=1,Zy=2,yf=class extends aN{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:uN,...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=pc.createServer((n,i)=>{let s=pc.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=hN(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=Xy}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===Zy){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(co,this);return}if(e&&this.once("close",e),this._state!==Jy)if(this._state=Jy,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(co,this):process.nextTick(co,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{co(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",Qy);let s=e.headers["sec-websocket-key"],o=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){Jn(this,e,t,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){Jn(this,e,t,400,"Invalid Upgrade header");return}if(s===void 0||!dN.test(s)){Jn(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){Jn(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){lo(t,400);return}let c=e.headers["sec-websocket-protocol"],u=new Set;if(c!==void 0)try{u=lN.parse(c)}catch{Jn(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let p=e.headers["sec-websocket-extensions"],f={};if(this.options.perMessageDeflate&&p!==void 0){let g=new Xn(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let y=Yy.parse(p);y[Xn.extensionName]&&(g.accept(y[Xn.extensionName]),f[Xn.extensionName]=g)}catch{Jn(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let g={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(g,(y,b,S,R)=>{if(!y)return lo(t,b||401,S,R);this.completeUpgrade(f,s,u,e,t,n,i)});return}if(!this.options.verifyClient(g))return lo(t,401)}this.completeUpgrade(f,s,u,e,t,n,i)}completeUpgrade(e,t,n,i,s,o,a){if(!s.readable||!s.writable)return s.destroy();if(s[fN])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Xy)return lo(s,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${cN("sha1").update(t+pN).digest("base64")}`],p=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&&(u.push(`Sec-WebSocket-Protocol: ${f}`),p._protocol=f)}if(e[Xn.extensionName]){let f=e[Xn.extensionName].params,g=Yy.format({[Xn.extensionName]:[f]});u.push(`Sec-WebSocket-Extensions: ${g}`),p._extensions=e}this.emit("headers",u,i),s.write(u.concat(`\r
|
|
12
|
+
`);function a(c){var u=sf(en.join(c,"prebuilds")).map(sy),p=u.filter(oy(rf,tf)).sort(ay)[0];if(p){var f=en.join(c,"prebuilds",p.name),m=sf(f).map(cy),y=m.filter(ly(ef,Jx)),_=y.sort(uy(ef))[0];if(_)return en.join(f,_.file)}}};function sf(r){try{return ey.readdirSync(r)}catch{return[]}}function Qx(r,e){var t=sf(r).filter(e);return t[0]&&en.join(r,t[0])}function Zx(r){return/\.node$/.test(r)}function sy(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 oy(r,e){return function(t){return t==null||t.platform!==r?!1:t.architectures.includes(e)}}function ay(r,e){return r.architectures.length-e.architectures.length}function cy(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 ly(r,e){return function(t){return!(t==null||t.runtime&&t.runtime!==r&&!hI(t)||t.abi&&t.abi!==e&&!t.napi||t.uv&&t.uv!==iy||t.armv&&t.armv!==nf||t.libc&&t.libc!==ny)}}function hI(r){return r.runtime==="node"&&r.napi}function uy(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 mI(){return!!(process.versions&&process.versions.nw)}function gI(){return process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE?!0:typeof window<"u"&&window.process&&window.process.type==="renderer"}function vI(r){return r==="linux"&&ey.existsSync("/etc/alpine-release")}Lr.parseTags=cy;Lr.matchTags=ly;Lr.compareTags=uy;Lr.parseTuple=sy;Lr.matchTuple=oy;Lr.compareTuples=ay});var cf=O((f6,af)=>{var of=typeof __webpack_require__=="function"?__non_webpack_require__:require;typeof of.addon=="function"?af.exports=of.addon.bind(of):af.exports=fy()});var hy=O((d6,dy)=>{"use strict";var xI=(r,e,t,n,i)=>{for(var s=0;s<i;s++)t[n+s]=r[s]^e[s&3]},yI=(r,e)=>{let t=r.length;for(var n=0;n<t;n++)r[n]^=e[n&3]};dy.exports={mask:xI,unmask:yI}});var uf=O((h6,lf)=>{"use strict";try{lf.exports=cf()(__dirname)}catch{lf.exports=hy()}});var io=O((m6,sc)=>{"use strict";var{EMPTY_BUFFER:_I}=Zr(),pf=Buffer[Symbol.species];function bI(r,e){if(r.length===0)return _I;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 pf(t.buffer,t.byteOffset,n):t}function my(r,e,t,n,i){for(let s=0;s<i;s++)t[n+s]=r[s]^e[s&3]}function gy(r,e){for(let t=0;t<r.length;t++)r[t]^=e[t&3]}function wI(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function ff(r){if(ff.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new pf(r):ArrayBuffer.isView(r)?e=new pf(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),ff.readOnly=!1),e}sc.exports={concat:bI,mask:my,toArrayBuffer:wI,toBuffer:ff,unmask:gy};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=uf();sc.exports.mask=function(e,t,n,i,s){s<48?my(e,t,n,i,s):r.mask(e,t,n,i,s)},sc.exports.unmask=function(e,t){e.length<32?gy(e,t):r.unmask(e,t)}}catch{}});var yy=O((g6,xy)=>{"use strict";var vy=Symbol("kDone"),df=Symbol("kRun"),hf=class{constructor(e){this[vy]=()=>{this.pending--,this[df]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[df]()}[df](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[vy])}}};xy.exports=hf});var oo=O((v6,Sy)=>{"use strict";var so=require("zlib"),_y=io(),SI=yy(),{kStatusCode:by}=Zr(),EI=Buffer[Symbol.species],TI=Buffer.from([0,0,255,255]),ac=Symbol("permessage-deflate"),tn=Symbol("total-length"),Fi=Symbol("callback"),Mn=Symbol("buffers"),Hi=Symbol("error"),oc,mf=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,!oc){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;oc=new SI(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[Fi];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){oc.add(i=>{this._decompress(e,t,(s,o)=>{i(),n(s,o)})})}compress(e,t,n){oc.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"?so.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=so.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[ac]=this,this._inflate[tn]=0,this._inflate[Mn]=[],this._inflate.on("error",AI),this._inflate.on("data",wy)}this._inflate[Fi]=n,this._inflate.write(e),t&&this._inflate.write(TI),this._inflate.flush(()=>{let s=this._inflate[Hi];if(s){this._inflate.close(),this._inflate=null,n(s);return}let o=_y.concat(this._inflate[Mn],this._inflate[tn]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[tn]=0,this._inflate[Mn]=[],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"?so.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=so.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[tn]=0,this._deflate[Mn]=[],this._deflate.on("data",CI)}this._deflate[Fi]=n,this._deflate.write(e),this._deflate.flush(so.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=_y.concat(this._deflate[Mn],this._deflate[tn]);t&&(s=new EI(s.buffer,s.byteOffset,s.length-4)),this._deflate[Fi]=null,this._deflate[tn]=0,this._deflate[Mn]=[],t&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,s)})}};Sy.exports=mf;function CI(r){this[Mn].push(r),this[tn]+=r.length}function wy(r){if(this[tn]+=r.length,this[ac]._maxPayload<1||this[tn]<=this[ac]._maxPayload){this[Mn].push(r);return}this[Hi]=new RangeError("Max payload size exceeded"),this[Hi].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Hi][by]=1009,this.removeListener("data",wy),this.reset()}function AI(r){if(this[ac]._inflate=null,this[Hi]){this[Fi](this[Hi]);return}r[by]=1007,this[Fi](r)}});var Ty=O((x6,Ey)=>{"use strict";function RI(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}Ey.exports=RI});var vf=O((y6,gf)=>{"use strict";try{gf.exports=cf()(__dirname)}catch{gf.exports=Ty()}});var $i=O((_6,cc)=>{"use strict";var{isUtf8:Cy}=require("buffer"),{hasBlob:kI}=Zr(),OI=[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 PI(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function xf(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 MI(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")}cc.exports={isBlob:MI,isValidStatusCode:PI,isValidUTF8:xf,tokenChars:OI};if(Cy)cc.exports.isValidUTF8=function(r){return r.length<24?xf(r):Cy(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=vf();cc.exports.isValidUTF8=function(e){return e.length<32?xf(e):r(e)}}catch{}});var Sf=O((b6,Iy)=>{"use strict";var{Writable:II}=require("stream"),Ay=oo(),{BINARY_TYPES:NI,EMPTY_BUFFER:Ry,kStatusCode:LI,kWebSocket:DI}=Zr(),{concat:yf,toArrayBuffer:BI,unmask:jI}=io(),{isValidStatusCode:FI,isValidUTF8:ky}=$i(),lc=Buffer[Symbol.species],ir=0,Oy=1,Py=2,My=3,_f=4,bf=5,uc=6,wf=class extends II{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||NI[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[DI]=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=ir}_write(e,t,n){if(this._opcode===8&&this._state==ir)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 lc(n.buffer,n.byteOffset+e,n.length-e),new lc(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 lc(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 ir:this.getInfo(e);break;case Oy:this.getPayloadLength16(e);break;case Py:this.getPayloadLength64(e);break;case My:this.getMask();break;case _f:this.getData(e);break;case bf:case uc: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[Ay.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=Oy:this._payloadLength===127?this._state=Py: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=My:this._state=_f}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=_f}getData(e){let t=Ry;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&&jI(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=bf,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[Ay.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===ir&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=ir;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=yf(n,t):this._binaryType==="arraybuffer"?i=BI(yf(n,t)):this._binaryType==="blob"?i=new Blob(n):i=n,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=ir):(this._state=uc,setImmediate(()=>{this.emit("message",i,!0),this._state=ir,this.startLoop(e)}))}else{let i=yf(n,t);if(!this._skipUTF8Validation&&!ky(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(s);return}this._state===bf||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=ir):(this._state=uc,setImmediate(()=>{this.emit("message",i,!1),this._state=ir,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,Ry),this.end();else{let n=e.readUInt16BE(0);if(!FI(n)){let s=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(s);return}let i=new lc(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!ky(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=ir;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=ir):(this._state=uc,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=ir,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[LI]=i,o}};Iy.exports=wf});var Cf=O((S6,Dy)=>{"use strict";var{Duplex:w6}=require("stream"),{randomFillSync:HI}=require("crypto"),Ny=oo(),{EMPTY_BUFFER:$I,kWebSocket:qI,NOOP:UI}=Zr(),{isBlob:qi,isValidStatusCode:WI}=$i(),{mask:Ly,toBuffer:Xn}=io(),sr=Symbol("kByteLength"),GI=Buffer.alloc(4),pc=8*1024,Jn,Ui=pc,wr=0,zI=1,KI=2,Ef=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=wr,this.onerror=UI,this[qI]=void 0}static frame(e,t){let n,i=!1,s=2,o=!1;t.mask&&(n=t.maskBuffer||GI,t.generateMask?t.generateMask(n):(Ui===pc&&(Jn===void 0&&(Jn=Buffer.alloc(pc)),HI(Jn,0,pc),Ui=0),n[0]=Jn[Ui++],n[1]=Jn[Ui++],n[2]=Jn[Ui++],n[3]=Jn[Ui++]),o=(n[0]|n[1]|n[2]|n[3])===0,s=6);let a;typeof e=="string"?(!t.mask||o)&&t[sr]!==void 0?a=t[sr]:(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 u=Buffer.allocUnsafe(i?a+s:s);return u[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(u[0]|=64),u[1]=c,c===126?u.writeUInt16BE(a,2):c===127&&(u[2]=u[3]=0,u.writeUIntBE(a,4,6)),t.mask?(u[1]|=128,u[s-4]=n[0],u[s-3]=n[1],u[s-2]=n[2],u[s-1]=n[3],o?[u,e]:i?(Ly(e,n,u,s,a),[u]):(Ly(e,n,e,0,a),[u,e])):[u,e]}close(e,t,n,i){let s;if(e===void 0)s=$I;else{if(typeof e!="number"||!WI(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={[sr]:s.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==wr?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):qi(e)?(i=e.size,s=!1):(e=Xn(e),i=e.length,s=Xn.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[sr]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};qi(e)?this._state!==wr?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==wr?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):qi(e)?(i=e.size,s=!1):(e=Xn(e),i=e.length,s=Xn.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[sr]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};qi(e)?this._state!==wr?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==wr?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}send(e,t,n){let i=this._extensions[Ny.extensionName],s=t.binary?2:1,o=t.compress,a,c;typeof e=="string"?(a=Buffer.byteLength(e),c=!1):qi(e)?(a=e.size,c=!1):(e=Xn(e),a=e.length,c=Xn.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 u={[sr]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:c,rsv1:o};qi(e)?this._state!==wr?this.enqueue([this.getBlobData,e,this._compress,u,n]):this.getBlobData(e,this._compress,u,n):this._state!==wr?this.enqueue([this.dispatch,e,this._compress,u,n]):this.dispatch(e,this._compress,u,n)}getBlobData(e,t,n,i){this._bufferedBytes+=n[sr],this._state=KI,e.arrayBuffer().then(s=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(Tf,this,a,i);return}this._bufferedBytes-=n[sr];let o=Xn(s);t?this.dispatch(o,t,n,i):(this._state=wr,this.sendFrame(r.frame(o,n),i),this.dequeue())}).catch(s=>{process.nextTick(VI,this,s,i)})}dispatch(e,t,n,i){if(!t){this.sendFrame(r.frame(e,n),i);return}let s=this._extensions[Ny.extensionName];this._bufferedBytes+=n[sr],this._state=zI,s.compress(e,n.fin,(o,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");Tf(this,c,i);return}this._bufferedBytes-=n[sr],this._state=wr,n.readOnly=!1,this.sendFrame(r.frame(a,n),i),this.dequeue()})}dequeue(){for(;this._state===wr&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][sr],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][sr],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)}};Dy.exports=Ef;function Tf(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 VI(r,e,t){Tf(r,e,t),r.onerror(e)}});var Gy=O((E6,Wy)=>{"use strict";var{kForOnEventAttribute:ao,kListener:Af}=Zr(),By=Symbol("kCode"),jy=Symbol("kData"),Fy=Symbol("kError"),Hy=Symbol("kMessage"),$y=Symbol("kReason"),Wi=Symbol("kTarget"),qy=Symbol("kType"),Uy=Symbol("kWasClean"),rn=class{constructor(e){this[Wi]=null,this[qy]=e}get target(){return this[Wi]}get type(){return this[qy]}};Object.defineProperty(rn.prototype,"target",{enumerable:!0});Object.defineProperty(rn.prototype,"type",{enumerable:!0});var Qn=class extends rn{constructor(e,t={}){super(e),this[By]=t.code===void 0?0:t.code,this[$y]=t.reason===void 0?"":t.reason,this[Uy]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[By]}get reason(){return this[$y]}get wasClean(){return this[Uy]}};Object.defineProperty(Qn.prototype,"code",{enumerable:!0});Object.defineProperty(Qn.prototype,"reason",{enumerable:!0});Object.defineProperty(Qn.prototype,"wasClean",{enumerable:!0});var Gi=class extends rn{constructor(e,t={}){super(e),this[Fy]=t.error===void 0?null:t.error,this[Hy]=t.message===void 0?"":t.message}get error(){return this[Fy]}get message(){return this[Hy]}};Object.defineProperty(Gi.prototype,"error",{enumerable:!0});Object.defineProperty(Gi.prototype,"message",{enumerable:!0});var co=class extends rn{constructor(e,t={}){super(e),this[jy]=t.data===void 0?null:t.data}get data(){return this[jy]}};Object.defineProperty(co.prototype,"data",{enumerable:!0});var YI={addEventListener(r,e,t={}){for(let i of this.listeners(r))if(!t[ao]&&i[Af]===e&&!i[ao])return;let n;if(r==="message")n=function(s,o){let a=new co("message",{data:o?s:s.toString()});a[Wi]=this,fc(e,this,a)};else if(r==="close")n=function(s,o){let a=new Qn("close",{code:s,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[Wi]=this,fc(e,this,a)};else if(r==="error")n=function(s){let o=new Gi("error",{error:s,message:s.message});o[Wi]=this,fc(e,this,o)};else if(r==="open")n=function(){let s=new rn("open");s[Wi]=this,fc(e,this,s)};else return;n[ao]=!!t[ao],n[Af]=e,t.once?this.once(r,n):this.on(r,n)},removeEventListener(r,e){for(let t of this.listeners(r))if(t[Af]===e&&!t[ao]){this.removeListener(r,t);break}}};Wy.exports={CloseEvent:Qn,ErrorEvent:Gi,Event:rn,EventTarget:YI,MessageEvent:co};function fc(r,e,t){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,t):r.call(e,t)}});var Rf=O((T6,zy)=>{"use strict";var{tokenChars:lo}=$i();function Dr(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}function XI(r){let e=Object.create(null),t=Object.create(null),n=!1,i=!1,s=!1,o,a,c=-1,u=-1,p=-1,f=0;for(;f<r.length;f++)if(u=r.charCodeAt(f),o===void 0)if(p===-1&&lo[u]===1)c===-1&&(c=f);else if(f!==0&&(u===32||u===9))p===-1&&c!==-1&&(p=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f);let y=r.slice(c,p);u===44?(Dr(e,y,t),t=Object.create(null)):o=y,c=p=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);else if(a===void 0)if(p===-1&&lo[u]===1)c===-1&&(c=f);else if(u===32||u===9)p===-1&&c!==-1&&(p=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f),Dr(t,r.slice(c,p),!0),u===44&&(Dr(e,o,t),t=Object.create(null),o=void 0),c=p=-1}else if(u===61&&c!==-1&&p===-1)a=r.slice(c,f),c=p=-1;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(i){if(lo[u]!==1)throw new SyntaxError(`Unexpected character at index ${f}`);c===-1?c=f:n||(n=!0),i=!1}else if(s)if(lo[u]===1)c===-1&&(c=f);else if(u===34&&c!==-1)s=!1,p=f;else if(u===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(u===34&&r.charCodeAt(f-1)===61)s=!0;else if(p===-1&&lo[u]===1)c===-1&&(c=f);else if(c!==-1&&(u===32||u===9))p===-1&&(p=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f);let y=r.slice(c,p);n&&(y=y.replace(/\\/g,""),n=!1),Dr(t,a,y),u===44&&(Dr(e,o,t),t=Object.create(null),o=void 0),a=void 0,c=p=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);if(c===-1||s||u===32||u===9)throw new SyntaxError("Unexpected end of input");p===-1&&(p=f);let m=r.slice(c,p);return o===void 0?Dr(e,m,t):(a===void 0?Dr(t,m,!0):n?Dr(t,a,m.replace(/\\/g,"")):Dr(t,a,m),Dr(e,o,t)),e}function JI(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(", ")}zy.exports={format:JI,parse:XI}});var gc=O((R6,i0)=>{"use strict";var QI=require("events"),ZI=require("https"),eN=require("http"),Yy=require("net"),tN=require("tls"),{randomBytes:rN,createHash:nN}=require("crypto"),{Duplex:C6,Readable:A6}=require("stream"),{URL:kf}=require("url"),In=oo(),iN=Sf(),sN=Cf(),{isBlob:oN}=$i(),{BINARY_TYPES:Ky,EMPTY_BUFFER:dc,GUID:aN,kForOnEventAttribute:Of,kListener:cN,kStatusCode:lN,kWebSocket:lt,NOOP:Xy}=Zr(),{EventTarget:{addEventListener:uN,removeEventListener:pN}}=Gy(),{format:fN,parse:dN}=Rf(),{toBuffer:hN}=io(),mN=30*1e3,Jy=Symbol("kAborted"),Pf=[8,13],nn=["CONNECTING","OPEN","CLOSING","CLOSED"],gN=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,be=class r extends QI{constructor(e,t,n){super(),this._binaryType=Ky[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=dc,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]),Qy(this,e,t,n)):(this._autoPong=n.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){Ky.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 iN({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),s=new sN(e,this._extensions,n.generateMask);this._receiver=i,this._sender=s,this._socket=e,i[lt]=this,s[lt]=this,e[lt]=this,i.on("conclude",yN),i.on("drain",_N),i.on("error",bN),i.on("message",wN),i.on("ping",SN),i.on("pong",EN),s.onerror=TN,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",t0),e.on("data",mc),e.on("end",r0),e.on("error",n0),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[In.extensionName]&&this._extensions[In.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){Vt(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())}),e0(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){Mf(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||dc,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){Mf(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||dc,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){Mf(this,e,n);return}let i={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[In.extensionName]||(i.compress=!1),this._sender.send(e||dc,i,n)}terminate(){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){Vt(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=r.CLOSING,this._socket.destroy())}}};Object.defineProperty(be,"CONNECTING",{enumerable:!0,value:nn.indexOf("CONNECTING")});Object.defineProperty(be.prototype,"CONNECTING",{enumerable:!0,value:nn.indexOf("CONNECTING")});Object.defineProperty(be,"OPEN",{enumerable:!0,value:nn.indexOf("OPEN")});Object.defineProperty(be.prototype,"OPEN",{enumerable:!0,value:nn.indexOf("OPEN")});Object.defineProperty(be,"CLOSING",{enumerable:!0,value:nn.indexOf("CLOSING")});Object.defineProperty(be.prototype,"CLOSING",{enumerable:!0,value:nn.indexOf("CLOSING")});Object.defineProperty(be,"CLOSED",{enumerable:!0,value:nn.indexOf("CLOSED")});Object.defineProperty(be.prototype,"CLOSED",{enumerable:!0,value:nn.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(be.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(be.prototype,`on${r}`,{enumerable:!0,get(){for(let e of this.listeners(r))if(e[Of])return e[cN];return null},set(e){for(let t of this.listeners(r))if(t[Of]){this.removeListener(r,t);break}typeof e=="function"&&this.addEventListener(r,e,{[Of]:!0})}})});be.prototype.addEventListener=uN;be.prototype.removeEventListener=pN;i0.exports=be;function Qy(r,e,t,n){let i={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:Pf[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,!Pf.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${Pf.join(", ")})`);let s;if(e instanceof kf)s=e;else try{s=new kf(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;hc(r,S);return}let u=o?443:80,p=rN(16).toString("base64"),f=o?ZI.request:eN.request,m=new Set,y;if(i.createConnection=i.createConnection||(o?xN:vN),i.defaultPort=i.defaultPort||u,i.port=s.port||u,i.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":p,Connection:"Upgrade",Upgrade:"websocket"},i.path=s.pathname+s.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(y=new In(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=fN({[In.extensionName]:y.offer()})),t.length){for(let S of t){if(typeof S!="string"||!gN.test(S)||m.has(S))throw new SyntaxError("An invalid or duplicated subprotocol was specified");m.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 _;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[A,P]of Object.entries(S))n.headers[A.toLowerCase()]=P}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")),_=r._req=f(i),r._redirects&&r.emit("redirect",r.url,_)}else _=r._req=f(i);i.timeout&&_.on("timeout",()=>{Vt(r,_,"Opening handshake has timed out")}),_.on("error",S=>{_===null||_[Jy]||(_=r._req=null,hc(r,S))}),_.on("response",S=>{let A=S.headers.location,P=S.statusCode;if(A&&i.followRedirects&&P>=300&&P<400){if(++r._redirects>i.maxRedirects){Vt(r,_,"Maximum redirects exceeded");return}_.abort();let L;try{L=new kf(A,e)}catch{let H=new SyntaxError(`Invalid URL: ${A}`);hc(r,H);return}Qy(r,L,t,n)}else r.emit("unexpected-response",_,S)||Vt(r,_,`Unexpected server response: ${S.statusCode}`)}),_.on("upgrade",(S,A,P)=>{if(r.emit("upgrade",S),r.readyState!==be.CONNECTING)return;_=r._req=null;let L=S.headers.upgrade;if(L===void 0||L.toLowerCase()!=="websocket"){Vt(r,A,"Invalid Upgrade header");return}let N=nN("sha1").update(p+aN).digest("base64");if(S.headers["sec-websocket-accept"]!==N){Vt(r,A,"Invalid Sec-WebSocket-Accept header");return}let H=S.headers["sec-websocket-protocol"],W;if(H!==void 0?m.size?m.has(H)||(W="Server sent an invalid subprotocol"):W="Server sent a subprotocol but none was requested":m.size&&(W="Server sent no subprotocol"),W){Vt(r,A,W);return}H&&(r._protocol=H);let U=S.headers["sec-websocket-extensions"];if(U!==void 0){if(!y){Vt(r,A,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let G;try{G=dN(U)}catch{Vt(r,A,"Invalid Sec-WebSocket-Extensions header");return}let M=Object.keys(G);if(M.length!==1||M[0]!==In.extensionName){Vt(r,A,"Server indicated an extension that was not requested");return}try{y.accept(G[In.extensionName])}catch{Vt(r,A,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[In.extensionName]=y}r.setSocket(A,P,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(_,r):_.end()}function hc(r,e){r._readyState=be.CLOSING,r._errorEmitted=!0,r.emit("error",e),r.emitClose()}function vN(r){return r.path=r.socketPath,Yy.connect(r)}function xN(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=Yy.isIP(r.host)?"":r.host),tN.connect(r)}function Vt(r,e,t){r._readyState=be.CLOSING;let n=new Error(t);Error.captureStackTrace(n,Vt),e.setHeader?(e[Jy]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(hc,r,n)):(e.destroy(n),e.once("error",r.emit.bind(r,"error")),e.once("close",r.emitClose.bind(r)))}function Mf(r,e,t){if(e){let n=oN(e)?e.size:hN(e).length;r._socket?r._sender._bufferedBytes+=n:r._bufferedAmount+=n}if(t){let n=new Error(`WebSocket is not open: readyState ${r.readyState} (${nn[r.readyState]})`);process.nextTick(t,n)}}function yN(r,e){let t=this[lt];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=r,t._socket[lt]!==void 0&&(t._socket.removeListener("data",mc),process.nextTick(Zy,t._socket),r===1005?t.close():t.close(r,e))}function _N(){let r=this[lt];r.isPaused||r._socket.resume()}function bN(r){let e=this[lt];e._socket[lt]!==void 0&&(e._socket.removeListener("data",mc),process.nextTick(Zy,e._socket),e.close(r[lN])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r))}function Vy(){this[lt].emitClose()}function wN(r,e){this[lt].emit("message",r,e)}function SN(r){let e=this[lt];e._autoPong&&e.pong(r,!this._isServer,Xy),e.emit("ping",r)}function EN(r){this[lt].emit("pong",r)}function Zy(r){r.resume()}function TN(r){let e=this[lt];e.readyState!==be.CLOSED&&(e.readyState===be.OPEN&&(e._readyState=be.CLOSING,e0(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r)))}function e0(r){r._closeTimer=setTimeout(r._socket.destroy.bind(r._socket),mN)}function t0(){let r=this[lt];this.removeListener("close",t0),this.removeListener("data",mc),this.removeListener("end",r0),r._readyState=be.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[lt]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",Vy),r._receiver.on("finish",Vy))}function mc(r){this[lt]._receiver.write(r)||this.pause()}function r0(){let r=this[lt];r._readyState=be.CLOSING,r._receiver.end(),this.end()}function n0(){let r=this[lt];this.removeListener("error",n0),this.on("error",Xy),r&&(r._readyState=be.CLOSING,this.destroy())}});var c0=O((O6,a0)=>{"use strict";var k6=gc(),{Duplex:CN}=require("stream");function s0(r){r.emit("close")}function AN(){!this.destroyed&&this._writableState.finished&&this.destroy()}function o0(r){this.removeListener("error",o0),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function RN(r,e){let t=!0,n=new CN({...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(s0,n);return}let o=!1;r.once("error",function(c){o=!0,s(c)}),r.once("close",function(){o||s(i),process.nextTick(s0,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",AN),n.on("error",o0),n}a0.exports=RN});var u0=O((P6,l0)=>{"use strict";var{tokenChars:kN}=$i();function ON(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}l0.exports={parse:ON}});var v0=O((I6,g0)=>{"use strict";var PN=require("events"),vc=require("http"),{Duplex:M6}=require("stream"),{createHash:MN}=require("crypto"),p0=Rf(),Zn=oo(),IN=u0(),NN=gc(),{GUID:LN,kWebSocket:DN}=Zr(),BN=/^[+/0-9A-Za-z]{22}==$/,f0=0,d0=1,m0=2,If=class extends PN{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:NN,...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=vc.createServer((n,i)=>{let s=vc.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=jN(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=f0}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===m0){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(uo,this);return}if(e&&this.once("close",e),this._state!==d0)if(this._state=d0,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(uo,this):process.nextTick(uo,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{uo(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",h0);let s=e.headers["sec-websocket-key"],o=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){ei(this,e,t,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){ei(this,e,t,400,"Invalid Upgrade header");return}if(s===void 0||!BN.test(s)){ei(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){ei(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){po(t,400);return}let c=e.headers["sec-websocket-protocol"],u=new Set;if(c!==void 0)try{u=IN.parse(c)}catch{ei(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let p=e.headers["sec-websocket-extensions"],f={};if(this.options.perMessageDeflate&&p!==void 0){let m=new Zn(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let y=p0.parse(p);y[Zn.extensionName]&&(m.accept(y[Zn.extensionName]),f[Zn.extensionName]=m)}catch{ei(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let m={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(m,(y,_,S,A)=>{if(!y)return po(t,_||401,S,A);this.completeUpgrade(f,s,u,e,t,n,i)});return}if(!this.options.verifyClient(m))return po(t,401)}this.completeUpgrade(f,s,u,e,t,n,i)}completeUpgrade(e,t,n,i,s,o,a){if(!s.readable||!s.writable)return s.destroy();if(s[DN])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>f0)return po(s,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${MN("sha1").update(t+LN).digest("base64")}`],p=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&&(u.push(`Sec-WebSocket-Protocol: ${f}`),p._protocol=f)}if(e[Zn.extensionName]){let f=e[Zn.extensionName].params,m=p0.format({[Zn.extensionName]:[f]});u.push(`Sec-WebSocket-Extensions: ${m}`),p._extensions=e}this.emit("headers",u,i),s.write(u.concat(`\r
|
|
13
13
|
`).join(`\r
|
|
14
|
-
`)),s.removeListener("error",
|
|
14
|
+
`)),s.removeListener("error",h0),p.setSocket(s,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(p),p.on("close",()=>{this.clients.delete(p),this._shouldEmitClose&&!this.clients.size&&process.nextTick(uo,this)})),a(p,i)}};g0.exports=If;function jN(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 uo(r){r._state=m0,r.emit("close")}function h0(){this.destroy()}function po(r,e,t,n){t=t||vc.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} ${vc.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 Jn(r,e,t,n,i,s){if(r.listenerCount("wsClientError")){let o=new Error(i);Error.captureStackTrace(o,Jn),r.emit("wsClientError",o,t,e)}else lo(t,n,i,s)}});var n0=O((l6,r0)=>{"use strict";var sn=uc();sn.createWebSocketStream=zy();sn.Server=t0();sn.Receiver=lf();sn.Sender=ff();sn.WebSocket=sn;sn.WebSocketServer=sn.Server;r0.exports=sn});var o0=O((u6,s0)=>{"use strict";var i0=Object.getOwnPropertySymbols,mN=Object.prototype.hasOwnProperty,gN=Object.prototype.propertyIsEnumerable;function vN(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function xN(){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}}s0.exports=xN()?Object.assign:function(r,e){for(var t,n=vN(r),i,s=1;s<arguments.length;s++){t=Object(arguments[s]);for(var o in t)mN.call(t,o)&&(n[o]=t[o]);if(i0){i=i0(t);for(var a=0;a<i.length;a++)gN.call(t,i[a])&&(n[i[a]]=t[i[a]])}}return n}});var l0=O((p6,_f)=>{"use strict";_f.exports=_N;_f.exports.append=c0;var yN=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function c0(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:a0(String(e)),n=0;n<t.length;n++)if(!yN.test(t[n]))throw new TypeError("field argument contains an invalid header name");if(r==="*")return r;var i=r,s=a0(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 a0(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 _N(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=c0(n,e))&&r.setHeader("Vary",t)}});var bf=O((f6,u0)=>{(function(){"use strict";var r=o0(),e=l0(),t={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function n(b){return typeof b=="string"||b instanceof String}function i(b,S){if(Array.isArray(S)){for(var R=0;R<S.length;++R)if(i(b,S[R]))return!0;return!1}else return n(S)?b===S:S instanceof RegExp?S.test(b):!!S}function s(b,S){var R=S.headers.origin,I=[],L;return!b.origin||b.origin==="*"?I.push([{key:"Access-Control-Allow-Origin",value:"*"}]):n(b.origin)?(I.push([{key:"Access-Control-Allow-Origin",value:b.origin}]),I.push([{key:"Vary",value:"Origin"}])):(L=i(R,b.origin),I.push([{key:"Access-Control-Allow-Origin",value:L?R:!1}]),I.push([{key:"Vary",value:"Origin"}])),I}function o(b){var S=b.methods;return S.join&&(S=b.methods.join(",")),{key:"Access-Control-Allow-Methods",value:S}}function a(b){return b.credentials===!0?{key:"Access-Control-Allow-Credentials",value:"true"}:null}function c(b,S){var R=b.allowedHeaders||b.headers,I=[];return R?R.join&&(R=R.join(",")):(R=S.headers["access-control-request-headers"],I.push([{key:"Vary",value:"Access-Control-Request-Headers"}])),R&&R.length&&I.push([{key:"Access-Control-Allow-Headers",value:R}]),I}function u(b){var S=b.exposedHeaders;if(S)S.join&&(S=S.join(","));else return null;return S&&S.length?{key:"Access-Control-Expose-Headers",value:S}:null}function p(b){var S=(typeof b.maxAge=="number"||b.maxAge)&&b.maxAge.toString();return S&&S.length?{key:"Access-Control-Max-Age",value:S}:null}function f(b,S){for(var R=0,I=b.length;R<I;R++){var L=b[R];L&&(Array.isArray(L)?f(L,S):L.key==="Vary"&&L.value?e(S,L.value):L.value&&S.setHeader(L.key,L.value))}}function g(b,S,R,I){var L=[],N=S.method&&S.method.toUpperCase&&S.method.toUpperCase();N==="OPTIONS"?(L.push(s(b,S)),L.push(a(b)),L.push(o(b)),L.push(c(b,S)),L.push(p(b)),L.push(u(b)),f(L,R),b.preflightContinue?I():(R.statusCode=b.optionsSuccessStatus,R.setHeader("Content-Length","0"),R.end())):(L.push(s(b,S)),L.push(a(b)),L.push(u(b)),f(L,R),I())}function y(b){var S=null;return typeof b=="function"?S=b:S=function(R,I){I(null,b)},function(I,L,N){S(I,function(H,W){if(H)N(H);else{var U=r({},t,W),G=null;U.origin&&typeof U.origin=="function"?G=U.origin:U.origin&&(G=function(P,F){F(null,U.origin)}),G?G(I.headers.origin,function(P,F){P||!F?N(P):(U.origin=F,g(U,I,L,N))}):N()}})}}u0.exports=y})()});var Sf=O(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.Server=Gi.BaseServer=void 0;var p0=gp(),fc=Dp(),bN=require("events"),f0=jp(),wN=Te(),SN=Px(),EN=n0(),d0=Np(),TN=to(),ne=(0,wN.default)("engine"),Ui=Symbol("responseHeaders");function CN(r){try{let e=JSON.parse(r);if(typeof e.sid=="string")return e.sid}catch{}}var Wi=class extends bN.EventEmitter{constructor(e={}){super(),this.middlewares=[],this.clients={},this.clientsCount=0,this.opts=Object.assign({wsEngine:EN.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(bf()(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?fc.default[e].upgradesTo||[]:[]}verify(e,t,n){let i=e._query.transport;if(!~this.opts.transports.indexOf(i)||i==="webtransport")return ne('unknown transport "%s"',i),n(ge.errors.UNKNOWN_TRANSPORT,{transport:i});if(AN(e.headers.origin)){let a=e.headers.origin;return e.headers.origin=null,ne("origin header invalid"),n(ge.errors.BAD_REQUEST,{name:"INVALID_ORIGIN",origin:a})}let o=e._query.sid;if(o){if(!this.clients.hasOwnProperty(o))return ne('unknown sid "%s"',o),n(ge.errors.UNKNOWN_SID,{sid:o});let a=this.clients[o].transport.name;if(!t&&a!==i)return ne("bad request: unexpected transport without upgrade"),n(ge.errors.BAD_REQUEST,{name:"TRANSPORT_MISMATCH",transport:i,previousTransport:a})}else return e.method!=="GET"?n(ge.errors.BAD_HANDSHAKE_METHOD,{method:e.method}):i==="websocket"&&!t?(ne("invalid transport upgrade"),n(ge.errors.BAD_REQUEST,{name:"TRANSPORT_HANDSHAKE_ERROR"})):this.opts.allowRequest?this.opts.allowRequest(e,(a,c)=>{if(!c)return n(ge.errors.FORBIDDEN,{message:a});n()}):n();n()}use(e){this.middlewares.push(e)}_applyMiddlewares(e,t,n){if(this.middlewares.length===0)return ne("no middleware to apply, skipping"),n();let i=s=>{ne("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(){ne("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 p0.generateId()}async handshake(e,t,n){let i=t._query.EIO==="4"?4:3;if(i===3&&!this.opts.allowEIO3){ne("unsupported protocol version"),this.emit("connection_error",{req:t,code:ge.errors.UNSUPPORTED_PROTOCOL_VERSION,message:ge.errorMessages[ge.errors.UNSUPPORTED_PROTOCOL_VERSION],context:{protocol:i}}),n(ge.errors.UNSUPPORTED_PROTOCOL_VERSION);return}let s;try{s=await this.generateId(t)}catch(c){ne("error while generating an id"),this.emit("connection_error",{req:t,code:ge.errors.BAD_REQUEST,message:ge.errorMessages[ge.errors.BAD_REQUEST],context:{name:"ID_GENERATION_ERROR",error:c}}),n(ge.errors.BAD_REQUEST);return}ne('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){ne('error handshaking to transport "%s"',e),this.emit("connection_error",{req:t,code:ge.errors.BAD_REQUEST,message:ge.errorMessages[ge.errors.BAD_REQUEST],context:{name:"TRANSPORT_HANDSHAKE_ERROR",error:c}}),n(ge.errors.BAD_REQUEST);return}let a=new f0.Socket(s,this,o,t,i);return o.on("headers",(c,u)=>{!u._query.sid&&(this.opts.cookie&&(c["Set-Cookie"]=[(0,SN.serialize)(this.opts.cookie.name,s,this.opts.cookie)]),this.emit("initial_headers",c,u)),this.emit("headers",c,u)}),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(()=>{ne("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){ne("session is closed");return}let s=i.value,o=(0,TN.createPacketDecoderStream)(this.opts.maxHttpBufferSize,"nodebuffer"),a=s.readable.pipeThrough(o).getReader(),{value:c,done:u}=await a.read();if(u){ne("stream is closed");return}if(clearTimeout(t),c.type!=="open")return ne("invalid WebTransport handshake"),e.close();if(c.data===void 0){let g=new d0.WebTransport(e,s,a),y=p0.generateId();ne('handshaking client "%s" (WebTransport)',y);let b=new f0.Socket(y,this,g,null,4);this.clients[y]=b,this.clientsCount++,b.once("close",()=>{delete this.clients[y],this.clientsCount--}),this.emit("connection",b);return}let p=CN(c.data);if(!p)return ne("invalid WebTransport handshake"),e.close();let f=this.clients[p];if(!f)ne("upgrade attempt for closed client"),e.close();else if(f.upgrading)ne("transport has already been trying to upgrade"),e.close();else if(f.upgraded)ne("transport had already been upgraded"),e.close();else{ne("upgrading existing transport");let g=new d0.WebTransport(e,s,a);f._maybeUpgrade(g)}}};Gi.BaseServer=Wi;Wi.errors={UNKNOWN_TRANSPORT:0,UNKNOWN_SID:1,BAD_HANDSHAKE_METHOD:2,BAD_REQUEST:3,FORBIDDEN:4,UNSUPPORTED_PROTOCOL_VERSION:5};Wi.errorMessages={0:"Transport unknown",1:"Session ID unknown",2:"Bad handshake method",3:"Bad request",4:"Forbidden",5:"Unsupported protocol version"};var wf=class{constructor(e,t){this.req=e,this.socket=t,e[Ui]={}}setHeader(e,t){this.req[Ui][e]=t}getHeader(e){return this.req[Ui][e]}removeHeader(e){delete this.req[Ui][e]}write(){}writeHead(){}end(){this.socket.destroy()}},ge=class r extends Wi{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[Ui]||{};delete t[Ui],!t._query.sid&&this.emit("initial_headers",n,t),this.emit("headers",n,t),ne("writing headers: %j",n),Object.keys(n).forEach(s=>{e.push(`${s}: ${n[s]}`)})}))}cleanup(){this.ws&&(ne("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 fc.default[e](t)}handleRequest(e,t){ne('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}),h0(t,i,s);return}if(e._query.sid)ne("setting new request for existing client"),this.clients[e._query.sid].transport.onRequest(e);else{let o=(a,c)=>h0(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 wf(e,t),s=(o,a)=>{if(o!==void 0){this.emit("connection_error",{req:e,code:o,message:r.errorMessages[o],context:a}),m0(t,o,a);return}let c=Buffer.from(n);n=null,i.writeHead(),this.ws.handleUpgrade(e,t,c,u=>{this.onWebSocket(e,t,u)})};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),fc.default[e._query.transport]!==void 0&&!fc.default[e._query.transport].prototype.handlesUpgrades){ne("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)ne("upgrade attempt for closed client"),n.close();else if(o.upgrading)ne("transport has already been trying to upgrade"),n.close();else if(o.upgraded)ne("transport had already been upgraded"),n.close();else{ne("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)=>m0(t,a,c);this.handshake(e._query.transport,e,o)}function s(){ne("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))ne('intercepting request for path "%s"',n),this.handleRequest(a,c);else{let u=0,p=o.length;for(;u<p;u++)o[u].call(e,a,c)}}),~this.opts.transports.indexOf("websocket")&&e.on("upgrade",(a,c,u)=>{s(a)?this.handleUpgrade(a,c,u):t.destroyUpgrade!==!1&&setTimeout(function(){if(c.writable&&c.bytesWritten<=0)return c.on("error",p=>{ne("error while destroying upgrade: %s",p.message)}),c.end()},i)})}};Gi.Server=ge;function h0(r,e,t){let n=e===ge.errors.FORBIDDEN?403:400,i=t&&t.message?t.message:ge.errorMessages[e];r.writeHead(n,{"Content-Type":"application/json"}),r.end(JSON.stringify({code:e,message:i}))}function m0(r,e,t={}){if(r.on("error",()=>{ne("ignoring error from closed connection")}),r.writable){let n=t.message||ge.errorMessages[e],i=Buffer.byteLength(n);r.write(`HTTP/1.1 400 Bad Request\r
|
|
18
|
+
`+t)}function ei(r,e,t,n,i,s){if(r.listenerCount("wsClientError")){let o=new Error(i);Error.captureStackTrace(o,ei),r.emit("wsClientError",o,t,e)}else po(t,n,i,s)}});var y0=O((N6,x0)=>{"use strict";var sn=gc();sn.createWebSocketStream=c0();sn.Server=v0();sn.Receiver=Sf();sn.Sender=Cf();sn.WebSocket=sn;sn.WebSocketServer=sn.Server;x0.exports=sn});var w0=O((L6,b0)=>{"use strict";var _0=Object.getOwnPropertySymbols,FN=Object.prototype.hasOwnProperty,HN=Object.prototype.propertyIsEnumerable;function $N(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function qN(){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}}b0.exports=qN()?Object.assign:function(r,e){for(var t,n=$N(r),i,s=1;s<arguments.length;s++){t=Object(arguments[s]);for(var o in t)FN.call(t,o)&&(n[o]=t[o]);if(_0){i=_0(t);for(var a=0;a<i.length;a++)HN.call(t,i[a])&&(n[i[a]]=t[i[a]])}}return n}});var T0=O((D6,Nf)=>{"use strict";Nf.exports=WN;Nf.exports.append=E0;var UN=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function E0(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:S0(String(e)),n=0;n<t.length;n++)if(!UN.test(t[n]))throw new TypeError("field argument contains an invalid header name");if(r==="*")return r;var i=r,s=S0(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 S0(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 WN(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=E0(n,e))&&r.setHeader("Vary",t)}});var Lf=O((B6,C0)=>{(function(){"use strict";var r=w0(),e=T0(),t={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function n(_){return typeof _=="string"||_ instanceof String}function i(_,S){if(Array.isArray(S)){for(var A=0;A<S.length;++A)if(i(_,S[A]))return!0;return!1}else return n(S)?_===S:S instanceof RegExp?S.test(_):!!S}function s(_,S){var A=S.headers.origin,P=[],L;return!_.origin||_.origin==="*"?P.push([{key:"Access-Control-Allow-Origin",value:"*"}]):n(_.origin)?(P.push([{key:"Access-Control-Allow-Origin",value:_.origin}]),P.push([{key:"Vary",value:"Origin"}])):(L=i(A,_.origin),P.push([{key:"Access-Control-Allow-Origin",value:L?A:!1}]),P.push([{key:"Vary",value:"Origin"}])),P}function o(_){var S=_.methods;return S.join&&(S=_.methods.join(",")),{key:"Access-Control-Allow-Methods",value:S}}function a(_){return _.credentials===!0?{key:"Access-Control-Allow-Credentials",value:"true"}:null}function c(_,S){var A=_.allowedHeaders||_.headers,P=[];return A?A.join&&(A=A.join(",")):(A=S.headers["access-control-request-headers"],P.push([{key:"Vary",value:"Access-Control-Request-Headers"}])),A&&A.length&&P.push([{key:"Access-Control-Allow-Headers",value:A}]),P}function u(_){var S=_.exposedHeaders;if(S)S.join&&(S=S.join(","));else return null;return S&&S.length?{key:"Access-Control-Expose-Headers",value:S}:null}function p(_){var S=(typeof _.maxAge=="number"||_.maxAge)&&_.maxAge.toString();return S&&S.length?{key:"Access-Control-Max-Age",value:S}:null}function f(_,S){for(var A=0,P=_.length;A<P;A++){var L=_[A];L&&(Array.isArray(L)?f(L,S):L.key==="Vary"&&L.value?e(S,L.value):L.value&&S.setHeader(L.key,L.value))}}function m(_,S,A,P){var L=[],N=S.method&&S.method.toUpperCase&&S.method.toUpperCase();N==="OPTIONS"?(L.push(s(_,S)),L.push(a(_)),L.push(o(_)),L.push(c(_,S)),L.push(p(_)),L.push(u(_)),f(L,A),_.preflightContinue?P():(A.statusCode=_.optionsSuccessStatus,A.setHeader("Content-Length","0"),A.end())):(L.push(s(_,S)),L.push(a(_)),L.push(u(_)),f(L,A),P())}function y(_){var S=null;return typeof _=="function"?S=_:S=function(A,P){P(null,_)},function(P,L,N){S(P,function(H,W){if(H)N(H);else{var U=r({},t,W),G=null;U.origin&&typeof U.origin=="function"?G=U.origin:U.origin&&(G=function(M,F){F(null,U.origin)}),G?G(P.headers.origin,function(M,F){M||!F?N(M):(U.origin=F,m(U,P,L,N))}):N()}})}}C0.exports=y})()});var Bf=O(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.Server=Vi.BaseServer=void 0;var A0=Op(),xc=Xp(),GN=require("events"),R0=Qp(),zN=Ce(),KN=Kx(),VN=y0(),k0=Vp(),YN=no(),ne=(0,zN.default)("engine"),zi=Symbol("responseHeaders");function XN(r){try{let e=JSON.parse(r);if(typeof e.sid=="string")return e.sid}catch{}}var Ki=class extends GN.EventEmitter{constructor(e={}){super(),this.middlewares=[],this.clients={},this.clientsCount=0,this.opts=Object.assign({wsEngine:VN.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(Lf()(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?xc.default[e].upgradesTo||[]:[]}verify(e,t,n){let i=e._query.transport;if(!~this.opts.transports.indexOf(i)||i==="webtransport")return ne('unknown transport "%s"',i),n(xe.errors.UNKNOWN_TRANSPORT,{transport:i});if(JN(e.headers.origin)){let a=e.headers.origin;return e.headers.origin=null,ne("origin header invalid"),n(xe.errors.BAD_REQUEST,{name:"INVALID_ORIGIN",origin:a})}let o=e._query.sid;if(o){if(!this.clients.hasOwnProperty(o))return ne('unknown sid "%s"',o),n(xe.errors.UNKNOWN_SID,{sid:o});let a=this.clients[o].transport.name;if(!t&&a!==i)return ne("bad request: unexpected transport without upgrade"),n(xe.errors.BAD_REQUEST,{name:"TRANSPORT_MISMATCH",transport:i,previousTransport:a})}else return e.method!=="GET"?n(xe.errors.BAD_HANDSHAKE_METHOD,{method:e.method}):i==="websocket"&&!t?(ne("invalid transport upgrade"),n(xe.errors.BAD_REQUEST,{name:"TRANSPORT_HANDSHAKE_ERROR"})):this.opts.allowRequest?this.opts.allowRequest(e,(a,c)=>{if(!c)return n(xe.errors.FORBIDDEN,{message:a});n()}):n();n()}use(e){this.middlewares.push(e)}_applyMiddlewares(e,t,n){if(this.middlewares.length===0)return ne("no middleware to apply, skipping"),n();let i=s=>{ne("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(){ne("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 A0.generateId()}async handshake(e,t,n){let i=t._query.EIO==="4"?4:3;if(i===3&&!this.opts.allowEIO3){ne("unsupported protocol version"),this.emit("connection_error",{req:t,code:xe.errors.UNSUPPORTED_PROTOCOL_VERSION,message:xe.errorMessages[xe.errors.UNSUPPORTED_PROTOCOL_VERSION],context:{protocol:i}}),n(xe.errors.UNSUPPORTED_PROTOCOL_VERSION);return}let s;try{s=await this.generateId(t)}catch(c){ne("error while generating an id"),this.emit("connection_error",{req:t,code:xe.errors.BAD_REQUEST,message:xe.errorMessages[xe.errors.BAD_REQUEST],context:{name:"ID_GENERATION_ERROR",error:c}}),n(xe.errors.BAD_REQUEST);return}ne('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){ne('error handshaking to transport "%s"',e),this.emit("connection_error",{req:t,code:xe.errors.BAD_REQUEST,message:xe.errorMessages[xe.errors.BAD_REQUEST],context:{name:"TRANSPORT_HANDSHAKE_ERROR",error:c}}),n(xe.errors.BAD_REQUEST);return}let a=new R0.Socket(s,this,o,t,i);return o.on("headers",(c,u)=>{!u._query.sid&&(this.opts.cookie&&(c["Set-Cookie"]=[(0,KN.serialize)(this.opts.cookie.name,s,this.opts.cookie)]),this.emit("initial_headers",c,u)),this.emit("headers",c,u)}),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(()=>{ne("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){ne("session is closed");return}let s=i.value,o=(0,YN.createPacketDecoderStream)(this.opts.maxHttpBufferSize,"nodebuffer"),a=s.readable.pipeThrough(o).getReader(),{value:c,done:u}=await a.read();if(u){ne("stream is closed");return}if(clearTimeout(t),c.type!=="open")return ne("invalid WebTransport handshake"),e.close();if(c.data===void 0){let m=new k0.WebTransport(e,s,a),y=A0.generateId();ne('handshaking client "%s" (WebTransport)',y);let _=new R0.Socket(y,this,m,null,4);this.clients[y]=_,this.clientsCount++,_.once("close",()=>{delete this.clients[y],this.clientsCount--}),this.emit("connection",_);return}let p=XN(c.data);if(!p)return ne("invalid WebTransport handshake"),e.close();let f=this.clients[p];if(!f)ne("upgrade attempt for closed client"),e.close();else if(f.upgrading)ne("transport has already been trying to upgrade"),e.close();else if(f.upgraded)ne("transport had already been upgraded"),e.close();else{ne("upgrading existing transport");let m=new k0.WebTransport(e,s,a);f._maybeUpgrade(m)}}};Vi.BaseServer=Ki;Ki.errors={UNKNOWN_TRANSPORT:0,UNKNOWN_SID:1,BAD_HANDSHAKE_METHOD:2,BAD_REQUEST:3,FORBIDDEN:4,UNSUPPORTED_PROTOCOL_VERSION:5};Ki.errorMessages={0:"Transport unknown",1:"Session ID unknown",2:"Bad handshake method",3:"Bad request",4:"Forbidden",5:"Unsupported protocol version"};var Df=class{constructor(e,t){this.req=e,this.socket=t,e[zi]={}}setHeader(e,t){this.req[zi][e]=t}getHeader(e){return this.req[zi][e]}removeHeader(e){delete this.req[zi][e]}write(){}writeHead(){}end(){this.socket.destroy()}},xe=class r extends Ki{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[zi]||{};delete t[zi],!t._query.sid&&this.emit("initial_headers",n,t),this.emit("headers",n,t),ne("writing headers: %j",n),Object.keys(n).forEach(s=>{e.push(`${s}: ${n[s]}`)})}))}cleanup(){this.ws&&(ne("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 xc.default[e](t)}handleRequest(e,t){ne('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}),O0(t,i,s);return}if(e._query.sid)ne("setting new request for existing client"),this.clients[e._query.sid].transport.onRequest(e);else{let o=(a,c)=>O0(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 Df(e,t),s=(o,a)=>{if(o!==void 0){this.emit("connection_error",{req:e,code:o,message:r.errorMessages[o],context:a}),P0(t,o,a);return}let c=Buffer.from(n);n=null,i.writeHead(),this.ws.handleUpgrade(e,t,c,u=>{this.onWebSocket(e,t,u)})};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),xc.default[e._query.transport]!==void 0&&!xc.default[e._query.transport].prototype.handlesUpgrades){ne("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)ne("upgrade attempt for closed client"),n.close();else if(o.upgrading)ne("transport has already been trying to upgrade"),n.close();else if(o.upgraded)ne("transport had already been upgraded"),n.close();else{ne("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)=>P0(t,a,c);this.handshake(e._query.transport,e,o)}function s(){ne("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))ne('intercepting request for path "%s"',n),this.handleRequest(a,c);else{let u=0,p=o.length;for(;u<p;u++)o[u].call(e,a,c)}}),~this.opts.transports.indexOf("websocket")&&e.on("upgrade",(a,c,u)=>{s(a)?this.handleUpgrade(a,c,u):t.destroyUpgrade!==!1&&setTimeout(function(){if(c.writable&&c.bytesWritten<=0)return c.on("error",p=>{ne("error while destroying upgrade: %s",p.message)}),c.end()},i)})}};Vi.Server=xe;function O0(r,e,t){let n=e===xe.errors.FORBIDDEN?403:400,i=t&&t.message?t.message:xe.errorMessages[e];r.writeHead(n,{"Content-Type":"application/json"}),r.end(JSON.stringify({code:e,message:i}))}function P0(r,e,t={}){if(r.on("error",()=>{ne("ignoring error from closed connection")}),r.writable){let n=t.message||xe.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 uo=[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 AN(r){if(r+="",r.length<1)return!1;if(!uo[r.charCodeAt(0)])return ne('invalid header, index 0, char "%s"',r.charCodeAt(0)),!0;if(r.length<2)return!1;if(!uo[r.charCodeAt(1)])return ne('invalid header, index 1, char "%s"',r.charCodeAt(1)),!0;if(r.length<3)return!1;if(!uo[r.charCodeAt(2)])return ne('invalid header, index 2, char "%s"',r.charCodeAt(2)),!0;if(r.length<4)return!1;if(!uo[r.charCodeAt(3)])return ne('invalid header, index 3, char "%s"',r.charCodeAt(3)),!0;for(let e=4;e<r.length;++e)if(!uo[r.charCodeAt(e)])return ne('invalid header, index "%i", char "%s"',e,r.charCodeAt(e)),!0;return!1}});var v0=O(dc=>{"use strict";Object.defineProperty(dc,"__esModule",{value:!0});dc.Polling=void 0;var RN=zn(),g0=require("zlib"),kN=Na(),ON=Te(),ir=(0,ON.default)("engine:polling"),PN={gzip:g0.createGzip,deflate:g0.createDeflate},Ef=class extends RN.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){ir("request overlap"),this.onError("overlap from client"),t.writeStatus("500 Internal Server Error"),t.end();return}ir("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&&(ir("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 u in a)t.writeHeader(u,String(a[u]));let c=u=>{this.onData(u.toString()),this.onDataRequestCleanup(),t.cork(()=>{t.end("ok")})};t.onAborted(()=>{this.onDataRequestCleanup(),this.onError("data request connection closed prematurely")}),t.onData((u,p)=>{let f=o+u.byteLength;if(f>n){this.onError("content-length mismatch"),t.close();return}if(!s){if(p){c(Buffer.from(u));return}s=Buffer.allocUnsafe(n)}if(Buffer.from(u).copy(s,o),p){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){ir('received "%s"',e);let t=n=>{if(n.type==="close")return ir("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&&(ir("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){ir('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=p=>{this.headers(this.req,o),this.res.cork(()=>{Object.keys(o).forEach(f=>{this.res.writeHeader(f,String(o[f]))}),this.res.end(p)}),n()};if(!this.httpCompression||!t.compress){a(e);return}if((i?Buffer.byteLength(e):e.length)<this.httpCompression.threshold){a(e);return}let u=kN(this.req).encodings(["gzip","deflate"]);if(!u){a(e);return}this.compress(e,u,(p,f)=>{if(p){this.res.writeStatus("500 Internal Server Error"),this.res.end(),n(p);return}o["Content-Encoding"]=u,a(f)})}compress(e,t,n){ir("compressing");let i=[],s=0;PN[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){ir("closing");let t,n=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(ir("transport writable - closing right away"),this.send([{type:"close"}]),n()):this.discarded?(ir("transport discarded - closing right away"),n()):(ir("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}};dc.Polling=Ef});var y0=O(hc=>{"use strict";Object.defineProperty(hc,"__esModule",{value:!0});hc.WebSocket=void 0;var MN=zn(),IN=Te(),x0=(0,IN.default)("engine:ws"),Tf=class extends MN.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;x0('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){x0("closing"),e&&e(),this.socket.end()}};hc.WebSocket=Tf});var _0=O(Cf=>{"use strict";Object.defineProperty(Cf,"__esModule",{value:!0});var NN=v0(),LN=y0();Cf.default={polling:NN.Polling,websocket:LN.WebSocket}});var b0=O(mc=>{"use strict";Object.defineProperty(mc,"__esModule",{value:!0});mc.uServer=void 0;var DN=Te(),Qn=Sf(),BN=_0(),Pn=(0,DN.default)("engine:uws"),Af=class extends Qn.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(()=>{Pn("response has been aborted")})}createTransport(e,t){return new BN.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 Rf(t),super._applyMiddlewares(e,e.res,i=>{e.res.writeHead(),n(i)})}handleRequest(e,t){Pn('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:Qn.Server.errorMessages[i],context:s}),this.abortRequest(t.res,i,s);return}if(t._query.sid)Pn("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(Qn.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!1,n)})}handleUpgrade(e,t,n){Pn("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:Qn.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 Pn("transport has already been trying to upgrade"),e.close();if(f.upgraded)return Pn("transport had already been upgraded"),e.close();Pn("upgrading existing transport"),c=this.createTransport(t._query.transport,t),f._maybeUpgrade(c)}else return Pn("upgrade attempt for closed client"),e.close()}else if(c=await this.handshake(t._query.transport,t,(f,g)=>this.abortRequest(e,f,g)),!c)return;let u={};!a&&this.emit("initial_headers",u,t),this.emit("headers",u,t),t.res.writeStatus("101 Switching Protocols"),Object.keys(u).forEach(f=>{t.res.writeHeader(f,u[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(Qn.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!0,i)})}abortRequest(e,t,n){let i=t===Qn.Server.errors.FORBIDDEN?"403 Forbidden":"400 Bad Request",s=n&&n.message?n.message:Qn.Server.errorMessages[t];e.writeStatus(i),e.writeHeader("Content-Type","application/json"),e.end(JSON.stringify({code:t,message:s}))}};mc.uServer=Af;var Rf=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 T0=O(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.protocol=ut.Transport=ut.Socket=ut.uServer=ut.parser=ut.transports=ut.Server=void 0;ut.listen=UN;ut.attach=E0;var jN=require("http"),w0=Sf();Object.defineProperty(ut,"Server",{enumerable:!0,get:function(){return w0.Server}});var FN=Dp();ut.transports=FN.default;var S0=to();ut.parser=S0;var HN=b0();Object.defineProperty(ut,"uServer",{enumerable:!0,get:function(){return HN.uServer}});var $N=jp();Object.defineProperty(ut,"Socket",{enumerable:!0,get:function(){return $N.Socket}});var qN=zn();Object.defineProperty(ut,"Transport",{enumerable:!0,get:function(){return qN.Transport}});ut.protocol=S0.protocol;function UN(r,e,t){typeof e=="function"&&(t=e,e={});let n=(0,jN.createServer)(function(s,o){o.writeHead(501),o.end("Not Implemented")}),i=E0(n,e);return i.httpServer=n,n.listen(r,t),i}function E0(r,e){let t=new w0.Server(e);return t.attach(r,e),t}});var A0=O(C0=>{C0.Emitter=Ct;function Ct(r){if(r)return WN(r)}function WN(r){for(var e in Ct.prototype)r[e]=Ct.prototype[e];return r}Ct.prototype.on=Ct.prototype.addEventListener=function(r,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(e),this};Ct.prototype.once=function(r,e){function t(){this.off(r,t),e.apply(this,arguments)}return t.fn=e,this.on(r,t),this};Ct.prototype.off=Ct.prototype.removeListener=Ct.prototype.removeAllListeners=Ct.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};Ct.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};Ct.prototype.emitReserved=Ct.prototype.emit;Ct.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]};Ct.prototype.hasListeners=function(r){return!!this.listeners(r).length}});var kf=O(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.isBinary=k0;vc.hasBinary=gc;var GN=typeof ArrayBuffer=="function",zN=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,R0=Object.prototype.toString,KN=typeof Blob=="function"||typeof Blob<"u"&&R0.call(Blob)==="[object BlobConstructor]",VN=typeof File=="function"||typeof File<"u"&&R0.call(File)==="[object FileConstructor]";function k0(r){return GN&&(r instanceof ArrayBuffer||zN(r))||KN&&r instanceof Blob||VN&&r instanceof File}function gc(r,e){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let t=0,n=r.length;t<n;t++)if(gc(r[t]))return!0;return!1}if(k0(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return gc(r.toJSON(),!0);for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&gc(r[t]))return!0;return!1}});var O0=O(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});xc.deconstructPacket=XN;xc.reconstructPacket=JN;var YN=kf();function XN(r){let e=[],t=r.data,n=r;return n.data=Of(t,e),n.attachments=e.length,{packet:n,buffers:e}}function Of(r,e){if(!r)return r;if((0,YN.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]=Of(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]=Of(r[n],e));return t}return r}function JN(r,e){return r.data=Pf(r.data,e),delete r.attachments,r}function Pf(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]=Pf(r[t],e);else if(typeof r=="object")for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&(r[t]=Pf(r[t],e));return r}});var po=O(Sr=>{"use strict";Object.defineProperty(Sr,"__esModule",{value:!0});Sr.Decoder=Sr.Encoder=Sr.PacketType=Sr.protocol=void 0;Sr.isPacketValid=nL;var QN=A0(),P0=O0(),M0=kf(),ZN=Te(),Mf=(0,ZN.default)("socket.io-parser"),I0=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];Sr.protocol=5;var le;(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"})(le||(Sr.PacketType=le={}));var If=class{constructor(e){this.replacer=e}encode(e){return Mf("encoding packet %j",e),(e.type===le.EVENT||e.type===le.ACK)&&(0,M0.hasBinary)(e)?this.encodeAsBinary({type:e.type===le.EVENT?le.BINARY_EVENT:le.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===le.BINARY_EVENT||e.type===le.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)),Mf("encoded %j as %s",e,t),t}encodeAsBinary(e){let t=(0,P0.deconstructPacket)(e),n=this.encodeAsString(t.packet),i=t.buffers;return i.unshift(n),i}};Sr.Encoder=If;var Nf=class r extends QN.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===le.BINARY_EVENT;n||t.type===le.BINARY_ACK?(t.type=n?le.EVENT:le.ACK,this.reconstructor=new Lf(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if((0,M0.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(le[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===le.BINARY_EVENT||n.type===le.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(!N0(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 Mf("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 le.CONNECT:return yc(t);case le.DISCONNECT:return t===void 0;case le.CONNECT_ERROR:return typeof t=="string"||yc(t);case le.EVENT:case le.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&I0.indexOf(t[0])===-1);case le.ACK:case le.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}};Sr.Decoder=Nf;var Lf=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,P0.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function eL(r){return typeof r=="string"}var N0=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r};function tL(r){return r===void 0||N0(r)}function yc(r){return Object.prototype.toString.call(r)==="[object Object]"}function rL(r,e){switch(r){case le.CONNECT:return e===void 0||yc(e);case le.DISCONNECT:return e===void 0;case le.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&I0.indexOf(e[0])===-1);case le.ACK:return Array.isArray(e);case le.CONNECT_ERROR:return typeof e=="string"||yc(e);default:return!1}}function nL(r){return eL(r.nsp)&&tL(r.id)&&rL(r.type,r.data)}});var L0=O(zi=>{"use strict";var iL=zi&&zi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(zi,"__esModule",{value:!0});zi.Client=void 0;var _c=po(),sL=iL(Te()),Er=(0,sL.default)("socket.io:client"),Df=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?(Er("no namespace joined yet, close the client"),this.close()):Er("the client has already joined a namespace, nothing to do")},this.server._connectTimeout)}connect(e,t={}){if(this.server._nsps.has(e))return Er("connecting to namespace %s",e),this.doConnect(e,t);this.server._checkNamespace(e,t,n=>{n?this.doConnect(e,t):(Er("creation of namespace %s was denied",e),this._packet({type:_c.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 Er("ignoring remove for %s",e.id)}close(){this.conn.readyState==="open"&&(Er("forcing transport close"),this.conn.close(),this.onclose("forced server close"))}_packet(e,t={}){if(this.conn.readyState!=="open"){Er("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){Er("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){Er("invalid packet format"),this.onerror(t)}}ondecoded(e){let{namespace:t,authPayload:n}=this._parseNamespace(e),i=this.nsps.get(t);!i&&e.type===_c.PacketType.CONNECT?this.connect(t,n):i&&e.type!==_c.PacketType.CONNECT&&e.type!==_c.PacketType.CONNECT_ERROR?process.nextTick(function(){i._onpacket(e)}):(Er("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){Er("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)}};zi.Client=Df});var wc=O(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.StrictEventEmitter=void 0;var oL=require("events"),Bf=class extends oL.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)}};bc.StrictEventEmitter=Bf});var jf=O(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});Sc.RESERVED_EVENTS=void 0;Sc.RESERVED_EVENTS=new Set(["connect","connect_error","disconnect","disconnecting","newListener","removeListener"])});var Ff=O(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Ki.RemoteSocket=Ki.BroadcastOperator=void 0;var aL=jf(),cL=po(),Ec=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(aL.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let n=[e,...t],i={type:cL.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=[],u=setTimeout(()=>{a=!0,o.apply(this,[new Error("operation has timed out"),this.flags.expectSingleResponse?null:c])},this.flags.timeout),p=-1,f=0,g=0,y=()=>{!a&&p===f&&c.length===g&&(clearTimeout(u),o.apply(this,[null,this.flags.expectSingleResponse?c[0]:c]))};return this.adapter.broadcastWithAck(i,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags},b=>{g+=b,f++,y()},b=>{c.push(b),y()}),this.adapter.serverCount().then(b=>{p=b,y()}),!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 Tc(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)}};Ki.BroadcastOperator=Ec;var Tc=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 Ec(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}};Ki.RemoteSocket=Tc});var $f=O(Vi=>{"use strict";var j0=Vi&&Vi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Vi,"__esModule",{value:!0});Vi.Socket=void 0;var sr=po(),lL=j0(Te()),uL=wc(),D0=j0(gp()),pL=Ff(),fL=jf(),vt=(0,lL.default)("socket.io:socket"),dL=new Set(["transport error","transport close","forced close","ping timeout","server shutting down","forced server close"]);function B0(){}var Hf=class extends uL.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:sr.PacketType.EVENT,data:s})}),this.recovered=!0):(t.conn.protocol===3?this.id=e.name!=="/"?e.name+"#"+t.id:t.id:this.id=D0.default.generateId(),this.server._opts.connectionStateRecovery&&(this.pid=D0.default.generateId())),this.handshake=this.buildHandshake(n),this.on("error",B0)}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(fL.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let n=[e,...t],i={type:sr.PacketType.EVENT,data:n};if(typeof n[n.length-1]=="function"){let o=this.nsp._ids++;vt("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(()=>{vt("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 vt("join room %s",e),this.adapter.addAll(this.id,new Set(Array.isArray(e)?e:[e]))}leave(e){return vt("leave room %s",e),this.adapter.del(this.id,e)}leaveAll(){this.adapter.delAll(this.id)}_onconnect(){vt("socket connected - writing packet"),this.connected=!0,this.join(this.id),this.conn.protocol===3?this.packet({type:sr.PacketType.CONNECT}):this.packet({type:sr.PacketType.CONNECT,data:{sid:this.id,pid:this.pid}})}_onpacket(e){switch(vt("got packet %j",e),e.type){case sr.PacketType.EVENT:this.onevent(e);break;case sr.PacketType.BINARY_EVENT:this.onevent(e);break;case sr.PacketType.ACK:this.onack(e);break;case sr.PacketType.BINARY_ACK:this.onack(e);break;case sr.PacketType.DISCONNECT:this.ondisconnect();break}}onevent(e){let t=e.data||[];if(vt("emitting event %j",t),e.id!=null&&(vt("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);vt("sending ack %j",i),t.packet({id:e,type:sr.PacketType.ACK,data:i}),n=!0}}onack(e){let t=this.acks.get(e.id);typeof t=="function"?(vt("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),this.acks.delete(e.id)):vt("bad ack %s",e.id)}ondisconnect(){vt("got disconnect packet"),this._onclose("client namespace disconnect")}_onerror(e){this.emitReserved("error",e)}_onclose(e,t){if(!this.connected)return this;vt("closing socket - reason %s",e),this.emitReserved("disconnecting",e,t),this.server._opts.connectionStateRecovery&&dL.has(e)&&(vt("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=B0}_error(e){this.packet({type:sr.PacketType.CONNECT_ERROR,data:e})}disconnect(e=!1){return this.connected?(e?this.client._disconnect():(this.packet({type:sr.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){vt("dispatching an event %j",e),this.run(e,t=>{process.nextTick(()=>{if(t)return this._onerror(t);this.connected?super.emitUntyped.apply(this,e):vt("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 pL.BroadcastOperator(this.adapter,new Set,new Set([this.id]),e)}};Vi.Socket=Hf});var Uf=O(on=>{"use strict";var hL=on&&on.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(on,"__esModule",{value:!0});on.Namespace=on.RESERVED_EVENTS=void 0;var F0=$f(),mL=wc(),gL=hL(Te()),Gt=Ff(),Yi=(0,gL.default)("socket.io:namespace");on.RESERVED_EVENTS=new Set(["connect","connection","new_namespace"]);var qf=class extends mL.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=>{Yi("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 Gt.BroadcastOperator(this.adapter).to(e)}in(e){return new Gt.BroadcastOperator(this.adapter).in(e)}except(e){return new Gt.BroadcastOperator(this.adapter).except(e)}async _add(e,t,n){var i;Yi("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"){Yi("next called after client was closed - ignoring socket"),s._cleanup();return}if(o)return Yi("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){Yi("error while restoring session: %s",o)}if(s)return Yi("connection state recovered for sid %s",s.sid),new F0.Socket(this,e,t,s)}return new F0.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 Gt.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(on.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 Gt.BroadcastOperator(this.adapter).allSockets()}compress(e){return new Gt.BroadcastOperator(this.adapter).compress(e)}get volatile(){return new Gt.BroadcastOperator(this.adapter).volatile}get local(){return new Gt.BroadcastOperator(this.adapter).local}timeout(e){return new Gt.BroadcastOperator(this.adapter).timeout(e)}fetchSockets(){return new Gt.BroadcastOperator(this.adapter).fetchSockets()}socketsJoin(e){return new Gt.BroadcastOperator(this.adapter).socketsJoin(e)}socketsLeave(e){return new Gt.BroadcastOperator(this.adapter).socketsLeave(e)}disconnectSockets(e=!1){return new Gt.BroadcastOperator(this.adapter).disconnectSockets(e)}};on.Namespace=qf});var W0=O(fo=>{"use strict";Object.defineProperty(fo,"__esModule",{value:!0});fo.encode=Wf;fo.decode=vL;fo.yeast=xL;var q0="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Cc=64,U0={},H0=0,Mn=0,$0;function Wf(r){let e="";do e=q0[r%Cc]+e,r=Math.floor(r/Cc);while(r>0);return e}function vL(r){let e=0;for(Mn=0;Mn<r.length;Mn++)e=e*Cc+U0[r.charAt(Mn)];return e}function xL(){let r=Wf(+new Date);return r!==$0?(H0=0,$0=r):r+"."+Wf(H0++)}for(;Mn<Cc;Mn++)U0[q0[Mn]]=Mn});var an=O((O6,K0)=>{"use strict";var G0=["nodebuffer","arraybuffer","fragments"],z0=typeof Blob<"u";z0&&G0.push("blob");K0.exports={BINARY_TYPES:G0,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:z0,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var ho=O((P6,Ac)=>{"use strict";var{EMPTY_BUFFER:yL}=an(),Gf=Buffer[Symbol.species];function _L(r,e){if(r.length===0)return yL;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 Gf(t.buffer,t.byteOffset,n):t}function V0(r,e,t,n,i){for(let s=0;s<i;s++)t[n+s]=r[s]^e[s&3]}function Y0(r,e){for(let t=0;t<r.length;t++)r[t]^=e[t&3]}function bL(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function zf(r){if(zf.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new Gf(r):ArrayBuffer.isView(r)?e=new Gf(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),zf.readOnly=!1),e}Ac.exports={concat:_L,mask:V0,toArrayBuffer:bL,toBuffer:zf,unmask:Y0};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=Yp();Ac.exports.mask=function(e,t,n,i,s){s<48?V0(e,t,n,i,s):r.mask(e,t,n,i,s)},Ac.exports.unmask=function(e,t){e.length<32?Y0(e,t):r.unmask(e,t)}}catch{}});var Q0=O((M6,J0)=>{"use strict";var X0=Symbol("kDone"),Kf=Symbol("kRun"),Vf=class{constructor(e){this[X0]=()=>{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[X0])}}};J0.exports=Vf});var go=O((I6,r_)=>{"use strict";var mo=require("zlib"),Z0=ho(),wL=Q0(),{kStatusCode:e_}=an(),SL=Buffer[Symbol.species],EL=Buffer.from([0,0,255,255]),kc=Symbol("permessage-deflate"),cn=Symbol("total-length"),Xi=Symbol("callback"),In=Symbol("buffers"),Ji=Symbol("error"),Rc,Yf=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,!Rc){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Rc=new wL(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[Xi];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){Rc.add(i=>{this._decompress(e,t,(s,o)=>{i(),n(s,o)})})}compress(e,t,n){Rc.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[kc]=this,this._inflate[cn]=0,this._inflate[In]=[],this._inflate.on("error",CL),this._inflate.on("data",t_)}this._inflate[Xi]=n,this._inflate.write(e),t&&this._inflate.write(EL),this._inflate.flush(()=>{let s=this._inflate[Ji];if(s){this._inflate.close(),this._inflate=null,n(s);return}let o=Z0.concat(this._inflate[In],this._inflate[cn]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[cn]=0,this._inflate[In]=[],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[cn]=0,this._deflate[In]=[],this._deflate.on("data",TL)}this._deflate[Xi]=n,this._deflate.write(e),this._deflate.flush(mo.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=Z0.concat(this._deflate[In],this._deflate[cn]);t&&(s=new SL(s.buffer,s.byteOffset,s.length-4)),this._deflate[Xi]=null,this._deflate[cn]=0,this._deflate[In]=[],t&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,s)})}};r_.exports=Yf;function TL(r){this[In].push(r),this[cn]+=r.length}function t_(r){if(this[cn]+=r.length,this[kc]._maxPayload<1||this[cn]<=this[kc]._maxPayload){this[In].push(r);return}this[Ji]=new RangeError("Max payload size exceeded"),this[Ji].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Ji][e_]=1009,this.removeListener("data",t_),this.reset()}function CL(r){if(this[kc]._inflate=null,this[Ji]){this[Xi](this[Ji]);return}r[e_]=1007,this[Xi](r)}});var Qi=O((N6,Oc)=>{"use strict";var{isUtf8:n_}=require("buffer"),{hasBlob:AL}=an(),RL=[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 kL(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function Xf(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 OL(r){return AL&&typeof r=="object"&&typeof r.arrayBuffer=="function"&&typeof r.type=="string"&&typeof r.stream=="function"&&(r[Symbol.toStringTag]==="Blob"||r[Symbol.toStringTag]==="File")}Oc.exports={isBlob:OL,isValidStatusCode:kL,isValidUTF8:Xf,tokenChars:RL};if(n_)Oc.exports.isValidUTF8=function(r){return r.length<24?Xf(r):n_(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=rf();Oc.exports.isValidUTF8=function(e){return e.length<32?Xf(e):r(e)}}catch{}});var td=O((L6,u_)=>{"use strict";var{Writable:PL}=require("stream"),i_=go(),{BINARY_TYPES:ML,EMPTY_BUFFER:s_,kStatusCode:IL,kWebSocket:NL}=an(),{concat:Jf,toArrayBuffer:LL,unmask:DL}=ho(),{isValidStatusCode:BL,isValidUTF8:o_}=Qi(),Pc=Buffer[Symbol.species],or=0,a_=1,c_=2,l_=3,Qf=4,Zf=5,Mc=6,ed=class extends PL{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||ML[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[NL]=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 Pc(n.buffer,n.byteOffset+e,n.length-e),new Pc(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 Pc(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 a_:this.getPayloadLength16(e);break;case c_:this.getPayloadLength64(e);break;case l_:this.getMask();break;case Qf:this.getData(e);break;case Zf:case Mc: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[i_.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=c_: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=Qf}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Qf}getData(e){let t=s_;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=Zf,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[i_.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=Jf(n,t):this._binaryType==="arraybuffer"?i=LL(Jf(n,t)):this._binaryType==="blob"?i=new Blob(n):i=n,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=or):(this._state=Mc,setImmediate(()=>{this.emit("message",i,!0),this._state=or,this.startLoop(e)}))}else{let i=Jf(n,t);if(!this._skipUTF8Validation&&!o_(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(s);return}this._state===Zf||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=or):(this._state=Mc,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,s_),this.end();else{let n=e.readUInt16BE(0);if(!BL(n)){let s=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(s);return}let i=new Pc(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!o_(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=Mc,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[IL]=i,o}};u_.exports=ed});var id=O((B6,d_)=>{"use strict";var{Duplex:D6}=require("stream"),{randomFillSync:jL}=require("crypto"),p_=go(),{EMPTY_BUFFER:FL,kWebSocket:HL,NOOP:$L}=an(),{isBlob:Zi,isValidStatusCode:qL}=Qi(),{mask:f_,toBuffer:Zn}=ho(),ar=Symbol("kByteLength"),UL=Buffer.alloc(4),Ic=8*1024,ei,es=Ic,Tr=0,WL=1,GL=2,rd=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=$L,this[HL]=void 0}static frame(e,t){let n,i=!1,s=2,o=!1;t.mask&&(n=t.maskBuffer||UL,t.generateMask?t.generateMask(n):(es===Ic&&(ei===void 0&&(ei=Buffer.alloc(Ic)),jL(ei,0,Ic),es=0),n[0]=ei[es++],n[1]=ei[es++],n[2]=ei[es++],n[3]=ei[es++]),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 u=Buffer.allocUnsafe(i?a+s:s);return u[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(u[0]|=64),u[1]=c,c===126?u.writeUInt16BE(a,2):c===127&&(u[2]=u[3]=0,u.writeUIntBE(a,4,6)),t.mask?(u[1]|=128,u[s-4]=n[0],u[s-3]=n[1],u[s-2]=n[2],u[s-1]=n[3],o?[u,e]:i?(f_(e,n,u,s,a),[u]):(f_(e,n,e,0,a),[u,e])):[u,e]}close(e,t,n,i){let s;if(e===void 0)s=FL;else{if(typeof e!="number"||!qL(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):Zi(e)?(i=e.size,s=!1):(e=Zn(e),i=e.length,s=Zn.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};Zi(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):Zi(e)?(i=e.size,s=!1):(e=Zn(e),i=e.length,s=Zn.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};Zi(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[p_.extensionName],s=t.binary?2:1,o=t.compress,a,c;typeof e=="string"?(a=Buffer.byteLength(e),c=!1):Zi(e)?(a=e.size,c=!1):(e=Zn(e),a=e.length,c=Zn.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 u={[ar]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:c,rsv1:o};Zi(e)?this._state!==Tr?this.enqueue([this.getBlobData,e,this._compress,u,n]):this.getBlobData(e,this._compress,u,n):this._state!==Tr?this.enqueue([this.dispatch,e,this._compress,u,n]):this.dispatch(e,this._compress,u,n)}getBlobData(e,t,n,i){this._bufferedBytes+=n[ar],this._state=GL,e.arrayBuffer().then(s=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(nd,this,a,i);return}this._bufferedBytes-=n[ar];let o=Zn(s);t?this.dispatch(o,t,n,i):(this._state=Tr,this.sendFrame(r.frame(o,n),i),this.dequeue())}).catch(s=>{process.nextTick(zL,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[ar],this._state=WL,s.compress(e,n.fin,(o,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");nd(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)}};d_.exports=rd;function nd(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 zL(r,e,t){nd(r,e,t),r.onerror(e)}});var w_=O((j6,b_)=>{"use strict";var{kForOnEventAttribute:vo,kListener:sd}=an(),h_=Symbol("kCode"),m_=Symbol("kData"),g_=Symbol("kError"),v_=Symbol("kMessage"),x_=Symbol("kReason"),ts=Symbol("kTarget"),y_=Symbol("kType"),__=Symbol("kWasClean"),ln=class{constructor(e){this[ts]=null,this[y_]=e}get target(){return this[ts]}get type(){return this[y_]}};Object.defineProperty(ln.prototype,"target",{enumerable:!0});Object.defineProperty(ln.prototype,"type",{enumerable:!0});var ti=class extends ln{constructor(e,t={}){super(e),this[h_]=t.code===void 0?0:t.code,this[x_]=t.reason===void 0?"":t.reason,this[__]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[h_]}get reason(){return this[x_]}get wasClean(){return this[__]}};Object.defineProperty(ti.prototype,"code",{enumerable:!0});Object.defineProperty(ti.prototype,"reason",{enumerable:!0});Object.defineProperty(ti.prototype,"wasClean",{enumerable:!0});var rs=class extends ln{constructor(e,t={}){super(e),this[g_]=t.error===void 0?null:t.error,this[v_]=t.message===void 0?"":t.message}get error(){return this[g_]}get message(){return this[v_]}};Object.defineProperty(rs.prototype,"error",{enumerable:!0});Object.defineProperty(rs.prototype,"message",{enumerable:!0});var xo=class extends ln{constructor(e,t={}){super(e),this[m_]=t.data===void 0?null:t.data}get data(){return this[m_]}};Object.defineProperty(xo.prototype,"data",{enumerable:!0});var KL={addEventListener(r,e,t={}){for(let i of this.listeners(r))if(!t[vo]&&i[sd]===e&&!i[vo])return;let n;if(r==="message")n=function(s,o){let a=new xo("message",{data:o?s:s.toString()});a[ts]=this,Nc(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[ts]=this,Nc(e,this,a)};else if(r==="error")n=function(s){let o=new rs("error",{error:s,message:s.message});o[ts]=this,Nc(e,this,o)};else if(r==="open")n=function(){let s=new ln("open");s[ts]=this,Nc(e,this,s)};else return;n[vo]=!!t[vo],n[sd]=e,t.once?this.once(r,n):this.on(r,n)},removeEventListener(r,e){for(let t of this.listeners(r))if(t[sd]===e&&!t[vo]){this.removeListener(r,t);break}}};b_.exports={CloseEvent:ti,ErrorEvent:rs,Event:ln,EventTarget:KL,MessageEvent:xo};function Nc(r,e,t){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,t):r.call(e,t)}});var od=O((F6,S_)=>{"use strict";var{tokenChars:yo}=Qi();function jr(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}function VL(r){let e=Object.create(null),t=Object.create(null),n=!1,i=!1,s=!1,o,a,c=-1,u=-1,p=-1,f=0;for(;f<r.length;f++)if(u=r.charCodeAt(f),o===void 0)if(p===-1&&yo[u]===1)c===-1&&(c=f);else if(f!==0&&(u===32||u===9))p===-1&&c!==-1&&(p=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f);let y=r.slice(c,p);u===44?(jr(e,y,t),t=Object.create(null)):o=y,c=p=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);else if(a===void 0)if(p===-1&&yo[u]===1)c===-1&&(c=f);else if(u===32||u===9)p===-1&&c!==-1&&(p=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f),jr(t,r.slice(c,p),!0),u===44&&(jr(e,o,t),t=Object.create(null),o=void 0),c=p=-1}else if(u===61&&c!==-1&&p===-1)a=r.slice(c,f),c=p=-1;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(i){if(yo[u]!==1)throw new SyntaxError(`Unexpected character at index ${f}`);c===-1?c=f:n||(n=!0),i=!1}else if(s)if(yo[u]===1)c===-1&&(c=f);else if(u===34&&c!==-1)s=!1,p=f;else if(u===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(u===34&&r.charCodeAt(f-1)===61)s=!0;else if(p===-1&&yo[u]===1)c===-1&&(c=f);else if(c!==-1&&(u===32||u===9))p===-1&&(p=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f);let y=r.slice(c,p);n&&(y=y.replace(/\\/g,""),n=!1),jr(t,a,y),u===44&&(jr(e,o,t),t=Object.create(null),o=void 0),a=void 0,c=p=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);if(c===-1||s||u===32||u===9)throw new SyntaxError("Unexpected end of input");p===-1&&(p=f);let g=r.slice(c,p);return o===void 0?jr(e,g,t):(a===void 0?jr(t,g,!0):n?jr(t,a,g.replace(/\\/g,"")):jr(t,a,g),jr(e,o,t)),e}function YL(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(", ")}S_.exports={format:YL,parse:VL}});var jc=O((q6,L_)=>{"use strict";var XL=require("events"),JL=require("https"),QL=require("http"),C_=require("net"),ZL=require("tls"),{randomBytes:eD,createHash:tD}=require("crypto"),{Duplex:H6,Readable:$6}=require("stream"),{URL:ad}=require("url"),Nn=go(),rD=td(),nD=id(),{isBlob:iD}=Qi(),{BINARY_TYPES:E_,EMPTY_BUFFER:Lc,GUID:sD,kForOnEventAttribute:cd,kListener:oD,kStatusCode:aD,kWebSocket:pt,NOOP:A_}=an(),{EventTarget:{addEventListener:cD,removeEventListener:lD}}=w_(),{format:uD,parse:pD}=od(),{toBuffer:fD}=ho(),dD=30*1e3,R_=Symbol("kAborted"),ld=[8,13],un=["CONNECTING","OPEN","CLOSING","CLOSED"],hD=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,_e=class r extends XL{constructor(e,t,n){super(),this._binaryType=E_[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Lc,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]),k_(this,e,t,n)):(this._autoPong=n.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){E_.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 rD({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),s=new nD(e,this._extensions,n.generateMask);this._receiver=i,this._sender=s,this._socket=e,i[pt]=this,s[pt]=this,e[pt]=this,i.on("conclude",vD),i.on("drain",xD),i.on("error",yD),i.on("message",_D),i.on("ping",bD),i.on("pong",wD),s.onerror=SD,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",M_),e.on("data",Bc),e.on("end",I_),e.on("error",N_),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[Nn.extensionName]&&this._extensions[Nn.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())}),P_(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){ud(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||Lc,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){ud(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||Lc,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){ud(this,e,n);return}let i={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[Nn.extensionName]||(i.compress=!1),this._sender.send(e||Lc,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(_e,"CONNECTING",{enumerable:!0,value:un.indexOf("CONNECTING")});Object.defineProperty(_e.prototype,"CONNECTING",{enumerable:!0,value:un.indexOf("CONNECTING")});Object.defineProperty(_e,"OPEN",{enumerable:!0,value:un.indexOf("OPEN")});Object.defineProperty(_e.prototype,"OPEN",{enumerable:!0,value:un.indexOf("OPEN")});Object.defineProperty(_e,"CLOSING",{enumerable:!0,value:un.indexOf("CLOSING")});Object.defineProperty(_e.prototype,"CLOSING",{enumerable:!0,value:un.indexOf("CLOSING")});Object.defineProperty(_e,"CLOSED",{enumerable:!0,value:un.indexOf("CLOSED")});Object.defineProperty(_e.prototype,"CLOSED",{enumerable:!0,value:un.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(_e.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(_e.prototype,`on${r}`,{enumerable:!0,get(){for(let e of this.listeners(r))if(e[cd])return e[oD];return null},set(e){for(let t of this.listeners(r))if(t[cd]){this.removeListener(r,t);break}typeof e=="function"&&this.addEventListener(r,e,{[cd]:!0})}})});_e.prototype.addEventListener=cD;_e.prototype.removeEventListener=lD;L_.exports=_e;function k_(r,e,t,n){let i={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:ld[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,!ld.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${ld.join(", ")})`);let s;if(e instanceof ad)s=e;else try{s=new ad(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;Dc(r,S);return}let u=o?443:80,p=eD(16).toString("base64"),f=o?JL.request:QL.request,g=new Set,y;if(i.createConnection=i.createConnection||(o?gD:mD),i.defaultPort=i.defaultPort||u,i.port=s.port||u,i.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":p,Connection:"Upgrade",Upgrade:"websocket"},i.path=s.pathname+s.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(y=new Nn(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=uD({[Nn.extensionName]:y.offer()})),t.length){for(let S of t){if(typeof S!="string"||!hD.test(S)||g.has(S))throw new SyntaxError("An invalid or duplicated subprotocol was specified");g.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 b;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[R,I]of Object.entries(S))n.headers[R.toLowerCase()]=I}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")),b=r._req=f(i),r._redirects&&r.emit("redirect",r.url,b)}else b=r._req=f(i);i.timeout&&b.on("timeout",()=>{zt(r,b,"Opening handshake has timed out")}),b.on("error",S=>{b===null||b[R_]||(b=r._req=null,Dc(r,S))}),b.on("response",S=>{let R=S.headers.location,I=S.statusCode;if(R&&i.followRedirects&&I>=300&&I<400){if(++r._redirects>i.maxRedirects){zt(r,b,"Maximum redirects exceeded");return}b.abort();let L;try{L=new ad(R,e)}catch{let H=new SyntaxError(`Invalid URL: ${R}`);Dc(r,H);return}k_(r,L,t,n)}else r.emit("unexpected-response",b,S)||zt(r,b,`Unexpected server response: ${S.statusCode}`)}),b.on("upgrade",(S,R,I)=>{if(r.emit("upgrade",S),r.readyState!==_e.CONNECTING)return;b=r._req=null;let L=S.headers.upgrade;if(L===void 0||L.toLowerCase()!=="websocket"){zt(r,R,"Invalid Upgrade header");return}let N=tD("sha1").update(p+sD).digest("base64");if(S.headers["sec-websocket-accept"]!==N){zt(r,R,"Invalid Sec-WebSocket-Accept header");return}let H=S.headers["sec-websocket-protocol"],W;if(H!==void 0?g.size?g.has(H)||(W="Server sent an invalid subprotocol"):W="Server sent a subprotocol but none was requested":g.size&&(W="Server sent no subprotocol"),W){zt(r,R,W);return}H&&(r._protocol=H);let U=S.headers["sec-websocket-extensions"];if(U!==void 0){if(!y){zt(r,R,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let G;try{G=pD(U)}catch{zt(r,R,"Invalid Sec-WebSocket-Extensions header");return}let P=Object.keys(G);if(P.length!==1||P[0]!==Nn.extensionName){zt(r,R,"Server indicated an extension that was not requested");return}try{y.accept(G[Nn.extensionName])}catch{zt(r,R,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[Nn.extensionName]=y}r.setSocket(R,I,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(b,r):b.end()}function Dc(r,e){r._readyState=_e.CLOSING,r._errorEmitted=!0,r.emit("error",e),r.emitClose()}function mD(r){return r.path=r.socketPath,C_.connect(r)}function gD(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=C_.isIP(r.host)?"":r.host),ZL.connect(r)}function zt(r,e,t){r._readyState=_e.CLOSING;let n=new Error(t);Error.captureStackTrace(n,zt),e.setHeader?(e[R_]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(Dc,r,n)):(e.destroy(n),e.once("error",r.emit.bind(r,"error")),e.once("close",r.emitClose.bind(r)))}function ud(r,e,t){if(e){let n=iD(e)?e.size:fD(e).length;r._socket?r._sender._bufferedBytes+=n:r._bufferedAmount+=n}if(t){let n=new Error(`WebSocket is not open: readyState ${r.readyState} (${un[r.readyState]})`);process.nextTick(t,n)}}function vD(r,e){let t=this[pt];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=r,t._socket[pt]!==void 0&&(t._socket.removeListener("data",Bc),process.nextTick(O_,t._socket),r===1005?t.close():t.close(r,e))}function xD(){let r=this[pt];r.isPaused||r._socket.resume()}function yD(r){let e=this[pt];e._socket[pt]!==void 0&&(e._socket.removeListener("data",Bc),process.nextTick(O_,e._socket),e.close(r[aD])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r))}function T_(){this[pt].emitClose()}function _D(r,e){this[pt].emit("message",r,e)}function bD(r){let e=this[pt];e._autoPong&&e.pong(r,!this._isServer,A_),e.emit("ping",r)}function wD(r){this[pt].emit("pong",r)}function O_(r){r.resume()}function SD(r){let e=this[pt];e.readyState!==_e.CLOSED&&(e.readyState===_e.OPEN&&(e._readyState=_e.CLOSING,P_(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r)))}function P_(r){r._closeTimer=setTimeout(r._socket.destroy.bind(r._socket),dD)}function M_(){let r=this[pt];this.removeListener("close",M_),this.removeListener("data",Bc),this.removeListener("end",I_),r._readyState=_e.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[pt]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",T_),r._receiver.on("finish",T_))}function Bc(r){this[pt]._receiver.write(r)||this.pause()}function I_(){let r=this[pt];r._readyState=_e.CLOSING,r._receiver.end(),this.end()}function N_(){let r=this[pt];this.removeListener("error",N_),this.on("error",A_),r&&(r._readyState=_e.CLOSING,this.destroy())}});var F_=O((W6,j_)=>{"use strict";var U6=jc(),{Duplex:ED}=require("stream");function D_(r){r.emit("close")}function TD(){!this.destroyed&&this._writableState.finished&&this.destroy()}function B_(r){this.removeListener("error",B_),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function CD(r,e){let t=!0,n=new ED({...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(D_,n);return}let o=!1;r.once("error",function(c){o=!0,s(c)}),r.once("close",function(){o||s(i),process.nextTick(D_,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",TD),n.on("error",B_),n}j_.exports=CD});var $_=O((G6,H_)=>{"use strict";var{tokenChars:AD}=Qi();function RD(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&&AD[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}H_.exports={parse:RD}});var V_=O((K6,K_)=>{"use strict";var kD=require("events"),Fc=require("http"),{Duplex:z6}=require("stream"),{createHash:OD}=require("crypto"),q_=od(),ri=go(),PD=$_(),MD=jc(),{GUID:ID,kWebSocket:ND}=an(),LD=/^[+/0-9A-Za-z]{22}==$/,U_=0,W_=1,z_=2,pd=class extends kD{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:MD,...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=Fc.createServer((n,i)=>{let s=Fc.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=DD(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=U_}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===z_){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(_o,this);return}if(e&&this.once("close",e),this._state!==W_)if(this._state=W_,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(_o,this):process.nextTick(_o,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{_o(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",G_);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||!LD.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)){bo(t,400);return}let c=e.headers["sec-websocket-protocol"],u=new Set;if(c!==void 0)try{u=PD.parse(c)}catch{ni(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let p=e.headers["sec-websocket-extensions"],f={};if(this.options.perMessageDeflate&&p!==void 0){let g=new ri(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let y=q_.parse(p);y[ri.extensionName]&&(g.accept(y[ri.extensionName]),f[ri.extensionName]=g)}catch{ni(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let g={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(g,(y,b,S,R)=>{if(!y)return bo(t,b||401,S,R);this.completeUpgrade(f,s,u,e,t,n,i)});return}if(!this.options.verifyClient(g))return bo(t,401)}this.completeUpgrade(f,s,u,e,t,n,i)}completeUpgrade(e,t,n,i,s,o,a){if(!s.readable||!s.writable)return s.destroy();if(s[ND])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>U_)return bo(s,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${OD("sha1").update(t+ID).digest("base64")}`],p=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&&(u.push(`Sec-WebSocket-Protocol: ${f}`),p._protocol=f)}if(e[ri.extensionName]){let f=e[ri.extensionName].params,g=q_.format({[ri.extensionName]:[f]});u.push(`Sec-WebSocket-Extensions: ${g}`),p._extensions=e}this.emit("headers",u,i),s.write(u.concat(`\r
|
|
23
|
+
`+n)}r.destroy()}var fo=[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 JN(r){if(r+="",r.length<1)return!1;if(!fo[r.charCodeAt(0)])return ne('invalid header, index 0, char "%s"',r.charCodeAt(0)),!0;if(r.length<2)return!1;if(!fo[r.charCodeAt(1)])return ne('invalid header, index 1, char "%s"',r.charCodeAt(1)),!0;if(r.length<3)return!1;if(!fo[r.charCodeAt(2)])return ne('invalid header, index 2, char "%s"',r.charCodeAt(2)),!0;if(r.length<4)return!1;if(!fo[r.charCodeAt(3)])return ne('invalid header, index 3, char "%s"',r.charCodeAt(3)),!0;for(let e=4;e<r.length;++e)if(!fo[r.charCodeAt(e)])return ne('invalid header, index "%i", char "%s"',e,r.charCodeAt(e)),!0;return!1}});var I0=O(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});yc.Polling=void 0;var QN=Yn(),M0=require("zlib"),ZN=Ha(),eL=Ce(),or=(0,eL.default)("engine:polling"),tL={gzip:M0.createGzip,deflate:M0.createDeflate},jf=class extends QN.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){or("request overlap"),this.onError("overlap from client"),t.writeStatus("500 Internal Server Error"),t.end();return}or("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&&(or("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 u in a)t.writeHeader(u,String(a[u]));let c=u=>{this.onData(u.toString()),this.onDataRequestCleanup(),t.cork(()=>{t.end("ok")})};t.onAborted(()=>{this.onDataRequestCleanup(),this.onError("data request connection closed prematurely")}),t.onData((u,p)=>{let f=o+u.byteLength;if(f>n){this.onError("content-length mismatch"),t.close();return}if(!s){if(p){c(Buffer.from(u));return}s=Buffer.allocUnsafe(n)}if(Buffer.from(u).copy(s,o),p){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){or('received "%s"',e);let t=n=>{if(n.type==="close")return or("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&&(or("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){or('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=p=>{this.headers(this.req,o),this.res.cork(()=>{Object.keys(o).forEach(f=>{this.res.writeHeader(f,String(o[f]))}),this.res.end(p)}),n()};if(!this.httpCompression||!t.compress){a(e);return}if((i?Buffer.byteLength(e):e.length)<this.httpCompression.threshold){a(e);return}let u=ZN(this.req).encodings(["gzip","deflate"]);if(!u){a(e);return}this.compress(e,u,(p,f)=>{if(p){this.res.writeStatus("500 Internal Server Error"),this.res.end(),n(p);return}o["Content-Encoding"]=u,a(f)})}compress(e,t,n){or("compressing");let i=[],s=0;tL[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){or("closing");let t,n=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(or("transport writable - closing right away"),this.send([{type:"close"}]),n()):this.discarded?(or("transport discarded - closing right away"),n()):(or("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}};yc.Polling=jf});var L0=O(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.WebSocket=void 0;var rL=Yn(),nL=Ce(),N0=(0,nL.default)("engine:ws"),Ff=class extends rL.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;N0('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){N0("closing"),e&&e(),this.socket.end()}};_c.WebSocket=Ff});var D0=O(Hf=>{"use strict";Object.defineProperty(Hf,"__esModule",{value:!0});var iL=I0(),sL=L0();Hf.default={polling:iL.Polling,websocket:sL.WebSocket}});var B0=O(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.uServer=void 0;var oL=Ce(),ti=Bf(),aL=D0(),Nn=(0,oL.default)("engine:uws"),$f=class extends ti.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(()=>{Nn("response has been aborted")})}createTransport(e,t){return new aL.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 qf(t),super._applyMiddlewares(e,e.res,i=>{e.res.writeHead(),n(i)})}handleRequest(e,t){Nn('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:ti.Server.errorMessages[i],context:s}),this.abortRequest(t.res,i,s);return}if(t._query.sid)Nn("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(ti.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!1,n)})}handleUpgrade(e,t,n){Nn("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:ti.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 Nn("transport has already been trying to upgrade"),e.close();if(f.upgraded)return Nn("transport had already been upgraded"),e.close();Nn("upgrading existing transport"),c=this.createTransport(t._query.transport,t),f._maybeUpgrade(c)}else return Nn("upgrade attempt for closed client"),e.close()}else if(c=await this.handshake(t._query.transport,t,(f,m)=>this.abortRequest(e,f,m)),!c)return;let u={};!a&&this.emit("initial_headers",u,t),this.emit("headers",u,t),t.res.writeStatus("101 Switching Protocols"),Object.keys(u).forEach(f=>{t.res.writeHeader(f,u[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(ti.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!0,i)})}abortRequest(e,t,n){let i=t===ti.Server.errors.FORBIDDEN?"403 Forbidden":"400 Bad Request",s=n&&n.message?n.message:ti.Server.errorMessages[t];e.writeStatus(i),e.writeHeader("Content-Type","application/json"),e.end(JSON.stringify({code:t,message:s}))}};bc.uServer=$f;var qf=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 $0=O(ut=>{"use strict";Object.defineProperty(ut,"__esModule",{value:!0});ut.protocol=ut.Transport=ut.Socket=ut.uServer=ut.parser=ut.transports=ut.Server=void 0;ut.listen=dL;ut.attach=H0;var cL=require("http"),j0=Bf();Object.defineProperty(ut,"Server",{enumerable:!0,get:function(){return j0.Server}});var lL=Xp();ut.transports=lL.default;var F0=no();ut.parser=F0;var uL=B0();Object.defineProperty(ut,"uServer",{enumerable:!0,get:function(){return uL.uServer}});var pL=Qp();Object.defineProperty(ut,"Socket",{enumerable:!0,get:function(){return pL.Socket}});var fL=Yn();Object.defineProperty(ut,"Transport",{enumerable:!0,get:function(){return fL.Transport}});ut.protocol=F0.protocol;function dL(r,e,t){typeof e=="function"&&(t=e,e={});let n=(0,cL.createServer)(function(s,o){o.writeHead(501),o.end("Not Implemented")}),i=H0(n,e);return i.httpServer=n,n.listen(r,t),i}function H0(r,e){let t=new j0.Server(e);return t.attach(r,e),t}});var U0=O(q0=>{q0.Emitter=At;function At(r){if(r)return hL(r)}function hL(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 Uf=O(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});Sc.isBinary=G0;Sc.hasBinary=wc;var mL=typeof ArrayBuffer=="function",gL=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,W0=Object.prototype.toString,vL=typeof Blob=="function"||typeof Blob<"u"&&W0.call(Blob)==="[object BlobConstructor]",xL=typeof File=="function"||typeof File<"u"&&W0.call(File)==="[object FileConstructor]";function G0(r){return mL&&(r instanceof ArrayBuffer||gL(r))||vL&&r instanceof Blob||xL&&r instanceof File}function wc(r,e){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let t=0,n=r.length;t<n;t++)if(wc(r[t]))return!0;return!1}if(G0(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return wc(r.toJSON(),!0);for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&wc(r[t]))return!0;return!1}});var z0=O(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});Ec.deconstructPacket=_L;Ec.reconstructPacket=bL;var yL=Uf();function _L(r){let e=[],t=r.data,n=r;return n.data=Wf(t,e),n.attachments=e.length,{packet:n,buffers:e}}function Wf(r,e){if(!r)return r;if((0,yL.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]=Wf(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]=Wf(r[n],e));return t}return r}function bL(r,e){return r.data=Gf(r.data,e),delete r.attachments,r}function Gf(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]=Gf(r[t],e);else if(typeof r=="object")for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&(r[t]=Gf(r[t],e));return r}});var ho=O(Sr=>{"use strict";Object.defineProperty(Sr,"__esModule",{value:!0});Sr.Decoder=Sr.Encoder=Sr.PacketType=Sr.protocol=void 0;Sr.isPacketValid=AL;var wL=U0(),K0=z0(),V0=Uf(),SL=Ce(),zf=(0,SL.default)("socket.io-parser"),Y0=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];Sr.protocol=5;var ue;(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"})(ue||(Sr.PacketType=ue={}));var Kf=class{constructor(e){this.replacer=e}encode(e){return zf("encoding packet %j",e),(e.type===ue.EVENT||e.type===ue.ACK)&&(0,V0.hasBinary)(e)?this.encodeAsBinary({type:e.type===ue.EVENT?ue.BINARY_EVENT:ue.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===ue.BINARY_EVENT||e.type===ue.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)),zf("encoded %j as %s",e,t),t}encodeAsBinary(e){let t=(0,K0.deconstructPacket)(e),n=this.encodeAsString(t.packet),i=t.buffers;return i.unshift(n),i}};Sr.Encoder=Kf;var Vf=class r extends wL.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===ue.BINARY_EVENT;n||t.type===ue.BINARY_ACK?(t.type=n?ue.EVENT:ue.ACK,this.reconstructor=new Yf(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if((0,V0.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(ue[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===ue.BINARY_EVENT||n.type===ue.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(!X0(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 zf("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 ue.CONNECT:return Tc(t);case ue.DISCONNECT:return t===void 0;case ue.CONNECT_ERROR:return typeof t=="string"||Tc(t);case ue.EVENT:case ue.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&Y0.indexOf(t[0])===-1);case ue.ACK:case ue.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}};Sr.Decoder=Vf;var Yf=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,K0.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function EL(r){return typeof r=="string"}var X0=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r};function TL(r){return r===void 0||X0(r)}function Tc(r){return Object.prototype.toString.call(r)==="[object Object]"}function CL(r,e){switch(r){case ue.CONNECT:return e===void 0||Tc(e);case ue.DISCONNECT:return e===void 0;case ue.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&Y0.indexOf(e[0])===-1);case ue.ACK:return Array.isArray(e);case ue.CONNECT_ERROR:return typeof e=="string"||Tc(e);default:return!1}}function AL(r){return EL(r.nsp)&&TL(r.id)&&CL(r.type,r.data)}});var J0=O(Yi=>{"use strict";var RL=Yi&&Yi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Yi,"__esModule",{value:!0});Yi.Client=void 0;var Cc=ho(),kL=RL(Ce()),Er=(0,kL.default)("socket.io:client"),Xf=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?(Er("no namespace joined yet, close the client"),this.close()):Er("the client has already joined a namespace, nothing to do")},this.server._connectTimeout)}connect(e,t={}){if(this.server._nsps.has(e))return Er("connecting to namespace %s",e),this.doConnect(e,t);this.server._checkNamespace(e,t,n=>{n?this.doConnect(e,t):(Er("creation of namespace %s was denied",e),this._packet({type:Cc.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 Er("ignoring remove for %s",e.id)}close(){this.conn.readyState==="open"&&(Er("forcing transport close"),this.conn.close(),this.onclose("forced server close"))}_packet(e,t={}){if(this.conn.readyState!=="open"){Er("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){Er("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){Er("invalid packet format"),this.onerror(t)}}ondecoded(e){let{namespace:t,authPayload:n}=this._parseNamespace(e),i=this.nsps.get(t);!i&&e.type===Cc.PacketType.CONNECT?this.connect(t,n):i&&e.type!==Cc.PacketType.CONNECT&&e.type!==Cc.PacketType.CONNECT_ERROR?process.nextTick(function(){i._onpacket(e)}):(Er("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){Er("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)}};Yi.Client=Xf});var Rc=O(Ac=>{"use strict";Object.defineProperty(Ac,"__esModule",{value:!0});Ac.StrictEventEmitter=void 0;var OL=require("events"),Jf=class extends OL.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)}};Ac.StrictEventEmitter=Jf});var Qf=O(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0});kc.RESERVED_EVENTS=void 0;kc.RESERVED_EVENTS=new Set(["connect","connect_error","disconnect","disconnecting","newListener","removeListener"])});var Zf=O(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.RemoteSocket=Xi.BroadcastOperator=void 0;var PL=Qf(),ML=ho(),Oc=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(PL.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let n=[e,...t],i={type:ML.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=[],u=setTimeout(()=>{a=!0,o.apply(this,[new Error("operation has timed out"),this.flags.expectSingleResponse?null:c])},this.flags.timeout),p=-1,f=0,m=0,y=()=>{!a&&p===f&&c.length===m&&(clearTimeout(u),o.apply(this,[null,this.flags.expectSingleResponse?c[0]:c]))};return this.adapter.broadcastWithAck(i,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags},_=>{m+=_,f++,y()},_=>{c.push(_),y()}),this.adapter.serverCount().then(_=>{p=_,y()}),!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 Pc(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)}};Xi.BroadcastOperator=Oc;var Pc=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 Oc(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}};Xi.RemoteSocket=Pc});var td=O(Ji=>{"use strict";var e_=Ji&&Ji.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ji,"__esModule",{value:!0});Ji.Socket=void 0;var ar=ho(),IL=e_(Ce()),NL=Rc(),Q0=e_(Op()),LL=Zf(),DL=Qf(),yt=(0,IL.default)("socket.io:socket"),BL=new Set(["transport error","transport close","forced close","ping timeout","server shutting down","forced server close"]);function Z0(){}var ed=class extends NL.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:ar.PacketType.EVENT,data:s})}),this.recovered=!0):(t.conn.protocol===3?this.id=e.name!=="/"?e.name+"#"+t.id:t.id:this.id=Q0.default.generateId(),this.server._opts.connectionStateRecovery&&(this.pid=Q0.default.generateId())),this.handshake=this.buildHandshake(n),this.on("error",Z0)}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(DL.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let n=[e,...t],i={type:ar.PacketType.EVENT,data:n};if(typeof n[n.length-1]=="function"){let o=this.nsp._ids++;yt("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(()=>{yt("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 yt("join room %s",e),this.adapter.addAll(this.id,new Set(Array.isArray(e)?e:[e]))}leave(e){return yt("leave room %s",e),this.adapter.del(this.id,e)}leaveAll(){this.adapter.delAll(this.id)}_onconnect(){yt("socket connected - writing packet"),this.connected=!0,this.join(this.id),this.conn.protocol===3?this.packet({type:ar.PacketType.CONNECT}):this.packet({type:ar.PacketType.CONNECT,data:{sid:this.id,pid:this.pid}})}_onpacket(e){switch(yt("got packet %j",e),e.type){case ar.PacketType.EVENT:this.onevent(e);break;case ar.PacketType.BINARY_EVENT:this.onevent(e);break;case ar.PacketType.ACK:this.onack(e);break;case ar.PacketType.BINARY_ACK:this.onack(e);break;case ar.PacketType.DISCONNECT:this.ondisconnect();break}}onevent(e){let t=e.data||[];if(yt("emitting event %j",t),e.id!=null&&(yt("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);yt("sending ack %j",i),t.packet({id:e,type:ar.PacketType.ACK,data:i}),n=!0}}onack(e){let t=this.acks.get(e.id);typeof t=="function"?(yt("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),this.acks.delete(e.id)):yt("bad ack %s",e.id)}ondisconnect(){yt("got disconnect packet"),this._onclose("client namespace disconnect")}_onerror(e){this.emitReserved("error",e)}_onclose(e,t){if(!this.connected)return this;yt("closing socket - reason %s",e),this.emitReserved("disconnecting",e,t),this.server._opts.connectionStateRecovery&&BL.has(e)&&(yt("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=Z0}_error(e){this.packet({type:ar.PacketType.CONNECT_ERROR,data:e})}disconnect(e=!1){return this.connected?(e?this.client._disconnect():(this.packet({type:ar.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){yt("dispatching an event %j",e),this.run(e,t=>{process.nextTick(()=>{if(t)return this._onerror(t);this.connected?super.emitUntyped.apply(this,e):yt("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 LL.BroadcastOperator(this.adapter,new Set,new Set([this.id]),e)}};Ji.Socket=ed});var nd=O(on=>{"use strict";var jL=on&&on.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(on,"__esModule",{value:!0});on.Namespace=on.RESERVED_EVENTS=void 0;var t_=td(),FL=Rc(),HL=jL(Ce()),Yt=Zf(),Qi=(0,HL.default)("socket.io:namespace");on.RESERVED_EVENTS=new Set(["connect","connection","new_namespace"]);var rd=class extends FL.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=>{Qi("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 Yt.BroadcastOperator(this.adapter).to(e)}in(e){return new Yt.BroadcastOperator(this.adapter).in(e)}except(e){return new Yt.BroadcastOperator(this.adapter).except(e)}async _add(e,t,n){var i;Qi("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"){Qi("next called after client was closed - ignoring socket"),s._cleanup();return}if(o)return Qi("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){Qi("error while restoring session: %s",o)}if(s)return Qi("connection state recovered for sid %s",s.sid),new t_.Socket(this,e,t,s)}return new t_.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 Yt.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(on.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 Yt.BroadcastOperator(this.adapter).allSockets()}compress(e){return new Yt.BroadcastOperator(this.adapter).compress(e)}get volatile(){return new Yt.BroadcastOperator(this.adapter).volatile}get local(){return new Yt.BroadcastOperator(this.adapter).local}timeout(e){return new Yt.BroadcastOperator(this.adapter).timeout(e)}fetchSockets(){return new Yt.BroadcastOperator(this.adapter).fetchSockets()}socketsJoin(e){return new Yt.BroadcastOperator(this.adapter).socketsJoin(e)}socketsLeave(e){return new Yt.BroadcastOperator(this.adapter).socketsLeave(e)}disconnectSockets(e=!1){return new Yt.BroadcastOperator(this.adapter).disconnectSockets(e)}};on.Namespace=rd});var o_=O(mo=>{"use strict";Object.defineProperty(mo,"__esModule",{value:!0});mo.encode=id;mo.decode=$L;mo.yeast=qL;var i_="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Mc=64,s_={},r_=0,Ln=0,n_;function id(r){let e="";do e=i_[r%Mc]+e,r=Math.floor(r/Mc);while(r>0);return e}function $L(r){let e=0;for(Ln=0;Ln<r.length;Ln++)e=e*Mc+s_[r.charAt(Ln)];return e}function qL(){let r=id(+new Date);return r!==n_?(r_=0,n_=r):r+"."+id(r_++)}for(;Ln<Mc;Ln++)s_[i_[Ln]]=Ln});var an=O((tW,l_)=>{"use strict";var a_=["nodebuffer","arraybuffer","fragments"],c_=typeof Blob<"u";c_&&a_.push("blob");l_.exports={BINARY_TYPES:a_,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:c_,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var go=O((rW,Ic)=>{"use strict";var{EMPTY_BUFFER:UL}=an(),sd=Buffer[Symbol.species];function WL(r,e){if(r.length===0)return UL;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 sd(t.buffer,t.byteOffset,n):t}function u_(r,e,t,n,i){for(let s=0;s<i;s++)t[n+s]=r[s]^e[s&3]}function p_(r,e){for(let t=0;t<r.length;t++)r[t]^=e[t&3]}function GL(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function od(r){if(od.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new sd(r):ArrayBuffer.isView(r)?e=new sd(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),od.readOnly=!1),e}Ic.exports={concat:WL,mask:u_,toArrayBuffer:GL,toBuffer:od,unmask:p_};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=uf();Ic.exports.mask=function(e,t,n,i,s){s<48?u_(e,t,n,i,s):r.mask(e,t,n,i,s)},Ic.exports.unmask=function(e,t){e.length<32?p_(e,t):r.unmask(e,t)}}catch{}});var h_=O((nW,d_)=>{"use strict";var f_=Symbol("kDone"),ad=Symbol("kRun"),cd=class{constructor(e){this[f_]=()=>{this.pending--,this[ad]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[ad]()}[ad](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[f_])}}};d_.exports=cd});var xo=O((iW,x_)=>{"use strict";var vo=require("zlib"),m_=go(),zL=h_(),{kStatusCode:g_}=an(),KL=Buffer[Symbol.species],VL=Buffer.from([0,0,255,255]),Lc=Symbol("permessage-deflate"),cn=Symbol("total-length"),Zi=Symbol("callback"),Dn=Symbol("buffers"),es=Symbol("error"),Nc,ld=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,!Nc){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Nc=new zL(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){Nc.add(i=>{this._decompress(e,t,(s,o)=>{i(),n(s,o)})})}compress(e,t,n){Nc.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[Lc]=this,this._inflate[cn]=0,this._inflate[Dn]=[],this._inflate.on("error",XL),this._inflate.on("data",v_)}this._inflate[Zi]=n,this._inflate.write(e),t&&this._inflate.write(VL),this._inflate.flush(()=>{let s=this._inflate[es];if(s){this._inflate.close(),this._inflate=null,n(s);return}let o=m_.concat(this._inflate[Dn],this._inflate[cn]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[cn]=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[cn]=0,this._deflate[Dn]=[],this._deflate.on("data",YL)}this._deflate[Zi]=n,this._deflate.write(e),this._deflate.flush(vo.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=m_.concat(this._deflate[Dn],this._deflate[cn]);t&&(s=new KL(s.buffer,s.byteOffset,s.length-4)),this._deflate[Zi]=null,this._deflate[cn]=0,this._deflate[Dn]=[],t&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,s)})}};x_.exports=ld;function YL(r){this[Dn].push(r),this[cn]+=r.length}function v_(r){if(this[cn]+=r.length,this[Lc]._maxPayload<1||this[cn]<=this[Lc]._maxPayload){this[Dn].push(r);return}this[es]=new RangeError("Max payload size exceeded"),this[es].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[es][g_]=1009,this.removeListener("data",v_),this.reset()}function XL(r){if(this[Lc]._inflate=null,this[es]){this[Zi](this[es]);return}r[g_]=1007,this[Zi](r)}});var ts=O((sW,Dc)=>{"use strict";var{isUtf8:y_}=require("buffer"),{hasBlob:JL}=an(),QL=[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 ZL(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function ud(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 eD(r){return JL&&typeof r=="object"&&typeof r.arrayBuffer=="function"&&typeof r.type=="string"&&typeof r.stream=="function"&&(r[Symbol.toStringTag]==="Blob"||r[Symbol.toStringTag]==="File")}Dc.exports={isBlob:eD,isValidStatusCode:ZL,isValidUTF8:ud,tokenChars:QL};if(y_)Dc.exports.isValidUTF8=function(r){return r.length<24?ud(r):y_(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=vf();Dc.exports.isValidUTF8=function(e){return e.length<32?ud(e):r(e)}}catch{}});var md=O((oW,C_)=>{"use strict";var{Writable:tD}=require("stream"),__=xo(),{BINARY_TYPES:rD,EMPTY_BUFFER:b_,kStatusCode:nD,kWebSocket:iD}=an(),{concat:pd,toArrayBuffer:sD,unmask:oD}=go(),{isValidStatusCode:aD,isValidUTF8:w_}=ts(),Bc=Buffer[Symbol.species],cr=0,S_=1,E_=2,T_=3,fd=4,dd=5,jc=6,hd=class extends tD{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||rD[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[iD]=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=cr}_write(e,t,n){if(this._opcode===8&&this._state==cr)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 Bc(n.buffer,n.byteOffset+e,n.length-e),new Bc(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 Bc(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 cr:this.getInfo(e);break;case S_:this.getPayloadLength16(e);break;case E_:this.getPayloadLength64(e);break;case T_:this.getMask();break;case fd:this.getData(e);break;case dd:case jc: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[__.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=S_:this._payloadLength===127?this._state=E_: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=T_:this._state=fd}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=fd}getData(e){let t=b_;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&&oD(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=dd,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[__.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===cr&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=cr;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=pd(n,t):this._binaryType==="arraybuffer"?i=sD(pd(n,t)):this._binaryType==="blob"?i=new Blob(n):i=n,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=cr):(this._state=jc,setImmediate(()=>{this.emit("message",i,!0),this._state=cr,this.startLoop(e)}))}else{let i=pd(n,t);if(!this._skipUTF8Validation&&!w_(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(s);return}this._state===dd||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=cr):(this._state=jc,setImmediate(()=>{this.emit("message",i,!1),this._state=cr,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,b_),this.end();else{let n=e.readUInt16BE(0);if(!aD(n)){let s=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(s);return}let i=new Bc(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!w_(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=cr;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=cr):(this._state=jc,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=cr,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[nD]=i,o}};C_.exports=hd});var xd=O((cW,k_)=>{"use strict";var{Duplex:aW}=require("stream"),{randomFillSync:cD}=require("crypto"),A_=xo(),{EMPTY_BUFFER:lD,kWebSocket:uD,NOOP:pD}=an(),{isBlob:rs,isValidStatusCode:fD}=ts(),{mask:R_,toBuffer:ri}=go(),lr=Symbol("kByteLength"),dD=Buffer.alloc(4),Fc=8*1024,ni,ns=Fc,Tr=0,hD=1,mD=2,gd=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=pD,this[uD]=void 0}static frame(e,t){let n,i=!1,s=2,o=!1;t.mask&&(n=t.maskBuffer||dD,t.generateMask?t.generateMask(n):(ns===Fc&&(ni===void 0&&(ni=Buffer.alloc(Fc)),cD(ni,0,Fc),ns=0),n[0]=ni[ns++],n[1]=ni[ns++],n[2]=ni[ns++],n[3]=ni[ns++]),o=(n[0]|n[1]|n[2]|n[3])===0,s=6);let a;typeof e=="string"?(!t.mask||o)&&t[lr]!==void 0?a=t[lr]:(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 u=Buffer.allocUnsafe(i?a+s:s);return u[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(u[0]|=64),u[1]=c,c===126?u.writeUInt16BE(a,2):c===127&&(u[2]=u[3]=0,u.writeUIntBE(a,4,6)),t.mask?(u[1]|=128,u[s-4]=n[0],u[s-3]=n[1],u[s-2]=n[2],u[s-1]=n[3],o?[u,e]:i?(R_(e,n,u,s,a),[u]):(R_(e,n,e,0,a),[u,e])):[u,e]}close(e,t,n,i){let s;if(e===void 0)s=lD;else{if(typeof e!="number"||!fD(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={[lr]: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):rs(e)?(i=e.size,s=!1):(e=ri(e),i=e.length,s=ri.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[lr]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};rs(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):rs(e)?(i=e.size,s=!1):(e=ri(e),i=e.length,s=ri.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[lr]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};rs(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[A_.extensionName],s=t.binary?2:1,o=t.compress,a,c;typeof e=="string"?(a=Buffer.byteLength(e),c=!1):rs(e)?(a=e.size,c=!1):(e=ri(e),a=e.length,c=ri.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 u={[lr]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:c,rsv1:o};rs(e)?this._state!==Tr?this.enqueue([this.getBlobData,e,this._compress,u,n]):this.getBlobData(e,this._compress,u,n):this._state!==Tr?this.enqueue([this.dispatch,e,this._compress,u,n]):this.dispatch(e,this._compress,u,n)}getBlobData(e,t,n,i){this._bufferedBytes+=n[lr],this._state=mD,e.arrayBuffer().then(s=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(vd,this,a,i);return}this._bufferedBytes-=n[lr];let o=ri(s);t?this.dispatch(o,t,n,i):(this._state=Tr,this.sendFrame(r.frame(o,n),i),this.dequeue())}).catch(s=>{process.nextTick(gD,this,s,i)})}dispatch(e,t,n,i){if(!t){this.sendFrame(r.frame(e,n),i);return}let s=this._extensions[A_.extensionName];this._bufferedBytes+=n[lr],this._state=hD,s.compress(e,n.fin,(o,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");vd(this,c,i);return}this._bufferedBytes-=n[lr],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][lr],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][lr],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)}};k_.exports=gd;function vd(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 gD(r,e,t){vd(r,e,t),r.onerror(e)}});var j_=O((lW,B_)=>{"use strict";var{kForOnEventAttribute:yo,kListener:yd}=an(),O_=Symbol("kCode"),P_=Symbol("kData"),M_=Symbol("kError"),I_=Symbol("kMessage"),N_=Symbol("kReason"),is=Symbol("kTarget"),L_=Symbol("kType"),D_=Symbol("kWasClean"),ln=class{constructor(e){this[is]=null,this[L_]=e}get target(){return this[is]}get type(){return this[L_]}};Object.defineProperty(ln.prototype,"target",{enumerable:!0});Object.defineProperty(ln.prototype,"type",{enumerable:!0});var ii=class extends ln{constructor(e,t={}){super(e),this[O_]=t.code===void 0?0:t.code,this[N_]=t.reason===void 0?"":t.reason,this[D_]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[O_]}get reason(){return this[N_]}get wasClean(){return this[D_]}};Object.defineProperty(ii.prototype,"code",{enumerable:!0});Object.defineProperty(ii.prototype,"reason",{enumerable:!0});Object.defineProperty(ii.prototype,"wasClean",{enumerable:!0});var ss=class extends ln{constructor(e,t={}){super(e),this[M_]=t.error===void 0?null:t.error,this[I_]=t.message===void 0?"":t.message}get error(){return this[M_]}get message(){return this[I_]}};Object.defineProperty(ss.prototype,"error",{enumerable:!0});Object.defineProperty(ss.prototype,"message",{enumerable:!0});var _o=class extends ln{constructor(e,t={}){super(e),this[P_]=t.data===void 0?null:t.data}get data(){return this[P_]}};Object.defineProperty(_o.prototype,"data",{enumerable:!0});var vD={addEventListener(r,e,t={}){for(let i of this.listeners(r))if(!t[yo]&&i[yd]===e&&!i[yo])return;let n;if(r==="message")n=function(s,o){let a=new _o("message",{data:o?s:s.toString()});a[is]=this,Hc(e,this,a)};else if(r==="close")n=function(s,o){let a=new ii("close",{code:s,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[is]=this,Hc(e,this,a)};else if(r==="error")n=function(s){let o=new ss("error",{error:s,message:s.message});o[is]=this,Hc(e,this,o)};else if(r==="open")n=function(){let s=new ln("open");s[is]=this,Hc(e,this,s)};else return;n[yo]=!!t[yo],n[yd]=e,t.once?this.once(r,n):this.on(r,n)},removeEventListener(r,e){for(let t of this.listeners(r))if(t[yd]===e&&!t[yo]){this.removeListener(r,t);break}}};B_.exports={CloseEvent:ii,ErrorEvent:ss,Event:ln,EventTarget:vD,MessageEvent:_o};function Hc(r,e,t){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,t):r.call(e,t)}});var _d=O((uW,F_)=>{"use strict";var{tokenChars:bo}=ts();function Br(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}function xD(r){let e=Object.create(null),t=Object.create(null),n=!1,i=!1,s=!1,o,a,c=-1,u=-1,p=-1,f=0;for(;f<r.length;f++)if(u=r.charCodeAt(f),o===void 0)if(p===-1&&bo[u]===1)c===-1&&(c=f);else if(f!==0&&(u===32||u===9))p===-1&&c!==-1&&(p=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f);let y=r.slice(c,p);u===44?(Br(e,y,t),t=Object.create(null)):o=y,c=p=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);else if(a===void 0)if(p===-1&&bo[u]===1)c===-1&&(c=f);else if(u===32||u===9)p===-1&&c!==-1&&(p=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f),Br(t,r.slice(c,p),!0),u===44&&(Br(e,o,t),t=Object.create(null),o=void 0),c=p=-1}else if(u===61&&c!==-1&&p===-1)a=r.slice(c,f),c=p=-1;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(i){if(bo[u]!==1)throw new SyntaxError(`Unexpected character at index ${f}`);c===-1?c=f:n||(n=!0),i=!1}else if(s)if(bo[u]===1)c===-1&&(c=f);else if(u===34&&c!==-1)s=!1,p=f;else if(u===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(u===34&&r.charCodeAt(f-1)===61)s=!0;else if(p===-1&&bo[u]===1)c===-1&&(c=f);else if(c!==-1&&(u===32||u===9))p===-1&&(p=f);else if(u===59||u===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);p===-1&&(p=f);let y=r.slice(c,p);n&&(y=y.replace(/\\/g,""),n=!1),Br(t,a,y),u===44&&(Br(e,o,t),t=Object.create(null),o=void 0),a=void 0,c=p=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);if(c===-1||s||u===32||u===9)throw new SyntaxError("Unexpected end of input");p===-1&&(p=f);let m=r.slice(c,p);return o===void 0?Br(e,m,t):(a===void 0?Br(t,m,!0):n?Br(t,a,m.replace(/\\/g,"")):Br(t,a,m),Br(e,o,t)),e}function yD(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(", ")}F_.exports={format:yD,parse:xD}});var Wc=O((dW,J_)=>{"use strict";var _D=require("events"),bD=require("https"),wD=require("http"),q_=require("net"),SD=require("tls"),{randomBytes:ED,createHash:TD}=require("crypto"),{Duplex:pW,Readable:fW}=require("stream"),{URL:bd}=require("url"),Bn=xo(),CD=md(),AD=xd(),{isBlob:RD}=ts(),{BINARY_TYPES:H_,EMPTY_BUFFER:$c,GUID:kD,kForOnEventAttribute:wd,kListener:OD,kStatusCode:PD,kWebSocket:pt,NOOP:U_}=an(),{EventTarget:{addEventListener:MD,removeEventListener:ID}}=j_(),{format:ND,parse:LD}=_d(),{toBuffer:DD}=go(),BD=30*1e3,W_=Symbol("kAborted"),Sd=[8,13],un=["CONNECTING","OPEN","CLOSING","CLOSED"],jD=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,we=class r extends _D{constructor(e,t,n){super(),this._binaryType=H_[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=$c,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]),G_(this,e,t,n)):(this._autoPong=n.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){H_.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 CD({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),s=new AD(e,this._extensions,n.generateMask);this._receiver=i,this._sender=s,this._socket=e,i[pt]=this,s[pt]=this,e[pt]=this,i.on("conclude",$D),i.on("drain",qD),i.on("error",UD),i.on("message",WD),i.on("ping",GD),i.on("pong",zD),s.onerror=KD,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",V_),e.on("data",Uc),e.on("end",Y_),e.on("error",X_),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[Bn.extensionName]&&this._extensions[Bn.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())}),K_(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){Ed(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||$c,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){Ed(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||$c,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){Ed(this,e,n);return}let i={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[Bn.extensionName]||(i.compress=!1),this._sender.send(e||$c,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(we,"CONNECTING",{enumerable:!0,value:un.indexOf("CONNECTING")});Object.defineProperty(we.prototype,"CONNECTING",{enumerable:!0,value:un.indexOf("CONNECTING")});Object.defineProperty(we,"OPEN",{enumerable:!0,value:un.indexOf("OPEN")});Object.defineProperty(we.prototype,"OPEN",{enumerable:!0,value:un.indexOf("OPEN")});Object.defineProperty(we,"CLOSING",{enumerable:!0,value:un.indexOf("CLOSING")});Object.defineProperty(we.prototype,"CLOSING",{enumerable:!0,value:un.indexOf("CLOSING")});Object.defineProperty(we,"CLOSED",{enumerable:!0,value:un.indexOf("CLOSED")});Object.defineProperty(we.prototype,"CLOSED",{enumerable:!0,value:un.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[wd])return e[OD];return null},set(e){for(let t of this.listeners(r))if(t[wd]){this.removeListener(r,t);break}typeof e=="function"&&this.addEventListener(r,e,{[wd]:!0})}})});we.prototype.addEventListener=MD;we.prototype.removeEventListener=ID;J_.exports=we;function G_(r,e,t,n){let i={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:Sd[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,!Sd.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${Sd.join(", ")})`);let s;if(e instanceof bd)s=e;else try{s=new bd(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;qc(r,S);return}let u=o?443:80,p=ED(16).toString("base64"),f=o?bD.request:wD.request,m=new Set,y;if(i.createConnection=i.createConnection||(o?HD:FD),i.defaultPort=i.defaultPort||u,i.port=s.port||u,i.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":p,Connection:"Upgrade",Upgrade:"websocket"},i.path=s.pathname+s.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(y=new Bn(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=ND({[Bn.extensionName]:y.offer()})),t.length){for(let S of t){if(typeof S!="string"||!jD.test(S)||m.has(S))throw new SyntaxError("An invalid or duplicated subprotocol was specified");m.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 _;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[A,P]of Object.entries(S))n.headers[A.toLowerCase()]=P}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")),_=r._req=f(i),r._redirects&&r.emit("redirect",r.url,_)}else _=r._req=f(i);i.timeout&&_.on("timeout",()=>{Xt(r,_,"Opening handshake has timed out")}),_.on("error",S=>{_===null||_[W_]||(_=r._req=null,qc(r,S))}),_.on("response",S=>{let A=S.headers.location,P=S.statusCode;if(A&&i.followRedirects&&P>=300&&P<400){if(++r._redirects>i.maxRedirects){Xt(r,_,"Maximum redirects exceeded");return}_.abort();let L;try{L=new bd(A,e)}catch{let H=new SyntaxError(`Invalid URL: ${A}`);qc(r,H);return}G_(r,L,t,n)}else r.emit("unexpected-response",_,S)||Xt(r,_,`Unexpected server response: ${S.statusCode}`)}),_.on("upgrade",(S,A,P)=>{if(r.emit("upgrade",S),r.readyState!==we.CONNECTING)return;_=r._req=null;let L=S.headers.upgrade;if(L===void 0||L.toLowerCase()!=="websocket"){Xt(r,A,"Invalid Upgrade header");return}let N=TD("sha1").update(p+kD).digest("base64");if(S.headers["sec-websocket-accept"]!==N){Xt(r,A,"Invalid Sec-WebSocket-Accept header");return}let H=S.headers["sec-websocket-protocol"],W;if(H!==void 0?m.size?m.has(H)||(W="Server sent an invalid subprotocol"):W="Server sent a subprotocol but none was requested":m.size&&(W="Server sent no subprotocol"),W){Xt(r,A,W);return}H&&(r._protocol=H);let U=S.headers["sec-websocket-extensions"];if(U!==void 0){if(!y){Xt(r,A,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let G;try{G=LD(U)}catch{Xt(r,A,"Invalid Sec-WebSocket-Extensions header");return}let M=Object.keys(G);if(M.length!==1||M[0]!==Bn.extensionName){Xt(r,A,"Server indicated an extension that was not requested");return}try{y.accept(G[Bn.extensionName])}catch{Xt(r,A,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[Bn.extensionName]=y}r.setSocket(A,P,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(_,r):_.end()}function qc(r,e){r._readyState=we.CLOSING,r._errorEmitted=!0,r.emit("error",e),r.emitClose()}function FD(r){return r.path=r.socketPath,q_.connect(r)}function HD(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=q_.isIP(r.host)?"":r.host),SD.connect(r)}function Xt(r,e,t){r._readyState=we.CLOSING;let n=new Error(t);Error.captureStackTrace(n,Xt),e.setHeader?(e[W_]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(qc,r,n)):(e.destroy(n),e.once("error",r.emit.bind(r,"error")),e.once("close",r.emitClose.bind(r)))}function Ed(r,e,t){if(e){let n=RD(e)?e.size:DD(e).length;r._socket?r._sender._bufferedBytes+=n:r._bufferedAmount+=n}if(t){let n=new Error(`WebSocket is not open: readyState ${r.readyState} (${un[r.readyState]})`);process.nextTick(t,n)}}function $D(r,e){let t=this[pt];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=r,t._socket[pt]!==void 0&&(t._socket.removeListener("data",Uc),process.nextTick(z_,t._socket),r===1005?t.close():t.close(r,e))}function qD(){let r=this[pt];r.isPaused||r._socket.resume()}function UD(r){let e=this[pt];e._socket[pt]!==void 0&&(e._socket.removeListener("data",Uc),process.nextTick(z_,e._socket),e.close(r[PD])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r))}function $_(){this[pt].emitClose()}function WD(r,e){this[pt].emit("message",r,e)}function GD(r){let e=this[pt];e._autoPong&&e.pong(r,!this._isServer,U_),e.emit("ping",r)}function zD(r){this[pt].emit("pong",r)}function z_(r){r.resume()}function KD(r){let e=this[pt];e.readyState!==we.CLOSED&&(e.readyState===we.OPEN&&(e._readyState=we.CLOSING,K_(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r)))}function K_(r){r._closeTimer=setTimeout(r._socket.destroy.bind(r._socket),BD)}function V_(){let r=this[pt];this.removeListener("close",V_),this.removeListener("data",Uc),this.removeListener("end",Y_),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[pt]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",$_),r._receiver.on("finish",$_))}function Uc(r){this[pt]._receiver.write(r)||this.pause()}function Y_(){let r=this[pt];r._readyState=we.CLOSING,r._receiver.end(),this.end()}function X_(){let r=this[pt];this.removeListener("error",X_),this.on("error",U_),r&&(r._readyState=we.CLOSING,this.destroy())}});var tb=O((mW,eb)=>{"use strict";var hW=Wc(),{Duplex:VD}=require("stream");function Q_(r){r.emit("close")}function YD(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Z_(r){this.removeListener("error",Z_),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function XD(r,e){let t=!0,n=new VD({...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(Q_,n);return}let o=!1;r.once("error",function(c){o=!0,s(c)}),r.once("close",function(){o||s(i),process.nextTick(Q_,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",YD),n.on("error",Z_),n}eb.exports=XD});var nb=O((gW,rb)=>{"use strict";var{tokenChars:JD}=ts();function QD(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&&JD[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}rb.exports={parse:QD}});var ub=O((xW,lb)=>{"use strict";var ZD=require("events"),Gc=require("http"),{Duplex:vW}=require("stream"),{createHash:e2}=require("crypto"),ib=_d(),si=xo(),t2=nb(),r2=Wc(),{GUID:n2,kWebSocket:i2}=an(),s2=/^[+/0-9A-Za-z]{22}==$/,sb=0,ob=1,cb=2,Td=class extends ZD{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:r2,...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=Gc.createServer((n,i)=>{let s=Gc.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=o2(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=sb}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===cb){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!==ob)if(this._state=ob,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",ab);let s=e.headers["sec-websocket-key"],o=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){oi(this,e,t,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){oi(this,e,t,400,"Invalid Upgrade header");return}if(s===void 0||!s2.test(s)){oi(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){oi(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"],u=new Set;if(c!==void 0)try{u=t2.parse(c)}catch{oi(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let p=e.headers["sec-websocket-extensions"],f={};if(this.options.perMessageDeflate&&p!==void 0){let m=new si(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let y=ib.parse(p);y[si.extensionName]&&(m.accept(y[si.extensionName]),f[si.extensionName]=m)}catch{oi(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let m={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(m,(y,_,S,A)=>{if(!y)return So(t,_||401,S,A);this.completeUpgrade(f,s,u,e,t,n,i)});return}if(!this.options.verifyClient(m))return So(t,401)}this.completeUpgrade(f,s,u,e,t,n,i)}completeUpgrade(e,t,n,i,s,o,a){if(!s.readable||!s.writable)return s.destroy();if(s[i2])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>sb)return So(s,503);let u=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${e2("sha1").update(t+n2).digest("base64")}`],p=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&&(u.push(`Sec-WebSocket-Protocol: ${f}`),p._protocol=f)}if(e[si.extensionName]){let f=e[si.extensionName].params,m=ib.format({[si.extensionName]:[f]});u.push(`Sec-WebSocket-Extensions: ${m}`),p._extensions=e}this.emit("headers",u,i),s.write(u.concat(`\r
|
|
24
24
|
`).join(`\r
|
|
25
|
-
`)),s.removeListener("error",
|
|
25
|
+
`)),s.removeListener("error",ab),p.setSocket(s,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(p),p.on("close",()=>{this.clients.delete(p),this._shouldEmitClose&&!this.clients.size&&process.nextTick(wo,this)})),a(p,i)}};lb.exports=Td;function o2(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 wo(r){r._state=cb,r.emit("close")}function ab(){this.destroy()}function So(r,e,t,n){t=t||Gc.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} ${Gc.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 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 bo(t,n,i,s)}});var X_=O((V6,Y_)=>{"use strict";var pn=jc();pn.createWebSocketStream=F_();pn.Server=V_();pn.Receiver=td();pn.Sender=id();pn.WebSocket=pn;pn.WebSocketServer=pn.Server;Y_.exports=pn});var hd=O(ns=>{"use strict";var fd;Object.defineProperty(ns,"__esModule",{value:!0});ns.SessionAwareAdapter=ns.Adapter=void 0;var BD=require("events"),jD=W0(),Hc=X_(),FD=typeof((fd=Hc?.Sender)===null||fd===void 0?void 0:fd.frame)=="function",$c=class extends BD.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,u=>{c++,u.acks.set(e.id,i),typeof u.notifyOutgoingListeners=="function"&&u.notifyOutgoingListeners(e),u.client.writeToEngine(a,o)}),n(c)}_encode(e,t){let n=this.encoder.encode(e);if(FD&&n.length===1&&typeof n[0]=="string"){let i=Buffer.from("4"+n[0]);t.wsPreEncodedFrame=Hc.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}};ns.Adapter=$c;var dd=class extends $c{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];HD(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,jD.yeast)();e.data.push(a),this.packets.push({id:a,opts:t,data:e.data,emittedAt:Date.now()})}super.broadcast(e,t)}};ns.SessionAwareAdapter=dd;function HD(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 J_=O(Fr=>{"use strict";var $D=Fr&&Fr.__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(Fr,"__esModule",{value:!0});Fr.ClusterAdapterWithHeartbeat=Fr.ClusterAdapter=Fr.MessageType=void 0;var qD=hd(),UD=Te(),WD=require("crypto"),be=(0,UD.debug)("socket.io-adapter"),GD="emitter",qc=5e3;function ss(){return(0,WD.randomBytes)(8).toString("hex")}var ee;(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"})(ee||(Fr.MessageType=ee={}));function ii(r){return{rooms:[...r.rooms],except:[...r.except],flags:r.flags}}function is(r){return{rooms:new Set(r.rooms),except:new Set(r.except),flags:r.flags}}var Uc=class extends qD.Adapter{constructor(e){super(e),this.requests=new Map,this.ackRequests=new Map,this.uid=ss()}onMessage(e,t){if(e.uid===this.uid)return be("[%s] ignore message from self",this.uid);if(e.nsp!==this.nsp.name)return be("[%s] ignore message from another namespace (%s)",this.uid,e.nsp);switch(be("[%s] new event of type %d from %s",this.uid,e.type,e.uid),e.type){case ee.BROADCAST:{if(e.data.requestId!==void 0)super.broadcastWithAck(e.data.packet,is(e.data.opts),i=>{be("[%s] waiting for %d client acknowledgements",this.uid,i),this.publishResponse(e.uid,{type:ee.BROADCAST_CLIENT_COUNT,data:{requestId:e.data.requestId,clientCount:i}})},i=>{be("[%s] received acknowledgement with value %j",this.uid,i),this.publishResponse(e.uid,{type:ee.BROADCAST_ACK,data:{requestId:e.data.requestId,packet:i}})});else{let i=e.data.packet,s=is(e.data.opts);this.addOffsetIfNecessary(i,s,t),super.broadcast(i,s)}break}case ee.SOCKETS_JOIN:super.addSockets(is(e.data.opts),e.data.rooms);break;case ee.SOCKETS_LEAVE:super.delSockets(is(e.data.opts),e.data.rooms);break;case ee.DISCONNECT_SOCKETS:super.disconnectSockets(is(e.data.opts),e.data.close);break;case ee.FETCH_SOCKETS:{be("[%s] calling fetchSockets with opts %j",this.uid,e.data.opts),super.fetchSockets(is(e.data.opts)).then(n=>{this.publishResponse(e.uid,{type:ee.FETCH_SOCKETS_RESPONSE,data:{requestId:e.data.requestId,sockets:n.map(i=>{let s=i.handshake,{sessionStore:o}=s,a=$D(s,["sessionStore"]);return{id:i.id,handshake:a,rooms:[...i.rooms],data:i.data}})}})});break}case ee.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,be("[%s] calling acknowledgement with %j",this.uid,a),this.publishResponse(e.uid,{type:ee.SERVER_SIDE_EMIT_RESPONSE,data:{requestId:e.data.requestId,packet:a}}))};this.nsp._onServerSideEmit([...n,o]);break}case ee.BROADCAST_CLIENT_COUNT:case ee.BROADCAST_ACK:case ee.FETCH_SOCKETS_RESPONSE:case ee.SERVER_SIDE_EMIT_RESPONSE:this.onResponse(e);break;default:be("[%s] unknown message type: %s",this.uid,e.type)}}onResponse(e){var t,n;let i=e.data.requestId;switch(be("[%s] received response %s to request %s",this.uid,e.type,i),e.type){case ee.BROADCAST_CLIENT_COUNT:{(t=this.ackRequests.get(i))===null||t===void 0||t.clientCountCallback(e.data.clientCount);break}case ee.BROADCAST_ACK:{(n=this.ackRequests.get(i))===null||n===void 0||n.ack(e.data.packet);break}case ee.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 ee.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:be("[%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:ee.BROADCAST,data:{packet:e,opts:ii(t)}});this.addOffsetIfNecessary(e,t,s)}catch(s){return be("[%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=ss();this.ackRequests.set(a,{clientCountCallback:n,ack:i}),this.publish({type:ee.BROADCAST,data:{packet:e,requestId:a,opts:ii(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:ee.SOCKETS_JOIN,data:{opts:ii(e),rooms:t}})}catch(s){be("[%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:ee.SOCKETS_LEAVE,data:{opts:ii(e),rooms:t}})}catch(s){be("[%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:ee.DISCONNECT_SOCKETS,data:{opts:ii(e),close:t}})}catch(s){be("[%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=ss();return new Promise((a,c)=>{let u=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||qc),p={type:ee.FETCH_SOCKETS,resolve:a,timeout:u,current:0,expected:s,responses:n};this.requests.set(o,p),this.publish({type:ee.FETCH_SOCKETS,data:{opts:ii(e),requestId:o}})})}async serverSideEmit(e){if(!(typeof e[e.length-1]=="function"))return this.publish({type:ee.SERVER_SIDE_EMIT,data:{packet:e}});let n=e.pop(),i=await this.serverCount()-1;if(be('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,i),i<=0)return n(null,[]);let s=ss(),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))},qc),a={type:ee.SERVER_SIDE_EMIT,resolve:n,timeout:o,current:0,expected:i,responses:[]};this.requests.set(s,a),this.publish({type:ee.SERVER_SIDE_EMIT,data:{requestId:s,packet:e}})}publish(e){be("[%s] sending message %s",this.uid,e.type),this.publishAndReturnOffset(e).catch(t=>{be("[%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,be("[%s] sending response %s to %s",this.uid,t.type,e),this.doPublishResponse(e,t).catch(n=>{be("[%s] error while publishing response: %s",this.uid,n)})}};Fr.ClusterAdapter=Uc;var md=class extends Uc{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&&(be("[%s] node %s seems down",this.uid,s),this.removeNode(s))})},1e3)}init(){this.publish({type:ee.INITIAL_HEARTBEAT})}scheduleHeartbeat(){this.heartbeatTimer?this.heartbeatTimer.refresh():this.heartbeatTimer=setTimeout(()=>{this.publish({type:ee.HEARTBEAT})},this._opts.heartbeatInterval)}close(){this.publish({type:ee.ADAPTER_CLOSE}),clearTimeout(this.heartbeatTimer),this.cleanupTimer&&clearInterval(this.cleanupTimer)}onMessage(e,t){if(e.uid===this.uid)return be("[%s] ignore message from self",this.uid);switch(e.uid&&e.uid!==GD&&this.nodesMap.set(e.uid,Date.now()),e.type){case ee.INITIAL_HEARTBEAT:this.publish({type:ee.HEARTBEAT});break;case ee.HEARTBEAT:break;case ee.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:ee.SERVER_SIDE_EMIT,data:{packet:e}});let n=e.pop(),i=this.nodesMap.size;if(be('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,i),i<=0)return n(null,[]);let s=ss(),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))},qc),a={type:ee.SERVER_SIDE_EMIT,resolve:n,timeout:o,missingUids:new Set([...this.nodesMap.keys()]),responses:[]};this.customRequests.set(s,a),this.publish({type:ee.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=ss();return new Promise((a,c)=>{let u=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||qc),p={type:ee.FETCH_SOCKETS,resolve:a,timeout:u,missingUids:new Set([...this.nodesMap.keys()]),responses:n};this.customRequests.set(o,p),this.publish({type:ee.FETCH_SOCKETS,data:{opts:ii(e),requestId:o}})})}onResponse(e){let t=e.data.requestId;switch(be("[%s] received response %s to request %s",this.uid,e.type,t),e.type){case ee.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 ee.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===ee.FETCH_SOCKETS?t.resolve(t.responses):t.type===ee.SERVER_SIDE_EMIT&&t.resolve(null,t.responses),this.customRequests.delete(n))}),this.nodesMap.delete(e)}};Fr.ClusterAdapterWithHeartbeat=md});var Wc=O(cr=>{"use strict";Object.defineProperty(cr,"__esModule",{value:!0});cr.MessageType=cr.ClusterAdapterWithHeartbeat=cr.ClusterAdapter=cr.SessionAwareAdapter=cr.Adapter=void 0;var Q_=hd();Object.defineProperty(cr,"Adapter",{enumerable:!0,get:function(){return Q_.Adapter}});Object.defineProperty(cr,"SessionAwareAdapter",{enumerable:!0,get:function(){return Q_.SessionAwareAdapter}});var gd=J_();Object.defineProperty(cr,"ClusterAdapter",{enumerable:!0,get:function(){return gd.ClusterAdapter}});Object.defineProperty(cr,"ClusterAdapterWithHeartbeat",{enumerable:!0,get:function(){return gd.ClusterAdapterWithHeartbeat}});Object.defineProperty(cr,"MessageType",{enumerable:!0,get:function(){return gd.MessageType}})});var tb=O(os=>{"use strict";var zD=os&&os.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(os,"__esModule",{value:!0});os.ParentNamespace=void 0;var Z_=Uf(),KD=Wc(),VD=zD(Te()),eb=(0,VD.default)("socket.io:parent-namespace"),Gc=class r extends Z_.Namespace{constructor(e){super(e,"/_"+r.count++),this.children=new Set}_initAdapter(){this.adapter=new vd(this)}emit(e,...t){return this.children.forEach(n=>{n.emit(e,...t)}),!0}createChild(e){eb("creating child namespace %s",e);let t=new Z_.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&&(eb("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")}};os.ParentNamespace=Gc;Gc.count=0;var vd=class extends KD.Adapter{broadcast(e,t){this.nsp.children.forEach(n=>{n.adapter.broadcast(e,t)})}}});var ab=O(oi=>{"use strict";var YD=oi&&oi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(oi,"__esModule",{value:!0});oi.patchAdapter=JD;oi.restoreAdapter=QD;oi.serveFile=e2;var si=Wc(),rb=require("fs"),XD=YD(Te()),zc=(0,XD.default)("socket.io:adapter-uws"),xd="",{addAll:ib,del:sb,broadcast:ob}=si.Adapter.prototype;function JD(r){si.Adapter.prototype.addAll=function(e,t){let n=!this.sids.has(e);ib.call(this,e,t);let i=this.nsp.sockets.get(e)||this.nsp._preConnectSockets.get(e);if(i){if(i.conn.transport.name==="websocket"){nb(this.nsp.name,i,n,t);return}n&&i.conn.on("upgrade",()=>{let s=this.sids.get(e);s&&nb(this.nsp.name,i,n,s)})}},si.Adapter.prototype.del=function(e,t){sb.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}${xd}${t}`;zc("unsubscribe connection %s from topic %s",i,o),s.unsubscribe(o)}},si.Adapter.prototype.broadcast=function(e,t){if(!(t.rooms.size<=1&&t.except.size===0)){ob.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}${xd}${t.rooms.keys().next().value}`;zc("fast publish to %s",a),o.forEach(c=>{let u=typeof c!="string";r.publish(a,u?c:"4"+c,u)}),this.apply(t,c=>{c.conn.transport.name!=="websocket"&&c.client.writeToEngine(o,s)})}}function nb(r,e,t,n){let i=e.conn.id,s=e.conn.transport.socket;t&&(zc("subscribe connection %s to topic %s",i,r),s.subscribe(r)),n.forEach(o=>{let a=`${r}${xd}${o}`;zc("subscribe connection %s to topic %s",i,a),s.subscribe(a)})}function QD(){si.Adapter.prototype.addAll=ib,si.Adapter.prototype.del=sb,si.Adapter.prototype.broadcast=ob}var ZD=r=>{let{buffer:e,byteOffset:t,byteLength:n}=r;return e.slice(t,t+n)};function e2(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=ZD(a);r.cork(()=>{let u=r.getWriteOffset(),[p,f]=r.tryEnd(c,t);!f&&!p&&(n.pause(),r.onWritable(g=>{let[y,b]=r.tryEnd(c.slice(g-u),t);return!b&&y&&n.resume(),y}))})};r.onAborted(i),n.on("data",o).on("error",s).on("end",i)}});var cb=O((eW,t2)=>{t2.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 gb=O((xt,wo)=>{"use strict";var r2=xt&&xt.__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=xt&&xt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),i2=xt&&xt.__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)&&r2(e,r,t);return n2(e,r),e},bd=xt&&xt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(xt,"__esModule",{value:!0});xt.Namespace=xt.Socket=xt.Server=void 0;var s2=bd(require("http")),o2=require("fs"),yd=require("zlib"),a2=Na(),Kc=require("stream"),lb=require("path"),ub=T0(),c2=L0(),pb=require("events"),wd=Uf();Object.defineProperty(xt,"Namespace",{enumerable:!0,get:function(){return wd.Namespace}});var l2=tb(),fb=Wc(),u2=i2(po()),p2=bd(Te()),mb=$f();Object.defineProperty(xt,"Socket",{enumerable:!0,get:function(){return mb.Socket}});var f2=wc(),_d=ab(),d2=bd(bf()),At=(0,p2.default)("socket.io:server"),db=cb().version,hb=/\.map/,as=class r extends f2.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||u2,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,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 At("dynamic namespace %s already exists",e),n(this._nsps.get(e));let u=this.parentNsps.get(o.value).createChild(e);At("dynamic namespace %s was created",e),n(u)})};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"){At("creating http server and binding to %d",e);let n=e;e=s2.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,At("creating uWebSockets.js-based engine with opts %j",t);let n=new ub.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=hb.test(o),c=a?"map":"source",u='"'+db+'"',p="W/"+u,f=s.getHeader("if-none-match");if(f&&(u===f||p===f)){At("serve client %s 304",c),i.writeStatus("304 Not Modified"),i.end();return}At("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",u);let g=lb.join(__dirname,"../client-dist/",o);(0,_d.serveFile)(i,g)}),(0,_d.patchAdapter)(e)}initEngine(e,t){At("creating engine.io instance with opts %j",t),this.eio=(0,ub.attach)(e,t),this._serveClient&&this.attachServe(e),this.httpServer=e,this.bind(this.eio)}attachServe(e){At("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=hb.test(n),s=i?"map":"source",o='"'+db+'"',a="W/"+o,c=e.headers["if-none-match"];if(c&&(o===c||a===c)){At("serve client %s 304",s),t.writeHead(304),t.end();return}At("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,o2.createReadStream)(lb.join(__dirname,"../client-dist/",e)),s=a2(t).encodings(["br","gzip","deflate"]),o=a=>{a&&n.end()};switch(s){case"br":n.writeHead(200,{"content-encoding":"br"}),(0,Kc.pipeline)(i,(0,yd.createBrotliCompress)(),n,o);break;case"gzip":n.writeHead(200,{"content-encoding":"gzip"}),(0,Kc.pipeline)(i,(0,yd.createGzip)(),n,o);break;case"deflate":n.writeHead(200,{"content-encoding":"deflate"}),(0,Kc.pipeline)(i,(0,yd.createDeflate)(),n,o);break;default:n.writeHead(200),(0,Kc.pipeline)(i,n,o)}}bind(e){return this.engine=e,this.engine.on("connection",this.onconnection.bind(this)),this}onconnection(e){At("incoming connection with id %s",e.id);let t=new c2.Client(this,e);return e.protocol===3&&t.connect("/"),this}of(e,t){if(typeof e=="function"||e instanceof RegExp){let i=new l2.ParentNamespace(this);return At("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 At("attaching namespace %s to parent namespace %s",e,i),s.createChild(e);At("initializing namespace %s",e),n=new wd.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,_d.restoreAdapter)(),this.httpServer)return new Promise(t=>{this.httpServer.close(n=>{e&&e(n),n&&At("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)}};xt.Server=as;var h2=Object.keys(pb.EventEmitter.prototype).filter(function(r){return typeof pb.EventEmitter.prototype[r]=="function"});h2.forEach(function(r){as.prototype[r]=function(){return this.sockets[r].apply(this.sockets,arguments)}});wo.exports=(r,e)=>new as(r,e);wo.exports.Server=as;wo.exports.Namespace=wd.Namespace;wo.exports.Socket=mb.Socket});var wb,Yc,Z,yt=st(()=>{wb={darwin:{capture:"robotjs",encoder:"sharp",tileSize:128,inputFormat:"bgra"},win32:{capture:"nodeScreenshots",encoder:"sharp",tileSize:256,inputFormat:"rgba"},linux:{capture:"nodeScreenshots",encoder:"sharp",tileSize:256,inputFormat:"rgba"}},Yc=wb[process.platform]||wb.linux,Z={pipeline:{captureLib:Yc.capture,encoder:Yc.encoder,inputFormat:Yc.inputFormat,tileSize:Yc.tileSize,jpegQuality:50,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},webrtc:{enableWebRTC:!0,enableTurn:!1,turnApiUrl:"https://9remote.cc/api/webrtc/turn-credentials",turnRefreshInterval:1380*60*1e3,dcMaxMessageSize:65536,dcBufferThreshold:65536,dcChunkSize:8,dcMaxTilesPerFrame:32,dcReliable:!0,dcOrdered:!1,answerTimeout:1e4},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},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 So,Eo,me,Ed=st(()=>{yt();Ri();So=()=>Z.logging,Eo=En("remote"),me={lifecycle:r=>{So().lifecycle&&Eo.info(r)},focus:r=>{So().focus&&Eo.info(r)},dpi:r=>{So().dpiDetection&&Eo.info(r)},error:(r,e)=>{So().errors&&Eo.error(`${r} ${e?.message||e||""}`)},warn:r=>{So().errors&&Eo.warn(r)}}});var kb={};Xr(kb,{ScreenHandler:()=>Td,encodeTilesBatch:()=>ls});function S2(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 ls(r,e){let t=Buffer.alloc(12);return t.writeUInt32LE(r.length,0),t.writeDoubleBE(e,4),Buffer.concat([t,...r.map(S2)])}var Td,Cd=st(()=>{Ed();Td=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()},ls),this.resourceManager.updateClientActivity(e.id)}catch(s){me.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()},ls),this.resourceManager.updateClientActivity(e.id)}catch(o){me.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),me.lifecycle("\u{1F680} Remote streaming started"),i.idleFrameCount=0,i.isStreaming=!0,i.tileManager.lastTileChecksums.clear();try{let o=await i.tileManager.getScreenDimensions();n.emit("screen-dimensions",o)}catch(o){me.error("Get dimensions error:",o)}let s=async()=>{if(!e.connected||!i.isStreaming){i.streamingTimeout=null;return}try{let o=performance.now(),a=await i.tileManager.detectChangedTilesWithHashes();a.tiles.length>0&&e.connected?(n.sendTiles({tiles:a.tiles,timestamp:Date.now(),currentHashes:a.currentHashes},ls),i.idleFrameCount=0):i.idleFrameCount++;let{activeInterval:c,idleInterval:u,idleThreshold:p}=this.resourceManager.getStreamingConfig(),f=i.idleFrameCount>=p?u:c,g=Math.max(0,f-(performance.now()-o));i.streamingTimeout=setTimeout(s,g)}catch(o){me.error("Auto streaming error:",o),i.streamingTimeout=setTimeout(s,200)}};s()})),e.on("stop-streaming",()=>{let i=this.resourceManager.getClient(e.id);i&&(i.isStreaming=!1,i.streamingTimeout&&(clearTimeout(i.streamingTimeout),i.streamingTimeout=null),me.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){me.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,u=typeof i?.dpr=="number"?i.dpr:1,p=s.tileManager.pickProfile({zoom:a,viewerWidth:c,dpr:u});if(s.tileManager.setProfile(p),s.tileManager.setFocusRect(o),o){let f=s.tileManager.activeTileSet?.size||0,g=s.tileManager.totalTiles,y=g?(f/g*100).toFixed(0):0;me.focus(`\u{1F3AF} [Focus] rect=${o.x},${o.y} ${o.w}x${o.h} | tiles ${f}/${g} (${y}%)`)}else me.focus("\u{1F3AF} [Focus] cleared \u2192 full screen")}))}}});async function Yb(){if(Ao)return Ao;let r=await import("node-screenshots");if(Ao=(r.Monitor||r.default?.Monitor).all()[0],!Ao)throw new Error("No monitor found via node-screenshots");return Ao}async function Xb(r){Id=r,Z.pipeline.captureLib==="nodeScreenshots"&&await Yb()}async function Jb(){let{captureLib:r,inputFormat:e}=Z.pipeline;if(r==="robotjs"){let{width:s,height:o}=Id.getScreenSize(),a=Id.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 Yb()).captureImageSync();return{buffer:n.toRawSync?n.toRawSync():n.rawSync(),width:n.width,height:n.height,channels:4,format:e}}var Id,Ao,Qb=st(()=>{yt();Id=null,Ao=null});function L2(r){return r==="bgra"?Ld.FORMAT_BGRA:Ld.FORMAT_RGBA}function Dd(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 Bd(r,e,t,n=4,i,s){let{encoder:o,inputFormat:a,jpegQuality:c}=Z.pipeline,u=i??c,p=s??a;if(o==="jpegTurbo")return Ld.compressSync(r,{width:e,height:t,format:L2(p),quality:u});let f=r;return p==="bgra"&&(f=Buffer.from(r),Dd(f)),(0,Zb.default)(f,{raw:{width:e,height:t,channels:n}}).jpeg({quality:u}).toBuffer()}var Zb,Nd,Ld,ew=st(()=>{Zb=X(require("sharp"),1),Nd=X(require("@julusian/jpeg-turbo"),1);yt();Ld=Nd.default.default||Nd.default});function ko(){for(let r of[oe.ROOT,oe.STATE])$r.default.existsSync(r)||$r.default.mkdirSync(r,{recursive:!0})}function Hd(){try{return ko(),$r.default.existsSync(Fd)?JSON.parse($r.default.readFileSync(Fd,"utf8"))||{}:{}}catch{return{}}}function tw(r){try{ko();let e={...Hd(),...r};return $r.default.writeFileSync(Fd,JSON.stringify(e,null,2),{mode:384}),e}catch(e){return console.error("Error saving settings:",e),null}}function rw(){try{return ko(),$r.default.existsSync(jd)?JSON.parse($r.default.readFileSync(jd,"utf8")):{machineId:null,key:null,name:"Default",createdAt:null}}catch{return{machineId:null,key:null,name:"Default",createdAt:null}}}function il(r){try{ko(),$r.default.writeFileSync(D2,JSON.stringify({cmd:r,ts:Date.now()}))}catch{}}function nw(r,e,t="Default"){try{ko();let n={machineId:r,key:e,name:t,createdAt:new Date().toISOString()};return $r.default.writeFileSync(jd,JSON.stringify(n,null,2),{mode:384}),n}catch(n){return console.error("Error saving key:",n),null}}var $r,Ro,BW,jW,jd,D2,Fd,Oo=st(()=>{$r=X(require("fs"),1),Ro=X(require("path"),1);gt();BW=oe.STATE,jW=Ro.default.join(oe.STATE,"state.json"),jd=Ro.default.join(oe.ROOT,"keys.json"),D2=Ro.default.join(oe.STATE,"cmd.json"),Fd=Ro.default.join(oe.STATE,"settings.json")});function iw(){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,Po.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,Po.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 sw(r){let e=B2[r];e&&process.platform==="darwin"&&(0,Po.exec)(`open "${e}"`,()=>{})}var Po,B2,ow=st(()=>{Po=require("child_process"),B2={screenRecording:"x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture",accessibility:"x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility"}});function j2(){return!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY}function ll(){for(let r=aw,e=null;r!==e;e=r,r=qr.default.dirname(r)){let t=qr.default.join(r,"package.json");if((0,we.existsSync)(t)){try{let n=JSON.parse((0,we.readFileSync)(t,"utf8"));if(n.name!=="9remote")continue;let i=typeof n.bin=="string"?n.bin:n.bin?.["9remote"];if(i){let s=qr.default.resolve(r,i);if((0,we.existsSync)(s))return s}}catch{}break}}return qr.default.resolve(aw,"..","index.js")}function No(){return process.execPath}function uw(){let r=qr.default.dirname(No()),e=["/usr/local/bin","/usr/bin","/bin","/usr/sbin","/sbin","/opt/homebrew/bin"];return e.includes(r)||e.unshift(r),e.join(":")}function $d(r){return String(r).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function F2(r,e){let t=[r,e,...cl].map(n=>` <string>${$d(n)}</string>`).join(`
|
|
29
|
+
`+t)}function oi(r,e,t,n,i,s){if(r.listenerCount("wsClientError")){let o=new Error(i);Error.captureStackTrace(o,oi),r.emit("wsClientError",o,t,e)}else So(t,n,i,s)}});var fb=O((yW,pb)=>{"use strict";var pn=Wc();pn.createWebSocketStream=tb();pn.Server=ub();pn.Receiver=md();pn.Sender=xd();pn.WebSocket=pn;pn.WebSocketServer=pn.Server;pb.exports=pn});var Rd=O(os=>{"use strict";var Cd;Object.defineProperty(os,"__esModule",{value:!0});os.SessionAwareAdapter=os.Adapter=void 0;var a2=require("events"),c2=o_(),zc=fb(),l2=typeof((Cd=zc?.Sender)===null||Cd===void 0?void 0:Cd.frame)=="function",Kc=class extends a2.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,u=>{c++,u.acks.set(e.id,i),typeof u.notifyOutgoingListeners=="function"&&u.notifyOutgoingListeners(e),u.client.writeToEngine(a,o)}),n(c)}_encode(e,t){let n=this.encoder.encode(e);if(l2&&n.length===1&&typeof n[0]=="string"){let i=Buffer.from("4"+n[0]);t.wsPreEncodedFrame=zc.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}};os.Adapter=Kc;var Ad=class extends Kc{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];u2(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,c2.yeast)();e.data.push(a),this.packets.push({id:a,opts:t,data:e.data,emittedAt:Date.now()})}super.broadcast(e,t)}};os.SessionAwareAdapter=Ad;function u2(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 db=O(jr=>{"use strict";var p2=jr&&jr.__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(jr,"__esModule",{value:!0});jr.ClusterAdapterWithHeartbeat=jr.ClusterAdapter=jr.MessageType=void 0;var f2=Rd(),d2=Ce(),h2=require("crypto"),Se=(0,d2.debug)("socket.io-adapter"),m2="emitter",Vc=5e3;function cs(){return(0,h2.randomBytes)(8).toString("hex")}var te;(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"})(te||(jr.MessageType=te={}));function ai(r){return{rooms:[...r.rooms],except:[...r.except],flags:r.flags}}function as(r){return{rooms:new Set(r.rooms),except:new Set(r.except),flags:r.flags}}var Yc=class extends f2.Adapter{constructor(e){super(e),this.requests=new Map,this.ackRequests=new Map,this.uid=cs()}onMessage(e,t){if(e.uid===this.uid)return Se("[%s] ignore message from self",this.uid);if(e.nsp!==this.nsp.name)return Se("[%s] ignore message from another namespace (%s)",this.uid,e.nsp);switch(Se("[%s] new event of type %d from %s",this.uid,e.type,e.uid),e.type){case te.BROADCAST:{if(e.data.requestId!==void 0)super.broadcastWithAck(e.data.packet,as(e.data.opts),i=>{Se("[%s] waiting for %d client acknowledgements",this.uid,i),this.publishResponse(e.uid,{type:te.BROADCAST_CLIENT_COUNT,data:{requestId:e.data.requestId,clientCount:i}})},i=>{Se("[%s] received acknowledgement with value %j",this.uid,i),this.publishResponse(e.uid,{type:te.BROADCAST_ACK,data:{requestId:e.data.requestId,packet:i}})});else{let i=e.data.packet,s=as(e.data.opts);this.addOffsetIfNecessary(i,s,t),super.broadcast(i,s)}break}case te.SOCKETS_JOIN:super.addSockets(as(e.data.opts),e.data.rooms);break;case te.SOCKETS_LEAVE:super.delSockets(as(e.data.opts),e.data.rooms);break;case te.DISCONNECT_SOCKETS:super.disconnectSockets(as(e.data.opts),e.data.close);break;case te.FETCH_SOCKETS:{Se("[%s] calling fetchSockets with opts %j",this.uid,e.data.opts),super.fetchSockets(as(e.data.opts)).then(n=>{this.publishResponse(e.uid,{type:te.FETCH_SOCKETS_RESPONSE,data:{requestId:e.data.requestId,sockets:n.map(i=>{let s=i.handshake,{sessionStore:o}=s,a=p2(s,["sessionStore"]);return{id:i.id,handshake:a,rooms:[...i.rooms],data:i.data}})}})});break}case te.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,Se("[%s] calling acknowledgement with %j",this.uid,a),this.publishResponse(e.uid,{type:te.SERVER_SIDE_EMIT_RESPONSE,data:{requestId:e.data.requestId,packet:a}}))};this.nsp._onServerSideEmit([...n,o]);break}case te.BROADCAST_CLIENT_COUNT:case te.BROADCAST_ACK:case te.FETCH_SOCKETS_RESPONSE:case te.SERVER_SIDE_EMIT_RESPONSE:this.onResponse(e);break;default:Se("[%s] unknown message type: %s",this.uid,e.type)}}onResponse(e){var t,n;let i=e.data.requestId;switch(Se("[%s] received response %s to request %s",this.uid,e.type,i),e.type){case te.BROADCAST_CLIENT_COUNT:{(t=this.ackRequests.get(i))===null||t===void 0||t.clientCountCallback(e.data.clientCount);break}case te.BROADCAST_ACK:{(n=this.ackRequests.get(i))===null||n===void 0||n.ack(e.data.packet);break}case te.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 te.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:Se("[%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:te.BROADCAST,data:{packet:e,opts:ai(t)}});this.addOffsetIfNecessary(e,t,s)}catch(s){return Se("[%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=cs();this.ackRequests.set(a,{clientCountCallback:n,ack:i}),this.publish({type:te.BROADCAST,data:{packet:e,requestId:a,opts:ai(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:te.SOCKETS_JOIN,data:{opts:ai(e),rooms:t}})}catch(s){Se("[%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:te.SOCKETS_LEAVE,data:{opts:ai(e),rooms:t}})}catch(s){Se("[%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:te.DISCONNECT_SOCKETS,data:{opts:ai(e),close:t}})}catch(s){Se("[%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=cs();return new Promise((a,c)=>{let u=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||Vc),p={type:te.FETCH_SOCKETS,resolve:a,timeout:u,current:0,expected:s,responses:n};this.requests.set(o,p),this.publish({type:te.FETCH_SOCKETS,data:{opts:ai(e),requestId:o}})})}async serverSideEmit(e){if(!(typeof e[e.length-1]=="function"))return this.publish({type:te.SERVER_SIDE_EMIT,data:{packet:e}});let n=e.pop(),i=await this.serverCount()-1;if(Se('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,i),i<=0)return n(null,[]);let s=cs(),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))},Vc),a={type:te.SERVER_SIDE_EMIT,resolve:n,timeout:o,current:0,expected:i,responses:[]};this.requests.set(s,a),this.publish({type:te.SERVER_SIDE_EMIT,data:{requestId:s,packet:e}})}publish(e){Se("[%s] sending message %s",this.uid,e.type),this.publishAndReturnOffset(e).catch(t=>{Se("[%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,Se("[%s] sending response %s to %s",this.uid,t.type,e),this.doPublishResponse(e,t).catch(n=>{Se("[%s] error while publishing response: %s",this.uid,n)})}};jr.ClusterAdapter=Yc;var kd=class extends Yc{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&&(Se("[%s] node %s seems down",this.uid,s),this.removeNode(s))})},1e3)}init(){this.publish({type:te.INITIAL_HEARTBEAT})}scheduleHeartbeat(){this.heartbeatTimer?this.heartbeatTimer.refresh():this.heartbeatTimer=setTimeout(()=>{this.publish({type:te.HEARTBEAT})},this._opts.heartbeatInterval)}close(){this.publish({type:te.ADAPTER_CLOSE}),clearTimeout(this.heartbeatTimer),this.cleanupTimer&&clearInterval(this.cleanupTimer)}onMessage(e,t){if(e.uid===this.uid)return Se("[%s] ignore message from self",this.uid);switch(e.uid&&e.uid!==m2&&this.nodesMap.set(e.uid,Date.now()),e.type){case te.INITIAL_HEARTBEAT:this.publish({type:te.HEARTBEAT});break;case te.HEARTBEAT:break;case te.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:te.SERVER_SIDE_EMIT,data:{packet:e}});let n=e.pop(),i=this.nodesMap.size;if(Se('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,i),i<=0)return n(null,[]);let s=cs(),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))},Vc),a={type:te.SERVER_SIDE_EMIT,resolve:n,timeout:o,missingUids:new Set([...this.nodesMap.keys()]),responses:[]};this.customRequests.set(s,a),this.publish({type:te.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=cs();return new Promise((a,c)=>{let u=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||Vc),p={type:te.FETCH_SOCKETS,resolve:a,timeout:u,missingUids:new Set([...this.nodesMap.keys()]),responses:n};this.customRequests.set(o,p),this.publish({type:te.FETCH_SOCKETS,data:{opts:ai(e),requestId:o}})})}onResponse(e){let t=e.data.requestId;switch(Se("[%s] received response %s to request %s",this.uid,e.type,t),e.type){case te.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 te.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===te.FETCH_SOCKETS?t.resolve(t.responses):t.type===te.SERVER_SIDE_EMIT&&t.resolve(null,t.responses),this.customRequests.delete(n))}),this.nodesMap.delete(e)}};jr.ClusterAdapterWithHeartbeat=kd});var Xc=O(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.MessageType=ur.ClusterAdapterWithHeartbeat=ur.ClusterAdapter=ur.SessionAwareAdapter=ur.Adapter=void 0;var hb=Rd();Object.defineProperty(ur,"Adapter",{enumerable:!0,get:function(){return hb.Adapter}});Object.defineProperty(ur,"SessionAwareAdapter",{enumerable:!0,get:function(){return hb.SessionAwareAdapter}});var Od=db();Object.defineProperty(ur,"ClusterAdapter",{enumerable:!0,get:function(){return Od.ClusterAdapter}});Object.defineProperty(ur,"ClusterAdapterWithHeartbeat",{enumerable:!0,get:function(){return Od.ClusterAdapterWithHeartbeat}});Object.defineProperty(ur,"MessageType",{enumerable:!0,get:function(){return Od.MessageType}})});var vb=O(ls=>{"use strict";var g2=ls&&ls.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ls,"__esModule",{value:!0});ls.ParentNamespace=void 0;var mb=nd(),v2=Xc(),x2=g2(Ce()),gb=(0,x2.default)("socket.io:parent-namespace"),Jc=class r extends mb.Namespace{constructor(e){super(e,"/_"+r.count++),this.children=new Set}_initAdapter(){this.adapter=new Pd(this)}emit(e,...t){return this.children.forEach(n=>{n.emit(e,...t)}),!0}createChild(e){gb("creating child namespace %s",e);let t=new mb.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&&(gb("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")}};ls.ParentNamespace=Jc;Jc.count=0;var Pd=class extends v2.Adapter{broadcast(e,t){this.nsp.children.forEach(n=>{n.adapter.broadcast(e,t)})}}});var Sb=O(li=>{"use strict";var y2=li&&li.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(li,"__esModule",{value:!0});li.patchAdapter=b2;li.restoreAdapter=w2;li.serveFile=E2;var ci=Xc(),xb=require("fs"),_2=y2(Ce()),Qc=(0,_2.default)("socket.io:adapter-uws"),Md="",{addAll:_b,del:bb,broadcast:wb}=ci.Adapter.prototype;function b2(r){ci.Adapter.prototype.addAll=function(e,t){let n=!this.sids.has(e);_b.call(this,e,t);let i=this.nsp.sockets.get(e)||this.nsp._preConnectSockets.get(e);if(i){if(i.conn.transport.name==="websocket"){yb(this.nsp.name,i,n,t);return}n&&i.conn.on("upgrade",()=>{let s=this.sids.get(e);s&&yb(this.nsp.name,i,n,s)})}},ci.Adapter.prototype.del=function(e,t){bb.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}${Md}${t}`;Qc("unsubscribe connection %s from topic %s",i,o),s.unsubscribe(o)}},ci.Adapter.prototype.broadcast=function(e,t){if(!(t.rooms.size<=1&&t.except.size===0)){wb.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}${Md}${t.rooms.keys().next().value}`;Qc("fast publish to %s",a),o.forEach(c=>{let u=typeof c!="string";r.publish(a,u?c:"4"+c,u)}),this.apply(t,c=>{c.conn.transport.name!=="websocket"&&c.client.writeToEngine(o,s)})}}function yb(r,e,t,n){let i=e.conn.id,s=e.conn.transport.socket;t&&(Qc("subscribe connection %s to topic %s",i,r),s.subscribe(r)),n.forEach(o=>{let a=`${r}${Md}${o}`;Qc("subscribe connection %s to topic %s",i,a),s.subscribe(a)})}function w2(){ci.Adapter.prototype.addAll=_b,ci.Adapter.prototype.del=bb,ci.Adapter.prototype.broadcast=wb}var S2=r=>{let{buffer:e,byteOffset:t,byteLength:n}=r;return e.slice(t,t+n)};function E2(r,e){let{size:t}=(0,xb.statSync)(e),n=(0,xb.createReadStream)(e),i=()=>!n.destroyed&&n.destroy(),s=a=>{throw i(),a},o=a=>{let c=S2(a);r.cork(()=>{let u=r.getWriteOffset(),[p,f]=r.tryEnd(c,t);!f&&!p&&(n.pause(),r.onWritable(m=>{let[y,_]=r.tryEnd(c.slice(m-u),t);return!_&&y&&n.resume(),y}))})};r.onAborted(i),n.on("data",o).on("error",s).on("end",i)}});var Eb=O((TW,T2)=>{T2.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 Mb=O((_t,Eo)=>{"use strict";var C2=_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]})),A2=_t&&_t.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),R2=_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)&&C2(e,r,t);return A2(e,r),e},Ld=_t&&_t.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(_t,"__esModule",{value:!0});_t.Namespace=_t.Socket=_t.Server=void 0;var k2=Ld(require("http")),O2=require("fs"),Id=require("zlib"),P2=Ha(),Zc=require("stream"),Tb=require("path"),Cb=$0(),M2=J0(),Ab=require("events"),Dd=nd();Object.defineProperty(_t,"Namespace",{enumerable:!0,get:function(){return Dd.Namespace}});var I2=vb(),Rb=Xc(),N2=R2(ho()),L2=Ld(Ce()),Pb=td();Object.defineProperty(_t,"Socket",{enumerable:!0,get:function(){return Pb.Socket}});var D2=Rc(),Nd=Sb(),B2=Ld(Lf()),Rt=(0,L2.default)("socket.io:server"),kb=Eb().version,Ob=/\.map/,us=class r extends D2.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||N2,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||Rb.SessionAwareAdapter)):this.adapter(t.adapter||Rb.Adapter),t.cleanupEmptyChildNamespaces=!!t.cleanupEmptyChildNamespaces,this.sockets=this.of("/"),(e||typeof e=="number")&&this.attach(e),this.opts.cors&&(this._corsMiddleware=(0,B2.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 u=this.parentNsps.get(o.value).createChild(e);Rt("dynamic namespace %s was created",e),n(u)})};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 Cb.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=Ob.test(o),c=a?"map":"source",u='"'+kb+'"',p="W/"+u,f=s.getHeader("if-none-match");if(f&&(u===f||p===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",u);let m=Tb.join(__dirname,"../client-dist/",o);(0,Nd.serveFile)(i,m)}),(0,Nd.patchAdapter)(e)}initEngine(e,t){Rt("creating engine.io instance with opts %j",t),this.eio=(0,Cb.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=Ob.test(n),s=i?"map":"source",o='"'+kb+'"',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,O2.createReadStream)(Tb.join(__dirname,"../client-dist/",e)),s=P2(t).encodings(["br","gzip","deflate"]),o=a=>{a&&n.end()};switch(s){case"br":n.writeHead(200,{"content-encoding":"br"}),(0,Zc.pipeline)(i,(0,Id.createBrotliCompress)(),n,o);break;case"gzip":n.writeHead(200,{"content-encoding":"gzip"}),(0,Zc.pipeline)(i,(0,Id.createGzip)(),n,o);break;case"deflate":n.writeHead(200,{"content-encoding":"deflate"}),(0,Zc.pipeline)(i,(0,Id.createDeflate)(),n,o);break;default:n.writeHead(200),(0,Zc.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 M2.Client(this,e);return e.protocol===3&&t.connect("/"),this}of(e,t){if(typeof e=="function"||e instanceof RegExp){let i=new I2.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 Dd.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,Nd.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)}};_t.Server=us;var j2=Object.keys(Ab.EventEmitter.prototype).filter(function(r){return typeof Ab.EventEmitter.prototype[r]=="function"});j2.forEach(function(r){us.prototype[r]=function(){return this.sockets[r].apply(this.sockets,arguments)}});Eo.exports=(r,e)=>new us(r,e);Eo.exports.Server=us;Eo.exports.Namespace=Dd.Namespace;Eo.exports.Socket=Pb.Socket});function Bd(){return To=(0,Lb.randomBytes)(32).toString("hex"),To}function Db(){return To||Bd(),To}function Bb(r){return!!r&&typeof r=="string"&&r===To}var Lb,To,el=Te(()=>{Lb=require("crypto"),To=null});var $b,rl,Z,bt=Te(()=>{$b={darwin:{capture:"robotjs",encoder:"sharp",tileSize:128,inputFormat:"bgra"},win32:{capture:"nodeScreenshots",encoder:"sharp",tileSize:256,inputFormat:"rgba"},linux:{capture:"nodeScreenshots",encoder:"sharp",tileSize:256,inputFormat:"rgba"}},rl=$b[process.platform]||$b.linux,Z={pipeline:{captureLib:rl.capture,encoder:rl.encoder,inputFormat:rl.inputFormat,tileSize:rl.tileSize,jpegQuality:50,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},webrtc:{enableWebRTC:!0,enableTurn:!1,turnApiUrl:"https://9remote.cc/api/webrtc/turn-credentials",turnRefreshInterval:1380*60*1e3,dcMaxMessageSize:65536,dcBufferThreshold:65536,dcChunkSize:8,dcMaxTilesPerFrame:32,dcReliable:!0,dcOrdered:!1,answerTimeout:1e4},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},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 Co,Ao,ve,Fd=Te(()=>{bt();Pi();Co=()=>Z.logging,Ao=An("remote"),ve={lifecycle:r=>{Co().lifecycle&&Ao.info(r)},focus:r=>{Co().focus&&Ao.info(r)},dpi:r=>{Co().dpiDetection&&Ao.info(r)},error:(r,e)=>{Co().errors&&Ao.error(`${r} ${e?.message||e||""}`)},warn:r=>{Co().errors&&Ao.warn(r)}}});var Vb={};Xr(Vb,{ScreenHandler:()=>Hd,encodeTilesBatch:()=>fs});function K2(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 fs(r,e){let t=Buffer.alloc(12);return t.writeUInt32LE(r.length,0),t.writeDoubleBE(e,4),Buffer.concat([t,...r.map(K2)])}var Hd,$d=Te(()=>{Fd();Hd=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()},fs),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()},fs),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"),i.idleFrameCount=0,i.isStreaming=!0,i.streamGen=(i.streamGen||0)+1;let s=i.streamGen;i.tileManager.lastTileChecksums.clear();try{let a=await i.tileManager.getScreenDimensions();n.emit("screen-dimensions",a)}catch(a){ve.error("Get dimensions error:",a)}let o=async()=>{if(!e.connected||!i.isStreaming||i.streamGen!==s){i.streamingTimeout=null;return}try{let a=performance.now(),c=await i.tileManager.detectChangedTilesWithHashes();c.tiles.length>0&&e.connected?(n.sendTiles({tiles:c.tiles,timestamp:Date.now(),currentHashes:c.currentHashes},fs),i.idleFrameCount=0):i.idleFrameCount++;let{activeInterval:u,idleInterval:p,idleThreshold:f}=this.resourceManager.getStreamingConfig(),m=i.idleFrameCount>=f?p:u,y=Math.max(0,m-(performance.now()-a));i.streamingTimeout=setTimeout(o,y)}catch(a){ve.error("Auto streaming error:",a),i.streamingTimeout=setTimeout(o,200)}};o()})),e.on("stop-streaming",()=>{let i=this.resourceManager.getClient(e.id);i&&(i.isStreaming=!1,i.streamingTimeout&&(clearTimeout(i.streamingTimeout),i.streamingTimeout=null),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,u=typeof i?.dpr=="number"?i.dpr:1,p=s.tileManager.pickProfile({zoom:a,viewerWidth:c,dpr:u});if(s.tileManager.setProfile(p),s.tileManager.setFocusRect(o),o){let f=s.tileManager.activeTileSet?.size||0,m=s.tileManager.totalTiles,y=m?(f/m*100).toFixed(0):0;ve.focus(`\u{1F3AF} [Focus] rect=${o.x},${o.y} ${o.w}x${o.h} | tiles ${f}/${m} (${y}%)`)}else ve.focus("\u{1F3AF} [Focus] cleared \u2192 full screen")}))}}});async function pw(){if(ko)return ko;let r=await import("node-screenshots");if(ko=(r.Monitor||r.default?.Monitor).all()[0],!ko)throw new Error("No monitor found via node-screenshots");return ko}async function fw(r){Yd=r,Z.pipeline.captureLib==="nodeScreenshots"&&await pw()}async function dw(){let{captureLib:r,inputFormat:e}=Z.pipeline;if(r==="robotjs"){let{width:s,height:o}=Yd.getScreenSize(),a=Yd.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 pw()).captureImageSync();return{buffer:n.toRawSync?n.toRawSync():n.rawSync(),width:n.width,height:n.height,channels:4,format:e}}var Yd,ko,hw=Te(()=>{bt();Yd=null,ko=null});function aB(r){return r==="bgra"?Jd.FORMAT_BGRA:Jd.FORMAT_RGBA}function Qd(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 Zd(r,e,t,n=4,i,s){let{encoder:o,inputFormat:a,jpegQuality:c}=Z.pipeline,u=i??c,p=s??a;if(o==="jpegTurbo")return Jd.compressSync(r,{width:e,height:t,format:aB(p),quality:u});let f=r;return p==="bgra"&&(f=Buffer.from(r),Qd(f)),(0,mw.default)(f,{raw:{width:e,height:t,channels:n}}).jpeg({quality:u}).toBuffer()}var mw,Xd,Jd,gw=Te(()=>{mw=X(require("sharp"),1),Xd=X(require("@julusian/jpeg-turbo"),1);bt();Jd=Xd.default.default||Xd.default});function Po(){for(let r of[oe.ROOT,oe.STATE])Hr.default.existsSync(r)||Hr.default.mkdirSync(r,{recursive:!0})}function rh(){try{return Po(),Hr.default.existsSync(th)?JSON.parse(Hr.default.readFileSync(th,"utf8"))||{}:{}}catch{return{}}}function vw(r){try{Po();let e={...rh(),...r};return Hr.default.writeFileSync(th,JSON.stringify(e,null,2),{mode:384}),e}catch(e){return console.error("Error saving settings:",e),null}}function xw(){try{return Po(),Hr.default.existsSync(eh)?JSON.parse(Hr.default.readFileSync(eh,"utf8")):{machineId:null,key:null,name:"Default",createdAt:null}}catch{return{machineId:null,key:null,name:"Default",createdAt:null}}}function gl(r){try{Po(),Hr.default.writeFileSync(cB,JSON.stringify({cmd:r,ts:Date.now()}))}catch{}}function yw(r,e,t="Default"){try{Po();let n={machineId:r,key:e,name:t,createdAt:new Date().toISOString()};return Hr.default.writeFileSync(eh,JSON.stringify(n,null,2),{mode:384}),n}catch(n){return console.error("Error saving key:",n),null}}var Hr,Oo,p8,f8,eh,cB,th,Mo=Te(()=>{Hr=X(require("fs"),1),Oo=X(require("path"),1);gt();p8=oe.STATE,f8=Oo.default.join(oe.STATE,"state.json"),eh=Oo.default.join(oe.ROOT,"keys.json"),cB=Oo.default.join(oe.STATE,"cmd.json"),th=Oo.default.join(oe.STATE,"settings.json")});function _w(){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,Io.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,Io.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 bw(r){let e=lB[r];e&&process.platform==="darwin"&&(0,Io.exec)(`open "${e}"`,()=>{})}var Io,lB,ww=Te(()=>{Io=require("child_process"),lB={screenRecording:"x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture",accessibility:"x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility"}});function uB(){return!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY}function bl(){for(let r=Sw,e=null;r!==e;e=r,r=$r.default.dirname(r)){let t=$r.default.join(r,"package.json");if((0,Ee.existsSync)(t)){try{let n=JSON.parse((0,Ee.readFileSync)(t,"utf8"));if(n.name!=="9remote")continue;let i=typeof n.bin=="string"?n.bin:n.bin?.["9remote"];if(i){let s=$r.default.resolve(r,i);if((0,Ee.existsSync)(s))return s}}catch{}break}}return $r.default.resolve(Sw,"..","index.js")}function Do(){return process.execPath}function Cw(){let r=$r.default.dirname(Do()),e=["/usr/local/bin","/usr/bin","/bin","/usr/sbin","/sbin","/opt/homebrew/bin"];return e.includes(r)||e.unshift(r),e.join(":")}function nh(r){return String(r).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function pB(r,e){let t=[r,e,..._l].map(n=>` <string>${nh(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>${ms}</string>
|
|
36
36
|
<key>ProgramArguments</key>
|
|
37
37
|
<array>
|
|
38
38
|
${t}
|
|
@@ -44,108 +44,113 @@ ${t}
|
|
|
44
44
|
<key>EnvironmentVariables</key>
|
|
45
45
|
<dict>
|
|
46
46
|
<key>PATH</key>
|
|
47
|
-
<string>${
|
|
47
|
+
<string>${nh(Cw())}</string>
|
|
48
48
|
<key>HOME</key>
|
|
49
|
-
<string>${
|
|
49
|
+
<string>${nh(Lo)}</string>
|
|
50
50
|
</dict>
|
|
51
51
|
<key>StandardOutPath</key>
|
|
52
|
-
<string>${
|
|
52
|
+
<string>${vl}</string>
|
|
53
53
|
<key>StandardErrorPath</key>
|
|
54
|
-
<string>${
|
|
54
|
+
<string>${vl}</string>
|
|
55
55
|
</dict>
|
|
56
56
|
</plist>
|
|
57
|
-
`}function
|
|
57
|
+
`}function fB(){return(0,Ee.mkdirSync)($r.default.dirname(kt.darwin),{recursive:!0}),(0,Ee.writeFileSync)(kt.darwin,pB(Do(),bl())),!0}function dB(){if((0,Ee.existsSync)(kt.darwin))try{(0,Ee.unlinkSync)(kt.darwin)}catch{}return!0}function hB(){return(0,Ee.existsSync)(kt.darwin)}function mB(){return`"${Do()}" "${bl()}" ${_l.join(" ")}`}function ih(r){return new Promise(e=>{(0,yl.execFile)("reg",r,{windowsHide:!0},(t,n)=>{e({ok:!t,stdout:n||""})})})}async function gB(){let r=mB(),{ok:e}=await ih(["ADD","HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run","/V",gs,"/t","REG_SZ","/D",r,"/F"]);return e}async function vB(){return await ih(["DELETE","HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run","/V",gs,"/F"]),!0}async function xB(){let{ok:r,stdout:e}=await ih(["QUERY","HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run","/V",gs]);return r&&e.includes(gs)}function yB(){let r=`${Do()} ${bl()} ${_l.join(" ")}`;return`[Desktop Entry]
|
|
58
58
|
Type=Application
|
|
59
|
-
Name=${
|
|
59
|
+
Name=${gs}
|
|
60
60
|
Exec=${r}
|
|
61
61
|
X-GNOME-Autostart-enabled=true
|
|
62
62
|
NoDisplay=false
|
|
63
63
|
Terminal=false
|
|
64
|
-
`}function
|
|
65
|
-
Description=${
|
|
64
|
+
`}function _B(){let r=_l.map(e=>`'${e}'`).join(" ");return`[Unit]
|
|
65
|
+
Description=${gs} Agent
|
|
66
66
|
After=network-online.target
|
|
67
67
|
Wants=network-online.target
|
|
68
68
|
|
|
69
69
|
[Service]
|
|
70
70
|
Type=simple
|
|
71
|
-
ExecStart=${
|
|
71
|
+
ExecStart=${Do()} ${bl()} ${r}
|
|
72
72
|
Restart=always
|
|
73
73
|
RestartSec=10
|
|
74
|
-
Environment=PATH=${
|
|
75
|
-
Environment=HOME=${
|
|
76
|
-
StandardOutput=append:${
|
|
77
|
-
StandardError=append:${
|
|
74
|
+
Environment=PATH=${Cw()}
|
|
75
|
+
Environment=HOME=${Lo}
|
|
76
|
+
StandardOutput=append:${vl}
|
|
77
|
+
StandardError=append:${vl}
|
|
78
78
|
|
|
79
79
|
[Install]
|
|
80
80
|
WantedBy=default.target
|
|
81
|
-
`}function
|
|
81
|
+
`}function xl(r){try{return(0,yl.execFileSync)("systemctl",["--user",...r],{stdio:"ignore"}),!0}catch{return!1}}function bB(){return uB()?((0,Ee.mkdirSync)($r.default.dirname(kt.linuxSystemd),{recursive:!0}),(0,Ee.writeFileSync)(kt.linuxSystemd,_B()),xl(["daemon-reload"]),xl(["enable",`${ms}.service`]),!0):((0,Ee.mkdirSync)($r.default.dirname(kt.linux),{recursive:!0}),(0,Ee.writeFileSync)(kt.linux,yB()),!0)}function wB(){if((0,Ee.existsSync)(kt.linuxSystemd)){xl(["disable",`${ms}.service`]);try{(0,Ee.unlinkSync)(kt.linuxSystemd)}catch{}xl(["daemon-reload"])}if((0,Ee.existsSync)(kt.linux))try{(0,Ee.unlinkSync)(kt.linux)}catch{}return!0}function SB(){return(0,Ee.existsSync)(kt.linux)||(0,Ee.existsSync)(kt.linuxSystemd)}async function sh(){try{if(process.platform==="darwin")return hB();if(process.platform==="win32")return await xB();if(process.platform==="linux")return SB()}catch{}return!1}async function Aw(r){try{if(process.platform==="darwin")return r?fB():dB();if(process.platform==="win32")return r?await gB():await vB();if(process.platform==="linux")return r?bB():wB()}catch{}return!1}var yl,Ee,No,Ew,$r,Tw,vl,ms,gs,_l,Lo,Sw,kt,Rw=Te(()=>{yl=require("child_process"),Ee=require("fs"),No=require("path"),Ew=X(require("os"),1),$r=X(require("path"),1),Tw=require("url");gt();vl=(0,No.join)(oe.LOGS,"autostart.log"),ms="cc.9remote.agent",gs="9Remote",_l=["--tray","--skip-update","--start"],Lo=Ew.default.homedir(),Sw=$r.default.dirname((0,Tw.fileURLToPath)(__importMetaUrl)),kt={darwin:(0,No.join)(Lo,"Library","LaunchAgents",`${ms}.plist`),linux:(0,No.join)(Lo,".config","autostart",`${ms}.desktop`),linuxSystemd:(0,No.join)(Lo,".config","systemd","user",`${ms}.service`)}});function EB(){Bo.default.existsSync(oe.CONFIG)||Bo.default.mkdirSync(oe.CONFIG,{recursive:!0})}function jo(){try{return JSON.parse(Bo.default.readFileSync(Ow,"utf8"))||{}}catch{return{}}}function wl(r){try{EB();let e={...jo(),...r};return Bo.default.writeFileSync(Ow,JSON.stringify(e,null,2)),e}catch{return null}}var Bo,kw,Ow,oh=Te(()=>{Bo=X(require("fs"),1),kw=X(require("path"),1);gt();Ow=kw.default.join(oe.CONFIG,"settings.json")});var Tl={};Xr(Tl,{getMode:()=>ph,isActive:()=>uh,onConnectionChange:()=>OB,setMode:()=>Ho,start:()=>kB,stop:()=>lh});function CB(){Pw||(Pw=!0,process.on("exit",()=>{if(Bt){try{Bt.kill()}catch{}Bt=null}}))}function Sl(){if(Bt)return;let r=TB[process.platform];if(r)try{Bt=(0,Mw.spawn)(r.cmd,r.args,{stdio:"ignore",windowsHide:!0}),Bt.on("error",e=>{El.warn(`inhibitor error: ${e.message}`),Bt=null}),Bt.on("exit",()=>{Bt=null}),CB(),El.info(`\u{1F4A4} Sleep inhibitor started (${r.cmd})`)}catch(e){El.warn(`Failed to start sleep inhibitor: ${e.message}`),Bt=null}}function Iw(){if(Bt){try{Bt.kill()}catch{}Bt=null,El.info("\u{1F4A4} Sleep inhibitor stopped")}}function Nw(){Fo&&(clearTimeout(Fo),Fo=null)}function AB(r){return(Z.sleepInhibit?.presets||{})[r]??null}function RB(r){let e=Z.sleepInhibit?.presets||{};return Object.prototype.hasOwnProperty.call(e,r)}function ch(){if(Nw(),vs==="never"){Sl();return}let r=AB(vs);if(r==null){Sl();return}if(ah>0){Sl();return}Sl(),Fo=setTimeout(()=>{Fo=null,ah===0&&Iw()},r)}function kB(){ch()}function lh(){Nw(),Iw()}function uh(){return Bt!==null}function ph(){return vs}function Ho(r){return RB(r)&&(vs=r,ch()),vs}function OB(r){ah=r,ch()}var Mw,El,TB,Bt,vs,Fo,ah,Pw,Cl=Te(()=>{Mw=require("child_process");bt();Pi();El=An("sleep"),TB={darwin:{cmd:"caffeinate",args:["-imsd"]},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}`]}},Bt=null,vs=Z.sleepInhibit?.defaultMode||"never",Fo=null,ah=0,Pw=!1});function PB(){(0,Fn.mkdirSync)(oe.STATE,{recursive:!0})}function Dw(){try{if((0,Fn.existsSync)(fh)){let r=JSON.parse((0,Fn.readFileSync)(fh,"utf8"));r.step===Oi.READY&&r.permanentKey&&(dn={...dn,...r})}}catch{}}function MB(){try{PB(),(0,Fn.writeFileSync)(fh,JSON.stringify(dn),{mode:384})}catch{}}function Bw(){jt=!!jo().desktopEnabled}function dh(){wl({desktopEnabled:jt})}function St(r,e){let t=`data: ${JSON.stringify({type:r,...e})}
|
|
82
82
|
|
|
83
|
-
`;for(let n of
|
|
83
|
+
`;for(let n of Al)try{n.write(t)}catch{Al.delete(n)}}function xt(r){St("log",{message:`[${new Date().toLocaleTimeString()}] ${r}`})}function jw(){return dn}function Hn(r){dn={...dn,...r},St("state",dn),MB()}function Fw(){Hn({oneTimeKey:"",oneTimeKeyExpiresAt:null,qrUrl:""})}function Hw(r){hh=!!r}function xs(){return!!hh&&!!jt&&!!Ar.screenRecording&&!!Ar.accessibility}function $w(r){mh=r}async function Rl(){let r=await _w(),e=Ar,t=xs();Ar=r,jt&&(!r.screenRecording||!r.accessibility)&&(jt=!1,dh());let n=e.screenRecording&&e.accessibility,i=r.screenRecording&&r.accessibility;return!jt&&!n&&i&&(jt=!0,dh()),(e.screenRecording!==r.screenRecording||e.accessibility!==r.accessibility)&&St("permissions",{...Ar,desktopEnabled:jt}),xs()!==t&&mh?.(),r}function qw(r,e){let t=r.headers.origin;if(t&&!La.includes(t))return he(e,403,"Forbidden origin");ee(e,{localToken:Db()})}function Uw(r,e,t=null,n="ws"){pi.set(r,{socketId:r,ip:e,deviceId:t,type:n,connectedAt:Date.now()}),St("connections",{connections:[...pi.values()]}),Gw()}function Ww(r){pi.delete(r),St("connections",{connections:[...pi.values()]}),Gw()}async function Gw(){try{(await Promise.resolve().then(()=>(Cl(),Tl))).onConnectionChange(pi.size)}catch{}}function zw(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",...dn})}
|
|
84
84
|
|
|
85
|
-
`),e.write(`data: ${JSON.stringify({type:"connections",connections:[...
|
|
85
|
+
`),e.write(`data: ${JSON.stringify({type:"connections",connections:[...pi.values()]})}
|
|
86
86
|
|
|
87
|
-
`),e.write(`data: ${JSON.stringify({type:"permissions",...
|
|
87
|
+
`),e.write(`data: ${JSON.stringify({type:"permissions",...Ar,desktopEnabled:jt})}
|
|
88
88
|
|
|
89
|
-
`),ml.add(e),r.on("close",()=>ml.delete(e))}function Ow(r,e){re(e,{...fn,...Rr,desktopEnabled:Lt,remoteAvailable:Qd})}async function Pw(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(er(),Ci)),n=await t(r,e);n&&(jn(n),re(e))}function Mw(r,e){re(e),jn({step:Ai.STOPPED,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null}),il("stop-tunnel")}function Iw(r,e){re(e),jn({step:Ai.PREPARING,stepDesc:""}),il("start-tunnel")}function Nw(r,e){re(e),jn({step:Ai.STOPPED,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null}),il("shutdown")}function Lw(r,e){re(e,{connections:[...ai.values()]})}function Dw(r,e){let t=new URL(r.url,"http://localhost"),n=parseInt(t.searchParams.get("lines")||sp,10);re(e,{logs:gv(Number.isFinite(n)?n:sp)})}async function Bw(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(er(),Ci)),n=await t(r,e);if(!n)return;let i=!!n.enabled;if(i&&(!Rr.screenRecording||!Rr.accessibility)){re(e,{ok:!1,enabled:Lt,reason:"permissions_required"});return}let s=ms();Lt=i,Jd(),_t("permissions",{...Rr,desktopEnabled:Lt}),ms()!==s&&Zd?.(),re(e,{ok:!0,enabled:Lt})}function jw(r,e){re(e,Rr)}async function Fw(r,e){let t=await Ud();re(e,{enabled:t})}async function Hw(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(er(),Ci)),n=await t(r,e);if(!n)return;let i=await pw(!!n.enabled),s=await Ud();_t("autostart",{enabled:s}),re(e,{ok:i,enabled:s})}async function $w(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(er(),Ci)),n=await t(r,e);if(!n)return;let{type:i}=n;if(process.platform==="darwin"){sw(i);let s=Date.now(),o=setInterval(async()=>{((await gl())[i]||Date.now()-s>pv)&&clearInterval(o)},uv)}re(e)}var Bn,yw,Xd,fn,Lt,Qd,Rr,ml,ai,Zd,ci=st(()=>{gt();Ri();gt();Oo();ow();fw();er();Bn=require("fs"),yw=require("path");gt();Wd();Xd=(0,yw.join)(oe.STATE,"ui-state.json");fn={step:Ai.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}},Lt=!1,Qd=!1,Rr={screenRecording:!1,accessibility:!1},ml=new Set,ai=new Map;mv(bt);Zd=null});var vl,qw=st(()=>{yt();ci();vl=class{constructor(){this.cfg=Z.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=N=>(this.samples.reduce((H,W)=>H+W[N],0)/e).toFixed(1),n=(Date.now()-this.lastLogTime)/1e3,i=(e/n).toFixed(1),s=[],o=0;for(let N of this.samples){for(let H of N.tileBytes)s.push(H);o+=N.tileBytes.reduce((H,W)=>H+W,0)}let a=(o/e/1024).toFixed(1),c=s.length?(s.reduce((N,H)=>N+H,0)/s.length/1024).toFixed(2):"0",u=s.length?(Math.min(...s)/1024).toFixed(2):"0",p=s.length?(Math.max(...s)/1024).toFixed(2):"0",f=this.samples.reduce((N,H)=>N+H.rawBytes,0)/e,g=o/e,y=g>0?(f/g).toFixed(0):"0",b=(this.samples.reduce((N,H)=>N+H.changedTiles,0)/e).toFixed(0),S=this.samples[0]?.totalTiles||0,R=S?(b/S*100).toFixed(1):"0",I=Z.pipeline,L=`[Metrics] ${I.captureLib}+${I.encoder} tile=${I.tileSize} q${I.jpegQuality} scale=${I.outputScale} | fps=${i} | capture=${t("capture")}ms enc=${t("encode")}ms total=${t("total")}ms | tiles=${b}/${S} (${R}%) | data=${a}KB/frame | tileAvg=${c}KB (min ${u}, max ${p}) | compress=${y}x`;bt(L),console.log(L),this.samples=[],this.lastLogTime=Date.now()}}});var Gw={};Xr(Gw,{TileManager:()=>eh});var gs,yl,Uw,xl,Ww,aB,cB,eh,zw=st(()=>{gs=X(require("fs"),1),yl=X(require("path"),1),Uw=X(require("sharp"),1),xl=require("child_process"),Ww=require("url");yt();Qb();ew();qw();Ed();aB=(0,Ww.fileURLToPath)(__importMetaUrl),cB=yl.default.dirname(aB),eh=class{constructor(e){this.robot=e,this.metrics=new vl,this.tileSize=Z.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=yl.default.join(cB,"../../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=Z.pipeline.outputScale||1,this.compressionQuality=Z.pipeline.jpegQuality,this.activeTileSet=null,this.focusStats={frames:0,scanned:0,changed:0,bytes:0},gs.default.existsSync(this.tempDir)||gs.default.mkdirSync(this.tempDir,{recursive:!0}),Xb(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){me.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(){me.dpi(`\u{1F50D} [DPI Detection] screenWidth from robot: ${this.screenWidth}x${this.screenHeight}`);try{let e=(0,xl.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(me.dpi(`\u{1F50D} [DPI Detection] Strategy 1 (Registry AppliedDPI): ${t} DPI`),t>=96){let n=t/96;return me.dpi(`\u2705 [DPI Detection] Using registry scale: ${n}x (${t}/96)`),n}}catch(e){me.dpi(`\u274C [DPI Detection] Strategy 1 failed: ${e.message}`)}try{let e=(0,xl.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(me.dpi(`\u{1F50D} [DPI Detection] Strategy 2 (WMI): physical width = ${t}px`),t>0&&t>this.screenWidth){let n=t/this.screenWidth;return me.dpi(`\u2705 [DPI Detection] Using WMI scale: ${n}x (${t}/${this.screenWidth})`),n}}catch(e){me.dpi(`\u274C [DPI Detection] Strategy 2 failed: ${e.message}`)}try{let e=(0,xl.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(me.dpi(`\u{1F50D} [DPI Detection] Strategy 3 (EnumDisplaySettings): physical width = ${t}px`),t>0&&t>this.screenWidth){let n=t/this.screenWidth;return me.dpi(`\u2705 [DPI Detection] Using EnumDisplaySettings scale: ${n}x (${t}/${this.screenWidth})`),n}}catch(e){me.dpi(`\u274C [DPI Detection] Strategy 3 failed: ${e.message}`)}return me.dpi("\u26A0\uFE0F [DPI Detection] All strategies failed, fallback to 1x"),1}async captureFullScreen(){let e=await Jb();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)}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.getSharedScreenCapture();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 g=this.calculateTileChecksumDirect(i,f);a.set(f,g)}n=this.metrics.now();let u=Array.from(a.values());if(this.lastTileChecksums.size===0){let f=[];for(let y=0;y<this.totalTiles;y++)c&&!c.has(y)||(this.lastTileChecksums.set(y,a.get(y)),f.push(this.processTileAsync(i,y)));let g=await Promise.all(f);return s.push(...g),this._recordFrame(e,t,n,s,i),{tiles:s,currentHashes:u}}for(let f=0;f<this.totalTiles;f++){if(c&&!c.has(f))continue;let g=a.get(f),y=this.lastTileChecksums.get(f);g!==y&&(o.push(f),this.lastTileChecksums.set(f,g))}if(o.length/this.totalTiles>this.changeThreshold){let f=[];for(let y=0;y<this.totalTiles;y++)c&&!c.has(y)||f.push(this.processTileAsync(i,y));let g=await Promise.all(f);s.push(...g.map(y=>({...y,fullRefresh:!0})))}else if(o.length>0){let f=o.map(y=>this.processTileAsync(i,y)),g=await Promise.all(f);s.push(...g)}return this._recordFrame(e,t,n,s,i),{tiles:s,currentHashes:u}}finally{this.isProcessing=!1}}async processTileAsync(e,t,n=null){let i=n||this.extractTile(e,t),s=await this.compressTileImage(i.buffer,i.width,i.height),{row:o,col:a}=this.getTilePosition(t);return{type:"tile-update",tileIndex:t,x:a*this.tileSize,y:o*this.tileSize,width:i.width,height:i.height,imageBuffer:s,hash:this.lastTileChecksums.get(t)??0,timestamp:Date.now(),frameCount:this.frameCount}}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),u=a-s,p=c-o,f=e.channels,g=e.width*f,y=0,b=16;for(let S=0;S<p;S+=4){let R=(S>>2&1)*8,I=(o+S)*g+s*f;for(let L=R;L<u;L+=b){let N=I+L*f;y+=e.buffer[N],y^=e.buffer[N+1],y+=e.buffer[N+2]<<1,y^=e.buffer[N+3]<<2}}return y>>>0}setFocusRect(e){if(!e){this.activeTileSet=null;return}let t=Z.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 u=i;u<=o;u++)for(let p=n;p<=s;p++)a.add(u*this.tilesPerRow+p);let c=this.activeTileSet;if(c)for(let u of a)c.has(u)||this.lastTileChecksums.delete(u);this.activeTileSet=a}getTilePosition(e){return{row:Math.floor(e/this.tilesPerRow),col:e%this.tilesPerRow}}extractTile(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),u=a-s,p=c-o,f=e.channels,g=u*f,y=Buffer.alloc(u*p*f);for(let b=0;b<p;b++){let S=((o+b)*e.width+s)*f,R=b*g;e.buffer.copy(y,R,S,S+g)}return{buffer:y,width:u,height:p,channels:f,tileIndex:t,x:s,y:o}}async compressTileImage(e,t,n){let i=this.scaleFactor;if(i&&i>0&&i<1){let s=Math.max(1,Math.floor(t*i)),o=Math.max(1,Math.floor(n*i)),{inputFormat:a}=Z.pipeline,c=e,u=4;a==="bgra"&&(c=Buffer.from(e),Dd(c));let p=await(0,Uw.default)(c,{raw:{width:t,height:n,channels:u}}).resize(s,o,{kernel:"lanczos3",fastShrinkOnLoad:!1}).raw().toBuffer();return Bd(p,s,o,4,this.compressionQuality,"rgba")}return Bd(e,t,n,4,this.compressionQuality)}pickProfile({zoom:e=1,viewerWidth:t=0,dpr:n=1}={}){let i=Z.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,u=o*a*c/s,p=Z.pipeline.tierHysteresis||0,f=this._currentTier;for(let y of i){let b=f&&y===f?y.minEffective-p:y.minEffective;if(u>=b)return this._currentTier=y,y}let g=i[i.length-1];return this._currentTier=g,g}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(u=>u.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<Z.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";me.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){me.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 u=this.calculateTileChecksumDirect(t,c);o.set(c,u),this.lastTileChecksums.set(c,u)}if(!e||e.length===0){let c=[];for(let p=0;p<this.totalTiles;p++)s&&!s.has(p)||c.push(this.processTileAsync(t,p));let u=await Promise.all(c);return n.push(...u),{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 p=0;p<this.totalTiles;p++)s&&!s.has(p)||c.push(this.processTileAsync(t,p));let u=await Promise.all(c);n.push(...u.map(p=>({...p,fullRefresh:!0})))}else if(i.length>0){let c=i.map(p=>this.processTileAsync(t,p)),u=await Promise.all(c);n.push(...u)}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()}reset(){this.lastTileChecksums.clear(),this.frameCount=0}cleanup(){try{gs.default.existsSync(this.tempDir)&&gs.default.readdirSync(this.tempDir).forEach(t=>gs.default.unlinkSync(yl.default.join(this.tempDir,t)))}catch(e){me.warn(`Cleanup error: ${e.message}`)}}}});var Kw={};Xr(Kw,{ResourceManager:()=>th});var th,Vw=st(()=>{yt();th=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>Z.resourceManagement.memoryWarningThreshold&&(console.warn(`\u26A0\uFE0F High memory: ${t}MB`),this.cleanupInactiveClients())},Z.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=Z.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())}catch(n){console.error(`Error cleaning up ${e}:`,n.message)}}getStreamingConfig(){return Z.streaming}getWebRTCConfig(){return Z.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 Yw={};Xr(Yw,{ScreenUpdateHelper:()=>rh});var rh,Xw=st(()=>{yt();rh=class{constructor(e){this.resourceManager=e}async sendTilesInChunks(e,t,n,i=!1){if(!t||t.length===0)return;let s=Z.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 u=o[c],p=c===o.length-1,f=setTimeout(()=>{a.delete(f),e.connected&&e.emit("tiles-data",{tiles:u,timestamp:n,forceRefresh:!1,userAction:i,chunkInfo:{chunkIndex:c,totalChunks:o.length,isLastChunk:p}})},c*Z.streaming.chunkDelay);a.add(f)}}}});var Jw={};Xr(Jw,{MouseHandler:()=>nh});var nh,Qw=st(()=>{yt();nh=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<Z.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),u=Math.max(0,Math.min(o.width-1,a)),p=Math.max(0,Math.min(o.height-1,c));n.moveMouse(u,p),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),u=Math.max(0,Math.min(o.width-1,a)),p=Math.max(0,Math.min(o.height-1,c));n.moveMouse(u,p),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),u=Math.max(0,Math.min(o.width-1,a)),p=Math.max(0,Math.min(o.height-1,c));n.moveMouse(u,p),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),u=Math.max(0,Math.min(o.width-1,a)),p=Math.max(0,Math.min(o.height-1,c));n.moveMouse(u,p),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 u=0,p=0;a||s==="left"||s==="right"?u=s==="right"?o:-o:p=s==="down"?-o:o,n.scrollMouse(u,p),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,u=n.getScreenSize(),p=Math.round(s/100*u.width),f=Math.round(o/100*u.height),g=Math.round(a/100*u.width),y=Math.round(c/100*u.height),b=Math.max(0,Math.min(u.width-1,p)),S=Math.max(0,Math.min(u.height-1,f)),R=Math.max(0,Math.min(u.width-1,g)),I=Math.max(0,Math.min(u.height-1,y));n.moveMouse(b,S),n.mouseToggle("down","left"),n.dragMouse(R,I),n.mouseToggle("up","left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Drag selection error:",s.message)}}))}}});var eS={};Xr(eS,{KeyboardHandler:()=>ih});function lB(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,Zw.execFile)("osascript",["-e",e],t=>{t&&console.error("osascript error:",t.message)})}var Zw,ih,tS=st(()=>{Zw=require("child_process");yt();ih=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<Z.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){n.keyTap(a,c);for(let u of c)n.keyToggle(u,"up")}else{let p={return:"enter"}[a.toLowerCase()]??a.toLowerCase();n.keyTap(p,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=Z.desktopSwitch[process.platform]?.[s];if(!o)return;process.platform==="darwin"?lB(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<Z.throttling.typeTextThrottle)){this.lastTypeText=s;try{if(!i.text||typeof i.text!="string")return;let o=i.text;o.length>Z.throttling.maxTextLength&&(o=o.substring(0,Z.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(u){console.error("Robot typeString error:",u.message)}},10)}catch(o){console.error("Type text error:",o.message)}}}))}}});var mh=O((IS,hh)=>{(function(r,e){"use strict";function t(T,l){if(!T)throw new Error(l||"Assertion failed")}function n(T,l){T.super_=l;var h=function(){};h.prototype=l.prototype,T.prototype=new h,T.prototype.constructor=T}function i(T,l,h){if(i.isBN(T))return T;this.negative=0,this.words=null,this.length=0,this.red=null,T!==null&&((l==="le"||l==="be")&&(h=l,l=10),this._init(T||0,l||10,h||"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(l){return l instanceof i?!0:l!==null&&typeof l=="object"&&l.constructor.wordSize===i.wordSize&&Array.isArray(l.words)},i.max=function(l,h){return l.cmp(h)>0?l:h},i.min=function(l,h){return l.cmp(h)<0?l:h},i.prototype._init=function(l,h,x){if(typeof l=="number")return this._initNumber(l,h,x);if(typeof l=="object")return this._initArray(l,h,x);h==="hex"&&(h=16),t(h===(h|0)&&h>=2&&h<=36),l=l.toString().replace(/\s+/g,"");var w=0;l[0]==="-"&&(w++,this.negative=1),w<l.length&&(h===16?this._parseHex(l,w,x):(this._parseBase(l,h,w),x==="le"&&this._initArray(this.toArray(),h,x)))},i.prototype._initNumber=function(l,h,x){l<0&&(this.negative=1,l=-l),l<67108864?(this.words=[l&67108863],this.length=1):l<4503599627370496?(this.words=[l&67108863,l/67108864&67108863],this.length=2):(t(l<9007199254740992),this.words=[l&67108863,l/67108864&67108863,1],this.length=3),x==="le"&&this._initArray(this.toArray(),h,x)},i.prototype._initArray=function(l,h,x){if(t(typeof l.length=="number"),l.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(l.length/3),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var m,v,C=0;if(x==="be")for(w=l.length-1,m=0;w>=0;w-=3)v=l[w]|l[w-1]<<8|l[w-2]<<16,this.words[m]|=v<<C&67108863,this.words[m+1]=v>>>26-C&67108863,C+=24,C>=26&&(C-=26,m++);else if(x==="le")for(w=0,m=0;w<l.length;w+=3)v=l[w]|l[w+1]<<8|l[w+2]<<16,this.words[m]|=v<<C&67108863,this.words[m+1]=v>>>26-C&67108863,C+=24,C>=26&&(C-=26,m++);return this.strip()};function o(T,l){var h=T.charCodeAt(l);return h>=65&&h<=70?h-55:h>=97&&h<=102?h-87:h-48&15}function a(T,l,h){var x=o(T,h);return h-1>=l&&(x|=o(T,h-1)<<4),x}i.prototype._parseHex=function(l,h,x){this.length=Math.ceil((l.length-h)/6),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var m=0,v=0,C;if(x==="be")for(w=l.length-1;w>=h;w-=2)C=a(l,h,w)<<m,this.words[v]|=C&67108863,m>=18?(m-=18,v+=1,this.words[v]|=C>>>26):m+=8;else{var _=l.length-h;for(w=_%2===0?h+1:h;w<l.length;w+=2)C=a(l,h,w)<<m,this.words[v]|=C&67108863,m>=18?(m-=18,v+=1,this.words[v]|=C>>>26):m+=8}this.strip()};function c(T,l,h,x){for(var w=0,m=Math.min(T.length,h),v=l;v<m;v++){var C=T.charCodeAt(v)-48;w*=x,C>=49?w+=C-49+10:C>=17?w+=C-17+10:w+=C}return w}i.prototype._parseBase=function(l,h,x){this.words=[0],this.length=1;for(var w=0,m=1;m<=67108863;m*=h)w++;w--,m=m/h|0;for(var v=l.length-x,C=v%w,_=Math.min(v,v-C)+x,d=0,E=x;E<_;E+=w)d=c(l,E,E+w,h),this.imuln(m),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(C!==0){var q=1;for(d=c(l,E,l.length,h),E=0;E<C;E++)q*=h;this.imuln(q),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}this.strip()},i.prototype.copy=function(l){l.words=new Array(this.length);for(var h=0;h<this.length;h++)l.words[h]=this.words[h];l.length=this.length,l.negative=this.negative,l.red=this.red},i.prototype.clone=function(){var l=new i(null);return this.copy(l),l},i.prototype._expand=function(l){for(;this.length<l;)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 u=["","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"],p=[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(l,h){l=l||10,h=h|0||1;var x;if(l===16||l==="hex"){x="";for(var w=0,m=0,v=0;v<this.length;v++){var C=this.words[v],_=((C<<w|m)&16777215).toString(16);m=C>>>24-w&16777215,w+=2,w>=26&&(w-=26,v--),m!==0||v!==this.length-1?x=u[6-_.length]+_+x:x=_+x}for(m!==0&&(x=m.toString(16)+x);x.length%h!==0;)x="0"+x;return this.negative!==0&&(x="-"+x),x}if(l===(l|0)&&l>=2&&l<=36){var d=p[l],E=f[l];x="";var q=this.clone();for(q.negative=0;!q.isZero();){var M=q.modn(E).toString(l);q=q.idivn(E),q.isZero()?x=M+x:x=u[d-M.length]+M+x}for(this.isZero()&&(x="0"+x);x.length%h!==0;)x="0"+x;return this.negative!==0&&(x="-"+x),x}t(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var l=this.words[0];return this.length===2?l+=this.words[1]*67108864:this.length===3&&this.words[2]===1?l+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-l:l},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(l,h){return t(typeof s<"u"),this.toArrayLike(s,l,h)},i.prototype.toArray=function(l,h){return this.toArrayLike(Array,l,h)},i.prototype.toArrayLike=function(l,h,x){var w=this.byteLength(),m=x||Math.max(1,w);t(w<=m,"byte array longer than desired length"),t(m>0,"Requested array length <= 0"),this.strip();var v=h==="le",C=new l(m),_,d,E=this.clone();if(v){for(d=0;!E.isZero();d++)_=E.andln(255),E.iushrn(8),C[d]=_;for(;d<m;d++)C[d]=0}else{for(d=0;d<m-w;d++)C[d]=0;for(d=0;!E.isZero();d++)_=E.andln(255),E.iushrn(8),C[m-d-1]=_}return C},Math.clz32?i.prototype._countBits=function(l){return 32-Math.clz32(l)}:i.prototype._countBits=function(l){var h=l,x=0;return h>=4096&&(x+=13,h>>>=13),h>=64&&(x+=7,h>>>=7),h>=8&&(x+=4,h>>>=4),h>=2&&(x+=2,h>>>=2),x+h},i.prototype._zeroBits=function(l){if(l===0)return 26;var h=l,x=0;return(h&8191)===0&&(x+=13,h>>>=13),(h&127)===0&&(x+=7,h>>>=7),(h&15)===0&&(x+=4,h>>>=4),(h&3)===0&&(x+=2,h>>>=2),(h&1)===0&&x++,x},i.prototype.bitLength=function(){var l=this.words[this.length-1],h=this._countBits(l);return(this.length-1)*26+h};function g(T){for(var l=new Array(T.bitLength()),h=0;h<l.length;h++){var x=h/26|0,w=h%26;l[h]=(T.words[x]&1<<w)>>>w}return l}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var l=0,h=0;h<this.length;h++){var x=this._zeroBits(this.words[h]);if(l+=x,x!==26)break}return l},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(l){return this.negative!==0?this.abs().inotn(l).iaddn(1):this.clone()},i.prototype.fromTwos=function(l){return this.testn(l-1)?this.notn(l).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(l){for(;this.length<l.length;)this.words[this.length++]=0;for(var h=0;h<l.length;h++)this.words[h]=this.words[h]|l.words[h];return this.strip()},i.prototype.ior=function(l){return t((this.negative|l.negative)===0),this.iuor(l)},i.prototype.or=function(l){return this.length>l.length?this.clone().ior(l):l.clone().ior(this)},i.prototype.uor=function(l){return this.length>l.length?this.clone().iuor(l):l.clone().iuor(this)},i.prototype.iuand=function(l){var h;this.length>l.length?h=l:h=this;for(var x=0;x<h.length;x++)this.words[x]=this.words[x]&l.words[x];return this.length=h.length,this.strip()},i.prototype.iand=function(l){return t((this.negative|l.negative)===0),this.iuand(l)},i.prototype.and=function(l){return this.length>l.length?this.clone().iand(l):l.clone().iand(this)},i.prototype.uand=function(l){return this.length>l.length?this.clone().iuand(l):l.clone().iuand(this)},i.prototype.iuxor=function(l){var h,x;this.length>l.length?(h=this,x=l):(h=l,x=this);for(var w=0;w<x.length;w++)this.words[w]=h.words[w]^x.words[w];if(this!==h)for(;w<h.length;w++)this.words[w]=h.words[w];return this.length=h.length,this.strip()},i.prototype.ixor=function(l){return t((this.negative|l.negative)===0),this.iuxor(l)},i.prototype.xor=function(l){return this.length>l.length?this.clone().ixor(l):l.clone().ixor(this)},i.prototype.uxor=function(l){return this.length>l.length?this.clone().iuxor(l):l.clone().iuxor(this)},i.prototype.inotn=function(l){t(typeof l=="number"&&l>=0);var h=Math.ceil(l/26)|0,x=l%26;this._expand(h),x>0&&h--;for(var w=0;w<h;w++)this.words[w]=~this.words[w]&67108863;return x>0&&(this.words[w]=~this.words[w]&67108863>>26-x),this.strip()},i.prototype.notn=function(l){return this.clone().inotn(l)},i.prototype.setn=function(l,h){t(typeof l=="number"&&l>=0);var x=l/26|0,w=l%26;return this._expand(x+1),h?this.words[x]=this.words[x]|1<<w:this.words[x]=this.words[x]&~(1<<w),this.strip()},i.prototype.iadd=function(l){var h;if(this.negative!==0&&l.negative===0)return this.negative=0,h=this.isub(l),this.negative^=1,this._normSign();if(this.negative===0&&l.negative!==0)return l.negative=0,h=this.isub(l),l.negative=1,h._normSign();var x,w;this.length>l.length?(x=this,w=l):(x=l,w=this);for(var m=0,v=0;v<w.length;v++)h=(x.words[v]|0)+(w.words[v]|0)+m,this.words[v]=h&67108863,m=h>>>26;for(;m!==0&&v<x.length;v++)h=(x.words[v]|0)+m,this.words[v]=h&67108863,m=h>>>26;if(this.length=x.length,m!==0)this.words[this.length]=m,this.length++;else if(x!==this)for(;v<x.length;v++)this.words[v]=x.words[v];return this},i.prototype.add=function(l){var h;return l.negative!==0&&this.negative===0?(l.negative=0,h=this.sub(l),l.negative^=1,h):l.negative===0&&this.negative!==0?(this.negative=0,h=l.sub(this),this.negative=1,h):this.length>l.length?this.clone().iadd(l):l.clone().iadd(this)},i.prototype.isub=function(l){if(l.negative!==0){l.negative=0;var h=this.iadd(l);return l.negative=1,h._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(l),this.negative=1,this._normSign();var x=this.cmp(l);if(x===0)return this.negative=0,this.length=1,this.words[0]=0,this;var w,m;x>0?(w=this,m=l):(w=l,m=this);for(var v=0,C=0;C<m.length;C++)h=(w.words[C]|0)-(m.words[C]|0)+v,v=h>>26,this.words[C]=h&67108863;for(;v!==0&&C<w.length;C++)h=(w.words[C]|0)+v,v=h>>26,this.words[C]=h&67108863;if(v===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(l){return this.clone().isub(l)};function y(T,l,h){h.negative=l.negative^T.negative;var x=T.length+l.length|0;h.length=x,x=x-1|0;var w=T.words[0]|0,m=l.words[0]|0,v=w*m,C=v&67108863,_=v/67108864|0;h.words[0]=C;for(var d=1;d<x;d++){for(var E=_>>>26,q=_&67108863,M=Math.min(d,l.length-1),D=Math.max(0,d-T.length+1);D<=M;D++){var $=d-D|0;w=T.words[$]|0,m=l.words[D]|0,v=w*m+q,E+=v/67108864|0,q=v&67108863}h.words[d]=q|0,_=E|0}return _!==0?h.words[d]=_|0:h.length--,h.strip()}var b=function(l,h,x){var w=l.words,m=h.words,v=x.words,C=0,_,d,E,q=w[0]|0,M=q&8191,D=q>>>13,$=w[1]|0,K=$&8191,B=$>>>13,de=w[2]|0,ie=de&8191,A=de>>>13,Y=w[3]|0,k=Y&8191,j=Y>>>13,J=w[4]|0,V=J&8191,z=J>>>13,he=w[5]|0,te=he&8191,Oe=he>>>13,Mg=w[6]|0,Pe=Mg&8191,Me=Mg>>>13,Ig=w[7]|0,Ie=Ig&8191,Ne=Ig>>>13,Ng=w[8]|0,Le=Ng&8191,De=Ng>>>13,Lg=w[9]|0,Be=Lg&8191,je=Lg>>>13,Dg=m[0]|0,Fe=Dg&8191,He=Dg>>>13,Bg=m[1]|0,$e=Bg&8191,qe=Bg>>>13,jg=m[2]|0,Ue=jg&8191,We=jg>>>13,Fg=m[3]|0,Ge=Fg&8191,ze=Fg>>>13,Hg=m[4]|0,Ke=Hg&8191,Ve=Hg>>>13,$g=m[5]|0,Ye=$g&8191,Xe=$g>>>13,qg=m[6]|0,Je=qg&8191,Qe=qg>>>13,Ug=m[7]|0,Ze=Ug&8191,et=Ug>>>13,Wg=m[8]|0,tt=Wg&8191,rt=Wg>>>13,Gg=m[9]|0,nt=Gg&8191,it=Gg>>>13;x.negative=l.negative^h.negative,x.length=19,_=Math.imul(M,Fe),d=Math.imul(M,He),d=d+Math.imul(D,Fe)|0,E=Math.imul(D,He);var Nu=(C+_|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Nu>>>26)|0,Nu&=67108863,_=Math.imul(K,Fe),d=Math.imul(K,He),d=d+Math.imul(B,Fe)|0,E=Math.imul(B,He),_=_+Math.imul(M,$e)|0,d=d+Math.imul(M,qe)|0,d=d+Math.imul(D,$e)|0,E=E+Math.imul(D,qe)|0;var Lu=(C+_|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Lu>>>26)|0,Lu&=67108863,_=Math.imul(ie,Fe),d=Math.imul(ie,He),d=d+Math.imul(A,Fe)|0,E=Math.imul(A,He),_=_+Math.imul(K,$e)|0,d=d+Math.imul(K,qe)|0,d=d+Math.imul(B,$e)|0,E=E+Math.imul(B,qe)|0,_=_+Math.imul(M,Ue)|0,d=d+Math.imul(M,We)|0,d=d+Math.imul(D,Ue)|0,E=E+Math.imul(D,We)|0;var Du=(C+_|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Du>>>26)|0,Du&=67108863,_=Math.imul(k,Fe),d=Math.imul(k,He),d=d+Math.imul(j,Fe)|0,E=Math.imul(j,He),_=_+Math.imul(ie,$e)|0,d=d+Math.imul(ie,qe)|0,d=d+Math.imul(A,$e)|0,E=E+Math.imul(A,qe)|0,_=_+Math.imul(K,Ue)|0,d=d+Math.imul(K,We)|0,d=d+Math.imul(B,Ue)|0,E=E+Math.imul(B,We)|0,_=_+Math.imul(M,Ge)|0,d=d+Math.imul(M,ze)|0,d=d+Math.imul(D,Ge)|0,E=E+Math.imul(D,ze)|0;var Bu=(C+_|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Bu>>>26)|0,Bu&=67108863,_=Math.imul(V,Fe),d=Math.imul(V,He),d=d+Math.imul(z,Fe)|0,E=Math.imul(z,He),_=_+Math.imul(k,$e)|0,d=d+Math.imul(k,qe)|0,d=d+Math.imul(j,$e)|0,E=E+Math.imul(j,qe)|0,_=_+Math.imul(ie,Ue)|0,d=d+Math.imul(ie,We)|0,d=d+Math.imul(A,Ue)|0,E=E+Math.imul(A,We)|0,_=_+Math.imul(K,Ge)|0,d=d+Math.imul(K,ze)|0,d=d+Math.imul(B,Ge)|0,E=E+Math.imul(B,ze)|0,_=_+Math.imul(M,Ke)|0,d=d+Math.imul(M,Ve)|0,d=d+Math.imul(D,Ke)|0,E=E+Math.imul(D,Ve)|0;var ju=(C+_|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(ju>>>26)|0,ju&=67108863,_=Math.imul(te,Fe),d=Math.imul(te,He),d=d+Math.imul(Oe,Fe)|0,E=Math.imul(Oe,He),_=_+Math.imul(V,$e)|0,d=d+Math.imul(V,qe)|0,d=d+Math.imul(z,$e)|0,E=E+Math.imul(z,qe)|0,_=_+Math.imul(k,Ue)|0,d=d+Math.imul(k,We)|0,d=d+Math.imul(j,Ue)|0,E=E+Math.imul(j,We)|0,_=_+Math.imul(ie,Ge)|0,d=d+Math.imul(ie,ze)|0,d=d+Math.imul(A,Ge)|0,E=E+Math.imul(A,ze)|0,_=_+Math.imul(K,Ke)|0,d=d+Math.imul(K,Ve)|0,d=d+Math.imul(B,Ke)|0,E=E+Math.imul(B,Ve)|0,_=_+Math.imul(M,Ye)|0,d=d+Math.imul(M,Xe)|0,d=d+Math.imul(D,Ye)|0,E=E+Math.imul(D,Xe)|0;var Fu=(C+_|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Fu>>>26)|0,Fu&=67108863,_=Math.imul(Pe,Fe),d=Math.imul(Pe,He),d=d+Math.imul(Me,Fe)|0,E=Math.imul(Me,He),_=_+Math.imul(te,$e)|0,d=d+Math.imul(te,qe)|0,d=d+Math.imul(Oe,$e)|0,E=E+Math.imul(Oe,qe)|0,_=_+Math.imul(V,Ue)|0,d=d+Math.imul(V,We)|0,d=d+Math.imul(z,Ue)|0,E=E+Math.imul(z,We)|0,_=_+Math.imul(k,Ge)|0,d=d+Math.imul(k,ze)|0,d=d+Math.imul(j,Ge)|0,E=E+Math.imul(j,ze)|0,_=_+Math.imul(ie,Ke)|0,d=d+Math.imul(ie,Ve)|0,d=d+Math.imul(A,Ke)|0,E=E+Math.imul(A,Ve)|0,_=_+Math.imul(K,Ye)|0,d=d+Math.imul(K,Xe)|0,d=d+Math.imul(B,Ye)|0,E=E+Math.imul(B,Xe)|0,_=_+Math.imul(M,Je)|0,d=d+Math.imul(M,Qe)|0,d=d+Math.imul(D,Je)|0,E=E+Math.imul(D,Qe)|0;var Hu=(C+_|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Hu>>>26)|0,Hu&=67108863,_=Math.imul(Ie,Fe),d=Math.imul(Ie,He),d=d+Math.imul(Ne,Fe)|0,E=Math.imul(Ne,He),_=_+Math.imul(Pe,$e)|0,d=d+Math.imul(Pe,qe)|0,d=d+Math.imul(Me,$e)|0,E=E+Math.imul(Me,qe)|0,_=_+Math.imul(te,Ue)|0,d=d+Math.imul(te,We)|0,d=d+Math.imul(Oe,Ue)|0,E=E+Math.imul(Oe,We)|0,_=_+Math.imul(V,Ge)|0,d=d+Math.imul(V,ze)|0,d=d+Math.imul(z,Ge)|0,E=E+Math.imul(z,ze)|0,_=_+Math.imul(k,Ke)|0,d=d+Math.imul(k,Ve)|0,d=d+Math.imul(j,Ke)|0,E=E+Math.imul(j,Ve)|0,_=_+Math.imul(ie,Ye)|0,d=d+Math.imul(ie,Xe)|0,d=d+Math.imul(A,Ye)|0,E=E+Math.imul(A,Xe)|0,_=_+Math.imul(K,Je)|0,d=d+Math.imul(K,Qe)|0,d=d+Math.imul(B,Je)|0,E=E+Math.imul(B,Qe)|0,_=_+Math.imul(M,Ze)|0,d=d+Math.imul(M,et)|0,d=d+Math.imul(D,Ze)|0,E=E+Math.imul(D,et)|0;var $u=(C+_|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+($u>>>26)|0,$u&=67108863,_=Math.imul(Le,Fe),d=Math.imul(Le,He),d=d+Math.imul(De,Fe)|0,E=Math.imul(De,He),_=_+Math.imul(Ie,$e)|0,d=d+Math.imul(Ie,qe)|0,d=d+Math.imul(Ne,$e)|0,E=E+Math.imul(Ne,qe)|0,_=_+Math.imul(Pe,Ue)|0,d=d+Math.imul(Pe,We)|0,d=d+Math.imul(Me,Ue)|0,E=E+Math.imul(Me,We)|0,_=_+Math.imul(te,Ge)|0,d=d+Math.imul(te,ze)|0,d=d+Math.imul(Oe,Ge)|0,E=E+Math.imul(Oe,ze)|0,_=_+Math.imul(V,Ke)|0,d=d+Math.imul(V,Ve)|0,d=d+Math.imul(z,Ke)|0,E=E+Math.imul(z,Ve)|0,_=_+Math.imul(k,Ye)|0,d=d+Math.imul(k,Xe)|0,d=d+Math.imul(j,Ye)|0,E=E+Math.imul(j,Xe)|0,_=_+Math.imul(ie,Je)|0,d=d+Math.imul(ie,Qe)|0,d=d+Math.imul(A,Je)|0,E=E+Math.imul(A,Qe)|0,_=_+Math.imul(K,Ze)|0,d=d+Math.imul(K,et)|0,d=d+Math.imul(B,Ze)|0,E=E+Math.imul(B,et)|0,_=_+Math.imul(M,tt)|0,d=d+Math.imul(M,rt)|0,d=d+Math.imul(D,tt)|0,E=E+Math.imul(D,rt)|0;var qu=(C+_|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(qu>>>26)|0,qu&=67108863,_=Math.imul(Be,Fe),d=Math.imul(Be,He),d=d+Math.imul(je,Fe)|0,E=Math.imul(je,He),_=_+Math.imul(Le,$e)|0,d=d+Math.imul(Le,qe)|0,d=d+Math.imul(De,$e)|0,E=E+Math.imul(De,qe)|0,_=_+Math.imul(Ie,Ue)|0,d=d+Math.imul(Ie,We)|0,d=d+Math.imul(Ne,Ue)|0,E=E+Math.imul(Ne,We)|0,_=_+Math.imul(Pe,Ge)|0,d=d+Math.imul(Pe,ze)|0,d=d+Math.imul(Me,Ge)|0,E=E+Math.imul(Me,ze)|0,_=_+Math.imul(te,Ke)|0,d=d+Math.imul(te,Ve)|0,d=d+Math.imul(Oe,Ke)|0,E=E+Math.imul(Oe,Ve)|0,_=_+Math.imul(V,Ye)|0,d=d+Math.imul(V,Xe)|0,d=d+Math.imul(z,Ye)|0,E=E+Math.imul(z,Xe)|0,_=_+Math.imul(k,Je)|0,d=d+Math.imul(k,Qe)|0,d=d+Math.imul(j,Je)|0,E=E+Math.imul(j,Qe)|0,_=_+Math.imul(ie,Ze)|0,d=d+Math.imul(ie,et)|0,d=d+Math.imul(A,Ze)|0,E=E+Math.imul(A,et)|0,_=_+Math.imul(K,tt)|0,d=d+Math.imul(K,rt)|0,d=d+Math.imul(B,tt)|0,E=E+Math.imul(B,rt)|0,_=_+Math.imul(M,nt)|0,d=d+Math.imul(M,it)|0,d=d+Math.imul(D,nt)|0,E=E+Math.imul(D,it)|0;var Uu=(C+_|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Uu>>>26)|0,Uu&=67108863,_=Math.imul(Be,$e),d=Math.imul(Be,qe),d=d+Math.imul(je,$e)|0,E=Math.imul(je,qe),_=_+Math.imul(Le,Ue)|0,d=d+Math.imul(Le,We)|0,d=d+Math.imul(De,Ue)|0,E=E+Math.imul(De,We)|0,_=_+Math.imul(Ie,Ge)|0,d=d+Math.imul(Ie,ze)|0,d=d+Math.imul(Ne,Ge)|0,E=E+Math.imul(Ne,ze)|0,_=_+Math.imul(Pe,Ke)|0,d=d+Math.imul(Pe,Ve)|0,d=d+Math.imul(Me,Ke)|0,E=E+Math.imul(Me,Ve)|0,_=_+Math.imul(te,Ye)|0,d=d+Math.imul(te,Xe)|0,d=d+Math.imul(Oe,Ye)|0,E=E+Math.imul(Oe,Xe)|0,_=_+Math.imul(V,Je)|0,d=d+Math.imul(V,Qe)|0,d=d+Math.imul(z,Je)|0,E=E+Math.imul(z,Qe)|0,_=_+Math.imul(k,Ze)|0,d=d+Math.imul(k,et)|0,d=d+Math.imul(j,Ze)|0,E=E+Math.imul(j,et)|0,_=_+Math.imul(ie,tt)|0,d=d+Math.imul(ie,rt)|0,d=d+Math.imul(A,tt)|0,E=E+Math.imul(A,rt)|0,_=_+Math.imul(K,nt)|0,d=d+Math.imul(K,it)|0,d=d+Math.imul(B,nt)|0,E=E+Math.imul(B,it)|0;var Wu=(C+_|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Wu>>>26)|0,Wu&=67108863,_=Math.imul(Be,Ue),d=Math.imul(Be,We),d=d+Math.imul(je,Ue)|0,E=Math.imul(je,We),_=_+Math.imul(Le,Ge)|0,d=d+Math.imul(Le,ze)|0,d=d+Math.imul(De,Ge)|0,E=E+Math.imul(De,ze)|0,_=_+Math.imul(Ie,Ke)|0,d=d+Math.imul(Ie,Ve)|0,d=d+Math.imul(Ne,Ke)|0,E=E+Math.imul(Ne,Ve)|0,_=_+Math.imul(Pe,Ye)|0,d=d+Math.imul(Pe,Xe)|0,d=d+Math.imul(Me,Ye)|0,E=E+Math.imul(Me,Xe)|0,_=_+Math.imul(te,Je)|0,d=d+Math.imul(te,Qe)|0,d=d+Math.imul(Oe,Je)|0,E=E+Math.imul(Oe,Qe)|0,_=_+Math.imul(V,Ze)|0,d=d+Math.imul(V,et)|0,d=d+Math.imul(z,Ze)|0,E=E+Math.imul(z,et)|0,_=_+Math.imul(k,tt)|0,d=d+Math.imul(k,rt)|0,d=d+Math.imul(j,tt)|0,E=E+Math.imul(j,rt)|0,_=_+Math.imul(ie,nt)|0,d=d+Math.imul(ie,it)|0,d=d+Math.imul(A,nt)|0,E=E+Math.imul(A,it)|0;var Gu=(C+_|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Gu>>>26)|0,Gu&=67108863,_=Math.imul(Be,Ge),d=Math.imul(Be,ze),d=d+Math.imul(je,Ge)|0,E=Math.imul(je,ze),_=_+Math.imul(Le,Ke)|0,d=d+Math.imul(Le,Ve)|0,d=d+Math.imul(De,Ke)|0,E=E+Math.imul(De,Ve)|0,_=_+Math.imul(Ie,Ye)|0,d=d+Math.imul(Ie,Xe)|0,d=d+Math.imul(Ne,Ye)|0,E=E+Math.imul(Ne,Xe)|0,_=_+Math.imul(Pe,Je)|0,d=d+Math.imul(Pe,Qe)|0,d=d+Math.imul(Me,Je)|0,E=E+Math.imul(Me,Qe)|0,_=_+Math.imul(te,Ze)|0,d=d+Math.imul(te,et)|0,d=d+Math.imul(Oe,Ze)|0,E=E+Math.imul(Oe,et)|0,_=_+Math.imul(V,tt)|0,d=d+Math.imul(V,rt)|0,d=d+Math.imul(z,tt)|0,E=E+Math.imul(z,rt)|0,_=_+Math.imul(k,nt)|0,d=d+Math.imul(k,it)|0,d=d+Math.imul(j,nt)|0,E=E+Math.imul(j,it)|0;var zu=(C+_|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(zu>>>26)|0,zu&=67108863,_=Math.imul(Be,Ke),d=Math.imul(Be,Ve),d=d+Math.imul(je,Ke)|0,E=Math.imul(je,Ve),_=_+Math.imul(Le,Ye)|0,d=d+Math.imul(Le,Xe)|0,d=d+Math.imul(De,Ye)|0,E=E+Math.imul(De,Xe)|0,_=_+Math.imul(Ie,Je)|0,d=d+Math.imul(Ie,Qe)|0,d=d+Math.imul(Ne,Je)|0,E=E+Math.imul(Ne,Qe)|0,_=_+Math.imul(Pe,Ze)|0,d=d+Math.imul(Pe,et)|0,d=d+Math.imul(Me,Ze)|0,E=E+Math.imul(Me,et)|0,_=_+Math.imul(te,tt)|0,d=d+Math.imul(te,rt)|0,d=d+Math.imul(Oe,tt)|0,E=E+Math.imul(Oe,rt)|0,_=_+Math.imul(V,nt)|0,d=d+Math.imul(V,it)|0,d=d+Math.imul(z,nt)|0,E=E+Math.imul(z,it)|0;var Ku=(C+_|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Ku>>>26)|0,Ku&=67108863,_=Math.imul(Be,Ye),d=Math.imul(Be,Xe),d=d+Math.imul(je,Ye)|0,E=Math.imul(je,Xe),_=_+Math.imul(Le,Je)|0,d=d+Math.imul(Le,Qe)|0,d=d+Math.imul(De,Je)|0,E=E+Math.imul(De,Qe)|0,_=_+Math.imul(Ie,Ze)|0,d=d+Math.imul(Ie,et)|0,d=d+Math.imul(Ne,Ze)|0,E=E+Math.imul(Ne,et)|0,_=_+Math.imul(Pe,tt)|0,d=d+Math.imul(Pe,rt)|0,d=d+Math.imul(Me,tt)|0,E=E+Math.imul(Me,rt)|0,_=_+Math.imul(te,nt)|0,d=d+Math.imul(te,it)|0,d=d+Math.imul(Oe,nt)|0,E=E+Math.imul(Oe,it)|0;var Vu=(C+_|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Vu>>>26)|0,Vu&=67108863,_=Math.imul(Be,Je),d=Math.imul(Be,Qe),d=d+Math.imul(je,Je)|0,E=Math.imul(je,Qe),_=_+Math.imul(Le,Ze)|0,d=d+Math.imul(Le,et)|0,d=d+Math.imul(De,Ze)|0,E=E+Math.imul(De,et)|0,_=_+Math.imul(Ie,tt)|0,d=d+Math.imul(Ie,rt)|0,d=d+Math.imul(Ne,tt)|0,E=E+Math.imul(Ne,rt)|0,_=_+Math.imul(Pe,nt)|0,d=d+Math.imul(Pe,it)|0,d=d+Math.imul(Me,nt)|0,E=E+Math.imul(Me,it)|0;var Yu=(C+_|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Yu>>>26)|0,Yu&=67108863,_=Math.imul(Be,Ze),d=Math.imul(Be,et),d=d+Math.imul(je,Ze)|0,E=Math.imul(je,et),_=_+Math.imul(Le,tt)|0,d=d+Math.imul(Le,rt)|0,d=d+Math.imul(De,tt)|0,E=E+Math.imul(De,rt)|0,_=_+Math.imul(Ie,nt)|0,d=d+Math.imul(Ie,it)|0,d=d+Math.imul(Ne,nt)|0,E=E+Math.imul(Ne,it)|0;var Xu=(C+_|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Xu>>>26)|0,Xu&=67108863,_=Math.imul(Be,tt),d=Math.imul(Be,rt),d=d+Math.imul(je,tt)|0,E=Math.imul(je,rt),_=_+Math.imul(Le,nt)|0,d=d+Math.imul(Le,it)|0,d=d+Math.imul(De,nt)|0,E=E+Math.imul(De,it)|0;var Ju=(C+_|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Ju>>>26)|0,Ju&=67108863,_=Math.imul(Be,nt),d=Math.imul(Be,it),d=d+Math.imul(je,nt)|0,E=Math.imul(je,it);var Qu=(C+_|0)+((d&8191)<<13)|0;return C=(E+(d>>>13)|0)+(Qu>>>26)|0,Qu&=67108863,v[0]=Nu,v[1]=Lu,v[2]=Du,v[3]=Bu,v[4]=ju,v[5]=Fu,v[6]=Hu,v[7]=$u,v[8]=qu,v[9]=Uu,v[10]=Wu,v[11]=Gu,v[12]=zu,v[13]=Ku,v[14]=Vu,v[15]=Yu,v[16]=Xu,v[17]=Ju,v[18]=Qu,C!==0&&(v[19]=C,x.length++),x};Math.imul||(b=y);function S(T,l,h){h.negative=l.negative^T.negative,h.length=T.length+l.length;for(var x=0,w=0,m=0;m<h.length-1;m++){var v=w;w=0;for(var C=x&67108863,_=Math.min(m,l.length-1),d=Math.max(0,m-T.length+1);d<=_;d++){var E=m-d,q=T.words[E]|0,M=l.words[d]|0,D=q*M,$=D&67108863;v=v+(D/67108864|0)|0,$=$+C|0,C=$&67108863,v=v+($>>>26)|0,w+=v>>>26,v&=67108863}h.words[m]=C,x=v,v=w}return x!==0?h.words[m]=x:h.length--,h.strip()}function R(T,l,h){var x=new I;return x.mulp(T,l,h)}i.prototype.mulTo=function(l,h){var x,w=this.length+l.length;return this.length===10&&l.length===10?x=b(this,l,h):w<63?x=y(this,l,h):w<1024?x=S(this,l,h):x=R(this,l,h),x};function I(T,l){this.x=T,this.y=l}I.prototype.makeRBT=function(l){for(var h=new Array(l),x=i.prototype._countBits(l)-1,w=0;w<l;w++)h[w]=this.revBin(w,x,l);return h},I.prototype.revBin=function(l,h,x){if(l===0||l===x-1)return l;for(var w=0,m=0;m<h;m++)w|=(l&1)<<h-m-1,l>>=1;return w},I.prototype.permute=function(l,h,x,w,m,v){for(var C=0;C<v;C++)w[C]=h[l[C]],m[C]=x[l[C]]},I.prototype.transform=function(l,h,x,w,m,v){this.permute(v,l,h,x,w,m);for(var C=1;C<m;C<<=1)for(var _=C<<1,d=Math.cos(2*Math.PI/_),E=Math.sin(2*Math.PI/_),q=0;q<m;q+=_)for(var M=d,D=E,$=0;$<C;$++){var K=x[q+$],B=w[q+$],de=x[q+$+C],ie=w[q+$+C],A=M*de-D*ie;ie=M*ie+D*de,de=A,x[q+$]=K+de,w[q+$]=B+ie,x[q+$+C]=K-de,w[q+$+C]=B-ie,$!==_&&(A=d*M-E*D,D=d*D+E*M,M=A)}},I.prototype.guessLen13b=function(l,h){var x=Math.max(h,l)|1,w=x&1,m=0;for(x=x/2|0;x;x=x>>>1)m++;return 1<<m+1+w},I.prototype.conjugate=function(l,h,x){if(!(x<=1))for(var w=0;w<x/2;w++){var m=l[w];l[w]=l[x-w-1],l[x-w-1]=m,m=h[w],h[w]=-h[x-w-1],h[x-w-1]=-m}},I.prototype.normalize13b=function(l,h){for(var x=0,w=0;w<h/2;w++){var m=Math.round(l[2*w+1]/h)*8192+Math.round(l[2*w]/h)+x;l[w]=m&67108863,m<67108864?x=0:x=m/67108864|0}return l},I.prototype.convert13b=function(l,h,x,w){for(var m=0,v=0;v<h;v++)m=m+(l[v]|0),x[2*v]=m&8191,m=m>>>13,x[2*v+1]=m&8191,m=m>>>13;for(v=2*h;v<w;++v)x[v]=0;t(m===0),t((m&-8192)===0)},I.prototype.stub=function(l){for(var h=new Array(l),x=0;x<l;x++)h[x]=0;return h},I.prototype.mulp=function(l,h,x){var w=2*this.guessLen13b(l.length,h.length),m=this.makeRBT(w),v=this.stub(w),C=new Array(w),_=new Array(w),d=new Array(w),E=new Array(w),q=new Array(w),M=new Array(w),D=x.words;D.length=w,this.convert13b(l.words,l.length,C,w),this.convert13b(h.words,h.length,E,w),this.transform(C,v,_,d,w,m),this.transform(E,v,q,M,w,m);for(var $=0;$<w;$++){var K=_[$]*q[$]-d[$]*M[$];d[$]=_[$]*M[$]+d[$]*q[$],_[$]=K}return this.conjugate(_,d,w),this.transform(_,d,D,v,w,m),this.conjugate(D,v,w),this.normalize13b(D,w),x.negative=l.negative^h.negative,x.length=l.length+h.length,x.strip()},i.prototype.mul=function(l){var h=new i(null);return h.words=new Array(this.length+l.length),this.mulTo(l,h)},i.prototype.mulf=function(l){var h=new i(null);return h.words=new Array(this.length+l.length),R(this,l,h)},i.prototype.imul=function(l){return this.clone().mulTo(l,this)},i.prototype.imuln=function(l){t(typeof l=="number"),t(l<67108864);for(var h=0,x=0;x<this.length;x++){var w=(this.words[x]|0)*l,m=(w&67108863)+(h&67108863);h>>=26,h+=w/67108864|0,h+=m>>>26,this.words[x]=m&67108863}return h!==0&&(this.words[x]=h,this.length++),this.length=l===0?1:this.length,this},i.prototype.muln=function(l){return this.clone().imuln(l)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(l){var h=g(l);if(h.length===0)return new i(1);for(var x=this,w=0;w<h.length&&h[w]===0;w++,x=x.sqr());if(++w<h.length)for(var m=x.sqr();w<h.length;w++,m=m.sqr())h[w]!==0&&(x=x.mul(m));return x},i.prototype.iushln=function(l){t(typeof l=="number"&&l>=0);var h=l%26,x=(l-h)/26,w=67108863>>>26-h<<26-h,m;if(h!==0){var v=0;for(m=0;m<this.length;m++){var C=this.words[m]&w,_=(this.words[m]|0)-C<<h;this.words[m]=_|v,v=C>>>26-h}v&&(this.words[m]=v,this.length++)}if(x!==0){for(m=this.length-1;m>=0;m--)this.words[m+x]=this.words[m];for(m=0;m<x;m++)this.words[m]=0;this.length+=x}return this.strip()},i.prototype.ishln=function(l){return t(this.negative===0),this.iushln(l)},i.prototype.iushrn=function(l,h,x){t(typeof l=="number"&&l>=0);var w;h?w=(h-h%26)/26:w=0;var m=l%26,v=Math.min((l-m)/26,this.length),C=67108863^67108863>>>m<<m,_=x;if(w-=v,w=Math.max(0,w),_){for(var d=0;d<v;d++)_.words[d]=this.words[d];_.length=v}if(v!==0)if(this.length>v)for(this.length-=v,d=0;d<this.length;d++)this.words[d]=this.words[d+v];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-m|q>>>m,E=q&C}return _&&E!==0&&(_.words[_.length++]=E),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(l,h,x){return t(this.negative===0),this.iushrn(l,h,x)},i.prototype.shln=function(l){return this.clone().ishln(l)},i.prototype.ushln=function(l){return this.clone().iushln(l)},i.prototype.shrn=function(l){return this.clone().ishrn(l)},i.prototype.ushrn=function(l){return this.clone().iushrn(l)},i.prototype.testn=function(l){t(typeof l=="number"&&l>=0);var h=l%26,x=(l-h)/26,w=1<<h;if(this.length<=x)return!1;var m=this.words[x];return!!(m&w)},i.prototype.imaskn=function(l){t(typeof l=="number"&&l>=0);var h=l%26,x=(l-h)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=x)return this;if(h!==0&&x++,this.length=Math.min(x,this.length),h!==0){var w=67108863^67108863>>>h<<h;this.words[this.length-1]&=w}return this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.maskn=function(l){return this.clone().imaskn(l)},i.prototype.iaddn=function(l){return t(typeof l=="number"),t(l<67108864),l<0?this.isubn(-l):this.negative!==0?this.length===1&&(this.words[0]|0)<l?(this.words[0]=l-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(l),this.negative=1,this):this._iaddn(l)},i.prototype._iaddn=function(l){this.words[0]+=l;for(var h=0;h<this.length&&this.words[h]>=67108864;h++)this.words[h]-=67108864,h===this.length-1?this.words[h+1]=1:this.words[h+1]++;return this.length=Math.max(this.length,h+1),this},i.prototype.isubn=function(l){if(t(typeof l=="number"),t(l<67108864),l<0)return this.iaddn(-l);if(this.negative!==0)return this.negative=0,this.iaddn(l),this.negative=1,this;if(this.words[0]-=l,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var h=0;h<this.length&&this.words[h]<0;h++)this.words[h]+=67108864,this.words[h+1]-=1;return this.strip()},i.prototype.addn=function(l){return this.clone().iaddn(l)},i.prototype.subn=function(l){return this.clone().isubn(l)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(l,h,x){var w=l.length+x,m;this._expand(w);var v,C=0;for(m=0;m<l.length;m++){v=(this.words[m+x]|0)+C;var _=(l.words[m]|0)*h;v-=_&67108863,C=(v>>26)-(_/67108864|0),this.words[m+x]=v&67108863}for(;m<this.length-x;m++)v=(this.words[m+x]|0)+C,C=v>>26,this.words[m+x]=v&67108863;if(C===0)return this.strip();for(t(C===-1),C=0,m=0;m<this.length;m++)v=-(this.words[m]|0)+C,C=v>>26,this.words[m]=v&67108863;return this.negative=1,this.strip()},i.prototype._wordDiv=function(l,h){var x=this.length-l.length,w=this.clone(),m=l,v=m.words[m.length-1]|0,C=this._countBits(v);x=26-C,x!==0&&(m=m.ushln(x),w.iushln(x),v=m.words[m.length-1]|0);var _=w.length-m.length,d;if(h!=="mod"){d=new i(null),d.length=_+1,d.words=new Array(d.length);for(var E=0;E<d.length;E++)d.words[E]=0}var q=w.clone()._ishlnsubmul(m,1,_);q.negative===0&&(w=q,d&&(d.words[_]=1));for(var M=_-1;M>=0;M--){var D=(w.words[m.length+M]|0)*67108864+(w.words[m.length+M-1]|0);for(D=Math.min(D/v|0,67108863),w._ishlnsubmul(m,D,M);w.negative!==0;)D--,w.negative=0,w._ishlnsubmul(m,1,M),w.isZero()||(w.negative^=1);d&&(d.words[M]=D)}return d&&d.strip(),w.strip(),h!=="div"&&x!==0&&w.iushrn(x),{div:d||null,mod:w}},i.prototype.divmod=function(l,h,x){if(t(!l.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var w,m,v;return this.negative!==0&&l.negative===0?(v=this.neg().divmod(l,h),h!=="mod"&&(w=v.div.neg()),h!=="div"&&(m=v.mod.neg(),x&&m.negative!==0&&m.iadd(l)),{div:w,mod:m}):this.negative===0&&l.negative!==0?(v=this.divmod(l.neg(),h),h!=="mod"&&(w=v.div.neg()),{div:w,mod:v.mod}):(this.negative&l.negative)!==0?(v=this.neg().divmod(l.neg(),h),h!=="div"&&(m=v.mod.neg(),x&&m.negative!==0&&m.isub(l)),{div:v.div,mod:m}):l.length>this.length||this.cmp(l)<0?{div:new i(0),mod:this}:l.length===1?h==="div"?{div:this.divn(l.words[0]),mod:null}:h==="mod"?{div:null,mod:new i(this.modn(l.words[0]))}:{div:this.divn(l.words[0]),mod:new i(this.modn(l.words[0]))}:this._wordDiv(l,h)},i.prototype.div=function(l){return this.divmod(l,"div",!1).div},i.prototype.mod=function(l){return this.divmod(l,"mod",!1).mod},i.prototype.umod=function(l){return this.divmod(l,"mod",!0).mod},i.prototype.divRound=function(l){var h=this.divmod(l);if(h.mod.isZero())return h.div;var x=h.div.negative!==0?h.mod.isub(l):h.mod,w=l.ushrn(1),m=l.andln(1),v=x.cmp(w);return v<0||m===1&&v===0?h.div:h.div.negative!==0?h.div.isubn(1):h.div.iaddn(1)},i.prototype.modn=function(l){t(l<=67108863);for(var h=(1<<26)%l,x=0,w=this.length-1;w>=0;w--)x=(h*x+(this.words[w]|0))%l;return x},i.prototype.idivn=function(l){t(l<=67108863);for(var h=0,x=this.length-1;x>=0;x--){var w=(this.words[x]|0)+h*67108864;this.words[x]=w/l|0,h=w%l}return this.strip()},i.prototype.divn=function(l){return this.clone().idivn(l)},i.prototype.egcd=function(l){t(l.negative===0),t(!l.isZero());var h=this,x=l.clone();h.negative!==0?h=h.umod(l):h=h.clone();for(var w=new i(1),m=new i(0),v=new i(0),C=new i(1),_=0;h.isEven()&&x.isEven();)h.iushrn(1),x.iushrn(1),++_;for(var d=x.clone(),E=h.clone();!h.isZero();){for(var q=0,M=1;(h.words[0]&M)===0&&q<26;++q,M<<=1);if(q>0)for(h.iushrn(q);q-- >0;)(w.isOdd()||m.isOdd())&&(w.iadd(d),m.isub(E)),w.iushrn(1),m.iushrn(1);for(var D=0,$=1;(x.words[0]&$)===0&&D<26;++D,$<<=1);if(D>0)for(x.iushrn(D);D-- >0;)(v.isOdd()||C.isOdd())&&(v.iadd(d),C.isub(E)),v.iushrn(1),C.iushrn(1);h.cmp(x)>=0?(h.isub(x),w.isub(v),m.isub(C)):(x.isub(h),v.isub(w),C.isub(m))}return{a:v,b:C,gcd:x.iushln(_)}},i.prototype._invmp=function(l){t(l.negative===0),t(!l.isZero());var h=this,x=l.clone();h.negative!==0?h=h.umod(l):h=h.clone();for(var w=new i(1),m=new i(0),v=x.clone();h.cmpn(1)>0&&x.cmpn(1)>0;){for(var C=0,_=1;(h.words[0]&_)===0&&C<26;++C,_<<=1);if(C>0)for(h.iushrn(C);C-- >0;)w.isOdd()&&w.iadd(v),w.iushrn(1);for(var d=0,E=1;(x.words[0]&E)===0&&d<26;++d,E<<=1);if(d>0)for(x.iushrn(d);d-- >0;)m.isOdd()&&m.iadd(v),m.iushrn(1);h.cmp(x)>=0?(h.isub(x),w.isub(m)):(x.isub(h),m.isub(w))}var q;return h.cmpn(1)===0?q=w:q=m,q.cmpn(0)<0&&q.iadd(l),q},i.prototype.gcd=function(l){if(this.isZero())return l.abs();if(l.isZero())return this.abs();var h=this.clone(),x=l.clone();h.negative=0,x.negative=0;for(var w=0;h.isEven()&&x.isEven();w++)h.iushrn(1),x.iushrn(1);do{for(;h.isEven();)h.iushrn(1);for(;x.isEven();)x.iushrn(1);var m=h.cmp(x);if(m<0){var v=h;h=x,x=v}else if(m===0||x.cmpn(1)===0)break;h.isub(x)}while(!0);return x.iushln(w)},i.prototype.invm=function(l){return this.egcd(l).a.umod(l)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(l){return this.words[0]&l},i.prototype.bincn=function(l){t(typeof l=="number");var h=l%26,x=(l-h)/26,w=1<<h;if(this.length<=x)return this._expand(x+1),this.words[x]|=w,this;for(var m=w,v=x;m!==0&&v<this.length;v++){var C=this.words[v]|0;C+=m,m=C>>>26,C&=67108863,this.words[v]=C}return m!==0&&(this.words[v]=m,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(l){var h=l<0;if(this.negative!==0&&!h)return-1;if(this.negative===0&&h)return 1;this.strip();var x;if(this.length>1)x=1;else{h&&(l=-l),t(l<=67108863,"Number is too big");var w=this.words[0]|0;x=w===l?0:w<l?-1:1}return this.negative!==0?-x|0:x},i.prototype.cmp=function(l){if(this.negative!==0&&l.negative===0)return-1;if(this.negative===0&&l.negative!==0)return 1;var h=this.ucmp(l);return this.negative!==0?-h|0:h},i.prototype.ucmp=function(l){if(this.length>l.length)return 1;if(this.length<l.length)return-1;for(var h=0,x=this.length-1;x>=0;x--){var w=this.words[x]|0,m=l.words[x]|0;if(w!==m){w<m?h=-1:w>m&&(h=1);break}}return h},i.prototype.gtn=function(l){return this.cmpn(l)===1},i.prototype.gt=function(l){return this.cmp(l)===1},i.prototype.gten=function(l){return this.cmpn(l)>=0},i.prototype.gte=function(l){return this.cmp(l)>=0},i.prototype.ltn=function(l){return this.cmpn(l)===-1},i.prototype.lt=function(l){return this.cmp(l)===-1},i.prototype.lten=function(l){return this.cmpn(l)<=0},i.prototype.lte=function(l){return this.cmp(l)<=0},i.prototype.eqn=function(l){return this.cmpn(l)===0},i.prototype.eq=function(l){return this.cmp(l)===0},i.red=function(l){return new P(l)},i.prototype.toRed=function(l){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),l.convertTo(this)._forceRed(l)},i.prototype.fromRed=function(){return t(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(l){return this.red=l,this},i.prototype.forceRed=function(l){return t(!this.red,"Already a number in reduction context"),this._forceRed(l)},i.prototype.redAdd=function(l){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,l)},i.prototype.redIAdd=function(l){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,l)},i.prototype.redSub=function(l){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,l)},i.prototype.redISub=function(l){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,l)},i.prototype.redShl=function(l){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,l)},i.prototype.redMul=function(l){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.mul(this,l)},i.prototype.redIMul=function(l){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.imul(this,l)},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(l){return t(this.red&&!l.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,l)};var L={k256:null,p224:null,p192:null,p25519:null};function N(T,l){this.name=T,this.p=new i(l,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}N.prototype._tmp=function(){var l=new i(null);return l.words=new Array(Math.ceil(this.n/13)),l},N.prototype.ireduce=function(l){var h=l,x;do this.split(h,this.tmp),h=this.imulK(h),h=h.iadd(this.tmp),x=h.bitLength();while(x>this.n);var w=x<this.n?-1:h.ucmp(this.p);return w===0?(h.words[0]=0,h.length=1):w>0?h.isub(this.p):h.strip!==void 0?h.strip():h._strip(),h},N.prototype.split=function(l,h){l.iushrn(this.n,0,h)},N.prototype.imulK=function(l){return l.imul(this.k)};function H(){N.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(H,N),H.prototype.split=function(l,h){for(var x=4194303,w=Math.min(l.length,9),m=0;m<w;m++)h.words[m]=l.words[m];if(h.length=w,l.length<=9){l.words[0]=0,l.length=1;return}var v=l.words[9];for(h.words[h.length++]=v&x,m=10;m<l.length;m++){var C=l.words[m]|0;l.words[m-10]=(C&x)<<4|v>>>22,v=C}v>>>=22,l.words[m-10]=v,v===0&&l.length>10?l.length-=10:l.length-=9},H.prototype.imulK=function(l){l.words[l.length]=0,l.words[l.length+1]=0,l.length+=2;for(var h=0,x=0;x<l.length;x++){var w=l.words[x]|0;h+=w*977,l.words[x]=h&67108863,h=w*64+(h/67108864|0)}return l.words[l.length-1]===0&&(l.length--,l.words[l.length-1]===0&&l.length--),l};function W(){N.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(W,N);function U(){N.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(U,N);function G(){N.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(G,N),G.prototype.imulK=function(l){for(var h=0,x=0;x<l.length;x++){var w=(l.words[x]|0)*19+h,m=w&67108863;w>>>=26,l.words[x]=m,h=w}return h!==0&&(l.words[l.length++]=h),l},i._prime=function(l){if(L[l])return L[l];var h;if(l==="k256")h=new H;else if(l==="p224")h=new W;else if(l==="p192")h=new U;else if(l==="p25519")h=new G;else throw new Error("Unknown prime "+l);return L[l]=h,h};function P(T){if(typeof T=="string"){var l=i._prime(T);this.m=l.p,this.prime=l}else t(T.gtn(1),"modulus must be greater than 1"),this.m=T,this.prime=null}P.prototype._verify1=function(l){t(l.negative===0,"red works only with positives"),t(l.red,"red works only with red numbers")},P.prototype._verify2=function(l,h){t((l.negative|h.negative)===0,"red works only with positives"),t(l.red&&l.red===h.red,"red works only with red numbers")},P.prototype.imod=function(l){return this.prime?this.prime.ireduce(l)._forceRed(this):l.umod(this.m)._forceRed(this)},P.prototype.neg=function(l){return l.isZero()?l.clone():this.m.sub(l)._forceRed(this)},P.prototype.add=function(l,h){this._verify2(l,h);var x=l.add(h);return x.cmp(this.m)>=0&&x.isub(this.m),x._forceRed(this)},P.prototype.iadd=function(l,h){this._verify2(l,h);var x=l.iadd(h);return x.cmp(this.m)>=0&&x.isub(this.m),x},P.prototype.sub=function(l,h){this._verify2(l,h);var x=l.sub(h);return x.cmpn(0)<0&&x.iadd(this.m),x._forceRed(this)},P.prototype.isub=function(l,h){this._verify2(l,h);var x=l.isub(h);return x.cmpn(0)<0&&x.iadd(this.m),x},P.prototype.shl=function(l,h){return this._verify1(l),this.imod(l.ushln(h))},P.prototype.imul=function(l,h){return this._verify2(l,h),this.imod(l.imul(h))},P.prototype.mul=function(l,h){return this._verify2(l,h),this.imod(l.mul(h))},P.prototype.isqr=function(l){return this.imul(l,l.clone())},P.prototype.sqr=function(l){return this.mul(l,l)},P.prototype.sqrt=function(l){if(l.isZero())return l.clone();var h=this.m.andln(3);if(t(h%2===1),h===3){var x=this.m.add(new i(1)).iushrn(2);return this.pow(l,x)}for(var w=this.m.subn(1),m=0;!w.isZero()&&w.andln(1)===0;)m++,w.iushrn(1);t(!w.isZero());var v=new i(1).toRed(this),C=v.redNeg(),_=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new i(2*d*d).toRed(this);this.pow(d,_).cmp(C)!==0;)d.redIAdd(C);for(var E=this.pow(d,w),q=this.pow(l,w.addn(1).iushrn(1)),M=this.pow(l,w),D=m;M.cmp(v)!==0;){for(var $=M,K=0;$.cmp(v)!==0;K++)$=$.redSqr();t(K<D);var B=this.pow(E,new i(1).iushln(D-K-1));q=q.redMul(B),E=B.redSqr(),M=M.redMul(E),D=K}return q},P.prototype.invm=function(l){var h=l._invmp(this.m);return h.negative!==0?(h.negative=0,this.imod(h).redNeg()):this.imod(h)},P.prototype.pow=function(l,h){if(h.isZero())return new i(1).toRed(this);if(h.cmpn(1)===0)return l.clone();var x=4,w=new Array(1<<x);w[0]=new i(1).toRed(this),w[1]=l;for(var m=2;m<w.length;m++)w[m]=this.mul(w[m-1],l);var v=w[0],C=0,_=0,d=h.bitLength()%26;for(d===0&&(d=26),m=h.length-1;m>=0;m--){for(var E=h.words[m],q=d-1;q>=0;q--){var M=E>>q&1;if(v!==w[0]&&(v=this.sqr(v)),M===0&&C===0){_=0;continue}C<<=1,C|=M,_++,!(_!==x&&(m!==0||q!==0))&&(v=this.mul(v,w[C]),_=0,C=0)}d=26}return v},P.prototype.convertTo=function(l){var h=l.umod(this.m);return h===l?h.clone():h},P.prototype.convertFrom=function(l){var h=l.clone();return h.red=null,h},i.mont=function(l){return new F(l)};function F(T){P.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(F,P),F.prototype.convertTo=function(l){return this.imod(l.ushln(this.shift))},F.prototype.convertFrom=function(l){var h=this.imod(l.mul(this.rinv));return h.red=null,h},F.prototype.imul=function(l,h){if(l.isZero()||h.isZero())return l.words[0]=0,l.length=1,l;var x=l.imul(h),w=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),m=x.isub(w).iushrn(this.shift),v=m;return m.cmp(this.m)>=0?v=m.isub(this.m):m.cmpn(0)<0&&(v=m.iadd(this.m)),v._forceRed(this)},F.prototype.mul=function(l,h){if(l.isZero()||h.isZero())return new i(0)._forceRed(this);var x=l.mul(h),w=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),m=x.isub(w).iushrn(this.shift),v=m;return m.cmp(this.m)>=0?v=m.isub(this.m):m.cmpn(0)<0&&(v=m.iadd(this.m)),v._forceRed(this)},F.prototype.invm=function(l){var h=this.imod(l._invmp(this.m).mul(this.r2));return h._forceRed(this)}})(typeof hh>"u"||hh,IS)});var NS=O((P8,gh)=>{typeof Object.create=="function"?gh.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:gh.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 Hn=O((M8,xh)=>{try{if(vh=require("util"),typeof vh.inherits!="function")throw"";xh.exports=vh.inherits}catch{xh.exports=NS()}var vh});var Tl=O((I8,LS)=>{"use strict";var El=require("buffer"),ys=El.Buffer,lr={},ur;for(ur in El)El.hasOwnProperty(ur)&&(ur==="SlowBuffer"||ur==="Buffer"||(lr[ur]=El[ur]));var _s=lr.Buffer={};for(ur in ys)ys.hasOwnProperty(ur)&&(ur==="allocUnsafe"||ur==="allocUnsafeSlow"||(_s[ur]=ys[ur]));lr.Buffer.prototype=ys.prototype;(!_s.from||_s.from===Uint8Array.from)&&(_s.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 ys(r,e,t)});_s.alloc||(_s.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=ys(r);return!e||e.length===0?n.fill(0):typeof t=="string"?n.fill(e,t):n.fill(e),n});if(!lr.kStringMaxLength)try{lr.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}lr.constants||(lr.constants={MAX_LENGTH:lr.kMaxLength},lr.kStringMaxLength&&(lr.constants.MAX_STRING_LENGTH=lr.kStringMaxLength));LS.exports=lr});var Cl=O(DS=>{"use strict";var vB=Hn();function pr(r){this._reporterState={obj:null,path:[],options:r||{},errors:[]}}DS.Reporter=pr;pr.prototype.isError=function(e){return e instanceof bs};pr.prototype.save=function(){let e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}};pr.prototype.restore=function(e){let t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)};pr.prototype.enterKey=function(e){return this._reporterState.path.push(e)};pr.prototype.exitKey=function(e){let t=this._reporterState;t.path=t.path.slice(0,e-1)};pr.prototype.leaveKey=function(e,t,n){let i=this._reporterState;this.exitKey(e),i.obj!==null&&(i.obj[t]=n)};pr.prototype.path=function(){return this._reporterState.path.join("/")};pr.prototype.enterObject=function(){let e=this._reporterState,t=e.obj;return e.obj={},t};pr.prototype.leaveObject=function(e){let t=this._reporterState,n=t.obj;return t.obj=e,n};pr.prototype.error=function(e){let t,n=this._reporterState,i=e instanceof bs;if(i?t=e:t=new bs(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};pr.prototype.wrapResult=function(e){let t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e};function bs(r,e){this.path=r,this.rethrow(e)}vB(bs,Error);bs.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,bs),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}});var Es=O(yh=>{"use strict";var xB=Hn(),Al=Cl().Reporter,ws=Tl().Buffer;function fr(r,e){if(Al.call(this,e),!ws.isBuffer(r)){this.error("Input not Buffer");return}this.base=r,this.offset=0,this.length=r.length}xB(fr,Al);yh.DecoderBuffer=fr;fr.isDecoderBuffer=function(e){return e instanceof fr?!0:typeof e=="object"&&ws.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"};fr.prototype.save=function(){return{offset:this.offset,reporter:Al.prototype.save.call(this)}};fr.prototype.restore=function(e){let t=new fr(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,Al.prototype.restore.call(this,e.reporter),t};fr.prototype.isEmpty=function(){return this.offset===this.length};fr.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")};fr.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");let n=new fr(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+e,this.offset+=e,n};fr.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)};function Ss(r,e){if(Array.isArray(r))this.length=0,this.value=r.map(function(t){return Ss.isEncoderBuffer(t)||(t=new Ss(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=ws.byteLength(r);else if(ws.isBuffer(r))this.value=r,this.length=r.length;else return e.error("Unsupported type: "+typeof r)}yh.EncoderBuffer=Ss;Ss.isEncoderBuffer=function(e){return e instanceof Ss?!0:typeof e=="object"&&e.constructor.name==="EncoderBuffer"&&typeof e.length=="number"&&typeof e.join=="function"};Ss.prototype.join=function(e,t){return e||(e=ws.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):ws.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}});var FS=O((D8,jS)=>{jS.exports=BS;function BS(r,e){if(!r)throw new Error(e||"Assertion failed")}BS.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)}});var Rl=O((B8,$S)=>{"use strict";var yB=Cl().Reporter,_B=Es().EncoderBuffer,bB=Es().DecoderBuffer,kt=FS(),HS=["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"],wB=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(HS),SB=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function ue(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())}$S.exports=ue;var EB=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];ue.prototype.clone=function(){let e=this._baseState,t={};EB.forEach(function(i){t[i]=e[i]});let n=new this.constructor(t.parent);return n._baseState=t,n};ue.prototype._wrap=function(){let e=this._baseState;wB.forEach(function(t){this[t]=function(){let i=new this.constructor(this);return e.children.push(i),i[t].apply(i,arguments)}},this)};ue.prototype._init=function(e){let t=this._baseState;kt(t.parent===null),e.call(this),t.children=t.children.filter(function(n){return n._baseState.parent===this},this),kt.equal(t.children.length,1,"Root node can have only one child")};ue.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&&(kt(t.children===null),t.children=n,n.forEach(function(i){i._baseState.parent=this},this)),e.length!==0&&(kt(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}))};SB.forEach(function(r){ue.prototype[r]=function(){let t=this._baseState;throw new Error(r+" not implemented for encoding: "+t.enc)}});HS.forEach(function(r){ue.prototype[r]=function(){let t=this._baseState,n=Array.prototype.slice.call(arguments);return kt(t.tag===null),t.tag=r,this._useArgs(n),this}});ue.prototype.use=function(e){kt(e);let t=this._baseState;return kt(t.use===null),t.use=e,this};ue.prototype.optional=function(){let e=this._baseState;return e.optional=!0,this};ue.prototype.def=function(e){let t=this._baseState;return kt(t.default===null),t.default=e,t.optional=!0,this};ue.prototype.explicit=function(e){let t=this._baseState;return kt(t.explicit===null&&t.implicit===null),t.explicit=e,this};ue.prototype.implicit=function(e){let t=this._baseState;return kt(t.explicit===null&&t.implicit===null),t.implicit=e,this};ue.prototype.obj=function(){let e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,t.length!==0&&this._useArgs(t),this};ue.prototype.key=function(e){let t=this._baseState;return kt(t.key===null),t.key=e,this};ue.prototype.any=function(){let e=this._baseState;return e.any=!0,this};ue.prototype.choice=function(e){let t=this._baseState;return kt(t.choice===null),t.choice=e,this._useArgs(Object.keys(e).map(function(n){return e[n]})),this};ue.prototype.contains=function(e){let t=this._baseState;return kt(t.use===null),t.contains=e,this};ue.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 u=e.save();try{n.choice===null?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t),s=!0}catch{s=!1}e.restore(u)}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 u=this._decodeTag(e,n.explicit);if(e.isError(u))return u;e=u}let c=e.offset;if(n.use===null&&n.choice===null){let u;n.any&&(u=e.save());let p=this._decodeTag(e,n.implicit!==null?n.implicit:n.tag,n.any);if(e.isError(p))return p;n.any?i=e.raw(u):e=p}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(p){p._decode(e,t)}),n.contains&&(n.tag==="octstr"||n.tag==="bitstr")){let u=new bB(i);i=this._getUse(n.contains,e._reporterState.obj)._decode(u,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};ue.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)};ue.prototype._getUse=function(e,t){let n=this._baseState;return n.useDecoder=this._use(e,t),kt(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};ue.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 u=c._decode(e,t);if(e.isError(u))return!1;i={type:o,value:u},s=!0}catch{return e.restore(a),!1}return!0},this),s?i:e.error("Choice not matched")};ue.prototype._createEncoderBuffer=function(e){return new _B(e,this.reporter)};ue.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};ue.prototype._encodeValue=function(e,t,n){let i=this._baseState;if(i.parent===null)return i.children[0]._encode(e,t||new yB);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 u=t.enterKey(c._baseState.key);if(typeof e!="object")return t.error("Child expected, but input is not object");let p=c._encode(e[c._baseState.key],t,e);return t.leaveKey(u),p},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(u){let p=this._baseState;return this._getUse(p.args[0],e)._encode(u,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,u=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,u,o))}return i.explicit!==null&&(s=this._encodeComposite(i.explicit,!1,"context",s)),s};ue.prototype._encodeChoice=function(e,t){let n=this._baseState,i=n.choice[e.type];return i||kt(!1,e.type+" not found in "+JSON.stringify(Object.keys(n.choice))),i._encode(e.value,t)};ue.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)};ue.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)};ue.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}});var kl=O(pi=>{"use strict";function qS(r){let e={};return Object.keys(r).forEach(function(t){(t|0)==t&&(t=t|0);let n=r[t];e[n]=t}),e}pi.tagClass={0:"universal",1:"application",2:"context",3:"private"};pi.tagClassByName=qS(pi.tagClass);pi.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"};pi.tagByName=qS(pi.tag)});var bh=O((F8,GS)=>{"use strict";var TB=Hn(),gn=Tl().Buffer,US=Rl(),_h=kl();function WS(r){this.enc="der",this.name=r.name,this.entity=r,this.tree=new kr,this.tree._init(r.body)}GS.exports=WS;WS.prototype.encode=function(e,t){return this.tree._encode(e,t).join()};function kr(r){US.call(this,"der",r)}TB(kr,US);kr.prototype._encodeComposite=function(e,t,n,i){let s=CB(e,t,n,this.reporter);if(i.length<128){let c=gn.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=gn.alloc(2+o);a[0]=s,a[1]=128|o;for(let c=1+o,u=i.length;u>0;c--,u>>=8)a[c]=u&255;return this._createEncoderBuffer([a,i])};kr.prototype._encodeStr=function(e,t){if(t==="bitstr")return this._createEncoderBuffer([e.unused|0,e.data]);if(t==="bmpstr"){let n=gn.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")};kr.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=gn.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 dr(r){return r<10?"0"+r:r}kr.prototype._encodeTime=function(e,t){let n,i=new Date(e);return t==="gentime"?n=[dr(i.getUTCFullYear()),dr(i.getUTCMonth()+1),dr(i.getUTCDate()),dr(i.getUTCHours()),dr(i.getUTCMinutes()),dr(i.getUTCSeconds()),"Z"].join(""):t==="utctime"?n=[dr(i.getUTCFullYear()%100),dr(i.getUTCMonth()+1),dr(i.getUTCDate()),dr(i.getUTCHours()),dr(i.getUTCMinutes()),dr(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(n,"octstr")};kr.prototype._encodeNull=function(){return this._createEncoderBuffer("")};kr.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"&&!gn.isBuffer(e)){let s=e.toArray();!e.sign&&s[0]&128&&s.unshift(0),e=gn.from(s)}if(gn.isBuffer(e)){let s=e.length;e.length===0&&s++;let o=gn.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(gn.from(i))};kr.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)};kr.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getEncoder("der").tree};kr.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 CB(r,e,t,n){let i;if(r==="seqof"?r="seq":r==="setof"&&(r="set"),_h.tagByName.hasOwnProperty(r))i=_h.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|=_h.tagClassByName[t||"universal"]<<6,i)}});var KS=O((H8,zS)=>{"use strict";var AB=Hn(),wh=bh();function Sh(r){wh.call(this,r),this.enc="pem"}AB(Sh,wh);zS.exports=Sh;Sh.prototype.encode=function(e,t){let i=wh.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(`
|
|
90
|
-
`)}});var Eh=O(YS=>{"use strict";var VS=YS;VS.der=bh();VS.pem=KS()});var Ch=O((q8,tE)=>{"use strict";var RB=Hn(),kB=mh(),XS=Es().DecoderBuffer,QS=Rl(),JS=kl();function ZS(r){this.enc="der",this.name=r.name,this.entity=r,this.tree=new Kt,this.tree._init(r.body)}tE.exports=ZS;ZS.prototype.decode=function(e,t){return XS.isDecoderBuffer(e)||(e=new XS(e,t)),this.tree._decode(e,t)};function Kt(r){QS.call(this,"der",r)}RB(Kt,QS);Kt.prototype._peekTag=function(e,t,n){if(e.isEmpty())return!1;let i=e.save(),s=Th(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)};Kt.prototype._decodeTag=function(e,t,n){let i=Th(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+'"'))};Kt.prototype._skipUntilEnd=function(e,t){for(;;){let n=Th(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}};Kt.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};Kt.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")}};Kt.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,u=s[0]%40;if(n?i=s:i=[c,u].concat(s.slice(1)),t){let p=t[i.join(" ")];p===void 0&&(p=t[i.join(".")]),p!==void 0&&(i=p)}return i};Kt.prototype._decodeTime=function(e,t){let n=e.raw().toString(),i,s,o,a,c,u;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,u=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,u=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,u,0)};Kt.prototype._decodeNull=function(){return null};Kt.prototype._decodeBool=function(e){let t=e.readUInt8();return e.isError(t)?t:t!==0};Kt.prototype._decodeInt=function(e,t){let n=e.raw(),i=new kB(n);return t&&(i=t[i.toString(10)]||i),i};Kt.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getDecoder("der").tree};function Th(r,e){let t=r.readUInt8(e);if(r.isError(t))return t;let n=JS.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=JS.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 nE=O((U8,rE)=>{"use strict";var OB=Hn(),PB=Tl().Buffer,Ah=Ch();function Rh(r){Ah.call(this,r),this.enc="pem"}OB(Rh,Ah);rE.exports=Rh;Rh.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 p=0;p<n.length;p++){let f=n[p].match(s);if(f!==null&&f[2]===i)if(o===-1){if(f[1]!=="BEGIN")break;o=p}else{if(f[1]!=="END")break;a=p;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 u=PB.from(c,"base64");return Ah.prototype.decode.call(this,u,t)}});var kh=O(sE=>{"use strict";var iE=sE;iE.der=Ch();iE.pem=nE()});var aE=O(oE=>{"use strict";var MB=Eh(),IB=kh(),NB=Hn(),LB=oE;LB.define=function(e,t){return new Ts(e,t)};function Ts(r,e){this.name=r,this.body=e,this.decoders={},this.encoders={}}Ts.prototype._createNamed=function(e){let t=this.name;function n(i){this._initNamed(i,t)}return NB(n,e),n.prototype._initNamed=function(s,o){e.call(this,s,o)},new n(this)};Ts.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(IB[e])),this.decoders[e]};Ts.prototype.decode=function(e,t,n){return this._getDecoder(t).decode(e,n)};Ts.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(MB[e])),this.encoders[e]};Ts.prototype.encode=function(e,t,n){return this._getEncoder(t).encode(e,n)}});var lE=O(cE=>{"use strict";var Ol=cE;Ol.Reporter=Cl().Reporter;Ol.DecoderBuffer=Es().DecoderBuffer;Ol.EncoderBuffer=Es().EncoderBuffer;Ol.Node=Rl()});var fE=O(pE=>{"use strict";var uE=pE;uE._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};uE.der=kl()});var hE=O(dE=>{"use strict";var Cs=dE;Cs.bignum=mh();Cs.define=aE().define;Cs.base=lE();Cs.constants=fE();Cs.decoders=kh();Cs.encoders=Eh()});var As=O((Oh,gE)=>{var Pl=require("buffer"),Ur=Pl.Buffer;function mE(r,e){for(var t in r)e[t]=r[t]}Ur.from&&Ur.alloc&&Ur.allocUnsafe&&Ur.allocUnsafeSlow?gE.exports=Pl:(mE(Pl,Oh),Oh.Buffer=fi);function fi(r,e,t){return Ur(r,e,t)}fi.prototype=Object.create(Ur.prototype);mE(Ur,fi);fi.from=function(r,e,t){if(typeof r=="number")throw new TypeError("Argument must not be a number");return Ur(r,e,t)};fi.alloc=function(r,e,t){if(typeof r!="number")throw new TypeError("Argument must be a number");var n=Ur(r);return e!==void 0?typeof t=="string"?n.fill(e,t):n.fill(e):n.fill(0),n};fi.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return Ur(r)};fi.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return Pl.SlowBuffer(r)}});var Ph=O((Y8,vE)=>{var Ml=As().Buffer,DB=require("stream"),BB=require("util");function Il(r){if(this.buffer=null,this.writable=!0,this.readable=!0,!r)return this.buffer=Ml.alloc(0),this;if(typeof r.pipe=="function")return this.buffer=Ml.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+")")}BB.inherits(Il,DB);Il.prototype.write=function(e){this.buffer=Ml.concat([this.buffer,Ml.from(e)]),this.emit("data",e)};Il.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1};vE.exports=Il});var yE=O((X8,xE)=>{"use strict";function Mh(r){var e=(r/8|0)+(r%8===0?0:1);return e}var jB={ES256:Mh(256),ES384:Mh(384),ES512:Mh(521)};function FB(r){var e=jB[r];if(e)return e;throw new Error('Unknown algorithm "'+r+'"')}xE.exports=FB});var CE=O((J8,TE)=>{"use strict";var Nl=As().Buffer,bE=yE(),Ll=128,wE=0,HB=32,$B=16,qB=2,SE=$B|HB|wE<<6,Dl=qB|wE<<6;function UB(r){return r.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function EE(r){if(Nl.isBuffer(r))return r;if(typeof r=="string")return Nl.from(r,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function WB(r,e){r=EE(r);var t=bE(e),n=t+1,i=r.length,s=0;if(r[s++]!==SE)throw new Error('Could not find expected "seq"');var o=r[s++];if(o===(Ll|1)&&(o=r[s++]),i-s<o)throw new Error('"seq" specified length of "'+o+'", only "'+(i-s)+'" remaining');if(r[s++]!==Dl)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++]!==Dl)throw new Error('Could not find expected "int" for "s"');var u=r[s++];if(i-s!==u)throw new Error('"s" specified length of "'+u+'", expected "'+(i-s)+'"');if(n<u)throw new Error('"s" specified length of "'+u+'", max of "'+n+'" is acceptable');var p=s;if(s+=u,s!==i)throw new Error('Expected to consume entire buffer, but "'+(i-s)+'" bytes remain');var f=t-a,g=t-u,y=Nl.allocUnsafe(f+a+g+u);for(s=0;s<f;++s)y[s]=0;r.copy(y,s,c+Math.max(-f,0),c+a),s=t;for(var b=s;s<b+g;++s)y[s]=0;return r.copy(y,s,p+Math.max(-g,0),p+u),y=y.toString("base64"),y=UB(y),y}function _E(r,e,t){for(var n=0;e+n<t&&r[e+n]===0;)++n;var i=r[e+n]>=Ll;return i&&--n,n}function GB(r,e){r=EE(r);var t=bE(e),n=r.length;if(n!==t*2)throw new TypeError('"'+e+'" signatures must be "'+t*2+'" bytes, saw "'+n+'"');var i=_E(r,0,t),s=_E(r,t,r.length),o=t-i,a=t-s,c=2+o+1+1+a,u=c<Ll,p=Nl.allocUnsafe((u?2:3)+c),f=0;return p[f++]=SE,u?p[f++]=c:(p[f++]=Ll|1,p[f++]=c&255),p[f++]=Dl,p[f++]=o,i<0?(p[f++]=0,f+=r.copy(p,f,0,t)):f+=r.copy(p,f,i,t),p[f++]=Dl,p[f++]=a,s<0?(p[f++]=0,r.copy(p,f,t)):r.copy(p,f,t+s),p}TE.exports={derToJose:WB,joseToDer:GB}});var RE=O((Q8,AE)=>{"use strict";var Ho=require("buffer").Buffer,Ih=require("buffer").SlowBuffer;AE.exports=Bl;function Bl(r,e){if(!Ho.isBuffer(r)||!Ho.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}Bl.install=function(){Ho.prototype.equal=Ih.prototype.equal=function(e){return Bl(this,e)}};var zB=Ho.prototype.equal,KB=Ih.prototype.equal;Bl.restore=function(){Ho.prototype.equal=zB,Ih.prototype.equal=KB}});var Bh=O((Z8,BE)=>{var ks=As().Buffer,hr=require("crypto"),OE=CE(),kE=require("util"),VB=`"%s" is not a valid algorithm.
|
|
89
|
+
`),Al.add(e),r.on("close",()=>Al.delete(e))}function Kw(r,e){ee(e,{...dn,...Ar,desktopEnabled:jt,remoteAvailable:hh})}async function Vw(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(Gt(),ki)),n=await t(r,e);n&&(Hn(n),ee(e))}function Yw(r,e){ee(e),Hn({step:Oi.PREPARING,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null}),gl("restart-tunnel")}function Xw(r,e){ee(e),Hn({step:Oi.PREPARING,stepDesc:""}),gl("start-tunnel")}function Jw(r,e){ee(e),Hn({step:Oi.STOPPED,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null}),gl("shutdown")}function Qw(r,e){ee(e,{connections:[...pi.values()]})}function Zw(r,e){let t=new URL(r.url,"http://localhost"),n=parseInt(t.searchParams.get("lines")||yp,10);ee(e,{logs:Mv(Number.isFinite(n)?n:yp)})}async function eS(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(Gt(),ki)),n=await t(r,e);if(!n)return;let i=!!n.enabled;if(i&&(!Ar.screenRecording||!Ar.accessibility)){ee(e,{ok:!1,enabled:jt,reason:"permissions_required"});return}let s=xs();jt=i,dh(),St("permissions",{...Ar,desktopEnabled:jt}),xs()!==s&&mh?.(),ee(e,{ok:!0,enabled:jt})}function tS(r,e){ee(e,Ar)}async function rS(r,e){let t=await sh();ee(e,{enabled:t})}async function nS(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(Gt(),ki)),n=await t(r,e);if(!n)return;let i=await Aw(!!n.enabled),s=await sh();St("autostart",{enabled:s}),ee(e,{ok:i,enabled:s})}async function iS(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(Gt(),ki)),n=await t(r,e);if(!n)return;let{type:i}=n;if(process.platform==="darwin"){bw(i);let s=Date.now(),o=setInterval(async()=>{((await Rl())[i]||Date.now()-s>Tv)&&clearInterval(o)},Ev)}ee(e)}var Fn,Lw,fh,dn,jt,hh,Ar,Al,pi,mh,fi=Te(()=>{gt();Pi();gt();Mo();ww();Rw();Gt();el();gt();Fn=require("fs"),Lw=require("path");gt();oh();fh=(0,Lw.join)(oe.STATE,"ui-state.json");dn={step:Oi.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}},jt=!1,hh=!1,Ar={screenRecording:!1,accessibility:!1},Al=new Set,pi=new Map;Pv(xt);mh=null});var kl,sS=Te(()=>{bt();fi();kl=class{constructor(){this.cfg=Z.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=N=>(this.samples.reduce((H,W)=>H+W[N],0)/e).toFixed(1),n=(Date.now()-this.lastLogTime)/1e3,i=(e/n).toFixed(1),s=[],o=0;for(let N of this.samples){for(let H of N.tileBytes)s.push(H);o+=N.tileBytes.reduce((H,W)=>H+W,0)}let a=(o/e/1024).toFixed(1),c=s.length?(s.reduce((N,H)=>N+H,0)/s.length/1024).toFixed(2):"0",u=s.length?(Math.min(...s)/1024).toFixed(2):"0",p=s.length?(Math.max(...s)/1024).toFixed(2):"0",f=this.samples.reduce((N,H)=>N+H.rawBytes,0)/e,m=o/e,y=m>0?(f/m).toFixed(0):"0",_=(this.samples.reduce((N,H)=>N+H.changedTiles,0)/e).toFixed(0),S=this.samples[0]?.totalTiles||0,A=S?(_/S*100).toFixed(1):"0",P=Z.pipeline,L=`[Metrics] ${P.captureLib}+${P.encoder} tile=${P.tileSize} q${P.jpegQuality} scale=${P.outputScale} | fps=${i} | capture=${t("capture")}ms enc=${t("encode")}ms total=${t("total")}ms | tiles=${_}/${S} (${A}%) | data=${a}KB/frame | tileAvg=${c}KB (min ${u}, max ${p}) | compress=${y}x`;xt(L),console.log(L),this.samples=[],this.lastLogTime=Date.now()}}});var cS={};Xr(cS,{TileManager:()=>gh});var ys,Pl,oS,Ol,aS,IB,NB,gh,lS=Te(()=>{ys=X(require("fs"),1),Pl=X(require("path"),1),oS=X(require("sharp"),1),Ol=require("child_process"),aS=require("url");bt();hw();gw();sS();Fd();IB=(0,aS.fileURLToPath)(__importMetaUrl),NB=Pl.default.dirname(IB),gh=class{constructor(e){this.robot=e,this.metrics=new kl,this.tileSize=Z.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=Pl.default.join(NB,"../../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=Z.pipeline.outputScale||1,this.compressionQuality=Z.pipeline.jpegQuality,this.activeTileSet=null,this.focusStats={frames:0,scanned:0,changed:0,bytes:0},ys.default.existsSync(this.tempDir)||ys.default.mkdirSync(this.tempDir,{recursive:!0}),fw(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,Ol.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,Ol.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,Ol.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 dw();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)}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.getSharedScreenCapture();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 m=this.calculateTileChecksumDirect(i,f);a.set(f,m)}n=this.metrics.now();let u=Array.from(a.values());if(this.lastTileChecksums.size===0){let f=[];for(let y=0;y<this.totalTiles;y++)c&&!c.has(y)||(this.lastTileChecksums.set(y,a.get(y)),f.push(this.processTileAsync(i,y)));let m=await Promise.all(f);return s.push(...m),this._recordFrame(e,t,n,s,i),{tiles:s,currentHashes:u}}for(let f=0;f<this.totalTiles;f++){if(c&&!c.has(f))continue;let m=a.get(f),y=this.lastTileChecksums.get(f);m!==y&&(o.push(f),this.lastTileChecksums.set(f,m))}if(o.length/this.totalTiles>this.changeThreshold){let f=[];for(let y=0;y<this.totalTiles;y++)c&&!c.has(y)||f.push(this.processTileAsync(i,y));let m=await Promise.all(f);s.push(...m.map(y=>({...y,fullRefresh:!0})))}else if(o.length>0){let f=o.map(y=>this.processTileAsync(i,y)),m=await Promise.all(f);s.push(...m)}return this._recordFrame(e,t,n,s,i),{tiles:s,currentHashes:u}}finally{this.isProcessing=!1}}async processTileAsync(e,t,n=null){let i=n||this.extractTile(e,t),s=await this.compressTileImage(i.buffer,i.width,i.height),{row:o,col:a}=this.getTilePosition(t);return{type:"tile-update",tileIndex:t,x:a*this.tileSize,y:o*this.tileSize,width:i.width,height:i.height,imageBuffer:s,hash:this.lastTileChecksums.get(t)??0,timestamp:Date.now(),frameCount:this.frameCount}}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),u=a-s,p=c-o,f=e.channels,m=e.width*f,y=0,_=16;for(let S=0;S<p;S+=4){let A=(S>>2&1)*8,P=(o+S)*m+s*f;for(let L=A;L<u;L+=_){let N=P+L*f;y+=e.buffer[N],y^=e.buffer[N+1],y+=e.buffer[N+2]<<1,y^=e.buffer[N+3]<<2}}return y>>>0}setFocusRect(e){if(!e){this.activeTileSet=null;return}let t=Z.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 u=i;u<=o;u++)for(let p=n;p<=s;p++)a.add(u*this.tilesPerRow+p);let c=this.activeTileSet;if(c)for(let u of a)c.has(u)||this.lastTileChecksums.delete(u);this.activeTileSet=a}getTilePosition(e){return{row:Math.floor(e/this.tilesPerRow),col:e%this.tilesPerRow}}extractTile(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),u=a-s,p=c-o,f=e.channels,m=u*f,y=Buffer.alloc(u*p*f);for(let _=0;_<p;_++){let S=((o+_)*e.width+s)*f,A=_*m;e.buffer.copy(y,A,S,S+m)}return{buffer:y,width:u,height:p,channels:f,tileIndex:t,x:s,y:o}}async compressTileImage(e,t,n){let i=this.scaleFactor;if(i&&i>0&&i<1){let s=Math.max(1,Math.floor(t*i)),o=Math.max(1,Math.floor(n*i)),{inputFormat:a}=Z.pipeline,c=e,u=4;a==="bgra"&&(c=Buffer.from(e),Qd(c));let p=await(0,oS.default)(c,{raw:{width:t,height:n,channels:u}}).resize(s,o,{kernel:"lanczos3",fastShrinkOnLoad:!1}).raw().toBuffer();return Zd(p,s,o,4,this.compressionQuality,"rgba")}return Zd(e,t,n,4,this.compressionQuality)}pickProfile({zoom:e=1,viewerWidth:t=0,dpr:n=1}={}){let i=Z.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,u=o*a*c/s,p=Z.pipeline.tierHysteresis||0,f=this._currentTier;for(let y of i){let _=f&&y===f?y.minEffective-p:y.minEffective;if(u>=_)return this._currentTier=y,y}let m=i[i.length-1];return this._currentTier=m,m}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(u=>u.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<Z.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 u=this.calculateTileChecksumDirect(t,c);o.set(c,u),this.lastTileChecksums.set(c,u)}if(!e||e.length===0){let c=[];for(let p=0;p<this.totalTiles;p++)s&&!s.has(p)||c.push(this.processTileAsync(t,p));let u=await Promise.all(c);return n.push(...u),{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 p=0;p<this.totalTiles;p++)s&&!s.has(p)||c.push(this.processTileAsync(t,p));let u=await Promise.all(c);n.push(...u.map(p=>({...p,fullRefresh:!0})))}else if(i.length>0){let c=i.map(p=>this.processTileAsync(t,p)),u=await Promise.all(c);n.push(...u)}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()}reset(){this.lastTileChecksums.clear(),this.frameCount=0}cleanup(){try{ys.default.existsSync(this.tempDir)&&ys.default.readdirSync(this.tempDir).forEach(t=>ys.default.unlinkSync(Pl.default.join(this.tempDir,t)))}catch(e){ve.warn(`Cleanup error: ${e.message}`)}}}});var uS={};Xr(uS,{ResourceManager:()=>vh});var vh,pS=Te(()=>{bt();vh=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>Z.resourceManagement.memoryWarningThreshold&&(console.warn(`\u26A0\uFE0F High memory: ${t}MB`),this.cleanupInactiveClients())},Z.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=Z.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())}catch(n){console.error(`Error cleaning up ${e}:`,n.message)}}getStreamingConfig(){return Z.streaming}getWebRTCConfig(){return Z.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 fS={};Xr(fS,{ScreenUpdateHelper:()=>xh});var xh,dS=Te(()=>{bt();xh=class{constructor(e){this.resourceManager=e}async sendTilesInChunks(e,t,n,i=!1){if(!t||t.length===0)return;let s=Z.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 u=o[c],p=c===o.length-1,f=setTimeout(()=>{a.delete(f),e.connected&&e.emit("tiles-data",{tiles:u,timestamp:n,forceRefresh:!1,userAction:i,chunkInfo:{chunkIndex:c,totalChunks:o.length,isLastChunk:p}})},c*Z.streaming.chunkDelay);a.add(f)}}}});var hS={};Xr(hS,{MouseHandler:()=>yh});var yh,mS=Te(()=>{bt();yh=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<Z.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),u=Math.max(0,Math.min(o.width-1,a)),p=Math.max(0,Math.min(o.height-1,c));n.moveMouse(u,p),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),u=Math.max(0,Math.min(o.width-1,a)),p=Math.max(0,Math.min(o.height-1,c));n.moveMouse(u,p),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),u=Math.max(0,Math.min(o.width-1,a)),p=Math.max(0,Math.min(o.height-1,c));n.moveMouse(u,p),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),u=Math.max(0,Math.min(o.width-1,a)),p=Math.max(0,Math.min(o.height-1,c));n.moveMouse(u,p),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 u=0,p=0;a||s==="left"||s==="right"?u=s==="right"?o:-o:p=s==="down"?-o:o,n.scrollMouse(u,p),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,u=n.getScreenSize(),p=Math.round(s/100*u.width),f=Math.round(o/100*u.height),m=Math.round(a/100*u.width),y=Math.round(c/100*u.height),_=Math.max(0,Math.min(u.width-1,p)),S=Math.max(0,Math.min(u.height-1,f)),A=Math.max(0,Math.min(u.width-1,m)),P=Math.max(0,Math.min(u.height-1,y));n.moveMouse(_,S),n.mouseToggle("down","left"),n.dragMouse(A,P),n.mouseToggle("up","left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Drag selection error:",s.message)}}))}}});var vS={};Xr(vS,{KeyboardHandler:()=>_h});function LB(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,gS.execFile)("osascript",["-e",e],t=>{t&&console.error("osascript error:",t.message)})}var gS,_h,xS=Te(()=>{gS=require("child_process");bt();_h=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<Z.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){n.keyTap(a,c);for(let u of c)n.keyToggle(u,"up")}else{let p={return:"enter"}[a.toLowerCase()]??a.toLowerCase();n.keyTap(p,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=Z.desktopSwitch[process.platform]?.[s];if(!o)return;process.platform==="darwin"?LB(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<Z.throttling.typeTextThrottle)){this.lastTypeText=s;try{if(!i.text||typeof i.text!="string")return;let o=i.text;o.length>Z.throttling.maxTextLength&&(o=o.substring(0,Z.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(u){console.error("Robot typeString error:",u.message)}},10)}catch(o){console.error("Type text error:",o.message)}}}))}}});var kh=O((XS,Rh)=>{(function(r,e){"use strict";function t(T,l){if(!T)throw new Error(l||"Assertion failed")}function n(T,l){T.super_=l;var h=function(){};h.prototype=l.prototype,T.prototype=new h,T.prototype.constructor=T}function i(T,l,h){if(i.isBN(T))return T;this.negative=0,this.words=null,this.length=0,this.red=null,T!==null&&((l==="le"||l==="be")&&(h=l,l=10),this._init(T||0,l||10,h||"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(l){return l instanceof i?!0:l!==null&&typeof l=="object"&&l.constructor.wordSize===i.wordSize&&Array.isArray(l.words)},i.max=function(l,h){return l.cmp(h)>0?l:h},i.min=function(l,h){return l.cmp(h)<0?l:h},i.prototype._init=function(l,h,x){if(typeof l=="number")return this._initNumber(l,h,x);if(typeof l=="object")return this._initArray(l,h,x);h==="hex"&&(h=16),t(h===(h|0)&&h>=2&&h<=36),l=l.toString().replace(/\s+/g,"");var w=0;l[0]==="-"&&(w++,this.negative=1),w<l.length&&(h===16?this._parseHex(l,w,x):(this._parseBase(l,h,w),x==="le"&&this._initArray(this.toArray(),h,x)))},i.prototype._initNumber=function(l,h,x){l<0&&(this.negative=1,l=-l),l<67108864?(this.words=[l&67108863],this.length=1):l<4503599627370496?(this.words=[l&67108863,l/67108864&67108863],this.length=2):(t(l<9007199254740992),this.words=[l&67108863,l/67108864&67108863,1],this.length=3),x==="le"&&this._initArray(this.toArray(),h,x)},i.prototype._initArray=function(l,h,x){if(t(typeof l.length=="number"),l.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(l.length/3),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var g,v,C=0;if(x==="be")for(w=l.length-1,g=0;w>=0;w-=3)v=l[w]|l[w-1]<<8|l[w-2]<<16,this.words[g]|=v<<C&67108863,this.words[g+1]=v>>>26-C&67108863,C+=24,C>=26&&(C-=26,g++);else if(x==="le")for(w=0,g=0;w<l.length;w+=3)v=l[w]|l[w+1]<<8|l[w+2]<<16,this.words[g]|=v<<C&67108863,this.words[g+1]=v>>>26-C&67108863,C+=24,C>=26&&(C-=26,g++);return this.strip()};function o(T,l){var h=T.charCodeAt(l);return h>=65&&h<=70?h-55:h>=97&&h<=102?h-87:h-48&15}function a(T,l,h){var x=o(T,h);return h-1>=l&&(x|=o(T,h-1)<<4),x}i.prototype._parseHex=function(l,h,x){this.length=Math.ceil((l.length-h)/6),this.words=new Array(this.length);for(var w=0;w<this.length;w++)this.words[w]=0;var g=0,v=0,C;if(x==="be")for(w=l.length-1;w>=h;w-=2)C=a(l,h,w)<<g,this.words[v]|=C&67108863,g>=18?(g-=18,v+=1,this.words[v]|=C>>>26):g+=8;else{var b=l.length-h;for(w=b%2===0?h+1:h;w<l.length;w+=2)C=a(l,h,w)<<g,this.words[v]|=C&67108863,g>=18?(g-=18,v+=1,this.words[v]|=C>>>26):g+=8}this.strip()};function c(T,l,h,x){for(var w=0,g=Math.min(T.length,h),v=l;v<g;v++){var C=T.charCodeAt(v)-48;w*=x,C>=49?w+=C-49+10:C>=17?w+=C-17+10:w+=C}return w}i.prototype._parseBase=function(l,h,x){this.words=[0],this.length=1;for(var w=0,g=1;g<=67108863;g*=h)w++;w--,g=g/h|0;for(var v=l.length-x,C=v%w,b=Math.min(v,v-C)+x,d=0,E=x;E<b;E+=w)d=c(l,E,E+w,h),this.imuln(g),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(C!==0){var q=1;for(d=c(l,E,l.length,h),E=0;E<C;E++)q*=h;this.imuln(q),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}this.strip()},i.prototype.copy=function(l){l.words=new Array(this.length);for(var h=0;h<this.length;h++)l.words[h]=this.words[h];l.length=this.length,l.negative=this.negative,l.red=this.red},i.prototype.clone=function(){var l=new i(null);return this.copy(l),l},i.prototype._expand=function(l){for(;this.length<l;)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 u=["","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"],p=[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(l,h){l=l||10,h=h|0||1;var x;if(l===16||l==="hex"){x="";for(var w=0,g=0,v=0;v<this.length;v++){var C=this.words[v],b=((C<<w|g)&16777215).toString(16);g=C>>>24-w&16777215,w+=2,w>=26&&(w-=26,v--),g!==0||v!==this.length-1?x=u[6-b.length]+b+x:x=b+x}for(g!==0&&(x=g.toString(16)+x);x.length%h!==0;)x="0"+x;return this.negative!==0&&(x="-"+x),x}if(l===(l|0)&&l>=2&&l<=36){var d=p[l],E=f[l];x="";var q=this.clone();for(q.negative=0;!q.isZero();){var I=q.modn(E).toString(l);q=q.idivn(E),q.isZero()?x=I+x:x=u[d-I.length]+I+x}for(this.isZero()&&(x="0"+x);x.length%h!==0;)x="0"+x;return this.negative!==0&&(x="-"+x),x}t(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var l=this.words[0];return this.length===2?l+=this.words[1]*67108864:this.length===3&&this.words[2]===1?l+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-l:l},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(l,h){return t(typeof s<"u"),this.toArrayLike(s,l,h)},i.prototype.toArray=function(l,h){return this.toArrayLike(Array,l,h)},i.prototype.toArrayLike=function(l,h,x){var w=this.byteLength(),g=x||Math.max(1,w);t(w<=g,"byte array longer than desired length"),t(g>0,"Requested array length <= 0"),this.strip();var v=h==="le",C=new l(g),b,d,E=this.clone();if(v){for(d=0;!E.isZero();d++)b=E.andln(255),E.iushrn(8),C[d]=b;for(;d<g;d++)C[d]=0}else{for(d=0;d<g-w;d++)C[d]=0;for(d=0;!E.isZero();d++)b=E.andln(255),E.iushrn(8),C[g-d-1]=b}return C},Math.clz32?i.prototype._countBits=function(l){return 32-Math.clz32(l)}:i.prototype._countBits=function(l){var h=l,x=0;return h>=4096&&(x+=13,h>>>=13),h>=64&&(x+=7,h>>>=7),h>=8&&(x+=4,h>>>=4),h>=2&&(x+=2,h>>>=2),x+h},i.prototype._zeroBits=function(l){if(l===0)return 26;var h=l,x=0;return(h&8191)===0&&(x+=13,h>>>=13),(h&127)===0&&(x+=7,h>>>=7),(h&15)===0&&(x+=4,h>>>=4),(h&3)===0&&(x+=2,h>>>=2),(h&1)===0&&x++,x},i.prototype.bitLength=function(){var l=this.words[this.length-1],h=this._countBits(l);return(this.length-1)*26+h};function m(T){for(var l=new Array(T.bitLength()),h=0;h<l.length;h++){var x=h/26|0,w=h%26;l[h]=(T.words[x]&1<<w)>>>w}return l}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var l=0,h=0;h<this.length;h++){var x=this._zeroBits(this.words[h]);if(l+=x,x!==26)break}return l},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(l){return this.negative!==0?this.abs().inotn(l).iaddn(1):this.clone()},i.prototype.fromTwos=function(l){return this.testn(l-1)?this.notn(l).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(l){for(;this.length<l.length;)this.words[this.length++]=0;for(var h=0;h<l.length;h++)this.words[h]=this.words[h]|l.words[h];return this.strip()},i.prototype.ior=function(l){return t((this.negative|l.negative)===0),this.iuor(l)},i.prototype.or=function(l){return this.length>l.length?this.clone().ior(l):l.clone().ior(this)},i.prototype.uor=function(l){return this.length>l.length?this.clone().iuor(l):l.clone().iuor(this)},i.prototype.iuand=function(l){var h;this.length>l.length?h=l:h=this;for(var x=0;x<h.length;x++)this.words[x]=this.words[x]&l.words[x];return this.length=h.length,this.strip()},i.prototype.iand=function(l){return t((this.negative|l.negative)===0),this.iuand(l)},i.prototype.and=function(l){return this.length>l.length?this.clone().iand(l):l.clone().iand(this)},i.prototype.uand=function(l){return this.length>l.length?this.clone().iuand(l):l.clone().iuand(this)},i.prototype.iuxor=function(l){var h,x;this.length>l.length?(h=this,x=l):(h=l,x=this);for(var w=0;w<x.length;w++)this.words[w]=h.words[w]^x.words[w];if(this!==h)for(;w<h.length;w++)this.words[w]=h.words[w];return this.length=h.length,this.strip()},i.prototype.ixor=function(l){return t((this.negative|l.negative)===0),this.iuxor(l)},i.prototype.xor=function(l){return this.length>l.length?this.clone().ixor(l):l.clone().ixor(this)},i.prototype.uxor=function(l){return this.length>l.length?this.clone().iuxor(l):l.clone().iuxor(this)},i.prototype.inotn=function(l){t(typeof l=="number"&&l>=0);var h=Math.ceil(l/26)|0,x=l%26;this._expand(h),x>0&&h--;for(var w=0;w<h;w++)this.words[w]=~this.words[w]&67108863;return x>0&&(this.words[w]=~this.words[w]&67108863>>26-x),this.strip()},i.prototype.notn=function(l){return this.clone().inotn(l)},i.prototype.setn=function(l,h){t(typeof l=="number"&&l>=0);var x=l/26|0,w=l%26;return this._expand(x+1),h?this.words[x]=this.words[x]|1<<w:this.words[x]=this.words[x]&~(1<<w),this.strip()},i.prototype.iadd=function(l){var h;if(this.negative!==0&&l.negative===0)return this.negative=0,h=this.isub(l),this.negative^=1,this._normSign();if(this.negative===0&&l.negative!==0)return l.negative=0,h=this.isub(l),l.negative=1,h._normSign();var x,w;this.length>l.length?(x=this,w=l):(x=l,w=this);for(var g=0,v=0;v<w.length;v++)h=(x.words[v]|0)+(w.words[v]|0)+g,this.words[v]=h&67108863,g=h>>>26;for(;g!==0&&v<x.length;v++)h=(x.words[v]|0)+g,this.words[v]=h&67108863,g=h>>>26;if(this.length=x.length,g!==0)this.words[this.length]=g,this.length++;else if(x!==this)for(;v<x.length;v++)this.words[v]=x.words[v];return this},i.prototype.add=function(l){var h;return l.negative!==0&&this.negative===0?(l.negative=0,h=this.sub(l),l.negative^=1,h):l.negative===0&&this.negative!==0?(this.negative=0,h=l.sub(this),this.negative=1,h):this.length>l.length?this.clone().iadd(l):l.clone().iadd(this)},i.prototype.isub=function(l){if(l.negative!==0){l.negative=0;var h=this.iadd(l);return l.negative=1,h._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(l),this.negative=1,this._normSign();var x=this.cmp(l);if(x===0)return this.negative=0,this.length=1,this.words[0]=0,this;var w,g;x>0?(w=this,g=l):(w=l,g=this);for(var v=0,C=0;C<g.length;C++)h=(w.words[C]|0)-(g.words[C]|0)+v,v=h>>26,this.words[C]=h&67108863;for(;v!==0&&C<w.length;C++)h=(w.words[C]|0)+v,v=h>>26,this.words[C]=h&67108863;if(v===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(l){return this.clone().isub(l)};function y(T,l,h){h.negative=l.negative^T.negative;var x=T.length+l.length|0;h.length=x,x=x-1|0;var w=T.words[0]|0,g=l.words[0]|0,v=w*g,C=v&67108863,b=v/67108864|0;h.words[0]=C;for(var d=1;d<x;d++){for(var E=b>>>26,q=b&67108863,I=Math.min(d,l.length-1),D=Math.max(0,d-T.length+1);D<=I;D++){var $=d-D|0;w=T.words[$]|0,g=l.words[D]|0,v=w*g+q,E+=v/67108864|0,q=v&67108863}h.words[d]=q|0,b=E|0}return b!==0?h.words[d]=b|0:h.length--,h.strip()}var _=function(l,h,x){var w=l.words,g=h.words,v=x.words,C=0,b,d,E,q=w[0]|0,I=q&8191,D=q>>>13,$=w[1]|0,K=$&8191,B=$>>>13,me=w[2]|0,ie=me&8191,R=me>>>13,Y=w[3]|0,k=Y&8191,j=Y>>>13,J=w[4]|0,V=J&8191,z=J>>>13,ge=w[5]|0,re=ge&8191,Pe=ge>>>13,zg=w[6]|0,Me=zg&8191,Ie=zg>>>13,Kg=w[7]|0,Ne=Kg&8191,Le=Kg>>>13,Vg=w[8]|0,De=Vg&8191,Be=Vg>>>13,Yg=w[9]|0,je=Yg&8191,Fe=Yg>>>13,Xg=g[0]|0,He=Xg&8191,$e=Xg>>>13,Jg=g[1]|0,qe=Jg&8191,Ue=Jg>>>13,Qg=g[2]|0,We=Qg&8191,Ge=Qg>>>13,Zg=g[3]|0,ze=Zg&8191,Ke=Zg>>>13,ev=g[4]|0,Ve=ev&8191,Ye=ev>>>13,tv=g[5]|0,Xe=tv&8191,Je=tv>>>13,rv=g[6]|0,Qe=rv&8191,Ze=rv>>>13,nv=g[7]|0,et=nv&8191,tt=nv>>>13,iv=g[8]|0,rt=iv&8191,nt=iv>>>13,sv=g[9]|0,it=sv&8191,st=sv>>>13;x.negative=l.negative^h.negative,x.length=19,b=Math.imul(I,He),d=Math.imul(I,$e),d=d+Math.imul(D,He)|0,E=Math.imul(D,$e);var Vu=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Vu>>>26)|0,Vu&=67108863,b=Math.imul(K,He),d=Math.imul(K,$e),d=d+Math.imul(B,He)|0,E=Math.imul(B,$e),b=b+Math.imul(I,qe)|0,d=d+Math.imul(I,Ue)|0,d=d+Math.imul(D,qe)|0,E=E+Math.imul(D,Ue)|0;var Yu=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Yu>>>26)|0,Yu&=67108863,b=Math.imul(ie,He),d=Math.imul(ie,$e),d=d+Math.imul(R,He)|0,E=Math.imul(R,$e),b=b+Math.imul(K,qe)|0,d=d+Math.imul(K,Ue)|0,d=d+Math.imul(B,qe)|0,E=E+Math.imul(B,Ue)|0,b=b+Math.imul(I,We)|0,d=d+Math.imul(I,Ge)|0,d=d+Math.imul(D,We)|0,E=E+Math.imul(D,Ge)|0;var Xu=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Xu>>>26)|0,Xu&=67108863,b=Math.imul(k,He),d=Math.imul(k,$e),d=d+Math.imul(j,He)|0,E=Math.imul(j,$e),b=b+Math.imul(ie,qe)|0,d=d+Math.imul(ie,Ue)|0,d=d+Math.imul(R,qe)|0,E=E+Math.imul(R,Ue)|0,b=b+Math.imul(K,We)|0,d=d+Math.imul(K,Ge)|0,d=d+Math.imul(B,We)|0,E=E+Math.imul(B,Ge)|0,b=b+Math.imul(I,ze)|0,d=d+Math.imul(I,Ke)|0,d=d+Math.imul(D,ze)|0,E=E+Math.imul(D,Ke)|0;var Ju=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Ju>>>26)|0,Ju&=67108863,b=Math.imul(V,He),d=Math.imul(V,$e),d=d+Math.imul(z,He)|0,E=Math.imul(z,$e),b=b+Math.imul(k,qe)|0,d=d+Math.imul(k,Ue)|0,d=d+Math.imul(j,qe)|0,E=E+Math.imul(j,Ue)|0,b=b+Math.imul(ie,We)|0,d=d+Math.imul(ie,Ge)|0,d=d+Math.imul(R,We)|0,E=E+Math.imul(R,Ge)|0,b=b+Math.imul(K,ze)|0,d=d+Math.imul(K,Ke)|0,d=d+Math.imul(B,ze)|0,E=E+Math.imul(B,Ke)|0,b=b+Math.imul(I,Ve)|0,d=d+Math.imul(I,Ye)|0,d=d+Math.imul(D,Ve)|0,E=E+Math.imul(D,Ye)|0;var Qu=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Qu>>>26)|0,Qu&=67108863,b=Math.imul(re,He),d=Math.imul(re,$e),d=d+Math.imul(Pe,He)|0,E=Math.imul(Pe,$e),b=b+Math.imul(V,qe)|0,d=d+Math.imul(V,Ue)|0,d=d+Math.imul(z,qe)|0,E=E+Math.imul(z,Ue)|0,b=b+Math.imul(k,We)|0,d=d+Math.imul(k,Ge)|0,d=d+Math.imul(j,We)|0,E=E+Math.imul(j,Ge)|0,b=b+Math.imul(ie,ze)|0,d=d+Math.imul(ie,Ke)|0,d=d+Math.imul(R,ze)|0,E=E+Math.imul(R,Ke)|0,b=b+Math.imul(K,Ve)|0,d=d+Math.imul(K,Ye)|0,d=d+Math.imul(B,Ve)|0,E=E+Math.imul(B,Ye)|0,b=b+Math.imul(I,Xe)|0,d=d+Math.imul(I,Je)|0,d=d+Math.imul(D,Xe)|0,E=E+Math.imul(D,Je)|0;var Zu=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(Zu>>>26)|0,Zu&=67108863,b=Math.imul(Me,He),d=Math.imul(Me,$e),d=d+Math.imul(Ie,He)|0,E=Math.imul(Ie,$e),b=b+Math.imul(re,qe)|0,d=d+Math.imul(re,Ue)|0,d=d+Math.imul(Pe,qe)|0,E=E+Math.imul(Pe,Ue)|0,b=b+Math.imul(V,We)|0,d=d+Math.imul(V,Ge)|0,d=d+Math.imul(z,We)|0,E=E+Math.imul(z,Ge)|0,b=b+Math.imul(k,ze)|0,d=d+Math.imul(k,Ke)|0,d=d+Math.imul(j,ze)|0,E=E+Math.imul(j,Ke)|0,b=b+Math.imul(ie,Ve)|0,d=d+Math.imul(ie,Ye)|0,d=d+Math.imul(R,Ve)|0,E=E+Math.imul(R,Ye)|0,b=b+Math.imul(K,Xe)|0,d=d+Math.imul(K,Je)|0,d=d+Math.imul(B,Xe)|0,E=E+Math.imul(B,Je)|0,b=b+Math.imul(I,Qe)|0,d=d+Math.imul(I,Ze)|0,d=d+Math.imul(D,Qe)|0,E=E+Math.imul(D,Ze)|0;var ep=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(ep>>>26)|0,ep&=67108863,b=Math.imul(Ne,He),d=Math.imul(Ne,$e),d=d+Math.imul(Le,He)|0,E=Math.imul(Le,$e),b=b+Math.imul(Me,qe)|0,d=d+Math.imul(Me,Ue)|0,d=d+Math.imul(Ie,qe)|0,E=E+Math.imul(Ie,Ue)|0,b=b+Math.imul(re,We)|0,d=d+Math.imul(re,Ge)|0,d=d+Math.imul(Pe,We)|0,E=E+Math.imul(Pe,Ge)|0,b=b+Math.imul(V,ze)|0,d=d+Math.imul(V,Ke)|0,d=d+Math.imul(z,ze)|0,E=E+Math.imul(z,Ke)|0,b=b+Math.imul(k,Ve)|0,d=d+Math.imul(k,Ye)|0,d=d+Math.imul(j,Ve)|0,E=E+Math.imul(j,Ye)|0,b=b+Math.imul(ie,Xe)|0,d=d+Math.imul(ie,Je)|0,d=d+Math.imul(R,Xe)|0,E=E+Math.imul(R,Je)|0,b=b+Math.imul(K,Qe)|0,d=d+Math.imul(K,Ze)|0,d=d+Math.imul(B,Qe)|0,E=E+Math.imul(B,Ze)|0,b=b+Math.imul(I,et)|0,d=d+Math.imul(I,tt)|0,d=d+Math.imul(D,et)|0,E=E+Math.imul(D,tt)|0;var tp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(tp>>>26)|0,tp&=67108863,b=Math.imul(De,He),d=Math.imul(De,$e),d=d+Math.imul(Be,He)|0,E=Math.imul(Be,$e),b=b+Math.imul(Ne,qe)|0,d=d+Math.imul(Ne,Ue)|0,d=d+Math.imul(Le,qe)|0,E=E+Math.imul(Le,Ue)|0,b=b+Math.imul(Me,We)|0,d=d+Math.imul(Me,Ge)|0,d=d+Math.imul(Ie,We)|0,E=E+Math.imul(Ie,Ge)|0,b=b+Math.imul(re,ze)|0,d=d+Math.imul(re,Ke)|0,d=d+Math.imul(Pe,ze)|0,E=E+Math.imul(Pe,Ke)|0,b=b+Math.imul(V,Ve)|0,d=d+Math.imul(V,Ye)|0,d=d+Math.imul(z,Ve)|0,E=E+Math.imul(z,Ye)|0,b=b+Math.imul(k,Xe)|0,d=d+Math.imul(k,Je)|0,d=d+Math.imul(j,Xe)|0,E=E+Math.imul(j,Je)|0,b=b+Math.imul(ie,Qe)|0,d=d+Math.imul(ie,Ze)|0,d=d+Math.imul(R,Qe)|0,E=E+Math.imul(R,Ze)|0,b=b+Math.imul(K,et)|0,d=d+Math.imul(K,tt)|0,d=d+Math.imul(B,et)|0,E=E+Math.imul(B,tt)|0,b=b+Math.imul(I,rt)|0,d=d+Math.imul(I,nt)|0,d=d+Math.imul(D,rt)|0,E=E+Math.imul(D,nt)|0;var rp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(rp>>>26)|0,rp&=67108863,b=Math.imul(je,He),d=Math.imul(je,$e),d=d+Math.imul(Fe,He)|0,E=Math.imul(Fe,$e),b=b+Math.imul(De,qe)|0,d=d+Math.imul(De,Ue)|0,d=d+Math.imul(Be,qe)|0,E=E+Math.imul(Be,Ue)|0,b=b+Math.imul(Ne,We)|0,d=d+Math.imul(Ne,Ge)|0,d=d+Math.imul(Le,We)|0,E=E+Math.imul(Le,Ge)|0,b=b+Math.imul(Me,ze)|0,d=d+Math.imul(Me,Ke)|0,d=d+Math.imul(Ie,ze)|0,E=E+Math.imul(Ie,Ke)|0,b=b+Math.imul(re,Ve)|0,d=d+Math.imul(re,Ye)|0,d=d+Math.imul(Pe,Ve)|0,E=E+Math.imul(Pe,Ye)|0,b=b+Math.imul(V,Xe)|0,d=d+Math.imul(V,Je)|0,d=d+Math.imul(z,Xe)|0,E=E+Math.imul(z,Je)|0,b=b+Math.imul(k,Qe)|0,d=d+Math.imul(k,Ze)|0,d=d+Math.imul(j,Qe)|0,E=E+Math.imul(j,Ze)|0,b=b+Math.imul(ie,et)|0,d=d+Math.imul(ie,tt)|0,d=d+Math.imul(R,et)|0,E=E+Math.imul(R,tt)|0,b=b+Math.imul(K,rt)|0,d=d+Math.imul(K,nt)|0,d=d+Math.imul(B,rt)|0,E=E+Math.imul(B,nt)|0,b=b+Math.imul(I,it)|0,d=d+Math.imul(I,st)|0,d=d+Math.imul(D,it)|0,E=E+Math.imul(D,st)|0;var np=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(np>>>26)|0,np&=67108863,b=Math.imul(je,qe),d=Math.imul(je,Ue),d=d+Math.imul(Fe,qe)|0,E=Math.imul(Fe,Ue),b=b+Math.imul(De,We)|0,d=d+Math.imul(De,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,Ke)|0,d=d+Math.imul(Le,ze)|0,E=E+Math.imul(Le,Ke)|0,b=b+Math.imul(Me,Ve)|0,d=d+Math.imul(Me,Ye)|0,d=d+Math.imul(Ie,Ve)|0,E=E+Math.imul(Ie,Ye)|0,b=b+Math.imul(re,Xe)|0,d=d+Math.imul(re,Je)|0,d=d+Math.imul(Pe,Xe)|0,E=E+Math.imul(Pe,Je)|0,b=b+Math.imul(V,Qe)|0,d=d+Math.imul(V,Ze)|0,d=d+Math.imul(z,Qe)|0,E=E+Math.imul(z,Ze)|0,b=b+Math.imul(k,et)|0,d=d+Math.imul(k,tt)|0,d=d+Math.imul(j,et)|0,E=E+Math.imul(j,tt)|0,b=b+Math.imul(ie,rt)|0,d=d+Math.imul(ie,nt)|0,d=d+Math.imul(R,rt)|0,E=E+Math.imul(R,nt)|0,b=b+Math.imul(K,it)|0,d=d+Math.imul(K,st)|0,d=d+Math.imul(B,it)|0,E=E+Math.imul(B,st)|0;var ip=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(ip>>>26)|0,ip&=67108863,b=Math.imul(je,We),d=Math.imul(je,Ge),d=d+Math.imul(Fe,We)|0,E=Math.imul(Fe,Ge),b=b+Math.imul(De,ze)|0,d=d+Math.imul(De,Ke)|0,d=d+Math.imul(Be,ze)|0,E=E+Math.imul(Be,Ke)|0,b=b+Math.imul(Ne,Ve)|0,d=d+Math.imul(Ne,Ye)|0,d=d+Math.imul(Le,Ve)|0,E=E+Math.imul(Le,Ye)|0,b=b+Math.imul(Me,Xe)|0,d=d+Math.imul(Me,Je)|0,d=d+Math.imul(Ie,Xe)|0,E=E+Math.imul(Ie,Je)|0,b=b+Math.imul(re,Qe)|0,d=d+Math.imul(re,Ze)|0,d=d+Math.imul(Pe,Qe)|0,E=E+Math.imul(Pe,Ze)|0,b=b+Math.imul(V,et)|0,d=d+Math.imul(V,tt)|0,d=d+Math.imul(z,et)|0,E=E+Math.imul(z,tt)|0,b=b+Math.imul(k,rt)|0,d=d+Math.imul(k,nt)|0,d=d+Math.imul(j,rt)|0,E=E+Math.imul(j,nt)|0,b=b+Math.imul(ie,it)|0,d=d+Math.imul(ie,st)|0,d=d+Math.imul(R,it)|0,E=E+Math.imul(R,st)|0;var sp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(sp>>>26)|0,sp&=67108863,b=Math.imul(je,ze),d=Math.imul(je,Ke),d=d+Math.imul(Fe,ze)|0,E=Math.imul(Fe,Ke),b=b+Math.imul(De,Ve)|0,d=d+Math.imul(De,Ye)|0,d=d+Math.imul(Be,Ve)|0,E=E+Math.imul(Be,Ye)|0,b=b+Math.imul(Ne,Xe)|0,d=d+Math.imul(Ne,Je)|0,d=d+Math.imul(Le,Xe)|0,E=E+Math.imul(Le,Je)|0,b=b+Math.imul(Me,Qe)|0,d=d+Math.imul(Me,Ze)|0,d=d+Math.imul(Ie,Qe)|0,E=E+Math.imul(Ie,Ze)|0,b=b+Math.imul(re,et)|0,d=d+Math.imul(re,tt)|0,d=d+Math.imul(Pe,et)|0,E=E+Math.imul(Pe,tt)|0,b=b+Math.imul(V,rt)|0,d=d+Math.imul(V,nt)|0,d=d+Math.imul(z,rt)|0,E=E+Math.imul(z,nt)|0,b=b+Math.imul(k,it)|0,d=d+Math.imul(k,st)|0,d=d+Math.imul(j,it)|0,E=E+Math.imul(j,st)|0;var op=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(op>>>26)|0,op&=67108863,b=Math.imul(je,Ve),d=Math.imul(je,Ye),d=d+Math.imul(Fe,Ve)|0,E=Math.imul(Fe,Ye),b=b+Math.imul(De,Xe)|0,d=d+Math.imul(De,Je)|0,d=d+Math.imul(Be,Xe)|0,E=E+Math.imul(Be,Je)|0,b=b+Math.imul(Ne,Qe)|0,d=d+Math.imul(Ne,Ze)|0,d=d+Math.imul(Le,Qe)|0,E=E+Math.imul(Le,Ze)|0,b=b+Math.imul(Me,et)|0,d=d+Math.imul(Me,tt)|0,d=d+Math.imul(Ie,et)|0,E=E+Math.imul(Ie,tt)|0,b=b+Math.imul(re,rt)|0,d=d+Math.imul(re,nt)|0,d=d+Math.imul(Pe,rt)|0,E=E+Math.imul(Pe,nt)|0,b=b+Math.imul(V,it)|0,d=d+Math.imul(V,st)|0,d=d+Math.imul(z,it)|0,E=E+Math.imul(z,st)|0;var ap=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(ap>>>26)|0,ap&=67108863,b=Math.imul(je,Xe),d=Math.imul(je,Je),d=d+Math.imul(Fe,Xe)|0,E=Math.imul(Fe,Je),b=b+Math.imul(De,Qe)|0,d=d+Math.imul(De,Ze)|0,d=d+Math.imul(Be,Qe)|0,E=E+Math.imul(Be,Ze)|0,b=b+Math.imul(Ne,et)|0,d=d+Math.imul(Ne,tt)|0,d=d+Math.imul(Le,et)|0,E=E+Math.imul(Le,tt)|0,b=b+Math.imul(Me,rt)|0,d=d+Math.imul(Me,nt)|0,d=d+Math.imul(Ie,rt)|0,E=E+Math.imul(Ie,nt)|0,b=b+Math.imul(re,it)|0,d=d+Math.imul(re,st)|0,d=d+Math.imul(Pe,it)|0,E=E+Math.imul(Pe,st)|0;var cp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(cp>>>26)|0,cp&=67108863,b=Math.imul(je,Qe),d=Math.imul(je,Ze),d=d+Math.imul(Fe,Qe)|0,E=Math.imul(Fe,Ze),b=b+Math.imul(De,et)|0,d=d+Math.imul(De,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(Le,rt)|0,E=E+Math.imul(Le,nt)|0,b=b+Math.imul(Me,it)|0,d=d+Math.imul(Me,st)|0,d=d+Math.imul(Ie,it)|0,E=E+Math.imul(Ie,st)|0;var lp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(lp>>>26)|0,lp&=67108863,b=Math.imul(je,et),d=Math.imul(je,tt),d=d+Math.imul(Fe,et)|0,E=Math.imul(Fe,tt),b=b+Math.imul(De,rt)|0,d=d+Math.imul(De,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(Le,it)|0,E=E+Math.imul(Le,st)|0;var up=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(up>>>26)|0,up&=67108863,b=Math.imul(je,rt),d=Math.imul(je,nt),d=d+Math.imul(Fe,rt)|0,E=Math.imul(Fe,nt),b=b+Math.imul(De,it)|0,d=d+Math.imul(De,st)|0,d=d+Math.imul(Be,it)|0,E=E+Math.imul(Be,st)|0;var pp=(C+b|0)+((d&8191)<<13)|0;C=(E+(d>>>13)|0)+(pp>>>26)|0,pp&=67108863,b=Math.imul(je,it),d=Math.imul(je,st),d=d+Math.imul(Fe,it)|0,E=Math.imul(Fe,st);var fp=(C+b|0)+((d&8191)<<13)|0;return C=(E+(d>>>13)|0)+(fp>>>26)|0,fp&=67108863,v[0]=Vu,v[1]=Yu,v[2]=Xu,v[3]=Ju,v[4]=Qu,v[5]=Zu,v[6]=ep,v[7]=tp,v[8]=rp,v[9]=np,v[10]=ip,v[11]=sp,v[12]=op,v[13]=ap,v[14]=cp,v[15]=lp,v[16]=up,v[17]=pp,v[18]=fp,C!==0&&(v[19]=C,x.length++),x};Math.imul||(_=y);function S(T,l,h){h.negative=l.negative^T.negative,h.length=T.length+l.length;for(var x=0,w=0,g=0;g<h.length-1;g++){var v=w;w=0;for(var C=x&67108863,b=Math.min(g,l.length-1),d=Math.max(0,g-T.length+1);d<=b;d++){var E=g-d,q=T.words[E]|0,I=l.words[d]|0,D=q*I,$=D&67108863;v=v+(D/67108864|0)|0,$=$+C|0,C=$&67108863,v=v+($>>>26)|0,w+=v>>>26,v&=67108863}h.words[g]=C,x=v,v=w}return x!==0?h.words[g]=x:h.length--,h.strip()}function A(T,l,h){var x=new P;return x.mulp(T,l,h)}i.prototype.mulTo=function(l,h){var x,w=this.length+l.length;return this.length===10&&l.length===10?x=_(this,l,h):w<63?x=y(this,l,h):w<1024?x=S(this,l,h):x=A(this,l,h),x};function P(T,l){this.x=T,this.y=l}P.prototype.makeRBT=function(l){for(var h=new Array(l),x=i.prototype._countBits(l)-1,w=0;w<l;w++)h[w]=this.revBin(w,x,l);return h},P.prototype.revBin=function(l,h,x){if(l===0||l===x-1)return l;for(var w=0,g=0;g<h;g++)w|=(l&1)<<h-g-1,l>>=1;return w},P.prototype.permute=function(l,h,x,w,g,v){for(var C=0;C<v;C++)w[C]=h[l[C]],g[C]=x[l[C]]},P.prototype.transform=function(l,h,x,w,g,v){this.permute(v,l,h,x,w,g);for(var C=1;C<g;C<<=1)for(var b=C<<1,d=Math.cos(2*Math.PI/b),E=Math.sin(2*Math.PI/b),q=0;q<g;q+=b)for(var I=d,D=E,$=0;$<C;$++){var K=x[q+$],B=w[q+$],me=x[q+$+C],ie=w[q+$+C],R=I*me-D*ie;ie=I*ie+D*me,me=R,x[q+$]=K+me,w[q+$]=B+ie,x[q+$+C]=K-me,w[q+$+C]=B-ie,$!==b&&(R=d*I-E*D,D=d*D+E*I,I=R)}},P.prototype.guessLen13b=function(l,h){var x=Math.max(h,l)|1,w=x&1,g=0;for(x=x/2|0;x;x=x>>>1)g++;return 1<<g+1+w},P.prototype.conjugate=function(l,h,x){if(!(x<=1))for(var w=0;w<x/2;w++){var g=l[w];l[w]=l[x-w-1],l[x-w-1]=g,g=h[w],h[w]=-h[x-w-1],h[x-w-1]=-g}},P.prototype.normalize13b=function(l,h){for(var x=0,w=0;w<h/2;w++){var g=Math.round(l[2*w+1]/h)*8192+Math.round(l[2*w]/h)+x;l[w]=g&67108863,g<67108864?x=0:x=g/67108864|0}return l},P.prototype.convert13b=function(l,h,x,w){for(var g=0,v=0;v<h;v++)g=g+(l[v]|0),x[2*v]=g&8191,g=g>>>13,x[2*v+1]=g&8191,g=g>>>13;for(v=2*h;v<w;++v)x[v]=0;t(g===0),t((g&-8192)===0)},P.prototype.stub=function(l){for(var h=new Array(l),x=0;x<l;x++)h[x]=0;return h},P.prototype.mulp=function(l,h,x){var w=2*this.guessLen13b(l.length,h.length),g=this.makeRBT(w),v=this.stub(w),C=new Array(w),b=new Array(w),d=new Array(w),E=new Array(w),q=new Array(w),I=new Array(w),D=x.words;D.length=w,this.convert13b(l.words,l.length,C,w),this.convert13b(h.words,h.length,E,w),this.transform(C,v,b,d,w,g),this.transform(E,v,q,I,w,g);for(var $=0;$<w;$++){var K=b[$]*q[$]-d[$]*I[$];d[$]=b[$]*I[$]+d[$]*q[$],b[$]=K}return this.conjugate(b,d,w),this.transform(b,d,D,v,w,g),this.conjugate(D,v,w),this.normalize13b(D,w),x.negative=l.negative^h.negative,x.length=l.length+h.length,x.strip()},i.prototype.mul=function(l){var h=new i(null);return h.words=new Array(this.length+l.length),this.mulTo(l,h)},i.prototype.mulf=function(l){var h=new i(null);return h.words=new Array(this.length+l.length),A(this,l,h)},i.prototype.imul=function(l){return this.clone().mulTo(l,this)},i.prototype.imuln=function(l){t(typeof l=="number"),t(l<67108864);for(var h=0,x=0;x<this.length;x++){var w=(this.words[x]|0)*l,g=(w&67108863)+(h&67108863);h>>=26,h+=w/67108864|0,h+=g>>>26,this.words[x]=g&67108863}return h!==0&&(this.words[x]=h,this.length++),this.length=l===0?1:this.length,this},i.prototype.muln=function(l){return this.clone().imuln(l)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(l){var h=m(l);if(h.length===0)return new i(1);for(var x=this,w=0;w<h.length&&h[w]===0;w++,x=x.sqr());if(++w<h.length)for(var g=x.sqr();w<h.length;w++,g=g.sqr())h[w]!==0&&(x=x.mul(g));return x},i.prototype.iushln=function(l){t(typeof l=="number"&&l>=0);var h=l%26,x=(l-h)/26,w=67108863>>>26-h<<26-h,g;if(h!==0){var v=0;for(g=0;g<this.length;g++){var C=this.words[g]&w,b=(this.words[g]|0)-C<<h;this.words[g]=b|v,v=C>>>26-h}v&&(this.words[g]=v,this.length++)}if(x!==0){for(g=this.length-1;g>=0;g--)this.words[g+x]=this.words[g];for(g=0;g<x;g++)this.words[g]=0;this.length+=x}return this.strip()},i.prototype.ishln=function(l){return t(this.negative===0),this.iushln(l)},i.prototype.iushrn=function(l,h,x){t(typeof l=="number"&&l>=0);var w;h?w=(h-h%26)/26:w=0;var g=l%26,v=Math.min((l-g)/26,this.length),C=67108863^67108863>>>g<<g,b=x;if(w-=v,w=Math.max(0,w),b){for(var d=0;d<v;d++)b.words[d]=this.words[d];b.length=v}if(v!==0)if(this.length>v)for(this.length-=v,d=0;d<this.length;d++)this.words[d]=this.words[d+v];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-g|q>>>g,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(l,h,x){return t(this.negative===0),this.iushrn(l,h,x)},i.prototype.shln=function(l){return this.clone().ishln(l)},i.prototype.ushln=function(l){return this.clone().iushln(l)},i.prototype.shrn=function(l){return this.clone().ishrn(l)},i.prototype.ushrn=function(l){return this.clone().iushrn(l)},i.prototype.testn=function(l){t(typeof l=="number"&&l>=0);var h=l%26,x=(l-h)/26,w=1<<h;if(this.length<=x)return!1;var g=this.words[x];return!!(g&w)},i.prototype.imaskn=function(l){t(typeof l=="number"&&l>=0);var h=l%26,x=(l-h)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=x)return this;if(h!==0&&x++,this.length=Math.min(x,this.length),h!==0){var w=67108863^67108863>>>h<<h;this.words[this.length-1]&=w}return this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.maskn=function(l){return this.clone().imaskn(l)},i.prototype.iaddn=function(l){return t(typeof l=="number"),t(l<67108864),l<0?this.isubn(-l):this.negative!==0?this.length===1&&(this.words[0]|0)<l?(this.words[0]=l-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(l),this.negative=1,this):this._iaddn(l)},i.prototype._iaddn=function(l){this.words[0]+=l;for(var h=0;h<this.length&&this.words[h]>=67108864;h++)this.words[h]-=67108864,h===this.length-1?this.words[h+1]=1:this.words[h+1]++;return this.length=Math.max(this.length,h+1),this},i.prototype.isubn=function(l){if(t(typeof l=="number"),t(l<67108864),l<0)return this.iaddn(-l);if(this.negative!==0)return this.negative=0,this.iaddn(l),this.negative=1,this;if(this.words[0]-=l,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var h=0;h<this.length&&this.words[h]<0;h++)this.words[h]+=67108864,this.words[h+1]-=1;return this.strip()},i.prototype.addn=function(l){return this.clone().iaddn(l)},i.prototype.subn=function(l){return this.clone().isubn(l)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(l,h,x){var w=l.length+x,g;this._expand(w);var v,C=0;for(g=0;g<l.length;g++){v=(this.words[g+x]|0)+C;var b=(l.words[g]|0)*h;v-=b&67108863,C=(v>>26)-(b/67108864|0),this.words[g+x]=v&67108863}for(;g<this.length-x;g++)v=(this.words[g+x]|0)+C,C=v>>26,this.words[g+x]=v&67108863;if(C===0)return this.strip();for(t(C===-1),C=0,g=0;g<this.length;g++)v=-(this.words[g]|0)+C,C=v>>26,this.words[g]=v&67108863;return this.negative=1,this.strip()},i.prototype._wordDiv=function(l,h){var x=this.length-l.length,w=this.clone(),g=l,v=g.words[g.length-1]|0,C=this._countBits(v);x=26-C,x!==0&&(g=g.ushln(x),w.iushln(x),v=g.words[g.length-1]|0);var b=w.length-g.length,d;if(h!=="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(g,1,b);q.negative===0&&(w=q,d&&(d.words[b]=1));for(var I=b-1;I>=0;I--){var D=(w.words[g.length+I]|0)*67108864+(w.words[g.length+I-1]|0);for(D=Math.min(D/v|0,67108863),w._ishlnsubmul(g,D,I);w.negative!==0;)D--,w.negative=0,w._ishlnsubmul(g,1,I),w.isZero()||(w.negative^=1);d&&(d.words[I]=D)}return d&&d.strip(),w.strip(),h!=="div"&&x!==0&&w.iushrn(x),{div:d||null,mod:w}},i.prototype.divmod=function(l,h,x){if(t(!l.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var w,g,v;return this.negative!==0&&l.negative===0?(v=this.neg().divmod(l,h),h!=="mod"&&(w=v.div.neg()),h!=="div"&&(g=v.mod.neg(),x&&g.negative!==0&&g.iadd(l)),{div:w,mod:g}):this.negative===0&&l.negative!==0?(v=this.divmod(l.neg(),h),h!=="mod"&&(w=v.div.neg()),{div:w,mod:v.mod}):(this.negative&l.negative)!==0?(v=this.neg().divmod(l.neg(),h),h!=="div"&&(g=v.mod.neg(),x&&g.negative!==0&&g.isub(l)),{div:v.div,mod:g}):l.length>this.length||this.cmp(l)<0?{div:new i(0),mod:this}:l.length===1?h==="div"?{div:this.divn(l.words[0]),mod:null}:h==="mod"?{div:null,mod:new i(this.modn(l.words[0]))}:{div:this.divn(l.words[0]),mod:new i(this.modn(l.words[0]))}:this._wordDiv(l,h)},i.prototype.div=function(l){return this.divmod(l,"div",!1).div},i.prototype.mod=function(l){return this.divmod(l,"mod",!1).mod},i.prototype.umod=function(l){return this.divmod(l,"mod",!0).mod},i.prototype.divRound=function(l){var h=this.divmod(l);if(h.mod.isZero())return h.div;var x=h.div.negative!==0?h.mod.isub(l):h.mod,w=l.ushrn(1),g=l.andln(1),v=x.cmp(w);return v<0||g===1&&v===0?h.div:h.div.negative!==0?h.div.isubn(1):h.div.iaddn(1)},i.prototype.modn=function(l){t(l<=67108863);for(var h=(1<<26)%l,x=0,w=this.length-1;w>=0;w--)x=(h*x+(this.words[w]|0))%l;return x},i.prototype.idivn=function(l){t(l<=67108863);for(var h=0,x=this.length-1;x>=0;x--){var w=(this.words[x]|0)+h*67108864;this.words[x]=w/l|0,h=w%l}return this.strip()},i.prototype.divn=function(l){return this.clone().idivn(l)},i.prototype.egcd=function(l){t(l.negative===0),t(!l.isZero());var h=this,x=l.clone();h.negative!==0?h=h.umod(l):h=h.clone();for(var w=new i(1),g=new i(0),v=new i(0),C=new i(1),b=0;h.isEven()&&x.isEven();)h.iushrn(1),x.iushrn(1),++b;for(var d=x.clone(),E=h.clone();!h.isZero();){for(var q=0,I=1;(h.words[0]&I)===0&&q<26;++q,I<<=1);if(q>0)for(h.iushrn(q);q-- >0;)(w.isOdd()||g.isOdd())&&(w.iadd(d),g.isub(E)),w.iushrn(1),g.iushrn(1);for(var D=0,$=1;(x.words[0]&$)===0&&D<26;++D,$<<=1);if(D>0)for(x.iushrn(D);D-- >0;)(v.isOdd()||C.isOdd())&&(v.iadd(d),C.isub(E)),v.iushrn(1),C.iushrn(1);h.cmp(x)>=0?(h.isub(x),w.isub(v),g.isub(C)):(x.isub(h),v.isub(w),C.isub(g))}return{a:v,b:C,gcd:x.iushln(b)}},i.prototype._invmp=function(l){t(l.negative===0),t(!l.isZero());var h=this,x=l.clone();h.negative!==0?h=h.umod(l):h=h.clone();for(var w=new i(1),g=new i(0),v=x.clone();h.cmpn(1)>0&&x.cmpn(1)>0;){for(var C=0,b=1;(h.words[0]&b)===0&&C<26;++C,b<<=1);if(C>0)for(h.iushrn(C);C-- >0;)w.isOdd()&&w.iadd(v),w.iushrn(1);for(var d=0,E=1;(x.words[0]&E)===0&&d<26;++d,E<<=1);if(d>0)for(x.iushrn(d);d-- >0;)g.isOdd()&&g.iadd(v),g.iushrn(1);h.cmp(x)>=0?(h.isub(x),w.isub(g)):(x.isub(h),g.isub(w))}var q;return h.cmpn(1)===0?q=w:q=g,q.cmpn(0)<0&&q.iadd(l),q},i.prototype.gcd=function(l){if(this.isZero())return l.abs();if(l.isZero())return this.abs();var h=this.clone(),x=l.clone();h.negative=0,x.negative=0;for(var w=0;h.isEven()&&x.isEven();w++)h.iushrn(1),x.iushrn(1);do{for(;h.isEven();)h.iushrn(1);for(;x.isEven();)x.iushrn(1);var g=h.cmp(x);if(g<0){var v=h;h=x,x=v}else if(g===0||x.cmpn(1)===0)break;h.isub(x)}while(!0);return x.iushln(w)},i.prototype.invm=function(l){return this.egcd(l).a.umod(l)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(l){return this.words[0]&l},i.prototype.bincn=function(l){t(typeof l=="number");var h=l%26,x=(l-h)/26,w=1<<h;if(this.length<=x)return this._expand(x+1),this.words[x]|=w,this;for(var g=w,v=x;g!==0&&v<this.length;v++){var C=this.words[v]|0;C+=g,g=C>>>26,C&=67108863,this.words[v]=C}return g!==0&&(this.words[v]=g,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(l){var h=l<0;if(this.negative!==0&&!h)return-1;if(this.negative===0&&h)return 1;this.strip();var x;if(this.length>1)x=1;else{h&&(l=-l),t(l<=67108863,"Number is too big");var w=this.words[0]|0;x=w===l?0:w<l?-1:1}return this.negative!==0?-x|0:x},i.prototype.cmp=function(l){if(this.negative!==0&&l.negative===0)return-1;if(this.negative===0&&l.negative!==0)return 1;var h=this.ucmp(l);return this.negative!==0?-h|0:h},i.prototype.ucmp=function(l){if(this.length>l.length)return 1;if(this.length<l.length)return-1;for(var h=0,x=this.length-1;x>=0;x--){var w=this.words[x]|0,g=l.words[x]|0;if(w!==g){w<g?h=-1:w>g&&(h=1);break}}return h},i.prototype.gtn=function(l){return this.cmpn(l)===1},i.prototype.gt=function(l){return this.cmp(l)===1},i.prototype.gten=function(l){return this.cmpn(l)>=0},i.prototype.gte=function(l){return this.cmp(l)>=0},i.prototype.ltn=function(l){return this.cmpn(l)===-1},i.prototype.lt=function(l){return this.cmp(l)===-1},i.prototype.lten=function(l){return this.cmpn(l)<=0},i.prototype.lte=function(l){return this.cmp(l)<=0},i.prototype.eqn=function(l){return this.cmpn(l)===0},i.prototype.eq=function(l){return this.cmp(l)===0},i.red=function(l){return new M(l)},i.prototype.toRed=function(l){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),l.convertTo(this)._forceRed(l)},i.prototype.fromRed=function(){return t(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(l){return this.red=l,this},i.prototype.forceRed=function(l){return t(!this.red,"Already a number in reduction context"),this._forceRed(l)},i.prototype.redAdd=function(l){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,l)},i.prototype.redIAdd=function(l){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,l)},i.prototype.redSub=function(l){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,l)},i.prototype.redISub=function(l){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,l)},i.prototype.redShl=function(l){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,l)},i.prototype.redMul=function(l){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.mul(this,l)},i.prototype.redIMul=function(l){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,l),this.red.imul(this,l)},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(l){return t(this.red&&!l.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,l)};var L={k256:null,p224:null,p192:null,p25519:null};function N(T,l){this.name=T,this.p=new i(l,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}N.prototype._tmp=function(){var l=new i(null);return l.words=new Array(Math.ceil(this.n/13)),l},N.prototype.ireduce=function(l){var h=l,x;do this.split(h,this.tmp),h=this.imulK(h),h=h.iadd(this.tmp),x=h.bitLength();while(x>this.n);var w=x<this.n?-1:h.ucmp(this.p);return w===0?(h.words[0]=0,h.length=1):w>0?h.isub(this.p):h.strip!==void 0?h.strip():h._strip(),h},N.prototype.split=function(l,h){l.iushrn(this.n,0,h)},N.prototype.imulK=function(l){return l.imul(this.k)};function H(){N.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(H,N),H.prototype.split=function(l,h){for(var x=4194303,w=Math.min(l.length,9),g=0;g<w;g++)h.words[g]=l.words[g];if(h.length=w,l.length<=9){l.words[0]=0,l.length=1;return}var v=l.words[9];for(h.words[h.length++]=v&x,g=10;g<l.length;g++){var C=l.words[g]|0;l.words[g-10]=(C&x)<<4|v>>>22,v=C}v>>>=22,l.words[g-10]=v,v===0&&l.length>10?l.length-=10:l.length-=9},H.prototype.imulK=function(l){l.words[l.length]=0,l.words[l.length+1]=0,l.length+=2;for(var h=0,x=0;x<l.length;x++){var w=l.words[x]|0;h+=w*977,l.words[x]=h&67108863,h=w*64+(h/67108864|0)}return l.words[l.length-1]===0&&(l.length--,l.words[l.length-1]===0&&l.length--),l};function W(){N.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(W,N);function U(){N.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(U,N);function G(){N.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(G,N),G.prototype.imulK=function(l){for(var h=0,x=0;x<l.length;x++){var w=(l.words[x]|0)*19+h,g=w&67108863;w>>>=26,l.words[x]=g,h=w}return h!==0&&(l.words[l.length++]=h),l},i._prime=function(l){if(L[l])return L[l];var h;if(l==="k256")h=new H;else if(l==="p224")h=new W;else if(l==="p192")h=new U;else if(l==="p25519")h=new G;else throw new Error("Unknown prime "+l);return L[l]=h,h};function M(T){if(typeof T=="string"){var l=i._prime(T);this.m=l.p,this.prime=l}else t(T.gtn(1),"modulus must be greater than 1"),this.m=T,this.prime=null}M.prototype._verify1=function(l){t(l.negative===0,"red works only with positives"),t(l.red,"red works only with red numbers")},M.prototype._verify2=function(l,h){t((l.negative|h.negative)===0,"red works only with positives"),t(l.red&&l.red===h.red,"red works only with red numbers")},M.prototype.imod=function(l){return this.prime?this.prime.ireduce(l)._forceRed(this):l.umod(this.m)._forceRed(this)},M.prototype.neg=function(l){return l.isZero()?l.clone():this.m.sub(l)._forceRed(this)},M.prototype.add=function(l,h){this._verify2(l,h);var x=l.add(h);return x.cmp(this.m)>=0&&x.isub(this.m),x._forceRed(this)},M.prototype.iadd=function(l,h){this._verify2(l,h);var x=l.iadd(h);return x.cmp(this.m)>=0&&x.isub(this.m),x},M.prototype.sub=function(l,h){this._verify2(l,h);var x=l.sub(h);return x.cmpn(0)<0&&x.iadd(this.m),x._forceRed(this)},M.prototype.isub=function(l,h){this._verify2(l,h);var x=l.isub(h);return x.cmpn(0)<0&&x.iadd(this.m),x},M.prototype.shl=function(l,h){return this._verify1(l),this.imod(l.ushln(h))},M.prototype.imul=function(l,h){return this._verify2(l,h),this.imod(l.imul(h))},M.prototype.mul=function(l,h){return this._verify2(l,h),this.imod(l.mul(h))},M.prototype.isqr=function(l){return this.imul(l,l.clone())},M.prototype.sqr=function(l){return this.mul(l,l)},M.prototype.sqrt=function(l){if(l.isZero())return l.clone();var h=this.m.andln(3);if(t(h%2===1),h===3){var x=this.m.add(new i(1)).iushrn(2);return this.pow(l,x)}for(var w=this.m.subn(1),g=0;!w.isZero()&&w.andln(1)===0;)g++,w.iushrn(1);t(!w.isZero());var v=new i(1).toRed(this),C=v.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(l,w.addn(1).iushrn(1)),I=this.pow(l,w),D=g;I.cmp(v)!==0;){for(var $=I,K=0;$.cmp(v)!==0;K++)$=$.redSqr();t(K<D);var B=this.pow(E,new i(1).iushln(D-K-1));q=q.redMul(B),E=B.redSqr(),I=I.redMul(E),D=K}return q},M.prototype.invm=function(l){var h=l._invmp(this.m);return h.negative!==0?(h.negative=0,this.imod(h).redNeg()):this.imod(h)},M.prototype.pow=function(l,h){if(h.isZero())return new i(1).toRed(this);if(h.cmpn(1)===0)return l.clone();var x=4,w=new Array(1<<x);w[0]=new i(1).toRed(this),w[1]=l;for(var g=2;g<w.length;g++)w[g]=this.mul(w[g-1],l);var v=w[0],C=0,b=0,d=h.bitLength()%26;for(d===0&&(d=26),g=h.length-1;g>=0;g--){for(var E=h.words[g],q=d-1;q>=0;q--){var I=E>>q&1;if(v!==w[0]&&(v=this.sqr(v)),I===0&&C===0){b=0;continue}C<<=1,C|=I,b++,!(b!==x&&(g!==0||q!==0))&&(v=this.mul(v,w[C]),b=0,C=0)}d=26}return v},M.prototype.convertTo=function(l){var h=l.umod(this.m);return h===l?h.clone():h},M.prototype.convertFrom=function(l){var h=l.clone();return h.red=null,h},i.mont=function(l){return new F(l)};function F(T){M.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(F,M),F.prototype.convertTo=function(l){return this.imod(l.ushln(this.shift))},F.prototype.convertFrom=function(l){var h=this.imod(l.mul(this.rinv));return h.red=null,h},F.prototype.imul=function(l,h){if(l.isZero()||h.isZero())return l.words[0]=0,l.length=1,l;var x=l.imul(h),w=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),g=x.isub(w).iushrn(this.shift),v=g;return g.cmp(this.m)>=0?v=g.isub(this.m):g.cmpn(0)<0&&(v=g.iadd(this.m)),v._forceRed(this)},F.prototype.mul=function(l,h){if(l.isZero()||h.isZero())return new i(0)._forceRed(this);var x=l.mul(h),w=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),g=x.isub(w).iushrn(this.shift),v=g;return g.cmp(this.m)>=0?v=g.isub(this.m):g.cmpn(0)<0&&(v=g.iadd(this.m)),v._forceRed(this)},F.prototype.invm=function(l){var h=this.imod(l._invmp(this.m).mul(this.r2));return h._forceRed(this)}})(typeof Rh>"u"||Rh,XS)});var JS=O((oG,Oh)=>{typeof Object.create=="function"?Oh.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Oh.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 Un=O((aG,Mh)=>{try{if(Ph=require("util"),typeof Ph.inherits!="function")throw"";Mh.exports=Ph.inherits}catch{Mh.exports=JS()}var Ph});var Fl=O((cG,QS)=>{"use strict";var jl=require("buffer"),bs=jl.Buffer,pr={},fr;for(fr in jl)jl.hasOwnProperty(fr)&&(fr==="SlowBuffer"||fr==="Buffer"||(pr[fr]=jl[fr]));var ws=pr.Buffer={};for(fr in bs)bs.hasOwnProperty(fr)&&(fr==="allocUnsafe"||fr==="allocUnsafeSlow"||(ws[fr]=bs[fr]));pr.Buffer.prototype=bs.prototype;(!ws.from||ws.from===Uint8Array.from)&&(ws.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 bs(r,e,t)});ws.alloc||(ws.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=bs(r);return!e||e.length===0?n.fill(0):typeof t=="string"?n.fill(e,t):n.fill(e),n});if(!pr.kStringMaxLength)try{pr.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}pr.constants||(pr.constants={MAX_LENGTH:pr.kMaxLength},pr.kStringMaxLength&&(pr.constants.MAX_STRING_LENGTH=pr.kStringMaxLength));QS.exports=pr});var Hl=O(ZS=>{"use strict";var qB=Un();function dr(r){this._reporterState={obj:null,path:[],options:r||{},errors:[]}}ZS.Reporter=dr;dr.prototype.isError=function(e){return e instanceof Ss};dr.prototype.save=function(){let e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}};dr.prototype.restore=function(e){let t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)};dr.prototype.enterKey=function(e){return this._reporterState.path.push(e)};dr.prototype.exitKey=function(e){let t=this._reporterState;t.path=t.path.slice(0,e-1)};dr.prototype.leaveKey=function(e,t,n){let i=this._reporterState;this.exitKey(e),i.obj!==null&&(i.obj[t]=n)};dr.prototype.path=function(){return this._reporterState.path.join("/")};dr.prototype.enterObject=function(){let e=this._reporterState,t=e.obj;return e.obj={},t};dr.prototype.leaveObject=function(e){let t=this._reporterState,n=t.obj;return t.obj=e,n};dr.prototype.error=function(e){let t,n=this._reporterState,i=e instanceof Ss;if(i?t=e:t=new Ss(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};dr.prototype.wrapResult=function(e){let t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e};function Ss(r,e){this.path=r,this.rethrow(e)}qB(Ss,Error);Ss.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,Ss),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}});var Cs=O(Ih=>{"use strict";var UB=Un(),$l=Hl().Reporter,Es=Fl().Buffer;function hr(r,e){if($l.call(this,e),!Es.isBuffer(r)){this.error("Input not Buffer");return}this.base=r,this.offset=0,this.length=r.length}UB(hr,$l);Ih.DecoderBuffer=hr;hr.isDecoderBuffer=function(e){return e instanceof hr?!0:typeof e=="object"&&Es.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"};hr.prototype.save=function(){return{offset:this.offset,reporter:$l.prototype.save.call(this)}};hr.prototype.restore=function(e){let t=new hr(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,$l.prototype.restore.call(this,e.reporter),t};hr.prototype.isEmpty=function(){return this.offset===this.length};hr.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")};hr.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");let n=new hr(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+e,this.offset+=e,n};hr.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)};function Ts(r,e){if(Array.isArray(r))this.length=0,this.value=r.map(function(t){return Ts.isEncoderBuffer(t)||(t=new Ts(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=Es.byteLength(r);else if(Es.isBuffer(r))this.value=r,this.length=r.length;else return e.error("Unsupported type: "+typeof r)}Ih.EncoderBuffer=Ts;Ts.isEncoderBuffer=function(e){return e instanceof Ts?!0:typeof e=="object"&&e.constructor.name==="EncoderBuffer"&&typeof e.length=="number"&&typeof e.join=="function"};Ts.prototype.join=function(e,t){return e||(e=Es.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):Es.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}});var rE=O((pG,tE)=>{tE.exports=eE;function eE(r,e){if(!r)throw new Error(e||"Assertion failed")}eE.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)}});var ql=O((fG,iE)=>{"use strict";var WB=Hl().Reporter,GB=Cs().EncoderBuffer,zB=Cs().DecoderBuffer,Ot=rE(),nE=["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"],KB=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(nE),VB=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function fe(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())}iE.exports=fe;var YB=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];fe.prototype.clone=function(){let e=this._baseState,t={};YB.forEach(function(i){t[i]=e[i]});let n=new this.constructor(t.parent);return n._baseState=t,n};fe.prototype._wrap=function(){let e=this._baseState;KB.forEach(function(t){this[t]=function(){let i=new this.constructor(this);return e.children.push(i),i[t].apply(i,arguments)}},this)};fe.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")};fe.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}))};VB.forEach(function(r){fe.prototype[r]=function(){let t=this._baseState;throw new Error(r+" not implemented for encoding: "+t.enc)}});nE.forEach(function(r){fe.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}});fe.prototype.use=function(e){Ot(e);let t=this._baseState;return Ot(t.use===null),t.use=e,this};fe.prototype.optional=function(){let e=this._baseState;return e.optional=!0,this};fe.prototype.def=function(e){let t=this._baseState;return Ot(t.default===null),t.default=e,t.optional=!0,this};fe.prototype.explicit=function(e){let t=this._baseState;return Ot(t.explicit===null&&t.implicit===null),t.explicit=e,this};fe.prototype.implicit=function(e){let t=this._baseState;return Ot(t.explicit===null&&t.implicit===null),t.implicit=e,this};fe.prototype.obj=function(){let e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,t.length!==0&&this._useArgs(t),this};fe.prototype.key=function(e){let t=this._baseState;return Ot(t.key===null),t.key=e,this};fe.prototype.any=function(){let e=this._baseState;return e.any=!0,this};fe.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};fe.prototype.contains=function(e){let t=this._baseState;return Ot(t.use===null),t.contains=e,this};fe.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 u=e.save();try{n.choice===null?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t),s=!0}catch{s=!1}e.restore(u)}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 u=this._decodeTag(e,n.explicit);if(e.isError(u))return u;e=u}let c=e.offset;if(n.use===null&&n.choice===null){let u;n.any&&(u=e.save());let p=this._decodeTag(e,n.implicit!==null?n.implicit:n.tag,n.any);if(e.isError(p))return p;n.any?i=e.raw(u):e=p}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(p){p._decode(e,t)}),n.contains&&(n.tag==="octstr"||n.tag==="bitstr")){let u=new zB(i);i=this._getUse(n.contains,e._reporterState.obj)._decode(u,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};fe.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)};fe.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};fe.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 u=c._decode(e,t);if(e.isError(u))return!1;i={type:o,value:u},s=!0}catch{return e.restore(a),!1}return!0},this),s?i:e.error("Choice not matched")};fe.prototype._createEncoderBuffer=function(e){return new GB(e,this.reporter)};fe.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};fe.prototype._encodeValue=function(e,t,n){let i=this._baseState;if(i.parent===null)return i.children[0]._encode(e,t||new WB);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 u=t.enterKey(c._baseState.key);if(typeof e!="object")return t.error("Child expected, but input is not object");let p=c._encode(e[c._baseState.key],t,e);return t.leaveKey(u),p},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(u){let p=this._baseState;return this._getUse(p.args[0],e)._encode(u,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,u=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,u,o))}return i.explicit!==null&&(s=this._encodeComposite(i.explicit,!1,"context",s)),s};fe.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)};fe.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)};fe.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)};fe.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}});var Ul=O(mi=>{"use strict";function sE(r){let e={};return Object.keys(r).forEach(function(t){(t|0)==t&&(t=t|0);let n=r[t];e[n]=t}),e}mi.tagClass={0:"universal",1:"application",2:"context",3:"private"};mi.tagClassByName=sE(mi.tagClass);mi.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"};mi.tagByName=sE(mi.tag)});var Lh=O((hG,cE)=>{"use strict";var XB=Un(),xn=Fl().Buffer,oE=ql(),Nh=Ul();function aE(r){this.enc="der",this.name=r.name,this.entity=r,this.tree=new Rr,this.tree._init(r.body)}cE.exports=aE;aE.prototype.encode=function(e,t){return this.tree._encode(e,t).join()};function Rr(r){oE.call(this,"der",r)}XB(Rr,oE);Rr.prototype._encodeComposite=function(e,t,n,i){let s=JB(e,t,n,this.reporter);if(i.length<128){let c=xn.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=xn.alloc(2+o);a[0]=s,a[1]=128|o;for(let c=1+o,u=i.length;u>0;c--,u>>=8)a[c]=u&255;return this._createEncoderBuffer([a,i])};Rr.prototype._encodeStr=function(e,t){if(t==="bitstr")return this._createEncoderBuffer([e.unused|0,e.data]);if(t==="bmpstr"){let n=xn.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")};Rr.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=xn.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 mr(r){return r<10?"0"+r:r}Rr.prototype._encodeTime=function(e,t){let n,i=new Date(e);return t==="gentime"?n=[mr(i.getUTCFullYear()),mr(i.getUTCMonth()+1),mr(i.getUTCDate()),mr(i.getUTCHours()),mr(i.getUTCMinutes()),mr(i.getUTCSeconds()),"Z"].join(""):t==="utctime"?n=[mr(i.getUTCFullYear()%100),mr(i.getUTCMonth()+1),mr(i.getUTCDate()),mr(i.getUTCHours()),mr(i.getUTCMinutes()),mr(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(n,"octstr")};Rr.prototype._encodeNull=function(){return this._createEncoderBuffer("")};Rr.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"&&!xn.isBuffer(e)){let s=e.toArray();!e.sign&&s[0]&128&&s.unshift(0),e=xn.from(s)}if(xn.isBuffer(e)){let s=e.length;e.length===0&&s++;let o=xn.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(xn.from(i))};Rr.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)};Rr.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getEncoder("der").tree};Rr.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 JB(r,e,t,n){let i;if(r==="seqof"?r="seq":r==="setof"&&(r="set"),Nh.tagByName.hasOwnProperty(r))i=Nh.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|=Nh.tagClassByName[t||"universal"]<<6,i)}});var uE=O((mG,lE)=>{"use strict";var QB=Un(),Dh=Lh();function Bh(r){Dh.call(this,r),this.enc="pem"}QB(Bh,Dh);lE.exports=Bh;Bh.prototype.encode=function(e,t){let i=Dh.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(`
|
|
90
|
+
`)}});var jh=O(fE=>{"use strict";var pE=fE;pE.der=Lh();pE.pem=uE()});var Hh=O((vG,xE)=>{"use strict";var ZB=Un(),ej=kh(),dE=Cs().DecoderBuffer,mE=ql(),hE=Ul();function gE(r){this.enc="der",this.name=r.name,this.entity=r,this.tree=new Jt,this.tree._init(r.body)}xE.exports=gE;gE.prototype.decode=function(e,t){return dE.isDecoderBuffer(e)||(e=new dE(e,t)),this.tree._decode(e,t)};function Jt(r){mE.call(this,"der",r)}ZB(Jt,mE);Jt.prototype._peekTag=function(e,t,n){if(e.isEmpty())return!1;let i=e.save(),s=Fh(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)};Jt.prototype._decodeTag=function(e,t,n){let i=Fh(e,'Failed to decode tag of "'+t+'"');if(e.isError(i))return i;let s=vE(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+'"'))};Jt.prototype._skipUntilEnd=function(e,t){for(;;){let n=Fh(e,t);if(e.isError(n))return n;let i=vE(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}};Jt.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};Jt.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")}};Jt.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,u=s[0]%40;if(n?i=s:i=[c,u].concat(s.slice(1)),t){let p=t[i.join(" ")];p===void 0&&(p=t[i.join(".")]),p!==void 0&&(i=p)}return i};Jt.prototype._decodeTime=function(e,t){let n=e.raw().toString(),i,s,o,a,c,u;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,u=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,u=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,u,0)};Jt.prototype._decodeNull=function(){return null};Jt.prototype._decodeBool=function(e){let t=e.readUInt8();return e.isError(t)?t:t!==0};Jt.prototype._decodeInt=function(e,t){let n=e.raw(),i=new ej(n);return t&&(i=t[i.toString(10)]||i),i};Jt.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getDecoder("der").tree};function Fh(r,e){let t=r.readUInt8(e);if(r.isError(t))return t;let n=hE.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=hE.tag[t];return{cls:n,primitive:i,tag:t,tagStr:s}}function vE(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 _E=O((xG,yE)=>{"use strict";var tj=Un(),rj=Fl().Buffer,$h=Hh();function qh(r){$h.call(this,r),this.enc="pem"}tj(qh,$h);yE.exports=qh;qh.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 p=0;p<n.length;p++){let f=n[p].match(s);if(f!==null&&f[2]===i)if(o===-1){if(f[1]!=="BEGIN")break;o=p}else{if(f[1]!=="END")break;a=p;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 u=rj.from(c,"base64");return $h.prototype.decode.call(this,u,t)}});var Uh=O(wE=>{"use strict";var bE=wE;bE.der=Hh();bE.pem=_E()});var EE=O(SE=>{"use strict";var nj=jh(),ij=Uh(),sj=Un(),oj=SE;oj.define=function(e,t){return new As(e,t)};function As(r,e){this.name=r,this.body=e,this.decoders={},this.encoders={}}As.prototype._createNamed=function(e){let t=this.name;function n(i){this._initNamed(i,t)}return sj(n,e),n.prototype._initNamed=function(s,o){e.call(this,s,o)},new n(this)};As.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(ij[e])),this.decoders[e]};As.prototype.decode=function(e,t,n){return this._getDecoder(t).decode(e,n)};As.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(nj[e])),this.encoders[e]};As.prototype.encode=function(e,t,n){return this._getEncoder(t).encode(e,n)}});var CE=O(TE=>{"use strict";var Wl=TE;Wl.Reporter=Hl().Reporter;Wl.DecoderBuffer=Cs().DecoderBuffer;Wl.EncoderBuffer=Cs().EncoderBuffer;Wl.Node=ql()});var kE=O(RE=>{"use strict";var AE=RE;AE._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};AE.der=Ul()});var PE=O(OE=>{"use strict";var Rs=OE;Rs.bignum=kh();Rs.define=EE().define;Rs.base=CE();Rs.constants=kE();Rs.decoders=Uh();Rs.encoders=jh()});var ks=O((Wh,IE)=>{var Gl=require("buffer"),qr=Gl.Buffer;function ME(r,e){for(var t in r)e[t]=r[t]}qr.from&&qr.alloc&&qr.allocUnsafe&&qr.allocUnsafeSlow?IE.exports=Gl:(ME(Gl,Wh),Wh.Buffer=gi);function gi(r,e,t){return qr(r,e,t)}gi.prototype=Object.create(qr.prototype);ME(qr,gi);gi.from=function(r,e,t){if(typeof r=="number")throw new TypeError("Argument must not be a number");return qr(r,e,t)};gi.alloc=function(r,e,t){if(typeof r!="number")throw new TypeError("Argument must be a number");var n=qr(r);return e!==void 0?typeof t=="string"?n.fill(e,t):n.fill(e):n.fill(0),n};gi.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return qr(r)};gi.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return Gl.SlowBuffer(r)}});var Gh=O((EG,NE)=>{var zl=ks().Buffer,aj=require("stream"),cj=require("util");function Kl(r){if(this.buffer=null,this.writable=!0,this.readable=!0,!r)return this.buffer=zl.alloc(0),this;if(typeof r.pipe=="function")return this.buffer=zl.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+")")}cj.inherits(Kl,aj);Kl.prototype.write=function(e){this.buffer=zl.concat([this.buffer,zl.from(e)]),this.emit("data",e)};Kl.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1};NE.exports=Kl});var DE=O((TG,LE)=>{"use strict";function zh(r){var e=(r/8|0)+(r%8===0?0:1);return e}var lj={ES256:zh(256),ES384:zh(384),ES512:zh(521)};function uj(r){var e=lj[r];if(e)return e;throw new Error('Unknown algorithm "'+r+'"')}LE.exports=uj});var UE=O((CG,qE)=>{"use strict";var Vl=ks().Buffer,jE=DE(),Yl=128,FE=0,pj=32,fj=16,dj=2,HE=fj|pj|FE<<6,Xl=dj|FE<<6;function hj(r){return r.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function $E(r){if(Vl.isBuffer(r))return r;if(typeof r=="string")return Vl.from(r,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function mj(r,e){r=$E(r);var t=jE(e),n=t+1,i=r.length,s=0;if(r[s++]!==HE)throw new Error('Could not find expected "seq"');var o=r[s++];if(o===(Yl|1)&&(o=r[s++]),i-s<o)throw new Error('"seq" specified length of "'+o+'", only "'+(i-s)+'" remaining');if(r[s++]!==Xl)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++]!==Xl)throw new Error('Could not find expected "int" for "s"');var u=r[s++];if(i-s!==u)throw new Error('"s" specified length of "'+u+'", expected "'+(i-s)+'"');if(n<u)throw new Error('"s" specified length of "'+u+'", max of "'+n+'" is acceptable');var p=s;if(s+=u,s!==i)throw new Error('Expected to consume entire buffer, but "'+(i-s)+'" bytes remain');var f=t-a,m=t-u,y=Vl.allocUnsafe(f+a+m+u);for(s=0;s<f;++s)y[s]=0;r.copy(y,s,c+Math.max(-f,0),c+a),s=t;for(var _=s;s<_+m;++s)y[s]=0;return r.copy(y,s,p+Math.max(-m,0),p+u),y=y.toString("base64"),y=hj(y),y}function BE(r,e,t){for(var n=0;e+n<t&&r[e+n]===0;)++n;var i=r[e+n]>=Yl;return i&&--n,n}function gj(r,e){r=$E(r);var t=jE(e),n=r.length;if(n!==t*2)throw new TypeError('"'+e+'" signatures must be "'+t*2+'" bytes, saw "'+n+'"');var i=BE(r,0,t),s=BE(r,t,r.length),o=t-i,a=t-s,c=2+o+1+1+a,u=c<Yl,p=Vl.allocUnsafe((u?2:3)+c),f=0;return p[f++]=HE,u?p[f++]=c:(p[f++]=Yl|1,p[f++]=c&255),p[f++]=Xl,p[f++]=o,i<0?(p[f++]=0,f+=r.copy(p,f,0,t)):f+=r.copy(p,f,i,t),p[f++]=Xl,p[f++]=a,s<0?(p[f++]=0,r.copy(p,f,t)):r.copy(p,f,t+s),p}qE.exports={derToJose:mj,joseToDer:gj}});var GE=O((AG,WE)=>{"use strict";var qo=require("buffer").Buffer,Kh=require("buffer").SlowBuffer;WE.exports=Jl;function Jl(r,e){if(!qo.isBuffer(r)||!qo.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}Jl.install=function(){qo.prototype.equal=Kh.prototype.equal=function(e){return Jl(this,e)}};var vj=qo.prototype.equal,xj=Kh.prototype.equal;Jl.restore=function(){qo.prototype.equal=vj,Kh.prototype.equal=xj}});var Jh=O((RG,e1)=>{var Ps=ks().Buffer,gr=require("crypto"),KE=UE(),zE=require("util"),yj=`"%s" is not a valid algorithm.
|
|
91
91
|
Supported algorithms are:
|
|
92
|
-
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,$o="secret must be a string or buffer",Rs="key must be a string or a buffer",YB="key must be a string, a buffer or an object",Lh=typeof hr.createPublicKey=="function";Lh&&(Rs+=" or a KeyObject",$o+="or a KeyObject");function PE(r){if(!ks.isBuffer(r)&&typeof r!="string"&&(!Lh||typeof r!="object"||typeof r.type!="string"||typeof r.asymmetricKeyType!="string"||typeof r.export!="function"))throw Or(Rs)}function ME(r){if(!ks.isBuffer(r)&&typeof r!="string"&&typeof r!="object")throw Or(YB)}function XB(r){if(!ks.isBuffer(r)){if(typeof r=="string")return r;if(!Lh||typeof r!="object"||r.type!=="secret"||typeof r.export!="function")throw Or($o)}}function Dh(r){return r.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function IE(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 Or(r){var e=[].slice.call(arguments,1),t=kE.format.bind(kE,r).apply(null,e);return new TypeError(t)}function JB(r){return ks.isBuffer(r)||typeof r=="string"}function qo(r){return JB(r)||(r=JSON.stringify(r)),r}function NE(r){return function(t,n){XB(n),t=qo(t);var i=hr.createHmac("sha"+r,n),s=(i.update(t),i.digest("base64"));return Dh(s)}}var Nh,QB="timingSafeEqual"in hr?function(e,t){return e.byteLength!==t.byteLength?!1:hr.timingSafeEqual(e,t)}:function(e,t){return Nh||(Nh=RE()),Nh(e,t)};function ZB(r){return function(t,n,i){var s=NE(r)(t,i);return QB(ks.from(n),ks.from(s))}}function LE(r){return function(t,n){ME(n),t=qo(t);var i=hr.createSign("RSA-SHA"+r),s=(i.update(t),i.sign(n,"base64"));return Dh(s)}}function DE(r){return function(t,n,i){PE(i),t=qo(t),n=IE(n);var s=hr.createVerify("RSA-SHA"+r);return s.update(t),s.verify(i,n,"base64")}}function ej(r){return function(t,n){ME(n),t=qo(t);var i=hr.createSign("RSA-SHA"+r),s=(i.update(t),i.sign({key:n,padding:hr.constants.RSA_PKCS1_PSS_PADDING,saltLength:hr.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Dh(s)}}function tj(r){return function(t,n,i){PE(i),t=qo(t),n=IE(n);var s=hr.createVerify("RSA-SHA"+r);return s.update(t),s.verify({key:i,padding:hr.constants.RSA_PKCS1_PSS_PADDING,saltLength:hr.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function rj(r){var e=LE(r);return function(){var n=e.apply(null,arguments);return n=OE.derToJose(n,"ES"+r),n}}function nj(r){var e=DE(r);return function(n,i,s){i=OE.joseToDer(i,"ES"+r).toString("base64");var o=e(n,i,s);return o}}function ij(){return function(){return""}}function sj(){return function(e,t){return t===""}}BE.exports=function(e){var t={hs:NE,rs:LE,ps:ej,es:rj,none:ij},n={hs:ZB,rs:DE,ps:tj,es:nj,none:sj},i=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw Or(VB,e);var s=(i[1]||i[3]).toLowerCase(),o=i[2];return{sign:t[s](o),verify:n[s](o)}}});var jh=O((eG,jE)=>{var oj=require("buffer").Buffer;jE.exports=function(e){return typeof e=="string"?e:typeof e=="number"||oj.isBuffer(e)?e.toString():JSON.stringify(e)}});var WE=O((tG,UE)=>{var aj=As().Buffer,FE=Ph(),cj=Bh(),lj=require("stream"),HE=jh(),Fh=require("util");function $E(r,e){return aj.from(r,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function uj(r,e,t){t=t||"utf8";var n=$E(HE(r),"binary"),i=$E(HE(e),t);return Fh.format("%s.%s",n,i)}function qE(r){var e=r.header,t=r.payload,n=r.secret||r.privateKey,i=r.encoding,s=cj(e.alg),o=uj(e,t,i),a=s.sign(o,n);return Fh.format("%s.%s",o,a)}function jl(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 FE(e);this.readable=!0,this.header=r.header,this.encoding=r.encoding,this.secret=this.privateKey=this.key=t,this.payload=new FE(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))}Fh.inherits(jl,lj);jl.prototype.sign=function(){try{var e=qE({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")}};jl.sign=qE;UE.exports=jl});var e1=O((rG,ZE)=>{var zE=As().Buffer,GE=Ph(),pj=Bh(),fj=require("stream"),KE=jh(),dj=require("util"),hj=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function mj(r){return Object.prototype.toString.call(r)==="[object Object]"}function gj(r){if(mj(r))return r;try{return JSON.parse(r)}catch{return}}function VE(r){var e=r.split(".",1)[0];return gj(zE.from(e,"base64").toString("binary"))}function vj(r){return r.split(".",2).join(".")}function YE(r){return r.split(".")[2]}function xj(r,e){e=e||"utf8";var t=r.split(".")[1];return zE.from(t,"base64").toString(e)}function XE(r){return hj.test(r)&&!!VE(r)}function JE(r,e,t){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}r=KE(r);var i=YE(r),s=vj(r),o=pj(e);return o.verify(s,i,t)}function QE(r,e){if(e=e||{},r=KE(r),!XE(r))return null;var t=VE(r);if(!t)return null;var n=xj(r);return(t.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:t,payload:n,signature:YE(r)}}function Os(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 GE(e);this.readable=!0,this.algorithm=r.algorithm,this.encoding=r.encoding,this.secret=this.publicKey=this.key=t,this.signature=new GE(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))}dj.inherits(Os,fj);Os.prototype.verify=function(){try{var e=JE(this.signature.buffer,this.algorithm,this.key.buffer),t=QE(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")}};Os.decode=QE;Os.isValid=XE;Os.verify=JE;ZE.exports=Os});var r1=O($n=>{var t1=WE(),Fl=e1(),yj=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];$n.ALGORITHMS=yj;$n.sign=t1.sign;$n.verify=Fl.verify;$n.decode=Fl.decode;$n.isValid=Fl.isValid;$n.createSign=function(e){return new t1(e)};$n.createVerify=function(e){return new Fl(e)}});var Hl=O((iG,n1)=>{"use strict";var Hh={};Hh.supportedContentEncodings={AES_GCM:"aesgcm",AES_128_GCM:"aes128gcm"};Hh.supportedUrgency={VERY_LOW:"very-low",LOW:"low",NORMAL:"normal",HIGH:"high"};n1.exports=Hh});var $h=O((sG,i1)=>{"use strict";function _j(r){return/^[A-Za-z0-9\-_]+$/.test(r)}i1.exports={validate:_j}});var Uh=O((oG,f1)=>{"use strict";var bj=require("crypto"),wj=hE(),Sj=r1(),{URL:o1}=require("url"),s1=Hl(),a1=$h(),Ej=720*60,Tj=1440*60,Cj=wj.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 Aj(r){return Cj.encode({version:1,privateKey:r,parameters:[1,2,840,10045,3,1,7]},"pem",{label:"EC PRIVATE KEY"})}function Rj(){let r=bj.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 c1(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 l1(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(!a1.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 u1(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(!a1.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 qh(r){let e=new Date;return e.setSeconds(e.getSeconds()+r),Math.floor(e.getTime()/1e3)}function p1(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=qh(Tj);if(r>=e)throw new Error("`expiration` value is greater than maximum of 24 hours")}function kj(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)}c1(e),l1(t),u1(n),n=Buffer.from(n,"base64url"),s?p1(s):s=qh(Ej);let o={typ:"JWT",alg:"ES256"},a={aud:r,exp:s,sub:e},c=Sj.sign({header:o,payload:a,privateKey:Aj(n)});if(i===s1.supportedContentEncodings.AES_128_GCM)return{Authorization:"vapid t="+c+", k="+t};if(i===s1.supportedContentEncodings.AES_GCM)return{Authorization:"WebPush "+c,"Crypto-Key":"p256ecdsa="+t};throw new Error("Unsupported encoding type specified.")}f1.exports={generateVAPIDKeys:Rj,getFutureExpirationTimestamp:qh,getVapidHeaders:kj,validateSubject:c1,validatePublicKey:l1,validatePrivateKey:u1,validateExpiration:p1}});var S1=O((aG,w1)=>{"use strict";var ql=require("crypto"),h1="aes-128-gcm",Ul={aes128gcm:1,aesgcm:2},di=16,Wr=16,Oj=12,m1=32,Uo="encrypt",Wo="decrypt",pe;process.env.ECE_KEYLOG==="1"?pe=function(r,e){return console.warn(r+" ["+e.length+"]: "+e.toString("base64url")),e}:pe=function(r,e){return e};function $l(r){return typeof r=="string"?Buffer.from(r,"base64url"):r}function g1(r,e){var t=ql.createHmac("sha256",r);return t.update(e),t.digest()}function v1(r,e){return pe("salt",r),pe("ikm",e),pe("extract",g1(r,e))}function Wh(r,e,t){pe("prk",r),pe("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=g1(r,Buffer.concat([i,e,o])),n=Buffer.concat([n,i]);return pe("expand",n.slice(0,t))}function x1(r,e,t,n){return Wh(v1(r,e),t,n)}function Gh(r,e){var t=Buffer.concat([Buffer.from("Content-Encoding: "+r+"\0","ascii"),e]);return pe("info "+r,t),t}function d1(r){var e=Buffer.concat([Buffer.alloc(2),r]);return e.writeUIntBE(r.length,0,2),e}function Pj(r,e){var t=r.privateKey,n,i;if(e===Uo)n=t.getPublicKey(),i=r.dh;else if(e===Wo)n=r.dh,i=t.getPublicKey();else throw new Error("Unknown mode only "+Uo+" and "+Wo+" supported");return{secret:t.computeSecret(r.dh),context:Buffer.concat([Buffer.from(r.keylabel,"ascii"),Buffer.from([0]),d1(i),d1(n)])}}function Mj(r,e){var t={secret:null,context:Buffer.alloc(0)};if(r.key){if(t.secret=r.key,t.secret.length!==Wr)throw new Error("An explicit key must be "+Wr+" bytes")}else r.dh?t=Pj(r,e):typeof r.keyid!==void 0&&(t.secret=r.keymap[r.keyid]);if(!t.secret)throw new Error("Unable to determine key");return pe("secret",t.secret),pe("context",t.context),r.authSecret&&(t.secret=x1(r.authSecret,t.secret,Gh("auth",Buffer.alloc(0)),m1),pe("authsecret",t.secret)),t}function Ij(r,e){if(!r.authSecret)throw new Error("No authentication secret for webpush");pe("authsecret",r.authSecret);var t,n,i;if(e===Uo)n=r.privateKey.getPublicKey(),t=i=r.dh;else if(e===Wo)t=n=r.keyid,i=r.privateKey.getPublicKey();else throw new Error("Unknown mode only "+Uo+" and "+Wo+" supported");return pe("remote pubkey",t),pe("sender pubkey",n),pe("receiver pubkey",i),pe("secret dh",x1(r.authSecret,r.privateKey.computeSecret(t),Buffer.concat([Buffer.from("WebPush: info\0"),i,n]),m1))}function Nj(r,e,t){if(t&&!Uj(t))throw new Error("Callback is not a function");if(r.key){if(r.key.length!==Wr)throw new Error("An explicit key must be "+Wr+" bytes");return pe("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 Ij(r,e)}function y1(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=Mj(r,e,t);n=Gh("aesgcm",o.context),i=Gh("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=Nj(r,e,t);else throw new Error("Unable to set context for mode "+r.version);var a=v1(r.salt,s),c={key:Wh(a,n,Wr),nonce:Wh(a,i,Oj)};return pe("key",c.key),pe("nonce base",c.nonce),c}function _1(r){var e={};e.version=r.version||"aes128gcm",e.rs=parseInt(r.rs,10),isNaN(e.rs)&&(e.rs=4096);var t=Ul[e.version];if(e.version==="aes128gcm"&&(t+=di),e.rs<=t)throw new Error("The rs parameter has to be greater than "+t);if(r.salt&&(e.salt=$l(r.salt),e.salt.length!==Wr))throw new Error("The salt parameter must be "+Wr+" bytes");return e.keyid=r.keyid,r.key?e.key=$l(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=$l(r.dh))),r.authSecret&&(e.authSecret=$l(r.authSecret)),e}function b1(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),pe("nonce"+e,t),t}function Lj(r,e){var t=r.readUIntBE(20,1);return e.salt=r.slice(0,Wr),e.rs=r.readUIntBE(Wr,4),e.keyid=r.slice(21,21+t),21+t}function Dj(r,e){var t=Ul[e],n=r.readUIntBE(0,t);if(n+t>r.length)throw new Error("padding exceeds block size");pe("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 Bj(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 jj(r,e,t,n,i){pe("decrypt",t);var s=b1(r.nonce,e),o=ql.createDecipheriv(h1,r.key,s);o.setAuthTag(t.slice(t.length-di));var a=o.update(t.slice(0,t.length-di));return a=Buffer.concat([a,o.final()]),pe("decrypted",a),n.version!=="aes128gcm"?Dj(a,n.version):Bj(a,i)}function Fj(r,e,t){var n=_1(e);if(n.version==="aes128gcm"){var i=Lj(r,n);r=r.slice(i)}var s=y1(n,Wo,t),o=0,a=Buffer.alloc(0),c=n.rs;n.version!=="aes128gcm"&&(c+=di);for(var u=0;o<r.length;++u){var p=o+c;if(n.version!=="aes128gcm"&&p===r.length)throw new Error("Truncated payload");if(p=Math.min(p,r.length),p-o<=di)throw new Error("Invalid block: too small at "+u);var f=jj(s,u,r.slice(o,p),n,p>=r.length);a=Buffer.concat([a,f]),o=p}return a}function Hj(r,e,t,n,i,s){pe("encrypt",t),n=n||0;var o=b1(r.nonce,e),a=ql.createCipheriv(h1,r.key,o),c=[],u=Ul[i.version],p=Buffer.alloc(n+u);if(p.fill(0),i.version!=="aes128gcm"){if(p.writeUIntBE(n,0,u),pe("padding",p),c.push(a.update(p)),c.push(a.update(t)),!s&&p.length+t.length<i.rs)throw new Error("Unable to pad to record size")}else c.push(a.update(t)),p.writeUIntBE(s?2:1,0,1),pe("padding",p),c.push(a.update(p));a.final();var f=a.getAuthTag();if(f.length!==di)throw new Error("invalid tag generated");return c.push(f),pe("encrypted",Buffer.concat(c))}function $j(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 qj(r,e,t){if(!Buffer.isBuffer(r))throw new Error("buffer argument must be a Buffer");var n=_1(e);n.salt||(n.salt=ql.randomBytes(Wr));var i;n.version==="aes128gcm"?(n.privateKey&&!n.keyid&&(n.keyid=n.privateKey.getPublicKey()),i=$j(n)):i=Buffer.alloc(0);var s=y1(n,Uo,t),o=0,a=Ul[n.version],c=a;n.version==="aes128gcm"&&(c+=di);for(var u=isNaN(parseInt(e.pad,10))?0:parseInt(e.pad,10),p=0,f=!1;!f;){var g=Math.min(n.rs-c-1,u);n.version!=="aes128gcm"&&(g=Math.min((1<<a*8)-1,g)),u>0&&g===0&&++g,u-=g;var y=o+n.rs-c-g;n.version!=="aes128gcm"?f=y>r.length:f=y>=r.length,f=f&&u<=0;var b=Hj(s,p,r.slice(o,y),g,n,f);i=Buffer.concat([i,b]),o=y,++p}return i}function Uj(r){return typeof r=="function"}w1.exports={decrypt:Fj,encrypt:qj}});var zh=O((cG,T1)=>{"use strict";var E1=require("crypto"),Wj=S1(),Gj=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=E1.createECDH("prime256v1"),s=i.generateKeys(),o=E1.randomBytes(16).toString("base64url"),a=Wj.encrypt(t,{version:n,dh:r,privateKey:i,salt:o,authSecret:e});return{localPublicKey:s,salt:o,cipherText:a}};T1.exports={encrypt:Gj}});var Kh=O((lG,A1)=>{"use strict";function C1(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(C1,Error);A1.exports=C1});var O1=O(Dt=>{"use strict";var zj=Dt&&Dt.__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]})),Kj=Dt&&Dt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),R1=Dt&&Dt.__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)&&zj(e,r,t);return Kj(e,r),e};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.req=Dt.json=Dt.toBuffer=void 0;var Vj=R1(require("http")),Yj=R1(require("https"));async function k1(r){let e=0,t=[];for await(let n of r)e+=n.length,t.push(n);return Buffer.concat(t,e)}Dt.toBuffer=k1;async function Xj(r){let t=(await k1(r)).toString("utf8");try{return JSON.parse(t)}catch(n){let i=n;throw i.message+=` (input: ${t})`,i}}Dt.json=Xj;function Jj(r,e={}){let n=((typeof r=="string"?r:r.href).startsWith("https:")?Yj:Vj).request(r,e),i=new Promise((s,o)=>{n.once("response",s).once("error",o).end()});return n.then=i.then.bind(i),n}Dt.req=Jj});var N1=O(Vt=>{"use strict";var M1=Vt&&Vt.__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]})),Qj=Vt&&Vt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),I1=Vt&&Vt.__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)&&M1(e,r,t);return Qj(e,r),e},Zj=Vt&&Vt.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&M1(e,r,t)};Object.defineProperty(Vt,"__esModule",{value:!0});Vt.Agent=void 0;var eF=I1(require("net")),P1=I1(require("http")),tF=require("https");Zj(O1(),Vt);var Gr=Symbol("AgentBaseInternalState"),Vh=class extends P1.Agent{constructor(e){super(e),this[Gr]={}}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(`
|
|
93
|
-
`).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
|
|
92
|
+
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,Uo="secret must be a string or buffer",Os="key must be a string or a buffer",_j="key must be a string, a buffer or an object",Yh=typeof gr.createPublicKey=="function";Yh&&(Os+=" or a KeyObject",Uo+="or a KeyObject");function VE(r){if(!Ps.isBuffer(r)&&typeof r!="string"&&(!Yh||typeof r!="object"||typeof r.type!="string"||typeof r.asymmetricKeyType!="string"||typeof r.export!="function"))throw kr(Os)}function YE(r){if(!Ps.isBuffer(r)&&typeof r!="string"&&typeof r!="object")throw kr(_j)}function bj(r){if(!Ps.isBuffer(r)){if(typeof r=="string")return r;if(!Yh||typeof r!="object"||r.type!=="secret"||typeof r.export!="function")throw kr(Uo)}}function Xh(r){return r.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function XE(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 kr(r){var e=[].slice.call(arguments,1),t=zE.format.bind(zE,r).apply(null,e);return new TypeError(t)}function wj(r){return Ps.isBuffer(r)||typeof r=="string"}function Wo(r){return wj(r)||(r=JSON.stringify(r)),r}function JE(r){return function(t,n){bj(n),t=Wo(t);var i=gr.createHmac("sha"+r,n),s=(i.update(t),i.digest("base64"));return Xh(s)}}var Vh,Sj="timingSafeEqual"in gr?function(e,t){return e.byteLength!==t.byteLength?!1:gr.timingSafeEqual(e,t)}:function(e,t){return Vh||(Vh=GE()),Vh(e,t)};function Ej(r){return function(t,n,i){var s=JE(r)(t,i);return Sj(Ps.from(n),Ps.from(s))}}function QE(r){return function(t,n){YE(n),t=Wo(t);var i=gr.createSign("RSA-SHA"+r),s=(i.update(t),i.sign(n,"base64"));return Xh(s)}}function ZE(r){return function(t,n,i){VE(i),t=Wo(t),n=XE(n);var s=gr.createVerify("RSA-SHA"+r);return s.update(t),s.verify(i,n,"base64")}}function Tj(r){return function(t,n){YE(n),t=Wo(t);var i=gr.createSign("RSA-SHA"+r),s=(i.update(t),i.sign({key:n,padding:gr.constants.RSA_PKCS1_PSS_PADDING,saltLength:gr.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Xh(s)}}function Cj(r){return function(t,n,i){VE(i),t=Wo(t),n=XE(n);var s=gr.createVerify("RSA-SHA"+r);return s.update(t),s.verify({key:i,padding:gr.constants.RSA_PKCS1_PSS_PADDING,saltLength:gr.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function Aj(r){var e=QE(r);return function(){var n=e.apply(null,arguments);return n=KE.derToJose(n,"ES"+r),n}}function Rj(r){var e=ZE(r);return function(n,i,s){i=KE.joseToDer(i,"ES"+r).toString("base64");var o=e(n,i,s);return o}}function kj(){return function(){return""}}function Oj(){return function(e,t){return t===""}}e1.exports=function(e){var t={hs:JE,rs:QE,ps:Tj,es:Aj,none:kj},n={hs:Ej,rs:ZE,ps:Cj,es:Rj,none:Oj},i=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw kr(yj,e);var s=(i[1]||i[3]).toLowerCase(),o=i[2];return{sign:t[s](o),verify:n[s](o)}}});var Qh=O((kG,t1)=>{var Pj=require("buffer").Buffer;t1.exports=function(e){return typeof e=="string"?e:typeof e=="number"||Pj.isBuffer(e)?e.toString():JSON.stringify(e)}});var a1=O((OG,o1)=>{var Mj=ks().Buffer,r1=Gh(),Ij=Jh(),Nj=require("stream"),n1=Qh(),Zh=require("util");function i1(r,e){return Mj.from(r,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Lj(r,e,t){t=t||"utf8";var n=i1(n1(r),"binary"),i=i1(n1(e),t);return Zh.format("%s.%s",n,i)}function s1(r){var e=r.header,t=r.payload,n=r.secret||r.privateKey,i=r.encoding,s=Ij(e.alg),o=Lj(e,t,i),a=s.sign(o,n);return Zh.format("%s.%s",o,a)}function Ql(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 r1(e);this.readable=!0,this.header=r.header,this.encoding=r.encoding,this.secret=this.privateKey=this.key=t,this.payload=new r1(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))}Zh.inherits(Ql,Nj);Ql.prototype.sign=function(){try{var e=s1({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")}};Ql.sign=s1;o1.exports=Ql});var v1=O((PG,g1)=>{var l1=ks().Buffer,c1=Gh(),Dj=Jh(),Bj=require("stream"),u1=Qh(),jj=require("util"),Fj=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function Hj(r){return Object.prototype.toString.call(r)==="[object Object]"}function $j(r){if(Hj(r))return r;try{return JSON.parse(r)}catch{return}}function p1(r){var e=r.split(".",1)[0];return $j(l1.from(e,"base64").toString("binary"))}function qj(r){return r.split(".",2).join(".")}function f1(r){return r.split(".")[2]}function Uj(r,e){e=e||"utf8";var t=r.split(".")[1];return l1.from(t,"base64").toString(e)}function d1(r){return Fj.test(r)&&!!p1(r)}function h1(r,e,t){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}r=u1(r);var i=f1(r),s=qj(r),o=Dj(e);return o.verify(s,i,t)}function m1(r,e){if(e=e||{},r=u1(r),!d1(r))return null;var t=p1(r);if(!t)return null;var n=Uj(r);return(t.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:t,payload:n,signature:f1(r)}}function Ms(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 c1(e);this.readable=!0,this.algorithm=r.algorithm,this.encoding=r.encoding,this.secret=this.publicKey=this.key=t,this.signature=new c1(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(Ms,Bj);Ms.prototype.verify=function(){try{var e=h1(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")}};Ms.decode=m1;Ms.isValid=d1;Ms.verify=h1;g1.exports=Ms});var y1=O(Wn=>{var x1=a1(),Zl=v1(),Wj=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Wn.ALGORITHMS=Wj;Wn.sign=x1.sign;Wn.verify=Zl.verify;Wn.decode=Zl.decode;Wn.isValid=Zl.isValid;Wn.createSign=function(e){return new x1(e)};Wn.createVerify=function(e){return new Zl(e)}});var eu=O((IG,_1)=>{"use strict";var em={};em.supportedContentEncodings={AES_GCM:"aesgcm",AES_128_GCM:"aes128gcm"};em.supportedUrgency={VERY_LOW:"very-low",LOW:"low",NORMAL:"normal",HIGH:"high"};_1.exports=em});var tm=O((NG,b1)=>{"use strict";function Gj(r){return/^[A-Za-z0-9\-_]+$/.test(r)}b1.exports={validate:Gj}});var nm=O((LG,k1)=>{"use strict";var zj=require("crypto"),Kj=PE(),Vj=y1(),{URL:S1}=require("url"),w1=eu(),E1=tm(),Yj=720*60,Xj=1440*60,Jj=Kj.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 Qj(r){return Jj.encode({version:1,privateKey:r,parameters:[1,2,840,10045,3,1,7]},"pem",{label:"EC PRIVATE KEY"})}function Zj(){let r=zj.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 T1(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 S1(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 C1(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(!E1.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 A1(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(!E1.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 rm(r){let e=new Date;return e.setSeconds(e.getSeconds()+r),Math.floor(e.getTime()/1e3)}function R1(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=rm(Xj);if(r>=e)throw new Error("`expiration` value is greater than maximum of 24 hours")}function eF(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 S1(r)}catch{throw new Error("VAPID audience is not a url. "+r)}T1(e),C1(t),A1(n),n=Buffer.from(n,"base64url"),s?R1(s):s=rm(Yj);let o={typ:"JWT",alg:"ES256"},a={aud:r,exp:s,sub:e},c=Vj.sign({header:o,payload:a,privateKey:Qj(n)});if(i===w1.supportedContentEncodings.AES_128_GCM)return{Authorization:"vapid t="+c+", k="+t};if(i===w1.supportedContentEncodings.AES_GCM)return{Authorization:"WebPush "+c,"Crypto-Key":"p256ecdsa="+t};throw new Error("Unsupported encoding type specified.")}k1.exports={generateVAPIDKeys:Zj,getFutureExpirationTimestamp:rm,getVapidHeaders:eF,validateSubject:T1,validatePublicKey:C1,validatePrivateKey:A1,validateExpiration:R1}});var H1=O((DG,F1)=>{"use strict";var ru=require("crypto"),P1="aes-128-gcm",nu={aes128gcm:1,aesgcm:2},vi=16,Ur=16,tF=12,M1=32,Go="encrypt",zo="decrypt",de;process.env.ECE_KEYLOG==="1"?de=function(r,e){return console.warn(r+" ["+e.length+"]: "+e.toString("base64url")),e}:de=function(r,e){return e};function tu(r){return typeof r=="string"?Buffer.from(r,"base64url"):r}function I1(r,e){var t=ru.createHmac("sha256",r);return t.update(e),t.digest()}function N1(r,e){return de("salt",r),de("ikm",e),de("extract",I1(r,e))}function im(r,e,t){de("prk",r),de("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=I1(r,Buffer.concat([i,e,o])),n=Buffer.concat([n,i]);return de("expand",n.slice(0,t))}function L1(r,e,t,n){return im(N1(r,e),t,n)}function sm(r,e){var t=Buffer.concat([Buffer.from("Content-Encoding: "+r+"\0","ascii"),e]);return de("info "+r,t),t}function O1(r){var e=Buffer.concat([Buffer.alloc(2),r]);return e.writeUIntBE(r.length,0,2),e}function rF(r,e){var t=r.privateKey,n,i;if(e===Go)n=t.getPublicKey(),i=r.dh;else if(e===zo)n=r.dh,i=t.getPublicKey();else throw new Error("Unknown mode only "+Go+" and "+zo+" supported");return{secret:t.computeSecret(r.dh),context:Buffer.concat([Buffer.from(r.keylabel,"ascii"),Buffer.from([0]),O1(i),O1(n)])}}function nF(r,e){var t={secret:null,context:Buffer.alloc(0)};if(r.key){if(t.secret=r.key,t.secret.length!==Ur)throw new Error("An explicit key must be "+Ur+" bytes")}else r.dh?t=rF(r,e):typeof r.keyid!==void 0&&(t.secret=r.keymap[r.keyid]);if(!t.secret)throw new Error("Unable to determine key");return de("secret",t.secret),de("context",t.context),r.authSecret&&(t.secret=L1(r.authSecret,t.secret,sm("auth",Buffer.alloc(0)),M1),de("authsecret",t.secret)),t}function iF(r,e){if(!r.authSecret)throw new Error("No authentication secret for webpush");de("authsecret",r.authSecret);var t,n,i;if(e===Go)n=r.privateKey.getPublicKey(),t=i=r.dh;else if(e===zo)t=n=r.keyid,i=r.privateKey.getPublicKey();else throw new Error("Unknown mode only "+Go+" and "+zo+" supported");return de("remote pubkey",t),de("sender pubkey",n),de("receiver pubkey",i),de("secret dh",L1(r.authSecret,r.privateKey.computeSecret(t),Buffer.concat([Buffer.from("WebPush: info\0"),i,n]),M1))}function sF(r,e,t){if(t&&!hF(t))throw new Error("Callback is not a function");if(r.key){if(r.key.length!==Ur)throw new Error("An explicit key must be "+Ur+" bytes");return de("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 iF(r,e)}function D1(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=nF(r,e,t);n=sm("aesgcm",o.context),i=sm("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=sF(r,e,t);else throw new Error("Unable to set context for mode "+r.version);var a=N1(r.salt,s),c={key:im(a,n,Ur),nonce:im(a,i,tF)};return de("key",c.key),de("nonce base",c.nonce),c}function B1(r){var e={};e.version=r.version||"aes128gcm",e.rs=parseInt(r.rs,10),isNaN(e.rs)&&(e.rs=4096);var t=nu[e.version];if(e.version==="aes128gcm"&&(t+=vi),e.rs<=t)throw new Error("The rs parameter has to be greater than "+t);if(r.salt&&(e.salt=tu(r.salt),e.salt.length!==Ur))throw new Error("The salt parameter must be "+Ur+" bytes");return e.keyid=r.keyid,r.key?e.key=tu(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=tu(r.dh))),r.authSecret&&(e.authSecret=tu(r.authSecret)),e}function j1(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),de("nonce"+e,t),t}function oF(r,e){var t=r.readUIntBE(20,1);return e.salt=r.slice(0,Ur),e.rs=r.readUIntBE(Ur,4),e.keyid=r.slice(21,21+t),21+t}function aF(r,e){var t=nu[e],n=r.readUIntBE(0,t);if(n+t>r.length)throw new Error("padding exceeds block size");de("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 cF(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 lF(r,e,t,n,i){de("decrypt",t);var s=j1(r.nonce,e),o=ru.createDecipheriv(P1,r.key,s);o.setAuthTag(t.slice(t.length-vi));var a=o.update(t.slice(0,t.length-vi));return a=Buffer.concat([a,o.final()]),de("decrypted",a),n.version!=="aes128gcm"?aF(a,n.version):cF(a,i)}function uF(r,e,t){var n=B1(e);if(n.version==="aes128gcm"){var i=oF(r,n);r=r.slice(i)}var s=D1(n,zo,t),o=0,a=Buffer.alloc(0),c=n.rs;n.version!=="aes128gcm"&&(c+=vi);for(var u=0;o<r.length;++u){var p=o+c;if(n.version!=="aes128gcm"&&p===r.length)throw new Error("Truncated payload");if(p=Math.min(p,r.length),p-o<=vi)throw new Error("Invalid block: too small at "+u);var f=lF(s,u,r.slice(o,p),n,p>=r.length);a=Buffer.concat([a,f]),o=p}return a}function pF(r,e,t,n,i,s){de("encrypt",t),n=n||0;var o=j1(r.nonce,e),a=ru.createCipheriv(P1,r.key,o),c=[],u=nu[i.version],p=Buffer.alloc(n+u);if(p.fill(0),i.version!=="aes128gcm"){if(p.writeUIntBE(n,0,u),de("padding",p),c.push(a.update(p)),c.push(a.update(t)),!s&&p.length+t.length<i.rs)throw new Error("Unable to pad to record size")}else c.push(a.update(t)),p.writeUIntBE(s?2:1,0,1),de("padding",p),c.push(a.update(p));a.final();var f=a.getAuthTag();if(f.length!==vi)throw new Error("invalid tag generated");return c.push(f),de("encrypted",Buffer.concat(c))}function fF(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 dF(r,e,t){if(!Buffer.isBuffer(r))throw new Error("buffer argument must be a Buffer");var n=B1(e);n.salt||(n.salt=ru.randomBytes(Ur));var i;n.version==="aes128gcm"?(n.privateKey&&!n.keyid&&(n.keyid=n.privateKey.getPublicKey()),i=fF(n)):i=Buffer.alloc(0);var s=D1(n,Go,t),o=0,a=nu[n.version],c=a;n.version==="aes128gcm"&&(c+=vi);for(var u=isNaN(parseInt(e.pad,10))?0:parseInt(e.pad,10),p=0,f=!1;!f;){var m=Math.min(n.rs-c-1,u);n.version!=="aes128gcm"&&(m=Math.min((1<<a*8)-1,m)),u>0&&m===0&&++m,u-=m;var y=o+n.rs-c-m;n.version!=="aes128gcm"?f=y>r.length:f=y>=r.length,f=f&&u<=0;var _=pF(s,p,r.slice(o,y),m,n,f);i=Buffer.concat([i,_]),o=y,++p}return i}function hF(r){return typeof r=="function"}F1.exports={decrypt:uF,encrypt:dF}});var om=O((BG,q1)=>{"use strict";var $1=require("crypto"),mF=H1(),gF=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=$1.createECDH("prime256v1"),s=i.generateKeys(),o=$1.randomBytes(16).toString("base64url"),a=mF.encrypt(t,{version:n,dh:r,privateKey:i,salt:o,authSecret:e});return{localPublicKey:s,salt:o,cipherText:a}};q1.exports={encrypt:gF}});var am=O((jG,W1)=>{"use strict";function U1(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(U1,Error);W1.exports=U1});var K1=O(Ft=>{"use strict";var vF=Ft&&Ft.__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]})),xF=Ft&&Ft.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),G1=Ft&&Ft.__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)&&vF(e,r,t);return xF(e,r),e};Object.defineProperty(Ft,"__esModule",{value:!0});Ft.req=Ft.json=Ft.toBuffer=void 0;var yF=G1(require("http")),_F=G1(require("https"));async function z1(r){let e=0,t=[];for await(let n of r)e+=n.length,t.push(n);return Buffer.concat(t,e)}Ft.toBuffer=z1;async function bF(r){let t=(await z1(r)).toString("utf8");try{return JSON.parse(t)}catch(n){let i=n;throw i.message+=` (input: ${t})`,i}}Ft.json=bF;function wF(r,e={}){let n=((typeof r=="string"?r:r.href).startsWith("https:")?_F:yF).request(r,e),i=new Promise((s,o)=>{n.once("response",s).once("error",o).end()});return n.then=i.then.bind(i),n}Ft.req=wF});var J1=O(Qt=>{"use strict";var Y1=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]})),SF=Qt&&Qt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),X1=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)&&Y1(e,r,t);return SF(e,r),e},EF=Qt&&Qt.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Y1(e,r,t)};Object.defineProperty(Qt,"__esModule",{value:!0});Qt.Agent=void 0;var TF=X1(require("net")),V1=X1(require("http")),CF=require("https");EF(K1(),Qt);var Wr=Symbol("AgentBaseInternalState"),cm=class extends V1.Agent{constructor(e){super(e),this[Wr]={}}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(`
|
|
93
|
+
`).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 TF.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)?CF.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 V1.Agent)try{return a.addRequest(e,i)}catch(c){return n(c)}this[Wr].currentSocket=a,super.createSocket(e,t,n)},a=>{this.decrementSockets(s,o),n(a)})}createConnection(){let e=this[Wr].currentSocket;if(this[Wr].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[Wr].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[Wr]&&(this[Wr].defaultPort=e)}get protocol(){return this[Wr].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[Wr]&&(this[Wr].protocol=e)}};Qt.Agent=cm});var Q1=O(Is=>{"use strict";var AF=Is&&Is.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Is,"__esModule",{value:!0});Is.parseProxyResponse=void 0;var RF=AF(Ce()),iu=(0,RF.default)("https-proxy-agent:parse-proxy-response");function kF(r){return new Promise((e,t)=>{let n=0,i=[];function s(){let p=r.read();p?u(p):r.once("readable",s)}function o(){r.removeListener("end",a),r.removeListener("error",c),r.removeListener("readable",s)}function a(){o(),iu("onend"),t(new Error("Proxy connection ended before receiving CONNECT response"))}function c(p){o(),iu("onerror %o",p),t(p)}function u(p){i.push(p),n+=p.length;let f=Buffer.concat(i,n),m=f.indexOf(`\r
|
|
94
94
|
\r
|
|
95
|
-
`);if(
|
|
96
|
-
`),
|
|
97
|
-
`;if(n.username||n.password){let
|
|
98
|
-
`;let c=(0,
|
|
99
|
-
`);let{connect:u,buffered:p}=await c;if(e.emit("proxyConnect",u),this.emit("proxyConnect",u,e),u.statusCode===200)return e.once("socket",fF),t.secureEndpoint?(Go("Upgrading socket connection to TLS"),D1.connect({...j1(B1(t),"host","path","port"),socket:i})):i;i.destroy();let f=new Gl.Socket({writable:!1});return f.readable=!0,e.once("socket",g=>{Go("Replaying proxy buffer for failed request"),(0,aF.default)(g.listenerCount("data")>0),g.push(p),g.push(null)}),f}};zl.protocols=["http","https"];mr.HttpsProxyAgent=zl;function fF(r){r.resume()}function j1(r,...e){let t={},n;for(n in r)e.includes(n)||(t[n]=r[n]);return t}});var z1=O((hG,G1)=>{"use strict";var U1=require("url"),W1=require("https"),dF=Kh(),Kl=Uh(),hF=zh(),Yt=Hl(),mF=$h(),q1=2419200,Yh="",Xh;function zo(){}zo.prototype.setGCMAPIKey=function(r){if(r===null){Yh=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.");Yh=r};zo.prototype.setVapidDetails=function(r,e,t){if(arguments.length===1&&arguments[0]===null){Xh=null;return}Kl.validateSubject(r),Kl.validatePublicKey(e),Kl.validatePrivateKey(t),Xh={subject:r,publicKey:e,privateKey:t}};zo.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=Yh,i=Xh,s=q1,o={},a=Yt.supportedContentEncodings.AES_128_GCM,c=Yt.supportedUrgency.NORMAL,u,p,f,g;if(t){let I=["headers","gcmAPIKey","vapidDetails","TTL","contentEncoding","urgency","topic","proxy","agent","timeout"],L=Object.keys(t);for(let N=0;N<L.length;N+=1){let H=L[N];if(!I.includes(H))throw new Error("'"+H+"' is an invalid option. The valid options are ['"+I.join("', '")+"'].")}if(t.headers){o=t.headers;let N=Object.keys(o).filter(function(H){return typeof t[H]<"u"});if(N.length>0)throw new Error("Duplicated headers defined ["+N.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===Yt.supportedContentEncodings.AES_128_GCM||t.contentEncoding===Yt.supportedContentEncodings.AES_GCM)a=t.contentEncoding;else throw new Error("Unsupported content encoding specified.");if(t.urgency)if(t.urgency===Yt.supportedUrgency.VERY_LOW||t.urgency===Yt.supportedUrgency.LOW||t.urgency===Yt.supportedUrgency.NORMAL||t.urgency===Yt.supportedUrgency.HIGH)c=t.urgency;else throw new Error("Unsupported urgency specified.");if(t.topic){if(!mF.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");u=t.topic}t.proxy&&(typeof t.proxy=="string"||typeof t.proxy.host=="string"?p=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 W1.Agent?(p&&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"&&(g=t.timeout)}typeof s>"u"&&(s=q1);let y={method:"POST",headers:{TTL:s}};Object.keys(o).forEach(function(I){y.headers[I]=o[I]});let b=null;if(e){let I=hF.encrypt(r.keys.p256dh,r.keys.auth,e,a);y.headers["Content-Length"]=I.cipherText.length,y.headers["Content-Type"]="application/octet-stream",a===Yt.supportedContentEncodings.AES_128_GCM?y.headers["Content-Encoding"]=Yt.supportedContentEncodings.AES_128_GCM:a===Yt.supportedContentEncodings.AES_GCM&&(y.headers["Content-Encoding"]=Yt.supportedContentEncodings.AES_GCM,y.headers.Encryption="salt="+I.salt,y.headers["Crypto-Key"]="dh="+I.localPublicKey.toString("base64url")),b=I.cipherText}else y.headers["Content-Length"]=0;let S=r.endpoint.startsWith("https://android.googleapis.com/gcm/send"),R=r.endpoint.startsWith("https://fcm.googleapis.com/fcm/send");if(S)n?y.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 I=U1.parse(r.endpoint),L=I.protocol+"//"+I.host,N=Kl.getVapidHeaders(L,i.subject,i.publicKey,i.privateKey,a);y.headers.Authorization=N.Authorization,a===Yt.supportedContentEncodings.AES_GCM&&(y.headers["Crypto-Key"]?y.headers["Crypto-Key"]+=";"+N["Crypto-Key"]:y.headers["Crypto-Key"]=N["Crypto-Key"])}else R&&n&&(y.headers.Authorization="key="+n);return y.headers.Urgency=c,u&&(y.headers.Topic=u),y.body=b,y.endpoint=r.endpoint,p&&(y.proxy=p),f&&(y.agent=f),g&&(y.timeout=g),y};zo.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=U1.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:u}=$1();o.agent=new u(n.proxy)}let c=W1.request(o,function(u){let p="";u.on("data",function(f){p+=f}),u.on("end",function(){u.statusCode<200||u.statusCode>299?s(new dF("Received unexpected response code",u.statusCode,u.headers,p,n.endpoint)):i({statusCode:u.statusCode,body:p,headers:u.headers})})});n.timeout&&c.on("timeout",function(){c.destroy(new Error("Socket timeout"))}),c.on("error",function(u){s(u)}),n.body&&c.write(n.body),c.end()})};G1.exports=zo});var Y1=O((mG,V1)=>{"use strict";var K1=Uh(),gF=zh(),vF=z1(),xF=Kh(),yF=Hl(),Ko=new vF;V1.exports={WebPushError:xF,supportedContentEncodings:yF.supportedContentEncodings,encrypt:gF.encrypt,getVapidHeaders:K1.getVapidHeaders,generateVAPIDKeys:K1.generateVAPIDKeys,setGCMAPIKey:Ko.setGCMAPIKey,setVapidDetails:Ko.setVapidDetails,generateRequestDetails:Ko.generateRequestDetails,sendNotification:Ko.sendNotification.bind(Ko)}});var Jo=O((UG,yT)=>{"use strict";var qF=require("path"),Kr="\\\\/",mT=`[^${Kr}]`,UF=0,vn="\\.",WF="\\+",GF="\\?",Ql="\\/",zF="(?=.)",gT="[^/]",em=`(?:${Ql}|$)`,vT=`(?:^|${Ql})`,tm=`${vn}{1,2}${em}`,KF=`(?!${vn})`,VF=`(?!${vT}${tm})`,YF=`(?!${vn}{0,1}${em})`,XF=`(?!${tm})`,JF=`[^.${Ql}]`,QF=`${gT}*?`,xT={DOT_LITERAL:vn,PLUS_LITERAL:WF,QMARK_LITERAL:GF,SLASH_LITERAL:Ql,ONE_CHAR:zF,QMARK:gT,END_ANCHOR:em,DOTS_SLASH:tm,NO_DOT:KF,NO_DOTS:VF,NO_DOT_SLASH:YF,NO_DOTS_SLASH:XF,QMARK_NO_DOT:JF,STAR:QF,START_ANCHOR:vT},ZF={...xT,SLASH_LITERAL:`[${Kr}]`,QMARK:mT,STAR:`${mT}*?`,DOTS_SLASH:`${vn}{1,2}(?:[${Kr}]|$)`,NO_DOT:`(?!${vn})`,NO_DOTS:`(?!(?:^|[${Kr}])${vn}{1,2}(?:[${Kr}]|$))`,NO_DOT_SLASH:`(?!${vn}{0,1}(?:[${Kr}]|$))`,NO_DOTS_SLASH:`(?!${vn}{1,2}(?:[${Kr}]|$))`,QMARK_NO_DOT:`[^.${Kr}]`,START_ANCHOR:`(?:^|[${Kr}])`,END_ANCHOR:`(?:[${Kr}]|$)`},e3={__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"};yT.exports={DEFAULT_MAX_EXTGLOB_RECURSION:UF,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:e3,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:qF.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?ZF:xT}}});var Zl=O(jt=>{"use strict";var t3=require("path"),r3=process.platform==="win32",{REGEX_BACKSLASH:n3,REGEX_REMOVE_BACKSLASH:i3,REGEX_SPECIAL_CHARS:s3,REGEX_SPECIAL_CHARS_GLOBAL:o3}=Jo();jt.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r);jt.hasRegexChars=r=>s3.test(r);jt.isRegexChar=r=>r.length===1&&jt.hasRegexChars(r);jt.escapeRegex=r=>r.replace(o3,"\\$1");jt.toPosixSlashes=r=>r.replace(n3,"/");jt.removeBackslashes=r=>r.replace(i3,e=>e==="\\"?"":e);jt.supportsLookbehinds=()=>{let r=process.version.slice(1).split(".").map(Number);return r.length===3&&r[0]>=9||r[0]===8&&r[1]>=10};jt.isWindows=r=>r&&typeof r.windows=="boolean"?r.windows:r3===!0||t3.sep==="\\";jt.escapeLast=(r,e,t)=>{let n=r.lastIndexOf(e,t);return n===-1?r:r[n-1]==="\\"?jt.escapeLast(r,e,n-1):`${r.slice(0,n)}\\${r.slice(n)}`};jt.removePrefix=(r,e={})=>{let t=r;return t.startsWith("./")&&(t=t.slice(2),e.prefix="./"),t};jt.wrapOutput=(r,e={},t={})=>{let n=t.contains?"":"^",i=t.contains?"":"$",s=`${n}(?:${r})${i}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}});var AT=O((GG,CT)=>{"use strict";var _T=Zl(),{CHAR_ASTERISK:rm,CHAR_AT:a3,CHAR_BACKWARD_SLASH:Qo,CHAR_COMMA:c3,CHAR_DOT:nm,CHAR_EXCLAMATION_MARK:im,CHAR_FORWARD_SLASH:TT,CHAR_LEFT_CURLY_BRACE:sm,CHAR_LEFT_PARENTHESES:om,CHAR_LEFT_SQUARE_BRACKET:l3,CHAR_PLUS:u3,CHAR_QUESTION_MARK:bT,CHAR_RIGHT_CURLY_BRACE:p3,CHAR_RIGHT_PARENTHESES:wT,CHAR_RIGHT_SQUARE_BRACKET:f3}=Jo(),ST=r=>r===TT||r===Qo,ET=r=>{r.isPrefix!==!0&&(r.depth=r.isGlobstar?1/0:1)},d3=(r,e)=>{let t=e||{},n=r.length-1,i=t.parts===!0||t.scanToEnd===!0,s=[],o=[],a=[],c=r,u=-1,p=0,f=0,g=!1,y=!1,b=!1,S=!1,R=!1,I=!1,L=!1,N=!1,H=!1,W=!1,U=0,G,P,F={value:"",depth:0,isGlob:!1},T=()=>u>=n,l=()=>c.charCodeAt(u+1),h=()=>(G=P,c.charCodeAt(++u));for(;u<n;){P=h();let C;if(P===Qo){L=F.backslashes=!0,P=h(),P===sm&&(I=!0);continue}if(I===!0||P===sm){for(U++;T()!==!0&&(P=h());){if(P===Qo){L=F.backslashes=!0,h();continue}if(P===sm){U++;continue}if(I!==!0&&P===nm&&(P=h())===nm){if(g=F.isBrace=!0,b=F.isGlob=!0,W=!0,i===!0)continue;break}if(I!==!0&&P===c3){if(g=F.isBrace=!0,b=F.isGlob=!0,W=!0,i===!0)continue;break}if(P===p3&&(U--,U===0)){I=!1,g=F.isBrace=!0,W=!0;break}}if(i===!0)continue;break}if(P===TT){if(s.push(u),o.push(F),F={value:"",depth:0,isGlob:!1},W===!0)continue;if(G===nm&&u===p+1){p+=2;continue}f=u+1;continue}if(t.noext!==!0&&(P===u3||P===a3||P===rm||P===bT||P===im)===!0&&l()===om){if(b=F.isGlob=!0,S=F.isExtglob=!0,W=!0,P===im&&u===p&&(H=!0),i===!0){for(;T()!==!0&&(P=h());){if(P===Qo){L=F.backslashes=!0,P=h();continue}if(P===wT){b=F.isGlob=!0,W=!0;break}}continue}break}if(P===rm){if(G===rm&&(R=F.isGlobstar=!0),b=F.isGlob=!0,W=!0,i===!0)continue;break}if(P===bT){if(b=F.isGlob=!0,W=!0,i===!0)continue;break}if(P===l3){for(;T()!==!0&&(C=h());){if(C===Qo){L=F.backslashes=!0,h();continue}if(C===f3){y=F.isBracket=!0,b=F.isGlob=!0,W=!0;break}}if(i===!0)continue;break}if(t.nonegate!==!0&&P===im&&u===p){N=F.negated=!0,p++;continue}if(t.noparen!==!0&&P===om){if(b=F.isGlob=!0,i===!0){for(;T()!==!0&&(P=h());){if(P===om){L=F.backslashes=!0,P=h();continue}if(P===wT){W=!0;break}}continue}break}if(b===!0){if(W=!0,i===!0)continue;break}}t.noext===!0&&(S=!1,b=!1);let x=c,w="",m="";p>0&&(w=c.slice(0,p),c=c.slice(p),f-=p),x&&b===!0&&f>0?(x=c.slice(0,f),m=c.slice(f)):b===!0?(x="",m=c):x=c,x&&x!==""&&x!=="/"&&x!==c&&ST(x.charCodeAt(x.length-1))&&(x=x.slice(0,-1)),t.unescape===!0&&(m&&(m=_T.removeBackslashes(m)),x&&L===!0&&(x=_T.removeBackslashes(x)));let v={prefix:w,input:r,start:p,base:x,glob:m,isBrace:g,isBracket:y,isGlob:b,isExtglob:S,isGlobstar:R,negated:N,negatedExtglob:H};if(t.tokens===!0&&(v.maxDepth=0,ST(P)||o.push(F),v.tokens=o),t.parts===!0||t.tokens===!0){let C;for(let _=0;_<s.length;_++){let d=C?C+1:p,E=s[_],q=r.slice(d,E);t.tokens&&(_===0&&p!==0?(o[_].isPrefix=!0,o[_].value=w):o[_].value=q,ET(o[_]),v.maxDepth+=o[_].depth),(_!==0||q!=="")&&a.push(q),C=E}if(C&&C+1<r.length){let _=r.slice(C+1);a.push(_),t.tokens&&(o[o.length-1].value=_,ET(o[o.length-1]),v.maxDepth+=o[o.length-1].depth)}v.slashes=s,v.parts=a}return v};CT.exports=d3});var MT=O((zG,PT)=>{"use strict";var Zo=Jo(),St=Zl(),{MAX_LENGTH:eu,POSIX_REGEX_SOURCE:h3,REGEX_NON_SPECIAL_CHARS:m3,REGEX_SPECIAL_CHARS_BACKREF:g3,REPLACEMENTS:RT}=Zo,v3=(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=>St.escapeRegex(i)).join("..")}return t},Ns=(r,e)=>`Missing ${r}: "${e}" - use "\\\\${e}" to match literal characters`,kT=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},x3=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},OT=r=>{let e=r.trim(),t=!0;for(;t===!0;)t=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),t=!0);if(x3(e))return e.replace(/\\(.)/g,"$1")},y3=r=>{let e=r.map(OT).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},am=(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}}}}},_3=r=>{let e=0,t=[];for(;e<r.length;){let i=am(r.slice(e),!1);if(!i||i.type!=="*")return;let s=kT(i.body).map(a=>a.trim());if(s.length!==1)return;let o=OT(s[0]);if(!o||o.length!==1)return;t.push(o),e+=i.end+1}return t.length<1?void 0:`${t.length===1?St.escapeRegex(t[0]):`[${t.map(i=>St.escapeRegex(i)).join("")}]`}*`},b3=r=>{let e=0,t=r.trim(),n=am(t);for(;n;)e++,t=n.body.trim(),n=am(t);return e},w3=(r,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let t=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:Zo.DEFAULT_MAX_EXTGLOB_RECURSION,n=kT(r).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||y3(n)))return{risky:!0};for(let i of n){let s=_3(i);if(s)return{risky:!0,safeOutput:s};if(b3(i)>t)return{risky:!0}}return{risky:!1}},cm=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a string");r=RT[r]||r;let t={...e},n=typeof t.maxLength=="number"?Math.min(eu,t.maxLength):eu,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=St.isWindows(e),u=Zo.globChars(c),p=Zo.extglobChars(u),{DOT_LITERAL:f,PLUS_LITERAL:g,SLASH_LITERAL:y,ONE_CHAR:b,DOTS_SLASH:S,NO_DOT:R,NO_DOT_SLASH:I,NO_DOTS_SLASH:L,QMARK:N,QMARK_NO_DOT:H,STAR:W,START_ANCHOR:U}=u,G=A=>`(${a}(?:(?!${U}${A.dot?S:f}).)*?)`,P=t.dot?"":R,F=t.dot?N:H,T=t.bash===!0?G(t):W;t.capture&&(T=`(${T})`),typeof t.noext=="boolean"&&(t.noextglob=t.noext);let l={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=St.removePrefix(r,l),i=r.length;let h=[],x=[],w=[],m=s,v,C=()=>l.index===i-1,_=l.peek=(A=1)=>r[l.index+A],d=l.advance=()=>r[++l.index]||"",E=()=>r.slice(l.index+1),q=(A="",Y=0)=>{l.consumed+=A,l.index+=Y},M=A=>{l.output+=A.output!=null?A.output:A.value,q(A.value)},D=()=>{let A=1;for(;_()==="!"&&(_(2)!=="("||_(3)==="?");)d(),l.start++,A++;return A%2===0?!1:(l.negated=!0,l.start++,!0)},$=A=>{l[A]++,w.push(A)},K=A=>{l[A]--,w.pop()},B=A=>{if(m.type==="globstar"){let Y=l.braces>0&&(A.type==="comma"||A.type==="brace"),k=A.extglob===!0||h.length&&(A.type==="pipe"||A.type==="paren");A.type!=="slash"&&A.type!=="paren"&&!Y&&!k&&(l.output=l.output.slice(0,-m.output.length),m.type="star",m.value="*",m.output=T,l.output+=m.output)}if(h.length&&A.type!=="paren"&&(h[h.length-1].inner+=A.value),(A.value||A.output)&&M(A),m&&m.type==="text"&&A.type==="text"){m.value+=A.value,m.output=(m.output||"")+A.value;return}A.prev=m,o.push(A),m=A},de=(A,Y)=>{let k={...p[Y],conditions:1,inner:""};k.prev=m,k.parens=l.parens,k.output=l.output,k.startIndex=l.index,k.tokensIndex=o.length;let j=(t.capture?"(":"")+k.open;$("parens"),B({type:A,value:Y,output:l.output?"":b}),B({type:"paren",extglob:!0,value:d(),output:j}),h.push(k)},ie=A=>{let Y=r.slice(A.startIndex,l.index+1),k=r.slice(A.startIndex+2,l.index),j=w3(k,t);if((A.type==="plus"||A.type==="star")&&j.risky){let z=j.safeOutput?(A.output?"":b)+(t.capture?`(${j.safeOutput})`:j.safeOutput):void 0,he=o[A.tokensIndex];he.type="text",he.value=Y,he.output=z||St.escapeRegex(Y);for(let te=A.tokensIndex+1;te<o.length;te++)o[te].value="",o[te].output="",delete o[te].suffix;l.output=A.output+he.output,l.backtrack=!0,B({type:"paren",extglob:!0,value:v,output:""}),K("parens");return}let J=A.close+(t.capture?")":""),V;if(A.type==="negate"){let z=T;if(A.inner&&A.inner.length>1&&A.inner.includes("/")&&(z=G(t)),(z!==T||C()||/^\)+$/.test(E()))&&(J=A.close=`)$))${z}`),A.inner.includes("*")&&(V=E())&&/^\.[^\\/.]+$/.test(V)){let he=cm(V,{...e,fastpaths:!1}).output;J=A.close=`)${he})${z})`}A.prev.type==="bos"&&(l.negatedExtglob=!0)}B({type:"paren",extglob:!0,value:v,output:J}),K("parens")};if(t.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(r)){let A=!1,Y=r.replace(g3,(k,j,J,V,z,he)=>V==="\\"?(A=!0,k):V==="?"?j?j+V+(z?N.repeat(z.length):""):he===0?F+(z?N.repeat(z.length):""):N.repeat(J.length):V==="."?f.repeat(J.length):V==="*"?j?j+V+(z?T:""):T:j?k:`\\${k}`);return A===!0&&(t.unescape===!0?Y=Y.replace(/\\/g,""):Y=Y.replace(/\\+/g,k=>k.length%2===0?"\\\\":k?"\\":"")),Y===r&&t.contains===!0?(l.output=r,l):(l.output=St.wrapOutput(Y,l,e),l)}for(;!C();){if(v=d(),v==="\0")continue;if(v==="\\"){let k=_();if(k==="/"&&t.bash!==!0||k==="."||k===";")continue;if(!k){v+="\\",B({type:"text",value:v});continue}let j=/^\\+/.exec(E()),J=0;if(j&&j[0].length>2&&(J=j[0].length,l.index+=J,J%2!==0&&(v+="\\")),t.unescape===!0?v=d():v+=d(),l.brackets===0){B({type:"text",value:v});continue}}if(l.brackets>0&&(v!=="]"||m.value==="["||m.value==="[^")){if(t.posix!==!1&&v===":"){let k=m.value.slice(1);if(k.includes("[")&&(m.posix=!0,k.includes(":"))){let j=m.value.lastIndexOf("["),J=m.value.slice(0,j),V=m.value.slice(j+2),z=h3[V];if(z){m.value=J+z,l.backtrack=!0,d(),!s.output&&o.indexOf(m)===1&&(s.output=b);continue}}}(v==="["&&_()!==":"||v==="-"&&_()==="]")&&(v=`\\${v}`),v==="]"&&(m.value==="["||m.value==="[^")&&(v=`\\${v}`),t.posix===!0&&v==="!"&&m.value==="["&&(v="^"),m.value+=v,M({value:v});continue}if(l.quotes===1&&v!=='"'){v=St.escapeRegex(v),m.value+=v,M({value:v});continue}if(v==='"'){l.quotes=l.quotes===1?0:1,t.keepQuotes===!0&&B({type:"text",value:v});continue}if(v==="("){$("parens"),B({type:"paren",value:v});continue}if(v===")"){if(l.parens===0&&t.strictBrackets===!0)throw new SyntaxError(Ns("opening","("));let k=h[h.length-1];if(k&&l.parens===k.parens+1){ie(h.pop());continue}B({type:"paren",value:v,output:l.parens?")":"\\)"}),K("parens");continue}if(v==="["){if(t.nobracket===!0||!E().includes("]")){if(t.nobracket!==!0&&t.strictBrackets===!0)throw new SyntaxError(Ns("closing","]"));v=`\\${v}`}else $("brackets");B({type:"bracket",value:v});continue}if(v==="]"){if(t.nobracket===!0||m&&m.type==="bracket"&&m.value.length===1){B({type:"text",value:v,output:`\\${v}`});continue}if(l.brackets===0){if(t.strictBrackets===!0)throw new SyntaxError(Ns("opening","["));B({type:"text",value:v,output:`\\${v}`});continue}K("brackets");let k=m.value.slice(1);if(m.posix!==!0&&k[0]==="^"&&!k.includes("/")&&(v=`/${v}`),m.value+=v,M({value:v}),t.literalBrackets===!1||St.hasRegexChars(k))continue;let j=St.escapeRegex(m.value);if(l.output=l.output.slice(0,-m.value.length),t.literalBrackets===!0){l.output+=j,m.value=j;continue}m.value=`(${a}${j}|${m.value})`,l.output+=m.value;continue}if(v==="{"&&t.nobrace!==!0){$("braces");let k={type:"brace",value:v,output:"(",outputIndex:l.output.length,tokensIndex:l.tokens.length};x.push(k),B(k);continue}if(v==="}"){let k=x[x.length-1];if(t.nobrace===!0||!k){B({type:"text",value:v,output:v});continue}let j=")";if(k.dots===!0){let J=o.slice(),V=[];for(let z=J.length-1;z>=0&&(o.pop(),J[z].type!=="brace");z--)J[z].type!=="dots"&&V.unshift(J[z].value);j=v3(V,t),l.backtrack=!0}if(k.comma!==!0&&k.dots!==!0){let J=l.output.slice(0,k.outputIndex),V=l.tokens.slice(k.tokensIndex);k.value=k.output="\\{",v=j="\\}",l.output=J;for(let z of V)l.output+=z.output||z.value}B({type:"brace",value:v,output:j}),K("braces"),x.pop();continue}if(v==="|"){h.length>0&&h[h.length-1].conditions++,B({type:"text",value:v});continue}if(v===","){let k=v,j=x[x.length-1];j&&w[w.length-1]==="braces"&&(j.comma=!0,k="|"),B({type:"comma",value:v,output:k});continue}if(v==="/"){if(m.type==="dot"&&l.index===l.start+1){l.start=l.index+1,l.consumed="",l.output="",o.pop(),m=s;continue}B({type:"slash",value:v,output:y});continue}if(v==="."){if(l.braces>0&&m.type==="dot"){m.value==="."&&(m.output=f);let k=x[x.length-1];m.type="dots",m.output+=v,m.value+=v,k.dots=!0;continue}if(l.braces+l.parens===0&&m.type!=="bos"&&m.type!=="slash"){B({type:"text",value:v,output:f});continue}B({type:"dot",value:v,output:f});continue}if(v==="?"){if(!(m&&m.value==="(")&&t.noextglob!==!0&&_()==="("&&_(2)!=="?"){de("qmark",v);continue}if(m&&m.type==="paren"){let j=_(),J=v;if(j==="<"&&!St.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(m.value==="("&&!/[!=<:]/.test(j)||j==="<"&&!/<([!=]|\w+>)/.test(E()))&&(J=`\\${v}`),B({type:"text",value:v,output:J});continue}if(t.dot!==!0&&(m.type==="slash"||m.type==="bos")){B({type:"qmark",value:v,output:H});continue}B({type:"qmark",value:v,output:N});continue}if(v==="!"){if(t.noextglob!==!0&&_()==="("&&(_(2)!=="?"||!/[!=<:]/.test(_(3)))){de("negate",v);continue}if(t.nonegate!==!0&&l.index===0){D();continue}}if(v==="+"){if(t.noextglob!==!0&&_()==="("&&_(2)!=="?"){de("plus",v);continue}if(m&&m.value==="("||t.regex===!1){B({type:"plus",value:v,output:g});continue}if(m&&(m.type==="bracket"||m.type==="paren"||m.type==="brace")||l.parens>0){B({type:"plus",value:v});continue}B({type:"plus",value:g});continue}if(v==="@"){if(t.noextglob!==!0&&_()==="("&&_(2)!=="?"){B({type:"at",extglob:!0,value:v,output:""});continue}B({type:"text",value:v});continue}if(v!=="*"){(v==="$"||v==="^")&&(v=`\\${v}`);let k=m3.exec(E());k&&(v+=k[0],l.index+=k[0].length),B({type:"text",value:v});continue}if(m&&(m.type==="globstar"||m.star===!0)){m.type="star",m.star=!0,m.value+=v,m.output=T,l.backtrack=!0,l.globstar=!0,q(v);continue}let A=E();if(t.noextglob!==!0&&/^\([^?]/.test(A)){de("star",v);continue}if(m.type==="star"){if(t.noglobstar===!0){q(v);continue}let k=m.prev,j=k.prev,J=k.type==="slash"||k.type==="bos",V=j&&(j.type==="star"||j.type==="globstar");if(t.bash===!0&&(!J||A[0]&&A[0]!=="/")){B({type:"star",value:v,output:""});continue}let z=l.braces>0&&(k.type==="comma"||k.type==="brace"),he=h.length&&(k.type==="pipe"||k.type==="paren");if(!J&&k.type!=="paren"&&!z&&!he){B({type:"star",value:v,output:""});continue}for(;A.slice(0,3)==="/**";){let te=r[l.index+4];if(te&&te!=="/")break;A=A.slice(3),q("/**",3)}if(k.type==="bos"&&C()){m.type="globstar",m.value+=v,m.output=G(t),l.output=m.output,l.globstar=!0,q(v);continue}if(k.type==="slash"&&k.prev.type!=="bos"&&!V&&C()){l.output=l.output.slice(0,-(k.output+m.output).length),k.output=`(?:${k.output}`,m.type="globstar",m.output=G(t)+(t.strictSlashes?")":"|$)"),m.value+=v,l.globstar=!0,l.output+=k.output+m.output,q(v);continue}if(k.type==="slash"&&k.prev.type!=="bos"&&A[0]==="/"){let te=A[1]!==void 0?"|$":"";l.output=l.output.slice(0,-(k.output+m.output).length),k.output=`(?:${k.output}`,m.type="globstar",m.output=`${G(t)}${y}|${y}${te})`,m.value+=v,l.output+=k.output+m.output,l.globstar=!0,q(v+d()),B({type:"slash",value:"/",output:""});continue}if(k.type==="bos"&&A[0]==="/"){m.type="globstar",m.value+=v,m.output=`(?:^|${y}|${G(t)}${y})`,l.output=m.output,l.globstar=!0,q(v+d()),B({type:"slash",value:"/",output:""});continue}l.output=l.output.slice(0,-m.output.length),m.type="globstar",m.output=G(t),m.value+=v,l.output+=m.output,l.globstar=!0,q(v);continue}let Y={type:"star",value:v,output:T};if(t.bash===!0){Y.output=".*?",(m.type==="bos"||m.type==="slash")&&(Y.output=P+Y.output),B(Y);continue}if(m&&(m.type==="bracket"||m.type==="paren")&&t.regex===!0){Y.output=v,B(Y);continue}(l.index===l.start||m.type==="slash"||m.type==="dot")&&(m.type==="dot"?(l.output+=I,m.output+=I):t.dot===!0?(l.output+=L,m.output+=L):(l.output+=P,m.output+=P),_()!=="*"&&(l.output+=b,m.output+=b)),B(Y)}for(;l.brackets>0;){if(t.strictBrackets===!0)throw new SyntaxError(Ns("closing","]"));l.output=St.escapeLast(l.output,"["),K("brackets")}for(;l.parens>0;){if(t.strictBrackets===!0)throw new SyntaxError(Ns("closing",")"));l.output=St.escapeLast(l.output,"("),K("parens")}for(;l.braces>0;){if(t.strictBrackets===!0)throw new SyntaxError(Ns("closing","}"));l.output=St.escapeLast(l.output,"{"),K("braces")}if(t.strictSlashes!==!0&&(m.type==="star"||m.type==="bracket")&&B({type:"maybe_slash",value:"",output:`${y}?`}),l.backtrack===!0){l.output="";for(let A of l.tokens)l.output+=A.output!=null?A.output:A.value,A.suffix&&(l.output+=A.suffix)}return l};cm.fastpaths=(r,e)=>{let t={...e},n=typeof t.maxLength=="number"?Math.min(eu,t.maxLength):eu,i=r.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);r=RT[r]||r;let s=St.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:u,NO_DOT:p,NO_DOTS:f,NO_DOTS_SLASH:g,STAR:y,START_ANCHOR:b}=Zo.globChars(s),S=t.dot?f:p,R=t.dot?g:p,I=t.capture?"":"?:",L={negated:!1,prefix:""},N=t.bash===!0?".*?":y;t.capture&&(N=`(${N})`);let H=P=>P.noglobstar===!0?N:`(${I}(?:(?!${b}${P.dot?u:o}).)*?)`,W=P=>{switch(P){case"*":return`${S}${c}${N}`;case".*":return`${o}${c}${N}`;case"*.*":return`${S}${N}${o}${c}${N}`;case"*/*":return`${S}${N}${a}${c}${R}${N}`;case"**":return S+H(t);case"**/*":return`(?:${S}${H(t)}${a})?${R}${c}${N}`;case"**/*.*":return`(?:${S}${H(t)}${a})?${R}${N}${o}${c}${N}`;case"**/.*":return`(?:${S}${H(t)}${a})?${o}${c}${N}`;default:{let F=/^(.*?)\.(\w+)$/.exec(P);if(!F)return;let T=W(F[1]);return T?T+o+F[2]:void 0}}},U=St.removePrefix(r,L),G=W(U);return G&&t.strictSlashes!==!0&&(G+=`${a}?`),G};PT.exports=cm});var NT=O((KG,IT)=>{"use strict";var S3=require("path"),E3=AT(),lm=MT(),um=Zl(),T3=Jo(),C3=r=>r&&typeof r=="object"&&!Array.isArray(r),Re=(r,e,t=!1)=>{if(Array.isArray(r)){let p=r.map(g=>Re(g,e,t));return g=>{for(let y of p){let b=y(g);if(b)return b}return!1}}let n=C3(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=um.isWindows(e),o=n?Re.compileRe(r,e):Re.makeRe(r,e,!1,!0),a=o.state;delete o.state;let c=()=>!1;if(i.ignore){let p={...e,ignore:null,onMatch:null,onResult:null};c=Re(i.ignore,p,t)}let u=(p,f=!1)=>{let{isMatch:g,match:y,output:b}=Re.test(p,o,e,{glob:r,posix:s}),S={glob:r,state:a,regex:o,posix:s,input:p,output:b,match:y,isMatch:g};return typeof i.onResult=="function"&&i.onResult(S),g===!1?(S.isMatch=!1,f?S:!1):c(p)?(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&&(u.state=a),u};Re.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?um.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=Re.matchBase(r,e,t,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Re.matchBase=(r,e,t,n=um.isWindows(t))=>(e instanceof RegExp?e:Re.makeRe(e,t)).test(S3.basename(r));Re.isMatch=(r,e,t)=>Re(e,t)(r);Re.parse=(r,e)=>Array.isArray(r)?r.map(t=>Re.parse(t,e)):lm(r,{...e,fastpaths:!1});Re.scan=(r,e)=>E3(r,e);Re.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=Re.toRegex(a,e);return n===!0&&(c.state=r),c};Re.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=lm.fastpaths(r,e)),i.output||(i=lm(r,e)),Re.compileRe(i,e,t,n)};Re.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/$^/}};Re.constants=T3;IT.exports=Re});var DT=O((VG,LT)=>{"use strict";LT.exports=NT()});var WT=O((YG,UT)=>{"use strict";var ta=require("fs"),{Readable:A3}=require("stream"),ea=require("path"),{promisify:iu}=require("util"),pm=DT(),R3=iu(ta.readdir),k3=iu(ta.stat),BT=iu(ta.lstat),O3=iu(ta.realpath),P3="!",$T="READDIRP_RECURSIVE_ERROR",M3=new Set(["ENOENT","EPERM","EACCES","ELOOP",$T]),fm="files",qT="directories",ru="files_directories",tu="all",jT=[fm,qT,ru,tu],I3=r=>M3.has(r.code),[FT,N3]=process.versions.node.split(".").slice(0,2).map(r=>Number.parseInt(r,10)),L3=process.platform==="win32"&&(FT>10||FT===10&&N3>=5),HT=r=>{if(r!==void 0){if(typeof r=="function")return r;if(typeof r=="string"){let e=pm(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)===P3?t.push(pm(i.slice(1))):e.push(pm(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))}}},nu=class r extends A3{static get defaultOptions(){return{root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:fm,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=HT(t.fileFilter),this._directoryFilter=HT(t.directoryFilter);let s=t.lstat?BT:k3;L3?this._stat=o=>s(o,{bigint:!0}):this._stat=s,this._maxDepth=t.depth,this._wantsDir=[qT,ru,tu].includes(i),this._wantsFile=[fm,ru,tu].includes(i),this._wantsEverything=i===tu,this._root=ea.resolve(n),this._isDirent="Dirent"in ta&&!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 R3(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=ea.resolve(ea.join(t,i));n={path:ea.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){I3(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 O3(n),s=await BT(i);if(s.isFile())return"file";if(s.isDirectory()){let o=i.length;if(n.startsWith(i)&&n.substr(o,1)===ea.sep){let a=new Error(`Circular symlink detected: "${n}" points to "${i}"`);return a.code=$T,this._onError(a)}return"directory"}}catch(i){this._onError(i)}}}}_includeAsFile(e){let t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}},Ls=(r,e={})=>{let t=e.entryType||e.type;if(t==="both"&&(t=ru),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&&!jT.includes(t))throw new Error(`readdirp: Invalid type passed. Use one of ${jT.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=r,new nu(e)},D3=(r,e={})=>new Promise((t,n)=>{let i=[];Ls(r,e).on("data",s=>i.push(s)).on("end",()=>t(i)).on("error",s=>n(s))});Ls.promise=D3;Ls.ReaddirpStream=nu;Ls.default=Ls;UT.exports=Ls});var ra=O((XG,YT)=>{"use strict";var B3=require("path"),Vr="\\\\/",GT=`[^${Vr}]`,j3=0,xn="\\.",F3="\\+",H3="\\?",su="\\/",$3="(?=.)",zT="[^/]",dm=`(?:${su}|$)`,KT=`(?:^|${su})`,hm=`${xn}{1,2}${dm}`,q3=`(?!${xn})`,U3=`(?!${KT}${hm})`,W3=`(?!${xn}{0,1}${dm})`,G3=`(?!${hm})`,z3=`[^.${su}]`,K3=`${zT}*?`,VT={DOT_LITERAL:xn,PLUS_LITERAL:F3,QMARK_LITERAL:H3,SLASH_LITERAL:su,ONE_CHAR:$3,QMARK:zT,END_ANCHOR:dm,DOTS_SLASH:hm,NO_DOT:q3,NO_DOTS:U3,NO_DOT_SLASH:W3,NO_DOTS_SLASH:G3,QMARK_NO_DOT:z3,STAR:K3,START_ANCHOR:KT},V3={...VT,SLASH_LITERAL:`[${Vr}]`,QMARK:GT,STAR:`${GT}*?`,DOTS_SLASH:`${xn}{1,2}(?:[${Vr}]|$)`,NO_DOT:`(?!${xn})`,NO_DOTS:`(?!(?:^|[${Vr}])${xn}{1,2}(?:[${Vr}]|$))`,NO_DOT_SLASH:`(?!${xn}{0,1}(?:[${Vr}]|$))`,NO_DOTS_SLASH:`(?!${xn}{1,2}(?:[${Vr}]|$))`,QMARK_NO_DOT:`[^.${Vr}]`,START_ANCHOR:`(?:^|[${Vr}])`,END_ANCHOR:`(?:[${Vr}]|$)`},Y3={__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"};YT.exports={DEFAULT_MAX_EXTGLOB_RECURSION:j3,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Y3,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:B3.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?V3:VT}}});var ou=O(Ft=>{"use strict";var X3=require("path"),J3=process.platform==="win32",{REGEX_BACKSLASH:Q3,REGEX_REMOVE_BACKSLASH:Z3,REGEX_SPECIAL_CHARS:eH,REGEX_SPECIAL_CHARS_GLOBAL:tH}=ra();Ft.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r);Ft.hasRegexChars=r=>eH.test(r);Ft.isRegexChar=r=>r.length===1&&Ft.hasRegexChars(r);Ft.escapeRegex=r=>r.replace(tH,"\\$1");Ft.toPosixSlashes=r=>r.replace(Q3,"/");Ft.removeBackslashes=r=>r.replace(Z3,e=>e==="\\"?"":e);Ft.supportsLookbehinds=()=>{let r=process.version.slice(1).split(".").map(Number);return r.length===3&&r[0]>=9||r[0]===8&&r[1]>=10};Ft.isWindows=r=>r&&typeof r.windows=="boolean"?r.windows:J3===!0||X3.sep==="\\";Ft.escapeLast=(r,e,t)=>{let n=r.lastIndexOf(e,t);return n===-1?r:r[n-1]==="\\"?Ft.escapeLast(r,e,n-1):`${r.slice(0,n)}\\${r.slice(n)}`};Ft.removePrefix=(r,e={})=>{let t=r;return t.startsWith("./")&&(t=t.slice(2),e.prefix="./"),t};Ft.wrapOutput=(r,e={},t={})=>{let n=t.contains?"":"^",i=t.contains?"":"$",s=`${n}(?:${r})${i}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}});var nC=O((QG,rC)=>{"use strict";var XT=ou(),{CHAR_ASTERISK:mm,CHAR_AT:rH,CHAR_BACKWARD_SLASH:na,CHAR_COMMA:nH,CHAR_DOT:gm,CHAR_EXCLAMATION_MARK:vm,CHAR_FORWARD_SLASH:tC,CHAR_LEFT_CURLY_BRACE:xm,CHAR_LEFT_PARENTHESES:ym,CHAR_LEFT_SQUARE_BRACKET:iH,CHAR_PLUS:sH,CHAR_QUESTION_MARK:JT,CHAR_RIGHT_CURLY_BRACE:oH,CHAR_RIGHT_PARENTHESES:QT,CHAR_RIGHT_SQUARE_BRACKET:aH}=ra(),ZT=r=>r===tC||r===na,eC=r=>{r.isPrefix!==!0&&(r.depth=r.isGlobstar?1/0:1)},cH=(r,e)=>{let t=e||{},n=r.length-1,i=t.parts===!0||t.scanToEnd===!0,s=[],o=[],a=[],c=r,u=-1,p=0,f=0,g=!1,y=!1,b=!1,S=!1,R=!1,I=!1,L=!1,N=!1,H=!1,W=!1,U=0,G,P,F={value:"",depth:0,isGlob:!1},T=()=>u>=n,l=()=>c.charCodeAt(u+1),h=()=>(G=P,c.charCodeAt(++u));for(;u<n;){P=h();let C;if(P===na){L=F.backslashes=!0,P=h(),P===xm&&(I=!0);continue}if(I===!0||P===xm){for(U++;T()!==!0&&(P=h());){if(P===na){L=F.backslashes=!0,h();continue}if(P===xm){U++;continue}if(I!==!0&&P===gm&&(P=h())===gm){if(g=F.isBrace=!0,b=F.isGlob=!0,W=!0,i===!0)continue;break}if(I!==!0&&P===nH){if(g=F.isBrace=!0,b=F.isGlob=!0,W=!0,i===!0)continue;break}if(P===oH&&(U--,U===0)){I=!1,g=F.isBrace=!0,W=!0;break}}if(i===!0)continue;break}if(P===tC){if(s.push(u),o.push(F),F={value:"",depth:0,isGlob:!1},W===!0)continue;if(G===gm&&u===p+1){p+=2;continue}f=u+1;continue}if(t.noext!==!0&&(P===sH||P===rH||P===mm||P===JT||P===vm)===!0&&l()===ym){if(b=F.isGlob=!0,S=F.isExtglob=!0,W=!0,P===vm&&u===p&&(H=!0),i===!0){for(;T()!==!0&&(P=h());){if(P===na){L=F.backslashes=!0,P=h();continue}if(P===QT){b=F.isGlob=!0,W=!0;break}}continue}break}if(P===mm){if(G===mm&&(R=F.isGlobstar=!0),b=F.isGlob=!0,W=!0,i===!0)continue;break}if(P===JT){if(b=F.isGlob=!0,W=!0,i===!0)continue;break}if(P===iH){for(;T()!==!0&&(C=h());){if(C===na){L=F.backslashes=!0,h();continue}if(C===aH){y=F.isBracket=!0,b=F.isGlob=!0,W=!0;break}}if(i===!0)continue;break}if(t.nonegate!==!0&&P===vm&&u===p){N=F.negated=!0,p++;continue}if(t.noparen!==!0&&P===ym){if(b=F.isGlob=!0,i===!0){for(;T()!==!0&&(P=h());){if(P===ym){L=F.backslashes=!0,P=h();continue}if(P===QT){W=!0;break}}continue}break}if(b===!0){if(W=!0,i===!0)continue;break}}t.noext===!0&&(S=!1,b=!1);let x=c,w="",m="";p>0&&(w=c.slice(0,p),c=c.slice(p),f-=p),x&&b===!0&&f>0?(x=c.slice(0,f),m=c.slice(f)):b===!0?(x="",m=c):x=c,x&&x!==""&&x!=="/"&&x!==c&&ZT(x.charCodeAt(x.length-1))&&(x=x.slice(0,-1)),t.unescape===!0&&(m&&(m=XT.removeBackslashes(m)),x&&L===!0&&(x=XT.removeBackslashes(x)));let v={prefix:w,input:r,start:p,base:x,glob:m,isBrace:g,isBracket:y,isGlob:b,isExtglob:S,isGlobstar:R,negated:N,negatedExtglob:H};if(t.tokens===!0&&(v.maxDepth=0,ZT(P)||o.push(F),v.tokens=o),t.parts===!0||t.tokens===!0){let C;for(let _=0;_<s.length;_++){let d=C?C+1:p,E=s[_],q=r.slice(d,E);t.tokens&&(_===0&&p!==0?(o[_].isPrefix=!0,o[_].value=w):o[_].value=q,eC(o[_]),v.maxDepth+=o[_].depth),(_!==0||q!=="")&&a.push(q),C=E}if(C&&C+1<r.length){let _=r.slice(C+1);a.push(_),t.tokens&&(o[o.length-1].value=_,eC(o[o.length-1]),v.maxDepth+=o[o.length-1].depth)}v.slashes=s,v.parts=a}return v};rC.exports=cH});var cC=O((ZG,aC)=>{"use strict";var ia=ra(),Et=ou(),{MAX_LENGTH:au,POSIX_REGEX_SOURCE:lH,REGEX_NON_SPECIAL_CHARS:uH,REGEX_SPECIAL_CHARS_BACKREF:pH,REPLACEMENTS:iC}=ia,fH=(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=>Et.escapeRegex(i)).join("..")}return t},Ds=(r,e)=>`Missing ${r}: "${e}" - use "\\\\${e}" to match literal characters`,sC=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},dH=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},oC=r=>{let e=r.trim(),t=!0;for(;t===!0;)t=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),t=!0);if(dH(e))return e.replace(/\\(.)/g,"$1")},hH=r=>{let e=r.map(oC).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},_m=(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}}}}},mH=r=>{let e=0,t=[];for(;e<r.length;){let i=_m(r.slice(e),!1);if(!i||i.type!=="*")return;let s=sC(i.body).map(a=>a.trim());if(s.length!==1)return;let o=oC(s[0]);if(!o||o.length!==1)return;t.push(o),e+=i.end+1}return t.length<1?void 0:`${t.length===1?Et.escapeRegex(t[0]):`[${t.map(i=>Et.escapeRegex(i)).join("")}]`}*`},gH=r=>{let e=0,t=r.trim(),n=_m(t);for(;n;)e++,t=n.body.trim(),n=_m(t);return e},vH=(r,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let t=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:ia.DEFAULT_MAX_EXTGLOB_RECURSION,n=sC(r).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||hH(n)))return{risky:!0};for(let i of n){let s=mH(i);if(s)return{risky:!0,safeOutput:s};if(gH(i)>t)return{risky:!0}}return{risky:!1}},bm=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a string");r=iC[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=Et.isWindows(e),u=ia.globChars(c),p=ia.extglobChars(u),{DOT_LITERAL:f,PLUS_LITERAL:g,SLASH_LITERAL:y,ONE_CHAR:b,DOTS_SLASH:S,NO_DOT:R,NO_DOT_SLASH:I,NO_DOTS_SLASH:L,QMARK:N,QMARK_NO_DOT:H,STAR:W,START_ANCHOR:U}=u,G=A=>`(${a}(?:(?!${U}${A.dot?S:f}).)*?)`,P=t.dot?"":R,F=t.dot?N:H,T=t.bash===!0?G(t):W;t.capture&&(T=`(${T})`),typeof t.noext=="boolean"&&(t.noextglob=t.noext);let l={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=Et.removePrefix(r,l),i=r.length;let h=[],x=[],w=[],m=s,v,C=()=>l.index===i-1,_=l.peek=(A=1)=>r[l.index+A],d=l.advance=()=>r[++l.index]||"",E=()=>r.slice(l.index+1),q=(A="",Y=0)=>{l.consumed+=A,l.index+=Y},M=A=>{l.output+=A.output!=null?A.output:A.value,q(A.value)},D=()=>{let A=1;for(;_()==="!"&&(_(2)!=="("||_(3)==="?");)d(),l.start++,A++;return A%2===0?!1:(l.negated=!0,l.start++,!0)},$=A=>{l[A]++,w.push(A)},K=A=>{l[A]--,w.pop()},B=A=>{if(m.type==="globstar"){let Y=l.braces>0&&(A.type==="comma"||A.type==="brace"),k=A.extglob===!0||h.length&&(A.type==="pipe"||A.type==="paren");A.type!=="slash"&&A.type!=="paren"&&!Y&&!k&&(l.output=l.output.slice(0,-m.output.length),m.type="star",m.value="*",m.output=T,l.output+=m.output)}if(h.length&&A.type!=="paren"&&(h[h.length-1].inner+=A.value),(A.value||A.output)&&M(A),m&&m.type==="text"&&A.type==="text"){m.value+=A.value,m.output=(m.output||"")+A.value;return}A.prev=m,o.push(A),m=A},de=(A,Y)=>{let k={...p[Y],conditions:1,inner:""};k.prev=m,k.parens=l.parens,k.output=l.output,k.startIndex=l.index,k.tokensIndex=o.length;let j=(t.capture?"(":"")+k.open;$("parens"),B({type:A,value:Y,output:l.output?"":b}),B({type:"paren",extglob:!0,value:d(),output:j}),h.push(k)},ie=A=>{let Y=r.slice(A.startIndex,l.index+1),k=r.slice(A.startIndex+2,l.index),j=vH(k,t);if((A.type==="plus"||A.type==="star")&&j.risky){let z=j.safeOutput?(A.output?"":b)+(t.capture?`(${j.safeOutput})`:j.safeOutput):void 0,he=o[A.tokensIndex];he.type="text",he.value=Y,he.output=z||Et.escapeRegex(Y);for(let te=A.tokensIndex+1;te<o.length;te++)o[te].value="",o[te].output="",delete o[te].suffix;l.output=A.output+he.output,l.backtrack=!0,B({type:"paren",extglob:!0,value:v,output:""}),K("parens");return}let J=A.close+(t.capture?")":""),V;if(A.type==="negate"){let z=T;if(A.inner&&A.inner.length>1&&A.inner.includes("/")&&(z=G(t)),(z!==T||C()||/^\)+$/.test(E()))&&(J=A.close=`)$))${z}`),A.inner.includes("*")&&(V=E())&&/^\.[^\\/.]+$/.test(V)){let he=bm(V,{...e,fastpaths:!1}).output;J=A.close=`)${he})${z})`}A.prev.type==="bos"&&(l.negatedExtglob=!0)}B({type:"paren",extglob:!0,value:v,output:J}),K("parens")};if(t.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(r)){let A=!1,Y=r.replace(pH,(k,j,J,V,z,he)=>V==="\\"?(A=!0,k):V==="?"?j?j+V+(z?N.repeat(z.length):""):he===0?F+(z?N.repeat(z.length):""):N.repeat(J.length):V==="."?f.repeat(J.length):V==="*"?j?j+V+(z?T:""):T:j?k:`\\${k}`);return A===!0&&(t.unescape===!0?Y=Y.replace(/\\/g,""):Y=Y.replace(/\\+/g,k=>k.length%2===0?"\\\\":k?"\\":"")),Y===r&&t.contains===!0?(l.output=r,l):(l.output=Et.wrapOutput(Y,l,e),l)}for(;!C();){if(v=d(),v==="\0")continue;if(v==="\\"){let k=_();if(k==="/"&&t.bash!==!0||k==="."||k===";")continue;if(!k){v+="\\",B({type:"text",value:v});continue}let j=/^\\+/.exec(E()),J=0;if(j&&j[0].length>2&&(J=j[0].length,l.index+=J,J%2!==0&&(v+="\\")),t.unescape===!0?v=d():v+=d(),l.brackets===0){B({type:"text",value:v});continue}}if(l.brackets>0&&(v!=="]"||m.value==="["||m.value==="[^")){if(t.posix!==!1&&v===":"){let k=m.value.slice(1);if(k.includes("[")&&(m.posix=!0,k.includes(":"))){let j=m.value.lastIndexOf("["),J=m.value.slice(0,j),V=m.value.slice(j+2),z=lH[V];if(z){m.value=J+z,l.backtrack=!0,d(),!s.output&&o.indexOf(m)===1&&(s.output=b);continue}}}(v==="["&&_()!==":"||v==="-"&&_()==="]")&&(v=`\\${v}`),v==="]"&&(m.value==="["||m.value==="[^")&&(v=`\\${v}`),t.posix===!0&&v==="!"&&m.value==="["&&(v="^"),m.value+=v,M({value:v});continue}if(l.quotes===1&&v!=='"'){v=Et.escapeRegex(v),m.value+=v,M({value:v});continue}if(v==='"'){l.quotes=l.quotes===1?0:1,t.keepQuotes===!0&&B({type:"text",value:v});continue}if(v==="("){$("parens"),B({type:"paren",value:v});continue}if(v===")"){if(l.parens===0&&t.strictBrackets===!0)throw new SyntaxError(Ds("opening","("));let k=h[h.length-1];if(k&&l.parens===k.parens+1){ie(h.pop());continue}B({type:"paren",value:v,output:l.parens?")":"\\)"}),K("parens");continue}if(v==="["){if(t.nobracket===!0||!E().includes("]")){if(t.nobracket!==!0&&t.strictBrackets===!0)throw new SyntaxError(Ds("closing","]"));v=`\\${v}`}else $("brackets");B({type:"bracket",value:v});continue}if(v==="]"){if(t.nobracket===!0||m&&m.type==="bracket"&&m.value.length===1){B({type:"text",value:v,output:`\\${v}`});continue}if(l.brackets===0){if(t.strictBrackets===!0)throw new SyntaxError(Ds("opening","["));B({type:"text",value:v,output:`\\${v}`});continue}K("brackets");let k=m.value.slice(1);if(m.posix!==!0&&k[0]==="^"&&!k.includes("/")&&(v=`/${v}`),m.value+=v,M({value:v}),t.literalBrackets===!1||Et.hasRegexChars(k))continue;let j=Et.escapeRegex(m.value);if(l.output=l.output.slice(0,-m.value.length),t.literalBrackets===!0){l.output+=j,m.value=j;continue}m.value=`(${a}${j}|${m.value})`,l.output+=m.value;continue}if(v==="{"&&t.nobrace!==!0){$("braces");let k={type:"brace",value:v,output:"(",outputIndex:l.output.length,tokensIndex:l.tokens.length};x.push(k),B(k);continue}if(v==="}"){let k=x[x.length-1];if(t.nobrace===!0||!k){B({type:"text",value:v,output:v});continue}let j=")";if(k.dots===!0){let J=o.slice(),V=[];for(let z=J.length-1;z>=0&&(o.pop(),J[z].type!=="brace");z--)J[z].type!=="dots"&&V.unshift(J[z].value);j=fH(V,t),l.backtrack=!0}if(k.comma!==!0&&k.dots!==!0){let J=l.output.slice(0,k.outputIndex),V=l.tokens.slice(k.tokensIndex);k.value=k.output="\\{",v=j="\\}",l.output=J;for(let z of V)l.output+=z.output||z.value}B({type:"brace",value:v,output:j}),K("braces"),x.pop();continue}if(v==="|"){h.length>0&&h[h.length-1].conditions++,B({type:"text",value:v});continue}if(v===","){let k=v,j=x[x.length-1];j&&w[w.length-1]==="braces"&&(j.comma=!0,k="|"),B({type:"comma",value:v,output:k});continue}if(v==="/"){if(m.type==="dot"&&l.index===l.start+1){l.start=l.index+1,l.consumed="",l.output="",o.pop(),m=s;continue}B({type:"slash",value:v,output:y});continue}if(v==="."){if(l.braces>0&&m.type==="dot"){m.value==="."&&(m.output=f);let k=x[x.length-1];m.type="dots",m.output+=v,m.value+=v,k.dots=!0;continue}if(l.braces+l.parens===0&&m.type!=="bos"&&m.type!=="slash"){B({type:"text",value:v,output:f});continue}B({type:"dot",value:v,output:f});continue}if(v==="?"){if(!(m&&m.value==="(")&&t.noextglob!==!0&&_()==="("&&_(2)!=="?"){de("qmark",v);continue}if(m&&m.type==="paren"){let j=_(),J=v;if(j==="<"&&!Et.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(m.value==="("&&!/[!=<:]/.test(j)||j==="<"&&!/<([!=]|\w+>)/.test(E()))&&(J=`\\${v}`),B({type:"text",value:v,output:J});continue}if(t.dot!==!0&&(m.type==="slash"||m.type==="bos")){B({type:"qmark",value:v,output:H});continue}B({type:"qmark",value:v,output:N});continue}if(v==="!"){if(t.noextglob!==!0&&_()==="("&&(_(2)!=="?"||!/[!=<:]/.test(_(3)))){de("negate",v);continue}if(t.nonegate!==!0&&l.index===0){D();continue}}if(v==="+"){if(t.noextglob!==!0&&_()==="("&&_(2)!=="?"){de("plus",v);continue}if(m&&m.value==="("||t.regex===!1){B({type:"plus",value:v,output:g});continue}if(m&&(m.type==="bracket"||m.type==="paren"||m.type==="brace")||l.parens>0){B({type:"plus",value:v});continue}B({type:"plus",value:g});continue}if(v==="@"){if(t.noextglob!==!0&&_()==="("&&_(2)!=="?"){B({type:"at",extglob:!0,value:v,output:""});continue}B({type:"text",value:v});continue}if(v!=="*"){(v==="$"||v==="^")&&(v=`\\${v}`);let k=uH.exec(E());k&&(v+=k[0],l.index+=k[0].length),B({type:"text",value:v});continue}if(m&&(m.type==="globstar"||m.star===!0)){m.type="star",m.star=!0,m.value+=v,m.output=T,l.backtrack=!0,l.globstar=!0,q(v);continue}let A=E();if(t.noextglob!==!0&&/^\([^?]/.test(A)){de("star",v);continue}if(m.type==="star"){if(t.noglobstar===!0){q(v);continue}let k=m.prev,j=k.prev,J=k.type==="slash"||k.type==="bos",V=j&&(j.type==="star"||j.type==="globstar");if(t.bash===!0&&(!J||A[0]&&A[0]!=="/")){B({type:"star",value:v,output:""});continue}let z=l.braces>0&&(k.type==="comma"||k.type==="brace"),he=h.length&&(k.type==="pipe"||k.type==="paren");if(!J&&k.type!=="paren"&&!z&&!he){B({type:"star",value:v,output:""});continue}for(;A.slice(0,3)==="/**";){let te=r[l.index+4];if(te&&te!=="/")break;A=A.slice(3),q("/**",3)}if(k.type==="bos"&&C()){m.type="globstar",m.value+=v,m.output=G(t),l.output=m.output,l.globstar=!0,q(v);continue}if(k.type==="slash"&&k.prev.type!=="bos"&&!V&&C()){l.output=l.output.slice(0,-(k.output+m.output).length),k.output=`(?:${k.output}`,m.type="globstar",m.output=G(t)+(t.strictSlashes?")":"|$)"),m.value+=v,l.globstar=!0,l.output+=k.output+m.output,q(v);continue}if(k.type==="slash"&&k.prev.type!=="bos"&&A[0]==="/"){let te=A[1]!==void 0?"|$":"";l.output=l.output.slice(0,-(k.output+m.output).length),k.output=`(?:${k.output}`,m.type="globstar",m.output=`${G(t)}${y}|${y}${te})`,m.value+=v,l.output+=k.output+m.output,l.globstar=!0,q(v+d()),B({type:"slash",value:"/",output:""});continue}if(k.type==="bos"&&A[0]==="/"){m.type="globstar",m.value+=v,m.output=`(?:^|${y}|${G(t)}${y})`,l.output=m.output,l.globstar=!0,q(v+d()),B({type:"slash",value:"/",output:""});continue}l.output=l.output.slice(0,-m.output.length),m.type="globstar",m.output=G(t),m.value+=v,l.output+=m.output,l.globstar=!0,q(v);continue}let Y={type:"star",value:v,output:T};if(t.bash===!0){Y.output=".*?",(m.type==="bos"||m.type==="slash")&&(Y.output=P+Y.output),B(Y);continue}if(m&&(m.type==="bracket"||m.type==="paren")&&t.regex===!0){Y.output=v,B(Y);continue}(l.index===l.start||m.type==="slash"||m.type==="dot")&&(m.type==="dot"?(l.output+=I,m.output+=I):t.dot===!0?(l.output+=L,m.output+=L):(l.output+=P,m.output+=P),_()!=="*"&&(l.output+=b,m.output+=b)),B(Y)}for(;l.brackets>0;){if(t.strictBrackets===!0)throw new SyntaxError(Ds("closing","]"));l.output=Et.escapeLast(l.output,"["),K("brackets")}for(;l.parens>0;){if(t.strictBrackets===!0)throw new SyntaxError(Ds("closing",")"));l.output=Et.escapeLast(l.output,"("),K("parens")}for(;l.braces>0;){if(t.strictBrackets===!0)throw new SyntaxError(Ds("closing","}"));l.output=Et.escapeLast(l.output,"{"),K("braces")}if(t.strictSlashes!==!0&&(m.type==="star"||m.type==="bracket")&&B({type:"maybe_slash",value:"",output:`${y}?`}),l.backtrack===!0){l.output="";for(let A of l.tokens)l.output+=A.output!=null?A.output:A.value,A.suffix&&(l.output+=A.suffix)}return l};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=iC[r]||r;let s=Et.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:u,NO_DOT:p,NO_DOTS:f,NO_DOTS_SLASH:g,STAR:y,START_ANCHOR:b}=ia.globChars(s),S=t.dot?f:p,R=t.dot?g:p,I=t.capture?"":"?:",L={negated:!1,prefix:""},N=t.bash===!0?".*?":y;t.capture&&(N=`(${N})`);let H=P=>P.noglobstar===!0?N:`(${I}(?:(?!${b}${P.dot?u:o}).)*?)`,W=P=>{switch(P){case"*":return`${S}${c}${N}`;case".*":return`${o}${c}${N}`;case"*.*":return`${S}${N}${o}${c}${N}`;case"*/*":return`${S}${N}${a}${c}${R}${N}`;case"**":return S+H(t);case"**/*":return`(?:${S}${H(t)}${a})?${R}${c}${N}`;case"**/*.*":return`(?:${S}${H(t)}${a})?${R}${N}${o}${c}${N}`;case"**/.*":return`(?:${S}${H(t)}${a})?${o}${c}${N}`;default:{let F=/^(.*?)\.(\w+)$/.exec(P);if(!F)return;let T=W(F[1]);return T?T+o+F[2]:void 0}}},U=Et.removePrefix(r,L),G=W(U);return G&&t.strictSlashes!==!0&&(G+=`${a}?`),G};aC.exports=bm});var uC=O((ez,lC)=>{"use strict";var xH=require("path"),yH=nC(),wm=cC(),Sm=ou(),_H=ra(),bH=r=>r&&typeof r=="object"&&!Array.isArray(r),ke=(r,e,t=!1)=>{if(Array.isArray(r)){let p=r.map(g=>ke(g,e,t));return g=>{for(let y of p){let b=y(g);if(b)return b}return!1}}let n=bH(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=Sm.isWindows(e),o=n?ke.compileRe(r,e):ke.makeRe(r,e,!1,!0),a=o.state;delete o.state;let c=()=>!1;if(i.ignore){let p={...e,ignore:null,onMatch:null,onResult:null};c=ke(i.ignore,p,t)}let u=(p,f=!1)=>{let{isMatch:g,match:y,output:b}=ke.test(p,o,e,{glob:r,posix:s}),S={glob:r,state:a,regex:o,posix:s,input:p,output:b,match:y,isMatch:g};return typeof i.onResult=="function"&&i.onResult(S),g===!1?(S.isMatch=!1,f?S:!1):c(p)?(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&&(u.state=a),u};ke.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?Sm.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=ke.matchBase(r,e,t,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};ke.matchBase=(r,e,t,n=Sm.isWindows(t))=>(e instanceof RegExp?e:ke.makeRe(e,t)).test(xH.basename(r));ke.isMatch=(r,e,t)=>ke(e,t)(r);ke.parse=(r,e)=>Array.isArray(r)?r.map(t=>ke.parse(t,e)):wm(r,{...e,fastpaths:!1});ke.scan=(r,e)=>yH(r,e);ke.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=ke.toRegex(a,e);return n===!0&&(c.state=r),c};ke.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=wm.fastpaths(r,e)),i.output||(i=wm(r,e)),ke.compileRe(i,e,t,n)};ke.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/$^/}};ke.constants=_H;lC.exports=ke});var fC=O((tz,pC)=>{"use strict";pC.exports=uC()});var Em=O((rz,dC)=>{dC.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 yC=O((vC,xC)=>{"use strict";Object.defineProperty(vC,"__esModule",{value:!0});var gC=fC(),wH=Em(),hC="!",SH={returnIndex:!1},EH=r=>Array.isArray(r)?r:[r],TH=(r,e)=>{if(typeof r=="function")return r;if(typeof r=="string"){let t=gC(r,e);return n=>r===n||t(n)}return r instanceof RegExp?t=>r.test(t):t=>!1},mC=(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=wH(s,!1);for(let c=0;c<e.length;c++){let u=e[c];if(u(o))return n?-1:!1}let a=i&&[o].concat(t.slice(1));for(let c=0;c<r.length;c++){let u=r[c];if(i?u(...a):u(o))return n?c:!0}return n?-1:!1},Tm=(r,e,t=SH)=>{if(r==null)throw new TypeError("anymatch: specify first argument");let n=typeof t=="boolean"?{returnIndex:t}:t,i=n.returnIndex||!1,s=EH(r),o=s.filter(c=>typeof c=="string"&&c.charAt(0)===hC).map(c=>c.slice(1)).map(c=>gC(c,n)),a=s.filter(c=>typeof c!="string"||typeof c=="string"&&c.charAt(0)!==hC).map(c=>TH(c,n));return e==null?(c,u=!1)=>mC(a,o,c,typeof u=="boolean"?u:!1):mC(a,o,e,i)};Tm.default=Tm;xC.exports=Tm});var bC=O((nz,_C)=>{_C.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 Cm=O((iz,SC)=>{var CH=bC(),wC={"{":"}","(":")","[":"]"},AH=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=wC[a];if(c){var u=r.indexOf(c,e);u!==-1&&(e=u+1)}if(r[e]==="!")return!0}else e++}return!1},RH=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=wC[t];if(n){var i=r.indexOf(n,e);i!==-1&&(e=i+1)}if(r[e]==="!")return!0}else e++}return!1};SC.exports=function(e,t){if(typeof e!="string"||e==="")return!1;if(CH(e))return!0;var n=AH;return t&&t.strict===!1&&(n=RH),n(e)}});var TC=O((sz,EC)=>{"use strict";var kH=Cm(),OH=require("path").posix.dirname,PH=require("os").platform()==="win32",Am="/",MH=/\\/g,IH=/[\{\[].*[\}\]]$/,NH=/(^|[^\\])([\{\[]|\([^\)]+$)/,LH=/\\([\!\*\?\|\[\]\(\)\{\}])/g;EC.exports=function(e,t){var n=Object.assign({flipBackslashes:!0},t);n.flipBackslashes&&PH&&e.indexOf(Am)<0&&(e=e.replace(MH,Am)),IH.test(e)&&(e+=Am),e+="a";do e=OH(e);while(kH(e)||NH.test(e));return e.replace(LH,"$1")}});var cu=O(vr=>{"use strict";vr.isInteger=r=>typeof r=="number"?Number.isInteger(r):typeof r=="string"&&r.trim()!==""?Number.isInteger(Number(r)):!1;vr.find=(r,e)=>r.nodes.find(t=>t.type===e);vr.exceedsLimit=(r,e,t=1,n)=>n===!1||!vr.isInteger(r)||!vr.isInteger(e)?!1:(Number(e)-Number(r))/Number(t)>=n;vr.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)};vr.encloseBrace=r=>r.type!=="brace"?!1:r.commas>>0+r.ranges>>0===0?(r.invalid=!0,!0):!1;vr.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;vr.isOpenOrClose=r=>r.type==="open"||r.type==="close"?!0:r.open===!0||r.close===!0;vr.reduce=r=>r.reduce((e,t)=>(t.type==="text"&&e.push(t.value),t.type==="range"&&(t.type="text"),e),[]);vr.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 lu=O((az,AC)=>{"use strict";var CC=cu();AC.exports=(r,e={})=>{let t=(n,i={})=>{let s=e.escapeInvalid&&CC.isInvalidBrace(i),o=n.invalid===!0&&e.escapeInvalid===!0,a="";if(n.value)return(s||o)&&CC.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 kC=O((cz,RC)=>{"use strict";RC.exports=function(r){return typeof r=="number"?r-r===0:typeof r=="string"&&r.trim()!==""?Number.isFinite?Number.isFinite(+r):isFinite(+r):!1}});var jC=O((lz,BC)=>{"use strict";var OC=kC(),mi=(r,e,t)=>{if(OC(r)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||r===e)return String(r);if(OC(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(mi.cache.hasOwnProperty(c))return mi.cache[c].result;let u=Math.min(r,e),p=Math.max(r,e);if(Math.abs(u-p)===1){let S=r+"|"+e;return n.capture?`(${S})`:n.wrap===!1?S:`(?:${S})`}let f=DC(r)||DC(e),g={min:r,max:e,a:u,b:p},y=[],b=[];if(f&&(g.isPadded=f,g.maxLen=String(g.max).length),u<0){let S=p<0?Math.abs(p):1;b=PC(S,Math.abs(u),g,n),u=g.a=0}return p>=0&&(y=PC(u,p,g,n)),g.negatives=b,g.positives=y,g.result=DH(b,y,n),n.capture===!0?g.result=`(${g.result})`:n.wrap!==!1&&y.length+b.length>1&&(g.result=`(?:${g.result})`),mi.cache[c]=g,g.result};function DH(r,e,t){let n=Rm(r,e,"-",!1,t)||[],i=Rm(e,r,"",!1,t)||[],s=Rm(r,e,"-?",!0,t)||[];return n.concat(s).concat(i).join("|")}function BH(r,e){let t=1,n=1,i=IC(r,t),s=new Set([e]);for(;r<=i&&i<=e;)s.add(i),t+=1,i=IC(r,t);for(i=NC(e+1,n)-1;r<i&&i<=e;)s.add(i),n+=1,i=NC(e+1,n)-1;return s=[...s],s.sort(HH),s}function jH(r,e,t){if(r===e)return{pattern:r,count:[],digits:0};let n=FH(r,e),i=n.length,s="",o=0;for(let a=0;a<i;a++){let[c,u]=n[a];c===u?s+=c:c!=="0"||u!=="9"?s+=$H(c,u,t):o++}return o&&(s+=t.shorthand===!0?"\\d":"[0-9]"),{pattern:s,count:[o],digits:i}}function PC(r,e,t,n){let i=BH(r,e),s=[],o=r,a;for(let c=0;c<i.length;c++){let u=i[c],p=jH(String(o),String(u),n),f="";if(!t.isPadded&&a&&a.pattern===p.pattern){a.count.length>1&&a.count.pop(),a.count.push(p.count[0]),a.string=a.pattern+LC(a.count),o=u+1;continue}t.isPadded&&(f=qH(u,t,n)),p.string=f+p.pattern+LC(p.count),s.push(p),o=u+1,a=p}return s}function Rm(r,e,t,n,i){let s=[];for(let o of r){let{string:a}=o;!n&&!MC(e,"string",a)&&s.push(t+a),n&&MC(e,"string",a)&&s.push(t+a)}return s}function FH(r,e){let t=[];for(let n=0;n<r.length;n++)t.push([r[n],e[n]]);return t}function HH(r,e){return r>e?1:e>r?-1:0}function MC(r,e,t){return r.some(n=>n[e]===t)}function IC(r,e){return Number(String(r).slice(0,-e)+"9".repeat(e))}function NC(r,e){return r-r%Math.pow(10,e)}function LC(r){let[e=0,t=""]=r;return t||e>1?`{${e+(t?","+t:"")}}`:""}function $H(r,e,t){return`[${r}${e-r===1?"":"-"}${e}]`}function DC(r){return/^-?(0+)\d/.test(r)}function qH(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}}`}}mi.cache={};mi.clearCache=()=>mi.cache={};BC.exports=mi});var Pm=O((uz,GC)=>{"use strict";var UH=require("util"),HC=jC(),FC=r=>r!==null&&typeof r=="object"&&!Array.isArray(r),WH=r=>e=>r===!0?Number(e):String(e),km=r=>typeof r=="number"||typeof r=="string"&&r!=="",sa=r=>Number.isInteger(+r),Om=r=>{let e=`${r}`,t=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++t]==="0";);return t>0},GH=(r,e,t)=>typeof r=="string"||typeof e=="string"?!0:t.stringify===!0,zH=(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},pu=(r,e)=>{let t=r[0]==="-"?"-":"";for(t&&(r=r.slice(1),e--);r.length<e;)r="0"+r;return t?"-"+r:r},KH=(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=>pu(String(a),t)).join("|")),r.negatives.length&&(s=`-(${n}${r.negatives.map(a=>pu(String(a),t)).join("|")})`),i&&s?o=`${i}|${s}`:o=i||s,e.wrap?`(${n}${o})`:o},$C=(r,e,t,n)=>{if(t)return HC(r,e,{wrap:!1,...n});let i=String.fromCharCode(r);if(r===e)return i;let s=String.fromCharCode(e);return`[${i}-${s}]`},qC=(r,e,t)=>{if(Array.isArray(r)){let n=t.wrap===!0,i=t.capture?"":"?:";return n?`(${i}${r.join("|")})`:r.join("|")}return HC(r,e,t)},UC=(...r)=>new RangeError("Invalid range arguments: "+UH.inspect(...r)),WC=(r,e,t)=>{if(t.strictRanges===!0)throw UC([r,e]);return[]},VH=(r,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${r}" to be a number`);return[]},YH=(r,e,t=1,n={})=>{let i=Number(r),s=Number(e);if(!Number.isInteger(i)||!Number.isInteger(s)){if(n.strictRanges===!0)throw UC([r,e]);return[]}i===0&&(i=0),s===0&&(s=0);let o=i>s,a=String(r),c=String(e),u=String(t);t=Math.max(Math.abs(t),1);let p=Om(a)||Om(c)||Om(u),f=p?Math.max(a.length,c.length,u.length):0,g=p===!1&&GH(r,e,n)===!1,y=n.transform||WH(g);if(n.toRegex&&t===1)return $C(pu(r,f),pu(e,f),!0,n);let b={negatives:[],positives:[]},S=L=>b[L<0?"negatives":"positives"].push(Math.abs(L)),R=[],I=0;for(;o?i>=s:i<=s;)n.toRegex===!0&&t>1?S(i):R.push(zH(y(i,I),f,g)),i=o?i-t:i+t,I++;return n.toRegex===!0?t>1?KH(b,n,f):qC(R,null,{wrap:!1,...n}):R},XH=(r,e,t=1,n={})=>{if(!sa(r)&&r.length>1||!sa(e)&&e.length>1)return WC(r,e,n);let i=n.transform||(g=>String.fromCharCode(g)),s=`${r}`.charCodeAt(0),o=`${e}`.charCodeAt(0),a=s>o,c=Math.min(s,o),u=Math.max(s,o);if(n.toRegex&&t===1)return $C(c,u,!1,n);let p=[],f=0;for(;a?s>=o:s<=o;)p.push(i(s,f)),s=a?s-t:s+t,f++;return n.toRegex===!0?qC(p,null,{wrap:!1,options:n}):p},uu=(r,e,t,n={})=>{if(e==null&&km(r))return[r];if(!km(r)||!km(e))return WC(r,e,n);if(typeof t=="function")return uu(r,e,1,{transform:t});if(FC(t))return uu(r,e,0,t);let i={...n};return i.capture===!0&&(i.wrap=!0),t=t||i.step||1,sa(t)?sa(r)&&sa(e)?YH(r,e,t,i):XH(r,e,Math.max(Math.abs(t),1),i):t!=null&&!FC(t)?VH(t,i):uu(r,e,1,t)};GC.exports=uu});var VC=O((pz,KC)=>{"use strict";var JH=Pm(),zC=cu(),QH=(r,e={})=>{let t=(n,i={})=>{let s=zC.isInvalidBrace(i),o=n.invalid===!0&&e.escapeInvalid===!0,a=s===!0||o===!0,c=e.escapeInvalid===!0?"\\":"",u="";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 p=zC.reduce(n.nodes),f=JH(...p,{...e,wrap:!1,toRegex:!0,strictZeros:!0});if(f.length!==0)return p.length>1&&f.length>1?`(${f})`:f}if(n.nodes)for(let p of n.nodes)u+=t(p,n);return u};return t(r)};KC.exports=QH});var JC=O((fz,XC)=>{"use strict";var ZH=Pm(),YC=lu(),Bs=cu(),gi=(r="",e="",t=!1)=>{let n=[];if(r=[].concat(r),e=[].concat(e),!e.length)return r;if(!r.length)return t?Bs.flatten(e).map(i=>`{${i}}`):e;for(let i of r)if(Array.isArray(i))for(let s of i)n.push(gi(s,e,t));else for(let s of e)t===!0&&typeof s=="string"&&(s=`{${s}}`),n.push(Array.isArray(s)?gi(i,s,t):i+s);return Bs.flatten(n)},e$=(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(gi(a.pop(),YC(i,e)));return}if(i.type==="brace"&&i.invalid!==!0&&i.nodes.length===2){a.push(gi(a.pop(),["{}"]));return}if(i.nodes&&i.ranges>0){let f=Bs.reduce(i.nodes);if(Bs.exceedsLimit(...f,e.step,t))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let g=ZH(...f,e);g.length===0&&(g=YC(i,e)),a.push(gi(a.pop(),g)),i.nodes=[];return}let c=Bs.encloseBrace(i),u=i.queue,p=i;for(;p.type!=="brace"&&p.type!=="root"&&p.parent;)p=p.parent,u=p.queue;for(let f=0;f<i.nodes.length;f++){let g=i.nodes[f];if(g.type==="comma"&&i.type==="brace"){f===1&&u.push(""),u.push("");continue}if(g.type==="close"){a.push(gi(a.pop(),u,c));continue}if(g.value&&g.type!=="open"){u.push(gi(u.pop(),g.value));continue}g.nodes&&n(g,i)}return u};return Bs.flatten(n(r))};XC.exports=e$});var ZC=O((dz,QC)=>{"use strict";QC.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:`
|
|
100
|
-
`,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 iA=O((hz,nA)=>{"use strict";var t$=lu(),{MAX_LENGTH:eA,CHAR_BACKSLASH:Mm,CHAR_BACKTICK:r$,CHAR_COMMA:n$,CHAR_DOT:i$,CHAR_LEFT_PARENTHESES:s$,CHAR_RIGHT_PARENTHESES:o$,CHAR_LEFT_CURLY_BRACE:a$,CHAR_RIGHT_CURLY_BRACE:c$,CHAR_LEFT_SQUARE_BRACKET:tA,CHAR_RIGHT_SQUARE_BRACKET:rA,CHAR_DOUBLE_QUOTE:l$,CHAR_SINGLE_QUOTE:u$,CHAR_NO_BREAK_SPACE:p$,CHAR_ZERO_WIDTH_NOBREAK_SPACE:f$}=ZC(),d$=(r,e={})=>{if(typeof r!="string")throw new TypeError("Expected a string");let t=e||{},n=typeof t.maxLength=="number"?Math.min(eA,t.maxLength):eA;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,u=r.length,p=0,f=0,g,y=()=>r[p++],b=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(b({type:"bos"});p<u;)if(o=s[s.length-1],g=y(),!(g===f$||g===p$)){if(g===Mm){b({type:"text",value:(e.keepEscaping?g:"")+y()});continue}if(g===rA){b({type:"text",value:"\\"+g});continue}if(g===tA){c++;let S;for(;p<u&&(S=y());){if(g+=S,S===tA){c++;continue}if(S===Mm){g+=y();continue}if(S===rA&&(c--,c===0))break}b({type:"text",value:g});continue}if(g===s$){o=b({type:"paren",nodes:[]}),s.push(o),b({type:"text",value:g});continue}if(g===o$){if(o.type!=="paren"){b({type:"text",value:g});continue}o=s.pop(),b({type:"text",value:g}),o=s[s.length-1];continue}if(g===l$||g===u$||g===r$){let S=g,R;for(e.keepQuotes!==!0&&(g="");p<u&&(R=y());){if(R===Mm){g+=R+y();continue}if(R===S){e.keepQuotes===!0&&(g+=R);break}g+=R}b({type:"text",value:g});continue}if(g===a$){f++;let R={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||o.dollar===!0,depth:f,commas:0,ranges:0,nodes:[]};o=b(R),s.push(o),b({type:"open",value:g});continue}if(g===c$){if(o.type!=="brace"){b({type:"text",value:g});continue}let S="close";o=s.pop(),o.close=!0,b({type:S,value:g}),f--,o=s[s.length-1];continue}if(g===n$&&f>0){if(o.ranges>0){o.ranges=0;let S=o.nodes.shift();o.nodes=[S,{type:"text",value:t$(o)}]}b({type:"comma",value:g}),o.commas++;continue}if(g===i$&&f>0&&o.commas===0){let S=o.nodes;if(f===0||S.length===0){b({type:"text",value:g});continue}if(a.type==="dot"){if(o.range=[],a.value+=g,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 R=S[S.length-1];R.value+=a.value+g,a=R,o.ranges--;continue}b({type:"dot",value:g});continue}b({type:"text",value:g})}do if(o=s.pop(),o.type!=="root"){o.nodes.forEach(I=>{I.nodes||(I.type==="open"&&(I.isOpen=!0),I.type==="close"&&(I.isClose=!0),I.nodes||(I.type="text"),I.invalid=!0)});let S=s[s.length-1],R=S.nodes.indexOf(o);S.nodes.splice(R,1,...o.nodes)}while(s.length>0);return b({type:"eos"}),i};nA.exports=d$});var aA=O((mz,oA)=>{"use strict";var sA=lu(),h$=VC(),m$=JC(),g$=iA(),Jt=(r,e={})=>{let t=[];if(Array.isArray(r))for(let n of r){let i=Jt.create(n,e);Array.isArray(i)?t.push(...i):t.push(i)}else t=[].concat(Jt.create(r,e));return e&&e.expand===!0&&e.nodupes===!0&&(t=[...new Set(t)]),t};Jt.parse=(r,e={})=>g$(r,e);Jt.stringify=(r,e={})=>sA(typeof r=="string"?Jt.parse(r,e):r,e);Jt.compile=(r,e={})=>(typeof r=="string"&&(r=Jt.parse(r,e)),h$(r,e));Jt.expand=(r,e={})=>{typeof r=="string"&&(r=Jt.parse(r,e));let t=m$(r,e);return e.noempty===!0&&(t=t.filter(Boolean)),e.nodupes===!0&&(t=[...new Set(t)]),t};Jt.create=(r,e={})=>r===""||r.length<3?[r]:e.expand!==!0?Jt.compile(r,e):Jt.expand(r,e);oA.exports=Jt});var cA=O((gz,v$)=>{v$.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 uA=O((vz,lA)=>{lA.exports=cA()});var fA=O((xz,pA)=>{"use strict";var x$=require("path"),y$=uA(),_$=new Set(y$);pA.exports=r=>_$.has(x$.extname(r).slice(1).toLowerCase())});var fu=O(Q=>{"use strict";var{sep:b$}=require("path"),{platform:Im}=process,w$=require("os");Q.EV_ALL="all";Q.EV_READY="ready";Q.EV_ADD="add";Q.EV_CHANGE="change";Q.EV_ADD_DIR="addDir";Q.EV_UNLINK="unlink";Q.EV_UNLINK_DIR="unlinkDir";Q.EV_RAW="raw";Q.EV_ERROR="error";Q.STR_DATA="data";Q.STR_END="end";Q.STR_CLOSE="close";Q.FSEVENT_CREATED="created";Q.FSEVENT_MODIFIED="modified";Q.FSEVENT_DELETED="deleted";Q.FSEVENT_MOVED="moved";Q.FSEVENT_CLONED="cloned";Q.FSEVENT_UNKNOWN="unknown";Q.FSEVENT_FLAG_MUST_SCAN_SUBDIRS=1;Q.FSEVENT_TYPE_FILE="file";Q.FSEVENT_TYPE_DIRECTORY="directory";Q.FSEVENT_TYPE_SYMLINK="symlink";Q.KEY_LISTENERS="listeners";Q.KEY_ERR="errHandlers";Q.KEY_RAW="rawEmitters";Q.HANDLER_KEYS=[Q.KEY_LISTENERS,Q.KEY_ERR,Q.KEY_RAW];Q.DOT_SLASH=`.${b$}`;Q.BACK_SLASH_RE=/\\/g;Q.DOUBLE_SLASH_RE=/\/\//;Q.SLASH_OR_BACK_SLASH_RE=/[/\\]/;Q.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/;Q.REPLACER_RE=/^\.[/\\]/;Q.SLASH="/";Q.SLASH_SLASH="//";Q.BRACE_START="{";Q.BANG="!";Q.ONE_DOT=".";Q.TWO_DOTS="..";Q.STAR="*";Q.GLOBSTAR="**";Q.ROOT_GLOBSTAR="/**/*";Q.SLASH_GLOBSTAR="/**";Q.DIR_SUFFIX="Dir";Q.ANYMATCH_OPTS={dot:!0};Q.STRING_TYPE="string";Q.FUNCTION_TYPE="function";Q.EMPTY_STR="";Q.EMPTY_FN=()=>{};Q.IDENTITY_FN=r=>r;Q.isWindows=Im==="win32";Q.isMacos=Im==="darwin";Q.isLinux=Im==="linux";Q.isIBMi=w$.type()==="OS400"});var xA=O((_z,vA)=>{"use strict";var yn=require("fs"),dt=require("path"),{promisify:la}=require("util"),S$=fA(),{isWindows:E$,isLinux:T$,EMPTY_FN:C$,EMPTY_STR:A$,KEY_LISTENERS:js,KEY_ERR:Nm,KEY_RAW:oa,HANDLER_KEYS:R$,EV_CHANGE:hu,EV_ADD:du,EV_ADD_DIR:k$,EV_ERROR:hA,STR_DATA:O$,STR_END:P$,BRACE_START:M$,STAR:I$}=fu(),N$="watch",L$=la(yn.open),mA=la(yn.stat),D$=la(yn.lstat),B$=la(yn.close),Lm=la(yn.realpath),j$={lstat:D$,stat:mA},Bm=(r,e)=>{r instanceof Set?r.forEach(e):e(r)},aa=(r,e,t)=>{let n=r[e];n instanceof Set||(r[e]=n=new Set([n])),n.add(t)},F$=r=>e=>{let t=r[e];t instanceof Set?t.clear():delete r[e]},ca=(r,e,t)=>{let n=r[e];n instanceof Set?n.delete(t):n===t&&delete r[e]},gA=r=>r instanceof Set?r.size===0:!r,mu=new Map;function dA(r,e,t,n,i){let s=(o,a)=>{t(r),i(o,a,{watchedPath:r}),a&&r!==a&&gu(dt.resolve(r,a),js,dt.join(r,a))};try{return yn.watch(r,e,s)}catch(o){n(o)}}var gu=(r,e,t,n,i)=>{let s=mu.get(r);s&&Bm(s[e],o=>{o(t,n,i)})},H$=(r,e,t,n)=>{let{listener:i,errHandler:s,rawEmitter:o}=n,a=mu.get(e),c;if(!t.persistent)return c=dA(r,t,i,s,o),c.close.bind(c);if(a)aa(a,js,i),aa(a,Nm,s),aa(a,oa,o);else{if(c=dA(r,t,gu.bind(null,e,js),s,gu.bind(null,e,oa)),!c)return;c.on(hA,async u=>{let p=gu.bind(null,e,Nm);if(a.watcherUnusable=!0,E$&&u.code==="EPERM")try{let f=await L$(r,"r");await B$(f),p(u)}catch{}else p(u)}),a={listeners:i,errHandlers:s,rawEmitters:o,watcher:c},mu.set(e,a)}return()=>{ca(a,js,i),ca(a,Nm,s),ca(a,oa,o),gA(a.listeners)&&(a.watcher.close(),mu.delete(e),R$.forEach(F$(a)),a.watcher=void 0,Object.freeze(a))}},Dm=new Map,$$=(r,e,t,n)=>{let{listener:i,rawEmitter:s}=n,o=Dm.get(e),a=new Set,c=new Set,u=o&&o.options;return u&&(u.persistent<t.persistent||u.interval>t.interval)&&(a=o.listeners,c=o.rawEmitters,yn.unwatchFile(e),o=void 0),o?(aa(o,js,i),aa(o,oa,s)):(o={listeners:i,rawEmitters:s,options:t,watcher:yn.watchFile(e,t,(p,f)=>{Bm(o.rawEmitters,y=>{y(hu,e,{curr:p,prev:f})});let g=p.mtimeMs;(p.size!==f.size||g>f.mtimeMs||g===0)&&Bm(o.listeners,y=>y(r,p))})},Dm.set(e,o)),()=>{ca(o,js,i),ca(o,oa,s),gA(o.listeners)&&(Dm.delete(e),yn.unwatchFile(e),o.options=o.watcher=void 0,Object.freeze(o))}},jm=class{constructor(e){this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){let n=this.fsw.options,i=dt.dirname(e),s=dt.basename(e);this.fsw._getWatchedDir(i).add(s);let a=dt.resolve(e),c={persistent:n.persistent};t||(t=C$);let u;return n.usePolling?(c.interval=n.enableBinaryInterval&&S$(s)?n.binaryInterval:n.interval,u=$$(e,a,c,{listener:t,rawEmitter:this.fsw._emitRaw})):u=H$(e,a,c,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),u}_handleFile(e,t,n){if(this.fsw.closed)return;let i=dt.dirname(e),s=dt.basename(e),o=this.fsw._getWatchedDir(i),a=t;if(o.has(s))return;let c=async(p,f)=>{if(this.fsw._throttle(N$,e,5)){if(!f||f.mtimeMs===0)try{let g=await mA(e);if(this.fsw.closed)return;let y=g.atimeMs,b=g.mtimeMs;(!y||y<=b||b!==a.mtimeMs)&&this.fsw._emit(hu,e,g),T$&&a.ino!==g.ino?(this.fsw._closeFile(p),a=g,this.fsw._addPathCloser(p,this._watchWithNodeFs(e,c))):a=g}catch{this.fsw._remove(i,s)}else if(o.has(s)){let g=f.atimeMs,y=f.mtimeMs;(!g||g<=y||y!==a.mtimeMs)&&this.fsw._emit(hu,e,f),a=f}}},u=this._watchWithNodeFs(e,c);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(du,e,0))return;this.fsw._emit(du,e,t)}return u}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 Lm(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(du,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=dt.join(e,A$),!n.hasGlob&&(a=this.fsw._throttle("readdir",e,1e3),!a))return;let c=this.fsw._getWatchedDir(n.path),u=new Set,p=this.fsw._readdirp(e,{fileFilter:f=>n.filterPath(f),directoryFilter:f=>n.filterDir(f),depth:0}).on(O$,async f=>{if(this.fsw.closed){p=void 0;return}let g=f.path,y=dt.join(e,g);if(u.add(g),!(f.stats.isSymbolicLink()&&await this._handleSymlink(f,e,y,g))){if(this.fsw.closed){p=void 0;return}(g===i||!i&&!c.has(g))&&(this.fsw._incrReadyCount(),y=dt.join(s,dt.relative(s,y)),this._addToNodeFs(y,t,n,o+1))}}).on(hA,this._boundHandleError);return new Promise(f=>p.once(P$,()=>{if(this.fsw.closed){p=void 0;return}let g=a?a.clear():!1;f(),c.getChildren().filter(y=>y!==e&&!u.has(y)&&(!n.hasGlob||n.filterPath({fullPath:dt.resolve(e,y)}))).forEach(y=>{this.fsw._remove(e,y)}),p=void 0,g&&this._handleRead(e,!1,n,i,s,o,a)}))}async _handleDir(e,t,n,i,s,o,a){let c=this.fsw._getWatchedDir(dt.dirname(e)),u=c.has(dt.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!s&&!u&&(!o.hasGlob||o.globFilter(e))&&this.fsw._emit(k$,e,t),c.add(dt.basename(e)),this.fsw._getWatchedDir(e);let p,f,g=this.fsw.options.depth;if((g==null||i<=g)&&!this.fsw._symlinkPaths.has(a)){if(!s&&(await this._handleRead(e,n,o,s,e,i,p),this.fsw.closed))return;f=this._watchWithNodeFs(e,(y,b)=>{b&&b.mtimeMs===0||this._handleRead(y,!1,o,s,e,i,p)})}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 j$[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))return o(),!1;let u=this.fsw.options.followSymlinks&&!e.includes(I$)&&!e.includes(M$),p;if(c.isDirectory()){let f=dt.resolve(e),g=u?await Lm(e):e;if(this.fsw.closed||(p=await this._handleDir(a.watchPath,c,t,i,s,a,g),this.fsw.closed))return;f!==g&&g!==void 0&&this.fsw._symlinkPaths.set(f,g)}else if(c.isSymbolicLink()){let f=u?await Lm(e):e;if(this.fsw.closed)return;let g=dt.dirname(a.watchPath);if(this.fsw._getWatchedDir(g).add(a.watchPath),this.fsw._emit(du,a.watchPath,c),p=await this._handleDir(g,c,t,i,e,a,f),this.fsw.closed)return;f!==void 0&&this.fsw._symlinkPaths.set(dt.resolve(e),f)}else p=this._handleFile(a.watchPath,c,t);return o(),this.fsw._addPathCloser(e,p),!1}catch(c){if(this.fsw._handleError(c))return o(),e}}};vA.exports=jm});var TA=O((bz,zm)=>{"use strict";var Wm=require("fs"),ht=require("path"),{promisify:Gm}=require("util"),Fs;try{Fs=require("fsevents")}catch(r){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(r)}if(Fs){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&&(Fs=void 0)}}var{EV_ADD:Fm,EV_CHANGE:q$,EV_ADD_DIR:yA,EV_UNLINK:vu,EV_ERROR:U$,STR_DATA:W$,STR_END:G$,FSEVENT_CREATED:z$,FSEVENT_MODIFIED:K$,FSEVENT_DELETED:V$,FSEVENT_MOVED:Y$,FSEVENT_UNKNOWN:X$,FSEVENT_FLAG_MUST_SCAN_SUBDIRS:J$,FSEVENT_TYPE_FILE:Q$,FSEVENT_TYPE_DIRECTORY:ua,FSEVENT_TYPE_SYMLINK:EA,ROOT_GLOBSTAR:_A,DIR_SUFFIX:Z$,DOT_SLASH:bA,FUNCTION_TYPE:Hm,EMPTY_FN:eq,IDENTITY_FN:tq}=fu(),rq=r=>isNaN(r)?{}:{depth:r},qm=Gm(Wm.stat),nq=Gm(Wm.lstat),wA=Gm(Wm.realpath),iq={stat:qm,lstat:nq},vi=new Map,sq=10,oq=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),aq=(r,e)=>({stop:Fs.watch(r,e)});function cq(r,e,t,n){let i=ht.extname(e)?ht.dirname(e):e,s=ht.dirname(i),o=vi.get(i);lq(s)&&(i=s);let a=ht.resolve(r),c=a!==e,u=(f,g,y)=>{c&&(f=f.replace(e,a)),(f===a||!f.indexOf(a+ht.sep))&&t(f,g,y)},p=!1;for(let f of vi.keys())if(e.indexOf(ht.resolve(f)+ht.sep)===0){i=f,o=vi.get(i),p=!0;break}return o||p?o.listeners.add(u):(o={listeners:new Set([u]),rawEmitter:n,watcher:aq(i,(f,g)=>{if(!o.listeners.size||g&J$)return;let y=Fs.getInfo(f,g);o.listeners.forEach(b=>{b(f,g,y)}),o.rawEmitter(y.event,f,y)})},vi.set(i,o)),()=>{let f=o.listeners;if(f.delete(u),!f.size&&(vi.delete(i),o.watcher))return o.watcher.stop().then(()=>{o.rawEmitter=o.watcher=void 0,Object.freeze(o)})}}var lq=r=>{let e=0;for(let t of vi.keys())if(t.indexOf(r)===0&&(e++,e>=sq))return!0;return!1},uq=()=>Fs&&vi.size<128,$m=(r,e)=>{let t=0;for(;!r.indexOf(e)&&(r=ht.dirname(r))!==e;)t++;return t},SA=(r,e)=>r.type===ua&&e.isDirectory()||r.type===EA&&e.isSymbolicLink()||r.type===Q$&&e.isFile(),Um=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+_A),!0;n.delete(e),n.delete(e+_A)}addOrChange(e,t,n,i,s,o,a,c){let u=s.has(o)?q$:Fm;this.handleEvent(u,e,t,n,i,s,o,a,c)}async checkExists(e,t,n,i,s,o,a,c){try{let u=await qm(e);if(this.fsw.closed)return;SA(a,u)?this.addOrChange(e,t,n,i,s,o,a,c):this.handleEvent(vu,e,t,n,i,s,o,a,c)}catch(u){u.code==="EACCES"?this.addOrChange(e,t,n,i,s,o,a,c):this.handleEvent(vu,e,t,n,i,s,o,a,c)}}handleEvent(e,t,n,i,s,o,a,c,u){if(!(this.fsw.closed||this.checkIgnored(t)))if(e===vu){let p=c.type===ua;(p||o.has(a))&&this.fsw._remove(s,a,p)}else{if(e===Fm){if(c.type===ua&&this.fsw._getWatchedDir(t),c.type===EA&&u.followSymlinks){let f=u.depth===void 0?void 0:$m(n,i)+1;return this._addToFsEvents(t,!1,!0,f)}this.fsw._getWatchedDir(s).add(a)}let p=c.type===ua?e+Z$:e;this.fsw._emit(p,t),p===yA&&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=cq(e,t,async(c,u,p)=>{if(this.fsw.closed||s.depth!==void 0&&$m(c,t)>s.depth)return;let f=n(ht.join(e,ht.relative(e,c)));if(i&&!i(f))return;let g=ht.dirname(f),y=ht.basename(f),b=this.fsw._getWatchedDir(p.type===ua?f:g);if(oq.has(u)||p.event===X$)if(typeof s.ignored===Hm){let S;try{S=await qm(f)}catch{}if(this.fsw.closed||this.checkIgnored(f,S))return;SA(p,S)?this.addOrChange(f,c,t,g,b,y,p,s):this.handleEvent(vu,f,c,t,g,b,y,p,s)}else this.checkExists(f,c,t,g,b,y,p,s);else switch(p.event){case z$:case K$:return this.addOrChange(f,c,t,g,b,y,p,s);case V$:case Y$:return this.checkExists(f,c,t,g,b,y,p,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 wA(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!==bA?a=o.replace(s,e):o!==bA&&(a=ht.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(ht.dirname(o)),u=ht.basename(o);a&&this.fsw._getWatchedDir(o),!c.has(u)&&(c.add(u),(!i.ignoreInitial||s===!0)&&this.fsw._emit(a?yA:Fm,o,t))}initWatch(e,t,n,i){if(this.fsw.closed)return;let s=this._watchWithFsEvents(n.watchPath,ht.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===Hm?t:tq,a=this.fsw._getWatchHelpers(e);try{let c=await iq[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:u=>a.filterPath(u),directoryFilter:u=>a.filterDir(u),...rq(s.depth-(i||0))}).on(W$,u=>{if(this.fsw.closed||u.stats.isDirectory()&&!a.filterPath(u))return;let p=ht.join(a.watchPath,u.path),{fullPath:f}=u;if(a.followSymlinks&&u.stats.isSymbolicLink()){let g=s.depth===void 0?void 0:$m(p,ht.resolve(a.watchPath))+1;this._handleFsEventsSymlink(p,f,o,g)}else this.emitAdd(p,u.stats,o,s,n)}).on(U$,eq).on(G$,()=>{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===Hm)this.initWatch(void 0,e,a,o);else{let c;try{c=await wA(a.watchPath)}catch{}this.initWatch(c,e,a,o)}}};zm.exports=Um;zm.exports.canUse=uq});var DA=O(ag=>{"use strict";var{EventEmitter:pq}=require("events"),sg=require("fs"),ae=require("path"),{promisify:MA}=require("util"),fq=WT(),Qm=yC().default,dq=TC(),Km=Cm(),hq=aA(),mq=Em(),gq=xA(),CA=TA(),{EV_ALL:Vm,EV_READY:vq,EV_ADD:xu,EV_CHANGE:pa,EV_UNLINK:AA,EV_ADD_DIR:xq,EV_UNLINK_DIR:yq,EV_RAW:_q,EV_ERROR:Ym,STR_CLOSE:bq,STR_END:wq,BACK_SLASH_RE:Sq,DOUBLE_SLASH_RE:RA,SLASH_OR_BACK_SLASH_RE:Eq,DOT_RE:Tq,REPLACER_RE:Cq,SLASH:Xm,SLASH_SLASH:Aq,BRACE_START:Rq,BANG:Zm,ONE_DOT:IA,TWO_DOTS:kq,GLOBSTAR:Oq,SLASH_GLOBSTAR:Jm,ANYMATCH_OPTS:eg,STRING_TYPE:og,FUNCTION_TYPE:Pq,EMPTY_STR:tg,EMPTY_FN:Mq,isWindows:Iq,isMacos:Nq,isIBMi:Lq}=fu(),Dq=MA(sg.stat),Bq=MA(sg.readdir),rg=(r=[])=>Array.isArray(r)?r:[r],NA=(r,e=[])=>(r.forEach(t=>{Array.isArray(t)?NA(t,e):e.push(t)}),e),kA=r=>{let e=NA(rg(r));if(!e.every(t=>typeof t===og))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(LA)},OA=r=>{let e=r.replace(Sq,Xm),t=!1;for(e.startsWith(Aq)&&(t=!0);e.match(RA);)e=e.replace(RA,Xm);return t&&(e=Xm+e),e},LA=r=>OA(ae.normalize(OA(r))),PA=(r=tg)=>e=>typeof e!==og?e:LA(ae.isAbsolute(e)?e:ae.join(r,e)),jq=(r,e)=>ae.isAbsolute(r)?r:r.startsWith(Zm)?Zm+ae.join(e,r.slice(1)):ae.join(e,r),Mr=(r,e)=>r[e]===void 0,ng=class{constructor(e,t){this.path=e,this._removeWatcher=t,this.items=new Set}add(e){let{items:t}=this;t&&e!==IA&&e!==kq&&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 Bq(n)}catch{this._removeWatcher&&this._removeWatcher(ae.dirname(n),ae.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)}},Fq="stat",Hq="lstat",ig=class{constructor(e,t,n,i){this.fsw=i,this.path=e=e.replace(Cq,tg),this.watchPath=t,this.fullWatchPath=ae.resolve(t),this.hasGlob=t!==e,e===tg&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&n?void 0:!1,this.globFilter=this.hasGlob?Qm(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?Fq:Hq}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 ae.join(this.watchPath,ae.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===Pq?this.globFilter(n):!0)&&this.fsw._isntIgnored(n,t)&&this.fsw._hasReadPermissions(t)}getDirParts(e){if(!this.hasGlob)return[];let t=[];return(e.includes(Rq)?hq.expand(e):[e]).forEach(i=>{t.push(ae.relative(this.watchPath,i).split(Eq))}),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===Oq&&(n=!0),n||!t[0][o]||Qm(s,t[0][o],eg))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}},yu=class extends pq{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,Mr(t,"persistent")&&(t.persistent=!0),Mr(t,"ignoreInitial")&&(t.ignoreInitial=!1),Mr(t,"ignorePermissionErrors")&&(t.ignorePermissionErrors=!1),Mr(t,"interval")&&(t.interval=100),Mr(t,"binaryInterval")&&(t.binaryInterval=300),Mr(t,"disableGlobbing")&&(t.disableGlobbing=!1),t.enableBinaryInterval=t.binaryInterval!==t.interval,Mr(t,"useFsEvents")&&(t.useFsEvents=!t.usePolling),CA.canUse()||(t.useFsEvents=!1),Mr(t,"usePolling")&&!t.useFsEvents&&(t.usePolling=Nq),Lq&&(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)),Mr(t,"atomic")&&(t.atomic=!t.usePolling&&!t.useFsEvents),t.atomic&&(this._pendingUnlinks=new Map),Mr(t,"followSymlinks")&&(t.followSymlinks=!0),Mr(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=rg(t.ignored));let a=0;this._emitReady=()=>{a++,a>=this._readyCount&&(this._emitReady=Mq,this._readyEmitted=!0,process.nextTick(()=>this.emit(vq)))},this._emitRaw=(...c)=>this.emit(_q,...c),this._readyEmitted=!1,this.options=t,t.useFsEvents?this._fsEventsHandler=new CA(this):this._nodeFsHandler=new gq(this),Object.freeze(t)}add(e,t,n){let{cwd:i,disableGlobbing:s}=this.options;this.closed=!1;let o=kA(e);return i&&(o=o.map(a=>{let c=jq(a,i);return s||!Km(a)?c:mq(c)})),o=o.filter(a=>a.startsWith(Zm)?(this._ignoredPaths.add(a.slice(1)),!1):(this._ignoredPaths.delete(a),this._ignoredPaths.delete(a+Jm),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(ae.dirname(c),ae.basename(t||c))})})),this}unwatch(e){if(this.closed)return this;let t=kA(e),{cwd:n}=this.options;return t.forEach(i=>{!ae.isAbsolute(i)&&!this._closers.has(i)&&(n&&(i=ae.join(n,i)),i=ae.resolve(i)),this._closePath(i),this._ignoredPaths.add(i),this._watched.has(i)&&this._ignoredPaths.add(i+Jm),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?ae.relative(this.options.cwd,n):n;e[i||IA]=t.getChildren().sort()}),e}emitWithAll(e,t){this.emit(...t),e!==Ym&&this.emit(Vm,...t)}async _emit(e,t,n,i,s){if(this.closed)return;let o=this.options;Iq&&(t=ae.normalize(t)),o.cwd&&(t=ae.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,u;if(c&&(u=this._pendingWrites.get(t)))return u.lastChange=new Date,this;if(o.atomic){if(e===AA)return this._pendingUnlinks.set(t,a),setTimeout(()=>{this._pendingUnlinks.forEach((p,f)=>{this.emit(...p),this.emit(Vm,...p),this._pendingUnlinks.delete(f)})},typeof o.atomic=="number"?o.atomic:100),this;e===xu&&this._pendingUnlinks.has(t)&&(e=a[0]=pa,this._pendingUnlinks.delete(t))}if(c&&(e===xu||e===pa)&&this._readyEmitted){let p=(f,g)=>{f?(e=a[0]=Ym,a[1]=f,this.emitWithAll(e,a)):g&&(a.length>2?a[2]=g:a.push(g),this.emitWithAll(e,a))};return this._awaitWriteFinish(t,c.stabilityThreshold,e,p),this}if(e===pa&&!this._throttle(pa,t,50))return this;if(o.alwaysStat&&n===void 0&&(e===xu||e===xq||e===pa)){let p=o.cwd?ae.join(o.cwd,t):t,f;try{f=await Dq(p)}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(Ym,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 u=i.get(t),p=u?u.count:0;return i.delete(t),clearTimeout(o),u&&clearTimeout(u.timeoutObject),p};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&&!ae.isAbsolute(e)&&(o=ae.join(this.options.cwd,e));let a=new Date,c=u=>{sg.stat(o,(p,f)=>{if(p||!this._pendingWrites.has(e)){p&&p.code!=="ENOENT"&&i(p);return}let g=Number(new Date);u&&f.size!==u.size&&(this._pendingWrites.get(e).lastChange=g);let y=this._pendingWrites.get(e);g-y.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&&Tq.test(e))return!0;if(!this._userIgnored){let{cwd:n}=this.options,i=this.options.ignored,s=i&&i.map(PA(n)),o=rg(s).filter(c=>typeof c===og&&!Km(c)).map(c=>c+Jm),a=this._getGlobIgnored().map(PA(n)).concat(s,o);this._userIgnored=Qm(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||!Km(e)?e:dq(e),i=this.options.followSymlinks;return new ig(e,n,i,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));let t=ae.resolve(e);return this._watched.has(t)||this._watched.set(t,new ng(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=ae.join(e,t),s=ae.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(g=>this._remove(i,g));let c=this._getWatchedDir(e),u=c.has(t);c.remove(t),this._symlinkPaths.has(s)&&this._symlinkPaths.delete(s);let p=i;if(this.options.cwd&&(p=ae.relative(this.options.cwd,i)),this.options.awaitWriteFinish&&this._pendingWrites.has(p)&&this._pendingWrites.get(p).cancelWait()===xu)return;this._watched.delete(i),this._watched.delete(s);let f=n?yq:AA;u&&!this._isIgnored(i)&&this._emit(f,i),this.options.useFsEvents||this._closePath(i)}_closePath(e){this._closeFile(e);let t=ae.dirname(e);this._getWatchedDir(t).remove(ae.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:Vm,alwaysStat:!0,lstat:!0,...t},i=fq(e,n);return this._streams.add(i),i.once(bq,()=>{i=void 0}),i.once(wq,()=>{i&&(this._streams.delete(i),i=void 0)}),i}};ag.FSWatcher=yu;var $q=(r,e)=>{let t=new yu(e);return t.add(r),t};ag.watch=$q});var CR=O((Xz,pg)=>{"use strict";var Vq=Object.prototype.hasOwnProperty,Ot="~";function ga(){}Object.create&&(ga.prototype=Object.create(null),new ga().__proto__||(Ot=!1));function Yq(r,e,t){this.fn=r,this.context=e,this.once=t||!1}function TR(r,e,t,n,i){if(typeof t!="function")throw new TypeError("The listener must be a function");var s=new Yq(t,n||r,i),o=Ot?Ot+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 Au(r,e){--r._eventsCount===0?r._events=new ga:delete r._events[e]}function Tt(){this._events=new ga,this._eventsCount=0}Tt.prototype.eventNames=function(){var e=[],t,n;if(this._eventsCount===0)return e;for(n in t=this._events)Vq.call(t,n)&&e.push(Ot?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};Tt.prototype.listeners=function(e){var t=Ot?Ot+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};Tt.prototype.listenerCount=function(e){var t=Ot?Ot+e:e,n=this._events[t];return n?n.fn?1:n.length:0};Tt.prototype.emit=function(e,t,n,i,s,o){var a=Ot?Ot+e:e;if(!this._events[a])return!1;var c=this._events[a],u=arguments.length,p,f;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),u){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,p=new Array(u-1);f<u;f++)p[f-1]=arguments[f];c.fn.apply(c.context,p)}else{var g=c.length,y;for(f=0;f<g;f++)switch(c[f].once&&this.removeListener(e,c[f].fn,void 0,!0),u){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(!p)for(y=1,p=new Array(u-1);y<u;y++)p[y-1]=arguments[y];c[f].fn.apply(c[f].context,p)}}return!0};Tt.prototype.on=function(e,t,n){return TR(this,e,t,n,!1)};Tt.prototype.once=function(e,t,n){return TR(this,e,t,n,!0)};Tt.prototype.removeListener=function(e,t,n,i){var s=Ot?Ot+e:e;if(!this._events[s])return this;if(!t)return Au(this,s),this;var o=this._events[s];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&Au(this,s);else{for(var a=0,c=[],u=o.length;a<u;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:Au(this,s)}return this};Tt.prototype.removeAllListeners=function(e){var t;return e?(t=Ot?Ot+e:e,this._events[t]&&Au(this,t)):(this._events=new ga,this._eventsCount=0),this};Tt.prototype.off=Tt.prototype.removeListener;Tt.prototype.addListener=Tt.prototype.on;Tt.prefixed=Ot;Tt.EventEmitter=Tt;typeof pg<"u"&&(pg.exports=Tt)});var RR=O((Jz,AR)=>{"use strict";AR.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 Ru=O(OR=>{var wn=OR,Xq=require("url"),kR=require("util")._extend,Jq=RR(),Qq=/(^|,)\s*upgrade\s*($|,)/i,fg=/^https|wss/;wn.isSSL=fg;wn.setupOutgoing=function(r,e,t,n){r.port=e[n||"target"].port||(fg.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=kR({},t.headers),e.headers&&kR(r.headers,e.headers),e.auth&&(r.auth=e.auth),e.ca&&(r.ca=e.ca),fg.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"||!Qq.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:Xq.parse(t.url).path||"";return o=e.ignorePath?"":o,r.path=wn.urlJoin(s,o),e.changeOrigin&&(r.headers.host=Jq(r.port,e[n||"target"].protocol)&&!Zq(r.host)?r.host+":"+r.port:r.host),r};wn.setupSocket=function(r){return r.setTimeout(0),r.setNoDelay(!0),r.setKeepAlive(!0,0),r};wn.getPort=function(r){var e=r.headers.host?r.headers.host.match(/:(\d+)/):"";return e?e[1]:wn.hasEncryptedConnection(r)?"443":"80"};wn.hasEncryptedConnection=function(r){return!!(r.connection.encrypted||r.connection.pair)};wn.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("?")};wn.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 Zq(r){return!!~r.indexOf(":")}});var NR=O((Zz,IR)=>{var PR=require("url"),MR=Ru(),eU=/^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&&eU.test(n.statusCode)){var s=PR.parse(i.target),o=PR.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,u=function(g,y){y!=null&&(s&&g.toLowerCase()==="set-cookie"&&(y=MR.rewriteCookieProperty(y,s,"domain")),o&&g.toLowerCase()==="set-cookie"&&(y=MR.rewriteCookieProperty(y,o,"path")),t.setHeader(String(g).trim(),y))};if(typeof s=="string"&&(s={"*":s}),typeof o=="string"&&(o={"*":o}),a&&n.rawHeaders!=null){c={};for(var p=0;p<n.rawHeaders.length;p+=2){var f=n.rawHeaders[p];c[f.toLowerCase()]=f}}Object.keys(n.headers).forEach(function(g){var y=n.headers[g];a&&c&&(g=c[g]||g),u(g,y)})},writeStatusCode:function(e,t,n){n.statusMessage?(t.statusCode=n.statusCode,t.statusMessage=n.statusMessage):t.statusCode=n.statusCode}}});var DR=O((eK,LR)=>{var va;LR.exports=function(){if(!va){try{va=Te()("follow-redirects")}catch{}typeof va!="function"&&(va=function(){})}va.apply(null,arguments)}});var $R=O((tK,Eg)=>{var ya=require("url"),xa=ya.URL,tU=require("http"),rU=require("https"),vg=require("stream").Writable,xg=require("assert"),BR=DR();(function(){var e=typeof process<"u",t=typeof window<"u"&&typeof document<"u",n=bi(Error.captureStackTrace);!e&&(t||!n)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var yg=!1;try{xg(new xa(""))}catch(r){yg=r.code==="ERR_INVALID_URL"}var nU=["Authorization","Proxy-Authorization","Cookie"],iU=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],_g=["abort","aborted","connect","error","socket","timeout"],bg=Object.create(null);_g.forEach(function(r){bg[r]=function(e,t,n){this._redirectable.emit(r,e,t,n)}});var hg=_a("ERR_INVALID_URL","Invalid URL",TypeError),mg=_a("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),sU=_a("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",mg),oU=_a("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),aU=_a("ERR_STREAM_WRITE_AFTER_END","write after end"),cU=vg.prototype.destroy||FR;function $t(r,e){vg.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 mg?i:new mg({cause:i}))}},this._headerFilter=new RegExp("^(?:"+nU.concat(r.sensitiveHeaders).map(hU).join("|")+")$","i"),this._performRequest()}$t.prototype=Object.create(vg.prototype);$t.prototype.abort=function(){Sg(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};$t.prototype.destroy=function(r){return Sg(this._currentRequest,r),cU.call(this,r),this};$t.prototype.write=function(r,e,t){if(this._ending)throw new aU;if(!_i(r)&&!fU(r))throw new TypeError("data should be a string, Buffer or Uint8Array");if(bi(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 oU),this.abort())};$t.prototype.end=function(r,e,t){if(bi(r)?(t=r,r=e=null):bi(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}};$t.prototype.setHeader=function(r,e){this._options.headers[r]=e,this._currentRequest.setHeader(r,e)};$t.prototype.removeHeader=function(r){delete this._options.headers[r],this._currentRequest.removeHeader(r)};$t.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){$t.prototype[r]=function(e,t){return this._currentRequest[r](e,t)}});["aborted","connection","socket"].forEach(function(r){Object.defineProperty($t.prototype,r,{get:function(){return this._currentRequest[r]}})});$t.prototype._sanitizeOptions=function(r){if(r.headers||(r.headers={}),pU(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))}};$t.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 _g)n.on(i,bg[i]);if(this._currentUrl=/^\//.test(this._options.path)?ya.format(this._options):this._options.path,this._isRedirect){var s=0,o=this,a=this._requestBodyBuffers;(function c(u){if(n===o._currentRequest)if(u)o.emit("error",u);else if(s<a.length){var p=a[s++];n.finished||n.write(p.data,p.encoding,c)}else o._ended&&n.end()})()}};$t.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(Sg(this._currentRequest),r.destroy(),++this._redirectCount>this._options.maxRedirects)throw new sU;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=[],dg(/^content-/i,this._options.headers));var o=dg(/^host$/i,this._options.headers),a=wg(this._currentUrl),c=o||a.host,u=/^\w+:/.test(t)?this._currentUrl:ya.format(Object.assign(a,{host:c})),p=lU(t,u);if(BR("redirecting to",p.href),this._isRedirect=!0,gg(p,this._options),(p.protocol!==a.protocol&&p.protocol!=="https:"||p.host!==c&&!uU(p.host,c))&&dg(this._headerFilter,this._options.headers),bi(i)){var f={headers:r.headers,statusCode:e},g={url:u,method:s,headers:n};i(this._options,f,g),this._sanitizeOptions(this._options)}this._performRequest()};function jR(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(u,p,f){return dU(u)?u=gg(u):_i(u)?u=gg(wg(u)):(f=p,p=HR(u),u={protocol:i}),bi(p)&&(f=p,p=null),p=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},u,p),p.nativeProtocols=t,!_i(p.host)&&!_i(p.hostname)&&(p.hostname="::1"),xg.equal(p.protocol,i,"protocol mismatch"),BR("options",p),new $t(p,f)}function c(u,p,f){var g=o.request(u,p,f);return g.end(),g}Object.defineProperties(o,{request:{value:a,configurable:!0,enumerable:!0,writable:!0},get:{value:c,configurable:!0,enumerable:!0,writable:!0}})}),e}function FR(){}function wg(r){var e;if(yg)e=new xa(r);else if(e=HR(ya.parse(r)),!_i(e.protocol))throw new hg({input:r});return e}function lU(r,e){return yg?new xa(r,e):wg(ya.resolve(e,r))}function HR(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 gg(r,e){var t=e||{};for(var n of iU)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 dg(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 _a(r,e,t){function n(i){bi(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 Sg(r,e){for(var t of _g)r.removeListener(t,bg[t]);r.on("error",FR),r.destroy(e)}function uU(r,e){xg(_i(r)&&_i(e));var t=r.length-e.length-1;return t>0&&r[t]==="."&&r.endsWith(e)}function pU(r){return r instanceof Array}function _i(r){return typeof r=="string"||r instanceof String}function bi(r){return typeof r=="function"}function fU(r){return typeof r=="object"&&"length"in r}function dU(r){return xa&&r instanceof xa}function hU(r){return r.replace(/[\]\\/()*+?.$]/g,"\\$&")}Eg.exports=jR({http:tU,https:rU});Eg.exports.wrap=jR});var UR=O((rK,qR)=>{var mU=require("http"),gU=require("https"),ba=NR(),ku=Ru(),vU=$R();ba=Object.keys(ba).map(function(r){return ba[r]});var xU={http:mU,https:gU};qR.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||ku.hasEncryptedConnection(e),s={for:e.connection.remoteAddress||e.socket.remoteAddress,port:ku.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?vU:xU,c=a.http,u=a.https;if(n.forward){var p=(n.forward.protocol==="https:"?u:c).request(ku.setupOutgoing(n.ssl||{},n,e,"forward")),f=b(p,n.forward);if(e.on("error",f),p.on("error",f),(n.buffer||e).pipe(p),!n.target)return t.end()}var g=(n.target.protocol==="https:"?u:c).request(ku.setupOutgoing(n.ssl||{},n,e));g.on("socket",function(S){s&&!g.getHeader("expect")&&s.emit("proxyReq",g,e,t,n)}),n.proxyTimeout&&g.setTimeout(n.proxyTimeout,function(){g.abort()}),e.on("aborted",function(){g.abort()});var y=b(g,n.target);e.on("error",y),g.on("error",y);function b(S,R){return function(L){if(e.socket.destroyed&&L.code==="ECONNRESET")return s.emit("econnreset",L,e,t,R),S.abort();o?o(L,e,t,R):s.emit("error",L,e,t,R)}}(n.buffer||e).pipe(g),g.on("response",function(S){if(s&&s.emit("proxyRes",S,e,t),!t.headersSent&&!n.selfHandleResponse)for(var R=0;R<ba.length&&!ba[R](e,t,S,n);R++);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=O((nK,WR)=>{var yU=require("http"),_U=require("https"),Ks=Ru();WR.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:Ks.getPort(e),proto:Ks.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(p,f){return Object.keys(f).reduce(function(g,y){var b=f[y];if(!Array.isArray(b))return g.push(y+": "+b),g;for(var S=0;S<b.length;S++)g.push(y+": "+b[S]);return g},[p]).join(`\r
|
|
95
|
+
`);if(m===-1){iu("have not received end of HTTP headers yet..."),s();return}let y=f.slice(0,m).toString("ascii").split(`\r
|
|
96
|
+
`),_=y.shift();if(!_)return r.destroy(),t(new Error("No header received from proxy CONNECT response"));let S=_.split(" "),A=+S[1],P=S.slice(2).join(" "),L={};for(let N of y){if(!N)continue;let H=N.indexOf(":");if(H===-1)return r.destroy(),t(new Error(`Invalid header from proxy CONNECT response: "${N}"`));let W=N.slice(0,H).toLowerCase(),U=N.slice(H+1).trimStart(),G=L[W];typeof G=="string"?L[W]=[G,U]:Array.isArray(G)?G.push(U):L[W]=U}iu("got proxy server response: %o %o",_,L),o(),e({connect:{statusCode:A,statusText:P,headers:L},buffered:f})}r.on("error",c),r.on("end",a),s()})}Is.parseProxyResponse=kF});var iT=O(vr=>{"use strict";var OF=vr&&vr.__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]})),PF=vr&&vr.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),rT=vr&&vr.__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)&&OF(e,r,t);return PF(e,r),e},nT=vr&&vr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(vr,"__esModule",{value:!0});vr.HttpsProxyAgent=void 0;var su=rT(require("net")),Z1=rT(require("tls")),MF=nT(require("assert")),IF=nT(Ce()),NF=J1(),LF=require("url"),DF=Q1(),Ko=(0,IF.default)("https-proxy-agent"),eT=r=>r.servername===void 0&&r.host&&!su.isIP(r.host)?{...r,servername:r.host}:r,ou=class extends NF.Agent{constructor(e,t){super(t),this.options={path:void 0},this.proxy=typeof e=="string"?new LF.URL(e):e,this.proxyHeaders=t?.headers??{},Ko("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?tT(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:"?(Ko("Creating `tls.Socket`: %o",this.connectOpts),i=Z1.connect(eT(this.connectOpts))):(Ko("Creating `net.Socket`: %o",this.connectOpts),i=su.connect(this.connectOpts));let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},o=su.isIPv6(t.host)?`[${t.host}]`:t.host,a=`CONNECT ${o}:${t.port} HTTP/1.1\r
|
|
97
|
+
`;if(n.username||n.password){let m=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(m).toString("base64")}`}s.Host=`${o}:${t.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let m of Object.keys(s))a+=`${m}: ${s[m]}\r
|
|
98
|
+
`;let c=(0,DF.parseProxyResponse)(i);i.write(`${a}\r
|
|
99
|
+
`);let{connect:u,buffered:p}=await c;if(e.emit("proxyConnect",u),this.emit("proxyConnect",u,e),u.statusCode===200)return e.once("socket",BF),t.secureEndpoint?(Ko("Upgrading socket connection to TLS"),Z1.connect({...tT(eT(t),"host","path","port"),socket:i})):i;i.destroy();let f=new su.Socket({writable:!1});return f.readable=!0,e.once("socket",m=>{Ko("Replaying proxy buffer for failed request"),(0,MF.default)(m.listenerCount("data")>0),m.push(p),m.push(null)}),f}};ou.protocols=["http","https"];vr.HttpsProxyAgent=ou;function BF(r){r.resume()}function tT(r,...e){let t={},n;for(n in r)e.includes(n)||(t[n]=r[n]);return t}});var lT=O((UG,cT)=>{"use strict";var oT=require("url"),aT=require("https"),jF=am(),au=nm(),FF=om(),Zt=eu(),HF=tm(),sT=2419200,lm="",um;function Vo(){}Vo.prototype.setGCMAPIKey=function(r){if(r===null){lm=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.");lm=r};Vo.prototype.setVapidDetails=function(r,e,t){if(arguments.length===1&&arguments[0]===null){um=null;return}au.validateSubject(r),au.validatePublicKey(e),au.validatePrivateKey(t),um={subject:r,publicKey:e,privateKey:t}};Vo.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=lm,i=um,s=sT,o={},a=Zt.supportedContentEncodings.AES_128_GCM,c=Zt.supportedUrgency.NORMAL,u,p,f,m;if(t){let P=["headers","gcmAPIKey","vapidDetails","TTL","contentEncoding","urgency","topic","proxy","agent","timeout"],L=Object.keys(t);for(let N=0;N<L.length;N+=1){let H=L[N];if(!P.includes(H))throw new Error("'"+H+"' is an invalid option. The valid options are ['"+P.join("', '")+"'].")}if(t.headers){o=t.headers;let N=Object.keys(o).filter(function(H){return typeof t[H]<"u"});if(N.length>0)throw new Error("Duplicated headers defined ["+N.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===Zt.supportedContentEncodings.AES_128_GCM||t.contentEncoding===Zt.supportedContentEncodings.AES_GCM)a=t.contentEncoding;else throw new Error("Unsupported content encoding specified.");if(t.urgency)if(t.urgency===Zt.supportedUrgency.VERY_LOW||t.urgency===Zt.supportedUrgency.LOW||t.urgency===Zt.supportedUrgency.NORMAL||t.urgency===Zt.supportedUrgency.HIGH)c=t.urgency;else throw new Error("Unsupported urgency specified.");if(t.topic){if(!HF.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");u=t.topic}t.proxy&&(typeof t.proxy=="string"||typeof t.proxy.host=="string"?p=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 aT.Agent?(p&&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"&&(m=t.timeout)}typeof s>"u"&&(s=sT);let y={method:"POST",headers:{TTL:s}};Object.keys(o).forEach(function(P){y.headers[P]=o[P]});let _=null;if(e){let P=FF.encrypt(r.keys.p256dh,r.keys.auth,e,a);y.headers["Content-Length"]=P.cipherText.length,y.headers["Content-Type"]="application/octet-stream",a===Zt.supportedContentEncodings.AES_128_GCM?y.headers["Content-Encoding"]=Zt.supportedContentEncodings.AES_128_GCM:a===Zt.supportedContentEncodings.AES_GCM&&(y.headers["Content-Encoding"]=Zt.supportedContentEncodings.AES_GCM,y.headers.Encryption="salt="+P.salt,y.headers["Crypto-Key"]="dh="+P.localPublicKey.toString("base64url")),_=P.cipherText}else y.headers["Content-Length"]=0;let S=r.endpoint.startsWith("https://android.googleapis.com/gcm/send"),A=r.endpoint.startsWith("https://fcm.googleapis.com/fcm/send");if(S)n?y.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 P=oT.parse(r.endpoint),L=P.protocol+"//"+P.host,N=au.getVapidHeaders(L,i.subject,i.publicKey,i.privateKey,a);y.headers.Authorization=N.Authorization,a===Zt.supportedContentEncodings.AES_GCM&&(y.headers["Crypto-Key"]?y.headers["Crypto-Key"]+=";"+N["Crypto-Key"]:y.headers["Crypto-Key"]=N["Crypto-Key"])}else A&&n&&(y.headers.Authorization="key="+n);return y.headers.Urgency=c,u&&(y.headers.Topic=u),y.body=_,y.endpoint=r.endpoint,p&&(y.proxy=p),f&&(y.agent=f),m&&(y.timeout=m),y};Vo.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=oT.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:u}=iT();o.agent=new u(n.proxy)}let c=aT.request(o,function(u){let p="";u.on("data",function(f){p+=f}),u.on("end",function(){u.statusCode<200||u.statusCode>299?s(new jF("Received unexpected response code",u.statusCode,u.headers,p,n.endpoint)):i({statusCode:u.statusCode,body:p,headers:u.headers})})});n.timeout&&c.on("timeout",function(){c.destroy(new Error("Socket timeout"))}),c.on("error",function(u){s(u)}),n.body&&c.write(n.body),c.end()})};cT.exports=Vo});var fT=O((WG,pT)=>{"use strict";var uT=nm(),$F=om(),qF=lT(),UF=am(),WF=eu(),Yo=new qF;pT.exports={WebPushError:UF,supportedContentEncodings:WF.supportedContentEncodings,encrypt:$F.encrypt,getVapidHeaders:uT.getVapidHeaders,generateVAPIDKeys:uT.generateVAPIDKeys,setGCMAPIKey:Yo.setGCMAPIKey,setVapidDetails:Yo.setVapidDetails,generateRequestDetails:Yo.generateRequestDetails,sendNotification:Yo.sendNotification.bind(Yo)}});var ea=O((yz,HT)=>{"use strict";var d3=require("path"),zr="\\\\/",DT=`[^${zr}]`,h3=0,_n="\\.",m3="\\+",g3="\\?",du="\\/",v3="(?=.)",BT="[^/]",dm=`(?:${du}|$)`,jT=`(?:^|${du})`,hm=`${_n}{1,2}${dm}`,x3=`(?!${_n})`,y3=`(?!${jT}${hm})`,_3=`(?!${_n}{0,1}${dm})`,b3=`(?!${hm})`,w3=`[^.${du}]`,S3=`${BT}*?`,FT={DOT_LITERAL:_n,PLUS_LITERAL:m3,QMARK_LITERAL:g3,SLASH_LITERAL:du,ONE_CHAR:v3,QMARK:BT,END_ANCHOR:dm,DOTS_SLASH:hm,NO_DOT:x3,NO_DOTS:y3,NO_DOT_SLASH:_3,NO_DOTS_SLASH:b3,QMARK_NO_DOT:w3,STAR:S3,START_ANCHOR:jT},E3={...FT,SLASH_LITERAL:`[${zr}]`,QMARK:DT,STAR:`${DT}*?`,DOTS_SLASH:`${_n}{1,2}(?:[${zr}]|$)`,NO_DOT:`(?!${_n})`,NO_DOTS:`(?!(?:^|[${zr}])${_n}{1,2}(?:[${zr}]|$))`,NO_DOT_SLASH:`(?!${_n}{0,1}(?:[${zr}]|$))`,NO_DOTS_SLASH:`(?!${_n}{1,2}(?:[${zr}]|$))`,QMARK_NO_DOT:`[^.${zr}]`,START_ANCHOR:`(?:^|[${zr}])`,END_ANCHOR:`(?:[${zr}]|$)`},T3={__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"};HT.exports={DEFAULT_MAX_EXTGLOB_RECURSION:h3,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:T3,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:d3.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?E3:FT}}});var hu=O($t=>{"use strict";var C3=require("path"),A3=process.platform==="win32",{REGEX_BACKSLASH:R3,REGEX_REMOVE_BACKSLASH:k3,REGEX_SPECIAL_CHARS:O3,REGEX_SPECIAL_CHARS_GLOBAL:P3}=ea();$t.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r);$t.hasRegexChars=r=>O3.test(r);$t.isRegexChar=r=>r.length===1&&$t.hasRegexChars(r);$t.escapeRegex=r=>r.replace(P3,"\\$1");$t.toPosixSlashes=r=>r.replace(R3,"/");$t.removeBackslashes=r=>r.replace(k3,e=>e==="\\"?"":e);$t.supportsLookbehinds=()=>{let r=process.version.slice(1).split(".").map(Number);return r.length===3&&r[0]>=9||r[0]===8&&r[1]>=10};$t.isWindows=r=>r&&typeof r.windows=="boolean"?r.windows:A3===!0||C3.sep==="\\";$t.escapeLast=(r,e,t)=>{let n=r.lastIndexOf(e,t);return n===-1?r:r[n-1]==="\\"?$t.escapeLast(r,e,n-1):`${r.slice(0,n)}\\${r.slice(n)}`};$t.removePrefix=(r,e={})=>{let t=r;return t.startsWith("./")&&(t=t.slice(2),e.prefix="./"),t};$t.wrapOutput=(r,e={},t={})=>{let n=t.contains?"":"^",i=t.contains?"":"$",s=`${n}(?:${r})${i}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}});var VT=O((bz,KT)=>{"use strict";var $T=hu(),{CHAR_ASTERISK:mm,CHAR_AT:M3,CHAR_BACKWARD_SLASH:ta,CHAR_COMMA:I3,CHAR_DOT:gm,CHAR_EXCLAMATION_MARK:vm,CHAR_FORWARD_SLASH:zT,CHAR_LEFT_CURLY_BRACE:xm,CHAR_LEFT_PARENTHESES:ym,CHAR_LEFT_SQUARE_BRACKET:N3,CHAR_PLUS:L3,CHAR_QUESTION_MARK:qT,CHAR_RIGHT_CURLY_BRACE:D3,CHAR_RIGHT_PARENTHESES:UT,CHAR_RIGHT_SQUARE_BRACKET:B3}=ea(),WT=r=>r===zT||r===ta,GT=r=>{r.isPrefix!==!0&&(r.depth=r.isGlobstar?1/0:1)},j3=(r,e)=>{let t=e||{},n=r.length-1,i=t.parts===!0||t.scanToEnd===!0,s=[],o=[],a=[],c=r,u=-1,p=0,f=0,m=!1,y=!1,_=!1,S=!1,A=!1,P=!1,L=!1,N=!1,H=!1,W=!1,U=0,G,M,F={value:"",depth:0,isGlob:!1},T=()=>u>=n,l=()=>c.charCodeAt(u+1),h=()=>(G=M,c.charCodeAt(++u));for(;u<n;){M=h();let C;if(M===ta){L=F.backslashes=!0,M=h(),M===xm&&(P=!0);continue}if(P===!0||M===xm){for(U++;T()!==!0&&(M=h());){if(M===ta){L=F.backslashes=!0,h();continue}if(M===xm){U++;continue}if(P!==!0&&M===gm&&(M=h())===gm){if(m=F.isBrace=!0,_=F.isGlob=!0,W=!0,i===!0)continue;break}if(P!==!0&&M===I3){if(m=F.isBrace=!0,_=F.isGlob=!0,W=!0,i===!0)continue;break}if(M===D3&&(U--,U===0)){P=!1,m=F.isBrace=!0,W=!0;break}}if(i===!0)continue;break}if(M===zT){if(s.push(u),o.push(F),F={value:"",depth:0,isGlob:!1},W===!0)continue;if(G===gm&&u===p+1){p+=2;continue}f=u+1;continue}if(t.noext!==!0&&(M===L3||M===M3||M===mm||M===qT||M===vm)===!0&&l()===ym){if(_=F.isGlob=!0,S=F.isExtglob=!0,W=!0,M===vm&&u===p&&(H=!0),i===!0){for(;T()!==!0&&(M=h());){if(M===ta){L=F.backslashes=!0,M=h();continue}if(M===UT){_=F.isGlob=!0,W=!0;break}}continue}break}if(M===mm){if(G===mm&&(A=F.isGlobstar=!0),_=F.isGlob=!0,W=!0,i===!0)continue;break}if(M===qT){if(_=F.isGlob=!0,W=!0,i===!0)continue;break}if(M===N3){for(;T()!==!0&&(C=h());){if(C===ta){L=F.backslashes=!0,h();continue}if(C===B3){y=F.isBracket=!0,_=F.isGlob=!0,W=!0;break}}if(i===!0)continue;break}if(t.nonegate!==!0&&M===vm&&u===p){N=F.negated=!0,p++;continue}if(t.noparen!==!0&&M===ym){if(_=F.isGlob=!0,i===!0){for(;T()!==!0&&(M=h());){if(M===ym){L=F.backslashes=!0,M=h();continue}if(M===UT){W=!0;break}}continue}break}if(_===!0){if(W=!0,i===!0)continue;break}}t.noext===!0&&(S=!1,_=!1);let x=c,w="",g="";p>0&&(w=c.slice(0,p),c=c.slice(p),f-=p),x&&_===!0&&f>0?(x=c.slice(0,f),g=c.slice(f)):_===!0?(x="",g=c):x=c,x&&x!==""&&x!=="/"&&x!==c&&WT(x.charCodeAt(x.length-1))&&(x=x.slice(0,-1)),t.unescape===!0&&(g&&(g=$T.removeBackslashes(g)),x&&L===!0&&(x=$T.removeBackslashes(x)));let v={prefix:w,input:r,start:p,base:x,glob:g,isBrace:m,isBracket:y,isGlob:_,isExtglob:S,isGlobstar:A,negated:N,negatedExtglob:H};if(t.tokens===!0&&(v.maxDepth=0,WT(M)||o.push(F),v.tokens=o),t.parts===!0||t.tokens===!0){let C;for(let b=0;b<s.length;b++){let d=C?C+1:p,E=s[b],q=r.slice(d,E);t.tokens&&(b===0&&p!==0?(o[b].isPrefix=!0,o[b].value=w):o[b].value=q,GT(o[b]),v.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,GT(o[o.length-1]),v.maxDepth+=o[o.length-1].depth)}v.slashes=s,v.parts=a}return v};KT.exports=j3});var ZT=O((wz,QT)=>{"use strict";var ra=ea(),Et=hu(),{MAX_LENGTH:mu,POSIX_REGEX_SOURCE:F3,REGEX_NON_SPECIAL_CHARS:H3,REGEX_SPECIAL_CHARS_BACKREF:$3,REPLACEMENTS:YT}=ra,q3=(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=>Et.escapeRegex(i)).join("..")}return t},Ls=(r,e)=>`Missing ${r}: "${e}" - use "\\\\${e}" to match literal characters`,XT=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},U3=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},JT=r=>{let e=r.trim(),t=!0;for(;t===!0;)t=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),t=!0);if(U3(e))return e.replace(/\\(.)/g,"$1")},W3=r=>{let e=r.map(JT).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},_m=(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}}}}},G3=r=>{let e=0,t=[];for(;e<r.length;){let i=_m(r.slice(e),!1);if(!i||i.type!=="*")return;let s=XT(i.body).map(a=>a.trim());if(s.length!==1)return;let o=JT(s[0]);if(!o||o.length!==1)return;t.push(o),e+=i.end+1}return t.length<1?void 0:`${t.length===1?Et.escapeRegex(t[0]):`[${t.map(i=>Et.escapeRegex(i)).join("")}]`}*`},z3=r=>{let e=0,t=r.trim(),n=_m(t);for(;n;)e++,t=n.body.trim(),n=_m(t);return e},K3=(r,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let t=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:ra.DEFAULT_MAX_EXTGLOB_RECURSION,n=XT(r).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||W3(n)))return{risky:!0};for(let i of n){let s=G3(i);if(s)return{risky:!0,safeOutput:s};if(z3(i)>t)return{risky:!0}}return{risky:!1}},bm=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a string");r=YT[r]||r;let t={...e},n=typeof t.maxLength=="number"?Math.min(mu,t.maxLength):mu,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=Et.isWindows(e),u=ra.globChars(c),p=ra.extglobChars(u),{DOT_LITERAL:f,PLUS_LITERAL:m,SLASH_LITERAL:y,ONE_CHAR:_,DOTS_SLASH:S,NO_DOT:A,NO_DOT_SLASH:P,NO_DOTS_SLASH:L,QMARK:N,QMARK_NO_DOT:H,STAR:W,START_ANCHOR:U}=u,G=R=>`(${a}(?:(?!${U}${R.dot?S:f}).)*?)`,M=t.dot?"":A,F=t.dot?N:H,T=t.bash===!0?G(t):W;t.capture&&(T=`(${T})`),typeof t.noext=="boolean"&&(t.noextglob=t.noext);let l={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=Et.removePrefix(r,l),i=r.length;let h=[],x=[],w=[],g=s,v,C=()=>l.index===i-1,b=l.peek=(R=1)=>r[l.index+R],d=l.advance=()=>r[++l.index]||"",E=()=>r.slice(l.index+1),q=(R="",Y=0)=>{l.consumed+=R,l.index+=Y},I=R=>{l.output+=R.output!=null?R.output:R.value,q(R.value)},D=()=>{let R=1;for(;b()==="!"&&(b(2)!=="("||b(3)==="?");)d(),l.start++,R++;return R%2===0?!1:(l.negated=!0,l.start++,!0)},$=R=>{l[R]++,w.push(R)},K=R=>{l[R]--,w.pop()},B=R=>{if(g.type==="globstar"){let Y=l.braces>0&&(R.type==="comma"||R.type==="brace"),k=R.extglob===!0||h.length&&(R.type==="pipe"||R.type==="paren");R.type!=="slash"&&R.type!=="paren"&&!Y&&!k&&(l.output=l.output.slice(0,-g.output.length),g.type="star",g.value="*",g.output=T,l.output+=g.output)}if(h.length&&R.type!=="paren"&&(h[h.length-1].inner+=R.value),(R.value||R.output)&&I(R),g&&g.type==="text"&&R.type==="text"){g.value+=R.value,g.output=(g.output||"")+R.value;return}R.prev=g,o.push(R),g=R},me=(R,Y)=>{let k={...p[Y],conditions:1,inner:""};k.prev=g,k.parens=l.parens,k.output=l.output,k.startIndex=l.index,k.tokensIndex=o.length;let j=(t.capture?"(":"")+k.open;$("parens"),B({type:R,value:Y,output:l.output?"":_}),B({type:"paren",extglob:!0,value:d(),output:j}),h.push(k)},ie=R=>{let Y=r.slice(R.startIndex,l.index+1),k=r.slice(R.startIndex+2,l.index),j=K3(k,t);if((R.type==="plus"||R.type==="star")&&j.risky){let z=j.safeOutput?(R.output?"":_)+(t.capture?`(${j.safeOutput})`:j.safeOutput):void 0,ge=o[R.tokensIndex];ge.type="text",ge.value=Y,ge.output=z||Et.escapeRegex(Y);for(let re=R.tokensIndex+1;re<o.length;re++)o[re].value="",o[re].output="",delete o[re].suffix;l.output=R.output+ge.output,l.backtrack=!0,B({type:"paren",extglob:!0,value:v,output:""}),K("parens");return}let J=R.close+(t.capture?")":""),V;if(R.type==="negate"){let z=T;if(R.inner&&R.inner.length>1&&R.inner.includes("/")&&(z=G(t)),(z!==T||C()||/^\)+$/.test(E()))&&(J=R.close=`)$))${z}`),R.inner.includes("*")&&(V=E())&&/^\.[^\\/.]+$/.test(V)){let ge=bm(V,{...e,fastpaths:!1}).output;J=R.close=`)${ge})${z})`}R.prev.type==="bos"&&(l.negatedExtglob=!0)}B({type:"paren",extglob:!0,value:v,output:J}),K("parens")};if(t.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(r)){let R=!1,Y=r.replace($3,(k,j,J,V,z,ge)=>V==="\\"?(R=!0,k):V==="?"?j?j+V+(z?N.repeat(z.length):""):ge===0?F+(z?N.repeat(z.length):""):N.repeat(J.length):V==="."?f.repeat(J.length):V==="*"?j?j+V+(z?T:""):T:j?k:`\\${k}`);return R===!0&&(t.unescape===!0?Y=Y.replace(/\\/g,""):Y=Y.replace(/\\+/g,k=>k.length%2===0?"\\\\":k?"\\":"")),Y===r&&t.contains===!0?(l.output=r,l):(l.output=Et.wrapOutput(Y,l,e),l)}for(;!C();){if(v=d(),v==="\0")continue;if(v==="\\"){let k=b();if(k==="/"&&t.bash!==!0||k==="."||k===";")continue;if(!k){v+="\\",B({type:"text",value:v});continue}let j=/^\\+/.exec(E()),J=0;if(j&&j[0].length>2&&(J=j[0].length,l.index+=J,J%2!==0&&(v+="\\")),t.unescape===!0?v=d():v+=d(),l.brackets===0){B({type:"text",value:v});continue}}if(l.brackets>0&&(v!=="]"||g.value==="["||g.value==="[^")){if(t.posix!==!1&&v===":"){let k=g.value.slice(1);if(k.includes("[")&&(g.posix=!0,k.includes(":"))){let j=g.value.lastIndexOf("["),J=g.value.slice(0,j),V=g.value.slice(j+2),z=F3[V];if(z){g.value=J+z,l.backtrack=!0,d(),!s.output&&o.indexOf(g)===1&&(s.output=_);continue}}}(v==="["&&b()!==":"||v==="-"&&b()==="]")&&(v=`\\${v}`),v==="]"&&(g.value==="["||g.value==="[^")&&(v=`\\${v}`),t.posix===!0&&v==="!"&&g.value==="["&&(v="^"),g.value+=v,I({value:v});continue}if(l.quotes===1&&v!=='"'){v=Et.escapeRegex(v),g.value+=v,I({value:v});continue}if(v==='"'){l.quotes=l.quotes===1?0:1,t.keepQuotes===!0&&B({type:"text",value:v});continue}if(v==="("){$("parens"),B({type:"paren",value:v});continue}if(v===")"){if(l.parens===0&&t.strictBrackets===!0)throw new SyntaxError(Ls("opening","("));let k=h[h.length-1];if(k&&l.parens===k.parens+1){ie(h.pop());continue}B({type:"paren",value:v,output:l.parens?")":"\\)"}),K("parens");continue}if(v==="["){if(t.nobracket===!0||!E().includes("]")){if(t.nobracket!==!0&&t.strictBrackets===!0)throw new SyntaxError(Ls("closing","]"));v=`\\${v}`}else $("brackets");B({type:"bracket",value:v});continue}if(v==="]"){if(t.nobracket===!0||g&&g.type==="bracket"&&g.value.length===1){B({type:"text",value:v,output:`\\${v}`});continue}if(l.brackets===0){if(t.strictBrackets===!0)throw new SyntaxError(Ls("opening","["));B({type:"text",value:v,output:`\\${v}`});continue}K("brackets");let k=g.value.slice(1);if(g.posix!==!0&&k[0]==="^"&&!k.includes("/")&&(v=`/${v}`),g.value+=v,I({value:v}),t.literalBrackets===!1||Et.hasRegexChars(k))continue;let j=Et.escapeRegex(g.value);if(l.output=l.output.slice(0,-g.value.length),t.literalBrackets===!0){l.output+=j,g.value=j;continue}g.value=`(${a}${j}|${g.value})`,l.output+=g.value;continue}if(v==="{"&&t.nobrace!==!0){$("braces");let k={type:"brace",value:v,output:"(",outputIndex:l.output.length,tokensIndex:l.tokens.length};x.push(k),B(k);continue}if(v==="}"){let k=x[x.length-1];if(t.nobrace===!0||!k){B({type:"text",value:v,output:v});continue}let j=")";if(k.dots===!0){let J=o.slice(),V=[];for(let z=J.length-1;z>=0&&(o.pop(),J[z].type!=="brace");z--)J[z].type!=="dots"&&V.unshift(J[z].value);j=q3(V,t),l.backtrack=!0}if(k.comma!==!0&&k.dots!==!0){let J=l.output.slice(0,k.outputIndex),V=l.tokens.slice(k.tokensIndex);k.value=k.output="\\{",v=j="\\}",l.output=J;for(let z of V)l.output+=z.output||z.value}B({type:"brace",value:v,output:j}),K("braces"),x.pop();continue}if(v==="|"){h.length>0&&h[h.length-1].conditions++,B({type:"text",value:v});continue}if(v===","){let k=v,j=x[x.length-1];j&&w[w.length-1]==="braces"&&(j.comma=!0,k="|"),B({type:"comma",value:v,output:k});continue}if(v==="/"){if(g.type==="dot"&&l.index===l.start+1){l.start=l.index+1,l.consumed="",l.output="",o.pop(),g=s;continue}B({type:"slash",value:v,output:y});continue}if(v==="."){if(l.braces>0&&g.type==="dot"){g.value==="."&&(g.output=f);let k=x[x.length-1];g.type="dots",g.output+=v,g.value+=v,k.dots=!0;continue}if(l.braces+l.parens===0&&g.type!=="bos"&&g.type!=="slash"){B({type:"text",value:v,output:f});continue}B({type:"dot",value:v,output:f});continue}if(v==="?"){if(!(g&&g.value==="(")&&t.noextglob!==!0&&b()==="("&&b(2)!=="?"){me("qmark",v);continue}if(g&&g.type==="paren"){let j=b(),J=v;if(j==="<"&&!Et.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(g.value==="("&&!/[!=<:]/.test(j)||j==="<"&&!/<([!=]|\w+>)/.test(E()))&&(J=`\\${v}`),B({type:"text",value:v,output:J});continue}if(t.dot!==!0&&(g.type==="slash"||g.type==="bos")){B({type:"qmark",value:v,output:H});continue}B({type:"qmark",value:v,output:N});continue}if(v==="!"){if(t.noextglob!==!0&&b()==="("&&(b(2)!=="?"||!/[!=<:]/.test(b(3)))){me("negate",v);continue}if(t.nonegate!==!0&&l.index===0){D();continue}}if(v==="+"){if(t.noextglob!==!0&&b()==="("&&b(2)!=="?"){me("plus",v);continue}if(g&&g.value==="("||t.regex===!1){B({type:"plus",value:v,output:m});continue}if(g&&(g.type==="bracket"||g.type==="paren"||g.type==="brace")||l.parens>0){B({type:"plus",value:v});continue}B({type:"plus",value:m});continue}if(v==="@"){if(t.noextglob!==!0&&b()==="("&&b(2)!=="?"){B({type:"at",extglob:!0,value:v,output:""});continue}B({type:"text",value:v});continue}if(v!=="*"){(v==="$"||v==="^")&&(v=`\\${v}`);let k=H3.exec(E());k&&(v+=k[0],l.index+=k[0].length),B({type:"text",value:v});continue}if(g&&(g.type==="globstar"||g.star===!0)){g.type="star",g.star=!0,g.value+=v,g.output=T,l.backtrack=!0,l.globstar=!0,q(v);continue}let R=E();if(t.noextglob!==!0&&/^\([^?]/.test(R)){me("star",v);continue}if(g.type==="star"){if(t.noglobstar===!0){q(v);continue}let k=g.prev,j=k.prev,J=k.type==="slash"||k.type==="bos",V=j&&(j.type==="star"||j.type==="globstar");if(t.bash===!0&&(!J||R[0]&&R[0]!=="/")){B({type:"star",value:v,output:""});continue}let z=l.braces>0&&(k.type==="comma"||k.type==="brace"),ge=h.length&&(k.type==="pipe"||k.type==="paren");if(!J&&k.type!=="paren"&&!z&&!ge){B({type:"star",value:v,output:""});continue}for(;R.slice(0,3)==="/**";){let re=r[l.index+4];if(re&&re!=="/")break;R=R.slice(3),q("/**",3)}if(k.type==="bos"&&C()){g.type="globstar",g.value+=v,g.output=G(t),l.output=g.output,l.globstar=!0,q(v);continue}if(k.type==="slash"&&k.prev.type!=="bos"&&!V&&C()){l.output=l.output.slice(0,-(k.output+g.output).length),k.output=`(?:${k.output}`,g.type="globstar",g.output=G(t)+(t.strictSlashes?")":"|$)"),g.value+=v,l.globstar=!0,l.output+=k.output+g.output,q(v);continue}if(k.type==="slash"&&k.prev.type!=="bos"&&R[0]==="/"){let re=R[1]!==void 0?"|$":"";l.output=l.output.slice(0,-(k.output+g.output).length),k.output=`(?:${k.output}`,g.type="globstar",g.output=`${G(t)}${y}|${y}${re})`,g.value+=v,l.output+=k.output+g.output,l.globstar=!0,q(v+d()),B({type:"slash",value:"/",output:""});continue}if(k.type==="bos"&&R[0]==="/"){g.type="globstar",g.value+=v,g.output=`(?:^|${y}|${G(t)}${y})`,l.output=g.output,l.globstar=!0,q(v+d()),B({type:"slash",value:"/",output:""});continue}l.output=l.output.slice(0,-g.output.length),g.type="globstar",g.output=G(t),g.value+=v,l.output+=g.output,l.globstar=!0,q(v);continue}let Y={type:"star",value:v,output:T};if(t.bash===!0){Y.output=".*?",(g.type==="bos"||g.type==="slash")&&(Y.output=M+Y.output),B(Y);continue}if(g&&(g.type==="bracket"||g.type==="paren")&&t.regex===!0){Y.output=v,B(Y);continue}(l.index===l.start||g.type==="slash"||g.type==="dot")&&(g.type==="dot"?(l.output+=P,g.output+=P):t.dot===!0?(l.output+=L,g.output+=L):(l.output+=M,g.output+=M),b()!=="*"&&(l.output+=_,g.output+=_)),B(Y)}for(;l.brackets>0;){if(t.strictBrackets===!0)throw new SyntaxError(Ls("closing","]"));l.output=Et.escapeLast(l.output,"["),K("brackets")}for(;l.parens>0;){if(t.strictBrackets===!0)throw new SyntaxError(Ls("closing",")"));l.output=Et.escapeLast(l.output,"("),K("parens")}for(;l.braces>0;){if(t.strictBrackets===!0)throw new SyntaxError(Ls("closing","}"));l.output=Et.escapeLast(l.output,"{"),K("braces")}if(t.strictSlashes!==!0&&(g.type==="star"||g.type==="bracket")&&B({type:"maybe_slash",value:"",output:`${y}?`}),l.backtrack===!0){l.output="";for(let R of l.tokens)l.output+=R.output!=null?R.output:R.value,R.suffix&&(l.output+=R.suffix)}return l};bm.fastpaths=(r,e)=>{let t={...e},n=typeof t.maxLength=="number"?Math.min(mu,t.maxLength):mu,i=r.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);r=YT[r]||r;let s=Et.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:u,NO_DOT:p,NO_DOTS:f,NO_DOTS_SLASH:m,STAR:y,START_ANCHOR:_}=ra.globChars(s),S=t.dot?f:p,A=t.dot?m:p,P=t.capture?"":"?:",L={negated:!1,prefix:""},N=t.bash===!0?".*?":y;t.capture&&(N=`(${N})`);let H=M=>M.noglobstar===!0?N:`(${P}(?:(?!${_}${M.dot?u:o}).)*?)`,W=M=>{switch(M){case"*":return`${S}${c}${N}`;case".*":return`${o}${c}${N}`;case"*.*":return`${S}${N}${o}${c}${N}`;case"*/*":return`${S}${N}${a}${c}${A}${N}`;case"**":return S+H(t);case"**/*":return`(?:${S}${H(t)}${a})?${A}${c}${N}`;case"**/*.*":return`(?:${S}${H(t)}${a})?${A}${N}${o}${c}${N}`;case"**/.*":return`(?:${S}${H(t)}${a})?${o}${c}${N}`;default:{let F=/^(.*?)\.(\w+)$/.exec(M);if(!F)return;let T=W(F[1]);return T?T+o+F[2]:void 0}}},U=Et.removePrefix(r,L),G=W(U);return G&&t.strictSlashes!==!0&&(G+=`${a}?`),G};QT.exports=bm});var tC=O((Sz,eC)=>{"use strict";var V3=require("path"),Y3=VT(),wm=ZT(),Sm=hu(),X3=ea(),J3=r=>r&&typeof r=="object"&&!Array.isArray(r),ke=(r,e,t=!1)=>{if(Array.isArray(r)){let p=r.map(m=>ke(m,e,t));return m=>{for(let y of p){let _=y(m);if(_)return _}return!1}}let n=J3(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=Sm.isWindows(e),o=n?ke.compileRe(r,e):ke.makeRe(r,e,!1,!0),a=o.state;delete o.state;let c=()=>!1;if(i.ignore){let p={...e,ignore:null,onMatch:null,onResult:null};c=ke(i.ignore,p,t)}let u=(p,f=!1)=>{let{isMatch:m,match:y,output:_}=ke.test(p,o,e,{glob:r,posix:s}),S={glob:r,state:a,regex:o,posix:s,input:p,output:_,match:y,isMatch:m};return typeof i.onResult=="function"&&i.onResult(S),m===!1?(S.isMatch=!1,f?S:!1):c(p)?(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&&(u.state=a),u};ke.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?Sm.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=ke.matchBase(r,e,t,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};ke.matchBase=(r,e,t,n=Sm.isWindows(t))=>(e instanceof RegExp?e:ke.makeRe(e,t)).test(V3.basename(r));ke.isMatch=(r,e,t)=>ke(e,t)(r);ke.parse=(r,e)=>Array.isArray(r)?r.map(t=>ke.parse(t,e)):wm(r,{...e,fastpaths:!1});ke.scan=(r,e)=>Y3(r,e);ke.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=ke.toRegex(a,e);return n===!0&&(c.state=r),c};ke.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=wm.fastpaths(r,e)),i.output||(i=wm(r,e)),ke.compileRe(i,e,t,n)};ke.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/$^/}};ke.constants=X3;eC.exports=ke});var nC=O((Ez,rC)=>{"use strict";rC.exports=tC()});var pC=O((Tz,uC)=>{"use strict";var ia=require("fs"),{Readable:Q3}=require("stream"),na=require("path"),{promisify:yu}=require("util"),Em=nC(),Z3=yu(ia.readdir),eH=yu(ia.stat),iC=yu(ia.lstat),tH=yu(ia.realpath),rH="!",cC="READDIRP_RECURSIVE_ERROR",nH=new Set(["ENOENT","EPERM","EACCES","ELOOP",cC]),Tm="files",lC="directories",vu="files_directories",gu="all",sC=[Tm,lC,vu,gu],iH=r=>nH.has(r.code),[oC,sH]=process.versions.node.split(".").slice(0,2).map(r=>Number.parseInt(r,10)),oH=process.platform==="win32"&&(oC>10||oC===10&&sH>=5),aC=r=>{if(r!==void 0){if(typeof r=="function")return r;if(typeof r=="string"){let e=Em(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)===rH?t.push(Em(i.slice(1))):e.push(Em(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))}}},xu=class r extends Q3{static get defaultOptions(){return{root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:Tm,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=aC(t.fileFilter),this._directoryFilter=aC(t.directoryFilter);let s=t.lstat?iC:eH;oH?this._stat=o=>s(o,{bigint:!0}):this._stat=s,this._maxDepth=t.depth,this._wantsDir=[lC,vu,gu].includes(i),this._wantsFile=[Tm,vu,gu].includes(i),this._wantsEverything=i===gu,this._root=na.resolve(n),this._isDirent="Dirent"in ia&&!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 Z3(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=na.resolve(na.join(t,i));n={path:na.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){iH(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 tH(n),s=await iC(i);if(s.isFile())return"file";if(s.isDirectory()){let o=i.length;if(n.startsWith(i)&&n.substr(o,1)===na.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()}},Ds=(r,e={})=>{let t=e.entryType||e.type;if(t==="both"&&(t=vu),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 xu(e)},aH=(r,e={})=>new Promise((t,n)=>{let i=[];Ds(r,e).on("data",s=>i.push(s)).on("end",()=>t(i)).on("error",s=>n(s))});Ds.promise=aH;Ds.ReaddirpStream=xu;Ds.default=Ds;uC.exports=Ds});var sa=O((Cz,gC)=>{"use strict";var cH=require("path"),Kr="\\\\/",fC=`[^${Kr}]`,lH=0,bn="\\.",uH="\\+",pH="\\?",_u="\\/",fH="(?=.)",dC="[^/]",Cm=`(?:${_u}|$)`,hC=`(?:^|${_u})`,Am=`${bn}{1,2}${Cm}`,dH=`(?!${bn})`,hH=`(?!${hC}${Am})`,mH=`(?!${bn}{0,1}${Cm})`,gH=`(?!${Am})`,vH=`[^.${_u}]`,xH=`${dC}*?`,mC={DOT_LITERAL:bn,PLUS_LITERAL:uH,QMARK_LITERAL:pH,SLASH_LITERAL:_u,ONE_CHAR:fH,QMARK:dC,END_ANCHOR:Cm,DOTS_SLASH:Am,NO_DOT:dH,NO_DOTS:hH,NO_DOT_SLASH:mH,NO_DOTS_SLASH:gH,QMARK_NO_DOT:vH,STAR:xH,START_ANCHOR:hC},yH={...mC,SLASH_LITERAL:`[${Kr}]`,QMARK:fC,STAR:`${fC}*?`,DOTS_SLASH:`${bn}{1,2}(?:[${Kr}]|$)`,NO_DOT:`(?!${bn})`,NO_DOTS:`(?!(?:^|[${Kr}])${bn}{1,2}(?:[${Kr}]|$))`,NO_DOT_SLASH:`(?!${bn}{0,1}(?:[${Kr}]|$))`,NO_DOTS_SLASH:`(?!${bn}{1,2}(?:[${Kr}]|$))`,QMARK_NO_DOT:`[^.${Kr}]`,START_ANCHOR:`(?:^|[${Kr}])`,END_ANCHOR:`(?:[${Kr}]|$)`},_H={__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"};gC.exports={DEFAULT_MAX_EXTGLOB_RECURSION:lH,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:_H,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:cH.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?yH:mC}}});var bu=O(qt=>{"use strict";var bH=require("path"),wH=process.platform==="win32",{REGEX_BACKSLASH:SH,REGEX_REMOVE_BACKSLASH:EH,REGEX_SPECIAL_CHARS:TH,REGEX_SPECIAL_CHARS_GLOBAL:CH}=sa();qt.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r);qt.hasRegexChars=r=>TH.test(r);qt.isRegexChar=r=>r.length===1&&qt.hasRegexChars(r);qt.escapeRegex=r=>r.replace(CH,"\\$1");qt.toPosixSlashes=r=>r.replace(SH,"/");qt.removeBackslashes=r=>r.replace(EH,e=>e==="\\"?"":e);qt.supportsLookbehinds=()=>{let r=process.version.slice(1).split(".").map(Number);return r.length===3&&r[0]>=9||r[0]===8&&r[1]>=10};qt.isWindows=r=>r&&typeof r.windows=="boolean"?r.windows:wH===!0||bH.sep==="\\";qt.escapeLast=(r,e,t)=>{let n=r.lastIndexOf(e,t);return n===-1?r:r[n-1]==="\\"?qt.escapeLast(r,e,n-1):`${r.slice(0,n)}\\${r.slice(n)}`};qt.removePrefix=(r,e={})=>{let t=r;return t.startsWith("./")&&(t=t.slice(2),e.prefix="./"),t};qt.wrapOutput=(r,e={},t={})=>{let n=t.contains?"":"^",i=t.contains?"":"$",s=`${n}(?:${r})${i}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}});var EC=O((Rz,SC)=>{"use strict";var vC=bu(),{CHAR_ASTERISK:Rm,CHAR_AT:AH,CHAR_BACKWARD_SLASH:oa,CHAR_COMMA:RH,CHAR_DOT:km,CHAR_EXCLAMATION_MARK:Om,CHAR_FORWARD_SLASH:wC,CHAR_LEFT_CURLY_BRACE:Pm,CHAR_LEFT_PARENTHESES:Mm,CHAR_LEFT_SQUARE_BRACKET:kH,CHAR_PLUS:OH,CHAR_QUESTION_MARK:xC,CHAR_RIGHT_CURLY_BRACE:PH,CHAR_RIGHT_PARENTHESES:yC,CHAR_RIGHT_SQUARE_BRACKET:MH}=sa(),_C=r=>r===wC||r===oa,bC=r=>{r.isPrefix!==!0&&(r.depth=r.isGlobstar?1/0:1)},IH=(r,e)=>{let t=e||{},n=r.length-1,i=t.parts===!0||t.scanToEnd===!0,s=[],o=[],a=[],c=r,u=-1,p=0,f=0,m=!1,y=!1,_=!1,S=!1,A=!1,P=!1,L=!1,N=!1,H=!1,W=!1,U=0,G,M,F={value:"",depth:0,isGlob:!1},T=()=>u>=n,l=()=>c.charCodeAt(u+1),h=()=>(G=M,c.charCodeAt(++u));for(;u<n;){M=h();let C;if(M===oa){L=F.backslashes=!0,M=h(),M===Pm&&(P=!0);continue}if(P===!0||M===Pm){for(U++;T()!==!0&&(M=h());){if(M===oa){L=F.backslashes=!0,h();continue}if(M===Pm){U++;continue}if(P!==!0&&M===km&&(M=h())===km){if(m=F.isBrace=!0,_=F.isGlob=!0,W=!0,i===!0)continue;break}if(P!==!0&&M===RH){if(m=F.isBrace=!0,_=F.isGlob=!0,W=!0,i===!0)continue;break}if(M===PH&&(U--,U===0)){P=!1,m=F.isBrace=!0,W=!0;break}}if(i===!0)continue;break}if(M===wC){if(s.push(u),o.push(F),F={value:"",depth:0,isGlob:!1},W===!0)continue;if(G===km&&u===p+1){p+=2;continue}f=u+1;continue}if(t.noext!==!0&&(M===OH||M===AH||M===Rm||M===xC||M===Om)===!0&&l()===Mm){if(_=F.isGlob=!0,S=F.isExtglob=!0,W=!0,M===Om&&u===p&&(H=!0),i===!0){for(;T()!==!0&&(M=h());){if(M===oa){L=F.backslashes=!0,M=h();continue}if(M===yC){_=F.isGlob=!0,W=!0;break}}continue}break}if(M===Rm){if(G===Rm&&(A=F.isGlobstar=!0),_=F.isGlob=!0,W=!0,i===!0)continue;break}if(M===xC){if(_=F.isGlob=!0,W=!0,i===!0)continue;break}if(M===kH){for(;T()!==!0&&(C=h());){if(C===oa){L=F.backslashes=!0,h();continue}if(C===MH){y=F.isBracket=!0,_=F.isGlob=!0,W=!0;break}}if(i===!0)continue;break}if(t.nonegate!==!0&&M===Om&&u===p){N=F.negated=!0,p++;continue}if(t.noparen!==!0&&M===Mm){if(_=F.isGlob=!0,i===!0){for(;T()!==!0&&(M=h());){if(M===Mm){L=F.backslashes=!0,M=h();continue}if(M===yC){W=!0;break}}continue}break}if(_===!0){if(W=!0,i===!0)continue;break}}t.noext===!0&&(S=!1,_=!1);let x=c,w="",g="";p>0&&(w=c.slice(0,p),c=c.slice(p),f-=p),x&&_===!0&&f>0?(x=c.slice(0,f),g=c.slice(f)):_===!0?(x="",g=c):x=c,x&&x!==""&&x!=="/"&&x!==c&&_C(x.charCodeAt(x.length-1))&&(x=x.slice(0,-1)),t.unescape===!0&&(g&&(g=vC.removeBackslashes(g)),x&&L===!0&&(x=vC.removeBackslashes(x)));let v={prefix:w,input:r,start:p,base:x,glob:g,isBrace:m,isBracket:y,isGlob:_,isExtglob:S,isGlobstar:A,negated:N,negatedExtglob:H};if(t.tokens===!0&&(v.maxDepth=0,_C(M)||o.push(F),v.tokens=o),t.parts===!0||t.tokens===!0){let C;for(let b=0;b<s.length;b++){let d=C?C+1:p,E=s[b],q=r.slice(d,E);t.tokens&&(b===0&&p!==0?(o[b].isPrefix=!0,o[b].value=w):o[b].value=q,bC(o[b]),v.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,bC(o[o.length-1]),v.maxDepth+=o[o.length-1].depth)}v.slashes=s,v.parts=a}return v};SC.exports=IH});var kC=O((kz,RC)=>{"use strict";var aa=sa(),Tt=bu(),{MAX_LENGTH:wu,POSIX_REGEX_SOURCE:NH,REGEX_NON_SPECIAL_CHARS:LH,REGEX_SPECIAL_CHARS_BACKREF:DH,REPLACEMENTS:TC}=aa,BH=(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},Bs=(r,e)=>`Missing ${r}: "${e}" - use "\\\\${e}" to match literal characters`,CC=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},jH=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},AC=r=>{let e=r.trim(),t=!0;for(;t===!0;)t=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),t=!0);if(jH(e))return e.replace(/\\(.)/g,"$1")},FH=r=>{let e=r.map(AC).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},Im=(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}}}}},HH=r=>{let e=0,t=[];for(;e<r.length;){let i=Im(r.slice(e),!1);if(!i||i.type!=="*")return;let s=CC(i.body).map(a=>a.trim());if(s.length!==1)return;let o=AC(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("")}]`}*`},$H=r=>{let e=0,t=r.trim(),n=Im(t);for(;n;)e++,t=n.body.trim(),n=Im(t);return e},qH=(r,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let t=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:aa.DEFAULT_MAX_EXTGLOB_RECURSION,n=CC(r).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||FH(n)))return{risky:!0};for(let i of n){let s=HH(i);if(s)return{risky:!0,safeOutput:s};if($H(i)>t)return{risky:!0}}return{risky:!1}},Nm=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a string");r=TC[r]||r;let t={...e},n=typeof t.maxLength=="number"?Math.min(wu,t.maxLength):wu,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),u=aa.globChars(c),p=aa.extglobChars(u),{DOT_LITERAL:f,PLUS_LITERAL:m,SLASH_LITERAL:y,ONE_CHAR:_,DOTS_SLASH:S,NO_DOT:A,NO_DOT_SLASH:P,NO_DOTS_SLASH:L,QMARK:N,QMARK_NO_DOT:H,STAR:W,START_ANCHOR:U}=u,G=R=>`(${a}(?:(?!${U}${R.dot?S:f}).)*?)`,M=t.dot?"":A,F=t.dot?N:H,T=t.bash===!0?G(t):W;t.capture&&(T=`(${T})`),typeof t.noext=="boolean"&&(t.noextglob=t.noext);let l={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,l),i=r.length;let h=[],x=[],w=[],g=s,v,C=()=>l.index===i-1,b=l.peek=(R=1)=>r[l.index+R],d=l.advance=()=>r[++l.index]||"",E=()=>r.slice(l.index+1),q=(R="",Y=0)=>{l.consumed+=R,l.index+=Y},I=R=>{l.output+=R.output!=null?R.output:R.value,q(R.value)},D=()=>{let R=1;for(;b()==="!"&&(b(2)!=="("||b(3)==="?");)d(),l.start++,R++;return R%2===0?!1:(l.negated=!0,l.start++,!0)},$=R=>{l[R]++,w.push(R)},K=R=>{l[R]--,w.pop()},B=R=>{if(g.type==="globstar"){let Y=l.braces>0&&(R.type==="comma"||R.type==="brace"),k=R.extglob===!0||h.length&&(R.type==="pipe"||R.type==="paren");R.type!=="slash"&&R.type!=="paren"&&!Y&&!k&&(l.output=l.output.slice(0,-g.output.length),g.type="star",g.value="*",g.output=T,l.output+=g.output)}if(h.length&&R.type!=="paren"&&(h[h.length-1].inner+=R.value),(R.value||R.output)&&I(R),g&&g.type==="text"&&R.type==="text"){g.value+=R.value,g.output=(g.output||"")+R.value;return}R.prev=g,o.push(R),g=R},me=(R,Y)=>{let k={...p[Y],conditions:1,inner:""};k.prev=g,k.parens=l.parens,k.output=l.output,k.startIndex=l.index,k.tokensIndex=o.length;let j=(t.capture?"(":"")+k.open;$("parens"),B({type:R,value:Y,output:l.output?"":_}),B({type:"paren",extglob:!0,value:d(),output:j}),h.push(k)},ie=R=>{let Y=r.slice(R.startIndex,l.index+1),k=r.slice(R.startIndex+2,l.index),j=qH(k,t);if((R.type==="plus"||R.type==="star")&&j.risky){let z=j.safeOutput?(R.output?"":_)+(t.capture?`(${j.safeOutput})`:j.safeOutput):void 0,ge=o[R.tokensIndex];ge.type="text",ge.value=Y,ge.output=z||Tt.escapeRegex(Y);for(let re=R.tokensIndex+1;re<o.length;re++)o[re].value="",o[re].output="",delete o[re].suffix;l.output=R.output+ge.output,l.backtrack=!0,B({type:"paren",extglob:!0,value:v,output:""}),K("parens");return}let J=R.close+(t.capture?")":""),V;if(R.type==="negate"){let z=T;if(R.inner&&R.inner.length>1&&R.inner.includes("/")&&(z=G(t)),(z!==T||C()||/^\)+$/.test(E()))&&(J=R.close=`)$))${z}`),R.inner.includes("*")&&(V=E())&&/^\.[^\\/.]+$/.test(V)){let ge=Nm(V,{...e,fastpaths:!1}).output;J=R.close=`)${ge})${z})`}R.prev.type==="bos"&&(l.negatedExtglob=!0)}B({type:"paren",extglob:!0,value:v,output:J}),K("parens")};if(t.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(r)){let R=!1,Y=r.replace(DH,(k,j,J,V,z,ge)=>V==="\\"?(R=!0,k):V==="?"?j?j+V+(z?N.repeat(z.length):""):ge===0?F+(z?N.repeat(z.length):""):N.repeat(J.length):V==="."?f.repeat(J.length):V==="*"?j?j+V+(z?T:""):T:j?k:`\\${k}`);return R===!0&&(t.unescape===!0?Y=Y.replace(/\\/g,""):Y=Y.replace(/\\+/g,k=>k.length%2===0?"\\\\":k?"\\":"")),Y===r&&t.contains===!0?(l.output=r,l):(l.output=Tt.wrapOutput(Y,l,e),l)}for(;!C();){if(v=d(),v==="\0")continue;if(v==="\\"){let k=b();if(k==="/"&&t.bash!==!0||k==="."||k===";")continue;if(!k){v+="\\",B({type:"text",value:v});continue}let j=/^\\+/.exec(E()),J=0;if(j&&j[0].length>2&&(J=j[0].length,l.index+=J,J%2!==0&&(v+="\\")),t.unescape===!0?v=d():v+=d(),l.brackets===0){B({type:"text",value:v});continue}}if(l.brackets>0&&(v!=="]"||g.value==="["||g.value==="[^")){if(t.posix!==!1&&v===":"){let k=g.value.slice(1);if(k.includes("[")&&(g.posix=!0,k.includes(":"))){let j=g.value.lastIndexOf("["),J=g.value.slice(0,j),V=g.value.slice(j+2),z=NH[V];if(z){g.value=J+z,l.backtrack=!0,d(),!s.output&&o.indexOf(g)===1&&(s.output=_);continue}}}(v==="["&&b()!==":"||v==="-"&&b()==="]")&&(v=`\\${v}`),v==="]"&&(g.value==="["||g.value==="[^")&&(v=`\\${v}`),t.posix===!0&&v==="!"&&g.value==="["&&(v="^"),g.value+=v,I({value:v});continue}if(l.quotes===1&&v!=='"'){v=Tt.escapeRegex(v),g.value+=v,I({value:v});continue}if(v==='"'){l.quotes=l.quotes===1?0:1,t.keepQuotes===!0&&B({type:"text",value:v});continue}if(v==="("){$("parens"),B({type:"paren",value:v});continue}if(v===")"){if(l.parens===0&&t.strictBrackets===!0)throw new SyntaxError(Bs("opening","("));let k=h[h.length-1];if(k&&l.parens===k.parens+1){ie(h.pop());continue}B({type:"paren",value:v,output:l.parens?")":"\\)"}),K("parens");continue}if(v==="["){if(t.nobracket===!0||!E().includes("]")){if(t.nobracket!==!0&&t.strictBrackets===!0)throw new SyntaxError(Bs("closing","]"));v=`\\${v}`}else $("brackets");B({type:"bracket",value:v});continue}if(v==="]"){if(t.nobracket===!0||g&&g.type==="bracket"&&g.value.length===1){B({type:"text",value:v,output:`\\${v}`});continue}if(l.brackets===0){if(t.strictBrackets===!0)throw new SyntaxError(Bs("opening","["));B({type:"text",value:v,output:`\\${v}`});continue}K("brackets");let k=g.value.slice(1);if(g.posix!==!0&&k[0]==="^"&&!k.includes("/")&&(v=`/${v}`),g.value+=v,I({value:v}),t.literalBrackets===!1||Tt.hasRegexChars(k))continue;let j=Tt.escapeRegex(g.value);if(l.output=l.output.slice(0,-g.value.length),t.literalBrackets===!0){l.output+=j,g.value=j;continue}g.value=`(${a}${j}|${g.value})`,l.output+=g.value;continue}if(v==="{"&&t.nobrace!==!0){$("braces");let k={type:"brace",value:v,output:"(",outputIndex:l.output.length,tokensIndex:l.tokens.length};x.push(k),B(k);continue}if(v==="}"){let k=x[x.length-1];if(t.nobrace===!0||!k){B({type:"text",value:v,output:v});continue}let j=")";if(k.dots===!0){let J=o.slice(),V=[];for(let z=J.length-1;z>=0&&(o.pop(),J[z].type!=="brace");z--)J[z].type!=="dots"&&V.unshift(J[z].value);j=BH(V,t),l.backtrack=!0}if(k.comma!==!0&&k.dots!==!0){let J=l.output.slice(0,k.outputIndex),V=l.tokens.slice(k.tokensIndex);k.value=k.output="\\{",v=j="\\}",l.output=J;for(let z of V)l.output+=z.output||z.value}B({type:"brace",value:v,output:j}),K("braces"),x.pop();continue}if(v==="|"){h.length>0&&h[h.length-1].conditions++,B({type:"text",value:v});continue}if(v===","){let k=v,j=x[x.length-1];j&&w[w.length-1]==="braces"&&(j.comma=!0,k="|"),B({type:"comma",value:v,output:k});continue}if(v==="/"){if(g.type==="dot"&&l.index===l.start+1){l.start=l.index+1,l.consumed="",l.output="",o.pop(),g=s;continue}B({type:"slash",value:v,output:y});continue}if(v==="."){if(l.braces>0&&g.type==="dot"){g.value==="."&&(g.output=f);let k=x[x.length-1];g.type="dots",g.output+=v,g.value+=v,k.dots=!0;continue}if(l.braces+l.parens===0&&g.type!=="bos"&&g.type!=="slash"){B({type:"text",value:v,output:f});continue}B({type:"dot",value:v,output:f});continue}if(v==="?"){if(!(g&&g.value==="(")&&t.noextglob!==!0&&b()==="("&&b(2)!=="?"){me("qmark",v);continue}if(g&&g.type==="paren"){let j=b(),J=v;if(j==="<"&&!Tt.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(g.value==="("&&!/[!=<:]/.test(j)||j==="<"&&!/<([!=]|\w+>)/.test(E()))&&(J=`\\${v}`),B({type:"text",value:v,output:J});continue}if(t.dot!==!0&&(g.type==="slash"||g.type==="bos")){B({type:"qmark",value:v,output:H});continue}B({type:"qmark",value:v,output:N});continue}if(v==="!"){if(t.noextglob!==!0&&b()==="("&&(b(2)!=="?"||!/[!=<:]/.test(b(3)))){me("negate",v);continue}if(t.nonegate!==!0&&l.index===0){D();continue}}if(v==="+"){if(t.noextglob!==!0&&b()==="("&&b(2)!=="?"){me("plus",v);continue}if(g&&g.value==="("||t.regex===!1){B({type:"plus",value:v,output:m});continue}if(g&&(g.type==="bracket"||g.type==="paren"||g.type==="brace")||l.parens>0){B({type:"plus",value:v});continue}B({type:"plus",value:m});continue}if(v==="@"){if(t.noextglob!==!0&&b()==="("&&b(2)!=="?"){B({type:"at",extglob:!0,value:v,output:""});continue}B({type:"text",value:v});continue}if(v!=="*"){(v==="$"||v==="^")&&(v=`\\${v}`);let k=LH.exec(E());k&&(v+=k[0],l.index+=k[0].length),B({type:"text",value:v});continue}if(g&&(g.type==="globstar"||g.star===!0)){g.type="star",g.star=!0,g.value+=v,g.output=T,l.backtrack=!0,l.globstar=!0,q(v);continue}let R=E();if(t.noextglob!==!0&&/^\([^?]/.test(R)){me("star",v);continue}if(g.type==="star"){if(t.noglobstar===!0){q(v);continue}let k=g.prev,j=k.prev,J=k.type==="slash"||k.type==="bos",V=j&&(j.type==="star"||j.type==="globstar");if(t.bash===!0&&(!J||R[0]&&R[0]!=="/")){B({type:"star",value:v,output:""});continue}let z=l.braces>0&&(k.type==="comma"||k.type==="brace"),ge=h.length&&(k.type==="pipe"||k.type==="paren");if(!J&&k.type!=="paren"&&!z&&!ge){B({type:"star",value:v,output:""});continue}for(;R.slice(0,3)==="/**";){let re=r[l.index+4];if(re&&re!=="/")break;R=R.slice(3),q("/**",3)}if(k.type==="bos"&&C()){g.type="globstar",g.value+=v,g.output=G(t),l.output=g.output,l.globstar=!0,q(v);continue}if(k.type==="slash"&&k.prev.type!=="bos"&&!V&&C()){l.output=l.output.slice(0,-(k.output+g.output).length),k.output=`(?:${k.output}`,g.type="globstar",g.output=G(t)+(t.strictSlashes?")":"|$)"),g.value+=v,l.globstar=!0,l.output+=k.output+g.output,q(v);continue}if(k.type==="slash"&&k.prev.type!=="bos"&&R[0]==="/"){let re=R[1]!==void 0?"|$":"";l.output=l.output.slice(0,-(k.output+g.output).length),k.output=`(?:${k.output}`,g.type="globstar",g.output=`${G(t)}${y}|${y}${re})`,g.value+=v,l.output+=k.output+g.output,l.globstar=!0,q(v+d()),B({type:"slash",value:"/",output:""});continue}if(k.type==="bos"&&R[0]==="/"){g.type="globstar",g.value+=v,g.output=`(?:^|${y}|${G(t)}${y})`,l.output=g.output,l.globstar=!0,q(v+d()),B({type:"slash",value:"/",output:""});continue}l.output=l.output.slice(0,-g.output.length),g.type="globstar",g.output=G(t),g.value+=v,l.output+=g.output,l.globstar=!0,q(v);continue}let Y={type:"star",value:v,output:T};if(t.bash===!0){Y.output=".*?",(g.type==="bos"||g.type==="slash")&&(Y.output=M+Y.output),B(Y);continue}if(g&&(g.type==="bracket"||g.type==="paren")&&t.regex===!0){Y.output=v,B(Y);continue}(l.index===l.start||g.type==="slash"||g.type==="dot")&&(g.type==="dot"?(l.output+=P,g.output+=P):t.dot===!0?(l.output+=L,g.output+=L):(l.output+=M,g.output+=M),b()!=="*"&&(l.output+=_,g.output+=_)),B(Y)}for(;l.brackets>0;){if(t.strictBrackets===!0)throw new SyntaxError(Bs("closing","]"));l.output=Tt.escapeLast(l.output,"["),K("brackets")}for(;l.parens>0;){if(t.strictBrackets===!0)throw new SyntaxError(Bs("closing",")"));l.output=Tt.escapeLast(l.output,"("),K("parens")}for(;l.braces>0;){if(t.strictBrackets===!0)throw new SyntaxError(Bs("closing","}"));l.output=Tt.escapeLast(l.output,"{"),K("braces")}if(t.strictSlashes!==!0&&(g.type==="star"||g.type==="bracket")&&B({type:"maybe_slash",value:"",output:`${y}?`}),l.backtrack===!0){l.output="";for(let R of l.tokens)l.output+=R.output!=null?R.output:R.value,R.suffix&&(l.output+=R.suffix)}return l};Nm.fastpaths=(r,e)=>{let t={...e},n=typeof t.maxLength=="number"?Math.min(wu,t.maxLength):wu,i=r.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);r=TC[r]||r;let s=Tt.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:u,NO_DOT:p,NO_DOTS:f,NO_DOTS_SLASH:m,STAR:y,START_ANCHOR:_}=aa.globChars(s),S=t.dot?f:p,A=t.dot?m:p,P=t.capture?"":"?:",L={negated:!1,prefix:""},N=t.bash===!0?".*?":y;t.capture&&(N=`(${N})`);let H=M=>M.noglobstar===!0?N:`(${P}(?:(?!${_}${M.dot?u:o}).)*?)`,W=M=>{switch(M){case"*":return`${S}${c}${N}`;case".*":return`${o}${c}${N}`;case"*.*":return`${S}${N}${o}${c}${N}`;case"*/*":return`${S}${N}${a}${c}${A}${N}`;case"**":return S+H(t);case"**/*":return`(?:${S}${H(t)}${a})?${A}${c}${N}`;case"**/*.*":return`(?:${S}${H(t)}${a})?${A}${N}${o}${c}${N}`;case"**/.*":return`(?:${S}${H(t)}${a})?${o}${c}${N}`;default:{let F=/^(.*?)\.(\w+)$/.exec(M);if(!F)return;let T=W(F[1]);return T?T+o+F[2]:void 0}}},U=Tt.removePrefix(r,L),G=W(U);return G&&t.strictSlashes!==!0&&(G+=`${a}?`),G};RC.exports=Nm});var PC=O((Oz,OC)=>{"use strict";var UH=require("path"),WH=EC(),Lm=kC(),Dm=bu(),GH=sa(),zH=r=>r&&typeof r=="object"&&!Array.isArray(r),Oe=(r,e,t=!1)=>{if(Array.isArray(r)){let p=r.map(m=>Oe(m,e,t));return m=>{for(let y of p){let _=y(m);if(_)return _}return!1}}let n=zH(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=Dm.isWindows(e),o=n?Oe.compileRe(r,e):Oe.makeRe(r,e,!1,!0),a=o.state;delete o.state;let c=()=>!1;if(i.ignore){let p={...e,ignore:null,onMatch:null,onResult:null};c=Oe(i.ignore,p,t)}let u=(p,f=!1)=>{let{isMatch:m,match:y,output:_}=Oe.test(p,o,e,{glob:r,posix:s}),S={glob:r,state:a,regex:o,posix:s,input:p,output:_,match:y,isMatch:m};return typeof i.onResult=="function"&&i.onResult(S),m===!1?(S.isMatch=!1,f?S:!1):c(p)?(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&&(u.state=a),u};Oe.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?Dm.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=Oe.matchBase(r,e,t,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Oe.matchBase=(r,e,t,n=Dm.isWindows(t))=>(e instanceof RegExp?e:Oe.makeRe(e,t)).test(UH.basename(r));Oe.isMatch=(r,e,t)=>Oe(e,t)(r);Oe.parse=(r,e)=>Array.isArray(r)?r.map(t=>Oe.parse(t,e)):Lm(r,{...e,fastpaths:!1});Oe.scan=(r,e)=>WH(r,e);Oe.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=Oe.toRegex(a,e);return n===!0&&(c.state=r),c};Oe.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=Lm.fastpaths(r,e)),i.output||(i=Lm(r,e)),Oe.compileRe(i,e,t,n)};Oe.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/$^/}};Oe.constants=GH;OC.exports=Oe});var IC=O((Pz,MC)=>{"use strict";MC.exports=PC()});var Bm=O((Mz,NC)=>{NC.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 HC=O((jC,FC)=>{"use strict";Object.defineProperty(jC,"__esModule",{value:!0});var BC=IC(),KH=Bm(),LC="!",VH={returnIndex:!1},YH=r=>Array.isArray(r)?r:[r],XH=(r,e)=>{if(typeof r=="function")return r;if(typeof r=="string"){let t=BC(r,e);return n=>r===n||t(n)}return r instanceof RegExp?t=>r.test(t):t=>!1},DC=(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=KH(s,!1);for(let c=0;c<e.length;c++){let u=e[c];if(u(o))return n?-1:!1}let a=i&&[o].concat(t.slice(1));for(let c=0;c<r.length;c++){let u=r[c];if(i?u(...a):u(o))return n?c:!0}return n?-1:!1},jm=(r,e,t=VH)=>{if(r==null)throw new TypeError("anymatch: specify first argument");let n=typeof t=="boolean"?{returnIndex:t}:t,i=n.returnIndex||!1,s=YH(r),o=s.filter(c=>typeof c=="string"&&c.charAt(0)===LC).map(c=>c.slice(1)).map(c=>BC(c,n)),a=s.filter(c=>typeof c!="string"||typeof c=="string"&&c.charAt(0)!==LC).map(c=>XH(c,n));return e==null?(c,u=!1)=>DC(a,o,c,typeof u=="boolean"?u:!1):DC(a,o,e,i)};jm.default=jm;FC.exports=jm});var qC=O((Iz,$C)=>{$C.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 Fm=O((Nz,WC)=>{var JH=qC(),UC={"{":"}","(":")","[":"]"},QH=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=UC[a];if(c){var u=r.indexOf(c,e);u!==-1&&(e=u+1)}if(r[e]==="!")return!0}else e++}return!1},ZH=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=UC[t];if(n){var i=r.indexOf(n,e);i!==-1&&(e=i+1)}if(r[e]==="!")return!0}else e++}return!1};WC.exports=function(e,t){if(typeof e!="string"||e==="")return!1;if(JH(e))return!0;var n=QH;return t&&t.strict===!1&&(n=ZH),n(e)}});var zC=O((Lz,GC)=>{"use strict";var e$=Fm(),t$=require("path").posix.dirname,r$=require("os").platform()==="win32",Hm="/",n$=/\\/g,i$=/[\{\[].*[\}\]]$/,s$=/(^|[^\\])([\{\[]|\([^\)]+$)/,o$=/\\([\!\*\?\|\[\]\(\)\{\}])/g;GC.exports=function(e,t){var n=Object.assign({flipBackslashes:!0},t);n.flipBackslashes&&r$&&e.indexOf(Hm)<0&&(e=e.replace(n$,Hm)),i$.test(e)&&(e+=Hm),e+="a";do e=t$(e);while(e$(e)||s$.test(e));return e.replace(o$,"$1")}});var Su=O(xr=>{"use strict";xr.isInteger=r=>typeof r=="number"?Number.isInteger(r):typeof r=="string"&&r.trim()!==""?Number.isInteger(Number(r)):!1;xr.find=(r,e)=>r.nodes.find(t=>t.type===e);xr.exceedsLimit=(r,e,t=1,n)=>n===!1||!xr.isInteger(r)||!xr.isInteger(e)?!1:(Number(e)-Number(r))/Number(t)>=n;xr.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)};xr.encloseBrace=r=>r.type!=="brace"?!1:r.commas>>0+r.ranges>>0===0?(r.invalid=!0,!0):!1;xr.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;xr.isOpenOrClose=r=>r.type==="open"||r.type==="close"?!0:r.open===!0||r.close===!0;xr.reduce=r=>r.reduce((e,t)=>(t.type==="text"&&e.push(t.value),t.type==="range"&&(t.type="text"),e),[]);xr.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 Eu=O((Bz,VC)=>{"use strict";var KC=Su();VC.exports=(r,e={})=>{let t=(n,i={})=>{let s=e.escapeInvalid&&KC.isInvalidBrace(i),o=n.invalid===!0&&e.escapeInvalid===!0,a="";if(n.value)return(s||o)&&KC.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 XC=O((jz,YC)=>{"use strict";YC.exports=function(r){return typeof r=="number"?r-r===0:typeof r=="string"&&r.trim()!==""?Number.isFinite?Number.isFinite(+r):isFinite(+r):!1}});var sA=O((Fz,iA)=>{"use strict";var JC=XC(),xi=(r,e,t)=>{if(JC(r)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||r===e)return String(r);if(JC(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(xi.cache.hasOwnProperty(c))return xi.cache[c].result;let u=Math.min(r,e),p=Math.max(r,e);if(Math.abs(u-p)===1){let S=r+"|"+e;return n.capture?`(${S})`:n.wrap===!1?S:`(?:${S})`}let f=nA(r)||nA(e),m={min:r,max:e,a:u,b:p},y=[],_=[];if(f&&(m.isPadded=f,m.maxLen=String(m.max).length),u<0){let S=p<0?Math.abs(p):1;_=QC(S,Math.abs(u),m,n),u=m.a=0}return p>=0&&(y=QC(u,p,m,n)),m.negatives=_,m.positives=y,m.result=a$(_,y,n),n.capture===!0?m.result=`(${m.result})`:n.wrap!==!1&&y.length+_.length>1&&(m.result=`(?:${m.result})`),xi.cache[c]=m,m.result};function a$(r,e,t){let n=$m(r,e,"-",!1,t)||[],i=$m(e,r,"",!1,t)||[],s=$m(r,e,"-?",!0,t)||[];return n.concat(s).concat(i).join("|")}function c$(r,e){let t=1,n=1,i=eA(r,t),s=new Set([e]);for(;r<=i&&i<=e;)s.add(i),t+=1,i=eA(r,t);for(i=tA(e+1,n)-1;r<i&&i<=e;)s.add(i),n+=1,i=tA(e+1,n)-1;return s=[...s],s.sort(p$),s}function l$(r,e,t){if(r===e)return{pattern:r,count:[],digits:0};let n=u$(r,e),i=n.length,s="",o=0;for(let a=0;a<i;a++){let[c,u]=n[a];c===u?s+=c:c!=="0"||u!=="9"?s+=f$(c,u,t):o++}return o&&(s+=t.shorthand===!0?"\\d":"[0-9]"),{pattern:s,count:[o],digits:i}}function QC(r,e,t,n){let i=c$(r,e),s=[],o=r,a;for(let c=0;c<i.length;c++){let u=i[c],p=l$(String(o),String(u),n),f="";if(!t.isPadded&&a&&a.pattern===p.pattern){a.count.length>1&&a.count.pop(),a.count.push(p.count[0]),a.string=a.pattern+rA(a.count),o=u+1;continue}t.isPadded&&(f=d$(u,t,n)),p.string=f+p.pattern+rA(p.count),s.push(p),o=u+1,a=p}return s}function $m(r,e,t,n,i){let s=[];for(let o of r){let{string:a}=o;!n&&!ZC(e,"string",a)&&s.push(t+a),n&&ZC(e,"string",a)&&s.push(t+a)}return s}function u$(r,e){let t=[];for(let n=0;n<r.length;n++)t.push([r[n],e[n]]);return t}function p$(r,e){return r>e?1:e>r?-1:0}function ZC(r,e,t){return r.some(n=>n[e]===t)}function eA(r,e){return Number(String(r).slice(0,-e)+"9".repeat(e))}function tA(r,e){return r-r%Math.pow(10,e)}function rA(r){let[e=0,t=""]=r;return t||e>1?`{${e+(t?","+t:"")}}`:""}function f$(r,e,t){return`[${r}${e-r===1?"":"-"}${e}]`}function nA(r){return/^-?(0+)\d/.test(r)}function d$(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}}`}}xi.cache={};xi.clearCache=()=>xi.cache={};iA.exports=xi});var Wm=O((Hz,fA)=>{"use strict";var h$=require("util"),aA=sA(),oA=r=>r!==null&&typeof r=="object"&&!Array.isArray(r),m$=r=>e=>r===!0?Number(e):String(e),qm=r=>typeof r=="number"||typeof r=="string"&&r!=="",ca=r=>Number.isInteger(+r),Um=r=>{let e=`${r}`,t=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++t]==="0";);return t>0},g$=(r,e,t)=>typeof r=="string"||typeof e=="string"?!0:t.stringify===!0,v$=(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},Cu=(r,e)=>{let t=r[0]==="-"?"-":"";for(t&&(r=r.slice(1),e--);r.length<e;)r="0"+r;return t?"-"+r:r},x$=(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=>Cu(String(a),t)).join("|")),r.negatives.length&&(s=`-(${n}${r.negatives.map(a=>Cu(String(a),t)).join("|")})`),i&&s?o=`${i}|${s}`:o=i||s,e.wrap?`(${n}${o})`:o},cA=(r,e,t,n)=>{if(t)return aA(r,e,{wrap:!1,...n});let i=String.fromCharCode(r);if(r===e)return i;let s=String.fromCharCode(e);return`[${i}-${s}]`},lA=(r,e,t)=>{if(Array.isArray(r)){let n=t.wrap===!0,i=t.capture?"":"?:";return n?`(${i}${r.join("|")})`:r.join("|")}return aA(r,e,t)},uA=(...r)=>new RangeError("Invalid range arguments: "+h$.inspect(...r)),pA=(r,e,t)=>{if(t.strictRanges===!0)throw uA([r,e]);return[]},y$=(r,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${r}" to be a number`);return[]},_$=(r,e,t=1,n={})=>{let i=Number(r),s=Number(e);if(!Number.isInteger(i)||!Number.isInteger(s)){if(n.strictRanges===!0)throw uA([r,e]);return[]}i===0&&(i=0),s===0&&(s=0);let o=i>s,a=String(r),c=String(e),u=String(t);t=Math.max(Math.abs(t),1);let p=Um(a)||Um(c)||Um(u),f=p?Math.max(a.length,c.length,u.length):0,m=p===!1&&g$(r,e,n)===!1,y=n.transform||m$(m);if(n.toRegex&&t===1)return cA(Cu(r,f),Cu(e,f),!0,n);let _={negatives:[],positives:[]},S=L=>_[L<0?"negatives":"positives"].push(Math.abs(L)),A=[],P=0;for(;o?i>=s:i<=s;)n.toRegex===!0&&t>1?S(i):A.push(v$(y(i,P),f,m)),i=o?i-t:i+t,P++;return n.toRegex===!0?t>1?x$(_,n,f):lA(A,null,{wrap:!1,...n}):A},b$=(r,e,t=1,n={})=>{if(!ca(r)&&r.length>1||!ca(e)&&e.length>1)return pA(r,e,n);let i=n.transform||(m=>String.fromCharCode(m)),s=`${r}`.charCodeAt(0),o=`${e}`.charCodeAt(0),a=s>o,c=Math.min(s,o),u=Math.max(s,o);if(n.toRegex&&t===1)return cA(c,u,!1,n);let p=[],f=0;for(;a?s>=o:s<=o;)p.push(i(s,f)),s=a?s-t:s+t,f++;return n.toRegex===!0?lA(p,null,{wrap:!1,options:n}):p},Tu=(r,e,t,n={})=>{if(e==null&&qm(r))return[r];if(!qm(r)||!qm(e))return pA(r,e,n);if(typeof t=="function")return Tu(r,e,1,{transform:t});if(oA(t))return Tu(r,e,0,t);let i={...n};return i.capture===!0&&(i.wrap=!0),t=t||i.step||1,ca(t)?ca(r)&&ca(e)?_$(r,e,t,i):b$(r,e,Math.max(Math.abs(t),1),i):t!=null&&!oA(t)?y$(t,i):Tu(r,e,1,t)};fA.exports=Tu});var mA=O(($z,hA)=>{"use strict";var w$=Wm(),dA=Su(),S$=(r,e={})=>{let t=(n,i={})=>{let s=dA.isInvalidBrace(i),o=n.invalid===!0&&e.escapeInvalid===!0,a=s===!0||o===!0,c=e.escapeInvalid===!0?"\\":"",u="";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 p=dA.reduce(n.nodes),f=w$(...p,{...e,wrap:!1,toRegex:!0,strictZeros:!0});if(f.length!==0)return p.length>1&&f.length>1?`(${f})`:f}if(n.nodes)for(let p of n.nodes)u+=t(p,n);return u};return t(r)};hA.exports=S$});var xA=O((qz,vA)=>{"use strict";var E$=Wm(),gA=Eu(),js=Su(),yi=(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(yi(s,e,t));else for(let s of e)t===!0&&typeof s=="string"&&(s=`{${s}}`),n.push(Array.isArray(s)?yi(i,s,t):i+s);return js.flatten(n)},T$=(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(yi(a.pop(),gA(i,e)));return}if(i.type==="brace"&&i.invalid!==!0&&i.nodes.length===2){a.push(yi(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 m=E$(...f,e);m.length===0&&(m=gA(i,e)),a.push(yi(a.pop(),m)),i.nodes=[];return}let c=js.encloseBrace(i),u=i.queue,p=i;for(;p.type!=="brace"&&p.type!=="root"&&p.parent;)p=p.parent,u=p.queue;for(let f=0;f<i.nodes.length;f++){let m=i.nodes[f];if(m.type==="comma"&&i.type==="brace"){f===1&&u.push(""),u.push("");continue}if(m.type==="close"){a.push(yi(a.pop(),u,c));continue}if(m.value&&m.type!=="open"){u.push(yi(u.pop(),m.value));continue}m.nodes&&n(m,i)}return u};return js.flatten(n(r))};vA.exports=T$});var _A=O((Uz,yA)=>{"use strict";yA.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:`
|
|
100
|
+
`,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 TA=O((Wz,EA)=>{"use strict";var C$=Eu(),{MAX_LENGTH:bA,CHAR_BACKSLASH:Gm,CHAR_BACKTICK:A$,CHAR_COMMA:R$,CHAR_DOT:k$,CHAR_LEFT_PARENTHESES:O$,CHAR_RIGHT_PARENTHESES:P$,CHAR_LEFT_CURLY_BRACE:M$,CHAR_RIGHT_CURLY_BRACE:I$,CHAR_LEFT_SQUARE_BRACKET:wA,CHAR_RIGHT_SQUARE_BRACKET:SA,CHAR_DOUBLE_QUOTE:N$,CHAR_SINGLE_QUOTE:L$,CHAR_NO_BREAK_SPACE:D$,CHAR_ZERO_WIDTH_NOBREAK_SPACE:B$}=_A(),j$=(r,e={})=>{if(typeof r!="string")throw new TypeError("Expected a string");let t=e||{},n=typeof t.maxLength=="number"?Math.min(bA,t.maxLength):bA;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,u=r.length,p=0,f=0,m,y=()=>r[p++],_=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(_({type:"bos"});p<u;)if(o=s[s.length-1],m=y(),!(m===B$||m===D$)){if(m===Gm){_({type:"text",value:(e.keepEscaping?m:"")+y()});continue}if(m===SA){_({type:"text",value:"\\"+m});continue}if(m===wA){c++;let S;for(;p<u&&(S=y());){if(m+=S,S===wA){c++;continue}if(S===Gm){m+=y();continue}if(S===SA&&(c--,c===0))break}_({type:"text",value:m});continue}if(m===O$){o=_({type:"paren",nodes:[]}),s.push(o),_({type:"text",value:m});continue}if(m===P$){if(o.type!=="paren"){_({type:"text",value:m});continue}o=s.pop(),_({type:"text",value:m}),o=s[s.length-1];continue}if(m===N$||m===L$||m===A$){let S=m,A;for(e.keepQuotes!==!0&&(m="");p<u&&(A=y());){if(A===Gm){m+=A+y();continue}if(A===S){e.keepQuotes===!0&&(m+=A);break}m+=A}_({type:"text",value:m});continue}if(m===M$){f++;let A={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||o.dollar===!0,depth:f,commas:0,ranges:0,nodes:[]};o=_(A),s.push(o),_({type:"open",value:m});continue}if(m===I$){if(o.type!=="brace"){_({type:"text",value:m});continue}let S="close";o=s.pop(),o.close=!0,_({type:S,value:m}),f--,o=s[s.length-1];continue}if(m===R$&&f>0){if(o.ranges>0){o.ranges=0;let S=o.nodes.shift();o.nodes=[S,{type:"text",value:C$(o)}]}_({type:"comma",value:m}),o.commas++;continue}if(m===k$&&f>0&&o.commas===0){let S=o.nodes;if(f===0||S.length===0){_({type:"text",value:m});continue}if(a.type==="dot"){if(o.range=[],a.value+=m,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 A=S[S.length-1];A.value+=a.value+m,a=A,o.ranges--;continue}_({type:"dot",value:m});continue}_({type:"text",value:m})}do if(o=s.pop(),o.type!=="root"){o.nodes.forEach(P=>{P.nodes||(P.type==="open"&&(P.isOpen=!0),P.type==="close"&&(P.isClose=!0),P.nodes||(P.type="text"),P.invalid=!0)});let S=s[s.length-1],A=S.nodes.indexOf(o);S.nodes.splice(A,1,...o.nodes)}while(s.length>0);return _({type:"eos"}),i};EA.exports=j$});var RA=O((Gz,AA)=>{"use strict";var CA=Eu(),F$=mA(),H$=xA(),$$=TA(),er=(r,e={})=>{let t=[];if(Array.isArray(r))for(let n of r){let i=er.create(n,e);Array.isArray(i)?t.push(...i):t.push(i)}else t=[].concat(er.create(r,e));return e&&e.expand===!0&&e.nodupes===!0&&(t=[...new Set(t)]),t};er.parse=(r,e={})=>$$(r,e);er.stringify=(r,e={})=>CA(typeof r=="string"?er.parse(r,e):r,e);er.compile=(r,e={})=>(typeof r=="string"&&(r=er.parse(r,e)),F$(r,e));er.expand=(r,e={})=>{typeof r=="string"&&(r=er.parse(r,e));let t=H$(r,e);return e.noempty===!0&&(t=t.filter(Boolean)),e.nodupes===!0&&(t=[...new Set(t)]),t};er.create=(r,e={})=>r===""||r.length<3?[r]:e.expand!==!0?er.compile(r,e):er.expand(r,e);AA.exports=er});var kA=O((zz,q$)=>{q$.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 PA=O((Kz,OA)=>{OA.exports=kA()});var IA=O((Vz,MA)=>{"use strict";var U$=require("path"),W$=PA(),G$=new Set(W$);MA.exports=r=>G$.has(U$.extname(r).slice(1).toLowerCase())});var Au=O(Q=>{"use strict";var{sep:z$}=require("path"),{platform:zm}=process,K$=require("os");Q.EV_ALL="all";Q.EV_READY="ready";Q.EV_ADD="add";Q.EV_CHANGE="change";Q.EV_ADD_DIR="addDir";Q.EV_UNLINK="unlink";Q.EV_UNLINK_DIR="unlinkDir";Q.EV_RAW="raw";Q.EV_ERROR="error";Q.STR_DATA="data";Q.STR_END="end";Q.STR_CLOSE="close";Q.FSEVENT_CREATED="created";Q.FSEVENT_MODIFIED="modified";Q.FSEVENT_DELETED="deleted";Q.FSEVENT_MOVED="moved";Q.FSEVENT_CLONED="cloned";Q.FSEVENT_UNKNOWN="unknown";Q.FSEVENT_FLAG_MUST_SCAN_SUBDIRS=1;Q.FSEVENT_TYPE_FILE="file";Q.FSEVENT_TYPE_DIRECTORY="directory";Q.FSEVENT_TYPE_SYMLINK="symlink";Q.KEY_LISTENERS="listeners";Q.KEY_ERR="errHandlers";Q.KEY_RAW="rawEmitters";Q.HANDLER_KEYS=[Q.KEY_LISTENERS,Q.KEY_ERR,Q.KEY_RAW];Q.DOT_SLASH=`.${z$}`;Q.BACK_SLASH_RE=/\\/g;Q.DOUBLE_SLASH_RE=/\/\//;Q.SLASH_OR_BACK_SLASH_RE=/[/\\]/;Q.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/;Q.REPLACER_RE=/^\.[/\\]/;Q.SLASH="/";Q.SLASH_SLASH="//";Q.BRACE_START="{";Q.BANG="!";Q.ONE_DOT=".";Q.TWO_DOTS="..";Q.STAR="*";Q.GLOBSTAR="**";Q.ROOT_GLOBSTAR="/**/*";Q.SLASH_GLOBSTAR="/**";Q.DIR_SUFFIX="Dir";Q.ANYMATCH_OPTS={dot:!0};Q.STRING_TYPE="string";Q.FUNCTION_TYPE="function";Q.EMPTY_STR="";Q.EMPTY_FN=()=>{};Q.IDENTITY_FN=r=>r;Q.isWindows=zm==="win32";Q.isMacos=zm==="darwin";Q.isLinux=zm==="linux";Q.isIBMi=K$.type()==="OS400"});var FA=O((Xz,jA)=>{"use strict";var wn=require("fs"),ht=require("path"),{promisify:fa}=require("util"),V$=IA(),{isWindows:Y$,isLinux:X$,EMPTY_FN:J$,EMPTY_STR:Q$,KEY_LISTENERS:Fs,KEY_ERR:Km,KEY_RAW:la,HANDLER_KEYS:Z$,EV_CHANGE:ku,EV_ADD:Ru,EV_ADD_DIR:eq,EV_ERROR:LA,STR_DATA:tq,STR_END:rq,BRACE_START:nq,STAR:iq}=Au(),sq="watch",oq=fa(wn.open),DA=fa(wn.stat),aq=fa(wn.lstat),cq=fa(wn.close),Vm=fa(wn.realpath),lq={lstat:aq,stat:DA},Xm=(r,e)=>{r instanceof Set?r.forEach(e):e(r)},ua=(r,e,t)=>{let n=r[e];n instanceof Set||(r[e]=n=new Set([n])),n.add(t)},uq=r=>e=>{let t=r[e];t instanceof Set?t.clear():delete r[e]},pa=(r,e,t)=>{let n=r[e];n instanceof Set?n.delete(t):n===t&&delete r[e]},BA=r=>r instanceof Set?r.size===0:!r,Ou=new Map;function NA(r,e,t,n,i){let s=(o,a)=>{t(r),i(o,a,{watchedPath:r}),a&&r!==a&&Pu(ht.resolve(r,a),Fs,ht.join(r,a))};try{return wn.watch(r,e,s)}catch(o){n(o)}}var Pu=(r,e,t,n,i)=>{let s=Ou.get(r);s&&Xm(s[e],o=>{o(t,n,i)})},pq=(r,e,t,n)=>{let{listener:i,errHandler:s,rawEmitter:o}=n,a=Ou.get(e),c;if(!t.persistent)return c=NA(r,t,i,s,o),c.close.bind(c);if(a)ua(a,Fs,i),ua(a,Km,s),ua(a,la,o);else{if(c=NA(r,t,Pu.bind(null,e,Fs),s,Pu.bind(null,e,la)),!c)return;c.on(LA,async u=>{let p=Pu.bind(null,e,Km);if(a.watcherUnusable=!0,Y$&&u.code==="EPERM")try{let f=await oq(r,"r");await cq(f),p(u)}catch{}else p(u)}),a={listeners:i,errHandlers:s,rawEmitters:o,watcher:c},Ou.set(e,a)}return()=>{pa(a,Fs,i),pa(a,Km,s),pa(a,la,o),BA(a.listeners)&&(a.watcher.close(),Ou.delete(e),Z$.forEach(uq(a)),a.watcher=void 0,Object.freeze(a))}},Ym=new Map,fq=(r,e,t,n)=>{let{listener:i,rawEmitter:s}=n,o=Ym.get(e),a=new Set,c=new Set,u=o&&o.options;return u&&(u.persistent<t.persistent||u.interval>t.interval)&&(a=o.listeners,c=o.rawEmitters,wn.unwatchFile(e),o=void 0),o?(ua(o,Fs,i),ua(o,la,s)):(o={listeners:i,rawEmitters:s,options:t,watcher:wn.watchFile(e,t,(p,f)=>{Xm(o.rawEmitters,y=>{y(ku,e,{curr:p,prev:f})});let m=p.mtimeMs;(p.size!==f.size||m>f.mtimeMs||m===0)&&Xm(o.listeners,y=>y(r,p))})},Ym.set(e,o)),()=>{pa(o,Fs,i),pa(o,la,s),BA(o.listeners)&&(Ym.delete(e),wn.unwatchFile(e),o.options=o.watcher=void 0,Object.freeze(o))}},Jm=class{constructor(e){this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){let n=this.fsw.options,i=ht.dirname(e),s=ht.basename(e);this.fsw._getWatchedDir(i).add(s);let a=ht.resolve(e),c={persistent:n.persistent};t||(t=J$);let u;return n.usePolling?(c.interval=n.enableBinaryInterval&&V$(s)?n.binaryInterval:n.interval,u=fq(e,a,c,{listener:t,rawEmitter:this.fsw._emitRaw})):u=pq(e,a,c,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),u}_handleFile(e,t,n){if(this.fsw.closed)return;let i=ht.dirname(e),s=ht.basename(e),o=this.fsw._getWatchedDir(i),a=t;if(o.has(s))return;let c=async(p,f)=>{if(this.fsw._throttle(sq,e,5)){if(!f||f.mtimeMs===0)try{let m=await DA(e);if(this.fsw.closed)return;let y=m.atimeMs,_=m.mtimeMs;(!y||y<=_||_!==a.mtimeMs)&&this.fsw._emit(ku,e,m),X$&&a.ino!==m.ino?(this.fsw._closeFile(p),a=m,this.fsw._addPathCloser(p,this._watchWithNodeFs(e,c))):a=m}catch{this.fsw._remove(i,s)}else if(o.has(s)){let m=f.atimeMs,y=f.mtimeMs;(!m||m<=y||y!==a.mtimeMs)&&this.fsw._emit(ku,e,f),a=f}}},u=this._watchWithNodeFs(e,c);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(Ru,e,0))return;this.fsw._emit(Ru,e,t)}return u}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 Vm(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(ku,n,e.stats)):(o.add(i),this.fsw._symlinkPaths.set(s,a),this.fsw._emit(Ru,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=ht.join(e,Q$),!n.hasGlob&&(a=this.fsw._throttle("readdir",e,1e3),!a))return;let c=this.fsw._getWatchedDir(n.path),u=new Set,p=this.fsw._readdirp(e,{fileFilter:f=>n.filterPath(f),directoryFilter:f=>n.filterDir(f),depth:0}).on(tq,async f=>{if(this.fsw.closed){p=void 0;return}let m=f.path,y=ht.join(e,m);if(u.add(m),!(f.stats.isSymbolicLink()&&await this._handleSymlink(f,e,y,m))){if(this.fsw.closed){p=void 0;return}(m===i||!i&&!c.has(m))&&(this.fsw._incrReadyCount(),y=ht.join(s,ht.relative(s,y)),this._addToNodeFs(y,t,n,o+1))}}).on(LA,this._boundHandleError);return new Promise(f=>p.once(rq,()=>{if(this.fsw.closed){p=void 0;return}let m=a?a.clear():!1;f(),c.getChildren().filter(y=>y!==e&&!u.has(y)&&(!n.hasGlob||n.filterPath({fullPath:ht.resolve(e,y)}))).forEach(y=>{this.fsw._remove(e,y)}),p=void 0,m&&this._handleRead(e,!1,n,i,s,o,a)}))}async _handleDir(e,t,n,i,s,o,a){let c=this.fsw._getWatchedDir(ht.dirname(e)),u=c.has(ht.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!s&&!u&&(!o.hasGlob||o.globFilter(e))&&this.fsw._emit(eq,e,t),c.add(ht.basename(e)),this.fsw._getWatchedDir(e);let p,f,m=this.fsw.options.depth;if((m==null||i<=m)&&!this.fsw._symlinkPaths.has(a)){if(!s&&(await this._handleRead(e,n,o,s,e,i,p),this.fsw.closed))return;f=this._watchWithNodeFs(e,(y,_)=>{_&&_.mtimeMs===0||this._handleRead(y,!1,o,s,e,i,p)})}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 lq[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))return o(),!1;let u=this.fsw.options.followSymlinks&&!e.includes(iq)&&!e.includes(nq),p;if(c.isDirectory()){let f=ht.resolve(e),m=u?await Vm(e):e;if(this.fsw.closed||(p=await this._handleDir(a.watchPath,c,t,i,s,a,m),this.fsw.closed))return;f!==m&&m!==void 0&&this.fsw._symlinkPaths.set(f,m)}else if(c.isSymbolicLink()){let f=u?await Vm(e):e;if(this.fsw.closed)return;let m=ht.dirname(a.watchPath);if(this.fsw._getWatchedDir(m).add(a.watchPath),this.fsw._emit(Ru,a.watchPath,c),p=await this._handleDir(m,c,t,i,e,a,f),this.fsw.closed)return;f!==void 0&&this.fsw._symlinkPaths.set(ht.resolve(e),f)}else p=this._handleFile(a.watchPath,c,t);return o(),this.fsw._addPathCloser(e,p),!1}catch(c){if(this.fsw._handleError(c))return o(),e}}};jA.exports=Jm});var zA=O((Jz,sg)=>{"use strict";var ng=require("fs"),mt=require("path"),{promisify:ig}=require("util"),Hs;try{Hs=require("fsevents")}catch(r){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(r)}if(Hs){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&&(Hs=void 0)}}var{EV_ADD:Qm,EV_CHANGE:dq,EV_ADD_DIR:HA,EV_UNLINK:Mu,EV_ERROR:hq,STR_DATA:mq,STR_END:gq,FSEVENT_CREATED:vq,FSEVENT_MODIFIED:xq,FSEVENT_DELETED:yq,FSEVENT_MOVED:_q,FSEVENT_UNKNOWN:bq,FSEVENT_FLAG_MUST_SCAN_SUBDIRS:wq,FSEVENT_TYPE_FILE:Sq,FSEVENT_TYPE_DIRECTORY:da,FSEVENT_TYPE_SYMLINK:GA,ROOT_GLOBSTAR:$A,DIR_SUFFIX:Eq,DOT_SLASH:qA,FUNCTION_TYPE:Zm,EMPTY_FN:Tq,IDENTITY_FN:Cq}=Au(),Aq=r=>isNaN(r)?{}:{depth:r},tg=ig(ng.stat),Rq=ig(ng.lstat),UA=ig(ng.realpath),kq={stat:tg,lstat:Rq},_i=new Map,Oq=10,Pq=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),Mq=(r,e)=>({stop:Hs.watch(r,e)});function Iq(r,e,t,n){let i=mt.extname(e)?mt.dirname(e):e,s=mt.dirname(i),o=_i.get(i);Nq(s)&&(i=s);let a=mt.resolve(r),c=a!==e,u=(f,m,y)=>{c&&(f=f.replace(e,a)),(f===a||!f.indexOf(a+mt.sep))&&t(f,m,y)},p=!1;for(let f of _i.keys())if(e.indexOf(mt.resolve(f)+mt.sep)===0){i=f,o=_i.get(i),p=!0;break}return o||p?o.listeners.add(u):(o={listeners:new Set([u]),rawEmitter:n,watcher:Mq(i,(f,m)=>{if(!o.listeners.size||m&wq)return;let y=Hs.getInfo(f,m);o.listeners.forEach(_=>{_(f,m,y)}),o.rawEmitter(y.event,f,y)})},_i.set(i,o)),()=>{let f=o.listeners;if(f.delete(u),!f.size&&(_i.delete(i),o.watcher))return o.watcher.stop().then(()=>{o.rawEmitter=o.watcher=void 0,Object.freeze(o)})}}var Nq=r=>{let e=0;for(let t of _i.keys())if(t.indexOf(r)===0&&(e++,e>=Oq))return!0;return!1},Lq=()=>Hs&&_i.size<128,eg=(r,e)=>{let t=0;for(;!r.indexOf(e)&&(r=mt.dirname(r))!==e;)t++;return t},WA=(r,e)=>r.type===da&&e.isDirectory()||r.type===GA&&e.isSymbolicLink()||r.type===Sq&&e.isFile(),rg=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+$A),!0;n.delete(e),n.delete(e+$A)}addOrChange(e,t,n,i,s,o,a,c){let u=s.has(o)?dq:Qm;this.handleEvent(u,e,t,n,i,s,o,a,c)}async checkExists(e,t,n,i,s,o,a,c){try{let u=await tg(e);if(this.fsw.closed)return;WA(a,u)?this.addOrChange(e,t,n,i,s,o,a,c):this.handleEvent(Mu,e,t,n,i,s,o,a,c)}catch(u){u.code==="EACCES"?this.addOrChange(e,t,n,i,s,o,a,c):this.handleEvent(Mu,e,t,n,i,s,o,a,c)}}handleEvent(e,t,n,i,s,o,a,c,u){if(!(this.fsw.closed||this.checkIgnored(t)))if(e===Mu){let p=c.type===da;(p||o.has(a))&&this.fsw._remove(s,a,p)}else{if(e===Qm){if(c.type===da&&this.fsw._getWatchedDir(t),c.type===GA&&u.followSymlinks){let f=u.depth===void 0?void 0:eg(n,i)+1;return this._addToFsEvents(t,!1,!0,f)}this.fsw._getWatchedDir(s).add(a)}let p=c.type===da?e+Eq:e;this.fsw._emit(p,t),p===HA&&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=Iq(e,t,async(c,u,p)=>{if(this.fsw.closed||s.depth!==void 0&&eg(c,t)>s.depth)return;let f=n(mt.join(e,mt.relative(e,c)));if(i&&!i(f))return;let m=mt.dirname(f),y=mt.basename(f),_=this.fsw._getWatchedDir(p.type===da?f:m);if(Pq.has(u)||p.event===bq)if(typeof s.ignored===Zm){let S;try{S=await tg(f)}catch{}if(this.fsw.closed||this.checkIgnored(f,S))return;WA(p,S)?this.addOrChange(f,c,t,m,_,y,p,s):this.handleEvent(Mu,f,c,t,m,_,y,p,s)}else this.checkExists(f,c,t,m,_,y,p,s);else switch(p.event){case vq:case xq:return this.addOrChange(f,c,t,m,_,y,p,s);case yq:case _q:return this.checkExists(f,c,t,m,_,y,p,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 UA(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!==qA?a=o.replace(s,e):o!==qA&&(a=mt.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(mt.dirname(o)),u=mt.basename(o);a&&this.fsw._getWatchedDir(o),!c.has(u)&&(c.add(u),(!i.ignoreInitial||s===!0)&&this.fsw._emit(a?HA:Qm,o,t))}initWatch(e,t,n,i){if(this.fsw.closed)return;let s=this._watchWithFsEvents(n.watchPath,mt.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===Zm?t:Cq,a=this.fsw._getWatchHelpers(e);try{let c=await kq[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:u=>a.filterPath(u),directoryFilter:u=>a.filterDir(u),...Aq(s.depth-(i||0))}).on(mq,u=>{if(this.fsw.closed||u.stats.isDirectory()&&!a.filterPath(u))return;let p=mt.join(a.watchPath,u.path),{fullPath:f}=u;if(a.followSymlinks&&u.stats.isSymbolicLink()){let m=s.depth===void 0?void 0:eg(p,mt.resolve(a.watchPath))+1;this._handleFsEventsSymlink(p,f,o,m)}else this.emitAdd(p,u.stats,o,s,n)}).on(hq,Tq).on(gq,()=>{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===Zm)this.initWatch(void 0,e,a,o);else{let c;try{c=await UA(a.watchPath)}catch{}this.initWatch(c,e,a,o)}}};sg.exports=rg;sg.exports.canUse=Lq});var nR=O(_g=>{"use strict";var{EventEmitter:Dq}=require("events"),xg=require("fs"),ce=require("path"),{promisify:ZA}=require("util"),Bq=pC(),pg=HC().default,jq=zC(),og=Fm(),Fq=RA(),Hq=Bm(),$q=FA(),KA=zA(),{EV_ALL:ag,EV_READY:qq,EV_ADD:Iu,EV_CHANGE:ha,EV_UNLINK:VA,EV_ADD_DIR:Uq,EV_UNLINK_DIR:Wq,EV_RAW:Gq,EV_ERROR:cg,STR_CLOSE:zq,STR_END:Kq,BACK_SLASH_RE:Vq,DOUBLE_SLASH_RE:YA,SLASH_OR_BACK_SLASH_RE:Yq,DOT_RE:Xq,REPLACER_RE:Jq,SLASH:lg,SLASH_SLASH:Qq,BRACE_START:Zq,BANG:fg,ONE_DOT:eR,TWO_DOTS:eU,GLOBSTAR:tU,SLASH_GLOBSTAR:ug,ANYMATCH_OPTS:dg,STRING_TYPE:yg,FUNCTION_TYPE:rU,EMPTY_STR:hg,EMPTY_FN:nU,isWindows:iU,isMacos:sU,isIBMi:oU}=Au(),aU=ZA(xg.stat),cU=ZA(xg.readdir),mg=(r=[])=>Array.isArray(r)?r:[r],tR=(r,e=[])=>(r.forEach(t=>{Array.isArray(t)?tR(t,e):e.push(t)}),e),XA=r=>{let e=tR(mg(r));if(!e.every(t=>typeof t===yg))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(rR)},JA=r=>{let e=r.replace(Vq,lg),t=!1;for(e.startsWith(Qq)&&(t=!0);e.match(YA);)e=e.replace(YA,lg);return t&&(e=lg+e),e},rR=r=>JA(ce.normalize(JA(r))),QA=(r=hg)=>e=>typeof e!==yg?e:rR(ce.isAbsolute(e)?e:ce.join(r,e)),lU=(r,e)=>ce.isAbsolute(r)?r:r.startsWith(fg)?fg+ce.join(e,r.slice(1)):ce.join(e,r),Pr=(r,e)=>r[e]===void 0,gg=class{constructor(e,t){this.path=e,this._removeWatcher=t,this.items=new Set}add(e){let{items:t}=this;t&&e!==eR&&e!==eU&&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 cU(n)}catch{this._removeWatcher&&this._removeWatcher(ce.dirname(n),ce.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)}},uU="stat",pU="lstat",vg=class{constructor(e,t,n,i){this.fsw=i,this.path=e=e.replace(Jq,hg),this.watchPath=t,this.fullWatchPath=ce.resolve(t),this.hasGlob=t!==e,e===hg&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&n?void 0:!1,this.globFilter=this.hasGlob?pg(e,void 0,dg):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(s=>{s.length>1&&s.pop()}),this.followSymlinks=n,this.statMethod=n?uU:pU}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 ce.join(this.watchPath,ce.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===rU?this.globFilter(n):!0)&&this.fsw._isntIgnored(n,t)&&this.fsw._hasReadPermissions(t)}getDirParts(e){if(!this.hasGlob)return[];let t=[];return(e.includes(Zq)?Fq.expand(e):[e]).forEach(i=>{t.push(ce.relative(this.watchPath,i).split(Yq))}),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===tU&&(n=!0),n||!t[0][o]||pg(s,t[0][o],dg))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}},Nu=class extends Dq{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,Pr(t,"persistent")&&(t.persistent=!0),Pr(t,"ignoreInitial")&&(t.ignoreInitial=!1),Pr(t,"ignorePermissionErrors")&&(t.ignorePermissionErrors=!1),Pr(t,"interval")&&(t.interval=100),Pr(t,"binaryInterval")&&(t.binaryInterval=300),Pr(t,"disableGlobbing")&&(t.disableGlobbing=!1),t.enableBinaryInterval=t.binaryInterval!==t.interval,Pr(t,"useFsEvents")&&(t.useFsEvents=!t.usePolling),KA.canUse()||(t.useFsEvents=!1),Pr(t,"usePolling")&&!t.useFsEvents&&(t.usePolling=sU),oU&&(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)),Pr(t,"atomic")&&(t.atomic=!t.usePolling&&!t.useFsEvents),t.atomic&&(this._pendingUnlinks=new Map),Pr(t,"followSymlinks")&&(t.followSymlinks=!0),Pr(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=mg(t.ignored));let a=0;this._emitReady=()=>{a++,a>=this._readyCount&&(this._emitReady=nU,this._readyEmitted=!0,process.nextTick(()=>this.emit(qq)))},this._emitRaw=(...c)=>this.emit(Gq,...c),this._readyEmitted=!1,this.options=t,t.useFsEvents?this._fsEventsHandler=new KA(this):this._nodeFsHandler=new $q(this),Object.freeze(t)}add(e,t,n){let{cwd:i,disableGlobbing:s}=this.options;this.closed=!1;let o=XA(e);return i&&(o=o.map(a=>{let c=lU(a,i);return s||!og(a)?c:Hq(c)})),o=o.filter(a=>a.startsWith(fg)?(this._ignoredPaths.add(a.slice(1)),!1):(this._ignoredPaths.delete(a),this._ignoredPaths.delete(a+ug),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(ce.dirname(c),ce.basename(t||c))})})),this}unwatch(e){if(this.closed)return this;let t=XA(e),{cwd:n}=this.options;return t.forEach(i=>{!ce.isAbsolute(i)&&!this._closers.has(i)&&(n&&(i=ce.join(n,i)),i=ce.resolve(i)),this._closePath(i),this._ignoredPaths.add(i),this._watched.has(i)&&this._ignoredPaths.add(i+ug),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?ce.relative(this.options.cwd,n):n;e[i||eR]=t.getChildren().sort()}),e}emitWithAll(e,t){this.emit(...t),e!==cg&&this.emit(ag,...t)}async _emit(e,t,n,i,s){if(this.closed)return;let o=this.options;iU&&(t=ce.normalize(t)),o.cwd&&(t=ce.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,u;if(c&&(u=this._pendingWrites.get(t)))return u.lastChange=new Date,this;if(o.atomic){if(e===VA)return this._pendingUnlinks.set(t,a),setTimeout(()=>{this._pendingUnlinks.forEach((p,f)=>{this.emit(...p),this.emit(ag,...p),this._pendingUnlinks.delete(f)})},typeof o.atomic=="number"?o.atomic:100),this;e===Iu&&this._pendingUnlinks.has(t)&&(e=a[0]=ha,this._pendingUnlinks.delete(t))}if(c&&(e===Iu||e===ha)&&this._readyEmitted){let p=(f,m)=>{f?(e=a[0]=cg,a[1]=f,this.emitWithAll(e,a)):m&&(a.length>2?a[2]=m:a.push(m),this.emitWithAll(e,a))};return this._awaitWriteFinish(t,c.stabilityThreshold,e,p),this}if(e===ha&&!this._throttle(ha,t,50))return this;if(o.alwaysStat&&n===void 0&&(e===Iu||e===Uq||e===ha)){let p=o.cwd?ce.join(o.cwd,t):t,f;try{f=await aU(p)}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(cg,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 u=i.get(t),p=u?u.count:0;return i.delete(t),clearTimeout(o),u&&clearTimeout(u.timeoutObject),p};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&&!ce.isAbsolute(e)&&(o=ce.join(this.options.cwd,e));let a=new Date,c=u=>{xg.stat(o,(p,f)=>{if(p||!this._pendingWrites.has(e)){p&&p.code!=="ENOENT"&&i(p);return}let m=Number(new Date);u&&f.size!==u.size&&(this._pendingWrites.get(e).lastChange=m);let y=this._pendingWrites.get(e);m-y.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&&Xq.test(e))return!0;if(!this._userIgnored){let{cwd:n}=this.options,i=this.options.ignored,s=i&&i.map(QA(n)),o=mg(s).filter(c=>typeof c===yg&&!og(c)).map(c=>c+ug),a=this._getGlobIgnored().map(QA(n)).concat(s,o);this._userIgnored=pg(a,void 0,dg)}return this._userIgnored([e,t])}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e,t){let n=t||this.options.disableGlobbing||!og(e)?e:jq(e),i=this.options.followSymlinks;return new vg(e,n,i,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));let t=ce.resolve(e);return this._watched.has(t)||this._watched.set(t,new gg(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=ce.join(e,t),s=ce.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(m=>this._remove(i,m));let c=this._getWatchedDir(e),u=c.has(t);c.remove(t),this._symlinkPaths.has(s)&&this._symlinkPaths.delete(s);let p=i;if(this.options.cwd&&(p=ce.relative(this.options.cwd,i)),this.options.awaitWriteFinish&&this._pendingWrites.has(p)&&this._pendingWrites.get(p).cancelWait()===Iu)return;this._watched.delete(i),this._watched.delete(s);let f=n?Wq:VA;u&&!this._isIgnored(i)&&this._emit(f,i),this.options.useFsEvents||this._closePath(i)}_closePath(e){this._closeFile(e);let t=ce.dirname(e);this._getWatchedDir(t).remove(ce.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:ag,alwaysStat:!0,lstat:!0,...t},i=Bq(e,n);return this._streams.add(i),i.once(zq,()=>{i=void 0}),i.once(Kq,()=>{i&&(this._streams.delete(i),i=void 0)}),i}};_g.FSWatcher=Nu;var fU=(r,e)=>{let t=new Nu(e);return t.add(r),t};_g.watch=fU});var KR=O((AK,Tg)=>{"use strict";var yU=Object.prototype.hasOwnProperty,Mt="~";function _a(){}Object.create&&(_a.prototype=Object.create(null),new _a().__proto__||(Mt=!1));function _U(r,e,t){this.fn=r,this.context=e,this.once=t||!1}function zR(r,e,t,n,i){if(typeof t!="function")throw new TypeError("The listener must be a function");var s=new _U(t,n||r,i),o=Mt?Mt+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 $u(r,e){--r._eventsCount===0?r._events=new _a:delete r._events[e]}function Ct(){this._events=new _a,this._eventsCount=0}Ct.prototype.eventNames=function(){var e=[],t,n;if(this._eventsCount===0)return e;for(n in t=this._events)yU.call(t,n)&&e.push(Mt?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};Ct.prototype.listeners=function(e){var t=Mt?Mt+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=Mt?Mt+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=Mt?Mt+e:e;if(!this._events[a])return!1;var c=this._events[a],u=arguments.length,p,f;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),u){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,p=new Array(u-1);f<u;f++)p[f-1]=arguments[f];c.fn.apply(c.context,p)}else{var m=c.length,y;for(f=0;f<m;f++)switch(c[f].once&&this.removeListener(e,c[f].fn,void 0,!0),u){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(!p)for(y=1,p=new Array(u-1);y<u;y++)p[y-1]=arguments[y];c[f].fn.apply(c[f].context,p)}}return!0};Ct.prototype.on=function(e,t,n){return zR(this,e,t,n,!1)};Ct.prototype.once=function(e,t,n){return zR(this,e,t,n,!0)};Ct.prototype.removeListener=function(e,t,n,i){var s=Mt?Mt+e:e;if(!this._events[s])return this;if(!t)return $u(this,s),this;var o=this._events[s];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&$u(this,s);else{for(var a=0,c=[],u=o.length;a<u;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:$u(this,s)}return this};Ct.prototype.removeAllListeners=function(e){var t;return e?(t=Mt?Mt+e:e,this._events[t]&&$u(this,t)):(this._events=new _a,this._eventsCount=0),this};Ct.prototype.off=Ct.prototype.removeListener;Ct.prototype.addListener=Ct.prototype.on;Ct.prefixed=Mt;Ct.EventEmitter=Ct;typeof Tg<"u"&&(Tg.exports=Ct)});var YR=O((RK,VR)=>{"use strict";VR.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=O(JR=>{var Tn=JR,bU=require("url"),XR=require("util")._extend,wU=YR(),SU=/(^|,)\s*upgrade\s*($|,)/i,Cg=/^https|wss/;Tn.isSSL=Cg;Tn.setupOutgoing=function(r,e,t,n){r.port=e[n||"target"].port||(Cg.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=XR({},t.headers),e.headers&&XR(r.headers,e.headers),e.auth&&(r.auth=e.auth),e.ca&&(r.ca=e.ca),Cg.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"||!SU.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:bU.parse(t.url).path||"";return o=e.ignorePath?"":o,r.path=Tn.urlJoin(s,o),e.changeOrigin&&(r.headers.host=wU(r.port,e[n||"target"].protocol)&&!EU(r.host)?r.host+":"+r.port:r.host),r};Tn.setupSocket=function(r){return r.setTimeout(0),r.setNoDelay(!0),r.setKeepAlive(!0,0),r};Tn.getPort=function(r){var e=r.headers.host?r.headers.host.match(/:(\d+)/):"";return e?e[1]:Tn.hasEncryptedConnection(r)?"443":"80"};Tn.hasEncryptedConnection=function(r){return!!(r.connection.encrypted||r.connection.pair)};Tn.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("?")};Tn.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 EU(r){return!!~r.indexOf(":")}});var tk=O((OK,ek)=>{var QR=require("url"),ZR=qu(),TU=/^201|30(1|2|7|8)$/;ek.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&&TU.test(n.statusCode)){var s=QR.parse(i.target),o=QR.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,u=function(m,y){y!=null&&(s&&m.toLowerCase()==="set-cookie"&&(y=ZR.rewriteCookieProperty(y,s,"domain")),o&&m.toLowerCase()==="set-cookie"&&(y=ZR.rewriteCookieProperty(y,o,"path")),t.setHeader(String(m).trim(),y))};if(typeof s=="string"&&(s={"*":s}),typeof o=="string"&&(o={"*":o}),a&&n.rawHeaders!=null){c={};for(var p=0;p<n.rawHeaders.length;p+=2){var f=n.rawHeaders[p];c[f.toLowerCase()]=f}}Object.keys(n.headers).forEach(function(m){var y=n.headers[m];a&&c&&(m=c[m]||m),u(m,y)})},writeStatusCode:function(e,t,n){n.statusMessage?(t.statusCode=n.statusCode,t.statusMessage=n.statusMessage):t.statusCode=n.statusCode}}});var nk=O((PK,rk)=>{var ba;rk.exports=function(){if(!ba){try{ba=Ce()("follow-redirects")}catch{}typeof ba!="function"&&(ba=function(){})}ba.apply(null,arguments)}});var ck=O((MK,jg)=>{var Sa=require("url"),wa=Sa.URL,CU=require("http"),AU=require("https"),Pg=require("stream").Writable,Mg=require("assert"),ik=nk();(function(){var e=typeof process<"u",t=typeof window<"u"&&typeof document<"u",n=Ei(Error.captureStackTrace);!e&&(t||!n)&&console.warn("The follow-redirects package should be excluded from browser builds.")})();var Ig=!1;try{Mg(new wa(""))}catch(r){Ig=r.code==="ERR_INVALID_URL"}var RU=["Authorization","Proxy-Authorization","Cookie"],kU=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],Ng=["abort","aborted","connect","error","socket","timeout"],Lg=Object.create(null);Ng.forEach(function(r){Lg[r]=function(e,t,n){this._redirectable.emit(r,e,t,n)}});var Rg=Ea("ERR_INVALID_URL","Invalid URL",TypeError),kg=Ea("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),OU=Ea("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",kg),PU=Ea("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),MU=Ea("ERR_STREAM_WRITE_AFTER_END","write after end"),IU=Pg.prototype.destroy||ok;function Wt(r,e){Pg.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 kg?i:new kg({cause:i}))}},this._headerFilter=new RegExp("^(?:"+RU.concat(r.sensitiveHeaders).map(FU).join("|")+")$","i"),this._performRequest()}Wt.prototype=Object.create(Pg.prototype);Wt.prototype.abort=function(){Bg(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};Wt.prototype.destroy=function(r){return Bg(this._currentRequest,r),IU.call(this,r),this};Wt.prototype.write=function(r,e,t){if(this._ending)throw new MU;if(!Si(r)&&!BU(r))throw new TypeError("data should be a string, Buffer or Uint8Array");if(Ei(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 PU),this.abort())};Wt.prototype.end=function(r,e,t){if(Ei(r)?(t=r,r=e=null):Ei(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}};Wt.prototype.setHeader=function(r,e){this._options.headers[r]=e,this._currentRequest.setHeader(r,e)};Wt.prototype.removeHeader=function(r){delete this._options.headers[r],this._currentRequest.removeHeader(r)};Wt.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){Wt.prototype[r]=function(e,t){return this._currentRequest[r](e,t)}});["aborted","connection","socket"].forEach(function(r){Object.defineProperty(Wt.prototype,r,{get:function(){return this._currentRequest[r]}})});Wt.prototype._sanitizeOptions=function(r){if(r.headers||(r.headers={}),DU(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))}};Wt.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 Ng)n.on(i,Lg[i]);if(this._currentUrl=/^\//.test(this._options.path)?Sa.format(this._options):this._options.path,this._isRedirect){var s=0,o=this,a=this._requestBodyBuffers;(function c(u){if(n===o._currentRequest)if(u)o.emit("error",u);else if(s<a.length){var p=a[s++];n.finished||n.write(p.data,p.encoding,c)}else o._ended&&n.end()})()}};Wt.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(Bg(this._currentRequest),r.destroy(),++this._redirectCount>this._options.maxRedirects)throw new OU;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=[],Ag(/^content-/i,this._options.headers));var o=Ag(/^host$/i,this._options.headers),a=Dg(this._currentUrl),c=o||a.host,u=/^\w+:/.test(t)?this._currentUrl:Sa.format(Object.assign(a,{host:c})),p=NU(t,u);if(ik("redirecting to",p.href),this._isRedirect=!0,Og(p,this._options),(p.protocol!==a.protocol&&p.protocol!=="https:"||p.host!==c&&!LU(p.host,c))&&Ag(this._headerFilter,this._options.headers),Ei(i)){var f={headers:r.headers,statusCode:e},m={url:u,method:s,headers:n};i(this._options,f,m),this._sanitizeOptions(this._options)}this._performRequest()};function sk(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(u,p,f){return jU(u)?u=Og(u):Si(u)?u=Og(Dg(u)):(f=p,p=ak(u),u={protocol:i}),Ei(p)&&(f=p,p=null),p=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},u,p),p.nativeProtocols=t,!Si(p.host)&&!Si(p.hostname)&&(p.hostname="::1"),Mg.equal(p.protocol,i,"protocol mismatch"),ik("options",p),new Wt(p,f)}function c(u,p,f){var m=o.request(u,p,f);return m.end(),m}Object.defineProperties(o,{request:{value:a,configurable:!0,enumerable:!0,writable:!0},get:{value:c,configurable:!0,enumerable:!0,writable:!0}})}),e}function ok(){}function Dg(r){var e;if(Ig)e=new wa(r);else if(e=ak(Sa.parse(r)),!Si(e.protocol))throw new Rg({input:r});return e}function NU(r,e){return Ig?new wa(r,e):Dg(Sa.resolve(e,r))}function ak(r){if(/^\[/.test(r.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(r.hostname))throw new Rg({input:r.href||r});if(/^\[/.test(r.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(r.host))throw new Rg({input:r.href||r});return r}function Og(r,e){var t=e||{};for(var n of kU)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 Ag(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 Ea(r,e,t){function n(i){Ei(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 Bg(r,e){for(var t of Ng)r.removeListener(t,Lg[t]);r.on("error",ok),r.destroy(e)}function LU(r,e){Mg(Si(r)&&Si(e));var t=r.length-e.length-1;return t>0&&r[t]==="."&&r.endsWith(e)}function DU(r){return r instanceof Array}function Si(r){return typeof r=="string"||r instanceof String}function Ei(r){return typeof r=="function"}function BU(r){return typeof r=="object"&&"length"in r}function jU(r){return wa&&r instanceof wa}function FU(r){return r.replace(/[\]\\/()*+?.$]/g,"\\$&")}jg.exports=sk({http:CU,https:AU});jg.exports.wrap=sk});var uk=O((IK,lk)=>{var HU=require("http"),$U=require("https"),Ta=tk(),Uu=qu(),qU=ck();Ta=Object.keys(Ta).map(function(r){return Ta[r]});var UU={http:HU,https:$U};lk.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||Uu.hasEncryptedConnection(e),s={for:e.connection.remoteAddress||e.socket.remoteAddress,port:Uu.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?qU:UU,c=a.http,u=a.https;if(n.forward){var p=(n.forward.protocol==="https:"?u:c).request(Uu.setupOutgoing(n.ssl||{},n,e,"forward")),f=_(p,n.forward);if(e.on("error",f),p.on("error",f),(n.buffer||e).pipe(p),!n.target)return t.end()}var m=(n.target.protocol==="https:"?u:c).request(Uu.setupOutgoing(n.ssl||{},n,e));m.on("socket",function(S){s&&!m.getHeader("expect")&&s.emit("proxyReq",m,e,t,n)}),n.proxyTimeout&&m.setTimeout(n.proxyTimeout,function(){m.abort()}),e.on("aborted",function(){m.abort()});var y=_(m,n.target);e.on("error",y),m.on("error",y);function _(S,A){return function(L){if(e.socket.destroyed&&L.code==="ECONNRESET")return s.emit("econnreset",L,e,t,A),S.abort();o?o(L,e,t,A):s.emit("error",L,e,t,A)}}(n.buffer||e).pipe(m),m.on("response",function(S){if(s&&s.emit("proxyRes",S,e,t),!t.headersSent&&!n.selfHandleResponse)for(var A=0;A<Ta.length&&!Ta[A](e,t,S,n);A++);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 fk=O((NK,pk)=>{var WU=require("http"),GU=require("https"),Vs=qu();pk.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:Vs.getPort(e),proto:Vs.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(p,f){return Object.keys(f).reduce(function(m,y){var _=f[y];if(!Array.isArray(_))return m.push(y+": "+_),m;for(var S=0;S<_.length;S++)m.push(y+": "+_[S]);return m},[p]).join(`\r
|
|
101
101
|
`)+`\r
|
|
102
102
|
\r
|
|
103
|
-
`};Ks.setupSocket(t),i&&i.length&&t.unshift(i);var c=(Ks.isSSL.test(n.target.protocol)?_U:yU).request(Ks.setupOutgoing(n.ssl||{},n,e));return s&&s.emit("proxyReqWs",c,e,t,n,i),c.on("error",u),c.on("response",function(p){p.upgrade||(t.write(a("HTTP/"+p.httpVersion+" "+p.statusCode+" "+p.statusMessage,p.headers)),p.pipe(t))}),c.on("upgrade",function(p,f,g){f.on("error",u),f.on("end",function(){s.emit("close",p,f,g)}),t.on("error",function(){f.end()}),Ks.setupSocket(f),g&&g.length&&f.unshift(g),t.write(a("HTTP/1.1 101 Switching Protocols",p.headers)),f.pipe(t).pipe(f),s.emit("open",f),s.emit("proxySocket",f)}),c.end();function u(p){o?o(p,e,t):s.emit("error",p,e,t),t.end()}}}});var QR=O((iK,JR)=>{var YR=JR.exports,zR=require("util")._extend,bU=require("url").parse,XR=CR(),wU=require("http"),SU=require("https"),KR=UR(),VR=GR();YR.Server=wi;function Tg(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 u=e;if(!(s[o]instanceof Buffer)&&s[o]!==n&&(u=zR({},e),zR(u,s[o]),o--),s[o]instanceof Buffer&&(a=s[o]),["target","forward"].forEach(function(f){typeof u[f]=="string"&&(u[f]=bU(u[f]))}),!u.target&&!u.forward)return this.emit("error",new Error("Must provide a proper URL as target"));for(var p=0;p<i.length&&!i[p](t,n,u,a,this,c);p++);}}}YR.createRightProxy=Tg;function wi(r){XR.call(this),r=r||{},r.prependPath=r.prependPath!==!1,this.web=this.proxyRequest=Tg("web")(r),this.ws=this.proxyWebsocketRequest=Tg("ws")(r),this.options=r,this.webPasses=Object.keys(KR).map(function(e){return KR[e]}),this.wsPasses=Object.keys(VR).map(function(e){return VR[e]}),this.on("error",this.onError,this)}require("util").inherits(wi,XR);wi.prototype.onError=function(r){if(this.listeners("error").length===1)throw r};wi.prototype.listen=function(r,e){var t=this,n=function(i,s){t.web(i,s)};return this._server=this.options.ssl?SU.createServer(this.options.ssl,n):wU.createServer(n),this.options.ws&&this._server.on("upgrade",function(i,s,o){t.ws(i,s,o)}),this._server.listen(r,e),this};wi.prototype.close=function(r){var e=this;this._server&&this._server.close(t);function t(){e._server=null,r&&r.apply(null,arguments)}};wi.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)};wi.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 ek=O((sK,ZR)=>{var wa=QR().Server;function Cg(r){return new wa(r)}wa.createProxyServer=Cg;wa.createServer=Cg;wa.createProxy=Cg;ZR.exports=wa});var rk=O((oK,tk)=>{tk.exports=ek()});var Tk=O((Sa,kg)=>{(function(r,e){typeof Sa=="object"&&typeof kg=="object"?kg.exports=e(require("child_process"),require("crypto")):typeof define=="function"&&define.amd?define(["child_process","crypto"],e):typeof Sa=="object"?Sa["electron-machine-id"]=e(require("child_process"),require("crypto")):r["electron-machine-id"]=e(r.child_process,r.crypto)})(Sa,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",u=t.exports=function(p){return s[p]||(s[p]=c&&a[p]||(c?a:o)("Symbol."+p))};u.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,u){return s.f(a,c,o(1,u))}:function(a,c,u){return a[c]=u,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(u){return o.call(a,u)};case 2:return function(u,p){return o.call(a,u,p)};case 3:return function(u,p,f){return o.call(a,u,p,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(u,p,f){if(s(u),p=a(p,!0),s(f),o)try{return c(u,p,f)}catch{}if("get"in f||"set"in f)throw TypeError("Accessors not supported!");return"value"in f&&(u[p]=f.value),u}},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,u,p){c&&!o(c=p?c:c.prototype,a)&&s(c,a,{configurable:!0,value:u})}},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(u,p){try{return u[p]}catch{}};t.exports=function(u){var p,f,g;return u===void 0?"Undefined":u===null?"Null":typeof(f=c(p=Object(u),o))=="string"?f:a?s(p):(g=s(p))=="Object"&&typeof p.callee=="function"?"Arguments":g}},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),u="prototype",p=function(f,g,y){var b,S,R,I=f&p.F,L=f&p.G,N=f&p.S,H=f&p.P,W=f&p.B,U=f&p.W,G=L?o:o[g]||(o[g]={}),P=G[u],F=L?s:N?s[g]:(s[g]||{})[u];L&&(y=g);for(b in y)S=!I&&F&&F[b]!==void 0,S&&b in G||(R=S?F[b]:y[b],G[b]=L&&typeof F[b]!="function"?y[b]:W&&S?a(R,s):U&&F[b]==R?(function(T){var l=function(h,x,w){if(this instanceof T){switch(arguments.length){case 0:return new T;case 1:return new T(h);case 2:return new T(h,x)}return new T(h,x,w)}return T.apply(this,arguments)};return l[u]=T[u],l})(R):H&&typeof R=="function"?a(Function.call,R):R,H&&((G.virtual||(G.virtual={}))[b]=R,f&p.R&&P&&!P[b]&&c(P,b,R)))};p.F=1,p.G=2,p.S=4,p.P=8,p.B=16,p.W=32,p.U=64,p.R=128,t.exports=p},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),u=i(8),p=i(10),f=i(45),g=i(18),y=i(52),b=i(1)("iterator"),S=!([].keys&&"next"in[].keys()),R="@@iterator",I="keys",L="values",N=function(){return this};t.exports=function(H,W,U,G,P,F,T){f(U,W,G);var l,h,x,w=function(D){if(!S&&D in _)return _[D];switch(D){case I:return function(){return new U(this,D)};case L:return function(){return new U(this,D)}}return function(){return new U(this,D)}},m=W+" Iterator",v=P==L,C=!1,_=H.prototype,d=_[b]||_[R]||P&&_[P],E=d||w(P),q=P?v?w("entries"):E:void 0,M=W=="Array"&&_.entries||d;if(M&&(x=y(M.call(new H)),x!==Object.prototype&&(g(x,m,!0),s||u(x,b)||c(x,b,N))),v&&d&&d.name!==L&&(C=!0,E=function(){return d.call(this)}),s&&!T||!S&&!C&&_[b]||c(_,b,E),p[W]=E,p[m]=N,P)if(l={values:v?E:w(L),keys:F?E:w(I),entries:q},T)for(h in l)h in _||a(_,h,l[h]);else o(o.P+o.F*(S||C),W,l);return l}},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),u=i(41),p=i(25),f=i(16),g=i(2),y=g.process,b=g.setImmediate,S=g.clearImmediate,R=g.MessageChannel,I=0,L={},N="onreadystatechange",H=function(){var U=+this;if(L.hasOwnProperty(U)){var G=L[U];delete L[U],G()}},W=function(U){H.call(U.data)};b&&S||(b=function(U){for(var G=[],P=1;arguments.length>P;)G.push(arguments[P++]);return L[++I]=function(){u(typeof U=="function"?U:Function(U),G)},s(I),I},S=function(U){delete L[U]},i(11)(y)=="process"?s=function(U){y.nextTick(c(H,U,1))}:R?(o=new R,a=o.port2,o.port1.onmessage=W,s=c(a.postMessage,a,1)):g.addEventListener&&typeof postMessage=="function"&&!g.importScripts?(s=function(U){g.postMessage(U+"","*")},g.addEventListener("message",W,!1)):s=N in f("script")?function(U){p.appendChild(f("script"))[N]=function(){p.removeChild(this),H.call(U)}}:function(U){setTimeout(c(H,U,1),0)}),t.exports={set:b,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,u;if(a&&typeof(c=o.toString)=="function"&&!s(u=c.call(o))||typeof(c=o.valueOf)=="function"&&!s(u=c.call(o))||!a&&typeof(c=o.toString)=="function"&&!s(u=c.call(o)))return u;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(N){return N&&N.__esModule?N:{default:N}}function o(){return process.platform!=="win32"?"":process.arch==="ia32"&&process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432")?"mixed":"native"}function a(N){return(0,b.createHash)("sha256").update(N).digest("hex")}function c(N){switch(R){case"darwin":return N.split("IOPlatformUUID")[1].split(`
|
|
104
|
-
`)[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return N.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":return N.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"freebsd":return N.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw new Error("Unsupported platform: "+process.platform)}}function u(N){var H=c((0,y.execSync)(L[R]).toString());return N?H:a(H)}function p(N){return new g.default(function(H,W){return(0,y.exec)(L[R],{},function(U,G,P){if(U)return W(new Error("Error while obtaining machine id: "+U.stack));var F=c(G.toString());return H(N?F:a(F))})})}Object.defineProperty(n,"__esModule",{value:!0});var f=i(35),g=s(f);n.machineIdSync=u,n.machineId=p;var y=i(70),b=i(71),S=process,R=S.platform,I={native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"},L={darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:I[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(u,p,f){var g,y=s(u),b=o(y.length),S=a(f,b);if(c&&p!=p){for(;b>S;)if(g=y[S++],g!=g)return!0}else for(;b>S;S++)if((c||S in y)&&y[S]===p)return c||S||0;return!c&&-1}}},function(t,y,i){var s=i(7),o=i(44),a=i(43),c=i(3),u=i(31),p=i(64),f={},g={},y=t.exports=function(b,S,R,I,L){var N,H,W,U,G=L?function(){return b}:p(b),P=s(R,I,S?2:1),F=0;if(typeof G!="function")throw TypeError(b+" is not iterable!");if(a(G)){for(N=u(b.length);N>F;F++)if(U=S?P(c(H=b[F])[0],H[1]):P(b[F]),U===f||U===g)return U}else for(W=G.call(b);!(H=W.next()).done;)if(U=o(W,P,H.value,S),U===f||U===g)return U};y.BREAK=f,y.RETURN=g},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,u){try{return u?a(s(c)[0],c[1]):a(c)}catch(f){var p=o.return;throw p!==void 0&&s(p.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(u,p,f){u.prototype=s(c,{next:o(1,f)}),a(u,p+" 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,u){if(!u&&!o)return!1;var p=!1;try{var f=[7],g=f[s]();g.next=function(){return{done:p=!0}},f[s]=function(){return g},c(f)}catch{}return p}},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,u=s.Promise,p=i(11)(c)=="process";t.exports=function(){var f,g,y,b=function(){var L,N;for(p&&(L=c.domain)&&L.exit();f;){N=f.fn,f=f.next;try{N()}catch(H){throw f?y():g=void 0,H}}g=void 0,L&&L.enter()};if(p)y=function(){c.nextTick(b)};else if(a){var S=!0,R=document.createTextNode("");new a(b).observe(R,{characterData:!0}),y=function(){R.data=S=!S}}else if(u&&u.resolve){var I=u.resolve();y=function(){I.then(b)}}else y=function(){o.call(s,b)};return function(L){var N={fn:L,next:void 0};g&&(g.next=N),f||(f=N,y()),g=N}}},function(t,n,i){var s=i(3),o=i(50),a=i(22),c=i(19)("IE_PROTO"),u=function(){},p="prototype",f=function(){var g,y=i(16)("iframe"),b=a.length,S=">";for(y.style.display="none",i(25).appendChild(y),y.src="javascript:",g=y.contentWindow.document,g.open(),g.write("<script>document.F=Object</script"+S),g.close(),f=g.F;b--;)delete f[p][a[b]];return f()};t.exports=Object.create||function(g,y){var b;return g!==null?(u[p]=s(g),b=new u,u[p]=null,b[c]=g):b=f(),y===void 0?b:o(b,y)}},function(t,n,i){var s=i(12),o=i(3),a=i(54);t.exports=i(4)?Object.defineProperties:function(c,u){o(c);for(var p,f=a(u),g=f.length,y=0;g>y;)s.f(c,p=f[y++],u[p]);return c}},function(t,n,i){var s=i(55),o=i(17),a=i(13),c=i(32),u=i(8),p=i(26),f=Object.getOwnPropertyDescriptor;n.f=i(4)?f:function(g,y){if(g=a(g),y=c(y,!0),p)try{return f(g,y)}catch{}if(u(g,y))return o(!s.f.call(g,y),g[y])}},function(t,n,i){var s=i(8),o=i(63),a=i(19)("IE_PROTO"),c=Object.prototype;t.exports=Object.getPrototypeOf||function(u){return u=o(u),s(u,a)?u[a]:typeof u.constructor=="function"&&u instanceof u.constructor?u.constructor.prototype:u 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(u,p){var f,g=o(u),y=0,b=[];for(f in g)f!=c&&s(g,f)&&b.push(f);for(;p.length>y;)s(g,f=p[y++])&&(~a(b,f)||b.push(f));return b}},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 u in a)c&&o[u]?o[u]=a[u]:s(o,u,a[u]);return o}},function(t,n,i){t.exports=i(5)},function(t,n,i){var s=i(9),o=i(3),a=function(c,u){if(o(c),!s(u)&&u!==null)throw TypeError(u+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?(function(c,u,p){try{p=i(7)(Function.call,i(51).f(Object.prototype,"__proto__").set,2),p(c,[]),u=!(c instanceof Array)}catch{u=!0}return function(f,g){return a(f,g),u?f.__proto__=g:p(f,g),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),u=i(1)("species");t.exports=function(p){var f=typeof o[p]=="function"?o[p]:s[p];c&&f&&!f[u]&&a.f(f,u,{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,u){var p,f=s(c).constructor;return f===void 0||(p=s(f)[a])==null?u:o(p)}},function(t,n,i){var s=i(20),o=i(15);t.exports=function(a){return function(c,u){var p,f,g=String(o(c)),y=s(u),b=g.length;return y<0||y>=b?a?"":void 0:(p=g.charCodeAt(y),p<55296||p>56319||y+1===b||(f=g.charCodeAt(y+1))<56320||f>57343?a?g.charAt(y):p:a?g.slice(y,y+2):(p-55296<<10)+(f-56320)+65536)}}},function(t,n,i){var s=i(20),o=Math.max,a=Math.min;t.exports=function(c,u){return c=s(c),c<0?o(c+u,0):a(c,u)}},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(u,p){this._t=c(u),this._i=0,this._k=p},function(){var u=this._t,p=this._k,f=this._i++;return!u||f>=u.length?(this._t=void 0,o(1)):p=="keys"?o(0,f):p=="values"?o(0,u[f]):o(0,[f,u[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),u=i(2),p=i(7),f=i(21),g=i(23),y=i(9),b=(i(3),i(14)),S=i(38),R=i(40),I=(i(58).set,i(60)),L=i(30).set,N=i(48)(),H="Promise",W=u.TypeError,G=u.process,U=u[H],G=u.process,P=f(G)=="process",F=function(){},T=!!(function(){try{var M=U.resolve(1),D=(M.constructor={})[i(1)("species")]=function($){$(F,F)};return(P||typeof PromiseRejectionEvent=="function")&&M.then(F)instanceof D}catch{}})(),l=function(M,D){return M===D||M===U&&D===a},h=function(M){var D;return!(!y(M)||typeof(D=M.then)!="function")&&D},x=function(M){return l(U,M)?new w(M):new o(M)},w=o=function(M){var D,$;this.promise=new M(function(K,B){if(D!==void 0||$!==void 0)throw W("Bad Promise constructor");D=K,$=B}),this.resolve=b(D),this.reject=b($)},m=function(M){try{M()}catch(D){return{error:D}}},v=function(M,D){if(!M._n){M._n=!0;var $=M._c;N(function(){for(var K=M._v,B=M._s==1,de=0,ie=function(A){var Y,k,j=B?A.ok:A.fail,J=A.resolve,V=A.reject,z=A.domain;try{j?(B||(M._h==2&&d(M),M._h=1),j===!0?Y=K:(z&&z.enter(),Y=j(K),z&&z.exit()),Y===A.promise?V(W("Promise-chain cycle")):(k=h(Y))?k.call(Y,J,V):J(Y)):V(K)}catch(he){V(he)}};$.length>de;)ie($[de++]);M._c=[],M._n=!1,D&&!M._h&&C(M)})}},C=function(M){L.call(u,function(){var D,$,K,B=M._v;if(_(M)&&(D=m(function(){P?G.emit("unhandledRejection",B,M):($=u.onunhandledrejection)?$({promise:M,reason:B}):(K=u.console)&&K.error&&K.error("Unhandled promise rejection",B)}),M._h=P||_(M)?2:1),M._a=void 0,D)throw D.error})},_=function(M){if(M._h==1)return!1;for(var D,$=M._a||M._c,K=0;$.length>K;)if(D=$[K++],D.fail||!_(D.promise))return!1;return!0},d=function(M){L.call(u,function(){var D;P?G.emit("rejectionHandled",M):(D=u.onrejectionhandled)&&D({promise:M,reason:M._v})})},E=function(M){var D=this;D._d||(D._d=!0,D=D._w||D,D._v=M,D._s=2,D._a||(D._a=D._c.slice()),v(D,!0))},q=function(M){var D,$=this;if(!$._d){$._d=!0,$=$._w||$;try{if($===M)throw W("Promise can't be resolved itself");(D=h(M))?N(function(){var K={_w:$,_d:!1};try{D.call(M,p(q,K,1),p(E,K,1))}catch(B){E.call(K,B)}}):($._v=M,$._s=1,v($,!1))}catch(K){E.call({_w:$,_d:!1},K)}}};T||(U=function(M){S(this,U,H,"_h"),b(M),s.call(this);try{M(p(q,this,1),p(E,this,1))}catch(D){E.call(this,D)}},s=function(M){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)(U.prototype,{then:function(M,D){var $=x(I(this,U));return $.ok=typeof M!="function"||M,$.fail=typeof D=="function"&&D,$.domain=P?G.domain:void 0,this._c.push($),this._a&&this._a.push($),this._s&&v(this,!1),$.promise},catch:function(M){return this.then(void 0,M)}}),w=function(){var M=new s;this.promise=M,this.resolve=p(q,M,1),this.reject=p(E,M,1)}),g(g.G+g.W+g.F*!T,{Promise:U}),i(18)(U,H),i(59)(H),a=i(6)[H],g(g.S+g.F*!T,H,{reject:function(M){var D=x(this),$=D.reject;return $(M),D.promise}}),g(g.S+g.F*(c||!T),H,{resolve:function(M){if(M instanceof U&&l(M.constructor,this))return M;var D=x(this),$=D.resolve;return $(M),D.promise}}),g(g.S+g.F*!(T&&i(46)(function(M){U.all(M).catch(F)})),H,{all:function(M){var D=this,$=x(D),K=$.resolve,B=$.reject,de=m(function(){var ie=[],A=0,Y=1;R(M,!1,function(k){var j=A++,J=!1;ie.push(void 0),Y++,D.resolve(k).then(function(V){J||(J=!0,ie[j]=V,--Y||K(ie))},B)}),--Y||K(ie)});return de&&B(de.error),$.promise},race:function(M){var D=this,$=x(D),K=$.reject,B=m(function(){R(M,!1,function(de){D.resolve(de).then($.resolve,K)})});return B&&K(B.error),$.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"),u=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],p=0;p<5;p++){var f=u[p],g=s[f],y=g&&g.prototype;y&&!y[c]&&o(y,c,f),a[f]=a.Array}},function(t,n){t.exports=require("child_process")},function(t,n){t.exports=require("crypto")}])})});var XU={};Xr(XU,{startServer:()=>eO});module.exports=oO(XU);var Mu=require("http"),Iu=require("child_process"),Si=require("fs"),Qt=require("path"),Jk=require("url");var Kg=(r=0)=>e=>`\x1B[${e+r}m`,Vg=(r=0)=>e=>`\x1B[${38+r};5;${e}m`,Yg=(r=0)=>(e,t,n)=>`\x1B[${38+r};2;${e};${t};${n}m`,ve={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]}},QU=Object.keys(ve.modifier),aO=Object.keys(ve.color),cO=Object.keys(ve.bgColor),ZU=[...aO,...cO];function lO(){let r=new Map;for(let[e,t]of Object.entries(ve)){for(let[n,i]of Object.entries(t))ve[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[n]=ve[n],r.set(i[0],i[1]);Object.defineProperty(ve,e,{value:t,enumerable:!1})}return Object.defineProperty(ve,"codes",{value:r,enumerable:!1}),ve.color.close="\x1B[39m",ve.bgColor.close="\x1B[49m",ve.color.ansi=Kg(),ve.color.ansi256=Vg(),ve.color.ansi16m=Yg(),ve.bgColor.ansi=Kg(10),ve.bgColor.ansi256=Vg(10),ve.bgColor.ansi16m=Yg(10),Object.defineProperties(ve,{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=>ve.rgbToAnsi256(...ve.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)=>ve.ansi256ToAnsi(ve.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>ve.ansi256ToAnsi(ve.hexToAnsi256(e)),enumerable:!1}}),ve}var uO=lO(),yr=uO;var Aa=X(require("node:process"),1),Jg=X(require("node:os"),1),Zu=X(require("node:tty"),1);function Zt(r,e=globalThis.Deno?globalThis.Deno.args:Aa.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:xe}=Aa.default,Ca;Zt("no-color")||Zt("no-colors")||Zt("color=false")||Zt("color=never")?Ca=0:(Zt("color")||Zt("colors")||Zt("color=true")||Zt("color=always"))&&(Ca=1);function pO(){if("FORCE_COLOR"in xe)return xe.FORCE_COLOR==="true"?1:xe.FORCE_COLOR==="false"?0:xe.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(xe.FORCE_COLOR,10),3)}function fO(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function dO(r,{streamIsTTY:e,sniffFlags:t=!0}={}){let n=pO();n!==void 0&&(Ca=n);let i=t?Ca:n;if(i===0)return 0;if(t){if(Zt("color=16m")||Zt("color=full")||Zt("color=truecolor"))return 3;if(Zt("color=256"))return 2}if("TF_BUILD"in xe&&"AGENT_NAME"in xe)return 1;if(r&&!e&&i===void 0)return 0;let s=i||0;if(xe.TERM==="dumb")return s;if(Aa.default.platform==="win32"){let o=Jg.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in xe)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>o in xe)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in xe)||xe.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in xe)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(xe.TEAMCITY_VERSION)?1:0;if(xe.COLORTERM==="truecolor"||xe.TERM==="xterm-kitty"||xe.TERM==="xterm-ghostty"||xe.TERM==="wezterm")return 3;if("TERM_PROGRAM"in xe){let o=Number.parseInt((xe.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(xe.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(xe.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(xe.TERM)||"COLORTERM"in xe?1:s}function Xg(r,e={}){let t=dO(r,{streamIsTTY:r&&r.isTTY,...e});return fO(t)}var hO={stdout:Xg({isTTY:Zu.default.isatty(1)}),stderr:Xg({isTTY:Zu.default.isatty(2)})},Qg=hO;function Zg(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 ev(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
|
|
103
|
+
`};Vs.setupSocket(t),i&&i.length&&t.unshift(i);var c=(Vs.isSSL.test(n.target.protocol)?GU:WU).request(Vs.setupOutgoing(n.ssl||{},n,e));return s&&s.emit("proxyReqWs",c,e,t,n,i),c.on("error",u),c.on("response",function(p){p.upgrade||(t.write(a("HTTP/"+p.httpVersion+" "+p.statusCode+" "+p.statusMessage,p.headers)),p.pipe(t))}),c.on("upgrade",function(p,f,m){f.on("error",u),f.on("end",function(){s.emit("close",p,f,m)}),t.on("error",function(){f.end()}),Vs.setupSocket(f),m&&m.length&&f.unshift(m),t.write(a("HTTP/1.1 101 Switching Protocols",p.headers)),f.pipe(t).pipe(f),s.emit("open",f),s.emit("proxySocket",f)}),c.end();function u(p){o?o(p,e,t):s.emit("error",p,e,t),t.end()}}}});var yk=O((LK,xk)=>{var gk=xk.exports,dk=require("util")._extend,zU=require("url").parse,vk=KR(),KU=require("http"),VU=require("https"),hk=uk(),mk=fk();gk.Server=Ti;function Fg(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 u=e;if(!(s[o]instanceof Buffer)&&s[o]!==n&&(u=dk({},e),dk(u,s[o]),o--),s[o]instanceof Buffer&&(a=s[o]),["target","forward"].forEach(function(f){typeof u[f]=="string"&&(u[f]=zU(u[f]))}),!u.target&&!u.forward)return this.emit("error",new Error("Must provide a proper URL as target"));for(var p=0;p<i.length&&!i[p](t,n,u,a,this,c);p++);}}}gk.createRightProxy=Fg;function Ti(r){vk.call(this),r=r||{},r.prependPath=r.prependPath!==!1,this.web=this.proxyRequest=Fg("web")(r),this.ws=this.proxyWebsocketRequest=Fg("ws")(r),this.options=r,this.webPasses=Object.keys(hk).map(function(e){return hk[e]}),this.wsPasses=Object.keys(mk).map(function(e){return mk[e]}),this.on("error",this.onError,this)}require("util").inherits(Ti,vk);Ti.prototype.onError=function(r){if(this.listeners("error").length===1)throw r};Ti.prototype.listen=function(r,e){var t=this,n=function(i,s){t.web(i,s)};return this._server=this.options.ssl?VU.createServer(this.options.ssl,n):KU.createServer(n),this.options.ws&&this._server.on("upgrade",function(i,s,o){t.ws(i,s,o)}),this._server.listen(r,e),this};Ti.prototype.close=function(r){var e=this;this._server&&this._server.close(t);function t(){e._server=null,r&&r.apply(null,arguments)}};Ti.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)};Ti.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 bk=O((DK,_k)=>{var Ca=yk().Server;function Hg(r){return new Ca(r)}Ca.createProxyServer=Hg;Ca.createServer=Hg;Ca.createProxy=Hg;_k.exports=Ca});var Sk=O((BK,wk)=>{wk.exports=bk()});var zk=O((Aa,Ug)=>{(function(r,e){typeof Aa=="object"&&typeof Ug=="object"?Ug.exports=e(require("child_process"),require("crypto")):typeof define=="function"&&define.amd?define(["child_process","crypto"],e):typeof Aa=="object"?Aa["electron-machine-id"]=e(require("child_process"),require("crypto")):r["electron-machine-id"]=e(r.child_process,r.crypto)})(Aa,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",u=t.exports=function(p){return s[p]||(s[p]=c&&a[p]||(c?a:o)("Symbol."+p))};u.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,u){return s.f(a,c,o(1,u))}:function(a,c,u){return a[c]=u,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(u){return o.call(a,u)};case 2:return function(u,p){return o.call(a,u,p)};case 3:return function(u,p,f){return o.call(a,u,p,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(u,p,f){if(s(u),p=a(p,!0),s(f),o)try{return c(u,p,f)}catch{}if("get"in f||"set"in f)throw TypeError("Accessors not supported!");return"value"in f&&(u[p]=f.value),u}},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,u,p){c&&!o(c=p?c:c.prototype,a)&&s(c,a,{configurable:!0,value:u})}},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(u,p){try{return u[p]}catch{}};t.exports=function(u){var p,f,m;return u===void 0?"Undefined":u===null?"Null":typeof(f=c(p=Object(u),o))=="string"?f:a?s(p):(m=s(p))=="Object"&&typeof p.callee=="function"?"Arguments":m}},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),u="prototype",p=function(f,m,y){var _,S,A,P=f&p.F,L=f&p.G,N=f&p.S,H=f&p.P,W=f&p.B,U=f&p.W,G=L?o:o[m]||(o[m]={}),M=G[u],F=L?s:N?s[m]:(s[m]||{})[u];L&&(y=m);for(_ in y)S=!P&&F&&F[_]!==void 0,S&&_ in G||(A=S?F[_]:y[_],G[_]=L&&typeof F[_]!="function"?y[_]:W&&S?a(A,s):U&&F[_]==A?(function(T){var l=function(h,x,w){if(this instanceof T){switch(arguments.length){case 0:return new T;case 1:return new T(h);case 2:return new T(h,x)}return new T(h,x,w)}return T.apply(this,arguments)};return l[u]=T[u],l})(A):H&&typeof A=="function"?a(Function.call,A):A,H&&((G.virtual||(G.virtual={}))[_]=A,f&p.R&&M&&!M[_]&&c(M,_,A)))};p.F=1,p.G=2,p.S=4,p.P=8,p.B=16,p.W=32,p.U=64,p.R=128,t.exports=p},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),u=i(8),p=i(10),f=i(45),m=i(18),y=i(52),_=i(1)("iterator"),S=!([].keys&&"next"in[].keys()),A="@@iterator",P="keys",L="values",N=function(){return this};t.exports=function(H,W,U,G,M,F,T){f(U,W,G);var l,h,x,w=function(D){if(!S&&D in b)return b[D];switch(D){case P:return function(){return new U(this,D)};case L:return function(){return new U(this,D)}}return function(){return new U(this,D)}},g=W+" Iterator",v=M==L,C=!1,b=H.prototype,d=b[_]||b[A]||M&&b[M],E=d||w(M),q=M?v?w("entries"):E:void 0,I=W=="Array"&&b.entries||d;if(I&&(x=y(I.call(new H)),x!==Object.prototype&&(m(x,g,!0),s||u(x,_)||c(x,_,N))),v&&d&&d.name!==L&&(C=!0,E=function(){return d.call(this)}),s&&!T||!S&&!C&&b[_]||c(b,_,E),p[W]=E,p[g]=N,M)if(l={values:v?E:w(L),keys:F?E:w(P),entries:q},T)for(h in l)h in b||a(b,h,l[h]);else o(o.P+o.F*(S||C),W,l);return l}},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),u=i(41),p=i(25),f=i(16),m=i(2),y=m.process,_=m.setImmediate,S=m.clearImmediate,A=m.MessageChannel,P=0,L={},N="onreadystatechange",H=function(){var U=+this;if(L.hasOwnProperty(U)){var G=L[U];delete L[U],G()}},W=function(U){H.call(U.data)};_&&S||(_=function(U){for(var G=[],M=1;arguments.length>M;)G.push(arguments[M++]);return L[++P]=function(){u(typeof U=="function"?U:Function(U),G)},s(P),P},S=function(U){delete L[U]},i(11)(y)=="process"?s=function(U){y.nextTick(c(H,U,1))}:A?(o=new A,a=o.port2,o.port1.onmessage=W,s=c(a.postMessage,a,1)):m.addEventListener&&typeof postMessage=="function"&&!m.importScripts?(s=function(U){m.postMessage(U+"","*")},m.addEventListener("message",W,!1)):s=N in f("script")?function(U){p.appendChild(f("script"))[N]=function(){p.removeChild(this),H.call(U)}}:function(U){setTimeout(c(H,U,1),0)}),t.exports={set:_,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,u;if(a&&typeof(c=o.toString)=="function"&&!s(u=c.call(o))||typeof(c=o.valueOf)=="function"&&!s(u=c.call(o))||!a&&typeof(c=o.toString)=="function"&&!s(u=c.call(o)))return u;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(N){return N&&N.__esModule?N:{default:N}}function o(){return process.platform!=="win32"?"":process.arch==="ia32"&&process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432")?"mixed":"native"}function a(N){return(0,_.createHash)("sha256").update(N).digest("hex")}function c(N){switch(A){case"darwin":return N.split("IOPlatformUUID")[1].split(`
|
|
104
|
+
`)[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return N.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":return N.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"freebsd":return N.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw new Error("Unsupported platform: "+process.platform)}}function u(N){var H=c((0,y.execSync)(L[A]).toString());return N?H:a(H)}function p(N){return new m.default(function(H,W){return(0,y.exec)(L[A],{},function(U,G,M){if(U)return W(new Error("Error while obtaining machine id: "+U.stack));var F=c(G.toString());return H(N?F:a(F))})})}Object.defineProperty(n,"__esModule",{value:!0});var f=i(35),m=s(f);n.machineIdSync=u,n.machineId=p;var y=i(70),_=i(71),S=process,A=S.platform,P={native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"},L={darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:P[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(u,p,f){var m,y=s(u),_=o(y.length),S=a(f,_);if(c&&p!=p){for(;_>S;)if(m=y[S++],m!=m)return!0}else for(;_>S;S++)if((c||S in y)&&y[S]===p)return c||S||0;return!c&&-1}}},function(t,y,i){var s=i(7),o=i(44),a=i(43),c=i(3),u=i(31),p=i(64),f={},m={},y=t.exports=function(_,S,A,P,L){var N,H,W,U,G=L?function(){return _}:p(_),M=s(A,P,S?2:1),F=0;if(typeof G!="function")throw TypeError(_+" is not iterable!");if(a(G)){for(N=u(_.length);N>F;F++)if(U=S?M(c(H=_[F])[0],H[1]):M(_[F]),U===f||U===m)return U}else for(W=G.call(_);!(H=W.next()).done;)if(U=o(W,M,H.value,S),U===f||U===m)return U};y.BREAK=f,y.RETURN=m},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,u){try{return u?a(s(c)[0],c[1]):a(c)}catch(f){var p=o.return;throw p!==void 0&&s(p.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(u,p,f){u.prototype=s(c,{next:o(1,f)}),a(u,p+" 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,u){if(!u&&!o)return!1;var p=!1;try{var f=[7],m=f[s]();m.next=function(){return{done:p=!0}},f[s]=function(){return m},c(f)}catch{}return p}},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,u=s.Promise,p=i(11)(c)=="process";t.exports=function(){var f,m,y,_=function(){var L,N;for(p&&(L=c.domain)&&L.exit();f;){N=f.fn,f=f.next;try{N()}catch(H){throw f?y():m=void 0,H}}m=void 0,L&&L.enter()};if(p)y=function(){c.nextTick(_)};else if(a){var S=!0,A=document.createTextNode("");new a(_).observe(A,{characterData:!0}),y=function(){A.data=S=!S}}else if(u&&u.resolve){var P=u.resolve();y=function(){P.then(_)}}else y=function(){o.call(s,_)};return function(L){var N={fn:L,next:void 0};m&&(m.next=N),f||(f=N,y()),m=N}}},function(t,n,i){var s=i(3),o=i(50),a=i(22),c=i(19)("IE_PROTO"),u=function(){},p="prototype",f=function(){var m,y=i(16)("iframe"),_=a.length,S=">";for(y.style.display="none",i(25).appendChild(y),y.src="javascript:",m=y.contentWindow.document,m.open(),m.write("<script>document.F=Object</script"+S),m.close(),f=m.F;_--;)delete f[p][a[_]];return f()};t.exports=Object.create||function(m,y){var _;return m!==null?(u[p]=s(m),_=new u,u[p]=null,_[c]=m):_=f(),y===void 0?_:o(_,y)}},function(t,n,i){var s=i(12),o=i(3),a=i(54);t.exports=i(4)?Object.defineProperties:function(c,u){o(c);for(var p,f=a(u),m=f.length,y=0;m>y;)s.f(c,p=f[y++],u[p]);return c}},function(t,n,i){var s=i(55),o=i(17),a=i(13),c=i(32),u=i(8),p=i(26),f=Object.getOwnPropertyDescriptor;n.f=i(4)?f:function(m,y){if(m=a(m),y=c(y,!0),p)try{return f(m,y)}catch{}if(u(m,y))return o(!s.f.call(m,y),m[y])}},function(t,n,i){var s=i(8),o=i(63),a=i(19)("IE_PROTO"),c=Object.prototype;t.exports=Object.getPrototypeOf||function(u){return u=o(u),s(u,a)?u[a]:typeof u.constructor=="function"&&u instanceof u.constructor?u.constructor.prototype:u 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(u,p){var f,m=o(u),y=0,_=[];for(f in m)f!=c&&s(m,f)&&_.push(f);for(;p.length>y;)s(m,f=p[y++])&&(~a(_,f)||_.push(f));return _}},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 u in a)c&&o[u]?o[u]=a[u]:s(o,u,a[u]);return o}},function(t,n,i){t.exports=i(5)},function(t,n,i){var s=i(9),o=i(3),a=function(c,u){if(o(c),!s(u)&&u!==null)throw TypeError(u+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?(function(c,u,p){try{p=i(7)(Function.call,i(51).f(Object.prototype,"__proto__").set,2),p(c,[]),u=!(c instanceof Array)}catch{u=!0}return function(f,m){return a(f,m),u?f.__proto__=m:p(f,m),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),u=i(1)("species");t.exports=function(p){var f=typeof o[p]=="function"?o[p]:s[p];c&&f&&!f[u]&&a.f(f,u,{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,u){var p,f=s(c).constructor;return f===void 0||(p=s(f)[a])==null?u:o(p)}},function(t,n,i){var s=i(20),o=i(15);t.exports=function(a){return function(c,u){var p,f,m=String(o(c)),y=s(u),_=m.length;return y<0||y>=_?a?"":void 0:(p=m.charCodeAt(y),p<55296||p>56319||y+1===_||(f=m.charCodeAt(y+1))<56320||f>57343?a?m.charAt(y):p:a?m.slice(y,y+2):(p-55296<<10)+(f-56320)+65536)}}},function(t,n,i){var s=i(20),o=Math.max,a=Math.min;t.exports=function(c,u){return c=s(c),c<0?o(c+u,0):a(c,u)}},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(u,p){this._t=c(u),this._i=0,this._k=p},function(){var u=this._t,p=this._k,f=this._i++;return!u||f>=u.length?(this._t=void 0,o(1)):p=="keys"?o(0,f):p=="values"?o(0,u[f]):o(0,[f,u[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),u=i(2),p=i(7),f=i(21),m=i(23),y=i(9),_=(i(3),i(14)),S=i(38),A=i(40),P=(i(58).set,i(60)),L=i(30).set,N=i(48)(),H="Promise",W=u.TypeError,G=u.process,U=u[H],G=u.process,M=f(G)=="process",F=function(){},T=!!(function(){try{var I=U.resolve(1),D=(I.constructor={})[i(1)("species")]=function($){$(F,F)};return(M||typeof PromiseRejectionEvent=="function")&&I.then(F)instanceof D}catch{}})(),l=function(I,D){return I===D||I===U&&D===a},h=function(I){var D;return!(!y(I)||typeof(D=I.then)!="function")&&D},x=function(I){return l(U,I)?new w(I):new o(I)},w=o=function(I){var D,$;this.promise=new I(function(K,B){if(D!==void 0||$!==void 0)throw W("Bad Promise constructor");D=K,$=B}),this.resolve=_(D),this.reject=_($)},g=function(I){try{I()}catch(D){return{error:D}}},v=function(I,D){if(!I._n){I._n=!0;var $=I._c;N(function(){for(var K=I._v,B=I._s==1,me=0,ie=function(R){var Y,k,j=B?R.ok:R.fail,J=R.resolve,V=R.reject,z=R.domain;try{j?(B||(I._h==2&&d(I),I._h=1),j===!0?Y=K:(z&&z.enter(),Y=j(K),z&&z.exit()),Y===R.promise?V(W("Promise-chain cycle")):(k=h(Y))?k.call(Y,J,V):J(Y)):V(K)}catch(ge){V(ge)}};$.length>me;)ie($[me++]);I._c=[],I._n=!1,D&&!I._h&&C(I)})}},C=function(I){L.call(u,function(){var D,$,K,B=I._v;if(b(I)&&(D=g(function(){M?G.emit("unhandledRejection",B,I):($=u.onunhandledrejection)?$({promise:I,reason:B}):(K=u.console)&&K.error&&K.error("Unhandled promise rejection",B)}),I._h=M||b(I)?2:1),I._a=void 0,D)throw D.error})},b=function(I){if(I._h==1)return!1;for(var D,$=I._a||I._c,K=0;$.length>K;)if(D=$[K++],D.fail||!b(D.promise))return!1;return!0},d=function(I){L.call(u,function(){var D;M?G.emit("rejectionHandled",I):(D=u.onrejectionhandled)&&D({promise:I,reason:I._v})})},E=function(I){var D=this;D._d||(D._d=!0,D=D._w||D,D._v=I,D._s=2,D._a||(D._a=D._c.slice()),v(D,!0))},q=function(I){var D,$=this;if(!$._d){$._d=!0,$=$._w||$;try{if($===I)throw W("Promise can't be resolved itself");(D=h(I))?N(function(){var K={_w:$,_d:!1};try{D.call(I,p(q,K,1),p(E,K,1))}catch(B){E.call(K,B)}}):($._v=I,$._s=1,v($,!1))}catch(K){E.call({_w:$,_d:!1},K)}}};T||(U=function(I){S(this,U,H,"_h"),_(I),s.call(this);try{I(p(q,this,1),p(E,this,1))}catch(D){E.call(this,D)}},s=function(I){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)(U.prototype,{then:function(I,D){var $=x(P(this,U));return $.ok=typeof I!="function"||I,$.fail=typeof D=="function"&&D,$.domain=M?G.domain:void 0,this._c.push($),this._a&&this._a.push($),this._s&&v(this,!1),$.promise},catch:function(I){return this.then(void 0,I)}}),w=function(){var I=new s;this.promise=I,this.resolve=p(q,I,1),this.reject=p(E,I,1)}),m(m.G+m.W+m.F*!T,{Promise:U}),i(18)(U,H),i(59)(H),a=i(6)[H],m(m.S+m.F*!T,H,{reject:function(I){var D=x(this),$=D.reject;return $(I),D.promise}}),m(m.S+m.F*(c||!T),H,{resolve:function(I){if(I instanceof U&&l(I.constructor,this))return I;var D=x(this),$=D.resolve;return $(I),D.promise}}),m(m.S+m.F*!(T&&i(46)(function(I){U.all(I).catch(F)})),H,{all:function(I){var D=this,$=x(D),K=$.resolve,B=$.reject,me=g(function(){var ie=[],R=0,Y=1;A(I,!1,function(k){var j=R++,J=!1;ie.push(void 0),Y++,D.resolve(k).then(function(V){J||(J=!0,ie[j]=V,--Y||K(ie))},B)}),--Y||K(ie)});return me&&B(me.error),$.promise},race:function(I){var D=this,$=x(D),K=$.reject,B=g(function(){A(I,!1,function(me){D.resolve(me).then($.resolve,K)})});return B&&K(B.error),$.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"),u=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],p=0;p<5;p++){var f=u[p],m=s[f],y=m&&m.prototype;y&&!y[c]&&o(y,c,f),a[f]=a.Array}},function(t,n){t.exports=require("child_process")},function(t,n){t.exports=require("crypto")}])})});var b4={};Xr(b4,{startServer:()=>EO});module.exports=OO(b4);var zu=require("http"),Ku=require("child_process"),Ci=require("fs"),tr=require("path"),bO=require("url");var av=(r=0)=>e=>`\x1B[${e+r}m`,cv=(r=0)=>e=>`\x1B[${38+r};5;${e}m`,lv=(r=0)=>(e,t,n)=>`\x1B[${38+r};2;${e};${t};${n}m`,ye={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]}},S4=Object.keys(ye.modifier),PO=Object.keys(ye.color),MO=Object.keys(ye.bgColor),E4=[...PO,...MO];function IO(){let r=new Map;for(let[e,t]of Object.entries(ye)){for(let[n,i]of Object.entries(t))ye[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[n]=ye[n],r.set(i[0],i[1]);Object.defineProperty(ye,e,{value:t,enumerable:!1})}return Object.defineProperty(ye,"codes",{value:r,enumerable:!1}),ye.color.close="\x1B[39m",ye.bgColor.close="\x1B[49m",ye.color.ansi=av(),ye.color.ansi256=cv(),ye.color.ansi16m=lv(),ye.bgColor.ansi=av(10),ye.bgColor.ansi256=cv(10),ye.bgColor.ansi16m=lv(10),Object.defineProperties(ye,{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=>ye.rgbToAnsi256(...ye.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)=>ye.ansi256ToAnsi(ye.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>ye.ansi256ToAnsi(ye.hexToAnsi256(e)),enumerable:!1}}),ye}var NO=IO(),_r=NO;var Pa=X(require("node:process"),1),pv=X(require("node:os"),1),dp=X(require("node:tty"),1);function rr(r,e=globalThis.Deno?globalThis.Deno.args:Pa.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:_e}=Pa.default,Oa;rr("no-color")||rr("no-colors")||rr("color=false")||rr("color=never")?Oa=0:(rr("color")||rr("colors")||rr("color=true")||rr("color=always"))&&(Oa=1);function LO(){if("FORCE_COLOR"in _e)return _e.FORCE_COLOR==="true"?1:_e.FORCE_COLOR==="false"?0:_e.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(_e.FORCE_COLOR,10),3)}function DO(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function BO(r,{streamIsTTY:e,sniffFlags:t=!0}={}){let n=LO();n!==void 0&&(Oa=n);let i=t?Oa:n;if(i===0)return 0;if(t){if(rr("color=16m")||rr("color=full")||rr("color=truecolor"))return 3;if(rr("color=256"))return 2}if("TF_BUILD"in _e&&"AGENT_NAME"in _e)return 1;if(r&&!e&&i===void 0)return 0;let s=i||0;if(_e.TERM==="dumb")return s;if(Pa.default.platform==="win32"){let o=pv.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in _e)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>o in _e)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in _e)||_e.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in _e)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(_e.TEAMCITY_VERSION)?1:0;if(_e.COLORTERM==="truecolor"||_e.TERM==="xterm-kitty"||_e.TERM==="xterm-ghostty"||_e.TERM==="wezterm")return 3;if("TERM_PROGRAM"in _e){let o=Number.parseInt((_e.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(_e.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(_e.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(_e.TERM)||"COLORTERM"in _e?1:s}function uv(r,e={}){let t=BO(r,{streamIsTTY:r&&r.isTTY,...e});return DO(t)}var jO={stdout:uv({isTTY:dp.default.isatty(1)}),stderr:uv({isTTY:dp.default.isatty(2)})},fv=jO;function dv(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 hv(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
|
|
105
105
|
`:`
|
|
106
106
|
`)+t,i=n+1,n=r.indexOf(`
|
|
107
|
-
`,i)}while(n!==-1);return s+=r.slice(i),s}var{stdout:
|
|
108
|
-
`);return s!==-1&&(e=ev(e,i,n,s)),n+e+i};Object.defineProperties(Xs.prototype,Ti);var _O=Xs(),o4=Xs({level:rv?rv.level:0});var iv=_O;er();gt();Ri();var vb=X(gb(),1),{Server:xb,Namespace:tW,Socket:rW}=vb.default;var gR=require("fs"),vR=require("path");gt();var mt={control:"control",binary:"binary"},ft={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 cs=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=ft.idle}get state(){return this._state}get ready(){return this._state===ft.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 Vc=class extends cs{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?ft.open:ft.connecting),e.socket.on("connect",()=>this._setState(ft.open)),e.socket.on("disconnect",()=>this._setState(ft.closed)),e.socket.onAny?.((t,n)=>this._emit("message",{event:t,data:n,source:"ws"}))}disconnect(){this._socket=null,this._setState(ft.closed)}send(e,t){if(!this._socket?.connected)return!1;let n=this._socket._rawEmit||this._socket.emit.bind(this._socket);if(e===mt.control){let{event:i,args:s=[]}=t;return n(i,...s),!0}return e===mt.binary?(n("tiles-bin-v2",t),!0):!1}};var Cb=X(require("node-datachannel"),1);function m2(r,e){return e&&typeof e=="object"&&e.type==="Buffer"&&Array.isArray(e.data)?{__b:Buffer.from(e.data).toString("base64")}:e}function g2(r,e){return e&&typeof e=="object"&&typeof e.__b=="string"?Buffer.from(e.__b,"base64"):e}function _b(r){return JSON.stringify(r,m2)}function bb(r){return JSON.parse(typeof r=="string"?r:Buffer.from(r).toString("utf8"),g2)}yt();var Eb=X(require("node:dns/promises"),1),v2=3e4,x2=/\s([0-9a-f-]{8,}\.local)\s/i,Sb=new Map;async function y2(r){let e=Sb.get(r);if(e&&Date.now()-e.ts<v2)return e.ip;try{let{address:t}=await Eb.default.lookup(r);return Sb.set(r,{ip:t,ts:Date.now()}),t}catch{return null}}async function Tb(r){let e=r.match(x2);if(!e)return r;let t=await y2(e[1]);return t?r.replace(e[1],t):null}var{PeerConnection:_2}=Cb.default,b2=[{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:"),u=o.replace(/^turns?:/,"").split("?")[0],p=u.split(":")[0],f=parseInt(u.split(":")[1]||(a?"5349":"3478")),g=o.includes("transport=tcp")?"Tcp":"Udp";i.push({hostname:p,port:f,type:a?"Tls":"Turn",relayType:g,username:s.username,password:s.credential})}return i}catch(t){return console.error("[WebRtcProtocol] TURN fetch failed:",t.message),null}}var Xc=class extends cs{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=b2,this._refreshTimer=null,this._remoteSet=!1,this._pendingCandidates=[],this._signaling=null}async connect(e){this._ctx=e,this._setState(ft.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(ft.closed)}send(e,t){if(e===mt.control){if(!this._dcControl)return!1;try{return this._dcControl.sendMessage(_b({event:t.event,args:t.args||[],ackId:t.ackId||null})),!0}catch(n){return console.error("[WebRtcProtocol] send control:",n.message),!1}}if(e===mt.binary){if(!this._dcBinary)return!1;try{let n=Array.isArray(t)?t:[t],i=this._ctx.profile?.rtc?.dcMaxMessageSize??65536;for(let s of n)s.length<=i&&this._dcBinary.sendMessageBinary(s);return!0}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 Tb(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=[];let t=this._ctx?.auth?.socketId||"anon",n=new _2(`peer-${t}`,{iceServers:this._iceServers});n.onDataChannel(i=>{let s=i.getLabel?.()||"",o=()=>{s==="control"?this._dcControl=i:s==="binary"&&(this._dcBinary=i),this._dcControl&&this._dcBinary&&this._setState(ft.open)};i.onOpen(o),i.onClosed(()=>{s==="control"&&(this._dcControl=null),s==="binary"&&(this._dcBinary=null),!this._dcControl&&!this._dcBinary&&this._setState(ft.closed)}),i.onError(a=>console.error(`[WebRtcProtocol] DC[${s}] error:`,a)),i.onMessage(a=>{if(s!=="control")return;let c;try{c=bb(a)}catch(u){console.error("[WebRtcProtocol] control parse:",u.message);return}try{this._emit("message",{event:c.event,data:c,source:"rtc"})}catch(u){console.error(`[WebRtcProtocol] handler error event=${c.event}:`,u.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(){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,Z.logging?.webrtc&&console.log(`[WebRtcProtocol] TURN credentials loaded (${t.length} servers)`)),clearTimeout(this._refreshTimer),this._refreshTimer=setTimeout(()=>this._refreshTurn(e),e.turnRefreshInterval)}};var Ab=new Map;function Sd(r){if(!r?.id)throw new Error("Adapter missing static id");Ab.set(r.id,r)}function Rb(r){return Ab.get(r)}Cd();Sd(Vc);Sd(Xc);var Jc=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._adapters=new Map,this._listeners=new Map,this._buffer=[],this._rtcSignalingHandler=null,this._sigListeners=null}get type(){return this._pickAdapter(mt.binary)?.constructor.id==="rtc"?"dc":"ws"}async init(){for(let e of this._profile.enabled){let t=Rb(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(mt.binary),o=i??Date.now();if(s?.constructor.id==="rtc"&&t){let a=[];for(let c=0;c<n.length;c+=this._dcChunkSize)a.push(t(n.slice(c,c+this._dcChunkSize),o));s.send(mt.binary,a);return}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;for(let s=0;s<e.length;s+=i){let o=e.slice(s,s+i);n.send(mt.binary,ls(o,t))}}_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===ft.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}_sendControl(e,t,n){let i=this._pickAdapter(mt.control);if(!i){this._buffer.push({event:e,args:t,ackId:n});return}i.constructor.id==="rtc"?i.send(mt.control,{event:e,args:t,ackId:n}):i.send(mt.control,{event:e,args:t})}_flushBuffer(){if(!(!this._buffer.length||!this._pickAdapter(mt.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((...u)=>this._sendAck(o,u));let a=this._listeners.get(e);if(a)for(let u of a)u(...s);let c=this._socket.listeners?.(e)||[];for(let u of c)u(...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(mt.control,{event:"__ack",args:t,ackId:e})}_sendSignaling(e){let t=this._adapters.get("ws");if(t?.ready){t.send(mt.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)}};var Ad=new Set;function Ob(r){Ad.add(r)}function Qc(r){Ad.delete(r)}function Cr(r,e,t){for(let n of Ad)try{n.emit(e,t)}catch{}}yt();var pT=require("path"),fT=require("url");var kd=X(require("net"),1),fe=X(require("fs"),1),Ae=X(require("path"),1),Ib=X(require("os"),1),Nb=require("child_process"),Lb=require("url"),rl=Ae.default.dirname((0,Lb.fileURLToPath)(__importMetaUrl)),Dn=Ae.default.join(Ib.default.homedir(),".9remote"),Zc=process.platform==="win32"?"\\\\.\\pipe\\9remote-pty":Ae.default.join(Dn,"pty-daemon.sock"),Pb=Ae.default.join(rl,"ptyDaemon.js"),Mb=Ae.default.join(rl,"ptyDaemon.cjs"),el=Ae.default.join(Dn,"daemon");function E2(){return"2.0.22"}function Db(r,e){if(fe.default.existsSync(r)){fe.default.mkdirSync(e,{recursive:!0});for(let t of fe.default.readdirSync(r,{withFileTypes:!0})){let n=Ae.default.join(r,t.name),i=Ae.default.join(e,t.name);t.isDirectory()?Db(n,i):t.isFile()&&fe.default.copyFileSync(n,i)}}}function T2(r){let e=r;for(let t=0;t<6;t++){let n=Ae.default.join(e,"node_modules","node-pty");if(fe.default.existsSync(n))return n;let i=Ae.default.dirname(e);if(i===e)break;e=i}return null}function C2(r){try{if(!fe.default.existsSync(el))return;let e=Ae.default.join(Dn,"pids","ptyDaemon.pid"),t=!1;try{let n=parseInt(fe.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 fe.default.readdirSync(el))if(n!==`v${r}`)try{fe.default.rmSync(Ae.default.join(el,n),{recursive:!0,force:!0})}catch{}}catch{}}function A2(r){let e=E2();C2(e);let t=Ae.default.join(el,`v${e}`),n=Ae.default.join(t,Ae.default.basename(r)),i=Ae.default.join(t,"node_modules","node-pty");if(fe.default.existsSync(n)&&fe.default.existsSync(i))return{script:n,cwd:t};try{fe.default.mkdirSync(t,{recursive:!0}),fe.default.copyFileSync(r,n);let s=T2(Ae.default.dirname(r));return s?(Db(s,i),{script:n,cwd:t}):null}catch{return null}}var Hr=null,us=!1,Ln=!1,Rd="",R2=0,ps=new Map,tl=new Map;function k2(){return++R2}function nl(r,e){tl.has(r)||tl.set(r,[]),tl.get(r).push(e)}function To(r,e){let t=tl.get(r);if(t)for(let n of t)try{n(e)}catch(i){console.error(`[DaemonClient] Error in ${r} handler:`,i)}}function Od(r){if(!Hr||!us)return!1;try{return Hr.write(JSON.stringify(r)+`
|
|
109
|
-
`),!0}catch(e){return console.error("[DaemonClient] Send error:",e),!1}}function
|
|
110
|
-
`);Rd=n.pop()||"";for(let i of n)if(i.trim())try{O2(JSON.parse(i))}catch{console.error("[DaemonClient] Invalid message:",i)}}),Hr.on("close",()=>{us=!1,Hr=null,To("disconnected"),setTimeout(()=>{!us&&!Ln&&jb()},2e3)}),Hr.on("error",t=>{clearTimeout(e),console.error("[DaemonClient] \u274C Connection error:",t.message),console.error("[DaemonClient] Error code:",t.code),Ln=!1,r(!1)})})}catch(r){return console.error("[DaemonClient] \u274C Connect error:",r),Ln=!1,!1}}}async function Fb(){return jb()}function Ar(){return us}async function Hb(){return(await Co({type:"listSessions"})).sessions||[]}async function $b(r,e=80,t=24,n=null){let i=`session-${Date.now()}`;return await Co({type:"createSession",sessionId:i,name:r,cols:e,rows:t,shellId:n})}async function qb(r){return await Co({type:"joinSession",sessionId:r})}function Pd(r,e){return Od({type:"input",sessionId:r,data:e})}function Ub(r,e,t){return Od({type:"resize",sessionId:r,cols:e,rows:t})}async function Wb(r){return await Co({type:"deleteSession",sessionId:r})}async function Gb(r,e){return await Co({type:"renameSession",sessionId:r,name:e})}Ri();var Kb=require("child_process");yt();var I2={darwin:()=>({cmd:"caffeinate",args:["-u","-t",String(Z.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)`]})},zb=0;function Vb(){let r=Z.displayWake;if(!r?.enabled)return;let e=Date.now();if(e-zb<r.throttleMs)return;zb=e;let t=I2[process.platform];if(t)try{let{cmd:n,args:i}=t(),s=(0,Kb.spawn)(n,i,{detached:!0,stdio:"ignore",windowsHide:!0});s.on("error",()=>{}),s.unref()}catch{}}var rS=En("remote"),hn=null;function uB(){return process.env.CODESPACES==="true"||process.env.GITPOD_WORKSPACE_ID||process.platform==="linux"&&!process.env.DISPLAY}async function aS(){if(hn!==null)return hn;if(uB())return hn=!1,rS.info("\u2705 Remote desktop not available (headless environment)"),hn;try{let r=await import("@hurdlegroup/robotjs");(r.default||r).getScreenSize(),hn=!0}catch{hn=!1,rS.info("\u2705 Remote desktop not available (no display or robotjs not installed)")}return hn}function cS(){return hn===!0}var li=null,lS=null,uS=null,pS=null,fS=null,dS=null,hS=null,dn=null,nS=null,iS=null,sS=null,oS=null;async function pB(){if(li)return!0;try{let r=await import("@hurdlegroup/robotjs");li=r.default||r;let{TileManager:e}=await Promise.resolve().then(()=>(zw(),Gw)),{ResourceManager:t}=await Promise.resolve().then(()=>(Vw(),Kw)),{ScreenUpdateHelper:n}=await Promise.resolve().then(()=>(Xw(),Yw)),{MouseHandler:i}=await Promise.resolve().then(()=>(Qw(),Jw)),{KeyboardHandler:s}=await Promise.resolve().then(()=>(tS(),eS)),{ScreenHandler:o}=await Promise.resolve().then(()=>(Cd(),kb));return lS=e,uS=t,pS=n,fS=i,dS=s,hS=o,li.setMouseDelay(2),li.setKeyboardDelay(2),!0}catch(r){return console.error("\u274C Failed to load remote modules:",r.message),!1}}async function mS(r,e){if(!hn){r.emit("remote:unavailable");return}if(!await pB()){r.emit("remote:unavailable");return}dn||(dn=new uS,nS=new pS(dn),iS=new fS(li,dn),sS=new dS(li,dn),oS=new hS(dn,nS),dn.startResourceMonitoring());let n=r.handshake.auth?.apiKey,i=new lS(li);dn.addClient(r.id,{tileManager:i,screenInterval:null,authenticated:!0,apiKey:n});let s=r.data.protocol;if(!s){r.emit("remote:unavailable");return}r.data.remoteAttached=!0;let o=a=>(...c)=>(Vb(),a(...c));iS.setupMouseHandlers(r,o),sS.setupKeyboardHandlers(r,o),oS.setupScreenHandlers(r,o,s),r.on("disconnect",()=>{let a=()=>{dn.removeClient(r.id),s.close(),Qc(s)},c=s._adapters?.get("rtc");if(!c?.ready)return a();c.on("stateChange",u=>{u===ft.closed&&a()})}),r.emit("remote:ready")}ci();var Fn=X(require("fs"),1),sh=X(require("path"),1),_l=0,Fo=null,fB=6e4,dB={name:"9Remote",postCreateCommand:"npm install -g 9remote@latest",postAttachCommand:"9remote start",forwardPorts:[2208],portsAttributes:{2208:{label:"9Remote Server",onAutoForward:"notify"}}};function mn(){return process.env.CODESPACES==="true"}function gS(){return mn()?{isCodespaces:!0,codespaceName:process.env.CODESPACE_NAME||"unknown",workspacePath:process.env.CODESPACE_VSCODE_FOLDER||process.cwd()}:null}function vS(){_l++,mn()&&_l===1&&hB()}function xS(){_l--,mn()&&_l===0&&mB()}function hB(){Fo||(Fo=setInterval(()=>{process.memoryUsage()},fB))}function mB(){Fo&&(console.log("\u23F8\uFE0F Stopping Codespaces heartbeat"),clearInterval(Fo),Fo=null)}function yS(r){return sh.default.join(r,".devcontainer","devcontainer.json")}function _S(r){try{let e=yS(r);if(!Fn.default.existsSync(e))return{enabled:!1,exists:!1};let t=JSON.parse(Fn.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 bS(r,e){try{let t=sh.default.join(r,".devcontainer"),n=yS(r);Fn.default.existsSync(t)||Fn.default.mkdirSync(t,{recursive:!0});let i={...dB};if(Fn.default.existsSync(n))try{i={...JSON.parse(Fn.default.readFileSync(n,"utf8"))}}catch{}return e?(i.postAttachCommand="9remote start",i.postCreateCommand||(i.postCreateCommand="npm install -g 9remote@latest")):delete i.postAttachCommand,Fn.default.writeFileSync(n,JSON.stringify(i,null,2)),{success:!0,enabled:e}}catch(t){return{success:!1,error:t.message}}}var bl=X(require("os"),1),wt=X(require("fs"),1),xs=X(require("path"),1);gt();var vs=oe.BUFFERS,wl=xs.default.join(oe.STATE,"sessions.json"),Sl="/tmp/9remote-uploads";wt.default.existsSync(Sl)||wt.default.mkdirSync(Sl,{recursive:!0});function oh(){return process.platform==="win32"?process.env.COMSPEC||"powershell.exe":process.env.SHELL||"/bin/zsh"}function ah(r){return r?"/workspaces":bl.default.homedir()}function ch(){let r=bl.default.homedir(),e=bl.default.userInfo().username,t=oh(),n={...process.env};if(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 wS(){wt.default.existsSync(vs)||wt.default.mkdirSync(vs,{recursive:!0})}function lh(r,e,t){if(t==="buffer"){wS();try{wt.default.writeFileSync(xs.default.join(vs,`${r}.buf`),e.join(""),"utf8")}catch(n){console.log(`\u26A0\uFE0F Failed to save buffer for ${r}:`,n.message)}}}function SS(r,e){if(e!=="buffer")return null;let t=xs.default.join(vs,`${r}.buf`);try{if(wt.default.existsSync(t))return wt.default.readFileSync(t,"utf8")}catch(n){console.log(`\u26A0\uFE0F Failed to load buffer for ${r}:`,n.message)}return null}function uh(r){let e=xs.default.join(vs,`${r}.buf`);try{wt.default.existsSync(e)&&wt.default.unlinkSync(e)}catch{}}function ES(){wS();try{return wt.default.readdirSync(vs).filter(r=>r.endsWith(".buf")).map(r=>r.replace(".buf",""))}catch{return[]}}function TS(){try{if(wt.default.existsSync(wl))return JSON.parse(wt.default.readFileSync(wl,"utf8"))}catch(r){console.log("\u26A0\uFE0F Failed to load session metadata:",r.message)}return{}}function ph(r){try{let e={};for(let[n,i]of r)e[n]={name:i.name,createdAt:i.createdAt};let t=xs.default.dirname(wl);wt.default.existsSync(t)||wt.default.mkdirSync(t,{recursive:!0}),wt.default.writeFileSync(wl,JSON.stringify(e,null,2),"utf8")}catch(e){console.log("\u26A0\uFE0F Failed to save session metadata:",e.message)}}var dh=X(require("node-pty"),1);var fh={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 CS(){return process.platform==="win32"?fh.win32:[]}function AS(r){if(process.platform==="win32"){let n=r?fh.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:[]}:fh.win32[0]}let e=process.env.SHELL||"/bin/bash",t=e.split("/").pop();return{id:t,label:t,path:e,args:["-l"]}}var gB=50*1024,ui="daemon";function RS(r,e,t,n,i){let s=null;r.onData(o=>{t.buffer.push(o);let a=t.buffer.reduce((c,u)=>c+u.length,0);for(;a>gB&&t.buffer.length>1;)a-=t.buffer.shift().length;Cr(n,"output",{sessionId:e,data:Buffer.from(o,"utf-8")}),ui==="buffer"&&(s&&clearTimeout(s),s=setTimeout(()=>lh(e,t.buffer,ui),2e3))}),r.onExit(({exitCode:o})=>{console.log(`PTY exited: sessionId=${e}, code=${o}`),ui==="buffer"&&t.buffer.length>0&&lh(e,t.buffer,ui),i.delete(e),uh(e),Cr(n,"sessionClosed",e)})}function kS(r,e,t){r.on("getSessions",n=>{let i=[];for(let[s,o]of t)i.push({id:s,name:o.name,createdAt:o.createdAt,restored:o.restored||!1,shellId:o.shellId,shellLabel:o.shellLabel});n(i)}),r.on("getShells",n=>{n({platform:process.platform,shells:CS()})}),r.on("createSession",async({name:n,shellId:i},s)=>{let o=`session-${Date.now()}`,a=AS(i),c=ch();c.NINE_REMOTE_SESSION_ID=o;let u=ah(mn());try{let p=n||`${a.label} ${t.size+1}`;if(ui==="daemon"&&Ar()){let y=await $b(p,80,24,i);y.success?(t.set(y.sessionId,{daemon:!0,name:p,createdAt:Date.now(),cwd:y.cwd,shellId:y.shellId,shellLabel:y.shellLabel}),s({success:!0,sessionId:y.sessionId,shellLabel:y.shellLabel})):s({success:!1,error:y.error});return}let f=dh.default.spawn(a.path,a.args,{name:"xterm-256color",cols:80,rows:24,cwd:u,env:c,useConpty:!1}),g={pty:f,name:p,createdAt:Date.now(),buffer:[],cwd:u,shellId:a.id,shellLabel:a.label};RS(f,o,g,e,t),t.set(o,g),s({success:!0,sessionId:o,shellLabel:a.label})}catch(p){console.error("Failed to create session:",p),s({success:!1,error:p.message})}}),r.on("joinSession",async(n,i)=>{let s=t.get(n);if(!s)return i({success:!1,error:"Session not found"});if(s.daemon&&Ar()){try{let o=await qb(n);i({success:o.success,name:o.name,cwd:o.cwd,error:o.error})}catch(o){i({success:!1,error:o.message})}return}if(s.needsRestore&&ui==="buffer")try{let o=oh(),a=process.platform==="win32"?[]:["-l"],c=ah(mn()),u=dh.default.spawn(o,a,{name:"xterm-256color",cols:80,rows:24,cwd:c,env:ch(),useConpty:!1});s.pty=u,s.needsRestore=!1,s.cwd=c;let p=SS(n,ui);p&&(s.buffer=[p]),RS(u,n,s,e,t),console.log(`\u2705 Restored PTY session: ${n}`)}catch(o){return console.error("Failed to restore session:",o),i({success:!1,error:"Failed to restore session"})}s.buffer?.length>0&&r.emit("output",{sessionId:n,data:Buffer.from(s.buffer.join(""),"utf-8")}),i({success:!0,name:s.name,cwd:s.cwd})}),r.on("deleteSession",async(n,i)=>{let s=t.get(n);if(!s)return i({success:!1,error:"Session not found"});if(s.daemon&&Ar()){try{await Wb(n),t.delete(n),i({success:!0})}catch(o){i({success:!1,error:o.message})}return}s.pty&&s.pty.kill(),t.delete(n),uh(n),Cr(e,"sessionClosed",n),ph(t),i({success:!0})}),r.on("renameSession",async({sessionId:n,name:i},s)=>{let o=t.get(n);if(!o)return s({success:!1,error:"Session not found"});if(o.daemon&&Ar()){try{await Gb(n,i),o.name=i,s({success:!0})}catch(a){s({success:!1,error:a.message})}return}o.name=i,Cr(e,"session-renamed",{sessionId:n,name:i}),ph(t),s({success:!0})})}var OS=X(require("fs"),1),PS=X(require("path"),1);function MS(r,e){r.on("input",({sessionId:t,data:n})=>{if(!t)return;let i=e.get(t);if(i){if(i.daemon&&Ar())return Pd(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&&Ar())return Ub(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=PS.default.join(Sl,`${Date.now()}_${a}`);OS.default.writeFileSync(c,Buffer.from(s,"base64")),console.log(`\u{1F4CE} File uploaded: ${c} (${i} bytes)`),o.daemon&&Ar()?Pd(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
|
|
107
|
+
`,i)}while(n!==-1);return s+=r.slice(i),s}var{stdout:mv,stderr:gv}=fv,hp=Symbol("GENERATOR"),Ai=Symbol("STYLER"),Xs=Symbol("IS_EMPTY"),vv=["ansi","ansi","ansi256","ansi16m"],Ri=Object.create(null),FO=(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=mv?mv.level:0;r.level=e.level===void 0?t:e.level};var HO=r=>{let e=(...t)=>t.join(" ");return FO(e,r),Object.setPrototypeOf(e,Js.prototype),e};function Js(r){return HO(r)}Object.setPrototypeOf(Js.prototype,Function.prototype);for(let[r,e]of Object.entries(_r))Ri[r]={get(){let t=Ma(this,gp(e.open,e.close,this[Ai]),this[Xs]);return Object.defineProperty(this,r,{value:t}),t}};Ri.visible={get(){let r=Ma(this,this[Ai],!0);return Object.defineProperty(this,"visible",{value:r}),r}};var mp=(r,e,t,...n)=>r==="rgb"?e==="ansi16m"?_r[t].ansi16m(...n):e==="ansi256"?_r[t].ansi256(_r.rgbToAnsi256(...n)):_r[t].ansi(_r.rgbToAnsi(...n)):r==="hex"?mp("rgb",e,t,..._r.hexToRgb(...n)):_r[t][r](...n),$O=["rgb","hex","ansi256"];for(let r of $O){Ri[r]={get(){let{level:t}=this;return function(...n){let i=gp(mp(r,vv[t],"color",...n),_r.color.close,this[Ai]);return Ma(this,i,this[Xs])}}};let e="bg"+r[0].toUpperCase()+r.slice(1);Ri[e]={get(){let{level:t}=this;return function(...n){let i=gp(mp(r,vv[t],"bgColor",...n),_r.bgColor.close,this[Ai]);return Ma(this,i,this[Xs])}}}}var qO=Object.defineProperties(()=>{},{...Ri,level:{enumerable:!0,get(){return this[hp].level},set(r){this[hp].level=r}}}),gp=(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}},Ma=(r,e,t)=>{let n=(...i)=>UO(n,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(n,qO),n[hp]=r,n[Ai]=e,n[Xs]=t,n},UO=(r,e)=>{if(r.level<=0||!e)return r[Xs]?"":e;let t=r[Ai];if(t===void 0)return e;let{openAll:n,closeAll:i}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=dv(e,t.close,t.open),t=t.parent;let s=e.indexOf(`
|
|
108
|
+
`);return s!==-1&&(e=hv(e,i,n,s)),n+e+i};Object.defineProperties(Js.prototype,Ri);var WO=Js(),P4=Js({level:gv?gv.level:0});var xv=WO;Gt();gt();Pi();var Ib=X(Mb(),1),{Server:Nb,Namespace:CW,Socket:AW}=Ib.default;var BR=require("fs"),jR=require("path");gt();el();var vt={control:"control",binary:"binary"},ft={idle:"idle",connecting:"connecting",open:"open",degraded:"degraded",closed:"closed"},jb={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 ps=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=ft.idle}get state(){return this._state}get ready(){return this._state===ft.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 tl=class extends ps{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?ft.open:ft.connecting),e.socket.on("connect",()=>this._setState(ft.open)),e.socket.on("disconnect",()=>this._setState(ft.closed)),e.socket.onAny?.((t,n)=>this._emit("message",{event:t,data:n,source:"ws"}))}disconnect(){this._socket=null,this._setState(ft.closed)}send(e,t){if(!this._socket?.connected)return!1;let n=this._socket._rawEmit||this._socket.emit.bind(this._socket);if(e===vt.control){let{event:i,args:s=[]}=t;return n(i,...s),!0}return e===vt.binary?(n("tiles-bin-v2",t),!0):!1}};var Gb=X(require("node-datachannel"),1);function F2(r,e){return e&&typeof e=="object"&&e.type==="Buffer"&&Array.isArray(e.data)?{__b:Buffer.from(e.data).toString("base64")}:e}function H2(r,e){return e&&typeof e=="object"&&typeof e.__b=="string"?Buffer.from(e.__b,"base64"):e}function Fb(r){return JSON.stringify(r,F2)}function Hb(r){return JSON.parse(typeof r=="string"?r:Buffer.from(r).toString("utf8"),H2)}bt();var Ub=X(require("node:dns/promises"),1),$2=3e4,q2=/\s([0-9a-f-]{8,}\.local)\s/i,qb=new Map;async function U2(r){let e=qb.get(r);if(e&&Date.now()-e.ts<$2)return e.ip;try{let{address:t}=await Ub.default.lookup(r);return qb.set(r,{ip:t,ts:Date.now()}),t}catch{return null}}async function Wb(r){let e=r.match(q2);if(!e)return r;let t=await U2(e[1]);return t?r.replace(e[1],t):null}var{PeerConnection:W2}=Gb.default,G2=[{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 z2(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:"),u=o.replace(/^turns?:/,"").split("?")[0],p=u.split(":")[0],f=parseInt(u.split(":")[1]||(a?"5349":"3478")),m=o.includes("transport=tcp")?"Tcp":"Udp";i.push({hostname:p,port:f,type:a?"Tls":"Turn",relayType:m,username:s.username,password:s.credential})}return i}catch(t){return console.error("[WebRtcProtocol] TURN fetch failed:",t.message),null}}var nl=class extends ps{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=G2,this._refreshTimer=null,this._remoteSet=!1,this._pendingCandidates=[],this._signaling=null}async connect(e){this._ctx=e,this._setState(ft.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(ft.closed)}send(e,t){if(e===vt.control){if(!this._dcControl)return!1;try{return this._dcControl.sendMessage(Fb({event:t.event,args:t.args||[],ackId:t.ackId||null})),!0}catch(n){return console.error("[WebRtcProtocol] send control:",n.message),!1}}if(e===vt.binary){if(!this._dcBinary)return!1;try{let n=Array.isArray(t)?t:[t],i=this._ctx.profile?.rtc?.dcMaxMessageSize??65536;for(let s of n)s.length<=i&&this._dcBinary.sendMessageBinary(s);return!0}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 Wb(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=[];let t=this._ctx?.auth?.socketId||"anon",n=new W2(`peer-${t}`,{iceServers:this._iceServers});n.onDataChannel(i=>{let s=i.getLabel?.()||"",o=()=>{s==="control"?this._dcControl=i:s==="binary"&&(this._dcBinary=i),this._dcControl&&this._dcBinary&&this._setState(ft.open)};i.onOpen(o),i.onClosed(()=>{s==="control"&&(this._dcControl=null),s==="binary"&&(this._dcBinary=null),!this._dcControl&&!this._dcBinary&&this._setState(ft.closed)}),i.onError(a=>console.error(`[WebRtcProtocol] DC[${s}] error:`,a)),i.onMessage(a=>{if(s!=="control")return;let c;try{c=Hb(a)}catch(u){console.error("[WebRtcProtocol] control parse:",u.message);return}try{this._emit("message",{event:c.event,data:c,source:"rtc"})}catch(u){console.error(`[WebRtcProtocol] handler error event=${c.event}:`,u.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(){try{this._pc?.close()}catch{}this._pc=null,this._dcControl=null,this._dcBinary=null}async _refreshTurn(e){let t=await z2(e.turnApiUrl,this._ctx.auth.apiKey);t?.length&&(this._iceServers=t,Z.logging?.webrtc&&console.log(`[WebRtcProtocol] TURN credentials loaded (${t.length} servers)`)),clearTimeout(this._refreshTimer),this._refreshTimer=setTimeout(()=>this._refreshTurn(e),e.turnRefreshInterval)}};var zb=new Map;function jd(r){if(!r?.id)throw new Error("Adapter missing static id");zb.set(r.id,r)}function Kb(r){return zb.get(r)}$d();jd(tl);jd(nl);var il=class{constructor(e,t){let n=t.enableWebRTC?"remoteDesktop":"clientApp",i={...jb[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._adapters=new Map,this._listeners=new Map,this._buffer=[],this._rtcSignalingHandler=null,this._sigListeners=null}get type(){return this._pickAdapter(vt.binary)?.constructor.id==="rtc"?"dc":"ws"}async init(){for(let e of this._profile.enabled){let t=Kb(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(vt.binary),o=i??Date.now();if(s?.constructor.id==="rtc"&&t){let a=[];for(let c=0;c<n.length;c+=this._dcChunkSize)a.push(t(n.slice(c,c+this._dcChunkSize),o));s.send(vt.binary,a);return}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;for(let s=0;s<e.length;s+=i){let o=e.slice(s,s+i);n.send(vt.binary,fs(o,t))}}_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===ft.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}_sendControl(e,t,n){let i=this._pickAdapter(vt.control);if(!i){this._buffer.push({event:e,args:t,ackId:n});return}i.constructor.id==="rtc"?i.send(vt.control,{event:e,args:t,ackId:n}):i.send(vt.control,{event:e,args:t})}_flushBuffer(){if(!(!this._buffer.length||!this._pickAdapter(vt.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((...u)=>this._sendAck(o,u));let a=this._listeners.get(e);if(a)for(let u of a)u(...s);let c=this._socket.listeners?.(e)||[];for(let u of c)u(...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(vt.control,{event:"__ack",args:t,ackId:e})}_sendSignaling(e){let t=this._adapters.get("ws");if(t?.ready){t.send(vt.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)}};var qd=new Set;function Yb(r){qd.add(r)}function sl(r){qd.delete(r)}function wt(r,e,t){for(let n of qd)try{n.emit(e,t)}catch{}}bt();var OT=require("path"),PT=require("url");var pl=X(require("net"),1),ae=X(require("fs"),1),pe=X(require("path"),1),ew=X(require("os"),1),tw=require("child_process"),rw=require("url");var Ud={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 Xb(){return process.platform==="win32"?Ud.win32:[]}function Jb(r){if(process.platform==="win32"){let n=r?Ud.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:[]}:Ud.win32[0]}let e=process.env.SHELL||"/bin/bash",t=e.split("/").pop();return{id:t,label:t,path:e,args:["-l"]}}var Gd=pe.default.dirname((0,rw.fileURLToPath)(__importMetaUrl)),fn=pe.default.join(ew.default.homedir(),".9remote"),Ro=process.platform==="win32"?"\\\\.\\pipe\\9remote-pty":pe.default.join(fn,"pty-daemon.sock"),Qb=pe.default.join(Gd,"ptyDaemon.js"),Zb=pe.default.join(Gd,"ptyDaemon.cjs"),ol=pe.default.join(fn,"daemon");function nw(r,e){if(ae.default.existsSync(r)){ae.default.mkdirSync(e,{recursive:!0});for(let t of ae.default.readdirSync(r,{withFileTypes:!0})){let n=pe.default.join(r,t.name),i=pe.default.join(e,t.name);t.isDirectory()?nw(n,i):t.isFile()&&ae.default.copyFileSync(n,i)}}}function V2(r,e){let t=r;for(let n=0;n<6;n++){let i=pe.default.join(t,"node_modules",e);if(ae.default.existsSync(i))return i;let s=pe.default.dirname(t);if(s===t)break;t=s}return null}var Y2=r=>V2(r,"node-pty");function X2(r){try{if(!ae.default.existsSync(ol))return;let e=pe.default.join(fn,"pids","ptyDaemon.pid"),t=!1;try{let n=parseInt(ae.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 ae.default.readdirSync(ol))if(n!==`v${r}`)try{ae.default.rmSync(pe.default.join(ol,n),{recursive:!0,force:!0})}catch{}}catch{}}function J2(r){X2("17");let e=pe.default.join(ol,`v${"17"}`),t=r.endsWith(".js"),n=t?pe.default.join(e,"features","terminal"):e,i=pe.default.join(n,pe.default.basename(r)),s=pe.default.join(n,"node_modules","node-pty");if(ae.default.existsSync(i)&&ae.default.existsSync(s))return{script:i,cwd:n};try{if(ae.default.mkdirSync(n,{recursive:!0}),ae.default.copyFileSync(r,i),t){let a=pe.default.dirname(r);ae.default.copyFileSync(pe.default.join(a,"constants.js"),pe.default.join(n,"constants.js"));let c=pe.default.join(e,"lib");ae.default.mkdirSync(c,{recursive:!0}),ae.default.copyFileSync(pe.default.resolve(a,"..","..","lib","constants.js"),pe.default.join(c,"constants.js"))}let o=Y2(pe.default.dirname(r));return o?(nw(o,s),{script:i,cwd:n}):null}catch{return null}}var Fr=null,ds=!1,jn=!1,Wd="",Q2=0,hs=new Map,al=new Map;function Z2(){return++Q2}function fl(r,e){al.has(r)||al.set(r,[]),al.get(r).push(e)}function ll(r,e){let t=al.get(r);if(t)for(let n of t)try{n(e)}catch(i){console.error(`[DaemonClient] Error in ${r} handler:`,i)}}function zd(r){if(!Fr||!ds)return!1;try{return Fr.write(JSON.stringify(r)+`
|
|
109
|
+
`),!0}catch(e){return console.error("[DaemonClient] Send error:",e),!1}}function dl(r,e=5e3){return new Promise((t,n)=>{let i=Z2();r.requestId=i;let s=setTimeout(()=>{hs.delete(i),n(new Error("Request timeout"))},e);hs.set(i,{resolve:t,reject:n,timer:s}),zd(r)||(clearTimeout(s),hs.delete(i),n(new Error("Not connected to daemon")))})}function eB(r){let{type:e,requestId:t,...n}=r;if(t&&hs.has(t)){let{resolve:i,timer:s}=hs.get(t);clearTimeout(s),hs.delete(t),i({type:e,...n});return}switch(e){case"output":ll("output",{sessionId:n.sessionId,data:Buffer.from(n.data,"base64")});break;case"sessionClosed":ll("sessionClosed",n.sessionId);break;case"pong":break;default:console.log("[DaemonClient] Unknown message:",e)}}function ul(){return new Promise(r=>{let e=pl.default.connect(Ro),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"&&ae.default.existsSync(Ro))try{ae.default.unlinkSync(Ro)}catch{}r(!1)})})}function tB(){ae.default.existsSync(fn)||ae.default.mkdirSync(fn,{recursive:!0});let r=ae.default.existsSync(Qb)?Qb:ae.default.existsSync(Zb)?Zb:null;if(!r)return console.error("[DaemonClient] \u274C Daemon script not found"),null;let e=J2(r);return e||{script:r,cwd:Gd}}async function rB(){if(!ae.default.existsSync(fn))try{ae.default.mkdirSync(fn,{recursive:!0})}catch(a){return console.error("[DaemonClient] Failed to create socket directory:",a.message),!1}let r=tB();if(!r)return!1;let{script:e,cwd:t}=r,n=pe.default.join(fn,"logs");try{ae.default.mkdirSync(n,{recursive:!0})}catch{}let i=pe.default.join(n,"daemon.log"),s;try{s=ae.default.openSync(i,"w")}catch(a){console.error("[DaemonClient] Failed to open log file:",a.message),s="ignore"}if((0,tw.spawn)("node",[e],{detached:!0,stdio:["ignore",s,s],cwd:t}).unref(),typeof s=="number")try{ae.default.closeSync(s)}catch{}for(let a=0;a<20;a++)if(await new Promise(c=>setTimeout(c,100)),await ul())return!0;console.error("[DaemonClient] \u274C Failed to start daemon");try{let a=ae.default.readFileSync(i,"utf8");a.trim()&&(console.error("[DaemonClient] Daemon log:"),console.error(a))}catch{}return!1}function nB(){return new Promise(r=>{let e=pl.default.connect(Ro),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})+`
|
|
110
|
+
`)),e.on("data",s=>{t+=s.toString();let o=t.indexOf(`
|
|
111
|
+
`);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 iB(){try{let r=pe.default.join(fn,"pids","ptyDaemon.pid"),e=parseInt(ae.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 ul())return;await new Promise(e=>setTimeout(e,100))}}async function iw(){if(!(ds||jn)){jn=!0;try{if(await ul()){let r=await nB();r!=="17"&&(console.log(`[DaemonClient] Daemon v${r} != v${"17"}, restarting`),await iB())}return!await ul()&&!await rB()?(console.error("[DaemonClient] \u274C Failed to start daemon"),jn=!1,!1):new Promise(r=>{let e=setTimeout(()=>{console.error("[DaemonClient] \u274C Connection timeout after 5s"),Fr&&Fr.destroy(),jn=!1,r(!1)},5e3);Fr=pl.default.connect(Ro),Fr.on("connect",()=>{clearTimeout(e),ds=!0,jn=!1,ll("connected"),r(!0)}),Fr.on("data",t=>{Wd+=t.toString();let n=Wd.split(`
|
|
112
|
+
`);Wd=n.pop()||"";for(let i of n)if(i.trim())try{eB(JSON.parse(i))}catch{console.error("[DaemonClient] Invalid message:",i)}}),Fr.on("close",()=>{ds=!1,Fr=null,ll("disconnected"),setTimeout(()=>{!ds&&!jn&&iw()},2e3)}),Fr.on("error",t=>{clearTimeout(e),console.error("[DaemonClient] \u274C Connection error:",t.message),console.error("[DaemonClient] Error code:",t.code),jn=!1,r(!1)})})}catch(r){return console.error("[DaemonClient] \u274C Connect error:",r),jn=!1,!1}}}async function sw(){return iw()}function Cr(){return ds}async function hl(){return(await dl({type:"listSessions"})).sessions||[]}async function Kd(r,e=80,t=24,n=null,i=`session-${Date.now()}`,s=null){return await dl({type:"createSession",sessionId:i,name:r,cols:e,rows:t,shellId:n,cwd:s})}async function ow(r){return await dl({type:"joinSession",sessionId:r})}function Vd(r,e){return zd({type:"input",sessionId:r,data:e})}function aw(r,e,t){return zd({type:"resize",sessionId:r,cols:e,rows:t})}async function ui(r){return await dl({type:"deleteSession",sessionId:r})}Pi();var lw=require("child_process");bt();var sB={darwin:()=>({cmd:"caffeinate",args:["-u","-t",String(Z.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)`]})},cw=0;function uw(){let r=Z.displayWake;if(!r?.enabled)return;let e=Date.now();if(e-cw<r.throttleMs)return;cw=e;let t=sB[process.platform];if(t)try{let{cmd:n,args:i}=t(),s=(0,lw.spawn)(n,i,{detached:!0,stdio:"ignore",windowsHide:!0});s.on("error",()=>{}),s.unref()}catch{}}var yS=An("remote"),mn=null;function DB(){return process.env.CODESPACES==="true"||process.env.GITPOD_WORKSPACE_ID||process.platform==="linux"&&!process.env.DISPLAY}async function ES(){if(mn!==null)return mn;if(DB())return mn=!1,yS.info("\u2705 Remote desktop not available (headless environment)"),mn;try{let r=await import("@hurdlegroup/robotjs");(r.default||r).getScreenSize(),mn=!0}catch{mn=!1,yS.info("\u2705 Remote desktop not available (no display or robotjs not installed)")}return mn}function TS(){return mn===!0}var di=null,CS=null,AS=null,RS=null,kS=null,OS=null,PS=null,hn=null,_S=null,bS=null,wS=null,SS=null;async function BB(){if(di)return!0;try{let r=await import("@hurdlegroup/robotjs");di=r.default||r;let{TileManager:e}=await Promise.resolve().then(()=>(lS(),cS)),{ResourceManager:t}=await Promise.resolve().then(()=>(pS(),uS)),{ScreenUpdateHelper:n}=await Promise.resolve().then(()=>(dS(),fS)),{MouseHandler:i}=await Promise.resolve().then(()=>(mS(),hS)),{KeyboardHandler:s}=await Promise.resolve().then(()=>(xS(),vS)),{ScreenHandler:o}=await Promise.resolve().then(()=>($d(),Vb));return CS=e,AS=t,RS=n,kS=i,OS=s,PS=o,di.setMouseDelay(2),di.setKeyboardDelay(2),!0}catch(r){return console.error("\u274C Failed to load remote modules:",r.message),!1}}async function MS(r,e){if(!mn){r.emit("remote:unavailable");return}if(!await BB()){r.emit("remote:unavailable");return}hn||(hn=new AS,_S=new RS(hn),bS=new kS(di,hn),wS=new OS(di,hn),SS=new PS(hn,_S),hn.startResourceMonitoring());let n=r.handshake.auth?.apiKey,i=new CS(di);hn.addClient(r.id,{tileManager:i,screenInterval:null,authenticated:!0,apiKey:n});let s=r.data.protocol;if(!s){r.emit("remote:unavailable");return}r.data.remoteAttached=!0;let o=a=>(...c)=>(uw(),a(...c));bS.setupMouseHandlers(r,o),wS.setupKeyboardHandlers(r,o),SS.setupScreenHandlers(r,o,s),r.on("disconnect",()=>{let a=()=>{hn.removeClient(r.id),s.close(),sl(s)},c=s._adapters?.get("rtc");if(!c?.ready)return a();c.on("stateChange",u=>{u===ft.closed&&a()})}),r.emit("remote:ready")}fi();var $n=X(require("fs"),1),bh=X(require("path"),1),Ml=0,$o=null,jB=6e4,FB={name:"9Remote",postCreateCommand:"npm install -g 9remote@latest",postAttachCommand:"9remote start",forwardPorts:[2208],portsAttributes:{2208:{label:"9Remote Server",onAutoForward:"notify"}}};function gn(){return process.env.CODESPACES==="true"}function IS(){return gn()?{isCodespaces:!0,codespaceName:process.env.CODESPACE_NAME||"unknown",workspacePath:process.env.CODESPACE_VSCODE_FOLDER||process.cwd()}:null}function NS(){Ml++,gn()&&Ml===1&&HB()}function LS(){Ml--,gn()&&Ml===0&&$B()}function HB(){$o||($o=setInterval(()=>{process.memoryUsage()},jB))}function $B(){$o&&(console.log("\u23F8\uFE0F Stopping Codespaces heartbeat"),clearInterval($o),$o=null)}function DS(r){return bh.default.join(r,".devcontainer","devcontainer.json")}function BS(r){try{let e=DS(r);if(!$n.default.existsSync(e))return{enabled:!1,exists:!1};let t=JSON.parse($n.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 jS(r,e){try{let t=bh.default.join(r,".devcontainer"),n=DS(r);$n.default.existsSync(t)||$n.default.mkdirSync(t,{recursive:!0});let i={...FB};if($n.default.existsSync(n))try{i={...JSON.parse($n.default.readFileSync(n,"utf8"))}}catch{}return e?(i.postAttachCommand="9remote start",i.postCreateCommand||(i.postCreateCommand="npm install -g 9remote@latest")):delete i.postAttachCommand,$n.default.writeFileSync(n,JSON.stringify(i,null,2)),{success:!0,enabled:e}}catch(t){return{success:!1,error:t.message}}}var Il=X(require("os"),1),Re=X(require("fs"),1),qn=X(require("path"),1);gt();var _s=oe.BUFFERS,Nl=qn.default.join(oe.STATE,"sessions.json"),Ll=qn.default.join(oe.STATE,"terminalGroups.json"),Dl="/tmp/9remote-uploads";Re.default.existsSync(Dl)||Re.default.mkdirSync(Dl,{recursive:!0});function wh(){return process.platform==="win32"?process.env.COMSPEC||"powershell.exe":process.env.SHELL||"/bin/zsh"}function Sh(r){return r?"/workspaces":Il.default.homedir()}function Eh(){let r=Il.default.homedir(),e=Il.default.userInfo().username,t=wh(),n={...process.env};if(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 FS(){Re.default.existsSync(_s)||Re.default.mkdirSync(_s,{recursive:!0})}function Th(r,e,t){if(t==="buffer"){FS();try{Re.default.writeFileSync(qn.default.join(_s,`${r}.buf`),e.join(""),"utf8")}catch(n){console.log(`\u26A0\uFE0F Failed to save buffer for ${r}:`,n.message)}}}function HS(r,e){if(e!=="buffer")return null;let t=qn.default.join(_s,`${r}.buf`);try{if(Re.default.existsSync(t))return Re.default.readFileSync(t,"utf8")}catch(n){console.log(`\u26A0\uFE0F Failed to load buffer for ${r}:`,n.message)}return null}function Bl(r){let e=qn.default.join(_s,`${r}.buf`);try{Re.default.existsSync(e)&&Re.default.unlinkSync(e)}catch{}}function $S(){FS();try{return Re.default.readdirSync(_s).filter(r=>r.endsWith(".buf")).map(r=>r.replace(".buf",""))}catch{return[]}}function Ch(){try{if(Re.default.existsSync(Nl))return JSON.parse(Re.default.readFileSync(Nl,"utf8"))}catch(r){console.log("\u26A0\uFE0F Failed to load session metadata:",r.message)}return{}}function vn(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=qn.default.dirname(Nl);Re.default.existsSync(t)||Re.default.mkdirSync(t,{recursive:!0}),Re.default.writeFileSync(Nl,JSON.stringify(e,null,2),"utf8")}catch(e){console.log("\u26A0\uFE0F Failed to save session metadata:",e.message)}}function qS(){try{if(Re.default.existsSync(Ll)){let r=JSON.parse(Re.default.readFileSync(Ll,"utf8"));return{groups:r.groups||[],sessionGroups:r.sessionGroups||{}}}}catch(r){console.log("\u26A0\uFE0F Failed to load groups:",r.message)}return{groups:[],sessionGroups:{}}}function US(r,e){try{let t=qn.default.dirname(Ll);Re.default.existsSync(t)||Re.default.mkdirSync(t,{recursive:!0});let n={groups:Array.from(r.values()),sessionGroups:e};Re.default.writeFileSync(Ll,JSON.stringify(n,null,2),"utf8")}catch(t){console.log("\u26A0\uFE0F Failed to save groups:",t.message)}}var Ah=X(require("node-pty"),1);var WS=2*1024*1024,hi="daemon";function GS(r,e,t,n,i){let s=null;r.onData(o=>{t.buffer.push(o),t.buffer.reduce((c,u)=>c+u.length,0)>WS&&(t.buffer=[t.buffer.join("").slice(-WS)]),wt(n,"output",{sessionId:e,data:Buffer.from(o,"utf-8")}),hi==="buffer"&&(s&&clearTimeout(s),s=setTimeout(()=>Th(e,t.buffer,hi),2e3))}),r.onExit(({exitCode:o})=>{console.log(`PTY exited: sessionId=${e}, code=${o}`),hi==="buffer"&&t.buffer.length>0&&Th(e,t.buffer,hi),i.delete(e),Bl(e),wt(n,"sessionClosed",e)})}function zS(r,e,t,n,i){let s=()=>US(n,i);r.on("getSessions",o=>{let a=[];for(let[c,u]of t)a.push({id:c,name:u.name,createdAt:u.createdAt,restored:u.restored||!1,shellId:u.shellId,shellLabel:u.shellLabel,groupId:i[c]||null});o(a)}),r.on("getShells",o=>{o({platform:process.platform,shells:Xb()})}),r.on("getGroups",o=>{o(Array.from(n.values()))}),r.on("createGroup",({name:o},a)=>{let c=`group-${Date.now()}`,u={id:c,name:o||"Group",createdAt:Date.now()};n.set(c,u),s(),wt(e,"groupsChanged"),a({success:!0,group:u})}),r.on("renameGroup",({groupId:o,name:a},c)=>{let u=n.get(o);if(!u)return c({success:!1,error:"Group not found"});u.name=a,s(),wt(e,"groupsChanged"),c({success:!0})}),r.on("deleteGroup",async({groupId:o},a)=>{if(!n.delete(o))return a({success:!1,error:"Group not found"});let c=Object.keys(i).filter(u=>i[u]===o);for(let u of c){let p=t.get(u);if(p){if(p.daemon&&Cr())try{await ui(u)}catch{}else p.pty&&(p.pty.kill(),Bl(u));t.delete(u),wt(e,"sessionClosed",u)}delete i[u]}s(),wt(e,"groupsChanged"),a({success:!0})}),r.on("moveSession",({sessionId:o,groupId:a},c)=>{a&&n.has(a)?i[o]=a:delete i[o],s(),wt(e,"groupsChanged"),c({success:!0})}),r.on("createSession",async({name:o,shellId:a,groupId:c},u)=>{let p=`session-${Date.now()}`,f=Jb(a),m=Eh();m.NINE_REMOTE_SESSION_ID=p;let y=Sh(gn());try{let _=o||`${f.label} ${t.size+1}`;if(hi==="daemon"&&Cr()){let P=await Kd(_,80,24,a,p,y);P.success?(t.set(P.sessionId,{daemon:!0,name:_,createdAt:Date.now(),cwd:P.cwd,shellId:P.shellId,shellLabel:P.shellLabel}),c&&n.has(c)&&(i[P.sessionId]=c,s()),vn(t),u({success:!0,sessionId:P.sessionId,shellLabel:P.shellLabel})):u({success:!1,error:P.error});return}let S=Ah.default.spawn(f.path,f.args,{name:"xterm-256color",cols:80,rows:24,cwd:y,env:m,useConpty:!1}),A={pty:S,name:_,createdAt:Date.now(),buffer:[],cwd:y,shellId:f.id,shellLabel:f.label};GS(S,p,A,e,t),t.set(p,A),c&&n.has(c)&&(i[p]=c,s()),u({success:!0,sessionId:p,shellLabel:f.label})}catch(_){console.error("Failed to create session:",_),u({success:!1,error:_.message})}}),r.on("joinSession",async(o,a)=>{let c=t.get(o);if(!c)return a({success:!1,error:"Session not found"});if(c.daemon&&Cr()){try{if(c.needsRespawn){let p=await Kd(c.name,80,24,c.shellId,o,c.cwd);if(!p.success)return a({success:!1,error:p.error});delete c.needsRespawn,c.cwd=p.cwd,c.shellLabel=p.shellLabel,vn(t)}let u=await ow(o);u.cwd&&u.cwd!==c.cwd&&(c.cwd=u.cwd,vn(t)),a({success:u.success,name:c.name,cwd:u.cwd||c.cwd,error:u.error})}catch(u){a({success:!1,error:u.message})}return}if(c.needsRestore&&hi==="buffer")try{let u=wh(),p=process.platform==="win32"?[]:["-l"],f=Sh(gn()),m=Ah.default.spawn(u,p,{name:"xterm-256color",cols:80,rows:24,cwd:f,env:Eh(),useConpty:!1});c.pty=m,c.needsRestore=!1,c.cwd=f;let y=HS(o,hi);y&&(c.buffer=[y]),GS(m,o,c,e,t),console.log(`\u2705 Restored PTY session: ${o}`)}catch(u){return console.error("Failed to restore session:",u),a({success:!1,error:"Failed to restore session"})}c.buffer?.length>0&&r.emit("output",{sessionId:o,data:Buffer.from(c.buffer.join(""),"utf-8")}),a({success:!0,name:c.name,cwd:c.cwd})}),r.on("deleteSession",async(o,a)=>{let c=t.get(o);if(!c)return a({success:!1,error:"Session not found"});if(c.daemon&&Cr()){try{await ui(o),t.delete(o),i[o]&&(delete i[o],s()),vn(t),a({success:!0})}catch(u){a({success:!1,error:u.message})}return}c.pty&&c.pty.kill(),t.delete(o),i[o]&&(delete i[o],s()),Bl(o),wt(e,"sessionClosed",o),vn(t),a({success:!0})}),r.on("renameSession",async({sessionId:o,name:a},c)=>{let u=t.get(o);if(!u)return c({success:!1,error:"Session not found"});u.name=a,wt(e,"session-renamed",{sessionId:o,name:a}),vn(t),c({success:!0})})}var KS=X(require("fs"),1),VS=X(require("path"),1);function YS(r,e){r.on("input",({sessionId:t,data:n})=>{if(!t)return;let i=e.get(t);if(i){if(i.daemon&&Cr())return Vd(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&&Cr())return aw(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=VS.default.join(Dl,`${Date.now()}_${a}`);KS.default.writeFileSync(c,Buffer.from(s,"base64")),console.log(`\u{1F4CE} File uploaded: ${c} (${i} bytes)`),o.daemon&&Cr()?Vd(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
|
|
111
113
|
Error uploading file: ${a.message}\r
|
|
112
|
-
`,"utf-8")})}})}var
|
|
114
|
+
`,"utf-8")})}})}var Or=X(require("fs"),1),Xo=X(require("path"),1),cu=X(fT(),1);gt();var lu=Xo.default.join(oe.CONFIG,"vapid.json"),uu=Xo.default.join(oe.CONFIG,"push-subscriptions.json"),zG=1800*1e3,Pt=[];function GF(){try{if(Or.default.existsSync(lu))return JSON.parse(Or.default.readFileSync(lu,"utf8"))}catch{}return null}function zF(r){let e=Xo.default.dirname(lu);Or.default.existsSync(e)||Or.default.mkdirSync(e,{recursive:!0}),Or.default.writeFileSync(lu,JSON.stringify(r,null,2),"utf8")}function KF(){let r=GF();if(!r){let e=cu.default.generateVAPIDKeys();r={publicKey:e.publicKey,privateKey:e.privateKey},zF(r)}return cu.default.setVapidDetails("mailto:admin@9remote.cc",r.publicKey,r.privateKey),r}function VF(){try{Or.default.existsSync(uu)&&(Pt=JSON.parse(Or.default.readFileSync(uu,"utf8")))}catch{Pt=[]}}function Jo(){try{let r=Xo.default.dirname(uu);Or.default.existsSync(r)||Or.default.mkdirSync(r,{recursive:!0}),Or.default.writeFileSync(uu,JSON.stringify(Pt,null,2),"utf8")}catch(r){console.error("Failed to save push subscriptions:",r.message)}}function Ns(r){return r.type==="expo"?r.token:r.endpoint}function dT(r,e){let t=Ns(r);Pt=Pt.filter(n=>Ns(n)!==t),Pt.push({...r,socketId:e,lastConnectedAt:Date.now()}),Jo()}function hT(r){Pt=Pt.filter(e=>Ns(e)!==r),Jo()}function mT(r){for(let e of Pt)e.socketId===r&&(e.disconnectedAt=Date.now());Jo()}function gT(r,e){for(let t of Pt)Ns(t)===e&&(t.socketId=r,t.disconnectedAt=null,t.lastConnectedAt=Date.now());Jo()}async function YF(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",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);console.log(` \u2705 Expo push sent to ${r.token.slice(0,30)}...`)}async function vT(r){let e=Av[r.tool]||"AI";console.log(`\u{1F514} Sending push notification: ${r.type} ${e}`);let t=Pt.reduce((i,s)=>(i?.lastConnectedAt??0)>=(s?.lastConnectedAt??0)?i:s,null);if(!t){console.log("\u{1F4E4} sendPush: no subscriptions");return}let n=Ns(t);console.log(`\u{1F4E4} sendPush: total=${Pt.length} target=${n.slice(0,50)}...`);try{if(t.type==="expo")await YF(t,e,r);else{let i=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",type:r.type}});await cu.default.sendNotification({endpoint:t.endpoint,keys:t.keys},i),console.log(` \u2705 WebPush sent to ${t.endpoint.slice(0,50)}...`)}}catch(i){console.log(` \u274C Push failed: ${i.statusCode||i.message}`),(i.statusCode===410||i.statusCode===404||i.message?.includes("DeviceNotRegistered"))&&(Pt=Pt.filter(o=>Ns(o)!==n),Jo())}}var XF=KF();VF();function xT(){return XF.publicKey}function yT(){return Pt.some(r=>!r.disconnectedAt)}var pm={};function _T(r,e){pm[r]=e}function pu(r){delete pm[r]}function bT(){return{...pm}}function wT(r){r.on("getNotificationState",()=>{r.emit("notificationState",bT())}),r.on("clearNotification",e=>{e&&(pu(e),r.broadcast.emit("notificationCleared",e))}),r.on("getVapidKey",e=>e(xT())),r.on("pushSubscribe",e=>{let t=e?.type==="expo"?e.token:e?.endpoint;t&&(gT(r.id,t),dT(e,r.id))}),r.on("pushUnsubscribe",e=>{e&&hT(e)}),r.on("getAutoStartStatus",e=>{if(!gn())return e({success:!1,error:"Not in Codespaces"});let t=process.env.CODESPACE_VSCODE_FOLDER||process.cwd();e({success:!0,...BS(t)})}),r.on("setAutoStart",({enabled:e},t)=>{if(!gn())return t({success:!1,error:"Not in Codespaces"});let n=process.env.CODESPACE_VSCODE_FOLDER||process.cwd();t(jS(n,e))})}var Gr=X(require("os"),1),dt=X(require("fs"),1),Ht=X(require("path"),1);gt();var ET=`http://localhost:${Ia}/api/notify`,TT="nineRemoteNotify",JF=Ht.default.join(oe.STATE,"claudeEnvBackup.json"),yn={claude:()=>Ht.default.join(Gr.default.homedir(),".claude","settings.json"),codex:()=>Ht.default.join(Gr.default.homedir(),".codex","config.toml"),gemini:()=>Ht.default.join(Gr.default.homedir(),".gemini","settings.json"),opencode:()=>Ht.default.join(Gr.default.homedir(),".config","opencode","plugin",`${TT}.js`)},QF={claude:()=>Ht.default.join(Gr.default.homedir(),".claude"),codex:()=>Ht.default.join(Gr.default.homedir(),".codex"),gemini:()=>Ht.default.join(Gr.default.homedir(),".gemini"),opencode:()=>[Ht.default.join(Gr.default.homedir(),".config","opencode"),Ht.default.join(Gr.default.homedir(),".opencode")]},Qo=(r,e)=>`command -v curl >/dev/null 2>&1 && curl -s --connect-timeout 1 --max-time 2 "${ET}?type=${r}&sessionId=$NINE_REMOTE_SESSION_ID&tool=${e}" > /dev/null 2>&1 & true`;function Zo(r){try{if(dt.default.existsSync(r))return JSON.parse(dt.default.readFileSync(r,"utf8"))}catch{}return{}}function fu(r,e){let t=Ht.default.dirname(r);dt.default.existsSync(t)||dt.default.mkdirSync(t,{recursive:!0}),dt.default.writeFileSync(r,JSON.stringify(e,null,2),"utf8")}function CT(r){let e={},t=r.env||{};for(let n of Object.keys(Zs))e[n]=t[n]??null;fu(JF,e),r.env={...t,...Zs}}function ZF(){let r=yn.claude(),e=Zo(r),t=Qo("stop","claude"),n=Qo("notification","claude");return e.hooks={...e.hooks||{},Stop:[{matcher:"",hooks:[{type:"command",command:t}]}],Notification:[{matcher:"permission_prompt|idle_prompt",hooks:[{type:"command",command:n}]}]},CT(e),fu(r,e),{success:!0}}var e3=/# 9Remote notification\nnotify\s*=.*\n?/g,t3="# 9Remote-saved: ";function r3(r){let e=r.search(/^\[/m);return e===-1?[r,""]:[r.slice(0,e),r.slice(e)]}var ST=/^notify\s*=\s*(\[[^\n]*\])\s*$/m;function n3(){let r=yn.codex(),e=Ht.default.dirname(r);dt.default.existsSync(e)||dt.default.mkdirSync(e,{recursive:!0});let t=dt.default.existsSync(r)?dt.default.readFileSync(r,"utf8"):"";t=t.replace(e3,"");let[n,i]=r3(t),s="",o=n.match(ST);if(o){try{let u=JSON.parse(o[1]);Array.isArray(u)&&u.length&&(s=` ; exec ${u.map(p=>`'${String(p).replace(/'/g,"'\\''")}'`).join(" ")} "$@"`)}catch{}n=n.replace(ST,`${t3}$&`)}let a=`${Qo("stop","codex")}${s}`,c=`# 9Remote notification
|
|
115
|
+
notify = ["bash", "-c", ${JSON.stringify(a)}, "9remote"]
|
|
116
|
+
`;return n.length&&!n.endsWith(`
|
|
113
117
|
`)&&(n+=`
|
|
114
|
-
`),n
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
118
|
+
`),dt.default.writeFileSync(r,n+c+i,"utf8"),{success:!0}}function i3(){let r=yn.gemini(),e=Zo(r),t=Qo("stop","gemini"),n=Qo("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},fu(r,e),{success:!0}}function s3(){return`// 9Remote OpenCode notify plugin (auto-generated)
|
|
119
|
+
const base = ${JSON.stringify(ET)};
|
|
120
|
+
const post = (type) => {
|
|
121
|
+
const sid = process.env.NINE_REMOTE_SESSION_ID || "";
|
|
122
|
+
if (!sid) return;
|
|
123
|
+
const url = base + "?type=" + type + "&sessionId=" + encodeURIComponent(sid) + "&tool=opencode";
|
|
119
124
|
try { fetch(url, { signal: AbortSignal.timeout(2000) }).catch(() => {}); } catch {}
|
|
120
125
|
};
|
|
121
|
-
export const ${
|
|
126
|
+
export const ${TT} = async () => ({
|
|
122
127
|
event: async ({ event }) => {
|
|
123
|
-
if (event.type === "session.idle") post(
|
|
124
|
-
else if (event.type === "permission.asked") post(
|
|
128
|
+
if (event.type === "session.idle") post("stop");
|
|
129
|
+
else if (event.type === "permission.asked") post("notification");
|
|
125
130
|
},
|
|
126
131
|
});
|
|
127
|
-
`}function
|
|
128
|
-
`),y=[];for(let
|
|
132
|
+
`}function o3(){let r=yn.opencode(),e=Ht.default.dirname(r);return dt.default.existsSync(e)||dt.default.mkdirSync(e,{recursive:!0}),dt.default.writeFileSync(r,s3(),"utf8"),{success:!0}}function a3(r){switch(r){case"claude":{let e=Zo(yn.claude());return!!(e.hooks?.Stop||e.hooks?.Notification)}case"codex":{let e=yn.codex();return dt.default.existsSync(e)&&dt.default.readFileSync(e,"utf8").includes("# 9Remote notification")}case"gemini":{let e=Zo(yn.gemini());return!!(e.hooks?.AfterAgent||e.hooks?.Notification)}case"opencode":return dt.default.existsSync(yn.opencode());default:return!1}}function c3(r){let e=QF[r]?.();return e?(Array.isArray(e)?e:[e]).some(n=>dt.default.existsSync(n)):!1}var l3={claude:ZF,codex:n3,gemini:i3,opencode:o3};var u3=Cv;function p3(r){return l3[r]?.()||{success:!1,error:"Unknown tool"}}function AT(){let r={};for(let e of u3)if(!(!c3(e)||a3(e)))try{r[e]=p3(e).success}catch{r[e]=!1}return r}function RT(){let r=yn.claude(),e=Zo(r);if(!e.hooks?.Stop&&!e.hooks?.Notification)return;let t=e.env||{};Object.keys(Zs).some(i=>t[i]!==Zs[i])&&(CT(e),fu(r,e))}var gz=(0,OT.dirname)((0,PT.fileURLToPath)(__importMetaUrl)),vz=xv.rgb(230,138,110),fm="daemon",f3="2.0.26",Gn=new Map,MT=new Map,IT={};async function kT(){let r=await hl(),e=new Map(r.map(n=>[n.id,n])),t=Ch();for(let n of r)if(!t[n.id])try{await ui(n.id)}catch{}Gn.clear();for(let[n,i]of Object.entries(t)){let s=e.get(n);Gn.set(n,{daemon:!0,name:i.name,createdAt:i.createdAt,shellId:i.shellId,cwd:s?.cwd||i.cwd,needsRespawn:!s})}vn(Gn)}async function NT(){let r=qS();for(let n of r.groups)MT.set(n.id,n);Object.assign(IT,r.sessionGroups);try{RT()}catch{}try{AT()}catch{}if(fm==="daemon")if(!await sw())console.error("\u274C Failed to connect to PTY daemon, falling back to buffer mode");else{await kT(),fl("connected",()=>{kT().catch(()=>{})});return}console.log("\u{1F4E6} Buffer persistence mode - scrollback enabled");let e=$S(),t=Ch();for(let n of e){let i=t[n]||{};Gn.set(n,{pty:null,name:i.name||`Terminal ${Gn.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 LT(r,e){fm==="daemon"&&(fl("output",({sessionId:n,data:i})=>wt(r,"output",{sessionId:n,data:i})),fl("sessionClosed",n=>{Gn.delete(n),pu(n),wt(r,"sessionClosed",n),wt(r,"notificationCleared",n)}));let t=()=>({version:f3,remoteAvailable:xs(),daemonMode:fm==="daemon"&&Cr(),platform:process.platform,...IS()});$w(()=>{let n=t();for(let i of r.sockets.sockets.values())i.data?.approved&&i.emit("serverInfo",n)}),r.on("connection",n=>{NS(),n.emit("serverInfo",t()),zS(n,r,Gn,MT,IT),YS(n,Gn),wT(n),TS()&&MS(n,e).catch(i=>{console.error("\u274C Failed to setup remote handlers:",i.message)}),n.on("disconnect",i=>{mT(n.id),LS()})})}var se=X(require("fs"),1),yr=X(require("path"),1),Vr=X(require("os"),1),qs=require("child_process"),fR=X(nR(),1);var bg=["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"],Lu=[".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 iR=[".ssh",".aws",".gnupg",".kube",".docker",".cargo",".npmrc",".netrc",".pypirc",".config/gh",".config/gcloud"],sR=["/etc/shadow","/etc/sudoers","/etc/ssh","/root","/private/etc/sudoers"];var oR=X(require("fs"),1),ma=X(require("path"),1),aR=X(require("os"),1);var cR=aR.default.homedir();function dU(r){if(!r)return null;let e=r.startsWith("~")?r.replace(/^~/,cR):r;try{return oR.default.realpathSync(e)}catch{return ma.default.resolve(e)}}function Sn(r){let e=dU(r);if(!e)return!1;for(let t of sR)if(e===t||e.startsWith(t+ma.default.sep))return!0;for(let t of iR){let n=ma.default.join(cR,t);if(e===n||e.startsWith(n+ma.default.sep))return!0}return!1}function Du(r){return bg.includes(r)}function Us(r){return Lu.includes(yr.default.extname(r).toLowerCase())}function mU(r,e){return r.isDirectory()?"folder":Us(e)?"binary":"file"}function ga(r){return r<1024?`${r}B`:r<1024*1024?`${(r/1024).toFixed(1)}KB`:`${(r/(1024*1024)).toFixed(1)}MB`}function dR(r,e,t,n=50){if(!(t.length>=n))try{for(let i of se.default.readdirSync(r)){if(t.length>=n)return;if(i.startsWith(".")||Du(i))continue;let s=yr.default.join(r,i);try{let o=se.default.statSync(s);o.isDirectory()?dR(s,e,t,n):i.toLowerCase().includes(e.toLowerCase())&&t.push({name:i,path:s,type:Us(i)?"binary":"file",size:o.size,sizeFormatted:ga(o.size)})}catch{}}}catch{}}function pR(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 hR(r,e,t,n,i,s){if(s.length>=200)return;let o;try{o=se.default.readdirSync(r,{withFileTypes:!0})}catch{return}for(let a of o){if(s.length>=200)return;if(Du(a.name))continue;let c=yr.default.join(r,a.name),u=yr.default.relative(e,c);if(a.isDirectory()){hR(c,e,t,n,i,s);continue}if(a.isFile()&&!Us(a.name)&&!(i&&i.test(u))&&!(n&&!n.test(u)))try{if(se.default.statSync(c).size>512e3)continue;let m=se.default.readFileSync(c,"utf-8").split(`
|
|
133
|
+
`),y=[];for(let _=0;_<m.length&&y.length<10;_++){let S=m[_],A=t(S);for(let P of A){if(y.length>=10)break;y.push({line:_+1,column:P.column+1,lineText:S,matchLength:P.length})}}y.length&&s.push({path:c,matches:y})}catch{}}}function mR(r,e,t){let n;try{n=se.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"||Du(s.name))continue;let o=yr.default.join(r,s.name);if(s.isDirectory()){let a={name:s.name,path:o,type:"folder"};e>0&&(a.children=mR(o,e-1,t)),i.push(a)}else s.isFile()&&i.push({name:s.name,path:o,type:Us(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 gU(){if(process.platform!=="win32")return[];try{return(0,qs.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=>se.default.existsSync(r)).map(r=>({letter:r[0],path:r}))}}function gR(r){r.on("getSystemInfo",t=>{let n=process.platform;t({success:!0,platform:n,isWindows:n==="win32",drives:n==="win32"?gU():[],homedir:Vr.default.homedir()})}),r.on("getFiles",({dirPath:t,showHidden:n},i)=>{try{let s=t||Vr.default.homedir(),o=s.startsWith("~")?s.replace("~",Vr.default.homedir()):s;if(Sn(o))return i({success:!1,error:"Access denied"});if(!se.default.existsSync(o))return i({success:!1,error:"Directory not found"});let a=[];for(let c of se.default.readdirSync(o))if(!(!n&&c.startsWith(".")&&c!==".env"&&c!==".env.example")&&!Du(c))try{let u=yr.default.join(o,c),p=se.default.statSync(u);a.push({name:c,path:u,type:mU(p,c),size:p.isFile()?p.size:null,sizeFormatted:p.isFile()?ga(p.size):null,modified:p.mtime.getTime()})}catch{}a.sort((c,u)=>c.type==="folder"&&u.type!=="folder"?-1:c.type!=="folder"&&u.type==="folder"?1:c.name.localeCompare(u.name)),i({success:!0,files:a,currentPath:o,parentPath:yr.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||Vr.default.homedir()).replace(/^~/,Vr.default.homedir());if(!se.default.existsSync(s))return i({success:!1,error:"Workspace not found"});let o=[];dR(s,n,o,50),o.sort((a,c)=>{let u=a.name.toLowerCase()===n.toLowerCase(),p=c.name.toLowerCase()===n.toLowerCase();return u&&!p?-1:!u&&p?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(Sn(t))return n({success:!1,error:"Access denied"});if(!se.default.existsSync(t))return n({success:!1,error:"File not found"});let i=se.default.statSync(t);if(i.size>512e3)return n({success:!1,error:`File too large (${ga(i.size)}). Max ${ga(512e3)}`});if(Us(t))return n({success:!1,error:"Cannot open binary file"});n({success:!0,content:se.default.readFileSync(t,"utf-8")})}catch(i){n({success:!1,error:i.message})}}),r.on("readImage",({filePath:t},n)=>{try{if(Sn(t))return n({success:!1,error:"Access denied"});if(!se.default.existsSync(t))return n({success:!1,error:"File not found"});let i=se.default.statSync(t),s=10*1024*1024;if(i.size>s)return n({success:!1,error:`Image too large (${ga(i.size)})`});let o=yr.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",u=se.default.readFileSync(t),p=`data:${c};base64,${u.toString("base64")}`;n({success:!0,dataUrl:p,size:i.size,mime:c})}catch(i){n({success:!1,error:i.message})}}),r.on("writeFile",({filePath:t,content:n},i)=>{try{if(Sn(t))return i({success:!1,error:"Access denied"});se.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(Sn(t))return i({success:!1,error:"Access denied"});if(se.default.existsSync(t))return i({success:!1,error:"Item already exists"});n==="folder"?se.default.mkdirSync(t,{recursive:!0}):se.default.writeFileSync(t,"","utf-8"),i({success:!0})}catch(s){i({success:!1,error:s.message})}}),r.on("deleteItem",({itemPath:t},n)=>{try{if(Sn(t))return n({success:!1,error:"Access denied"});if(!se.default.existsSync(t))return n({success:!1,error:"Item not found"});se.default.statSync(t).isDirectory()?se.default.rmSync(t,{recursive:!0}):se.default.unlinkSync(t),n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.on("renameItem",({oldPath:t,newPath:n},i)=>{try{if(Sn(t)||Sn(n))return i({success:!1,error:"Access denied"});if(!se.default.existsSync(t))return i({success:!1,error:"Item not found"});if(se.default.existsSync(n))return i({success:!1,error:"Target already exists"});se.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 u=(t||Vr.default.homedir()).replace(/^~/,Vr.default.homedir());if(!se.default.existsSync(u))return c({success:!1,error:"Workspace not found"});let p;if(s){let _;try{_=new RegExp(n,i?"g":"gi")}catch(S){return c({success:!1,error:`Invalid regex: ${S.message}`})}p=S=>{let A=[],P;for(_.lastIndex=0;(P=_.exec(S))!==null;)A.push({column:P.index,length:P[0].length}),P.index===_.lastIndex&&_.lastIndex++;return A}}else{let _=i?n:n.toLowerCase();p=S=>{let A=i?S:S.toLowerCase(),P=[],L=0;for(;(L=A.indexOf(_,L))!==-1;)P.push({column:L,length:_.length}),L+=_.length||1;return P}}let f=pR(o),m=pR(a),y=[];hR(u,u,p,f,m,y),c({success:!0,results:y})}catch(u){c({success:!1,error:u.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 u;if(o){let m;try{m=new RegExp(n,s?"g":"gi")}catch(y){return c({success:!1,error:`Invalid regex: ${y.message}`})}u=y=>{let _=0;return{next:y.replace(m,A=>(_++,i)),count:_}}}else u=m=>{let y=0,_=s?"g":"gi",S=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),A=new RegExp(S,_);return{next:m.replace(A,()=>(y++,i)),count:y}};let p=0,f=0;for(let m of a)try{if(!se.default.existsSync(m)||Us(m))continue;let y=se.default.statSync(m);if(!y.isFile()||y.size>512e3)continue;let _=se.default.readFileSync(m,"utf-8"),{next:S,count:A}=u(_);A>0&&(se.default.writeFileSync(m,S,"utf-8"),p+=A,f++)}catch{}c({success:!0,replacedCount:p,fileCount:f})}catch(u){c({success:!1,error:u.message})}});let e=new Map;r.on("watchDir",({dirPath:t},n)=>{try{if(!t||!se.default.existsSync(t))return n({success:!1,error:"Directory not found"});if(e.has(t))return n({success:!0});let i=fR.default.watch(t,{depth:0,ignoreInitial:!0,persistent:!0,ignored:o=>bg.includes(yr.default.basename(o))}),s=o=>a=>r.emit("fileChange",{type:o,path:a});i.on("add",s("add")).on("change",s("change")).on("unlink",s("unlink")).on("addDir",s("addDir")).on("unlinkDir",s("unlinkDir")),e.set(t,i),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.close(),e.delete(t)),n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.once("disconnect",()=>{for(let 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=[yr.default.dirname(t)]);let a=(0,qs.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||!se.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","cmd","/K",`cd /d "${t}"`],a.shell=!1):(s="gnome-terminal",o=[`--working-directory=${t}`]);let c=(0,qs.spawn)(s,o,a);c.on("error",()=>{if(i==="linux"){let u=(0,qs.spawn)("xterm",["-e",`cd "${t}" && bash`],a);u.on("error",p=>n({success:!1,error:p.message})),u.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||Vr.default.homedir()).replace(/^~/,Vr.default.homedir());if(!se.default.existsSync(o))return s({success:!1,error:"Directory not found"});let c=mR(o,typeof n=="number"?n:3,!!i);s({success:!0,tree:{name:yr.default.basename(o)||o,path:o,type:"folder",children:c}})}catch(o){s({success:!1,error:o.message})}})}var Ut=X(require("fs"),1),wi=X(require("path"),1),Mr=require("child_process");function bi(r,e){return new Promise(t=>{let n=(0,Mr.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 vR(r){return Lu.includes(wi.default.extname(r).toLowerCase())}function xR(r){r.on("gitStatus",({repoPath:e},t)=>{try{let n=(0,Mr.execSync)("git status --porcelain",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}),i={};try{(0,Mr.execSync)("git diff HEAD --numstat",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}).trim().split(`
|
|
129
134
|
`).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(`
|
|
130
|
-
`).filter(Boolean)){let a=o.match(/^([MADRCU?! ]{1,2})\s+(.+)$/);if(!a)continue;let c=a[1],u=a[2];if(!u)continue;let p;c.includes("?")?p="?":c.includes("A")?p="A":c.includes("D")?p="D":c.includes("M")?p="M":c.includes("R")?p="R":p=c.trim()[0]||"?";let f=i[u]||{added:0,deleted:0};if(p==="?")try{let
|
|
131
|
-
`).length,f.deleted=0}}catch{}s.push({status:p,path:u,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("gitFileStatus",({repoPath:e,filePath:t},n)=>{try{let i=
|
|
135
|
+
`).filter(Boolean)){let a=o.match(/^([MADRCU?! ]{1,2})\s+(.+)$/);if(!a)continue;let c=a[1],u=a[2];if(!u)continue;let p;c.includes("?")?p="?":c.includes("A")?p="A":c.includes("D")?p="D":c.includes("M")?p="M":c.includes("R")?p="R":p=c.trim()[0]||"?";let f=i[u]||{added:0,deleted:0};if(p==="?")try{let m=wi.default.join(e,u);if(Ut.default.existsSync(m)&&!vR(u)){let y=Ut.default.readFileSync(m,"utf-8");f.added=y.split(`
|
|
136
|
+
`).length,f.deleted=0}}catch{}s.push({status:p,path:u,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("gitFileStatus",({repoPath:e,filePath:t},n)=>{try{let i=wi.default.relative(e,t),o=(0,Mr.execSync)(`git status --porcelain -- "${i}"`,{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}).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],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]||"?",n({success:!0,status:u,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=wi.default.join(e,t);if(Ut.default.existsSync(o)){let c=Ut.default.readFileSync(o,"utf-8").split(`
|
|
132
137
|
`);s=`diff --git a/${t} b/${t}
|
|
133
138
|
new file mode 100644
|
|
134
139
|
--- /dev/null
|
|
135
140
|
+++ b/${t}
|
|
136
141
|
@@ -0,0 +1,${c.length} @@
|
|
137
142
|
${c.map(u=>`+${u}`).join(`
|
|
138
|
-
`)}`}}else if(t)s=(0,
|
|
139
|
-
`).filter(c=>c.startsWith("??")).map(c=>c.substring(3));for(let c of a){let u=
|
|
143
|
+
`)}`}}else if(t)s=(0,Mr.execSync)(`git diff HEAD -- "${t}"`,{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0});else{s=(0,Mr.execSync)("git diff HEAD",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0});let a=(0,Mr.execSync)("git status --porcelain",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}).trim().split(`
|
|
144
|
+
`).filter(c=>c.startsWith("??")).map(c=>c.substring(3));for(let c of a){let u=wi.default.join(e,c);if(Ut.default.existsSync(u)&&!vR(c))try{if(Ut.default.statSync(u).size<=512e3){let m=Ut.default.readFileSync(u,"utf-8").split(`
|
|
140
145
|
`);s+=`
|
|
141
146
|
diff --git a/${c} b/${c}
|
|
142
147
|
new file mode 100644
|
|
143
148
|
--- /dev/null
|
|
144
149
|
+++ b/${c}
|
|
145
|
-
@@ -0,0 +1,${
|
|
146
|
-
${
|
|
147
|
-
`)}`}}catch{}}}i({success:!0,diff:s})}catch(s){i({success:!1,error:s.message})}}),r.on("gitBranch",async({repoPath:e},t)=>{let n=await
|
|
148
|
-
`).filter(Boolean).map(a=>{let[c,...u]=a.split(" ");return{hash:c,message:u.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=
|
|
150
|
+
@@ -0,0 +1,${m.length} @@
|
|
151
|
+
${m.map(y=>`+${y}`).join(`
|
|
152
|
+
`)}`}}catch{}}}i({success:!0,diff:s})}catch(s){i({success:!1,error:s.message})}}),r.on("gitBranch",async({repoPath:e},t)=>{let n=await bi(["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 bi(["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 bi(["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 bi(["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 bi(["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 bi(["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 bi(["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(`
|
|
153
|
+
`).filter(Boolean).map(a=>{let[c,...u]=a.split(" ");return{hash:c,message:u.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=wi.default.join(e,t);n==="?"?Ut.default.existsSync(s)&&(Ut.default.statSync(s).isDirectory()?Ut.default.rmSync(s,{recursive:!0}):Ut.default.unlinkSync(s)):n==="A"?((0,Mr.execSync)(`git reset HEAD -- "${t}"`,{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}),Ut.default.existsSync(s)&&Ut.default.unlinkSync(s)):(0,Mr.execSync)(`git checkout HEAD -- "${t}"`,{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}),i({success:!0})}catch(s){i({success:!1,error:s.message})}})}function yR(r){r.on("connection",e=>{gR(e),xR(e)})}fi();var En=require("fs"),bR=require("path");gt();oh();var _R=oe.CONFIG,wg=(0,bR.join)(oe.CONFIG,"approvedDevices.json"),Yr=new Map,Ws=!1,va=new Map,Gs=new Map;function wR(){(0,En.existsSync)(_R)||(0,En.mkdirSync)(_R,{recursive:!0})}function SR(){try{if(wR(),(0,En.existsSync)(wg)){let r=JSON.parse((0,En.readFileSync)(wg,"utf8"));Array.isArray(r)?Yr=new Map(r.map(e=>[e,{approvedAt:null}])):Yr=new Map(Object.entries(r))}}catch{Yr=new Map}}function Sg(){try{wR(),(0,En.writeFileSync)(wg,JSON.stringify(Object.fromEntries(Yr),null,2))}catch{}}function ER(r){return r?Yr.has(r):!1}function Bu(r){r&&(Yr.set(r,{approvedAt:new Date().toISOString()}),Sg())}function TR(r){Yr.delete(r),Sg()}function CR(r,e){let t=Yr.get(r);return t?(Yr.set(r,{...t,label:e||""}),Sg(),!0):!1}function AR(){return[...Yr.entries()].map(([r,e])=>({deviceId:r,...e}))}function RR(r,e){va.set(r,e)}function Eg(r){return va.get(r)||null}function ju(r){va.delete(r)}function kR(r){if(!r)return!1;for(let e of va.values())if(e.deviceId===r)return!0;return!1}function OR(){return[...va.entries()].map(([r,e])=>({socketId:r,...e}))}function PR(r,e){r&&Gs.set(r,{...e,rejectedAt:new Date().toISOString()})}function MR(r){return r?Gs.has(r):!1}function IR(r,e,t){let n=Gs.get(r);n&&Gs.set(r,{...n,socketId:e,ip:t})}function NR(){return[...Gs.entries()].map(([r,e])=>({deviceId:r,...e}))}function zs(r){Gs.delete(r)}function LR(){return Ws=!!jo().autoApprove,Ws}function Fu(){return Ws}function DR(r){return Ws=!!r,wl({autoApprove:Ws}),Ws}function FR(){try{let r=(0,jR.join)(oe.ROOT,"keys.json");return JSON.parse((0,BR.readFileSync)(r,"utf8")).key||null}catch{return null}}var Ks=null;function ya(){return Ks}function xa(r){r.handshake.auth?.tempKey&&(xt("One-time key used \u2014 clearing from UI"),Fw()),xU(r)}function xU(r){if(r.data.protocol)return;let{webrtc:e,streaming:t}=Z,n=new il(r,{enableWebRTC:e.enableWebRTC,apiKey:e.enableTurn?FR():null,turnApiUrl:e.enableTurn?e.turnApiUrl:null,turnRefreshInterval:e.turnRefreshInterval,dcMaxMessageSize:e.dcMaxMessageSize,dcChunkSize:e.dcChunkSize,dcMaxTilesPerFrame:e.dcMaxTilesPerFrame,answerTimeout:e.answerTimeout,wsChunkSize:t.chunkSize});r.data.protocol=n,Yb(n),n.init().then(()=>n.setupSignaling(r)).catch(i=>console.error("[transport] pm init failed:",i.message)),n.attachAsBus(r)}function HR(r){let e=Ks;if(!e)return!1;let t=e.sockets.sockets.get(r),n=Eg(r);return!t||!n?!1:(Bu(n.deviceId),ju(r),zs(n.deviceId),t.data.approved=!0,t.emit("device:approved"),xa(t),xt(`Device approved: ${n.deviceId.slice(0,8)}...`),!0)}function $R(r){let e=Ks;if(!e||!r)return!1;Bu(r),zs(r);for(let t of e.sockets.sockets.values())t.handshake.auth?.deviceId===r&&(t.data.approved=!0,t.emit("device:approved"),xa(t));return xt(`Device approved from pending: ${r.slice(0,8)}...`),!0}function Hu(r){let e=Ks;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&&xt(`Disconnected ${t} socket(s) for device ${r.slice(0,8)}...`),t}function qR(r){let e=Ks;if(!e)return!1;let t=Eg(r),n=e.sockets.sockets.get(r);return ju(r),t?.deviceId&&PR(t.deviceId,{ip:t.ip,socketId:r}),n&&(n.emit("device:rejected"),n.disconnect(!0)),St("deviceApproval",{action:"refresh"}),xt(`Device rejected: ${t?.deviceId?.slice(0,8)||"unknown"}...`),!0}async function UR(r){SR(),LR();let e=new Nb(r,{cors:{origin:"*",methods:["GET","POST"],credentials:!0,allowedHeaders:["*"]},transports:["websocket","polling"],allowEIO3:!0,allowUpgrades:!0,pingTimeout:6e4,pingInterval:25e3,maxHttpBufferSize:1e8}),t=await ES();return Hw(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,m)=>{if(n.data.approved)return m();let y=f[0];return y==="device:clientReady"||y==="disconnect"?m():m(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"],u=n.handshake.headers.origin,p=!u||La.includes(u);if(!c&&a&&p&&Bb(n.handshake.auth?.localToken)){n.data.approved=!0,n.data.localUi=!0,xt("Local UI connected \u2014 trusted (token)"),xa(n);return}if(Uw(n.id,i,s),xt(`Client connected: ${i} (device: ${s?.slice(0,8)||"none"})`),n.on("disconnect",f=>{Ww(n.id),ju(n.id),xt(`Client disconnected: ${i} (${f})`);let m=n.data?.protocol;if(m&&!n.data?.remoteAttached){try{m.close()}catch{}sl(m)}}),s&&ER(s))xt(`Device recognized: ${s.slice(0,8)}...`),n.data.approved=!0,xa(n);else if(s&&MR(s))IR(s,n.id,i),xt(`Rejected device reconnected: ${s.slice(0,8)} \u2014 waiting in Clients list`),n.emit("device:rejected"),St("deviceApproval",{action:"refresh"});else if(s&&Fu())Bu(s),zs(s),n.data.approved=!0,xt(`Auto-approved device: ${s.slice(0,8)}...`),xa(n),n.once("device:clientReady",()=>n.emit("device:approved")),St("deviceApproval",{action:"refresh"});else{if(xt(`Unknown device: ${s?.slice(0,8)||"no-id"} \u2014 waiting for approval`),kR(s)){xt(`Device ${s?.slice(0,8)} already pending, ignoring duplicate`),n.disconnect(!0);return}RR(n.id,{deviceId:s,ip:i}),n.once("device:clientReady",()=>{n.emit("device:pendingApproval"),St("deviceApproval",{socketId:n.id,deviceId:s,ip:i,action:"pending"})})}}),LT(e,FR()),yR(e),Ks=e,e}function WR(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 GR(r,e){return r.method==="OPTIONS"?(e.writeHead(200),e.end(),!0):!1}var Ys=require("zlib"),Ak=X(Sk(),1);var YU=["data:","javascript:","#","mailto:","blob:"],XU=["href","src","action","srcset","poster","data","formaction","data-src","data-href","data-url","data-background"];function Wu(r,e){return!r||YU.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 Ek(r,e){let t=`/proxy/${e}`,n=new RegExp(`(${XU.join("|")})=(["'])([^"']*?)\\2`,"gi");return r=r.replace(n,(i,s,o,a)=>{if(s.toLowerCase()==="srcset"){let c=a.split(",").map(u=>{let[p,...f]=u.trim().split(/\s+/),m=Wu(p,e);return f.length?`${m} ${f.join(" ")}`:m}).join(", ");return`${s}=${o}${c}${o}`}return`${s}=${o}${Wu(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 Tk(r){let e=`/proxy/${r}`;return`
|
|
149
154
|
// Service Worker for 9Remote Proxy - Port ${r}
|
|
150
155
|
const PROXY_BASE = '${e}';
|
|
151
156
|
const TARGET_PORT = ${r};
|
|
@@ -200,7 +205,7 @@ self.addEventListener('fetch', (event) => {
|
|
|
200
205
|
|
|
201
206
|
event.respondWith(fetch(new Request(newUrl, requestInit)));
|
|
202
207
|
});
|
|
203
|
-
`}function
|
|
208
|
+
`}function Ck(r){return`
|
|
204
209
|
<script data-proxy-injected="true">
|
|
205
210
|
(function() {
|
|
206
211
|
if (window.__proxySwRegistered) return;
|
|
@@ -242,7 +247,7 @@ self.addEventListener('fetch', (event) => {
|
|
|
242
247
|
});
|
|
243
248
|
}
|
|
244
249
|
})();
|
|
245
|
-
</script>`}var
|
|
250
|
+
</script>`}var $g=new Set;function Rk(r){$g.add(String(r))}function kk(r){$g.delete(String(r))}function JU(r){return $g.has(String(r))}function QU(r){switch(r){case"gzip":return(0,Ys.createGunzip)();case"deflate":return(0,Ys.createInflate)();case"br":return(0,Ys.createBrotliDecompress)();default:return null}}function ZU(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 Ok(){"";let r=Ak.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=Wu(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=QU(o),m=f?e.pipe(f):e,y=[];m.on("data",_=>y.push(_)),m.on("error",_=>{console.error("[Proxy] Decompress error:",_.message),n.writeHead(502),n.end("Bad Gateway: Decompression failed")}),m.on("end",()=>{let _=Buffer.concat(y).toString("utf8");_=Ek(_,i);let S=Ck(i);_=ZU(_,S),n.writeHead(e.statusCode,c),n.end(_)})}),r}function Pk(r,e,t,n,i,s){if(i==="/sw.js"){let o=Tk(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(!JU(n)){t.writeHead(401,{"Content-Type":"text/html"}),t.end(`
|
|
246
251
|
<!DOCTYPE html>
|
|
247
252
|
<html>
|
|
248
253
|
<head><title>Unauthorized</title></head>
|
|
@@ -253,8 +258,8 @@ self.addEventListener('fetch', (event) => {
|
|
|
253
258
|
</div>
|
|
254
259
|
</body>
|
|
255
260
|
</html>
|
|
256
|
-
`);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
|
|
257
|
-
`);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 PU(r,e=2e3){return new Promise(t=>{let n=pk.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 MU(r,e=2e3){return new Promise(t=>{let n=fk.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 IU(r){let[e,t]=await Promise.all([PU(r),MU(r)]);return t.active?{port:r,...t}:e.active?{port:r,...e}:{port:r,active:!1}}async function mk(){let r=await OU();return(await Promise.all(r.map(t=>IU(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 gk=X(require("crypto"),1),NU=process.env.API_KEY_SECRET||"9remote-api-key-secret";function LU(){let r="abcdefghijklmnopqrstuvwxyz0123456789",e="";for(let t=0;t<4;t++)e+=r.charAt(Math.floor(Math.random()*r.length));return e}function vk(r,e){return gk.default.createHmac("sha256",NU).update(r+e).digest("hex").slice(0,6)}function xk(r){let e=r.slice(0,8),t=LU(),n=vk(e,t);return{key:`sk-${e}-${t}-${n}`,keyId:t}}function DU(r){if(!r||!r.startsWith("sk-"))return null;let e=r.split("-");if(e.length===4){let[,t,n,i]=e,s=vk(t,n);return i!==s?null:{machineId:t,keyId:n}}return null}function Pu(r){return DU(r)!==null}async function yk(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(!Pu(n)){e.setHeader("Content-Type","application/json"),e.writeHead(401),e.end(JSON.stringify({error:"Unauthorized: Invalid API key"}));return}let i=await mk();e.setHeader("Content-Type","application/json"),e.writeHead(200),e.end(JSON.stringify(i))}var wk=require("url");var Rg=X(require("path"),1),Sk=X(require("os"),1);gt();var _k=X(require("path"),1),bk=X(require("os"),1);var _K=_k.default.join(bk.default.homedir(),".9remote","pids");var CK=Rg.default.dirname((0,wk.fileURLToPath)(__importMetaUrl)),BU="9remote",AK=`https://registry.npmjs.org/${BU}/latest`;var RK=Rg.default.join(Sk.default.homedir(),".9remote","cloudflared.pid");function Ek(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}ci();er();gt();Oo();var Ck=X(Tk(),1),Og=X(require("crypto"),1),{machineIdSync:jU}=Ck.default;async function Ak(r=null){let e=r||process.env.MACHINE_ID_SALT||"9remote-salt";try{let t=jU();return Og.default.createHash("sha256").update(t+e).digest("hex").substring(0,16)}catch(t){return console.error("Error getting machine ID:",t),Og.default.randomUUID().replace(/-/g,"").substring(0,16)}}ci();async function Rk(r,e){let t=ww(),n=t.workerUrl||"https://9remote.cc";if(!t.permanentKey){Ee(e,400,"No permanent key set");return}try{let s=await(await Qs(`${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}`;jn({oneTimeKey:s.tempKey,oneTimeKeyExpiresAt:s.expiresAt,qrUrl:o}),re(e,{oneTimeKey:s.tempKey,expiresAt:s.expiresAt,qrUrl:o})}catch(i){Ee(e,500,i.message)}}async function kk(r,e){try{let t=await Ak(),{key:n}=xk(t),i=rw();nw(t,n,i?.name||"Default"),jn({permanentKey:n}),re(e,{ok:!0,permanentKey:n})}catch(t){Ee(e,500,t.message)}}er();async function Ok(r,e){let t=await _r(r,e);if(!t)return;let n=yR(t.socketId);re(e,{ok:n})}async function Pk(r,e){let t=await _r(r,e);if(!t)return;let n=bR(t.socketId);re(e,{ok:n})}function Mk(r,e){re(e,{pending:lR()})}function Ik(r,e){re(e,{devices:oR()})}function Nk(r,e){re(e,{rejected:dR()})}async function Lk(r,e){let t=await _r(r,e);if(!t)return;let n=_R(t.deviceId);re(e,{ok:n})}async function Dk(r,e){let t=await _r(r,e);t&&(Cu(t.deviceId),Gs(t.deviceId),re(e))}async function Bk(r,e){let t=await _r(r,e);t&&(Cu(t.deviceId),sR(t.deviceId),re(e))}async function jk(r,e){let t=await _r(r,e);if(!t)return;let n=Cu(t.deviceId);re(e,{disconnected:n})}function Fk(r,e){re(e,{enabled:Eu()})}async function Hk(r,e){let t=await _r(r,e);if(!t)return;let n=mR(!!t.enabled);re(e,{enabled:n})}er();var $k={},FU=1e4;function qk(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 Uk(r,e){let t="";await new Promise(n=>{r.on("data",i=>t+=i),r.on("end",n)});try{Gk(qk(t,null)),re(e,{success:!0})}catch{Ee(e,400,"Invalid JSON")}}function Wk(r,e,{query:t}){Gk(qk(null,t)),re(e,{success:!0})}function Gk({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};aT(e,s),Cr(i,"chatNotification",s);let o=`${t}:${r}`;n-($k[o]||0)<FU||($k[o]=n,i.timeout(5e3).emit("chatNotificationAck",s,(a,c)=>{!(!a&&c&&c.length>0)&&i.sockets.sockets.size===0&&eT(s)}))}er();hl();Oo();yt();ci();function zk(){return{mode:Yd(),active:Vd(),presets:Object.keys(Z.sleepInhibit?.presets||{})}}function Kk(r,e){re(e,zk())}async function Vk(r,e){let t=await _r(r,e);if(!t)return;let n=jo(t.mode);tw({sleepInhibitMode:n});let i=zk();_t("sleepInhibit",i),re(e,i)}hl();Oo();yt();hv();var Un=En("server"),Wn=(0,Jk.fileURLToPath)(new URL(".",__importMetaUrl)),Qk=process.env.NODE_ENV==="development",HU=5173,$U="https://registry.npmjs.org/9remote/latest",Pg=(0,Si.existsSync)((0,Qt.join)(Wn,"ui","dist"))?(0,Qt.join)(Wn,"ui","dist"):(0,Qt.join)(Wn,"ui"),qU={".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 UU(r,e,t){let n=(0,Mu.request)({hostname:"localhost",port:HU,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 Yk(r,e){if(!(0,Si.existsSync)(e))return!1;let t=qU[(0,Qt.extname)(e)]||"application/octet-stream";return r.setHeader("Content-Type",t),r.writeHead(200),r.end((0,Si.readFileSync)(e)),!0}async function WU(r){try{let e=await Qs($U);if(!e.ok)return;let{version:t}=await e.json();t&&Ek(r,t)&&_t("updateAvailable",{version:t})}catch{}}function GU(r,e){if(process.env.CODESPACES!=="true"){Ee(e,400,"Not running on Codespaces");return}let t=process.env.CODESPACE_NAME;if(!t){Ee(e,400,"Codespace name not found");return}let n=ma();n&&n.emit("codespace:stopping"),re(e,{success:!0,message:"Stopping codespace..."}),setTimeout(()=>(0,Iu.execFile)("gh",["codespace","stop","-c",t],{windowsHide:!0}),500)}var Zk;async function Xk(r,e,{pathname:t}){let n=r.headers.authorization;if(!n||!n.startsWith("Bearer ")||!Pu(n.slice(7))){Ee(e,401,"Unauthorized");return}let{parseJsonBody:i}=await Promise.resolve().then(()=>(er(),Ci)),s=await i(r,e);if(s){if(!s.port){Ee(e,400,"Port required");return}t.endsWith("start")?ak(s.port):ck(s.port),re(e,{success:!0})}}function zU(r,e,{pathname:t,search:n}){let i=t.match(/^\/proxy\/(\d+)(\/.*)?$/);i?uk(Zk,r,e,i[1],i[2]||"/",n):Ee(e,404,"Not found")}var KU=[{path:"/api/health",method:"GET",public:!0,handler:(r,e)=>re(e,{status:"ok",timestamp:Date.now()})},{path:"/api/version",method:"GET",public:!0,handler:(r,e)=>{re(e,{version:"2.0.22"})}},{path:"/api/notify",method:"POST",public:!0,handler:Uk},{path:"/api/notify",method:"GET",public:!0,handler:Wk},{path:"/proxy/*",method:"*",public:!0,handler:zU},{path:"/api/ui/events",method:"GET",handler:kw},{path:"/api/ui/state",method:"GET",handler:Ow},{path:"/api/ui/state",method:"POST",handler:Pw},{path:"/api/ui/stop",method:"POST",handler:Mw},{path:"/api/ui/start",method:"POST",handler:Iw},{path:"/api/ui/shutdown",method:"POST",handler:Nw},{path:"/api/key/one-time",method:"POST",handler:Rk},{path:"/api/key/regenerate",method:"POST",handler:kk},{path:"/api/device/approve",method:"POST",handler:Ok},{path:"/api/device/reject",method:"POST",handler:Pk},{path:"/api/device/pending",method:"GET",handler:Mk},{path:"/api/device/approved",method:"GET",handler:Ik},{path:"/api/device/rejected",method:"GET",handler:Nk},{path:"/api/device/approve-rejected",method:"POST",handler:Lk},{path:"/api/device/clear-rejected",method:"POST",handler:Dk},{path:"/api/device/remove",method:"POST",handler:Bk},{path:"/api/device/disconnect",method:"POST",handler:jk},{path:"/api/device/auto-approve",method:"GET",handler:Fk},{path:"/api/device/auto-approve",method:"POST",handler:Hk},{path:"/api/connections",method:"GET",handler:Lw},{path:"/api/logs",method:"GET",handler:Dw},{path:"/api/permissions",method:"GET",handler:jw},{path:"/api/permissions/request",method:"POST",handler:$w},{path:"/api/desktop/toggle",method:"POST",handler:Bw},{path:"/api/autostart",method:"GET",handler:Fw},{path:"/api/autostart",method:"POST",handler:Hw},{path:"/api/sleep-inhibit",method:"GET",handler:Kk},{path:"/api/sleep-inhibit",method:"POST",handler:Vk},{path:"/api/local-sites",method:"*",public:!0,handler:yk},{path:"/api/codespace/stop",method:"POST",handler:GU},{path:"/api/proxy/start",method:"POST",public:!0,handler:Xk},{path:"/api/proxy/end",method:"POST",public:!0,handler:Xk}];var VU=parseInt(process.env.PORT||"2208",10),Ea=null;function YU(){if(!Qk)return;let r=(0,Qt.join)(Wn,"vite.config.js");if(!(0,Si.existsSync)(r))return;let e=(0,Si.existsSync)((0,Qt.join)(Wn,"node_modules",".bin","vite"))?(0,Qt.join)(Wn,"node_modules",".bin","vite"):(0,Qt.join)(Wn,"..","node_modules",".bin","vite");Ea=(0,Iu.spawn)("node",[e,"--config",r],{cwd:Wn,stdio:"ignore",detached:!1}),Ea.on("error",()=>{}),Ea.unref()}async function eO(){let r=Hd(),e=r.sleepInhibitMode;e||(r.sleepInhibit===!1?e="never":e=Z.sleepInhibit?.defaultMode||"never"),jo(e),await dT(),Zk=lk(),YU();let n=np(KU,{fallback:(a,c,{pathname:u})=>{if(u.startsWith("/api/")||u.startsWith("/socket.io")){Ee(c,404,"Not found");return}let p=!!a.headers["cf-connecting-ip"],f=a.socket.remoteAddress==="127.0.0.1"||a.socket.remoteAddress==="::1";if(p||!f){Ee(c,403,"Forbidden");return}let g=()=>{let y=u==="/"||u===""?(0,Qt.join)(Pg,"index.html"):(0,Qt.join)(Pg,u);Yk(c,y)||Yk(c,(0,Qt.join)(Pg,"index.html"))};if(Qk){UU(a,c,g);return}g()}}),i=(0,Mu.createServer)(async(a,c)=>{SR(c),!ER(a,c)&&await n(a,c)});_w(),bw(),gl(),process.platform==="darwin"&&setInterval(gl,lv),await wR(i),i.listen(VU,a=>{if(a)throw a;WU("2.0.22")});let s=!1,o=async a=>{if(s)return;s=!0,Kd(),Un.info(`\u{1F6D1} Received ${a}, shutting down gracefully...`);let c=setTimeout(()=>{Un.error("\u26A0\uFE0F Forced exit"),process.exit(1)},5e3);try{if(i.close(()=>Un.info("\u2713 HTTP server closed")),Ea)try{Ea.kill()}catch{}let u=ma();u&&(u.emit("server:shutdown"),u.close(()=>Un.info("\u2713 Socket.IO closed"))),await new Promise(p=>setTimeout(p,500)),clearTimeout(c),Un.info("\u2705 Server stopped cleanly"),process.exit(0)}catch(u){Un.error(`\u274C Error during shutdown: ${u?.message||u}`),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=>{Un.error(`\u26A0\uFE0F uncaughtException: ${a?.stack||a}`)}),process.on("unhandledRejection",a=>{Un.error(`\u26A0\uFE0F unhandledRejection: ${a?.stack||a}`)}),i}eO();0&&(module.exports={startServer});
|
|
261
|
+
`);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 Mk=X(require("http"),1),Ik=X(require("https"),1),Nk=require("child_process"),Lk=require("util"),e4=(0,Lk.promisify)(Nk.exec);async function t4(){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 e4(t),i=n.split(`
|
|
262
|
+
`);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 r4(r,e=2e3){return new Promise(t=>{let n=Mk.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 n4(r,e=2e3){return new Promise(t=>{let n=Ik.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 i4(r){let[e,t]=await Promise.all([r4(r),n4(r)]);return t.active?{port:r,...t}:e.active?{port:r,...e}:{port:r,active:!1}}async function Dk(){let r=await t4();return(await Promise.all(r.map(t=>i4(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 Bk=X(require("crypto"),1),s4=process.env.API_KEY_SECRET||"9remote-api-key-secret";function o4(){let r="abcdefghijklmnopqrstuvwxyz0123456789",e="";for(let t=0;t<4;t++)e+=r.charAt(Math.floor(Math.random()*r.length));return e}function jk(r,e){return Bk.default.createHmac("sha256",s4).update(r+e).digest("hex").slice(0,6)}function Fk(r){let e=r.slice(0,8),t=o4(),n=jk(e,t);return{key:`sk-${e}-${t}-${n}`,keyId:t}}function a4(r){if(!r||!r.startsWith("sk-"))return null;let e=r.split("-");if(e.length===4){let[,t,n,i]=e,s=jk(t,n);return i!==s?null:{machineId:t,keyId:n}}return null}function Gu(r){return a4(r)!==null}async function Hk(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(!Gu(n)){e.setHeader("Content-Type","application/json"),e.writeHead(401),e.end(JSON.stringify({error:"Unauthorized: Invalid API key"}));return}let i=await Dk();e.setHeader("Content-Type","application/json"),e.writeHead(200),e.end(JSON.stringify(i))}el();var Uk=require("url");var qg=X(require("path"),1),Wk=X(require("os"),1);gt();var $k=X(require("path"),1),qk=X(require("os"),1);var JK=$k.default.join(qk.default.homedir(),".9remote","pids");var nV=qg.default.dirname((0,Uk.fileURLToPath)(__importMetaUrl)),c4="9remote",iV=`https://registry.npmjs.org/${c4}/latest`;var sV=qg.default.join(Wk.default.homedir(),".9remote","cloudflared.pid");function Gk(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}fi();Gt();gt();Mo();var Kk=X(zk(),1),Wg=X(require("crypto"),1),{machineIdSync:l4}=Kk.default;async function Vk(r=null){let e=r||process.env.MACHINE_ID_SALT||"9remote-salt";try{let t=l4();return Wg.default.createHash("sha256").update(t+e).digest("hex").substring(0,16)}catch(t){return console.error("Error getting machine ID:",t),Wg.default.randomUUID().replace(/-/g,"").substring(0,16)}}fi();async function Yk(r,e){let t=jw(),n=t.workerUrl||"https://9remote.cc";if(!t.permanentKey){he(e,400,"No permanent key set");return}try{let s=await(await eo(`${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}`;Hn({oneTimeKey:s.tempKey,oneTimeKeyExpiresAt:s.expiresAt,qrUrl:o}),ee(e,{oneTimeKey:s.tempKey,expiresAt:s.expiresAt,qrUrl:o})}catch(i){he(e,500,i.message)}}async function Xk(r,e){try{let t=await Vk(),{key:n}=Fk(t),i=xw();yw(t,n,i?.name||"Default"),Hn({permanentKey:n}),ee(e,{ok:!0,permanentKey:n})}catch(t){he(e,500,t.message)}}Gt();async function Jk(r,e){let t=await It(r,e);if(!t)return;let n=HR(t.socketId);ee(e,{ok:n})}async function Qk(r,e){let t=await It(r,e);if(!t)return;let n=qR(t.socketId);ee(e,{ok:n})}function Zk(r,e){ee(e,{pending:OR()})}function eO(r,e){ee(e,{devices:AR()})}function tO(r,e){ee(e,{rejected:NR()})}async function rO(r,e){let t=await It(r,e);if(!t)return;let n=$R(t.deviceId);ee(e,{ok:n})}async function nO(r,e){let t=await It(r,e);t&&(Hu(t.deviceId),zs(t.deviceId),ee(e))}async function iO(r,e){let t=await It(r,e);t&&(Hu(t.deviceId),TR(t.deviceId),ee(e))}async function sO(r,e){let t=await It(r,e);if(!t)return;let n=Hu(t.deviceId);ee(e,{disconnected:n})}function oO(r,e){ee(e,{enabled:Fu()})}async function aO(r,e){let t=await It(r,e);if(!t)return;let n=CR(t.deviceId,t.label);ee(e,{ok:n})}async function cO(r,e){let t=await It(r,e);if(!t)return;let n=DR(!!t.enabled);ee(e,{enabled:n})}Gt();var lO={},u4=1e4;function uO(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 pO(r,e){let t="";await new Promise(n=>{r.on("data",i=>t+=i),r.on("end",n)});try{dO(uO(t,null)),ee(e,{success:!0})}catch{he(e,400,"Invalid JSON")}}function fO(r,e,{query:t}){dO(uO(null,t)),ee(e,{success:!0})}function dO({type:r,sessionId:e,tool:t}){let n=Date.now(),i=ya();if(!i||!e)return;let s={type:r,sessionId:e,tool:t,timestamp:n};if(_T(e,s),wt(i,"chatNotification",s),!yT())return;let o=`${t}:${r}`;n-(lO[o]||0)<u4||(lO[o]=n,i.timeout(5e3).emit("chatNotificationAck",s,(a,c)=>{!a&&c&&c.length>0||vT(s)}))}Gt();Cl();Mo();bt();fi();function hO(){return{mode:ph(),active:uh(),presets:Object.keys(Z.sleepInhibit?.presets||{})}}function mO(r,e){ee(e,hO())}async function gO(r,e){let t=await It(r,e);if(!t)return;let n=Ho(t.mode);vw({sleepInhibitMode:n});let i=hO();St("sleepInhibit",i),ee(e,i)}Gt();async function vO(r,e){try{let t=await hl();ee(e,{sessions:t})}catch(t){he(e,500,t.message)}}async function xO(r,e){let t=await It(r,e);if(t){if(!t.sessionId)return he(e,400,"sessionId required");try{await ui(t.sessionId),ee(e)}catch(n){he(e,500,n.message)}}}Cl();Mo();bt();Ov();var zn=An("server"),Kn=(0,bO.fileURLToPath)(new URL(".",__importMetaUrl)),wO=process.env.NODE_ENV==="development",p4=5173,f4="https://registry.npmjs.org/9remote/latest",Gg=(0,Ci.existsSync)((0,tr.join)(Kn,"ui","dist"))?(0,tr.join)(Kn,"ui","dist"):(0,tr.join)(Kn,"ui"),d4={".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 h4(r,e,t){let n=(0,zu.request)({hostname:"localhost",port:p4,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 yO(r,e){if(!(0,Ci.existsSync)(e))return!1;let t=d4[(0,tr.extname)(e)]||"application/octet-stream";return r.setHeader("Content-Type",t),r.writeHead(200),r.end((0,Ci.readFileSync)(e)),!0}async function m4(r){try{let e=await eo(f4);if(!e.ok)return;let{version:t}=await e.json();t&&Gk(r,t)&&St("updateAvailable",{version:t})}catch{}}function g4(r,e){if(process.env.CODESPACES!=="true"){he(e,400,"Not running on Codespaces");return}let t=process.env.CODESPACE_NAME;if(!t){he(e,400,"Codespace name not found");return}let n=ya();n&&n.emit("codespace:stopping"),ee(e,{success:!0,message:"Stopping codespace..."}),setTimeout(()=>(0,Ku.execFile)("gh",["codespace","stop","-c",t],{windowsHide:!0}),500)}var SO;async function _O(r,e,{pathname:t}){let n=r.headers.authorization;if(!n||!n.startsWith("Bearer ")||!Gu(n.slice(7))){he(e,401,"Unauthorized");return}let{parseJsonBody:i}=await Promise.resolve().then(()=>(Gt(),ki)),s=await i(r,e);if(s){if(!s.port){he(e,400,"Port required");return}t.endsWith("start")?Rk(s.port):kk(s.port),ee(e,{success:!0})}}function v4(r,e,{pathname:t,search:n}){let i=t.match(/^\/proxy\/(\d+)(\/.*)?$/);i?Pk(SO,r,e,i[1],i[2]||"/",n):he(e,404,"Not found")}var x4=[{path:"/api/health",method:"GET",public:!0,handler:(r,e)=>ee(e,{status:"ok",timestamp:Date.now()})},{path:"/api/version",method:"GET",public:!0,handler:(r,e)=>{ee(e,{version:"2.0.26"})}},{path:"/api/notify",method:"POST",public:!0,handler:pO},{path:"/api/notify",method:"GET",public:!0,handler:fO},{path:"/proxy/*",method:"*",public:!0,handler:v4},{path:"/api/ui/events",method:"GET",handler:zw},{path:"/api/local-token",method:"GET",handler:qw},{path:"/api/ui/state",method:"GET",handler:Kw},{path:"/api/ui/state",method:"POST",handler:Vw},{path:"/api/ui/stop",method:"POST",handler:Yw},{path:"/api/ui/start",method:"POST",handler:Xw},{path:"/api/ui/shutdown",method:"POST",handler:Jw},{path:"/api/key/one-time",method:"POST",handler:Yk},{path:"/api/key/regenerate",method:"POST",handler:Xk},{path:"/api/device/approve",method:"POST",handler:Jk},{path:"/api/device/reject",method:"POST",handler:Qk},{path:"/api/device/pending",method:"GET",handler:Zk},{path:"/api/device/approved",method:"GET",handler:eO},{path:"/api/device/rejected",method:"GET",handler:tO},{path:"/api/device/approve-rejected",method:"POST",handler:rO},{path:"/api/device/clear-rejected",method:"POST",handler:nO},{path:"/api/device/remove",method:"POST",handler:iO},{path:"/api/device/label",method:"POST",handler:aO},{path:"/api/device/disconnect",method:"POST",handler:sO},{path:"/api/device/auto-approve",method:"GET",handler:oO},{path:"/api/device/auto-approve",method:"POST",handler:cO},{path:"/api/connections",method:"GET",handler:Qw},{path:"/api/logs",method:"GET",handler:Zw},{path:"/api/permissions",method:"GET",handler:tS},{path:"/api/permissions/request",method:"POST",handler:iS},{path:"/api/desktop/toggle",method:"POST",handler:eS},{path:"/api/autostart",method:"GET",handler:rS},{path:"/api/autostart",method:"POST",handler:nS},{path:"/api/sleep-inhibit",method:"GET",handler:mO},{path:"/api/sleep-inhibit",method:"POST",handler:gO},{path:"/api/sessions",method:"GET",handler:vO},{path:"/api/sessions/delete",method:"POST",handler:xO},{path:"/api/local-sites",method:"*",public:!0,handler:Hk},{path:"/api/codespace/stop",method:"POST",handler:g4},{path:"/api/proxy/start",method:"POST",public:!0,handler:_O},{path:"/api/proxy/end",method:"POST",public:!0,handler:_O}];var y4=parseInt(process.env.PORT||"2208",10),Ra=null;function _4(){if(!wO)return;let r=(0,tr.join)(Kn,"vite.config.js");if(!(0,Ci.existsSync)(r))return;let e=(0,Ci.existsSync)((0,tr.join)(Kn,"node_modules",".bin","vite"))?(0,tr.join)(Kn,"node_modules",".bin","vite"):(0,tr.join)(Kn,"..","node_modules",".bin","vite");Ra=(0,Ku.spawn)("node",[e,"--config",r],{cwd:Kn,stdio:"ignore",detached:!1}),Ra.on("error",()=>{}),Ra.unref()}async function EO(){let r=rh(),e=r.sleepInhibitMode;e||(r.sleepInhibit===!1?e="never":e=Z.sleepInhibit?.defaultMode||"never"),Ho(e),await NT(),SO=Ok(),_4();let n=vp(x4,{fallback:(a,c,{pathname:u})=>{if(u.startsWith("/api/")||u.startsWith("/socket.io")){he(c,404,"Not found");return}let p=!!a.headers["cf-connecting-ip"],f=a.socket.remoteAddress==="127.0.0.1"||a.socket.remoteAddress==="::1";if(p||!f){he(c,403,"Forbidden");return}let m=()=>{let y=u==="/"||u===""?(0,tr.join)(Gg,"index.html"):(0,tr.join)(Gg,u);yO(c,y)||yO(c,(0,tr.join)(Gg,"index.html"))};if(wO){h4(a,c,m);return}m()}}),i=(0,zu.createServer)(async(a,c)=>{WR(c),!GR(a,c)&&await n(a,c)});Bd(),Dw(),Bw(),Rl(),process.platform==="darwin"&&setInterval(Rl,Sv),await UR(i),i.listen(y4,a=>{if(a)throw a;m4("2.0.26")});let s=!1,o=async a=>{if(s)return;s=!0,lh(),zn.info(`\u{1F6D1} Received ${a}, shutting down gracefully...`);let c=setTimeout(()=>{zn.error("\u26A0\uFE0F Forced exit"),process.exit(1)},5e3);try{if(i.close(()=>zn.info("\u2713 HTTP server closed")),Ra)try{Ra.kill()}catch{}let u=ya();u&&(u.emit("server:shutdown"),u.close(()=>zn.info("\u2713 Socket.IO closed"))),await new Promise(p=>setTimeout(p,500)),clearTimeout(c),zn.info("\u2705 Server stopped cleanly"),process.exit(0)}catch(u){zn.error(`\u274C Error during shutdown: ${u?.message||u}`),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=>{zn.error(`\u26A0\uFE0F uncaughtException: ${a?.stack||a}`)}),process.on("unhandledRejection",a=>{zn.error(`\u26A0\uFE0F unhandledRejection: ${a?.stack||a}`)}),i}EO();0&&(module.exports={startServer});
|
|
258
263
|
/*! Bundled license information:
|
|
259
264
|
|
|
260
265
|
negotiator/index.js:
|