9remote 2.1.16 → 2.1.20
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 +51 -51
- package/dist/server.cjs +67 -67
- package/dist/ui/assets/{index-CChQTRnB.css → index-Cq9ojg5L.css} +18 -0
- package/dist/ui/assets/{index-UDvTKes9.js → index-UFRGjGeL.js} +46800 -46699
- package/dist/ui/index.html +2 -2
- package/package.json +1 -1
package/dist/server.cjs
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
const __importMetaUrl = require('url').pathToFileURL(__filename).href;
|
|
2
|
-
var
|
|
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
|
|
4
|
-
=== SESSION ${new Date().toISOString()} pid=${process.pid} argv=${process.argv.slice(2).join(" ")} ===`),
|
|
5
|
-
`).filter(Boolean).slice(-r)}catch{return[]}}function Fr(r){return{info:(...e)=>So(r,"info",$p(e)),warn:(...e)=>So(r,"warn",$p(e)),error:(...e)=>So(r,"error",$p(e))}}var jr,Wp,rc,nc,ic,Qv,Hp,kM,RM,ri=Ce(()=>{jr=W(require("fs"),1),Wp=W(require("path"),1);St();rc=se.LOGS,nc=Wp.default.join(rc,_o.fileName),ic=Wp.default.join(rc,_o.rotatedName),Qv=!1,Hp=null;kM=/\x1b\[[0-9;]*m/g,RM=/https?:\/\/[^\s]+/g});var ay=k((u6,zp)=>{"use strict";zp.exports=oy;zp.exports.preferredCharsets=oy;var PM=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function IM(r){for(var e=r.split(","),t=0,n=0;t<e.length;t++){var i=NM(e[t].trim(),t);i&&(e[n++]=i)}return e.length=n,e}function NM(r,e){var t=PM.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 DM(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=LM(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function LM(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 oy(r,e){var t=IM(r===void 0?"*":r||"");if(!e)return t.filter(sy).sort(iy).map(BM);var n=e.map(function(s,o){return DM(s,t,o)});return n.filter(sy).sort(iy).map(function(s){return e[n.indexOf(s)]})}function iy(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function BM(r){return r.charset}function sy(r){return r.q>0}});var fy=k((p6,Vp)=>{"use strict";Vp.exports=py;Vp.exports.preferredEncodings=py;var jM=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function FM(r){for(var e=r.split(","),t=!1,n=1,i=0,s=0;i<e.length;i++){var o=UM(e[i].trim(),i);o&&(e[s++]=o,t=t||uy("identity",o),n=Math.min(n,o.q||1))}return t||(e[s++]={encoding:"identity",q:n,i}),e.length=s,e}function UM(r,e){var t=jM.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 qM(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=uy(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function uy(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 py(r,e){var t=FM(r||"");if(!e)return t.filter(ly).sort(cy).map($M);var n=e.map(function(s,o){return qM(s,t,o)});return n.filter(ly).sort(cy).map(function(s){return e[n.indexOf(s)]})}function cy(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function $M(r){return r.encoding}function ly(r){return r.q>0}});var vy=k((f6,Kp)=>{"use strict";Kp.exports=gy;Kp.exports.preferredLanguages=gy;var HM=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function WM(r){for(var e=r.split(","),t=0,n=0;t<e.length;t++){var i=my(e[t].trim(),t);i&&(e[n++]=i)}return e.length=n,e}function my(r,e){var t=HM.exec(r);if(!t)return null;var n=t[1],i=t[2],s=n;i&&(s+="-"+i);var o=1;if(t[3])for(var a=t[3].split(";"),c=0;c<a.length;c++){var l=a[c].split("=");l[0]==="q"&&(o=parseFloat(l[1]))}return{prefix:n,suffix:i,q:o,i:e,full:s}}function GM(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=zM(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function zM(r,e,t){var n=my(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 gy(r,e){var t=WM(r===void 0?"*":r||"");if(!e)return t.filter(hy).sort(dy).map(VM);var n=e.map(function(s,o){return GM(s,t,o)});return n.filter(hy).sort(dy).map(function(s){return e[n.indexOf(s)]})}function dy(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function VM(r){return r.full}function hy(r){return r.q>0}});var Sy=k((d6,Yp)=>{"use strict";Yp.exports=by;Yp.exports.preferredMediaTypes=by;var KM=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function YM(r){for(var e=eP(r),t=0,n=0;t<e.length;t++){var i=_y(e[t].trim(),t);i&&(e[n++]=i)}return e.length=n,e}function _y(r,e){var t=KM.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=tP(t[3]).map(QM),c=0;c<a.length;c++){var l=a[c],u=l[0].toLowerCase(),f=l[1],d=f&&f[0]==='"'&&f[f.length-1]==='"'?f.substr(1,f.length-2):f;if(u==="q"){i=parseFloat(d);break}n[u]=d}return{type:o,subtype:s,params:n,q:i,i:e}}function XM(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=JM(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function JM(r,e,t){var n=_y(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 by(r,e){var t=YM(r===void 0?"*/*":r||"");if(!e)return t.filter(xy).sort(yy).map(ZM);var n=e.map(function(s,o){return XM(s,t,o)});return n.filter(xy).sort(yy).map(function(s){return e[n.indexOf(s)]})}function yy(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function ZM(r){return r.type+"/"+r.subtype}function xy(r){return r.q>0}function wy(r){for(var e=0,t=0;(t=r.indexOf('"',t))!==-1;)e++,t++;return e}function QM(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 eP(r){for(var e=r.split(","),t=1,n=0;t<e.length;t++)wy(e[n])%2==0?e[++n]=e[t]:e[n]+=","+e[t];return e.length=n+1,e}function tP(r){for(var e=r.split(";"),t=1,n=0;t<e.length;t++)wy(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 Ey=k((h6,Xp)=>{"use strict";var rP=ay(),nP=fy(),iP=vy(),sP=Sy();Xp.exports=pe;Xp.exports.Negotiator=pe;function pe(r){if(!(this instanceof pe))return new pe(r);this.request=r}pe.prototype.charset=function(e){var t=this.charsets(e);return t&&t[0]};pe.prototype.charsets=function(e){return rP(this.request.headers["accept-charset"],e)};pe.prototype.encoding=function(e){var t=this.encodings(e);return t&&t[0]};pe.prototype.encodings=function(e){return nP(this.request.headers["accept-encoding"],e)};pe.prototype.language=function(e){var t=this.languages(e);return t&&t[0]};pe.prototype.languages=function(e){return iP(this.request.headers["accept-language"],e)};pe.prototype.mediaType=function(e){var t=this.mediaTypes(e);return t&&t[0]};pe.prototype.mediaTypes=function(e){return sP(this.request.headers.accept,e)};pe.prototype.preferredCharset=pe.prototype.charset;pe.prototype.preferredCharsets=pe.prototype.charsets;pe.prototype.preferredEncoding=pe.prototype.encoding;pe.prototype.preferredEncodings=pe.prototype.encodings;pe.prototype.preferredLanguage=pe.prototype.language;pe.prototype.preferredLanguages=pe.prototype.languages;pe.prototype.preferredMediaType=pe.prototype.mediaType;pe.prototype.preferredMediaTypes=pe.prototype.mediaTypes});var Ty=k((m6,oP)=>{oP.exports={"application/1d-interleaved-parityfec":{source:"iana"},"application/3gpdash-qoe-report+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/3gpp-ims+xml":{source:"iana",compressible:!0},"application/3gpphal+json":{source:"iana",compressible:!0},"application/3gpphalforms+json":{source:"iana",compressible:!0},"application/a2l":{source:"iana"},"application/ace+cbor":{source:"iana"},"application/activemessage":{source:"iana"},"application/activity+json":{source:"iana",compressible:!0},"application/alto-costmap+json":{source:"iana",compressible:!0},"application/alto-costmapfilter+json":{source:"iana",compressible:!0},"application/alto-directory+json":{source:"iana",compressible:!0},"application/alto-endpointcost+json":{source:"iana",compressible:!0},"application/alto-endpointcostparams+json":{source:"iana",compressible:!0},"application/alto-endpointprop+json":{source:"iana",compressible:!0},"application/alto-endpointpropparams+json":{source:"iana",compressible:!0},"application/alto-error+json":{source:"iana",compressible:!0},"application/alto-networkmap+json":{source:"iana",compressible:!0},"application/alto-networkmapfilter+json":{source:"iana",compressible:!0},"application/alto-updatestreamcontrol+json":{source:"iana",compressible:!0},"application/alto-updatestreamparams+json":{source:"iana",compressible:!0},"application/aml":{source:"iana"},"application/andrew-inset":{source:"iana",extensions:["ez"]},"application/applefile":{source:"iana"},"application/applixware":{source:"apache",extensions:["aw"]},"application/at+jwt":{source:"iana"},"application/atf":{source:"iana"},"application/atfx":{source:"iana"},"application/atom+xml":{source:"iana",compressible:!0,extensions:["atom"]},"application/atomcat+xml":{source:"iana",compressible:!0,extensions:["atomcat"]},"application/atomdeleted+xml":{source:"iana",compressible:!0,extensions:["atomdeleted"]},"application/atomicmail":{source:"iana"},"application/atomsvc+xml":{source:"iana",compressible:!0,extensions:["atomsvc"]},"application/atsc-dwd+xml":{source:"iana",compressible:!0,extensions:["dwd"]},"application/atsc-dynamic-event-message":{source:"iana"},"application/atsc-held+xml":{source:"iana",compressible:!0,extensions:["held"]},"application/atsc-rdt+json":{source:"iana",compressible:!0},"application/atsc-rsat+xml":{source:"iana",compressible:!0,extensions:["rsat"]},"application/atxml":{source:"iana"},"application/auth-policy+xml":{source:"iana",compressible:!0},"application/bacnet-xdd+zip":{source:"iana",compressible:!1},"application/batch-smtp":{source:"iana"},"application/bdoc":{compressible:!1,extensions:["bdoc"]},"application/beep+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/calendar+json":{source:"iana",compressible:!0},"application/calendar+xml":{source:"iana",compressible:!0,extensions:["xcs"]},"application/call-completion":{source:"iana"},"application/cals-1840":{source:"iana"},"application/captive+json":{source:"iana",compressible:!0},"application/cbor":{source:"iana"},"application/cbor-seq":{source:"iana"},"application/cccex":{source:"iana"},"application/ccmp+xml":{source:"iana",compressible:!0},"application/ccxml+xml":{source:"iana",compressible:!0,extensions:["ccxml"]},"application/cdfx+xml":{source:"iana",compressible:!0,extensions:["cdfx"]},"application/cdmi-capability":{source:"iana",extensions:["cdmia"]},"application/cdmi-container":{source:"iana",extensions:["cdmic"]},"application/cdmi-domain":{source:"iana",extensions:["cdmid"]},"application/cdmi-object":{source:"iana",extensions:["cdmio"]},"application/cdmi-queue":{source:"iana",extensions:["cdmiq"]},"application/cdni":{source:"iana"},"application/cea":{source:"iana"},"application/cea-2018+xml":{source:"iana",compressible:!0},"application/cellml+xml":{source:"iana",compressible:!0},"application/cfw":{source:"iana"},"application/city+json":{source:"iana",compressible:!0},"application/clr":{source:"iana"},"application/clue+xml":{source:"iana",compressible:!0},"application/clue_info+xml":{source:"iana",compressible:!0},"application/cms":{source:"iana"},"application/cnrp+xml":{source:"iana",compressible:!0},"application/coap-group+json":{source:"iana",compressible:!0},"application/coap-payload":{source:"iana"},"application/commonground":{source:"iana"},"application/conference-info+xml":{source:"iana",compressible:!0},"application/cose":{source:"iana"},"application/cose-key":{source:"iana"},"application/cose-key-set":{source:"iana"},"application/cpl+xml":{source:"iana",compressible:!0,extensions:["cpl"]},"application/csrattrs":{source:"iana"},"application/csta+xml":{source:"iana",compressible:!0},"application/cstadata+xml":{source:"iana",compressible:!0},"application/csvm+json":{source:"iana",compressible:!0},"application/cu-seeme":{source:"apache",extensions:["cu"]},"application/cwt":{source:"iana"},"application/cybercash":{source:"iana"},"application/dart":{compressible:!0},"application/dash+xml":{source:"iana",compressible:!0,extensions:["mpd"]},"application/dash-patch+xml":{source:"iana",compressible:!0,extensions:["mpp"]},"application/dashdelta":{source:"iana"},"application/davmount+xml":{source:"iana",compressible:!0,extensions:["davmount"]},"application/dca-rft":{source:"iana"},"application/dcd":{source:"iana"},"application/dec-dx":{source:"iana"},"application/dialog-info+xml":{source:"iana",compressible:!0},"application/dicom":{source:"iana"},"application/dicom+json":{source:"iana",compressible:!0},"application/dicom+xml":{source:"iana",compressible:!0},"application/dii":{source:"iana"},"application/dit":{source:"iana"},"application/dns":{source:"iana"},"application/dns+json":{source:"iana",compressible:!0},"application/dns-message":{source:"iana"},"application/docbook+xml":{source:"apache",compressible:!0,extensions:["dbk"]},"application/dots+cbor":{source:"iana"},"application/dskpp+xml":{source:"iana",compressible:!0},"application/dssc+der":{source:"iana",extensions:["dssc"]},"application/dssc+xml":{source:"iana",compressible:!0,extensions:["xdssc"]},"application/dvcs":{source:"iana"},"application/ecmascript":{source:"iana",compressible:!0,extensions:["es","ecma"]},"application/edi-consent":{source:"iana"},"application/edi-x12":{source:"iana",compressible:!1},"application/edifact":{source:"iana",compressible:!1},"application/efi":{source:"iana"},"application/elm+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/elm+xml":{source:"iana",compressible:!0},"application/emergencycalldata.cap+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/emergencycalldata.comment+xml":{source:"iana",compressible:!0},"application/emergencycalldata.control+xml":{source:"iana",compressible:!0},"application/emergencycalldata.deviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.ecall.msd":{source:"iana"},"application/emergencycalldata.providerinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.serviceinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.subscriberinfo+xml":{source:"iana",compressible:!0},"application/emergencycalldata.veds+xml":{source:"iana",compressible:!0},"application/emma+xml":{source:"iana",compressible:!0,extensions:["emma"]},"application/emotionml+xml":{source:"iana",compressible:!0,extensions:["emotionml"]},"application/encaprtp":{source:"iana"},"application/epp+xml":{source:"iana",compressible:!0},"application/epub+zip":{source:"iana",compressible:!1,extensions:["epub"]},"application/eshop":{source:"iana"},"application/exi":{source:"iana",extensions:["exi"]},"application/expect-ct-report+json":{source:"iana",compressible:!0},"application/express":{source:"iana",extensions:["exp"]},"application/fastinfoset":{source:"iana"},"application/fastsoap":{source:"iana"},"application/fdt+xml":{source:"iana",compressible:!0,extensions:["fdt"]},"application/fhir+json":{source:"iana",charset:"UTF-8",compressible:!0},"application/fhir+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/fido.trusted-apps+json":{compressible:!0},"application/fits":{source:"iana"},"application/flexfec":{source:"iana"},"application/font-sfnt":{source:"iana"},"application/font-tdpfr":{source:"iana",extensions:["pfr"]},"application/font-woff":{source:"iana",compressible:!1},"application/framework-attributes+xml":{source:"iana",compressible:!0},"application/geo+json":{source:"iana",compressible:!0,extensions:["geojson"]},"application/geo+json-seq":{source:"iana"},"application/geopackage+sqlite3":{source:"iana"},"application/geoxacml+xml":{source:"iana",compressible:!0},"application/gltf-buffer":{source:"iana"},"application/gml+xml":{source:"iana",compressible:!0,extensions:["gml"]},"application/gpx+xml":{source:"apache",compressible:!0,extensions:["gpx"]},"application/gxf":{source:"apache",extensions:["gxf"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/h224":{source:"iana"},"application/held+xml":{source:"iana",compressible:!0},"application/hjson":{extensions:["hjson"]},"application/http":{source:"iana"},"application/hyperstudio":{source:"iana",extensions:["stk"]},"application/ibe-key-request+xml":{source:"iana",compressible:!0},"application/ibe-pkg-reply+xml":{source:"iana",compressible:!0},"application/ibe-pp-data":{source:"iana"},"application/iges":{source:"iana"},"application/im-iscomposing+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/index":{source:"iana"},"application/index.cmd":{source:"iana"},"application/index.obj":{source:"iana"},"application/index.response":{source:"iana"},"application/index.vnd":{source:"iana"},"application/inkml+xml":{source:"iana",compressible:!0,extensions:["ink","inkml"]},"application/iotp":{source:"iana"},"application/ipfix":{source:"iana",extensions:["ipfix"]},"application/ipp":{source:"iana"},"application/isup":{source:"iana"},"application/its+xml":{source:"iana",compressible:!0,extensions:["its"]},"application/java-archive":{source:"apache",compressible:!1,extensions:["jar","war","ear"]},"application/java-serialized-object":{source:"apache",compressible:!1,extensions:["ser"]},"application/java-vm":{source:"apache",compressible:!1,extensions:["class"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/jf2feed+json":{source:"iana",compressible:!0},"application/jose":{source:"iana"},"application/jose+json":{source:"iana",compressible:!0},"application/jrd+json":{source:"iana",compressible:!0},"application/jscalendar+json":{source:"iana",compressible:!0},"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/json-patch+json":{source:"iana",compressible:!0},"application/json-seq":{source:"iana"},"application/json5":{extensions:["json5"]},"application/jsonml+json":{source:"apache",compressible:!0,extensions:["jsonml"]},"application/jwk+json":{source:"iana",compressible:!0},"application/jwk-set+json":{source:"iana",compressible:!0},"application/jwt":{source:"iana"},"application/kpml-request+xml":{source:"iana",compressible:!0},"application/kpml-response+xml":{source:"iana",compressible:!0},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/lgr+xml":{source:"iana",compressible:!0,extensions:["lgr"]},"application/link-format":{source:"iana"},"application/load-control+xml":{source:"iana",compressible:!0},"application/lost+xml":{source:"iana",compressible:!0,extensions:["lostxml"]},"application/lostsync+xml":{source:"iana",compressible:!0},"application/lpf+zip":{source:"iana",compressible:!1},"application/lxf":{source:"iana"},"application/mac-binhex40":{source:"iana",extensions:["hqx"]},"application/mac-compactpro":{source:"apache",extensions:["cpt"]},"application/macwriteii":{source:"iana"},"application/mads+xml":{source:"iana",compressible:!0,extensions:["mads"]},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/marc":{source:"iana",extensions:["mrc"]},"application/marcxml+xml":{source:"iana",compressible:!0,extensions:["mrcx"]},"application/mathematica":{source:"iana",extensions:["ma","nb","mb"]},"application/mathml+xml":{source:"iana",compressible:!0,extensions:["mathml"]},"application/mathml-content+xml":{source:"iana",compressible:!0},"application/mathml-presentation+xml":{source:"iana",compressible:!0},"application/mbms-associated-procedure-description+xml":{source:"iana",compressible:!0},"application/mbms-deregister+xml":{source:"iana",compressible:!0},"application/mbms-envelope+xml":{source:"iana",compressible:!0},"application/mbms-msk+xml":{source:"iana",compressible:!0},"application/mbms-msk-response+xml":{source:"iana",compressible:!0},"application/mbms-protection-description+xml":{source:"iana",compressible:!0},"application/mbms-reception-report+xml":{source:"iana",compressible:!0},"application/mbms-register+xml":{source:"iana",compressible:!0},"application/mbms-register-response+xml":{source:"iana",compressible:!0},"application/mbms-schedule+xml":{source:"iana",compressible:!0},"application/mbms-user-service-description+xml":{source:"iana",compressible:!0},"application/mbox":{source:"iana",extensions:["mbox"]},"application/media-policy-dataset+xml":{source:"iana",compressible:!0,extensions:["mpf"]},"application/media_control+xml":{source:"iana",compressible:!0},"application/mediaservercontrol+xml":{source:"iana",compressible:!0,extensions:["mscml"]},"application/merge-patch+json":{source:"iana",compressible:!0},"application/metalink+xml":{source:"apache",compressible:!0,extensions:["metalink"]},"application/metalink4+xml":{source:"iana",compressible:!0,extensions:["meta4"]},"application/mets+xml":{source:"iana",compressible:!0,extensions:["mets"]},"application/mf4":{source:"iana"},"application/mikey":{source:"iana"},"application/mipc":{source:"iana"},"application/missing-blocks+cbor-seq":{source:"iana"},"application/mmt-aei+xml":{source:"iana",compressible:!0,extensions:["maei"]},"application/mmt-usd+xml":{source:"iana",compressible:!0,extensions:["musd"]},"application/mods+xml":{source:"iana",compressible:!0,extensions:["mods"]},"application/moss-keys":{source:"iana"},"application/moss-signature":{source:"iana"},"application/mosskey-data":{source:"iana"},"application/mosskey-request":{source:"iana"},"application/mp21":{source:"iana",extensions:["m21","mp21"]},"application/mp4":{source:"iana",extensions:["mp4s","m4p"]},"application/mpeg4-generic":{source:"iana"},"application/mpeg4-iod":{source:"iana"},"application/mpeg4-iod-xmt":{source:"iana"},"application/mrb-consumer+xml":{source:"iana",compressible:!0},"application/mrb-publish+xml":{source:"iana",compressible:!0},"application/msc-ivr+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msc-mixer+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/msword":{source:"iana",compressible:!1,extensions:["doc","dot"]},"application/mud+json":{source:"iana",compressible:!0},"application/multipart-core":{source:"iana"},"application/mxf":{source:"iana",extensions:["mxf"]},"application/n-quads":{source:"iana",extensions:["nq"]},"application/n-triples":{source:"iana",extensions:["nt"]},"application/nasdata":{source:"iana"},"application/news-checkgroups":{source:"iana",charset:"US-ASCII"},"application/news-groupinfo":{source:"iana",charset:"US-ASCII"},"application/news-transmission":{source:"iana"},"application/nlsml+xml":{source:"iana",compressible:!0},"application/node":{source:"iana",extensions:["cjs"]},"application/nss":{source:"iana"},"application/oauth-authz-req+jwt":{source:"iana"},"application/oblivious-dns-message":{source:"iana"},"application/ocsp-request":{source:"iana"},"application/ocsp-response":{source:"iana"},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{source:"iana",extensions:["oda"]},"application/odm+xml":{source:"iana",compressible:!0},"application/odx":{source:"iana"},"application/oebps-package+xml":{source:"iana",compressible:!0,extensions:["opf"]},"application/ogg":{source:"iana",compressible:!1,extensions:["ogx"]},"application/omdoc+xml":{source:"apache",compressible:!0,extensions:["omdoc"]},"application/onenote":{source:"apache",extensions:["onetoc","onetoc2","onetmp","onepkg"]},"application/opc-nodeset+xml":{source:"iana",compressible:!0},"application/oscore":{source:"iana"},"application/oxps":{source:"iana",extensions:["oxps"]},"application/p21":{source:"iana"},"application/p21+zip":{source:"iana",compressible:!1},"application/p2p-overlay+xml":{source:"iana",compressible:!0,extensions:["relo"]},"application/parityfec":{source:"iana"},"application/passport":{source:"iana"},"application/patch-ops-error+xml":{source:"iana",compressible:!0,extensions:["xer"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/pdx":{source:"iana"},"application/pem-certificate-chain":{source:"iana"},"application/pgp-encrypted":{source:"iana",compressible:!1,extensions:["pgp"]},"application/pgp-keys":{source:"iana",extensions:["asc"]},"application/pgp-signature":{source:"iana",extensions:["asc","sig"]},"application/pics-rules":{source:"apache",extensions:["prf"]},"application/pidf+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pidf-diff+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/pkcs10":{source:"iana",extensions:["p10"]},"application/pkcs12":{source:"iana"},"application/pkcs7-mime":{source:"iana",extensions:["p7m","p7c"]},"application/pkcs7-signature":{source:"iana",extensions:["p7s"]},"application/pkcs8":{source:"iana",extensions:["p8"]},"application/pkcs8-encrypted":{source:"iana"},"application/pkix-attr-cert":{source:"iana",extensions:["ac"]},"application/pkix-cert":{source:"iana",extensions:["cer"]},"application/pkix-crl":{source:"iana",extensions:["crl"]},"application/pkix-pkipath":{source:"iana",extensions:["pkipath"]},"application/pkixcmp":{source:"iana",extensions:["pki"]},"application/pls+xml":{source:"iana",compressible:!0,extensions:["pls"]},"application/poc-settings+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/postscript":{source:"iana",compressible:!0,extensions:["ai","eps","ps"]},"application/ppsp-tracker+json":{source:"iana",compressible:!0},"application/problem+json":{source:"iana",compressible:!0},"application/problem+xml":{source:"iana",compressible:!0},"application/provenance+xml":{source:"iana",compressible:!0,extensions:["provx"]},"application/prs.alvestrand.titrax-sheet":{source:"iana"},"application/prs.cww":{source:"iana",extensions:["cww"]},"application/prs.cyn":{source:"iana",charset:"7-BIT"},"application/prs.hpub+zip":{source:"iana",compressible:!1},"application/prs.nprend":{source:"iana"},"application/prs.plucker":{source:"iana"},"application/prs.rdf-xml-crypt":{source:"iana"},"application/prs.xsf+xml":{source:"iana",compressible:!0},"application/pskc+xml":{source:"iana",compressible:!0,extensions:["pskcxml"]},"application/pvd+json":{source:"iana",compressible:!0},"application/qsig":{source:"iana"},"application/raml+yaml":{compressible:!0,extensions:["raml"]},"application/raptorfec":{source:"iana"},"application/rdap+json":{source:"iana",compressible:!0},"application/rdf+xml":{source:"iana",compressible:!0,extensions:["rdf","owl"]},"application/reginfo+xml":{source:"iana",compressible:!0,extensions:["rif"]},"application/relax-ng-compact-syntax":{source:"iana",extensions:["rnc"]},"application/remote-printing":{source:"iana"},"application/reputon+json":{source:"iana",compressible:!0},"application/resource-lists+xml":{source:"iana",compressible:!0,extensions:["rl"]},"application/resource-lists-diff+xml":{source:"iana",compressible:!0,extensions:["rld"]},"application/rfc+xml":{source:"iana",compressible:!0},"application/riscos":{source:"iana"},"application/rlmi+xml":{source:"iana",compressible:!0},"application/rls-services+xml":{source:"iana",compressible:!0,extensions:["rs"]},"application/route-apd+xml":{source:"iana",compressible:!0,extensions:["rapd"]},"application/route-s-tsid+xml":{source:"iana",compressible:!0,extensions:["sls"]},"application/route-usd+xml":{source:"iana",compressible:!0,extensions:["rusd"]},"application/rpki-ghostbusters":{source:"iana",extensions:["gbr"]},"application/rpki-manifest":{source:"iana",extensions:["mft"]},"application/rpki-publication":{source:"iana"},"application/rpki-roa":{source:"iana",extensions:["roa"]},"application/rpki-updown":{source:"iana"},"application/rsd+xml":{source:"apache",compressible:!0,extensions:["rsd"]},"application/rss+xml":{source:"apache",compressible:!0,extensions:["rss"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/rtploopback":{source:"iana"},"application/rtx":{source:"iana"},"application/samlassertion+xml":{source:"iana",compressible:!0},"application/samlmetadata+xml":{source:"iana",compressible:!0},"application/sarif+json":{source:"iana",compressible:!0},"application/sarif-external-properties+json":{source:"iana",compressible:!0},"application/sbe":{source:"iana"},"application/sbml+xml":{source:"iana",compressible:!0,extensions:["sbml"]},"application/scaip+xml":{source:"iana",compressible:!0},"application/scim+json":{source:"iana",compressible:!0},"application/scvp-cv-request":{source:"iana",extensions:["scq"]},"application/scvp-cv-response":{source:"iana",extensions:["scs"]},"application/scvp-vp-request":{source:"iana",extensions:["spq"]},"application/scvp-vp-response":{source:"iana",extensions:["spp"]},"application/sdp":{source:"iana",extensions:["sdp"]},"application/secevent+jwt":{source:"iana"},"application/senml+cbor":{source:"iana"},"application/senml+json":{source:"iana",compressible:!0},"application/senml+xml":{source:"iana",compressible:!0,extensions:["senmlx"]},"application/senml-etch+cbor":{source:"iana"},"application/senml-etch+json":{source:"iana",compressible:!0},"application/senml-exi":{source:"iana"},"application/sensml+cbor":{source:"iana"},"application/sensml+json":{source:"iana",compressible:!0},"application/sensml+xml":{source:"iana",compressible:!0,extensions:["sensmlx"]},"application/sensml-exi":{source:"iana"},"application/sep+xml":{source:"iana",compressible:!0},"application/sep-exi":{source:"iana"},"application/session-info":{source:"iana"},"application/set-payment":{source:"iana"},"application/set-payment-initiation":{source:"iana",extensions:["setpay"]},"application/set-registration":{source:"iana"},"application/set-registration-initiation":{source:"iana",extensions:["setreg"]},"application/sgml":{source:"iana"},"application/sgml-open-catalog":{source:"iana"},"application/shf+xml":{source:"iana",compressible:!0,extensions:["shf"]},"application/sieve":{source:"iana",extensions:["siv","sieve"]},"application/simple-filter+xml":{source:"iana",compressible:!0},"application/simple-message-summary":{source:"iana"},"application/simplesymbolcontainer":{source:"iana"},"application/sipc":{source:"iana"},"application/slate":{source:"iana"},"application/smil":{source:"iana"},"application/smil+xml":{source:"iana",compressible:!0,extensions:["smi","smil"]},"application/smpte336m":{source:"iana"},"application/soap+fastinfoset":{source:"iana"},"application/soap+xml":{source:"iana",compressible:!0},"application/sparql-query":{source:"iana",extensions:["rq"]},"application/sparql-results+xml":{source:"iana",compressible:!0,extensions:["srx"]},"application/spdx+json":{source:"iana",compressible:!0},"application/spirits-event+xml":{source:"iana",compressible:!0},"application/sql":{source:"iana"},"application/srgs":{source:"iana",extensions:["gram"]},"application/srgs+xml":{source:"iana",compressible:!0,extensions:["grxml"]},"application/sru+xml":{source:"iana",compressible:!0,extensions:["sru"]},"application/ssdl+xml":{source:"apache",compressible:!0,extensions:["ssdl"]},"application/ssml+xml":{source:"iana",compressible:!0,extensions:["ssml"]},"application/stix+json":{source:"iana",compressible:!0},"application/swid+xml":{source:"iana",compressible:!0,extensions:["swidtag"]},"application/tamp-apex-update":{source:"iana"},"application/tamp-apex-update-confirm":{source:"iana"},"application/tamp-community-update":{source:"iana"},"application/tamp-community-update-confirm":{source:"iana"},"application/tamp-error":{source:"iana"},"application/tamp-sequence-adjust":{source:"iana"},"application/tamp-sequence-adjust-confirm":{source:"iana"},"application/tamp-status-query":{source:"iana"},"application/tamp-status-response":{source:"iana"},"application/tamp-update":{source:"iana"},"application/tamp-update-confirm":{source:"iana"},"application/tar":{compressible:!0},"application/taxii+json":{source:"iana",compressible:!0},"application/td+json":{source:"iana",compressible:!0},"application/tei+xml":{source:"iana",compressible:!0,extensions:["tei","teicorpus"]},"application/tetra_isi":{source:"iana"},"application/thraud+xml":{source:"iana",compressible:!0,extensions:["tfi"]},"application/timestamp-query":{source:"iana"},"application/timestamp-reply":{source:"iana"},"application/timestamped-data":{source:"iana",extensions:["tsd"]},"application/tlsrpt+gzip":{source:"iana"},"application/tlsrpt+json":{source:"iana",compressible:!0},"application/tnauthlist":{source:"iana"},"application/token-introspection+jwt":{source:"iana"},"application/toml":{compressible:!0,extensions:["toml"]},"application/trickle-ice-sdpfrag":{source:"iana"},"application/trig":{source:"iana",extensions:["trig"]},"application/ttml+xml":{source:"iana",compressible:!0,extensions:["ttml"]},"application/tve-trigger":{source:"iana"},"application/tzif":{source:"iana"},"application/tzif-leap":{source:"iana"},"application/ubjson":{compressible:!1,extensions:["ubj"]},"application/ulpfec":{source:"iana"},"application/urc-grpsheet+xml":{source:"iana",compressible:!0},"application/urc-ressheet+xml":{source:"iana",compressible:!0,extensions:["rsheet"]},"application/urc-targetdesc+xml":{source:"iana",compressible:!0,extensions:["td"]},"application/urc-uisocketdesc+xml":{source:"iana",compressible:!0},"application/vcard+json":{source:"iana",compressible:!0},"application/vcard+xml":{source:"iana",compressible:!0},"application/vemmi":{source:"iana"},"application/vividence.scriptfile":{source:"apache"},"application/vnd.1000minds.decision-model+xml":{source:"iana",compressible:!0,extensions:["1km"]},"application/vnd.3gpp-prose+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-prose-pc3ch+xml":{source:"iana",compressible:!0},"application/vnd.3gpp-v2x-local-service-information":{source:"iana"},"application/vnd.3gpp.5gnas":{source:"iana"},"application/vnd.3gpp.access-transfer-events+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.bsf+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gmop+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.gtpc":{source:"iana"},"application/vnd.3gpp.interworking-data":{source:"iana"},"application/vnd.3gpp.lpp":{source:"iana"},"application/vnd.3gpp.mc-signalling-ear":{source:"iana"},"application/vnd.3gpp.mcdata-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-payload":{source:"iana"},"application/vnd.3gpp.mcdata-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-signalling":{source:"iana"},"application/vnd.3gpp.mcdata-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcdata-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-floor-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-signed+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-ue-init-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcptt-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-command+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-affiliation-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-location-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-mbms-usage-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-service-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-transmission-request+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-ue-config+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mcvideo-user-profile+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.mid-call+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ngap":{source:"iana"},"application/vnd.3gpp.pfcp":{source:"iana"},"application/vnd.3gpp.pic-bw-large":{source:"iana",extensions:["plb"]},"application/vnd.3gpp.pic-bw-small":{source:"iana",extensions:["psb"]},"application/vnd.3gpp.pic-bw-var":{source:"iana",extensions:["pvb"]},"application/vnd.3gpp.s1ap":{source:"iana"},"application/vnd.3gpp.sms":{source:"iana"},"application/vnd.3gpp.sms+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-ext+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.srvcc-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.state-and-event-info+xml":{source:"iana",compressible:!0},"application/vnd.3gpp.ussd+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.bcmcsinfo+xml":{source:"iana",compressible:!0},"application/vnd.3gpp2.sms":{source:"iana"},"application/vnd.3gpp2.tcap":{source:"iana",extensions:["tcap"]},"application/vnd.3lightssoftware.imagescal":{source:"iana"},"application/vnd.3m.post-it-notes":{source:"iana",extensions:["pwn"]},"application/vnd.accpac.simply.aso":{source:"iana",extensions:["aso"]},"application/vnd.accpac.simply.imp":{source:"iana",extensions:["imp"]},"application/vnd.acucobol":{source:"iana",extensions:["acu"]},"application/vnd.acucorp":{source:"iana",extensions:["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{source:"apache",compressible:!1,extensions:["air"]},"application/vnd.adobe.flash.movie":{source:"iana"},"application/vnd.adobe.formscentral.fcdt":{source:"iana",extensions:["fcdt"]},"application/vnd.adobe.fxp":{source:"iana",extensions:["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{source:"iana"},"application/vnd.adobe.xdp+xml":{source:"iana",compressible:!0,extensions:["xdp"]},"application/vnd.adobe.xfdf":{source:"iana",extensions:["xfdf"]},"application/vnd.aether.imp":{source:"iana"},"application/vnd.afpc.afplinedata":{source:"iana"},"application/vnd.afpc.afplinedata-pagedef":{source:"iana"},"application/vnd.afpc.cmoca-cmresource":{source:"iana"},"application/vnd.afpc.foca-charset":{source:"iana"},"application/vnd.afpc.foca-codedfont":{source:"iana"},"application/vnd.afpc.foca-codepage":{source:"iana"},"application/vnd.afpc.modca":{source:"iana"},"application/vnd.afpc.modca-cmtable":{source:"iana"},"application/vnd.afpc.modca-formdef":{source:"iana"},"application/vnd.afpc.modca-mediummap":{source:"iana"},"application/vnd.afpc.modca-objectcontainer":{source:"iana"},"application/vnd.afpc.modca-overlay":{source:"iana"},"application/vnd.afpc.modca-pagesegment":{source:"iana"},"application/vnd.age":{source:"iana",extensions:["age"]},"application/vnd.ah-barcode":{source:"iana"},"application/vnd.ahead.space":{source:"iana",extensions:["ahead"]},"application/vnd.airzip.filesecure.azf":{source:"iana",extensions:["azf"]},"application/vnd.airzip.filesecure.azs":{source:"iana",extensions:["azs"]},"application/vnd.amadeus+json":{source:"iana",compressible:!0},"application/vnd.amazon.ebook":{source:"apache",extensions:["azw"]},"application/vnd.amazon.mobi8-ebook":{source:"iana"},"application/vnd.americandynamics.acc":{source:"iana",extensions:["acc"]},"application/vnd.amiga.ami":{source:"iana",extensions:["ami"]},"application/vnd.amundsen.maze+xml":{source:"iana",compressible:!0},"application/vnd.android.ota":{source:"iana"},"application/vnd.android.package-archive":{source:"apache",compressible:!1,extensions:["apk"]},"application/vnd.anki":{source:"iana"},"application/vnd.anser-web-certificate-issue-initiation":{source:"iana",extensions:["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{source:"apache",extensions:["fti"]},"application/vnd.antix.game-component":{source:"iana",extensions:["atx"]},"application/vnd.apache.arrow.file":{source:"iana"},"application/vnd.apache.arrow.stream":{source:"iana"},"application/vnd.apache.thrift.binary":{source:"iana"},"application/vnd.apache.thrift.compact":{source:"iana"},"application/vnd.apache.thrift.json":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/vnd.aplextor.warrp+json":{source:"iana",compressible:!0},"application/vnd.apothekende.reservation+json":{source:"iana",compressible:!0},"application/vnd.apple.installer+xml":{source:"iana",compressible:!0,extensions:["mpkg"]},"application/vnd.apple.keynote":{source:"iana",extensions:["key"]},"application/vnd.apple.mpegurl":{source:"iana",extensions:["m3u8"]},"application/vnd.apple.numbers":{source:"iana",extensions:["numbers"]},"application/vnd.apple.pages":{source:"iana",extensions:["pages"]},"application/vnd.apple.pkpass":{compressible:!1,extensions:["pkpass"]},"application/vnd.arastra.swi":{source:"iana"},"application/vnd.aristanetworks.swi":{source:"iana",extensions:["swi"]},"application/vnd.artisan+json":{source:"iana",compressible:!0},"application/vnd.artsquare":{source:"iana"},"application/vnd.astraea-software.iota":{source:"iana",extensions:["iota"]},"application/vnd.audiograph":{source:"iana",extensions:["aep"]},"application/vnd.autopackage":{source:"iana"},"application/vnd.avalon+json":{source:"iana",compressible:!0},"application/vnd.avistar+xml":{source:"iana",compressible:!0},"application/vnd.balsamiq.bmml+xml":{source:"iana",compressible:!0,extensions:["bmml"]},"application/vnd.balsamiq.bmpr":{source:"iana"},"application/vnd.banana-accounting":{source:"iana"},"application/vnd.bbf.usp.error":{source:"iana"},"application/vnd.bbf.usp.msg":{source:"iana"},"application/vnd.bbf.usp.msg+json":{source:"iana",compressible:!0},"application/vnd.bekitzur-stech+json":{source:"iana",compressible:!0},"application/vnd.bint.med-content":{source:"iana"},"application/vnd.biopax.rdf+xml":{source:"iana",compressible:!0},"application/vnd.blink-idb-value-wrapper":{source:"iana"},"application/vnd.blueice.multipass":{source:"iana",extensions:["mpm"]},"application/vnd.bluetooth.ep.oob":{source:"iana"},"application/vnd.bluetooth.le.oob":{source:"iana"},"application/vnd.bmi":{source:"iana",extensions:["bmi"]},"application/vnd.bpf":{source:"iana"},"application/vnd.bpf3":{source:"iana"},"application/vnd.businessobjects":{source:"iana",extensions:["rep"]},"application/vnd.byu.uapi+json":{source:"iana",compressible:!0},"application/vnd.cab-jscript":{source:"iana"},"application/vnd.canon-cpdl":{source:"iana"},"application/vnd.canon-lips":{source:"iana"},"application/vnd.capasystems-pg+json":{source:"iana",compressible:!0},"application/vnd.cendio.thinlinc.clientconf":{source:"iana"},"application/vnd.century-systems.tcp_stream":{source:"iana"},"application/vnd.chemdraw+xml":{source:"iana",compressible:!0,extensions:["cdxml"]},"application/vnd.chess-pgn":{source:"iana"},"application/vnd.chipnuts.karaoke-mmd":{source:"iana",extensions:["mmd"]},"application/vnd.ciedi":{source:"iana"},"application/vnd.cinderella":{source:"iana",extensions:["cdy"]},"application/vnd.cirpack.isdn-ext":{source:"iana"},"application/vnd.citationstyles.style+xml":{source:"iana",compressible:!0,extensions:["csl"]},"application/vnd.claymore":{source:"iana",extensions:["cla"]},"application/vnd.cloanto.rp9":{source:"iana",extensions:["rp9"]},"application/vnd.clonk.c4group":{source:"iana",extensions:["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{source:"iana",extensions:["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{source:"iana",extensions:["c11amz"]},"application/vnd.coffeescript":{source:"iana"},"application/vnd.collabio.xodocuments.document":{source:"iana"},"application/vnd.collabio.xodocuments.document-template":{source:"iana"},"application/vnd.collabio.xodocuments.presentation":{source:"iana"},"application/vnd.collabio.xodocuments.presentation-template":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{source:"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{source:"iana"},"application/vnd.collection+json":{source:"iana",compressible:!0},"application/vnd.collection.doc+json":{source:"iana",compressible:!0},"application/vnd.collection.next+json":{source:"iana",compressible:!0},"application/vnd.comicbook+zip":{source:"iana",compressible:!1},"application/vnd.comicbook-rar":{source:"iana"},"application/vnd.commerce-battelle":{source:"iana"},"application/vnd.commonspace":{source:"iana",extensions:["csp"]},"application/vnd.contact.cmsg":{source:"iana",extensions:["cdbcmsg"]},"application/vnd.coreos.ignition+json":{source:"iana",compressible:!0},"application/vnd.cosmocaller":{source:"iana",extensions:["cmc"]},"application/vnd.crick.clicker":{source:"iana",extensions:["clkx"]},"application/vnd.crick.clicker.keyboard":{source:"iana",extensions:["clkk"]},"application/vnd.crick.clicker.palette":{source:"iana",extensions:["clkp"]},"application/vnd.crick.clicker.template":{source:"iana",extensions:["clkt"]},"application/vnd.crick.clicker.wordbank":{source:"iana",extensions:["clkw"]},"application/vnd.criticaltools.wbs+xml":{source:"iana",compressible:!0,extensions:["wbs"]},"application/vnd.cryptii.pipe+json":{source:"iana",compressible:!0},"application/vnd.crypto-shade-file":{source:"iana"},"application/vnd.cryptomator.encrypted":{source:"iana"},"application/vnd.cryptomator.vault":{source:"iana"},"application/vnd.ctc-posml":{source:"iana",extensions:["pml"]},"application/vnd.ctct.ws+xml":{source:"iana",compressible:!0},"application/vnd.cups-pdf":{source:"iana"},"application/vnd.cups-postscript":{source:"iana"},"application/vnd.cups-ppd":{source:"iana",extensions:["ppd"]},"application/vnd.cups-raster":{source:"iana"},"application/vnd.cups-raw":{source:"iana"},"application/vnd.curl":{source:"iana"},"application/vnd.curl.car":{source:"apache",extensions:["car"]},"application/vnd.curl.pcurl":{source:"apache",extensions:["pcurl"]},"application/vnd.cyan.dean.root+xml":{source:"iana",compressible:!0},"application/vnd.cybank":{source:"iana"},"application/vnd.cyclonedx+json":{source:"iana",compressible:!0},"application/vnd.cyclonedx+xml":{source:"iana",compressible:!0},"application/vnd.d2l.coursepackage1p0+zip":{source:"iana",compressible:!1},"application/vnd.d3m-dataset":{source:"iana"},"application/vnd.d3m-problem":{source:"iana"},"application/vnd.dart":{source:"iana",compressible:!0,extensions:["dart"]},"application/vnd.data-vision.rdz":{source:"iana",extensions:["rdz"]},"application/vnd.datapackage+json":{source:"iana",compressible:!0},"application/vnd.dataresource+json":{source:"iana",compressible:!0},"application/vnd.dbf":{source:"iana",extensions:["dbf"]},"application/vnd.debian.binary-package":{source:"iana"},"application/vnd.dece.data":{source:"iana",extensions:["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{source:"iana",compressible:!0,extensions:["uvt","uvvt"]},"application/vnd.dece.unspecified":{source:"iana",extensions:["uvx","uvvx"]},"application/vnd.dece.zip":{source:"iana",extensions:["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{source:"iana",extensions:["fe_launch"]},"application/vnd.desmume.movie":{source:"iana"},"application/vnd.dir-bi.plate-dl-nosuffix":{source:"iana"},"application/vnd.dm.delegation+xml":{source:"iana",compressible:!0},"application/vnd.dna":{source:"iana",extensions:["dna"]},"application/vnd.document+json":{source:"iana",compressible:!0},"application/vnd.dolby.mlp":{source:"apache",extensions:["mlp"]},"application/vnd.dolby.mobile.1":{source:"iana"},"application/vnd.dolby.mobile.2":{source:"iana"},"application/vnd.doremir.scorecloud-binary-document":{source:"iana"},"application/vnd.dpgraph":{source:"iana",extensions:["dpg"]},"application/vnd.dreamfactory":{source:"iana",extensions:["dfac"]},"application/vnd.drive+json":{source:"iana",compressible:!0},"application/vnd.ds-keypoint":{source:"apache",extensions:["kpxx"]},"application/vnd.dtg.local":{source:"iana"},"application/vnd.dtg.local.flash":{source:"iana"},"application/vnd.dtg.local.html":{source:"iana"},"application/vnd.dvb.ait":{source:"iana",extensions:["ait"]},"application/vnd.dvb.dvbisl+xml":{source:"iana",compressible:!0},"application/vnd.dvb.dvbj":{source:"iana"},"application/vnd.dvb.esgcontainer":{source:"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess":{source:"iana"},"application/vnd.dvb.ipdcesgaccess2":{source:"iana"},"application/vnd.dvb.ipdcesgpdd":{source:"iana"},"application/vnd.dvb.ipdcroaming":{source:"iana"},"application/vnd.dvb.iptv.alfec-base":{source:"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{source:"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-container+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-generic+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-msglist+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-request+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-ia-registration-response+xml":{source:"iana",compressible:!0},"application/vnd.dvb.notif-init+xml":{source:"iana",compressible:!0},"application/vnd.dvb.pfr":{source:"iana"},"application/vnd.dvb.service":{source:"iana",extensions:["svc"]},"application/vnd.dxr":{source:"iana"},"application/vnd.dynageo":{source:"iana",extensions:["geo"]},"application/vnd.dzr":{source:"iana"},"application/vnd.easykaraoke.cdgdownload":{source:"iana"},"application/vnd.ecdis-update":{source:"iana"},"application/vnd.ecip.rlp":{source:"iana"},"application/vnd.eclipse.ditto+json":{source:"iana",compressible:!0},"application/vnd.ecowin.chart":{source:"iana",extensions:["mag"]},"application/vnd.ecowin.filerequest":{source:"iana"},"application/vnd.ecowin.fileupdate":{source:"iana"},"application/vnd.ecowin.series":{source:"iana"},"application/vnd.ecowin.seriesrequest":{source:"iana"},"application/vnd.ecowin.seriesupdate":{source:"iana"},"application/vnd.efi.img":{source:"iana"},"application/vnd.efi.iso":{source:"iana"},"application/vnd.emclient.accessrequest+xml":{source:"iana",compressible:!0},"application/vnd.enliven":{source:"iana",extensions:["nml"]},"application/vnd.enphase.envoy":{source:"iana"},"application/vnd.eprints.data+xml":{source:"iana",compressible:!0},"application/vnd.epson.esf":{source:"iana",extensions:["esf"]},"application/vnd.epson.msf":{source:"iana",extensions:["msf"]},"application/vnd.epson.quickanime":{source:"iana",extensions:["qam"]},"application/vnd.epson.salt":{source:"iana",extensions:["slt"]},"application/vnd.epson.ssf":{source:"iana",extensions:["ssf"]},"application/vnd.ericsson.quickcall":{source:"iana"},"application/vnd.espass-espass+zip":{source:"iana",compressible:!1},"application/vnd.eszigno3+xml":{source:"iana",compressible:!0,extensions:["es3","et3"]},"application/vnd.etsi.aoc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.asic-e+zip":{source:"iana",compressible:!1},"application/vnd.etsi.asic-s+zip":{source:"iana",compressible:!1},"application/vnd.etsi.cug+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvcommand+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-bc+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-cod+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsad-npvr+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvservice+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvsync+xml":{source:"iana",compressible:!0},"application/vnd.etsi.iptvueprofile+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mcid+xml":{source:"iana",compressible:!0},"application/vnd.etsi.mheg5":{source:"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{source:"iana",compressible:!0},"application/vnd.etsi.pstn+xml":{source:"iana",compressible:!0},"application/vnd.etsi.sci+xml":{source:"iana",compressible:!0},"application/vnd.etsi.simservs+xml":{source:"iana",compressible:!0},"application/vnd.etsi.timestamp-token":{source:"iana"},"application/vnd.etsi.tsl+xml":{source:"iana",compressible:!0},"application/vnd.etsi.tsl.der":{source:"iana"},"application/vnd.eu.kasparian.car+json":{source:"iana",compressible:!0},"application/vnd.eudora.data":{source:"iana"},"application/vnd.evolv.ecig.profile":{source:"iana"},"application/vnd.evolv.ecig.settings":{source:"iana"},"application/vnd.evolv.ecig.theme":{source:"iana"},"application/vnd.exstream-empower+zip":{source:"iana",compressible:!1},"application/vnd.exstream-package":{source:"iana"},"application/vnd.ezpix-album":{source:"iana",extensions:["ez2"]},"application/vnd.ezpix-package":{source:"iana",extensions:["ez3"]},"application/vnd.f-secure.mobile":{source:"iana"},"application/vnd.familysearch.gedcom+zip":{source:"iana",compressible:!1},"application/vnd.fastcopy-disk-image":{source:"iana"},"application/vnd.fdf":{source:"iana",extensions:["fdf"]},"application/vnd.fdsn.mseed":{source:"iana",extensions:["mseed"]},"application/vnd.fdsn.seed":{source:"iana",extensions:["seed","dataless"]},"application/vnd.ffsns":{source:"iana"},"application/vnd.ficlab.flb+zip":{source:"iana",compressible:!1},"application/vnd.filmit.zfc":{source:"iana"},"application/vnd.fints":{source:"iana"},"application/vnd.firemonkeys.cloudcell":{source:"iana"},"application/vnd.flographit":{source:"iana",extensions:["gph"]},"application/vnd.fluxtime.clip":{source:"iana",extensions:["ftc"]},"application/vnd.font-fontforge-sfd":{source:"iana"},"application/vnd.framemaker":{source:"iana",extensions:["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{source:"iana",extensions:["fnc"]},"application/vnd.frogans.ltf":{source:"iana",extensions:["ltf"]},"application/vnd.fsc.weblaunch":{source:"iana",extensions:["fsc"]},"application/vnd.fujifilm.fb.docuworks":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.binder":{source:"iana"},"application/vnd.fujifilm.fb.docuworks.container":{source:"iana"},"application/vnd.fujifilm.fb.jfi+xml":{source:"iana",compressible:!0},"application/vnd.fujitsu.oasys":{source:"iana",extensions:["oas"]},"application/vnd.fujitsu.oasys2":{source:"iana",extensions:["oa2"]},"application/vnd.fujitsu.oasys3":{source:"iana",extensions:["oa3"]},"application/vnd.fujitsu.oasysgp":{source:"iana",extensions:["fg5"]},"application/vnd.fujitsu.oasysprs":{source:"iana",extensions:["bh2"]},"application/vnd.fujixerox.art-ex":{source:"iana"},"application/vnd.fujixerox.art4":{source:"iana"},"application/vnd.fujixerox.ddd":{source:"iana",extensions:["ddd"]},"application/vnd.fujixerox.docuworks":{source:"iana",extensions:["xdw"]},"application/vnd.fujixerox.docuworks.binder":{source:"iana",extensions:["xbd"]},"application/vnd.fujixerox.docuworks.container":{source:"iana"},"application/vnd.fujixerox.hbpl":{source:"iana"},"application/vnd.fut-misnet":{source:"iana"},"application/vnd.futoin+cbor":{source:"iana"},"application/vnd.futoin+json":{source:"iana",compressible:!0},"application/vnd.fuzzysheet":{source:"iana",extensions:["fzs"]},"application/vnd.genomatix.tuxedo":{source:"iana",extensions:["txd"]},"application/vnd.gentics.grd+json":{source:"iana",compressible:!0},"application/vnd.geo+json":{source:"iana",compressible:!0},"application/vnd.geocube+xml":{source:"iana",compressible:!0},"application/vnd.geogebra.file":{source:"iana",extensions:["ggb"]},"application/vnd.geogebra.slides":{source:"iana"},"application/vnd.geogebra.tool":{source:"iana",extensions:["ggt"]},"application/vnd.geometry-explorer":{source:"iana",extensions:["gex","gre"]},"application/vnd.geonext":{source:"iana",extensions:["gxt"]},"application/vnd.geoplan":{source:"iana",extensions:["g2w"]},"application/vnd.geospace":{source:"iana",extensions:["g3w"]},"application/vnd.gerber":{source:"iana"},"application/vnd.globalplatform.card-content-mgt":{source:"iana"},"application/vnd.globalplatform.card-content-mgt-response":{source:"iana"},"application/vnd.gmx":{source:"iana",extensions:["gmx"]},"application/vnd.google-apps.document":{compressible:!1,extensions:["gdoc"]},"application/vnd.google-apps.presentation":{compressible:!1,extensions:["gslides"]},"application/vnd.google-apps.spreadsheet":{compressible:!1,extensions:["gsheet"]},"application/vnd.google-earth.kml+xml":{source:"iana",compressible:!0,extensions:["kml"]},"application/vnd.google-earth.kmz":{source:"iana",compressible:!1,extensions:["kmz"]},"application/vnd.gov.sk.e-form+xml":{source:"iana",compressible:!0},"application/vnd.gov.sk.e-form+zip":{source:"iana",compressible:!1},"application/vnd.gov.sk.xmldatacontainer+xml":{source:"iana",compressible:!0},"application/vnd.grafeq":{source:"iana",extensions:["gqf","gqs"]},"application/vnd.gridmp":{source:"iana"},"application/vnd.groove-account":{source:"iana",extensions:["gac"]},"application/vnd.groove-help":{source:"iana",extensions:["ghf"]},"application/vnd.groove-identity-message":{source:"iana",extensions:["gim"]},"application/vnd.groove-injector":{source:"iana",extensions:["grv"]},"application/vnd.groove-tool-message":{source:"iana",extensions:["gtm"]},"application/vnd.groove-tool-template":{source:"iana",extensions:["tpl"]},"application/vnd.groove-vcard":{source:"iana",extensions:["vcg"]},"application/vnd.hal+json":{source:"iana",compressible:!0},"application/vnd.hal+xml":{source:"iana",compressible:!0,extensions:["hal"]},"application/vnd.handheld-entertainment+xml":{source:"iana",compressible:!0,extensions:["zmm"]},"application/vnd.hbci":{source:"iana",extensions:["hbci"]},"application/vnd.hc+json":{source:"iana",compressible:!0},"application/vnd.hcl-bireports":{source:"iana"},"application/vnd.hdt":{source:"iana"},"application/vnd.heroku+json":{source:"iana",compressible:!0},"application/vnd.hhe.lesson-player":{source:"iana",extensions:["les"]},"application/vnd.hl7cda+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hl7v2+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.hp-hpgl":{source:"iana",extensions:["hpgl"]},"application/vnd.hp-hpid":{source:"iana",extensions:["hpid"]},"application/vnd.hp-hps":{source:"iana",extensions:["hps"]},"application/vnd.hp-jlyt":{source:"iana",extensions:["jlt"]},"application/vnd.hp-pcl":{source:"iana",extensions:["pcl"]},"application/vnd.hp-pclxl":{source:"iana",extensions:["pclxl"]},"application/vnd.httphone":{source:"iana"},"application/vnd.hydrostatix.sof-data":{source:"iana",extensions:["sfd-hdstx"]},"application/vnd.hyper+json":{source:"iana",compressible:!0},"application/vnd.hyper-item+json":{source:"iana",compressible:!0},"application/vnd.hyperdrive+json":{source:"iana",compressible:!0},"application/vnd.hzn-3d-crossword":{source:"iana"},"application/vnd.ibm.afplinedata":{source:"iana"},"application/vnd.ibm.electronic-media":{source:"iana"},"application/vnd.ibm.minipay":{source:"iana",extensions:["mpy"]},"application/vnd.ibm.modcap":{source:"iana",extensions:["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{source:"iana",extensions:["irm"]},"application/vnd.ibm.secure-container":{source:"iana",extensions:["sc"]},"application/vnd.iccprofile":{source:"iana",extensions:["icc","icm"]},"application/vnd.ieee.1905":{source:"iana"},"application/vnd.igloader":{source:"iana",extensions:["igl"]},"application/vnd.imagemeter.folder+zip":{source:"iana",compressible:!1},"application/vnd.imagemeter.image+zip":{source:"iana",compressible:!1},"application/vnd.immervision-ivp":{source:"iana",extensions:["ivp"]},"application/vnd.immervision-ivu":{source:"iana",extensions:["ivu"]},"application/vnd.ims.imsccv1p1":{source:"iana"},"application/vnd.ims.imsccv1p2":{source:"iana"},"application/vnd.ims.imsccv1p3":{source:"iana"},"application/vnd.ims.lis.v2.result+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolproxy.id+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings+json":{source:"iana",compressible:!0},"application/vnd.ims.lti.v2.toolsettings.simple+json":{source:"iana",compressible:!0},"application/vnd.informedcontrol.rms+xml":{source:"iana",compressible:!0},"application/vnd.informix-visionary":{source:"iana"},"application/vnd.infotech.project":{source:"iana"},"application/vnd.infotech.project+xml":{source:"iana",compressible:!0},"application/vnd.innopath.wamp.notification":{source:"iana"},"application/vnd.insors.igm":{source:"iana",extensions:["igm"]},"application/vnd.intercon.formnet":{source:"iana",extensions:["xpw","xpx"]},"application/vnd.intergeo":{source:"iana",extensions:["i2g"]},"application/vnd.intertrust.digibox":{source:"iana"},"application/vnd.intertrust.nncp":{source:"iana"},"application/vnd.intu.qbo":{source:"iana",extensions:["qbo"]},"application/vnd.intu.qfx":{source:"iana",extensions:["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.conceptitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.knowledgeitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.newsmessage+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.packageitem+xml":{source:"iana",compressible:!0},"application/vnd.iptc.g2.planningitem+xml":{source:"iana",compressible:!0},"application/vnd.ipunplugged.rcprofile":{source:"iana",extensions:["rcprofile"]},"application/vnd.irepository.package+xml":{source:"iana",compressible:!0,extensions:["irp"]},"application/vnd.is-xpr":{source:"iana",extensions:["xpr"]},"application/vnd.isac.fcs":{source:"iana",extensions:["fcs"]},"application/vnd.iso11783-10+zip":{source:"iana",compressible:!1},"application/vnd.jam":{source:"iana",extensions:["jam"]},"application/vnd.japannet-directory-service":{source:"iana"},"application/vnd.japannet-jpnstore-wakeup":{source:"iana"},"application/vnd.japannet-payment-wakeup":{source:"iana"},"application/vnd.japannet-registration":{source:"iana"},"application/vnd.japannet-registration-wakeup":{source:"iana"},"application/vnd.japannet-setstore-wakeup":{source:"iana"},"application/vnd.japannet-verification":{source:"iana"},"application/vnd.japannet-verification-wakeup":{source:"iana"},"application/vnd.jcp.javame.midlet-rms":{source:"iana",extensions:["rms"]},"application/vnd.jisp":{source:"iana",extensions:["jisp"]},"application/vnd.joost.joda-archive":{source:"iana",extensions:["joda"]},"application/vnd.jsk.isdn-ngn":{source:"iana"},"application/vnd.kahootz":{source:"iana",extensions:["ktz","ktr"]},"application/vnd.kde.karbon":{source:"iana",extensions:["karbon"]},"application/vnd.kde.kchart":{source:"iana",extensions:["chrt"]},"application/vnd.kde.kformula":{source:"iana",extensions:["kfo"]},"application/vnd.kde.kivio":{source:"iana",extensions:["flw"]},"application/vnd.kde.kontour":{source:"iana",extensions:["kon"]},"application/vnd.kde.kpresenter":{source:"iana",extensions:["kpr","kpt"]},"application/vnd.kde.kspread":{source:"iana",extensions:["ksp"]},"application/vnd.kde.kword":{source:"iana",extensions:["kwd","kwt"]},"application/vnd.kenameaapp":{source:"iana",extensions:["htke"]},"application/vnd.kidspiration":{source:"iana",extensions:["kia"]},"application/vnd.kinar":{source:"iana",extensions:["kne","knp"]},"application/vnd.koan":{source:"iana",extensions:["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{source:"iana",extensions:["sse"]},"application/vnd.las":{source:"iana"},"application/vnd.las.las+json":{source:"iana",compressible:!0},"application/vnd.las.las+xml":{source:"iana",compressible:!0,extensions:["lasxml"]},"application/vnd.laszip":{source:"iana"},"application/vnd.leap+json":{source:"iana",compressible:!0},"application/vnd.liberty-request+xml":{source:"iana",compressible:!0},"application/vnd.llamagraphics.life-balance.desktop":{source:"iana",extensions:["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{source:"iana",compressible:!0,extensions:["lbe"]},"application/vnd.logipipe.circuit+zip":{source:"iana",compressible:!1},"application/vnd.loom":{source:"iana"},"application/vnd.lotus-1-2-3":{source:"iana",extensions:["123"]},"application/vnd.lotus-approach":{source:"iana",extensions:["apr"]},"application/vnd.lotus-freelance":{source:"iana",extensions:["pre"]},"application/vnd.lotus-notes":{source:"iana",extensions:["nsf"]},"application/vnd.lotus-organizer":{source:"iana",extensions:["org"]},"application/vnd.lotus-screencam":{source:"iana",extensions:["scm"]},"application/vnd.lotus-wordpro":{source:"iana",extensions:["lwp"]},"application/vnd.macports.portpkg":{source:"iana",extensions:["portpkg"]},"application/vnd.mapbox-vector-tile":{source:"iana",extensions:["mvt"]},"application/vnd.marlin.drm.actiontoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.conftoken+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.license+xml":{source:"iana",compressible:!0},"application/vnd.marlin.drm.mdcf":{source:"iana"},"application/vnd.mason+json":{source:"iana",compressible:!0},"application/vnd.maxar.archive.3tz+zip":{source:"iana",compressible:!1},"application/vnd.maxmind.maxmind-db":{source:"iana"},"application/vnd.mcd":{source:"iana",extensions:["mcd"]},"application/vnd.medcalcdata":{source:"iana",extensions:["mc1"]},"application/vnd.mediastation.cdkey":{source:"iana",extensions:["cdkey"]},"application/vnd.meridian-slingshot":{source:"iana"},"application/vnd.mfer":{source:"iana",extensions:["mwf"]},"application/vnd.mfmp":{source:"iana",extensions:["mfm"]},"application/vnd.micro+json":{source:"iana",compressible:!0},"application/vnd.micrografx.flo":{source:"iana",extensions:["flo"]},"application/vnd.micrografx.igx":{source:"iana",extensions:["igx"]},"application/vnd.microsoft.portable-executable":{source:"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{source:"iana"},"application/vnd.miele+json":{source:"iana",compressible:!0},"application/vnd.mif":{source:"iana",extensions:["mif"]},"application/vnd.minisoft-hp3000-save":{source:"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{source:"iana"},"application/vnd.mobius.daf":{source:"iana",extensions:["daf"]},"application/vnd.mobius.dis":{source:"iana",extensions:["dis"]},"application/vnd.mobius.mbk":{source:"iana",extensions:["mbk"]},"application/vnd.mobius.mqy":{source:"iana",extensions:["mqy"]},"application/vnd.mobius.msl":{source:"iana",extensions:["msl"]},"application/vnd.mobius.plc":{source:"iana",extensions:["plc"]},"application/vnd.mobius.txf":{source:"iana",extensions:["txf"]},"application/vnd.mophun.application":{source:"iana",extensions:["mpn"]},"application/vnd.mophun.certificate":{source:"iana",extensions:["mpc"]},"application/vnd.motorola.flexsuite":{source:"iana"},"application/vnd.motorola.flexsuite.adsi":{source:"iana"},"application/vnd.motorola.flexsuite.fis":{source:"iana"},"application/vnd.motorola.flexsuite.gotap":{source:"iana"},"application/vnd.motorola.flexsuite.kmr":{source:"iana"},"application/vnd.motorola.flexsuite.ttc":{source:"iana"},"application/vnd.motorola.flexsuite.wem":{source:"iana"},"application/vnd.motorola.iprm":{source:"iana"},"application/vnd.mozilla.xul+xml":{source:"iana",compressible:!0,extensions:["xul"]},"application/vnd.ms-3mfdocument":{source:"iana"},"application/vnd.ms-artgalry":{source:"iana",extensions:["cil"]},"application/vnd.ms-asf":{source:"iana"},"application/vnd.ms-cab-compressed":{source:"iana",extensions:["cab"]},"application/vnd.ms-color.iccprofile":{source:"apache"},"application/vnd.ms-excel":{source:"iana",compressible:!1,extensions:["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{source:"iana",extensions:["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{source:"iana",extensions:["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{source:"iana",extensions:["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{source:"iana",extensions:["xltm"]},"application/vnd.ms-fontobject":{source:"iana",compressible:!0,extensions:["eot"]},"application/vnd.ms-htmlhelp":{source:"iana",extensions:["chm"]},"application/vnd.ms-ims":{source:"iana",extensions:["ims"]},"application/vnd.ms-lrm":{source:"iana",extensions:["lrm"]},"application/vnd.ms-office.activex+xml":{source:"iana",compressible:!0},"application/vnd.ms-officetheme":{source:"iana",extensions:["thmx"]},"application/vnd.ms-opentype":{source:"apache",compressible:!0},"application/vnd.ms-outlook":{compressible:!1,extensions:["msg"]},"application/vnd.ms-package.obfuscated-opentype":{source:"apache"},"application/vnd.ms-pki.seccat":{source:"apache",extensions:["cat"]},"application/vnd.ms-pki.stl":{source:"apache",extensions:["stl"]},"application/vnd.ms-playready.initiator+xml":{source:"iana",compressible:!0},"application/vnd.ms-powerpoint":{source:"iana",compressible:!1,extensions:["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{source:"iana",extensions:["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{source:"iana",extensions:["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{source:"iana",extensions:["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{source:"iana",extensions:["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{source:"iana",extensions:["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{source:"iana",compressible:!0},"application/vnd.ms-printing.printticket+xml":{source:"apache",compressible:!0},"application/vnd.ms-printschematicket+xml":{source:"iana",compressible:!0},"application/vnd.ms-project":{source:"iana",extensions:["mpp","mpt"]},"application/vnd.ms-tnef":{source:"iana"},"application/vnd.ms-windows.devicepairing":{source:"iana"},"application/vnd.ms-windows.nwprinting.oob":{source:"iana"},"application/vnd.ms-windows.printerpairing":{source:"iana"},"application/vnd.ms-windows.wsd.oob":{source:"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.lic-resp":{source:"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{source:"iana"},"application/vnd.ms-wmdrm.meter-resp":{source:"iana"},"application/vnd.ms-word.document.macroenabled.12":{source:"iana",extensions:["docm"]},"application/vnd.ms-word.template.macroenabled.12":{source:"iana",extensions:["dotm"]},"application/vnd.ms-works":{source:"iana",extensions:["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{source:"iana",extensions:["wpl"]},"application/vnd.ms-xpsdocument":{source:"iana",compressible:!1,extensions:["xps"]},"application/vnd.msa-disk-image":{source:"iana"},"application/vnd.mseq":{source:"iana",extensions:["mseq"]},"application/vnd.msign":{source:"iana"},"application/vnd.multiad.creator":{source:"iana"},"application/vnd.multiad.creator.cif":{source:"iana"},"application/vnd.music-niff":{source:"iana"},"application/vnd.musician":{source:"iana",extensions:["mus"]},"application/vnd.muvee.style":{source:"iana",extensions:["msty"]},"application/vnd.mynfc":{source:"iana",extensions:["taglet"]},"application/vnd.nacamar.ybrid+json":{source:"iana",compressible:!0},"application/vnd.ncd.control":{source:"iana"},"application/vnd.ncd.reference":{source:"iana"},"application/vnd.nearst.inv+json":{source:"iana",compressible:!0},"application/vnd.nebumind.line":{source:"iana"},"application/vnd.nervana":{source:"iana"},"application/vnd.netfpx":{source:"iana"},"application/vnd.neurolanguage.nlu":{source:"iana",extensions:["nlu"]},"application/vnd.nimn":{source:"iana"},"application/vnd.nintendo.nitro.rom":{source:"iana"},"application/vnd.nintendo.snes.rom":{source:"iana"},"application/vnd.nitf":{source:"iana",extensions:["ntf","nitf"]},"application/vnd.noblenet-directory":{source:"iana",extensions:["nnd"]},"application/vnd.noblenet-sealer":{source:"iana",extensions:["nns"]},"application/vnd.noblenet-web":{source:"iana",extensions:["nnw"]},"application/vnd.nokia.catalogs":{source:"iana"},"application/vnd.nokia.conml+wbxml":{source:"iana"},"application/vnd.nokia.conml+xml":{source:"iana",compressible:!0},"application/vnd.nokia.iptv.config+xml":{source:"iana",compressible:!0},"application/vnd.nokia.isds-radio-presets":{source:"iana"},"application/vnd.nokia.landmark+wbxml":{source:"iana"},"application/vnd.nokia.landmark+xml":{source:"iana",compressible:!0},"application/vnd.nokia.landmarkcollection+xml":{source:"iana",compressible:!0},"application/vnd.nokia.n-gage.ac+xml":{source:"iana",compressible:!0,extensions:["ac"]},"application/vnd.nokia.n-gage.data":{source:"iana",extensions:["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{source:"iana",extensions:["n-gage"]},"application/vnd.nokia.ncd":{source:"iana"},"application/vnd.nokia.pcd+wbxml":{source:"iana"},"application/vnd.nokia.pcd+xml":{source:"iana",compressible:!0},"application/vnd.nokia.radio-preset":{source:"iana",extensions:["rpst"]},"application/vnd.nokia.radio-presets":{source:"iana",extensions:["rpss"]},"application/vnd.novadigm.edm":{source:"iana",extensions:["edm"]},"application/vnd.novadigm.edx":{source:"iana",extensions:["edx"]},"application/vnd.novadigm.ext":{source:"iana",extensions:["ext"]},"application/vnd.ntt-local.content-share":{source:"iana"},"application/vnd.ntt-local.file-transfer":{source:"iana"},"application/vnd.ntt-local.ogw_remote-access":{source:"iana"},"application/vnd.ntt-local.sip-ta_remote":{source:"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{source:"iana"},"application/vnd.oasis.opendocument.chart":{source:"iana",extensions:["odc"]},"application/vnd.oasis.opendocument.chart-template":{source:"iana",extensions:["otc"]},"application/vnd.oasis.opendocument.database":{source:"iana",extensions:["odb"]},"application/vnd.oasis.opendocument.formula":{source:"iana",extensions:["odf"]},"application/vnd.oasis.opendocument.formula-template":{source:"iana",extensions:["odft"]},"application/vnd.oasis.opendocument.graphics":{source:"iana",compressible:!1,extensions:["odg"]},"application/vnd.oasis.opendocument.graphics-template":{source:"iana",extensions:["otg"]},"application/vnd.oasis.opendocument.image":{source:"iana",extensions:["odi"]},"application/vnd.oasis.opendocument.image-template":{source:"iana",extensions:["oti"]},"application/vnd.oasis.opendocument.presentation":{source:"iana",compressible:!1,extensions:["odp"]},"application/vnd.oasis.opendocument.presentation-template":{source:"iana",extensions:["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{source:"iana",compressible:!1,extensions:["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{source:"iana",extensions:["ots"]},"application/vnd.oasis.opendocument.text":{source:"iana",compressible:!1,extensions:["odt"]},"application/vnd.oasis.opendocument.text-master":{source:"iana",extensions:["odm"]},"application/vnd.oasis.opendocument.text-template":{source:"iana",extensions:["ott"]},"application/vnd.oasis.opendocument.text-web":{source:"iana",extensions:["oth"]},"application/vnd.obn":{source:"iana"},"application/vnd.ocf+cbor":{source:"iana"},"application/vnd.oci.image.manifest.v1+json":{source:"iana",compressible:!0},"application/vnd.oftn.l10n+json":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessdownload+xml":{source:"iana",compressible:!0},"application/vnd.oipf.contentaccessstreaming+xml":{source:"iana",compressible:!0},"application/vnd.oipf.cspg-hexbinary":{source:"iana"},"application/vnd.oipf.dae.svg+xml":{source:"iana",compressible:!0},"application/vnd.oipf.dae.xhtml+xml":{source:"iana",compressible:!0},"application/vnd.oipf.mippvcontrolmessage+xml":{source:"iana",compressible:!0},"application/vnd.oipf.pae.gem":{source:"iana"},"application/vnd.oipf.spdiscovery+xml":{source:"iana",compressible:!0},"application/vnd.oipf.spdlist+xml":{source:"iana",compressible:!0},"application/vnd.oipf.ueprofile+xml":{source:"iana",compressible:!0},"application/vnd.oipf.userprofile+xml":{source:"iana",compressible:!0},"application/vnd.olpc-sugar":{source:"iana",extensions:["xo"]},"application/vnd.oma-scws-config":{source:"iana"},"application/vnd.oma-scws-http-request":{source:"iana"},"application/vnd.oma-scws-http-response":{source:"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.drm-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.imd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.ltkm":{source:"iana"},"application/vnd.oma.bcast.notification+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.provisioningtrigger":{source:"iana"},"application/vnd.oma.bcast.sgboot":{source:"iana"},"application/vnd.oma.bcast.sgdd+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sgdu":{source:"iana"},"application/vnd.oma.bcast.simple-symbol-container":{source:"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.sprov+xml":{source:"iana",compressible:!0},"application/vnd.oma.bcast.stkm":{source:"iana"},"application/vnd.oma.cab-address-book+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-feature-handler+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-pcc+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-subs-invite+xml":{source:"iana",compressible:!0},"application/vnd.oma.cab-user-prefs+xml":{source:"iana",compressible:!0},"application/vnd.oma.dcd":{source:"iana"},"application/vnd.oma.dcdc":{source:"iana"},"application/vnd.oma.dd2+xml":{source:"iana",compressible:!0,extensions:["dd2"]},"application/vnd.oma.drm.risd+xml":{source:"iana",compressible:!0},"application/vnd.oma.group-usage-list+xml":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+cbor":{source:"iana"},"application/vnd.oma.lwm2m+json":{source:"iana",compressible:!0},"application/vnd.oma.lwm2m+tlv":{source:"iana"},"application/vnd.oma.pal+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.detailed-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.final-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.groups+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.invocation-descriptor+xml":{source:"iana",compressible:!0},"application/vnd.oma.poc.optimized-progress-report+xml":{source:"iana",compressible:!0},"application/vnd.oma.push":{source:"iana"},"application/vnd.oma.scidm.messages+xml":{source:"iana",compressible:!0},"application/vnd.oma.xcap-directory+xml":{source:"iana",compressible:!0},"application/vnd.omads-email+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-file+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omads-folder+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.omaloc-supl-init":{source:"iana"},"application/vnd.onepager":{source:"iana"},"application/vnd.onepagertamp":{source:"iana"},"application/vnd.onepagertamx":{source:"iana"},"application/vnd.onepagertat":{source:"iana"},"application/vnd.onepagertatp":{source:"iana"},"application/vnd.onepagertatx":{source:"iana"},"application/vnd.openblox.game+xml":{source:"iana",compressible:!0,extensions:["obgx"]},"application/vnd.openblox.game-binary":{source:"iana"},"application/vnd.openeye.oeb":{source:"iana"},"application/vnd.openofficeorg.extension":{source:"apache",extensions:["oxt"]},"application/vnd.openstreetmap.data+xml":{source:"iana",compressible:!0,extensions:["osm"]},"application/vnd.opentimestamps.ots":{source:"iana"},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawing+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",compressible:!1,extensions:["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slide":{source:"iana",extensions:["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{source:"iana",extensions:["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.template":{source:"iana",extensions:["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",compressible:!1,extensions:["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{source:"iana",extensions:["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.theme+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.vmldrawing":{source:"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",compressible:!1,extensions:["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{source:"iana",extensions:["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.core-properties+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{source:"iana",compressible:!0},"application/vnd.openxmlformats-package.relationships+xml":{source:"iana",compressible:!0},"application/vnd.oracle.resource+json":{source:"iana",compressible:!0},"application/vnd.orange.indata":{source:"iana"},"application/vnd.osa.netdeploy":{source:"iana"},"application/vnd.osgeo.mapguide.package":{source:"iana",extensions:["mgp"]},"application/vnd.osgi.bundle":{source:"iana"},"application/vnd.osgi.dp":{source:"iana",extensions:["dp"]},"application/vnd.osgi.subsystem":{source:"iana",extensions:["esa"]},"application/vnd.otps.ct-kip+xml":{source:"iana",compressible:!0},"application/vnd.oxli.countgraph":{source:"iana"},"application/vnd.pagerduty+json":{source:"iana",compressible:!0},"application/vnd.palm":{source:"iana",extensions:["pdb","pqa","oprc"]},"application/vnd.panoply":{source:"iana"},"application/vnd.paos.xml":{source:"iana"},"application/vnd.patentdive":{source:"iana"},"application/vnd.patientecommsdoc":{source:"iana"},"application/vnd.pawaafile":{source:"iana",extensions:["paw"]},"application/vnd.pcos":{source:"iana"},"application/vnd.pg.format":{source:"iana",extensions:["str"]},"application/vnd.pg.osasli":{source:"iana",extensions:["ei6"]},"application/vnd.piaccess.application-licence":{source:"iana"},"application/vnd.picsel":{source:"iana",extensions:["efif"]},"application/vnd.pmi.widget":{source:"iana",extensions:["wg"]},"application/vnd.poc.group-advertisement+xml":{source:"iana",compressible:!0},"application/vnd.pocketlearn":{source:"iana",extensions:["plf"]},"application/vnd.powerbuilder6":{source:"iana",extensions:["pbd"]},"application/vnd.powerbuilder6-s":{source:"iana"},"application/vnd.powerbuilder7":{source:"iana"},"application/vnd.powerbuilder7-s":{source:"iana"},"application/vnd.powerbuilder75":{source:"iana"},"application/vnd.powerbuilder75-s":{source:"iana"},"application/vnd.preminet":{source:"iana"},"application/vnd.previewsystems.box":{source:"iana",extensions:["box"]},"application/vnd.proteus.magazine":{source:"iana",extensions:["mgz"]},"application/vnd.psfs":{source:"iana"},"application/vnd.publishare-delta-tree":{source:"iana",extensions:["qps"]},"application/vnd.pvi.ptid1":{source:"iana",extensions:["ptid"]},"application/vnd.pwg-multiplexed":{source:"iana"},"application/vnd.pwg-xhtml-print+xml":{source:"iana",compressible:!0},"application/vnd.qualcomm.brew-app-res":{source:"iana"},"application/vnd.quarantainenet":{source:"iana"},"application/vnd.quark.quarkxpress":{source:"iana",extensions:["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{source:"iana"},"application/vnd.radisys.moml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-conn+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-audit-stream+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-conf+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-base+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-detect+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-group+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-speech+xml":{source:"iana",compressible:!0},"application/vnd.radisys.msml-dialog-transform+xml":{source:"iana",compressible:!0},"application/vnd.rainstor.data":{source:"iana"},"application/vnd.rapid":{source:"iana"},"application/vnd.rar":{source:"iana",extensions:["rar"]},"application/vnd.realvnc.bed":{source:"iana",extensions:["bed"]},"application/vnd.recordare.musicxml":{source:"iana",extensions:["mxl"]},"application/vnd.recordare.musicxml+xml":{source:"iana",compressible:!0,extensions:["musicxml"]},"application/vnd.renlearn.rlprint":{source:"iana"},"application/vnd.resilient.logic":{source:"iana"},"application/vnd.restful+json":{source:"iana",compressible:!0},"application/vnd.rig.cryptonote":{source:"iana",extensions:["cryptonote"]},"application/vnd.rim.cod":{source:"apache",extensions:["cod"]},"application/vnd.rn-realmedia":{source:"apache",extensions:["rm"]},"application/vnd.rn-realmedia-vbr":{source:"apache",extensions:["rmvb"]},"application/vnd.route66.link66+xml":{source:"iana",compressible:!0,extensions:["link66"]},"application/vnd.rs-274x":{source:"iana"},"application/vnd.ruckus.download":{source:"iana"},"application/vnd.s3sms":{source:"iana"},"application/vnd.sailingtracker.track":{source:"iana",extensions:["st"]},"application/vnd.sar":{source:"iana"},"application/vnd.sbm.cid":{source:"iana"},"application/vnd.sbm.mid2":{source:"iana"},"application/vnd.scribus":{source:"iana"},"application/vnd.sealed.3df":{source:"iana"},"application/vnd.sealed.csf":{source:"iana"},"application/vnd.sealed.doc":{source:"iana"},"application/vnd.sealed.eml":{source:"iana"},"application/vnd.sealed.mht":{source:"iana"},"application/vnd.sealed.net":{source:"iana"},"application/vnd.sealed.ppt":{source:"iana"},"application/vnd.sealed.tiff":{source:"iana"},"application/vnd.sealed.xls":{source:"iana"},"application/vnd.sealedmedia.softseal.html":{source:"iana"},"application/vnd.sealedmedia.softseal.pdf":{source:"iana"},"application/vnd.seemail":{source:"iana",extensions:["see"]},"application/vnd.seis+json":{source:"iana",compressible:!0},"application/vnd.sema":{source:"iana",extensions:["sema"]},"application/vnd.semd":{source:"iana",extensions:["semd"]},"application/vnd.semf":{source:"iana",extensions:["semf"]},"application/vnd.shade-save-file":{source:"iana"},"application/vnd.shana.informed.formdata":{source:"iana",extensions:["ifm"]},"application/vnd.shana.informed.formtemplate":{source:"iana",extensions:["itp"]},"application/vnd.shana.informed.interchange":{source:"iana",extensions:["iif"]},"application/vnd.shana.informed.package":{source:"iana",extensions:["ipk"]},"application/vnd.shootproof+json":{source:"iana",compressible:!0},"application/vnd.shopkick+json":{source:"iana",compressible:!0},"application/vnd.shp":{source:"iana"},"application/vnd.shx":{source:"iana"},"application/vnd.sigrok.session":{source:"iana"},"application/vnd.simtech-mindmapper":{source:"iana",extensions:["twd","twds"]},"application/vnd.siren+json":{source:"iana",compressible:!0},"application/vnd.smaf":{source:"iana",extensions:["mmf"]},"application/vnd.smart.notebook":{source:"iana"},"application/vnd.smart.teacher":{source:"iana",extensions:["teacher"]},"application/vnd.snesdev-page-table":{source:"iana"},"application/vnd.software602.filler.form+xml":{source:"iana",compressible:!0,extensions:["fo"]},"application/vnd.software602.filler.form-xml-zip":{source:"iana"},"application/vnd.solent.sdkm+xml":{source:"iana",compressible:!0,extensions:["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{source:"iana",extensions:["dxp"]},"application/vnd.spotfire.sfs":{source:"iana",extensions:["sfs"]},"application/vnd.sqlite3":{source:"iana"},"application/vnd.sss-cod":{source:"iana"},"application/vnd.sss-dtf":{source:"iana"},"application/vnd.sss-ntf":{source:"iana"},"application/vnd.stardivision.calc":{source:"apache",extensions:["sdc"]},"application/vnd.stardivision.draw":{source:"apache",extensions:["sda"]},"application/vnd.stardivision.impress":{source:"apache",extensions:["sdd"]},"application/vnd.stardivision.math":{source:"apache",extensions:["smf"]},"application/vnd.stardivision.writer":{source:"apache",extensions:["sdw","vor"]},"application/vnd.stardivision.writer-global":{source:"apache",extensions:["sgl"]},"application/vnd.stepmania.package":{source:"iana",extensions:["smzip"]},"application/vnd.stepmania.stepchart":{source:"iana",extensions:["sm"]},"application/vnd.street-stream":{source:"iana"},"application/vnd.sun.wadl+xml":{source:"iana",compressible:!0,extensions:["wadl"]},"application/vnd.sun.xml.calc":{source:"apache",extensions:["sxc"]},"application/vnd.sun.xml.calc.template":{source:"apache",extensions:["stc"]},"application/vnd.sun.xml.draw":{source:"apache",extensions:["sxd"]},"application/vnd.sun.xml.draw.template":{source:"apache",extensions:["std"]},"application/vnd.sun.xml.impress":{source:"apache",extensions:["sxi"]},"application/vnd.sun.xml.impress.template":{source:"apache",extensions:["sti"]},"application/vnd.sun.xml.math":{source:"apache",extensions:["sxm"]},"application/vnd.sun.xml.writer":{source:"apache",extensions:["sxw"]},"application/vnd.sun.xml.writer.global":{source:"apache",extensions:["sxg"]},"application/vnd.sun.xml.writer.template":{source:"apache",extensions:["stw"]},"application/vnd.sus-calendar":{source:"iana",extensions:["sus","susp"]},"application/vnd.svd":{source:"iana",extensions:["svd"]},"application/vnd.swiftview-ics":{source:"iana"},"application/vnd.sycle+xml":{source:"iana",compressible:!0},"application/vnd.syft+json":{source:"iana",compressible:!0},"application/vnd.symbian.install":{source:"apache",extensions:["sis","sisx"]},"application/vnd.syncml+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xsm"]},"application/vnd.syncml.dm+wbxml":{source:"iana",charset:"UTF-8",extensions:["bdm"]},"application/vnd.syncml.dm+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["xdm"]},"application/vnd.syncml.dm.notification":{source:"iana"},"application/vnd.syncml.dmddf+wbxml":{source:"iana"},"application/vnd.syncml.dmddf+xml":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["ddf"]},"application/vnd.syncml.dmtnds+wbxml":{source:"iana"},"application/vnd.syncml.dmtnds+xml":{source:"iana",charset:"UTF-8",compressible:!0},"application/vnd.syncml.ds.notification":{source:"iana"},"application/vnd.tableschema+json":{source:"iana",compressible:!0},"application/vnd.tao.intent-module-archive":{source:"iana",extensions:["tao"]},"application/vnd.tcpdump.pcap":{source:"iana",extensions:["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{source:"iana",compressible:!0},"application/vnd.tmd.mediaflex.api+xml":{source:"iana",compressible:!0},"application/vnd.tml":{source:"iana"},"application/vnd.tmobile-livetv":{source:"iana",extensions:["tmo"]},"application/vnd.tri.onesource":{source:"iana"},"application/vnd.trid.tpt":{source:"iana",extensions:["tpt"]},"application/vnd.triscape.mxs":{source:"iana",extensions:["mxs"]},"application/vnd.trueapp":{source:"iana",extensions:["tra"]},"application/vnd.truedoc":{source:"iana"},"application/vnd.ubisoft.webplayer":{source:"iana"},"application/vnd.ufdl":{source:"iana",extensions:["ufd","ufdl"]},"application/vnd.uiq.theme":{source:"iana",extensions:["utz"]},"application/vnd.umajin":{source:"iana",extensions:["umj"]},"application/vnd.unity":{source:"iana",extensions:["unityweb"]},"application/vnd.uoml+xml":{source:"iana",compressible:!0,extensions:["uoml"]},"application/vnd.uplanet.alert":{source:"iana"},"application/vnd.uplanet.alert-wbxml":{source:"iana"},"application/vnd.uplanet.bearer-choice":{source:"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{source:"iana"},"application/vnd.uplanet.cacheop":{source:"iana"},"application/vnd.uplanet.cacheop-wbxml":{source:"iana"},"application/vnd.uplanet.channel":{source:"iana"},"application/vnd.uplanet.channel-wbxml":{source:"iana"},"application/vnd.uplanet.list":{source:"iana"},"application/vnd.uplanet.list-wbxml":{source:"iana"},"application/vnd.uplanet.listcmd":{source:"iana"},"application/vnd.uplanet.listcmd-wbxml":{source:"iana"},"application/vnd.uplanet.signal":{source:"iana"},"application/vnd.uri-map":{source:"iana"},"application/vnd.valve.source.material":{source:"iana"},"application/vnd.vcx":{source:"iana",extensions:["vcx"]},"application/vnd.vd-study":{source:"iana"},"application/vnd.vectorworks":{source:"iana"},"application/vnd.vel+json":{source:"iana",compressible:!0},"application/vnd.verimatrix.vcas":{source:"iana"},"application/vnd.veritone.aion+json":{source:"iana",compressible:!0},"application/vnd.veryant.thin":{source:"iana"},"application/vnd.ves.encrypted":{source:"iana"},"application/vnd.vidsoft.vidconference":{source:"iana"},"application/vnd.visio":{source:"iana",extensions:["vsd","vst","vss","vsw"]},"application/vnd.visionary":{source:"iana",extensions:["vis"]},"application/vnd.vividence.scriptfile":{source:"iana"},"application/vnd.vsf":{source:"iana",extensions:["vsf"]},"application/vnd.wap.sic":{source:"iana"},"application/vnd.wap.slc":{source:"iana"},"application/vnd.wap.wbxml":{source:"iana",charset:"UTF-8",extensions:["wbxml"]},"application/vnd.wap.wmlc":{source:"iana",extensions:["wmlc"]},"application/vnd.wap.wmlscriptc":{source:"iana",extensions:["wmlsc"]},"application/vnd.webturbo":{source:"iana",extensions:["wtb"]},"application/vnd.wfa.dpp":{source:"iana"},"application/vnd.wfa.p2p":{source:"iana"},"application/vnd.wfa.wsc":{source:"iana"},"application/vnd.windows.devicepairing":{source:"iana"},"application/vnd.wmc":{source:"iana"},"application/vnd.wmf.bootstrap":{source:"iana"},"application/vnd.wolfram.mathematica":{source:"iana"},"application/vnd.wolfram.mathematica.package":{source:"iana"},"application/vnd.wolfram.player":{source:"iana",extensions:["nbp"]},"application/vnd.wordperfect":{source:"iana",extensions:["wpd"]},"application/vnd.wqd":{source:"iana",extensions:["wqd"]},"application/vnd.wrq-hp3000-labelled":{source:"iana"},"application/vnd.wt.stf":{source:"iana",extensions:["stf"]},"application/vnd.wv.csp+wbxml":{source:"iana"},"application/vnd.wv.csp+xml":{source:"iana",compressible:!0},"application/vnd.wv.ssp+xml":{source:"iana",compressible:!0},"application/vnd.xacml+json":{source:"iana",compressible:!0},"application/vnd.xara":{source:"iana",extensions:["xar"]},"application/vnd.xfdl":{source:"iana",extensions:["xfdl"]},"application/vnd.xfdl.webform":{source:"iana"},"application/vnd.xmi+xml":{source:"iana",compressible:!0},"application/vnd.xmpie.cpkg":{source:"iana"},"application/vnd.xmpie.dpkg":{source:"iana"},"application/vnd.xmpie.plan":{source:"iana"},"application/vnd.xmpie.ppkg":{source:"iana"},"application/vnd.xmpie.xlim":{source:"iana"},"application/vnd.yamaha.hv-dic":{source:"iana",extensions:["hvd"]},"application/vnd.yamaha.hv-script":{source:"iana",extensions:["hvs"]},"application/vnd.yamaha.hv-voice":{source:"iana",extensions:["hvp"]},"application/vnd.yamaha.openscoreformat":{source:"iana",extensions:["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{source:"iana",compressible:!0,extensions:["osfpvg"]},"application/vnd.yamaha.remote-setup":{source:"iana"},"application/vnd.yamaha.smaf-audio":{source:"iana",extensions:["saf"]},"application/vnd.yamaha.smaf-phrase":{source:"iana",extensions:["spf"]},"application/vnd.yamaha.through-ngn":{source:"iana"},"application/vnd.yamaha.tunnel-udpencap":{source:"iana"},"application/vnd.yaoweme":{source:"iana"},"application/vnd.yellowriver-custom-menu":{source:"iana",extensions:["cmp"]},"application/vnd.youtube.yt":{source:"iana"},"application/vnd.zul":{source:"iana",extensions:["zir","zirz"]},"application/vnd.zzazz.deck+xml":{source:"iana",compressible:!0,extensions:["zaz"]},"application/voicexml+xml":{source:"iana",compressible:!0,extensions:["vxml"]},"application/voucher-cms+json":{source:"iana",compressible:!0},"application/vq-rtcpxr":{source:"iana"},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"application/watcherinfo+xml":{source:"iana",compressible:!0,extensions:["wif"]},"application/webpush-options+json":{source:"iana",compressible:!0},"application/whoispp-query":{source:"iana"},"application/whoispp-response":{source:"iana"},"application/widget":{source:"iana",extensions:["wgt"]},"application/winhlp":{source:"apache",extensions:["hlp"]},"application/wita":{source:"iana"},"application/wordperfect5.1":{source:"iana"},"application/wsdl+xml":{source:"iana",compressible:!0,extensions:["wsdl"]},"application/wspolicy+xml":{source:"iana",compressible:!0,extensions:["wspolicy"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/x-abiword":{source:"apache",extensions:["abw"]},"application/x-ace-compressed":{source:"apache",extensions:["ace"]},"application/x-amf":{source:"apache"},"application/x-apple-diskimage":{source:"apache",extensions:["dmg"]},"application/x-arj":{compressible:!1,extensions:["arj"]},"application/x-authorware-bin":{source:"apache",extensions:["aab","x32","u32","vox"]},"application/x-authorware-map":{source:"apache",extensions:["aam"]},"application/x-authorware-seg":{source:"apache",extensions:["aas"]},"application/x-bcpio":{source:"apache",extensions:["bcpio"]},"application/x-bdoc":{compressible:!1,extensions:["bdoc"]},"application/x-bittorrent":{source:"apache",extensions:["torrent"]},"application/x-blorb":{source:"apache",extensions:["blb","blorb"]},"application/x-bzip":{source:"apache",compressible:!1,extensions:["bz"]},"application/x-bzip2":{source:"apache",compressible:!1,extensions:["bz2","boz"]},"application/x-cbr":{source:"apache",extensions:["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{source:"apache",extensions:["vcd"]},"application/x-cfs-compressed":{source:"apache",extensions:["cfs"]},"application/x-chat":{source:"apache",extensions:["chat"]},"application/x-chess-pgn":{source:"apache",extensions:["pgn"]},"application/x-chrome-extension":{extensions:["crx"]},"application/x-cocoa":{source:"nginx",extensions:["cco"]},"application/x-compress":{source:"apache"},"application/x-conference":{source:"apache",extensions:["nsc"]},"application/x-cpio":{source:"apache",extensions:["cpio"]},"application/x-csh":{source:"apache",extensions:["csh"]},"application/x-deb":{compressible:!1},"application/x-debian-package":{source:"apache",extensions:["deb","udeb"]},"application/x-dgc-compressed":{source:"apache",extensions:["dgc"]},"application/x-director":{source:"apache",extensions:["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{source:"apache",extensions:["wad"]},"application/x-dtbncx+xml":{source:"apache",compressible:!0,extensions:["ncx"]},"application/x-dtbook+xml":{source:"apache",compressible:!0,extensions:["dtb"]},"application/x-dtbresource+xml":{source:"apache",compressible:!0,extensions:["res"]},"application/x-dvi":{source:"apache",compressible:!1,extensions:["dvi"]},"application/x-envoy":{source:"apache",extensions:["evy"]},"application/x-eva":{source:"apache",extensions:["eva"]},"application/x-font-bdf":{source:"apache",extensions:["bdf"]},"application/x-font-dos":{source:"apache"},"application/x-font-framemaker":{source:"apache"},"application/x-font-ghostscript":{source:"apache",extensions:["gsf"]},"application/x-font-libgrx":{source:"apache"},"application/x-font-linux-psf":{source:"apache",extensions:["psf"]},"application/x-font-pcf":{source:"apache",extensions:["pcf"]},"application/x-font-snf":{source:"apache",extensions:["snf"]},"application/x-font-speedo":{source:"apache"},"application/x-font-sunos-news":{source:"apache"},"application/x-font-type1":{source:"apache",extensions:["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{source:"apache"},"application/x-freearc":{source:"apache",extensions:["arc"]},"application/x-futuresplash":{source:"apache",extensions:["spl"]},"application/x-gca-compressed":{source:"apache",extensions:["gca"]},"application/x-glulx":{source:"apache",extensions:["ulx"]},"application/x-gnumeric":{source:"apache",extensions:["gnumeric"]},"application/x-gramps-xml":{source:"apache",extensions:["gramps"]},"application/x-gtar":{source:"apache",extensions:["gtar"]},"application/x-gzip":{source:"apache"},"application/x-hdf":{source:"apache",extensions:["hdf"]},"application/x-httpd-php":{compressible:!0,extensions:["php"]},"application/x-install-instructions":{source:"apache",extensions:["install"]},"application/x-iso9660-image":{source:"apache",extensions:["iso"]},"application/x-iwork-keynote-sffkey":{extensions:["key"]},"application/x-iwork-numbers-sffnumbers":{extensions:["numbers"]},"application/x-iwork-pages-sffpages":{extensions:["pages"]},"application/x-java-archive-diff":{source:"nginx",extensions:["jardiff"]},"application/x-java-jnlp-file":{source:"apache",compressible:!1,extensions:["jnlp"]},"application/x-javascript":{compressible:!0},"application/x-keepass2":{extensions:["kdbx"]},"application/x-latex":{source:"apache",compressible:!1,extensions:["latex"]},"application/x-lua-bytecode":{extensions:["luac"]},"application/x-lzh-compressed":{source:"apache",extensions:["lzh","lha"]},"application/x-makeself":{source:"nginx",extensions:["run"]},"application/x-mie":{source:"apache",extensions:["mie"]},"application/x-mobipocket-ebook":{source:"apache",extensions:["prc","mobi"]},"application/x-mpegurl":{compressible:!1},"application/x-ms-application":{source:"apache",extensions:["application"]},"application/x-ms-shortcut":{source:"apache",extensions:["lnk"]},"application/x-ms-wmd":{source:"apache",extensions:["wmd"]},"application/x-ms-wmz":{source:"apache",extensions:["wmz"]},"application/x-ms-xbap":{source:"apache",extensions:["xbap"]},"application/x-msaccess":{source:"apache",extensions:["mdb"]},"application/x-msbinder":{source:"apache",extensions:["obd"]},"application/x-mscardfile":{source:"apache",extensions:["crd"]},"application/x-msclip":{source:"apache",extensions:["clp"]},"application/x-msdos-program":{extensions:["exe"]},"application/x-msdownload":{source:"apache",extensions:["exe","dll","com","bat","msi"]},"application/x-msmediaview":{source:"apache",extensions:["mvb","m13","m14"]},"application/x-msmetafile":{source:"apache",extensions:["wmf","wmz","emf","emz"]},"application/x-msmoney":{source:"apache",extensions:["mny"]},"application/x-mspublisher":{source:"apache",extensions:["pub"]},"application/x-msschedule":{source:"apache",extensions:["scd"]},"application/x-msterminal":{source:"apache",extensions:["trm"]},"application/x-mswrite":{source:"apache",extensions:["wri"]},"application/x-netcdf":{source:"apache",extensions:["nc","cdf"]},"application/x-ns-proxy-autoconfig":{compressible:!0,extensions:["pac"]},"application/x-nzb":{source:"apache",extensions:["nzb"]},"application/x-perl":{source:"nginx",extensions:["pl","pm"]},"application/x-pilot":{source:"nginx",extensions:["prc","pdb"]},"application/x-pkcs12":{source:"apache",compressible:!1,extensions:["p12","pfx"]},"application/x-pkcs7-certificates":{source:"apache",extensions:["p7b","spc"]},"application/x-pkcs7-certreqresp":{source:"apache",extensions:["p7r"]},"application/x-pki-message":{source:"iana"},"application/x-rar-compressed":{source:"apache",compressible:!1,extensions:["rar"]},"application/x-redhat-package-manager":{source:"nginx",extensions:["rpm"]},"application/x-research-info-systems":{source:"apache",extensions:["ris"]},"application/x-sea":{source:"nginx",extensions:["sea"]},"application/x-sh":{source:"apache",compressible:!0,extensions:["sh"]},"application/x-shar":{source:"apache",extensions:["shar"]},"application/x-shockwave-flash":{source:"apache",compressible:!1,extensions:["swf"]},"application/x-silverlight-app":{source:"apache",extensions:["xap"]},"application/x-sql":{source:"apache",extensions:["sql"]},"application/x-stuffit":{source:"apache",compressible:!1,extensions:["sit"]},"application/x-stuffitx":{source:"apache",extensions:["sitx"]},"application/x-subrip":{source:"apache",extensions:["srt"]},"application/x-sv4cpio":{source:"apache",extensions:["sv4cpio"]},"application/x-sv4crc":{source:"apache",extensions:["sv4crc"]},"application/x-t3vm-image":{source:"apache",extensions:["t3"]},"application/x-tads":{source:"apache",extensions:["gam"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-tcl":{source:"apache",extensions:["tcl","tk"]},"application/x-tex":{source:"apache",extensions:["tex"]},"application/x-tex-tfm":{source:"apache",extensions:["tfm"]},"application/x-texinfo":{source:"apache",extensions:["texinfo","texi"]},"application/x-tgif":{source:"apache",extensions:["obj"]},"application/x-ustar":{source:"apache",extensions:["ustar"]},"application/x-virtualbox-hdd":{compressible:!0,extensions:["hdd"]},"application/x-virtualbox-ova":{compressible:!0,extensions:["ova"]},"application/x-virtualbox-ovf":{compressible:!0,extensions:["ovf"]},"application/x-virtualbox-vbox":{compressible:!0,extensions:["vbox"]},"application/x-virtualbox-vbox-extpack":{compressible:!1,extensions:["vbox-extpack"]},"application/x-virtualbox-vdi":{compressible:!0,extensions:["vdi"]},"application/x-virtualbox-vhd":{compressible:!0,extensions:["vhd"]},"application/x-virtualbox-vmdk":{compressible:!0,extensions:["vmdk"]},"application/x-wais-source":{source:"apache",extensions:["src"]},"application/x-web-app-manifest+json":{compressible:!0,extensions:["webapp"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"application/x-x509-ca-cert":{source:"iana",extensions:["der","crt","pem"]},"application/x-x509-ca-ra-cert":{source:"iana"},"application/x-x509-next-ca-cert":{source:"iana"},"application/x-xfig":{source:"apache",extensions:["fig"]},"application/x-xliff+xml":{source:"apache",compressible:!0,extensions:["xlf"]},"application/x-xpinstall":{source:"apache",compressible:!1,extensions:["xpi"]},"application/x-xz":{source:"apache",extensions:["xz"]},"application/x-zmachine":{source:"apache",extensions:["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{source:"iana"},"application/xacml+xml":{source:"iana",compressible:!0},"application/xaml+xml":{source:"apache",compressible:!0,extensions:["xaml"]},"application/xcap-att+xml":{source:"iana",compressible:!0,extensions:["xav"]},"application/xcap-caps+xml":{source:"iana",compressible:!0,extensions:["xca"]},"application/xcap-diff+xml":{source:"iana",compressible:!0,extensions:["xdf"]},"application/xcap-el+xml":{source:"iana",compressible:!0,extensions:["xel"]},"application/xcap-error+xml":{source:"iana",compressible:!0},"application/xcap-ns+xml":{source:"iana",compressible:!0,extensions:["xns"]},"application/xcon-conference-info+xml":{source:"iana",compressible:!0},"application/xcon-conference-info-diff+xml":{source:"iana",compressible:!0},"application/xenc+xml":{source:"iana",compressible:!0,extensions:["xenc"]},"application/xhtml+xml":{source:"iana",compressible:!0,extensions:["xhtml","xht"]},"application/xhtml-voice+xml":{source:"apache",compressible:!0},"application/xliff+xml":{source:"iana",compressible:!0,extensions:["xlf"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml","xsl","xsd","rng"]},"application/xml-dtd":{source:"iana",compressible:!0,extensions:["dtd"]},"application/xml-external-parsed-entity":{source:"iana"},"application/xml-patch+xml":{source:"iana",compressible:!0},"application/xmpp+xml":{source:"iana",compressible:!0},"application/xop+xml":{source:"iana",compressible:!0,extensions:["xop"]},"application/xproc+xml":{source:"apache",compressible:!0,extensions:["xpl"]},"application/xslt+xml":{source:"iana",compressible:!0,extensions:["xsl","xslt"]},"application/xspf+xml":{source:"apache",compressible:!0,extensions:["xspf"]},"application/xv+xml":{source:"iana",compressible:!0,extensions:["mxml","xhvml","xvml","xvm"]},"application/yang":{source:"iana",extensions:["yang"]},"application/yang-data+json":{source:"iana",compressible:!0},"application/yang-data+xml":{source:"iana",compressible:!0},"application/yang-patch+json":{source:"iana",compressible:!0},"application/yang-patch+xml":{source:"iana",compressible:!0},"application/yin+xml":{source:"iana",compressible:!0,extensions:["yin"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/zlib":{source:"iana"},"application/zstd":{source:"iana"},"audio/1d-interleaved-parityfec":{source:"iana"},"audio/32kadpcm":{source:"iana"},"audio/3gpp":{source:"iana",compressible:!1,extensions:["3gpp"]},"audio/3gpp2":{source:"iana"},"audio/aac":{source:"iana"},"audio/ac3":{source:"iana"},"audio/adpcm":{source:"apache",extensions:["adp"]},"audio/amr":{source:"iana",extensions:["amr"]},"audio/amr-wb":{source:"iana"},"audio/amr-wb+":{source:"iana"},"audio/aptx":{source:"iana"},"audio/asc":{source:"iana"},"audio/atrac-advanced-lossless":{source:"iana"},"audio/atrac-x":{source:"iana"},"audio/atrac3":{source:"iana"},"audio/basic":{source:"iana",compressible:!1,extensions:["au","snd"]},"audio/bv16":{source:"iana"},"audio/bv32":{source:"iana"},"audio/clearmode":{source:"iana"},"audio/cn":{source:"iana"},"audio/dat12":{source:"iana"},"audio/dls":{source:"iana"},"audio/dsr-es201108":{source:"iana"},"audio/dsr-es202050":{source:"iana"},"audio/dsr-es202211":{source:"iana"},"audio/dsr-es202212":{source:"iana"},"audio/dv":{source:"iana"},"audio/dvi4":{source:"iana"},"audio/eac3":{source:"iana"},"audio/encaprtp":{source:"iana"},"audio/evrc":{source:"iana"},"audio/evrc-qcp":{source:"iana"},"audio/evrc0":{source:"iana"},"audio/evrc1":{source:"iana"},"audio/evrcb":{source:"iana"},"audio/evrcb0":{source:"iana"},"audio/evrcb1":{source:"iana"},"audio/evrcnw":{source:"iana"},"audio/evrcnw0":{source:"iana"},"audio/evrcnw1":{source:"iana"},"audio/evrcwb":{source:"iana"},"audio/evrcwb0":{source:"iana"},"audio/evrcwb1":{source:"iana"},"audio/evs":{source:"iana"},"audio/flexfec":{source:"iana"},"audio/fwdred":{source:"iana"},"audio/g711-0":{source:"iana"},"audio/g719":{source:"iana"},"audio/g722":{source:"iana"},"audio/g7221":{source:"iana"},"audio/g723":{source:"iana"},"audio/g726-16":{source:"iana"},"audio/g726-24":{source:"iana"},"audio/g726-32":{source:"iana"},"audio/g726-40":{source:"iana"},"audio/g728":{source:"iana"},"audio/g729":{source:"iana"},"audio/g7291":{source:"iana"},"audio/g729d":{source:"iana"},"audio/g729e":{source:"iana"},"audio/gsm":{source:"iana"},"audio/gsm-efr":{source:"iana"},"audio/gsm-hr-08":{source:"iana"},"audio/ilbc":{source:"iana"},"audio/ip-mr_v2.5":{source:"iana"},"audio/isac":{source:"apache"},"audio/l16":{source:"iana"},"audio/l20":{source:"iana"},"audio/l24":{source:"iana",compressible:!1},"audio/l8":{source:"iana"},"audio/lpc":{source:"iana"},"audio/melp":{source:"iana"},"audio/melp1200":{source:"iana"},"audio/melp2400":{source:"iana"},"audio/melp600":{source:"iana"},"audio/mhas":{source:"iana"},"audio/midi":{source:"apache",extensions:["mid","midi","kar","rmi"]},"audio/mobile-xmf":{source:"iana",extensions:["mxmf"]},"audio/mp3":{compressible:!1,extensions:["mp3"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a","mp4a"]},"audio/mp4a-latm":{source:"iana"},"audio/mpa":{source:"iana"},"audio/mpa-robust":{source:"iana"},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{source:"iana"},"audio/musepack":{source:"apache"},"audio/ogg":{source:"iana",compressible:!1,extensions:["oga","ogg","spx","opus"]},"audio/opus":{source:"iana"},"audio/parityfec":{source:"iana"},"audio/pcma":{source:"iana"},"audio/pcma-wb":{source:"iana"},"audio/pcmu":{source:"iana"},"audio/pcmu-wb":{source:"iana"},"audio/prs.sid":{source:"iana"},"audio/qcelp":{source:"iana"},"audio/raptorfec":{source:"iana"},"audio/red":{source:"iana"},"audio/rtp-enc-aescm128":{source:"iana"},"audio/rtp-midi":{source:"iana"},"audio/rtploopback":{source:"iana"},"audio/rtx":{source:"iana"},"audio/s3m":{source:"apache",extensions:["s3m"]},"audio/scip":{source:"iana"},"audio/silk":{source:"apache",extensions:["sil"]},"audio/smv":{source:"iana"},"audio/smv-qcp":{source:"iana"},"audio/smv0":{source:"iana"},"audio/sofa":{source:"iana"},"audio/sp-midi":{source:"iana"},"audio/speex":{source:"iana"},"audio/t140c":{source:"iana"},"audio/t38":{source:"iana"},"audio/telephone-event":{source:"iana"},"audio/tetra_acelp":{source:"iana"},"audio/tetra_acelp_bb":{source:"iana"},"audio/tone":{source:"iana"},"audio/tsvcis":{source:"iana"},"audio/uemclip":{source:"iana"},"audio/ulpfec":{source:"iana"},"audio/usac":{source:"iana"},"audio/vdvi":{source:"iana"},"audio/vmr-wb":{source:"iana"},"audio/vnd.3gpp.iufp":{source:"iana"},"audio/vnd.4sb":{source:"iana"},"audio/vnd.audiokoz":{source:"iana"},"audio/vnd.celp":{source:"iana"},"audio/vnd.cisco.nse":{source:"iana"},"audio/vnd.cmles.radio-events":{source:"iana"},"audio/vnd.cns.anp1":{source:"iana"},"audio/vnd.cns.inf1":{source:"iana"},"audio/vnd.dece.audio":{source:"iana",extensions:["uva","uvva"]},"audio/vnd.digital-winds":{source:"iana",extensions:["eol"]},"audio/vnd.dlna.adts":{source:"iana"},"audio/vnd.dolby.heaac.1":{source:"iana"},"audio/vnd.dolby.heaac.2":{source:"iana"},"audio/vnd.dolby.mlp":{source:"iana"},"audio/vnd.dolby.mps":{source:"iana"},"audio/vnd.dolby.pl2":{source:"iana"},"audio/vnd.dolby.pl2x":{source:"iana"},"audio/vnd.dolby.pl2z":{source:"iana"},"audio/vnd.dolby.pulse.1":{source:"iana"},"audio/vnd.dra":{source:"iana",extensions:["dra"]},"audio/vnd.dts":{source:"iana",extensions:["dts"]},"audio/vnd.dts.hd":{source:"iana",extensions:["dtshd"]},"audio/vnd.dts.uhd":{source:"iana"},"audio/vnd.dvb.file":{source:"iana"},"audio/vnd.everad.plj":{source:"iana"},"audio/vnd.hns.audio":{source:"iana"},"audio/vnd.lucent.voice":{source:"iana",extensions:["lvp"]},"audio/vnd.ms-playready.media.pya":{source:"iana",extensions:["pya"]},"audio/vnd.nokia.mobile-xmf":{source:"iana"},"audio/vnd.nortel.vbk":{source:"iana"},"audio/vnd.nuera.ecelp4800":{source:"iana",extensions:["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{source:"iana",extensions:["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{source:"iana",extensions:["ecelp9600"]},"audio/vnd.octel.sbc":{source:"iana"},"audio/vnd.presonus.multitrack":{source:"iana"},"audio/vnd.qcelp":{source:"iana"},"audio/vnd.rhetorex.32kadpcm":{source:"iana"},"audio/vnd.rip":{source:"iana",extensions:["rip"]},"audio/vnd.rn-realaudio":{compressible:!1},"audio/vnd.sealedmedia.softseal.mpeg":{source:"iana"},"audio/vnd.vmx.cvsd":{source:"iana"},"audio/vnd.wave":{compressible:!1},"audio/vorbis":{source:"iana",compressible:!1},"audio/vorbis-config":{source:"iana"},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/wave":{compressible:!1,extensions:["wav"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/x-aac":{source:"apache",compressible:!1,extensions:["aac"]},"audio/x-aiff":{source:"apache",extensions:["aif","aiff","aifc"]},"audio/x-caf":{source:"apache",compressible:!1,extensions:["caf"]},"audio/x-flac":{source:"apache",extensions:["flac"]},"audio/x-m4a":{source:"nginx",extensions:["m4a"]},"audio/x-matroska":{source:"apache",extensions:["mka"]},"audio/x-mpegurl":{source:"apache",extensions:["m3u"]},"audio/x-ms-wax":{source:"apache",extensions:["wax"]},"audio/x-ms-wma":{source:"apache",extensions:["wma"]},"audio/x-pn-realaudio":{source:"apache",extensions:["ram","ra"]},"audio/x-pn-realaudio-plugin":{source:"apache",extensions:["rmp"]},"audio/x-realaudio":{source:"nginx",extensions:["ra"]},"audio/x-tta":{source:"apache"},"audio/x-wav":{source:"apache",extensions:["wav"]},"audio/xm":{source:"apache",extensions:["xm"]},"chemical/x-cdx":{source:"apache",extensions:["cdx"]},"chemical/x-cif":{source:"apache",extensions:["cif"]},"chemical/x-cmdf":{source:"apache",extensions:["cmdf"]},"chemical/x-cml":{source:"apache",extensions:["cml"]},"chemical/x-csml":{source:"apache",extensions:["csml"]},"chemical/x-pdb":{source:"apache"},"chemical/x-xyz":{source:"apache",extensions:["xyz"]},"font/collection":{source:"iana",extensions:["ttc"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"font/sfnt":{source:"iana"},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/woff":{source:"iana",extensions:["woff"]},"font/woff2":{source:"iana",extensions:["woff2"]},"image/aces":{source:"iana",extensions:["exr"]},"image/apng":{compressible:!1,extensions:["apng"]},"image/avci":{source:"iana",extensions:["avci"]},"image/avcs":{source:"iana",extensions:["avcs"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/cgm":{source:"iana",extensions:["cgm"]},"image/dicom-rle":{source:"iana",extensions:["drle"]},"image/emf":{source:"iana",extensions:["emf"]},"image/fits":{source:"iana",extensions:["fits"]},"image/g3fax":{source:"iana",extensions:["g3"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/heic":{source:"iana",extensions:["heic"]},"image/heic-sequence":{source:"iana",extensions:["heics"]},"image/heif":{source:"iana",extensions:["heif"]},"image/heif-sequence":{source:"iana",extensions:["heifs"]},"image/hej2k":{source:"iana",extensions:["hej2"]},"image/hsj2":{source:"iana",extensions:["hsj2"]},"image/ief":{source:"iana",extensions:["ief"]},"image/jls":{source:"iana",extensions:["jls"]},"image/jp2":{source:"iana",compressible:!1,extensions:["jp2","jpg2"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/jph":{source:"iana",extensions:["jph"]},"image/jphc":{source:"iana",extensions:["jhc"]},"image/jpm":{source:"iana",compressible:!1,extensions:["jpm"]},"image/jpx":{source:"iana",compressible:!1,extensions:["jpx","jpf"]},"image/jxr":{source:"iana",extensions:["jxr"]},"image/jxra":{source:"iana",extensions:["jxra"]},"image/jxrs":{source:"iana",extensions:["jxrs"]},"image/jxs":{source:"iana",extensions:["jxs"]},"image/jxsc":{source:"iana",extensions:["jxsc"]},"image/jxsi":{source:"iana",extensions:["jxsi"]},"image/jxss":{source:"iana",extensions:["jxss"]},"image/ktx":{source:"iana",extensions:["ktx"]},"image/ktx2":{source:"iana",extensions:["ktx2"]},"image/naplps":{source:"iana"},"image/pjpeg":{compressible:!1},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/prs.btif":{source:"iana",extensions:["btif"]},"image/prs.pti":{source:"iana",extensions:["pti"]},"image/pwg-raster":{source:"iana"},"image/sgi":{source:"apache",extensions:["sgi"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/t38":{source:"iana",extensions:["t38"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tif","tiff"]},"image/tiff-fx":{source:"iana",extensions:["tfx"]},"image/vnd.adobe.photoshop":{source:"iana",compressible:!0,extensions:["psd"]},"image/vnd.airzip.accelerator.azv":{source:"iana",extensions:["azv"]},"image/vnd.cns.inf2":{source:"iana"},"image/vnd.dece.graphic":{source:"iana",extensions:["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{source:"iana",extensions:["djvu","djv"]},"image/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"image/vnd.dwg":{source:"iana",extensions:["dwg"]},"image/vnd.dxf":{source:"iana",extensions:["dxf"]},"image/vnd.fastbidsheet":{source:"iana",extensions:["fbs"]},"image/vnd.fpx":{source:"iana",extensions:["fpx"]},"image/vnd.fst":{source:"iana",extensions:["fst"]},"image/vnd.fujixerox.edmics-mmr":{source:"iana",extensions:["mmr"]},"image/vnd.fujixerox.edmics-rlc":{source:"iana",extensions:["rlc"]},"image/vnd.globalgraphics.pgb":{source:"iana"},"image/vnd.microsoft.icon":{source:"iana",compressible:!0,extensions:["ico"]},"image/vnd.mix":{source:"iana"},"image/vnd.mozilla.apng":{source:"iana"},"image/vnd.ms-dds":{compressible:!0,extensions:["dds"]},"image/vnd.ms-modi":{source:"iana",extensions:["mdi"]},"image/vnd.ms-photo":{source:"apache",extensions:["wdp"]},"image/vnd.net-fpx":{source:"iana",extensions:["npx"]},"image/vnd.pco.b16":{source:"iana",extensions:["b16"]},"image/vnd.radiance":{source:"iana"},"image/vnd.sealed.png":{source:"iana"},"image/vnd.sealedmedia.softseal.gif":{source:"iana"},"image/vnd.sealedmedia.softseal.jpg":{source:"iana"},"image/vnd.svf":{source:"iana"},"image/vnd.tencent.tap":{source:"iana",extensions:["tap"]},"image/vnd.valve.source.texture":{source:"iana",extensions:["vtf"]},"image/vnd.wap.wbmp":{source:"iana",extensions:["wbmp"]},"image/vnd.xiff":{source:"iana",extensions:["xif"]},"image/vnd.zbrush.pcx":{source:"iana",extensions:["pcx"]},"image/webp":{source:"apache",extensions:["webp"]},"image/wmf":{source:"iana",extensions:["wmf"]},"image/x-3ds":{source:"apache",extensions:["3ds"]},"image/x-cmu-raster":{source:"apache",extensions:["ras"]},"image/x-cmx":{source:"apache",extensions:["cmx"]},"image/x-freehand":{source:"apache",extensions:["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/x-jng":{source:"nginx",extensions:["jng"]},"image/x-mrsid-image":{source:"apache",extensions:["sid"]},"image/x-ms-bmp":{source:"nginx",compressible:!0,extensions:["bmp"]},"image/x-pcx":{source:"apache",extensions:["pcx"]},"image/x-pict":{source:"apache",extensions:["pic","pct"]},"image/x-portable-anymap":{source:"apache",extensions:["pnm"]},"image/x-portable-bitmap":{source:"apache",extensions:["pbm"]},"image/x-portable-graymap":{source:"apache",extensions:["pgm"]},"image/x-portable-pixmap":{source:"apache",extensions:["ppm"]},"image/x-rgb":{source:"apache",extensions:["rgb"]},"image/x-tga":{source:"apache",extensions:["tga"]},"image/x-xbitmap":{source:"apache",extensions:["xbm"]},"image/x-xcf":{compressible:!1},"image/x-xpixmap":{source:"apache",extensions:["xpm"]},"image/x-xwindowdump":{source:"apache",extensions:["xwd"]},"message/cpim":{source:"iana"},"message/delivery-status":{source:"iana"},"message/disposition-notification":{source:"iana",extensions:["disposition-notification"]},"message/external-body":{source:"iana"},"message/feedback-report":{source:"iana"},"message/global":{source:"iana",extensions:["u8msg"]},"message/global-delivery-status":{source:"iana",extensions:["u8dsn"]},"message/global-disposition-notification":{source:"iana",extensions:["u8mdn"]},"message/global-headers":{source:"iana",extensions:["u8hdr"]},"message/http":{source:"iana",compressible:!1},"message/imdn+xml":{source:"iana",compressible:!0},"message/news":{source:"iana"},"message/partial":{source:"iana",compressible:!1},"message/rfc822":{source:"iana",compressible:!0,extensions:["eml","mime"]},"message/s-http":{source:"iana"},"message/sip":{source:"iana"},"message/sipfrag":{source:"iana"},"message/tracking-status":{source:"iana"},"message/vnd.si.simp":{source:"iana"},"message/vnd.wfa.wsc":{source:"iana",extensions:["wsc"]},"model/3mf":{source:"iana",extensions:["3mf"]},"model/e57":{source:"iana"},"model/gltf+json":{source:"iana",compressible:!0,extensions:["gltf"]},"model/gltf-binary":{source:"iana",compressible:!0,extensions:["glb"]},"model/iges":{source:"iana",compressible:!1,extensions:["igs","iges"]},"model/mesh":{source:"iana",compressible:!1,extensions:["msh","mesh","silo"]},"model/mtl":{source:"iana",extensions:["mtl"]},"model/obj":{source:"iana",extensions:["obj"]},"model/step":{source:"iana"},"model/step+xml":{source:"iana",compressible:!0,extensions:["stpx"]},"model/step+zip":{source:"iana",compressible:!1,extensions:["stpz"]},"model/step-xml+zip":{source:"iana",compressible:!1,extensions:["stpxz"]},"model/stl":{source:"iana",extensions:["stl"]},"model/vnd.collada+xml":{source:"iana",compressible:!0,extensions:["dae"]},"model/vnd.dwf":{source:"iana",extensions:["dwf"]},"model/vnd.flatland.3dml":{source:"iana"},"model/vnd.gdl":{source:"iana",extensions:["gdl"]},"model/vnd.gs-gdl":{source:"apache"},"model/vnd.gs.gdl":{source:"iana"},"model/vnd.gtw":{source:"iana",extensions:["gtw"]},"model/vnd.moml+xml":{source:"iana",compressible:!0},"model/vnd.mts":{source:"iana",extensions:["mts"]},"model/vnd.opengex":{source:"iana",extensions:["ogex"]},"model/vnd.parasolid.transmit.binary":{source:"iana",extensions:["x_b"]},"model/vnd.parasolid.transmit.text":{source:"iana",extensions:["x_t"]},"model/vnd.pytha.pyox":{source:"iana"},"model/vnd.rosette.annotated-data-model":{source:"iana"},"model/vnd.sap.vds":{source:"iana",extensions:["vds"]},"model/vnd.usdz+zip":{source:"iana",compressible:!1,extensions:["usdz"]},"model/vnd.valve.source.compiled-map":{source:"iana",extensions:["bsp"]},"model/vnd.vtu":{source:"iana",extensions:["vtu"]},"model/vrml":{source:"iana",compressible:!1,extensions:["wrl","vrml"]},"model/x3d+binary":{source:"apache",compressible:!1,extensions:["x3db","x3dbz"]},"model/x3d+fastinfoset":{source:"iana",extensions:["x3db"]},"model/x3d+vrml":{source:"apache",compressible:!1,extensions:["x3dv","x3dvz"]},"model/x3d+xml":{source:"iana",compressible:!0,extensions:["x3d","x3dz"]},"model/x3d-vrml":{source:"iana",extensions:["x3dv"]},"multipart/alternative":{source:"iana",compressible:!1},"multipart/appledouble":{source:"iana"},"multipart/byteranges":{source:"iana"},"multipart/digest":{source:"iana"},"multipart/encrypted":{source:"iana",compressible:!1},"multipart/form-data":{source:"iana",compressible:!1},"multipart/header-set":{source:"iana"},"multipart/mixed":{source:"iana"},"multipart/multilingual":{source:"iana"},"multipart/parallel":{source:"iana"},"multipart/related":{source:"iana",compressible:!1},"multipart/report":{source:"iana"},"multipart/signed":{source:"iana",compressible:!1},"multipart/vnd.bint.med-plus":{source:"iana"},"multipart/voice-message":{source:"iana"},"multipart/x-mixed-replace":{source:"iana"},"text/1d-interleaved-parityfec":{source:"iana"},"text/cache-manifest":{source:"iana",compressible:!0,extensions:["appcache","manifest"]},"text/calendar":{source:"iana",extensions:["ics","ifb"]},"text/calender":{compressible:!0},"text/cmd":{compressible:!0},"text/coffeescript":{extensions:["coffee","litcoffee"]},"text/cql":{source:"iana"},"text/cql-expression":{source:"iana"},"text/cql-identifier":{source:"iana"},"text/css":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["css"]},"text/csv":{source:"iana",compressible:!0,extensions:["csv"]},"text/csv-schema":{source:"iana"},"text/directory":{source:"iana"},"text/dns":{source:"iana"},"text/ecmascript":{source:"iana"},"text/encaprtp":{source:"iana"},"text/enriched":{source:"iana"},"text/fhirpath":{source:"iana"},"text/flexfec":{source:"iana"},"text/fwdred":{source:"iana"},"text/gff3":{source:"iana"},"text/grammar-ref-list":{source:"iana"},"text/html":{source:"iana",compressible:!0,extensions:["html","htm","shtml"]},"text/jade":{extensions:["jade"]},"text/javascript":{source:"iana",compressible:!0},"text/jcr-cnd":{source:"iana"},"text/jsx":{compressible:!0,extensions:["jsx"]},"text/less":{compressible:!0,extensions:["less"]},"text/markdown":{source:"iana",compressible:!0,extensions:["markdown","md"]},"text/mathml":{source:"nginx",extensions:["mml"]},"text/mdx":{compressible:!0,extensions:["mdx"]},"text/mizar":{source:"iana"},"text/n3":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["n3"]},"text/parameters":{source:"iana",charset:"UTF-8"},"text/parityfec":{source:"iana"},"text/plain":{source:"iana",compressible:!0,extensions:["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{source:"iana",charset:"UTF-8"},"text/prs.fallenstein.rst":{source:"iana"},"text/prs.lines.tag":{source:"iana",extensions:["dsc"]},"text/prs.prop.logic":{source:"iana"},"text/raptorfec":{source:"iana"},"text/red":{source:"iana"},"text/rfc822-headers":{source:"iana"},"text/richtext":{source:"iana",compressible:!0,extensions:["rtx"]},"text/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"text/rtp-enc-aescm128":{source:"iana"},"text/rtploopback":{source:"iana"},"text/rtx":{source:"iana"},"text/sgml":{source:"iana",extensions:["sgml","sgm"]},"text/shaclc":{source:"iana"},"text/shex":{source:"iana",extensions:["shex"]},"text/slim":{extensions:["slim","slm"]},"text/spdx":{source:"iana",extensions:["spdx"]},"text/strings":{source:"iana"},"text/stylus":{extensions:["stylus","styl"]},"text/t140":{source:"iana"},"text/tab-separated-values":{source:"iana",compressible:!0,extensions:["tsv"]},"text/troff":{source:"iana",extensions:["t","tr","roff","man","me","ms"]},"text/turtle":{source:"iana",charset:"UTF-8",extensions:["ttl"]},"text/ulpfec":{source:"iana"},"text/uri-list":{source:"iana",compressible:!0,extensions:["uri","uris","urls"]},"text/vcard":{source:"iana",compressible:!0,extensions:["vcard"]},"text/vnd.a":{source:"iana"},"text/vnd.abc":{source:"iana"},"text/vnd.ascii-art":{source:"iana"},"text/vnd.curl":{source:"iana",extensions:["curl"]},"text/vnd.curl.dcurl":{source:"apache",extensions:["dcurl"]},"text/vnd.curl.mcurl":{source:"apache",extensions:["mcurl"]},"text/vnd.curl.scurl":{source:"apache",extensions:["scurl"]},"text/vnd.debian.copyright":{source:"iana",charset:"UTF-8"},"text/vnd.dmclientscript":{source:"iana"},"text/vnd.dvb.subtitle":{source:"iana",extensions:["sub"]},"text/vnd.esmertec.theme-descriptor":{source:"iana",charset:"UTF-8"},"text/vnd.familysearch.gedcom":{source:"iana",extensions:["ged"]},"text/vnd.ficlab.flt":{source:"iana"},"text/vnd.fly":{source:"iana",extensions:["fly"]},"text/vnd.fmi.flexstor":{source:"iana",extensions:["flx"]},"text/vnd.gml":{source:"iana"},"text/vnd.graphviz":{source:"iana",extensions:["gv"]},"text/vnd.hans":{source:"iana"},"text/vnd.hgl":{source:"iana"},"text/vnd.in3d.3dml":{source:"iana",extensions:["3dml"]},"text/vnd.in3d.spot":{source:"iana",extensions:["spot"]},"text/vnd.iptc.newsml":{source:"iana"},"text/vnd.iptc.nitf":{source:"iana"},"text/vnd.latex-z":{source:"iana"},"text/vnd.motorola.reflex":{source:"iana"},"text/vnd.ms-mediapackage":{source:"iana"},"text/vnd.net2phone.commcenter.command":{source:"iana"},"text/vnd.radisys.msml-basic-layout":{source:"iana"},"text/vnd.senx.warpscript":{source:"iana"},"text/vnd.si.uricatalogue":{source:"iana"},"text/vnd.sosi":{source:"iana"},"text/vnd.sun.j2me.app-descriptor":{source:"iana",charset:"UTF-8",extensions:["jad"]},"text/vnd.trolltech.linguist":{source:"iana",charset:"UTF-8"},"text/vnd.wap.si":{source:"iana"},"text/vnd.wap.sl":{source:"iana"},"text/vnd.wap.wml":{source:"iana",extensions:["wml"]},"text/vnd.wap.wmlscript":{source:"iana",extensions:["wmls"]},"text/vtt":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["vtt"]},"text/x-asm":{source:"apache",extensions:["s","asm"]},"text/x-c":{source:"apache",extensions:["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{source:"nginx",extensions:["htc"]},"text/x-fortran":{source:"apache",extensions:["f","for","f77","f90"]},"text/x-gwt-rpc":{compressible:!0},"text/x-handlebars-template":{extensions:["hbs"]},"text/x-java-source":{source:"apache",extensions:["java"]},"text/x-jquery-tmpl":{compressible:!0},"text/x-lua":{extensions:["lua"]},"text/x-markdown":{compressible:!0,extensions:["mkd"]},"text/x-nfo":{source:"apache",extensions:["nfo"]},"text/x-opml":{source:"apache",extensions:["opml"]},"text/x-org":{compressible:!0,extensions:["org"]},"text/x-pascal":{source:"apache",extensions:["p","pas"]},"text/x-processing":{compressible:!0,extensions:["pde"]},"text/x-sass":{extensions:["sass"]},"text/x-scss":{extensions:["scss"]},"text/x-setext":{source:"apache",extensions:["etx"]},"text/x-sfv":{source:"apache",extensions:["sfv"]},"text/x-suse-ymp":{compressible:!0,extensions:["ymp"]},"text/x-uuencode":{source:"apache",extensions:["uu"]},"text/x-vcalendar":{source:"apache",extensions:["vcs"]},"text/x-vcard":{source:"apache",extensions:["vcf"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/xml-external-parsed-entity":{source:"iana"},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"video/1d-interleaved-parityfec":{source:"iana"},"video/3gpp":{source:"iana",extensions:["3gp","3gpp"]},"video/3gpp-tt":{source:"iana"},"video/3gpp2":{source:"iana",extensions:["3g2"]},"video/av1":{source:"iana"},"video/bmpeg":{source:"iana"},"video/bt656":{source:"iana"},"video/celb":{source:"iana"},"video/dv":{source:"iana"},"video/encaprtp":{source:"iana"},"video/ffv1":{source:"iana"},"video/flexfec":{source:"iana"},"video/h261":{source:"iana",extensions:["h261"]},"video/h263":{source:"iana",extensions:["h263"]},"video/h263-1998":{source:"iana"},"video/h263-2000":{source:"iana"},"video/h264":{source:"iana",extensions:["h264"]},"video/h264-rcdo":{source:"iana"},"video/h264-svc":{source:"iana"},"video/h265":{source:"iana"},"video/iso.segment":{source:"iana",extensions:["m4s"]},"video/jpeg":{source:"iana",extensions:["jpgv"]},"video/jpeg2000":{source:"iana"},"video/jpm":{source:"apache",extensions:["jpm","jpgm"]},"video/jxsv":{source:"iana"},"video/mj2":{source:"iana",extensions:["mj2","mjp2"]},"video/mp1s":{source:"iana"},"video/mp2p":{source:"iana"},"video/mp2t":{source:"iana",extensions:["ts"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","mp4v","mpg4"]},"video/mp4v-es":{source:"iana"},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{source:"iana"},"video/mpv":{source:"iana"},"video/nv":{source:"iana"},"video/ogg":{source:"iana",compressible:!1,extensions:["ogv"]},"video/parityfec":{source:"iana"},"video/pointer":{source:"iana"},"video/quicktime":{source:"iana",compressible:!1,extensions:["qt","mov"]},"video/raptorfec":{source:"iana"},"video/raw":{source:"iana"},"video/rtp-enc-aescm128":{source:"iana"},"video/rtploopback":{source:"iana"},"video/rtx":{source:"iana"},"video/scip":{source:"iana"},"video/smpte291":{source:"iana"},"video/smpte292m":{source:"iana"},"video/ulpfec":{source:"iana"},"video/vc1":{source:"iana"},"video/vc2":{source:"iana"},"video/vnd.cctv":{source:"iana"},"video/vnd.dece.hd":{source:"iana",extensions:["uvh","uvvh"]},"video/vnd.dece.mobile":{source:"iana",extensions:["uvm","uvvm"]},"video/vnd.dece.mp4":{source:"iana"},"video/vnd.dece.pd":{source:"iana",extensions:["uvp","uvvp"]},"video/vnd.dece.sd":{source:"iana",extensions:["uvs","uvvs"]},"video/vnd.dece.video":{source:"iana",extensions:["uvv","uvvv"]},"video/vnd.directv.mpeg":{source:"iana"},"video/vnd.directv.mpeg-tts":{source:"iana"},"video/vnd.dlna.mpeg-tts":{source:"iana"},"video/vnd.dvb.file":{source:"iana",extensions:["dvb"]},"video/vnd.fvt":{source:"iana",extensions:["fvt"]},"video/vnd.hns.video":{source:"iana"},"video/vnd.iptvforum.1dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.1dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.2dparityfec-1010":{source:"iana"},"video/vnd.iptvforum.2dparityfec-2005":{source:"iana"},"video/vnd.iptvforum.ttsavc":{source:"iana"},"video/vnd.iptvforum.ttsmpeg2":{source:"iana"},"video/vnd.motorola.video":{source:"iana"},"video/vnd.motorola.videop":{source:"iana"},"video/vnd.mpegurl":{source:"iana",extensions:["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{source:"iana",extensions:["pyv"]},"video/vnd.nokia.interleaved-multimedia":{source:"iana"},"video/vnd.nokia.mp4vr":{source:"iana"},"video/vnd.nokia.videovoip":{source:"iana"},"video/vnd.objectvideo":{source:"iana"},"video/vnd.radgamettools.bink":{source:"iana"},"video/vnd.radgamettools.smacker":{source:"iana"},"video/vnd.sealed.mpeg1":{source:"iana"},"video/vnd.sealed.mpeg4":{source:"iana"},"video/vnd.sealed.swf":{source:"iana"},"video/vnd.sealedmedia.softseal.mov":{source:"iana"},"video/vnd.uvvu.mp4":{source:"iana",extensions:["uvu","uvvu"]},"video/vnd.vivo":{source:"iana",extensions:["viv"]},"video/vnd.youtube.yt":{source:"iana"},"video/vp8":{source:"iana"},"video/vp9":{source:"iana"},"video/webm":{source:"apache",compressible:!1,extensions:["webm"]},"video/x-f4v":{source:"apache",extensions:["f4v"]},"video/x-fli":{source:"apache",extensions:["fli"]},"video/x-flv":{source:"apache",compressible:!1,extensions:["flv"]},"video/x-m4v":{source:"apache",extensions:["m4v"]},"video/x-matroska":{source:"apache",compressible:!1,extensions:["mkv","mk3d","mks"]},"video/x-mng":{source:"apache",extensions:["mng"]},"video/x-ms-asf":{source:"apache",extensions:["asf","asx"]},"video/x-ms-vob":{source:"apache",extensions:["vob"]},"video/x-ms-wm":{source:"apache",extensions:["wm"]},"video/x-ms-wmv":{source:"apache",compressible:!1,extensions:["wmv"]},"video/x-ms-wmx":{source:"apache",extensions:["wmx"]},"video/x-ms-wvx":{source:"apache",extensions:["wvx"]},"video/x-msvideo":{source:"apache",extensions:["avi"]},"video/x-sgi-movie":{source:"apache",extensions:["movie"]},"video/x-smv":{source:"apache",extensions:["smv"]},"x-conference/x-cooltalk":{source:"apache",extensions:["ice"]},"x-shader/x-fragment":{compressible:!0},"x-shader/x-vertex":{compressible:!0}}});var Ay=k((g6,Cy)=>{Cy.exports=Ty()});var Oy=k(Ut=>{"use strict";var sc=Ay(),aP=require("path").extname,ky=/^\s*([^;\s]*)(?:;|\s|$)/,cP=/^text\//i;Ut.charset=Ry;Ut.charsets={lookup:Ry};Ut.contentType=lP;Ut.extension=uP;Ut.extensions=Object.create(null);Ut.lookup=pP;Ut.types=Object.create(null);fP(Ut.extensions,Ut.types);function Ry(r){if(!r||typeof r!="string")return!1;var e=ky.exec(r),t=e&&sc[e[1].toLowerCase()];return t&&t.charset?t.charset:e&&cP.test(e[1])?"UTF-8":!1}function lP(r){if(!r||typeof r!="string")return!1;var e=r.indexOf("/")===-1?Ut.lookup(r):r;if(!e)return!1;if(e.indexOf("charset")===-1){var t=Ut.charset(e);t&&(e+="; charset="+t.toLowerCase())}return e}function uP(r){if(!r||typeof r!="string")return!1;var e=ky.exec(r),t=e&&Ut.extensions[e[1].toLowerCase()];return!t||!t.length?!1:t[0]}function pP(r){if(!r||typeof r!="string")return!1;var e=aP("x."+r).toLowerCase().substr(1);return e&&Ut.types[e]||!1}function fP(r,e){var t=["nginx","apache",void 0,"iana"];Object.keys(sc).forEach(function(i){var s=sc[i],o=s.extensions;if(!(!o||!o.length)){r[i]=o;for(var a=0;a<o.length;a++){var c=o[a];if(e[c]){var l=t.indexOf(sc[e[c]].source),u=t.indexOf(s.source);if(e[c]!=="application/octet-stream"&&(l>u||l===u&&e[c].substr(0,12)==="application/"))continue}e[c]=i}}})}});var oc=k((y6,My)=>{"use strict";var dP=Ey(),hP=Oy();My.exports=Yt;function Yt(r){if(!(this instanceof Yt))return new Yt(r);this.headers=r.headers,this.negotiator=new dP(r)}Yt.prototype.type=Yt.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(mP),i=this.negotiator.mediaTypes(n.filter(gP)),s=i[0];return s?e[n.indexOf(s)]:!1};Yt.prototype.encoding=Yt.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};Yt.prototype.charset=Yt.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};Yt.prototype.lang=Yt.prototype.langs=Yt.prototype.language=Yt.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 mP(r){return r.indexOf("/")===-1?hP.lookup(r):r}function gP(r){return typeof r=="string"}});var Zp=k((Py,Iy)=>{var Eo=require("crypto"),Jp=function(){};Jp.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};Jp.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()};Py=Iy.exports=new Jp});var ac=k(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.ERROR_PACKET=In.PACKET_TYPES_REVERSE=In.PACKET_TYPES=void 0;var Ur=Object.create(null);In.PACKET_TYPES=Ur;Ur.open="0";Ur.close="1";Ur.ping="2";Ur.pong="3";Ur.message="4";Ur.upgrade="5";Ur.noop="6";var Ny=Object.create(null);In.PACKET_TYPES_REVERSE=Ny;Object.keys(Ur).forEach(r=>{Ny[Ur[r]]=r});var vP={type:"error",data:"parser error"};In.ERROR_PACKET=vP});var Ly=k(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.encodePacket=void 0;Gi.encodePacketToBinary=_P;var yP=ac(),xP=({type:r,data:e},t,n)=>e instanceof ArrayBuffer||ArrayBuffer.isView(e)?n(t?e:"b"+Dy(e,!0).toString("base64")):n(yP.PACKET_TYPES[r]+(e||""));Gi.encodePacket=xP;var Dy=(r,e)=>Buffer.isBuffer(r)||r instanceof Uint8Array&&!e?r:r instanceof ArrayBuffer?Buffer.from(r):Buffer.from(r.buffer,r.byteOffset,r.byteLength),Qp;function _P(r,e){if(r.data instanceof ArrayBuffer||ArrayBuffer.isView(r.data))return e(Dy(r.data,!1));(0,Gi.encodePacket)(r,!0,t=>{Qp||(Qp=new TextEncoder),e(Qp.encode(t))})}});var jy=k(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});lc.decodePacket=void 0;var cc=ac(),bP=(r,e)=>{if(typeof r!="string")return{type:"message",data:By(r,e)};let t=r.charAt(0);if(t==="b"){let n=Buffer.from(r.substring(1),"base64");return{type:"message",data:By(n,e)}}return cc.PACKET_TYPES_REVERSE[t]?r.length>1?{type:cc.PACKET_TYPES_REVERSE[t],data:r.substring(1)}:{type:cc.PACKET_TYPES_REVERSE[t]}:cc.ERROR_PACKET};lc.decodePacket=bP;var By=(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=k(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.decodePayload=qt.decodePacket=qt.encodePayload=qt.encodePacket=qt.protocol=void 0;qt.createPacketEncoderStream=EP;qt.createPacketDecoderStream=TP;var tf=Ly();Object.defineProperty(qt,"encodePacket",{enumerable:!0,get:function(){return tf.encodePacket}});var rf=jy();Object.defineProperty(qt,"decodePacket",{enumerable:!0,get:function(){return rf.decodePacket}});var Fy=ac(),Uy="",wP=(r,e)=>{let t=r.length,n=new Array(t),i=0;r.forEach((s,o)=>{(0,tf.encodePacket)(s,!1,a=>{n[o]=a,++i===t&&e(n.join(Uy))})})};qt.encodePayload=wP;var SP=(r,e)=>{let t=r.split(Uy),n=[];for(let i=0;i<t.length;i++){let s=(0,rf.decodePacket)(t[i],e);if(n.push(s),s.type==="error")break}return n};qt.decodePayload=SP;function EP(){return new TransformStream({transform(r,e){(0,tf.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 ef;function uc(r){return r.reduce((e,t)=>e+t.length,0)}function pc(r,e){if(r[0].length===e)return r.shift();let t=new Uint8Array(e),n=0;for(let i=0;i<e;i++)t[i]=r[0][n++],n===r[0].length&&(r.shift(),n=0);return r.length&&n<r[0].length&&(r[0]=r[0].slice(n)),t}function TP(r,e){ef||(ef=new TextDecoder);let t=[],n=0,i=-1,s=!1;return new TransformStream({transform(o,a){for(t.push(o);;){if(n===0){if(uc(t)<1)break;let c=pc(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(uc(t)<2)break;let c=pc(t,2);i=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),n=3}else if(n===2){if(uc(t)<8)break;let c=pc(t,8),l=new DataView(c.buffer,c.byteOffset,c.length),u=l.getUint32(0);if(u>Math.pow(2,21)-1){a.enqueue(Fy.ERROR_PACKET);break}i=u*Math.pow(2,32)+l.getUint32(4),n=3}else{if(uc(t)<i)break;let c=pc(t,i);a.enqueue((0,rf.decodePacket)(s?c:ef.decode(c),e)),n=0}if(i===0||i>r){a.enqueue(Fy.ERROR_PACKET);break}}}})}qt.protocol=4});var Wy=k((S6,Hy)=>{var Nn=String.fromCharCode;function qy(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 CP(r){for(var e=r.length,t=-1,n,i="";++t<e;)n=r[t],n>65535&&(n-=65536,i+=Nn(n>>>10&1023|55296),n=56320|n&1023),i+=Nn(n);return i}function $y(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 nf(r,e){return Nn(r>>e&63|128)}function AP(r,e){if((r&4294967168)==0)return Nn(r);var t="";return(r&4294965248)==0?t=Nn(r>>6&31|192):(r&4294901760)==0?($y(r,e)||(r=65533),t=Nn(r>>12&15|224),t+=nf(r,6)):(r&4292870144)==0&&(t=Nn(r>>18&7|240),t+=nf(r,12),t+=nf(r,6)),t+=Nn(r&63|128),t}function kP(r,e){e=e||{};for(var t=e.strict!==!1,n=qy(r),i=n.length,s=-1,o,a="";++s<i;)o=n[s],a+=AP(o,t);return a}function zi(){if(Dn>=dc)throw Error("Invalid byte index");var r=fc[Dn]&255;if(Dn++,(r&192)==128)return r&63;throw Error("Invalid continuation byte")}function RP(r){var e,t,n,i,s;if(Dn>dc)throw Error("Invalid byte index");if(Dn==dc)return!1;if(e=fc[Dn]&255,Dn++,(e&128)==0)return e;if((e&224)==192){if(t=zi(),s=(e&31)<<6|t,s>=128)return s;throw Error("Invalid continuation byte")}if((e&240)==224){if(t=zi(),n=zi(),s=(e&15)<<12|t<<6|n,s>=2048)return $y(s,r)?s:65533;throw Error("Invalid continuation byte")}if((e&248)==240&&(t=zi(),n=zi(),i=zi(),s=(e&7)<<18|t<<12|n<<6|i,s>=65536&&s<=1114111))return s;throw Error("Invalid UTF-8 detected")}var fc,dc,Dn;function OP(r,e){e=e||{};var t=e.strict!==!1;fc=qy(r),dc=fc.length,Dn=0;for(var n=[],i;(i=RP(t))!==!1;)n.push(i);return CP(n)}Hy.exports={version:"2.1.2",encode:kP,decode:OP}});var Zy=k(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.packets=ht.protocol=void 0;ht.encodePacket=sf;ht.encodeBase64Packet=Vy;ht.decodePacket=of;ht.decodeBase64Packet=Ky;ht.encodePayload=NP;ht.decodePayload=LP;ht.encodePayloadAsBinary=Xy;ht.decodePayloadAsBinary=Jy;var zy=Wy();ht.protocol=3;var MP=r=>{for(let e of r)if(e.data instanceof ArrayBuffer||ArrayBuffer.isView(e.data))return!0;return!1};ht.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6};var Vi=Object.keys(ht.packets),Cr={type:"error",data:"parser error"},PP=Buffer.concat([]);function sf(r,e,t,n){if(typeof e=="function"&&(n=e,e=null),typeof t=="function"&&(n=t,t=null),Buffer.isBuffer(r.data))return Gy(r,e,n);if(r.data&&(r.data.buffer||r.data)instanceof ArrayBuffer)return Gy({type:r.type,data:af(r.data)},e,n);var i=ht.packets[r.type];return r.data!==void 0&&(i+=t?zy.encode(String(r.data),{strict:!1}):String(r.data)),n(""+i)}function Gy(r,e,t){if(!e)return Vy(r,t);var n=r.data,i=Buffer.allocUnsafe(1);return i[0]=ht.packets[r.type],t(Buffer.concat([i,n]))}function Vy(r,e){var t=Buffer.isBuffer(r.data)?r.data:af(r.data),n="b"+ht.packets[r.type];return n+=t.toString("base64"),e(n)}function of(r,e,t){if(r===void 0)return Cr;let n;if(typeof r=="string")return n=r.charAt(0),n==="b"?Ky(r.slice(1),e):t&&(r=IP(r),r===!1)||Number(n)!=n||!Vi[n]?Cr:r.length>1?{type:Vi[n],data:r.slice(1)}:{type:Vi[n]};if(e==="arraybuffer"){var i=new Uint8Array(r);return n=i[0],{type:Vi[n],data:i.buffer.slice(1)}}return r instanceof ArrayBuffer&&(r=af(r)),n=r[0],{type:Vi[n],data:r.slice(1)}}function IP(r){try{r=zy.decode(r,{strict:!1})}catch{return!1}return r}function Ky(r,e){var t=Vi[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 NP(r,e,t){if(typeof e=="function"&&(t=e,e=null),e&&MP(r))return Xy(r,t);if(!r.length)return t("0:");function n(i,s){sf(i,e,!1,function(o){s(null,DP(o))})}Yy(r,n,function(i,s){return t(s.join(""))})}function DP(r){return r.length+":"+r}function Yy(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 Jy(r,e,t);if(typeof e=="function"&&(t=e,e=null),r==="")return t(Cr,0,1);for(var n="",i,s,o,a=0,c=r.length;a<c;a++){var l=r.charAt(a);if(l!==":"){n+=l;continue}if(n===""||n!=(i=Number(n))||(s=r.slice(a+1,a+1+i),n!=s.length))return t(Cr,0,1);if(s.length){if(o=of(s,e,!1),Cr.type===o.type&&Cr.data===o.data)return t(Cr,0,1);var u=t(o,a+i,c);if(u===!1)return}a+=i,n=""}if(n!=="")return t(Cr,0,1)}function BP(r){for(var e="",t=0,n=r.length;t<n;t++)e+=String.fromCharCode(r[t]);return e}function jP(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 af(r){var e=r.byteLength||r.length,t=r.byteOffset||0;return Buffer.from(r.buffer||r,t,e)}function Xy(r,e){if(!r.length)return e(PP);Yy(r,FP,function(t,n){return e(Buffer.concat(n))})}function FP(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,jP(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]))}sf(r,!0,!0,t)}function Jy(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(Cr,0,1);o+=""+n[s]}n=n.slice(o.length+1);var c=parseInt(o,10),l=n.slice(1,c+1);a&&(l=BP(l)),i.push(l),n=n.slice(c+1)}var u=i.length;for(s=0;s<u;s++){var f=i[s];t(of(f,e,!0),s,u)}}});var ex=k((T6,Qy)=>{var Ki=1e3,Yi=Ki*60,Xi=Yi*60,ni=Xi*24,UP=ni*7,qP=ni*365.25;Qy.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?WP(r):HP(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*qP;case"weeks":case"week":case"w":return t*UP;case"days":case"day":case"d":return t*ni;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Xi;case"minutes":case"minute":case"mins":case"min":case"m":return t*Yi;case"seconds":case"second":case"secs":case"sec":case"s":return t*Ki;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function HP(r){var e=Math.abs(r);return e>=ni?Math.round(r/ni)+"d":e>=Xi?Math.round(r/Xi)+"h":e>=Yi?Math.round(r/Yi)+"m":e>=Ki?Math.round(r/Ki)+"s":r+"ms"}function WP(r){var e=Math.abs(r);return e>=ni?hc(r,e,ni,"day"):e>=Xi?hc(r,e,Xi,"hour"):e>=Yi?hc(r,e,Yi,"minute"):e>=Ki?hc(r,e,Ki,"second"):r+" ms"}function hc(r,e,t,n){var i=e>=t*1.5;return Math.round(r/t)+" "+n+(i?"s":"")}});var cf=k((C6,tx)=>{function GP(r){t.debug=t,t.default=t,t.coerce=c,t.disable=o,t.enable=i,t.enabled=a,t.humanize=ex(),t.destroy=l,Object.keys(r).forEach(u=>{t[u]=r[u]}),t.names=[],t.skips=[],t.formatters={};function e(u){let f=0;for(let d=0;d<u.length;d++)f=(f<<5)-f+u.charCodeAt(d),f|=0;return t.colors[Math.abs(f)%t.colors.length]}t.selectColor=e;function t(u){let f,d=null,g,y;function b(...C){if(!b.enabled)return;let R=b,M=Number(new Date),P=M-(f||M);R.diff=P,R.prev=f,R.curr=M,f=M,C[0]=t.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let B=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(F,V)=>{if(F==="%%")return"%";B++;let D=t.formatters[V];if(typeof D=="function"){let $=C[B];F=D.call(R,$),C.splice(B,1),B--}return F}),t.formatArgs.call(R,C),(R.log||t.log).apply(R,C)}return b.namespace=u,b.useColors=t.useColors(),b.color=t.selectColor(u),b.extend=n,b.destroy=t.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(g!==t.namespaces&&(g=t.namespaces,y=t.enabled(u)),y),set:C=>{d=C}}),typeof t.init=="function"&&t.init(b),b}function n(u,f){let d=t(this.namespace+(typeof f>"u"?":":f)+u);return d.log=this.log,d}function i(u){t.save(u),t.namespaces=u,t.names=[],t.skips=[];let f=(typeof u=="string"?u:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let d of f)d[0]==="-"?t.skips.push(d.slice(1)):t.names.push(d)}function s(u,f){let d=0,g=0,y=-1,b=0;for(;d<u.length;)if(g<f.length&&(f[g]===u[d]||f[g]==="*"))f[g]==="*"?(y=g,b=d,g++):(d++,g++);else if(y!==-1)g=y+1,b++,d=b;else return!1;for(;g<f.length&&f[g]==="*";)g++;return g===f.length}function o(){let u=[...t.names,...t.skips.map(f=>"-"+f)].join(",");return t.enable(""),u}function a(u){for(let f of t.skips)if(s(u,f))return!1;for(let f of t.names)if(s(u,f))return!0;return!1}function c(u){return u instanceof Error?u.stack||u.message:u}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}tx.exports=GP});var rx=k(($t,mc)=>{$t.formatArgs=VP;$t.save=KP;$t.load=YP;$t.useColors=zP;$t.storage=XP();$t.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`."))}})();$t.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 zP(){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 VP(r){if(r[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+r[0]+(this.useColors?"%c ":" ")+"+"+mc.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)}$t.log=console.debug||console.log||(()=>{});function KP(r){try{r?$t.storage.setItem("debug",r):$t.storage.removeItem("debug")}catch{}}function YP(){let r;try{r=$t.storage.getItem("debug")||$t.storage.getItem("DEBUG")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function XP(){try{return localStorage}catch{}}mc.exports=cf()($t);var{formatters:JP}=mc.exports;JP.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var ix=k((A6,nx)=>{"use strict";nx.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 ax=k((k6,ox)=>{"use strict";var ZP=require("os"),sx=require("tty"),ar=ix(),{env:mt}=process,Ln;ar("no-color")||ar("no-colors")||ar("color=false")||ar("color=never")?Ln=0:(ar("color")||ar("colors")||ar("color=true")||ar("color=always"))&&(Ln=1);"FORCE_COLOR"in mt&&(mt.FORCE_COLOR==="true"?Ln=1:mt.FORCE_COLOR==="false"?Ln=0:Ln=mt.FORCE_COLOR.length===0?1:Math.min(parseInt(mt.FORCE_COLOR,10),3));function lf(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function uf(r,e){if(Ln===0)return 0;if(ar("color=16m")||ar("color=full")||ar("color=truecolor"))return 3;if(ar("color=256"))return 2;if(r&&!e&&Ln===void 0)return 0;let t=Ln||0;if(mt.TERM==="dumb")return t;if(process.platform==="win32"){let n=ZP.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in mt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in mt)||mt.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in mt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(mt.TEAMCITY_VERSION)?1:0;if(mt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in mt){let n=parseInt((mt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(mt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(mt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(mt.TERM)||"COLORTERM"in mt?1:t}function QP(r){let e=uf(r,r&&r.isTTY);return lf(e)}ox.exports={supportsColor:QP,stdout:lf(uf(!0,sx.isatty(1))),stderr:lf(uf(!0,sx.isatty(2)))}});var lx=k((gt,vc)=>{var eI=require("tty"),gc=require("util");gt.init=aI;gt.log=iI;gt.formatArgs=rI;gt.save=sI;gt.load=oI;gt.useColors=tI;gt.destroy=gc.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");gt.colors=[6,2,3,4,5,1];try{let r=ax();r&&(r.stderr||r).level>=2&&(gt.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{}gt.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 tI(){return"colors"in gt.inspectOpts?!!gt.inspectOpts.colors:eI.isatty(process.stderr.fd)}function rI(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 oM=Object.create;var Ya=Object.defineProperty;var aM=Object.getOwnPropertyDescriptor;var cM=Object.getOwnPropertyNames;var lM=Object.getPrototypeOf,uM=Object.prototype.hasOwnProperty;var ke=(r,e)=>()=>(r&&(e=r(r=0)),e);var A=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports),rn=(r,e)=>{for(var t in e)Ya(r,t,{get:e[t],enumerable:!0})},Dv=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of cM(e))!uM.call(r,i)&&i!==t&&Ya(r,i,{get:()=>e[i],enumerable:!(n=aM(e,i))||n.enumerable});return r};var W=(r,e,t)=>(t=r!=null?oM(lM(r)):{},Dv(e||!r||!r.__esModule?Ya(t,"default",{value:r,enumerable:!0}):t,r)),pM=r=>Dv(Ya({},"__esModule",{value:!0}),r);var Hi={};rn(Hi,{createRouter:()=>jp,jsonErr:()=>le,jsonOk:()=>Z,parseJsonBody:()=>jt});function CM(r){return new Promise(e=>{let t="";r.on("data",n=>t+=n),r.on("end",()=>e(t))})}function Z(r,e={ok:!0}){r.setHeader("Content-Type","application/json"),r.writeHead(200),r.end(JSON.stringify(e))}function le(r,e,t){r.setHeader("Content-Type","application/json"),r.writeHead(e),r.end(JSON.stringify({error:t}))}async function jt(r,e){try{let t=await CM(r);return JSON.parse(t||"{}")}catch{return le(e,400,"Invalid JSON"),null}}function jp(r,{fallback:e}={}){let t=new Map,n=[];for(let a of r){let c=a.method==="*"?["GET","POST","PUT","DELETE"]:[a.method];for(let l of c)a.path.endsWith("/*")?n.push({...a,prefix:a.path.slice(0,-2),method:l}):t.set(`${l}:${a.path}`,a)}let i=new Set,s=[];for(let a of r)a.public&&(a.path.endsWith("/*")?s.push(a.path.slice(0,-2)):i.add(a.path));function o(a){return i.has(a)?!0:s.some(c=>a.startsWith(c))}return async(a,c)=>{let l=(0,Vv.parse)(a.url,!0),{pathname:u,search:f}=l,d=!!a.headers["cf-connecting-ip"],g=a.socket.remoteAddress==="127.0.0.1"||a.socket.remoteAddress==="::1";if(!o(u)&&(d||!g)){le(c,403,"Forbidden");return}let y=`${a.method}:${u}`,b=t.get(y);if(b){try{await b.handler(a,c,{pathname:u,query:l.query,search:f})}catch(C){console.error("Error:",a.url,C),le(c,500,C.message)}return}for(let C of n)if(C.method===a.method&&u.startsWith(C.prefix)){try{await C.handler(a,c,{pathname:u,query:l.query,search:f})}catch(R){console.error("Error:",a.url,R),le(c,500,R.message)}return}if(e){try{await e(a,c,{pathname:u,search:f})}catch(C){console.error("Error:",a.url,C),le(c,500,C.message)}return}le(c,404,"Not found")}}var Vv,Ft=ke(()=>{Vv=require("url")});function wo(r,e={}){return fetch(r,{...e,headers:{...RM,...e.headers}})}var ec,nn,Yv,Wi,Up,kM,Nn,ie,Xv,Fp,AM,Qa,Kv,xo,tc,_o,qp,ti,Jv,Zv,Qv,bo,ey,ty,RM,St=ke(()=>{ec=W(require("dns"),1),nn=W(require("path"),1),Yv=W(require("os"),1),Wi="9remote",Up=process.env.NREMOTE_REGISTRY||`https://registry.npmjs.org/${Wi}/latest`,kM=`${Wi}@latest`,Nn=nn.default.join(Yv.default.homedir(),".9remote"),ie={ROOT:Nn,LOGS:nn.default.join(Nn,"logs"),STATE:nn.default.join(Nn,"state"),CONFIG:nn.default.join(Nn,"config"),BIN:nn.default.join(Nn,"bin"),PIDS:nn.default.join(Nn,"pids"),BUFFERS:nn.default.join(Nn,"buffers"),DAEMON:nn.default.join(Nn,"daemon")},Xv=new ec.default.promises.Resolver;Xv.setServers(["1.1.1.1","1.0.0.1","8.8.8.8"]);Fp=ec.default.lookup,AM=/^(\d{1,3}\.){3}\d{1,3}$|^::1$|^[0-9a-f:]+$/i;ec.default.lookup=(r,e,t)=>{if(typeof e=="function"&&(t=e,e={}),r==="localhost"||AM.test(r))return Fp(r,e,t);Xv.resolve4(r).then(n=>{if(!n?.length)return Fp(r,e,t);e.all?t(null,n.map(i=>({address:i,family:4}))):t(null,n[0],4)}).catch(()=>Fp(r,e,t))};Qa=2208,Kv=5173,xo="local-ui",tc=[`http://localhost:${Qa}`,`http://127.0.0.1:${Qa}`,`http://localhost:${Kv}`,`http://127.0.0.1:${Kv}`],_o={fileName:"agent.log",rotatedName:"agent.log.1",maxBytes:2*1024*1024,cleanupAfterDays:7},qp=60,ti={STOPPED:0,PREPARING:1,CONNECTING:2,TUNNELING:3,VERIFYING:4,READY:5},Jv=5e3,Zv=1e3,Qv=6e4,bo={CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN:"1"},ey=["claude","codex","gemini","opencode","grok","cursor","antigravity","kiro","copilot","codebuddy","factory","qoder","rovodev","hermes","amp","pi"],ty={claude:"Claude",codex:"Codex",gemini:"Gemini",opencode:"OpenCode",grok:"Grok",cursor:"Cursor",antigravity:"Antigravity",kiro:"Kiro",copilot:"Copilot",codebuddy:"CodeBuddy",factory:"Factory",qoder:"Qoder",rovodev:"Rovo Dev",hermes:"Hermes",amp:"Amp",pi:"Pi"},RM={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 OM(){jr.default.existsSync(rc)||jr.default.mkdirSync(rc,{recursive:!0})}function MM(){try{if(jr.default.statSync(nc).size<_o.maxBytes)return;try{jr.default.rmSync(ic,{force:!0})}catch{}jr.default.renameSync(nc,ic)}catch{}}function PM(){try{let r=jr.default.statSync(ic);Date.now()-r.mtimeMs>_o.cleanupAfterDays*864e5&&jr.default.rmSync(ic,{force:!0})}catch{}}function Gp(r){try{MM(),jr.default.appendFileSync(nc,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 ny(){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 DM(r){return String(r).replace(IM,"").replace(NM,"").replace(/\s+$/g,"")}function So(r,e,t){let n=DM(t);if(!n)return;let i=e==="info"?r:`${r}:${e}`,s=`${ny()} [${i}] ${n}`;if(Gp(s),Hp)try{Hp(s)}catch{}}function LM(){process.on("uncaughtException",r=>So("crash","error",`uncaughtException: ${r?.stack||r?.message||r}`)),process.on("unhandledRejection",r=>{let e=r instanceof Error?r.stack||r.message:String(r);So("crash","error",`unhandledRejection: ${e}`)}),process.on("exit",r=>Gp(`${ny()} [exit] code=${r} pid=${process.pid}`))}function iy(){ry||(ry=!0,OM(),PM(),Gp(`
|
|
4
|
+
=== SESSION ${new Date().toISOString()} pid=${process.pid} argv=${process.argv.slice(2).join(" ")} ===`),LM())}function sy(r){Hp=r}function oy(r=60){try{return jr.default.readFileSync(nc,"utf8").split(`
|
|
5
|
+
`).filter(Boolean).slice(-r)}catch{return[]}}function Fr(r){return{info:(...e)=>So(r,"info",$p(e)),warn:(...e)=>So(r,"warn",$p(e)),error:(...e)=>So(r,"error",$p(e))}}var jr,Wp,rc,nc,ic,ry,Hp,IM,NM,ri=ke(()=>{jr=W(require("fs"),1),Wp=W(require("path"),1);St();rc=ie.LOGS,nc=Wp.default.join(rc,_o.fileName),ic=Wp.default.join(rc,_o.rotatedName),ry=!1,Hp=null;IM=/\x1b\[[0-9;]*m/g,NM=/https?:\/\/[^\s]+/g});var uy=A((g6,zp)=>{"use strict";zp.exports=ly;zp.exports.preferredCharsets=ly;var BM=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function jM(r){for(var e=r.split(","),t=0,n=0;t<e.length;t++){var i=FM(e[t].trim(),t);i&&(e[n++]=i)}return e.length=n,e}function FM(r,e){var t=BM.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 UM(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=qM(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function qM(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 ly(r,e){var t=jM(r===void 0?"*":r||"");if(!e)return t.filter(cy).sort(ay).map($M);var n=e.map(function(s,o){return UM(s,t,o)});return n.filter(cy).sort(ay).map(function(s){return e[n.indexOf(s)]})}function ay(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function $M(r){return r.charset}function cy(r){return r.q>0}});var my=A((v6,Vp)=>{"use strict";Vp.exports=hy;Vp.exports.preferredEncodings=hy;var HM=/^\s*([^\s;]+)\s*(?:;(.*))?$/;function WM(r){for(var e=r.split(","),t=!1,n=1,i=0,s=0;i<e.length;i++){var o=GM(e[i].trim(),i);o&&(e[s++]=o,t=t||dy("identity",o),n=Math.min(n,o.q||1))}return t||(e[s++]={encoding:"identity",q:n,i}),e.length=s,e}function GM(r,e){var t=HM.exec(r);if(!t)return null;var n=t[1],i=1;if(t[2])for(var s=t[2].split(";"),o=0;o<s.length;o++){var a=s[o].trim().split("=");if(a[0]==="q"){i=parseFloat(a[1]);break}}return{encoding:n,q:i,i:e}}function zM(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=dy(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function dy(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 hy(r,e){var t=WM(r||"");if(!e)return t.filter(fy).sort(py).map(VM);var n=e.map(function(s,o){return zM(s,t,o)});return n.filter(fy).sort(py).map(function(s){return e[n.indexOf(s)]})}function py(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function VM(r){return r.encoding}function fy(r){return r.q>0}});var _y=A((y6,Kp)=>{"use strict";Kp.exports=xy;Kp.exports.preferredLanguages=xy;var KM=/^\s*([^\s\-;]+)(?:-([^\s;]+))?\s*(?:;(.*))?$/;function YM(r){for(var e=r.split(","),t=0,n=0;t<e.length;t++){var i=yy(e[t].trim(),t);i&&(e[n++]=i)}return e.length=n,e}function yy(r,e){var t=KM.exec(r);if(!t)return null;var n=t[1],i=t[2],s=n;i&&(s+="-"+i);var o=1;if(t[3])for(var a=t[3].split(";"),c=0;c<a.length;c++){var l=a[c].split("=");l[0]==="q"&&(o=parseFloat(l[1]))}return{prefix:n,suffix:i,q:o,i:e,full:s}}function XM(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=JM(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function JM(r,e,t){var n=yy(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 xy(r,e){var t=YM(r===void 0?"*":r||"");if(!e)return t.filter(vy).sort(gy).map(ZM);var n=e.map(function(s,o){return XM(s,t,o)});return n.filter(vy).sort(gy).map(function(s){return e[n.indexOf(s)]})}function gy(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function ZM(r){return r.full}function vy(r){return r.q>0}});var Cy=A((x6,Yp)=>{"use strict";Yp.exports=Ey;Yp.exports.preferredMediaTypes=Ey;var QM=/^\s*([^\s\/;]+)\/([^;\s]+)\s*(?:;(.*))?$/;function eP(r){for(var e=sP(r),t=0,n=0;t<e.length;t++){var i=Sy(e[t].trim(),t);i&&(e[n++]=i)}return e.length=n,e}function Sy(r,e){var t=QM.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=oP(t[3]).map(iP),c=0;c<a.length;c++){var l=a[c],u=l[0].toLowerCase(),f=l[1],d=f&&f[0]==='"'&&f[f.length-1]==='"'?f.substr(1,f.length-2):f;if(u==="q"){i=parseFloat(d);break}n[u]=d}return{type:o,subtype:s,params:n,q:i,i:e}}function tP(r,e,t){for(var n={o:-1,q:0,s:0},i=0;i<e.length;i++){var s=rP(r,e[i],t);s&&(n.s-s.s||n.q-s.q||n.o-s.o)<0&&(n=s)}return n}function rP(r,e,t){var n=Sy(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 Ey(r,e){var t=eP(r===void 0?"*/*":r||"");if(!e)return t.filter(wy).sort(by).map(nP);var n=e.map(function(s,o){return tP(s,t,o)});return n.filter(wy).sort(by).map(function(s){return e[n.indexOf(s)]})}function by(r,e){return e.q-r.q||e.s-r.s||r.o-e.o||r.i-e.i||0}function nP(r){return r.type+"/"+r.subtype}function wy(r){return r.q>0}function Ty(r){for(var e=0,t=0;(t=r.indexOf('"',t))!==-1;)e++,t++;return e}function iP(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++)Ty(e[n])%2==0?e[++n]=e[t]:e[n]+=","+e[t];return e.length=n+1,e}function oP(r){for(var e=r.split(";"),t=1,n=0;t<e.length;t++)Ty(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 ky=A((_6,Xp)=>{"use strict";var aP=uy(),cP=my(),lP=_y(),uP=Cy();Xp.exports=pe;Xp.exports.Negotiator=pe;function pe(r){if(!(this instanceof pe))return new pe(r);this.request=r}pe.prototype.charset=function(e){var t=this.charsets(e);return t&&t[0]};pe.prototype.charsets=function(e){return aP(this.request.headers["accept-charset"],e)};pe.prototype.encoding=function(e){var t=this.encodings(e);return t&&t[0]};pe.prototype.encodings=function(e){return cP(this.request.headers["accept-encoding"],e)};pe.prototype.language=function(e){var t=this.languages(e);return t&&t[0]};pe.prototype.languages=function(e){return lP(this.request.headers["accept-language"],e)};pe.prototype.mediaType=function(e){var t=this.mediaTypes(e);return t&&t[0]};pe.prototype.mediaTypes=function(e){return uP(this.request.headers.accept,e)};pe.prototype.preferredCharset=pe.prototype.charset;pe.prototype.preferredCharsets=pe.prototype.charsets;pe.prototype.preferredEncoding=pe.prototype.encoding;pe.prototype.preferredEncodings=pe.prototype.encodings;pe.prototype.preferredLanguage=pe.prototype.language;pe.prototype.preferredLanguages=pe.prototype.languages;pe.prototype.preferredMediaType=pe.prototype.mediaType;pe.prototype.preferredMediaTypes=pe.prototype.mediaTypes});var Ay=A((b6,pP)=>{pP.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 Oy=A((w6,Ry)=>{Ry.exports=Ay()});var Iy=A(Ut=>{"use strict";var sc=Oy(),fP=require("path").extname,My=/^\s*([^;\s]*)(?:;|\s|$)/,dP=/^text\//i;Ut.charset=Py;Ut.charsets={lookup:Py};Ut.contentType=hP;Ut.extension=mP;Ut.extensions=Object.create(null);Ut.lookup=gP;Ut.types=Object.create(null);vP(Ut.extensions,Ut.types);function Py(r){if(!r||typeof r!="string")return!1;var e=My.exec(r),t=e&&sc[e[1].toLowerCase()];return t&&t.charset?t.charset:e&&dP.test(e[1])?"UTF-8":!1}function hP(r){if(!r||typeof r!="string")return!1;var e=r.indexOf("/")===-1?Ut.lookup(r):r;if(!e)return!1;if(e.indexOf("charset")===-1){var t=Ut.charset(e);t&&(e+="; charset="+t.toLowerCase())}return e}function mP(r){if(!r||typeof r!="string")return!1;var e=My.exec(r),t=e&&Ut.extensions[e[1].toLowerCase()];return!t||!t.length?!1:t[0]}function gP(r){if(!r||typeof r!="string")return!1;var e=fP("x."+r).toLowerCase().substr(1);return e&&Ut.types[e]||!1}function vP(r,e){var t=["nginx","apache",void 0,"iana"];Object.keys(sc).forEach(function(i){var s=sc[i],o=s.extensions;if(!(!o||!o.length)){r[i]=o;for(var a=0;a<o.length;a++){var c=o[a];if(e[c]){var l=t.indexOf(sc[e[c]].source),u=t.indexOf(s.source);if(e[c]!=="application/octet-stream"&&(l>u||l===u&&e[c].substr(0,12)==="application/"))continue}e[c]=i}}})}});var oc=A((E6,Ny)=>{"use strict";var yP=ky(),xP=Iy();Ny.exports=Yt;function Yt(r){if(!(this instanceof Yt))return new Yt(r);this.headers=r.headers,this.negotiator=new yP(r)}Yt.prototype.type=Yt.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(_P),i=this.negotiator.mediaTypes(n.filter(bP)),s=i[0];return s?e[n.indexOf(s)]:!1};Yt.prototype.encoding=Yt.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};Yt.prototype.charset=Yt.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};Yt.prototype.lang=Yt.prototype.langs=Yt.prototype.language=Yt.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 _P(r){return r.indexOf("/")===-1?xP.lookup(r):r}function bP(r){return typeof r=="string"}});var Zp=A((Dy,Ly)=>{var Eo=require("crypto"),Jp=function(){};Jp.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};Jp.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()};Dy=Ly.exports=new Jp});var ac=A(Dn=>{"use strict";Object.defineProperty(Dn,"__esModule",{value:!0});Dn.ERROR_PACKET=Dn.PACKET_TYPES_REVERSE=Dn.PACKET_TYPES=void 0;var Ur=Object.create(null);Dn.PACKET_TYPES=Ur;Ur.open="0";Ur.close="1";Ur.ping="2";Ur.pong="3";Ur.message="4";Ur.upgrade="5";Ur.noop="6";var By=Object.create(null);Dn.PACKET_TYPES_REVERSE=By;Object.keys(Ur).forEach(r=>{By[Ur[r]]=r});var wP={type:"error",data:"parser error"};Dn.ERROR_PACKET=wP});var Fy=A(Gi=>{"use strict";Object.defineProperty(Gi,"__esModule",{value:!0});Gi.encodePacket=void 0;Gi.encodePacketToBinary=TP;var SP=ac(),EP=({type:r,data:e},t,n)=>e instanceof ArrayBuffer||ArrayBuffer.isView(e)?n(t?e:"b"+jy(e,!0).toString("base64")):n(SP.PACKET_TYPES[r]+(e||""));Gi.encodePacket=EP;var jy=(r,e)=>Buffer.isBuffer(r)||r instanceof Uint8Array&&!e?r:r instanceof ArrayBuffer?Buffer.from(r):Buffer.from(r.buffer,r.byteOffset,r.byteLength),Qp;function TP(r,e){if(r.data instanceof ArrayBuffer||ArrayBuffer.isView(r.data))return e(jy(r.data,!1));(0,Gi.encodePacket)(r,!0,t=>{Qp||(Qp=new TextEncoder),e(Qp.encode(t))})}});var qy=A(lc=>{"use strict";Object.defineProperty(lc,"__esModule",{value:!0});lc.decodePacket=void 0;var cc=ac(),CP=(r,e)=>{if(typeof r!="string")return{type:"message",data:Uy(r,e)};let t=r.charAt(0);if(t==="b"){let n=Buffer.from(r.substring(1),"base64");return{type:"message",data:Uy(n,e)}}return cc.PACKET_TYPES_REVERSE[t]?r.length>1?{type:cc.PACKET_TYPES_REVERSE[t],data:r.substring(1)}:{type:cc.PACKET_TYPES_REVERSE[t]}:cc.ERROR_PACKET};lc.decodePacket=CP;var Uy=(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=A(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.decodePayload=qt.decodePacket=qt.encodePayload=qt.encodePacket=qt.protocol=void 0;qt.createPacketEncoderStream=RP;qt.createPacketDecoderStream=OP;var tf=Fy();Object.defineProperty(qt,"encodePacket",{enumerable:!0,get:function(){return tf.encodePacket}});var rf=qy();Object.defineProperty(qt,"decodePacket",{enumerable:!0,get:function(){return rf.decodePacket}});var $y=ac(),Hy="",kP=(r,e)=>{let t=r.length,n=new Array(t),i=0;r.forEach((s,o)=>{(0,tf.encodePacket)(s,!1,a=>{n[o]=a,++i===t&&e(n.join(Hy))})})};qt.encodePayload=kP;var AP=(r,e)=>{let t=r.split(Hy),n=[];for(let i=0;i<t.length;i++){let s=(0,rf.decodePacket)(t[i],e);if(n.push(s),s.type==="error")break}return n};qt.decodePayload=AP;function RP(){return new TransformStream({transform(r,e){(0,tf.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 ef;function uc(r){return r.reduce((e,t)=>e+t.length,0)}function pc(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 OP(r,e){ef||(ef=new TextDecoder);let t=[],n=0,i=-1,s=!1;return new TransformStream({transform(o,a){for(t.push(o);;){if(n===0){if(uc(t)<1)break;let c=pc(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(uc(t)<2)break;let c=pc(t,2);i=new DataView(c.buffer,c.byteOffset,c.length).getUint16(0),n=3}else if(n===2){if(uc(t)<8)break;let c=pc(t,8),l=new DataView(c.buffer,c.byteOffset,c.length),u=l.getUint32(0);if(u>Math.pow(2,21)-1){a.enqueue($y.ERROR_PACKET);break}i=u*Math.pow(2,32)+l.getUint32(4),n=3}else{if(uc(t)<i)break;let c=pc(t,i);a.enqueue((0,rf.decodePacket)(s?c:ef.decode(c),e)),n=0}if(i===0||i>r){a.enqueue($y.ERROR_PACKET);break}}}})}qt.protocol=4});var Vy=A((R6,zy)=>{var Ln=String.fromCharCode;function Wy(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 MP(r){for(var e=r.length,t=-1,n,i="";++t<e;)n=r[t],n>65535&&(n-=65536,i+=Ln(n>>>10&1023|55296),n=56320|n&1023),i+=Ln(n);return i}function Gy(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 nf(r,e){return Ln(r>>e&63|128)}function PP(r,e){if((r&4294967168)==0)return Ln(r);var t="";return(r&4294965248)==0?t=Ln(r>>6&31|192):(r&4294901760)==0?(Gy(r,e)||(r=65533),t=Ln(r>>12&15|224),t+=nf(r,6)):(r&4292870144)==0&&(t=Ln(r>>18&7|240),t+=nf(r,12),t+=nf(r,6)),t+=Ln(r&63|128),t}function IP(r,e){e=e||{};for(var t=e.strict!==!1,n=Wy(r),i=n.length,s=-1,o,a="";++s<i;)o=n[s],a+=PP(o,t);return a}function zi(){if(Bn>=dc)throw Error("Invalid byte index");var r=fc[Bn]&255;if(Bn++,(r&192)==128)return r&63;throw Error("Invalid continuation byte")}function NP(r){var e,t,n,i,s;if(Bn>dc)throw Error("Invalid byte index");if(Bn==dc)return!1;if(e=fc[Bn]&255,Bn++,(e&128)==0)return e;if((e&224)==192){if(t=zi(),s=(e&31)<<6|t,s>=128)return s;throw Error("Invalid continuation byte")}if((e&240)==224){if(t=zi(),n=zi(),s=(e&15)<<12|t<<6|n,s>=2048)return Gy(s,r)?s:65533;throw Error("Invalid continuation byte")}if((e&248)==240&&(t=zi(),n=zi(),i=zi(),s=(e&7)<<18|t<<12|n<<6|i,s>=65536&&s<=1114111))return s;throw Error("Invalid UTF-8 detected")}var fc,dc,Bn;function DP(r,e){e=e||{};var t=e.strict!==!1;fc=Wy(r),dc=fc.length,Bn=0;for(var n=[],i;(i=NP(t))!==!1;)n.push(i);return MP(n)}zy.exports={version:"2.1.2",encode:IP,decode:DP}});var tx=A(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.packets=ht.protocol=void 0;ht.encodePacket=sf;ht.encodeBase64Packet=Xy;ht.decodePacket=of;ht.decodeBase64Packet=Jy;ht.encodePayload=FP;ht.decodePayload=qP;ht.encodePayloadAsBinary=Qy;ht.decodePayloadAsBinary=ex;var Yy=Vy();ht.protocol=3;var LP=r=>{for(let e of r)if(e.data instanceof ArrayBuffer||ArrayBuffer.isView(e.data))return!0;return!1};ht.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6};var Vi=Object.keys(ht.packets),Cr={type:"error",data:"parser error"},BP=Buffer.concat([]);function sf(r,e,t,n){if(typeof e=="function"&&(n=e,e=null),typeof t=="function"&&(n=t,t=null),Buffer.isBuffer(r.data))return Ky(r,e,n);if(r.data&&(r.data.buffer||r.data)instanceof ArrayBuffer)return Ky({type:r.type,data:af(r.data)},e,n);var i=ht.packets[r.type];return r.data!==void 0&&(i+=t?Yy.encode(String(r.data),{strict:!1}):String(r.data)),n(""+i)}function Ky(r,e,t){if(!e)return Xy(r,t);var n=r.data,i=Buffer.allocUnsafe(1);return i[0]=ht.packets[r.type],t(Buffer.concat([i,n]))}function Xy(r,e){var t=Buffer.isBuffer(r.data)?r.data:af(r.data),n="b"+ht.packets[r.type];return n+=t.toString("base64"),e(n)}function of(r,e,t){if(r===void 0)return Cr;let n;if(typeof r=="string")return n=r.charAt(0),n==="b"?Jy(r.slice(1),e):t&&(r=jP(r),r===!1)||Number(n)!=n||!Vi[n]?Cr:r.length>1?{type:Vi[n],data:r.slice(1)}:{type:Vi[n]};if(e==="arraybuffer"){var i=new Uint8Array(r);return n=i[0],{type:Vi[n],data:i.buffer.slice(1)}}return r instanceof ArrayBuffer&&(r=af(r)),n=r[0],{type:Vi[n],data:r.slice(1)}}function jP(r){try{r=Yy.decode(r,{strict:!1})}catch{return!1}return r}function Jy(r,e){var t=Vi[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 FP(r,e,t){if(typeof e=="function"&&(t=e,e=null),e&&LP(r))return Qy(r,t);if(!r.length)return t("0:");function n(i,s){sf(i,e,!1,function(o){s(null,UP(o))})}Zy(r,n,function(i,s){return t(s.join(""))})}function UP(r){return r.length+":"+r}function Zy(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 qP(r,e,t){if(typeof r!="string")return ex(r,e,t);if(typeof e=="function"&&(t=e,e=null),r==="")return t(Cr,0,1);for(var n="",i,s,o,a=0,c=r.length;a<c;a++){var l=r.charAt(a);if(l!==":"){n+=l;continue}if(n===""||n!=(i=Number(n))||(s=r.slice(a+1,a+1+i),n!=s.length))return t(Cr,0,1);if(s.length){if(o=of(s,e,!1),Cr.type===o.type&&Cr.data===o.data)return t(Cr,0,1);var u=t(o,a+i,c);if(u===!1)return}a+=i,n=""}if(n!=="")return t(Cr,0,1)}function $P(r){for(var e="",t=0,n=r.length;t<n;t++)e+=String.fromCharCode(r[t]);return e}function HP(r){for(var e=Buffer.allocUnsafe(r.length),t=0,n=r.length;t<n;t++)e.writeUInt8(r.charCodeAt(t),t);return e}function af(r){var e=r.byteLength||r.length,t=r.byteOffset||0;return Buffer.from(r.buffer||r,t,e)}function Qy(r,e){if(!r.length)return e(BP);Zy(r,WP,function(t,n){return e(Buffer.concat(n))})}function WP(r,e){function t(n){var i=""+n.length,s;if(typeof n=="string"){s=Buffer.allocUnsafe(i.length+2),s[0]=0;for(var o=0;o<i.length;o++)s[o+1]=parseInt(i[o],10);return s[s.length-1]=255,e(null,Buffer.concat([s,HP(n)]))}s=Buffer.allocUnsafe(i.length+2),s[0]=1;for(var o=0;o<i.length;o++)s[o+1]=parseInt(i[o],10);s[s.length-1]=255,e(null,Buffer.concat([s,n]))}sf(r,!0,!0,t)}function ex(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(Cr,0,1);o+=""+n[s]}n=n.slice(o.length+1);var c=parseInt(o,10),l=n.slice(1,c+1);a&&(l=$P(l)),i.push(l),n=n.slice(c+1)}var u=i.length;for(s=0;s<u;s++){var f=i[s];t(of(f,e,!0),s,u)}}});var nx=A((M6,rx)=>{var Ki=1e3,Yi=Ki*60,Xi=Yi*60,ni=Xi*24,GP=ni*7,zP=ni*365.25;rx.exports=function(r,e){e=e||{};var t=typeof r;if(t==="string"&&r.length>0)return VP(r);if(t==="number"&&isFinite(r))return e.long?YP(r):KP(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))};function VP(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*zP;case"weeks":case"week":case"w":return t*GP;case"days":case"day":case"d":return t*ni;case"hours":case"hour":case"hrs":case"hr":case"h":return t*Xi;case"minutes":case"minute":case"mins":case"min":case"m":return t*Yi;case"seconds":case"second":case"secs":case"sec":case"s":return t*Ki;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function KP(r){var e=Math.abs(r);return e>=ni?Math.round(r/ni)+"d":e>=Xi?Math.round(r/Xi)+"h":e>=Yi?Math.round(r/Yi)+"m":e>=Ki?Math.round(r/Ki)+"s":r+"ms"}function YP(r){var e=Math.abs(r);return e>=ni?hc(r,e,ni,"day"):e>=Xi?hc(r,e,Xi,"hour"):e>=Yi?hc(r,e,Yi,"minute"):e>=Ki?hc(r,e,Ki,"second"):r+" ms"}function hc(r,e,t,n){var i=e>=t*1.5;return Math.round(r/t)+" "+n+(i?"s":"")}});var cf=A((P6,ix)=>{function XP(r){t.debug=t,t.default=t,t.coerce=c,t.disable=o,t.enable=i,t.enabled=a,t.humanize=nx(),t.destroy=l,Object.keys(r).forEach(u=>{t[u]=r[u]}),t.names=[],t.skips=[],t.formatters={};function e(u){let f=0;for(let d=0;d<u.length;d++)f=(f<<5)-f+u.charCodeAt(d),f|=0;return t.colors[Math.abs(f)%t.colors.length]}t.selectColor=e;function t(u){let f,d=null,g,y;function b(...C){if(!b.enabled)return;let R=b,O=Number(new Date),P=O-(f||O);R.diff=P,R.prev=f,R.curr=O,f=O,C[0]=t.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let B=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(F,V)=>{if(F==="%%")return"%";B++;let D=t.formatters[V];if(typeof D=="function"){let $=C[B];F=D.call(R,$),C.splice(B,1),B--}return F}),t.formatArgs.call(R,C),(R.log||t.log).apply(R,C)}return b.namespace=u,b.useColors=t.useColors(),b.color=t.selectColor(u),b.extend=n,b.destroy=t.destroy,Object.defineProperty(b,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(g!==t.namespaces&&(g=t.namespaces,y=t.enabled(u)),y),set:C=>{d=C}}),typeof t.init=="function"&&t.init(b),b}function n(u,f){let d=t(this.namespace+(typeof f>"u"?":":f)+u);return d.log=this.log,d}function i(u){t.save(u),t.namespaces=u,t.names=[],t.skips=[];let f=(typeof u=="string"?u:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let d of f)d[0]==="-"?t.skips.push(d.slice(1)):t.names.push(d)}function s(u,f){let d=0,g=0,y=-1,b=0;for(;d<u.length;)if(g<f.length&&(f[g]===u[d]||f[g]==="*"))f[g]==="*"?(y=g,b=d,g++):(d++,g++);else if(y!==-1)g=y+1,b++,d=b;else return!1;for(;g<f.length&&f[g]==="*";)g++;return g===f.length}function o(){let u=[...t.names,...t.skips.map(f=>"-"+f)].join(",");return t.enable(""),u}function a(u){for(let f of t.skips)if(s(u,f))return!1;for(let f of t.names)if(s(u,f))return!0;return!1}function c(u){return u instanceof Error?u.stack||u.message:u}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}ix.exports=XP});var sx=A(($t,mc)=>{$t.formatArgs=ZP;$t.save=QP;$t.load=eI;$t.useColors=JP;$t.storage=tI();$t.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`."))}})();$t.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 JP(){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 ":" ")+"+"+mc.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)}$t.log=console.debug||console.log||(()=>{});function QP(r){try{r?$t.storage.setItem("debug",r):$t.storage.removeItem("debug")}catch{}}function eI(){let r;try{r=$t.storage.getItem("debug")||$t.storage.getItem("DEBUG")}catch{}return!r&&typeof process<"u"&&"env"in process&&(r=process.env.DEBUG),r}function tI(){try{return localStorage}catch{}}mc.exports=cf()($t);var{formatters:rI}=mc.exports;rI.j=function(r){try{return JSON.stringify(r)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var ax=A((I6,ox)=>{"use strict";ox.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 ux=A((N6,lx)=>{"use strict";var nI=require("os"),cx=require("tty"),ar=ax(),{env:mt}=process,jn;ar("no-color")||ar("no-colors")||ar("color=false")||ar("color=never")?jn=0:(ar("color")||ar("colors")||ar("color=true")||ar("color=always"))&&(jn=1);"FORCE_COLOR"in mt&&(mt.FORCE_COLOR==="true"?jn=1:mt.FORCE_COLOR==="false"?jn=0:jn=mt.FORCE_COLOR.length===0?1:Math.min(parseInt(mt.FORCE_COLOR,10),3));function lf(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function uf(r,e){if(jn===0)return 0;if(ar("color=16m")||ar("color=full")||ar("color=truecolor"))return 3;if(ar("color=256"))return 2;if(r&&!e&&jn===void 0)return 0;let t=jn||0;if(mt.TERM==="dumb")return t;if(process.platform==="win32"){let n=nI.release().split(".");return Number(n[0])>=10&&Number(n[2])>=10586?Number(n[2])>=14931?3:2:1}if("CI"in mt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(n=>n in mt)||mt.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in mt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(mt.TEAMCITY_VERSION)?1:0;if(mt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in mt){let n=parseInt((mt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(mt.TERM_PROGRAM){case"iTerm.app":return n>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(mt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(mt.TERM)||"COLORTERM"in mt?1:t}function iI(r){let e=uf(r,r&&r.isTTY);return lf(e)}lx.exports={supportsColor:iI,stdout:lf(uf(!0,cx.isatty(1))),stderr:lf(uf(!0,cx.isatty(2)))}});var fx=A((gt,vc)=>{var sI=require("tty"),gc=require("util");gt.init=fI;gt.log=lI;gt.formatArgs=aI;gt.save=uI;gt.load=pI;gt.useColors=oI;gt.destroy=gc.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");gt.colors=[6,2,3,4,5,1];try{let r=ux();r&&(r.stderr||r).level>=2&&(gt.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{}gt.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 oI(){return"colors"in gt.inspectOpts?!!gt.inspectOpts.colors:sI.isatty(process.stderr.fd)}function aI(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+"+vc.exports.humanize(this.diff)+"\x1B[0m")}else r[0]=
|
|
8
|
-
`)}function
|
|
9
|
-
`).map(e=>e.trim()).join(" ")};
|
|
10
|
-
`}),super.onData(e.replace(xI,"\\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)}};bc.JSONP=hf});var hx=k(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.WebSocket=void 0;var bI=ii(),wI=Re(),dx=(0,wI.default)("engine:ws"),mf=class extends bI.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();dx('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){dx("closing"),this.socket.close(),e&&e()}};wc.WebSocket=mf});var vf=k(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});Sc.WebTransport=void 0;var SI=ii(),EI=Re(),TI=To(),Ji=(0,EI.default)("engine:webtransport"),gf=class extends SI.Transport{constructor(e,t,n){super({_query:{EIO:"4"}}),this.session=e;let i=(0,TI.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()}};Sc.WebTransport=gf});var xf=k(yf=>{"use strict";Object.defineProperty(yf,"__esModule",{value:!0});var CI=df(),AI=fx(),kI=hx(),RI=vf();yf.default={polling:mx,websocket:kI.WebSocket,webtransport:RI.WebTransport};function mx(r){return typeof r._query.j=="string"?new AI.JSONP(r):new CI.Polling(r)}mx.upgradesTo=["websocket","webtransport"]});var bf=k(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});Ec.Socket=void 0;var OI=require("events"),MI=Re(),nn=require("timers"),Oe=(0,MI.default)("engine:socket"),_f=class extends OI.EventEmitter{get readyState(){return this._readyState}set readyState(e){Oe("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 Oe("packet received with closed socket");switch(Oe(`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}Oe("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}Oe("got pong"),(0,nn.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){Oe("transport error"),this.onClose("transport error",e)}schedulePing(){this.pingIntervalTimer=(0,nn.setTimeout)(()=>{Oe("writing ping packet - expecting pong within %sms",this.server.opts.pingTimeout),this.sendPacket("ping"),this.resetPingTimeout()},this.server.opts.pingInterval)}resetPingTimeout(){(0,nn.clearTimeout)(this.pingTimeoutTimer),this.pingTimeoutTimer=(0,nn.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){Oe("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){Oe('might upgrade socket transport from "%s" to "%s"',this.transport.name,e.name),this.upgrading=!0;let t=(0,nn.setTimeout)(()=>{Oe("client did not complete upgrade - closing transport"),o(),e.readyState==="open"&&e.close()},this.server.opts.upgradeTimeout),n,i=u=>{u.type==="ping"&&u.data==="probe"?(Oe("got probe ping packet, sending pong"),e.send([{type:"pong",data:"probe"}]),this.emit("upgrading",e),clearInterval(n),n=setInterval(s,100)):u.type==="upgrade"&&this.readyState!=="closed"?(Oe("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&&(Oe("writing a noop packet to polling for fast upgrade"),this.transport.send([{type:"noop"}]))},o=()=>{this.upgrading=!1,clearInterval(n),(0,nn.clearTimeout)(t),e.removeListener("packet",i),e.removeListener("close",c),e.removeListener("error",a),this.removeListener("close",l)},a=u=>{Oe("client did not complete upgrade - %s",u),o(),e.close(),e=null},c=()=>{a("transport closed")},l=()=>{a("socket closed")};e.on("packet",i),e.once("close",c),e.once("error",a),this.once("close",l)}clearTransport(){let e,t=this.cleanupFn.length;for(let n=0;n<t;n++)e=this.cleanupFn.shift(),e();this.transport.on("error",function(){Oe("error triggered by discarded transport")}),this.transport.close(),(0,nn.clearTimeout)(this.pingTimeoutTimer)}onClose(e,t){this.readyState!=="closed"&&(this.readyState="closed",(0,nn.clearTimeout)(this.pingIntervalTimer),(0,nn.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"){Oe('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){Oe("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){Oe("there are %d remaining packets in the buffer, waiting for the 'drain' event",this.writeBuffer.length),this.once("drain",()=>{Oe("all packets have been sent, closing the transport"),this.closeTransport(e)});return}Oe("the buffer is empty, closing the transport right away"),this.closeTransport(e)}}closeTransport(e){Oe("closing the transport (discard? %s)",!!e),e&&this.transport.discard(),this.transport.close(this.onClose.bind(this,"forced close"))}};Ec.Socket=_f});var yx=k(wf=>{"use strict";wf.parse=jI;wf.serialize=FI;var PI=Object.prototype.toString,II=Object.prototype.hasOwnProperty,NI=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,DI=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,LI=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,BI=/^[\u0020-\u003A\u003D-\u007E]*$/;function jI(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||UI,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),l=vx(r,o,c),u=r.slice(c,l);if(!II.call(t,u)){var f=gx(r,o+1,a),d=vx(r,a,f);r.charCodeAt(f)===34&&r.charCodeAt(d-1)===34&&(f++,d--);var g=r.slice(f,d);t[u]=$I(g,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 vx(r,e,t){for(;e>t;){var n=r.charCodeAt(--e);if(n!==32&&n!==9)return e+1}return t}function FI(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(!DI.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(!LI.test(t.domain))throw new TypeError("option domain is invalid");s+="; Domain="+t.domain}if(t.path){if(!BI.test(t.path))throw new TypeError("option path is invalid");s+="; Path="+t.path}if(t.expires){var a=t.expires;if(!qI(a)||isNaN(a.valueOf()))throw new TypeError("option expires is invalid");s+="; Expires="+a.toUTCString()}if(t.httpOnly&&(s+="; HttpOnly"),t.secure&&(s+="; Secure"),t.partitioned&&(s+="; Partitioned"),t.priority){var c=typeof t.priority=="string"?t.priority.toLowerCase():t.priority;switch(c){case"low":s+="; Priority=Low";break;case"medium":s+="; Priority=Medium";break;case"high":s+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(t.sameSite){var l=typeof t.sameSite=="string"?t.sameSite.toLowerCase():t.sameSite;switch(l){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return s}function UI(r){return r.indexOf("%")!==-1?decodeURIComponent(r):r}function qI(r){return PI.call(r)==="[object Date]"}function $I(r,e){try{return e(r)}catch{return r}}});var sn=k((j6,bx)=>{"use strict";var xx=["nodebuffer","arraybuffer","fragments"],_x=typeof Blob<"u";_x&&xx.push("blob");bx.exports={BINARY_TYPES:xx,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:_x,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Bx=k((F6,Lx)=>{var Tx=require("fs"),on=require("path"),Cx=require("os"),Ax=typeof __webpack_require__=="function"?__non_webpack_require__:require,HI=process.config&&process.config.variables||{},WI=!!process.env.PREBUILDS_ONLY,wx=process.versions.modules,Sf=VI()?"electron":zI()?"node-webkit":"node",Ef=process.env.npm_config_arch||Cx.arch(),Tf=process.env.npm_config_platform||Cx.platform(),kx=process.env.LIBC||(KI(Tf)?"musl":"glibc"),Cf=process.env.ARM_VERSION||(Ef==="arm64"?"8":HI.arm_version)||"",Rx=(process.versions.uv||"").split(".")[0];Lx.exports=qr;function qr(r){return Ax(qr.resolve(r))}qr.resolve=qr.path=function(r){r=on.resolve(r||".");try{var e=Ax(on.join(r,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[e+"_PREBUILD"]&&(r=process.env[e+"_PREBUILD"])}catch{}if(!WI){var t=Sx(on.join(r,"build/Release"),Ex);if(t)return t;var n=Sx(on.join(r,"build/Debug"),Ex);if(n)return n}var i=a(r);if(i)return i;var s=a(on.dirname(process.execPath));if(s)return s;var o=["platform="+Tf,"arch="+Ef,"runtime="+Sf,"abi="+wx,"uv="+Rx,Cf?"armv="+Cf:"","libc="+kx,"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+"+vc.exports.humanize(this.diff)+"\x1B[0m")}else r[0]=cI()+e+" "+r[0]}function cI(){return gt.inspectOpts.hideDate?"":new Date().toISOString()+" "}function lI(...r){return process.stderr.write(gc.formatWithOptions(gt.inspectOpts,...r)+`
|
|
8
|
+
`)}function uI(r){r?process.env.DEBUG=r:delete process.env.DEBUG}function pI(){return process.env.DEBUG}function fI(r){r.inspectOpts={};let e=Object.keys(gt.inspectOpts);for(let t=0;t<e.length;t++)r.inspectOpts[e[t]]=gt.inspectOpts[e[t]]}vc.exports=cf()(gt);var{formatters:px}=vc.exports;px.o=function(r){return this.inspectOpts.colors=this.useColors,gc.inspect(r,this.inspectOpts).split(`
|
|
9
|
+
`).map(e=>e.trim()).join(" ")};px.O=function(r){return this.inspectOpts.colors=this.useColors,gc.inspect(r,this.inspectOpts)}});var Oe=A((D6,pf)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?pf.exports=sx():pf.exports=fx()});var ii=A(xc=>{"use strict";Object.defineProperty(xc,"__esModule",{value:!0});xc.Transport=void 0;var dI=require("events"),hI=To(),mI=tx(),gI=Oe(),dx=(0,gI.default)("engine:transport");function vI(){}var yc=class extends dI.EventEmitter{get readyState(){return this._readyState}set readyState(e){dx("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?hI:mI,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||vI))}onError(e,t){if(this.listeners("error").length){let n=new Error(e);n.type="TransportError",n.description=t,this.emit("error",n)}else dx("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")}};xc.Transport=yc;yc.upgradesTo=[]});var df=A(_c=>{"use strict";Object.defineProperty(_c,"__esModule",{value:!0});_c.Polling=void 0;var yI=ii(),hx=require("zlib"),xI=oc(),_I=Oe(),Xt=(0,_I.default)("engine:polling"),bI={gzip:hx.createGzip,deflate:hx.createDeflate},ff=class extends yI.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){Xt("request overlap"),this.onError("overlap from client"),t.writeHead(400),t.end();return}Xt("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&&(Xt("triggering empty send to append close packet"),this.send([{type:"noop"}]))}onDataRequest(e,t){if(this.dataReq){this.onError("data request overlap from client"),t.writeHead(400),t.end();return}let n=e.headers["content-type"]==="application/octet-stream";if(n&&this.protocol===4)return this.onError("invalid content");this.dataReq=e,this.dataRes=t;let i=n?Buffer.concat([]):"",s=()=>{e.removeListener("data",a),e.removeListener("end",c),e.removeListener("close",o),this.dataReq=this.dataRes=i=null},o=()=>{s(),this.onError("data request connection closed prematurely")},a=l=>{let u;n?(i=Buffer.concat([i,l]),u=i.length):(i+=l,u=Buffer.byteLength(i)),u>this.maxHttpBufferSize&&(t.writeHead(413).end(),s())},c=()=>{this.onData(i);let l={"Content-Type":"text/html","Content-Length":"2"};t.writeHead(200,this.headers(e,l)),t.end("ok"),s()};e.on("close",o),n||e.setEncoding("utf8"),e.on("data",a),e.on("end",c)}onData(e){Xt('received "%s"',e);let t=n=>{if(n.type==="close")return Xt("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&&(Xt("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){Xt('writing "%s"',e),this.doWrite(e,t,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(e,t,n){let i=typeof e=="string",o={"Content-Type":i?"text/plain; charset=UTF-8":"application/octet-stream"},a=u=>{o["Content-Length"]=typeof u=="string"?Buffer.byteLength(u):u.length,this.res.writeHead(200,this.headers(this.req,o)),this.res.end(u),n()};if(!this.httpCompression||!t.compress){a(e);return}if((i?Buffer.byteLength(e):e.length)<this.httpCompression.threshold){a(e);return}let l=xI(this.req).encodings(["gzip","deflate"]);if(!l){a(e);return}this.compress(e,l,(u,f)=>{if(u){this.res.writeHead(500),this.res.end(),n(u);return}o["Content-Encoding"]=l,a(f)})}compress(e,t,n){Xt("compressing");let i=[],s=0;bI[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){Xt("closing");let t;this.dataReq&&(Xt("aborting ongoing data request"),this.dataReq.destroy());let n=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(Xt("transport writable - closing right away"),this.send([{type:"close"}]),n()):this.discarded?(Xt("transport discarded - closing right away"),n()):(Xt("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}};_c.Polling=ff});var mx=A(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.JSONP=void 0;var wI=df(),SI=require("querystring"),EI=/\\\\n/g,TI=/(\\)?\\n/g,hf=class extends wI.Polling{constructor(e){super(e),this.head="___eio["+(e._query.j||"").replace(/[^0-9]/g,"")+"](",this.foot=");"}onData(e){e=SI.parse(e).d,typeof e=="string"&&(e=e.replace(TI,function(t,n){return n?t:`
|
|
10
|
+
`}),super.onData(e.replace(EI,"\\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)}};bc.JSONP=hf});var vx=A(wc=>{"use strict";Object.defineProperty(wc,"__esModule",{value:!0});wc.WebSocket=void 0;var CI=ii(),kI=Oe(),gx=(0,kI.default)("engine:ws"),mf=class extends CI.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();gx('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){gx("closing"),this.socket.close(),e&&e()}};wc.WebSocket=mf});var vf=A(Sc=>{"use strict";Object.defineProperty(Sc,"__esModule",{value:!0});Sc.WebTransport=void 0;var AI=ii(),RI=Oe(),OI=To(),Ji=(0,RI.default)("engine:webtransport"),gf=class extends AI.Transport{constructor(e,t,n){super({_query:{EIO:"4"}}),this.session=e;let i=(0,OI.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()}};Sc.WebTransport=gf});var xf=A(yf=>{"use strict";Object.defineProperty(yf,"__esModule",{value:!0});var MI=df(),PI=mx(),II=vx(),NI=vf();yf.default={polling:yx,websocket:II.WebSocket,webtransport:NI.WebTransport};function yx(r){return typeof r._query.j=="string"?new PI.JSONP(r):new MI.Polling(r)}yx.upgradesTo=["websocket","webtransport"]});var bf=A(Ec=>{"use strict";Object.defineProperty(Ec,"__esModule",{value:!0});Ec.Socket=void 0;var DI=require("events"),LI=Oe(),sn=require("timers"),Me=(0,LI.default)("engine:socket"),_f=class extends DI.EventEmitter{get readyState(){return this._readyState}set readyState(e){Me("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 Me("packet received with closed socket");switch(Me(`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}Me("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}Me("got pong"),(0,sn.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){Me("transport error"),this.onClose("transport error",e)}schedulePing(){this.pingIntervalTimer=(0,sn.setTimeout)(()=>{Me("writing ping packet - expecting pong within %sms",this.server.opts.pingTimeout),this.sendPacket("ping"),this.resetPingTimeout()},this.server.opts.pingInterval)}resetPingTimeout(){(0,sn.clearTimeout)(this.pingTimeoutTimer),this.pingTimeoutTimer=(0,sn.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){Me("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){Me('might upgrade socket transport from "%s" to "%s"',this.transport.name,e.name),this.upgrading=!0;let t=(0,sn.setTimeout)(()=>{Me("client did not complete upgrade - closing transport"),o(),e.readyState==="open"&&e.close()},this.server.opts.upgradeTimeout),n,i=u=>{u.type==="ping"&&u.data==="probe"?(Me("got probe ping packet, sending pong"),e.send([{type:"pong",data:"probe"}]),this.emit("upgrading",e),clearInterval(n),n=setInterval(s,100)):u.type==="upgrade"&&this.readyState!=="closed"?(Me("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&&(Me("writing a noop packet to polling for fast upgrade"),this.transport.send([{type:"noop"}]))},o=()=>{this.upgrading=!1,clearInterval(n),(0,sn.clearTimeout)(t),e.removeListener("packet",i),e.removeListener("close",c),e.removeListener("error",a),this.removeListener("close",l)},a=u=>{Me("client did not complete upgrade - %s",u),o(),e.close(),e=null},c=()=>{a("transport closed")},l=()=>{a("socket closed")};e.on("packet",i),e.once("close",c),e.once("error",a),this.once("close",l)}clearTransport(){let e,t=this.cleanupFn.length;for(let n=0;n<t;n++)e=this.cleanupFn.shift(),e();this.transport.on("error",function(){Me("error triggered by discarded transport")}),this.transport.close(),(0,sn.clearTimeout)(this.pingTimeoutTimer)}onClose(e,t){this.readyState!=="closed"&&(this.readyState="closed",(0,sn.clearTimeout)(this.pingIntervalTimer),(0,sn.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"){Me('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){Me("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){Me("there are %d remaining packets in the buffer, waiting for the 'drain' event",this.writeBuffer.length),this.once("drain",()=>{Me("all packets have been sent, closing the transport"),this.closeTransport(e)});return}Me("the buffer is empty, closing the transport right away"),this.closeTransport(e)}}closeTransport(e){Me("closing the transport (discard? %s)",!!e),e&&this.transport.discard(),this.transport.close(this.onClose.bind(this,"forced close"))}};Ec.Socket=_f});var bx=A(wf=>{"use strict";wf.parse=HI;wf.serialize=WI;var BI=Object.prototype.toString,jI=Object.prototype.hasOwnProperty,FI=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,UI=/^("?)[\u0021\u0023-\u002B\u002D-\u003A\u003C-\u005B\u005D-\u007E]*\1$/,qI=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,$I=/^[\u0020-\u003A\u003D-\u007E]*$/;function HI(r,e){if(typeof r!="string")throw new TypeError("argument str must be a string");var t={},n=r.length;if(n<2)return t;var i=e&&e.decode||GI,s=0,o=0,a=0;do{if(o=r.indexOf("=",s),o===-1)break;if(a=r.indexOf(";",s),a===-1)a=n;else if(o>a){s=r.lastIndexOf(";",o-1)+1;continue}var c=xx(r,s,o),l=_x(r,o,c),u=r.slice(c,l);if(!jI.call(t,u)){var f=xx(r,o+1,a),d=_x(r,a,f);r.charCodeAt(f)===34&&r.charCodeAt(d-1)===34&&(f++,d--);var g=r.slice(f,d);t[u]=VI(g,i)}s=a+1}while(s<n);return t}function xx(r,e,t){do{var n=r.charCodeAt(e);if(n!==32&&n!==9)return e}while(++e<t);return t}function _x(r,e,t){for(;e>t;){var n=r.charCodeAt(--e);if(n!==32&&n!==9)return e+1}return t}function WI(r,e,t){var n=t&&t.encode||encodeURIComponent;if(typeof n!="function")throw new TypeError("option encode is invalid");if(!FI.test(r))throw new TypeError("argument name is invalid");var i=n(e);if(!UI.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(!qI.test(t.domain))throw new TypeError("option domain is invalid");s+="; Domain="+t.domain}if(t.path){if(!$I.test(t.path))throw new TypeError("option path is invalid");s+="; Path="+t.path}if(t.expires){var a=t.expires;if(!zI(a)||isNaN(a.valueOf()))throw new TypeError("option expires is invalid");s+="; Expires="+a.toUTCString()}if(t.httpOnly&&(s+="; HttpOnly"),t.secure&&(s+="; Secure"),t.partitioned&&(s+="; Partitioned"),t.priority){var c=typeof t.priority=="string"?t.priority.toLowerCase():t.priority;switch(c){case"low":s+="; Priority=Low";break;case"medium":s+="; Priority=Medium";break;case"high":s+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(t.sameSite){var l=typeof t.sameSite=="string"?t.sameSite.toLowerCase():t.sameSite;switch(l){case!0:s+="; SameSite=Strict";break;case"lax":s+="; SameSite=Lax";break;case"strict":s+="; SameSite=Strict";break;case"none":s+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return s}function GI(r){return r.indexOf("%")!==-1?decodeURIComponent(r):r}function zI(r){return BI.call(r)==="[object Date]"}function VI(r,e){try{return e(r)}catch{return r}}});var on=A((W6,Ex)=>{"use strict";var wx=["nodebuffer","arraybuffer","fragments"],Sx=typeof Blob<"u";Sx&&wx.push("blob");Ex.exports={BINARY_TYPES:wx,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:Sx,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Ux=A((G6,Fx)=>{var Ax=require("fs"),an=require("path"),Rx=require("os"),Ox=typeof __webpack_require__=="function"?__non_webpack_require__:require,KI=process.config&&process.config.variables||{},YI=!!process.env.PREBUILDS_ONLY,Tx=process.versions.modules,Sf=ZI()?"electron":JI()?"node-webkit":"node",Ef=process.env.npm_config_arch||Rx.arch(),Tf=process.env.npm_config_platform||Rx.platform(),Mx=process.env.LIBC||(QI(Tf)?"musl":"glibc"),Cf=process.env.ARM_VERSION||(Ef==="arm64"?"8":KI.arm_version)||"",Px=(process.versions.uv||"").split(".")[0];Fx.exports=qr;function qr(r){return Ox(qr.resolve(r))}qr.resolve=qr.path=function(r){r=an.resolve(r||".");try{var e=Ox(an.join(r,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[e+"_PREBUILD"]&&(r=process.env[e+"_PREBUILD"])}catch{}if(!YI){var t=Cx(an.join(r,"build/Release"),kx);if(t)return t;var n=Cx(an.join(r,"build/Debug"),kx);if(n)return n}var i=a(r);if(i)return i;var s=a(an.dirname(process.execPath));if(s)return s;var o=["platform="+Tf,"arch="+Ef,"runtime="+Sf,"abi="+Tx,"uv="+Px,Cf?"armv="+Cf:"","libc="+Mx,"node="+process.versions.node,process.versions.electron?"electron="+process.versions.electron:"",typeof __webpack_require__=="function"?"webpack=true":""].filter(Boolean).join(" ");throw new Error("No native build was found for "+o+`
|
|
11
11
|
loaded from: `+r+`
|
|
12
|
-
`);function a(c){var l=Af(on.join(c,"prebuilds")).map(Ox),u=l.filter(Mx(Tf,Ef)).sort(Px)[0];if(u){var f=on.join(c,"prebuilds",u.name),d=Af(f).map(Ix),g=d.filter(Nx(Sf,wx)),y=g.sort(Dx(Sf))[0];if(y)return on.join(f,y.file)}}};function Af(r){try{return Tx.readdirSync(r)}catch{return[]}}function Sx(r,e){var t=Af(r).filter(e);return t[0]&&on.join(r,t[0])}function Ex(r){return/\.node$/.test(r)}function Ox(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 Mx(r,e){return function(t){return t==null||t.platform!==r?!1:t.architectures.includes(e)}}function Px(r,e){return r.architectures.length-e.architectures.length}function Ix(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 Nx(r,e){return function(t){return!(t==null||t.runtime&&t.runtime!==r&&!GI(t)||t.abi&&t.abi!==e&&!t.napi||t.uv&&t.uv!==Rx||t.armv&&t.armv!==Cf||t.libc&&t.libc!==kx)}}function GI(r){return r.runtime==="node"&&r.napi}function Dx(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 zI(){return!!(process.versions&&process.versions.nw)}function VI(){return process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE?!0:typeof window<"u"&&window.process&&window.process.type==="renderer"}function KI(r){return r==="linux"&&Tx.existsSync("/etc/alpine-release")}qr.parseTags=Ix;qr.matchTags=Nx;qr.compareTags=Dx;qr.parseTuple=Ox;qr.matchTuple=Mx;qr.compareTuples=Px});var Of=k((U6,Rf)=>{var kf=typeof __webpack_require__=="function"?__non_webpack_require__:require;typeof kf.addon=="function"?Rf.exports=kf.addon.bind(kf):Rf.exports=Bx()});var Fx=k((q6,jx)=>{"use strict";var YI=(r,e,t,n,i)=>{for(var s=0;s<i;s++)t[n+s]=r[s]^e[s&3]},XI=(r,e)=>{let t=r.length;for(var n=0;n<t;n++)r[n]^=e[n&3]};jx.exports={mask:YI,unmask:XI}});var Pf=k(($6,Mf)=>{"use strict";try{Mf.exports=Of()(__dirname)}catch{Mf.exports=Fx()}});var Co=k((H6,Tc)=>{"use strict";var{EMPTY_BUFFER:JI}=sn(),If=Buffer[Symbol.species];function ZI(r,e){if(r.length===0)return JI;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 If(t.buffer,t.byteOffset,n):t}function Ux(r,e,t,n,i){for(let s=0;s<i;s++)t[n+s]=r[s]^e[s&3]}function qx(r,e){for(let t=0;t<r.length;t++)r[t]^=e[t&3]}function QI(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function Nf(r){if(Nf.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new If(r):ArrayBuffer.isView(r)?e=new If(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),Nf.readOnly=!1),e}Tc.exports={concat:ZI,mask:Ux,toArrayBuffer:QI,toBuffer:Nf,unmask:qx};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=Pf();Tc.exports.mask=function(e,t,n,i,s){s<48?Ux(e,t,n,i,s):r.mask(e,t,n,i,s)},Tc.exports.unmask=function(e,t){e.length<32?qx(e,t):r.unmask(e,t)}}catch{}});var Wx=k((W6,Hx)=>{"use strict";var $x=Symbol("kDone"),Df=Symbol("kRun"),Lf=class{constructor(e){this[$x]=()=>{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[$x])}}};Hx.exports=Lf});var ko=k((G6,Kx)=>{"use strict";var Ao=require("zlib"),Gx=Co(),eN=Wx(),{kStatusCode:zx}=sn(),tN=Buffer[Symbol.species],rN=Buffer.from([0,0,255,255]),Ac=Symbol("permessage-deflate"),an=Symbol("total-length"),Zi=Symbol("callback"),Bn=Symbol("buffers"),Qi=Symbol("error"),Cc,Bf=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,!Cc){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Cc=new eN(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){Cc.add(i=>{this._decompress(e,t,(s,o)=>{i(),n(s,o)})})}compress(e,t,n){Cc.add(i=>{this._compress(e,t,(s,o)=>{i(),n(s,o)})})}_decompress(e,t,n){let i=this._isServer?"client":"server";if(!this._inflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?Ao.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=Ao.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[Ac]=this,this._inflate[an]=0,this._inflate[Bn]=[],this._inflate.on("error",iN),this._inflate.on("data",Vx)}this._inflate[Zi]=n,this._inflate.write(e),t&&this._inflate.write(rN),this._inflate.flush(()=>{let s=this._inflate[Qi];if(s){this._inflate.close(),this._inflate=null,n(s);return}let o=Gx.concat(this._inflate[Bn],this._inflate[an]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[an]=0,this._inflate[Bn]=[],t&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),n(null,o)})}_compress(e,t,n){let i=this._isServer?"server":"client";if(!this._deflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?Ao.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=Ao.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[an]=0,this._deflate[Bn]=[],this._deflate.on("data",nN)}this._deflate[Zi]=n,this._deflate.write(e),this._deflate.flush(Ao.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=Gx.concat(this._deflate[Bn],this._deflate[an]);t&&(s=new tN(s.buffer,s.byteOffset,s.length-4)),this._deflate[Zi]=null,this._deflate[an]=0,this._deflate[Bn]=[],t&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,s)})}};Kx.exports=Bf;function nN(r){this[Bn].push(r),this[an]+=r.length}function Vx(r){if(this[an]+=r.length,this[Ac]._maxPayload<1||this[an]<=this[Ac]._maxPayload){this[Bn].push(r);return}this[Qi]=new RangeError("Max payload size exceeded"),this[Qi].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Qi][zx]=1009,this.removeListener("data",Vx),this.reset()}function iN(r){if(this[Ac]._inflate=null,this[Qi]){this[Zi](this[Qi]);return}r[zx]=1007,this[Zi](r)}});var Xx=k((z6,Yx)=>{"use strict";function sN(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}Yx.exports=sN});var Ff=k((V6,jf)=>{"use strict";try{jf.exports=Of()(__dirname)}catch{jf.exports=Xx()}});var es=k((K6,kc)=>{"use strict";var{isUtf8:Jx}=require("buffer"),{hasBlob:oN}=sn(),aN=[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 cN(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function Uf(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 lN(r){return oN&&typeof r=="object"&&typeof r.arrayBuffer=="function"&&typeof r.type=="string"&&typeof r.stream=="function"&&(r[Symbol.toStringTag]==="Blob"||r[Symbol.toStringTag]==="File")}kc.exports={isBlob:lN,isValidStatusCode:cN,isValidUTF8:Uf,tokenChars:aN};if(Jx)kc.exports.isValidUTF8=function(r){return r.length<24?Uf(r):Jx(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=Ff();kc.exports.isValidUTF8=function(e){return e.length<32?Uf(e):r(e)}}catch{}});var Gf=k((Y6,i0)=>{"use strict";var{Writable:uN}=require("stream"),Zx=ko(),{BINARY_TYPES:pN,EMPTY_BUFFER:Qx,kStatusCode:fN,kWebSocket:dN}=sn(),{concat:qf,toArrayBuffer:hN,unmask:mN}=Co(),{isValidStatusCode:gN,isValidUTF8:e0}=es(),Rc=Buffer[Symbol.species],cr=0,t0=1,r0=2,n0=3,$f=4,Hf=5,Oc=6,Wf=class extends uN{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||pN[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[dN]=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 Rc(n.buffer,n.byteOffset+e,n.length-e),new Rc(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 Rc(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 t0:this.getPayloadLength16(e);break;case r0:this.getPayloadLength64(e);break;case n0:this.getMask();break;case $f:this.getData(e);break;case Hf:case Oc: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[Zx.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=t0:this._payloadLength===127?this._state=r0: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=n0:this._state=$f}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=$f}getData(e){let t=Qx;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&&mN(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=Hf,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[Zx.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=qf(n,t):this._binaryType==="arraybuffer"?i=hN(qf(n,t)):this._binaryType==="blob"?i=new Blob(n):i=n,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=cr):(this._state=Oc,setImmediate(()=>{this.emit("message",i,!0),this._state=cr,this.startLoop(e)}))}else{let i=qf(n,t);if(!this._skipUTF8Validation&&!e0(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(s);return}this._state===Hf||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=cr):(this._state=Oc,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,Qx),this.end();else{let n=e.readUInt16BE(0);if(!gN(n)){let s=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(s);return}let i=new Rc(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!e0(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=Oc,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[fN]=i,o}};i0.exports=Wf});var Kf=k((J6,a0)=>{"use strict";var{Duplex:X6}=require("stream"),{randomFillSync:vN}=require("crypto"),s0=ko(),{EMPTY_BUFFER:yN,kWebSocket:xN,NOOP:_N}=sn(),{isBlob:ts,isValidStatusCode:bN}=es(),{mask:o0,toBuffer:si}=Co(),lr=Symbol("kByteLength"),wN=Buffer.alloc(4),Mc=8*1024,oi,rs=Mc,Ar=0,SN=1,EN=2,zf=class r{constructor(e,t,n){this._extensions=t||{},n&&(this._generateMask=n,this._maskBuffer=Buffer.alloc(4)),this._socket=e,this._firstFragment=!0,this._compress=!1,this._bufferedBytes=0,this._queue=[],this._state=Ar,this.onerror=_N,this[xN]=void 0}static frame(e,t){let n,i=!1,s=2,o=!1;t.mask&&(n=t.maskBuffer||wN,t.generateMask?t.generateMask(n):(rs===Mc&&(oi===void 0&&(oi=Buffer.alloc(Mc)),vN(oi,0,Mc),rs=0),n[0]=oi[rs++],n[1]=oi[rs++],n[2]=oi[rs++],n[3]=oi[rs++]),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 l=Buffer.allocUnsafe(i?a+s:s);return l[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(l[0]|=64),l[1]=c,c===126?l.writeUInt16BE(a,2):c===127&&(l[2]=l[3]=0,l.writeUIntBE(a,4,6)),t.mask?(l[1]|=128,l[s-4]=n[0],l[s-3]=n[1],l[s-2]=n[2],l[s-1]=n[3],o?[l,e]:i?(o0(e,n,l,s,a),[l]):(o0(e,n,e,0,a),[l,e])):[l,e]}close(e,t,n,i){let s;if(e===void 0)s=yN;else{if(typeof e!="number"||!bN(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!==Ar?this.enqueue([this.dispatch,s,!1,o,i]):this.sendFrame(r.frame(s,o),i)}ping(e,t,n){let i,s;if(typeof e=="string"?(i=Buffer.byteLength(e),s=!1):ts(e)?(i=e.size,s=!1):(e=si(e),i=e.length,s=si.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[lr]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};ts(e)?this._state!==Ar?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Ar?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}pong(e,t,n){let i,s;if(typeof e=="string"?(i=Buffer.byteLength(e),s=!1):ts(e)?(i=e.size,s=!1):(e=si(e),i=e.length,s=si.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[lr]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};ts(e)?this._state!==Ar?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Ar?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}send(e,t,n){let i=this._extensions[s0.extensionName],s=t.binary?2:1,o=t.compress,a,c;typeof e=="string"?(a=Buffer.byteLength(e),c=!1):ts(e)?(a=e.size,c=!1):(e=si(e),a=e.length,c=si.readOnly),this._firstFragment?(this._firstFragment=!1,o&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=a>=i._threshold),this._compress=o):(o=!1,s=0),t.fin&&(this._firstFragment=!0);let l={[lr]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:c,rsv1:o};ts(e)?this._state!==Ar?this.enqueue([this.getBlobData,e,this._compress,l,n]):this.getBlobData(e,this._compress,l,n):this._state!==Ar?this.enqueue([this.dispatch,e,this._compress,l,n]):this.dispatch(e,this._compress,l,n)}getBlobData(e,t,n,i){this._bufferedBytes+=n[lr],this._state=EN,e.arrayBuffer().then(s=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(Vf,this,a,i);return}this._bufferedBytes-=n[lr];let o=si(s);t?this.dispatch(o,t,n,i):(this._state=Ar,this.sendFrame(r.frame(o,n),i),this.dequeue())}).catch(s=>{process.nextTick(TN,this,s,i)})}dispatch(e,t,n,i){if(!t){this.sendFrame(r.frame(e,n),i);return}let s=this._extensions[s0.extensionName];this._bufferedBytes+=n[lr],this._state=SN,s.compress(e,n.fin,(o,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");Vf(this,c,i);return}this._bufferedBytes-=n[lr],this._state=Ar,n.readOnly=!1,this.sendFrame(r.frame(a,n),i),this.dequeue()})}dequeue(){for(;this._state===Ar&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][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)}};a0.exports=zf;function Vf(r,e,t){typeof t=="function"&&t(e);for(let n=0;n<r._queue.length;n++){let i=r._queue[n],s=i[i.length-1];typeof s=="function"&&s(e)}}function TN(r,e,t){Vf(r,e,t),r.onerror(e)}});var g0=k((Z6,m0)=>{"use strict";var{kForOnEventAttribute:Ro,kListener:Yf}=sn(),c0=Symbol("kCode"),l0=Symbol("kData"),u0=Symbol("kError"),p0=Symbol("kMessage"),f0=Symbol("kReason"),ns=Symbol("kTarget"),d0=Symbol("kType"),h0=Symbol("kWasClean"),cn=class{constructor(e){this[ns]=null,this[d0]=e}get target(){return this[ns]}get type(){return this[d0]}};Object.defineProperty(cn.prototype,"target",{enumerable:!0});Object.defineProperty(cn.prototype,"type",{enumerable:!0});var ai=class extends cn{constructor(e,t={}){super(e),this[c0]=t.code===void 0?0:t.code,this[f0]=t.reason===void 0?"":t.reason,this[h0]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[c0]}get reason(){return this[f0]}get wasClean(){return this[h0]}};Object.defineProperty(ai.prototype,"code",{enumerable:!0});Object.defineProperty(ai.prototype,"reason",{enumerable:!0});Object.defineProperty(ai.prototype,"wasClean",{enumerable:!0});var is=class extends cn{constructor(e,t={}){super(e),this[u0]=t.error===void 0?null:t.error,this[p0]=t.message===void 0?"":t.message}get error(){return this[u0]}get message(){return this[p0]}};Object.defineProperty(is.prototype,"error",{enumerable:!0});Object.defineProperty(is.prototype,"message",{enumerable:!0});var Oo=class extends cn{constructor(e,t={}){super(e),this[l0]=t.data===void 0?null:t.data}get data(){return this[l0]}};Object.defineProperty(Oo.prototype,"data",{enumerable:!0});var CN={addEventListener(r,e,t={}){for(let i of this.listeners(r))if(!t[Ro]&&i[Yf]===e&&!i[Ro])return;let n;if(r==="message")n=function(s,o){let a=new Oo("message",{data:o?s:s.toString()});a[ns]=this,Pc(e,this,a)};else if(r==="close")n=function(s,o){let a=new ai("close",{code:s,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[ns]=this,Pc(e,this,a)};else if(r==="error")n=function(s){let o=new is("error",{error:s,message:s.message});o[ns]=this,Pc(e,this,o)};else if(r==="open")n=function(){let s=new cn("open");s[ns]=this,Pc(e,this,s)};else return;n[Ro]=!!t[Ro],n[Yf]=e,t.once?this.once(r,n):this.on(r,n)},removeEventListener(r,e){for(let t of this.listeners(r))if(t[Yf]===e&&!t[Ro]){this.removeListener(r,t);break}}};m0.exports={CloseEvent:ai,ErrorEvent:is,Event:cn,EventTarget:CN,MessageEvent:Oo};function Pc(r,e,t){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,t):r.call(e,t)}});var Xf=k((Q6,v0)=>{"use strict";var{tokenChars:Mo}=es();function $r(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}function AN(r){let e=Object.create(null),t=Object.create(null),n=!1,i=!1,s=!1,o,a,c=-1,l=-1,u=-1,f=0;for(;f<r.length;f++)if(l=r.charCodeAt(f),o===void 0)if(u===-1&&Mo[l]===1)c===-1&&(c=f);else if(f!==0&&(l===32||l===9))u===-1&&c!==-1&&(u=f);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);u===-1&&(u=f);let g=r.slice(c,u);l===44?($r(e,g,t),t=Object.create(null)):o=g,c=u=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);else if(a===void 0)if(u===-1&&Mo[l]===1)c===-1&&(c=f);else if(l===32||l===9)u===-1&&c!==-1&&(u=f);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);u===-1&&(u=f),$r(t,r.slice(c,u),!0),l===44&&($r(e,o,t),t=Object.create(null),o=void 0),c=u=-1}else if(l===61&&c!==-1&&u===-1)a=r.slice(c,f),c=u=-1;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(i){if(Mo[l]!==1)throw new SyntaxError(`Unexpected character at index ${f}`);c===-1?c=f:n||(n=!0),i=!1}else if(s)if(Mo[l]===1)c===-1&&(c=f);else if(l===34&&c!==-1)s=!1,u=f;else if(l===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(l===34&&r.charCodeAt(f-1)===61)s=!0;else if(u===-1&&Mo[l]===1)c===-1&&(c=f);else if(c!==-1&&(l===32||l===9))u===-1&&(u=f);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);u===-1&&(u=f);let g=r.slice(c,u);n&&(g=g.replace(/\\/g,""),n=!1),$r(t,a,g),l===44&&($r(e,o,t),t=Object.create(null),o=void 0),a=void 0,c=u=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);if(c===-1||s||l===32||l===9)throw new SyntaxError("Unexpected end of input");u===-1&&(u=f);let d=r.slice(c,u);return o===void 0?$r(e,d,t):(a===void 0?$r(t,d,!0):n?$r(t,a,d.replace(/\\/g,"")):$r(t,a,d),$r(e,o,t)),e}function kN(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(", ")}v0.exports={format:kN,parse:AN}});var Lc=k((rW,R0)=>{"use strict";var RN=require("events"),ON=require("https"),MN=require("http"),_0=require("net"),PN=require("tls"),{randomBytes:IN,createHash:NN}=require("crypto"),{Duplex:eW,Readable:tW}=require("stream"),{URL:Jf}=require("url"),jn=ko(),DN=Gf(),LN=Kf(),{isBlob:BN}=es(),{BINARY_TYPES:y0,EMPTY_BUFFER:Ic,GUID:jN,kForOnEventAttribute:Zf,kListener:FN,kStatusCode:UN,kWebSocket:vt,NOOP:b0}=sn(),{EventTarget:{addEventListener:qN,removeEventListener:$N}}=g0(),{format:HN,parse:WN}=Xf(),{toBuffer:GN}=Co(),zN=30*1e3,w0=Symbol("kAborted"),Qf=[8,13],ln=["CONNECTING","OPEN","CLOSING","CLOSED"],VN=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,we=class r extends RN{constructor(e,t,n){super(),this._binaryType=y0[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Ic,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]),S0(this,e,t,n)):(this._autoPong=n.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){y0.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 DN({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),s=new LN(e,this._extensions,n.generateMask);this._receiver=i,this._sender=s,this._socket=e,i[vt]=this,s[vt]=this,e[vt]=this,i.on("conclude",XN),i.on("drain",JN),i.on("error",ZN),i.on("message",QN),i.on("ping",eD),i.on("pong",tD),s.onerror=rD,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",C0),e.on("data",Dc),e.on("end",A0),e.on("error",k0),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[jn.extensionName]&&this._extensions[jn.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){Jt(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===r.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=r.CLOSING,this._sender.close(e,t,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),T0(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||Ic,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||Ic,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[jn.extensionName]||(i.compress=!1),this._sender.send(e||Ic,i,n)}terminate(){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){Jt(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=r.CLOSING,this._socket.destroy())}}};Object.defineProperty(we,"CONNECTING",{enumerable:!0,value:ln.indexOf("CONNECTING")});Object.defineProperty(we.prototype,"CONNECTING",{enumerable:!0,value:ln.indexOf("CONNECTING")});Object.defineProperty(we,"OPEN",{enumerable:!0,value:ln.indexOf("OPEN")});Object.defineProperty(we.prototype,"OPEN",{enumerable:!0,value:ln.indexOf("OPEN")});Object.defineProperty(we,"CLOSING",{enumerable:!0,value:ln.indexOf("CLOSING")});Object.defineProperty(we.prototype,"CLOSING",{enumerable:!0,value:ln.indexOf("CLOSING")});Object.defineProperty(we,"CLOSED",{enumerable:!0,value:ln.indexOf("CLOSED")});Object.defineProperty(we.prototype,"CLOSED",{enumerable:!0,value:ln.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[Zf])return e[FN];return null},set(e){for(let t of this.listeners(r))if(t[Zf]){this.removeListener(r,t);break}typeof e=="function"&&this.addEventListener(r,e,{[Zf]:!0})}})});we.prototype.addEventListener=qN;we.prototype.removeEventListener=$N;R0.exports=we;function S0(r,e,t,n){let i={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:Qf[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,!Qf.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${Qf.join(", ")})`);let s;if(e instanceof Jf)s=e;else try{s=new Jf(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 b=new SyntaxError(c);if(r._redirects===0)throw b;Nc(r,b);return}let l=o?443:80,u=IN(16).toString("base64"),f=o?ON.request:MN.request,d=new Set,g;if(i.createConnection=i.createConnection||(o?YN:KN),i.defaultPort=i.defaultPort||l,i.port=s.port||l,i.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":u,Connection:"Upgrade",Upgrade:"websocket"},i.path=s.pathname+s.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(g=new jn(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=HN({[jn.extensionName]:g.offer()})),t.length){for(let b of t){if(typeof b!="string"||!VN.test(b)||d.has(b))throw new SyntaxError("An invalid or duplicated subprotocol was specified");d.add(b)}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 b=i.path.split(":");i.socketPath=b[0],i.path=b[1]}let y;if(i.followRedirects){if(r._redirects===0){r._originalIpc=a,r._originalSecure=o,r._originalHostOrSocketPath=a?i.socketPath:s.host;let b=n&&n.headers;if(n={...n,headers:{}},b)for(let[C,R]of Object.entries(b))n.headers[C.toLowerCase()]=R}else if(r.listenerCount("redirect")===0){let b=a?r._originalIpc?i.socketPath===r._originalHostOrSocketPath:!1:r._originalIpc?!1:s.host===r._originalHostOrSocketPath;(!b||r._originalSecure&&!o)&&(delete i.headers.authorization,delete i.headers.cookie,b||delete i.headers.host,i.auth=void 0)}i.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),y=r._req=f(i),r._redirects&&r.emit("redirect",r.url,y)}else y=r._req=f(i);i.timeout&&y.on("timeout",()=>{Jt(r,y,"Opening handshake has timed out")}),y.on("error",b=>{y===null||y[w0]||(y=r._req=null,Nc(r,b))}),y.on("response",b=>{let C=b.headers.location,R=b.statusCode;if(C&&i.followRedirects&&R>=300&&R<400){if(++r._redirects>i.maxRedirects){Jt(r,y,"Maximum redirects exceeded");return}y.abort();let M;try{M=new Jf(C,e)}catch{let B=new SyntaxError(`Invalid URL: ${C}`);Nc(r,B);return}S0(r,M,t,n)}else r.emit("unexpected-response",y,b)||Jt(r,y,`Unexpected server response: ${b.statusCode}`)}),y.on("upgrade",(b,C,R)=>{if(r.emit("upgrade",b),r.readyState!==we.CONNECTING)return;y=r._req=null;let M=b.headers.upgrade;if(M===void 0||M.toLowerCase()!=="websocket"){Jt(r,C,"Invalid Upgrade header");return}let P=NN("sha1").update(u+jN).digest("base64");if(b.headers["sec-websocket-accept"]!==P){Jt(r,C,"Invalid Sec-WebSocket-Accept header");return}let B=b.headers["sec-websocket-protocol"],G;if(B!==void 0?d.size?d.has(B)||(G="Server sent an invalid subprotocol"):G="Server sent a subprotocol but none was requested":d.size&&(G="Server sent no subprotocol"),G){Jt(r,C,G);return}B&&(r._protocol=B);let F=b.headers["sec-websocket-extensions"];if(F!==void 0){if(!g){Jt(r,C,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let V;try{V=WN(F)}catch{Jt(r,C,"Invalid Sec-WebSocket-Extensions header");return}let D=Object.keys(V);if(D.length!==1||D[0]!==jn.extensionName){Jt(r,C,"Server indicated an extension that was not requested");return}try{g.accept(V[jn.extensionName])}catch{Jt(r,C,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[jn.extensionName]=g}r.setSocket(C,R,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(y,r):y.end()}function Nc(r,e){r._readyState=we.CLOSING,r._errorEmitted=!0,r.emit("error",e),r.emitClose()}function KN(r){return r.path=r.socketPath,_0.connect(r)}function YN(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=_0.isIP(r.host)?"":r.host),PN.connect(r)}function Jt(r,e,t){r._readyState=we.CLOSING;let n=new Error(t);Error.captureStackTrace(n,Jt),e.setHeader?(e[w0]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(Nc,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=BN(e)?e.size:GN(e).length;r._socket?r._sender._bufferedBytes+=n:r._bufferedAmount+=n}if(t){let n=new Error(`WebSocket is not open: readyState ${r.readyState} (${ln[r.readyState]})`);process.nextTick(t,n)}}function XN(r,e){let t=this[vt];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=r,t._socket[vt]!==void 0&&(t._socket.removeListener("data",Dc),process.nextTick(E0,t._socket),r===1005?t.close():t.close(r,e))}function JN(){let r=this[vt];r.isPaused||r._socket.resume()}function ZN(r){let e=this[vt];e._socket[vt]!==void 0&&(e._socket.removeListener("data",Dc),process.nextTick(E0,e._socket),e.close(r[UN])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r))}function x0(){this[vt].emitClose()}function QN(r,e){this[vt].emit("message",r,e)}function eD(r){let e=this[vt];e._autoPong&&e.pong(r,!this._isServer,b0),e.emit("ping",r)}function tD(r){this[vt].emit("pong",r)}function E0(r){r.resume()}function rD(r){let e=this[vt];e.readyState!==we.CLOSED&&(e.readyState===we.OPEN&&(e._readyState=we.CLOSING,T0(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r)))}function T0(r){r._closeTimer=setTimeout(r._socket.destroy.bind(r._socket),zN)}function C0(){let r=this[vt];this.removeListener("close",C0),this.removeListener("data",Dc),this.removeListener("end",A0),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[vt]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",x0),r._receiver.on("finish",x0))}function Dc(r){this[vt]._receiver.write(r)||this.pause()}function A0(){let r=this[vt];r._readyState=we.CLOSING,r._receiver.end(),this.end()}function k0(){let r=this[vt];this.removeListener("error",k0),this.on("error",b0),r&&(r._readyState=we.CLOSING,this.destroy())}});var I0=k((iW,P0)=>{"use strict";var nW=Lc(),{Duplex:nD}=require("stream");function O0(r){r.emit("close")}function iD(){!this.destroyed&&this._writableState.finished&&this.destroy()}function M0(r){this.removeListener("error",M0),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function sD(r,e){let t=!0,n=new nD({...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(O0,n);return}let o=!1;r.once("error",function(c){o=!0,s(c)}),r.once("close",function(){o||s(i),process.nextTick(O0,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",iD),n.on("error",M0),n}P0.exports=sD});var D0=k((sW,N0)=>{"use strict";var{tokenChars:oD}=es();function aD(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&&oD[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}N0.exports={parse:aD}});var $0=k((aW,q0)=>{"use strict";var cD=require("events"),Bc=require("http"),{Duplex:oW}=require("stream"),{createHash:lD}=require("crypto"),L0=Xf(),ci=ko(),uD=D0(),pD=Lc(),{GUID:fD,kWebSocket:dD}=sn(),hD=/^[+/0-9A-Za-z]{22}==$/,B0=0,j0=1,U0=2,td=class extends cD{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:pD,...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=Bc.createServer((n,i)=>{let s=Bc.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=mD(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=B0}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===U0){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(Po,this);return}if(e&&this.once("close",e),this._state!==j0)if(this._state=j0,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(Po,this):process.nextTick(Po,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{Po(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",F0);let s=e.headers["sec-websocket-key"],o=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){li(this,e,t,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){li(this,e,t,400,"Invalid Upgrade header");return}if(s===void 0||!hD.test(s)){li(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){li(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){Io(t,400);return}let c=e.headers["sec-websocket-protocol"],l=new Set;if(c!==void 0)try{l=uD.parse(c)}catch{li(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let u=e.headers["sec-websocket-extensions"],f={};if(this.options.perMessageDeflate&&u!==void 0){let d=new ci(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let g=L0.parse(u);g[ci.extensionName]&&(d.accept(g[ci.extensionName]),f[ci.extensionName]=d)}catch{li(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let d={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(d,(g,y,b,C)=>{if(!g)return Io(t,y||401,b,C);this.completeUpgrade(f,s,l,e,t,n,i)});return}if(!this.options.verifyClient(d))return Io(t,401)}this.completeUpgrade(f,s,l,e,t,n,i)}completeUpgrade(e,t,n,i,s,o,a){if(!s.readable||!s.writable)return s.destroy();if(s[dD])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>B0)return Io(s,503);let l=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${lD("sha1").update(t+fD).digest("base64")}`],u=new this.options.WebSocket(null,void 0,this.options);if(n.size){let f=this.options.handleProtocols?this.options.handleProtocols(n,i):n.values().next().value;f&&(l.push(`Sec-WebSocket-Protocol: ${f}`),u._protocol=f)}if(e[ci.extensionName]){let f=e[ci.extensionName].params,d=L0.format({[ci.extensionName]:[f]});l.push(`Sec-WebSocket-Extensions: ${d}`),u._extensions=e}this.emit("headers",l,i),s.write(l.concat(`\r
|
|
12
|
+
`);function a(c){var l=kf(an.join(c,"prebuilds")).map(Ix),u=l.filter(Nx(Tf,Ef)).sort(Dx)[0];if(u){var f=an.join(c,"prebuilds",u.name),d=kf(f).map(Lx),g=d.filter(Bx(Sf,Tx)),y=g.sort(jx(Sf))[0];if(y)return an.join(f,y.file)}}};function kf(r){try{return Ax.readdirSync(r)}catch{return[]}}function Cx(r,e){var t=kf(r).filter(e);return t[0]&&an.join(r,t[0])}function kx(r){return/\.node$/.test(r)}function Ix(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 Nx(r,e){return function(t){return t==null||t.platform!==r?!1:t.architectures.includes(e)}}function Dx(r,e){return r.architectures.length-e.architectures.length}function Lx(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 Bx(r,e){return function(t){return!(t==null||t.runtime&&t.runtime!==r&&!XI(t)||t.abi&&t.abi!==e&&!t.napi||t.uv&&t.uv!==Px||t.armv&&t.armv!==Cf||t.libc&&t.libc!==Mx)}}function XI(r){return r.runtime==="node"&&r.napi}function jx(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 JI(){return!!(process.versions&&process.versions.nw)}function ZI(){return process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE?!0:typeof window<"u"&&window.process&&window.process.type==="renderer"}function QI(r){return r==="linux"&&Ax.existsSync("/etc/alpine-release")}qr.parseTags=Lx;qr.matchTags=Bx;qr.compareTags=jx;qr.parseTuple=Ix;qr.matchTuple=Nx;qr.compareTuples=Dx});var Of=A((z6,Rf)=>{var Af=typeof __webpack_require__=="function"?__non_webpack_require__:require;typeof Af.addon=="function"?Rf.exports=Af.addon.bind(Af):Rf.exports=Ux()});var $x=A((V6,qx)=>{"use strict";var eN=(r,e,t,n,i)=>{for(var s=0;s<i;s++)t[n+s]=r[s]^e[s&3]},tN=(r,e)=>{let t=r.length;for(var n=0;n<t;n++)r[n]^=e[n&3]};qx.exports={mask:eN,unmask:tN}});var Pf=A((K6,Mf)=>{"use strict";try{Mf.exports=Of()(__dirname)}catch{Mf.exports=$x()}});var Co=A((Y6,Tc)=>{"use strict";var{EMPTY_BUFFER:rN}=on(),If=Buffer[Symbol.species];function nN(r,e){if(r.length===0)return rN;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 If(t.buffer,t.byteOffset,n):t}function Hx(r,e,t,n,i){for(let s=0;s<i;s++)t[n+s]=r[s]^e[s&3]}function Wx(r,e){for(let t=0;t<r.length;t++)r[t]^=e[t&3]}function iN(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function Nf(r){if(Nf.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new If(r):ArrayBuffer.isView(r)?e=new If(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),Nf.readOnly=!1),e}Tc.exports={concat:nN,mask:Hx,toArrayBuffer:iN,toBuffer:Nf,unmask:Wx};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=Pf();Tc.exports.mask=function(e,t,n,i,s){s<48?Hx(e,t,n,i,s):r.mask(e,t,n,i,s)},Tc.exports.unmask=function(e,t){e.length<32?Wx(e,t):r.unmask(e,t)}}catch{}});var Vx=A((X6,zx)=>{"use strict";var Gx=Symbol("kDone"),Df=Symbol("kRun"),Lf=class{constructor(e){this[Gx]=()=>{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[Gx])}}};zx.exports=Lf});var Ao=A((J6,Jx)=>{"use strict";var ko=require("zlib"),Kx=Co(),sN=Vx(),{kStatusCode:Yx}=on(),oN=Buffer[Symbol.species],aN=Buffer.from([0,0,255,255]),kc=Symbol("permessage-deflate"),cn=Symbol("total-length"),Zi=Symbol("callback"),Fn=Symbol("buffers"),Qi=Symbol("error"),Cc,Bf=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,!Cc){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;Cc=new sN(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){Cc.add(i=>{this._decompress(e,t,(s,o)=>{i(),n(s,o)})})}compress(e,t,n){Cc.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"?ko.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=ko.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[kc]=this,this._inflate[cn]=0,this._inflate[Fn]=[],this._inflate.on("error",lN),this._inflate.on("data",Xx)}this._inflate[Zi]=n,this._inflate.write(e),t&&this._inflate.write(aN),this._inflate.flush(()=>{let s=this._inflate[Qi];if(s){this._inflate.close(),this._inflate=null,n(s);return}let o=Kx.concat(this._inflate[Fn],this._inflate[cn]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[cn]=0,this._inflate[Fn]=[],t&&this.params[`${i}_no_context_takeover`]&&this._inflate.reset()),n(null,o)})}_compress(e,t,n){let i=this._isServer?"server":"client";if(!this._deflate){let s=`${i}_max_window_bits`,o=typeof this.params[s]!="number"?ko.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=ko.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[cn]=0,this._deflate[Fn]=[],this._deflate.on("data",cN)}this._deflate[Zi]=n,this._deflate.write(e),this._deflate.flush(ko.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=Kx.concat(this._deflate[Fn],this._deflate[cn]);t&&(s=new oN(s.buffer,s.byteOffset,s.length-4)),this._deflate[Zi]=null,this._deflate[cn]=0,this._deflate[Fn]=[],t&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,s)})}};Jx.exports=Bf;function cN(r){this[Fn].push(r),this[cn]+=r.length}function Xx(r){if(this[cn]+=r.length,this[kc]._maxPayload<1||this[cn]<=this[kc]._maxPayload){this[Fn].push(r);return}this[Qi]=new RangeError("Max payload size exceeded"),this[Qi].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[Qi][Yx]=1009,this.removeListener("data",Xx),this.reset()}function lN(r){if(this[kc]._inflate=null,this[Qi]){this[Zi](this[Qi]);return}r[Yx]=1007,this[Zi](r)}});var Qx=A((Z6,Zx)=>{"use strict";function uN(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}Zx.exports=uN});var Ff=A((Q6,jf)=>{"use strict";try{jf.exports=Of()(__dirname)}catch{jf.exports=Qx()}});var es=A((eW,Ac)=>{"use strict";var{isUtf8:e0}=require("buffer"),{hasBlob:pN}=on(),fN=[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 dN(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function Uf(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 hN(r){return pN&&typeof r=="object"&&typeof r.arrayBuffer=="function"&&typeof r.type=="string"&&typeof r.stream=="function"&&(r[Symbol.toStringTag]==="Blob"||r[Symbol.toStringTag]==="File")}Ac.exports={isBlob:hN,isValidStatusCode:dN,isValidUTF8:Uf,tokenChars:fN};if(e0)Ac.exports.isValidUTF8=function(r){return r.length<24?Uf(r):e0(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=Ff();Ac.exports.isValidUTF8=function(e){return e.length<32?Uf(e):r(e)}}catch{}});var Gf=A((tW,a0)=>{"use strict";var{Writable:mN}=require("stream"),t0=Ao(),{BINARY_TYPES:gN,EMPTY_BUFFER:r0,kStatusCode:vN,kWebSocket:yN}=on(),{concat:qf,toArrayBuffer:xN,unmask:_N}=Co(),{isValidStatusCode:bN,isValidUTF8:n0}=es(),Rc=Buffer[Symbol.species],cr=0,i0=1,s0=2,o0=3,$f=4,Hf=5,Oc=6,Wf=class extends mN{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||gN[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[yN]=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 Rc(n.buffer,n.byteOffset+e,n.length-e),new Rc(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 Rc(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 i0:this.getPayloadLength16(e);break;case s0:this.getPayloadLength64(e);break;case o0:this.getMask();break;case $f:this.getData(e);break;case Hf:case Oc: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[t0.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=i0:this._payloadLength===127?this._state=s0: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=o0:this._state=$f}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=$f}getData(e){let t=r0;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&&_N(t,this._mask)}if(this._opcode>7){this.controlMessage(t,e);return}if(this._compressed){this._state=Hf,this.decompress(t,e);return}t.length&&(this._messageLength=this._totalPayloadLength,this._fragments.push(t)),this.dataMessage(e)}decompress(e,t){this._extensions[t0.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=qf(n,t):this._binaryType==="arraybuffer"?i=xN(qf(n,t)):this._binaryType==="blob"?i=new Blob(n):i=n,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=cr):(this._state=Oc,setImmediate(()=>{this.emit("message",i,!0),this._state=cr,this.startLoop(e)}))}else{let i=qf(n,t);if(!this._skipUTF8Validation&&!n0(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");e(s);return}this._state===Hf||this._allowSynchronousEvents?(this.emit("message",i,!1),this._state=cr):(this._state=Oc,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,r0),this.end();else{let n=e.readUInt16BE(0);if(!bN(n)){let s=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(s);return}let i=new Rc(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!n0(i)){let s=this.createError(Error,"invalid UTF-8 sequence",!0,1007,"WS_ERR_INVALID_UTF8");t(s);return}this._loop=!1,this.emit("conclude",n,i),this.end()}this._state=cr;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=cr):(this._state=Oc,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[vN]=i,o}};a0.exports=Wf});var Kf=A((nW,u0)=>{"use strict";var{Duplex:rW}=require("stream"),{randomFillSync:wN}=require("crypto"),c0=Ao(),{EMPTY_BUFFER:SN,kWebSocket:EN,NOOP:TN}=on(),{isBlob:ts,isValidStatusCode:CN}=es(),{mask:l0,toBuffer:si}=Co(),lr=Symbol("kByteLength"),kN=Buffer.alloc(4),Mc=8*1024,oi,rs=Mc,kr=0,AN=1,RN=2,zf=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=kr,this.onerror=TN,this[EN]=void 0}static frame(e,t){let n,i=!1,s=2,o=!1;t.mask&&(n=t.maskBuffer||kN,t.generateMask?t.generateMask(n):(rs===Mc&&(oi===void 0&&(oi=Buffer.alloc(Mc)),wN(oi,0,Mc),rs=0),n[0]=oi[rs++],n[1]=oi[rs++],n[2]=oi[rs++],n[3]=oi[rs++]),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 l=Buffer.allocUnsafe(i?a+s:s);return l[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(l[0]|=64),l[1]=c,c===126?l.writeUInt16BE(a,2):c===127&&(l[2]=l[3]=0,l.writeUIntBE(a,4,6)),t.mask?(l[1]|=128,l[s-4]=n[0],l[s-3]=n[1],l[s-2]=n[2],l[s-1]=n[3],o?[l,e]:i?(l0(e,n,l,s,a),[l]):(l0(e,n,e,0,a),[l,e])):[l,e]}close(e,t,n,i){let s;if(e===void 0)s=SN;else{if(typeof e!="number"||!CN(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!==kr?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):ts(e)?(i=e.size,s=!1):(e=si(e),i=e.length,s=si.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[lr]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};ts(e)?this._state!==kr?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==kr?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):ts(e)?(i=e.size,s=!1):(e=si(e),i=e.length,s=si.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[lr]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};ts(e)?this._state!==kr?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==kr?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}send(e,t,n){let i=this._extensions[c0.extensionName],s=t.binary?2:1,o=t.compress,a,c;typeof e=="string"?(a=Buffer.byteLength(e),c=!1):ts(e)?(a=e.size,c=!1):(e=si(e),a=e.length,c=si.readOnly),this._firstFragment?(this._firstFragment=!1,o&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=a>=i._threshold),this._compress=o):(o=!1,s=0),t.fin&&(this._firstFragment=!0);let l={[lr]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:c,rsv1:o};ts(e)?this._state!==kr?this.enqueue([this.getBlobData,e,this._compress,l,n]):this.getBlobData(e,this._compress,l,n):this._state!==kr?this.enqueue([this.dispatch,e,this._compress,l,n]):this.dispatch(e,this._compress,l,n)}getBlobData(e,t,n,i){this._bufferedBytes+=n[lr],this._state=RN,e.arrayBuffer().then(s=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(Vf,this,a,i);return}this._bufferedBytes-=n[lr];let o=si(s);t?this.dispatch(o,t,n,i):(this._state=kr,this.sendFrame(r.frame(o,n),i),this.dequeue())}).catch(s=>{process.nextTick(ON,this,s,i)})}dispatch(e,t,n,i){if(!t){this.sendFrame(r.frame(e,n),i);return}let s=this._extensions[c0.extensionName];this._bufferedBytes+=n[lr],this._state=AN,s.compress(e,n.fin,(o,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");Vf(this,c,i);return}this._bufferedBytes-=n[lr],this._state=kr,n.readOnly=!1,this.sendFrame(r.frame(a,n),i),this.dequeue()})}dequeue(){for(;this._state===kr&&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)}};u0.exports=zf;function Vf(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 ON(r,e,t){Vf(r,e,t),r.onerror(e)}});var x0=A((iW,y0)=>{"use strict";var{kForOnEventAttribute:Ro,kListener:Yf}=on(),p0=Symbol("kCode"),f0=Symbol("kData"),d0=Symbol("kError"),h0=Symbol("kMessage"),m0=Symbol("kReason"),ns=Symbol("kTarget"),g0=Symbol("kType"),v0=Symbol("kWasClean"),ln=class{constructor(e){this[ns]=null,this[g0]=e}get target(){return this[ns]}get type(){return this[g0]}};Object.defineProperty(ln.prototype,"target",{enumerable:!0});Object.defineProperty(ln.prototype,"type",{enumerable:!0});var ai=class extends ln{constructor(e,t={}){super(e),this[p0]=t.code===void 0?0:t.code,this[m0]=t.reason===void 0?"":t.reason,this[v0]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[p0]}get reason(){return this[m0]}get wasClean(){return this[v0]}};Object.defineProperty(ai.prototype,"code",{enumerable:!0});Object.defineProperty(ai.prototype,"reason",{enumerable:!0});Object.defineProperty(ai.prototype,"wasClean",{enumerable:!0});var is=class extends ln{constructor(e,t={}){super(e),this[d0]=t.error===void 0?null:t.error,this[h0]=t.message===void 0?"":t.message}get error(){return this[d0]}get message(){return this[h0]}};Object.defineProperty(is.prototype,"error",{enumerable:!0});Object.defineProperty(is.prototype,"message",{enumerable:!0});var Oo=class extends ln{constructor(e,t={}){super(e),this[f0]=t.data===void 0?null:t.data}get data(){return this[f0]}};Object.defineProperty(Oo.prototype,"data",{enumerable:!0});var MN={addEventListener(r,e,t={}){for(let i of this.listeners(r))if(!t[Ro]&&i[Yf]===e&&!i[Ro])return;let n;if(r==="message")n=function(s,o){let a=new Oo("message",{data:o?s:s.toString()});a[ns]=this,Pc(e,this,a)};else if(r==="close")n=function(s,o){let a=new ai("close",{code:s,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[ns]=this,Pc(e,this,a)};else if(r==="error")n=function(s){let o=new is("error",{error:s,message:s.message});o[ns]=this,Pc(e,this,o)};else if(r==="open")n=function(){let s=new ln("open");s[ns]=this,Pc(e,this,s)};else return;n[Ro]=!!t[Ro],n[Yf]=e,t.once?this.once(r,n):this.on(r,n)},removeEventListener(r,e){for(let t of this.listeners(r))if(t[Yf]===e&&!t[Ro]){this.removeListener(r,t);break}}};y0.exports={CloseEvent:ai,ErrorEvent:is,Event:ln,EventTarget:MN,MessageEvent:Oo};function Pc(r,e,t){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,t):r.call(e,t)}});var Xf=A((sW,_0)=>{"use strict";var{tokenChars:Mo}=es();function $r(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}function PN(r){let e=Object.create(null),t=Object.create(null),n=!1,i=!1,s=!1,o,a,c=-1,l=-1,u=-1,f=0;for(;f<r.length;f++)if(l=r.charCodeAt(f),o===void 0)if(u===-1&&Mo[l]===1)c===-1&&(c=f);else if(f!==0&&(l===32||l===9))u===-1&&c!==-1&&(u=f);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);u===-1&&(u=f);let g=r.slice(c,u);l===44?($r(e,g,t),t=Object.create(null)):o=g,c=u=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);else if(a===void 0)if(u===-1&&Mo[l]===1)c===-1&&(c=f);else if(l===32||l===9)u===-1&&c!==-1&&(u=f);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);u===-1&&(u=f),$r(t,r.slice(c,u),!0),l===44&&($r(e,o,t),t=Object.create(null),o=void 0),c=u=-1}else if(l===61&&c!==-1&&u===-1)a=r.slice(c,f),c=u=-1;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(i){if(Mo[l]!==1)throw new SyntaxError(`Unexpected character at index ${f}`);c===-1?c=f:n||(n=!0),i=!1}else if(s)if(Mo[l]===1)c===-1&&(c=f);else if(l===34&&c!==-1)s=!1,u=f;else if(l===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(l===34&&r.charCodeAt(f-1)===61)s=!0;else if(u===-1&&Mo[l]===1)c===-1&&(c=f);else if(c!==-1&&(l===32||l===9))u===-1&&(u=f);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);u===-1&&(u=f);let g=r.slice(c,u);n&&(g=g.replace(/\\/g,""),n=!1),$r(t,a,g),l===44&&($r(e,o,t),t=Object.create(null),o=void 0),a=void 0,c=u=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);if(c===-1||s||l===32||l===9)throw new SyntaxError("Unexpected end of input");u===-1&&(u=f);let d=r.slice(c,u);return o===void 0?$r(e,d,t):(a===void 0?$r(t,d,!0):n?$r(t,a,d.replace(/\\/g,"")):$r(t,a,d),$r(e,o,t)),e}function IN(r){return Object.keys(r).map(e=>{let t=r[e];return Array.isArray(t)||(t=[t]),t.map(n=>[e].concat(Object.keys(n).map(i=>{let s=n[i];return Array.isArray(s)||(s=[s]),s.map(o=>o===!0?i:`${i}=${o}`).join("; ")})).join("; ")).join(", ")}).join(", ")}_0.exports={format:IN,parse:PN}});var Lc=A((cW,P0)=>{"use strict";var NN=require("events"),DN=require("https"),LN=require("http"),S0=require("net"),BN=require("tls"),{randomBytes:jN,createHash:FN}=require("crypto"),{Duplex:oW,Readable:aW}=require("stream"),{URL:Jf}=require("url"),Un=Ao(),UN=Gf(),qN=Kf(),{isBlob:$N}=es(),{BINARY_TYPES:b0,EMPTY_BUFFER:Ic,GUID:HN,kForOnEventAttribute:Zf,kListener:WN,kStatusCode:GN,kWebSocket:vt,NOOP:E0}=on(),{EventTarget:{addEventListener:zN,removeEventListener:VN}}=x0(),{format:KN,parse:YN}=Xf(),{toBuffer:XN}=Co(),JN=30*1e3,T0=Symbol("kAborted"),Qf=[8,13],un=["CONNECTING","OPEN","CLOSING","CLOSED"],ZN=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Se=class r extends NN{constructor(e,t,n){super(),this._binaryType=b0[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=Ic,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]),C0(this,e,t,n)):(this._autoPong=n.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){b0.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 UN({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),s=new qN(e,this._extensions,n.generateMask);this._receiver=i,this._sender=s,this._socket=e,i[vt]=this,s[vt]=this,e[vt]=this,i.on("conclude",tD),i.on("drain",rD),i.on("error",nD),i.on("message",iD),i.on("ping",sD),i.on("pong",oD),s.onerror=aD,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",R0),e.on("data",Dc),e.on("end",O0),e.on("error",M0),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[Un.extensionName]&&this._extensions[Un.extensionName].cleanup(),this._receiver.removeAllListeners(),this._readyState=r.CLOSED,this.emit("close",this._closeCode,this._closeMessage)}close(e,t){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){Jt(this,this._req,"WebSocket was closed before the connection was established");return}if(this.readyState===r.CLOSING){this._closeFrameSent&&(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end();return}this._readyState=r.CLOSING,this._sender.close(e,t,!this._isServer,n=>{n||(this._closeFrameSent=!0,(this._closeFrameReceived||this._receiver._writableState.errorEmitted)&&this._socket.end())}),A0(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||Ic,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||Ic,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[Un.extensionName]||(i.compress=!1),this._sender.send(e||Ic,i,n)}terminate(){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){Jt(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=r.CLOSING,this._socket.destroy())}}};Object.defineProperty(Se,"CONNECTING",{enumerable:!0,value:un.indexOf("CONNECTING")});Object.defineProperty(Se.prototype,"CONNECTING",{enumerable:!0,value:un.indexOf("CONNECTING")});Object.defineProperty(Se,"OPEN",{enumerable:!0,value:un.indexOf("OPEN")});Object.defineProperty(Se.prototype,"OPEN",{enumerable:!0,value:un.indexOf("OPEN")});Object.defineProperty(Se,"CLOSING",{enumerable:!0,value:un.indexOf("CLOSING")});Object.defineProperty(Se.prototype,"CLOSING",{enumerable:!0,value:un.indexOf("CLOSING")});Object.defineProperty(Se,"CLOSED",{enumerable:!0,value:un.indexOf("CLOSED")});Object.defineProperty(Se.prototype,"CLOSED",{enumerable:!0,value:un.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(Se.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(Se.prototype,`on${r}`,{enumerable:!0,get(){for(let e of this.listeners(r))if(e[Zf])return e[WN];return null},set(e){for(let t of this.listeners(r))if(t[Zf]){this.removeListener(r,t);break}typeof e=="function"&&this.addEventListener(r,e,{[Zf]:!0})}})});Se.prototype.addEventListener=zN;Se.prototype.removeEventListener=VN;P0.exports=Se;function C0(r,e,t,n){let i={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:Qf[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,!Qf.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${Qf.join(", ")})`);let s;if(e instanceof Jf)s=e;else try{s=new Jf(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 b=new SyntaxError(c);if(r._redirects===0)throw b;Nc(r,b);return}let l=o?443:80,u=jN(16).toString("base64"),f=o?DN.request:LN.request,d=new Set,g;if(i.createConnection=i.createConnection||(o?eD:QN),i.defaultPort=i.defaultPort||l,i.port=s.port||l,i.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":u,Connection:"Upgrade",Upgrade:"websocket"},i.path=s.pathname+s.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(g=new Un(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=KN({[Un.extensionName]:g.offer()})),t.length){for(let b of t){if(typeof b!="string"||!ZN.test(b)||d.has(b))throw new SyntaxError("An invalid or duplicated subprotocol was specified");d.add(b)}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 b=i.path.split(":");i.socketPath=b[0],i.path=b[1]}let y;if(i.followRedirects){if(r._redirects===0){r._originalIpc=a,r._originalSecure=o,r._originalHostOrSocketPath=a?i.socketPath:s.host;let b=n&&n.headers;if(n={...n,headers:{}},b)for(let[C,R]of Object.entries(b))n.headers[C.toLowerCase()]=R}else if(r.listenerCount("redirect")===0){let b=a?r._originalIpc?i.socketPath===r._originalHostOrSocketPath:!1:r._originalIpc?!1:s.host===r._originalHostOrSocketPath;(!b||r._originalSecure&&!o)&&(delete i.headers.authorization,delete i.headers.cookie,b||delete i.headers.host,i.auth=void 0)}i.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),y=r._req=f(i),r._redirects&&r.emit("redirect",r.url,y)}else y=r._req=f(i);i.timeout&&y.on("timeout",()=>{Jt(r,y,"Opening handshake has timed out")}),y.on("error",b=>{y===null||y[T0]||(y=r._req=null,Nc(r,b))}),y.on("response",b=>{let C=b.headers.location,R=b.statusCode;if(C&&i.followRedirects&&R>=300&&R<400){if(++r._redirects>i.maxRedirects){Jt(r,y,"Maximum redirects exceeded");return}y.abort();let O;try{O=new Jf(C,e)}catch{let B=new SyntaxError(`Invalid URL: ${C}`);Nc(r,B);return}C0(r,O,t,n)}else r.emit("unexpected-response",y,b)||Jt(r,y,`Unexpected server response: ${b.statusCode}`)}),y.on("upgrade",(b,C,R)=>{if(r.emit("upgrade",b),r.readyState!==Se.CONNECTING)return;y=r._req=null;let O=b.headers.upgrade;if(O===void 0||O.toLowerCase()!=="websocket"){Jt(r,C,"Invalid Upgrade header");return}let P=FN("sha1").update(u+HN).digest("base64");if(b.headers["sec-websocket-accept"]!==P){Jt(r,C,"Invalid Sec-WebSocket-Accept header");return}let B=b.headers["sec-websocket-protocol"],G;if(B!==void 0?d.size?d.has(B)||(G="Server sent an invalid subprotocol"):G="Server sent a subprotocol but none was requested":d.size&&(G="Server sent no subprotocol"),G){Jt(r,C,G);return}B&&(r._protocol=B);let F=b.headers["sec-websocket-extensions"];if(F!==void 0){if(!g){Jt(r,C,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let V;try{V=YN(F)}catch{Jt(r,C,"Invalid Sec-WebSocket-Extensions header");return}let D=Object.keys(V);if(D.length!==1||D[0]!==Un.extensionName){Jt(r,C,"Server indicated an extension that was not requested");return}try{g.accept(V[Un.extensionName])}catch{Jt(r,C,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[Un.extensionName]=g}r.setSocket(C,R,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(y,r):y.end()}function Nc(r,e){r._readyState=Se.CLOSING,r._errorEmitted=!0,r.emit("error",e),r.emitClose()}function QN(r){return r.path=r.socketPath,S0.connect(r)}function eD(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=S0.isIP(r.host)?"":r.host),BN.connect(r)}function Jt(r,e,t){r._readyState=Se.CLOSING;let n=new Error(t);Error.captureStackTrace(n,Jt),e.setHeader?(e[T0]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(Nc,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=$N(e)?e.size:XN(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 tD(r,e){let t=this[vt];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=r,t._socket[vt]!==void 0&&(t._socket.removeListener("data",Dc),process.nextTick(k0,t._socket),r===1005?t.close():t.close(r,e))}function rD(){let r=this[vt];r.isPaused||r._socket.resume()}function nD(r){let e=this[vt];e._socket[vt]!==void 0&&(e._socket.removeListener("data",Dc),process.nextTick(k0,e._socket),e.close(r[GN])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r))}function w0(){this[vt].emitClose()}function iD(r,e){this[vt].emit("message",r,e)}function sD(r){let e=this[vt];e._autoPong&&e.pong(r,!this._isServer,E0),e.emit("ping",r)}function oD(r){this[vt].emit("pong",r)}function k0(r){r.resume()}function aD(r){let e=this[vt];e.readyState!==Se.CLOSED&&(e.readyState===Se.OPEN&&(e._readyState=Se.CLOSING,A0(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r)))}function A0(r){r._closeTimer=setTimeout(r._socket.destroy.bind(r._socket),JN)}function R0(){let r=this[vt];this.removeListener("close",R0),this.removeListener("data",Dc),this.removeListener("end",O0),r._readyState=Se.CLOSING;let e;!this._readableState.endEmitted&&!r._closeFrameReceived&&!r._receiver._writableState.errorEmitted&&(e=r._socket.read())!==null&&r._receiver.write(e),r._receiver.end(),this[vt]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",w0),r._receiver.on("finish",w0))}function Dc(r){this[vt]._receiver.write(r)||this.pause()}function O0(){let r=this[vt];r._readyState=Se.CLOSING,r._receiver.end(),this.end()}function M0(){let r=this[vt];this.removeListener("error",M0),this.on("error",E0),r&&(r._readyState=Se.CLOSING,this.destroy())}});var L0=A((uW,D0)=>{"use strict";var lW=Lc(),{Duplex:cD}=require("stream");function I0(r){r.emit("close")}function lD(){!this.destroyed&&this._writableState.finished&&this.destroy()}function N0(r){this.removeListener("error",N0),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function uD(r,e){let t=!0,n=new cD({...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(I0,n);return}let o=!1;r.once("error",function(c){o=!0,s(c)}),r.once("close",function(){o||s(i),process.nextTick(I0,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",lD),n.on("error",N0),n}D0.exports=uD});var j0=A((pW,B0)=>{"use strict";var{tokenChars:pD}=es();function fD(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&&pD[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}B0.exports={parse:fD}});var G0=A((dW,W0)=>{"use strict";var dD=require("events"),Bc=require("http"),{Duplex:fW}=require("stream"),{createHash:hD}=require("crypto"),F0=Xf(),ci=Ao(),mD=j0(),gD=Lc(),{GUID:vD,kWebSocket:yD}=on(),xD=/^[+/0-9A-Za-z]{22}==$/,U0=0,q0=1,H0=2,td=class extends dD{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:gD,...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=Bc.createServer((n,i)=>{let s=Bc.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=_D(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=U0}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===H0){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(Po,this);return}if(e&&this.once("close",e),this._state!==q0)if(this._state=q0,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(Po,this):process.nextTick(Po,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{Po(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",$0);let s=e.headers["sec-websocket-key"],o=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){li(this,e,t,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){li(this,e,t,400,"Invalid Upgrade header");return}if(s===void 0||!xD.test(s)){li(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){li(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){Io(t,400);return}let c=e.headers["sec-websocket-protocol"],l=new Set;if(c!==void 0)try{l=mD.parse(c)}catch{li(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let u=e.headers["sec-websocket-extensions"],f={};if(this.options.perMessageDeflate&&u!==void 0){let d=new ci(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let g=F0.parse(u);g[ci.extensionName]&&(d.accept(g[ci.extensionName]),f[ci.extensionName]=d)}catch{li(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let d={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(d,(g,y,b,C)=>{if(!g)return Io(t,y||401,b,C);this.completeUpgrade(f,s,l,e,t,n,i)});return}if(!this.options.verifyClient(d))return Io(t,401)}this.completeUpgrade(f,s,l,e,t,n,i)}completeUpgrade(e,t,n,i,s,o,a){if(!s.readable||!s.writable)return s.destroy();if(s[yD])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>U0)return Io(s,503);let l=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${hD("sha1").update(t+vD).digest("base64")}`],u=new this.options.WebSocket(null,void 0,this.options);if(n.size){let f=this.options.handleProtocols?this.options.handleProtocols(n,i):n.values().next().value;f&&(l.push(`Sec-WebSocket-Protocol: ${f}`),u._protocol=f)}if(e[ci.extensionName]){let f=e[ci.extensionName].params,d=F0.format({[ci.extensionName]:[f]});l.push(`Sec-WebSocket-Extensions: ${d}`),u._extensions=e}this.emit("headers",l,i),s.write(l.concat(`\r
|
|
13
13
|
`).join(`\r
|
|
14
|
-
`)),s.removeListener("error"
|
|
14
|
+
`)),s.removeListener("error",$0),u.setSocket(s,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(u),u.on("close",()=>{this.clients.delete(u),this._shouldEmitClose&&!this.clients.size&&process.nextTick(Po,this)})),a(u,i)}};W0.exports=td;function _D(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 Po(r){r._state=H0,r.emit("close")}function $0(){this.destroy()}function Io(r,e,t,n){t=t||Bc.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} ${Bc.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 li(r,e,t,n,i,s){if(r.listenerCount("wsClientError")){let o=new Error(i);Error.captureStackTrace(o,li),r.emit("wsClientError",o,t,e)}else Io(t,n,i,s)}});var W0=k((cW,H0)=>{"use strict";var un=Lc();un.createWebSocketStream=I0();un.Server=$0();un.Receiver=Gf();un.Sender=Kf();un.WebSocket=un;un.WebSocketServer=un.Server;H0.exports=un});var V0=k((lW,z0)=>{"use strict";var G0=Object.getOwnPropertySymbols,gD=Object.prototype.hasOwnProperty,vD=Object.prototype.propertyIsEnumerable;function yD(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function xD(){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}}z0.exports=xD()?Object.assign:function(r,e){for(var t,n=yD(r),i,s=1;s<arguments.length;s++){t=Object(arguments[s]);for(var o in t)gD.call(t,o)&&(n[o]=t[o]);if(G0){i=G0(t);for(var a=0;a<i.length;a++)vD.call(t,i[a])&&(n[i[a]]=t[i[a]])}}return n}});var X0=k((uW,rd)=>{"use strict";rd.exports=bD;rd.exports.append=Y0;var _D=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function Y0(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:K0(String(e)),n=0;n<t.length;n++)if(!_D.test(t[n]))throw new TypeError("field argument contains an invalid header name");if(r==="*")return r;var i=r,s=K0(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 K0(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 bD(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=Y0(n,e))&&r.setHeader("Vary",t)}});var nd=k((pW,J0)=>{(function(){"use strict";var r=V0(),e=X0(),t={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function n(y){return typeof y=="string"||y instanceof String}function i(y,b){if(Array.isArray(b)){for(var C=0;C<b.length;++C)if(i(y,b[C]))return!0;return!1}else return n(b)?y===b:b instanceof RegExp?b.test(y):!!b}function s(y,b){var C=b.headers.origin,R=[],M;return!y.origin||y.origin==="*"?R.push([{key:"Access-Control-Allow-Origin",value:"*"}]):n(y.origin)?(R.push([{key:"Access-Control-Allow-Origin",value:y.origin}]),R.push([{key:"Vary",value:"Origin"}])):(M=i(C,y.origin),R.push([{key:"Access-Control-Allow-Origin",value:M?C:!1}]),R.push([{key:"Vary",value:"Origin"}])),R}function o(y){var b=y.methods;return b.join&&(b=y.methods.join(",")),{key:"Access-Control-Allow-Methods",value:b}}function a(y){return y.credentials===!0?{key:"Access-Control-Allow-Credentials",value:"true"}:null}function c(y,b){var C=y.allowedHeaders||y.headers,R=[];return C?C.join&&(C=C.join(",")):(C=b.headers["access-control-request-headers"],R.push([{key:"Vary",value:"Access-Control-Request-Headers"}])),C&&C.length&&R.push([{key:"Access-Control-Allow-Headers",value:C}]),R}function l(y){var b=y.exposedHeaders;if(b)b.join&&(b=b.join(","));else return null;return b&&b.length?{key:"Access-Control-Expose-Headers",value:b}:null}function u(y){var b=(typeof y.maxAge=="number"||y.maxAge)&&y.maxAge.toString();return b&&b.length?{key:"Access-Control-Max-Age",value:b}:null}function f(y,b){for(var C=0,R=y.length;C<R;C++){var M=y[C];M&&(Array.isArray(M)?f(M,b):M.key==="Vary"&&M.value?e(b,M.value):M.value&&b.setHeader(M.key,M.value))}}function d(y,b,C,R){var M=[],P=b.method&&b.method.toUpperCase&&b.method.toUpperCase();P==="OPTIONS"?(M.push(s(y,b)),M.push(a(y)),M.push(o(y)),M.push(c(y,b)),M.push(u(y)),M.push(l(y)),f(M,C),y.preflightContinue?R():(C.statusCode=y.optionsSuccessStatus,C.setHeader("Content-Length","0"),C.end())):(M.push(s(y,b)),M.push(a(y)),M.push(l(y)),f(M,C),R())}function g(y){var b=null;return typeof y=="function"?b=y:b=function(C,R){R(null,y)},function(R,M,P){b(R,function(B,G){if(B)P(B);else{var F=r({},t,G),V=null;F.origin&&typeof F.origin=="function"?V=F.origin:F.origin&&(V=function(D,$){$(null,F.origin)}),V?V(R.headers.origin,function(D,$){D||!$?P(D):(F.origin=$,d(F,R,M,P))}):P()}})}}J0.exports=g})()});var sd=k(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.Server=as.BaseServer=void 0;var Z0=Zp(),jc=xf(),wD=require("events"),Q0=bf(),SD=Re(),ED=yx(),TD=W0(),e_=vf(),CD=To(),te=(0,SD.default)("engine"),ss=Symbol("responseHeaders");function AD(r){try{let e=JSON.parse(r);if(typeof e.sid=="string")return e.sid}catch{}}var os=class extends wD.EventEmitter{constructor(e={}){super(),this.middlewares=[],this.clients={},this.clientsCount=0,this.opts=Object.assign({wsEngine:TD.Server,pingTimeout:2e4,pingInterval:25e3,upgradeTimeout:1e4,maxHttpBufferSize:1e6,transports:["polling","websocket"],allowUpgrades:!0,httpCompression:{threshold:1024},cors:!1,allowEIO3:!1},e),e.cookie&&(this.opts.cookie=Object.assign({name:"io",path:"/",httpOnly:e.cookie.path!==!1,sameSite:"lax"},e.cookie)),this.opts.cors&&this.use(nd()(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?jc.default[e].upgradesTo||[]:[]}verify(e,t,n){let i=e._query.transport;if(!~this.opts.transports.indexOf(i)||i==="webtransport")return te('unknown transport "%s"',i),n(ye.errors.UNKNOWN_TRANSPORT,{transport:i});if(kD(e.headers.origin)){let a=e.headers.origin;return e.headers.origin=null,te("origin header invalid"),n(ye.errors.BAD_REQUEST,{name:"INVALID_ORIGIN",origin:a})}let o=e._query.sid;if(o){if(!this.clients.hasOwnProperty(o))return te('unknown sid "%s"',o),n(ye.errors.UNKNOWN_SID,{sid:o});let a=this.clients[o].transport.name;if(!t&&a!==i)return te("bad request: unexpected transport without upgrade"),n(ye.errors.BAD_REQUEST,{name:"TRANSPORT_MISMATCH",transport:i,previousTransport:a})}else return e.method!=="GET"?n(ye.errors.BAD_HANDSHAKE_METHOD,{method:e.method}):i==="websocket"&&!t?(te("invalid transport upgrade"),n(ye.errors.BAD_REQUEST,{name:"TRANSPORT_HANDSHAKE_ERROR"})):this.opts.allowRequest?this.opts.allowRequest(e,(a,c)=>{if(!c)return n(ye.errors.FORBIDDEN,{message:a});n()}):n();n()}use(e){this.middlewares.push(e)}_applyMiddlewares(e,t,n){if(this.middlewares.length===0)return te("no middleware to apply, skipping"),n();let i=s=>{te("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(){te("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 Z0.generateId()}async handshake(e,t,n){let i=t._query.EIO==="4"?4:3;if(i===3&&!this.opts.allowEIO3){te("unsupported protocol version"),this.emit("connection_error",{req:t,code:ye.errors.UNSUPPORTED_PROTOCOL_VERSION,message:ye.errorMessages[ye.errors.UNSUPPORTED_PROTOCOL_VERSION],context:{protocol:i}}),n(ye.errors.UNSUPPORTED_PROTOCOL_VERSION);return}let s;try{s=await this.generateId(t)}catch(c){te("error while generating an id"),this.emit("connection_error",{req:t,code:ye.errors.BAD_REQUEST,message:ye.errorMessages[ye.errors.BAD_REQUEST],context:{name:"ID_GENERATION_ERROR",error:c}}),n(ye.errors.BAD_REQUEST);return}te('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){te('error handshaking to transport "%s"',e),this.emit("connection_error",{req:t,code:ye.errors.BAD_REQUEST,message:ye.errorMessages[ye.errors.BAD_REQUEST],context:{name:"TRANSPORT_HANDSHAKE_ERROR",error:c}}),n(ye.errors.BAD_REQUEST);return}let a=new Q0.Socket(s,this,o,t,i);return o.on("headers",(c,l)=>{!l._query.sid&&(this.opts.cookie&&(c["Set-Cookie"]=[(0,ED.serialize)(this.opts.cookie.name,s,this.opts.cookie)]),this.emit("initial_headers",c,l)),this.emit("headers",c,l)}),o.onRequest(t),this.clients[s]=a,this.clientsCount++,a.once("close",()=>{delete this.clients[s],this.clientsCount--}),this.emit("connection",a),o}async onWebTransportSession(e){let t=setTimeout(()=>{te("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){te("session is closed");return}let s=i.value,o=(0,CD.createPacketDecoderStream)(this.opts.maxHttpBufferSize,"nodebuffer"),a=s.readable.pipeThrough(o).getReader(),{value:c,done:l}=await a.read();if(l){te("stream is closed");return}if(clearTimeout(t),c.type!=="open")return te("invalid WebTransport handshake"),e.close();if(c.data===void 0){let d=new e_.WebTransport(e,s,a),g=Z0.generateId();te('handshaking client "%s" (WebTransport)',g);let y=new Q0.Socket(g,this,d,null,4);this.clients[g]=y,this.clientsCount++,y.once("close",()=>{delete this.clients[g],this.clientsCount--}),this.emit("connection",y);return}let u=AD(c.data);if(!u)return te("invalid WebTransport handshake"),e.close();let f=this.clients[u];if(!f)te("upgrade attempt for closed client"),e.close();else if(f.upgrading)te("transport has already been trying to upgrade"),e.close();else if(f.upgraded)te("transport had already been upgraded"),e.close();else{te("upgrading existing transport");let d=new e_.WebTransport(e,s,a);f._maybeUpgrade(d)}}};as.BaseServer=os;os.errors={UNKNOWN_TRANSPORT:0,UNKNOWN_SID:1,BAD_HANDSHAKE_METHOD:2,BAD_REQUEST:3,FORBIDDEN:4,UNSUPPORTED_PROTOCOL_VERSION:5};os.errorMessages={0:"Transport unknown",1:"Session ID unknown",2:"Bad handshake method",3:"Bad request",4:"Forbidden",5:"Unsupported protocol version"};var id=class{constructor(e,t){this.req=e,this.socket=t,e[ss]={}}setHeader(e,t){this.req[ss][e]=t}getHeader(e){return this.req[ss][e]}removeHeader(e){delete this.req[ss][e]}write(){}writeHead(){}end(){this.socket.destroy()}},ye=class r extends os{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[ss]||{};delete t[ss],!t._query.sid&&this.emit("initial_headers",n,t),this.emit("headers",n,t),te("writing headers: %j",n),Object.keys(n).forEach(s=>{e.push(`${s}: ${n[s]}`)})}))}cleanup(){this.ws&&(te("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 jc.default[e](t)}handleRequest(e,t){te('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}),t_(t,i,s);return}if(e._query.sid)te("setting new request for existing client"),this.clients[e._query.sid].transport.onRequest(e);else{let o=(a,c)=>t_(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 id(e,t),s=(o,a)=>{if(o!==void 0){this.emit("connection_error",{req:e,code:o,message:r.errorMessages[o],context:a}),r_(t,o,a);return}let c=Buffer.from(n);n=null,i.writeHead(),this.ws.handleUpgrade(e,t,c,l=>{this.onWebSocket(e,t,l)})};this._applyMiddlewares(e,i,o=>{o?s(r.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(e,!0,s)})}onWebSocket(e,t,n){if(n.on("error",s),jc.default[e._query.transport]!==void 0&&!jc.default[e._query.transport].prototype.handlesUpgrades){te("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)te("upgrade attempt for closed client"),n.close();else if(o.upgrading)te("transport has already been trying to upgrade"),n.close();else if(o.upgraded)te("transport had already been upgraded"),n.close();else{te("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)=>r_(t,a,c);this.handshake(e._query.transport,e,o)}function s(){te("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))te('intercepting request for path "%s"',n),this.handleRequest(a,c);else{let l=0,u=o.length;for(;l<u;l++)o[l].call(e,a,c)}}),~this.opts.transports.indexOf("websocket")&&e.on("upgrade",(a,c,l)=>{s(a)?this.handleUpgrade(a,c,l):t.destroyUpgrade!==!1&&setTimeout(function(){if(c.writable&&c.bytesWritten<=0)return c.on("error",u=>{te("error while destroying upgrade: %s",u.message)}),c.end()},i)})}};as.Server=ye;function t_(r,e,t){let n=e===ye.errors.FORBIDDEN?403:400,i=t&&t.message?t.message:ye.errorMessages[e];r.writeHead(n,{"Content-Type":"application/json"}),r.end(JSON.stringify({code:e,message:i}))}function r_(r,e,t={}){if(r.on("error",()=>{te("ignoring error from closed connection")}),r.writable){let n=t.message||ye.errorMessages[e],i=Buffer.byteLength(n);r.write(`HTTP/1.1 400 Bad Request\r
|
|
18
|
+
`+t)}function li(r,e,t,n,i,s){if(r.listenerCount("wsClientError")){let o=new Error(i);Error.captureStackTrace(o,li),r.emit("wsClientError",o,t,e)}else Io(t,n,i,s)}});var V0=A((hW,z0)=>{"use strict";var pn=Lc();pn.createWebSocketStream=L0();pn.Server=G0();pn.Receiver=Gf();pn.Sender=Kf();pn.WebSocket=pn;pn.WebSocketServer=pn.Server;z0.exports=pn});var X0=A((mW,Y0)=>{"use strict";var K0=Object.getOwnPropertySymbols,bD=Object.prototype.hasOwnProperty,wD=Object.prototype.propertyIsEnumerable;function SD(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function ED(){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}}Y0.exports=ED()?Object.assign:function(r,e){for(var t,n=SD(r),i,s=1;s<arguments.length;s++){t=Object(arguments[s]);for(var o in t)bD.call(t,o)&&(n[o]=t[o]);if(K0){i=K0(t);for(var a=0;a<i.length;a++)wD.call(t,i[a])&&(n[i[a]]=t[i[a]])}}return n}});var Q0=A((gW,rd)=>{"use strict";rd.exports=CD;rd.exports.append=Z0;var TD=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;function Z0(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:J0(String(e)),n=0;n<t.length;n++)if(!TD.test(t[n]))throw new TypeError("field argument contains an invalid header name");if(r==="*")return r;var i=r,s=J0(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 J0(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 CD(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=Z0(n,e))&&r.setHeader("Vary",t)}});var nd=A((vW,e_)=>{(function(){"use strict";var r=X0(),e=Q0(),t={origin:"*",methods:"GET,HEAD,PUT,PATCH,POST,DELETE",preflightContinue:!1,optionsSuccessStatus:204};function n(y){return typeof y=="string"||y instanceof String}function i(y,b){if(Array.isArray(b)){for(var C=0;C<b.length;++C)if(i(y,b[C]))return!0;return!1}else return n(b)?y===b:b instanceof RegExp?b.test(y):!!b}function s(y,b){var C=b.headers.origin,R=[],O;return!y.origin||y.origin==="*"?R.push([{key:"Access-Control-Allow-Origin",value:"*"}]):n(y.origin)?(R.push([{key:"Access-Control-Allow-Origin",value:y.origin}]),R.push([{key:"Vary",value:"Origin"}])):(O=i(C,y.origin),R.push([{key:"Access-Control-Allow-Origin",value:O?C:!1}]),R.push([{key:"Vary",value:"Origin"}])),R}function o(y){var b=y.methods;return b.join&&(b=y.methods.join(",")),{key:"Access-Control-Allow-Methods",value:b}}function a(y){return y.credentials===!0?{key:"Access-Control-Allow-Credentials",value:"true"}:null}function c(y,b){var C=y.allowedHeaders||y.headers,R=[];return C?C.join&&(C=C.join(",")):(C=b.headers["access-control-request-headers"],R.push([{key:"Vary",value:"Access-Control-Request-Headers"}])),C&&C.length&&R.push([{key:"Access-Control-Allow-Headers",value:C}]),R}function l(y){var b=y.exposedHeaders;if(b)b.join&&(b=b.join(","));else return null;return b&&b.length?{key:"Access-Control-Expose-Headers",value:b}:null}function u(y){var b=(typeof y.maxAge=="number"||y.maxAge)&&y.maxAge.toString();return b&&b.length?{key:"Access-Control-Max-Age",value:b}:null}function f(y,b){for(var C=0,R=y.length;C<R;C++){var O=y[C];O&&(Array.isArray(O)?f(O,b):O.key==="Vary"&&O.value?e(b,O.value):O.value&&b.setHeader(O.key,O.value))}}function d(y,b,C,R){var O=[],P=b.method&&b.method.toUpperCase&&b.method.toUpperCase();P==="OPTIONS"?(O.push(s(y,b)),O.push(a(y)),O.push(o(y)),O.push(c(y,b)),O.push(u(y)),O.push(l(y)),f(O,C),y.preflightContinue?R():(C.statusCode=y.optionsSuccessStatus,C.setHeader("Content-Length","0"),C.end())):(O.push(s(y,b)),O.push(a(y)),O.push(l(y)),f(O,C),R())}function g(y){var b=null;return typeof y=="function"?b=y:b=function(C,R){R(null,y)},function(R,O,P){b(R,function(B,G){if(B)P(B);else{var F=r({},t,G),V=null;F.origin&&typeof F.origin=="function"?V=F.origin:F.origin&&(V=function(D,$){$(null,F.origin)}),V?V(R.headers.origin,function(D,$){D||!$?P(D):(F.origin=$,d(F,R,O,P))}):P()}})}}e_.exports=g})()});var sd=A(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.Server=as.BaseServer=void 0;var t_=Zp(),jc=xf(),kD=require("events"),r_=bf(),AD=Oe(),RD=bx(),OD=V0(),n_=vf(),MD=To(),te=(0,AD.default)("engine"),ss=Symbol("responseHeaders");function PD(r){try{let e=JSON.parse(r);if(typeof e.sid=="string")return e.sid}catch{}}var os=class extends kD.EventEmitter{constructor(e={}){super(),this.middlewares=[],this.clients={},this.clientsCount=0,this.opts=Object.assign({wsEngine:OD.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(nd()(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?jc.default[e].upgradesTo||[]:[]}verify(e,t,n){let i=e._query.transport;if(!~this.opts.transports.indexOf(i)||i==="webtransport")return te('unknown transport "%s"',i),n(xe.errors.UNKNOWN_TRANSPORT,{transport:i});if(ID(e.headers.origin)){let a=e.headers.origin;return e.headers.origin=null,te("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 te('unknown sid "%s"',o),n(xe.errors.UNKNOWN_SID,{sid:o});let a=this.clients[o].transport.name;if(!t&&a!==i)return te("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?(te("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 te("no middleware to apply, skipping"),n();let i=s=>{te("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(){te("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 t_.generateId()}async handshake(e,t,n){let i=t._query.EIO==="4"?4:3;if(i===3&&!this.opts.allowEIO3){te("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){te("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}te('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){te('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 r_.Socket(s,this,o,t,i);return o.on("headers",(c,l)=>{!l._query.sid&&(this.opts.cookie&&(c["Set-Cookie"]=[(0,RD.serialize)(this.opts.cookie.name,s,this.opts.cookie)]),this.emit("initial_headers",c,l)),this.emit("headers",c,l)}),o.onRequest(t),this.clients[s]=a,this.clientsCount++,a.once("close",()=>{delete this.clients[s],this.clientsCount--}),this.emit("connection",a),o}async onWebTransportSession(e){let t=setTimeout(()=>{te("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){te("session is closed");return}let s=i.value,o=(0,MD.createPacketDecoderStream)(this.opts.maxHttpBufferSize,"nodebuffer"),a=s.readable.pipeThrough(o).getReader(),{value:c,done:l}=await a.read();if(l){te("stream is closed");return}if(clearTimeout(t),c.type!=="open")return te("invalid WebTransport handshake"),e.close();if(c.data===void 0){let d=new n_.WebTransport(e,s,a),g=t_.generateId();te('handshaking client "%s" (WebTransport)',g);let y=new r_.Socket(g,this,d,null,4);this.clients[g]=y,this.clientsCount++,y.once("close",()=>{delete this.clients[g],this.clientsCount--}),this.emit("connection",y);return}let u=PD(c.data);if(!u)return te("invalid WebTransport handshake"),e.close();let f=this.clients[u];if(!f)te("upgrade attempt for closed client"),e.close();else if(f.upgrading)te("transport has already been trying to upgrade"),e.close();else if(f.upgraded)te("transport had already been upgraded"),e.close();else{te("upgrading existing transport");let d=new n_.WebTransport(e,s,a);f._maybeUpgrade(d)}}};as.BaseServer=os;os.errors={UNKNOWN_TRANSPORT:0,UNKNOWN_SID:1,BAD_HANDSHAKE_METHOD:2,BAD_REQUEST:3,FORBIDDEN:4,UNSUPPORTED_PROTOCOL_VERSION:5};os.errorMessages={0:"Transport unknown",1:"Session ID unknown",2:"Bad handshake method",3:"Bad request",4:"Forbidden",5:"Unsupported protocol version"};var id=class{constructor(e,t){this.req=e,this.socket=t,e[ss]={}}setHeader(e,t){this.req[ss][e]=t}getHeader(e){return this.req[ss][e]}removeHeader(e){delete this.req[ss][e]}write(){}writeHead(){}end(){this.socket.destroy()}},xe=class r extends os{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[ss]||{};delete t[ss],!t._query.sid&&this.emit("initial_headers",n,t),this.emit("headers",n,t),te("writing headers: %j",n),Object.keys(n).forEach(s=>{e.push(`${s}: ${n[s]}`)})}))}cleanup(){this.ws&&(te("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 jc.default[e](t)}handleRequest(e,t){te('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}),i_(t,i,s);return}if(e._query.sid)te("setting new request for existing client"),this.clients[e._query.sid].transport.onRequest(e);else{let o=(a,c)=>i_(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 id(e,t),s=(o,a)=>{if(o!==void 0){this.emit("connection_error",{req:e,code:o,message:r.errorMessages[o],context:a}),s_(t,o,a);return}let c=Buffer.from(n);n=null,i.writeHead(),this.ws.handleUpgrade(e,t,c,l=>{this.onWebSocket(e,t,l)})};this._applyMiddlewares(e,i,o=>{o?s(r.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(e,!0,s)})}onWebSocket(e,t,n){if(n.on("error",s),jc.default[e._query.transport]!==void 0&&!jc.default[e._query.transport].prototype.handlesUpgrades){te("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)te("upgrade attempt for closed client"),n.close();else if(o.upgrading)te("transport has already been trying to upgrade"),n.close();else if(o.upgraded)te("transport had already been upgraded"),n.close();else{te("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)=>s_(t,a,c);this.handshake(e._query.transport,e,o)}function s(){te("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))te('intercepting request for path "%s"',n),this.handleRequest(a,c);else{let l=0,u=o.length;for(;l<u;l++)o[l].call(e,a,c)}}),~this.opts.transports.indexOf("websocket")&&e.on("upgrade",(a,c,l)=>{s(a)?this.handleUpgrade(a,c,l):t.destroyUpgrade!==!1&&setTimeout(function(){if(c.writable&&c.bytesWritten<=0)return c.on("error",u=>{te("error while destroying upgrade: %s",u.message)}),c.end()},i)})}};as.Server=xe;function i_(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 s_(r,e,t={}){if(r.on("error",()=>{te("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 No=[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 kD(r){if(r+="",r.length<1)return!1;if(!No[r.charCodeAt(0)])return te('invalid header, index 0, char "%s"',r.charCodeAt(0)),!0;if(r.length<2)return!1;if(!No[r.charCodeAt(1)])return te('invalid header, index 1, char "%s"',r.charCodeAt(1)),!0;if(r.length<3)return!1;if(!No[r.charCodeAt(2)])return te('invalid header, index 2, char "%s"',r.charCodeAt(2)),!0;if(r.length<4)return!1;if(!No[r.charCodeAt(3)])return te('invalid header, index 3, char "%s"',r.charCodeAt(3)),!0;for(let e=4;e<r.length;++e)if(!No[r.charCodeAt(e)])return te('invalid header, index "%i", char "%s"',e,r.charCodeAt(e)),!0;return!1}});var i_=k(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});Fc.Polling=void 0;var RD=ii(),n_=require("zlib"),OD=oc(),MD=Re(),ur=(0,MD.default)("engine:polling"),PD={gzip:n_.createGzip,deflate:n_.createDeflate},od=class extends RD.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){ur("request overlap"),this.onError("overlap from client"),t.writeStatus("500 Internal Server Error"),t.end();return}ur("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&&(ur("triggering empty send to append close packet"),this.send([{type:"noop"}]))}onDataRequest(e,t){if(this.dataReq){this.onError("data request overlap from client"),t.writeStatus("500 Internal Server Error"),t.end();return}let n=Number(e.headers["content-length"]);if(!n){this.onError("content-length header required"),t.writeStatus("411 Length Required").end();return}if(n>this.maxHttpBufferSize){this.onError("payload too large"),t.writeStatus("413 Payload Too Large").end();return}if(e.headers["content-type"]==="application/octet-stream"&&this.protocol===4)return this.onError("invalid content");this.dataReq=e,this.dataRes=t;let s,o=0,a={"Content-Type":"text/html"};this.headers(e,a);for(let l in a)t.writeHeader(l,String(a[l]));let c=l=>{this.onData(l.toString()),this.onDataRequestCleanup(),t.cork(()=>{t.end("ok")})};t.onAborted(()=>{this.onDataRequestCleanup(),this.onError("data request connection closed prematurely")}),t.onData((l,u)=>{let f=o+l.byteLength;if(f>n){this.onError("content-length mismatch"),t.close();return}if(!s){if(u){c(Buffer.from(l));return}s=Buffer.allocUnsafe(n)}if(Buffer.from(l).copy(s,o),u){if(f!=n){this.onError("content-length mismatch"),t.writeStatus("400 Content-Length Mismatch").end(),this.onDataRequestCleanup();return}c(s);return}o=f})}onDataRequestCleanup(){this.dataReq=this.dataRes=null}onData(e){ur('received "%s"',e);let t=n=>{if(n.type==="close")return ur("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&&(ur("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){ur('writing "%s"',e),this.doWrite(e,t,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(e,t,n){let i=typeof e=="string",o={"Content-Type":i?"text/plain; charset=UTF-8":"application/octet-stream"},a=u=>{this.headers(this.req,o),this.res.cork(()=>{Object.keys(o).forEach(f=>{this.res.writeHeader(f,String(o[f]))}),this.res.end(u)}),n()};if(!this.httpCompression||!t.compress){a(e);return}if((i?Buffer.byteLength(e):e.length)<this.httpCompression.threshold){a(e);return}let l=OD(this.req).encodings(["gzip","deflate"]);if(!l){a(e);return}this.compress(e,l,(u,f)=>{if(u){this.res.writeStatus("500 Internal Server Error"),this.res.end(),n(u);return}o["Content-Encoding"]=l,a(f)})}compress(e,t,n){ur("compressing");let i=[],s=0;PD[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){ur("closing");let t,n=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(ur("transport writable - closing right away"),this.send([{type:"close"}]),n()):this.discarded?(ur("transport discarded - closing right away"),n()):(ur("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}};Fc.Polling=od});var o_=k(Uc=>{"use strict";Object.defineProperty(Uc,"__esModule",{value:!0});Uc.WebSocket=void 0;var ID=ii(),ND=Re(),s_=(0,ND.default)("engine:ws"),ad=class extends ID.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;s_('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){s_("closing"),e&&e(),this.socket.end()}};Uc.WebSocket=ad});var a_=k(cd=>{"use strict";Object.defineProperty(cd,"__esModule",{value:!0});var DD=i_(),LD=o_();cd.default={polling:DD.Polling,websocket:LD.WebSocket}});var c_=k(qc=>{"use strict";Object.defineProperty(qc,"__esModule",{value:!0});qc.uServer=void 0;var BD=Re(),ui=sd(),jD=a_(),Fn=(0,BD.default)("engine:uws"),ld=class extends ui.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(()=>{Fn("response has been aborted")})}createTransport(e,t){return new jD.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 ud(t),super._applyMiddlewares(e,e.res,i=>{e.res.writeHead(),n(i)})}handleRequest(e,t){Fn('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:ui.Server.errorMessages[i],context:s}),this.abortRequest(t.res,i,s);return}if(t._query.sid)Fn("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(ui.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!1,n)})}handleUpgrade(e,t,n){Fn("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:ui.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 Fn("transport has already been trying to upgrade"),e.close();if(f.upgraded)return Fn("transport had already been upgraded"),e.close();Fn("upgrading existing transport"),c=this.createTransport(t._query.transport,t),f._maybeUpgrade(c)}else return Fn("upgrade attempt for closed client"),e.close()}else if(c=await this.handshake(t._query.transport,t,(f,d)=>this.abortRequest(e,f,d)),!c)return;let l={};!a&&this.emit("initial_headers",l,t),this.emit("headers",l,t),t.res.writeStatus("101 Switching Protocols"),Object.keys(l).forEach(f=>{t.res.writeHeader(f,l[f])}),e.upgrade({transport:c},t.getHeader("sec-websocket-key"),t.getHeader("sec-websocket-protocol"),t.getHeader("sec-websocket-extensions"),n)};this._applyMiddlewares(t,e,s=>{s?i(ui.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!0,i)})}abortRequest(e,t,n){let i=t===ui.Server.errors.FORBIDDEN?"403 Forbidden":"400 Bad Request",s=n&&n.message?n.message:ui.Server.errorMessages[t];e.writeStatus(i),e.writeHeader("Content-Type","application/json"),e.end(JSON.stringify({code:t,message:s}))}};qc.uServer=ld;var ud=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 f_=k(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.protocol=yt.Transport=yt.Socket=yt.uServer=yt.parser=yt.transports=yt.Server=void 0;yt.listen=WD;yt.attach=p_;var FD=require("http"),l_=sd();Object.defineProperty(yt,"Server",{enumerable:!0,get:function(){return l_.Server}});var UD=xf();yt.transports=UD.default;var u_=To();yt.parser=u_;var qD=c_();Object.defineProperty(yt,"uServer",{enumerable:!0,get:function(){return qD.uServer}});var $D=bf();Object.defineProperty(yt,"Socket",{enumerable:!0,get:function(){return $D.Socket}});var HD=ii();Object.defineProperty(yt,"Transport",{enumerable:!0,get:function(){return HD.Transport}});yt.protocol=u_.protocol;function WD(r,e,t){typeof e=="function"&&(t=e,e={});let n=(0,FD.createServer)(function(s,o){o.writeHead(501),o.end("Not Implemented")}),i=p_(n,e);return i.httpServer=n,n.listen(r,t),i}function p_(r,e){let t=new l_.Server(e);return t.attach(r,e),t}});var h_=k(d_=>{d_.Emitter=Mt;function Mt(r){if(r)return GD(r)}function GD(r){for(var e in Mt.prototype)r[e]=Mt.prototype[e];return r}Mt.prototype.on=Mt.prototype.addEventListener=function(r,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(e),this};Mt.prototype.once=function(r,e){function t(){this.off(r,t),e.apply(this,arguments)}return t.fn=e,this.on(r,t),this};Mt.prototype.off=Mt.prototype.removeListener=Mt.prototype.removeAllListeners=Mt.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};Mt.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};Mt.prototype.emitReserved=Mt.prototype.emit;Mt.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]};Mt.prototype.hasListeners=function(r){return!!this.listeners(r).length}});var pd=k(Hc=>{"use strict";Object.defineProperty(Hc,"__esModule",{value:!0});Hc.isBinary=g_;Hc.hasBinary=$c;var zD=typeof ArrayBuffer=="function",VD=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,m_=Object.prototype.toString,KD=typeof Blob=="function"||typeof Blob<"u"&&m_.call(Blob)==="[object BlobConstructor]",YD=typeof File=="function"||typeof File<"u"&&m_.call(File)==="[object FileConstructor]";function g_(r){return zD&&(r instanceof ArrayBuffer||VD(r))||KD&&r instanceof Blob||YD&&r instanceof File}function $c(r,e){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let t=0,n=r.length;t<n;t++)if($c(r[t]))return!0;return!1}if(g_(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return $c(r.toJSON(),!0);for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&$c(r[t]))return!0;return!1}});var v_=k(Wc=>{"use strict";Object.defineProperty(Wc,"__esModule",{value:!0});Wc.deconstructPacket=JD;Wc.reconstructPacket=ZD;var XD=pd();function JD(r){let e=[],t=r.data,n=r;return n.data=fd(t,e),n.attachments=e.length,{packet:n,buffers:e}}function fd(r,e){if(!r)return r;if((0,XD.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]=fd(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]=fd(r[n],e));return t}return r}function ZD(r,e){return r.data=dd(r.data,e),delete r.attachments,r}function dd(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]=dd(r[t],e);else if(typeof r=="object")for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&(r[t]=dd(r[t],e));return r}});var Do=k(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.Decoder=kr.Encoder=kr.PacketType=kr.protocol=void 0;kr.isPacketValid=iL;var QD=h_(),y_=v_(),x_=pd(),eL=Re(),hd=(0,eL.default)("socket.io-parser"),__=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];kr.protocol=5;var fe;(function(r){r[r.CONNECT=0]="CONNECT",r[r.DISCONNECT=1]="DISCONNECT",r[r.EVENT=2]="EVENT",r[r.ACK=3]="ACK",r[r.CONNECT_ERROR=4]="CONNECT_ERROR",r[r.BINARY_EVENT=5]="BINARY_EVENT",r[r.BINARY_ACK=6]="BINARY_ACK"})(fe||(kr.PacketType=fe={}));var md=class{constructor(e){this.replacer=e}encode(e){return hd("encoding packet %j",e),(e.type===fe.EVENT||e.type===fe.ACK)&&(0,x_.hasBinary)(e)?this.encodeAsBinary({type:e.type===fe.EVENT?fe.BINARY_EVENT:fe.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===fe.BINARY_EVENT||e.type===fe.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),hd("encoded %j as %s",e,t),t}encodeAsBinary(e){let t=(0,y_.deconstructPacket)(e),n=this.encodeAsString(t.packet),i=t.buffers;return i.unshift(n),i}};kr.Encoder=md;var gd=class r extends QD.Emitter{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof e=="function"?{reviver:e}:e)}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);let n=t.type===fe.BINARY_EVENT;n||t.type===fe.BINARY_ACK?(t.type=n?fe.EVENT:fe.ACK,this.reconstructor=new vd(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if((0,x_.isBinary)(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0,n={type:Number(e.charAt(0))};if(fe[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===fe.BINARY_EVENT||n.type===fe.BINARY_ACK){let s=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);let o=e.substring(s,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");let a=Number(o);if(!b_(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 hd("decoded %s as %j",e,n),n}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case fe.CONNECT:return Gc(t);case fe.DISCONNECT:return t===void 0;case fe.CONNECT_ERROR:return typeof t=="string"||Gc(t);case fe.EVENT:case fe.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&__.indexOf(t[0])===-1);case fe.ACK:case fe.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}};kr.Decoder=gd;var vd=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,y_.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function tL(r){return typeof r=="string"}var b_=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r};function rL(r){return r===void 0||b_(r)}function Gc(r){return Object.prototype.toString.call(r)==="[object Object]"}function nL(r,e){switch(r){case fe.CONNECT:return e===void 0||Gc(e);case fe.DISCONNECT:return e===void 0;case fe.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&__.indexOf(e[0])===-1);case fe.ACK:return Array.isArray(e);case fe.CONNECT_ERROR:return typeof e=="string"||Gc(e);default:return!1}}function iL(r){return tL(r.nsp)&&rL(r.id)&&nL(r.type,r.data)}});var w_=k(cs=>{"use strict";var sL=cs&&cs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(cs,"__esModule",{value:!0});cs.Client=void 0;var zc=Do(),oL=sL(Re()),Rr=(0,oL.default)("socket.io:client"),yd=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?(Rr("no namespace joined yet, close the client"),this.close()):Rr("the client has already joined a namespace, nothing to do")},this.server._connectTimeout)}connect(e,t={}){if(this.server._nsps.has(e))return Rr("connecting to namespace %s",e),this.doConnect(e,t);this.server._checkNamespace(e,t,n=>{n?this.doConnect(e,t):(Rr("creation of namespace %s was denied",e),this._packet({type:zc.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 Rr("ignoring remove for %s",e.id)}close(){this.conn.readyState==="open"&&(Rr("forcing transport close"),this.conn.close(),this.onclose("forced server close"))}_packet(e,t={}){if(this.conn.readyState!=="open"){Rr("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){Rr("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){Rr("invalid packet format"),this.onerror(t)}}ondecoded(e){let{namespace:t,authPayload:n}=this._parseNamespace(e),i=this.nsps.get(t);!i&&e.type===zc.PacketType.CONNECT?this.connect(t,n):i&&e.type!==zc.PacketType.CONNECT&&e.type!==zc.PacketType.CONNECT_ERROR?process.nextTick(function(){i._onpacket(e)}):(Rr("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){Rr("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)}};cs.Client=yd});var Kc=k(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});Vc.StrictEventEmitter=void 0;var aL=require("events"),xd=class extends aL.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)}};Vc.StrictEventEmitter=xd});var _d=k(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});Yc.RESERVED_EVENTS=void 0;Yc.RESERVED_EVENTS=new Set(["connect","connect_error","disconnect","disconnecting","newListener","removeListener"])});var bd=k(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.RemoteSocket=ls.BroadcastOperator=void 0;var cL=_d(),lL=Do(),Xc=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(cL.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let n=[e,...t],i={type:lL.PacketType.EVENT,data:n};if(!(typeof n[n.length-1]=="function"))return this.adapter.broadcast(i,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags}),!0;let o=n.pop(),a=!1,c=[],l=setTimeout(()=>{a=!0,o.apply(this,[new Error("operation has timed out"),this.flags.expectSingleResponse?null:c])},this.flags.timeout),u=-1,f=0,d=0,g=()=>{!a&&u===f&&c.length===d&&(clearTimeout(l),o.apply(this,[null,this.flags.expectSingleResponse?c[0]:c]))};return this.adapter.broadcastWithAck(i,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags},y=>{d+=y,f++,g()},y=>{c.push(y),g()}),this.adapter.serverCount().then(y=>{u=y,g()}),!0}emitWithAck(e,...t){return new Promise((n,i)=>{t.push((s,o)=>s?(s.responses=o,i(s)):n(o)),this.emit(e,...t)})}allSockets(){if(!this.adapter)throw new Error("No adapter for this namespace, are you trying to get the list of clients of a dynamic namespace?");return this.adapter.sockets(this.rooms)}fetchSockets(){return this.adapter.fetchSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags}).then(e=>e.map(t=>t.server?t:new Jc(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)}};ls.BroadcastOperator=Xc;var Jc=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 Xc(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}};ls.RemoteSocket=Jc});var Sd=k(us=>{"use strict";var T_=us&&us.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(us,"__esModule",{value:!0});us.Socket=void 0;var pr=Do(),uL=T_(Re()),pL=Kc(),S_=T_(Zp()),fL=bd(),dL=_d(),Et=(0,uL.default)("socket.io:socket"),hL=new Set(["transport error","transport close","forced close","ping timeout","server shutting down","forced server close"]);function E_(){}var wd=class extends pL.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:pr.PacketType.EVENT,data:s})}),this.recovered=!0):(t.conn.protocol===3?this.id=e.name!=="/"?e.name+"#"+t.id:t.id:this.id=S_.default.generateId(),this.server._opts.connectionStateRecovery&&(this.pid=S_.default.generateId())),this.handshake=this.buildHandshake(n),this.on("error",E_)}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:pr.PacketType.EVENT,data:n};if(typeof n[n.length-1]=="function"){let o=this.nsp._ids++;Et("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(()=>{Et("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 Et("join room %s",e),this.adapter.addAll(this.id,new Set(Array.isArray(e)?e:[e]))}leave(e){return Et("leave room %s",e),this.adapter.del(this.id,e)}leaveAll(){this.adapter.delAll(this.id)}_onconnect(){Et("socket connected - writing packet"),this.connected=!0,this.join(this.id),this.conn.protocol===3?this.packet({type:pr.PacketType.CONNECT}):this.packet({type:pr.PacketType.CONNECT,data:{sid:this.id,pid:this.pid}})}_onpacket(e){switch(Et("got packet %j",e),e.type){case pr.PacketType.EVENT:this.onevent(e);break;case pr.PacketType.BINARY_EVENT:this.onevent(e);break;case pr.PacketType.ACK:this.onack(e);break;case pr.PacketType.BINARY_ACK:this.onack(e);break;case pr.PacketType.DISCONNECT:this.ondisconnect();break}}onevent(e){let t=e.data||[];if(Et("emitting event %j",t),e.id!=null&&(Et("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);Et("sending ack %j",i),t.packet({id:e,type:pr.PacketType.ACK,data:i}),n=!0}}onack(e){let t=this.acks.get(e.id);typeof t=="function"?(Et("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),this.acks.delete(e.id)):Et("bad ack %s",e.id)}ondisconnect(){Et("got disconnect packet"),this._onclose("client namespace disconnect")}_onerror(e){this.emitReserved("error",e)}_onclose(e,t){if(!this.connected)return this;Et("closing socket - reason %s",e),this.emitReserved("disconnecting",e,t),this.server._opts.connectionStateRecovery&&hL.has(e)&&(Et("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=E_}_error(e){this.packet({type:pr.PacketType.CONNECT_ERROR,data:e})}disconnect(e=!1){return this.connected?(e?this.client._disconnect():(this.packet({type:pr.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){Et("dispatching an event %j",e),this.run(e,t=>{process.nextTick(()=>{if(t)return this._onerror(t);this.connected?super.emitUntyped.apply(this,e):Et("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 fL.BroadcastOperator(this.adapter,new Set,new Set([this.id]),e)}};us.Socket=wd});var Td=k(pn=>{"use strict";var mL=pn&&pn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(pn,"__esModule",{value:!0});pn.Namespace=pn.RESERVED_EVENTS=void 0;var C_=Sd(),gL=Kc(),vL=mL(Re()),Zt=bd(),ps=(0,vL.default)("socket.io:namespace");pn.RESERVED_EVENTS=new Set(["connect","connection","new_namespace"]);var Ed=class extends gL.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=>{ps("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 Zt.BroadcastOperator(this.adapter).to(e)}in(e){return new Zt.BroadcastOperator(this.adapter).in(e)}except(e){return new Zt.BroadcastOperator(this.adapter).except(e)}async _add(e,t,n){var i;ps("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"){ps("next called after client was closed - ignoring socket"),s._cleanup();return}if(o)return ps("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){ps("error while restoring session: %s",o)}if(s)return ps("connection state recovered for sid %s",s.sid),new C_.Socket(this,e,t,s)}return new C_.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 Zt.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(pn.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 Zt.BroadcastOperator(this.adapter).allSockets()}compress(e){return new Zt.BroadcastOperator(this.adapter).compress(e)}get volatile(){return new Zt.BroadcastOperator(this.adapter).volatile}get local(){return new Zt.BroadcastOperator(this.adapter).local}timeout(e){return new Zt.BroadcastOperator(this.adapter).timeout(e)}fetchSockets(){return new Zt.BroadcastOperator(this.adapter).fetchSockets()}socketsJoin(e){return new Zt.BroadcastOperator(this.adapter).socketsJoin(e)}socketsLeave(e){return new Zt.BroadcastOperator(this.adapter).socketsLeave(e)}disconnectSockets(e=!1){return new Zt.BroadcastOperator(this.adapter).disconnectSockets(e)}};pn.Namespace=Ed});var M_=k(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});Lo.encode=Cd;Lo.decode=yL;Lo.yeast=xL;var R_="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Zc=64,O_={},A_=0,Un=0,k_;function Cd(r){let e="";do e=R_[r%Zc]+e,r=Math.floor(r/Zc);while(r>0);return e}function yL(r){let e=0;for(Un=0;Un<r.length;Un++)e=e*Zc+O_[r.charAt(Un)];return e}function xL(){let r=Cd(+new Date);return r!==k_?(A_=0,k_=r):r+"."+Cd(A_++)}for(;Un<Zc;Un++)O_[R_[Un]]=Un});var fn=k((RW,N_)=>{"use strict";var P_=["nodebuffer","arraybuffer","fragments"],I_=typeof Blob<"u";I_&&P_.push("blob");N_.exports={BINARY_TYPES:P_,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:I_,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Bo=k((OW,Qc)=>{"use strict";var{EMPTY_BUFFER:_L}=fn(),Ad=Buffer[Symbol.species];function bL(r,e){if(r.length===0)return _L;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 Ad(t.buffer,t.byteOffset,n):t}function D_(r,e,t,n,i){for(let s=0;s<i;s++)t[n+s]=r[s]^e[s&3]}function L_(r,e){for(let t=0;t<r.length;t++)r[t]^=e[t&3]}function wL(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function kd(r){if(kd.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new Ad(r):ArrayBuffer.isView(r)?e=new Ad(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),kd.readOnly=!1),e}Qc.exports={concat:bL,mask:D_,toArrayBuffer:wL,toBuffer:kd,unmask:L_};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=Pf();Qc.exports.mask=function(e,t,n,i,s){s<48?D_(e,t,n,i,s):r.mask(e,t,n,i,s)},Qc.exports.unmask=function(e,t){e.length<32?L_(e,t):r.unmask(e,t)}}catch{}});var F_=k((MW,j_)=>{"use strict";var B_=Symbol("kDone"),Rd=Symbol("kRun"),Od=class{constructor(e){this[B_]=()=>{this.pending--,this[Rd]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[Rd]()}[Rd](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[B_])}}};j_.exports=Od});var Fo=k((PW,H_)=>{"use strict";var jo=require("zlib"),U_=Bo(),SL=F_(),{kStatusCode:q_}=fn(),EL=Buffer[Symbol.species],TL=Buffer.from([0,0,255,255]),tl=Symbol("permessage-deflate"),dn=Symbol("total-length"),fs=Symbol("callback"),qn=Symbol("buffers"),ds=Symbol("error"),el,Md=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,!el){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;el=new SL(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[fs];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){el.add(i=>{this._decompress(e,t,(s,o)=>{i(),n(s,o)})})}compress(e,t,n){el.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"?jo.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=jo.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[tl]=this,this._inflate[dn]=0,this._inflate[qn]=[],this._inflate.on("error",AL),this._inflate.on("data",$_)}this._inflate[fs]=n,this._inflate.write(e),t&&this._inflate.write(TL),this._inflate.flush(()=>{let s=this._inflate[ds];if(s){this._inflate.close(),this._inflate=null,n(s);return}let o=U_.concat(this._inflate[qn],this._inflate[dn]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[dn]=0,this._inflate[qn]=[],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"?jo.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=jo.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[dn]=0,this._deflate[qn]=[],this._deflate.on("data",CL)}this._deflate[fs]=n,this._deflate.write(e),this._deflate.flush(jo.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=U_.concat(this._deflate[qn],this._deflate[dn]);t&&(s=new EL(s.buffer,s.byteOffset,s.length-4)),this._deflate[fs]=null,this._deflate[dn]=0,this._deflate[qn]=[],t&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,s)})}};H_.exports=Md;function CL(r){this[qn].push(r),this[dn]+=r.length}function $_(r){if(this[dn]+=r.length,this[tl]._maxPayload<1||this[dn]<=this[tl]._maxPayload){this[qn].push(r);return}this[ds]=new RangeError("Max payload size exceeded"),this[ds].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[ds][q_]=1009,this.removeListener("data",$_),this.reset()}function AL(r){if(this[tl]._inflate=null,this[ds]){this[fs](this[ds]);return}r[q_]=1007,this[fs](r)}});var hs=k((IW,rl)=>{"use strict";var{isUtf8:W_}=require("buffer"),{hasBlob:kL}=fn(),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 OL(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function Pd(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 ML(r){return kL&&typeof r=="object"&&typeof r.arrayBuffer=="function"&&typeof r.type=="string"&&typeof r.stream=="function"&&(r[Symbol.toStringTag]==="Blob"||r[Symbol.toStringTag]==="File")}rl.exports={isBlob:ML,isValidStatusCode:OL,isValidUTF8:Pd,tokenChars:RL};if(W_)rl.exports.isValidUTF8=function(r){return r.length<24?Pd(r):W_(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=Ff();rl.exports.isValidUTF8=function(e){return e.length<32?Pd(e):r(e)}}catch{}});var Bd=k((NW,J_)=>{"use strict";var{Writable:PL}=require("stream"),G_=Fo(),{BINARY_TYPES:IL,EMPTY_BUFFER:z_,kStatusCode:NL,kWebSocket:DL}=fn(),{concat:Id,toArrayBuffer:LL,unmask:BL}=Bo(),{isValidStatusCode:jL,isValidUTF8:V_}=hs(),nl=Buffer[Symbol.species],fr=0,K_=1,Y_=2,X_=3,Nd=4,Dd=5,il=6,Ld=class extends PL{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||IL[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[DL]=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=fr}_write(e,t,n){if(this._opcode===8&&this._state==fr)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 nl(n.buffer,n.byteOffset+e,n.length-e),new nl(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 nl(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 fr:this.getInfo(e);break;case K_:this.getPayloadLength16(e);break;case Y_:this.getPayloadLength64(e);break;case X_:this.getMask();break;case Nd:this.getData(e);break;case Dd:case il: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[G_.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=K_:this._payloadLength===127?this._state=Y_: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=X_:this._state=Nd}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Nd}getData(e){let t=z_;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&&BL(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[G_.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===fr&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=fr;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=Id(n,t):this._binaryType==="arraybuffer"?i=LL(Id(n,t)):this._binaryType==="blob"?i=new Blob(n):i=n,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=fr):(this._state=il,setImmediate(()=>{this.emit("message",i,!0),this._state=fr,this.startLoop(e)}))}else{let i=Id(n,t);if(!this._skipUTF8Validation&&!V_(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=fr):(this._state=il,setImmediate(()=>{this.emit("message",i,!1),this._state=fr,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,z_),this.end();else{let n=e.readUInt16BE(0);if(!jL(n)){let s=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(s);return}let i=new nl(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!V_(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=fr;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=fr):(this._state=il,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=fr,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[NL]=i,o}};J_.exports=Ld});var Ud=k((LW,eb)=>{"use strict";var{Duplex:DW}=require("stream"),{randomFillSync:FL}=require("crypto"),Z_=Fo(),{EMPTY_BUFFER:UL,kWebSocket:qL,NOOP:$L}=fn(),{isBlob:ms,isValidStatusCode:HL}=hs(),{mask:Q_,toBuffer:pi}=Bo(),dr=Symbol("kByteLength"),WL=Buffer.alloc(4),sl=8*1024,fi,gs=sl,Or=0,GL=1,zL=2,jd=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=Or,this.onerror=$L,this[qL]=void 0}static frame(e,t){let n,i=!1,s=2,o=!1;t.mask&&(n=t.maskBuffer||WL,t.generateMask?t.generateMask(n):(gs===sl&&(fi===void 0&&(fi=Buffer.alloc(sl)),FL(fi,0,sl),gs=0),n[0]=fi[gs++],n[1]=fi[gs++],n[2]=fi[gs++],n[3]=fi[gs++]),o=(n[0]|n[1]|n[2]|n[3])===0,s=6);let a;typeof e=="string"?(!t.mask||o)&&t[dr]!==void 0?a=t[dr]:(e=Buffer.from(e),a=e.length):(a=e.length,i=t.mask&&t.readOnly&&!o);let c=a;a>=65536?(s+=8,c=127):a>125&&(s+=2,c=126);let l=Buffer.allocUnsafe(i?a+s:s);return l[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(l[0]|=64),l[1]=c,c===126?l.writeUInt16BE(a,2):c===127&&(l[2]=l[3]=0,l.writeUIntBE(a,4,6)),t.mask?(l[1]|=128,l[s-4]=n[0],l[s-3]=n[1],l[s-2]=n[2],l[s-1]=n[3],o?[l,e]:i?(Q_(e,n,l,s,a),[l]):(Q_(e,n,e,0,a),[l,e])):[l,e]}close(e,t,n,i){let s;if(e===void 0)s=UL;else{if(typeof e!="number"||!HL(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={[dr]:s.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Or?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):ms(e)?(i=e.size,s=!1):(e=pi(e),i=e.length,s=pi.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[dr]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};ms(e)?this._state!==Or?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Or?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):ms(e)?(i=e.size,s=!1):(e=pi(e),i=e.length,s=pi.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[dr]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};ms(e)?this._state!==Or?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Or?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}send(e,t,n){let i=this._extensions[Z_.extensionName],s=t.binary?2:1,o=t.compress,a,c;typeof e=="string"?(a=Buffer.byteLength(e),c=!1):ms(e)?(a=e.size,c=!1):(e=pi(e),a=e.length,c=pi.readOnly),this._firstFragment?(this._firstFragment=!1,o&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=a>=i._threshold),this._compress=o):(o=!1,s=0),t.fin&&(this._firstFragment=!0);let l={[dr]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:c,rsv1:o};ms(e)?this._state!==Or?this.enqueue([this.getBlobData,e,this._compress,l,n]):this.getBlobData(e,this._compress,l,n):this._state!==Or?this.enqueue([this.dispatch,e,this._compress,l,n]):this.dispatch(e,this._compress,l,n)}getBlobData(e,t,n,i){this._bufferedBytes+=n[dr],this._state=zL,e.arrayBuffer().then(s=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(Fd,this,a,i);return}this._bufferedBytes-=n[dr];let o=pi(s);t?this.dispatch(o,t,n,i):(this._state=Or,this.sendFrame(r.frame(o,n),i),this.dequeue())}).catch(s=>{process.nextTick(VL,this,s,i)})}dispatch(e,t,n,i){if(!t){this.sendFrame(r.frame(e,n),i);return}let s=this._extensions[Z_.extensionName];this._bufferedBytes+=n[dr],this._state=GL,s.compress(e,n.fin,(o,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");Fd(this,c,i);return}this._bufferedBytes-=n[dr],this._state=Or,n.readOnly=!1,this.sendFrame(r.frame(a,n),i),this.dequeue()})}dequeue(){for(;this._state===Or&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][dr],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][dr],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)}};eb.exports=jd;function Fd(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 VL(r,e,t){Fd(r,e,t),r.onerror(e)}});var lb=k((BW,cb)=>{"use strict";var{kForOnEventAttribute:Uo,kListener:qd}=fn(),tb=Symbol("kCode"),rb=Symbol("kData"),nb=Symbol("kError"),ib=Symbol("kMessage"),sb=Symbol("kReason"),vs=Symbol("kTarget"),ob=Symbol("kType"),ab=Symbol("kWasClean"),hn=class{constructor(e){this[vs]=null,this[ob]=e}get target(){return this[vs]}get type(){return this[ob]}};Object.defineProperty(hn.prototype,"target",{enumerable:!0});Object.defineProperty(hn.prototype,"type",{enumerable:!0});var di=class extends hn{constructor(e,t={}){super(e),this[tb]=t.code===void 0?0:t.code,this[sb]=t.reason===void 0?"":t.reason,this[ab]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[tb]}get reason(){return this[sb]}get wasClean(){return this[ab]}};Object.defineProperty(di.prototype,"code",{enumerable:!0});Object.defineProperty(di.prototype,"reason",{enumerable:!0});Object.defineProperty(di.prototype,"wasClean",{enumerable:!0});var ys=class extends hn{constructor(e,t={}){super(e),this[nb]=t.error===void 0?null:t.error,this[ib]=t.message===void 0?"":t.message}get error(){return this[nb]}get message(){return this[ib]}};Object.defineProperty(ys.prototype,"error",{enumerable:!0});Object.defineProperty(ys.prototype,"message",{enumerable:!0});var qo=class extends hn{constructor(e,t={}){super(e),this[rb]=t.data===void 0?null:t.data}get data(){return this[rb]}};Object.defineProperty(qo.prototype,"data",{enumerable:!0});var KL={addEventListener(r,e,t={}){for(let i of this.listeners(r))if(!t[Uo]&&i[qd]===e&&!i[Uo])return;let n;if(r==="message")n=function(s,o){let a=new qo("message",{data:o?s:s.toString()});a[vs]=this,ol(e,this,a)};else if(r==="close")n=function(s,o){let a=new di("close",{code:s,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[vs]=this,ol(e,this,a)};else if(r==="error")n=function(s){let o=new ys("error",{error:s,message:s.message});o[vs]=this,ol(e,this,o)};else if(r==="open")n=function(){let s=new hn("open");s[vs]=this,ol(e,this,s)};else return;n[Uo]=!!t[Uo],n[qd]=e,t.once?this.once(r,n):this.on(r,n)},removeEventListener(r,e){for(let t of this.listeners(r))if(t[qd]===e&&!t[Uo]){this.removeListener(r,t);break}}};cb.exports={CloseEvent:di,ErrorEvent:ys,Event:hn,EventTarget:KL,MessageEvent:qo};function ol(r,e,t){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,t):r.call(e,t)}});var $d=k((jW,ub)=>{"use strict";var{tokenChars:$o}=hs();function Hr(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}function YL(r){let e=Object.create(null),t=Object.create(null),n=!1,i=!1,s=!1,o,a,c=-1,l=-1,u=-1,f=0;for(;f<r.length;f++)if(l=r.charCodeAt(f),o===void 0)if(u===-1&&$o[l]===1)c===-1&&(c=f);else if(f!==0&&(l===32||l===9))u===-1&&c!==-1&&(u=f);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);u===-1&&(u=f);let g=r.slice(c,u);l===44?(Hr(e,g,t),t=Object.create(null)):o=g,c=u=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);else if(a===void 0)if(u===-1&&$o[l]===1)c===-1&&(c=f);else if(l===32||l===9)u===-1&&c!==-1&&(u=f);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);u===-1&&(u=f),Hr(t,r.slice(c,u),!0),l===44&&(Hr(e,o,t),t=Object.create(null),o=void 0),c=u=-1}else if(l===61&&c!==-1&&u===-1)a=r.slice(c,f),c=u=-1;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(i){if($o[l]!==1)throw new SyntaxError(`Unexpected character at index ${f}`);c===-1?c=f:n||(n=!0),i=!1}else if(s)if($o[l]===1)c===-1&&(c=f);else if(l===34&&c!==-1)s=!1,u=f;else if(l===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(l===34&&r.charCodeAt(f-1)===61)s=!0;else if(u===-1&&$o[l]===1)c===-1&&(c=f);else if(c!==-1&&(l===32||l===9))u===-1&&(u=f);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);u===-1&&(u=f);let g=r.slice(c,u);n&&(g=g.replace(/\\/g,""),n=!1),Hr(t,a,g),l===44&&(Hr(e,o,t),t=Object.create(null),o=void 0),a=void 0,c=u=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);if(c===-1||s||l===32||l===9)throw new SyntaxError("Unexpected end of input");u===-1&&(u=f);let d=r.slice(c,u);return o===void 0?Hr(e,d,t):(a===void 0?Hr(t,d,!0):n?Hr(t,a,d.replace(/\\/g,"")):Hr(t,a,d),Hr(e,o,t)),e}function XL(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(", ")}ub.exports={format:XL,parse:YL}});var ul=k((qW,wb)=>{"use strict";var JL=require("events"),ZL=require("https"),QL=require("http"),db=require("net"),e2=require("tls"),{randomBytes:t2,createHash:r2}=require("crypto"),{Duplex:FW,Readable:UW}=require("stream"),{URL:Hd}=require("url"),$n=Fo(),n2=Bd(),i2=Ud(),{isBlob:s2}=hs(),{BINARY_TYPES:pb,EMPTY_BUFFER:al,GUID:o2,kForOnEventAttribute:Wd,kListener:a2,kStatusCode:c2,kWebSocket:xt,NOOP:hb}=fn(),{EventTarget:{addEventListener:l2,removeEventListener:u2}}=lb(),{format:p2,parse:f2}=$d(),{toBuffer:d2}=Bo(),h2=30*1e3,mb=Symbol("kAborted"),Gd=[8,13],mn=["CONNECTING","OPEN","CLOSING","CLOSED"],m2=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Se=class r extends JL{constructor(e,t,n){super(),this._binaryType=pb[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=al,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]),gb(this,e,t,n)):(this._autoPong=n.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){pb.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 n2({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),s=new i2(e,this._extensions,n.generateMask);this._receiver=i,this._sender=s,this._socket=e,i[xt]=this,s[xt]=this,e[xt]=this,i.on("conclude",y2),i.on("drain",x2),i.on("error",_2),i.on("message",b2),i.on("ping",w2),i.on("pong",S2),s.onerror=E2,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",xb),e.on("data",ll),e.on("end",_b),e.on("error",bb),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[$n.extensionName]&&this._extensions[$n.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){Qt(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())}),yb(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){zd(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||al,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){zd(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||al,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){zd(this,e,n);return}let i={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[$n.extensionName]||(i.compress=!1),this._sender.send(e||al,i,n)}terminate(){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){Qt(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=r.CLOSING,this._socket.destroy())}}};Object.defineProperty(Se,"CONNECTING",{enumerable:!0,value:mn.indexOf("CONNECTING")});Object.defineProperty(Se.prototype,"CONNECTING",{enumerable:!0,value:mn.indexOf("CONNECTING")});Object.defineProperty(Se,"OPEN",{enumerable:!0,value:mn.indexOf("OPEN")});Object.defineProperty(Se.prototype,"OPEN",{enumerable:!0,value:mn.indexOf("OPEN")});Object.defineProperty(Se,"CLOSING",{enumerable:!0,value:mn.indexOf("CLOSING")});Object.defineProperty(Se.prototype,"CLOSING",{enumerable:!0,value:mn.indexOf("CLOSING")});Object.defineProperty(Se,"CLOSED",{enumerable:!0,value:mn.indexOf("CLOSED")});Object.defineProperty(Se.prototype,"CLOSED",{enumerable:!0,value:mn.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(Se.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(Se.prototype,`on${r}`,{enumerable:!0,get(){for(let e of this.listeners(r))if(e[Wd])return e[a2];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})}})});Se.prototype.addEventListener=l2;Se.prototype.removeEventListener=u2;wb.exports=Se;function gb(r,e,t,n){let i={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:Gd[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,!Gd.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${Gd.join(", ")})`);let s;if(e instanceof Hd)s=e;else try{s=new Hd(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 b=new SyntaxError(c);if(r._redirects===0)throw b;cl(r,b);return}let l=o?443:80,u=t2(16).toString("base64"),f=o?ZL.request:QL.request,d=new Set,g;if(i.createConnection=i.createConnection||(o?v2:g2),i.defaultPort=i.defaultPort||l,i.port=s.port||l,i.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":u,Connection:"Upgrade",Upgrade:"websocket"},i.path=s.pathname+s.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(g=new $n(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=p2({[$n.extensionName]:g.offer()})),t.length){for(let b of t){if(typeof b!="string"||!m2.test(b)||d.has(b))throw new SyntaxError("An invalid or duplicated subprotocol was specified");d.add(b)}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 b=i.path.split(":");i.socketPath=b[0],i.path=b[1]}let y;if(i.followRedirects){if(r._redirects===0){r._originalIpc=a,r._originalSecure=o,r._originalHostOrSocketPath=a?i.socketPath:s.host;let b=n&&n.headers;if(n={...n,headers:{}},b)for(let[C,R]of Object.entries(b))n.headers[C.toLowerCase()]=R}else if(r.listenerCount("redirect")===0){let b=a?r._originalIpc?i.socketPath===r._originalHostOrSocketPath:!1:r._originalIpc?!1:s.host===r._originalHostOrSocketPath;(!b||r._originalSecure&&!o)&&(delete i.headers.authorization,delete i.headers.cookie,b||delete i.headers.host,i.auth=void 0)}i.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),y=r._req=f(i),r._redirects&&r.emit("redirect",r.url,y)}else y=r._req=f(i);i.timeout&&y.on("timeout",()=>{Qt(r,y,"Opening handshake has timed out")}),y.on("error",b=>{y===null||y[mb]||(y=r._req=null,cl(r,b))}),y.on("response",b=>{let C=b.headers.location,R=b.statusCode;if(C&&i.followRedirects&&R>=300&&R<400){if(++r._redirects>i.maxRedirects){Qt(r,y,"Maximum redirects exceeded");return}y.abort();let M;try{M=new Hd(C,e)}catch{let B=new SyntaxError(`Invalid URL: ${C}`);cl(r,B);return}gb(r,M,t,n)}else r.emit("unexpected-response",y,b)||Qt(r,y,`Unexpected server response: ${b.statusCode}`)}),y.on("upgrade",(b,C,R)=>{if(r.emit("upgrade",b),r.readyState!==Se.CONNECTING)return;y=r._req=null;let M=b.headers.upgrade;if(M===void 0||M.toLowerCase()!=="websocket"){Qt(r,C,"Invalid Upgrade header");return}let P=r2("sha1").update(u+o2).digest("base64");if(b.headers["sec-websocket-accept"]!==P){Qt(r,C,"Invalid Sec-WebSocket-Accept header");return}let B=b.headers["sec-websocket-protocol"],G;if(B!==void 0?d.size?d.has(B)||(G="Server sent an invalid subprotocol"):G="Server sent a subprotocol but none was requested":d.size&&(G="Server sent no subprotocol"),G){Qt(r,C,G);return}B&&(r._protocol=B);let F=b.headers["sec-websocket-extensions"];if(F!==void 0){if(!g){Qt(r,C,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let V;try{V=f2(F)}catch{Qt(r,C,"Invalid Sec-WebSocket-Extensions header");return}let D=Object.keys(V);if(D.length!==1||D[0]!==$n.extensionName){Qt(r,C,"Server indicated an extension that was not requested");return}try{g.accept(V[$n.extensionName])}catch{Qt(r,C,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[$n.extensionName]=g}r.setSocket(C,R,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(y,r):y.end()}function cl(r,e){r._readyState=Se.CLOSING,r._errorEmitted=!0,r.emit("error",e),r.emitClose()}function g2(r){return r.path=r.socketPath,db.connect(r)}function v2(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=db.isIP(r.host)?"":r.host),e2.connect(r)}function Qt(r,e,t){r._readyState=Se.CLOSING;let n=new Error(t);Error.captureStackTrace(n,Qt),e.setHeader?(e[mb]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(cl,r,n)):(e.destroy(n),e.once("error",r.emit.bind(r,"error")),e.once("close",r.emitClose.bind(r)))}function zd(r,e,t){if(e){let n=s2(e)?e.size:d2(e).length;r._socket?r._sender._bufferedBytes+=n:r._bufferedAmount+=n}if(t){let n=new Error(`WebSocket is not open: readyState ${r.readyState} (${mn[r.readyState]})`);process.nextTick(t,n)}}function y2(r,e){let t=this[xt];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=r,t._socket[xt]!==void 0&&(t._socket.removeListener("data",ll),process.nextTick(vb,t._socket),r===1005?t.close():t.close(r,e))}function x2(){let r=this[xt];r.isPaused||r._socket.resume()}function _2(r){let e=this[xt];e._socket[xt]!==void 0&&(e._socket.removeListener("data",ll),process.nextTick(vb,e._socket),e.close(r[c2])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r))}function fb(){this[xt].emitClose()}function b2(r,e){this[xt].emit("message",r,e)}function w2(r){let e=this[xt];e._autoPong&&e.pong(r,!this._isServer,hb),e.emit("ping",r)}function S2(r){this[xt].emit("pong",r)}function vb(r){r.resume()}function E2(r){let e=this[xt];e.readyState!==Se.CLOSED&&(e.readyState===Se.OPEN&&(e._readyState=Se.CLOSING,yb(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r)))}function yb(r){r._closeTimer=setTimeout(r._socket.destroy.bind(r._socket),h2)}function xb(){let r=this[xt];this.removeListener("close",xb),this.removeListener("data",ll),this.removeListener("end",_b),r._readyState=Se.CLOSING;let e;!this._readableState.endEmitted&&!r._closeFrameReceived&&!r._receiver._writableState.errorEmitted&&(e=r._socket.read())!==null&&r._receiver.write(e),r._receiver.end(),this[xt]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",fb),r._receiver.on("finish",fb))}function ll(r){this[xt]._receiver.write(r)||this.pause()}function _b(){let r=this[xt];r._readyState=Se.CLOSING,r._receiver.end(),this.end()}function bb(){let r=this[xt];this.removeListener("error",bb),this.on("error",hb),r&&(r._readyState=Se.CLOSING,this.destroy())}});var Cb=k((HW,Tb)=>{"use strict";var $W=ul(),{Duplex:T2}=require("stream");function Sb(r){r.emit("close")}function C2(){!this.destroyed&&this._writableState.finished&&this.destroy()}function Eb(r){this.removeListener("error",Eb),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function A2(r,e){let t=!0,n=new T2({...e,autoDestroy:!1,emitClose:!1,objectMode:!1,writableObjectMode:!1});return r.on("message",function(s,o){let a=!o&&n._readableState.objectMode?s.toString():s;n.push(a)||r.pause()}),r.once("error",function(s){n.destroyed||(t=!1,n.destroy(s))}),r.once("close",function(){n.destroyed||n.push(null)}),n._destroy=function(i,s){if(r.readyState===r.CLOSED){s(i),process.nextTick(Sb,n);return}let o=!1;r.once("error",function(c){o=!0,s(c)}),r.once("close",function(){o||s(i),process.nextTick(Sb,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",C2),n.on("error",Eb),n}Tb.exports=A2});var kb=k((WW,Ab)=>{"use strict";var{tokenChars:k2}=hs();function R2(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&&k2[o]===1)t===-1&&(t=i);else if(i!==0&&(o===32||o===9))n===-1&&t!==-1&&(n=i);else if(o===44){if(t===-1)throw new SyntaxError(`Unexpected character at index ${i}`);n===-1&&(n=i);let a=r.slice(t,n);if(e.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);e.add(a),t=n=-1}else throw new SyntaxError(`Unexpected character at index ${i}`)}if(t===-1||n!==-1)throw new SyntaxError("Unexpected end of input");let s=r.slice(t,i);if(e.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);return e.add(s),e}Ab.exports={parse:R2}});var Db=k((zW,Nb)=>{"use strict";var O2=require("events"),pl=require("http"),{Duplex:GW}=require("stream"),{createHash:M2}=require("crypto"),Rb=$d(),hi=Fo(),P2=kb(),I2=ul(),{GUID:N2,kWebSocket:D2}=fn(),L2=/^[+/0-9A-Za-z]{22}==$/,Ob=0,Mb=1,Ib=2,Vd=class extends O2{constructor(e,t){if(super(),e={allowSynchronousEvents:!0,autoPong:!0,maxPayload:100*1024*1024,skipUTF8Validation:!1,perMessageDeflate:!1,handleProtocols:null,clientTracking:!0,verifyClient:null,noServer:!1,backlog:null,server:null,host:null,path:null,port:null,WebSocket:I2,...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=pl.createServer((n,i)=>{let s=pl.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=B2(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=Ob}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===Ib){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(Ho,this);return}if(e&&this.once("close",e),this._state!==Mb)if(this._state=Mb,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(Ho,this):process.nextTick(Ho,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{Ho(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",Pb);let s=e.headers["sec-websocket-key"],o=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){mi(this,e,t,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){mi(this,e,t,400,"Invalid Upgrade header");return}if(s===void 0||!L2.test(s)){mi(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){mi(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){Wo(t,400);return}let c=e.headers["sec-websocket-protocol"],l=new Set;if(c!==void 0)try{l=P2.parse(c)}catch{mi(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let u=e.headers["sec-websocket-extensions"],f={};if(this.options.perMessageDeflate&&u!==void 0){let d=new hi(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let g=Rb.parse(u);g[hi.extensionName]&&(d.accept(g[hi.extensionName]),f[hi.extensionName]=d)}catch{mi(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let d={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(d,(g,y,b,C)=>{if(!g)return Wo(t,y||401,b,C);this.completeUpgrade(f,s,l,e,t,n,i)});return}if(!this.options.verifyClient(d))return Wo(t,401)}this.completeUpgrade(f,s,l,e,t,n,i)}completeUpgrade(e,t,n,i,s,o,a){if(!s.readable||!s.writable)return s.destroy();if(s[D2])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Ob)return Wo(s,503);let l=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${M2("sha1").update(t+N2).digest("base64")}`],u=new this.options.WebSocket(null,void 0,this.options);if(n.size){let f=this.options.handleProtocols?this.options.handleProtocols(n,i):n.values().next().value;f&&(l.push(`Sec-WebSocket-Protocol: ${f}`),u._protocol=f)}if(e[hi.extensionName]){let f=e[hi.extensionName].params,d=Rb.format({[hi.extensionName]:[f]});l.push(`Sec-WebSocket-Extensions: ${d}`),u._extensions=e}this.emit("headers",l,i),s.write(l.concat(`\r
|
|
23
|
+
`+n)}r.destroy()}var No=[0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1];function ID(r){if(r+="",r.length<1)return!1;if(!No[r.charCodeAt(0)])return te('invalid header, index 0, char "%s"',r.charCodeAt(0)),!0;if(r.length<2)return!1;if(!No[r.charCodeAt(1)])return te('invalid header, index 1, char "%s"',r.charCodeAt(1)),!0;if(r.length<3)return!1;if(!No[r.charCodeAt(2)])return te('invalid header, index 2, char "%s"',r.charCodeAt(2)),!0;if(r.length<4)return!1;if(!No[r.charCodeAt(3)])return te('invalid header, index 3, char "%s"',r.charCodeAt(3)),!0;for(let e=4;e<r.length;++e)if(!No[r.charCodeAt(e)])return te('invalid header, index "%i", char "%s"',e,r.charCodeAt(e)),!0;return!1}});var a_=A(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});Fc.Polling=void 0;var ND=ii(),o_=require("zlib"),DD=oc(),LD=Oe(),ur=(0,LD.default)("engine:polling"),BD={gzip:o_.createGzip,deflate:o_.createDeflate},od=class extends ND.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){ur("request overlap"),this.onError("overlap from client"),t.writeStatus("500 Internal Server Error"),t.end();return}ur("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&&(ur("triggering empty send to append close packet"),this.send([{type:"noop"}]))}onDataRequest(e,t){if(this.dataReq){this.onError("data request overlap from client"),t.writeStatus("500 Internal Server Error"),t.end();return}let n=Number(e.headers["content-length"]);if(!n){this.onError("content-length header required"),t.writeStatus("411 Length Required").end();return}if(n>this.maxHttpBufferSize){this.onError("payload too large"),t.writeStatus("413 Payload Too Large").end();return}if(e.headers["content-type"]==="application/octet-stream"&&this.protocol===4)return this.onError("invalid content");this.dataReq=e,this.dataRes=t;let s,o=0,a={"Content-Type":"text/html"};this.headers(e,a);for(let l in a)t.writeHeader(l,String(a[l]));let c=l=>{this.onData(l.toString()),this.onDataRequestCleanup(),t.cork(()=>{t.end("ok")})};t.onAborted(()=>{this.onDataRequestCleanup(),this.onError("data request connection closed prematurely")}),t.onData((l,u)=>{let f=o+l.byteLength;if(f>n){this.onError("content-length mismatch"),t.close();return}if(!s){if(u){c(Buffer.from(l));return}s=Buffer.allocUnsafe(n)}if(Buffer.from(l).copy(s,o),u){if(f!=n){this.onError("content-length mismatch"),t.writeStatus("400 Content-Length Mismatch").end(),this.onDataRequestCleanup();return}c(s);return}o=f})}onDataRequestCleanup(){this.dataReq=this.dataRes=null}onData(e){ur('received "%s"',e);let t=n=>{if(n.type==="close")return ur("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&&(ur("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){ur('writing "%s"',e),this.doWrite(e,t,()=>{this.req.cleanup(),this.emit("drain")})}doWrite(e,t,n){let i=typeof e=="string",o={"Content-Type":i?"text/plain; charset=UTF-8":"application/octet-stream"},a=u=>{this.headers(this.req,o),this.res.cork(()=>{Object.keys(o).forEach(f=>{this.res.writeHeader(f,String(o[f]))}),this.res.end(u)}),n()};if(!this.httpCompression||!t.compress){a(e);return}if((i?Buffer.byteLength(e):e.length)<this.httpCompression.threshold){a(e);return}let l=DD(this.req).encodings(["gzip","deflate"]);if(!l){a(e);return}this.compress(e,l,(u,f)=>{if(u){this.res.writeStatus("500 Internal Server Error"),this.res.end(),n(u);return}o["Content-Encoding"]=l,a(f)})}compress(e,t,n){ur("compressing");let i=[],s=0;BD[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){ur("closing");let t,n=()=>{clearTimeout(t),e(),this.onClose()};this.writable?(ur("transport writable - closing right away"),this.send([{type:"close"}]),n()):this.discarded?(ur("transport discarded - closing right away"),n()):(ur("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}};Fc.Polling=od});var l_=A(Uc=>{"use strict";Object.defineProperty(Uc,"__esModule",{value:!0});Uc.WebSocket=void 0;var jD=ii(),FD=Oe(),c_=(0,FD.default)("engine:ws"),ad=class extends jD.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;c_('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){c_("closing"),e&&e(),this.socket.end()}};Uc.WebSocket=ad});var u_=A(cd=>{"use strict";Object.defineProperty(cd,"__esModule",{value:!0});var UD=a_(),qD=l_();cd.default={polling:UD.Polling,websocket:qD.WebSocket}});var p_=A(qc=>{"use strict";Object.defineProperty(qc,"__esModule",{value:!0});qc.uServer=void 0;var $D=Oe(),ui=sd(),HD=u_(),qn=(0,$D.default)("engine:uws"),ld=class extends ui.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(()=>{qn("response has been aborted")})}createTransport(e,t){return new HD.default[e](t)}attach(e,t={}){let n=this._computePath(t);e.any(n,this.handleRequest.bind(this)).ws(n,{compression:t.compression,idleTimeout:t.idleTimeout,maxBackpressure:t.maxBackpressure,maxPayloadLength:this.opts.maxHttpBufferSize,upgrade:this.handleUpgrade.bind(this),open:i=>{let s=i.getUserData().transport;s.socket=i,s.writable=!0,s.emit("ready")},message:(i,s,o)=>{i.getUserData().transport.onData(o?s:Buffer.from(s).toString())},close:(i,s,o)=>{i.getUserData().transport.onClose(s,o)}})}_applyMiddlewares(e,t,n){if(this.middlewares.length===0)return n();e.res=new ud(t),super._applyMiddlewares(e,e.res,i=>{e.res.writeHead(),n(i)})}handleRequest(e,t){qn('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:ui.Server.errorMessages[i],context:s}),this.abortRequest(t.res,i,s);return}if(t._query.sid)qn("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(ui.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!1,n)})}handleUpgrade(e,t,n){qn("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:ui.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 qn("transport has already been trying to upgrade"),e.close();if(f.upgraded)return qn("transport had already been upgraded"),e.close();qn("upgrading existing transport"),c=this.createTransport(t._query.transport,t),f._maybeUpgrade(c)}else return qn("upgrade attempt for closed client"),e.close()}else if(c=await this.handshake(t._query.transport,t,(f,d)=>this.abortRequest(e,f,d)),!c)return;let l={};!a&&this.emit("initial_headers",l,t),this.emit("headers",l,t),t.res.writeStatus("101 Switching Protocols"),Object.keys(l).forEach(f=>{t.res.writeHeader(f,l[f])}),e.upgrade({transport:c},t.getHeader("sec-websocket-key"),t.getHeader("sec-websocket-protocol"),t.getHeader("sec-websocket-extensions"),n)};this._applyMiddlewares(t,e,s=>{s?i(ui.Server.errors.BAD_REQUEST,{name:"MIDDLEWARE_FAILURE"}):this.verify(t,!0,i)})}abortRequest(e,t,n){let i=t===ui.Server.errors.FORBIDDEN?"403 Forbidden":"400 Bad Request",s=n&&n.message?n.message:ui.Server.errorMessages[t];e.writeStatus(i),e.writeHeader("Content-Type","application/json"),e.end(JSON.stringify({code:t,message:s}))}};qc.uServer=ld;var ud=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 m_=A(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.protocol=yt.Transport=yt.Socket=yt.uServer=yt.parser=yt.transports=yt.Server=void 0;yt.listen=YD;yt.attach=h_;var WD=require("http"),f_=sd();Object.defineProperty(yt,"Server",{enumerable:!0,get:function(){return f_.Server}});var GD=xf();yt.transports=GD.default;var d_=To();yt.parser=d_;var zD=p_();Object.defineProperty(yt,"uServer",{enumerable:!0,get:function(){return zD.uServer}});var VD=bf();Object.defineProperty(yt,"Socket",{enumerable:!0,get:function(){return VD.Socket}});var KD=ii();Object.defineProperty(yt,"Transport",{enumerable:!0,get:function(){return KD.Transport}});yt.protocol=d_.protocol;function YD(r,e,t){typeof e=="function"&&(t=e,e={});let n=(0,WD.createServer)(function(s,o){o.writeHead(501),o.end("Not Implemented")}),i=h_(n,e);return i.httpServer=n,n.listen(r,t),i}function h_(r,e){let t=new f_.Server(e);return t.attach(r,e),t}});var v_=A(g_=>{g_.Emitter=Mt;function Mt(r){if(r)return XD(r)}function XD(r){for(var e in Mt.prototype)r[e]=Mt.prototype[e];return r}Mt.prototype.on=Mt.prototype.addEventListener=function(r,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+r]=this._callbacks["$"+r]||[]).push(e),this};Mt.prototype.once=function(r,e){function t(){this.off(r,t),e.apply(this,arguments)}return t.fn=e,this.on(r,t),this};Mt.prototype.off=Mt.prototype.removeListener=Mt.prototype.removeAllListeners=Mt.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};Mt.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};Mt.prototype.emitReserved=Mt.prototype.emit;Mt.prototype.listeners=function(r){return this._callbacks=this._callbacks||{},this._callbacks["$"+r]||[]};Mt.prototype.hasListeners=function(r){return!!this.listeners(r).length}});var pd=A(Hc=>{"use strict";Object.defineProperty(Hc,"__esModule",{value:!0});Hc.isBinary=x_;Hc.hasBinary=$c;var JD=typeof ArrayBuffer=="function",ZD=r=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(r):r.buffer instanceof ArrayBuffer,y_=Object.prototype.toString,QD=typeof Blob=="function"||typeof Blob<"u"&&y_.call(Blob)==="[object BlobConstructor]",eL=typeof File=="function"||typeof File<"u"&&y_.call(File)==="[object FileConstructor]";function x_(r){return JD&&(r instanceof ArrayBuffer||ZD(r))||QD&&r instanceof Blob||eL&&r instanceof File}function $c(r,e){if(!r||typeof r!="object")return!1;if(Array.isArray(r)){for(let t=0,n=r.length;t<n;t++)if($c(r[t]))return!0;return!1}if(x_(r))return!0;if(r.toJSON&&typeof r.toJSON=="function"&&arguments.length===1)return $c(r.toJSON(),!0);for(let t in r)if(Object.prototype.hasOwnProperty.call(r,t)&&$c(r[t]))return!0;return!1}});var __=A(Wc=>{"use strict";Object.defineProperty(Wc,"__esModule",{value:!0});Wc.deconstructPacket=rL;Wc.reconstructPacket=nL;var tL=pd();function rL(r){let e=[],t=r.data,n=r;return n.data=fd(t,e),n.attachments=e.length,{packet:n,buffers:e}}function fd(r,e){if(!r)return r;if((0,tL.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]=fd(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]=fd(r[n],e));return t}return r}function nL(r,e){return r.data=dd(r.data,e),delete r.attachments,r}function dd(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]=dd(r[t],e);else if(typeof r=="object")for(let t in r)Object.prototype.hasOwnProperty.call(r,t)&&(r[t]=dd(r[t],e));return r}});var Do=A(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.Decoder=Ar.Encoder=Ar.PacketType=Ar.protocol=void 0;Ar.isPacketValid=lL;var iL=v_(),b_=__(),w_=pd(),sL=Oe(),hd=(0,sL.default)("socket.io-parser"),S_=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"];Ar.protocol=5;var fe;(function(r){r[r.CONNECT=0]="CONNECT",r[r.DISCONNECT=1]="DISCONNECT",r[r.EVENT=2]="EVENT",r[r.ACK=3]="ACK",r[r.CONNECT_ERROR=4]="CONNECT_ERROR",r[r.BINARY_EVENT=5]="BINARY_EVENT",r[r.BINARY_ACK=6]="BINARY_ACK"})(fe||(Ar.PacketType=fe={}));var md=class{constructor(e){this.replacer=e}encode(e){return hd("encoding packet %j",e),(e.type===fe.EVENT||e.type===fe.ACK)&&(0,w_.hasBinary)(e)?this.encodeAsBinary({type:e.type===fe.EVENT?fe.BINARY_EVENT:fe.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let t=""+e.type;return(e.type===fe.BINARY_EVENT||e.type===fe.BINARY_ACK)&&(t+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(t+=e.nsp+","),e.id!=null&&(t+=e.id),e.data!=null&&(t+=JSON.stringify(e.data,this.replacer)),hd("encoded %j as %s",e,t),t}encodeAsBinary(e){let t=(0,b_.deconstructPacket)(e),n=this.encodeAsString(t.packet),i=t.buffers;return i.unshift(n),i}};Ar.Encoder=md;var gd=class r extends iL.Emitter{constructor(e){super(),this.opts=Object.assign({reviver:void 0,maxAttachments:10},typeof e=="function"?{reviver:e}:e)}add(e){let t;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");t=this.decodeString(e);let n=t.type===fe.BINARY_EVENT;n||t.type===fe.BINARY_ACK?(t.type=n?fe.EVENT:fe.ACK,this.reconstructor=new vd(t),t.attachments===0&&super.emitReserved("decoded",t)):super.emitReserved("decoded",t)}else if((0,w_.isBinary)(e)||e.base64)if(this.reconstructor)t=this.reconstructor.takeBinaryData(e),t&&(this.reconstructor=null,super.emitReserved("decoded",t));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let t=0,n={type:Number(e.charAt(0))};if(fe[n.type]===void 0)throw new Error("unknown packet type "+n.type);if(n.type===fe.BINARY_EVENT||n.type===fe.BINARY_ACK){let s=t+1;for(;e.charAt(++t)!=="-"&&t!=e.length;);let o=e.substring(s,t);if(o!=Number(o)||e.charAt(t)!=="-")throw new Error("Illegal attachments");let a=Number(o);if(!E_(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 hd("decoded %s as %j",e,n),n}tryParse(e){try{return JSON.parse(e,this.opts.reviver)}catch{return!1}}static isPayloadValid(e,t){switch(e){case fe.CONNECT:return Gc(t);case fe.DISCONNECT:return t===void 0;case fe.CONNECT_ERROR:return typeof t=="string"||Gc(t);case fe.EVENT:case fe.BINARY_EVENT:return Array.isArray(t)&&(typeof t[0]=="number"||typeof t[0]=="string"&&S_.indexOf(t[0])===-1);case fe.ACK:case fe.BINARY_ACK:return Array.isArray(t)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}};Ar.Decoder=gd;var vd=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,b_.reconstructPacket)(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}};function oL(r){return typeof r=="string"}var E_=Number.isInteger||function(r){return typeof r=="number"&&isFinite(r)&&Math.floor(r)===r};function aL(r){return r===void 0||E_(r)}function Gc(r){return Object.prototype.toString.call(r)==="[object Object]"}function cL(r,e){switch(r){case fe.CONNECT:return e===void 0||Gc(e);case fe.DISCONNECT:return e===void 0;case fe.EVENT:return Array.isArray(e)&&(typeof e[0]=="number"||typeof e[0]=="string"&&S_.indexOf(e[0])===-1);case fe.ACK:return Array.isArray(e);case fe.CONNECT_ERROR:return typeof e=="string"||Gc(e);default:return!1}}function lL(r){return oL(r.nsp)&&aL(r.id)&&cL(r.type,r.data)}});var T_=A(cs=>{"use strict";var uL=cs&&cs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(cs,"__esModule",{value:!0});cs.Client=void 0;var zc=Do(),pL=uL(Oe()),Rr=(0,pL.default)("socket.io:client"),yd=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?(Rr("no namespace joined yet, close the client"),this.close()):Rr("the client has already joined a namespace, nothing to do")},this.server._connectTimeout)}connect(e,t={}){if(this.server._nsps.has(e))return Rr("connecting to namespace %s",e),this.doConnect(e,t);this.server._checkNamespace(e,t,n=>{n?this.doConnect(e,t):(Rr("creation of namespace %s was denied",e),this._packet({type:zc.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 Rr("ignoring remove for %s",e.id)}close(){this.conn.readyState==="open"&&(Rr("forcing transport close"),this.conn.close(),this.onclose("forced server close"))}_packet(e,t={}){if(this.conn.readyState!=="open"){Rr("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){Rr("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){Rr("invalid packet format"),this.onerror(t)}}ondecoded(e){let{namespace:t,authPayload:n}=this._parseNamespace(e),i=this.nsps.get(t);!i&&e.type===zc.PacketType.CONNECT?this.connect(t,n):i&&e.type!==zc.PacketType.CONNECT&&e.type!==zc.PacketType.CONNECT_ERROR?process.nextTick(function(){i._onpacket(e)}):(Rr("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){Rr("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)}};cs.Client=yd});var Kc=A(Vc=>{"use strict";Object.defineProperty(Vc,"__esModule",{value:!0});Vc.StrictEventEmitter=void 0;var fL=require("events"),xd=class extends fL.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)}};Vc.StrictEventEmitter=xd});var _d=A(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});Yc.RESERVED_EVENTS=void 0;Yc.RESERVED_EVENTS=new Set(["connect","connect_error","disconnect","disconnecting","newListener","removeListener"])});var bd=A(ls=>{"use strict";Object.defineProperty(ls,"__esModule",{value:!0});ls.RemoteSocket=ls.BroadcastOperator=void 0;var dL=_d(),hL=Do(),Xc=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(dL.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let n=[e,...t],i={type:hL.PacketType.EVENT,data:n};if(!(typeof n[n.length-1]=="function"))return this.adapter.broadcast(i,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags}),!0;let o=n.pop(),a=!1,c=[],l=setTimeout(()=>{a=!0,o.apply(this,[new Error("operation has timed out"),this.flags.expectSingleResponse?null:c])},this.flags.timeout),u=-1,f=0,d=0,g=()=>{!a&&u===f&&c.length===d&&(clearTimeout(l),o.apply(this,[null,this.flags.expectSingleResponse?c[0]:c]))};return this.adapter.broadcastWithAck(i,{rooms:this.rooms,except:this.exceptRooms,flags:this.flags},y=>{d+=y,f++,g()},y=>{c.push(y),g()}),this.adapter.serverCount().then(y=>{u=y,g()}),!0}emitWithAck(e,...t){return new Promise((n,i)=>{t.push((s,o)=>s?(s.responses=o,i(s)):n(o)),this.emit(e,...t)})}allSockets(){if(!this.adapter)throw new Error("No adapter for this namespace, are you trying to get the list of clients of a dynamic namespace?");return this.adapter.sockets(this.rooms)}fetchSockets(){return this.adapter.fetchSockets({rooms:this.rooms,except:this.exceptRooms,flags:this.flags}).then(e=>e.map(t=>t.server?t:new Jc(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)}};ls.BroadcastOperator=Xc;var Jc=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 Xc(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}};ls.RemoteSocket=Jc});var Sd=A(us=>{"use strict";var A_=us&&us.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(us,"__esModule",{value:!0});us.Socket=void 0;var pr=Do(),mL=A_(Oe()),gL=Kc(),C_=A_(Zp()),vL=bd(),yL=_d(),Et=(0,mL.default)("socket.io:socket"),xL=new Set(["transport error","transport close","forced close","ping timeout","server shutting down","forced server close"]);function k_(){}var wd=class extends gL.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:pr.PacketType.EVENT,data:s})}),this.recovered=!0):(t.conn.protocol===3?this.id=e.name!=="/"?e.name+"#"+t.id:t.id:this.id=C_.default.generateId(),this.server._opts.connectionStateRecovery&&(this.pid=C_.default.generateId())),this.handshake=this.buildHandshake(n),this.on("error",k_)}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(yL.RESERVED_EVENTS.has(e))throw new Error(`"${String(e)}" is a reserved event name`);let n=[e,...t],i={type:pr.PacketType.EVENT,data:n};if(typeof n[n.length-1]=="function"){let o=this.nsp._ids++;Et("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(()=>{Et("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 Et("join room %s",e),this.adapter.addAll(this.id,new Set(Array.isArray(e)?e:[e]))}leave(e){return Et("leave room %s",e),this.adapter.del(this.id,e)}leaveAll(){this.adapter.delAll(this.id)}_onconnect(){Et("socket connected - writing packet"),this.connected=!0,this.join(this.id),this.conn.protocol===3?this.packet({type:pr.PacketType.CONNECT}):this.packet({type:pr.PacketType.CONNECT,data:{sid:this.id,pid:this.pid}})}_onpacket(e){switch(Et("got packet %j",e),e.type){case pr.PacketType.EVENT:this.onevent(e);break;case pr.PacketType.BINARY_EVENT:this.onevent(e);break;case pr.PacketType.ACK:this.onack(e);break;case pr.PacketType.BINARY_ACK:this.onack(e);break;case pr.PacketType.DISCONNECT:this.ondisconnect();break}}onevent(e){let t=e.data||[];if(Et("emitting event %j",t),e.id!=null&&(Et("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);Et("sending ack %j",i),t.packet({id:e,type:pr.PacketType.ACK,data:i}),n=!0}}onack(e){let t=this.acks.get(e.id);typeof t=="function"?(Et("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),this.acks.delete(e.id)):Et("bad ack %s",e.id)}ondisconnect(){Et("got disconnect packet"),this._onclose("client namespace disconnect")}_onerror(e){this.emitReserved("error",e)}_onclose(e,t){if(!this.connected)return this;Et("closing socket - reason %s",e),this.emitReserved("disconnecting",e,t),this.server._opts.connectionStateRecovery&&xL.has(e)&&(Et("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=k_}_error(e){this.packet({type:pr.PacketType.CONNECT_ERROR,data:e})}disconnect(e=!1){return this.connected?(e?this.client._disconnect():(this.packet({type:pr.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){Et("dispatching an event %j",e),this.run(e,t=>{process.nextTick(()=>{if(t)return this._onerror(t);this.connected?super.emitUntyped.apply(this,e):Et("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 vL.BroadcastOperator(this.adapter,new Set,new Set([this.id]),e)}};us.Socket=wd});var Td=A(fn=>{"use strict";var _L=fn&&fn.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(fn,"__esModule",{value:!0});fn.Namespace=fn.RESERVED_EVENTS=void 0;var R_=Sd(),bL=Kc(),wL=_L(Oe()),Zt=bd(),ps=(0,wL.default)("socket.io:namespace");fn.RESERVED_EVENTS=new Set(["connect","connection","new_namespace"]);var Ed=class extends bL.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=>{ps("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 Zt.BroadcastOperator(this.adapter).to(e)}in(e){return new Zt.BroadcastOperator(this.adapter).in(e)}except(e){return new Zt.BroadcastOperator(this.adapter).except(e)}async _add(e,t,n){var i;ps("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"){ps("next called after client was closed - ignoring socket"),s._cleanup();return}if(o)return ps("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){ps("error while restoring session: %s",o)}if(s)return ps("connection state recovered for sid %s",s.sid),new R_.Socket(this,e,t,s)}return new R_.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 Zt.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(fn.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 Zt.BroadcastOperator(this.adapter).allSockets()}compress(e){return new Zt.BroadcastOperator(this.adapter).compress(e)}get volatile(){return new Zt.BroadcastOperator(this.adapter).volatile}get local(){return new Zt.BroadcastOperator(this.adapter).local}timeout(e){return new Zt.BroadcastOperator(this.adapter).timeout(e)}fetchSockets(){return new Zt.BroadcastOperator(this.adapter).fetchSockets()}socketsJoin(e){return new Zt.BroadcastOperator(this.adapter).socketsJoin(e)}socketsLeave(e){return new Zt.BroadcastOperator(this.adapter).socketsLeave(e)}disconnectSockets(e=!1){return new Zt.BroadcastOperator(this.adapter).disconnectSockets(e)}};fn.Namespace=Ed});var N_=A(Lo=>{"use strict";Object.defineProperty(Lo,"__esModule",{value:!0});Lo.encode=Cd;Lo.decode=SL;Lo.yeast=EL;var P_="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),Zc=64,I_={},O_=0,$n=0,M_;function Cd(r){let e="";do e=P_[r%Zc]+e,r=Math.floor(r/Zc);while(r>0);return e}function SL(r){let e=0;for($n=0;$n<r.length;$n++)e=e*Zc+I_[r.charAt($n)];return e}function EL(){let r=Cd(+new Date);return r!==M_?(O_=0,M_=r):r+"."+Cd(O_++)}for(;$n<Zc;$n++)I_[P_[$n]]=$n});var dn=A((DW,B_)=>{"use strict";var D_=["nodebuffer","arraybuffer","fragments"],L_=typeof Blob<"u";L_&&D_.push("blob");B_.exports={BINARY_TYPES:D_,EMPTY_BUFFER:Buffer.alloc(0),GUID:"258EAFA5-E914-47DA-95CA-C5AB0DC85B11",hasBlob:L_,kForOnEventAttribute:Symbol("kIsForOnEventAttribute"),kListener:Symbol("kListener"),kStatusCode:Symbol("status-code"),kWebSocket:Symbol("websocket"),NOOP:()=>{}}});var Bo=A((LW,Qc)=>{"use strict";var{EMPTY_BUFFER:TL}=dn(),kd=Buffer[Symbol.species];function CL(r,e){if(r.length===0)return TL;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 kd(t.buffer,t.byteOffset,n):t}function j_(r,e,t,n,i){for(let s=0;s<i;s++)t[n+s]=r[s]^e[s&3]}function F_(r,e){for(let t=0;t<r.length;t++)r[t]^=e[t&3]}function kL(r){return r.length===r.buffer.byteLength?r.buffer:r.buffer.slice(r.byteOffset,r.byteOffset+r.length)}function Ad(r){if(Ad.readOnly=!0,Buffer.isBuffer(r))return r;let e;return r instanceof ArrayBuffer?e=new kd(r):ArrayBuffer.isView(r)?e=new kd(r.buffer,r.byteOffset,r.byteLength):(e=Buffer.from(r),Ad.readOnly=!1),e}Qc.exports={concat:CL,mask:j_,toArrayBuffer:kL,toBuffer:Ad,unmask:F_};if(!process.env.WS_NO_BUFFER_UTIL)try{let r=Pf();Qc.exports.mask=function(e,t,n,i,s){s<48?j_(e,t,n,i,s):r.mask(e,t,n,i,s)},Qc.exports.unmask=function(e,t){e.length<32?F_(e,t):r.unmask(e,t)}}catch{}});var $_=A((BW,q_)=>{"use strict";var U_=Symbol("kDone"),Rd=Symbol("kRun"),Od=class{constructor(e){this[U_]=()=>{this.pending--,this[Rd]()},this.concurrency=e||1/0,this.jobs=[],this.pending=0}add(e){this.jobs.push(e),this[Rd]()}[Rd](){if(this.pending!==this.concurrency&&this.jobs.length){let e=this.jobs.shift();this.pending++,e(this[U_])}}};q_.exports=Od});var Fo=A((jW,z_)=>{"use strict";var jo=require("zlib"),H_=Bo(),AL=$_(),{kStatusCode:W_}=dn(),RL=Buffer[Symbol.species],OL=Buffer.from([0,0,255,255]),tl=Symbol("permessage-deflate"),hn=Symbol("total-length"),fs=Symbol("callback"),Hn=Symbol("buffers"),ds=Symbol("error"),el,Md=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,!el){let i=this._options.concurrencyLimit!==void 0?this._options.concurrencyLimit:10;el=new AL(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[fs];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){el.add(i=>{this._decompress(e,t,(s,o)=>{i(),n(s,o)})})}compress(e,t,n){el.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"?jo.Z_DEFAULT_WINDOWBITS:this.params[s];this._inflate=jo.createInflateRaw({...this._options.zlibInflateOptions,windowBits:o}),this._inflate[tl]=this,this._inflate[hn]=0,this._inflate[Hn]=[],this._inflate.on("error",PL),this._inflate.on("data",G_)}this._inflate[fs]=n,this._inflate.write(e),t&&this._inflate.write(OL),this._inflate.flush(()=>{let s=this._inflate[ds];if(s){this._inflate.close(),this._inflate=null,n(s);return}let o=H_.concat(this._inflate[Hn],this._inflate[hn]);this._inflate._readableState.endEmitted?(this._inflate.close(),this._inflate=null):(this._inflate[hn]=0,this._inflate[Hn]=[],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"?jo.Z_DEFAULT_WINDOWBITS:this.params[s];this._deflate=jo.createDeflateRaw({...this._options.zlibDeflateOptions,windowBits:o}),this._deflate[hn]=0,this._deflate[Hn]=[],this._deflate.on("data",ML)}this._deflate[fs]=n,this._deflate.write(e),this._deflate.flush(jo.Z_SYNC_FLUSH,()=>{if(!this._deflate)return;let s=H_.concat(this._deflate[Hn],this._deflate[hn]);t&&(s=new RL(s.buffer,s.byteOffset,s.length-4)),this._deflate[fs]=null,this._deflate[hn]=0,this._deflate[Hn]=[],t&&this.params[`${i}_no_context_takeover`]&&this._deflate.reset(),n(null,s)})}};z_.exports=Md;function ML(r){this[Hn].push(r),this[hn]+=r.length}function G_(r){if(this[hn]+=r.length,this[tl]._maxPayload<1||this[hn]<=this[tl]._maxPayload){this[Hn].push(r);return}this[ds]=new RangeError("Max payload size exceeded"),this[ds].code="WS_ERR_UNSUPPORTED_MESSAGE_LENGTH",this[ds][W_]=1009,this.removeListener("data",G_),this.reset()}function PL(r){if(this[tl]._inflate=null,this[ds]){this[fs](this[ds]);return}r[W_]=1007,this[fs](r)}});var hs=A((FW,rl)=>{"use strict";var{isUtf8:V_}=require("buffer"),{hasBlob:IL}=dn(),NL=[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 DL(r){return r>=1e3&&r<=1014&&r!==1004&&r!==1005&&r!==1006||r>=3e3&&r<=4999}function Pd(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 LL(r){return IL&&typeof r=="object"&&typeof r.arrayBuffer=="function"&&typeof r.type=="string"&&typeof r.stream=="function"&&(r[Symbol.toStringTag]==="Blob"||r[Symbol.toStringTag]==="File")}rl.exports={isBlob:LL,isValidStatusCode:DL,isValidUTF8:Pd,tokenChars:NL};if(V_)rl.exports.isValidUTF8=function(r){return r.length<24?Pd(r):V_(r)};else if(!process.env.WS_NO_UTF_8_VALIDATE)try{let r=Ff();rl.exports.isValidUTF8=function(e){return e.length<32?Pd(e):r(e)}}catch{}});var Bd=A((UW,eb)=>{"use strict";var{Writable:BL}=require("stream"),K_=Fo(),{BINARY_TYPES:jL,EMPTY_BUFFER:Y_,kStatusCode:FL,kWebSocket:UL}=dn(),{concat:Id,toArrayBuffer:qL,unmask:$L}=Bo(),{isValidStatusCode:HL,isValidUTF8:X_}=hs(),nl=Buffer[Symbol.species],fr=0,J_=1,Z_=2,Q_=3,Nd=4,Dd=5,il=6,Ld=class extends BL{constructor(e={}){super(),this._allowSynchronousEvents=e.allowSynchronousEvents!==void 0?e.allowSynchronousEvents:!0,this._binaryType=e.binaryType||jL[0],this._extensions=e.extensions||{},this._isServer=!!e.isServer,this._maxPayload=e.maxPayload|0,this._skipUTF8Validation=!!e.skipUTF8Validation,this[UL]=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=fr}_write(e,t,n){if(this._opcode===8&&this._state==fr)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 nl(n.buffer,n.byteOffset+e,n.length-e),new nl(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 nl(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 fr:this.getInfo(e);break;case J_:this.getPayloadLength16(e);break;case Z_:this.getPayloadLength64(e);break;case Q_:this.getMask();break;case Nd:this.getData(e);break;case Dd:case il: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[K_.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=J_:this._payloadLength===127?this._state=Z_: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=Q_:this._state=Nd}getMask(){if(this._bufferedBytes<4){this._loop=!1;return}this._mask=this.consume(4),this._state=Nd}getData(e){let t=Y_;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&&$L(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[K_.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===fr&&this.startLoop(t)})}dataMessage(e){if(!this._fin){this._state=fr;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=Id(n,t):this._binaryType==="arraybuffer"?i=qL(Id(n,t)):this._binaryType==="blob"?i=new Blob(n):i=n,this._allowSynchronousEvents?(this.emit("message",i,!0),this._state=fr):(this._state=il,setImmediate(()=>{this.emit("message",i,!0),this._state=fr,this.startLoop(e)}))}else{let i=Id(n,t);if(!this._skipUTF8Validation&&!X_(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=fr):(this._state=il,setImmediate(()=>{this.emit("message",i,!1),this._state=fr,this.startLoop(e)}))}}controlMessage(e,t){if(this._opcode===8){if(e.length===0)this._loop=!1,this.emit("conclude",1005,Y_),this.end();else{let n=e.readUInt16BE(0);if(!HL(n)){let s=this.createError(RangeError,`invalid status code ${n}`,!0,1002,"WS_ERR_INVALID_CLOSE_CODE");t(s);return}let i=new nl(e.buffer,e.byteOffset+2,e.length-2);if(!this._skipUTF8Validation&&!X_(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=fr;return}this._allowSynchronousEvents?(this.emit(this._opcode===9?"ping":"pong",e),this._state=fr):(this._state=il,setImmediate(()=>{this.emit(this._opcode===9?"ping":"pong",e),this._state=fr,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[FL]=i,o}};eb.exports=Ld});var Ud=A(($W,nb)=>{"use strict";var{Duplex:qW}=require("stream"),{randomFillSync:WL}=require("crypto"),tb=Fo(),{EMPTY_BUFFER:GL,kWebSocket:zL,NOOP:VL}=dn(),{isBlob:ms,isValidStatusCode:KL}=hs(),{mask:rb,toBuffer:pi}=Bo(),dr=Symbol("kByteLength"),YL=Buffer.alloc(4),sl=8*1024,fi,gs=sl,Or=0,XL=1,JL=2,jd=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=Or,this.onerror=VL,this[zL]=void 0}static frame(e,t){let n,i=!1,s=2,o=!1;t.mask&&(n=t.maskBuffer||YL,t.generateMask?t.generateMask(n):(gs===sl&&(fi===void 0&&(fi=Buffer.alloc(sl)),WL(fi,0,sl),gs=0),n[0]=fi[gs++],n[1]=fi[gs++],n[2]=fi[gs++],n[3]=fi[gs++]),o=(n[0]|n[1]|n[2]|n[3])===0,s=6);let a;typeof e=="string"?(!t.mask||o)&&t[dr]!==void 0?a=t[dr]:(e=Buffer.from(e),a=e.length):(a=e.length,i=t.mask&&t.readOnly&&!o);let c=a;a>=65536?(s+=8,c=127):a>125&&(s+=2,c=126);let l=Buffer.allocUnsafe(i?a+s:s);return l[0]=t.fin?t.opcode|128:t.opcode,t.rsv1&&(l[0]|=64),l[1]=c,c===126?l.writeUInt16BE(a,2):c===127&&(l[2]=l[3]=0,l.writeUIntBE(a,4,6)),t.mask?(l[1]|=128,l[s-4]=n[0],l[s-3]=n[1],l[s-2]=n[2],l[s-1]=n[3],o?[l,e]:i?(rb(e,n,l,s,a),[l]):(rb(e,n,e,0,a),[l,e])):[l,e]}close(e,t,n,i){let s;if(e===void 0)s=GL;else{if(typeof e!="number"||!KL(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={[dr]:s.length,fin:!0,generateMask:this._generateMask,mask:n,maskBuffer:this._maskBuffer,opcode:8,readOnly:!1,rsv1:!1};this._state!==Or?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):ms(e)?(i=e.size,s=!1):(e=pi(e),i=e.length,s=pi.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[dr]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:9,readOnly:s,rsv1:!1};ms(e)?this._state!==Or?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Or?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):ms(e)?(i=e.size,s=!1):(e=pi(e),i=e.length,s=pi.readOnly),i>125)throw new RangeError("The data size must not be greater than 125 bytes");let o={[dr]:i,fin:!0,generateMask:this._generateMask,mask:t,maskBuffer:this._maskBuffer,opcode:10,readOnly:s,rsv1:!1};ms(e)?this._state!==Or?this.enqueue([this.getBlobData,e,!1,o,n]):this.getBlobData(e,!1,o,n):this._state!==Or?this.enqueue([this.dispatch,e,!1,o,n]):this.sendFrame(r.frame(e,o),n)}send(e,t,n){let i=this._extensions[tb.extensionName],s=t.binary?2:1,o=t.compress,a,c;typeof e=="string"?(a=Buffer.byteLength(e),c=!1):ms(e)?(a=e.size,c=!1):(e=pi(e),a=e.length,c=pi.readOnly),this._firstFragment?(this._firstFragment=!1,o&&i&&i.params[i._isServer?"server_no_context_takeover":"client_no_context_takeover"]&&(o=a>=i._threshold),this._compress=o):(o=!1,s=0),t.fin&&(this._firstFragment=!0);let l={[dr]:a,fin:t.fin,generateMask:this._generateMask,mask:t.mask,maskBuffer:this._maskBuffer,opcode:s,readOnly:c,rsv1:o};ms(e)?this._state!==Or?this.enqueue([this.getBlobData,e,this._compress,l,n]):this.getBlobData(e,this._compress,l,n):this._state!==Or?this.enqueue([this.dispatch,e,this._compress,l,n]):this.dispatch(e,this._compress,l,n)}getBlobData(e,t,n,i){this._bufferedBytes+=n[dr],this._state=JL,e.arrayBuffer().then(s=>{if(this._socket.destroyed){let a=new Error("The socket was closed while the blob was being read");process.nextTick(Fd,this,a,i);return}this._bufferedBytes-=n[dr];let o=pi(s);t?this.dispatch(o,t,n,i):(this._state=Or,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[tb.extensionName];this._bufferedBytes+=n[dr],this._state=XL,s.compress(e,n.fin,(o,a)=>{if(this._socket.destroyed){let c=new Error("The socket was closed while data was being compressed");Fd(this,c,i);return}this._bufferedBytes-=n[dr],this._state=Or,n.readOnly=!1,this.sendFrame(r.frame(a,n),i),this.dequeue()})}dequeue(){for(;this._state===Or&&this._queue.length;){let e=this._queue.shift();this._bufferedBytes-=e[3][dr],Reflect.apply(e[0],this,e.slice(1))}}enqueue(e){this._bufferedBytes+=e[3][dr],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)}};nb.exports=jd;function Fd(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){Fd(r,e,t),r.onerror(e)}});var fb=A((HW,pb)=>{"use strict";var{kForOnEventAttribute:Uo,kListener:qd}=dn(),ib=Symbol("kCode"),sb=Symbol("kData"),ob=Symbol("kError"),ab=Symbol("kMessage"),cb=Symbol("kReason"),vs=Symbol("kTarget"),lb=Symbol("kType"),ub=Symbol("kWasClean"),mn=class{constructor(e){this[vs]=null,this[lb]=e}get target(){return this[vs]}get type(){return this[lb]}};Object.defineProperty(mn.prototype,"target",{enumerable:!0});Object.defineProperty(mn.prototype,"type",{enumerable:!0});var di=class extends mn{constructor(e,t={}){super(e),this[ib]=t.code===void 0?0:t.code,this[cb]=t.reason===void 0?"":t.reason,this[ub]=t.wasClean===void 0?!1:t.wasClean}get code(){return this[ib]}get reason(){return this[cb]}get wasClean(){return this[ub]}};Object.defineProperty(di.prototype,"code",{enumerable:!0});Object.defineProperty(di.prototype,"reason",{enumerable:!0});Object.defineProperty(di.prototype,"wasClean",{enumerable:!0});var ys=class extends mn{constructor(e,t={}){super(e),this[ob]=t.error===void 0?null:t.error,this[ab]=t.message===void 0?"":t.message}get error(){return this[ob]}get message(){return this[ab]}};Object.defineProperty(ys.prototype,"error",{enumerable:!0});Object.defineProperty(ys.prototype,"message",{enumerable:!0});var qo=class extends mn{constructor(e,t={}){super(e),this[sb]=t.data===void 0?null:t.data}get data(){return this[sb]}};Object.defineProperty(qo.prototype,"data",{enumerable:!0});var QL={addEventListener(r,e,t={}){for(let i of this.listeners(r))if(!t[Uo]&&i[qd]===e&&!i[Uo])return;let n;if(r==="message")n=function(s,o){let a=new qo("message",{data:o?s:s.toString()});a[vs]=this,ol(e,this,a)};else if(r==="close")n=function(s,o){let a=new di("close",{code:s,reason:o.toString(),wasClean:this._closeFrameReceived&&this._closeFrameSent});a[vs]=this,ol(e,this,a)};else if(r==="error")n=function(s){let o=new ys("error",{error:s,message:s.message});o[vs]=this,ol(e,this,o)};else if(r==="open")n=function(){let s=new mn("open");s[vs]=this,ol(e,this,s)};else return;n[Uo]=!!t[Uo],n[qd]=e,t.once?this.once(r,n):this.on(r,n)},removeEventListener(r,e){for(let t of this.listeners(r))if(t[qd]===e&&!t[Uo]){this.removeListener(r,t);break}}};pb.exports={CloseEvent:di,ErrorEvent:ys,Event:mn,EventTarget:QL,MessageEvent:qo};function ol(r,e,t){typeof r=="object"&&r.handleEvent?r.handleEvent.call(r,t):r.call(e,t)}});var $d=A((WW,db)=>{"use strict";var{tokenChars:$o}=hs();function Hr(r,e,t){r[e]===void 0?r[e]=[t]:r[e].push(t)}function e2(r){let e=Object.create(null),t=Object.create(null),n=!1,i=!1,s=!1,o,a,c=-1,l=-1,u=-1,f=0;for(;f<r.length;f++)if(l=r.charCodeAt(f),o===void 0)if(u===-1&&$o[l]===1)c===-1&&(c=f);else if(f!==0&&(l===32||l===9))u===-1&&c!==-1&&(u=f);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);u===-1&&(u=f);let g=r.slice(c,u);l===44?(Hr(e,g,t),t=Object.create(null)):o=g,c=u=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);else if(a===void 0)if(u===-1&&$o[l]===1)c===-1&&(c=f);else if(l===32||l===9)u===-1&&c!==-1&&(u=f);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);u===-1&&(u=f),Hr(t,r.slice(c,u),!0),l===44&&(Hr(e,o,t),t=Object.create(null),o=void 0),c=u=-1}else if(l===61&&c!==-1&&u===-1)a=r.slice(c,f),c=u=-1;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(i){if($o[l]!==1)throw new SyntaxError(`Unexpected character at index ${f}`);c===-1?c=f:n||(n=!0),i=!1}else if(s)if($o[l]===1)c===-1&&(c=f);else if(l===34&&c!==-1)s=!1,u=f;else if(l===92)i=!0;else throw new SyntaxError(`Unexpected character at index ${f}`);else if(l===34&&r.charCodeAt(f-1)===61)s=!0;else if(u===-1&&$o[l]===1)c===-1&&(c=f);else if(c!==-1&&(l===32||l===9))u===-1&&(u=f);else if(l===59||l===44){if(c===-1)throw new SyntaxError(`Unexpected character at index ${f}`);u===-1&&(u=f);let g=r.slice(c,u);n&&(g=g.replace(/\\/g,""),n=!1),Hr(t,a,g),l===44&&(Hr(e,o,t),t=Object.create(null),o=void 0),a=void 0,c=u=-1}else throw new SyntaxError(`Unexpected character at index ${f}`);if(c===-1||s||l===32||l===9)throw new SyntaxError("Unexpected end of input");u===-1&&(u=f);let d=r.slice(c,u);return o===void 0?Hr(e,d,t):(a===void 0?Hr(t,d,!0):n?Hr(t,a,d.replace(/\\/g,"")):Hr(t,a,d),Hr(e,o,t)),e}function t2(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(", ")}db.exports={format:t2,parse:e2}});var ul=A((VW,Tb)=>{"use strict";var r2=require("events"),n2=require("https"),i2=require("http"),gb=require("net"),s2=require("tls"),{randomBytes:o2,createHash:a2}=require("crypto"),{Duplex:GW,Readable:zW}=require("stream"),{URL:Hd}=require("url"),Wn=Fo(),c2=Bd(),l2=Ud(),{isBlob:u2}=hs(),{BINARY_TYPES:hb,EMPTY_BUFFER:al,GUID:p2,kForOnEventAttribute:Wd,kListener:f2,kStatusCode:d2,kWebSocket:xt,NOOP:vb}=dn(),{EventTarget:{addEventListener:h2,removeEventListener:m2}}=fb(),{format:g2,parse:v2}=$d(),{toBuffer:y2}=Bo(),x2=30*1e3,yb=Symbol("kAborted"),Gd=[8,13],gn=["CONNECTING","OPEN","CLOSING","CLOSED"],_2=/^[!#$%&'*+\-.0-9A-Z^_`|a-z~]+$/,Ee=class r extends r2{constructor(e,t,n){super(),this._binaryType=hb[0],this._closeCode=1006,this._closeFrameReceived=!1,this._closeFrameSent=!1,this._closeMessage=al,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]),xb(this,e,t,n)):(this._autoPong=n.autoPong,this._isServer=!0)}get binaryType(){return this._binaryType}set binaryType(e){hb.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 c2({allowSynchronousEvents:n.allowSynchronousEvents,binaryType:this.binaryType,extensions:this._extensions,isServer:this._isServer,maxPayload:n.maxPayload,skipUTF8Validation:n.skipUTF8Validation}),s=new l2(e,this._extensions,n.generateMask);this._receiver=i,this._sender=s,this._socket=e,i[xt]=this,s[xt]=this,e[xt]=this,i.on("conclude",S2),i.on("drain",E2),i.on("error",T2),i.on("message",C2),i.on("ping",k2),i.on("pong",A2),s.onerror=R2,e.setTimeout&&e.setTimeout(0),e.setNoDelay&&e.setNoDelay(),t.length>0&&e.unshift(t),e.on("close",wb),e.on("data",ll),e.on("end",Sb),e.on("error",Eb),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[Wn.extensionName]&&this._extensions[Wn.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){Qt(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())}),bb(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){zd(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.ping(e||al,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){zd(this,e,n);return}t===void 0&&(t=!this._isServer),this._sender.pong(e||al,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){zd(this,e,n);return}let i={binary:typeof e!="string",mask:!this._isServer,compress:!0,fin:!0,...t};this._extensions[Wn.extensionName]||(i.compress=!1),this._sender.send(e||al,i,n)}terminate(){if(this.readyState!==r.CLOSED){if(this.readyState===r.CONNECTING){Qt(this,this._req,"WebSocket was closed before the connection was established");return}this._socket&&(this._readyState=r.CLOSING,this._socket.destroy())}}};Object.defineProperty(Ee,"CONNECTING",{enumerable:!0,value:gn.indexOf("CONNECTING")});Object.defineProperty(Ee.prototype,"CONNECTING",{enumerable:!0,value:gn.indexOf("CONNECTING")});Object.defineProperty(Ee,"OPEN",{enumerable:!0,value:gn.indexOf("OPEN")});Object.defineProperty(Ee.prototype,"OPEN",{enumerable:!0,value:gn.indexOf("OPEN")});Object.defineProperty(Ee,"CLOSING",{enumerable:!0,value:gn.indexOf("CLOSING")});Object.defineProperty(Ee.prototype,"CLOSING",{enumerable:!0,value:gn.indexOf("CLOSING")});Object.defineProperty(Ee,"CLOSED",{enumerable:!0,value:gn.indexOf("CLOSED")});Object.defineProperty(Ee.prototype,"CLOSED",{enumerable:!0,value:gn.indexOf("CLOSED")});["binaryType","bufferedAmount","extensions","isPaused","protocol","readyState","url"].forEach(r=>{Object.defineProperty(Ee.prototype,r,{enumerable:!0})});["open","error","close","message"].forEach(r=>{Object.defineProperty(Ee.prototype,`on${r}`,{enumerable:!0,get(){for(let e of this.listeners(r))if(e[Wd])return e[f2];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})}})});Ee.prototype.addEventListener=h2;Ee.prototype.removeEventListener=m2;Tb.exports=Ee;function xb(r,e,t,n){let i={allowSynchronousEvents:!0,autoPong:!0,protocolVersion:Gd[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,!Gd.includes(i.protocolVersion))throw new RangeError(`Unsupported protocol version: ${i.protocolVersion} (supported versions: ${Gd.join(", ")})`);let s;if(e instanceof Hd)s=e;else try{s=new Hd(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 b=new SyntaxError(c);if(r._redirects===0)throw b;cl(r,b);return}let l=o?443:80,u=o2(16).toString("base64"),f=o?n2.request:i2.request,d=new Set,g;if(i.createConnection=i.createConnection||(o?w2:b2),i.defaultPort=i.defaultPort||l,i.port=s.port||l,i.host=s.hostname.startsWith("[")?s.hostname.slice(1,-1):s.hostname,i.headers={...i.headers,"Sec-WebSocket-Version":i.protocolVersion,"Sec-WebSocket-Key":u,Connection:"Upgrade",Upgrade:"websocket"},i.path=s.pathname+s.search,i.timeout=i.handshakeTimeout,i.perMessageDeflate&&(g=new Wn(i.perMessageDeflate!==!0?i.perMessageDeflate:{},!1,i.maxPayload),i.headers["Sec-WebSocket-Extensions"]=g2({[Wn.extensionName]:g.offer()})),t.length){for(let b of t){if(typeof b!="string"||!_2.test(b)||d.has(b))throw new SyntaxError("An invalid or duplicated subprotocol was specified");d.add(b)}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 b=i.path.split(":");i.socketPath=b[0],i.path=b[1]}let y;if(i.followRedirects){if(r._redirects===0){r._originalIpc=a,r._originalSecure=o,r._originalHostOrSocketPath=a?i.socketPath:s.host;let b=n&&n.headers;if(n={...n,headers:{}},b)for(let[C,R]of Object.entries(b))n.headers[C.toLowerCase()]=R}else if(r.listenerCount("redirect")===0){let b=a?r._originalIpc?i.socketPath===r._originalHostOrSocketPath:!1:r._originalIpc?!1:s.host===r._originalHostOrSocketPath;(!b||r._originalSecure&&!o)&&(delete i.headers.authorization,delete i.headers.cookie,b||delete i.headers.host,i.auth=void 0)}i.auth&&!n.headers.authorization&&(n.headers.authorization="Basic "+Buffer.from(i.auth).toString("base64")),y=r._req=f(i),r._redirects&&r.emit("redirect",r.url,y)}else y=r._req=f(i);i.timeout&&y.on("timeout",()=>{Qt(r,y,"Opening handshake has timed out")}),y.on("error",b=>{y===null||y[yb]||(y=r._req=null,cl(r,b))}),y.on("response",b=>{let C=b.headers.location,R=b.statusCode;if(C&&i.followRedirects&&R>=300&&R<400){if(++r._redirects>i.maxRedirects){Qt(r,y,"Maximum redirects exceeded");return}y.abort();let O;try{O=new Hd(C,e)}catch{let B=new SyntaxError(`Invalid URL: ${C}`);cl(r,B);return}xb(r,O,t,n)}else r.emit("unexpected-response",y,b)||Qt(r,y,`Unexpected server response: ${b.statusCode}`)}),y.on("upgrade",(b,C,R)=>{if(r.emit("upgrade",b),r.readyState!==Ee.CONNECTING)return;y=r._req=null;let O=b.headers.upgrade;if(O===void 0||O.toLowerCase()!=="websocket"){Qt(r,C,"Invalid Upgrade header");return}let P=a2("sha1").update(u+p2).digest("base64");if(b.headers["sec-websocket-accept"]!==P){Qt(r,C,"Invalid Sec-WebSocket-Accept header");return}let B=b.headers["sec-websocket-protocol"],G;if(B!==void 0?d.size?d.has(B)||(G="Server sent an invalid subprotocol"):G="Server sent a subprotocol but none was requested":d.size&&(G="Server sent no subprotocol"),G){Qt(r,C,G);return}B&&(r._protocol=B);let F=b.headers["sec-websocket-extensions"];if(F!==void 0){if(!g){Qt(r,C,"Server sent a Sec-WebSocket-Extensions header but no extension was requested");return}let V;try{V=v2(F)}catch{Qt(r,C,"Invalid Sec-WebSocket-Extensions header");return}let D=Object.keys(V);if(D.length!==1||D[0]!==Wn.extensionName){Qt(r,C,"Server indicated an extension that was not requested");return}try{g.accept(V[Wn.extensionName])}catch{Qt(r,C,"Invalid Sec-WebSocket-Extensions header");return}r._extensions[Wn.extensionName]=g}r.setSocket(C,R,{allowSynchronousEvents:i.allowSynchronousEvents,generateMask:i.generateMask,maxPayload:i.maxPayload,skipUTF8Validation:i.skipUTF8Validation})}),i.finishRequest?i.finishRequest(y,r):y.end()}function cl(r,e){r._readyState=Ee.CLOSING,r._errorEmitted=!0,r.emit("error",e),r.emitClose()}function b2(r){return r.path=r.socketPath,gb.connect(r)}function w2(r){return r.path=void 0,!r.servername&&r.servername!==""&&(r.servername=gb.isIP(r.host)?"":r.host),s2.connect(r)}function Qt(r,e,t){r._readyState=Ee.CLOSING;let n=new Error(t);Error.captureStackTrace(n,Qt),e.setHeader?(e[yb]=!0,e.abort(),e.socket&&!e.socket.destroyed&&e.socket.destroy(),process.nextTick(cl,r,n)):(e.destroy(n),e.once("error",r.emit.bind(r,"error")),e.once("close",r.emitClose.bind(r)))}function zd(r,e,t){if(e){let n=u2(e)?e.size:y2(e).length;r._socket?r._sender._bufferedBytes+=n:r._bufferedAmount+=n}if(t){let n=new Error(`WebSocket is not open: readyState ${r.readyState} (${gn[r.readyState]})`);process.nextTick(t,n)}}function S2(r,e){let t=this[xt];t._closeFrameReceived=!0,t._closeMessage=e,t._closeCode=r,t._socket[xt]!==void 0&&(t._socket.removeListener("data",ll),process.nextTick(_b,t._socket),r===1005?t.close():t.close(r,e))}function E2(){let r=this[xt];r.isPaused||r._socket.resume()}function T2(r){let e=this[xt];e._socket[xt]!==void 0&&(e._socket.removeListener("data",ll),process.nextTick(_b,e._socket),e.close(r[d2])),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r))}function mb(){this[xt].emitClose()}function C2(r,e){this[xt].emit("message",r,e)}function k2(r){let e=this[xt];e._autoPong&&e.pong(r,!this._isServer,vb),e.emit("ping",r)}function A2(r){this[xt].emit("pong",r)}function _b(r){r.resume()}function R2(r){let e=this[xt];e.readyState!==Ee.CLOSED&&(e.readyState===Ee.OPEN&&(e._readyState=Ee.CLOSING,bb(e)),this._socket.end(),e._errorEmitted||(e._errorEmitted=!0,e.emit("error",r)))}function bb(r){r._closeTimer=setTimeout(r._socket.destroy.bind(r._socket),x2)}function wb(){let r=this[xt];this.removeListener("close",wb),this.removeListener("data",ll),this.removeListener("end",Sb),r._readyState=Ee.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[xt]=void 0,clearTimeout(r._closeTimer),r._receiver._writableState.finished||r._receiver._writableState.errorEmitted?r.emitClose():(r._receiver.on("error",mb),r._receiver.on("finish",mb))}function ll(r){this[xt]._receiver.write(r)||this.pause()}function Sb(){let r=this[xt];r._readyState=Ee.CLOSING,r._receiver.end(),this.end()}function Eb(){let r=this[xt];this.removeListener("error",Eb),this.on("error",vb),r&&(r._readyState=Ee.CLOSING,this.destroy())}});var Rb=A((YW,Ab)=>{"use strict";var KW=ul(),{Duplex:O2}=require("stream");function Cb(r){r.emit("close")}function M2(){!this.destroyed&&this._writableState.finished&&this.destroy()}function kb(r){this.removeListener("error",kb),this.destroy(),this.listenerCount("error")===0&&this.emit("error",r)}function P2(r,e){let t=!0,n=new O2({...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(Cb,n);return}let o=!1;r.once("error",function(c){o=!0,s(c)}),r.once("close",function(){o||s(i),process.nextTick(Cb,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",M2),n.on("error",kb),n}Ab.exports=P2});var Mb=A((XW,Ob)=>{"use strict";var{tokenChars:I2}=hs();function N2(r){let e=new Set,t=-1,n=-1,i=0;for(i;i<r.length;i++){let o=r.charCodeAt(i);if(n===-1&&I2[o]===1)t===-1&&(t=i);else if(i!==0&&(o===32||o===9))n===-1&&t!==-1&&(n=i);else if(o===44){if(t===-1)throw new SyntaxError(`Unexpected character at index ${i}`);n===-1&&(n=i);let a=r.slice(t,n);if(e.has(a))throw new SyntaxError(`The "${a}" subprotocol is duplicated`);e.add(a),t=n=-1}else throw new SyntaxError(`Unexpected character at index ${i}`)}if(t===-1||n!==-1)throw new SyntaxError("Unexpected end of input");let s=r.slice(t,i);if(e.has(s))throw new SyntaxError(`The "${s}" subprotocol is duplicated`);return e.add(s),e}Ob.exports={parse:N2}});var jb=A((ZW,Bb)=>{"use strict";var D2=require("events"),pl=require("http"),{Duplex:JW}=require("stream"),{createHash:L2}=require("crypto"),Pb=$d(),hi=Fo(),B2=Mb(),j2=ul(),{GUID:F2,kWebSocket:U2}=dn(),q2=/^[+/0-9A-Za-z]{22}==$/,Ib=0,Nb=1,Lb=2,Vd=class extends D2{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:j2,...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=pl.createServer((n,i)=>{let s=pl.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=$2(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=Ib}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===Lb){e&&this.once("close",()=>{e(new Error("The server is not running"))}),process.nextTick(Ho,this);return}if(e&&this.once("close",e),this._state!==Nb)if(this._state=Nb,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(Ho,this):process.nextTick(Ho,this);else{let t=this._server;this._removeListeners(),this._removeListeners=this._server=null,t.close(()=>{Ho(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",Db);let s=e.headers["sec-websocket-key"],o=e.headers.upgrade,a=+e.headers["sec-websocket-version"];if(e.method!=="GET"){mi(this,e,t,405,"Invalid HTTP method");return}if(o===void 0||o.toLowerCase()!=="websocket"){mi(this,e,t,400,"Invalid Upgrade header");return}if(s===void 0||!q2.test(s)){mi(this,e,t,400,"Missing or invalid Sec-WebSocket-Key header");return}if(a!==13&&a!==8){mi(this,e,t,400,"Missing or invalid Sec-WebSocket-Version header",{"Sec-WebSocket-Version":"13, 8"});return}if(!this.shouldHandle(e)){Wo(t,400);return}let c=e.headers["sec-websocket-protocol"],l=new Set;if(c!==void 0)try{l=B2.parse(c)}catch{mi(this,e,t,400,"Invalid Sec-WebSocket-Protocol header");return}let u=e.headers["sec-websocket-extensions"],f={};if(this.options.perMessageDeflate&&u!==void 0){let d=new hi(this.options.perMessageDeflate,!0,this.options.maxPayload);try{let g=Pb.parse(u);g[hi.extensionName]&&(d.accept(g[hi.extensionName]),f[hi.extensionName]=d)}catch{mi(this,e,t,400,"Invalid or unacceptable Sec-WebSocket-Extensions header");return}}if(this.options.verifyClient){let d={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(d,(g,y,b,C)=>{if(!g)return Wo(t,y||401,b,C);this.completeUpgrade(f,s,l,e,t,n,i)});return}if(!this.options.verifyClient(d))return Wo(t,401)}this.completeUpgrade(f,s,l,e,t,n,i)}completeUpgrade(e,t,n,i,s,o,a){if(!s.readable||!s.writable)return s.destroy();if(s[U2])throw new Error("server.handleUpgrade() was called more than once with the same socket, possibly due to a misconfiguration");if(this._state>Ib)return Wo(s,503);let l=["HTTP/1.1 101 Switching Protocols","Upgrade: websocket","Connection: Upgrade",`Sec-WebSocket-Accept: ${L2("sha1").update(t+F2).digest("base64")}`],u=new this.options.WebSocket(null,void 0,this.options);if(n.size){let f=this.options.handleProtocols?this.options.handleProtocols(n,i):n.values().next().value;f&&(l.push(`Sec-WebSocket-Protocol: ${f}`),u._protocol=f)}if(e[hi.extensionName]){let f=e[hi.extensionName].params,d=Pb.format({[hi.extensionName]:[f]});l.push(`Sec-WebSocket-Extensions: ${d}`),u._extensions=e}this.emit("headers",l,i),s.write(l.concat(`\r
|
|
24
24
|
`).join(`\r
|
|
25
|
-
`)),s.removeListener("error",
|
|
25
|
+
`)),s.removeListener("error",Db),u.setSocket(s,o,{allowSynchronousEvents:this.options.allowSynchronousEvents,maxPayload:this.options.maxPayload,skipUTF8Validation:this.options.skipUTF8Validation}),this.clients&&(this.clients.add(u),u.on("close",()=>{this.clients.delete(u),this._shouldEmitClose&&!this.clients.size&&process.nextTick(Ho,this)})),a(u,i)}};Bb.exports=Vd;function $2(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 Ho(r){r._state=Lb,r.emit("close")}function Db(){this.destroy()}function Wo(r,e,t,n){t=t||pl.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} ${pl.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 mi(r,e,t,n,i,s){if(r.listenerCount("wsClientError")){let o=new Error(i);Error.captureStackTrace(o,mi),r.emit("wsClientError",o,t,e)}else Wo(t,n,i,s)}});var Bb=k((VW,Lb)=>{"use strict";var gn=ul();gn.createWebSocketStream=Cb();gn.Server=Db();gn.Receiver=Bd();gn.Sender=Ud();gn.WebSocket=gn;gn.WebSocketServer=gn.Server;Lb.exports=gn});var Xd=k(xs=>{"use strict";var Kd;Object.defineProperty(xs,"__esModule",{value:!0});xs.SessionAwareAdapter=xs.Adapter=void 0;var j2=require("events"),F2=M_(),fl=Bb(),U2=typeof((Kd=fl?.Sender)===null||Kd===void 0?void 0:Kd.frame)=="function",dl=class extends j2.EventEmitter{constructor(e){super(),this.nsp=e,this.rooms=new Map,this.sids=new Map,this.encoder=e.server.encoder}init(){}close(){}serverCount(){return Promise.resolve(1)}addAll(e,t){this.sids.has(e)||this.sids.set(e,new Set);for(let n of t)this.sids.get(e).add(n),this.rooms.has(n)||(this.rooms.set(n,new Set),this.emit("create-room",n)),this.rooms.get(n).has(e)||(this.rooms.get(n).add(e),this.emit("join-room",n,e))}del(e,t){this.sids.has(e)&&this.sids.get(e).delete(t),this._del(t,e)}_del(e,t){let n=this.rooms.get(e);n!=null&&(n.delete(t)&&this.emit("leave-room",e,t),n.size===0&&this.rooms.delete(e)&&this.emit("delete-room",e))}delAll(e){if(this.sids.has(e)){for(let t of this.sids.get(e))this._del(t,e);this.sids.delete(e)}}broadcast(e,t){let n=t.flags||{},i={preEncoded:!0,volatile:n.volatile,compress:n.compress};e.nsp=this.nsp.name;let s=this._encode(e,i);this.apply(t,o=>{typeof o.notifyOutgoingListeners=="function"&&o.notifyOutgoingListeners(e),o.client.writeToEngine(s,i)})}broadcastWithAck(e,t,n,i){let s=t.flags||{},o={preEncoded:!0,volatile:s.volatile,compress:s.compress};e.nsp=this.nsp.name,e.id=this.nsp._ids++;let a=this._encode(e,o),c=0;this.apply(t,l=>{c++,l.acks.set(e.id,i),typeof l.notifyOutgoingListeners=="function"&&l.notifyOutgoingListeners(e),l.client.writeToEngine(a,o)}),n(c)}_encode(e,t){let n=this.encoder.encode(e);if(U2&&n.length===1&&typeof n[0]=="string"){let i=Buffer.from("4"+n[0]);t.wsPreEncodedFrame=fl.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}};xs.Adapter=dl;var Yd=class extends dl{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];q2(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,F2.yeast)();e.data.push(a),this.packets.push({id:a,opts:t,data:e.data,emittedAt:Date.now()})}super.broadcast(e,t)}};xs.SessionAwareAdapter=Yd;function q2(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 jb=k(Wr=>{"use strict";var $2=Wr&&Wr.__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(Wr,"__esModule",{value:!0});Wr.ClusterAdapterWithHeartbeat=Wr.ClusterAdapter=Wr.MessageType=void 0;var H2=Xd(),W2=Re(),G2=require("crypto"),Ee=(0,W2.debug)("socket.io-adapter"),z2="emitter",hl=5e3;function bs(){return(0,G2.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||(Wr.MessageType=ee={}));function gi(r){return{rooms:[...r.rooms],except:[...r.except],flags:r.flags}}function _s(r){return{rooms:new Set(r.rooms),except:new Set(r.except),flags:r.flags}}var ml=class extends H2.Adapter{constructor(e){super(e),this.requests=new Map,this.ackRequests=new Map,this.uid=bs()}onMessage(e,t){if(e.uid===this.uid)return Ee("[%s] ignore message from self",this.uid);if(e.nsp!==this.nsp.name)return Ee("[%s] ignore message from another namespace (%s)",this.uid,e.nsp);switch(Ee("[%s] new event of type %d from %s",this.uid,e.type,e.uid),e.type){case ee.BROADCAST:{if(e.data.requestId!==void 0)super.broadcastWithAck(e.data.packet,_s(e.data.opts),i=>{Ee("[%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=>{Ee("[%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=_s(e.data.opts);this.addOffsetIfNecessary(i,s,t),super.broadcast(i,s)}break}case ee.SOCKETS_JOIN:super.addSockets(_s(e.data.opts),e.data.rooms);break;case ee.SOCKETS_LEAVE:super.delSockets(_s(e.data.opts),e.data.rooms);break;case ee.DISCONNECT_SOCKETS:super.disconnectSockets(_s(e.data.opts),e.data.close);break;case ee.FETCH_SOCKETS:{Ee("[%s] calling fetchSockets with opts %j",this.uid,e.data.opts),super.fetchSockets(_s(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=$2(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,Ee("[%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:Ee("[%s] unknown message type: %s",this.uid,e.type)}}onResponse(e){var t,n;let i=e.data.requestId;switch(Ee("[%s] received response %s to request %s",this.uid,e.type,i),e.type){case 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:Ee("[%s] unknown response type: %s",this.uid,e.type)}}async broadcast(e,t){var n;if(!((n=t.flags)===null||n===void 0?void 0:n.local))try{let s=await this.publishAndReturnOffset({type:ee.BROADCAST,data:{packet:e,opts:gi(t)}});this.addOffsetIfNecessary(e,t,s)}catch(s){return Ee("[%s] error while broadcasting message: %s",this.uid,s.message)}super.broadcast(e,t)}addOffsetIfNecessary(e,t,n){var i;if(!this.nsp.server.opts.connectionStateRecovery)return;let s=e.type===2,o=e.id===void 0,a=((i=t.flags)===null||i===void 0?void 0:i.volatile)===void 0;s&&o&&a&&e.data.push(n)}broadcastWithAck(e,t,n,i){var s;if(!((s=t?.flags)===null||s===void 0?void 0:s.local)){let a=bs();this.ackRequests.set(a,{clientCountCallback:n,ack:i}),this.publish({type:ee.BROADCAST,data:{packet:e,requestId:a,opts:gi(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:gi(e),rooms:t}})}catch(s){Ee("[%s] error while publishing message: %s",this.uid,s.message)}super.addSockets(e,t)}async delSockets(e,t){var n;if(!((n=e.flags)===null||n===void 0?void 0:n.local))try{await this.publishAndReturnOffset({type:ee.SOCKETS_LEAVE,data:{opts:gi(e),rooms:t}})}catch(s){Ee("[%s] error while publishing message: %s",this.uid,s.message)}super.delSockets(e,t)}async disconnectSockets(e,t){var n;if(!((n=e.flags)===null||n===void 0?void 0:n.local))try{await this.publishAndReturnOffset({type:ee.DISCONNECT_SOCKETS,data:{opts:gi(e),close:t}})}catch(s){Ee("[%s] error while publishing message: %s",this.uid,s.message)}super.disconnectSockets(e,t)}async fetchSockets(e){var t;let[n,i]=await Promise.all([super.fetchSockets(e),this.serverCount()]),s=i-1;if(!((t=e.flags)===null||t===void 0)&&t.local||s<=0)return n;let o=bs();return new Promise((a,c)=>{let l=setTimeout(()=>{let f=this.requests.get(o);f&&(c(new Error(`timeout reached: only ${f.current} responses received out of ${f.expected}`)),this.requests.delete(o))},e.flags.timeout||hl),u={type:ee.FETCH_SOCKETS,resolve:a,timeout:l,current:0,expected:s,responses:n};this.requests.set(o,u),this.publish({type:ee.FETCH_SOCKETS,data:{opts:gi(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(Ee('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,i),i<=0)return n(null,[]);let s=bs(),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))},hl),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){Ee("[%s] sending message %s",this.uid,e.type),this.publishAndReturnOffset(e).catch(t=>{Ee("[%s] error while publishing message: %s",this.uid,t)})}publishAndReturnOffset(e){return e.uid=this.uid,e.nsp=this.nsp.name,this.doPublish(e)}publishResponse(e,t){t.uid=this.uid,t.nsp=this.nsp.name,Ee("[%s] sending response %s to %s",this.uid,t.type,e),this.doPublishResponse(e,t).catch(n=>{Ee("[%s] error while publishing response: %s",this.uid,n)})}};Wr.ClusterAdapter=ml;var Jd=class extends ml{constructor(e,t){super(e),this.nodesMap=new Map,this.customRequests=new Map,this._opts=Object.assign({heartbeatInterval:5e3,heartbeatTimeout:1e4},t),this.cleanupTimer=setInterval(()=>{let n=Date.now();this.nodesMap.forEach((i,s)=>{n-i>this._opts.heartbeatTimeout&&(Ee("[%s] node %s seems down",this.uid,s),this.removeNode(s))})},1e3)}init(){this.publish({type: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 Ee("[%s] ignore message from self",this.uid);switch(e.uid&&e.uid!==z2&&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(Ee('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,i),i<=0)return n(null,[]);let s=bs(),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))},hl),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=bs();return new Promise((a,c)=>{let l=setTimeout(()=>{let f=this.customRequests.get(o);f&&(c(new Error(`timeout reached: missing ${f.missingUids.size} responses`)),this.customRequests.delete(o))},e.flags.timeout||hl),u={type:ee.FETCH_SOCKETS,resolve:a,timeout:l,missingUids:new Set([...this.nodesMap.keys()]),responses:n};this.customRequests.set(o,u),this.publish({type:ee.FETCH_SOCKETS,data:{opts:gi(e),requestId:o}})})}onResponse(e){let t=e.data.requestId;switch(Ee("[%s] received response %s to request %s",this.uid,e.type,t),e.type){case 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)}};Wr.ClusterAdapterWithHeartbeat=Jd});var gl=k(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.MessageType=hr.ClusterAdapterWithHeartbeat=hr.ClusterAdapter=hr.SessionAwareAdapter=hr.Adapter=void 0;var Fb=Xd();Object.defineProperty(hr,"Adapter",{enumerable:!0,get:function(){return Fb.Adapter}});Object.defineProperty(hr,"SessionAwareAdapter",{enumerable:!0,get:function(){return Fb.SessionAwareAdapter}});var Zd=jb();Object.defineProperty(hr,"ClusterAdapter",{enumerable:!0,get:function(){return Zd.ClusterAdapter}});Object.defineProperty(hr,"ClusterAdapterWithHeartbeat",{enumerable:!0,get:function(){return Zd.ClusterAdapterWithHeartbeat}});Object.defineProperty(hr,"MessageType",{enumerable:!0,get:function(){return Zd.MessageType}})});var $b=k(ws=>{"use strict";var V2=ws&&ws.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ws,"__esModule",{value:!0});ws.ParentNamespace=void 0;var Ub=Td(),K2=gl(),Y2=V2(Re()),qb=(0,Y2.default)("socket.io:parent-namespace"),vl=class r extends Ub.Namespace{constructor(e){super(e,"/_"+r.count++),this.children=new Set}_initAdapter(){this.adapter=new Qd(this)}emit(e,...t){return this.children.forEach(n=>{n.emit(e,...t)}),!0}createChild(e){qb("creating child namespace %s",e);let t=new Ub.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&&(qb("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")}};ws.ParentNamespace=vl;vl.count=0;var Qd=class extends K2.Adapter{broadcast(e,t){this.nsp.children.forEach(n=>{n.adapter.broadcast(e,t)})}}});var Kb=k(yi=>{"use strict";var X2=yi&&yi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(yi,"__esModule",{value:!0});yi.patchAdapter=Z2;yi.restoreAdapter=Q2;yi.serveFile=tB;var vi=gl(),Hb=require("fs"),J2=X2(Re()),yl=(0,J2.default)("socket.io:adapter-uws"),eh="",{addAll:Gb,del:zb,broadcast:Vb}=vi.Adapter.prototype;function Z2(r){vi.Adapter.prototype.addAll=function(e,t){let n=!this.sids.has(e);Gb.call(this,e,t);let i=this.nsp.sockets.get(e)||this.nsp._preConnectSockets.get(e);if(i){if(i.conn.transport.name==="websocket"){Wb(this.nsp.name,i,n,t);return}n&&i.conn.on("upgrade",()=>{let s=this.sids.get(e);s&&Wb(this.nsp.name,i,n,s)})}},vi.Adapter.prototype.del=function(e,t){zb.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}${eh}${t}`;yl("unsubscribe connection %s from topic %s",i,o),s.unsubscribe(o)}},vi.Adapter.prototype.broadcast=function(e,t){if(!(t.rooms.size<=1&&t.except.size===0)){Vb.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}${eh}${t.rooms.keys().next().value}`;yl("fast publish to %s",a),o.forEach(c=>{let l=typeof c!="string";r.publish(a,l?c:"4"+c,l)}),this.apply(t,c=>{c.conn.transport.name!=="websocket"&&c.client.writeToEngine(o,s)})}}function Wb(r,e,t,n){let i=e.conn.id,s=e.conn.transport.socket;t&&(yl("subscribe connection %s to topic %s",i,r),s.subscribe(r)),n.forEach(o=>{let a=`${r}${eh}${o}`;yl("subscribe connection %s to topic %s",i,a),s.subscribe(a)})}function Q2(){vi.Adapter.prototype.addAll=Gb,vi.Adapter.prototype.del=zb,vi.Adapter.prototype.broadcast=Vb}var eB=r=>{let{buffer:e,byteOffset:t,byteLength:n}=r;return e.slice(t,t+n)};function tB(r,e){let{size:t}=(0,Hb.statSync)(e),n=(0,Hb.createReadStream)(e),i=()=>!n.destroyed&&n.destroy(),s=a=>{throw i(),a},o=a=>{let c=eB(a);r.cork(()=>{let l=r.getWriteOffset(),[u,f]=r.tryEnd(c,t);!f&&!u&&(n.pause(),r.onWritable(d=>{let[g,y]=r.tryEnd(c.slice(d-l),t);return!y&&g&&n.resume(),g}))})};r.onAborted(i),n.on("data",o).on("error",s).on("end",i)}});var Yb=k((QW,rB)=>{rB.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 nw=k((Tt,Go)=>{"use strict";var nB=Tt&&Tt.__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]})),iB=Tt&&Tt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),sB=Tt&&Tt.__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)&&nB(e,r,t);return iB(e,r),e},nh=Tt&&Tt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Tt,"__esModule",{value:!0});Tt.Namespace=Tt.Socket=Tt.Server=void 0;var oB=nh(require("http")),aB=require("fs"),th=require("zlib"),cB=oc(),xl=require("stream"),Xb=require("path"),Jb=f_(),lB=w_(),Zb=require("events"),ih=Td();Object.defineProperty(Tt,"Namespace",{enumerable:!0,get:function(){return ih.Namespace}});var uB=$b(),Qb=gl(),pB=sB(Do()),fB=nh(Re()),rw=Sd();Object.defineProperty(Tt,"Socket",{enumerable:!0,get:function(){return rw.Socket}});var dB=Kc(),rh=Kb(),hB=nh(nd()),Pt=(0,fB.default)("socket.io:server"),ew=Yb().version,tw=/\.map/,Ss=class r extends dB.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||pB,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||Qb.SessionAwareAdapter)):this.adapter(t.adapter||Qb.Adapter),t.cleanupEmptyChildNamespaces=!!t.cleanupEmptyChildNamespaces,this.sockets=this.of("/"),(e||typeof e=="number")&&this.attach(e),this.opts.cors&&(this._corsMiddleware=(0,hB.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 Pt("dynamic namespace %s already exists",e),n(this._nsps.get(e));let l=this.parentNsps.get(o.value).createChild(e);Pt("dynamic namespace %s was created",e),n(l)})};s()}path(e){if(!arguments.length)return this._path;this._path=e.replace(/\/$/,"");let t=this._path.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");return this.clientPathRegex=new RegExp("^"+t+"/socket\\.io(\\.msgpack|\\.esm)?(\\.min)?\\.js(\\.map)?(?:\\?|$)"),this}connectTimeout(e){return e===void 0?this._connectTimeout:(this._connectTimeout=e,this)}adapter(e){if(!arguments.length)return this._adapter;this._adapter=e;for(let t of this._nsps.values())t._initAdapter();return this}listen(e,t={}){return this.attach(e,t)}attach(e,t={}){if(typeof e=="function"){let n="You are trying to attach socket.io to an express request handler function. Please pass a http.Server instance.";throw new Error(n)}if(Number(e)==e&&(e=Number(e)),typeof e=="number"){Pt("creating http server and binding to %d",e);let n=e;e=oB.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,Pt("creating uWebSockets.js-based engine with opts %j",t);let n=new Jb.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=tw.test(o),c=a?"map":"source",l='"'+ew+'"',u="W/"+l,f=s.getHeader("if-none-match");if(f&&(l===f||u===f)){Pt("serve client %s 304",c),i.writeStatus("304 Not Modified"),i.end();return}Pt("serve client %s",c),i.writeHeader("cache-control","public, max-age=0"),i.writeHeader("content-type","application/"+(a?"json":"javascript")+"; charset=utf-8"),i.writeHeader("etag",l);let d=Xb.join(__dirname,"../client-dist/",o);(0,rh.serveFile)(i,d)}),(0,rh.patchAdapter)(e)}initEngine(e,t){Pt("creating engine.io instance with opts %j",t),this.eio=(0,Jb.attach)(e,t),this._serveClient&&this.attachServe(e),this.httpServer=e,this.bind(this.eio)}attachServe(e){Pt("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=tw.test(n),s=i?"map":"source",o='"'+ew+'"',a="W/"+o,c=e.headers["if-none-match"];if(c&&(o===c||a===c)){Pt("serve client %s 304",s),t.writeHead(304),t.end();return}Pt("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,aB.createReadStream)(Xb.join(__dirname,"../client-dist/",e)),s=cB(t).encodings(["br","gzip","deflate"]),o=a=>{a&&n.end()};switch(s){case"br":n.writeHead(200,{"content-encoding":"br"}),(0,xl.pipeline)(i,(0,th.createBrotliCompress)(),n,o);break;case"gzip":n.writeHead(200,{"content-encoding":"gzip"}),(0,xl.pipeline)(i,(0,th.createGzip)(),n,o);break;case"deflate":n.writeHead(200,{"content-encoding":"deflate"}),(0,xl.pipeline)(i,(0,th.createDeflate)(),n,o);break;default:n.writeHead(200),(0,xl.pipeline)(i,n,o)}}bind(e){return this.engine=e,this.engine.on("connection",this.onconnection.bind(this)),this}onconnection(e){Pt("incoming connection with id %s",e.id);let t=new lB.Client(this,e);return e.protocol===3&&t.connect("/"),this}of(e,t){if(typeof e=="function"||e instanceof RegExp){let i=new uB.ParentNamespace(this);return Pt("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 Pt("attaching namespace %s to parent namespace %s",e,i),s.createChild(e);Pt("initializing namespace %s",e),n=new ih.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,rh.restoreAdapter)(),this.httpServer)return new Promise(t=>{this.httpServer.close(n=>{e&&e(n),n&&Pt("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)}};Tt.Server=Ss;var mB=Object.keys(Zb.EventEmitter.prototype).filter(function(r){return typeof Zb.EventEmitter.prototype[r]=="function"});mB.forEach(function(r){Ss.prototype[r]=function(){return this.sockets[r].apply(this.sockets,arguments)}});Go.exports=(r,e)=>new Ss(r,e);Go.exports.Server=Ss;Go.exports.Namespace=ih.Namespace;Go.exports.Socket=rw.Socket});function sh(){return zo=(0,ow.randomBytes)(32).toString("hex"),zo}function aw(){return zo||sh(),zo}function cw(r){return!!r&&typeof r=="string"&&r===zo}var ow,zo,_l=Ce(()=>{ow=require("crypto"),zo=null});var vw,Sl,H,dt=Ce(()=>{vw={darwin:{capture:"nodeScreenshots",encoder:"sharp",tileSize:128,inputFormat:"rgba"},win32:{capture:"nodeScreenshots",encoder:"sharp",tileSize:256,inputFormat:"rgba"},linux:{capture:"nodeScreenshots",encoder:"sharp",tileSize:256,inputFormat:"rgba"}},Sl=vw[process.platform]||vw.linux,H={pipeline:{captureLib:Sl.capture,encoder:Sl.encoder,inputFormat:Sl.inputFormat,tileSize:Sl.tileSize,tileFormat:"webp",webpEffort:0,jpegQuality:50,tileConcurrency:6,outputScale:1,scaleMode:"smooth",minOutputScale:.25,maxOutputScale:1,qualityFloor:85,tierHysteresis:.05,adaptiveTiers:[{minEffective:1,outputScale:1,jpegQuality:85},{minEffective:.7,outputScale:.95,jpegQuality:85},{minEffective:.4,outputScale:.8,jpegQuality:85},{minEffective:0,outputScale:.65,jpegQuality:85}],checksumSampling:{rowStep:3,colStep:8}},webrtc:{enableWebRTC:!0,enableTurn:!1,turnApiUrl:"https://9remote.cc/api/webrtc/turn-credentials",turnRefreshInterval:1380*60*1e3,dcMaxMessageSize:65536,dcBufferThreshold:262144,iceDisconnectGraceMs:6e3,dcChunkSize:8,dcMaxTilesPerFrame:32,dcReliable:!0,dcOrdered:!1,answerTimeout:1e4,maxControlBuffer:500},robotSettings:{mouseDelay:2,keyboardDelay:2},throttling:{mouseThrottle:8,keyThrottle:25,typeTextThrottle:100,maxTextLength:1e3},resourceManagement:{inactiveTimeout:120*1e3,memoryCheckInterval:6e4,memoryWarningThreshold:1e3,maxTimersPerClient:100,maxChunkTimersPerClient:50,disconnectGraceMs:3e4},streaming:{activeInterval:60,idleInterval:400,idleThreshold:3,actionCaptureDelay:50,chunkSize:32,chunkDelay:5},focus:{paddingTiles:4},clipboard:{enabled:!0,pollInterval:1e3,maxTextLength:2e4},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 Vo,Ko,ve,ph=Ce(()=>{dt();ri();Vo=()=>H.logging,Ko=Fr("remote"),ve={lifecycle:r=>{Vo().lifecycle&&Ko.info(r)},focus:r=>{Vo().focus&&Ko.info(r)},dpi:r=>{Vo().dpiDetection&&Ko.info(r)},error:(r,e)=>{Vo().errors&&Ko.error(`${r} ${e?.message||e||""}`)},warn:r=>{Vo().errors&&Ko.warn(r)}}});function Xo(){for(let r of[se.ROOT,se.STATE])Gr.default.existsSync(r)||Gr.default.mkdirSync(r,{recursive:!0})}function hh(){try{return Xo(),Gr.default.existsSync(dh)?JSON.parse(Gr.default.readFileSync(dh,"utf8"))||{}:{}}catch{return{}}}function Sw(r){try{Xo();let e={...hh(),...r};return Gr.default.writeFileSync(dh,JSON.stringify(e,null,2),{mode:384}),e}catch(e){return console.error("Error saving settings:",e),null}}function Ew(){try{return Xo(),Gr.default.existsSync(fh)?JSON.parse(Gr.default.readFileSync(fh,"utf8")):{machineId:null,key:null,name:"Default",createdAt:null}}catch{return{machineId:null,key:null,name:"Default",createdAt:null}}}function Wn(r){try{Xo(),Gr.default.writeFileSync(kB,JSON.stringify({cmd:r,ts:Date.now()}))}catch{}}function Tw(r,e,t="Default"){try{Xo();let n={machineId:r,key:e,name:t,createdAt:new Date().toISOString()};return Gr.default.writeFileSync(fh,JSON.stringify(n,null,2),{mode:384}),n}catch(n){return console.error("Error saving key:",n),null}}var Gr,Yo,A8,k8,fh,kB,dh,Ts=Ce(()=>{Gr=W(require("fs"),1),Yo=W(require("path"),1);St();A8=se.STATE,k8=Yo.default.join(se.STATE,"state.json"),fh=Yo.default.join(se.ROOT,"keys.json"),kB=Yo.default.join(se.STATE,"cmd.json"),dh=Yo.default.join(se.STATE,"settings.json")});function Cw(){return new Promise(r=>{if(process.platform!=="darwin"){r({screenRecording:!0,accessibility:!0});return}let e=!1,t=!1,n=0,i=()=>{++n===2&&r({screenRecording:e,accessibility:t})};(0,Jo.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,Jo.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 Aw(r){let e=RB[r];e&&process.platform==="darwin"&&(0,Jo.exec)(`open "${e}"`,()=>{})}var Jo,RB,kw=Ce(()=>{Jo=require("child_process"),RB={screenRecording:"x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture",accessibility:"x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility"}});function OB(){return!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY}function ea(){for(let r=Rw,e=null;r!==e;e=r,r=Mr.default.dirname(r)){let t=Mr.default.join(r,"package.json");if((0,de.existsSync)(t)){try{let n=JSON.parse((0,de.readFileSync)(t,"utf8"));if(n.name!==Wi)continue;let i=typeof n.bin=="string"?n.bin:n.bin?.[Wi];if(i){let s=Mr.default.resolve(r,i);if((0,de.existsSync)(s))return s}}catch{}break}}return process.argv[1]||Mr.default.resolve(Rw,"..","index.js")}function ks(){return process.execPath}function Pw(){let r=Mr.default.dirname(ks()),e=["/usr/local/bin","/usr/bin","/bin","/usr/sbin","/sbin","/opt/homebrew/bin"];return e.includes(r)||e.unshift(r),e.join(":")}function mh(r){return String(r).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function MB(r,e){let t=[r,e,...kl].map(n=>` <string>${mh(n)}</string>`).join(`
|
|
29
|
+
`+t)}function mi(r,e,t,n,i,s){if(r.listenerCount("wsClientError")){let o=new Error(i);Error.captureStackTrace(o,mi),r.emit("wsClientError",o,t,e)}else Wo(t,n,i,s)}});var Ub=A((QW,Fb)=>{"use strict";var vn=ul();vn.createWebSocketStream=Rb();vn.Server=jb();vn.Receiver=Bd();vn.Sender=Ud();vn.WebSocket=vn;vn.WebSocketServer=vn.Server;Fb.exports=vn});var Xd=A(xs=>{"use strict";var Kd;Object.defineProperty(xs,"__esModule",{value:!0});xs.SessionAwareAdapter=xs.Adapter=void 0;var H2=require("events"),W2=N_(),fl=Ub(),G2=typeof((Kd=fl?.Sender)===null||Kd===void 0?void 0:Kd.frame)=="function",dl=class extends H2.EventEmitter{constructor(e){super(),this.nsp=e,this.rooms=new Map,this.sids=new Map,this.encoder=e.server.encoder}init(){}close(){}serverCount(){return Promise.resolve(1)}addAll(e,t){this.sids.has(e)||this.sids.set(e,new Set);for(let n of t)this.sids.get(e).add(n),this.rooms.has(n)||(this.rooms.set(n,new Set),this.emit("create-room",n)),this.rooms.get(n).has(e)||(this.rooms.get(n).add(e),this.emit("join-room",n,e))}del(e,t){this.sids.has(e)&&this.sids.get(e).delete(t),this._del(t,e)}_del(e,t){let n=this.rooms.get(e);n!=null&&(n.delete(t)&&this.emit("leave-room",e,t),n.size===0&&this.rooms.delete(e)&&this.emit("delete-room",e))}delAll(e){if(this.sids.has(e)){for(let t of this.sids.get(e))this._del(t,e);this.sids.delete(e)}}broadcast(e,t){let n=t.flags||{},i={preEncoded:!0,volatile:n.volatile,compress:n.compress};e.nsp=this.nsp.name;let s=this._encode(e,i);this.apply(t,o=>{typeof o.notifyOutgoingListeners=="function"&&o.notifyOutgoingListeners(e),o.client.writeToEngine(s,i)})}broadcastWithAck(e,t,n,i){let s=t.flags||{},o={preEncoded:!0,volatile:s.volatile,compress:s.compress};e.nsp=this.nsp.name,e.id=this.nsp._ids++;let a=this._encode(e,o),c=0;this.apply(t,l=>{c++,l.acks.set(e.id,i),typeof l.notifyOutgoingListeners=="function"&&l.notifyOutgoingListeners(e),l.client.writeToEngine(a,o)}),n(c)}_encode(e,t){let n=this.encoder.encode(e);if(G2&&n.length===1&&typeof n[0]=="string"){let i=Buffer.from("4"+n[0]);t.wsPreEncodedFrame=fl.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}};xs.Adapter=dl;var Yd=class extends dl{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];z2(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,W2.yeast)();e.data.push(a),this.packets.push({id:a,opts:t,data:e.data,emittedAt:Date.now()})}super.broadcast(e,t)}};xs.SessionAwareAdapter=Yd;function z2(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 qb=A(Wr=>{"use strict";var V2=Wr&&Wr.__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(Wr,"__esModule",{value:!0});Wr.ClusterAdapterWithHeartbeat=Wr.ClusterAdapter=Wr.MessageType=void 0;var K2=Xd(),Y2=Oe(),X2=require("crypto"),Te=(0,Y2.debug)("socket.io-adapter"),J2="emitter",hl=5e3;function bs(){return(0,X2.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||(Wr.MessageType=ee={}));function gi(r){return{rooms:[...r.rooms],except:[...r.except],flags:r.flags}}function _s(r){return{rooms:new Set(r.rooms),except:new Set(r.except),flags:r.flags}}var ml=class extends K2.Adapter{constructor(e){super(e),this.requests=new Map,this.ackRequests=new Map,this.uid=bs()}onMessage(e,t){if(e.uid===this.uid)return Te("[%s] ignore message from self",this.uid);if(e.nsp!==this.nsp.name)return Te("[%s] ignore message from another namespace (%s)",this.uid,e.nsp);switch(Te("[%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,_s(e.data.opts),i=>{Te("[%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=>{Te("[%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=_s(e.data.opts);this.addOffsetIfNecessary(i,s,t),super.broadcast(i,s)}break}case ee.SOCKETS_JOIN:super.addSockets(_s(e.data.opts),e.data.rooms);break;case ee.SOCKETS_LEAVE:super.delSockets(_s(e.data.opts),e.data.rooms);break;case ee.DISCONNECT_SOCKETS:super.disconnectSockets(_s(e.data.opts),e.data.close);break;case ee.FETCH_SOCKETS:{Te("[%s] calling fetchSockets with opts %j",this.uid,e.data.opts),super.fetchSockets(_s(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=V2(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,Te("[%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:Te("[%s] unknown message type: %s",this.uid,e.type)}}onResponse(e){var t,n;let i=e.data.requestId;switch(Te("[%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:Te("[%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:gi(t)}});this.addOffsetIfNecessary(e,t,s)}catch(s){return Te("[%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=bs();this.ackRequests.set(a,{clientCountCallback:n,ack:i}),this.publish({type:ee.BROADCAST,data:{packet:e,requestId:a,opts:gi(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:gi(e),rooms:t}})}catch(s){Te("[%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:gi(e),rooms:t}})}catch(s){Te("[%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:gi(e),close:t}})}catch(s){Te("[%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=bs();return new Promise((a,c)=>{let l=setTimeout(()=>{let f=this.requests.get(o);f&&(c(new Error(`timeout reached: only ${f.current} responses received out of ${f.expected}`)),this.requests.delete(o))},e.flags.timeout||hl),u={type:ee.FETCH_SOCKETS,resolve:a,timeout:l,current:0,expected:s,responses:n};this.requests.set(o,u),this.publish({type:ee.FETCH_SOCKETS,data:{opts:gi(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(Te('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,i),i<=0)return n(null,[]);let s=bs(),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))},hl),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){Te("[%s] sending message %s",this.uid,e.type),this.publishAndReturnOffset(e).catch(t=>{Te("[%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,Te("[%s] sending response %s to %s",this.uid,t.type,e),this.doPublishResponse(e,t).catch(n=>{Te("[%s] error while publishing response: %s",this.uid,n)})}};Wr.ClusterAdapter=ml;var Jd=class extends ml{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&&(Te("[%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 Te("[%s] ignore message from self",this.uid);switch(e.uid&&e.uid!==J2&&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(Te('[%s] waiting for %d responses to "serverSideEmit" request',this.uid,i),i<=0)return n(null,[]);let s=bs(),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))},hl),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=bs();return new Promise((a,c)=>{let l=setTimeout(()=>{let f=this.customRequests.get(o);f&&(c(new Error(`timeout reached: missing ${f.missingUids.size} responses`)),this.customRequests.delete(o))},e.flags.timeout||hl),u={type:ee.FETCH_SOCKETS,resolve:a,timeout:l,missingUids:new Set([...this.nodesMap.keys()]),responses:n};this.customRequests.set(o,u),this.publish({type:ee.FETCH_SOCKETS,data:{opts:gi(e),requestId:o}})})}onResponse(e){let t=e.data.requestId;switch(Te("[%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)}};Wr.ClusterAdapterWithHeartbeat=Jd});var gl=A(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.MessageType=hr.ClusterAdapterWithHeartbeat=hr.ClusterAdapter=hr.SessionAwareAdapter=hr.Adapter=void 0;var $b=Xd();Object.defineProperty(hr,"Adapter",{enumerable:!0,get:function(){return $b.Adapter}});Object.defineProperty(hr,"SessionAwareAdapter",{enumerable:!0,get:function(){return $b.SessionAwareAdapter}});var Zd=qb();Object.defineProperty(hr,"ClusterAdapter",{enumerable:!0,get:function(){return Zd.ClusterAdapter}});Object.defineProperty(hr,"ClusterAdapterWithHeartbeat",{enumerable:!0,get:function(){return Zd.ClusterAdapterWithHeartbeat}});Object.defineProperty(hr,"MessageType",{enumerable:!0,get:function(){return Zd.MessageType}})});var Gb=A(ws=>{"use strict";var Z2=ws&&ws.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ws,"__esModule",{value:!0});ws.ParentNamespace=void 0;var Hb=Td(),Q2=gl(),eB=Z2(Oe()),Wb=(0,eB.default)("socket.io:parent-namespace"),vl=class r extends Hb.Namespace{constructor(e){super(e,"/_"+r.count++),this.children=new Set}_initAdapter(){this.adapter=new Qd(this)}emit(e,...t){return this.children.forEach(n=>{n.emit(e,...t)}),!0}createChild(e){Wb("creating child namespace %s",e);let t=new Hb.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&&(Wb("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")}};ws.ParentNamespace=vl;vl.count=0;var Qd=class extends Q2.Adapter{broadcast(e,t){this.nsp.children.forEach(n=>{n.adapter.broadcast(e,t)})}}});var Jb=A(yi=>{"use strict";var tB=yi&&yi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(yi,"__esModule",{value:!0});yi.patchAdapter=nB;yi.restoreAdapter=iB;yi.serveFile=oB;var vi=gl(),zb=require("fs"),rB=tB(Oe()),yl=(0,rB.default)("socket.io:adapter-uws"),eh="",{addAll:Kb,del:Yb,broadcast:Xb}=vi.Adapter.prototype;function nB(r){vi.Adapter.prototype.addAll=function(e,t){let n=!this.sids.has(e);Kb.call(this,e,t);let i=this.nsp.sockets.get(e)||this.nsp._preConnectSockets.get(e);if(i){if(i.conn.transport.name==="websocket"){Vb(this.nsp.name,i,n,t);return}n&&i.conn.on("upgrade",()=>{let s=this.sids.get(e);s&&Vb(this.nsp.name,i,n,s)})}},vi.Adapter.prototype.del=function(e,t){Yb.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}${eh}${t}`;yl("unsubscribe connection %s from topic %s",i,o),s.unsubscribe(o)}},vi.Adapter.prototype.broadcast=function(e,t){if(!(t.rooms.size<=1&&t.except.size===0)){Xb.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}${eh}${t.rooms.keys().next().value}`;yl("fast publish to %s",a),o.forEach(c=>{let l=typeof c!="string";r.publish(a,l?c:"4"+c,l)}),this.apply(t,c=>{c.conn.transport.name!=="websocket"&&c.client.writeToEngine(o,s)})}}function Vb(r,e,t,n){let i=e.conn.id,s=e.conn.transport.socket;t&&(yl("subscribe connection %s to topic %s",i,r),s.subscribe(r)),n.forEach(o=>{let a=`${r}${eh}${o}`;yl("subscribe connection %s to topic %s",i,a),s.subscribe(a)})}function iB(){vi.Adapter.prototype.addAll=Kb,vi.Adapter.prototype.del=Yb,vi.Adapter.prototype.broadcast=Xb}var sB=r=>{let{buffer:e,byteOffset:t,byteLength:n}=r;return e.slice(t,t+n)};function oB(r,e){let{size:t}=(0,zb.statSync)(e),n=(0,zb.createReadStream)(e),i=()=>!n.destroyed&&n.destroy(),s=a=>{throw i(),a},o=a=>{let c=sB(a);r.cork(()=>{let l=r.getWriteOffset(),[u,f]=r.tryEnd(c,t);!f&&!u&&(n.pause(),r.onWritable(d=>{let[g,y]=r.tryEnd(c.slice(d-l),t);return!y&&g&&n.resume(),g}))})};r.onAborted(i),n.on("data",o).on("error",s).on("end",i)}});var Zb=A((s8,aB)=>{aB.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 ow=A((Tt,Go)=>{"use strict";var cB=Tt&&Tt.__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]})),lB=Tt&&Tt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),uB=Tt&&Tt.__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)&&cB(e,r,t);return lB(e,r),e},nh=Tt&&Tt.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Tt,"__esModule",{value:!0});Tt.Namespace=Tt.Socket=Tt.Server=void 0;var pB=nh(require("http")),fB=require("fs"),th=require("zlib"),dB=oc(),xl=require("stream"),Qb=require("path"),ew=m_(),hB=T_(),tw=require("events"),ih=Td();Object.defineProperty(Tt,"Namespace",{enumerable:!0,get:function(){return ih.Namespace}});var mB=Gb(),rw=gl(),gB=uB(Do()),vB=nh(Oe()),sw=Sd();Object.defineProperty(Tt,"Socket",{enumerable:!0,get:function(){return sw.Socket}});var yB=Kc(),rh=Jb(),xB=nh(nd()),Pt=(0,vB.default)("socket.io:server"),nw=Zb().version,iw=/\.map/,Ss=class r extends yB.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||gB,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||rw.SessionAwareAdapter)):this.adapter(t.adapter||rw.Adapter),t.cleanupEmptyChildNamespaces=!!t.cleanupEmptyChildNamespaces,this.sockets=this.of("/"),(e||typeof e=="number")&&this.attach(e),this.opts.cors&&(this._corsMiddleware=(0,xB.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 Pt("dynamic namespace %s already exists",e),n(this._nsps.get(e));let l=this.parentNsps.get(o.value).createChild(e);Pt("dynamic namespace %s was created",e),n(l)})};s()}path(e){if(!arguments.length)return this._path;this._path=e.replace(/\/$/,"");let t=this._path.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&");return this.clientPathRegex=new RegExp("^"+t+"/socket\\.io(\\.msgpack|\\.esm)?(\\.min)?\\.js(\\.map)?(?:\\?|$)"),this}connectTimeout(e){return e===void 0?this._connectTimeout:(this._connectTimeout=e,this)}adapter(e){if(!arguments.length)return this._adapter;this._adapter=e;for(let t of this._nsps.values())t._initAdapter();return this}listen(e,t={}){return this.attach(e,t)}attach(e,t={}){if(typeof e=="function"){let n="You are trying to attach socket.io to an express request handler function. Please pass a http.Server instance.";throw new Error(n)}if(Number(e)==e&&(e=Number(e)),typeof e=="number"){Pt("creating http server and binding to %d",e);let n=e;e=pB.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,Pt("creating uWebSockets.js-based engine with opts %j",t);let n=new ew.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=iw.test(o),c=a?"map":"source",l='"'+nw+'"',u="W/"+l,f=s.getHeader("if-none-match");if(f&&(l===f||u===f)){Pt("serve client %s 304",c),i.writeStatus("304 Not Modified"),i.end();return}Pt("serve client %s",c),i.writeHeader("cache-control","public, max-age=0"),i.writeHeader("content-type","application/"+(a?"json":"javascript")+"; charset=utf-8"),i.writeHeader("etag",l);let d=Qb.join(__dirname,"../client-dist/",o);(0,rh.serveFile)(i,d)}),(0,rh.patchAdapter)(e)}initEngine(e,t){Pt("creating engine.io instance with opts %j",t),this.eio=(0,ew.attach)(e,t),this._serveClient&&this.attachServe(e),this.httpServer=e,this.bind(this.eio)}attachServe(e){Pt("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=iw.test(n),s=i?"map":"source",o='"'+nw+'"',a="W/"+o,c=e.headers["if-none-match"];if(c&&(o===c||a===c)){Pt("serve client %s 304",s),t.writeHead(304),t.end();return}Pt("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,fB.createReadStream)(Qb.join(__dirname,"../client-dist/",e)),s=dB(t).encodings(["br","gzip","deflate"]),o=a=>{a&&n.end()};switch(s){case"br":n.writeHead(200,{"content-encoding":"br"}),(0,xl.pipeline)(i,(0,th.createBrotliCompress)(),n,o);break;case"gzip":n.writeHead(200,{"content-encoding":"gzip"}),(0,xl.pipeline)(i,(0,th.createGzip)(),n,o);break;case"deflate":n.writeHead(200,{"content-encoding":"deflate"}),(0,xl.pipeline)(i,(0,th.createDeflate)(),n,o);break;default:n.writeHead(200),(0,xl.pipeline)(i,n,o)}}bind(e){return this.engine=e,this.engine.on("connection",this.onconnection.bind(this)),this}onconnection(e){Pt("incoming connection with id %s",e.id);let t=new hB.Client(this,e);return e.protocol===3&&t.connect("/"),this}of(e,t){if(typeof e=="function"||e instanceof RegExp){let i=new mB.ParentNamespace(this);return Pt("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 Pt("attaching namespace %s to parent namespace %s",e,i),s.createChild(e);Pt("initializing namespace %s",e),n=new ih.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,rh.restoreAdapter)(),this.httpServer)return new Promise(t=>{this.httpServer.close(n=>{e&&e(n),n&&Pt("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)}};Tt.Server=Ss;var _B=Object.keys(tw.EventEmitter.prototype).filter(function(r){return typeof tw.EventEmitter.prototype[r]=="function"});_B.forEach(function(r){Ss.prototype[r]=function(){return this.sockets[r].apply(this.sockets,arguments)}});Go.exports=(r,e)=>new Ss(r,e);Go.exports.Server=Ss;Go.exports.Namespace=ih.Namespace;Go.exports.Socket=sw.Socket});function sh(){return zo=(0,lw.randomBytes)(32).toString("hex"),zo}function uw(){return zo||sh(),zo}function pw(r){return!!r&&typeof r=="string"&&r===zo}var lw,zo,_l=ke(()=>{lw=require("crypto"),zo=null});var _w,Sl,H,dt=ke(()=>{_w={darwin:{capture:"nodeScreenshots",encoder:"sharp",tileSize:128,inputFormat:"rgba"},win32:{capture:"nodeScreenshots",encoder:"sharp",tileSize:256,inputFormat:"rgba"},linux:{capture:"nodeScreenshots",encoder:"sharp",tileSize:256,inputFormat:"rgba"}},Sl=_w[process.platform]||_w.linux,H={pipeline:{captureLib:Sl.capture,encoder:Sl.encoder,inputFormat:Sl.inputFormat,tileSize:Sl.tileSize,tileFormat:"webp",webpEffort:0,jpegQuality:50,tileConcurrency:6,outputScale:1,scaleMode:"smooth",minOutputScale:.25,maxOutputScale:1,qualityFloor:85,tierHysteresis:.05,adaptiveTiers:[{minEffective:1,outputScale:1,jpegQuality:85},{minEffective:.7,outputScale:.95,jpegQuality:85},{minEffective:.4,outputScale:.8,jpegQuality:85},{minEffective:0,outputScale:.65,jpegQuality:85}],checksumSampling:{rowStep:3,colStep:8}},webrtc:{enableWebRTC:!0,enableTurn:!1,turnApiUrl:"https://9remote.cc/api/webrtc/turn-credentials",turnRefreshInterval:1380*60*1e3,dcMaxMessageSize:65536,dcBufferThreshold:262144,iceDisconnectGraceMs:6e3,dcChunkSize:8,dcMaxTilesPerFrame:32,dcReliable:!0,dcOrdered:!1,answerTimeout:1e4,maxControlBuffer:500,ackWindow:2,ackPollMs:20,ackTimeoutMs:1500},robotSettings:{mouseDelay:2,keyboardDelay:2},throttling:{mouseThrottle:8,keyThrottle:25,typeTextThrottle:100,maxTextLength:1e3},resourceManagement:{inactiveTimeout:120*1e3,memoryCheckInterval:6e4,memoryWarningThreshold:1e3,maxTimersPerClient:100,maxChunkTimersPerClient:50,disconnectGraceMs:3e4},streaming:{activeInterval:60,idleInterval:400,idleThreshold:3,actionCaptureDelay:50,chunkSize:32,chunkDelay:5},focus:{paddingTiles:4},clipboard:{enabled:!0,pollInterval:1e3,maxTextLength:2e4},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 Vo,Ko,ye,ph=ke(()=>{dt();ri();Vo=()=>H.logging,Ko=Fr("remote"),ye={lifecycle:r=>{Vo().lifecycle&&Ko.info(r)},focus:r=>{Vo().focus&&Ko.info(r)},dpi:r=>{Vo().dpiDetection&&Ko.info(r)},error:(r,e)=>{Vo().errors&&Ko.error(`${r} ${e?.message||e||""}`)},warn:r=>{Vo().errors&&Ko.warn(r)}}});function Xo(){for(let r of[ie.ROOT,ie.STATE])Gr.default.existsSync(r)||Gr.default.mkdirSync(r,{recursive:!0})}function hh(){try{return Xo(),Gr.default.existsSync(dh)?JSON.parse(Gr.default.readFileSync(dh,"utf8"))||{}:{}}catch{return{}}}function Cw(r){try{Xo();let e={...hh(),...r};return Gr.default.writeFileSync(dh,JSON.stringify(e,null,2),{mode:384}),e}catch(e){return console.error("Error saving settings:",e),null}}function kw(){try{return Xo(),Gr.default.existsSync(fh)?JSON.parse(Gr.default.readFileSync(fh,"utf8")):{machineId:null,key:null,name:"Default",createdAt:null}}catch{return{machineId:null,key:null,name:"Default",createdAt:null}}}function yn(r){try{Xo(),Gr.default.writeFileSync(IB,JSON.stringify({cmd:r,ts:Date.now()}))}catch{}}function Aw(r,e,t="Default"){try{Xo();let n={machineId:r,key:e,name:t,createdAt:new Date().toISOString()};return Gr.default.writeFileSync(fh,JSON.stringify(n,null,2),{mode:384}),n}catch(n){return console.error("Error saving key:",n),null}}var Gr,Yo,I8,N8,fh,IB,dh,Ts=ke(()=>{Gr=W(require("fs"),1),Yo=W(require("path"),1);St();I8=ie.STATE,N8=Yo.default.join(ie.STATE,"state.json"),fh=Yo.default.join(ie.ROOT,"keys.json"),IB=Yo.default.join(ie.STATE,"cmd.json"),dh=Yo.default.join(ie.STATE,"settings.json")});function Rw(){return new Promise(r=>{if(process.platform!=="darwin"){r({screenRecording:!0,accessibility:!0});return}let e=!1,t=!1,n=0,i=()=>{++n===2&&r({screenRecording:e,accessibility:t})};(0,Jo.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,Jo.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 Ow(r){let e=NB[r];e&&process.platform==="darwin"&&(0,Jo.exec)(`open "${e}"`,()=>{})}var Jo,NB,Mw=ke(()=>{Jo=require("child_process"),NB={screenRecording:"x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture",accessibility:"x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility"}});function DB(){return!process.env.DISPLAY&&!process.env.WAYLAND_DISPLAY}function ea(){for(let r=Pw,e=null;r!==e;e=r,r=Mr.default.dirname(r)){let t=Mr.default.join(r,"package.json");if((0,de.existsSync)(t)){try{let n=JSON.parse((0,de.readFileSync)(t,"utf8"));if(n.name!==Wi)continue;let i=typeof n.bin=="string"?n.bin:n.bin?.[Wi];if(i){let s=Mr.default.resolve(r,i);if((0,de.existsSync)(s))return s}}catch{}break}}return process.argv[1]||Mr.default.resolve(Pw,"..","index.js")}function As(){return process.execPath}function Dw(){let r=Mr.default.dirname(As()),e=["/usr/local/bin","/usr/bin","/bin","/usr/sbin","/sbin","/opt/homebrew/bin"];return e.includes(r)||e.unshift(r),e.join(":")}function mh(r){return String(r).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function LB(r,e){let t=[r,e,...Al].map(n=>` <string>${mh(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>${ks}</string>
|
|
36
36
|
<key>ProgramArguments</key>
|
|
37
37
|
<array>
|
|
38
38
|
${t}
|
|
@@ -44,7 +44,7 @@ ${t}
|
|
|
44
44
|
<key>EnvironmentVariables</key>
|
|
45
45
|
<dict>
|
|
46
46
|
<key>PATH</key>
|
|
47
|
-
<string>${mh(
|
|
47
|
+
<string>${mh(Dw())}</string>
|
|
48
48
|
<key>HOME</key>
|
|
49
49
|
<string>${mh(Zo)}</string>
|
|
50
50
|
</dict>
|
|
@@ -54,36 +54,36 @@ ${t}
|
|
|
54
54
|
<string>${Tl}</string>
|
|
55
55
|
</dict>
|
|
56
56
|
</plist>
|
|
57
|
-
`}function
|
|
58
|
-
WshShell.Run """${
|
|
59
|
-
`}function
|
|
57
|
+
`}function BB(){return(0,de.mkdirSync)(Mr.default.dirname(lt.darwin),{recursive:!0}),(0,de.writeFileSync)(lt.darwin,LB(As(),ea())),!0}function jB(){if((0,de.existsSync)(lt.darwin))try{(0,de.unlinkSync)(lt.darwin)}catch{}return!0}function FB(){return(0,de.existsSync)(lt.darwin)}function UB(){let r=Al.join(" ");return`Set WshShell = CreateObject("WScript.Shell")
|
|
58
|
+
WshShell.Run """${As()}"" ""${ea()}"" ${r}", 0, False
|
|
59
|
+
`}function Lw(){try{(0,Qo.execFileSync)("reg",["DELETE","HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run","/V",kl,"/F"],{windowsHide:!0,stdio:"ignore"})}catch{}}function qB(){let r=Mr.default.dirname(lt.win);return(0,de.existsSync)(r)?(Lw(),(0,de.writeFileSync)(lt.win,UB()),!0):!1}function $B(){if(Lw(),(0,de.existsSync)(lt.win))try{(0,de.unlinkSync)(lt.win)}catch{}return!0}function HB(){return(0,de.existsSync)(lt.win)}function WB(){let r=`${As()} ${ea()} ${Al.join(" ")}`;return`[Desktop Entry]
|
|
60
60
|
Type=Application
|
|
61
|
-
Name=${
|
|
61
|
+
Name=${kl}
|
|
62
62
|
Exec=${r}
|
|
63
63
|
X-GNOME-Autostart-enabled=true
|
|
64
64
|
NoDisplay=false
|
|
65
65
|
Terminal=false
|
|
66
|
-
`}function
|
|
67
|
-
Description=${
|
|
66
|
+
`}function GB(){let r=Al.map(e=>`'${e}'`).join(" ");return`[Unit]
|
|
67
|
+
Description=${kl} Agent
|
|
68
68
|
After=network-online.target
|
|
69
69
|
Wants=network-online.target
|
|
70
70
|
|
|
71
71
|
[Service]
|
|
72
72
|
Type=simple
|
|
73
|
-
ExecStart=${
|
|
73
|
+
ExecStart=${As()} ${ea()} ${r}
|
|
74
74
|
Restart=always
|
|
75
75
|
RestartSec=10
|
|
76
|
-
Environment=PATH=${
|
|
76
|
+
Environment=PATH=${Dw()}
|
|
77
77
|
Environment=HOME=${Zo}
|
|
78
78
|
StandardOutput=append:${Tl}
|
|
79
79
|
StandardError=append:${Tl}
|
|
80
80
|
|
|
81
81
|
[Install]
|
|
82
82
|
WantedBy=default.target
|
|
83
|
-
`}function Cl(r){try{return(0,Qo.execFileSync)("systemctl",["--user",...r],{stdio:"ignore"}),!0}catch{return!1}}function
|
|
84
|
-
`).filter(Boolean))if((0,ia.execSync)(`ps -o ppid= -p ${e}`,{encoding:"utf8"}).trim()==="1")try{process.kill(Number(e))}catch{}}catch{}}function Ol(){if(Ht)return;let r=
|
|
83
|
+
`}function Cl(r){try{return(0,Qo.execFileSync)("systemctl",["--user",...r],{stdio:"ignore"}),!0}catch{return!1}}function zB(){return DB()?((0,de.mkdirSync)(Mr.default.dirname(lt.linuxSystemd),{recursive:!0}),(0,de.writeFileSync)(lt.linuxSystemd,GB()),Cl(["daemon-reload"]),Cl(["enable",`${ks}.service`]),!0):((0,de.mkdirSync)(Mr.default.dirname(lt.linux),{recursive:!0}),(0,de.writeFileSync)(lt.linux,WB()),!0)}function VB(){if((0,de.existsSync)(lt.linuxSystemd)){Cl(["disable",`${ks}.service`]);try{(0,de.unlinkSync)(lt.linuxSystemd)}catch{}Cl(["daemon-reload"])}if((0,de.existsSync)(lt.linux))try{(0,de.unlinkSync)(lt.linux)}catch{}return!0}function KB(){return(0,de.existsSync)(lt.linux)||(0,de.existsSync)(lt.linuxSystemd)}async function gh(){try{if(process.platform==="darwin")return FB();if(process.platform==="win32")return await HB();if(process.platform==="linux")return KB()}catch{}return!1}async function Bw(r){try{if(process.platform==="darwin")return r?BB():jB();if(process.platform==="win32")return r?await qB():await $B();if(process.platform==="linux")return r?zB():VB()}catch{}return!1}var Qo,de,Cs,Iw,Mr,Nw,Tl,ks,kl,Al,Zo,Pw,lt,vh=ke(()=>{Qo=require("child_process"),de=require("fs"),Cs=require("path"),Iw=W(require("os"),1),Mr=W(require("path"),1),Nw=require("url");St();Tl=(0,Cs.join)(ie.LOGS,"autostart.log"),ks="cc.9remote.agent",kl="9Remote",Al=["--tray","--skip-update","--start"],Zo=Iw.default.homedir(),Pw=Mr.default.dirname((0,Nw.fileURLToPath)(__importMetaUrl)),lt={darwin:(0,Cs.join)(Zo,"Library","LaunchAgents",`${ks}.plist`),linux:(0,Cs.join)(Zo,".config","autostart",`${ks}.desktop`),linuxSystemd:(0,Cs.join)(Zo,".config","systemd","user",`${ks}.service`),win:(0,Cs.join)(process.env.APPDATA||"","Microsoft","Windows","Start Menu","Programs","Startup",`${kl}.vbs`)}});function YB(){ta.default.existsSync(ie.CONFIG)||ta.default.mkdirSync(ie.CONFIG,{recursive:!0})}function ra(){try{return JSON.parse(ta.default.readFileSync(Fw,"utf8"))||{}}catch{return{}}}function Rl(r){try{YB();let e={...ra(),...r};return ta.default.writeFileSync(Fw,JSON.stringify(e,null,2)),e}catch{return null}}var ta,jw,Fw,yh=ke(()=>{ta=W(require("fs"),1),jw=W(require("path"),1);St();Fw=jw.default.join(ie.CONFIG,"settings.json")});var Pl={};rn(Pl,{getMode:()=>Sh,isActive:()=>wh,onConnectionChange:()=>rj,setMode:()=>sa,start:()=>tj,stop:()=>bh});function JB(){Uw||(Uw=!0,process.on("exit",()=>{if(Ht){try{Ht.kill()}catch{}Ht=null}}))}function ZB(){if(!qw&&(qw=!0,process.platform==="darwin"))try{let r=(0,ia.execSync)("pgrep -f 'caffeinate -imsd'",{encoding:"utf8"}).trim();for(let e of r.split(`
|
|
84
|
+
`).filter(Boolean))if((0,ia.execSync)(`ps -o ppid= -p ${e}`,{encoding:"utf8"}).trim()==="1")try{process.kill(Number(e))}catch{}}catch{}}function Ol(){if(Ht)return;let r=XB[process.platform];if(r)try{Ht=(0,ia.spawn)(r.cmd,r.args,{stdio:"ignore",windowsHide:!0}),Ht.on("error",e=>{Ml.warn(`inhibitor error: ${e.message}`),Ht=null}),Ht.on("exit",()=>{Ht=null}),JB(),Ml.info(`\u{1F4A4} Sleep inhibitor started (${r.cmd})`)}catch(e){Ml.warn(`Failed to start sleep inhibitor: ${e.message}`),Ht=null}}function $w(){if(Ht){try{Ht.kill()}catch{}Ht=null,Ml.info("\u{1F4A4} Sleep inhibitor stopped")}}function Hw(){na&&(clearTimeout(na),na=null)}function QB(r){return(H.sleepInhibit?.presets||{})[r]??null}function ej(r){let e=H.sleepInhibit?.presets||{};return Object.prototype.hasOwnProperty.call(e,r)}function _h(){if(ZB(),Hw(),Rs==="never"){Ol();return}let r=QB(Rs);if(r==null){Ol();return}if(xh>0){Ol();return}Ol(),na=setTimeout(()=>{na=null,xh===0&&$w()},r)}function tj(){_h()}function bh(){Hw(),$w()}function wh(){return Ht!==null}function Sh(){return Rs}function sa(r){return ej(r)&&(Rs=r,_h()),Rs}function rj(r){xh=r,_h()}var ia,Ml,XB,Ht,Rs,na,xh,Uw,qw,Il=ke(()=>{ia=require("child_process");dt();ri();Ml=Fr("sleep"),XB={darwin:{cmd:"caffeinate",args:["-imsd","-w",String(process.pid)]},linux:{cmd:"systemd-inhibit",args:["--what=idle:sleep:handle-lid-switch","--who=9remote","--why=remote-active","sleep","infinity"]},win32:{cmd:"powershell.exe",args:["-NonInteractive","-NoProfile","-WindowStyle","Hidden","-Command",`Add-Type -Name K -Namespace W -MemberDefinition '[System.Runtime.InteropServices.DllImport("kernel32")]public static extern uint SetThreadExecutionState(uint e);'; [void][W.K]::SetThreadExecutionState(0x80000041); while($true){Start-Sleep 3600}`]}},Ht=null,Rs=H.sleepInhibit?.defaultMode||"never",na=null,xh=0,Uw=!1;qw=!1});function nj(){(0,zn.mkdirSync)(ie.STATE,{recursive:!0})}function Gw(){try{if((0,zn.existsSync)(Eh)){let r=JSON.parse((0,zn.readFileSync)(Eh,"utf8"));r.step===ti.READY&&r.permanentKey&&(xn={...xn,...r})}}catch{}}function ij(){try{nj(),(0,zn.writeFileSync)(Eh,JSON.stringify(xn),{mode:384})}catch{}}function zw(){Wt=!!ra().desktopEnabled}function Th(){Rl({desktopEnabled:Wt})}function Ct(r,e){let t=`data: ${JSON.stringify({type:r,...e})}
|
|
85
85
|
|
|
86
|
-
`;for(let n of Nl)try{n.write(t)}catch{Nl.delete(n)}}function
|
|
86
|
+
`;for(let n of Nl)try{n.write(t)}catch{Nl.delete(n)}}function _e(r){Ct("log",{message:`[${new Date().toLocaleTimeString()}] ${r}`})}function Vw(){return xn}function _n(r){xn={...xn,...r},Ct("state",xn),ij()}function Kw(){_n({oneTimeKey:"",oneTimeKeyExpiresAt:null,qrUrl:""})}function Yw(){return Dl}function Xw(r){Dl=r||null}function Jw(r){Ch=!!r}function Os(){return!!Ch&&!!Wt&&!!Pr.screenRecording&&!!Pr.accessibility}function Zw(r){kh=r}async function Ll(){let r=await Rw(),e=Pr,t=Os();Pr=r,Wt&&(!r.screenRecording||!r.accessibility)&&(Wt=!1,Th());let n=e.screenRecording&&e.accessibility,i=r.screenRecording&&r.accessibility;return!Wt&&!n&&i&&(Wt=!0,Th()),(e.screenRecording!==r.screenRecording||e.accessibility!==r.accessibility)&&Ct("permissions",{...Pr,desktopEnabled:Wt}),Os()!==t&&kh?.(),r}function Qw(r,e){let t=r.headers.origin;if(t&&!tc.includes(t))return le(e,403,"Forbidden origin");Z(e,{localToken:uw()})}function eS(r,e,t=null,n="ws"){xi.set(r,{socketId:r,ip:e,deviceId:t,type:n,connectedAt:Date.now()}),Ct("connections",{connections:[...xi.values()]}),rS()}function tS(r){xi.delete(r),Ct("connections",{connections:[...xi.values()]}),rS()}async function rS(){try{(await Promise.resolve().then(()=>(Il(),Pl))).onConnectionChange(xi.size)}catch{}}function nS(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",...xn})}
|
|
87
87
|
|
|
88
88
|
`),e.write(`data: ${JSON.stringify({type:"connections",connections:[...xi.values()]})}
|
|
89
89
|
|
|
@@ -91,42 +91,42 @@ WantedBy=default.target
|
|
|
91
91
|
|
|
92
92
|
`),Dl&&e.write(`data: ${JSON.stringify({type:"updateAvailable",...Dl})}
|
|
93
93
|
|
|
94
|
-
`),Nl.add(e),r.on("close",()=>Nl.delete(e))}function tS(r,e){Z(e,{...vn,...Pr,desktopEnabled:Wt,remoteAvailable:Ch})}async function rS(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(Ft(),Hi)),n=await t(r,e);n&&(yn(n),Z(e))}function nS(r,e){Z(e),yn({step:ti.PREPARING,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null}),Wn("restart-tunnel")}function iS(r,e){Z(e),yn({step:ti.PREPARING,stepDesc:""}),Wn("start-tunnel")}function sS(r,e){Z(e),yn({step:ti.STOPPED,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null}),Wn("stop-tunnel")}function oS(r,e){Z(e),yn({step:ti.STOPPED,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null}),Wn("shutdown")}function aS(r,e){Z(e),Wn("update")}function cS(r,e){Z(e,{connections:[...xi.values()]})}function lS(r,e){let t=new URL(r.url,"http://localhost"),n=parseInt(t.searchParams.get("lines")||qp,10);Z(e,{logs:ny(Number.isFinite(n)?n:qp)})}async function uS(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(Ft(),Hi)),n=await t(r,e);if(!n)return;let i=!!n.enabled;if(i&&(!Pr.screenRecording||!Pr.accessibility)){Z(e,{ok:!1,enabled:Wt,reason:"permissions_required"});return}let s=Os();Wt=i,Th(),Ct("permissions",{...Pr,desktopEnabled:Wt}),Os()!==s&&Ah?.(),Z(e,{ok:!0,enabled:Wt})}function pS(r,e){Z(e,Pr)}async function fS(r,e){let t=await gh();Z(e,{enabled:t})}async function dS(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(Ft(),Hi)),n=await t(r,e);if(!n)return;let i=await Nw(!!n.enabled),s=await gh();Ct("autostart",{enabled:s}),Z(e,{ok:i,enabled:s})}async function hS(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(Ft(),Hi)),n=await t(r,e);if(!n)return;let{type:i}=n;if(process.platform==="darwin"){Aw(i);let s=Date.now(),o=setInterval(async()=>{((await Ll())[i]||Date.now()-s>Xv)&&clearInterval(o)},Yv)}Z(e)}var Gn,qw,Eh,vn,Wt,Ch,Pr,Nl,xi,Dl,Ah,xn=Ce(()=>{St();ri();St();Ts();kw();vh();Ft();_l();St();Gn=require("fs"),qw=require("path");St();yh();Eh=(0,qw.join)(se.STATE,"ui-state.json");vn={step:ti.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}},Wt=!1,Ch=!1,Pr={screenRecording:!1,accessibility:!1},Nl=new Set,xi=new Map;ry(xe);Dl=null;Ah=null});var mS={};tn(mS,{ScreenHandler:()=>kh,encodeTilesBatch:()=>Ms});function ej(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 Ms(r,e){let t=Buffer.alloc(12);return t.writeUInt32LE(r.length,0),t.writeDoubleBE(e,4),Buffer.concat([t,...r.map(ej)])}var kh,Rh=Ce(()=>{ph();dt();xn();kh=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()},Ms),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()},Ms),this.resourceManager.updateClientActivity(e.id)}catch(o){ve.error("Tile capture with hashes error:",o),n.emit("screen-error",{error:o.message})}})),e.on("start-streaming",t(async()=>{let i=this.resourceManager.getClient(e.id);if(!i)return;i.streamingTimeout&&(clearTimeout(i.streamingTimeout),i.streamingTimeout=null),ve.lifecycle("\u{1F680} Remote streaming started");let{tileFormat:s,webpEffort:o,jpegQuality:a}=H.pipeline;xe(`\u{1F5BC}\uFE0F Remote stream codec: ${s.toUpperCase()}${s==="webp"?` (effort=${o})`:""} q=${a}`),i.idleFrameCount=0,i.isStreaming=!0,i.streamGen=(i.streamGen||0)+1;let c=i.streamGen;i.tileManager.lastTileChecksums.clear();try{let u=await i.tileManager.getScreenDimensions();n.emit("screen-dimensions",u)}catch(u){ve.error("Get dimensions error:",u)}let l=async()=>{if(!e.connected||!i.isStreaming||i.streamGen!==c){i.streamingTimeout=null;return}try{let u=performance.now(),f=await i.tileManager.detectChangedTilesWithHashes();if(f.tiles.length>0&&e.connected){let R=n.sendTiles({tiles:f.tiles,timestamp:Date.now(),currentHashes:f.currentHashes},Ms);i.tileManager.commitHashes(R||[]),i.idleFrameCount=0}else i.idleFrameCount++;let{activeInterval:d,idleInterval:g,idleThreshold:y}=this.resourceManager.getStreamingConfig(),b=i.idleFrameCount>=y?g:d,C=Math.max(0,b-(performance.now()-u));i.streamingTimeout=setTimeout(l,C)}catch(u){ve.error("Auto streaming error:",u),i.streamingTimeout=setTimeout(l,200)}};l()})),e.on("stop-streaming",()=>{let i=this.resourceManager.getClient(e.id);i&&(i.isStreaming=!1,i.streamingTimeout&&(clearTimeout(i.streamingTimeout),i.streamingTimeout=null),i.tileManager?.clearMemory?.(),ve.lifecycle("\u23F9\uFE0F Remote streaming stopped"))}),e.on("get-screen-dimensions",t(async()=>{let i=this.resourceManager.getClient(e.id);if(i)try{let s=await i.tileManager.getScreenDimensions();n.emit("screen-dimensions",s)}catch(s){ve.error("Get dimensions error:",s),n.emit("screen-error",{error:s.message})}})),e.on("boost-stream",t(()=>{let i=this.resourceManager.getClient(e.id);i&&(i.idleFrameCount=0)})),e.on("set-focus",t(i=>{let s=this.resourceManager.getClient(e.id);if(!s)return;let o=i?.rect||null,a=typeof i?.zoom=="number"?i.zoom:1,c=typeof i?.viewerWidth=="number"?i.viewerWidth:0,l=typeof i?.dpr=="number"?i.dpr:1,u=s.tileManager.pickProfile({zoom:a,viewerWidth:c,dpr:l});if(s.tileManager.setProfile(u),s.tileManager.setFocusRect(o),o){let f=s.tileManager.activeTileSet?.size||0,d=s.tileManager.totalTiles,g=d?(f/d*100).toFixed(0):0;ve.focus(`\u{1F3AF} [Focus] rect=${o.x},${o.y} ${o.w}x${o.h} | tiles ${f}/${d} (${g}%)`)}else ve.focus("\u{1F3AF} [Focus] cleared \u2192 full screen")}))}}});function gS(r){Oh.add(r)}function Ps(r){Oh.delete(r)}function ut(r,e,t){for(let n of Oh)if(n.hasReadyAdapter?.())try{n.emit(e,t)}catch{}}var Oh,_i=Ce(()=>{Oh=new Set});async function DS(){if(Bs)return Bs;let r=await import("node-screenshots");if(Bs=(r.Monitor||r.default?.Monitor).all()[0],!Bs)throw new Error("No monitor found via node-screenshots");return Bs}async function LS(r){Bh=r,H.pipeline.captureLib==="nodeScreenshots"&&await DS()}async function BS(){let{captureLib:r,inputFormat:e}=H.pipeline;if(r==="robotjs"){let{width:n,height:i}=Bh.getScreenSize(),s=Bh.screen.capture(0,0,n,i),o=s.byteWidth/s.bytesPerPixel;return{buffer:Buffer.from(s.image),width:o,height:s.height,channels:s.bytesPerPixel,format:e}}let t;try{t=await DS();let n=await t.captureImage();return{buffer:await n.toRaw(),width:n.width,height:n.height,channels:4,format:e}}catch(n){throw Bs=null,n}}var Bh,Bs,jS=Ce(()=>{dt();Bh=null,Bs=null});function yj(r){return r==="bgra"?Fh.FORMAT_BGRA:Fh.FORMAT_RGBA}function Uh(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 FS(r,e,t,n=4,i,s){let{encoder:o,inputFormat:a,jpegQuality:c,tileFormat:l,webpEffort:u}=H.pipeline,f=i??c,d=s??a;if(o==="jpegTurbo"&&l!=="webp")return Fh.compressSync(r,{width:e,height:t,format:yj(d),quality:f});let g=r;d==="bgra"&&(g=Buffer.from(r),Uh(g));let y=(0,zl.default)(g,{raw:{width:e,height:t,channels:n}});return l==="webp"?y.webp({quality:f,effort:u}).toBuffer():y.jpeg({quality:f}).toBuffer()}var zl,jh,Fh,US=Ce(()=>{zl=W(require("sharp"),1),jh=W(require("@julusian/jpeg-turbo"),1);dt();Fh=jh.default.default||jh.default;zl.default.cache(!1);zl.default.concurrency(1)});var Vl,qS=Ce(()=>{dt();xn();Vl=class{constructor(){this.cfg=H.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=P=>(this.samples.reduce((B,G)=>B+G[P],0)/e).toFixed(1),n=(Date.now()-this.lastLogTime)/1e3,i=(e/n).toFixed(1),s=[],o=0;for(let P of this.samples){for(let B of P.tileBytes)s.push(B);o+=P.tileBytes.reduce((B,G)=>B+G,0)}let a=(o/e/1024).toFixed(1),c=s.length?(s.reduce((P,B)=>P+B,0)/s.length/1024).toFixed(2):"0",l=s.length?(Math.min(...s)/1024).toFixed(2):"0",u=s.length?(Math.max(...s)/1024).toFixed(2):"0",f=this.samples.reduce((P,B)=>P+B.rawBytes,0)/e,d=o/e,g=d>0?(f/d).toFixed(0):"0",y=(this.samples.reduce((P,B)=>P+B.changedTiles,0)/e).toFixed(0),b=this.samples[0]?.totalTiles||0,C=b?(y/b*100).toFixed(1):"0",R=H.pipeline,M=`[Metrics] ${R.captureLib}+${R.encoder} tile=${R.tileSize} q${R.jpegQuality} scale=${R.outputScale} | fps=${i} | capture=${t("capture")}ms enc=${t("encode")}ms total=${t("total")}ms | tiles=${y}/${b} (${C}%) | data=${a}KB/frame | tileAvg=${c}KB (min ${l}, max ${u}) | compress=${g}x`;xe(M),console.log(M),this.samples=[],this.lastLogTime=Date.now()}}});var WS={};tn(WS,{TileManager:()=>qh,mapLimit:()=>wi});async function wi(r,e,t){let n=new Array(r.length),i=0,s=Math.min(e,r.length),o=Array.from({length:s},async(a,c)=>{for(;i<r.length;){let l=i++;n[l]=await t(r[l],l,c)}});return await Promise.all(o),n}var js,Yl,$S,Kl,HS,xj,_j,qh,GS=Ce(()=>{js=W(require("fs"),1),Yl=W(require("path"),1),$S=W(require("sharp"),1),Kl=require("child_process"),HS=require("url");dt();jS();US();qS();ph();xj=(0,HS.fileURLToPath)(__importMetaUrl),_j=Yl.default.dirname(xj);qh=class{constructor(e){this.robot=e,this.metrics=new Vl,this.tileSize=H.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(_j,"../../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=H.pipeline.outputScale||1,this.compressionQuality=H.pipeline.jpegQuality,this.activeTileSet=null,this.focusStats={frames:0,scanned:0,changed:0,bytes:0},this._scratchExtract=[],this._scratchSwap=[],this._prefetchCapture=null,js.default.existsSync(this.tempDir)||js.default.mkdirSync(this.tempDir,{recursive:!0}),LS(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,Kl.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,Kl.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,Kl.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 BS();return{buffer:e.buffer,width:e.width,height:e.height,channels:e.channels}}async getSharedScreenCapture(){let e=Date.now();return this.sharedScreenCache&&e-this.lastCaptureTime<this.CACHE_TTL?this.sharedScreenCache:(this.sharedScreenCache=await this.captureFullScreen(),this.lastCaptureTime=e,this.sharedScreenCache)}async getCaptureForStreaming(){if(!this._prefetchCapture){let t=await this.captureFullScreen();return this._prefetchCapture=this.captureFullScreen(),t}let e;try{e=await this._prefetchCapture}catch(t){throw this._prefetchCapture=null,t}return this._prefetchCapture=this.captureFullScreen(),e}clearScreenCache(){}async detectChangedTiles(){return(await this.detectChangedTilesWithHashes()).tiles}async detectChangedTilesWithHashes(){if(this.isProcessing)return{tiles:[],currentHashes:Array.from(this.lastTileChecksums.values())};this.isProcessing=!0;let e=this.metrics.now(),t=e,n=e;try{let i=await this.getCaptureForStreaming();t=this.metrics.now();let s=[],o=[],a=new Map;this.frameCount++;let c=this.activeTileSet;for(let f=0;f<this.totalTiles;f++){if(c&&!c.has(f))continue;let d=this.calculateTileChecksumDirect(i,f);a.set(f,d)}n=this.metrics.now();let l=Array.from(a.values());if(this.lastTileChecksums.size===0){let f=[];for(let g=0;g<this.totalTiles;g++)c&&!c.has(g)||f.push(g);let d=await wi(f,H.pipeline.tileConcurrency,(g,y,b)=>this.processTileAsync(i,g,null,a.get(g),b));return s.push(...d),this._recordFrame(e,t,n,s,i),{tiles:s,currentHashes:l}}for(let f=0;f<this.totalTiles;f++){if(c&&!c.has(f))continue;let d=a.get(f),g=this.lastTileChecksums.get(f);d!==g&&o.push(f)}if(o.length/this.totalTiles>this.changeThreshold){let f=[];for(let g=0;g<this.totalTiles;g++)c&&!c.has(g)||f.push(g);let d=await wi(f,H.pipeline.tileConcurrency,(g,y,b)=>this.processTileAsync(i,g,null,a.get(g),b));s.push(...d.map(g=>({...g,fullRefresh:!0})))}else if(o.length>0){let f=await wi(o,H.pipeline.tileConcurrency,(d,g,y)=>this.processTileAsync(i,d,null,a.get(d),y));s.push(...f)}return this._recordFrame(e,t,n,s,i),{tiles:s,currentHashes:l}}finally{this.isProcessing=!1}}async processTileAsync(e,t,n=null,i=null,s=null){let o=n||this.extractTile(e,t,s),a=await this.compressTileImage(o.buffer,o.width,o.height,s),{row:c,col:l}=this.getTilePosition(t);return{type:"tile-update",tileIndex:t,x:l*this.tileSize,y:c*this.tileSize,width:o.width,height:o.height,imageBuffer:a,hash:i??this.lastTileChecksums.get(t)??0,timestamp:Date.now(),frameCount:this.frameCount}}commitHashes(e){for(let t of e)this.lastTileChecksums.set(t.tileIndex,t.hash)}calculateTileChecksumDirect(e,t){let{row:n,col:i}=this.getTilePosition(t),s=i*this.tileSize,o=n*this.tileSize,a=Math.min(s+this.tileSize,e.width),c=Math.min(o+this.tileSize,e.height),l=a-s,u=c-o,f=e.channels,d=e.width*f,g=0,{rowStep:y,colStep:b}=H.pipeline.checksumSampling;for(let C=0;C<u;C+=y){let R=(C/y|0)%b,M=(o+C)*d+(s+R)*f;for(let P=R;P<l;P+=b){let B=M+(P-R)*f,G=P+1;g=g+e.buffer[B]*G>>>0,g^=e.buffer[B+1]<<1,g=g+e.buffer[B+2]*G>>>0,g^=e.buffer[B+3]<<2}}return g>>>0}setFocusRect(e){if(!e){this.activeTileSet=null;return}let t=H.focus.paddingTiles,n=Math.max(0,Math.floor(e.x/this.tileSize)-t),i=Math.max(0,Math.floor(e.y/this.tileSize)-t),s=Math.min(this.tilesPerRow-1,Math.floor((e.x+e.w)/this.tileSize)+t),o=Math.min(this.tilesPerColumn-1,Math.floor((e.y+e.h)/this.tileSize)+t),a=new Set;for(let l=i;l<=o;l++)for(let u=n;u<=s;u++)a.add(l*this.tilesPerRow+u);let c=this.activeTileSet;if(c)for(let l of a)c.has(l)||this.lastTileChecksums.delete(l);this.activeTileSet=a}getTilePosition(e){return{row:Math.floor(e/this.tilesPerRow),col:e%this.tilesPerRow}}_getScratch(e,t,n){let i=e[t];return(!i||i.length<n)&&(i=Buffer.allocUnsafe(n),e[t]=i),i.subarray(0,n)}extractTile(e,t,n=null){let{row:i,col:s}=this.getTilePosition(t),o=s*this.tileSize,a=i*this.tileSize,c=Math.min(o+this.tileSize,e.width),l=Math.min(a+this.tileSize,e.height),u=c-o,f=l-a,d=e.channels,g=u*d,y=u*f*d,b=n===null?Buffer.allocUnsafe(y):this._getScratch(this._scratchExtract,n,y);for(let C=0;C<f;C++){let R=((a+C)*e.width+o)*d,M=C*g;e.buffer.copy(b,M,R,R+g)}return{buffer:b,width:u,height:f,channels:d,tileIndex:t,x:o,y:a}}async compressTileImage(e,t,n,i=null){let s=this.scaleFactor;if(s&&s>0&&s<1){let o=Math.max(1,Math.floor(t*s)),a=Math.max(1,Math.floor(n*s)),{inputFormat:c}=H.pipeline,l=e,u=4;c==="bgra"&&(i===null?l=Buffer.from(e):(l=this._getScratch(this._scratchSwap,i,e.length),e.copy(l)),Uh(l));let{tileFormat:f,webpEffort:d}=H.pipeline,g=(0,$S.default)(l,{raw:{width:t,height:n,channels:u}}).resize(o,a,{kernel:"lanczos3",fastShrinkOnLoad:!1});return f==="webp"?g.webp({quality:this.compressionQuality,effort:d}).toBuffer():g.jpeg({quality:this.compressionQuality}).toBuffer()}return FS(e,t,n,4,this.compressionQuality)}pickProfile({zoom:e=1,viewerWidth:t=0,dpr:n=1}={}){let i=this.captureWidth||this.screenWidth||1,s=t>0?t:i,o=e>0?e:1,a=n>0?n:1,c=s*o*a/i,l=H.pipeline;if(l.scaleMode!=="smooth"){let y=l.adaptiveTiers||[];if(!y.length)return null;let b=l.tierHysteresis||0,C=this._currentTier;for(let M of y){let P=C&&M===C?M.minEffective-b:M.minEffective;if(c>=P)return this._currentTier=M,M}let R=y[y.length-1];return this._currentTier=R,R}let u=l.minOutputScale??.25,f=l.maxOutputScale??1,g={outputScale:Math.max(u,Math.min(f,c)),jpegQuality:l.qualityFloor??80};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(l=>l.imageBuffer?.length||0),c=s?s.width*s.height*s.channels:0;this.metrics.record({capture:t-e,checksum:n-t,encode:o-n,total:o-e,changedTiles:i.length,totalTiles:this.totalTiles,tileBytes:a,rawBytes:c})}_recordFocusFrame(e){let t=this.focusStats;t.frames++,t.scanned+=this.activeTileSet?this.activeTileSet.size:this.totalTiles,t.changed+=e.length;for(let c of e)t.bytes+=c.imageBuffer?.length||0;if(t.frames<H.logging.focusEveryFrames)return;let n=(t.scanned/t.frames).toFixed(0),i=(t.changed/t.frames).toFixed(1),s=(t.bytes/t.frames/1024).toFixed(1),o=this.totalTiles?((1-n/this.totalTiles)*100).toFixed(0):0,a=this.activeTileSet?"focus":"full";ve.focus(`\u{1F3AF} [Focus/${a}] ${t.frames}f | scan ${n}/${this.totalTiles} tiles (saved ${o}%) | changed ${i}/f | data ${s}KB/f`),this.focusStats={frames:0,scanned:0,changed:0,bytes:0}}async getScreenDimensions(){try{let e=await this.captureFullScreen();this.scaledWidth=e.width,this.scaledHeight=e.height,this.tilesPerRow=Math.ceil(e.width/this.tileSize),this.tilesPerColumn=Math.ceil(e.height/this.tileSize),this.totalTiles=this.tilesPerRow*this.tilesPerColumn}catch(e){ve.error("Error getting dimensions:",e)}return{width:this.scaledWidth,height:this.scaledHeight,tileWidth:this.tileSize,tileHeight:this.tileSize,tileCount:this.totalTiles,scaleFactor:this.scaleFactor,originalWidth:this.screenWidth,originalHeight:this.screenHeight}}async compareClientTileHashes(e){if(this.isProcessing)return{tiles:[],currentHashes:[],changedIndices:[]};this.isProcessing=!0;try{let t=await this.getSharedScreenCapture(),n=[],i=[];this.frameCount++;let s=this.activeTileSet,o=new Map;for(let c=0;c<this.totalTiles;c++){if(s&&!s.has(c))continue;let l=this.calculateTileChecksumDirect(t,c);o.set(c,l),this.lastTileChecksums.set(c,l)}if(!e||e.length===0){let c=[];for(let u=0;u<this.totalTiles;u++)s&&!s.has(u)||c.push(u);let l=await wi(c,H.pipeline.tileConcurrency,u=>this.processTileAsync(t,u));return n.push(...l),{tiles:n,currentHashes:Array.from(o.values())}}for(let c=0;c<this.totalTiles;c++)s&&!s.has(c)||e[c]!==o.get(c)&&i.push(c);if(i.length/this.totalTiles>this.changeThreshold){let c=[];for(let u=0;u<this.totalTiles;u++)s&&!s.has(u)||c.push(u);let l=await wi(c,H.pipeline.tileConcurrency,u=>this.processTileAsync(t,u));n.push(...l.map(u=>({...u,fullRefresh:!0})))}else if(i.length>0){let c=await wi(i,H.pipeline.tileConcurrency,l=>this.processTileAsync(t,l));n.push(...c)}return this._recordFocusFrame(n),{tiles:n,currentHashes:Array.from(o.values()),changedIndices:i}}finally{this.isProcessing=!1}}clearMemory(){this.sharedScreenCache=null,this.lastCaptureTime=0,this.lastTileChecksums.clear(),this._scratchExtract=[],this._scratchSwap=[],this._traceFrames=50,this._prefetchCapture=null}reset(){this.lastTileChecksums.clear(),this.frameCount=0}cleanup(){try{js.default.existsSync(this.tempDir)&&js.default.readdirSync(this.tempDir).forEach(t=>js.default.unlinkSync(Yl.default.join(this.tempDir,t)))}catch(e){ve.warn(`Cleanup error: ${e.message}`)}}}});var zS={};tn(zS,{ResourceManager:()=>$h});var $h,VS=Ce(()=>{dt();_i();$h=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>H.resourceManagement.memoryWarningThreshold&&(console.warn(`\u26A0\uFE0F High memory: ${t}MB`),this.cleanupInactiveClients())},H.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=H.resourceManagement.inactiveTimeout;for(let[n,i]of this.activeClients.entries())e-i.lastActivity>t&&(console.log(`\u{1F9F9} Cleaning inactive client: ${n}`),this.cleanupClientResources(n,i),this.activeClients.delete(n))}cleanupClientResources(e,t){try{t.isStreaming=!1,t?.streamingTimeout&&(clearTimeout(t.streamingTimeout),t.streamingTimeout=null),t?.screenInterval&&(clearInterval(t.screenInterval),t.screenInterval=null);let n=this.activeTimers.get(e);n&&(n.forEach(s=>clearTimeout(s)),this.activeTimers.delete(e));let i=this.chunkTimers.get(e);i&&(i.forEach(s=>clearTimeout(s)),this.chunkTimers.delete(e)),t?.tileManager&&(t.tileManager.clearMemory(),t.tileManager.cleanup(),t.tileManager.reset()),t?.protocol&&(t.protocol.close(),Ps(t.protocol))}catch(n){console.error(`Error cleaning up ${e}:`,n.message)}}getStreamingConfig(){return H.streaming}getWebRTCConfig(){return H.webrtc}removeClient(e){let t=this.activeClients.get(e);t&&(this.cleanupClientResources(e,t),this.activeClients.delete(e))}getChunkTimers(e){return this.chunkTimers.has(e)||this.chunkTimers.set(e,new Set),this.chunkTimers.get(e)}cleanupAll(){this.stopResourceMonitoring();for(let[e,t]of this.activeClients.entries())this.cleanupClientResources(e,t);this.activeClients.clear(),this.activeTimers.clear(),this.chunkTimers.clear()}}});var KS={};tn(KS,{ScreenUpdateHelper:()=>Hh});var Hh,YS=Ce(()=>{dt();Hh=class{constructor(e){this.resourceManager=e}async sendTilesInChunks(e,t,n,i=!1){if(!t||t.length===0)return;let s=H.streaming.chunkSize,o=[];for(let c=0;c<t.length;c+=s)o.push(t.slice(c,c+s));let a=this.resourceManager.getChunkTimers(e.id);for(let c=0;c<o.length;c++){let l=o[c],u=c===o.length-1,f=setTimeout(()=>{a.delete(f),e.connected&&e.emit("tiles-data",{tiles:l,timestamp:n,forceRefresh:!1,userAction:i,chunkInfo:{chunkIndex:c,totalChunks:o.length,isLastChunk:u}})},c*H.streaming.chunkDelay);a.add(f)}}}});var XS={};tn(XS,{MouseHandler:()=>Wh});var Wh,JS=Ce(()=>{dt();Wh=class{constructor(e,t){this.robot=e,this.resourceManager=t,this.lastMouseMove=0,this.buttonDown=null}setupMouseHandlers(e,t){let n=this.robot;e.on("mouse-move",t(i=>{let s=Date.now();if(!(s-this.lastMouseMove<H.throttling.mouseThrottle)){this.lastMouseMove=s;try{let o=n.getScreenSize(),a=Math.round(i.x/100*o.width),c=Math.round(i.y/100*o.height),l=Math.max(0,Math.min(o.width-1,a)),u=Math.max(0,Math.min(o.height-1,c));this.buttonDown?n.dragMouse(l,u,this.buttonDown):n.moveMouse(l,u),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Mouse move error:",o.message)}}})),e.on("mouse-click",t(async i=>{try{let s=this.resourceManager.getClient(e.id);if(!s)return;let o=n.getScreenSize(),a=Math.round(i.x/100*o.width),c=Math.round(i.y/100*o.height),l=Math.max(0,Math.min(o.width-1,a)),u=Math.max(0,Math.min(o.height-1,c));n.moveMouse(l,u),n.mouseClick(i.button||"left",i.double||!1),s.idleFrameCount=0,this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Mouse click error:",s.message)}})),e.on("mouse-press",t(async i=>{try{if(!this.resourceManager.getClient(e.id))return;let o=n.getScreenSize(),a=Math.round(i.x/100*o.width),c=Math.round(i.y/100*o.height),l=Math.max(0,Math.min(o.width-1,a)),u=Math.max(0,Math.min(o.height-1,c));n.moveMouse(l,u);let f=i.button||"left";n.mouseToggle("down",f),this.buttonDown=f,this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Mouse press error:",s.message)}})),e.on("mouse-release",t(async i=>{try{if(!this.resourceManager.getClient(e.id))return;let o=n.getScreenSize(),a=Math.round(i.x/100*o.width),c=Math.round(i.y/100*o.height),l=Math.max(0,Math.min(o.width-1,a)),u=Math.max(0,Math.min(o.height-1,c));n.moveMouse(l,u);let f=this.buttonDown||i.button||"left";n.mouseToggle("up",f),this.buttonDown=null,this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Mouse release error:",s.message)}})),e.on("scroll",t(async i=>{try{let{direction:s,amount:o=60,horizontal:a=!1}=i,c=this.resourceManager.getClient(e.id);if(!c)return;let l=0,u=0;a||s==="left"||s==="right"?l=s==="right"?o:-o:u=s==="down"?-o:o,n.scrollMouse(l,u),c.idleFrameCount=0,this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Scroll error:",s.message)}})),e.on("mouse-drag-select",t(i=>{try{let{startX:s,startY:o,endX:a,endY:c}=i,l=n.getScreenSize(),u=Math.round(s/100*l.width),f=Math.round(o/100*l.height),d=Math.round(a/100*l.width),g=Math.round(c/100*l.height),y=Math.max(0,Math.min(l.width-1,u)),b=Math.max(0,Math.min(l.height-1,f)),C=Math.max(0,Math.min(l.width-1,d)),R=Math.max(0,Math.min(l.height-1,g));n.moveMouse(y,b),n.mouseToggle("down","left"),n.dragMouse(C,R),n.mouseToggle("up","left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Drag selection error:",s.message)}}))}}});var QS={};tn(QS,{KeyboardHandler:()=>Gh});function bj(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,ZS.execFile)("osascript",["-e",e],t=>{t&&console.error("osascript error:",t.message)})}var ZS,Gh,eE=Ce(()=>{ZS=require("child_process");dt();Gh=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<H.throttling.keyThrottle)){this.lastKeyPress=s;try{if(!i.key||typeof i.key!="string")return;let o=this.resourceManager.getClient(e.id),a=i.key,c=i.modifier||[];if(a.length===1)if(c.filter(u=>u!=="shift").length>0){n.keyTap(a.toLowerCase(),c);for(let u of c)n.keyToggle(u,"up")}else n.typeString(a);else{let u={return:"enter"}[a.toLowerCase()]??a.toLowerCase();n.keyTap(u,c)}o&&(o.idleFrameCount=0),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Key press error:",o.message)}}})),e.on("desktop-switch",t(i=>{try{let s=i?.direction,o=H.desktopSwitch[process.platform]?.[s];if(!o)return;process.platform==="darwin"?bj(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<H.throttling.typeTextThrottle)){this.lastTypeText=s;try{if(!i.text||typeof i.text!="string")return;let o=i.text;o.length>H.throttling.maxTextLength&&(o=o.substring(0,H.throttling.maxTextLength));let a=o.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g,""),c=this.resourceManager.getClient(e.id);setTimeout(()=>{try{n.typeString(a),this.resourceManager.updateClientActivity(e.id),c&&(c.idleFrameCount=0,c.tileManager&&c.tileManager.clearScreenCache())}catch(l){console.error("Robot typeString error:",l.message)}},10)}catch(o){console.error("Type text error:",o.message)}}}))}}});var om=k((DE,sm)=>{(function(r,e){"use strict";function t(T,p){if(!T)throw new Error(p||"Assertion failed")}function n(T,p){T.super_=p;var m=function(){};m.prototype=p.prototype,T.prototype=new m,T.prototype.constructor=T}function i(T,p,m){if(i.isBN(T))return T;this.negative=0,this.words=null,this.length=0,this.red=null,T!==null&&((p==="le"||p==="be")&&(m=p,p=10),this._init(T||0,p||10,m||"be"))}typeof r=="object"?r.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=require("buffer").Buffer}catch{}i.isBN=function(p){return p instanceof i?!0:p!==null&&typeof p=="object"&&p.constructor.wordSize===i.wordSize&&Array.isArray(p.words)},i.max=function(p,m){return p.cmp(m)>0?p:m},i.min=function(p,m){return p.cmp(m)<0?p:m},i.prototype._init=function(p,m,x){if(typeof p=="number")return this._initNumber(p,m,x);if(typeof p=="object")return this._initArray(p,m,x);m==="hex"&&(m=16),t(m===(m|0)&&m>=2&&m<=36),p=p.toString().replace(/\s+/g,"");var S=0;p[0]==="-"&&(S++,this.negative=1),S<p.length&&(m===16?this._parseHex(p,S,x):(this._parseBase(p,m,S),x==="le"&&this._initArray(this.toArray(),m,x)))},i.prototype._initNumber=function(p,m,x){p<0&&(this.negative=1,p=-p),p<67108864?(this.words=[p&67108863],this.length=1):p<4503599627370496?(this.words=[p&67108863,p/67108864&67108863],this.length=2):(t(p<9007199254740992),this.words=[p&67108863,p/67108864&67108863,1],this.length=3),x==="le"&&this._initArray(this.toArray(),m,x)},i.prototype._initArray=function(p,m,x){if(t(typeof p.length=="number"),p.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(p.length/3),this.words=new Array(this.length);for(var S=0;S<this.length;S++)this.words[S]=0;var v,_,A=0;if(x==="be")for(S=p.length-1,v=0;S>=0;S-=3)_=p[S]|p[S-1]<<8|p[S-2]<<16,this.words[v]|=_<<A&67108863,this.words[v+1]=_>>>26-A&67108863,A+=24,A>=26&&(A-=26,v++);else if(x==="le")for(S=0,v=0;S<p.length;S+=3)_=p[S]|p[S+1]<<8|p[S+2]<<16,this.words[v]|=_<<A&67108863,this.words[v+1]=_>>>26-A&67108863,A+=24,A>=26&&(A-=26,v++);return this.strip()};function o(T,p){var m=T.charCodeAt(p);return m>=65&&m<=70?m-55:m>=97&&m<=102?m-87:m-48&15}function a(T,p,m){var x=o(T,m);return m-1>=p&&(x|=o(T,m-1)<<4),x}i.prototype._parseHex=function(p,m,x){this.length=Math.ceil((p.length-m)/6),this.words=new Array(this.length);for(var S=0;S<this.length;S++)this.words[S]=0;var v=0,_=0,A;if(x==="be")for(S=p.length-1;S>=m;S-=2)A=a(p,m,S)<<v,this.words[_]|=A&67108863,v>=18?(v-=18,_+=1,this.words[_]|=A>>>26):v+=8;else{var w=p.length-m;for(S=w%2===0?m+1:m;S<p.length;S+=2)A=a(p,m,S)<<v,this.words[_]|=A&67108863,v>=18?(v-=18,_+=1,this.words[_]|=A>>>26):v+=8}this.strip()};function c(T,p,m,x){for(var S=0,v=Math.min(T.length,m),_=p;_<v;_++){var A=T.charCodeAt(_)-48;S*=x,A>=49?S+=A-49+10:A>=17?S+=A-17+10:S+=A}return S}i.prototype._parseBase=function(p,m,x){this.words=[0],this.length=1;for(var S=0,v=1;v<=67108863;v*=m)S++;S--,v=v/m|0;for(var _=p.length-x,A=_%S,w=Math.min(_,_-A)+x,h=0,E=x;E<w;E+=S)h=c(p,E,E+S,m),this.imuln(v),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(A!==0){var q=1;for(h=c(p,E,p.length,m),E=0;E<A;E++)q*=m;this.imuln(q),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this.strip()},i.prototype.copy=function(p){p.words=new Array(this.length);for(var m=0;m<this.length;m++)p.words[m]=this.words[m];p.length=this.length,p.negative=this.negative,p.red=this.red},i.prototype.clone=function(){var p=new i(null);return this.copy(p),p},i.prototype._expand=function(p){for(;this.length<p;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(p,m){p=p||10,m=m|0||1;var x;if(p===16||p==="hex"){x="";for(var S=0,v=0,_=0;_<this.length;_++){var A=this.words[_],w=((A<<S|v)&16777215).toString(16);v=A>>>24-S&16777215,S+=2,S>=26&&(S-=26,_--),v!==0||_!==this.length-1?x=l[6-w.length]+w+x:x=w+x}for(v!==0&&(x=v.toString(16)+x);x.length%m!==0;)x="0"+x;return this.negative!==0&&(x="-"+x),x}if(p===(p|0)&&p>=2&&p<=36){var h=u[p],E=f[p];x="";var q=this.clone();for(q.negative=0;!q.isZero();){var O=q.modn(E).toString(p);q=q.idivn(E),q.isZero()?x=O+x:x=l[h-O.length]+O+x}for(this.isZero()&&(x="0"+x);x.length%m!==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 p=this.words[0];return this.length===2?p+=this.words[1]*67108864:this.length===3&&this.words[2]===1?p+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-p:p},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(p,m){return t(typeof s<"u"),this.toArrayLike(s,p,m)},i.prototype.toArray=function(p,m){return this.toArrayLike(Array,p,m)},i.prototype.toArrayLike=function(p,m,x){var S=this.byteLength(),v=x||Math.max(1,S);t(S<=v,"byte array longer than desired length"),t(v>0,"Requested array length <= 0"),this.strip();var _=m==="le",A=new p(v),w,h,E=this.clone();if(_){for(h=0;!E.isZero();h++)w=E.andln(255),E.iushrn(8),A[h]=w;for(;h<v;h++)A[h]=0}else{for(h=0;h<v-S;h++)A[h]=0;for(h=0;!E.isZero();h++)w=E.andln(255),E.iushrn(8),A[v-h-1]=w}return A},Math.clz32?i.prototype._countBits=function(p){return 32-Math.clz32(p)}:i.prototype._countBits=function(p){var m=p,x=0;return m>=4096&&(x+=13,m>>>=13),m>=64&&(x+=7,m>>>=7),m>=8&&(x+=4,m>>>=4),m>=2&&(x+=2,m>>>=2),x+m},i.prototype._zeroBits=function(p){if(p===0)return 26;var m=p,x=0;return(m&8191)===0&&(x+=13,m>>>=13),(m&127)===0&&(x+=7,m>>>=7),(m&15)===0&&(x+=4,m>>>=4),(m&3)===0&&(x+=2,m>>>=2),(m&1)===0&&x++,x},i.prototype.bitLength=function(){var p=this.words[this.length-1],m=this._countBits(p);return(this.length-1)*26+m};function d(T){for(var p=new Array(T.bitLength()),m=0;m<p.length;m++){var x=m/26|0,S=m%26;p[m]=(T.words[x]&1<<S)>>>S}return p}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var p=0,m=0;m<this.length;m++){var x=this._zeroBits(this.words[m]);if(p+=x,x!==26)break}return p},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(p){return this.negative!==0?this.abs().inotn(p).iaddn(1):this.clone()},i.prototype.fromTwos=function(p){return this.testn(p-1)?this.notn(p).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(p){for(;this.length<p.length;)this.words[this.length++]=0;for(var m=0;m<p.length;m++)this.words[m]=this.words[m]|p.words[m];return this.strip()},i.prototype.ior=function(p){return t((this.negative|p.negative)===0),this.iuor(p)},i.prototype.or=function(p){return this.length>p.length?this.clone().ior(p):p.clone().ior(this)},i.prototype.uor=function(p){return this.length>p.length?this.clone().iuor(p):p.clone().iuor(this)},i.prototype.iuand=function(p){var m;this.length>p.length?m=p:m=this;for(var x=0;x<m.length;x++)this.words[x]=this.words[x]&p.words[x];return this.length=m.length,this.strip()},i.prototype.iand=function(p){return t((this.negative|p.negative)===0),this.iuand(p)},i.prototype.and=function(p){return this.length>p.length?this.clone().iand(p):p.clone().iand(this)},i.prototype.uand=function(p){return this.length>p.length?this.clone().iuand(p):p.clone().iuand(this)},i.prototype.iuxor=function(p){var m,x;this.length>p.length?(m=this,x=p):(m=p,x=this);for(var S=0;S<x.length;S++)this.words[S]=m.words[S]^x.words[S];if(this!==m)for(;S<m.length;S++)this.words[S]=m.words[S];return this.length=m.length,this.strip()},i.prototype.ixor=function(p){return t((this.negative|p.negative)===0),this.iuxor(p)},i.prototype.xor=function(p){return this.length>p.length?this.clone().ixor(p):p.clone().ixor(this)},i.prototype.uxor=function(p){return this.length>p.length?this.clone().iuxor(p):p.clone().iuxor(this)},i.prototype.inotn=function(p){t(typeof p=="number"&&p>=0);var m=Math.ceil(p/26)|0,x=p%26;this._expand(m),x>0&&m--;for(var S=0;S<m;S++)this.words[S]=~this.words[S]&67108863;return x>0&&(this.words[S]=~this.words[S]&67108863>>26-x),this.strip()},i.prototype.notn=function(p){return this.clone().inotn(p)},i.prototype.setn=function(p,m){t(typeof p=="number"&&p>=0);var x=p/26|0,S=p%26;return this._expand(x+1),m?this.words[x]=this.words[x]|1<<S:this.words[x]=this.words[x]&~(1<<S),this.strip()},i.prototype.iadd=function(p){var m;if(this.negative!==0&&p.negative===0)return this.negative=0,m=this.isub(p),this.negative^=1,this._normSign();if(this.negative===0&&p.negative!==0)return p.negative=0,m=this.isub(p),p.negative=1,m._normSign();var x,S;this.length>p.length?(x=this,S=p):(x=p,S=this);for(var v=0,_=0;_<S.length;_++)m=(x.words[_]|0)+(S.words[_]|0)+v,this.words[_]=m&67108863,v=m>>>26;for(;v!==0&&_<x.length;_++)m=(x.words[_]|0)+v,this.words[_]=m&67108863,v=m>>>26;if(this.length=x.length,v!==0)this.words[this.length]=v,this.length++;else if(x!==this)for(;_<x.length;_++)this.words[_]=x.words[_];return this},i.prototype.add=function(p){var m;return p.negative!==0&&this.negative===0?(p.negative=0,m=this.sub(p),p.negative^=1,m):p.negative===0&&this.negative!==0?(this.negative=0,m=p.sub(this),this.negative=1,m):this.length>p.length?this.clone().iadd(p):p.clone().iadd(this)},i.prototype.isub=function(p){if(p.negative!==0){p.negative=0;var m=this.iadd(p);return p.negative=1,m._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(p),this.negative=1,this._normSign();var x=this.cmp(p);if(x===0)return this.negative=0,this.length=1,this.words[0]=0,this;var S,v;x>0?(S=this,v=p):(S=p,v=this);for(var _=0,A=0;A<v.length;A++)m=(S.words[A]|0)-(v.words[A]|0)+_,_=m>>26,this.words[A]=m&67108863;for(;_!==0&&A<S.length;A++)m=(S.words[A]|0)+_,_=m>>26,this.words[A]=m&67108863;if(_===0&&A<S.length&&S!==this)for(;A<S.length;A++)this.words[A]=S.words[A];return this.length=Math.max(this.length,A),S!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(p){return this.clone().isub(p)};function g(T,p,m){m.negative=p.negative^T.negative;var x=T.length+p.length|0;m.length=x,x=x-1|0;var S=T.words[0]|0,v=p.words[0]|0,_=S*v,A=_&67108863,w=_/67108864|0;m.words[0]=A;for(var h=1;h<x;h++){for(var E=w>>>26,q=w&67108863,O=Math.min(h,p.length-1),I=Math.max(0,h-T.length+1);I<=O;I++){var j=h-I|0;S=T.words[j]|0,v=p.words[I]|0,_=S*v+q,E+=_/67108864|0,q=_&67108863}m.words[h]=q|0,w=E|0}return w!==0?m.words[h]=w|0:m.length--,m.strip()}var y=function(p,m,x){var S=p.words,v=m.words,_=x.words,A=0,w,h,E,q=S[0]|0,O=q&8191,I=q>>>13,j=S[1]|0,K=j&8191,U=j>>>13,ke=S[2]|0,ie=ke&8191,N=ke>>>13,ne=S[3]|0,L=ne&8191,z=ne>>>13,oe=S[4]|0,Q=oe&8191,J=oe>>>13,Ot=S[5]|0,ae=Ot&8191,Ie=Ot>>>13,yv=S[6]|0,Ne=yv&8191,De=yv>>>13,xv=S[7]|0,Le=xv&8191,Be=xv>>>13,_v=S[8]|0,je=_v&8191,Fe=_v>>>13,bv=S[9]|0,Ue=bv&8191,qe=bv>>>13,wv=v[0]|0,$e=wv&8191,He=wv>>>13,Sv=v[1]|0,We=Sv&8191,Ge=Sv>>>13,Ev=v[2]|0,ze=Ev&8191,Ve=Ev>>>13,Tv=v[3]|0,Ke=Tv&8191,Ye=Tv>>>13,Cv=v[4]|0,Xe=Cv&8191,Je=Cv>>>13,Av=v[5]|0,Ze=Av&8191,Qe=Av>>>13,kv=v[6]|0,et=kv&8191,tt=kv>>>13,Rv=v[7]|0,rt=Rv&8191,nt=Rv>>>13,Ov=v[8]|0,it=Ov&8191,st=Ov>>>13,Mv=v[9]|0,ot=Mv&8191,at=Mv>>>13;x.negative=p.negative^m.negative,x.length=19,w=Math.imul(O,$e),h=Math.imul(O,He),h=h+Math.imul(I,$e)|0,E=Math.imul(I,He);var mp=(A+w|0)+((h&8191)<<13)|0;A=(E+(h>>>13)|0)+(mp>>>26)|0,mp&=67108863,w=Math.imul(K,$e),h=Math.imul(K,He),h=h+Math.imul(U,$e)|0,E=Math.imul(U,He),w=w+Math.imul(O,We)|0,h=h+Math.imul(O,Ge)|0,h=h+Math.imul(I,We)|0,E=E+Math.imul(I,Ge)|0;var gp=(A+w|0)+((h&8191)<<13)|0;A=(E+(h>>>13)|0)+(gp>>>26)|0,gp&=67108863,w=Math.imul(ie,$e),h=Math.imul(ie,He),h=h+Math.imul(N,$e)|0,E=Math.imul(N,He),w=w+Math.imul(K,We)|0,h=h+Math.imul(K,Ge)|0,h=h+Math.imul(U,We)|0,E=E+Math.imul(U,Ge)|0,w=w+Math.imul(O,ze)|0,h=h+Math.imul(O,Ve)|0,h=h+Math.imul(I,ze)|0,E=E+Math.imul(I,Ve)|0;var vp=(A+w|0)+((h&8191)<<13)|0;A=(E+(h>>>13)|0)+(vp>>>26)|0,vp&=67108863,w=Math.imul(L,$e),h=Math.imul(L,He),h=h+Math.imul(z,$e)|0,E=Math.imul(z,He),w=w+Math.imul(ie,We)|0,h=h+Math.imul(ie,Ge)|0,h=h+Math.imul(N,We)|0,E=E+Math.imul(N,Ge)|0,w=w+Math.imul(K,ze)|0,h=h+Math.imul(K,Ve)|0,h=h+Math.imul(U,ze)|0,E=E+Math.imul(U,Ve)|0,w=w+Math.imul(O,Ke)|0,h=h+Math.imul(O,Ye)|0,h=h+Math.imul(I,Ke)|0,E=E+Math.imul(I,Ye)|0;var yp=(A+w|0)+((h&8191)<<13)|0;A=(E+(h>>>13)|0)+(yp>>>26)|0,yp&=67108863,w=Math.imul(Q,$e),h=Math.imul(Q,He),h=h+Math.imul(J,$e)|0,E=Math.imul(J,He),w=w+Math.imul(L,We)|0,h=h+Math.imul(L,Ge)|0,h=h+Math.imul(z,We)|0,E=E+Math.imul(z,Ge)|0,w=w+Math.imul(ie,ze)|0,h=h+Math.imul(ie,Ve)|0,h=h+Math.imul(N,ze)|0,E=E+Math.imul(N,Ve)|0,w=w+Math.imul(K,Ke)|0,h=h+Math.imul(K,Ye)|0,h=h+Math.imul(U,Ke)|0,E=E+Math.imul(U,Ye)|0,w=w+Math.imul(O,Xe)|0,h=h+Math.imul(O,Je)|0,h=h+Math.imul(I,Xe)|0,E=E+Math.imul(I,Je)|0;var xp=(A+w|0)+((h&8191)<<13)|0;A=(E+(h>>>13)|0)+(xp>>>26)|0,xp&=67108863,w=Math.imul(ae,$e),h=Math.imul(ae,He),h=h+Math.imul(Ie,$e)|0,E=Math.imul(Ie,He),w=w+Math.imul(Q,We)|0,h=h+Math.imul(Q,Ge)|0,h=h+Math.imul(J,We)|0,E=E+Math.imul(J,Ge)|0,w=w+Math.imul(L,ze)|0,h=h+Math.imul(L,Ve)|0,h=h+Math.imul(z,ze)|0,E=E+Math.imul(z,Ve)|0,w=w+Math.imul(ie,Ke)|0,h=h+Math.imul(ie,Ye)|0,h=h+Math.imul(N,Ke)|0,E=E+Math.imul(N,Ye)|0,w=w+Math.imul(K,Xe)|0,h=h+Math.imul(K,Je)|0,h=h+Math.imul(U,Xe)|0,E=E+Math.imul(U,Je)|0,w=w+Math.imul(O,Ze)|0,h=h+Math.imul(O,Qe)|0,h=h+Math.imul(I,Ze)|0,E=E+Math.imul(I,Qe)|0;var _p=(A+w|0)+((h&8191)<<13)|0;A=(E+(h>>>13)|0)+(_p>>>26)|0,_p&=67108863,w=Math.imul(Ne,$e),h=Math.imul(Ne,He),h=h+Math.imul(De,$e)|0,E=Math.imul(De,He),w=w+Math.imul(ae,We)|0,h=h+Math.imul(ae,Ge)|0,h=h+Math.imul(Ie,We)|0,E=E+Math.imul(Ie,Ge)|0,w=w+Math.imul(Q,ze)|0,h=h+Math.imul(Q,Ve)|0,h=h+Math.imul(J,ze)|0,E=E+Math.imul(J,Ve)|0,w=w+Math.imul(L,Ke)|0,h=h+Math.imul(L,Ye)|0,h=h+Math.imul(z,Ke)|0,E=E+Math.imul(z,Ye)|0,w=w+Math.imul(ie,Xe)|0,h=h+Math.imul(ie,Je)|0,h=h+Math.imul(N,Xe)|0,E=E+Math.imul(N,Je)|0,w=w+Math.imul(K,Ze)|0,h=h+Math.imul(K,Qe)|0,h=h+Math.imul(U,Ze)|0,E=E+Math.imul(U,Qe)|0,w=w+Math.imul(O,et)|0,h=h+Math.imul(O,tt)|0,h=h+Math.imul(I,et)|0,E=E+Math.imul(I,tt)|0;var bp=(A+w|0)+((h&8191)<<13)|0;A=(E+(h>>>13)|0)+(bp>>>26)|0,bp&=67108863,w=Math.imul(Le,$e),h=Math.imul(Le,He),h=h+Math.imul(Be,$e)|0,E=Math.imul(Be,He),w=w+Math.imul(Ne,We)|0,h=h+Math.imul(Ne,Ge)|0,h=h+Math.imul(De,We)|0,E=E+Math.imul(De,Ge)|0,w=w+Math.imul(ae,ze)|0,h=h+Math.imul(ae,Ve)|0,h=h+Math.imul(Ie,ze)|0,E=E+Math.imul(Ie,Ve)|0,w=w+Math.imul(Q,Ke)|0,h=h+Math.imul(Q,Ye)|0,h=h+Math.imul(J,Ke)|0,E=E+Math.imul(J,Ye)|0,w=w+Math.imul(L,Xe)|0,h=h+Math.imul(L,Je)|0,h=h+Math.imul(z,Xe)|0,E=E+Math.imul(z,Je)|0,w=w+Math.imul(ie,Ze)|0,h=h+Math.imul(ie,Qe)|0,h=h+Math.imul(N,Ze)|0,E=E+Math.imul(N,Qe)|0,w=w+Math.imul(K,et)|0,h=h+Math.imul(K,tt)|0,h=h+Math.imul(U,et)|0,E=E+Math.imul(U,tt)|0,w=w+Math.imul(O,rt)|0,h=h+Math.imul(O,nt)|0,h=h+Math.imul(I,rt)|0,E=E+Math.imul(I,nt)|0;var wp=(A+w|0)+((h&8191)<<13)|0;A=(E+(h>>>13)|0)+(wp>>>26)|0,wp&=67108863,w=Math.imul(je,$e),h=Math.imul(je,He),h=h+Math.imul(Fe,$e)|0,E=Math.imul(Fe,He),w=w+Math.imul(Le,We)|0,h=h+Math.imul(Le,Ge)|0,h=h+Math.imul(Be,We)|0,E=E+Math.imul(Be,Ge)|0,w=w+Math.imul(Ne,ze)|0,h=h+Math.imul(Ne,Ve)|0,h=h+Math.imul(De,ze)|0,E=E+Math.imul(De,Ve)|0,w=w+Math.imul(ae,Ke)|0,h=h+Math.imul(ae,Ye)|0,h=h+Math.imul(Ie,Ke)|0,E=E+Math.imul(Ie,Ye)|0,w=w+Math.imul(Q,Xe)|0,h=h+Math.imul(Q,Je)|0,h=h+Math.imul(J,Xe)|0,E=E+Math.imul(J,Je)|0,w=w+Math.imul(L,Ze)|0,h=h+Math.imul(L,Qe)|0,h=h+Math.imul(z,Ze)|0,E=E+Math.imul(z,Qe)|0,w=w+Math.imul(ie,et)|0,h=h+Math.imul(ie,tt)|0,h=h+Math.imul(N,et)|0,E=E+Math.imul(N,tt)|0,w=w+Math.imul(K,rt)|0,h=h+Math.imul(K,nt)|0,h=h+Math.imul(U,rt)|0,E=E+Math.imul(U,nt)|0,w=w+Math.imul(O,it)|0,h=h+Math.imul(O,st)|0,h=h+Math.imul(I,it)|0,E=E+Math.imul(I,st)|0;var Sp=(A+w|0)+((h&8191)<<13)|0;A=(E+(h>>>13)|0)+(Sp>>>26)|0,Sp&=67108863,w=Math.imul(Ue,$e),h=Math.imul(Ue,He),h=h+Math.imul(qe,$e)|0,E=Math.imul(qe,He),w=w+Math.imul(je,We)|0,h=h+Math.imul(je,Ge)|0,h=h+Math.imul(Fe,We)|0,E=E+Math.imul(Fe,Ge)|0,w=w+Math.imul(Le,ze)|0,h=h+Math.imul(Le,Ve)|0,h=h+Math.imul(Be,ze)|0,E=E+Math.imul(Be,Ve)|0,w=w+Math.imul(Ne,Ke)|0,h=h+Math.imul(Ne,Ye)|0,h=h+Math.imul(De,Ke)|0,E=E+Math.imul(De,Ye)|0,w=w+Math.imul(ae,Xe)|0,h=h+Math.imul(ae,Je)|0,h=h+Math.imul(Ie,Xe)|0,E=E+Math.imul(Ie,Je)|0,w=w+Math.imul(Q,Ze)|0,h=h+Math.imul(Q,Qe)|0,h=h+Math.imul(J,Ze)|0,E=E+Math.imul(J,Qe)|0,w=w+Math.imul(L,et)|0,h=h+Math.imul(L,tt)|0,h=h+Math.imul(z,et)|0,E=E+Math.imul(z,tt)|0,w=w+Math.imul(ie,rt)|0,h=h+Math.imul(ie,nt)|0,h=h+Math.imul(N,rt)|0,E=E+Math.imul(N,nt)|0,w=w+Math.imul(K,it)|0,h=h+Math.imul(K,st)|0,h=h+Math.imul(U,it)|0,E=E+Math.imul(U,st)|0,w=w+Math.imul(O,ot)|0,h=h+Math.imul(O,at)|0,h=h+Math.imul(I,ot)|0,E=E+Math.imul(I,at)|0;var Ep=(A+w|0)+((h&8191)<<13)|0;A=(E+(h>>>13)|0)+(Ep>>>26)|0,Ep&=67108863,w=Math.imul(Ue,We),h=Math.imul(Ue,Ge),h=h+Math.imul(qe,We)|0,E=Math.imul(qe,Ge),w=w+Math.imul(je,ze)|0,h=h+Math.imul(je,Ve)|0,h=h+Math.imul(Fe,ze)|0,E=E+Math.imul(Fe,Ve)|0,w=w+Math.imul(Le,Ke)|0,h=h+Math.imul(Le,Ye)|0,h=h+Math.imul(Be,Ke)|0,E=E+Math.imul(Be,Ye)|0,w=w+Math.imul(Ne,Xe)|0,h=h+Math.imul(Ne,Je)|0,h=h+Math.imul(De,Xe)|0,E=E+Math.imul(De,Je)|0,w=w+Math.imul(ae,Ze)|0,h=h+Math.imul(ae,Qe)|0,h=h+Math.imul(Ie,Ze)|0,E=E+Math.imul(Ie,Qe)|0,w=w+Math.imul(Q,et)|0,h=h+Math.imul(Q,tt)|0,h=h+Math.imul(J,et)|0,E=E+Math.imul(J,tt)|0,w=w+Math.imul(L,rt)|0,h=h+Math.imul(L,nt)|0,h=h+Math.imul(z,rt)|0,E=E+Math.imul(z,nt)|0,w=w+Math.imul(ie,it)|0,h=h+Math.imul(ie,st)|0,h=h+Math.imul(N,it)|0,E=E+Math.imul(N,st)|0,w=w+Math.imul(K,ot)|0,h=h+Math.imul(K,at)|0,h=h+Math.imul(U,ot)|0,E=E+Math.imul(U,at)|0;var Tp=(A+w|0)+((h&8191)<<13)|0;A=(E+(h>>>13)|0)+(Tp>>>26)|0,Tp&=67108863,w=Math.imul(Ue,ze),h=Math.imul(Ue,Ve),h=h+Math.imul(qe,ze)|0,E=Math.imul(qe,Ve),w=w+Math.imul(je,Ke)|0,h=h+Math.imul(je,Ye)|0,h=h+Math.imul(Fe,Ke)|0,E=E+Math.imul(Fe,Ye)|0,w=w+Math.imul(Le,Xe)|0,h=h+Math.imul(Le,Je)|0,h=h+Math.imul(Be,Xe)|0,E=E+Math.imul(Be,Je)|0,w=w+Math.imul(Ne,Ze)|0,h=h+Math.imul(Ne,Qe)|0,h=h+Math.imul(De,Ze)|0,E=E+Math.imul(De,Qe)|0,w=w+Math.imul(ae,et)|0,h=h+Math.imul(ae,tt)|0,h=h+Math.imul(Ie,et)|0,E=E+Math.imul(Ie,tt)|0,w=w+Math.imul(Q,rt)|0,h=h+Math.imul(Q,nt)|0,h=h+Math.imul(J,rt)|0,E=E+Math.imul(J,nt)|0,w=w+Math.imul(L,it)|0,h=h+Math.imul(L,st)|0,h=h+Math.imul(z,it)|0,E=E+Math.imul(z,st)|0,w=w+Math.imul(ie,ot)|0,h=h+Math.imul(ie,at)|0,h=h+Math.imul(N,ot)|0,E=E+Math.imul(N,at)|0;var Cp=(A+w|0)+((h&8191)<<13)|0;A=(E+(h>>>13)|0)+(Cp>>>26)|0,Cp&=67108863,w=Math.imul(Ue,Ke),h=Math.imul(Ue,Ye),h=h+Math.imul(qe,Ke)|0,E=Math.imul(qe,Ye),w=w+Math.imul(je,Xe)|0,h=h+Math.imul(je,Je)|0,h=h+Math.imul(Fe,Xe)|0,E=E+Math.imul(Fe,Je)|0,w=w+Math.imul(Le,Ze)|0,h=h+Math.imul(Le,Qe)|0,h=h+Math.imul(Be,Ze)|0,E=E+Math.imul(Be,Qe)|0,w=w+Math.imul(Ne,et)|0,h=h+Math.imul(Ne,tt)|0,h=h+Math.imul(De,et)|0,E=E+Math.imul(De,tt)|0,w=w+Math.imul(ae,rt)|0,h=h+Math.imul(ae,nt)|0,h=h+Math.imul(Ie,rt)|0,E=E+Math.imul(Ie,nt)|0,w=w+Math.imul(Q,it)|0,h=h+Math.imul(Q,st)|0,h=h+Math.imul(J,it)|0,E=E+Math.imul(J,st)|0,w=w+Math.imul(L,ot)|0,h=h+Math.imul(L,at)|0,h=h+Math.imul(z,ot)|0,E=E+Math.imul(z,at)|0;var Ap=(A+w|0)+((h&8191)<<13)|0;A=(E+(h>>>13)|0)+(Ap>>>26)|0,Ap&=67108863,w=Math.imul(Ue,Xe),h=Math.imul(Ue,Je),h=h+Math.imul(qe,Xe)|0,E=Math.imul(qe,Je),w=w+Math.imul(je,Ze)|0,h=h+Math.imul(je,Qe)|0,h=h+Math.imul(Fe,Ze)|0,E=E+Math.imul(Fe,Qe)|0,w=w+Math.imul(Le,et)|0,h=h+Math.imul(Le,tt)|0,h=h+Math.imul(Be,et)|0,E=E+Math.imul(Be,tt)|0,w=w+Math.imul(Ne,rt)|0,h=h+Math.imul(Ne,nt)|0,h=h+Math.imul(De,rt)|0,E=E+Math.imul(De,nt)|0,w=w+Math.imul(ae,it)|0,h=h+Math.imul(ae,st)|0,h=h+Math.imul(Ie,it)|0,E=E+Math.imul(Ie,st)|0,w=w+Math.imul(Q,ot)|0,h=h+Math.imul(Q,at)|0,h=h+Math.imul(J,ot)|0,E=E+Math.imul(J,at)|0;var kp=(A+w|0)+((h&8191)<<13)|0;A=(E+(h>>>13)|0)+(kp>>>26)|0,kp&=67108863,w=Math.imul(Ue,Ze),h=Math.imul(Ue,Qe),h=h+Math.imul(qe,Ze)|0,E=Math.imul(qe,Qe),w=w+Math.imul(je,et)|0,h=h+Math.imul(je,tt)|0,h=h+Math.imul(Fe,et)|0,E=E+Math.imul(Fe,tt)|0,w=w+Math.imul(Le,rt)|0,h=h+Math.imul(Le,nt)|0,h=h+Math.imul(Be,rt)|0,E=E+Math.imul(Be,nt)|0,w=w+Math.imul(Ne,it)|0,h=h+Math.imul(Ne,st)|0,h=h+Math.imul(De,it)|0,E=E+Math.imul(De,st)|0,w=w+Math.imul(ae,ot)|0,h=h+Math.imul(ae,at)|0,h=h+Math.imul(Ie,ot)|0,E=E+Math.imul(Ie,at)|0;var Rp=(A+w|0)+((h&8191)<<13)|0;A=(E+(h>>>13)|0)+(Rp>>>26)|0,Rp&=67108863,w=Math.imul(Ue,et),h=Math.imul(Ue,tt),h=h+Math.imul(qe,et)|0,E=Math.imul(qe,tt),w=w+Math.imul(je,rt)|0,h=h+Math.imul(je,nt)|0,h=h+Math.imul(Fe,rt)|0,E=E+Math.imul(Fe,nt)|0,w=w+Math.imul(Le,it)|0,h=h+Math.imul(Le,st)|0,h=h+Math.imul(Be,it)|0,E=E+Math.imul(Be,st)|0,w=w+Math.imul(Ne,ot)|0,h=h+Math.imul(Ne,at)|0,h=h+Math.imul(De,ot)|0,E=E+Math.imul(De,at)|0;var Op=(A+w|0)+((h&8191)<<13)|0;A=(E+(h>>>13)|0)+(Op>>>26)|0,Op&=67108863,w=Math.imul(Ue,rt),h=Math.imul(Ue,nt),h=h+Math.imul(qe,rt)|0,E=Math.imul(qe,nt),w=w+Math.imul(je,it)|0,h=h+Math.imul(je,st)|0,h=h+Math.imul(Fe,it)|0,E=E+Math.imul(Fe,st)|0,w=w+Math.imul(Le,ot)|0,h=h+Math.imul(Le,at)|0,h=h+Math.imul(Be,ot)|0,E=E+Math.imul(Be,at)|0;var Mp=(A+w|0)+((h&8191)<<13)|0;A=(E+(h>>>13)|0)+(Mp>>>26)|0,Mp&=67108863,w=Math.imul(Ue,it),h=Math.imul(Ue,st),h=h+Math.imul(qe,it)|0,E=Math.imul(qe,st),w=w+Math.imul(je,ot)|0,h=h+Math.imul(je,at)|0,h=h+Math.imul(Fe,ot)|0,E=E+Math.imul(Fe,at)|0;var Pp=(A+w|0)+((h&8191)<<13)|0;A=(E+(h>>>13)|0)+(Pp>>>26)|0,Pp&=67108863,w=Math.imul(Ue,ot),h=Math.imul(Ue,at),h=h+Math.imul(qe,ot)|0,E=Math.imul(qe,at);var Ip=(A+w|0)+((h&8191)<<13)|0;return A=(E+(h>>>13)|0)+(Ip>>>26)|0,Ip&=67108863,_[0]=mp,_[1]=gp,_[2]=vp,_[3]=yp,_[4]=xp,_[5]=_p,_[6]=bp,_[7]=wp,_[8]=Sp,_[9]=Ep,_[10]=Tp,_[11]=Cp,_[12]=Ap,_[13]=kp,_[14]=Rp,_[15]=Op,_[16]=Mp,_[17]=Pp,_[18]=Ip,A!==0&&(_[19]=A,x.length++),x};Math.imul||(y=g);function b(T,p,m){m.negative=p.negative^T.negative,m.length=T.length+p.length;for(var x=0,S=0,v=0;v<m.length-1;v++){var _=S;S=0;for(var A=x&67108863,w=Math.min(v,p.length-1),h=Math.max(0,v-T.length+1);h<=w;h++){var E=v-h,q=T.words[E]|0,O=p.words[h]|0,I=q*O,j=I&67108863;_=_+(I/67108864|0)|0,j=j+A|0,A=j&67108863,_=_+(j>>>26)|0,S+=_>>>26,_&=67108863}m.words[v]=A,x=_,_=S}return x!==0?m.words[v]=x:m.length--,m.strip()}function C(T,p,m){var x=new R;return x.mulp(T,p,m)}i.prototype.mulTo=function(p,m){var x,S=this.length+p.length;return this.length===10&&p.length===10?x=y(this,p,m):S<63?x=g(this,p,m):S<1024?x=b(this,p,m):x=C(this,p,m),x};function R(T,p){this.x=T,this.y=p}R.prototype.makeRBT=function(p){for(var m=new Array(p),x=i.prototype._countBits(p)-1,S=0;S<p;S++)m[S]=this.revBin(S,x,p);return m},R.prototype.revBin=function(p,m,x){if(p===0||p===x-1)return p;for(var S=0,v=0;v<m;v++)S|=(p&1)<<m-v-1,p>>=1;return S},R.prototype.permute=function(p,m,x,S,v,_){for(var A=0;A<_;A++)S[A]=m[p[A]],v[A]=x[p[A]]},R.prototype.transform=function(p,m,x,S,v,_){this.permute(_,p,m,x,S,v);for(var A=1;A<v;A<<=1)for(var w=A<<1,h=Math.cos(2*Math.PI/w),E=Math.sin(2*Math.PI/w),q=0;q<v;q+=w)for(var O=h,I=E,j=0;j<A;j++){var K=x[q+j],U=S[q+j],ke=x[q+j+A],ie=S[q+j+A],N=O*ke-I*ie;ie=O*ie+I*ke,ke=N,x[q+j]=K+ke,S[q+j]=U+ie,x[q+j+A]=K-ke,S[q+j+A]=U-ie,j!==w&&(N=h*O-E*I,I=h*I+E*O,O=N)}},R.prototype.guessLen13b=function(p,m){var x=Math.max(m,p)|1,S=x&1,v=0;for(x=x/2|0;x;x=x>>>1)v++;return 1<<v+1+S},R.prototype.conjugate=function(p,m,x){if(!(x<=1))for(var S=0;S<x/2;S++){var v=p[S];p[S]=p[x-S-1],p[x-S-1]=v,v=m[S],m[S]=-m[x-S-1],m[x-S-1]=-v}},R.prototype.normalize13b=function(p,m){for(var x=0,S=0;S<m/2;S++){var v=Math.round(p[2*S+1]/m)*8192+Math.round(p[2*S]/m)+x;p[S]=v&67108863,v<67108864?x=0:x=v/67108864|0}return p},R.prototype.convert13b=function(p,m,x,S){for(var v=0,_=0;_<m;_++)v=v+(p[_]|0),x[2*_]=v&8191,v=v>>>13,x[2*_+1]=v&8191,v=v>>>13;for(_=2*m;_<S;++_)x[_]=0;t(v===0),t((v&-8192)===0)},R.prototype.stub=function(p){for(var m=new Array(p),x=0;x<p;x++)m[x]=0;return m},R.prototype.mulp=function(p,m,x){var S=2*this.guessLen13b(p.length,m.length),v=this.makeRBT(S),_=this.stub(S),A=new Array(S),w=new Array(S),h=new Array(S),E=new Array(S),q=new Array(S),O=new Array(S),I=x.words;I.length=S,this.convert13b(p.words,p.length,A,S),this.convert13b(m.words,m.length,E,S),this.transform(A,_,w,h,S,v),this.transform(E,_,q,O,S,v);for(var j=0;j<S;j++){var K=w[j]*q[j]-h[j]*O[j];h[j]=w[j]*O[j]+h[j]*q[j],w[j]=K}return this.conjugate(w,h,S),this.transform(w,h,I,_,S,v),this.conjugate(I,_,S),this.normalize13b(I,S),x.negative=p.negative^m.negative,x.length=p.length+m.length,x.strip()},i.prototype.mul=function(p){var m=new i(null);return m.words=new Array(this.length+p.length),this.mulTo(p,m)},i.prototype.mulf=function(p){var m=new i(null);return m.words=new Array(this.length+p.length),C(this,p,m)},i.prototype.imul=function(p){return this.clone().mulTo(p,this)},i.prototype.imuln=function(p){t(typeof p=="number"),t(p<67108864);for(var m=0,x=0;x<this.length;x++){var S=(this.words[x]|0)*p,v=(S&67108863)+(m&67108863);m>>=26,m+=S/67108864|0,m+=v>>>26,this.words[x]=v&67108863}return m!==0&&(this.words[x]=m,this.length++),this.length=p===0?1:this.length,this},i.prototype.muln=function(p){return this.clone().imuln(p)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(p){var m=d(p);if(m.length===0)return new i(1);for(var x=this,S=0;S<m.length&&m[S]===0;S++,x=x.sqr());if(++S<m.length)for(var v=x.sqr();S<m.length;S++,v=v.sqr())m[S]!==0&&(x=x.mul(v));return x},i.prototype.iushln=function(p){t(typeof p=="number"&&p>=0);var m=p%26,x=(p-m)/26,S=67108863>>>26-m<<26-m,v;if(m!==0){var _=0;for(v=0;v<this.length;v++){var A=this.words[v]&S,w=(this.words[v]|0)-A<<m;this.words[v]=w|_,_=A>>>26-m}_&&(this.words[v]=_,this.length++)}if(x!==0){for(v=this.length-1;v>=0;v--)this.words[v+x]=this.words[v];for(v=0;v<x;v++)this.words[v]=0;this.length+=x}return this.strip()},i.prototype.ishln=function(p){return t(this.negative===0),this.iushln(p)},i.prototype.iushrn=function(p,m,x){t(typeof p=="number"&&p>=0);var S;m?S=(m-m%26)/26:S=0;var v=p%26,_=Math.min((p-v)/26,this.length),A=67108863^67108863>>>v<<v,w=x;if(S-=_,S=Math.max(0,S),w){for(var h=0;h<_;h++)w.words[h]=this.words[h];w.length=_}if(_!==0)if(this.length>_)for(this.length-=_,h=0;h<this.length;h++)this.words[h]=this.words[h+_];else this.words[0]=0,this.length=1;var E=0;for(h=this.length-1;h>=0&&(E!==0||h>=S);h--){var q=this.words[h]|0;this.words[h]=E<<26-v|q>>>v,E=q&A}return w&&E!==0&&(w.words[w.length++]=E),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(p,m,x){return t(this.negative===0),this.iushrn(p,m,x)},i.prototype.shln=function(p){return this.clone().ishln(p)},i.prototype.ushln=function(p){return this.clone().iushln(p)},i.prototype.shrn=function(p){return this.clone().ishrn(p)},i.prototype.ushrn=function(p){return this.clone().iushrn(p)},i.prototype.testn=function(p){t(typeof p=="number"&&p>=0);var m=p%26,x=(p-m)/26,S=1<<m;if(this.length<=x)return!1;var v=this.words[x];return!!(v&S)},i.prototype.imaskn=function(p){t(typeof p=="number"&&p>=0);var m=p%26,x=(p-m)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=x)return this;if(m!==0&&x++,this.length=Math.min(x,this.length),m!==0){var S=67108863^67108863>>>m<<m;this.words[this.length-1]&=S}return this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.maskn=function(p){return this.clone().imaskn(p)},i.prototype.iaddn=function(p){return t(typeof p=="number"),t(p<67108864),p<0?this.isubn(-p):this.negative!==0?this.length===1&&(this.words[0]|0)<p?(this.words[0]=p-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(p),this.negative=1,this):this._iaddn(p)},i.prototype._iaddn=function(p){this.words[0]+=p;for(var m=0;m<this.length&&this.words[m]>=67108864;m++)this.words[m]-=67108864,m===this.length-1?this.words[m+1]=1:this.words[m+1]++;return this.length=Math.max(this.length,m+1),this},i.prototype.isubn=function(p){if(t(typeof p=="number"),t(p<67108864),p<0)return this.iaddn(-p);if(this.negative!==0)return this.negative=0,this.iaddn(p),this.negative=1,this;if(this.words[0]-=p,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var m=0;m<this.length&&this.words[m]<0;m++)this.words[m]+=67108864,this.words[m+1]-=1;return this.strip()},i.prototype.addn=function(p){return this.clone().iaddn(p)},i.prototype.subn=function(p){return this.clone().isubn(p)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(p,m,x){var S=p.length+x,v;this._expand(S);var _,A=0;for(v=0;v<p.length;v++){_=(this.words[v+x]|0)+A;var w=(p.words[v]|0)*m;_-=w&67108863,A=(_>>26)-(w/67108864|0),this.words[v+x]=_&67108863}for(;v<this.length-x;v++)_=(this.words[v+x]|0)+A,A=_>>26,this.words[v+x]=_&67108863;if(A===0)return this.strip();for(t(A===-1),A=0,v=0;v<this.length;v++)_=-(this.words[v]|0)+A,A=_>>26,this.words[v]=_&67108863;return this.negative=1,this.strip()},i.prototype._wordDiv=function(p,m){var x=this.length-p.length,S=this.clone(),v=p,_=v.words[v.length-1]|0,A=this._countBits(_);x=26-A,x!==0&&(v=v.ushln(x),S.iushln(x),_=v.words[v.length-1]|0);var w=S.length-v.length,h;if(m!=="mod"){h=new i(null),h.length=w+1,h.words=new Array(h.length);for(var E=0;E<h.length;E++)h.words[E]=0}var q=S.clone()._ishlnsubmul(v,1,w);q.negative===0&&(S=q,h&&(h.words[w]=1));for(var O=w-1;O>=0;O--){var I=(S.words[v.length+O]|0)*67108864+(S.words[v.length+O-1]|0);for(I=Math.min(I/_|0,67108863),S._ishlnsubmul(v,I,O);S.negative!==0;)I--,S.negative=0,S._ishlnsubmul(v,1,O),S.isZero()||(S.negative^=1);h&&(h.words[O]=I)}return h&&h.strip(),S.strip(),m!=="div"&&x!==0&&S.iushrn(x),{div:h||null,mod:S}},i.prototype.divmod=function(p,m,x){if(t(!p.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var S,v,_;return this.negative!==0&&p.negative===0?(_=this.neg().divmod(p,m),m!=="mod"&&(S=_.div.neg()),m!=="div"&&(v=_.mod.neg(),x&&v.negative!==0&&v.iadd(p)),{div:S,mod:v}):this.negative===0&&p.negative!==0?(_=this.divmod(p.neg(),m),m!=="mod"&&(S=_.div.neg()),{div:S,mod:_.mod}):(this.negative&p.negative)!==0?(_=this.neg().divmod(p.neg(),m),m!=="div"&&(v=_.mod.neg(),x&&v.negative!==0&&v.isub(p)),{div:_.div,mod:v}):p.length>this.length||this.cmp(p)<0?{div:new i(0),mod:this}:p.length===1?m==="div"?{div:this.divn(p.words[0]),mod:null}:m==="mod"?{div:null,mod:new i(this.modn(p.words[0]))}:{div:this.divn(p.words[0]),mod:new i(this.modn(p.words[0]))}:this._wordDiv(p,m)},i.prototype.div=function(p){return this.divmod(p,"div",!1).div},i.prototype.mod=function(p){return this.divmod(p,"mod",!1).mod},i.prototype.umod=function(p){return this.divmod(p,"mod",!0).mod},i.prototype.divRound=function(p){var m=this.divmod(p);if(m.mod.isZero())return m.div;var x=m.div.negative!==0?m.mod.isub(p):m.mod,S=p.ushrn(1),v=p.andln(1),_=x.cmp(S);return _<0||v===1&&_===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},i.prototype.modn=function(p){t(p<=67108863);for(var m=(1<<26)%p,x=0,S=this.length-1;S>=0;S--)x=(m*x+(this.words[S]|0))%p;return x},i.prototype.idivn=function(p){t(p<=67108863);for(var m=0,x=this.length-1;x>=0;x--){var S=(this.words[x]|0)+m*67108864;this.words[x]=S/p|0,m=S%p}return this.strip()},i.prototype.divn=function(p){return this.clone().idivn(p)},i.prototype.egcd=function(p){t(p.negative===0),t(!p.isZero());var m=this,x=p.clone();m.negative!==0?m=m.umod(p):m=m.clone();for(var S=new i(1),v=new i(0),_=new i(0),A=new i(1),w=0;m.isEven()&&x.isEven();)m.iushrn(1),x.iushrn(1),++w;for(var h=x.clone(),E=m.clone();!m.isZero();){for(var q=0,O=1;(m.words[0]&O)===0&&q<26;++q,O<<=1);if(q>0)for(m.iushrn(q);q-- >0;)(S.isOdd()||v.isOdd())&&(S.iadd(h),v.isub(E)),S.iushrn(1),v.iushrn(1);for(var I=0,j=1;(x.words[0]&j)===0&&I<26;++I,j<<=1);if(I>0)for(x.iushrn(I);I-- >0;)(_.isOdd()||A.isOdd())&&(_.iadd(h),A.isub(E)),_.iushrn(1),A.iushrn(1);m.cmp(x)>=0?(m.isub(x),S.isub(_),v.isub(A)):(x.isub(m),_.isub(S),A.isub(v))}return{a:_,b:A,gcd:x.iushln(w)}},i.prototype._invmp=function(p){t(p.negative===0),t(!p.isZero());var m=this,x=p.clone();m.negative!==0?m=m.umod(p):m=m.clone();for(var S=new i(1),v=new i(0),_=x.clone();m.cmpn(1)>0&&x.cmpn(1)>0;){for(var A=0,w=1;(m.words[0]&w)===0&&A<26;++A,w<<=1);if(A>0)for(m.iushrn(A);A-- >0;)S.isOdd()&&S.iadd(_),S.iushrn(1);for(var h=0,E=1;(x.words[0]&E)===0&&h<26;++h,E<<=1);if(h>0)for(x.iushrn(h);h-- >0;)v.isOdd()&&v.iadd(_),v.iushrn(1);m.cmp(x)>=0?(m.isub(x),S.isub(v)):(x.isub(m),v.isub(S))}var q;return m.cmpn(1)===0?q=S:q=v,q.cmpn(0)<0&&q.iadd(p),q},i.prototype.gcd=function(p){if(this.isZero())return p.abs();if(p.isZero())return this.abs();var m=this.clone(),x=p.clone();m.negative=0,x.negative=0;for(var S=0;m.isEven()&&x.isEven();S++)m.iushrn(1),x.iushrn(1);do{for(;m.isEven();)m.iushrn(1);for(;x.isEven();)x.iushrn(1);var v=m.cmp(x);if(v<0){var _=m;m=x,x=_}else if(v===0||x.cmpn(1)===0)break;m.isub(x)}while(!0);return x.iushln(S)},i.prototype.invm=function(p){return this.egcd(p).a.umod(p)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(p){return this.words[0]&p},i.prototype.bincn=function(p){t(typeof p=="number");var m=p%26,x=(p-m)/26,S=1<<m;if(this.length<=x)return this._expand(x+1),this.words[x]|=S,this;for(var v=S,_=x;v!==0&&_<this.length;_++){var A=this.words[_]|0;A+=v,v=A>>>26,A&=67108863,this.words[_]=A}return v!==0&&(this.words[_]=v,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(p){var m=p<0;if(this.negative!==0&&!m)return-1;if(this.negative===0&&m)return 1;this.strip();var x;if(this.length>1)x=1;else{m&&(p=-p),t(p<=67108863,"Number is too big");var S=this.words[0]|0;x=S===p?0:S<p?-1:1}return this.negative!==0?-x|0:x},i.prototype.cmp=function(p){if(this.negative!==0&&p.negative===0)return-1;if(this.negative===0&&p.negative!==0)return 1;var m=this.ucmp(p);return this.negative!==0?-m|0:m},i.prototype.ucmp=function(p){if(this.length>p.length)return 1;if(this.length<p.length)return-1;for(var m=0,x=this.length-1;x>=0;x--){var S=this.words[x]|0,v=p.words[x]|0;if(S!==v){S<v?m=-1:S>v&&(m=1);break}}return m},i.prototype.gtn=function(p){return this.cmpn(p)===1},i.prototype.gt=function(p){return this.cmp(p)===1},i.prototype.gten=function(p){return this.cmpn(p)>=0},i.prototype.gte=function(p){return this.cmp(p)>=0},i.prototype.ltn=function(p){return this.cmpn(p)===-1},i.prototype.lt=function(p){return this.cmp(p)===-1},i.prototype.lten=function(p){return this.cmpn(p)<=0},i.prototype.lte=function(p){return this.cmp(p)<=0},i.prototype.eqn=function(p){return this.cmpn(p)===0},i.prototype.eq=function(p){return this.cmp(p)===0},i.red=function(p){return new D(p)},i.prototype.toRed=function(p){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),p.convertTo(this)._forceRed(p)},i.prototype.fromRed=function(){return t(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(p){return this.red=p,this},i.prototype.forceRed=function(p){return t(!this.red,"Already a number in reduction context"),this._forceRed(p)},i.prototype.redAdd=function(p){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,p)},i.prototype.redIAdd=function(p){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,p)},i.prototype.redSub=function(p){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,p)},i.prototype.redISub=function(p){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,p)},i.prototype.redShl=function(p){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,p)},i.prototype.redMul=function(p){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,p),this.red.mul(this,p)},i.prototype.redIMul=function(p){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,p),this.red.imul(this,p)},i.prototype.redSqr=function(){return t(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return t(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return t(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return t(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return t(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(p){return t(this.red&&!p.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,p)};var M={k256:null,p224:null,p192:null,p25519:null};function P(T,p){this.name=T,this.p=new i(p,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}P.prototype._tmp=function(){var p=new i(null);return p.words=new Array(Math.ceil(this.n/13)),p},P.prototype.ireduce=function(p){var m=p,x;do this.split(m,this.tmp),m=this.imulK(m),m=m.iadd(this.tmp),x=m.bitLength();while(x>this.n);var S=x<this.n?-1:m.ucmp(this.p);return S===0?(m.words[0]=0,m.length=1):S>0?m.isub(this.p):m.strip!==void 0?m.strip():m._strip(),m},P.prototype.split=function(p,m){p.iushrn(this.n,0,m)},P.prototype.imulK=function(p){return p.imul(this.k)};function B(){P.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(B,P),B.prototype.split=function(p,m){for(var x=4194303,S=Math.min(p.length,9),v=0;v<S;v++)m.words[v]=p.words[v];if(m.length=S,p.length<=9){p.words[0]=0,p.length=1;return}var _=p.words[9];for(m.words[m.length++]=_&x,v=10;v<p.length;v++){var A=p.words[v]|0;p.words[v-10]=(A&x)<<4|_>>>22,_=A}_>>>=22,p.words[v-10]=_,_===0&&p.length>10?p.length-=10:p.length-=9},B.prototype.imulK=function(p){p.words[p.length]=0,p.words[p.length+1]=0,p.length+=2;for(var m=0,x=0;x<p.length;x++){var S=p.words[x]|0;m+=S*977,p.words[x]=m&67108863,m=S*64+(m/67108864|0)}return p.words[p.length-1]===0&&(p.length--,p.words[p.length-1]===0&&p.length--),p};function G(){P.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(G,P);function F(){P.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(F,P);function V(){P.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(V,P),V.prototype.imulK=function(p){for(var m=0,x=0;x<p.length;x++){var S=(p.words[x]|0)*19+m,v=S&67108863;S>>>=26,p.words[x]=v,m=S}return m!==0&&(p.words[p.length++]=m),p},i._prime=function(p){if(M[p])return M[p];var m;if(p==="k256")m=new B;else if(p==="p224")m=new G;else if(p==="p192")m=new F;else if(p==="p25519")m=new V;else throw new Error("Unknown prime "+p);return M[p]=m,m};function D(T){if(typeof T=="string"){var p=i._prime(T);this.m=p.p,this.prime=p}else t(T.gtn(1),"modulus must be greater than 1"),this.m=T,this.prime=null}D.prototype._verify1=function(p){t(p.negative===0,"red works only with positives"),t(p.red,"red works only with red numbers")},D.prototype._verify2=function(p,m){t((p.negative|m.negative)===0,"red works only with positives"),t(p.red&&p.red===m.red,"red works only with red numbers")},D.prototype.imod=function(p){return this.prime?this.prime.ireduce(p)._forceRed(this):p.umod(this.m)._forceRed(this)},D.prototype.neg=function(p){return p.isZero()?p.clone():this.m.sub(p)._forceRed(this)},D.prototype.add=function(p,m){this._verify2(p,m);var x=p.add(m);return x.cmp(this.m)>=0&&x.isub(this.m),x._forceRed(this)},D.prototype.iadd=function(p,m){this._verify2(p,m);var x=p.iadd(m);return x.cmp(this.m)>=0&&x.isub(this.m),x},D.prototype.sub=function(p,m){this._verify2(p,m);var x=p.sub(m);return x.cmpn(0)<0&&x.iadd(this.m),x._forceRed(this)},D.prototype.isub=function(p,m){this._verify2(p,m);var x=p.isub(m);return x.cmpn(0)<0&&x.iadd(this.m),x},D.prototype.shl=function(p,m){return this._verify1(p),this.imod(p.ushln(m))},D.prototype.imul=function(p,m){return this._verify2(p,m),this.imod(p.imul(m))},D.prototype.mul=function(p,m){return this._verify2(p,m),this.imod(p.mul(m))},D.prototype.isqr=function(p){return this.imul(p,p.clone())},D.prototype.sqr=function(p){return this.mul(p,p)},D.prototype.sqrt=function(p){if(p.isZero())return p.clone();var m=this.m.andln(3);if(t(m%2===1),m===3){var x=this.m.add(new i(1)).iushrn(2);return this.pow(p,x)}for(var S=this.m.subn(1),v=0;!S.isZero()&&S.andln(1)===0;)v++,S.iushrn(1);t(!S.isZero());var _=new i(1).toRed(this),A=_.redNeg(),w=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new i(2*h*h).toRed(this);this.pow(h,w).cmp(A)!==0;)h.redIAdd(A);for(var E=this.pow(h,S),q=this.pow(p,S.addn(1).iushrn(1)),O=this.pow(p,S),I=v;O.cmp(_)!==0;){for(var j=O,K=0;j.cmp(_)!==0;K++)j=j.redSqr();t(K<I);var U=this.pow(E,new i(1).iushln(I-K-1));q=q.redMul(U),E=U.redSqr(),O=O.redMul(E),I=K}return q},D.prototype.invm=function(p){var m=p._invmp(this.m);return m.negative!==0?(m.negative=0,this.imod(m).redNeg()):this.imod(m)},D.prototype.pow=function(p,m){if(m.isZero())return new i(1).toRed(this);if(m.cmpn(1)===0)return p.clone();var x=4,S=new Array(1<<x);S[0]=new i(1).toRed(this),S[1]=p;for(var v=2;v<S.length;v++)S[v]=this.mul(S[v-1],p);var _=S[0],A=0,w=0,h=m.bitLength()%26;for(h===0&&(h=26),v=m.length-1;v>=0;v--){for(var E=m.words[v],q=h-1;q>=0;q--){var O=E>>q&1;if(_!==S[0]&&(_=this.sqr(_)),O===0&&A===0){w=0;continue}A<<=1,A|=O,w++,!(w!==x&&(v!==0||q!==0))&&(_=this.mul(_,S[A]),w=0,A=0)}h=26}return _},D.prototype.convertTo=function(p){var m=p.umod(this.m);return m===p?m.clone():m},D.prototype.convertFrom=function(p){var m=p.clone();return m.red=null,m},i.mont=function(p){return new $(p)};function $(T){D.call(this,T),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n($,D),$.prototype.convertTo=function(p){return this.imod(p.ushln(this.shift))},$.prototype.convertFrom=function(p){var m=this.imod(p.mul(this.rinv));return m.red=null,m},$.prototype.imul=function(p,m){if(p.isZero()||m.isZero())return p.words[0]=0,p.length=1,p;var x=p.imul(m),S=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=x.isub(S).iushrn(this.shift),_=v;return v.cmp(this.m)>=0?_=v.isub(this.m):v.cmpn(0)<0&&(_=v.iadd(this.m)),_._forceRed(this)},$.prototype.mul=function(p,m){if(p.isZero()||m.isZero())return new i(0)._forceRed(this);var x=p.mul(m),S=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=x.isub(S).iushrn(this.shift),_=v;return v.cmp(this.m)>=0?_=v.isub(this.m):v.cmpn(0)<0&&(_=v.iadd(this.m)),_._forceRed(this)},$.prototype.invm=function(p){var m=this.imod(p._invmp(this.m).mul(this.r2));return m._forceRed(this)}})(typeof sm>"u"||sm,DE)});var LE=k((GG,am)=>{typeof Object.create=="function"?am.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:am.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 Yn=k((zG,lm)=>{try{if(cm=require("util"),typeof cm.inherits!="function")throw"";lm.exports=cm.inherits}catch{lm.exports=LE()}var cm});var su=k((VG,BE)=>{"use strict";var iu=require("buffer"),Us=iu.Buffer,mr={},gr;for(gr in iu)iu.hasOwnProperty(gr)&&(gr==="SlowBuffer"||gr==="Buffer"||(mr[gr]=iu[gr]));var qs=mr.Buffer={};for(gr in Us)Us.hasOwnProperty(gr)&&(gr==="allocUnsafe"||gr==="allocUnsafeSlow"||(qs[gr]=Us[gr]));mr.Buffer.prototype=Us.prototype;(!qs.from||qs.from===Uint8Array.from)&&(qs.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 Us(r,e,t)});qs.alloc||(qs.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=Us(r);return!e||e.length===0?n.fill(0):typeof t=="string"?n.fill(e,t):n.fill(e),n});if(!mr.kStringMaxLength)try{mr.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}mr.constants||(mr.constants={MAX_LENGTH:mr.kMaxLength},mr.kStringMaxLength&&(mr.constants.MAX_STRING_LENGTH=mr.kStringMaxLength));BE.exports=mr});var ou=k(jE=>{"use strict";var Fj=Yn();function vr(r){this._reporterState={obj:null,path:[],options:r||{},errors:[]}}jE.Reporter=vr;vr.prototype.isError=function(e){return e instanceof $s};vr.prototype.save=function(){let e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}};vr.prototype.restore=function(e){let t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)};vr.prototype.enterKey=function(e){return this._reporterState.path.push(e)};vr.prototype.exitKey=function(e){let t=this._reporterState;t.path=t.path.slice(0,e-1)};vr.prototype.leaveKey=function(e,t,n){let i=this._reporterState;this.exitKey(e),i.obj!==null&&(i.obj[t]=n)};vr.prototype.path=function(){return this._reporterState.path.join("/")};vr.prototype.enterObject=function(){let e=this._reporterState,t=e.obj;return e.obj={},t};vr.prototype.leaveObject=function(e){let t=this._reporterState,n=t.obj;return t.obj=e,n};vr.prototype.error=function(e){let t,n=this._reporterState,i=e instanceof $s;if(i?t=e:t=new $s(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};vr.prototype.wrapResult=function(e){let t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e};function $s(r,e){this.path=r,this.rethrow(e)}Fj($s,Error);$s.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,$s),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}});var Gs=k(um=>{"use strict";var Uj=Yn(),au=ou().Reporter,Hs=su().Buffer;function yr(r,e){if(au.call(this,e),!Hs.isBuffer(r)){this.error("Input not Buffer");return}this.base=r,this.offset=0,this.length=r.length}Uj(yr,au);um.DecoderBuffer=yr;yr.isDecoderBuffer=function(e){return e instanceof yr?!0:typeof e=="object"&&Hs.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"};yr.prototype.save=function(){return{offset:this.offset,reporter:au.prototype.save.call(this)}};yr.prototype.restore=function(e){let t=new yr(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,au.prototype.restore.call(this,e.reporter),t};yr.prototype.isEmpty=function(){return this.offset===this.length};yr.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")};yr.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");let n=new yr(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+e,this.offset+=e,n};yr.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)};function Ws(r,e){if(Array.isArray(r))this.length=0,this.value=r.map(function(t){return Ws.isEncoderBuffer(t)||(t=new Ws(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=Hs.byteLength(r);else if(Hs.isBuffer(r))this.value=r,this.length=r.length;else return e.error("Unsupported type: "+typeof r)}um.EncoderBuffer=Ws;Ws.isEncoderBuffer=function(e){return e instanceof Ws?!0:typeof e=="object"&&e.constructor.name==="EncoderBuffer"&&typeof e.length=="number"&&typeof e.join=="function"};Ws.prototype.join=function(e,t){return e||(e=Hs.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):Hs.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}});var qE=k((XG,UE)=>{UE.exports=FE;function FE(r,e){if(!r)throw new Error(e||"Assertion failed")}FE.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)}});var cu=k((JG,HE)=>{"use strict";var qj=ou().Reporter,$j=Gs().EncoderBuffer,Hj=Gs().DecoderBuffer,Nt=qE(),$E=["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"],Wj=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat($E),Gj=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function me(r,e,t){let n={};this._baseState=n,n.name=t,n.enc=r,n.parent=e||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}HE.exports=me;var zj=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];me.prototype.clone=function(){let e=this._baseState,t={};zj.forEach(function(i){t[i]=e[i]});let n=new this.constructor(t.parent);return n._baseState=t,n};me.prototype._wrap=function(){let e=this._baseState;Wj.forEach(function(t){this[t]=function(){let i=new this.constructor(this);return e.children.push(i),i[t].apply(i,arguments)}},this)};me.prototype._init=function(e){let t=this._baseState;Nt(t.parent===null),e.call(this),t.children=t.children.filter(function(n){return n._baseState.parent===this},this),Nt.equal(t.children.length,1,"Root node can have only one child")};me.prototype._useArgs=function(e){let t=this._baseState,n=e.filter(function(i){return i instanceof this.constructor},this);e=e.filter(function(i){return!(i instanceof this.constructor)},this),n.length!==0&&(Nt(t.children===null),t.children=n,n.forEach(function(i){i._baseState.parent=this},this)),e.length!==0&&(Nt(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}))};Gj.forEach(function(r){me.prototype[r]=function(){let t=this._baseState;throw new Error(r+" not implemented for encoding: "+t.enc)}});$E.forEach(function(r){me.prototype[r]=function(){let t=this._baseState,n=Array.prototype.slice.call(arguments);return Nt(t.tag===null),t.tag=r,this._useArgs(n),this}});me.prototype.use=function(e){Nt(e);let t=this._baseState;return Nt(t.use===null),t.use=e,this};me.prototype.optional=function(){let e=this._baseState;return e.optional=!0,this};me.prototype.def=function(e){let t=this._baseState;return Nt(t.default===null),t.default=e,t.optional=!0,this};me.prototype.explicit=function(e){let t=this._baseState;return Nt(t.explicit===null&&t.implicit===null),t.explicit=e,this};me.prototype.implicit=function(e){let t=this._baseState;return Nt(t.explicit===null&&t.implicit===null),t.implicit=e,this};me.prototype.obj=function(){let e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,t.length!==0&&this._useArgs(t),this};me.prototype.key=function(e){let t=this._baseState;return Nt(t.key===null),t.key=e,this};me.prototype.any=function(){let e=this._baseState;return e.any=!0,this};me.prototype.choice=function(e){let t=this._baseState;return Nt(t.choice===null),t.choice=e,this._useArgs(Object.keys(e).map(function(n){return e[n]})),this};me.prototype.contains=function(e){let t=this._baseState;return Nt(t.use===null),t.contains=e,this};me.prototype._decode=function(e,t){let n=this._baseState;if(n.parent===null)return e.wrapResult(n.children[0]._decode(e,t));let i=n.default,s=!0,o=null;if(n.key!==null&&(o=e.enterKey(n.key)),n.optional){let c=null;if(n.explicit!==null?c=n.explicit:n.implicit!==null?c=n.implicit:n.tag!==null&&(c=n.tag),c===null&&!n.any){let l=e.save();try{n.choice===null?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t),s=!0}catch{s=!1}e.restore(l)}else if(s=this._peekTag(e,c,n.any),e.isError(s))return s}let a;if(n.obj&&s&&(a=e.enterObject()),s){if(n.explicit!==null){let l=this._decodeTag(e,n.explicit);if(e.isError(l))return l;e=l}let c=e.offset;if(n.use===null&&n.choice===null){let l;n.any&&(l=e.save());let u=this._decodeTag(e,n.implicit!==null?n.implicit:n.tag,n.any);if(e.isError(u))return u;n.any?i=e.raw(l):e=u}if(t&&t.track&&n.tag!==null&&t.track(e.path(),c,e.length,"tagged"),t&&t.track&&n.tag!==null&&t.track(e.path(),e.offset,e.length,"content"),n.any||(n.choice===null?i=this._decodeGeneric(n.tag,e,t):i=this._decodeChoice(e,t)),e.isError(i))return i;if(!n.any&&n.choice===null&&n.children!==null&&n.children.forEach(function(u){u._decode(e,t)}),n.contains&&(n.tag==="octstr"||n.tag==="bitstr")){let l=new Hj(i);i=this._getUse(n.contains,e._reporterState.obj)._decode(l,t)}}return n.obj&&s&&(i=e.leaveObject(a)),n.key!==null&&(i!==null||s===!0)?e.leaveKey(o,n.key,i):o!==null&&e.exitKey(o),i};me.prototype._decodeGeneric=function(e,t,n){let i=this._baseState;return e==="seq"||e==="set"?null:e==="seqof"||e==="setof"?this._decodeList(t,e,i.args[0],n):/str$/.test(e)?this._decodeStr(t,e,n):e==="objid"&&i.args?this._decodeObjid(t,i.args[0],i.args[1],n):e==="objid"?this._decodeObjid(t,null,null,n):e==="gentime"||e==="utctime"?this._decodeTime(t,e,n):e==="null_"?this._decodeNull(t,n):e==="bool"?this._decodeBool(t,n):e==="objDesc"?this._decodeStr(t,e,n):e==="int"||e==="enum"?this._decodeInt(t,i.args&&i.args[0],n):i.use!==null?this._getUse(i.use,t._reporterState.obj)._decode(t,n):t.error("unknown tag: "+e)};me.prototype._getUse=function(e,t){let n=this._baseState;return n.useDecoder=this._use(e,t),Nt(n.useDecoder._baseState.parent===null),n.useDecoder=n.useDecoder._baseState.children[0],n.implicit!==n.useDecoder._baseState.implicit&&(n.useDecoder=n.useDecoder.clone(),n.useDecoder._baseState.implicit=n.implicit),n.useDecoder};me.prototype._decodeChoice=function(e,t){let n=this._baseState,i=null,s=!1;return Object.keys(n.choice).some(function(o){let a=e.save(),c=n.choice[o];try{let l=c._decode(e,t);if(e.isError(l))return!1;i={type:o,value:l},s=!0}catch{return e.restore(a),!1}return!0},this),s?i:e.error("Choice not matched")};me.prototype._createEncoderBuffer=function(e){return new $j(e,this.reporter)};me.prototype._encode=function(e,t,n){let i=this._baseState;if(i.default!==null&&i.default===e)return;let s=this._encodeValue(e,t,n);if(s!==void 0&&!this._skipDefault(s,t,n))return s};me.prototype._encodeValue=function(e,t,n){let i=this._baseState;if(i.parent===null)return i.children[0]._encode(e,t||new qj);let s=null;if(this.reporter=t,i.optional&&e===void 0)if(i.default!==null)e=i.default;else return;let o=null,a=!1;if(i.any)s=this._createEncoderBuffer(e);else if(i.choice)s=this._encodeChoice(e,t);else if(i.contains)o=this._getUse(i.contains,n)._encode(e,t),a=!0;else if(i.children)o=i.children.map(function(c){if(c._baseState.tag==="null_")return c._encode(null,t,e);if(c._baseState.key===null)return t.error("Child should have a key");let l=t.enterKey(c._baseState.key);if(typeof e!="object")return t.error("Child expected, but input is not object");let u=c._encode(e[c._baseState.key],t,e);return t.leaveKey(l),u},this).filter(function(c){return c}),o=this._createEncoderBuffer(o);else if(i.tag==="seqof"||i.tag==="setof"){if(!(i.args&&i.args.length===1))return t.error("Too many args for : "+i.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");let c=this.clone();c._baseState.implicit=null,o=this._createEncoderBuffer(e.map(function(l){let u=this._baseState;return this._getUse(u.args[0],e)._encode(l,t)},c))}else i.use!==null?s=this._getUse(i.use,n)._encode(e,t):(o=this._encodePrimitive(i.tag,e),a=!0);if(!i.any&&i.choice===null){let c=i.implicit!==null?i.implicit:i.tag,l=i.implicit===null?"universal":"context";c===null?i.use===null&&t.error("Tag could be omitted only for .use()"):i.use===null&&(s=this._encodeComposite(c,a,l,o))}return i.explicit!==null&&(s=this._encodeComposite(i.explicit,!1,"context",s)),s};me.prototype._encodeChoice=function(e,t){let n=this._baseState,i=n.choice[e.type];return i||Nt(!1,e.type+" not found in "+JSON.stringify(Object.keys(n.choice))),i._encode(e.value,t)};me.prototype._encodePrimitive=function(e,t){let n=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if(e==="objid"&&n.args)return this._encodeObjid(t,n.reverseArgs[0],n.args[1]);if(e==="objid")return this._encodeObjid(t,null,null);if(e==="gentime"||e==="utctime")return this._encodeTime(t,e);if(e==="null_")return this._encodeNull();if(e==="int"||e==="enum")return this._encodeInt(t,n.args&&n.reverseArgs[0]);if(e==="bool")return this._encodeBool(t);if(e==="objDesc")return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)};me.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)};me.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}});var lu=k(Ei=>{"use strict";function WE(r){let e={};return Object.keys(r).forEach(function(t){(t|0)==t&&(t=t|0);let n=r[t];e[n]=t}),e}Ei.tagClass={0:"universal",1:"application",2:"context",3:"private"};Ei.tagClassByName=WE(Ei.tagClass);Ei.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"};Ei.tagByName=WE(Ei.tag)});var fm=k((QG,VE)=>{"use strict";var Vj=Yn(),En=su().Buffer,GE=cu(),pm=lu();function zE(r){this.enc="der",this.name=r.name,this.entity=r,this.tree=new Ir,this.tree._init(r.body)}VE.exports=zE;zE.prototype.encode=function(e,t){return this.tree._encode(e,t).join()};function Ir(r){GE.call(this,"der",r)}Vj(Ir,GE);Ir.prototype._encodeComposite=function(e,t,n,i){let s=Kj(e,t,n,this.reporter);if(i.length<128){let c=En.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=En.alloc(2+o);a[0]=s,a[1]=128|o;for(let c=1+o,l=i.length;l>0;c--,l>>=8)a[c]=l&255;return this._createEncoderBuffer([a,i])};Ir.prototype._encodeStr=function(e,t){if(t==="bitstr")return this._createEncoderBuffer([e.unused|0,e.data]);if(t==="bmpstr"){let n=En.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")};Ir.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=En.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 xr(r){return r<10?"0"+r:r}Ir.prototype._encodeTime=function(e,t){let n,i=new Date(e);return t==="gentime"?n=[xr(i.getUTCFullYear()),xr(i.getUTCMonth()+1),xr(i.getUTCDate()),xr(i.getUTCHours()),xr(i.getUTCMinutes()),xr(i.getUTCSeconds()),"Z"].join(""):t==="utctime"?n=[xr(i.getUTCFullYear()%100),xr(i.getUTCMonth()+1),xr(i.getUTCDate()),xr(i.getUTCHours()),xr(i.getUTCMinutes()),xr(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(n,"octstr")};Ir.prototype._encodeNull=function(){return this._createEncoderBuffer("")};Ir.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"&&!En.isBuffer(e)){let s=e.toArray();!e.sign&&s[0]&128&&s.unshift(0),e=En.from(s)}if(En.isBuffer(e)){let s=e.length;e.length===0&&s++;let o=En.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(En.from(i))};Ir.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)};Ir.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getEncoder("der").tree};Ir.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 Kj(r,e,t,n){let i;if(r==="seqof"?r="seq":r==="setof"&&(r="set"),pm.tagByName.hasOwnProperty(r))i=pm.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|=pm.tagClassByName[t||"universal"]<<6,i)}});var YE=k((ez,KE)=>{"use strict";var Yj=Yn(),dm=fm();function hm(r){dm.call(this,r),this.enc="pem"}Yj(hm,dm);KE.exports=hm;hm.prototype.encode=function(e,t){let i=dm.prototype.encode.call(this,e).toString("base64"),s=["-----BEGIN "+t.label+"-----"];for(let o=0;o<i.length;o+=64)s.push(i.slice(o,o+64));return s.push("-----END "+t.label+"-----"),s.join(`
|
|
95
|
-
`)}});var mm=k(JE=>{"use strict";var XE=JE;XE.der=fm();XE.pem=YE()});var vm=k((rz,n1)=>{"use strict";var Xj=Yn(),Jj=om(),ZE=Gs().DecoderBuffer,e1=cu(),QE=lu();function t1(r){this.enc="der",this.name=r.name,this.entity=r,this.tree=new tr,this.tree._init(r.body)}n1.exports=t1;t1.prototype.decode=function(e,t){return ZE.isDecoderBuffer(e)||(e=new ZE(e,t)),this.tree._decode(e,t)};function tr(r){e1.call(this,"der",r)}Xj(tr,e1);tr.prototype._peekTag=function(e,t,n){if(e.isEmpty())return!1;let i=e.save(),s=gm(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)};tr.prototype._decodeTag=function(e,t,n){let i=gm(e,'Failed to decode tag of "'+t+'"');if(e.isError(i))return i;let s=r1(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+'"'))};tr.prototype._skipUntilEnd=function(e,t){for(;;){let n=gm(e,t);if(e.isError(n))return n;let i=r1(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}};tr.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};tr.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")}};tr.prototype._decodeObjid=function(e,t,n){let i,s=[],o=0,a=0;for(;!e.isEmpty();)a=e.readUInt8(),o<<=7,o|=a&127,(a&128)===0&&(s.push(o),o=0);a&128&&s.push(o);let c=s[0]/40|0,l=s[0]%40;if(n?i=s:i=[c,l].concat(s.slice(1)),t){let u=t[i.join(" ")];u===void 0&&(u=t[i.join(".")]),u!==void 0&&(i=u)}return i};tr.prototype._decodeTime=function(e,t){let n=e.raw().toString(),i,s,o,a,c,l;if(t==="gentime")i=n.slice(0,4)|0,s=n.slice(4,6)|0,o=n.slice(6,8)|0,a=n.slice(8,10)|0,c=n.slice(10,12)|0,l=n.slice(12,14)|0;else if(t==="utctime")i=n.slice(0,2)|0,s=n.slice(2,4)|0,o=n.slice(4,6)|0,a=n.slice(6,8)|0,c=n.slice(8,10)|0,l=n.slice(10,12)|0,i<70?i=2e3+i:i=1900+i;else return e.error("Decoding "+t+" time is not supported yet");return Date.UTC(i,s-1,o,a,c,l,0)};tr.prototype._decodeNull=function(){return null};tr.prototype._decodeBool=function(e){let t=e.readUInt8();return e.isError(t)?t:t!==0};tr.prototype._decodeInt=function(e,t){let n=e.raw(),i=new Jj(n);return t&&(i=t[i.toString(10)]||i),i};tr.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getDecoder("der").tree};function gm(r,e){let t=r.readUInt8(e);if(r.isError(t))return t;let n=QE.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=QE.tag[t];return{cls:n,primitive:i,tag:t,tagStr:s}}function r1(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 s1=k((nz,i1)=>{"use strict";var Zj=Yn(),Qj=su().Buffer,ym=vm();function xm(r){ym.call(this,r),this.enc="pem"}Zj(xm,ym);i1.exports=xm;xm.prototype.decode=function(e,t){let n=e.toString().split(/[\r\n]+/g),i=t.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/,o=-1,a=-1;for(let u=0;u<n.length;u++){let f=n[u].match(s);if(f!==null&&f[2]===i)if(o===-1){if(f[1]!=="BEGIN")break;o=u}else{if(f[1]!=="END")break;a=u;break}}if(o===-1||a===-1)throw new Error("PEM section not found for: "+i);let c=n.slice(o+1,a).join("");c.replace(/[^a-z0-9+/=]+/gi,"");let l=Qj.from(c,"base64");return ym.prototype.decode.call(this,l,t)}});var _m=k(a1=>{"use strict";var o1=a1;o1.der=vm();o1.pem=s1()});var l1=k(c1=>{"use strict";var eF=mm(),tF=_m(),rF=Yn(),nF=c1;nF.define=function(e,t){return new zs(e,t)};function zs(r,e){this.name=r,this.body=e,this.decoders={},this.encoders={}}zs.prototype._createNamed=function(e){let t=this.name;function n(i){this._initNamed(i,t)}return rF(n,e),n.prototype._initNamed=function(s,o){e.call(this,s,o)},new n(this)};zs.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(tF[e])),this.decoders[e]};zs.prototype.decode=function(e,t,n){return this._getDecoder(t).decode(e,n)};zs.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(eF[e])),this.encoders[e]};zs.prototype.encode=function(e,t,n){return this._getEncoder(t).encode(e,n)}});var p1=k(u1=>{"use strict";var uu=u1;uu.Reporter=ou().Reporter;uu.DecoderBuffer=Gs().DecoderBuffer;uu.EncoderBuffer=Gs().EncoderBuffer;uu.Node=cu()});var h1=k(d1=>{"use strict";var f1=d1;f1._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};f1.der=lu()});var g1=k(m1=>{"use strict";var Vs=m1;Vs.bignum=om();Vs.define=l1().define;Vs.base=p1();Vs.constants=h1();Vs.decoders=_m();Vs.encoders=mm()});var Ks=k((bm,y1)=>{var pu=require("buffer"),Yr=pu.Buffer;function v1(r,e){for(var t in r)e[t]=r[t]}Yr.from&&Yr.alloc&&Yr.allocUnsafe&&Yr.allocUnsafeSlow?y1.exports=pu:(v1(pu,bm),bm.Buffer=Ti);function Ti(r,e,t){return Yr(r,e,t)}Ti.prototype=Object.create(Yr.prototype);v1(Yr,Ti);Ti.from=function(r,e,t){if(typeof r=="number")throw new TypeError("Argument must not be a number");return Yr(r,e,t)};Ti.alloc=function(r,e,t){if(typeof r!="number")throw new TypeError("Argument must be a number");var n=Yr(r);return e!==void 0?typeof t=="string"?n.fill(e,t):n.fill(e):n.fill(0),n};Ti.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return Yr(r)};Ti.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return pu.SlowBuffer(r)}});var wm=k((lz,x1)=>{var fu=Ks().Buffer,iF=require("stream"),sF=require("util");function du(r){if(this.buffer=null,this.writable=!0,this.readable=!0,!r)return this.buffer=fu.alloc(0),this;if(typeof r.pipe=="function")return this.buffer=fu.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+")")}sF.inherits(du,iF);du.prototype.write=function(e){this.buffer=fu.concat([this.buffer,fu.from(e)]),this.emit("data",e)};du.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1};x1.exports=du});var b1=k((uz,_1)=>{"use strict";function Sm(r){var e=(r/8|0)+(r%8===0?0:1);return e}var oF={ES256:Sm(256),ES384:Sm(384),ES512:Sm(521)};function aF(r){var e=oF[r];if(e)return e;throw new Error('Unknown algorithm "'+r+'"')}_1.exports=aF});var k1=k((pz,A1)=>{"use strict";var hu=Ks().Buffer,S1=b1(),mu=128,E1=0,cF=32,lF=16,uF=2,T1=lF|cF|E1<<6,gu=uF|E1<<6;function pF(r){return r.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function C1(r){if(hu.isBuffer(r))return r;if(typeof r=="string")return hu.from(r,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function fF(r,e){r=C1(r);var t=S1(e),n=t+1,i=r.length,s=0;if(r[s++]!==T1)throw new Error('Could not find expected "seq"');var o=r[s++];if(o===(mu|1)&&(o=r[s++]),i-s<o)throw new Error('"seq" specified length of "'+o+'", only "'+(i-s)+'" remaining');if(r[s++]!==gu)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++]!==gu)throw new Error('Could not find expected "int" for "s"');var l=r[s++];if(i-s!==l)throw new Error('"s" specified length of "'+l+'", expected "'+(i-s)+'"');if(n<l)throw new Error('"s" specified length of "'+l+'", max of "'+n+'" is acceptable');var u=s;if(s+=l,s!==i)throw new Error('Expected to consume entire buffer, but "'+(i-s)+'" bytes remain');var f=t-a,d=t-l,g=hu.allocUnsafe(f+a+d+l);for(s=0;s<f;++s)g[s]=0;r.copy(g,s,c+Math.max(-f,0),c+a),s=t;for(var y=s;s<y+d;++s)g[s]=0;return r.copy(g,s,u+Math.max(-d,0),u+l),g=g.toString("base64"),g=pF(g),g}function w1(r,e,t){for(var n=0;e+n<t&&r[e+n]===0;)++n;var i=r[e+n]>=mu;return i&&--n,n}function dF(r,e){r=C1(r);var t=S1(e),n=r.length;if(n!==t*2)throw new TypeError('"'+e+'" signatures must be "'+t*2+'" bytes, saw "'+n+'"');var i=w1(r,0,t),s=w1(r,t,r.length),o=t-i,a=t-s,c=2+o+1+1+a,l=c<mu,u=hu.allocUnsafe((l?2:3)+c),f=0;return u[f++]=T1,l?u[f++]=c:(u[f++]=mu|1,u[f++]=c&255),u[f++]=gu,u[f++]=o,i<0?(u[f++]=0,f+=r.copy(u,f,0,t)):f+=r.copy(u,f,i,t),u[f++]=gu,u[f++]=a,s<0?(u[f++]=0,r.copy(u,f,t)):r.copy(u,f,t+s),u}A1.exports={derToJose:fF,joseToDer:dF}});var O1=k((fz,R1)=>{"use strict";var fa=require("buffer").Buffer,Em=require("buffer").SlowBuffer;R1.exports=vu;function vu(r,e){if(!fa.isBuffer(r)||!fa.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}vu.install=function(){fa.prototype.equal=Em.prototype.equal=function(e){return vu(this,e)}};var hF=fa.prototype.equal,mF=Em.prototype.equal;vu.restore=function(){fa.prototype.equal=hF,Em.prototype.equal=mF}});var km=k((dz,F1)=>{var Xs=Ks().Buffer,_r=require("crypto"),P1=k1(),M1=require("util"),gF=`"%s" is not a valid algorithm.
|
|
94
|
+
`),Nl.add(e),r.on("close",()=>Nl.delete(e))}function iS(r,e){Z(e,{...xn,...Pr,desktopEnabled:Wt,remoteAvailable:Ch})}async function sS(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(Ft(),Hi)),n=await t(r,e);n&&(_n(n),Z(e))}function oS(r,e){Z(e),_n({step:ti.PREPARING,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null}),yn("restart-tunnel")}function aS(r,e){Z(e),_n({step:ti.PREPARING,stepDesc:""}),yn("start-tunnel")}function cS(r,e){Z(e),_n({step:ti.STOPPED,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null}),yn("stop-tunnel")}function lS(r,e){Z(e),_n({step:ti.STOPPED,stepDesc:"",tunnelUrl:"",oneTimeKey:"",oneTimeKeyExpiresAt:null}),yn("shutdown")}function uS(r,e){Z(e),yn("update")}function pS(r,e){Z(e,{connections:[...xi.values()]})}function fS(r,e){let t=new URL(r.url,"http://localhost"),n=parseInt(t.searchParams.get("lines")||qp,10);Z(e,{logs:oy(Number.isFinite(n)?n:qp)})}async function dS(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(Ft(),Hi)),n=await t(r,e);if(!n)return;let i=!!n.enabled;if(i&&(!Pr.screenRecording||!Pr.accessibility)){Z(e,{ok:!1,enabled:Wt,reason:"permissions_required"});return}let s=Os();Wt=i,Th(),Ct("permissions",{...Pr,desktopEnabled:Wt}),Os()!==s&&kh?.(),Z(e,{ok:!0,enabled:Wt})}function hS(r,e){Z(e,Pr)}async function mS(r,e){let t=await gh();Z(e,{enabled:t})}async function gS(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(Ft(),Hi)),n=await t(r,e);if(!n)return;let i=await Bw(!!n.enabled),s=await gh();Ct("autostart",{enabled:s}),Z(e,{ok:i,enabled:s})}async function vS(r,e){let{parseJsonBody:t}=await Promise.resolve().then(()=>(Ft(),Hi)),n=await t(r,e);if(!n)return;let{type:i}=n;if(process.platform==="darwin"){Ow(i);let s=Date.now(),o=setInterval(async()=>{((await Ll())[i]||Date.now()-s>Qv)&&clearInterval(o)},Zv)}Z(e)}var zn,Ww,Eh,xn,Wt,Ch,Pr,Nl,xi,Dl,kh,bn=ke(()=>{St();ri();St();Ts();Mw();vh();Ft();_l();St();zn=require("fs"),Ww=require("path");St();yh();Eh=(0,Ww.join)(ie.STATE,"ui-state.json");xn={step:ti.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}},Wt=!1,Ch=!1,Pr={screenRecording:!1,accessibility:!1},Nl=new Set,xi=new Map;sy(_e);Dl=null;kh=null});var yS={};rn(yS,{ScreenHandler:()=>Ah,encodeTilesBatch:()=>Ms});function sj(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 Ms(r,e){let t=Buffer.alloc(12);return t.writeUInt32LE(r.length,0),t.writeDoubleBE(e,4),Buffer.concat([t,...r.map(sj)])}var Ah,Rh=ke(()=>{ph();dt();bn();Ah=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()},Ms),this.resourceManager.updateClientActivity(e.id)}catch(s){ye.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()},Ms),this.resourceManager.updateClientActivity(e.id)}catch(o){ye.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),ye.lifecycle("\u{1F680} Remote streaming started");let{tileFormat:s,webpEffort:o,jpegQuality:a}=H.pipeline;_e(`\u{1F5BC}\uFE0F Remote stream codec: ${s.toUpperCase()}${s==="webp"?` (effort=${o})`:""} q=${a}`),i.idleFrameCount=0,i.isStreaming=!0,i.streamGen=(i.streamGen||0)+1;let c=i.streamGen;i.tileManager.lastTileChecksums.clear();try{let u=await i.tileManager.getScreenDimensions();n.emit("screen-dimensions",u)}catch(u){ye.error("Get dimensions error:",u)}let l=async()=>{if(!e.connected||!i.isStreaming||i.streamGen!==c){i.streamingTimeout=null;return}if(i.inFlight??=new Set,i.inFlight.size>=H.webrtc.ackWindow){i.streamingTimeout=setTimeout(l,H.webrtc.ackPollMs);return}try{let u=performance.now(),f=Date.now(),d=await i.tileManager.detectChangedTilesWithHashes();if(d.tiles.length>0&&e.connected){let O=n.sendTiles({tiles:d.tiles,timestamp:f,currentHashes:d.currentHashes},Ms);if(i.tileManager.commitHashes(O||[]),i.idleFrameCount=0,O?.length){i.inFlight.add(f),i.ackTimers??=new Map;let P=setTimeout(()=>{i.inFlight.delete(f),i.ackTimers.delete(f)},H.webrtc.ackTimeoutMs);i.ackTimers.set(f,P)}}else i.idleFrameCount++;let{activeInterval:g,idleInterval:y,idleThreshold:b}=this.resourceManager.getStreamingConfig(),C=i.idleFrameCount>=b?y:g,R=Math.max(0,C-(performance.now()-u));i.streamingTimeout=setTimeout(l,R)}catch(u){ye.error("Auto streaming error:",u),i.streamingTimeout=setTimeout(l,200)}};l()})),e.on("stop-streaming",()=>{let i=this.resourceManager.getClient(e.id);if(i){if(i.isStreaming=!1,i.streamingTimeout&&(clearTimeout(i.streamingTimeout),i.streamingTimeout=null),i.inFlight?.clear?.(),i.ackTimers){for(let s of i.ackTimers.values())clearTimeout(s);i.ackTimers.clear()}i.tileManager?.clearMemory?.(),ye.lifecycle("\u23F9\uFE0F Remote streaming stopped")}}),e.on("tile-ack",t(i=>{let s=this.resourceManager.getClient(e.id);if(!s)return;let o=i?.ts;if(typeof o=="number"){s.inFlight??=new Set,s.ackTimers??=new Map;for(let a of[...s.inFlight])if(a<=o){s.inFlight.delete(a);let c=s.ackTimers.get(a);c&&(clearTimeout(c),s.ackTimers.delete(a))}}})),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){ye.error("Get dimensions error:",s),n.emit("screen-error",{error:s.message})}})),e.on("boost-stream",t(()=>{let i=this.resourceManager.getClient(e.id);i&&(i.idleFrameCount=0)})),e.on("set-focus",t(i=>{let s=this.resourceManager.getClient(e.id);if(!s)return;let o=i?.rect||null,a=typeof i?.zoom=="number"?i.zoom:1,c=typeof i?.viewerWidth=="number"?i.viewerWidth:0,l=typeof i?.dpr=="number"?i.dpr:1,u=s.tileManager.pickProfile({zoom:a,viewerWidth:c,dpr:l});if(s.tileManager.setProfile(u),s.tileManager.setFocusRect(o),o){let f=s.tileManager.activeTileSet?.size||0,d=s.tileManager.totalTiles,g=d?(f/d*100).toFixed(0):0;ye.focus(`\u{1F3AF} [Focus] rect=${o.x},${o.y} ${o.w}x${o.h} | tiles ${f}/${d} (${g}%)`)}else ye.focus("\u{1F3AF} [Focus] cleared \u2192 full screen")}))}}});function xS(r){Oh.add(r)}function Ps(r){Oh.delete(r)}function ut(r,e,t){for(let n of Oh)if(n.hasReadyAdapter?.())try{n.emit(e,t)}catch{}}var Oh,_i=ke(()=>{Oh=new Set});async function jS(){if(Bs)return Bs;let r=await import("node-screenshots");if(Bs=(r.Monitor||r.default?.Monitor).all()[0],!Bs)throw new Error("No monitor found via node-screenshots");return Bs}async function FS(r){Bh=r,H.pipeline.captureLib==="nodeScreenshots"&&await jS()}async function US(){let{captureLib:r,inputFormat:e}=H.pipeline;if(r==="robotjs"){let{width:n,height:i}=Bh.getScreenSize(),s=Bh.screen.capture(0,0,n,i),o=s.byteWidth/s.bytesPerPixel;return{buffer:Buffer.from(s.image),width:o,height:s.height,channels:s.bytesPerPixel,format:e}}let t;try{t=await jS();let n=await t.captureImage();return{buffer:await n.toRaw(),width:n.width,height:n.height,channels:4,format:e}}catch(n){throw Bs=null,n}}var Bh,Bs,qS=ke(()=>{dt();Bh=null,Bs=null});function Sj(r){return r==="bgra"?Fh.FORMAT_BGRA:Fh.FORMAT_RGBA}function Uh(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 $S(r,e,t,n=4,i,s){let{encoder:o,inputFormat:a,jpegQuality:c,tileFormat:l,webpEffort:u}=H.pipeline,f=i??c,d=s??a;if(o==="jpegTurbo"&&l!=="webp")return Fh.compressSync(r,{width:e,height:t,format:Sj(d),quality:f});let g=r;d==="bgra"&&(g=Buffer.from(r),Uh(g));let y=(0,zl.default)(g,{raw:{width:e,height:t,channels:n}});return l==="webp"?y.webp({quality:f,effort:u}).toBuffer():y.jpeg({quality:f}).toBuffer()}var zl,jh,Fh,HS=ke(()=>{zl=W(require("sharp"),1),jh=W(require("@julusian/jpeg-turbo"),1);dt();Fh=jh.default.default||jh.default;zl.default.cache(!1);zl.default.concurrency(1)});var Vl,WS=ke(()=>{dt();bn();Vl=class{constructor(){this.cfg=H.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=P=>(this.samples.reduce((B,G)=>B+G[P],0)/e).toFixed(1),n=(Date.now()-this.lastLogTime)/1e3,i=(e/n).toFixed(1),s=[],o=0;for(let P of this.samples){for(let B of P.tileBytes)s.push(B);o+=P.tileBytes.reduce((B,G)=>B+G,0)}let a=(o/e/1024).toFixed(1),c=s.length?(s.reduce((P,B)=>P+B,0)/s.length/1024).toFixed(2):"0",l=s.length?(Math.min(...s)/1024).toFixed(2):"0",u=s.length?(Math.max(...s)/1024).toFixed(2):"0",f=this.samples.reduce((P,B)=>P+B.rawBytes,0)/e,d=o/e,g=d>0?(f/d).toFixed(0):"0",y=(this.samples.reduce((P,B)=>P+B.changedTiles,0)/e).toFixed(0),b=this.samples[0]?.totalTiles||0,C=b?(y/b*100).toFixed(1):"0",R=H.pipeline,O=`[Metrics] ${R.captureLib}+${R.encoder} tile=${R.tileSize} q${R.jpegQuality} scale=${R.outputScale} | fps=${i} | capture=${t("capture")}ms enc=${t("encode")}ms total=${t("total")}ms | tiles=${y}/${b} (${C}%) | data=${a}KB/frame | tileAvg=${c}KB (min ${l}, max ${u}) | compress=${g}x`;_e(O),console.log(O),this.samples=[],this.lastLogTime=Date.now()}}});var VS={};rn(VS,{TileManager:()=>qh,mapLimit:()=>wi});async function wi(r,e,t){let n=new Array(r.length),i=0,s=Math.min(e,r.length),o=Array.from({length:s},async(a,c)=>{for(;i<r.length;){let l=i++;n[l]=await t(r[l],l,c)}});return await Promise.all(o),n}var js,Yl,GS,Kl,zS,Ej,Tj,qh,KS=ke(()=>{js=W(require("fs"),1),Yl=W(require("path"),1),GS=W(require("sharp"),1),Kl=require("child_process"),zS=require("url");dt();qS();HS();WS();ph();Ej=(0,zS.fileURLToPath)(__importMetaUrl),Tj=Yl.default.dirname(Ej);qh=class{constructor(e){this.robot=e,this.metrics=new Vl,this.tileSize=H.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(Tj,"../../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=H.pipeline.outputScale||1,this.compressionQuality=H.pipeline.jpegQuality,this.activeTileSet=null,this.focusStats={frames:0,scanned:0,changed:0,bytes:0},this._scratchExtract=[],this._scratchSwap=[],this._prefetchCapture=null,js.default.existsSync(this.tempDir)||js.default.mkdirSync(this.tempDir,{recursive:!0}),FS(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){ye.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(){ye.dpi(`\u{1F50D} [DPI Detection] screenWidth from robot: ${this.screenWidth}x${this.screenHeight}`);try{let e=(0,Kl.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(ye.dpi(`\u{1F50D} [DPI Detection] Strategy 1 (Registry AppliedDPI): ${t} DPI`),t>=96){let n=t/96;return ye.dpi(`\u2705 [DPI Detection] Using registry scale: ${n}x (${t}/96)`),n}}catch(e){ye.dpi(`\u274C [DPI Detection] Strategy 1 failed: ${e.message}`)}try{let e=(0,Kl.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(ye.dpi(`\u{1F50D} [DPI Detection] Strategy 2 (WMI): physical width = ${t}px`),t>0&&t>this.screenWidth){let n=t/this.screenWidth;return ye.dpi(`\u2705 [DPI Detection] Using WMI scale: ${n}x (${t}/${this.screenWidth})`),n}}catch(e){ye.dpi(`\u274C [DPI Detection] Strategy 2 failed: ${e.message}`)}try{let e=(0,Kl.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(ye.dpi(`\u{1F50D} [DPI Detection] Strategy 3 (EnumDisplaySettings): physical width = ${t}px`),t>0&&t>this.screenWidth){let n=t/this.screenWidth;return ye.dpi(`\u2705 [DPI Detection] Using EnumDisplaySettings scale: ${n}x (${t}/${this.screenWidth})`),n}}catch(e){ye.dpi(`\u274C [DPI Detection] Strategy 3 failed: ${e.message}`)}return ye.dpi("\u26A0\uFE0F [DPI Detection] All strategies failed, fallback to 1x"),1}async captureFullScreen(){let e=await US();return{buffer:e.buffer,width:e.width,height:e.height,channels:e.channels}}async getSharedScreenCapture(){let e=Date.now();return this.sharedScreenCache&&e-this.lastCaptureTime<this.CACHE_TTL?this.sharedScreenCache:(this.sharedScreenCache=await this.captureFullScreen(),this.lastCaptureTime=e,this.sharedScreenCache)}async getCaptureForStreaming(){if(!this._prefetchCapture){let t=await this.captureFullScreen();return this._prefetchCapture=this.captureFullScreen(),t}let e;try{e=await this._prefetchCapture}catch(t){throw this._prefetchCapture=null,t}return this._prefetchCapture=this.captureFullScreen(),e}clearScreenCache(){}async detectChangedTiles(){return(await this.detectChangedTilesWithHashes()).tiles}async detectChangedTilesWithHashes(){if(this.isProcessing)return{tiles:[],currentHashes:Array.from(this.lastTileChecksums.values())};this.isProcessing=!0;let e=this.metrics.now(),t=e,n=e;try{let i=await this.getCaptureForStreaming();t=this.metrics.now();let s=[],o=[],a=new Map;this.frameCount++;let c=this.activeTileSet;for(let f=0;f<this.totalTiles;f++){if(c&&!c.has(f))continue;let d=this.calculateTileChecksumDirect(i,f);a.set(f,d)}n=this.metrics.now();let l=Array.from(a.values());if(this.lastTileChecksums.size===0){let f=[];for(let g=0;g<this.totalTiles;g++)c&&!c.has(g)||f.push(g);let d=await wi(f,H.pipeline.tileConcurrency,(g,y,b)=>this.processTileAsync(i,g,null,a.get(g),b));return s.push(...d),this._recordFrame(e,t,n,s,i),{tiles:s,currentHashes:l}}for(let f=0;f<this.totalTiles;f++){if(c&&!c.has(f))continue;let d=a.get(f),g=this.lastTileChecksums.get(f);d!==g&&o.push(f)}if(o.length/this.totalTiles>this.changeThreshold){let f=[];for(let g=0;g<this.totalTiles;g++)c&&!c.has(g)||f.push(g);let d=await wi(f,H.pipeline.tileConcurrency,(g,y,b)=>this.processTileAsync(i,g,null,a.get(g),b));s.push(...d.map(g=>({...g,fullRefresh:!0})))}else if(o.length>0){let f=await wi(o,H.pipeline.tileConcurrency,(d,g,y)=>this.processTileAsync(i,d,null,a.get(d),y));s.push(...f)}return this._recordFrame(e,t,n,s,i),{tiles:s,currentHashes:l}}finally{this.isProcessing=!1}}async processTileAsync(e,t,n=null,i=null,s=null){let o=n||this.extractTile(e,t,s),a=await this.compressTileImage(o.buffer,o.width,o.height,s),{row:c,col:l}=this.getTilePosition(t);return{type:"tile-update",tileIndex:t,x:l*this.tileSize,y:c*this.tileSize,width:o.width,height:o.height,imageBuffer:a,hash:i??this.lastTileChecksums.get(t)??0,timestamp:Date.now(),frameCount:this.frameCount}}commitHashes(e){for(let t of e)this.lastTileChecksums.set(t.tileIndex,t.hash)}calculateTileChecksumDirect(e,t){let{row:n,col:i}=this.getTilePosition(t),s=i*this.tileSize,o=n*this.tileSize,a=Math.min(s+this.tileSize,e.width),c=Math.min(o+this.tileSize,e.height),l=a-s,u=c-o,f=e.channels,d=e.width*f,g=0,{rowStep:y,colStep:b}=H.pipeline.checksumSampling;for(let C=0;C<u;C+=y){let R=(C/y|0)%b,O=(o+C)*d+(s+R)*f;for(let P=R;P<l;P+=b){let B=O+(P-R)*f,G=P+1;g=g+e.buffer[B]*G>>>0,g^=e.buffer[B+1]<<1,g=g+e.buffer[B+2]*G>>>0,g^=e.buffer[B+3]<<2}}return g>>>0}setFocusRect(e){if(!e){this.activeTileSet=null;return}let t=H.focus.paddingTiles,n=Math.max(0,Math.floor(e.x/this.tileSize)-t),i=Math.max(0,Math.floor(e.y/this.tileSize)-t),s=Math.min(this.tilesPerRow-1,Math.floor((e.x+e.w)/this.tileSize)+t),o=Math.min(this.tilesPerColumn-1,Math.floor((e.y+e.h)/this.tileSize)+t),a=new Set;for(let l=i;l<=o;l++)for(let u=n;u<=s;u++)a.add(l*this.tilesPerRow+u);let c=this.activeTileSet;if(c)for(let l of a)c.has(l)||this.lastTileChecksums.delete(l);this.activeTileSet=a}getTilePosition(e){return{row:Math.floor(e/this.tilesPerRow),col:e%this.tilesPerRow}}_getScratch(e,t,n){let i=e[t];return(!i||i.length<n)&&(i=Buffer.allocUnsafe(n),e[t]=i),i.subarray(0,n)}extractTile(e,t,n=null){let{row:i,col:s}=this.getTilePosition(t),o=s*this.tileSize,a=i*this.tileSize,c=Math.min(o+this.tileSize,e.width),l=Math.min(a+this.tileSize,e.height),u=c-o,f=l-a,d=e.channels,g=u*d,y=u*f*d,b=n===null?Buffer.allocUnsafe(y):this._getScratch(this._scratchExtract,n,y);for(let C=0;C<f;C++){let R=((a+C)*e.width+o)*d,O=C*g;e.buffer.copy(b,O,R,R+g)}return{buffer:b,width:u,height:f,channels:d,tileIndex:t,x:o,y:a}}async compressTileImage(e,t,n,i=null){let s=this.scaleFactor;if(s&&s>0&&s<1){let o=Math.max(1,Math.floor(t*s)),a=Math.max(1,Math.floor(n*s)),{inputFormat:c}=H.pipeline,l=e,u=4;c==="bgra"&&(i===null?l=Buffer.from(e):(l=this._getScratch(this._scratchSwap,i,e.length),e.copy(l)),Uh(l));let{tileFormat:f,webpEffort:d}=H.pipeline,g=(0,GS.default)(l,{raw:{width:t,height:n,channels:u}}).resize(o,a,{kernel:"lanczos3",fastShrinkOnLoad:!1});return f==="webp"?g.webp({quality:this.compressionQuality,effort:d}).toBuffer():g.jpeg({quality:this.compressionQuality}).toBuffer()}return $S(e,t,n,4,this.compressionQuality)}pickProfile({zoom:e=1,viewerWidth:t=0,dpr:n=1}={}){let i=this.captureWidth||this.screenWidth||1,s=t>0?t:i,o=e>0?e:1,a=n>0?n:1,c=s*o*a/i,l=H.pipeline;if(l.scaleMode!=="smooth"){let y=l.adaptiveTiers||[];if(!y.length)return null;let b=l.tierHysteresis||0,C=this._currentTier;for(let O of y){let P=C&&O===C?O.minEffective-b:O.minEffective;if(c>=P)return this._currentTier=O,O}let R=y[y.length-1];return this._currentTier=R,R}let u=l.minOutputScale??.25,f=l.maxOutputScale??1,g={outputScale:Math.max(u,Math.min(f,c)),jpegQuality:l.qualityFloor??80};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(l=>l.imageBuffer?.length||0),c=s?s.width*s.height*s.channels:0;this.metrics.record({capture:t-e,checksum:n-t,encode:o-n,total:o-e,changedTiles:i.length,totalTiles:this.totalTiles,tileBytes:a,rawBytes:c})}_recordFocusFrame(e){let t=this.focusStats;t.frames++,t.scanned+=this.activeTileSet?this.activeTileSet.size:this.totalTiles,t.changed+=e.length;for(let c of e)t.bytes+=c.imageBuffer?.length||0;if(t.frames<H.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";ye.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){ye.error("Error getting dimensions:",e)}return{width:this.scaledWidth,height:this.scaledHeight,tileWidth:this.tileSize,tileHeight:this.tileSize,tileCount:this.totalTiles,scaleFactor:this.scaleFactor,originalWidth:this.screenWidth,originalHeight:this.screenHeight}}async compareClientTileHashes(e){if(this.isProcessing)return{tiles:[],currentHashes:[],changedIndices:[]};this.isProcessing=!0;try{let t=await this.getSharedScreenCapture(),n=[],i=[];this.frameCount++;let s=this.activeTileSet,o=new Map;for(let c=0;c<this.totalTiles;c++){if(s&&!s.has(c))continue;let l=this.calculateTileChecksumDirect(t,c);o.set(c,l),this.lastTileChecksums.set(c,l)}if(!e||e.length===0){let c=[];for(let u=0;u<this.totalTiles;u++)s&&!s.has(u)||c.push(u);let l=await wi(c,H.pipeline.tileConcurrency,u=>this.processTileAsync(t,u));return n.push(...l),{tiles:n,currentHashes:Array.from(o.values())}}for(let c=0;c<this.totalTiles;c++)s&&!s.has(c)||e[c]!==o.get(c)&&i.push(c);if(i.length/this.totalTiles>this.changeThreshold){let c=[];for(let u=0;u<this.totalTiles;u++)s&&!s.has(u)||c.push(u);let l=await wi(c,H.pipeline.tileConcurrency,u=>this.processTileAsync(t,u));n.push(...l.map(u=>({...u,fullRefresh:!0})))}else if(i.length>0){let c=await wi(i,H.pipeline.tileConcurrency,l=>this.processTileAsync(t,l));n.push(...c)}return this._recordFocusFrame(n),{tiles:n,currentHashes:Array.from(o.values()),changedIndices:i}}finally{this.isProcessing=!1}}clearMemory(){this.sharedScreenCache=null,this.lastCaptureTime=0,this.lastTileChecksums.clear(),this._scratchExtract=[],this._scratchSwap=[],this._traceFrames=50,this._prefetchCapture=null}reset(){this.lastTileChecksums.clear(),this.frameCount=0}cleanup(){try{js.default.existsSync(this.tempDir)&&js.default.readdirSync(this.tempDir).forEach(t=>js.default.unlinkSync(Yl.default.join(this.tempDir,t)))}catch(e){ye.warn(`Cleanup error: ${e.message}`)}}}});var YS={};rn(YS,{ResourceManager:()=>$h});var $h,XS=ke(()=>{dt();_i();$h=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>H.resourceManagement.memoryWarningThreshold&&(console.warn(`\u26A0\uFE0F High memory: ${t}MB`),this.cleanupInactiveClients())},H.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=H.resourceManagement.inactiveTimeout;for(let[n,i]of this.activeClients.entries())e-i.lastActivity>t&&(console.log(`\u{1F9F9} Cleaning inactive client: ${n}`),this.cleanupClientResources(n,i),this.activeClients.delete(n))}cleanupClientResources(e,t){try{t.isStreaming=!1,t?.streamingTimeout&&(clearTimeout(t.streamingTimeout),t.streamingTimeout=null),t?.screenInterval&&(clearInterval(t.screenInterval),t.screenInterval=null);let n=this.activeTimers.get(e);n&&(n.forEach(s=>clearTimeout(s)),this.activeTimers.delete(e));let i=this.chunkTimers.get(e);i&&(i.forEach(s=>clearTimeout(s)),this.chunkTimers.delete(e)),t?.tileManager&&(t.tileManager.clearMemory(),t.tileManager.cleanup(),t.tileManager.reset()),t?.protocol&&(t.protocol.close(),Ps(t.protocol))}catch(n){console.error(`Error cleaning up ${e}:`,n.message)}}getStreamingConfig(){return H.streaming}getWebRTCConfig(){return H.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 JS={};rn(JS,{ScreenUpdateHelper:()=>Hh});var Hh,ZS=ke(()=>{dt();Hh=class{constructor(e){this.resourceManager=e}async sendTilesInChunks(e,t,n,i=!1){if(!t||t.length===0)return;let s=H.streaming.chunkSize,o=[];for(let c=0;c<t.length;c+=s)o.push(t.slice(c,c+s));let a=this.resourceManager.getChunkTimers(e.id);for(let c=0;c<o.length;c++){let l=o[c],u=c===o.length-1,f=setTimeout(()=>{a.delete(f),e.connected&&e.emit("tiles-data",{tiles:l,timestamp:n,forceRefresh:!1,userAction:i,chunkInfo:{chunkIndex:c,totalChunks:o.length,isLastChunk:u}})},c*H.streaming.chunkDelay);a.add(f)}}}});var QS={};rn(QS,{MouseHandler:()=>Wh});var Wh,eE=ke(()=>{dt();Wh=class{constructor(e,t){this.robot=e,this.resourceManager=t,this.lastMouseMove=0,this.buttonDown=null}setupMouseHandlers(e,t){let n=this.robot;e.on("mouse-move",t(i=>{let s=Date.now();if(!(s-this.lastMouseMove<H.throttling.mouseThrottle)){this.lastMouseMove=s;try{let o=n.getScreenSize(),a=Math.round(i.x/100*o.width),c=Math.round(i.y/100*o.height),l=Math.max(0,Math.min(o.width-1,a)),u=Math.max(0,Math.min(o.height-1,c));this.buttonDown?n.dragMouse(l,u,this.buttonDown):n.moveMouse(l,u),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Mouse move error:",o.message)}}})),e.on("mouse-click",t(async i=>{try{let s=this.resourceManager.getClient(e.id);if(!s)return;let o=n.getScreenSize(),a=Math.round(i.x/100*o.width),c=Math.round(i.y/100*o.height),l=Math.max(0,Math.min(o.width-1,a)),u=Math.max(0,Math.min(o.height-1,c));n.moveMouse(l,u),n.mouseClick(i.button||"left",i.double||!1),s.idleFrameCount=0,this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Mouse click error:",s.message)}})),e.on("mouse-press",t(async i=>{try{if(!this.resourceManager.getClient(e.id))return;let o=n.getScreenSize(),a=Math.round(i.x/100*o.width),c=Math.round(i.y/100*o.height),l=Math.max(0,Math.min(o.width-1,a)),u=Math.max(0,Math.min(o.height-1,c));n.moveMouse(l,u);let f=i.button||"left";n.mouseToggle("down",f),this.buttonDown=f,this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Mouse press error:",s.message)}})),e.on("mouse-release",t(async i=>{try{if(!this.resourceManager.getClient(e.id))return;let o=n.getScreenSize(),a=Math.round(i.x/100*o.width),c=Math.round(i.y/100*o.height),l=Math.max(0,Math.min(o.width-1,a)),u=Math.max(0,Math.min(o.height-1,c));n.moveMouse(l,u);let f=this.buttonDown||i.button||"left";n.mouseToggle("up",f),this.buttonDown=null,this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Mouse release error:",s.message)}})),e.on("scroll",t(async i=>{try{let{direction:s,amount:o=60,horizontal:a=!1}=i,c=this.resourceManager.getClient(e.id);if(!c)return;let l=0,u=0;a||s==="left"||s==="right"?l=s==="right"?o:-o:u=s==="down"?-o:o,n.scrollMouse(l,u),c.idleFrameCount=0,this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Scroll error:",s.message)}})),e.on("mouse-drag-select",t(i=>{try{let{startX:s,startY:o,endX:a,endY:c}=i,l=n.getScreenSize(),u=Math.round(s/100*l.width),f=Math.round(o/100*l.height),d=Math.round(a/100*l.width),g=Math.round(c/100*l.height),y=Math.max(0,Math.min(l.width-1,u)),b=Math.max(0,Math.min(l.height-1,f)),C=Math.max(0,Math.min(l.width-1,d)),R=Math.max(0,Math.min(l.height-1,g));n.moveMouse(y,b),n.mouseToggle("down","left"),n.dragMouse(C,R),n.mouseToggle("up","left"),this.resourceManager.updateClientActivity(e.id)}catch(s){console.error("Drag selection error:",s.message)}}))}}});var rE={};rn(rE,{KeyboardHandler:()=>Gh});function Cj(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,tE.execFile)("osascript",["-e",e],t=>{t&&console.error("osascript error:",t.message)})}var tE,Gh,nE=ke(()=>{tE=require("child_process");dt();Gh=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<H.throttling.keyThrottle)){this.lastKeyPress=s;try{if(!i.key||typeof i.key!="string")return;let o=this.resourceManager.getClient(e.id),a=i.key,c=i.modifier||[];if(a.length===1)if(c.filter(u=>u!=="shift").length>0){n.keyTap(a.toLowerCase(),c);for(let u of c)n.keyToggle(u,"up")}else n.typeString(a);else{let u={return:"enter"}[a.toLowerCase()]??a.toLowerCase();n.keyTap(u,c)}o&&(o.idleFrameCount=0),this.resourceManager.updateClientActivity(e.id)}catch(o){console.error("Key press error:",o.message)}}})),e.on("desktop-switch",t(i=>{try{let s=i?.direction,o=H.desktopSwitch[process.platform]?.[s];if(!o)return;process.platform==="darwin"?Cj(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<H.throttling.typeTextThrottle)){this.lastTypeText=s;try{if(!i.text||typeof i.text!="string")return;let o=i.text;o.length>H.throttling.maxTextLength&&(o=o.substring(0,H.throttling.maxTextLength));let a=o.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g,""),c=this.resourceManager.getClient(e.id);setTimeout(()=>{try{n.typeString(a),this.resourceManager.updateClientActivity(e.id),c&&(c.idleFrameCount=0,c.tileManager&&c.tileManager.clearScreenCache())}catch(l){console.error("Robot typeString error:",l.message)}},10)}catch(o){console.error("Type text error:",o.message)}}}))}}});var lm=A((UE,cm)=>{(function(r,e){"use strict";function t(T,p){if(!T)throw new Error(p||"Assertion failed")}function n(T,p){T.super_=p;var m=function(){};m.prototype=p.prototype,T.prototype=new m,T.prototype.constructor=T}function i(T,p,m){if(i.isBN(T))return T;this.negative=0,this.words=null,this.length=0,this.red=null,T!==null&&((p==="le"||p==="be")&&(m=p,p=10),this._init(T||0,p||10,m||"be"))}typeof r=="object"?r.exports=i:e.BN=i,i.BN=i,i.wordSize=26;var s;try{typeof window<"u"&&typeof window.Buffer<"u"?s=window.Buffer:s=require("buffer").Buffer}catch{}i.isBN=function(p){return p instanceof i?!0:p!==null&&typeof p=="object"&&p.constructor.wordSize===i.wordSize&&Array.isArray(p.words)},i.max=function(p,m){return p.cmp(m)>0?p:m},i.min=function(p,m){return p.cmp(m)<0?p:m},i.prototype._init=function(p,m,x){if(typeof p=="number")return this._initNumber(p,m,x);if(typeof p=="object")return this._initArray(p,m,x);m==="hex"&&(m=16),t(m===(m|0)&&m>=2&&m<=36),p=p.toString().replace(/\s+/g,"");var S=0;p[0]==="-"&&(S++,this.negative=1),S<p.length&&(m===16?this._parseHex(p,S,x):(this._parseBase(p,m,S),x==="le"&&this._initArray(this.toArray(),m,x)))},i.prototype._initNumber=function(p,m,x){p<0&&(this.negative=1,p=-p),p<67108864?(this.words=[p&67108863],this.length=1):p<4503599627370496?(this.words=[p&67108863,p/67108864&67108863],this.length=2):(t(p<9007199254740992),this.words=[p&67108863,p/67108864&67108863,1],this.length=3),x==="le"&&this._initArray(this.toArray(),m,x)},i.prototype._initArray=function(p,m,x){if(t(typeof p.length=="number"),p.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(p.length/3),this.words=new Array(this.length);for(var S=0;S<this.length;S++)this.words[S]=0;var v,_,k=0;if(x==="be")for(S=p.length-1,v=0;S>=0;S-=3)_=p[S]|p[S-1]<<8|p[S-2]<<16,this.words[v]|=_<<k&67108863,this.words[v+1]=_>>>26-k&67108863,k+=24,k>=26&&(k-=26,v++);else if(x==="le")for(S=0,v=0;S<p.length;S+=3)_=p[S]|p[S+1]<<8|p[S+2]<<16,this.words[v]|=_<<k&67108863,this.words[v+1]=_>>>26-k&67108863,k+=24,k>=26&&(k-=26,v++);return this.strip()};function o(T,p){var m=T.charCodeAt(p);return m>=65&&m<=70?m-55:m>=97&&m<=102?m-87:m-48&15}function a(T,p,m){var x=o(T,m);return m-1>=p&&(x|=o(T,m-1)<<4),x}i.prototype._parseHex=function(p,m,x){this.length=Math.ceil((p.length-m)/6),this.words=new Array(this.length);for(var S=0;S<this.length;S++)this.words[S]=0;var v=0,_=0,k;if(x==="be")for(S=p.length-1;S>=m;S-=2)k=a(p,m,S)<<v,this.words[_]|=k&67108863,v>=18?(v-=18,_+=1,this.words[_]|=k>>>26):v+=8;else{var w=p.length-m;for(S=w%2===0?m+1:m;S<p.length;S+=2)k=a(p,m,S)<<v,this.words[_]|=k&67108863,v>=18?(v-=18,_+=1,this.words[_]|=k>>>26):v+=8}this.strip()};function c(T,p,m,x){for(var S=0,v=Math.min(T.length,m),_=p;_<v;_++){var k=T.charCodeAt(_)-48;S*=x,k>=49?S+=k-49+10:k>=17?S+=k-17+10:S+=k}return S}i.prototype._parseBase=function(p,m,x){this.words=[0],this.length=1;for(var S=0,v=1;v<=67108863;v*=m)S++;S--,v=v/m|0;for(var _=p.length-x,k=_%S,w=Math.min(_,_-k)+x,h=0,E=x;E<w;E+=S)h=c(p,E,E+S,m),this.imuln(v),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(k!==0){var q=1;for(h=c(p,E,p.length,m),E=0;E<k;E++)q*=m;this.imuln(q),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}this.strip()},i.prototype.copy=function(p){p.words=new Array(this.length);for(var m=0;m<this.length;m++)p.words[m]=this.words[m];p.length=this.length,p.negative=this.negative,p.red=this.red},i.prototype.clone=function(){var p=new i(null);return this.copy(p),p},i.prototype._expand=function(p){for(;this.length<p;)this.words[this.length++]=0;return this},i.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},i.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},i.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(p,m){p=p||10,m=m|0||1;var x;if(p===16||p==="hex"){x="";for(var S=0,v=0,_=0;_<this.length;_++){var k=this.words[_],w=((k<<S|v)&16777215).toString(16);v=k>>>24-S&16777215,S+=2,S>=26&&(S-=26,_--),v!==0||_!==this.length-1?x=l[6-w.length]+w+x:x=w+x}for(v!==0&&(x=v.toString(16)+x);x.length%m!==0;)x="0"+x;return this.negative!==0&&(x="-"+x),x}if(p===(p|0)&&p>=2&&p<=36){var h=u[p],E=f[p];x="";var q=this.clone();for(q.negative=0;!q.isZero();){var M=q.modn(E).toString(p);q=q.idivn(E),q.isZero()?x=M+x:x=l[h-M.length]+M+x}for(this.isZero()&&(x="0"+x);x.length%m!==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 p=this.words[0];return this.length===2?p+=this.words[1]*67108864:this.length===3&&this.words[2]===1?p+=4503599627370496+this.words[1]*67108864:this.length>2&&t(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-p:p},i.prototype.toJSON=function(){return this.toString(16)},i.prototype.toBuffer=function(p,m){return t(typeof s<"u"),this.toArrayLike(s,p,m)},i.prototype.toArray=function(p,m){return this.toArrayLike(Array,p,m)},i.prototype.toArrayLike=function(p,m,x){var S=this.byteLength(),v=x||Math.max(1,S);t(S<=v,"byte array longer than desired length"),t(v>0,"Requested array length <= 0"),this.strip();var _=m==="le",k=new p(v),w,h,E=this.clone();if(_){for(h=0;!E.isZero();h++)w=E.andln(255),E.iushrn(8),k[h]=w;for(;h<v;h++)k[h]=0}else{for(h=0;h<v-S;h++)k[h]=0;for(h=0;!E.isZero();h++)w=E.andln(255),E.iushrn(8),k[v-h-1]=w}return k},Math.clz32?i.prototype._countBits=function(p){return 32-Math.clz32(p)}:i.prototype._countBits=function(p){var m=p,x=0;return m>=4096&&(x+=13,m>>>=13),m>=64&&(x+=7,m>>>=7),m>=8&&(x+=4,m>>>=4),m>=2&&(x+=2,m>>>=2),x+m},i.prototype._zeroBits=function(p){if(p===0)return 26;var m=p,x=0;return(m&8191)===0&&(x+=13,m>>>=13),(m&127)===0&&(x+=7,m>>>=7),(m&15)===0&&(x+=4,m>>>=4),(m&3)===0&&(x+=2,m>>>=2),(m&1)===0&&x++,x},i.prototype.bitLength=function(){var p=this.words[this.length-1],m=this._countBits(p);return(this.length-1)*26+m};function d(T){for(var p=new Array(T.bitLength()),m=0;m<p.length;m++){var x=m/26|0,S=m%26;p[m]=(T.words[x]&1<<S)>>>S}return p}i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var p=0,m=0;m<this.length;m++){var x=this._zeroBits(this.words[m]);if(p+=x,x!==26)break}return p},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(p){return this.negative!==0?this.abs().inotn(p).iaddn(1):this.clone()},i.prototype.fromTwos=function(p){return this.testn(p-1)?this.notn(p).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return this.negative!==0},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(p){for(;this.length<p.length;)this.words[this.length++]=0;for(var m=0;m<p.length;m++)this.words[m]=this.words[m]|p.words[m];return this.strip()},i.prototype.ior=function(p){return t((this.negative|p.negative)===0),this.iuor(p)},i.prototype.or=function(p){return this.length>p.length?this.clone().ior(p):p.clone().ior(this)},i.prototype.uor=function(p){return this.length>p.length?this.clone().iuor(p):p.clone().iuor(this)},i.prototype.iuand=function(p){var m;this.length>p.length?m=p:m=this;for(var x=0;x<m.length;x++)this.words[x]=this.words[x]&p.words[x];return this.length=m.length,this.strip()},i.prototype.iand=function(p){return t((this.negative|p.negative)===0),this.iuand(p)},i.prototype.and=function(p){return this.length>p.length?this.clone().iand(p):p.clone().iand(this)},i.prototype.uand=function(p){return this.length>p.length?this.clone().iuand(p):p.clone().iuand(this)},i.prototype.iuxor=function(p){var m,x;this.length>p.length?(m=this,x=p):(m=p,x=this);for(var S=0;S<x.length;S++)this.words[S]=m.words[S]^x.words[S];if(this!==m)for(;S<m.length;S++)this.words[S]=m.words[S];return this.length=m.length,this.strip()},i.prototype.ixor=function(p){return t((this.negative|p.negative)===0),this.iuxor(p)},i.prototype.xor=function(p){return this.length>p.length?this.clone().ixor(p):p.clone().ixor(this)},i.prototype.uxor=function(p){return this.length>p.length?this.clone().iuxor(p):p.clone().iuxor(this)},i.prototype.inotn=function(p){t(typeof p=="number"&&p>=0);var m=Math.ceil(p/26)|0,x=p%26;this._expand(m),x>0&&m--;for(var S=0;S<m;S++)this.words[S]=~this.words[S]&67108863;return x>0&&(this.words[S]=~this.words[S]&67108863>>26-x),this.strip()},i.prototype.notn=function(p){return this.clone().inotn(p)},i.prototype.setn=function(p,m){t(typeof p=="number"&&p>=0);var x=p/26|0,S=p%26;return this._expand(x+1),m?this.words[x]=this.words[x]|1<<S:this.words[x]=this.words[x]&~(1<<S),this.strip()},i.prototype.iadd=function(p){var m;if(this.negative!==0&&p.negative===0)return this.negative=0,m=this.isub(p),this.negative^=1,this._normSign();if(this.negative===0&&p.negative!==0)return p.negative=0,m=this.isub(p),p.negative=1,m._normSign();var x,S;this.length>p.length?(x=this,S=p):(x=p,S=this);for(var v=0,_=0;_<S.length;_++)m=(x.words[_]|0)+(S.words[_]|0)+v,this.words[_]=m&67108863,v=m>>>26;for(;v!==0&&_<x.length;_++)m=(x.words[_]|0)+v,this.words[_]=m&67108863,v=m>>>26;if(this.length=x.length,v!==0)this.words[this.length]=v,this.length++;else if(x!==this)for(;_<x.length;_++)this.words[_]=x.words[_];return this},i.prototype.add=function(p){var m;return p.negative!==0&&this.negative===0?(p.negative=0,m=this.sub(p),p.negative^=1,m):p.negative===0&&this.negative!==0?(this.negative=0,m=p.sub(this),this.negative=1,m):this.length>p.length?this.clone().iadd(p):p.clone().iadd(this)},i.prototype.isub=function(p){if(p.negative!==0){p.negative=0;var m=this.iadd(p);return p.negative=1,m._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(p),this.negative=1,this._normSign();var x=this.cmp(p);if(x===0)return this.negative=0,this.length=1,this.words[0]=0,this;var S,v;x>0?(S=this,v=p):(S=p,v=this);for(var _=0,k=0;k<v.length;k++)m=(S.words[k]|0)-(v.words[k]|0)+_,_=m>>26,this.words[k]=m&67108863;for(;_!==0&&k<S.length;k++)m=(S.words[k]|0)+_,_=m>>26,this.words[k]=m&67108863;if(_===0&&k<S.length&&S!==this)for(;k<S.length;k++)this.words[k]=S.words[k];return this.length=Math.max(this.length,k),S!==this&&(this.negative=1),this.strip()},i.prototype.sub=function(p){return this.clone().isub(p)};function g(T,p,m){m.negative=p.negative^T.negative;var x=T.length+p.length|0;m.length=x,x=x-1|0;var S=T.words[0]|0,v=p.words[0]|0,_=S*v,k=_&67108863,w=_/67108864|0;m.words[0]=k;for(var h=1;h<x;h++){for(var E=w>>>26,q=w&67108863,M=Math.min(h,p.length-1),I=Math.max(0,h-T.length+1);I<=M;I++){var j=h-I|0;S=T.words[j]|0,v=p.words[I]|0,_=S*v+q,E+=_/67108864|0,q=_&67108863}m.words[h]=q|0,w=E|0}return w!==0?m.words[h]=w|0:m.length--,m.strip()}var y=function(p,m,x){var S=p.words,v=m.words,_=x.words,k=0,w,h,E,q=S[0]|0,M=q&8191,I=q>>>13,j=S[1]|0,K=j&8191,U=j>>>13,Re=S[2]|0,se=Re&8191,N=Re>>>13,ne=S[3]|0,L=ne&8191,z=ne>>>13,oe=S[4]|0,Q=oe&8191,J=oe>>>13,Ot=S[5]|0,ae=Ot&8191,Ie=Ot>>>13,bv=S[6]|0,Ne=bv&8191,De=bv>>>13,wv=S[7]|0,Le=wv&8191,Be=wv>>>13,Sv=S[8]|0,je=Sv&8191,Fe=Sv>>>13,Ev=S[9]|0,Ue=Ev&8191,qe=Ev>>>13,Tv=v[0]|0,$e=Tv&8191,He=Tv>>>13,Cv=v[1]|0,We=Cv&8191,Ge=Cv>>>13,kv=v[2]|0,ze=kv&8191,Ve=kv>>>13,Av=v[3]|0,Ke=Av&8191,Ye=Av>>>13,Rv=v[4]|0,Xe=Rv&8191,Je=Rv>>>13,Ov=v[5]|0,Ze=Ov&8191,Qe=Ov>>>13,Mv=v[6]|0,et=Mv&8191,tt=Mv>>>13,Pv=v[7]|0,rt=Pv&8191,nt=Pv>>>13,Iv=v[8]|0,it=Iv&8191,st=Iv>>>13,Nv=v[9]|0,ot=Nv&8191,at=Nv>>>13;x.negative=p.negative^m.negative,x.length=19,w=Math.imul(M,$e),h=Math.imul(M,He),h=h+Math.imul(I,$e)|0,E=Math.imul(I,He);var mp=(k+w|0)+((h&8191)<<13)|0;k=(E+(h>>>13)|0)+(mp>>>26)|0,mp&=67108863,w=Math.imul(K,$e),h=Math.imul(K,He),h=h+Math.imul(U,$e)|0,E=Math.imul(U,He),w=w+Math.imul(M,We)|0,h=h+Math.imul(M,Ge)|0,h=h+Math.imul(I,We)|0,E=E+Math.imul(I,Ge)|0;var gp=(k+w|0)+((h&8191)<<13)|0;k=(E+(h>>>13)|0)+(gp>>>26)|0,gp&=67108863,w=Math.imul(se,$e),h=Math.imul(se,He),h=h+Math.imul(N,$e)|0,E=Math.imul(N,He),w=w+Math.imul(K,We)|0,h=h+Math.imul(K,Ge)|0,h=h+Math.imul(U,We)|0,E=E+Math.imul(U,Ge)|0,w=w+Math.imul(M,ze)|0,h=h+Math.imul(M,Ve)|0,h=h+Math.imul(I,ze)|0,E=E+Math.imul(I,Ve)|0;var vp=(k+w|0)+((h&8191)<<13)|0;k=(E+(h>>>13)|0)+(vp>>>26)|0,vp&=67108863,w=Math.imul(L,$e),h=Math.imul(L,He),h=h+Math.imul(z,$e)|0,E=Math.imul(z,He),w=w+Math.imul(se,We)|0,h=h+Math.imul(se,Ge)|0,h=h+Math.imul(N,We)|0,E=E+Math.imul(N,Ge)|0,w=w+Math.imul(K,ze)|0,h=h+Math.imul(K,Ve)|0,h=h+Math.imul(U,ze)|0,E=E+Math.imul(U,Ve)|0,w=w+Math.imul(M,Ke)|0,h=h+Math.imul(M,Ye)|0,h=h+Math.imul(I,Ke)|0,E=E+Math.imul(I,Ye)|0;var yp=(k+w|0)+((h&8191)<<13)|0;k=(E+(h>>>13)|0)+(yp>>>26)|0,yp&=67108863,w=Math.imul(Q,$e),h=Math.imul(Q,He),h=h+Math.imul(J,$e)|0,E=Math.imul(J,He),w=w+Math.imul(L,We)|0,h=h+Math.imul(L,Ge)|0,h=h+Math.imul(z,We)|0,E=E+Math.imul(z,Ge)|0,w=w+Math.imul(se,ze)|0,h=h+Math.imul(se,Ve)|0,h=h+Math.imul(N,ze)|0,E=E+Math.imul(N,Ve)|0,w=w+Math.imul(K,Ke)|0,h=h+Math.imul(K,Ye)|0,h=h+Math.imul(U,Ke)|0,E=E+Math.imul(U,Ye)|0,w=w+Math.imul(M,Xe)|0,h=h+Math.imul(M,Je)|0,h=h+Math.imul(I,Xe)|0,E=E+Math.imul(I,Je)|0;var xp=(k+w|0)+((h&8191)<<13)|0;k=(E+(h>>>13)|0)+(xp>>>26)|0,xp&=67108863,w=Math.imul(ae,$e),h=Math.imul(ae,He),h=h+Math.imul(Ie,$e)|0,E=Math.imul(Ie,He),w=w+Math.imul(Q,We)|0,h=h+Math.imul(Q,Ge)|0,h=h+Math.imul(J,We)|0,E=E+Math.imul(J,Ge)|0,w=w+Math.imul(L,ze)|0,h=h+Math.imul(L,Ve)|0,h=h+Math.imul(z,ze)|0,E=E+Math.imul(z,Ve)|0,w=w+Math.imul(se,Ke)|0,h=h+Math.imul(se,Ye)|0,h=h+Math.imul(N,Ke)|0,E=E+Math.imul(N,Ye)|0,w=w+Math.imul(K,Xe)|0,h=h+Math.imul(K,Je)|0,h=h+Math.imul(U,Xe)|0,E=E+Math.imul(U,Je)|0,w=w+Math.imul(M,Ze)|0,h=h+Math.imul(M,Qe)|0,h=h+Math.imul(I,Ze)|0,E=E+Math.imul(I,Qe)|0;var _p=(k+w|0)+((h&8191)<<13)|0;k=(E+(h>>>13)|0)+(_p>>>26)|0,_p&=67108863,w=Math.imul(Ne,$e),h=Math.imul(Ne,He),h=h+Math.imul(De,$e)|0,E=Math.imul(De,He),w=w+Math.imul(ae,We)|0,h=h+Math.imul(ae,Ge)|0,h=h+Math.imul(Ie,We)|0,E=E+Math.imul(Ie,Ge)|0,w=w+Math.imul(Q,ze)|0,h=h+Math.imul(Q,Ve)|0,h=h+Math.imul(J,ze)|0,E=E+Math.imul(J,Ve)|0,w=w+Math.imul(L,Ke)|0,h=h+Math.imul(L,Ye)|0,h=h+Math.imul(z,Ke)|0,E=E+Math.imul(z,Ye)|0,w=w+Math.imul(se,Xe)|0,h=h+Math.imul(se,Je)|0,h=h+Math.imul(N,Xe)|0,E=E+Math.imul(N,Je)|0,w=w+Math.imul(K,Ze)|0,h=h+Math.imul(K,Qe)|0,h=h+Math.imul(U,Ze)|0,E=E+Math.imul(U,Qe)|0,w=w+Math.imul(M,et)|0,h=h+Math.imul(M,tt)|0,h=h+Math.imul(I,et)|0,E=E+Math.imul(I,tt)|0;var bp=(k+w|0)+((h&8191)<<13)|0;k=(E+(h>>>13)|0)+(bp>>>26)|0,bp&=67108863,w=Math.imul(Le,$e),h=Math.imul(Le,He),h=h+Math.imul(Be,$e)|0,E=Math.imul(Be,He),w=w+Math.imul(Ne,We)|0,h=h+Math.imul(Ne,Ge)|0,h=h+Math.imul(De,We)|0,E=E+Math.imul(De,Ge)|0,w=w+Math.imul(ae,ze)|0,h=h+Math.imul(ae,Ve)|0,h=h+Math.imul(Ie,ze)|0,E=E+Math.imul(Ie,Ve)|0,w=w+Math.imul(Q,Ke)|0,h=h+Math.imul(Q,Ye)|0,h=h+Math.imul(J,Ke)|0,E=E+Math.imul(J,Ye)|0,w=w+Math.imul(L,Xe)|0,h=h+Math.imul(L,Je)|0,h=h+Math.imul(z,Xe)|0,E=E+Math.imul(z,Je)|0,w=w+Math.imul(se,Ze)|0,h=h+Math.imul(se,Qe)|0,h=h+Math.imul(N,Ze)|0,E=E+Math.imul(N,Qe)|0,w=w+Math.imul(K,et)|0,h=h+Math.imul(K,tt)|0,h=h+Math.imul(U,et)|0,E=E+Math.imul(U,tt)|0,w=w+Math.imul(M,rt)|0,h=h+Math.imul(M,nt)|0,h=h+Math.imul(I,rt)|0,E=E+Math.imul(I,nt)|0;var wp=(k+w|0)+((h&8191)<<13)|0;k=(E+(h>>>13)|0)+(wp>>>26)|0,wp&=67108863,w=Math.imul(je,$e),h=Math.imul(je,He),h=h+Math.imul(Fe,$e)|0,E=Math.imul(Fe,He),w=w+Math.imul(Le,We)|0,h=h+Math.imul(Le,Ge)|0,h=h+Math.imul(Be,We)|0,E=E+Math.imul(Be,Ge)|0,w=w+Math.imul(Ne,ze)|0,h=h+Math.imul(Ne,Ve)|0,h=h+Math.imul(De,ze)|0,E=E+Math.imul(De,Ve)|0,w=w+Math.imul(ae,Ke)|0,h=h+Math.imul(ae,Ye)|0,h=h+Math.imul(Ie,Ke)|0,E=E+Math.imul(Ie,Ye)|0,w=w+Math.imul(Q,Xe)|0,h=h+Math.imul(Q,Je)|0,h=h+Math.imul(J,Xe)|0,E=E+Math.imul(J,Je)|0,w=w+Math.imul(L,Ze)|0,h=h+Math.imul(L,Qe)|0,h=h+Math.imul(z,Ze)|0,E=E+Math.imul(z,Qe)|0,w=w+Math.imul(se,et)|0,h=h+Math.imul(se,tt)|0,h=h+Math.imul(N,et)|0,E=E+Math.imul(N,tt)|0,w=w+Math.imul(K,rt)|0,h=h+Math.imul(K,nt)|0,h=h+Math.imul(U,rt)|0,E=E+Math.imul(U,nt)|0,w=w+Math.imul(M,it)|0,h=h+Math.imul(M,st)|0,h=h+Math.imul(I,it)|0,E=E+Math.imul(I,st)|0;var Sp=(k+w|0)+((h&8191)<<13)|0;k=(E+(h>>>13)|0)+(Sp>>>26)|0,Sp&=67108863,w=Math.imul(Ue,$e),h=Math.imul(Ue,He),h=h+Math.imul(qe,$e)|0,E=Math.imul(qe,He),w=w+Math.imul(je,We)|0,h=h+Math.imul(je,Ge)|0,h=h+Math.imul(Fe,We)|0,E=E+Math.imul(Fe,Ge)|0,w=w+Math.imul(Le,ze)|0,h=h+Math.imul(Le,Ve)|0,h=h+Math.imul(Be,ze)|0,E=E+Math.imul(Be,Ve)|0,w=w+Math.imul(Ne,Ke)|0,h=h+Math.imul(Ne,Ye)|0,h=h+Math.imul(De,Ke)|0,E=E+Math.imul(De,Ye)|0,w=w+Math.imul(ae,Xe)|0,h=h+Math.imul(ae,Je)|0,h=h+Math.imul(Ie,Xe)|0,E=E+Math.imul(Ie,Je)|0,w=w+Math.imul(Q,Ze)|0,h=h+Math.imul(Q,Qe)|0,h=h+Math.imul(J,Ze)|0,E=E+Math.imul(J,Qe)|0,w=w+Math.imul(L,et)|0,h=h+Math.imul(L,tt)|0,h=h+Math.imul(z,et)|0,E=E+Math.imul(z,tt)|0,w=w+Math.imul(se,rt)|0,h=h+Math.imul(se,nt)|0,h=h+Math.imul(N,rt)|0,E=E+Math.imul(N,nt)|0,w=w+Math.imul(K,it)|0,h=h+Math.imul(K,st)|0,h=h+Math.imul(U,it)|0,E=E+Math.imul(U,st)|0,w=w+Math.imul(M,ot)|0,h=h+Math.imul(M,at)|0,h=h+Math.imul(I,ot)|0,E=E+Math.imul(I,at)|0;var Ep=(k+w|0)+((h&8191)<<13)|0;k=(E+(h>>>13)|0)+(Ep>>>26)|0,Ep&=67108863,w=Math.imul(Ue,We),h=Math.imul(Ue,Ge),h=h+Math.imul(qe,We)|0,E=Math.imul(qe,Ge),w=w+Math.imul(je,ze)|0,h=h+Math.imul(je,Ve)|0,h=h+Math.imul(Fe,ze)|0,E=E+Math.imul(Fe,Ve)|0,w=w+Math.imul(Le,Ke)|0,h=h+Math.imul(Le,Ye)|0,h=h+Math.imul(Be,Ke)|0,E=E+Math.imul(Be,Ye)|0,w=w+Math.imul(Ne,Xe)|0,h=h+Math.imul(Ne,Je)|0,h=h+Math.imul(De,Xe)|0,E=E+Math.imul(De,Je)|0,w=w+Math.imul(ae,Ze)|0,h=h+Math.imul(ae,Qe)|0,h=h+Math.imul(Ie,Ze)|0,E=E+Math.imul(Ie,Qe)|0,w=w+Math.imul(Q,et)|0,h=h+Math.imul(Q,tt)|0,h=h+Math.imul(J,et)|0,E=E+Math.imul(J,tt)|0,w=w+Math.imul(L,rt)|0,h=h+Math.imul(L,nt)|0,h=h+Math.imul(z,rt)|0,E=E+Math.imul(z,nt)|0,w=w+Math.imul(se,it)|0,h=h+Math.imul(se,st)|0,h=h+Math.imul(N,it)|0,E=E+Math.imul(N,st)|0,w=w+Math.imul(K,ot)|0,h=h+Math.imul(K,at)|0,h=h+Math.imul(U,ot)|0,E=E+Math.imul(U,at)|0;var Tp=(k+w|0)+((h&8191)<<13)|0;k=(E+(h>>>13)|0)+(Tp>>>26)|0,Tp&=67108863,w=Math.imul(Ue,ze),h=Math.imul(Ue,Ve),h=h+Math.imul(qe,ze)|0,E=Math.imul(qe,Ve),w=w+Math.imul(je,Ke)|0,h=h+Math.imul(je,Ye)|0,h=h+Math.imul(Fe,Ke)|0,E=E+Math.imul(Fe,Ye)|0,w=w+Math.imul(Le,Xe)|0,h=h+Math.imul(Le,Je)|0,h=h+Math.imul(Be,Xe)|0,E=E+Math.imul(Be,Je)|0,w=w+Math.imul(Ne,Ze)|0,h=h+Math.imul(Ne,Qe)|0,h=h+Math.imul(De,Ze)|0,E=E+Math.imul(De,Qe)|0,w=w+Math.imul(ae,et)|0,h=h+Math.imul(ae,tt)|0,h=h+Math.imul(Ie,et)|0,E=E+Math.imul(Ie,tt)|0,w=w+Math.imul(Q,rt)|0,h=h+Math.imul(Q,nt)|0,h=h+Math.imul(J,rt)|0,E=E+Math.imul(J,nt)|0,w=w+Math.imul(L,it)|0,h=h+Math.imul(L,st)|0,h=h+Math.imul(z,it)|0,E=E+Math.imul(z,st)|0,w=w+Math.imul(se,ot)|0,h=h+Math.imul(se,at)|0,h=h+Math.imul(N,ot)|0,E=E+Math.imul(N,at)|0;var Cp=(k+w|0)+((h&8191)<<13)|0;k=(E+(h>>>13)|0)+(Cp>>>26)|0,Cp&=67108863,w=Math.imul(Ue,Ke),h=Math.imul(Ue,Ye),h=h+Math.imul(qe,Ke)|0,E=Math.imul(qe,Ye),w=w+Math.imul(je,Xe)|0,h=h+Math.imul(je,Je)|0,h=h+Math.imul(Fe,Xe)|0,E=E+Math.imul(Fe,Je)|0,w=w+Math.imul(Le,Ze)|0,h=h+Math.imul(Le,Qe)|0,h=h+Math.imul(Be,Ze)|0,E=E+Math.imul(Be,Qe)|0,w=w+Math.imul(Ne,et)|0,h=h+Math.imul(Ne,tt)|0,h=h+Math.imul(De,et)|0,E=E+Math.imul(De,tt)|0,w=w+Math.imul(ae,rt)|0,h=h+Math.imul(ae,nt)|0,h=h+Math.imul(Ie,rt)|0,E=E+Math.imul(Ie,nt)|0,w=w+Math.imul(Q,it)|0,h=h+Math.imul(Q,st)|0,h=h+Math.imul(J,it)|0,E=E+Math.imul(J,st)|0,w=w+Math.imul(L,ot)|0,h=h+Math.imul(L,at)|0,h=h+Math.imul(z,ot)|0,E=E+Math.imul(z,at)|0;var kp=(k+w|0)+((h&8191)<<13)|0;k=(E+(h>>>13)|0)+(kp>>>26)|0,kp&=67108863,w=Math.imul(Ue,Xe),h=Math.imul(Ue,Je),h=h+Math.imul(qe,Xe)|0,E=Math.imul(qe,Je),w=w+Math.imul(je,Ze)|0,h=h+Math.imul(je,Qe)|0,h=h+Math.imul(Fe,Ze)|0,E=E+Math.imul(Fe,Qe)|0,w=w+Math.imul(Le,et)|0,h=h+Math.imul(Le,tt)|0,h=h+Math.imul(Be,et)|0,E=E+Math.imul(Be,tt)|0,w=w+Math.imul(Ne,rt)|0,h=h+Math.imul(Ne,nt)|0,h=h+Math.imul(De,rt)|0,E=E+Math.imul(De,nt)|0,w=w+Math.imul(ae,it)|0,h=h+Math.imul(ae,st)|0,h=h+Math.imul(Ie,it)|0,E=E+Math.imul(Ie,st)|0,w=w+Math.imul(Q,ot)|0,h=h+Math.imul(Q,at)|0,h=h+Math.imul(J,ot)|0,E=E+Math.imul(J,at)|0;var Ap=(k+w|0)+((h&8191)<<13)|0;k=(E+(h>>>13)|0)+(Ap>>>26)|0,Ap&=67108863,w=Math.imul(Ue,Ze),h=Math.imul(Ue,Qe),h=h+Math.imul(qe,Ze)|0,E=Math.imul(qe,Qe),w=w+Math.imul(je,et)|0,h=h+Math.imul(je,tt)|0,h=h+Math.imul(Fe,et)|0,E=E+Math.imul(Fe,tt)|0,w=w+Math.imul(Le,rt)|0,h=h+Math.imul(Le,nt)|0,h=h+Math.imul(Be,rt)|0,E=E+Math.imul(Be,nt)|0,w=w+Math.imul(Ne,it)|0,h=h+Math.imul(Ne,st)|0,h=h+Math.imul(De,it)|0,E=E+Math.imul(De,st)|0,w=w+Math.imul(ae,ot)|0,h=h+Math.imul(ae,at)|0,h=h+Math.imul(Ie,ot)|0,E=E+Math.imul(Ie,at)|0;var Rp=(k+w|0)+((h&8191)<<13)|0;k=(E+(h>>>13)|0)+(Rp>>>26)|0,Rp&=67108863,w=Math.imul(Ue,et),h=Math.imul(Ue,tt),h=h+Math.imul(qe,et)|0,E=Math.imul(qe,tt),w=w+Math.imul(je,rt)|0,h=h+Math.imul(je,nt)|0,h=h+Math.imul(Fe,rt)|0,E=E+Math.imul(Fe,nt)|0,w=w+Math.imul(Le,it)|0,h=h+Math.imul(Le,st)|0,h=h+Math.imul(Be,it)|0,E=E+Math.imul(Be,st)|0,w=w+Math.imul(Ne,ot)|0,h=h+Math.imul(Ne,at)|0,h=h+Math.imul(De,ot)|0,E=E+Math.imul(De,at)|0;var Op=(k+w|0)+((h&8191)<<13)|0;k=(E+(h>>>13)|0)+(Op>>>26)|0,Op&=67108863,w=Math.imul(Ue,rt),h=Math.imul(Ue,nt),h=h+Math.imul(qe,rt)|0,E=Math.imul(qe,nt),w=w+Math.imul(je,it)|0,h=h+Math.imul(je,st)|0,h=h+Math.imul(Fe,it)|0,E=E+Math.imul(Fe,st)|0,w=w+Math.imul(Le,ot)|0,h=h+Math.imul(Le,at)|0,h=h+Math.imul(Be,ot)|0,E=E+Math.imul(Be,at)|0;var Mp=(k+w|0)+((h&8191)<<13)|0;k=(E+(h>>>13)|0)+(Mp>>>26)|0,Mp&=67108863,w=Math.imul(Ue,it),h=Math.imul(Ue,st),h=h+Math.imul(qe,it)|0,E=Math.imul(qe,st),w=w+Math.imul(je,ot)|0,h=h+Math.imul(je,at)|0,h=h+Math.imul(Fe,ot)|0,E=E+Math.imul(Fe,at)|0;var Pp=(k+w|0)+((h&8191)<<13)|0;k=(E+(h>>>13)|0)+(Pp>>>26)|0,Pp&=67108863,w=Math.imul(Ue,ot),h=Math.imul(Ue,at),h=h+Math.imul(qe,ot)|0,E=Math.imul(qe,at);var Ip=(k+w|0)+((h&8191)<<13)|0;return k=(E+(h>>>13)|0)+(Ip>>>26)|0,Ip&=67108863,_[0]=mp,_[1]=gp,_[2]=vp,_[3]=yp,_[4]=xp,_[5]=_p,_[6]=bp,_[7]=wp,_[8]=Sp,_[9]=Ep,_[10]=Tp,_[11]=Cp,_[12]=kp,_[13]=Ap,_[14]=Rp,_[15]=Op,_[16]=Mp,_[17]=Pp,_[18]=Ip,k!==0&&(_[19]=k,x.length++),x};Math.imul||(y=g);function b(T,p,m){m.negative=p.negative^T.negative,m.length=T.length+p.length;for(var x=0,S=0,v=0;v<m.length-1;v++){var _=S;S=0;for(var k=x&67108863,w=Math.min(v,p.length-1),h=Math.max(0,v-T.length+1);h<=w;h++){var E=v-h,q=T.words[E]|0,M=p.words[h]|0,I=q*M,j=I&67108863;_=_+(I/67108864|0)|0,j=j+k|0,k=j&67108863,_=_+(j>>>26)|0,S+=_>>>26,_&=67108863}m.words[v]=k,x=_,_=S}return x!==0?m.words[v]=x:m.length--,m.strip()}function C(T,p,m){var x=new R;return x.mulp(T,p,m)}i.prototype.mulTo=function(p,m){var x,S=this.length+p.length;return this.length===10&&p.length===10?x=y(this,p,m):S<63?x=g(this,p,m):S<1024?x=b(this,p,m):x=C(this,p,m),x};function R(T,p){this.x=T,this.y=p}R.prototype.makeRBT=function(p){for(var m=new Array(p),x=i.prototype._countBits(p)-1,S=0;S<p;S++)m[S]=this.revBin(S,x,p);return m},R.prototype.revBin=function(p,m,x){if(p===0||p===x-1)return p;for(var S=0,v=0;v<m;v++)S|=(p&1)<<m-v-1,p>>=1;return S},R.prototype.permute=function(p,m,x,S,v,_){for(var k=0;k<_;k++)S[k]=m[p[k]],v[k]=x[p[k]]},R.prototype.transform=function(p,m,x,S,v,_){this.permute(_,p,m,x,S,v);for(var k=1;k<v;k<<=1)for(var w=k<<1,h=Math.cos(2*Math.PI/w),E=Math.sin(2*Math.PI/w),q=0;q<v;q+=w)for(var M=h,I=E,j=0;j<k;j++){var K=x[q+j],U=S[q+j],Re=x[q+j+k],se=S[q+j+k],N=M*Re-I*se;se=M*se+I*Re,Re=N,x[q+j]=K+Re,S[q+j]=U+se,x[q+j+k]=K-Re,S[q+j+k]=U-se,j!==w&&(N=h*M-E*I,I=h*I+E*M,M=N)}},R.prototype.guessLen13b=function(p,m){var x=Math.max(m,p)|1,S=x&1,v=0;for(x=x/2|0;x;x=x>>>1)v++;return 1<<v+1+S},R.prototype.conjugate=function(p,m,x){if(!(x<=1))for(var S=0;S<x/2;S++){var v=p[S];p[S]=p[x-S-1],p[x-S-1]=v,v=m[S],m[S]=-m[x-S-1],m[x-S-1]=-v}},R.prototype.normalize13b=function(p,m){for(var x=0,S=0;S<m/2;S++){var v=Math.round(p[2*S+1]/m)*8192+Math.round(p[2*S]/m)+x;p[S]=v&67108863,v<67108864?x=0:x=v/67108864|0}return p},R.prototype.convert13b=function(p,m,x,S){for(var v=0,_=0;_<m;_++)v=v+(p[_]|0),x[2*_]=v&8191,v=v>>>13,x[2*_+1]=v&8191,v=v>>>13;for(_=2*m;_<S;++_)x[_]=0;t(v===0),t((v&-8192)===0)},R.prototype.stub=function(p){for(var m=new Array(p),x=0;x<p;x++)m[x]=0;return m},R.prototype.mulp=function(p,m,x){var S=2*this.guessLen13b(p.length,m.length),v=this.makeRBT(S),_=this.stub(S),k=new Array(S),w=new Array(S),h=new Array(S),E=new Array(S),q=new Array(S),M=new Array(S),I=x.words;I.length=S,this.convert13b(p.words,p.length,k,S),this.convert13b(m.words,m.length,E,S),this.transform(k,_,w,h,S,v),this.transform(E,_,q,M,S,v);for(var j=0;j<S;j++){var K=w[j]*q[j]-h[j]*M[j];h[j]=w[j]*M[j]+h[j]*q[j],w[j]=K}return this.conjugate(w,h,S),this.transform(w,h,I,_,S,v),this.conjugate(I,_,S),this.normalize13b(I,S),x.negative=p.negative^m.negative,x.length=p.length+m.length,x.strip()},i.prototype.mul=function(p){var m=new i(null);return m.words=new Array(this.length+p.length),this.mulTo(p,m)},i.prototype.mulf=function(p){var m=new i(null);return m.words=new Array(this.length+p.length),C(this,p,m)},i.prototype.imul=function(p){return this.clone().mulTo(p,this)},i.prototype.imuln=function(p){t(typeof p=="number"),t(p<67108864);for(var m=0,x=0;x<this.length;x++){var S=(this.words[x]|0)*p,v=(S&67108863)+(m&67108863);m>>=26,m+=S/67108864|0,m+=v>>>26,this.words[x]=v&67108863}return m!==0&&(this.words[x]=m,this.length++),this.length=p===0?1:this.length,this},i.prototype.muln=function(p){return this.clone().imuln(p)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(p){var m=d(p);if(m.length===0)return new i(1);for(var x=this,S=0;S<m.length&&m[S]===0;S++,x=x.sqr());if(++S<m.length)for(var v=x.sqr();S<m.length;S++,v=v.sqr())m[S]!==0&&(x=x.mul(v));return x},i.prototype.iushln=function(p){t(typeof p=="number"&&p>=0);var m=p%26,x=(p-m)/26,S=67108863>>>26-m<<26-m,v;if(m!==0){var _=0;for(v=0;v<this.length;v++){var k=this.words[v]&S,w=(this.words[v]|0)-k<<m;this.words[v]=w|_,_=k>>>26-m}_&&(this.words[v]=_,this.length++)}if(x!==0){for(v=this.length-1;v>=0;v--)this.words[v+x]=this.words[v];for(v=0;v<x;v++)this.words[v]=0;this.length+=x}return this.strip()},i.prototype.ishln=function(p){return t(this.negative===0),this.iushln(p)},i.prototype.iushrn=function(p,m,x){t(typeof p=="number"&&p>=0);var S;m?S=(m-m%26)/26:S=0;var v=p%26,_=Math.min((p-v)/26,this.length),k=67108863^67108863>>>v<<v,w=x;if(S-=_,S=Math.max(0,S),w){for(var h=0;h<_;h++)w.words[h]=this.words[h];w.length=_}if(_!==0)if(this.length>_)for(this.length-=_,h=0;h<this.length;h++)this.words[h]=this.words[h+_];else this.words[0]=0,this.length=1;var E=0;for(h=this.length-1;h>=0&&(E!==0||h>=S);h--){var q=this.words[h]|0;this.words[h]=E<<26-v|q>>>v,E=q&k}return w&&E!==0&&(w.words[w.length++]=E),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.ishrn=function(p,m,x){return t(this.negative===0),this.iushrn(p,m,x)},i.prototype.shln=function(p){return this.clone().ishln(p)},i.prototype.ushln=function(p){return this.clone().iushln(p)},i.prototype.shrn=function(p){return this.clone().ishrn(p)},i.prototype.ushrn=function(p){return this.clone().iushrn(p)},i.prototype.testn=function(p){t(typeof p=="number"&&p>=0);var m=p%26,x=(p-m)/26,S=1<<m;if(this.length<=x)return!1;var v=this.words[x];return!!(v&S)},i.prototype.imaskn=function(p){t(typeof p=="number"&&p>=0);var m=p%26,x=(p-m)/26;if(t(this.negative===0,"imaskn works only with positive numbers"),this.length<=x)return this;if(m!==0&&x++,this.length=Math.min(x,this.length),m!==0){var S=67108863^67108863>>>m<<m;this.words[this.length-1]&=S}return this.length===0&&(this.words[0]=0,this.length=1),this.strip()},i.prototype.maskn=function(p){return this.clone().imaskn(p)},i.prototype.iaddn=function(p){return t(typeof p=="number"),t(p<67108864),p<0?this.isubn(-p):this.negative!==0?this.length===1&&(this.words[0]|0)<p?(this.words[0]=p-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(p),this.negative=1,this):this._iaddn(p)},i.prototype._iaddn=function(p){this.words[0]+=p;for(var m=0;m<this.length&&this.words[m]>=67108864;m++)this.words[m]-=67108864,m===this.length-1?this.words[m+1]=1:this.words[m+1]++;return this.length=Math.max(this.length,m+1),this},i.prototype.isubn=function(p){if(t(typeof p=="number"),t(p<67108864),p<0)return this.iaddn(-p);if(this.negative!==0)return this.negative=0,this.iaddn(p),this.negative=1,this;if(this.words[0]-=p,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var m=0;m<this.length&&this.words[m]<0;m++)this.words[m]+=67108864,this.words[m+1]-=1;return this.strip()},i.prototype.addn=function(p){return this.clone().iaddn(p)},i.prototype.subn=function(p){return this.clone().isubn(p)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(p,m,x){var S=p.length+x,v;this._expand(S);var _,k=0;for(v=0;v<p.length;v++){_=(this.words[v+x]|0)+k;var w=(p.words[v]|0)*m;_-=w&67108863,k=(_>>26)-(w/67108864|0),this.words[v+x]=_&67108863}for(;v<this.length-x;v++)_=(this.words[v+x]|0)+k,k=_>>26,this.words[v+x]=_&67108863;if(k===0)return this.strip();for(t(k===-1),k=0,v=0;v<this.length;v++)_=-(this.words[v]|0)+k,k=_>>26,this.words[v]=_&67108863;return this.negative=1,this.strip()},i.prototype._wordDiv=function(p,m){var x=this.length-p.length,S=this.clone(),v=p,_=v.words[v.length-1]|0,k=this._countBits(_);x=26-k,x!==0&&(v=v.ushln(x),S.iushln(x),_=v.words[v.length-1]|0);var w=S.length-v.length,h;if(m!=="mod"){h=new i(null),h.length=w+1,h.words=new Array(h.length);for(var E=0;E<h.length;E++)h.words[E]=0}var q=S.clone()._ishlnsubmul(v,1,w);q.negative===0&&(S=q,h&&(h.words[w]=1));for(var M=w-1;M>=0;M--){var I=(S.words[v.length+M]|0)*67108864+(S.words[v.length+M-1]|0);for(I=Math.min(I/_|0,67108863),S._ishlnsubmul(v,I,M);S.negative!==0;)I--,S.negative=0,S._ishlnsubmul(v,1,M),S.isZero()||(S.negative^=1);h&&(h.words[M]=I)}return h&&h.strip(),S.strip(),m!=="div"&&x!==0&&S.iushrn(x),{div:h||null,mod:S}},i.prototype.divmod=function(p,m,x){if(t(!p.isZero()),this.isZero())return{div:new i(0),mod:new i(0)};var S,v,_;return this.negative!==0&&p.negative===0?(_=this.neg().divmod(p,m),m!=="mod"&&(S=_.div.neg()),m!=="div"&&(v=_.mod.neg(),x&&v.negative!==0&&v.iadd(p)),{div:S,mod:v}):this.negative===0&&p.negative!==0?(_=this.divmod(p.neg(),m),m!=="mod"&&(S=_.div.neg()),{div:S,mod:_.mod}):(this.negative&p.negative)!==0?(_=this.neg().divmod(p.neg(),m),m!=="div"&&(v=_.mod.neg(),x&&v.negative!==0&&v.isub(p)),{div:_.div,mod:v}):p.length>this.length||this.cmp(p)<0?{div:new i(0),mod:this}:p.length===1?m==="div"?{div:this.divn(p.words[0]),mod:null}:m==="mod"?{div:null,mod:new i(this.modn(p.words[0]))}:{div:this.divn(p.words[0]),mod:new i(this.modn(p.words[0]))}:this._wordDiv(p,m)},i.prototype.div=function(p){return this.divmod(p,"div",!1).div},i.prototype.mod=function(p){return this.divmod(p,"mod",!1).mod},i.prototype.umod=function(p){return this.divmod(p,"mod",!0).mod},i.prototype.divRound=function(p){var m=this.divmod(p);if(m.mod.isZero())return m.div;var x=m.div.negative!==0?m.mod.isub(p):m.mod,S=p.ushrn(1),v=p.andln(1),_=x.cmp(S);return _<0||v===1&&_===0?m.div:m.div.negative!==0?m.div.isubn(1):m.div.iaddn(1)},i.prototype.modn=function(p){t(p<=67108863);for(var m=(1<<26)%p,x=0,S=this.length-1;S>=0;S--)x=(m*x+(this.words[S]|0))%p;return x},i.prototype.idivn=function(p){t(p<=67108863);for(var m=0,x=this.length-1;x>=0;x--){var S=(this.words[x]|0)+m*67108864;this.words[x]=S/p|0,m=S%p}return this.strip()},i.prototype.divn=function(p){return this.clone().idivn(p)},i.prototype.egcd=function(p){t(p.negative===0),t(!p.isZero());var m=this,x=p.clone();m.negative!==0?m=m.umod(p):m=m.clone();for(var S=new i(1),v=new i(0),_=new i(0),k=new i(1),w=0;m.isEven()&&x.isEven();)m.iushrn(1),x.iushrn(1),++w;for(var h=x.clone(),E=m.clone();!m.isZero();){for(var q=0,M=1;(m.words[0]&M)===0&&q<26;++q,M<<=1);if(q>0)for(m.iushrn(q);q-- >0;)(S.isOdd()||v.isOdd())&&(S.iadd(h),v.isub(E)),S.iushrn(1),v.iushrn(1);for(var I=0,j=1;(x.words[0]&j)===0&&I<26;++I,j<<=1);if(I>0)for(x.iushrn(I);I-- >0;)(_.isOdd()||k.isOdd())&&(_.iadd(h),k.isub(E)),_.iushrn(1),k.iushrn(1);m.cmp(x)>=0?(m.isub(x),S.isub(_),v.isub(k)):(x.isub(m),_.isub(S),k.isub(v))}return{a:_,b:k,gcd:x.iushln(w)}},i.prototype._invmp=function(p){t(p.negative===0),t(!p.isZero());var m=this,x=p.clone();m.negative!==0?m=m.umod(p):m=m.clone();for(var S=new i(1),v=new i(0),_=x.clone();m.cmpn(1)>0&&x.cmpn(1)>0;){for(var k=0,w=1;(m.words[0]&w)===0&&k<26;++k,w<<=1);if(k>0)for(m.iushrn(k);k-- >0;)S.isOdd()&&S.iadd(_),S.iushrn(1);for(var h=0,E=1;(x.words[0]&E)===0&&h<26;++h,E<<=1);if(h>0)for(x.iushrn(h);h-- >0;)v.isOdd()&&v.iadd(_),v.iushrn(1);m.cmp(x)>=0?(m.isub(x),S.isub(v)):(x.isub(m),v.isub(S))}var q;return m.cmpn(1)===0?q=S:q=v,q.cmpn(0)<0&&q.iadd(p),q},i.prototype.gcd=function(p){if(this.isZero())return p.abs();if(p.isZero())return this.abs();var m=this.clone(),x=p.clone();m.negative=0,x.negative=0;for(var S=0;m.isEven()&&x.isEven();S++)m.iushrn(1),x.iushrn(1);do{for(;m.isEven();)m.iushrn(1);for(;x.isEven();)x.iushrn(1);var v=m.cmp(x);if(v<0){var _=m;m=x,x=_}else if(v===0||x.cmpn(1)===0)break;m.isub(x)}while(!0);return x.iushln(S)},i.prototype.invm=function(p){return this.egcd(p).a.umod(p)},i.prototype.isEven=function(){return(this.words[0]&1)===0},i.prototype.isOdd=function(){return(this.words[0]&1)===1},i.prototype.andln=function(p){return this.words[0]&p},i.prototype.bincn=function(p){t(typeof p=="number");var m=p%26,x=(p-m)/26,S=1<<m;if(this.length<=x)return this._expand(x+1),this.words[x]|=S,this;for(var v=S,_=x;v!==0&&_<this.length;_++){var k=this.words[_]|0;k+=v,v=k>>>26,k&=67108863,this.words[_]=k}return v!==0&&(this.words[_]=v,this.length++),this},i.prototype.isZero=function(){return this.length===1&&this.words[0]===0},i.prototype.cmpn=function(p){var m=p<0;if(this.negative!==0&&!m)return-1;if(this.negative===0&&m)return 1;this.strip();var x;if(this.length>1)x=1;else{m&&(p=-p),t(p<=67108863,"Number is too big");var S=this.words[0]|0;x=S===p?0:S<p?-1:1}return this.negative!==0?-x|0:x},i.prototype.cmp=function(p){if(this.negative!==0&&p.negative===0)return-1;if(this.negative===0&&p.negative!==0)return 1;var m=this.ucmp(p);return this.negative!==0?-m|0:m},i.prototype.ucmp=function(p){if(this.length>p.length)return 1;if(this.length<p.length)return-1;for(var m=0,x=this.length-1;x>=0;x--){var S=this.words[x]|0,v=p.words[x]|0;if(S!==v){S<v?m=-1:S>v&&(m=1);break}}return m},i.prototype.gtn=function(p){return this.cmpn(p)===1},i.prototype.gt=function(p){return this.cmp(p)===1},i.prototype.gten=function(p){return this.cmpn(p)>=0},i.prototype.gte=function(p){return this.cmp(p)>=0},i.prototype.ltn=function(p){return this.cmpn(p)===-1},i.prototype.lt=function(p){return this.cmp(p)===-1},i.prototype.lten=function(p){return this.cmpn(p)<=0},i.prototype.lte=function(p){return this.cmp(p)<=0},i.prototype.eqn=function(p){return this.cmpn(p)===0},i.prototype.eq=function(p){return this.cmp(p)===0},i.red=function(p){return new D(p)},i.prototype.toRed=function(p){return t(!this.red,"Already a number in reduction context"),t(this.negative===0,"red works only with positives"),p.convertTo(this)._forceRed(p)},i.prototype.fromRed=function(){return t(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(p){return this.red=p,this},i.prototype.forceRed=function(p){return t(!this.red,"Already a number in reduction context"),this._forceRed(p)},i.prototype.redAdd=function(p){return t(this.red,"redAdd works only with red numbers"),this.red.add(this,p)},i.prototype.redIAdd=function(p){return t(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,p)},i.prototype.redSub=function(p){return t(this.red,"redSub works only with red numbers"),this.red.sub(this,p)},i.prototype.redISub=function(p){return t(this.red,"redISub works only with red numbers"),this.red.isub(this,p)},i.prototype.redShl=function(p){return t(this.red,"redShl works only with red numbers"),this.red.shl(this,p)},i.prototype.redMul=function(p){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,p),this.red.mul(this,p)},i.prototype.redIMul=function(p){return t(this.red,"redMul works only with red numbers"),this.red._verify2(this,p),this.red.imul(this,p)},i.prototype.redSqr=function(){return t(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return t(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return t(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return t(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return t(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(p){return t(this.red&&!p.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,p)};var O={k256:null,p224:null,p192:null,p25519:null};function P(T,p){this.name=T,this.p=new i(p,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}P.prototype._tmp=function(){var p=new i(null);return p.words=new Array(Math.ceil(this.n/13)),p},P.prototype.ireduce=function(p){var m=p,x;do this.split(m,this.tmp),m=this.imulK(m),m=m.iadd(this.tmp),x=m.bitLength();while(x>this.n);var S=x<this.n?-1:m.ucmp(this.p);return S===0?(m.words[0]=0,m.length=1):S>0?m.isub(this.p):m.strip!==void 0?m.strip():m._strip(),m},P.prototype.split=function(p,m){p.iushrn(this.n,0,m)},P.prototype.imulK=function(p){return p.imul(this.k)};function B(){P.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(B,P),B.prototype.split=function(p,m){for(var x=4194303,S=Math.min(p.length,9),v=0;v<S;v++)m.words[v]=p.words[v];if(m.length=S,p.length<=9){p.words[0]=0,p.length=1;return}var _=p.words[9];for(m.words[m.length++]=_&x,v=10;v<p.length;v++){var k=p.words[v]|0;p.words[v-10]=(k&x)<<4|_>>>22,_=k}_>>>=22,p.words[v-10]=_,_===0&&p.length>10?p.length-=10:p.length-=9},B.prototype.imulK=function(p){p.words[p.length]=0,p.words[p.length+1]=0,p.length+=2;for(var m=0,x=0;x<p.length;x++){var S=p.words[x]|0;m+=S*977,p.words[x]=m&67108863,m=S*64+(m/67108864|0)}return p.words[p.length-1]===0&&(p.length--,p.words[p.length-1]===0&&p.length--),p};function G(){P.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(G,P);function F(){P.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(F,P);function V(){P.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(V,P),V.prototype.imulK=function(p){for(var m=0,x=0;x<p.length;x++){var S=(p.words[x]|0)*19+m,v=S&67108863;S>>>=26,p.words[x]=v,m=S}return m!==0&&(p.words[p.length++]=m),p},i._prime=function(p){if(O[p])return O[p];var m;if(p==="k256")m=new B;else if(p==="p224")m=new G;else if(p==="p192")m=new F;else if(p==="p25519")m=new V;else throw new Error("Unknown prime "+p);return O[p]=m,m};function D(T){if(typeof T=="string"){var p=i._prime(T);this.m=p.p,this.prime=p}else t(T.gtn(1),"modulus must be greater than 1"),this.m=T,this.prime=null}D.prototype._verify1=function(p){t(p.negative===0,"red works only with positives"),t(p.red,"red works only with red numbers")},D.prototype._verify2=function(p,m){t((p.negative|m.negative)===0,"red works only with positives"),t(p.red&&p.red===m.red,"red works only with red numbers")},D.prototype.imod=function(p){return this.prime?this.prime.ireduce(p)._forceRed(this):p.umod(this.m)._forceRed(this)},D.prototype.neg=function(p){return p.isZero()?p.clone():this.m.sub(p)._forceRed(this)},D.prototype.add=function(p,m){this._verify2(p,m);var x=p.add(m);return x.cmp(this.m)>=0&&x.isub(this.m),x._forceRed(this)},D.prototype.iadd=function(p,m){this._verify2(p,m);var x=p.iadd(m);return x.cmp(this.m)>=0&&x.isub(this.m),x},D.prototype.sub=function(p,m){this._verify2(p,m);var x=p.sub(m);return x.cmpn(0)<0&&x.iadd(this.m),x._forceRed(this)},D.prototype.isub=function(p,m){this._verify2(p,m);var x=p.isub(m);return x.cmpn(0)<0&&x.iadd(this.m),x},D.prototype.shl=function(p,m){return this._verify1(p),this.imod(p.ushln(m))},D.prototype.imul=function(p,m){return this._verify2(p,m),this.imod(p.imul(m))},D.prototype.mul=function(p,m){return this._verify2(p,m),this.imod(p.mul(m))},D.prototype.isqr=function(p){return this.imul(p,p.clone())},D.prototype.sqr=function(p){return this.mul(p,p)},D.prototype.sqrt=function(p){if(p.isZero())return p.clone();var m=this.m.andln(3);if(t(m%2===1),m===3){var x=this.m.add(new i(1)).iushrn(2);return this.pow(p,x)}for(var S=this.m.subn(1),v=0;!S.isZero()&&S.andln(1)===0;)v++,S.iushrn(1);t(!S.isZero());var _=new i(1).toRed(this),k=_.redNeg(),w=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new i(2*h*h).toRed(this);this.pow(h,w).cmp(k)!==0;)h.redIAdd(k);for(var E=this.pow(h,S),q=this.pow(p,S.addn(1).iushrn(1)),M=this.pow(p,S),I=v;M.cmp(_)!==0;){for(var j=M,K=0;j.cmp(_)!==0;K++)j=j.redSqr();t(K<I);var U=this.pow(E,new i(1).iushln(I-K-1));q=q.redMul(U),E=U.redSqr(),M=M.redMul(E),I=K}return q},D.prototype.invm=function(p){var m=p._invmp(this.m);return m.negative!==0?(m.negative=0,this.imod(m).redNeg()):this.imod(m)},D.prototype.pow=function(p,m){if(m.isZero())return new i(1).toRed(this);if(m.cmpn(1)===0)return p.clone();var x=4,S=new Array(1<<x);S[0]=new i(1).toRed(this),S[1]=p;for(var v=2;v<S.length;v++)S[v]=this.mul(S[v-1],p);var _=S[0],k=0,w=0,h=m.bitLength()%26;for(h===0&&(h=26),v=m.length-1;v>=0;v--){for(var E=m.words[v],q=h-1;q>=0;q--){var M=E>>q&1;if(_!==S[0]&&(_=this.sqr(_)),M===0&&k===0){w=0;continue}k<<=1,k|=M,w++,!(w!==x&&(v!==0||q!==0))&&(_=this.mul(_,S[k]),w=0,k=0)}h=26}return _},D.prototype.convertTo=function(p){var m=p.umod(this.m);return m===p?m.clone():m},D.prototype.convertFrom=function(p){var m=p.clone();return m.red=null,m},i.mont=function(p){return new $(p)};function $(T){D.call(this,T),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n($,D),$.prototype.convertTo=function(p){return this.imod(p.ushln(this.shift))},$.prototype.convertFrom=function(p){var m=this.imod(p.mul(this.rinv));return m.red=null,m},$.prototype.imul=function(p,m){if(p.isZero()||m.isZero())return p.words[0]=0,p.length=1,p;var x=p.imul(m),S=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=x.isub(S).iushrn(this.shift),_=v;return v.cmp(this.m)>=0?_=v.isub(this.m):v.cmpn(0)<0&&(_=v.iadd(this.m)),_._forceRed(this)},$.prototype.mul=function(p,m){if(p.isZero()||m.isZero())return new i(0)._forceRed(this);var x=p.mul(m),S=x.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),v=x.isub(S).iushrn(this.shift),_=v;return v.cmp(this.m)>=0?_=v.isub(this.m):v.cmpn(0)<0&&(_=v.iadd(this.m)),_._forceRed(this)},$.prototype.invm=function(p){var m=this.imod(p._invmp(this.m).mul(this.r2));return m._forceRed(this)}})(typeof cm>"u"||cm,UE)});var qE=A((JG,um)=>{typeof Object.create=="function"?um.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:um.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 Yn=A((ZG,fm)=>{try{if(pm=require("util"),typeof pm.inherits!="function")throw"";fm.exports=pm.inherits}catch{fm.exports=qE()}var pm});var su=A((QG,$E)=>{"use strict";var iu=require("buffer"),Us=iu.Buffer,mr={},gr;for(gr in iu)iu.hasOwnProperty(gr)&&(gr==="SlowBuffer"||gr==="Buffer"||(mr[gr]=iu[gr]));var qs=mr.Buffer={};for(gr in Us)Us.hasOwnProperty(gr)&&(gr==="allocUnsafe"||gr==="allocUnsafeSlow"||(qs[gr]=Us[gr]));mr.Buffer.prototype=Us.prototype;(!qs.from||qs.from===Uint8Array.from)&&(qs.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 Us(r,e,t)});qs.alloc||(qs.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=Us(r);return!e||e.length===0?n.fill(0):typeof t=="string"?n.fill(e,t):n.fill(e),n});if(!mr.kStringMaxLength)try{mr.kStringMaxLength=process.binding("buffer").kStringMaxLength}catch{}mr.constants||(mr.constants={MAX_LENGTH:mr.kMaxLength},mr.kStringMaxLength&&(mr.constants.MAX_STRING_LENGTH=mr.kStringMaxLength));$E.exports=mr});var ou=A(HE=>{"use strict";var Gj=Yn();function vr(r){this._reporterState={obj:null,path:[],options:r||{},errors:[]}}HE.Reporter=vr;vr.prototype.isError=function(e){return e instanceof $s};vr.prototype.save=function(){let e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}};vr.prototype.restore=function(e){let t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)};vr.prototype.enterKey=function(e){return this._reporterState.path.push(e)};vr.prototype.exitKey=function(e){let t=this._reporterState;t.path=t.path.slice(0,e-1)};vr.prototype.leaveKey=function(e,t,n){let i=this._reporterState;this.exitKey(e),i.obj!==null&&(i.obj[t]=n)};vr.prototype.path=function(){return this._reporterState.path.join("/")};vr.prototype.enterObject=function(){let e=this._reporterState,t=e.obj;return e.obj={},t};vr.prototype.leaveObject=function(e){let t=this._reporterState,n=t.obj;return t.obj=e,n};vr.prototype.error=function(e){let t,n=this._reporterState,i=e instanceof $s;if(i?t=e:t=new $s(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};vr.prototype.wrapResult=function(e){let t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e};function $s(r,e){this.path=r,this.rethrow(e)}Gj($s,Error);$s.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,$s),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}});var Gs=A(dm=>{"use strict";var zj=Yn(),au=ou().Reporter,Hs=su().Buffer;function yr(r,e){if(au.call(this,e),!Hs.isBuffer(r)){this.error("Input not Buffer");return}this.base=r,this.offset=0,this.length=r.length}zj(yr,au);dm.DecoderBuffer=yr;yr.isDecoderBuffer=function(e){return e instanceof yr?!0:typeof e=="object"&&Hs.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"};yr.prototype.save=function(){return{offset:this.offset,reporter:au.prototype.save.call(this)}};yr.prototype.restore=function(e){let t=new yr(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,au.prototype.restore.call(this,e.reporter),t};yr.prototype.isEmpty=function(){return this.offset===this.length};yr.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")};yr.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");let n=new yr(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+e,this.offset+=e,n};yr.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)};function Ws(r,e){if(Array.isArray(r))this.length=0,this.value=r.map(function(t){return Ws.isEncoderBuffer(t)||(t=new Ws(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=Hs.byteLength(r);else if(Hs.isBuffer(r))this.value=r,this.length=r.length;else return e.error("Unsupported type: "+typeof r)}dm.EncoderBuffer=Ws;Ws.isEncoderBuffer=function(e){return e instanceof Ws?!0:typeof e=="object"&&e.constructor.name==="EncoderBuffer"&&typeof e.length=="number"&&typeof e.join=="function"};Ws.prototype.join=function(e,t){return e||(e=Hs.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):Hs.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}});var zE=A((rz,GE)=>{GE.exports=WE;function WE(r,e){if(!r)throw new Error(e||"Assertion failed")}WE.equal=function(e,t,n){if(e!=t)throw new Error(n||"Assertion failed: "+e+" != "+t)}});var cu=A((nz,KE)=>{"use strict";var Vj=ou().Reporter,Kj=Gs().EncoderBuffer,Yj=Gs().DecoderBuffer,Nt=zE(),VE=["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"],Xj=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(VE),Jj=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function ge(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())}KE.exports=ge;var Zj=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];ge.prototype.clone=function(){let e=this._baseState,t={};Zj.forEach(function(i){t[i]=e[i]});let n=new this.constructor(t.parent);return n._baseState=t,n};ge.prototype._wrap=function(){let e=this._baseState;Xj.forEach(function(t){this[t]=function(){let i=new this.constructor(this);return e.children.push(i),i[t].apply(i,arguments)}},this)};ge.prototype._init=function(e){let t=this._baseState;Nt(t.parent===null),e.call(this),t.children=t.children.filter(function(n){return n._baseState.parent===this},this),Nt.equal(t.children.length,1,"Root node can have only one child")};ge.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&&(Nt(t.children===null),t.children=n,n.forEach(function(i){i._baseState.parent=this},this)),e.length!==0&&(Nt(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}))};Jj.forEach(function(r){ge.prototype[r]=function(){let t=this._baseState;throw new Error(r+" not implemented for encoding: "+t.enc)}});VE.forEach(function(r){ge.prototype[r]=function(){let t=this._baseState,n=Array.prototype.slice.call(arguments);return Nt(t.tag===null),t.tag=r,this._useArgs(n),this}});ge.prototype.use=function(e){Nt(e);let t=this._baseState;return Nt(t.use===null),t.use=e,this};ge.prototype.optional=function(){let e=this._baseState;return e.optional=!0,this};ge.prototype.def=function(e){let t=this._baseState;return Nt(t.default===null),t.default=e,t.optional=!0,this};ge.prototype.explicit=function(e){let t=this._baseState;return Nt(t.explicit===null&&t.implicit===null),t.explicit=e,this};ge.prototype.implicit=function(e){let t=this._baseState;return Nt(t.explicit===null&&t.implicit===null),t.implicit=e,this};ge.prototype.obj=function(){let e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,t.length!==0&&this._useArgs(t),this};ge.prototype.key=function(e){let t=this._baseState;return Nt(t.key===null),t.key=e,this};ge.prototype.any=function(){let e=this._baseState;return e.any=!0,this};ge.prototype.choice=function(e){let t=this._baseState;return Nt(t.choice===null),t.choice=e,this._useArgs(Object.keys(e).map(function(n){return e[n]})),this};ge.prototype.contains=function(e){let t=this._baseState;return Nt(t.use===null),t.contains=e,this};ge.prototype._decode=function(e,t){let n=this._baseState;if(n.parent===null)return e.wrapResult(n.children[0]._decode(e,t));let i=n.default,s=!0,o=null;if(n.key!==null&&(o=e.enterKey(n.key)),n.optional){let c=null;if(n.explicit!==null?c=n.explicit:n.implicit!==null?c=n.implicit:n.tag!==null&&(c=n.tag),c===null&&!n.any){let l=e.save();try{n.choice===null?this._decodeGeneric(n.tag,e,t):this._decodeChoice(e,t),s=!0}catch{s=!1}e.restore(l)}else if(s=this._peekTag(e,c,n.any),e.isError(s))return s}let a;if(n.obj&&s&&(a=e.enterObject()),s){if(n.explicit!==null){let l=this._decodeTag(e,n.explicit);if(e.isError(l))return l;e=l}let c=e.offset;if(n.use===null&&n.choice===null){let l;n.any&&(l=e.save());let u=this._decodeTag(e,n.implicit!==null?n.implicit:n.tag,n.any);if(e.isError(u))return u;n.any?i=e.raw(l):e=u}if(t&&t.track&&n.tag!==null&&t.track(e.path(),c,e.length,"tagged"),t&&t.track&&n.tag!==null&&t.track(e.path(),e.offset,e.length,"content"),n.any||(n.choice===null?i=this._decodeGeneric(n.tag,e,t):i=this._decodeChoice(e,t)),e.isError(i))return i;if(!n.any&&n.choice===null&&n.children!==null&&n.children.forEach(function(u){u._decode(e,t)}),n.contains&&(n.tag==="octstr"||n.tag==="bitstr")){let l=new Yj(i);i=this._getUse(n.contains,e._reporterState.obj)._decode(l,t)}}return n.obj&&s&&(i=e.leaveObject(a)),n.key!==null&&(i!==null||s===!0)?e.leaveKey(o,n.key,i):o!==null&&e.exitKey(o),i};ge.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)};ge.prototype._getUse=function(e,t){let n=this._baseState;return n.useDecoder=this._use(e,t),Nt(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};ge.prototype._decodeChoice=function(e,t){let n=this._baseState,i=null,s=!1;return Object.keys(n.choice).some(function(o){let a=e.save(),c=n.choice[o];try{let l=c._decode(e,t);if(e.isError(l))return!1;i={type:o,value:l},s=!0}catch{return e.restore(a),!1}return!0},this),s?i:e.error("Choice not matched")};ge.prototype._createEncoderBuffer=function(e){return new Kj(e,this.reporter)};ge.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};ge.prototype._encodeValue=function(e,t,n){let i=this._baseState;if(i.parent===null)return i.children[0]._encode(e,t||new Vj);let s=null;if(this.reporter=t,i.optional&&e===void 0)if(i.default!==null)e=i.default;else return;let o=null,a=!1;if(i.any)s=this._createEncoderBuffer(e);else if(i.choice)s=this._encodeChoice(e,t);else if(i.contains)o=this._getUse(i.contains,n)._encode(e,t),a=!0;else if(i.children)o=i.children.map(function(c){if(c._baseState.tag==="null_")return c._encode(null,t,e);if(c._baseState.key===null)return t.error("Child should have a key");let l=t.enterKey(c._baseState.key);if(typeof e!="object")return t.error("Child expected, but input is not object");let u=c._encode(e[c._baseState.key],t,e);return t.leaveKey(l),u},this).filter(function(c){return c}),o=this._createEncoderBuffer(o);else if(i.tag==="seqof"||i.tag==="setof"){if(!(i.args&&i.args.length===1))return t.error("Too many args for : "+i.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");let c=this.clone();c._baseState.implicit=null,o=this._createEncoderBuffer(e.map(function(l){let u=this._baseState;return this._getUse(u.args[0],e)._encode(l,t)},c))}else i.use!==null?s=this._getUse(i.use,n)._encode(e,t):(o=this._encodePrimitive(i.tag,e),a=!0);if(!i.any&&i.choice===null){let c=i.implicit!==null?i.implicit:i.tag,l=i.implicit===null?"universal":"context";c===null?i.use===null&&t.error("Tag could be omitted only for .use()"):i.use===null&&(s=this._encodeComposite(c,a,l,o))}return i.explicit!==null&&(s=this._encodeComposite(i.explicit,!1,"context",s)),s};ge.prototype._encodeChoice=function(e,t){let n=this._baseState,i=n.choice[e.type];return i||Nt(!1,e.type+" not found in "+JSON.stringify(Object.keys(n.choice))),i._encode(e.value,t)};ge.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)};ge.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)};ge.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}});var lu=A(Ei=>{"use strict";function YE(r){let e={};return Object.keys(r).forEach(function(t){(t|0)==t&&(t=t|0);let n=r[t];e[n]=t}),e}Ei.tagClass={0:"universal",1:"application",2:"context",3:"private"};Ei.tagClassByName=YE(Ei.tagClass);Ei.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"};Ei.tagByName=YE(Ei.tag)});var mm=A((sz,ZE)=>{"use strict";var Qj=Yn(),Cn=su().Buffer,XE=cu(),hm=lu();function JE(r){this.enc="der",this.name=r.name,this.entity=r,this.tree=new Ir,this.tree._init(r.body)}ZE.exports=JE;JE.prototype.encode=function(e,t){return this.tree._encode(e,t).join()};function Ir(r){XE.call(this,"der",r)}Qj(Ir,XE);Ir.prototype._encodeComposite=function(e,t,n,i){let s=eF(e,t,n,this.reporter);if(i.length<128){let c=Cn.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=Cn.alloc(2+o);a[0]=s,a[1]=128|o;for(let c=1+o,l=i.length;l>0;c--,l>>=8)a[c]=l&255;return this._createEncoderBuffer([a,i])};Ir.prototype._encodeStr=function(e,t){if(t==="bitstr")return this._createEncoderBuffer([e.unused|0,e.data]);if(t==="bmpstr"){let n=Cn.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")};Ir.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=Cn.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 xr(r){return r<10?"0"+r:r}Ir.prototype._encodeTime=function(e,t){let n,i=new Date(e);return t==="gentime"?n=[xr(i.getUTCFullYear()),xr(i.getUTCMonth()+1),xr(i.getUTCDate()),xr(i.getUTCHours()),xr(i.getUTCMinutes()),xr(i.getUTCSeconds()),"Z"].join(""):t==="utctime"?n=[xr(i.getUTCFullYear()%100),xr(i.getUTCMonth()+1),xr(i.getUTCDate()),xr(i.getUTCHours()),xr(i.getUTCMinutes()),xr(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(n,"octstr")};Ir.prototype._encodeNull=function(){return this._createEncoderBuffer("")};Ir.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"&&!Cn.isBuffer(e)){let s=e.toArray();!e.sign&&s[0]&128&&s.unshift(0),e=Cn.from(s)}if(Cn.isBuffer(e)){let s=e.length;e.length===0&&s++;let o=Cn.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(Cn.from(i))};Ir.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)};Ir.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getEncoder("der").tree};Ir.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 eF(r,e,t,n){let i;if(r==="seqof"?r="seq":r==="setof"&&(r="set"),hm.tagByName.hasOwnProperty(r))i=hm.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|=hm.tagClassByName[t||"universal"]<<6,i)}});var e1=A((oz,QE)=>{"use strict";var tF=Yn(),gm=mm();function vm(r){gm.call(this,r),this.enc="pem"}tF(vm,gm);QE.exports=vm;vm.prototype.encode=function(e,t){let i=gm.prototype.encode.call(this,e).toString("base64"),s=["-----BEGIN "+t.label+"-----"];for(let o=0;o<i.length;o+=64)s.push(i.slice(o,o+64));return s.push("-----END "+t.label+"-----"),s.join(`
|
|
95
|
+
`)}});var ym=A(r1=>{"use strict";var t1=r1;t1.der=mm();t1.pem=e1()});var _m=A((cz,c1)=>{"use strict";var rF=Yn(),nF=lm(),n1=Gs().DecoderBuffer,s1=cu(),i1=lu();function o1(r){this.enc="der",this.name=r.name,this.entity=r,this.tree=new tr,this.tree._init(r.body)}c1.exports=o1;o1.prototype.decode=function(e,t){return n1.isDecoderBuffer(e)||(e=new n1(e,t)),this.tree._decode(e,t)};function tr(r){s1.call(this,"der",r)}rF(tr,s1);tr.prototype._peekTag=function(e,t,n){if(e.isEmpty())return!1;let i=e.save(),s=xm(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)};tr.prototype._decodeTag=function(e,t,n){let i=xm(e,'Failed to decode tag of "'+t+'"');if(e.isError(i))return i;let s=a1(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+'"'))};tr.prototype._skipUntilEnd=function(e,t){for(;;){let n=xm(e,t);if(e.isError(n))return n;let i=a1(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}};tr.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};tr.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")}};tr.prototype._decodeObjid=function(e,t,n){let i,s=[],o=0,a=0;for(;!e.isEmpty();)a=e.readUInt8(),o<<=7,o|=a&127,(a&128)===0&&(s.push(o),o=0);a&128&&s.push(o);let c=s[0]/40|0,l=s[0]%40;if(n?i=s:i=[c,l].concat(s.slice(1)),t){let u=t[i.join(" ")];u===void 0&&(u=t[i.join(".")]),u!==void 0&&(i=u)}return i};tr.prototype._decodeTime=function(e,t){let n=e.raw().toString(),i,s,o,a,c,l;if(t==="gentime")i=n.slice(0,4)|0,s=n.slice(4,6)|0,o=n.slice(6,8)|0,a=n.slice(8,10)|0,c=n.slice(10,12)|0,l=n.slice(12,14)|0;else if(t==="utctime")i=n.slice(0,2)|0,s=n.slice(2,4)|0,o=n.slice(4,6)|0,a=n.slice(6,8)|0,c=n.slice(8,10)|0,l=n.slice(10,12)|0,i<70?i=2e3+i:i=1900+i;else return e.error("Decoding "+t+" time is not supported yet");return Date.UTC(i,s-1,o,a,c,l,0)};tr.prototype._decodeNull=function(){return null};tr.prototype._decodeBool=function(e){let t=e.readUInt8();return e.isError(t)?t:t!==0};tr.prototype._decodeInt=function(e,t){let n=e.raw(),i=new nF(n);return t&&(i=t[i.toString(10)]||i),i};tr.prototype._use=function(e,t){return typeof e=="function"&&(e=e(t)),e._getDecoder("der").tree};function xm(r,e){let t=r.readUInt8(e);if(r.isError(t))return t;let n=i1.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=i1.tag[t];return{cls:n,primitive:i,tag:t,tagStr:s}}function a1(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 u1=A((lz,l1)=>{"use strict";var iF=Yn(),sF=su().Buffer,bm=_m();function wm(r){bm.call(this,r),this.enc="pem"}iF(wm,bm);l1.exports=wm;wm.prototype.decode=function(e,t){let n=e.toString().split(/[\r\n]+/g),i=t.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/,o=-1,a=-1;for(let u=0;u<n.length;u++){let f=n[u].match(s);if(f!==null&&f[2]===i)if(o===-1){if(f[1]!=="BEGIN")break;o=u}else{if(f[1]!=="END")break;a=u;break}}if(o===-1||a===-1)throw new Error("PEM section not found for: "+i);let c=n.slice(o+1,a).join("");c.replace(/[^a-z0-9+/=]+/gi,"");let l=sF.from(c,"base64");return bm.prototype.decode.call(this,l,t)}});var Sm=A(f1=>{"use strict";var p1=f1;p1.der=_m();p1.pem=u1()});var h1=A(d1=>{"use strict";var oF=ym(),aF=Sm(),cF=Yn(),lF=d1;lF.define=function(e,t){return new zs(e,t)};function zs(r,e){this.name=r,this.body=e,this.decoders={},this.encoders={}}zs.prototype._createNamed=function(e){let t=this.name;function n(i){this._initNamed(i,t)}return cF(n,e),n.prototype._initNamed=function(s,o){e.call(this,s,o)},new n(this)};zs.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(aF[e])),this.decoders[e]};zs.prototype.decode=function(e,t,n){return this._getDecoder(t).decode(e,n)};zs.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(oF[e])),this.encoders[e]};zs.prototype.encode=function(e,t,n){return this._getEncoder(t).encode(e,n)}});var g1=A(m1=>{"use strict";var uu=m1;uu.Reporter=ou().Reporter;uu.DecoderBuffer=Gs().DecoderBuffer;uu.EncoderBuffer=Gs().EncoderBuffer;uu.Node=cu()});var x1=A(y1=>{"use strict";var v1=y1;v1._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};v1.der=lu()});var b1=A(_1=>{"use strict";var Vs=_1;Vs.bignum=lm();Vs.define=h1().define;Vs.base=g1();Vs.constants=x1();Vs.decoders=Sm();Vs.encoders=ym()});var Ks=A((Em,S1)=>{var pu=require("buffer"),Xr=pu.Buffer;function w1(r,e){for(var t in r)e[t]=r[t]}Xr.from&&Xr.alloc&&Xr.allocUnsafe&&Xr.allocUnsafeSlow?S1.exports=pu:(w1(pu,Em),Em.Buffer=Ti);function Ti(r,e,t){return Xr(r,e,t)}Ti.prototype=Object.create(Xr.prototype);w1(Xr,Ti);Ti.from=function(r,e,t){if(typeof r=="number")throw new TypeError("Argument must not be a number");return Xr(r,e,t)};Ti.alloc=function(r,e,t){if(typeof r!="number")throw new TypeError("Argument must be a number");var n=Xr(r);return e!==void 0?typeof t=="string"?n.fill(e,t):n.fill(e):n.fill(0),n};Ti.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return Xr(r)};Ti.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return pu.SlowBuffer(r)}});var Tm=A((mz,E1)=>{var fu=Ks().Buffer,uF=require("stream"),pF=require("util");function du(r){if(this.buffer=null,this.writable=!0,this.readable=!0,!r)return this.buffer=fu.alloc(0),this;if(typeof r.pipe=="function")return this.buffer=fu.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+")")}pF.inherits(du,uF);du.prototype.write=function(e){this.buffer=fu.concat([this.buffer,fu.from(e)]),this.emit("data",e)};du.prototype.end=function(e){e&&this.write(e),this.emit("end",e),this.emit("close"),this.writable=!1,this.readable=!1};E1.exports=du});var C1=A((gz,T1)=>{"use strict";function Cm(r){var e=(r/8|0)+(r%8===0?0:1);return e}var fF={ES256:Cm(256),ES384:Cm(384),ES512:Cm(521)};function dF(r){var e=fF[r];if(e)return e;throw new Error('Unknown algorithm "'+r+'"')}T1.exports=dF});var I1=A((vz,P1)=>{"use strict";var hu=Ks().Buffer,A1=C1(),mu=128,R1=0,hF=32,mF=16,gF=2,O1=mF|hF|R1<<6,gu=gF|R1<<6;function vF(r){return r.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function M1(r){if(hu.isBuffer(r))return r;if(typeof r=="string")return hu.from(r,"base64");throw new TypeError("ECDSA signature must be a Base64 string or a Buffer")}function yF(r,e){r=M1(r);var t=A1(e),n=t+1,i=r.length,s=0;if(r[s++]!==O1)throw new Error('Could not find expected "seq"');var o=r[s++];if(o===(mu|1)&&(o=r[s++]),i-s<o)throw new Error('"seq" specified length of "'+o+'", only "'+(i-s)+'" remaining');if(r[s++]!==gu)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++]!==gu)throw new Error('Could not find expected "int" for "s"');var l=r[s++];if(i-s!==l)throw new Error('"s" specified length of "'+l+'", expected "'+(i-s)+'"');if(n<l)throw new Error('"s" specified length of "'+l+'", max of "'+n+'" is acceptable');var u=s;if(s+=l,s!==i)throw new Error('Expected to consume entire buffer, but "'+(i-s)+'" bytes remain');var f=t-a,d=t-l,g=hu.allocUnsafe(f+a+d+l);for(s=0;s<f;++s)g[s]=0;r.copy(g,s,c+Math.max(-f,0),c+a),s=t;for(var y=s;s<y+d;++s)g[s]=0;return r.copy(g,s,u+Math.max(-d,0),u+l),g=g.toString("base64"),g=vF(g),g}function k1(r,e,t){for(var n=0;e+n<t&&r[e+n]===0;)++n;var i=r[e+n]>=mu;return i&&--n,n}function xF(r,e){r=M1(r);var t=A1(e),n=r.length;if(n!==t*2)throw new TypeError('"'+e+'" signatures must be "'+t*2+'" bytes, saw "'+n+'"');var i=k1(r,0,t),s=k1(r,t,r.length),o=t-i,a=t-s,c=2+o+1+1+a,l=c<mu,u=hu.allocUnsafe((l?2:3)+c),f=0;return u[f++]=O1,l?u[f++]=c:(u[f++]=mu|1,u[f++]=c&255),u[f++]=gu,u[f++]=o,i<0?(u[f++]=0,f+=r.copy(u,f,0,t)):f+=r.copy(u,f,i,t),u[f++]=gu,u[f++]=a,s<0?(u[f++]=0,r.copy(u,f,t)):r.copy(u,f,t+s),u}P1.exports={derToJose:yF,joseToDer:xF}});var D1=A((yz,N1)=>{"use strict";var fa=require("buffer").Buffer,km=require("buffer").SlowBuffer;N1.exports=vu;function vu(r,e){if(!fa.isBuffer(r)||!fa.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}vu.install=function(){fa.prototype.equal=km.prototype.equal=function(e){return vu(this,e)}};var _F=fa.prototype.equal,bF=km.prototype.equal;vu.restore=function(){fa.prototype.equal=_F,km.prototype.equal=bF}});var Mm=A((xz,W1)=>{var Xs=Ks().Buffer,_r=require("crypto"),B1=I1(),L1=require("util"),wF=`"%s" is not a valid algorithm.
|
|
96
96
|
Supported algorithms are:
|
|
97
|
-
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,da="secret must be a string or buffer",Ys="key must be a string or a buffer",vF="key must be a string, a buffer or an object",Cm=typeof _r.createPublicKey=="function";Cm&&(Ys+=" or a KeyObject",da+="or a KeyObject");function I1(r){if(!Xs.isBuffer(r)&&typeof r!="string"&&(!Cm||typeof r!="object"||typeof r.type!="string"||typeof r.asymmetricKeyType!="string"||typeof r.export!="function"))throw Nr(Ys)}function N1(r){if(!Xs.isBuffer(r)&&typeof r!="string"&&typeof r!="object")throw Nr(vF)}function yF(r){if(!Xs.isBuffer(r)){if(typeof r=="string")return r;if(!Cm||typeof r!="object"||r.type!=="secret"||typeof r.export!="function")throw Nr(da)}}function Am(r){return r.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function D1(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 Nr(r){var e=[].slice.call(arguments,1),t=M1.format.bind(M1,r).apply(null,e);return new TypeError(t)}function xF(r){return Xs.isBuffer(r)||typeof r=="string"}function ha(r){return xF(r)||(r=JSON.stringify(r)),r}function L1(r){return function(t,n){yF(n),t=ha(t);var i=_r.createHmac("sha"+r,n),s=(i.update(t),i.digest("base64"));return Am(s)}}var Tm,_F="timingSafeEqual"in _r?function(e,t){return e.byteLength!==t.byteLength?!1:_r.timingSafeEqual(e,t)}:function(e,t){return Tm||(Tm=O1()),Tm(e,t)};function bF(r){return function(t,n,i){var s=L1(r)(t,i);return _F(Xs.from(n),Xs.from(s))}}function B1(r){return function(t,n){N1(n),t=ha(t);var i=_r.createSign("RSA-SHA"+r),s=(i.update(t),i.sign(n,"base64"));return Am(s)}}function j1(r){return function(t,n,i){I1(i),t=ha(t),n=D1(n);var s=_r.createVerify("RSA-SHA"+r);return s.update(t),s.verify(i,n,"base64")}}function wF(r){return function(t,n){N1(n),t=ha(t);var i=_r.createSign("RSA-SHA"+r),s=(i.update(t),i.sign({key:n,padding:_r.constants.RSA_PKCS1_PSS_PADDING,saltLength:_r.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Am(s)}}function SF(r){return function(t,n,i){I1(i),t=ha(t),n=D1(n);var s=_r.createVerify("RSA-SHA"+r);return s.update(t),s.verify({key:i,padding:_r.constants.RSA_PKCS1_PSS_PADDING,saltLength:_r.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function EF(r){var e=B1(r);return function(){var n=e.apply(null,arguments);return n=P1.derToJose(n,"ES"+r),n}}function TF(r){var e=j1(r);return function(n,i,s){i=P1.joseToDer(i,"ES"+r).toString("base64");var o=e(n,i,s);return o}}function CF(){return function(){return""}}function AF(){return function(e,t){return t===""}}F1.exports=function(e){var t={hs:L1,rs:B1,ps:wF,es:EF,none:CF},n={hs:bF,rs:j1,ps:SF,es:TF,none:AF},i=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw Nr(gF,e);var s=(i[1]||i[3]).toLowerCase(),o=i[2];return{sign:t[s](o),verify:n[s](o)}}});var Rm=k((hz,U1)=>{var kF=require("buffer").Buffer;U1.exports=function(e){return typeof e=="string"?e:typeof e=="number"||kF.isBuffer(e)?e.toString():JSON.stringify(e)}});var z1=k((mz,G1)=>{var RF=Ks().Buffer,q1=wm(),OF=km(),MF=require("stream"),$1=Rm(),Om=require("util");function H1(r,e){return RF.from(r,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function PF(r,e,t){t=t||"utf8";var n=H1($1(r),"binary"),i=H1($1(e),t);return Om.format("%s.%s",n,i)}function W1(r){var e=r.header,t=r.payload,n=r.secret||r.privateKey,i=r.encoding,s=OF(e.alg),o=PF(e,t,i),a=s.sign(o,n);return Om.format("%s.%s",o,a)}function yu(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 q1(e);this.readable=!0,this.header=r.header,this.encoding=r.encoding,this.secret=this.privateKey=this.key=t,this.payload=new q1(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))}Om.inherits(yu,MF);yu.prototype.sign=function(){try{var e=W1({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")}};yu.sign=W1;G1.exports=yu});var rT=k((gz,tT)=>{var K1=Ks().Buffer,V1=wm(),IF=km(),NF=require("stream"),Y1=Rm(),DF=require("util"),LF=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function BF(r){return Object.prototype.toString.call(r)==="[object Object]"}function jF(r){if(BF(r))return r;try{return JSON.parse(r)}catch{return}}function X1(r){var e=r.split(".",1)[0];return jF(K1.from(e,"base64").toString("binary"))}function FF(r){return r.split(".",2).join(".")}function J1(r){return r.split(".")[2]}function UF(r,e){e=e||"utf8";var t=r.split(".")[1];return K1.from(t,"base64").toString(e)}function Z1(r){return LF.test(r)&&!!X1(r)}function Q1(r,e,t){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}r=Y1(r);var i=J1(r),s=FF(r),o=IF(e);return o.verify(s,i,t)}function eT(r,e){if(e=e||{},r=Y1(r),!Z1(r))return null;var t=X1(r);if(!t)return null;var n=UF(r);return(t.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:t,payload:n,signature:J1(r)}}function Js(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 V1(e);this.readable=!0,this.algorithm=r.algorithm,this.encoding=r.encoding,this.secret=this.publicKey=this.key=t,this.signature=new V1(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))}DF.inherits(Js,NF);Js.prototype.verify=function(){try{var e=Q1(this.signature.buffer,this.algorithm,this.key.buffer),t=eT(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")}};Js.decode=eT;Js.isValid=Z1;Js.verify=Q1;tT.exports=Js});var iT=k(Xn=>{var nT=z1(),xu=rT(),qF=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Xn.ALGORITHMS=qF;Xn.sign=nT.sign;Xn.verify=xu.verify;Xn.decode=xu.decode;Xn.isValid=xu.isValid;Xn.createSign=function(e){return new nT(e)};Xn.createVerify=function(e){return new xu(e)}});var _u=k((yz,sT)=>{"use strict";var Mm={};Mm.supportedContentEncodings={AES_GCM:"aesgcm",AES_128_GCM:"aes128gcm"};Mm.supportedUrgency={VERY_LOW:"very-low",LOW:"low",NORMAL:"normal",HIGH:"high"};sT.exports=Mm});var Pm=k((xz,oT)=>{"use strict";function $F(r){return/^[A-Za-z0-9\-_]+$/.test(r)}oT.exports={validate:$F}});var Nm=k((_z,hT)=>{"use strict";var HF=require("crypto"),WF=g1(),GF=iT(),{URL:cT}=require("url"),aT=_u(),lT=Pm(),zF=720*60,VF=1440*60,KF=WF.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 YF(r){return KF.encode({version:1,privateKey:r,parameters:[1,2,840,10045,3,1,7]},"pem",{label:"EC PRIVATE KEY"})}function XF(){let r=HF.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 uT(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 cT(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 pT(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(!lT.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 fT(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(!lT.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 Im(r){let e=new Date;return e.setSeconds(e.getSeconds()+r),Math.floor(e.getTime()/1e3)}function dT(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=Im(VF);if(r>=e)throw new Error("`expiration` value is greater than maximum of 24 hours")}function JF(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 cT(r)}catch{throw new Error("VAPID audience is not a url. "+r)}uT(e),pT(t),fT(n),n=Buffer.from(n,"base64url"),s?dT(s):s=Im(zF);let o={typ:"JWT",alg:"ES256"},a={aud:r,exp:s,sub:e},c=GF.sign({header:o,payload:a,privateKey:YF(n)});if(i===aT.supportedContentEncodings.AES_128_GCM)return{Authorization:"vapid t="+c+", k="+t};if(i===aT.supportedContentEncodings.AES_GCM)return{Authorization:"WebPush "+c,"Crypto-Key":"p256ecdsa="+t};throw new Error("Unsupported encoding type specified.")}hT.exports={generateVAPIDKeys:XF,getFutureExpirationTimestamp:Im,getVapidHeaders:JF,validateSubject:uT,validatePublicKey:pT,validatePrivateKey:fT,validateExpiration:dT}});var TT=k((bz,ET)=>{"use strict";var wu=require("crypto"),gT="aes-128-gcm",Su={aes128gcm:1,aesgcm:2},Ci=16,Xr=16,ZF=12,vT=32,ma="encrypt",ga="decrypt",ge;process.env.ECE_KEYLOG==="1"?ge=function(r,e){return console.warn(r+" ["+e.length+"]: "+e.toString("base64url")),e}:ge=function(r,e){return e};function bu(r){return typeof r=="string"?Buffer.from(r,"base64url"):r}function yT(r,e){var t=wu.createHmac("sha256",r);return t.update(e),t.digest()}function xT(r,e){return ge("salt",r),ge("ikm",e),ge("extract",yT(r,e))}function Dm(r,e,t){ge("prk",r),ge("info",e);var n=Buffer.alloc(0),i=Buffer.alloc(0);e=Buffer.from(e,"ascii");for(var s=0,o=Buffer.alloc(1);n.length<t;)o.writeUIntBE(++s,0,1),i=yT(r,Buffer.concat([i,e,o])),n=Buffer.concat([n,i]);return ge("expand",n.slice(0,t))}function _T(r,e,t,n){return Dm(xT(r,e),t,n)}function Lm(r,e){var t=Buffer.concat([Buffer.from("Content-Encoding: "+r+"\0","ascii"),e]);return ge("info "+r,t),t}function mT(r){var e=Buffer.concat([Buffer.alloc(2),r]);return e.writeUIntBE(r.length,0,2),e}function QF(r,e){var t=r.privateKey,n,i;if(e===ma)n=t.getPublicKey(),i=r.dh;else if(e===ga)n=r.dh,i=t.getPublicKey();else throw new Error("Unknown mode only "+ma+" and "+ga+" supported");return{secret:t.computeSecret(r.dh),context:Buffer.concat([Buffer.from(r.keylabel,"ascii"),Buffer.from([0]),mT(i),mT(n)])}}function e3(r,e){var t={secret:null,context:Buffer.alloc(0)};if(r.key){if(t.secret=r.key,t.secret.length!==Xr)throw new Error("An explicit key must be "+Xr+" bytes")}else r.dh?t=QF(r,e):typeof r.keyid!==void 0&&(t.secret=r.keymap[r.keyid]);if(!t.secret)throw new Error("Unable to determine key");return ge("secret",t.secret),ge("context",t.context),r.authSecret&&(t.secret=_T(r.authSecret,t.secret,Lm("auth",Buffer.alloc(0)),vT),ge("authsecret",t.secret)),t}function t3(r,e){if(!r.authSecret)throw new Error("No authentication secret for webpush");ge("authsecret",r.authSecret);var t,n,i;if(e===ma)n=r.privateKey.getPublicKey(),t=i=r.dh;else if(e===ga)t=n=r.keyid,i=r.privateKey.getPublicKey();else throw new Error("Unknown mode only "+ma+" and "+ga+" supported");return ge("remote pubkey",t),ge("sender pubkey",n),ge("receiver pubkey",i),ge("secret dh",_T(r.authSecret,r.privateKey.computeSecret(t),Buffer.concat([Buffer.from("WebPush: info\0"),i,n]),vT))}function r3(r,e,t){if(t&&!p3(t))throw new Error("Callback is not a function");if(r.key){if(r.key.length!==Xr)throw new Error("An explicit key must be "+Xr+" bytes");return ge("secret key",r.key)}if(!r.privateKey){if(t)var n=t(r.keyid);else var n=r.keymap&&r.keymap[r.keyid];if(!n)throw new Error('No saved key (keyid: "'+r.keyid+'")');return n}return t3(r,e)}function bT(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=e3(r,e,t);n=Lm("aesgcm",o.context),i=Lm("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=r3(r,e,t);else throw new Error("Unable to set context for mode "+r.version);var a=xT(r.salt,s),c={key:Dm(a,n,Xr),nonce:Dm(a,i,ZF)};return ge("key",c.key),ge("nonce base",c.nonce),c}function wT(r){var e={};e.version=r.version||"aes128gcm",e.rs=parseInt(r.rs,10),isNaN(e.rs)&&(e.rs=4096);var t=Su[e.version];if(e.version==="aes128gcm"&&(t+=Ci),e.rs<=t)throw new Error("The rs parameter has to be greater than "+t);if(r.salt&&(e.salt=bu(r.salt),e.salt.length!==Xr))throw new Error("The salt parameter must be "+Xr+" bytes");return e.keyid=r.keyid,r.key?e.key=bu(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=bu(r.dh))),r.authSecret&&(e.authSecret=bu(r.authSecret)),e}function ST(r,e){var t=Buffer.from(r),n=t.readUIntBE(t.length-6,6),i=((n^e)&16777215)+((n/16777216^e/16777216)&16777215)*16777216;return t.writeUIntBE(i,t.length-6,6),ge("nonce"+e,t),t}function n3(r,e){var t=r.readUIntBE(20,1);return e.salt=r.slice(0,Xr),e.rs=r.readUIntBE(Xr,4),e.keyid=r.slice(21,21+t),21+t}function i3(r,e){var t=Su[e],n=r.readUIntBE(0,t);if(n+t>r.length)throw new Error("padding exceeds block size");ge("padding",r.slice(0,t+n));var i=Buffer.alloc(n);if(i.fill(0),i.compare(r.slice(t,t+n))!==0)throw new Error("invalid padding");return r.slice(t+n)}function s3(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 o3(r,e,t,n,i){ge("decrypt",t);var s=ST(r.nonce,e),o=wu.createDecipheriv(gT,r.key,s);o.setAuthTag(t.slice(t.length-Ci));var a=o.update(t.slice(0,t.length-Ci));return a=Buffer.concat([a,o.final()]),ge("decrypted",a),n.version!=="aes128gcm"?i3(a,n.version):s3(a,i)}function a3(r,e,t){var n=wT(e);if(n.version==="aes128gcm"){var i=n3(r,n);r=r.slice(i)}var s=bT(n,ga,t),o=0,a=Buffer.alloc(0),c=n.rs;n.version!=="aes128gcm"&&(c+=Ci);for(var l=0;o<r.length;++l){var u=o+c;if(n.version!=="aes128gcm"&&u===r.length)throw new Error("Truncated payload");if(u=Math.min(u,r.length),u-o<=Ci)throw new Error("Invalid block: too small at "+l);var f=o3(s,l,r.slice(o,u),n,u>=r.length);a=Buffer.concat([a,f]),o=u}return a}function c3(r,e,t,n,i,s){ge("encrypt",t),n=n||0;var o=ST(r.nonce,e),a=wu.createCipheriv(gT,r.key,o),c=[],l=Su[i.version],u=Buffer.alloc(n+l);if(u.fill(0),i.version!=="aes128gcm"){if(u.writeUIntBE(n,0,l),ge("padding",u),c.push(a.update(u)),c.push(a.update(t)),!s&&u.length+t.length<i.rs)throw new Error("Unable to pad to record size")}else c.push(a.update(t)),u.writeUIntBE(s?2:1,0,1),ge("padding",u),c.push(a.update(u));a.final();var f=a.getAuthTag();if(f.length!==Ci)throw new Error("invalid tag generated");return c.push(f),ge("encrypted",Buffer.concat(c))}function l3(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 u3(r,e,t){if(!Buffer.isBuffer(r))throw new Error("buffer argument must be a Buffer");var n=wT(e);n.salt||(n.salt=wu.randomBytes(Xr));var i;n.version==="aes128gcm"?(n.privateKey&&!n.keyid&&(n.keyid=n.privateKey.getPublicKey()),i=l3(n)):i=Buffer.alloc(0);var s=bT(n,ma,t),o=0,a=Su[n.version],c=a;n.version==="aes128gcm"&&(c+=Ci);for(var l=isNaN(parseInt(e.pad,10))?0:parseInt(e.pad,10),u=0,f=!1;!f;){var d=Math.min(n.rs-c-1,l);n.version!=="aes128gcm"&&(d=Math.min((1<<a*8)-1,d)),l>0&&d===0&&++d,l-=d;var g=o+n.rs-c-d;n.version!=="aes128gcm"?f=g>r.length:f=g>=r.length,f=f&&l<=0;var y=c3(s,u,r.slice(o,g),d,n,f);i=Buffer.concat([i,y]),o=g,++u}return i}function p3(r){return typeof r=="function"}ET.exports={decrypt:a3,encrypt:u3}});var Bm=k((wz,AT)=>{"use strict";var CT=require("crypto"),f3=TT(),d3=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=CT.createECDH("prime256v1"),s=i.generateKeys(),o=CT.randomBytes(16).toString("base64url"),a=f3.encrypt(t,{version:n,dh:r,privateKey:i,salt:o,authSecret:e});return{localPublicKey:s,salt:o,cipherText:a}};AT.exports={encrypt:d3}});var jm=k((Sz,RT)=>{"use strict";function kT(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(kT,Error);RT.exports=kT});var PT=k(Gt=>{"use strict";var h3=Gt&&Gt.__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]})),m3=Gt&&Gt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),OT=Gt&&Gt.__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)&&h3(e,r,t);return m3(e,r),e};Object.defineProperty(Gt,"__esModule",{value:!0});Gt.req=Gt.json=Gt.toBuffer=void 0;var g3=OT(require("http")),v3=OT(require("https"));async function MT(r){let e=0,t=[];for await(let n of r)e+=n.length,t.push(n);return Buffer.concat(t,e)}Gt.toBuffer=MT;async function y3(r){let t=(await MT(r)).toString("utf8");try{return JSON.parse(t)}catch(n){let i=n;throw i.message+=` (input: ${t})`,i}}Gt.json=y3;function x3(r,e={}){let n=((typeof r=="string"?r:r.href).startsWith("https:")?v3:g3).request(r,e),i=new Promise((s,o)=>{n.once("response",s).once("error",o).end()});return n.then=i.then.bind(i),n}Gt.req=x3});var LT=k(rr=>{"use strict";var NT=rr&&rr.__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]})),_3=rr&&rr.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),DT=rr&&rr.__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)&&NT(e,r,t);return _3(e,r),e},b3=rr&&rr.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&NT(e,r,t)};Object.defineProperty(rr,"__esModule",{value:!0});rr.Agent=void 0;var w3=DT(require("net")),IT=DT(require("http")),S3=require("https");b3(PT(),rr);var Jr=Symbol("AgentBaseInternalState"),Fm=class extends IT.Agent{constructor(e){super(e),this[Jr]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:t}=new Error;return typeof t!="string"?!1:t.split(`
|
|
98
|
-
`).some(n=>n.indexOf("(https.js:")!==-1||n.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let t=new
|
|
97
|
+
"HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "ES256", "ES384", "ES512" and "none".`,da="secret must be a string or buffer",Ys="key must be a string or a buffer",SF="key must be a string, a buffer or an object",Rm=typeof _r.createPublicKey=="function";Rm&&(Ys+=" or a KeyObject",da+="or a KeyObject");function j1(r){if(!Xs.isBuffer(r)&&typeof r!="string"&&(!Rm||typeof r!="object"||typeof r.type!="string"||typeof r.asymmetricKeyType!="string"||typeof r.export!="function"))throw Nr(Ys)}function F1(r){if(!Xs.isBuffer(r)&&typeof r!="string"&&typeof r!="object")throw Nr(SF)}function EF(r){if(!Xs.isBuffer(r)){if(typeof r=="string")return r;if(!Rm||typeof r!="object"||r.type!=="secret"||typeof r.export!="function")throw Nr(da)}}function Om(r){return r.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function U1(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 Nr(r){var e=[].slice.call(arguments,1),t=L1.format.bind(L1,r).apply(null,e);return new TypeError(t)}function TF(r){return Xs.isBuffer(r)||typeof r=="string"}function ha(r){return TF(r)||(r=JSON.stringify(r)),r}function q1(r){return function(t,n){EF(n),t=ha(t);var i=_r.createHmac("sha"+r,n),s=(i.update(t),i.digest("base64"));return Om(s)}}var Am,CF="timingSafeEqual"in _r?function(e,t){return e.byteLength!==t.byteLength?!1:_r.timingSafeEqual(e,t)}:function(e,t){return Am||(Am=D1()),Am(e,t)};function kF(r){return function(t,n,i){var s=q1(r)(t,i);return CF(Xs.from(n),Xs.from(s))}}function $1(r){return function(t,n){F1(n),t=ha(t);var i=_r.createSign("RSA-SHA"+r),s=(i.update(t),i.sign(n,"base64"));return Om(s)}}function H1(r){return function(t,n,i){j1(i),t=ha(t),n=U1(n);var s=_r.createVerify("RSA-SHA"+r);return s.update(t),s.verify(i,n,"base64")}}function AF(r){return function(t,n){F1(n),t=ha(t);var i=_r.createSign("RSA-SHA"+r),s=(i.update(t),i.sign({key:n,padding:_r.constants.RSA_PKCS1_PSS_PADDING,saltLength:_r.constants.RSA_PSS_SALTLEN_DIGEST},"base64"));return Om(s)}}function RF(r){return function(t,n,i){j1(i),t=ha(t),n=U1(n);var s=_r.createVerify("RSA-SHA"+r);return s.update(t),s.verify({key:i,padding:_r.constants.RSA_PKCS1_PSS_PADDING,saltLength:_r.constants.RSA_PSS_SALTLEN_DIGEST},n,"base64")}}function OF(r){var e=$1(r);return function(){var n=e.apply(null,arguments);return n=B1.derToJose(n,"ES"+r),n}}function MF(r){var e=H1(r);return function(n,i,s){i=B1.joseToDer(i,"ES"+r).toString("base64");var o=e(n,i,s);return o}}function PF(){return function(){return""}}function IF(){return function(e,t){return t===""}}W1.exports=function(e){var t={hs:q1,rs:$1,ps:AF,es:OF,none:PF},n={hs:kF,rs:H1,ps:RF,es:MF,none:IF},i=e.match(/^(RS|PS|ES|HS)(256|384|512)$|^(none)$/);if(!i)throw Nr(wF,e);var s=(i[1]||i[3]).toLowerCase(),o=i[2];return{sign:t[s](o),verify:n[s](o)}}});var Pm=A((_z,G1)=>{var NF=require("buffer").Buffer;G1.exports=function(e){return typeof e=="string"?e:typeof e=="number"||NF.isBuffer(e)?e.toString():JSON.stringify(e)}});var J1=A((bz,X1)=>{var DF=Ks().Buffer,z1=Tm(),LF=Mm(),BF=require("stream"),V1=Pm(),Im=require("util");function K1(r,e){return DF.from(r,e).toString("base64").replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function jF(r,e,t){t=t||"utf8";var n=K1(V1(r),"binary"),i=K1(V1(e),t);return Im.format("%s.%s",n,i)}function Y1(r){var e=r.header,t=r.payload,n=r.secret||r.privateKey,i=r.encoding,s=LF(e.alg),o=jF(e,t,i),a=s.sign(o,n);return Im.format("%s.%s",o,a)}function yu(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 z1(e);this.readable=!0,this.header=r.header,this.encoding=r.encoding,this.secret=this.privateKey=this.key=t,this.payload=new z1(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))}Im.inherits(yu,BF);yu.prototype.sign=function(){try{var e=Y1({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")}};yu.sign=Y1;X1.exports=yu});var aT=A((wz,oT)=>{var Q1=Ks().Buffer,Z1=Tm(),FF=Mm(),UF=require("stream"),eT=Pm(),qF=require("util"),$F=/^[a-zA-Z0-9\-_]+?\.[a-zA-Z0-9\-_]+?\.([a-zA-Z0-9\-_]+)?$/;function HF(r){return Object.prototype.toString.call(r)==="[object Object]"}function WF(r){if(HF(r))return r;try{return JSON.parse(r)}catch{return}}function tT(r){var e=r.split(".",1)[0];return WF(Q1.from(e,"base64").toString("binary"))}function GF(r){return r.split(".",2).join(".")}function rT(r){return r.split(".")[2]}function zF(r,e){e=e||"utf8";var t=r.split(".")[1];return Q1.from(t,"base64").toString(e)}function nT(r){return $F.test(r)&&!!tT(r)}function iT(r,e,t){if(!e){var n=new Error("Missing algorithm parameter for jws.verify");throw n.code="MISSING_ALGORITHM",n}r=eT(r);var i=rT(r),s=GF(r),o=FF(e);return o.verify(s,i,t)}function sT(r,e){if(e=e||{},r=eT(r),!nT(r))return null;var t=tT(r);if(!t)return null;var n=zF(r);return(t.typ==="JWT"||e.json)&&(n=JSON.parse(n,e.encoding)),{header:t,payload:n,signature:rT(r)}}function Js(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 Z1(e);this.readable=!0,this.algorithm=r.algorithm,this.encoding=r.encoding,this.secret=this.publicKey=this.key=t,this.signature=new Z1(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))}qF.inherits(Js,UF);Js.prototype.verify=function(){try{var e=iT(this.signature.buffer,this.algorithm,this.key.buffer),t=sT(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")}};Js.decode=sT;Js.isValid=nT;Js.verify=iT;oT.exports=Js});var lT=A(Xn=>{var cT=J1(),xu=aT(),VF=["HS256","HS384","HS512","RS256","RS384","RS512","PS256","PS384","PS512","ES256","ES384","ES512"];Xn.ALGORITHMS=VF;Xn.sign=cT.sign;Xn.verify=xu.verify;Xn.decode=xu.decode;Xn.isValid=xu.isValid;Xn.createSign=function(e){return new cT(e)};Xn.createVerify=function(e){return new xu(e)}});var _u=A((Ez,uT)=>{"use strict";var Nm={};Nm.supportedContentEncodings={AES_GCM:"aesgcm",AES_128_GCM:"aes128gcm"};Nm.supportedUrgency={VERY_LOW:"very-low",LOW:"low",NORMAL:"normal",HIGH:"high"};uT.exports=Nm});var Dm=A((Tz,pT)=>{"use strict";function KF(r){return/^[A-Za-z0-9\-_]+$/.test(r)}pT.exports={validate:KF}});var Bm=A((Cz,xT)=>{"use strict";var YF=require("crypto"),XF=b1(),JF=lT(),{URL:dT}=require("url"),fT=_u(),hT=Dm(),ZF=720*60,QF=1440*60,e3=XF.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 t3(r){return e3.encode({version:1,privateKey:r,parameters:[1,2,840,10045,3,1,7]},"pem",{label:"EC PRIVATE KEY"})}function r3(){let r=YF.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 mT(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 dT(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 gT(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(!hT.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 vT(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(!hT.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 Lm(r){let e=new Date;return e.setSeconds(e.getSeconds()+r),Math.floor(e.getTime()/1e3)}function yT(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=Lm(QF);if(r>=e)throw new Error("`expiration` value is greater than maximum of 24 hours")}function n3(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 dT(r)}catch{throw new Error("VAPID audience is not a url. "+r)}mT(e),gT(t),vT(n),n=Buffer.from(n,"base64url"),s?yT(s):s=Lm(ZF);let o={typ:"JWT",alg:"ES256"},a={aud:r,exp:s,sub:e},c=JF.sign({header:o,payload:a,privateKey:t3(n)});if(i===fT.supportedContentEncodings.AES_128_GCM)return{Authorization:"vapid t="+c+", k="+t};if(i===fT.supportedContentEncodings.AES_GCM)return{Authorization:"WebPush "+c,"Crypto-Key":"p256ecdsa="+t};throw new Error("Unsupported encoding type specified.")}xT.exports={generateVAPIDKeys:r3,getFutureExpirationTimestamp:Lm,getVapidHeaders:n3,validateSubject:mT,validatePublicKey:gT,validatePrivateKey:vT,validateExpiration:yT}});var OT=A((kz,RT)=>{"use strict";var wu=require("crypto"),bT="aes-128-gcm",Su={aes128gcm:1,aesgcm:2},Ci=16,Jr=16,i3=12,wT=32,ma="encrypt",ga="decrypt",ve;process.env.ECE_KEYLOG==="1"?ve=function(r,e){return console.warn(r+" ["+e.length+"]: "+e.toString("base64url")),e}:ve=function(r,e){return e};function bu(r){return typeof r=="string"?Buffer.from(r,"base64url"):r}function ST(r,e){var t=wu.createHmac("sha256",r);return t.update(e),t.digest()}function ET(r,e){return ve("salt",r),ve("ikm",e),ve("extract",ST(r,e))}function jm(r,e,t){ve("prk",r),ve("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=ST(r,Buffer.concat([i,e,o])),n=Buffer.concat([n,i]);return ve("expand",n.slice(0,t))}function TT(r,e,t,n){return jm(ET(r,e),t,n)}function Fm(r,e){var t=Buffer.concat([Buffer.from("Content-Encoding: "+r+"\0","ascii"),e]);return ve("info "+r,t),t}function _T(r){var e=Buffer.concat([Buffer.alloc(2),r]);return e.writeUIntBE(r.length,0,2),e}function s3(r,e){var t=r.privateKey,n,i;if(e===ma)n=t.getPublicKey(),i=r.dh;else if(e===ga)n=r.dh,i=t.getPublicKey();else throw new Error("Unknown mode only "+ma+" and "+ga+" supported");return{secret:t.computeSecret(r.dh),context:Buffer.concat([Buffer.from(r.keylabel,"ascii"),Buffer.from([0]),_T(i),_T(n)])}}function o3(r,e){var t={secret:null,context:Buffer.alloc(0)};if(r.key){if(t.secret=r.key,t.secret.length!==Jr)throw new Error("An explicit key must be "+Jr+" bytes")}else r.dh?t=s3(r,e):typeof r.keyid!==void 0&&(t.secret=r.keymap[r.keyid]);if(!t.secret)throw new Error("Unable to determine key");return ve("secret",t.secret),ve("context",t.context),r.authSecret&&(t.secret=TT(r.authSecret,t.secret,Fm("auth",Buffer.alloc(0)),wT),ve("authsecret",t.secret)),t}function a3(r,e){if(!r.authSecret)throw new Error("No authentication secret for webpush");ve("authsecret",r.authSecret);var t,n,i;if(e===ma)n=r.privateKey.getPublicKey(),t=i=r.dh;else if(e===ga)t=n=r.keyid,i=r.privateKey.getPublicKey();else throw new Error("Unknown mode only "+ma+" and "+ga+" supported");return ve("remote pubkey",t),ve("sender pubkey",n),ve("receiver pubkey",i),ve("secret dh",TT(r.authSecret,r.privateKey.computeSecret(t),Buffer.concat([Buffer.from("WebPush: info\0"),i,n]),wT))}function c3(r,e,t){if(t&&!v3(t))throw new Error("Callback is not a function");if(r.key){if(r.key.length!==Jr)throw new Error("An explicit key must be "+Jr+" bytes");return ve("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 a3(r,e)}function CT(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=o3(r,e,t);n=Fm("aesgcm",o.context),i=Fm("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=c3(r,e,t);else throw new Error("Unable to set context for mode "+r.version);var a=ET(r.salt,s),c={key:jm(a,n,Jr),nonce:jm(a,i,i3)};return ve("key",c.key),ve("nonce base",c.nonce),c}function kT(r){var e={};e.version=r.version||"aes128gcm",e.rs=parseInt(r.rs,10),isNaN(e.rs)&&(e.rs=4096);var t=Su[e.version];if(e.version==="aes128gcm"&&(t+=Ci),e.rs<=t)throw new Error("The rs parameter has to be greater than "+t);if(r.salt&&(e.salt=bu(r.salt),e.salt.length!==Jr))throw new Error("The salt parameter must be "+Jr+" bytes");return e.keyid=r.keyid,r.key?e.key=bu(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=bu(r.dh))),r.authSecret&&(e.authSecret=bu(r.authSecret)),e}function AT(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),ve("nonce"+e,t),t}function l3(r,e){var t=r.readUIntBE(20,1);return e.salt=r.slice(0,Jr),e.rs=r.readUIntBE(Jr,4),e.keyid=r.slice(21,21+t),21+t}function u3(r,e){var t=Su[e],n=r.readUIntBE(0,t);if(n+t>r.length)throw new Error("padding exceeds block size");ve("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 p3(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 f3(r,e,t,n,i){ve("decrypt",t);var s=AT(r.nonce,e),o=wu.createDecipheriv(bT,r.key,s);o.setAuthTag(t.slice(t.length-Ci));var a=o.update(t.slice(0,t.length-Ci));return a=Buffer.concat([a,o.final()]),ve("decrypted",a),n.version!=="aes128gcm"?u3(a,n.version):p3(a,i)}function d3(r,e,t){var n=kT(e);if(n.version==="aes128gcm"){var i=l3(r,n);r=r.slice(i)}var s=CT(n,ga,t),o=0,a=Buffer.alloc(0),c=n.rs;n.version!=="aes128gcm"&&(c+=Ci);for(var l=0;o<r.length;++l){var u=o+c;if(n.version!=="aes128gcm"&&u===r.length)throw new Error("Truncated payload");if(u=Math.min(u,r.length),u-o<=Ci)throw new Error("Invalid block: too small at "+l);var f=f3(s,l,r.slice(o,u),n,u>=r.length);a=Buffer.concat([a,f]),o=u}return a}function h3(r,e,t,n,i,s){ve("encrypt",t),n=n||0;var o=AT(r.nonce,e),a=wu.createCipheriv(bT,r.key,o),c=[],l=Su[i.version],u=Buffer.alloc(n+l);if(u.fill(0),i.version!=="aes128gcm"){if(u.writeUIntBE(n,0,l),ve("padding",u),c.push(a.update(u)),c.push(a.update(t)),!s&&u.length+t.length<i.rs)throw new Error("Unable to pad to record size")}else c.push(a.update(t)),u.writeUIntBE(s?2:1,0,1),ve("padding",u),c.push(a.update(u));a.final();var f=a.getAuthTag();if(f.length!==Ci)throw new Error("invalid tag generated");return c.push(f),ve("encrypted",Buffer.concat(c))}function m3(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 g3(r,e,t){if(!Buffer.isBuffer(r))throw new Error("buffer argument must be a Buffer");var n=kT(e);n.salt||(n.salt=wu.randomBytes(Jr));var i;n.version==="aes128gcm"?(n.privateKey&&!n.keyid&&(n.keyid=n.privateKey.getPublicKey()),i=m3(n)):i=Buffer.alloc(0);var s=CT(n,ma,t),o=0,a=Su[n.version],c=a;n.version==="aes128gcm"&&(c+=Ci);for(var l=isNaN(parseInt(e.pad,10))?0:parseInt(e.pad,10),u=0,f=!1;!f;){var d=Math.min(n.rs-c-1,l);n.version!=="aes128gcm"&&(d=Math.min((1<<a*8)-1,d)),l>0&&d===0&&++d,l-=d;var g=o+n.rs-c-d;n.version!=="aes128gcm"?f=g>r.length:f=g>=r.length,f=f&&l<=0;var y=h3(s,u,r.slice(o,g),d,n,f);i=Buffer.concat([i,y]),o=g,++u}return i}function v3(r){return typeof r=="function"}RT.exports={decrypt:d3,encrypt:g3}});var Um=A((Az,PT)=>{"use strict";var MT=require("crypto"),y3=OT(),x3=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=MT.createECDH("prime256v1"),s=i.generateKeys(),o=MT.randomBytes(16).toString("base64url"),a=y3.encrypt(t,{version:n,dh:r,privateKey:i,salt:o,authSecret:e});return{localPublicKey:s,salt:o,cipherText:a}};PT.exports={encrypt:x3}});var qm=A((Rz,NT)=>{"use strict";function IT(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(IT,Error);NT.exports=IT});var BT=A(Gt=>{"use strict";var _3=Gt&&Gt.__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]})),b3=Gt&&Gt.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),DT=Gt&&Gt.__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)&&_3(e,r,t);return b3(e,r),e};Object.defineProperty(Gt,"__esModule",{value:!0});Gt.req=Gt.json=Gt.toBuffer=void 0;var w3=DT(require("http")),S3=DT(require("https"));async function LT(r){let e=0,t=[];for await(let n of r)e+=n.length,t.push(n);return Buffer.concat(t,e)}Gt.toBuffer=LT;async function E3(r){let t=(await LT(r)).toString("utf8");try{return JSON.parse(t)}catch(n){let i=n;throw i.message+=` (input: ${t})`,i}}Gt.json=E3;function T3(r,e={}){let n=((typeof r=="string"?r:r.href).startsWith("https:")?S3:w3).request(r,e),i=new Promise((s,o)=>{n.once("response",s).once("error",o).end()});return n.then=i.then.bind(i),n}Gt.req=T3});var qT=A(rr=>{"use strict";var FT=rr&&rr.__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]})),C3=rr&&rr.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),UT=rr&&rr.__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)&&FT(e,r,t);return C3(e,r),e},k3=rr&&rr.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&FT(e,r,t)};Object.defineProperty(rr,"__esModule",{value:!0});rr.Agent=void 0;var A3=UT(require("net")),jT=UT(require("http")),R3=require("https");k3(BT(),rr);var Zr=Symbol("AgentBaseInternalState"),$m=class extends jT.Agent{constructor(e){super(e),this[Zr]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:t}=new Error;return typeof t!="string"?!1:t.split(`
|
|
98
|
+
`).some(n=>n.indexOf("(https.js:")!==-1||n.indexOf("node:https:")!==-1)}incrementSockets(e){if(this.maxSockets===1/0&&this.maxTotalSockets===1/0)return null;this.sockets[e]||(this.sockets[e]=[]);let t=new A3.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)?R3.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 jT.Agent)try{return a.addRequest(e,i)}catch(c){return n(c)}this[Zr].currentSocket=a,super.createSocket(e,t,n)},a=>{this.decrementSockets(s,o),n(a)})}createConnection(){let e=this[Zr].currentSocket;if(this[Zr].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[Zr].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[Zr]&&(this[Zr].defaultPort=e)}get protocol(){return this[Zr].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[Zr]&&(this[Zr].protocol=e)}};rr.Agent=$m});var $T=A(Zs=>{"use strict";var O3=Zs&&Zs.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Zs,"__esModule",{value:!0});Zs.parseProxyResponse=void 0;var M3=O3(Oe()),Eu=(0,M3.default)("https-proxy-agent:parse-proxy-response");function P3(r){return new Promise((e,t)=>{let n=0,i=[];function s(){let u=r.read();u?l(u):r.once("readable",s)}function o(){r.removeListener("end",a),r.removeListener("error",c),r.removeListener("readable",s)}function a(){o(),Eu("onend"),t(new Error("Proxy connection ended before receiving CONNECT response"))}function c(u){o(),Eu("onerror %o",u),t(u)}function l(u){i.push(u),n+=u.length;let f=Buffer.concat(i,n),d=f.indexOf(`\r
|
|
99
99
|
\r
|
|
100
100
|
`);if(d===-1){Eu("have not received end of HTTP headers yet..."),s();return}let g=f.slice(0,d).toString("ascii").split(`\r
|
|
101
|
-
`),y=g.shift();if(!y)return r.destroy(),t(new Error("No header received from proxy CONNECT response"));let b=y.split(" "),C=+b[1],R=b.slice(2).join(" "),
|
|
101
|
+
`),y=g.shift();if(!y)return r.destroy(),t(new Error("No header received from proxy CONNECT response"));let b=y.split(" "),C=+b[1],R=b.slice(2).join(" "),O={};for(let P of g){if(!P)continue;let B=P.indexOf(":");if(B===-1)return r.destroy(),t(new Error(`Invalid header from proxy CONNECT response: "${P}"`));let G=P.slice(0,B).toLowerCase(),F=P.slice(B+1).trimStart(),V=O[G];typeof V=="string"?O[G]=[V,F]:Array.isArray(V)?V.push(F):O[G]=F}Eu("got proxy server response: %o %o",y,O),o(),e({connect:{statusCode:C,statusText:R,headers:O},buffered:f})}r.on("error",c),r.on("end",a),s()})}Zs.parseProxyResponse=P3});var KT=A(br=>{"use strict";var I3=br&&br.__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]})),N3=br&&br.__setModuleDefault||(Object.create?(function(r,e){Object.defineProperty(r,"default",{enumerable:!0,value:e})}):function(r,e){r.default=e}),zT=br&&br.__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)&&I3(e,r,t);return N3(e,r),e},VT=br&&br.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(br,"__esModule",{value:!0});br.HttpsProxyAgent=void 0;var Tu=zT(require("net")),HT=zT(require("tls")),D3=VT(require("assert")),L3=VT(Oe()),B3=qT(),j3=require("url"),F3=$T(),va=(0,L3.default)("https-proxy-agent"),WT=r=>r.servername===void 0&&r.host&&!Tu.isIP(r.host)?{...r,servername:r.host}:r,Cu=class extends B3.Agent{constructor(e,t){super(t),this.options={path:void 0},this.proxy=typeof e=="string"?new j3.URL(e):e,this.proxyHeaders=t?.headers??{},va("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?GT(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:"?(va("Creating `tls.Socket`: %o",this.connectOpts),i=HT.connect(WT(this.connectOpts))):(va("Creating `net.Socket`: %o",this.connectOpts),i=Tu.connect(this.connectOpts));let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},o=Tu.isIPv6(t.host)?`[${t.host}]`:t.host,a=`CONNECT ${o}:${t.port} HTTP/1.1\r
|
|
102
102
|
`;if(n.username||n.password){let d=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(d).toString("base64")}`}s.Host=`${o}:${t.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let d of Object.keys(s))a+=`${d}: ${s[d]}\r
|
|
103
|
-
`;let c=(0,
|
|
104
|
-
`);let{connect:l,buffered:u}=await c;if(e.emit("proxyConnect",l),this.emit("proxyConnect",l,e),l.statusCode===200)return e.once("socket",N3),t.secureEndpoint?(va("Upgrading socket connection to TLS"),jT.connect({...UT(FT(t),"host","path","port"),socket:i})):i;i.destroy();let f=new Tu.Socket({writable:!1});return f.readable=!0,e.once("socket",d=>{va("Replaying proxy buffer for failed request"),(0,R3.default)(d.listenerCount("data")>0),d.push(u),d.push(null)}),f}};Cu.protocols=["http","https"];br.HttpsProxyAgent=Cu;function N3(r){r.resume()}function UT(r,...e){let t={},n;for(n in r)e.includes(n)||(t[n]=r[n]);return t}});var KT=k((kz,VT)=>{"use strict";var GT=require("url"),zT=require("https"),D3=jm(),Au=Nm(),L3=Bm(),nr=_u(),B3=Pm(),WT=2419200,Um="",qm;function ya(){}ya.prototype.setGCMAPIKey=function(r){if(r===null){Um=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.");Um=r};ya.prototype.setVapidDetails=function(r,e,t){if(arguments.length===1&&arguments[0]===null){qm=null;return}Au.validateSubject(r),Au.validatePublicKey(e),Au.validatePrivateKey(t),qm={subject:r,publicKey:e,privateKey:t}};ya.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=Um,i=qm,s=WT,o={},a=nr.supportedContentEncodings.AES_128_GCM,c=nr.supportedUrgency.NORMAL,l,u,f,d;if(t){let R=["headers","gcmAPIKey","vapidDetails","TTL","contentEncoding","urgency","topic","proxy","agent","timeout"],M=Object.keys(t);for(let P=0;P<M.length;P+=1){let B=M[P];if(!R.includes(B))throw new Error("'"+B+"' is an invalid option. The valid options are ['"+R.join("', '")+"'].")}if(t.headers){o=t.headers;let P=Object.keys(o).filter(function(B){return typeof t[B]<"u"});if(P.length>0)throw new Error("Duplicated headers defined ["+P.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===nr.supportedContentEncodings.AES_128_GCM||t.contentEncoding===nr.supportedContentEncodings.AES_GCM)a=t.contentEncoding;else throw new Error("Unsupported content encoding specified.");if(t.urgency)if(t.urgency===nr.supportedUrgency.VERY_LOW||t.urgency===nr.supportedUrgency.LOW||t.urgency===nr.supportedUrgency.NORMAL||t.urgency===nr.supportedUrgency.HIGH)c=t.urgency;else throw new Error("Unsupported urgency specified.");if(t.topic){if(!B3.validate(t.topic))throw new Error("Unsupported characters set use the URL or filename-safe Base64 characters set");if(t.topic.length>32)throw new Error("use maximum of 32 characters from the URL or filename-safe Base64 characters set");l=t.topic}t.proxy&&(typeof t.proxy=="string"||typeof t.proxy.host=="string"?u=t.proxy:console.warn("Attempt to use proxy option, but invalid type it should be a string or proxy options object.")),t.agent&&(t.agent instanceof zT.Agent?(u&&console.warn("Agent option will be ignored because proxy option is defined."),f=t.agent):console.warn("Wrong type for the agent option, it should be an instance of https.Agent.")),typeof t.timeout=="number"&&(d=t.timeout)}typeof s>"u"&&(s=WT);let g={method:"POST",headers:{TTL:s}};Object.keys(o).forEach(function(R){g.headers[R]=o[R]});let y=null;if(e){let R=L3.encrypt(r.keys.p256dh,r.keys.auth,e,a);g.headers["Content-Length"]=R.cipherText.length,g.headers["Content-Type"]="application/octet-stream",a===nr.supportedContentEncodings.AES_128_GCM?g.headers["Content-Encoding"]=nr.supportedContentEncodings.AES_128_GCM:a===nr.supportedContentEncodings.AES_GCM&&(g.headers["Content-Encoding"]=nr.supportedContentEncodings.AES_GCM,g.headers.Encryption="salt="+R.salt,g.headers["Crypto-Key"]="dh="+R.localPublicKey.toString("base64url")),y=R.cipherText}else g.headers["Content-Length"]=0;let b=r.endpoint.startsWith("https://android.googleapis.com/gcm/send"),C=r.endpoint.startsWith("https://fcm.googleapis.com/fcm/send");if(b)n?g.headers.Authorization="key="+n:console.warn("Attempt to send push notification to GCM endpoint, but no GCM key is defined. Please use setGCMApiKey() or add 'gcmAPIKey' as an option.");else if(i){let R=GT.parse(r.endpoint),M=R.protocol+"//"+R.host,P=Au.getVapidHeaders(M,i.subject,i.publicKey,i.privateKey,a);g.headers.Authorization=P.Authorization,a===nr.supportedContentEncodings.AES_GCM&&(g.headers["Crypto-Key"]?g.headers["Crypto-Key"]+=";"+P["Crypto-Key"]:g.headers["Crypto-Key"]=P["Crypto-Key"])}else C&&n&&(g.headers.Authorization="key="+n);return g.headers.Urgency=c,l&&(g.headers.Topic=l),g.body=y,g.endpoint=r.endpoint,u&&(g.proxy=u),f&&(g.agent=f),d&&(g.timeout=d),g};ya.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=GT.parse(n.endpoint);if(o.hostname=a.hostname,o.port=a.port,o.path=a.path,o.headers=n.headers,o.method=n.method,n.timeout&&(o.timeout=n.timeout),n.agent&&(o.agent=n.agent),n.proxy){let{HttpsProxyAgent:l}=HT();o.agent=new l(n.proxy)}let c=zT.request(o,function(l){let u="";l.on("data",function(f){u+=f}),l.on("end",function(){l.statusCode<200||l.statusCode>299?s(new D3("Received unexpected response code",l.statusCode,l.headers,u,n.endpoint)):i({statusCode:l.statusCode,body:u,headers:l.headers})})});n.timeout&&c.on("timeout",function(){c.destroy(new Error("Socket timeout"))}),c.on("error",function(l){s(l)}),n.body&&c.write(n.body),c.end()})};VT.exports=ya});var JT=k((Rz,XT)=>{"use strict";var YT=Nm(),j3=Bm(),F3=KT(),U3=jm(),q3=_u(),xa=new F3;XT.exports={WebPushError:U3,supportedContentEncodings:q3.supportedContentEncodings,encrypt:j3.encrypt,getVapidHeaders:YT.getVapidHeaders,generateVAPIDKeys:YT.generateVAPIDKeys,setGCMAPIKey:xa.setGCMAPIKey,setVapidDetails:xa.setVapidDetails,generateRequestDetails:xa.generateRequestDetails,sendNotification:xa.sendNotification.bind(xa)}});var Ea=k((fV,BC)=>{"use strict";var xU=require("path"),Qr="\\\\/",IC=`[^${Qr}]`,_U=0,Cn="\\.",bU="\\+",wU="\\?",Nu="\\/",SU="(?=.)",NC="[^/]",Vm=`(?:${Nu}|$)`,DC=`(?:^|${Nu})`,Km=`${Cn}{1,2}${Vm}`,EU=`(?!${Cn})`,TU=`(?!${DC}${Km})`,CU=`(?!${Cn}{0,1}${Vm})`,AU=`(?!${Km})`,kU=`[^.${Nu}]`,RU=`${NC}*?`,LC={DOT_LITERAL:Cn,PLUS_LITERAL:bU,QMARK_LITERAL:wU,SLASH_LITERAL:Nu,ONE_CHAR:SU,QMARK:NC,END_ANCHOR:Vm,DOTS_SLASH:Km,NO_DOT:EU,NO_DOTS:TU,NO_DOT_SLASH:CU,NO_DOTS_SLASH:AU,QMARK_NO_DOT:kU,STAR:RU,START_ANCHOR:DC},OU={...LC,SLASH_LITERAL:`[${Qr}]`,QMARK:IC,STAR:`${IC}*?`,DOTS_SLASH:`${Cn}{1,2}(?:[${Qr}]|$)`,NO_DOT:`(?!${Cn})`,NO_DOTS:`(?!(?:^|[${Qr}])${Cn}{1,2}(?:[${Qr}]|$))`,NO_DOT_SLASH:`(?!${Cn}{0,1}(?:[${Qr}]|$))`,NO_DOTS_SLASH:`(?!${Cn}{1,2}(?:[${Qr}]|$))`,QMARK_NO_DOT:`[^.${Qr}]`,START_ANCHOR:`(?:^|[${Qr}])`,END_ANCHOR:`(?:[${Qr}]|$)`},MU={__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"};BC.exports={DEFAULT_MAX_EXTGLOB_RECURSION:_U,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:MU,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:xU.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?OU:LC}}});var Du=k(zt=>{"use strict";var PU=require("path"),IU=process.platform==="win32",{REGEX_BACKSLASH:NU,REGEX_REMOVE_BACKSLASH:DU,REGEX_SPECIAL_CHARS:LU,REGEX_SPECIAL_CHARS_GLOBAL:BU}=Ea();zt.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r);zt.hasRegexChars=r=>LU.test(r);zt.isRegexChar=r=>r.length===1&&zt.hasRegexChars(r);zt.escapeRegex=r=>r.replace(BU,"\\$1");zt.toPosixSlashes=r=>r.replace(NU,"/");zt.removeBackslashes=r=>r.replace(DU,e=>e==="\\"?"":e);zt.supportsLookbehinds=()=>{let r=process.version.slice(1).split(".").map(Number);return r.length===3&&r[0]>=9||r[0]===8&&r[1]>=10};zt.isWindows=r=>r&&typeof r.windows=="boolean"?r.windows:IU===!0||PU.sep==="\\";zt.escapeLast=(r,e,t)=>{let n=r.lastIndexOf(e,t);return n===-1?r:r[n-1]==="\\"?zt.escapeLast(r,e,n-1):`${r.slice(0,n)}\\${r.slice(n)}`};zt.removePrefix=(r,e={})=>{let t=r;return t.startsWith("./")&&(t=t.slice(2),e.prefix="./"),t};zt.wrapOutput=(r,e={},t={})=>{let n=t.contains?"":"^",i=t.contains?"":"$",s=`${n}(?:${r})${i}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}});var GC=k((hV,WC)=>{"use strict";var jC=Du(),{CHAR_ASTERISK:Ym,CHAR_AT:jU,CHAR_BACKWARD_SLASH:Ta,CHAR_COMMA:FU,CHAR_DOT:Xm,CHAR_EXCLAMATION_MARK:Jm,CHAR_FORWARD_SLASH:HC,CHAR_LEFT_CURLY_BRACE:Zm,CHAR_LEFT_PARENTHESES:Qm,CHAR_LEFT_SQUARE_BRACKET:UU,CHAR_PLUS:qU,CHAR_QUESTION_MARK:FC,CHAR_RIGHT_CURLY_BRACE:$U,CHAR_RIGHT_PARENTHESES:UC,CHAR_RIGHT_SQUARE_BRACKET:HU}=Ea(),qC=r=>r===HC||r===Ta,$C=r=>{r.isPrefix!==!0&&(r.depth=r.isGlobstar?1/0:1)},WU=(r,e)=>{let t=e||{},n=r.length-1,i=t.parts===!0||t.scanToEnd===!0,s=[],o=[],a=[],c=r,l=-1,u=0,f=0,d=!1,g=!1,y=!1,b=!1,C=!1,R=!1,M=!1,P=!1,B=!1,G=!1,F=0,V,D,$={value:"",depth:0,isGlob:!1},T=()=>l>=n,p=()=>c.charCodeAt(l+1),m=()=>(V=D,c.charCodeAt(++l));for(;l<n;){D=m();let A;if(D===Ta){M=$.backslashes=!0,D=m(),D===Zm&&(R=!0);continue}if(R===!0||D===Zm){for(F++;T()!==!0&&(D=m());){if(D===Ta){M=$.backslashes=!0,m();continue}if(D===Zm){F++;continue}if(R!==!0&&D===Xm&&(D=m())===Xm){if(d=$.isBrace=!0,y=$.isGlob=!0,G=!0,i===!0)continue;break}if(R!==!0&&D===FU){if(d=$.isBrace=!0,y=$.isGlob=!0,G=!0,i===!0)continue;break}if(D===$U&&(F--,F===0)){R=!1,d=$.isBrace=!0,G=!0;break}}if(i===!0)continue;break}if(D===HC){if(s.push(l),o.push($),$={value:"",depth:0,isGlob:!1},G===!0)continue;if(V===Xm&&l===u+1){u+=2;continue}f=l+1;continue}if(t.noext!==!0&&(D===qU||D===jU||D===Ym||D===FC||D===Jm)===!0&&p()===Qm){if(y=$.isGlob=!0,b=$.isExtglob=!0,G=!0,D===Jm&&l===u&&(B=!0),i===!0){for(;T()!==!0&&(D=m());){if(D===Ta){M=$.backslashes=!0,D=m();continue}if(D===UC){y=$.isGlob=!0,G=!0;break}}continue}break}if(D===Ym){if(V===Ym&&(C=$.isGlobstar=!0),y=$.isGlob=!0,G=!0,i===!0)continue;break}if(D===FC){if(y=$.isGlob=!0,G=!0,i===!0)continue;break}if(D===UU){for(;T()!==!0&&(A=m());){if(A===Ta){M=$.backslashes=!0,m();continue}if(A===HU){g=$.isBracket=!0,y=$.isGlob=!0,G=!0;break}}if(i===!0)continue;break}if(t.nonegate!==!0&&D===Jm&&l===u){P=$.negated=!0,u++;continue}if(t.noparen!==!0&&D===Qm){if(y=$.isGlob=!0,i===!0){for(;T()!==!0&&(D=m());){if(D===Qm){M=$.backslashes=!0,D=m();continue}if(D===UC){G=!0;break}}continue}break}if(y===!0){if(G=!0,i===!0)continue;break}}t.noext===!0&&(b=!1,y=!1);let x=c,S="",v="";u>0&&(S=c.slice(0,u),c=c.slice(u),f-=u),x&&y===!0&&f>0?(x=c.slice(0,f),v=c.slice(f)):y===!0?(x="",v=c):x=c,x&&x!==""&&x!=="/"&&x!==c&&qC(x.charCodeAt(x.length-1))&&(x=x.slice(0,-1)),t.unescape===!0&&(v&&(v=jC.removeBackslashes(v)),x&&M===!0&&(x=jC.removeBackslashes(x)));let _={prefix:S,input:r,start:u,base:x,glob:v,isBrace:d,isBracket:g,isGlob:y,isExtglob:b,isGlobstar:C,negated:P,negatedExtglob:B};if(t.tokens===!0&&(_.maxDepth=0,qC(D)||o.push($),_.tokens=o),t.parts===!0||t.tokens===!0){let A;for(let w=0;w<s.length;w++){let h=A?A+1:u,E=s[w],q=r.slice(h,E);t.tokens&&(w===0&&u!==0?(o[w].isPrefix=!0,o[w].value=S):o[w].value=q,$C(o[w]),_.maxDepth+=o[w].depth),(w!==0||q!=="")&&a.push(q),A=E}if(A&&A+1<r.length){let w=r.slice(A+1);a.push(w),t.tokens&&(o[o.length-1].value=w,$C(o[o.length-1]),_.maxDepth+=o[o.length-1].depth)}_.slashes=s,_.parts=a}return _};WC.exports=WU});var XC=k((mV,YC)=>{"use strict";var Ca=Ea(),kt=Du(),{MAX_LENGTH:Lu,POSIX_REGEX_SOURCE:GU,REGEX_NON_SPECIAL_CHARS:zU,REGEX_SPECIAL_CHARS_BACKREF:VU,REPLACEMENTS:zC}=Ca,KU=(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=>kt.escapeRegex(i)).join("..")}return t},to=(r,e)=>`Missing ${r}: "${e}" - use "\\\\${e}" to match literal characters`,VC=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},YU=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},KC=r=>{let e=r.trim(),t=!0;for(;t===!0;)t=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),t=!0);if(YU(e))return e.replace(/\\(.)/g,"$1")},XU=r=>{let e=r.map(KC).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},eg=(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}}}}},JU=r=>{let e=0,t=[];for(;e<r.length;){let i=eg(r.slice(e),!1);if(!i||i.type!=="*")return;let s=VC(i.body).map(a=>a.trim());if(s.length!==1)return;let o=KC(s[0]);if(!o||o.length!==1)return;t.push(o),e+=i.end+1}return t.length<1?void 0:`${t.length===1?kt.escapeRegex(t[0]):`[${t.map(i=>kt.escapeRegex(i)).join("")}]`}*`},ZU=r=>{let e=0,t=r.trim(),n=eg(t);for(;n;)e++,t=n.body.trim(),n=eg(t);return e},QU=(r,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let t=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:Ca.DEFAULT_MAX_EXTGLOB_RECURSION,n=VC(r).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||XU(n)))return{risky:!0};for(let i of n){let s=JU(i);if(s)return{risky:!0,safeOutput:s};if(ZU(i)>t)return{risky:!0}}return{risky:!1}},tg=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a string");r=zC[r]||r;let t={...e},n=typeof t.maxLength=="number"?Math.min(Lu,t.maxLength):Lu,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=kt.isWindows(e),l=Ca.globChars(c),u=Ca.extglobChars(l),{DOT_LITERAL:f,PLUS_LITERAL:d,SLASH_LITERAL:g,ONE_CHAR:y,DOTS_SLASH:b,NO_DOT:C,NO_DOT_SLASH:R,NO_DOTS_SLASH:M,QMARK:P,QMARK_NO_DOT:B,STAR:G,START_ANCHOR:F}=l,V=N=>`(${a}(?:(?!${F}${N.dot?b:f}).)*?)`,D=t.dot?"":C,$=t.dot?P:B,T=t.bash===!0?V(t):G;t.capture&&(T=`(${T})`),typeof t.noext=="boolean"&&(t.noextglob=t.noext);let p={input:r,index:-1,start:0,dot:t.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};r=kt.removePrefix(r,p),i=r.length;let m=[],x=[],S=[],v=s,_,A=()=>p.index===i-1,w=p.peek=(N=1)=>r[p.index+N],h=p.advance=()=>r[++p.index]||"",E=()=>r.slice(p.index+1),q=(N="",ne=0)=>{p.consumed+=N,p.index+=ne},O=N=>{p.output+=N.output!=null?N.output:N.value,q(N.value)},I=()=>{let N=1;for(;w()==="!"&&(w(2)!=="("||w(3)==="?");)h(),p.start++,N++;return N%2===0?!1:(p.negated=!0,p.start++,!0)},j=N=>{p[N]++,S.push(N)},K=N=>{p[N]--,S.pop()},U=N=>{if(v.type==="globstar"){let ne=p.braces>0&&(N.type==="comma"||N.type==="brace"),L=N.extglob===!0||m.length&&(N.type==="pipe"||N.type==="paren");N.type!=="slash"&&N.type!=="paren"&&!ne&&!L&&(p.output=p.output.slice(0,-v.output.length),v.type="star",v.value="*",v.output=T,p.output+=v.output)}if(m.length&&N.type!=="paren"&&(m[m.length-1].inner+=N.value),(N.value||N.output)&&O(N),v&&v.type==="text"&&N.type==="text"){v.value+=N.value,v.output=(v.output||"")+N.value;return}N.prev=v,o.push(N),v=N},ke=(N,ne)=>{let L={...u[ne],conditions:1,inner:""};L.prev=v,L.parens=p.parens,L.output=p.output,L.startIndex=p.index,L.tokensIndex=o.length;let z=(t.capture?"(":"")+L.open;j("parens"),U({type:N,value:ne,output:p.output?"":y}),U({type:"paren",extglob:!0,value:h(),output:z}),m.push(L)},ie=N=>{let ne=r.slice(N.startIndex,p.index+1),L=r.slice(N.startIndex+2,p.index),z=QU(L,t);if((N.type==="plus"||N.type==="star")&&z.risky){let J=z.safeOutput?(N.output?"":y)+(t.capture?`(${z.safeOutput})`:z.safeOutput):void 0,Ot=o[N.tokensIndex];Ot.type="text",Ot.value=ne,Ot.output=J||kt.escapeRegex(ne);for(let ae=N.tokensIndex+1;ae<o.length;ae++)o[ae].value="",o[ae].output="",delete o[ae].suffix;p.output=N.output+Ot.output,p.backtrack=!0,U({type:"paren",extglob:!0,value:_,output:""}),K("parens");return}let oe=N.close+(t.capture?")":""),Q;if(N.type==="negate"){let J=T;if(N.inner&&N.inner.length>1&&N.inner.includes("/")&&(J=V(t)),(J!==T||A()||/^\)+$/.test(E()))&&(oe=N.close=`)$))${J}`),N.inner.includes("*")&&(Q=E())&&/^\.[^\\/.]+$/.test(Q)){let Ot=tg(Q,{...e,fastpaths:!1}).output;oe=N.close=`)${Ot})${J})`}N.prev.type==="bos"&&(p.negatedExtglob=!0)}U({type:"paren",extglob:!0,value:_,output:oe}),K("parens")};if(t.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(r)){let N=!1,ne=r.replace(VU,(L,z,oe,Q,J,Ot)=>Q==="\\"?(N=!0,L):Q==="?"?z?z+Q+(J?P.repeat(J.length):""):Ot===0?$+(J?P.repeat(J.length):""):P.repeat(oe.length):Q==="."?f.repeat(oe.length):Q==="*"?z?z+Q+(J?T:""):T:z?L:`\\${L}`);return N===!0&&(t.unescape===!0?ne=ne.replace(/\\/g,""):ne=ne.replace(/\\+/g,L=>L.length%2===0?"\\\\":L?"\\":"")),ne===r&&t.contains===!0?(p.output=r,p):(p.output=kt.wrapOutput(ne,p,e),p)}for(;!A();){if(_=h(),_==="\0")continue;if(_==="\\"){let L=w();if(L==="/"&&t.bash!==!0||L==="."||L===";")continue;if(!L){_+="\\",U({type:"text",value:_});continue}let z=/^\\+/.exec(E()),oe=0;if(z&&z[0].length>2&&(oe=z[0].length,p.index+=oe,oe%2!==0&&(_+="\\")),t.unescape===!0?_=h():_+=h(),p.brackets===0){U({type:"text",value:_});continue}}if(p.brackets>0&&(_!=="]"||v.value==="["||v.value==="[^")){if(t.posix!==!1&&_===":"){let L=v.value.slice(1);if(L.includes("[")&&(v.posix=!0,L.includes(":"))){let z=v.value.lastIndexOf("["),oe=v.value.slice(0,z),Q=v.value.slice(z+2),J=GU[Q];if(J){v.value=oe+J,p.backtrack=!0,h(),!s.output&&o.indexOf(v)===1&&(s.output=y);continue}}}(_==="["&&w()!==":"||_==="-"&&w()==="]")&&(_=`\\${_}`),_==="]"&&(v.value==="["||v.value==="[^")&&(_=`\\${_}`),t.posix===!0&&_==="!"&&v.value==="["&&(_="^"),v.value+=_,O({value:_});continue}if(p.quotes===1&&_!=='"'){_=kt.escapeRegex(_),v.value+=_,O({value:_});continue}if(_==='"'){p.quotes=p.quotes===1?0:1,t.keepQuotes===!0&&U({type:"text",value:_});continue}if(_==="("){j("parens"),U({type:"paren",value:_});continue}if(_===")"){if(p.parens===0&&t.strictBrackets===!0)throw new SyntaxError(to("opening","("));let L=m[m.length-1];if(L&&p.parens===L.parens+1){ie(m.pop());continue}U({type:"paren",value:_,output:p.parens?")":"\\)"}),K("parens");continue}if(_==="["){if(t.nobracket===!0||!E().includes("]")){if(t.nobracket!==!0&&t.strictBrackets===!0)throw new SyntaxError(to("closing","]"));_=`\\${_}`}else j("brackets");U({type:"bracket",value:_});continue}if(_==="]"){if(t.nobracket===!0||v&&v.type==="bracket"&&v.value.length===1){U({type:"text",value:_,output:`\\${_}`});continue}if(p.brackets===0){if(t.strictBrackets===!0)throw new SyntaxError(to("opening","["));U({type:"text",value:_,output:`\\${_}`});continue}K("brackets");let L=v.value.slice(1);if(v.posix!==!0&&L[0]==="^"&&!L.includes("/")&&(_=`/${_}`),v.value+=_,O({value:_}),t.literalBrackets===!1||kt.hasRegexChars(L))continue;let z=kt.escapeRegex(v.value);if(p.output=p.output.slice(0,-v.value.length),t.literalBrackets===!0){p.output+=z,v.value=z;continue}v.value=`(${a}${z}|${v.value})`,p.output+=v.value;continue}if(_==="{"&&t.nobrace!==!0){j("braces");let L={type:"brace",value:_,output:"(",outputIndex:p.output.length,tokensIndex:p.tokens.length};x.push(L),U(L);continue}if(_==="}"){let L=x[x.length-1];if(t.nobrace===!0||!L){U({type:"text",value:_,output:_});continue}let z=")";if(L.dots===!0){let oe=o.slice(),Q=[];for(let J=oe.length-1;J>=0&&(o.pop(),oe[J].type!=="brace");J--)oe[J].type!=="dots"&&Q.unshift(oe[J].value);z=KU(Q,t),p.backtrack=!0}if(L.comma!==!0&&L.dots!==!0){let oe=p.output.slice(0,L.outputIndex),Q=p.tokens.slice(L.tokensIndex);L.value=L.output="\\{",_=z="\\}",p.output=oe;for(let J of Q)p.output+=J.output||J.value}U({type:"brace",value:_,output:z}),K("braces"),x.pop();continue}if(_==="|"){m.length>0&&m[m.length-1].conditions++,U({type:"text",value:_});continue}if(_===","){let L=_,z=x[x.length-1];z&&S[S.length-1]==="braces"&&(z.comma=!0,L="|"),U({type:"comma",value:_,output:L});continue}if(_==="/"){if(v.type==="dot"&&p.index===p.start+1){p.start=p.index+1,p.consumed="",p.output="",o.pop(),v=s;continue}U({type:"slash",value:_,output:g});continue}if(_==="."){if(p.braces>0&&v.type==="dot"){v.value==="."&&(v.output=f);let L=x[x.length-1];v.type="dots",v.output+=_,v.value+=_,L.dots=!0;continue}if(p.braces+p.parens===0&&v.type!=="bos"&&v.type!=="slash"){U({type:"text",value:_,output:f});continue}U({type:"dot",value:_,output:f});continue}if(_==="?"){if(!(v&&v.value==="(")&&t.noextglob!==!0&&w()==="("&&w(2)!=="?"){ke("qmark",_);continue}if(v&&v.type==="paren"){let z=w(),oe=_;if(z==="<"&&!kt.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(v.value==="("&&!/[!=<:]/.test(z)||z==="<"&&!/<([!=]|\w+>)/.test(E()))&&(oe=`\\${_}`),U({type:"text",value:_,output:oe});continue}if(t.dot!==!0&&(v.type==="slash"||v.type==="bos")){U({type:"qmark",value:_,output:B});continue}U({type:"qmark",value:_,output:P});continue}if(_==="!"){if(t.noextglob!==!0&&w()==="("&&(w(2)!=="?"||!/[!=<:]/.test(w(3)))){ke("negate",_);continue}if(t.nonegate!==!0&&p.index===0){I();continue}}if(_==="+"){if(t.noextglob!==!0&&w()==="("&&w(2)!=="?"){ke("plus",_);continue}if(v&&v.value==="("||t.regex===!1){U({type:"plus",value:_,output:d});continue}if(v&&(v.type==="bracket"||v.type==="paren"||v.type==="brace")||p.parens>0){U({type:"plus",value:_});continue}U({type:"plus",value:d});continue}if(_==="@"){if(t.noextglob!==!0&&w()==="("&&w(2)!=="?"){U({type:"at",extglob:!0,value:_,output:""});continue}U({type:"text",value:_});continue}if(_!=="*"){(_==="$"||_==="^")&&(_=`\\${_}`);let L=zU.exec(E());L&&(_+=L[0],p.index+=L[0].length),U({type:"text",value:_});continue}if(v&&(v.type==="globstar"||v.star===!0)){v.type="star",v.star=!0,v.value+=_,v.output=T,p.backtrack=!0,p.globstar=!0,q(_);continue}let N=E();if(t.noextglob!==!0&&/^\([^?]/.test(N)){ke("star",_);continue}if(v.type==="star"){if(t.noglobstar===!0){q(_);continue}let L=v.prev,z=L.prev,oe=L.type==="slash"||L.type==="bos",Q=z&&(z.type==="star"||z.type==="globstar");if(t.bash===!0&&(!oe||N[0]&&N[0]!=="/")){U({type:"star",value:_,output:""});continue}let J=p.braces>0&&(L.type==="comma"||L.type==="brace"),Ot=m.length&&(L.type==="pipe"||L.type==="paren");if(!oe&&L.type!=="paren"&&!J&&!Ot){U({type:"star",value:_,output:""});continue}for(;N.slice(0,3)==="/**";){let ae=r[p.index+4];if(ae&&ae!=="/")break;N=N.slice(3),q("/**",3)}if(L.type==="bos"&&A()){v.type="globstar",v.value+=_,v.output=V(t),p.output=v.output,p.globstar=!0,q(_);continue}if(L.type==="slash"&&L.prev.type!=="bos"&&!Q&&A()){p.output=p.output.slice(0,-(L.output+v.output).length),L.output=`(?:${L.output}`,v.type="globstar",v.output=V(t)+(t.strictSlashes?")":"|$)"),v.value+=_,p.globstar=!0,p.output+=L.output+v.output,q(_);continue}if(L.type==="slash"&&L.prev.type!=="bos"&&N[0]==="/"){let ae=N[1]!==void 0?"|$":"";p.output=p.output.slice(0,-(L.output+v.output).length),L.output=`(?:${L.output}`,v.type="globstar",v.output=`${V(t)}${g}|${g}${ae})`,v.value+=_,p.output+=L.output+v.output,p.globstar=!0,q(_+h()),U({type:"slash",value:"/",output:""});continue}if(L.type==="bos"&&N[0]==="/"){v.type="globstar",v.value+=_,v.output=`(?:^|${g}|${V(t)}${g})`,p.output=v.output,p.globstar=!0,q(_+h()),U({type:"slash",value:"/",output:""});continue}p.output=p.output.slice(0,-v.output.length),v.type="globstar",v.output=V(t),v.value+=_,p.output+=v.output,p.globstar=!0,q(_);continue}let ne={type:"star",value:_,output:T};if(t.bash===!0){ne.output=".*?",(v.type==="bos"||v.type==="slash")&&(ne.output=D+ne.output),U(ne);continue}if(v&&(v.type==="bracket"||v.type==="paren")&&t.regex===!0){ne.output=_,U(ne);continue}(p.index===p.start||v.type==="slash"||v.type==="dot")&&(v.type==="dot"?(p.output+=R,v.output+=R):t.dot===!0?(p.output+=M,v.output+=M):(p.output+=D,v.output+=D),w()!=="*"&&(p.output+=y,v.output+=y)),U(ne)}for(;p.brackets>0;){if(t.strictBrackets===!0)throw new SyntaxError(to("closing","]"));p.output=kt.escapeLast(p.output,"["),K("brackets")}for(;p.parens>0;){if(t.strictBrackets===!0)throw new SyntaxError(to("closing",")"));p.output=kt.escapeLast(p.output,"("),K("parens")}for(;p.braces>0;){if(t.strictBrackets===!0)throw new SyntaxError(to("closing","}"));p.output=kt.escapeLast(p.output,"{"),K("braces")}if(t.strictSlashes!==!0&&(v.type==="star"||v.type==="bracket")&&U({type:"maybe_slash",value:"",output:`${g}?`}),p.backtrack===!0){p.output="";for(let N of p.tokens)p.output+=N.output!=null?N.output:N.value,N.suffix&&(p.output+=N.suffix)}return p};tg.fastpaths=(r,e)=>{let t={...e},n=typeof t.maxLength=="number"?Math.min(Lu,t.maxLength):Lu,i=r.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);r=zC[r]||r;let s=kt.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:l,NO_DOT:u,NO_DOTS:f,NO_DOTS_SLASH:d,STAR:g,START_ANCHOR:y}=Ca.globChars(s),b=t.dot?f:u,C=t.dot?d:u,R=t.capture?"":"?:",M={negated:!1,prefix:""},P=t.bash===!0?".*?":g;t.capture&&(P=`(${P})`);let B=D=>D.noglobstar===!0?P:`(${R}(?:(?!${y}${D.dot?l:o}).)*?)`,G=D=>{switch(D){case"*":return`${b}${c}${P}`;case".*":return`${o}${c}${P}`;case"*.*":return`${b}${P}${o}${c}${P}`;case"*/*":return`${b}${P}${a}${c}${C}${P}`;case"**":return b+B(t);case"**/*":return`(?:${b}${B(t)}${a})?${C}${c}${P}`;case"**/*.*":return`(?:${b}${B(t)}${a})?${C}${P}${o}${c}${P}`;case"**/.*":return`(?:${b}${B(t)}${a})?${o}${c}${P}`;default:{let $=/^(.*?)\.(\w+)$/.exec(D);if(!$)return;let T=G($[1]);return T?T+o+$[2]:void 0}}},F=kt.removePrefix(r,M),V=G(F);return V&&t.strictSlashes!==!0&&(V+=`${a}?`),V};YC.exports=tg});var ZC=k((gV,JC)=>{"use strict";var eq=require("path"),tq=GC(),rg=XC(),ng=Du(),rq=Ea(),nq=r=>r&&typeof r=="object"&&!Array.isArray(r),Pe=(r,e,t=!1)=>{if(Array.isArray(r)){let u=r.map(d=>Pe(d,e,t));return d=>{for(let g of u){let y=g(d);if(y)return y}return!1}}let n=nq(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=ng.isWindows(e),o=n?Pe.compileRe(r,e):Pe.makeRe(r,e,!1,!0),a=o.state;delete o.state;let c=()=>!1;if(i.ignore){let u={...e,ignore:null,onMatch:null,onResult:null};c=Pe(i.ignore,u,t)}let l=(u,f=!1)=>{let{isMatch:d,match:g,output:y}=Pe.test(u,o,e,{glob:r,posix:s}),b={glob:r,state:a,regex:o,posix:s,input:u,output:y,match:g,isMatch:d};return typeof i.onResult=="function"&&i.onResult(b),d===!1?(b.isMatch=!1,f?b:!1):c(u)?(typeof i.onIgnore=="function"&&i.onIgnore(b),b.isMatch=!1,f?b:!1):(typeof i.onMatch=="function"&&i.onMatch(b),f?b:!0)};return t&&(l.state=a),l};Pe.test=(r,e,t,{glob:n,posix:i}={})=>{if(typeof r!="string")throw new TypeError("Expected input to be a string");if(r==="")return{isMatch:!1,output:""};let s=t||{},o=s.format||(i?ng.toPosixSlashes:null),a=r===n,c=a&&o?o(r):r;return a===!1&&(c=o?o(r):r,a=c===n),(a===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?a=Pe.matchBase(r,e,t,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Pe.matchBase=(r,e,t,n=ng.isWindows(t))=>(e instanceof RegExp?e:Pe.makeRe(e,t)).test(eq.basename(r));Pe.isMatch=(r,e,t)=>Pe(e,t)(r);Pe.parse=(r,e)=>Array.isArray(r)?r.map(t=>Pe.parse(t,e)):rg(r,{...e,fastpaths:!1});Pe.scan=(r,e)=>tq(r,e);Pe.compileRe=(r,e,t=!1,n=!1)=>{if(t===!0)return r.output;let i=e||{},s=i.contains?"":"^",o=i.contains?"":"$",a=`${s}(?:${r.output})${o}`;r&&r.negated===!0&&(a=`^(?!${a}).*$`);let c=Pe.toRegex(a,e);return n===!0&&(c.state=r),c};Pe.makeRe=(r,e={},t=!1,n=!1)=>{if(!r||typeof r!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(r[0]==="."||r[0]==="*")&&(i.output=rg.fastpaths(r,e)),i.output||(i=rg(r,e)),Pe.compileRe(i,e,t,n)};Pe.toRegex=(r,e)=>{try{let t=e||{};return new RegExp(r,t.flags||(t.nocase?"i":""))}catch(t){if(e&&e.debug===!0)throw t;return/$^/}};Pe.constants=rq;JC.exports=Pe});var ig=k((vV,QC)=>{"use strict";QC.exports=ZC()});var aA=k((yV,oA)=>{"use strict";var ka=require("fs"),{Readable:iq}=require("stream"),Aa=require("path"),{promisify:Uu}=require("util"),sg=ig(),sq=Uu(ka.readdir),oq=Uu(ka.stat),eA=Uu(ka.lstat),aq=Uu(ka.realpath),cq="!",iA="READDIRP_RECURSIVE_ERROR",lq=new Set(["ENOENT","EPERM","EACCES","ELOOP",iA]),og="files",sA="directories",ju="files_directories",Bu="all",tA=[og,sA,ju,Bu],uq=r=>lq.has(r.code),[rA,pq]=process.versions.node.split(".").slice(0,2).map(r=>Number.parseInt(r,10)),fq=process.platform==="win32"&&(rA>10||rA===10&&pq>=5),nA=r=>{if(r!==void 0){if(typeof r=="function")return r;if(typeof r=="string"){let e=sg(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)===cq?t.push(sg(i.slice(1))):e.push(sg(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))}}},Fu=class r extends iq{static get defaultOptions(){return{root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:og,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=nA(t.fileFilter),this._directoryFilter=nA(t.directoryFilter);let s=t.lstat?eA:oq;fq?this._stat=o=>s(o,{bigint:!0}):this._stat=s,this._maxDepth=t.depth,this._wantsDir=[sA,ju,Bu].includes(i),this._wantsFile=[og,ju,Bu].includes(i),this._wantsEverything=i===Bu,this._root=Aa.resolve(n),this._isDirent="Dirent"in ka&&!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 sq(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=Aa.resolve(Aa.join(t,i));n={path:Aa.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){uq(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 aq(n),s=await eA(i);if(s.isFile())return"file";if(s.isDirectory()){let o=i.length;if(n.startsWith(i)&&n.substr(o,1)===Aa.sep){let a=new Error(`Circular symlink detected: "${n}" points to "${i}"`);return a.code=iA,this._onError(a)}return"directory"}}catch(i){this._onError(i)}}}}_includeAsFile(e){let t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}},ro=(r,e={})=>{let t=e.entryType||e.type;if(t==="both"&&(t=ju),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&&!tA.includes(t))throw new Error(`readdirp: Invalid type passed. Use one of ${tA.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=r,new Fu(e)},dq=(r,e={})=>new Promise((t,n)=>{let i=[];ro(r,e).on("data",s=>i.push(s)).on("end",()=>t(i)).on("error",s=>n(s))});ro.promise=dq;ro.ReaddirpStream=Fu;ro.default=ro;oA.exports=ro});var ag=k((xV,cA)=>{cA.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 hA=k((fA,dA)=>{"use strict";Object.defineProperty(fA,"__esModule",{value:!0});var pA=ig(),hq=ag(),lA="!",mq={returnIndex:!1},gq=r=>Array.isArray(r)?r:[r],vq=(r,e)=>{if(typeof r=="function")return r;if(typeof r=="string"){let t=pA(r,e);return n=>r===n||t(n)}return r instanceof RegExp?t=>r.test(t):t=>!1},uA=(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=hq(s,!1);for(let c=0;c<e.length;c++){let l=e[c];if(l(o))return n?-1:!1}let a=i&&[o].concat(t.slice(1));for(let c=0;c<r.length;c++){let l=r[c];if(i?l(...a):l(o))return n?c:!0}return n?-1:!1},cg=(r,e,t=mq)=>{if(r==null)throw new TypeError("anymatch: specify first argument");let n=typeof t=="boolean"?{returnIndex:t}:t,i=n.returnIndex||!1,s=gq(r),o=s.filter(c=>typeof c=="string"&&c.charAt(0)===lA).map(c=>c.slice(1)).map(c=>pA(c,n)),a=s.filter(c=>typeof c!="string"||typeof c=="string"&&c.charAt(0)!==lA).map(c=>vq(c,n));return e==null?(c,l=!1)=>uA(a,o,c,typeof l=="boolean"?l:!1):uA(a,o,e,i)};cg.default=cg;dA.exports=cg});var gA=k((_V,mA)=>{mA.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 lg=k((bV,yA)=>{var yq=gA(),vA={"{":"}","(":")","[":"]"},xq=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=vA[a];if(c){var l=r.indexOf(c,e);l!==-1&&(e=l+1)}if(r[e]==="!")return!0}else e++}return!1},_q=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=vA[t];if(n){var i=r.indexOf(n,e);i!==-1&&(e=i+1)}if(r[e]==="!")return!0}else e++}return!1};yA.exports=function(e,t){if(typeof e!="string"||e==="")return!1;if(yq(e))return!0;var n=xq;return t&&t.strict===!1&&(n=_q),n(e)}});var _A=k((wV,xA)=>{"use strict";var bq=lg(),wq=require("path").posix.dirname,Sq=require("os").platform()==="win32",ug="/",Eq=/\\/g,Tq=/[\{\[].*[\}\]]$/,Cq=/(^|[^\\])([\{\[]|\([^\)]+$)/,Aq=/\\([\!\*\?\|\[\]\(\)\{\}])/g;xA.exports=function(e,t){var n=Object.assign({flipBackslashes:!0},t);n.flipBackslashes&&Sq&&e.indexOf(ug)<0&&(e=e.replace(Eq,ug)),Tq.test(e)&&(e+=ug),e+="a";do e=wq(e);while(bq(e)||Cq.test(e));return e.replace(Aq,"$1")}});var qu=k(Sr=>{"use strict";Sr.isInteger=r=>typeof r=="number"?Number.isInteger(r):typeof r=="string"&&r.trim()!==""?Number.isInteger(Number(r)):!1;Sr.find=(r,e)=>r.nodes.find(t=>t.type===e);Sr.exceedsLimit=(r,e,t=1,n)=>n===!1||!Sr.isInteger(r)||!Sr.isInteger(e)?!1:(Number(e)-Number(r))/Number(t)>=n;Sr.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)};Sr.encloseBrace=r=>r.type!=="brace"?!1:r.commas>>0+r.ranges>>0===0?(r.invalid=!0,!0):!1;Sr.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;Sr.isOpenOrClose=r=>r.type==="open"||r.type==="close"?!0:r.open===!0||r.close===!0;Sr.reduce=r=>r.reduce((e,t)=>(t.type==="text"&&e.push(t.value),t.type==="range"&&(t.type="text"),e),[]);Sr.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 $u=k((EV,wA)=>{"use strict";var bA=qu();wA.exports=(r,e={})=>{let t=(n,i={})=>{let s=e.escapeInvalid&&bA.isInvalidBrace(i),o=n.invalid===!0&&e.escapeInvalid===!0,a="";if(n.value)return(s||o)&&bA.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 EA=k((TV,SA)=>{"use strict";SA.exports=function(r){return typeof r=="number"?r-r===0:typeof r=="string"&&r.trim()!==""?Number.isFinite?Number.isFinite(+r):isFinite(+r):!1}});var IA=k((CV,PA)=>{"use strict";var TA=EA(),Oi=(r,e,t)=>{if(TA(r)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||r===e)return String(r);if(TA(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(Oi.cache.hasOwnProperty(c))return Oi.cache[c].result;let l=Math.min(r,e),u=Math.max(r,e);if(Math.abs(l-u)===1){let b=r+"|"+e;return n.capture?`(${b})`:n.wrap===!1?b:`(?:${b})`}let f=MA(r)||MA(e),d={min:r,max:e,a:l,b:u},g=[],y=[];if(f&&(d.isPadded=f,d.maxLen=String(d.max).length),l<0){let b=u<0?Math.abs(u):1;y=CA(b,Math.abs(l),d,n),l=d.a=0}return u>=0&&(g=CA(l,u,d,n)),d.negatives=y,d.positives=g,d.result=kq(y,g,n),n.capture===!0?d.result=`(${d.result})`:n.wrap!==!1&&g.length+y.length>1&&(d.result=`(?:${d.result})`),Oi.cache[c]=d,d.result};function kq(r,e,t){let n=pg(r,e,"-",!1,t)||[],i=pg(e,r,"",!1,t)||[],s=pg(r,e,"-?",!0,t)||[];return n.concat(s).concat(i).join("|")}function Rq(r,e){let t=1,n=1,i=kA(r,t),s=new Set([e]);for(;r<=i&&i<=e;)s.add(i),t+=1,i=kA(r,t);for(i=RA(e+1,n)-1;r<i&&i<=e;)s.add(i),n+=1,i=RA(e+1,n)-1;return s=[...s],s.sort(Pq),s}function Oq(r,e,t){if(r===e)return{pattern:r,count:[],digits:0};let n=Mq(r,e),i=n.length,s="",o=0;for(let a=0;a<i;a++){let[c,l]=n[a];c===l?s+=c:c!=="0"||l!=="9"?s+=Iq(c,l,t):o++}return o&&(s+=t.shorthand===!0?"\\d":"[0-9]"),{pattern:s,count:[o],digits:i}}function CA(r,e,t,n){let i=Rq(r,e),s=[],o=r,a;for(let c=0;c<i.length;c++){let l=i[c],u=Oq(String(o),String(l),n),f="";if(!t.isPadded&&a&&a.pattern===u.pattern){a.count.length>1&&a.count.pop(),a.count.push(u.count[0]),a.string=a.pattern+OA(a.count),o=l+1;continue}t.isPadded&&(f=Nq(l,t,n)),u.string=f+u.pattern+OA(u.count),s.push(u),o=l+1,a=u}return s}function pg(r,e,t,n,i){let s=[];for(let o of r){let{string:a}=o;!n&&!AA(e,"string",a)&&s.push(t+a),n&&AA(e,"string",a)&&s.push(t+a)}return s}function Mq(r,e){let t=[];for(let n=0;n<r.length;n++)t.push([r[n],e[n]]);return t}function Pq(r,e){return r>e?1:e>r?-1:0}function AA(r,e,t){return r.some(n=>n[e]===t)}function kA(r,e){return Number(String(r).slice(0,-e)+"9".repeat(e))}function RA(r,e){return r-r%Math.pow(10,e)}function OA(r){let[e=0,t=""]=r;return t||e>1?`{${e+(t?","+t:"")}}`:""}function Iq(r,e,t){return`[${r}${e-r===1?"":"-"}${e}]`}function MA(r){return/^-?(0+)\d/.test(r)}function Nq(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}}`}}Oi.cache={};Oi.clearCache=()=>Oi.cache={};PA.exports=Oi});var hg=k((AV,UA)=>{"use strict";var Dq=require("util"),DA=IA(),NA=r=>r!==null&&typeof r=="object"&&!Array.isArray(r),Lq=r=>e=>r===!0?Number(e):String(e),fg=r=>typeof r=="number"||typeof r=="string"&&r!=="",Ra=r=>Number.isInteger(+r),dg=r=>{let e=`${r}`,t=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++t]==="0";);return t>0},Bq=(r,e,t)=>typeof r=="string"||typeof e=="string"?!0:t.stringify===!0,jq=(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},Wu=(r,e)=>{let t=r[0]==="-"?"-":"";for(t&&(r=r.slice(1),e--);r.length<e;)r="0"+r;return t?"-"+r:r},Fq=(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=>Wu(String(a),t)).join("|")),r.negatives.length&&(s=`-(${n}${r.negatives.map(a=>Wu(String(a),t)).join("|")})`),i&&s?o=`${i}|${s}`:o=i||s,e.wrap?`(${n}${o})`:o},LA=(r,e,t,n)=>{if(t)return DA(r,e,{wrap:!1,...n});let i=String.fromCharCode(r);if(r===e)return i;let s=String.fromCharCode(e);return`[${i}-${s}]`},BA=(r,e,t)=>{if(Array.isArray(r)){let n=t.wrap===!0,i=t.capture?"":"?:";return n?`(${i}${r.join("|")})`:r.join("|")}return DA(r,e,t)},jA=(...r)=>new RangeError("Invalid range arguments: "+Dq.inspect(...r)),FA=(r,e,t)=>{if(t.strictRanges===!0)throw jA([r,e]);return[]},Uq=(r,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${r}" to be a number`);return[]},qq=(r,e,t=1,n={})=>{let i=Number(r),s=Number(e);if(!Number.isInteger(i)||!Number.isInteger(s)){if(n.strictRanges===!0)throw jA([r,e]);return[]}i===0&&(i=0),s===0&&(s=0);let o=i>s,a=String(r),c=String(e),l=String(t);t=Math.max(Math.abs(t),1);let u=dg(a)||dg(c)||dg(l),f=u?Math.max(a.length,c.length,l.length):0,d=u===!1&&Bq(r,e,n)===!1,g=n.transform||Lq(d);if(n.toRegex&&t===1)return LA(Wu(r,f),Wu(e,f),!0,n);let y={negatives:[],positives:[]},b=M=>y[M<0?"negatives":"positives"].push(Math.abs(M)),C=[],R=0;for(;o?i>=s:i<=s;)n.toRegex===!0&&t>1?b(i):C.push(jq(g(i,R),f,d)),i=o?i-t:i+t,R++;return n.toRegex===!0?t>1?Fq(y,n,f):BA(C,null,{wrap:!1,...n}):C},$q=(r,e,t=1,n={})=>{if(!Ra(r)&&r.length>1||!Ra(e)&&e.length>1)return FA(r,e,n);let i=n.transform||(d=>String.fromCharCode(d)),s=`${r}`.charCodeAt(0),o=`${e}`.charCodeAt(0),a=s>o,c=Math.min(s,o),l=Math.max(s,o);if(n.toRegex&&t===1)return LA(c,l,!1,n);let u=[],f=0;for(;a?s>=o:s<=o;)u.push(i(s,f)),s=a?s-t:s+t,f++;return n.toRegex===!0?BA(u,null,{wrap:!1,options:n}):u},Hu=(r,e,t,n={})=>{if(e==null&&fg(r))return[r];if(!fg(r)||!fg(e))return FA(r,e,n);if(typeof t=="function")return Hu(r,e,1,{transform:t});if(NA(t))return Hu(r,e,0,t);let i={...n};return i.capture===!0&&(i.wrap=!0),t=t||i.step||1,Ra(t)?Ra(r)&&Ra(e)?qq(r,e,t,i):$q(r,e,Math.max(Math.abs(t),1),i):t!=null&&!NA(t)?Uq(t,i):Hu(r,e,1,t)};UA.exports=Hu});var HA=k((kV,$A)=>{"use strict";var Hq=hg(),qA=qu(),Wq=(r,e={})=>{let t=(n,i={})=>{let s=qA.isInvalidBrace(i),o=n.invalid===!0&&e.escapeInvalid===!0,a=s===!0||o===!0,c=e.escapeInvalid===!0?"\\":"",l="";if(n.isOpen===!0)return c+n.value;if(n.isClose===!0)return console.log("node.isClose",c,n.value),c+n.value;if(n.type==="open")return a?c+n.value:"(";if(n.type==="close")return a?c+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let u=qA.reduce(n.nodes),f=Hq(...u,{...e,wrap:!1,toRegex:!0,strictZeros:!0});if(f.length!==0)return u.length>1&&f.length>1?`(${f})`:f}if(n.nodes)for(let u of n.nodes)l+=t(u,n);return l};return t(r)};$A.exports=Wq});var zA=k((RV,GA)=>{"use strict";var Gq=hg(),WA=$u(),no=qu(),Mi=(r="",e="",t=!1)=>{let n=[];if(r=[].concat(r),e=[].concat(e),!e.length)return r;if(!r.length)return t?no.flatten(e).map(i=>`{${i}}`):e;for(let i of r)if(Array.isArray(i))for(let s of i)n.push(Mi(s,e,t));else for(let s of e)t===!0&&typeof s=="string"&&(s=`{${s}}`),n.push(Array.isArray(s)?Mi(i,s,t):i+s);return no.flatten(n)},zq=(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(Mi(a.pop(),WA(i,e)));return}if(i.type==="brace"&&i.invalid!==!0&&i.nodes.length===2){a.push(Mi(a.pop(),["{}"]));return}if(i.nodes&&i.ranges>0){let f=no.reduce(i.nodes);if(no.exceedsLimit(...f,e.step,t))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let d=Gq(...f,e);d.length===0&&(d=WA(i,e)),a.push(Mi(a.pop(),d)),i.nodes=[];return}let c=no.encloseBrace(i),l=i.queue,u=i;for(;u.type!=="brace"&&u.type!=="root"&&u.parent;)u=u.parent,l=u.queue;for(let f=0;f<i.nodes.length;f++){let d=i.nodes[f];if(d.type==="comma"&&i.type==="brace"){f===1&&l.push(""),l.push("");continue}if(d.type==="close"){a.push(Mi(a.pop(),l,c));continue}if(d.value&&d.type!=="open"){l.push(Mi(l.pop(),d.value));continue}d.nodes&&n(d,i)}return l};return no.flatten(n(r))};GA.exports=zq});var KA=k((OV,VA)=>{"use strict";VA.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
|
|
105
|
-
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var QA=k((MV,ZA)=>{"use strict";var Vq=$u(),{MAX_LENGTH:YA,CHAR_BACKSLASH:mg,CHAR_BACKTICK:Kq,CHAR_COMMA:Yq,CHAR_DOT:Xq,CHAR_LEFT_PARENTHESES:Jq,CHAR_RIGHT_PARENTHESES:Zq,CHAR_LEFT_CURLY_BRACE:Qq,CHAR_RIGHT_CURLY_BRACE:e$,CHAR_LEFT_SQUARE_BRACKET:XA,CHAR_RIGHT_SQUARE_BRACKET:JA,CHAR_DOUBLE_QUOTE:t$,CHAR_SINGLE_QUOTE:r$,CHAR_NO_BREAK_SPACE:n$,CHAR_ZERO_WIDTH_NOBREAK_SPACE:i$}=KA(),s$=(r,e={})=>{if(typeof r!="string")throw new TypeError("Expected a string");let t=e||{},n=typeof t.maxLength=="number"?Math.min(YA,t.maxLength):YA;if(r.length>n)throw new SyntaxError(`Input length (${r.length}), exceeds max characters (${n})`);let i={type:"root",input:r,nodes:[]},s=[i],o=i,a=i,c=0,l=r.length,u=0,f=0,d,g=()=>r[u++],y=b=>{if(b.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&b.type==="text"){a.value+=b.value;return}return o.nodes.push(b),b.parent=o,b.prev=a,a=b,b};for(y({type:"bos"});u<l;)if(o=s[s.length-1],d=g(),!(d===i$||d===n$)){if(d===mg){y({type:"text",value:(e.keepEscaping?d:"")+g()});continue}if(d===JA){y({type:"text",value:"\\"+d});continue}if(d===XA){c++;let b;for(;u<l&&(b=g());){if(d+=b,b===XA){c++;continue}if(b===mg){d+=g();continue}if(b===JA&&(c--,c===0))break}y({type:"text",value:d});continue}if(d===Jq){o=y({type:"paren",nodes:[]}),s.push(o),y({type:"text",value:d});continue}if(d===Zq){if(o.type!=="paren"){y({type:"text",value:d});continue}o=s.pop(),y({type:"text",value:d}),o=s[s.length-1];continue}if(d===t$||d===r$||d===Kq){let b=d,C;for(e.keepQuotes!==!0&&(d="");u<l&&(C=g());){if(C===mg){d+=C+g();continue}if(C===b){e.keepQuotes===!0&&(d+=C);break}d+=C}y({type:"text",value:d});continue}if(d===Qq){f++;let C={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||o.dollar===!0,depth:f,commas:0,ranges:0,nodes:[]};o=y(C),s.push(o),y({type:"open",value:d});continue}if(d===e$){if(o.type!=="brace"){y({type:"text",value:d});continue}let b="close";o=s.pop(),o.close=!0,y({type:b,value:d}),f--,o=s[s.length-1];continue}if(d===Yq&&f>0){if(o.ranges>0){o.ranges=0;let b=o.nodes.shift();o.nodes=[b,{type:"text",value:Vq(o)}]}y({type:"comma",value:d}),o.commas++;continue}if(d===Xq&&f>0&&o.commas===0){let b=o.nodes;if(f===0||b.length===0){y({type:"text",value:d});continue}if(a.type==="dot"){if(o.range=[],a.value+=d,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"){b.pop();let C=b[b.length-1];C.value+=a.value+d,a=C,o.ranges--;continue}y({type:"dot",value:d});continue}y({type:"text",value:d})}do if(o=s.pop(),o.type!=="root"){o.nodes.forEach(R=>{R.nodes||(R.type==="open"&&(R.isOpen=!0),R.type==="close"&&(R.isClose=!0),R.nodes||(R.type="text"),R.invalid=!0)});let b=s[s.length-1],C=b.nodes.indexOf(o);b.nodes.splice(C,1,...o.nodes)}while(s.length>0);return y({type:"eos"}),i};ZA.exports=s$});var rk=k((PV,tk)=>{"use strict";var ek=$u(),o$=HA(),a$=zA(),c$=QA(),ir=(r,e={})=>{let t=[];if(Array.isArray(r))for(let n of r){let i=ir.create(n,e);Array.isArray(i)?t.push(...i):t.push(i)}else t=[].concat(ir.create(r,e));return e&&e.expand===!0&&e.nodupes===!0&&(t=[...new Set(t)]),t};ir.parse=(r,e={})=>c$(r,e);ir.stringify=(r,e={})=>ek(typeof r=="string"?ir.parse(r,e):r,e);ir.compile=(r,e={})=>(typeof r=="string"&&(r=ir.parse(r,e)),o$(r,e));ir.expand=(r,e={})=>{typeof r=="string"&&(r=ir.parse(r,e));let t=a$(r,e);return e.noempty===!0&&(t=t.filter(Boolean)),e.nodupes===!0&&(t=[...new Set(t)]),t};ir.create=(r,e={})=>r===""||r.length<3?[r]:e.expand!==!0?ir.compile(r,e):ir.expand(r,e);tk.exports=ir});var nk=k((IV,l$)=>{l$.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 sk=k((NV,ik)=>{ik.exports=nk()});var ak=k((DV,ok)=>{"use strict";var u$=require("path"),p$=sk(),f$=new Set(p$);ok.exports=r=>f$.has(u$.extname(r).slice(1).toLowerCase())});var Gu=k(Y=>{"use strict";var{sep:d$}=require("path"),{platform:gg}=process,h$=require("os");Y.EV_ALL="all";Y.EV_READY="ready";Y.EV_ADD="add";Y.EV_CHANGE="change";Y.EV_ADD_DIR="addDir";Y.EV_UNLINK="unlink";Y.EV_UNLINK_DIR="unlinkDir";Y.EV_RAW="raw";Y.EV_ERROR="error";Y.STR_DATA="data";Y.STR_END="end";Y.STR_CLOSE="close";Y.FSEVENT_CREATED="created";Y.FSEVENT_MODIFIED="modified";Y.FSEVENT_DELETED="deleted";Y.FSEVENT_MOVED="moved";Y.FSEVENT_CLONED="cloned";Y.FSEVENT_UNKNOWN="unknown";Y.FSEVENT_FLAG_MUST_SCAN_SUBDIRS=1;Y.FSEVENT_TYPE_FILE="file";Y.FSEVENT_TYPE_DIRECTORY="directory";Y.FSEVENT_TYPE_SYMLINK="symlink";Y.KEY_LISTENERS="listeners";Y.KEY_ERR="errHandlers";Y.KEY_RAW="rawEmitters";Y.HANDLER_KEYS=[Y.KEY_LISTENERS,Y.KEY_ERR,Y.KEY_RAW];Y.DOT_SLASH=`.${d$}`;Y.BACK_SLASH_RE=/\\/g;Y.DOUBLE_SLASH_RE=/\/\//;Y.SLASH_OR_BACK_SLASH_RE=/[/\\]/;Y.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/;Y.REPLACER_RE=/^\.[/\\]/;Y.SLASH="/";Y.SLASH_SLASH="//";Y.BRACE_START="{";Y.BANG="!";Y.ONE_DOT=".";Y.TWO_DOTS="..";Y.STAR="*";Y.GLOBSTAR="**";Y.ROOT_GLOBSTAR="/**/*";Y.SLASH_GLOBSTAR="/**";Y.DIR_SUFFIX="Dir";Y.ANYMATCH_OPTS={dot:!0};Y.STRING_TYPE="string";Y.FUNCTION_TYPE="function";Y.EMPTY_STR="";Y.EMPTY_FN=()=>{};Y.IDENTITY_FN=r=>r;Y.isWindows=gg==="win32";Y.isMacos=gg==="darwin";Y.isLinux=gg==="linux";Y.isIBMi=h$.type()==="OS400"});var dk=k((BV,fk)=>{"use strict";var An=require("fs"),_t=require("path"),{promisify:Ia}=require("util"),m$=ak(),{isWindows:g$,isLinux:v$,EMPTY_FN:y$,EMPTY_STR:x$,KEY_LISTENERS:io,KEY_ERR:vg,KEY_RAW:Oa,HANDLER_KEYS:_$,EV_CHANGE:Vu,EV_ADD:zu,EV_ADD_DIR:b$,EV_ERROR:lk,STR_DATA:w$,STR_END:S$,BRACE_START:E$,STAR:T$}=Gu(),C$="watch",A$=Ia(An.open),uk=Ia(An.stat),k$=Ia(An.lstat),R$=Ia(An.close),yg=Ia(An.realpath),O$={lstat:k$,stat:uk},_g=(r,e)=>{r instanceof Set?r.forEach(e):e(r)},Ma=(r,e,t)=>{let n=r[e];n instanceof Set||(r[e]=n=new Set([n])),n.add(t)},M$=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]},pk=r=>r instanceof Set?r.size===0:!r,Ku=new Map;function ck(r,e,t,n,i){let s=(o,a)=>{t(r),i(o,a,{watchedPath:r}),a&&r!==a&&Yu(_t.resolve(r,a),io,_t.join(r,a))};try{return An.watch(r,e,s)}catch(o){n(o)}}var Yu=(r,e,t,n,i)=>{let s=Ku.get(r);s&&_g(s[e],o=>{o(t,n,i)})},P$=(r,e,t,n)=>{let{listener:i,errHandler:s,rawEmitter:o}=n,a=Ku.get(e),c;if(!t.persistent)return c=ck(r,t,i,s,o),c.close.bind(c);if(a)Ma(a,io,i),Ma(a,vg,s),Ma(a,Oa,o);else{if(c=ck(r,t,Yu.bind(null,e,io),s,Yu.bind(null,e,Oa)),!c)return;c.on(lk,async l=>{let u=Yu.bind(null,e,vg);if(a.watcherUnusable=!0,g$&&l.code==="EPERM")try{let f=await A$(r,"r");await R$(f),u(l)}catch{}else u(l)}),a={listeners:i,errHandlers:s,rawEmitters:o,watcher:c},Ku.set(e,a)}return()=>{Pa(a,io,i),Pa(a,vg,s),Pa(a,Oa,o),pk(a.listeners)&&(a.watcher.close(),Ku.delete(e),_$.forEach(M$(a)),a.watcher=void 0,Object.freeze(a))}},xg=new Map,I$=(r,e,t,n)=>{let{listener:i,rawEmitter:s}=n,o=xg.get(e),a=new Set,c=new Set,l=o&&o.options;return l&&(l.persistent<t.persistent||l.interval>t.interval)&&(a=o.listeners,c=o.rawEmitters,An.unwatchFile(e),o=void 0),o?(Ma(o,io,i),Ma(o,Oa,s)):(o={listeners:i,rawEmitters:s,options:t,watcher:An.watchFile(e,t,(u,f)=>{_g(o.rawEmitters,g=>{g(Vu,e,{curr:u,prev:f})});let d=u.mtimeMs;(u.size!==f.size||d>f.mtimeMs||d===0)&&_g(o.listeners,g=>g(r,u))})},xg.set(e,o)),()=>{Pa(o,io,i),Pa(o,Oa,s),pk(o.listeners)&&(xg.delete(e),An.unwatchFile(e),o.options=o.watcher=void 0,Object.freeze(o))}},bg=class{constructor(e){this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){let n=this.fsw.options,i=_t.dirname(e),s=_t.basename(e);this.fsw._getWatchedDir(i).add(s);let a=_t.resolve(e),c={persistent:n.persistent};t||(t=y$);let l;return n.usePolling?(c.interval=n.enableBinaryInterval&&m$(s)?n.binaryInterval:n.interval,l=I$(e,a,c,{listener:t,rawEmitter:this.fsw._emitRaw})):l=P$(e,a,c,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),l}_handleFile(e,t,n){if(this.fsw.closed)return;let i=_t.dirname(e),s=_t.basename(e),o=this.fsw._getWatchedDir(i),a=t;if(o.has(s))return;let c=async(u,f)=>{if(this.fsw._throttle(C$,e,5)){if(!f||f.mtimeMs===0)try{let d=await uk(e);if(this.fsw.closed)return;let g=d.atimeMs,y=d.mtimeMs;(!g||g<=y||y!==a.mtimeMs)&&this.fsw._emit(Vu,e,d),v$&&a.ino!==d.ino?(this.fsw._closeFile(u),a=d,this.fsw._addPathCloser(u,this._watchWithNodeFs(e,c))):a=d}catch{this.fsw._remove(i,s)}else if(o.has(s)){let d=f.atimeMs,g=f.mtimeMs;(!d||d<=g||g!==a.mtimeMs)&&this.fsw._emit(Vu,e,f),a=f}}},l=this._watchWithNodeFs(e,c);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(zu,e,0))return;this.fsw._emit(zu,e,t)}return l}async _handleSymlink(e,t,n,i){if(this.fsw.closed)return;let s=e.fullPath,o=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let a;try{a=await yg(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(Vu,n,e.stats)):(o.add(i),this.fsw._symlinkPaths.set(s,a),this.fsw._emit(zu,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=_t.join(e,x$),!n.hasGlob&&(a=this.fsw._throttle("readdir",e,1e3),!a))return;let c=this.fsw._getWatchedDir(n.path),l=new Set,u=this.fsw._readdirp(e,{fileFilter:f=>n.filterPath(f),directoryFilter:f=>n.filterDir(f),depth:0}).on(w$,async f=>{if(this.fsw.closed){u=void 0;return}let d=f.path,g=_t.join(e,d);if(l.add(d),!(f.stats.isSymbolicLink()&&await this._handleSymlink(f,e,g,d))){if(this.fsw.closed){u=void 0;return}(d===i||!i&&!c.has(d))&&(this.fsw._incrReadyCount(),g=_t.join(s,_t.relative(s,g)),this._addToNodeFs(g,t,n,o+1))}}).on(lk,this._boundHandleError);return new Promise(f=>u.once(S$,()=>{if(this.fsw.closed){u=void 0;return}let d=a?a.clear():!1;f(),c.getChildren().filter(g=>g!==e&&!l.has(g)&&(!n.hasGlob||n.filterPath({fullPath:_t.resolve(e,g)}))).forEach(g=>{this.fsw._remove(e,g)}),u=void 0,d&&this._handleRead(e,!1,n,i,s,o,a)}))}async _handleDir(e,t,n,i,s,o,a){let c=this.fsw._getWatchedDir(_t.dirname(e)),l=c.has(_t.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!s&&!l&&(!o.hasGlob||o.globFilter(e))&&this.fsw._emit(b$,e,t),c.add(_t.basename(e)),this.fsw._getWatchedDir(e);let u,f,d=this.fsw.options.depth;if((d==null||i<=d)&&!this.fsw._symlinkPaths.has(a)){if(!s&&(await this._handleRead(e,n,o,s,e,i,u),this.fsw.closed))return;f=this._watchWithNodeFs(e,(g,y)=>{y&&y.mtimeMs===0||this._handleRead(g,!1,o,s,e,i,u)})}return f}async _addToNodeFs(e,t,n,i,s){let o=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return o(),!1;let a=this.fsw._getWatchHelpers(e,i);!a.hasGlob&&n&&(a.hasGlob=n.hasGlob,a.globFilter=n.globFilter,a.filterPath=c=>n.filterPath(c),a.filterDir=c=>n.filterDir(c));try{let c=await O$[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))return o(),!1;let l=this.fsw.options.followSymlinks&&!e.includes(T$)&&!e.includes(E$),u;if(c.isDirectory()){let f=_t.resolve(e),d=l?await yg(e):e;if(this.fsw.closed||(u=await this._handleDir(a.watchPath,c,t,i,s,a,d),this.fsw.closed))return;f!==d&&d!==void 0&&this.fsw._symlinkPaths.set(f,d)}else if(c.isSymbolicLink()){let f=l?await yg(e):e;if(this.fsw.closed)return;let d=_t.dirname(a.watchPath);if(this.fsw._getWatchedDir(d).add(a.watchPath),this.fsw._emit(zu,a.watchPath,c),u=await this._handleDir(d,c,t,i,e,a,f),this.fsw.closed)return;f!==void 0&&this.fsw._symlinkPaths.set(_t.resolve(e),f)}else u=this._handleFile(a.watchPath,c,t);return o(),this.fsw._addPathCloser(e,u),!1}catch(c){if(this.fsw._handleError(c))return o(),e}}};fk.exports=bg});var _k=k((jV,Rg)=>{"use strict";var Ag=require("fs"),bt=require("path"),{promisify:kg}=require("util"),so;try{so=require("fsevents")}catch(r){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(r)}if(so){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&&(so=void 0)}}var{EV_ADD:wg,EV_CHANGE:N$,EV_ADD_DIR:hk,EV_UNLINK:Xu,EV_ERROR:D$,STR_DATA:L$,STR_END:B$,FSEVENT_CREATED:j$,FSEVENT_MODIFIED:F$,FSEVENT_DELETED:U$,FSEVENT_MOVED:q$,FSEVENT_UNKNOWN:$$,FSEVENT_FLAG_MUST_SCAN_SUBDIRS:H$,FSEVENT_TYPE_FILE:W$,FSEVENT_TYPE_DIRECTORY:Na,FSEVENT_TYPE_SYMLINK:xk,ROOT_GLOBSTAR:mk,DIR_SUFFIX:G$,DOT_SLASH:gk,FUNCTION_TYPE:Sg,EMPTY_FN:z$,IDENTITY_FN:V$}=Gu(),K$=r=>isNaN(r)?{}:{depth:r},Tg=kg(Ag.stat),Y$=kg(Ag.lstat),vk=kg(Ag.realpath),X$={stat:Tg,lstat:Y$},Pi=new Map,J$=10,Z$=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),Q$=(r,e)=>({stop:so.watch(r,e)});function eH(r,e,t,n){let i=bt.extname(e)?bt.dirname(e):e,s=bt.dirname(i),o=Pi.get(i);tH(s)&&(i=s);let a=bt.resolve(r),c=a!==e,l=(f,d,g)=>{c&&(f=f.replace(e,a)),(f===a||!f.indexOf(a+bt.sep))&&t(f,d,g)},u=!1;for(let f of Pi.keys())if(e.indexOf(bt.resolve(f)+bt.sep)===0){i=f,o=Pi.get(i),u=!0;break}return o||u?o.listeners.add(l):(o={listeners:new Set([l]),rawEmitter:n,watcher:Q$(i,(f,d)=>{if(!o.listeners.size||d&H$)return;let g=so.getInfo(f,d);o.listeners.forEach(y=>{y(f,d,g)}),o.rawEmitter(g.event,f,g)})},Pi.set(i,o)),()=>{let f=o.listeners;if(f.delete(l),!f.size&&(Pi.delete(i),o.watcher))return o.watcher.stop().then(()=>{o.rawEmitter=o.watcher=void 0,Object.freeze(o)})}}var tH=r=>{let e=0;for(let t of Pi.keys())if(t.indexOf(r)===0&&(e++,e>=J$))return!0;return!1},rH=()=>so&&Pi.size<128,Eg=(r,e)=>{let t=0;for(;!r.indexOf(e)&&(r=bt.dirname(r))!==e;)t++;return t},yk=(r,e)=>r.type===Na&&e.isDirectory()||r.type===xk&&e.isSymbolicLink()||r.type===W$&&e.isFile(),Cg=class{constructor(e){this.fsw=e}checkIgnored(e,t){let n=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,t))return n.add(e),t&&t.isDirectory()&&n.add(e+mk),!0;n.delete(e),n.delete(e+mk)}addOrChange(e,t,n,i,s,o,a,c){let l=s.has(o)?N$:wg;this.handleEvent(l,e,t,n,i,s,o,a,c)}async checkExists(e,t,n,i,s,o,a,c){try{let l=await Tg(e);if(this.fsw.closed)return;yk(a,l)?this.addOrChange(e,t,n,i,s,o,a,c):this.handleEvent(Xu,e,t,n,i,s,o,a,c)}catch(l){l.code==="EACCES"?this.addOrChange(e,t,n,i,s,o,a,c):this.handleEvent(Xu,e,t,n,i,s,o,a,c)}}handleEvent(e,t,n,i,s,o,a,c,l){if(!(this.fsw.closed||this.checkIgnored(t)))if(e===Xu){let u=c.type===Na;(u||o.has(a))&&this.fsw._remove(s,a,u)}else{if(e===wg){if(c.type===Na&&this.fsw._getWatchedDir(t),c.type===xk&&l.followSymlinks){let f=l.depth===void 0?void 0:Eg(n,i)+1;return this._addToFsEvents(t,!1,!0,f)}this.fsw._getWatchedDir(s).add(a)}let u=c.type===Na?e+G$:e;this.fsw._emit(u,t),u===hk&&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=eH(e,t,async(c,l,u)=>{if(this.fsw.closed||s.depth!==void 0&&Eg(c,t)>s.depth)return;let f=n(bt.join(e,bt.relative(e,c)));if(i&&!i(f))return;let d=bt.dirname(f),g=bt.basename(f),y=this.fsw._getWatchedDir(u.type===Na?f:d);if(Z$.has(l)||u.event===$$)if(typeof s.ignored===Sg){let b;try{b=await Tg(f)}catch{}if(this.fsw.closed||this.checkIgnored(f,b))return;yk(u,b)?this.addOrChange(f,c,t,d,y,g,u,s):this.handleEvent(Xu,f,c,t,d,y,g,u,s)}else this.checkExists(f,c,t,d,y,g,u,s);else switch(u.event){case j$:case F$:return this.addOrChange(f,c,t,d,y,g,u,s);case U$:case q$:return this.checkExists(f,c,t,d,y,g,u,s)}},this.fsw._emitRaw);return this.fsw._emitReady(),a}async _handleFsEventsSymlink(e,t,n,i){if(!(this.fsw.closed||this.fsw._symlinkPaths.has(t))){this.fsw._symlinkPaths.set(t,!0),this.fsw._incrReadyCount();try{let s=await vk(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!==gk?a=o.replace(s,e):o!==gk&&(a=bt.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(bt.dirname(o)),l=bt.basename(o);a&&this.fsw._getWatchedDir(o),!c.has(l)&&(c.add(l),(!i.ignoreInitial||s===!0)&&this.fsw._emit(a?hk:wg,o,t))}initWatch(e,t,n,i){if(this.fsw.closed)return;let s=this._watchWithFsEvents(n.watchPath,bt.resolve(e||n.watchPath),i,n.globFilter);this.fsw._addPathCloser(t,s)}async _addToFsEvents(e,t,n,i){if(this.fsw.closed)return;let s=this.fsw.options,o=typeof t===Sg?t:V$,a=this.fsw._getWatchHelpers(e);try{let c=await X$[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))throw null;if(c.isDirectory()){if(a.globFilter||this.emitAdd(o(e),c,o,s,n),i&&i>s.depth)return;this.fsw._readdirp(a.watchPath,{fileFilter:l=>a.filterPath(l),directoryFilter:l=>a.filterDir(l),...K$(s.depth-(i||0))}).on(L$,l=>{if(this.fsw.closed||l.stats.isDirectory()&&!a.filterPath(l))return;let u=bt.join(a.watchPath,l.path),{fullPath:f}=l;if(a.followSymlinks&&l.stats.isSymbolicLink()){let d=s.depth===void 0?void 0:Eg(u,bt.resolve(a.watchPath))+1;this._handleFsEventsSymlink(u,f,o,d)}else this.emitAdd(u,l.stats,o,s,n)}).on(D$,z$).on(B$,()=>{this.fsw._emitReady()})}else this.emitAdd(a.watchPath,c,o,s,n),this.fsw._emitReady()}catch(c){(!c||this.fsw._handleError(c))&&(this.fsw._emitReady(),this.fsw._emitReady())}if(s.persistent&&n!==!0)if(typeof t===Sg)this.initWatch(void 0,e,a,o);else{let c;try{c=await vk(a.watchPath)}catch{}this.initWatch(c,e,a,o)}}};Rg.exports=Cg;Rg.exports.canUse=rH});var Mk=k(Wg=>{"use strict";var{EventEmitter:nH}=require("events"),$g=require("fs"),ue=require("path"),{promisify:Ak}=require("util"),iH=aA(),Dg=hA().default,sH=_A(),Og=lg(),oH=rk(),aH=ag(),cH=dk(),bk=_k(),{EV_ALL:Mg,EV_READY:lH,EV_ADD:Ju,EV_CHANGE:Da,EV_UNLINK:wk,EV_ADD_DIR:uH,EV_UNLINK_DIR:pH,EV_RAW:fH,EV_ERROR:Pg,STR_CLOSE:dH,STR_END:hH,BACK_SLASH_RE:mH,DOUBLE_SLASH_RE:Sk,SLASH_OR_BACK_SLASH_RE:gH,DOT_RE:vH,REPLACER_RE:yH,SLASH:Ig,SLASH_SLASH:xH,BRACE_START:_H,BANG:Lg,ONE_DOT:kk,TWO_DOTS:bH,GLOBSTAR:wH,SLASH_GLOBSTAR:Ng,ANYMATCH_OPTS:Bg,STRING_TYPE:Hg,FUNCTION_TYPE:SH,EMPTY_STR:jg,EMPTY_FN:EH,isWindows:TH,isMacos:CH,isIBMi:AH}=Gu(),kH=Ak($g.stat),RH=Ak($g.readdir),Fg=(r=[])=>Array.isArray(r)?r:[r],Rk=(r,e=[])=>(r.forEach(t=>{Array.isArray(t)?Rk(t,e):e.push(t)}),e),Ek=r=>{let e=Rk(Fg(r));if(!e.every(t=>typeof t===Hg))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(Ok)},Tk=r=>{let e=r.replace(mH,Ig),t=!1;for(e.startsWith(xH)&&(t=!0);e.match(Sk);)e=e.replace(Sk,Ig);return t&&(e=Ig+e),e},Ok=r=>Tk(ue.normalize(Tk(r))),Ck=(r=jg)=>e=>typeof e!==Hg?e:Ok(ue.isAbsolute(e)?e:ue.join(r,e)),OH=(r,e)=>ue.isAbsolute(r)?r:r.startsWith(Lg)?Lg+ue.join(e,r.slice(1)):ue.join(e,r),Lr=(r,e)=>r[e]===void 0,Ug=class{constructor(e,t){this.path=e,this._removeWatcher=t,this.items=new Set}add(e){let{items:t}=this;t&&e!==kk&&e!==bH&&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 RH(n)}catch{this._removeWatcher&&this._removeWatcher(ue.dirname(n),ue.basename(n))}}has(e){let{items:t}=this;if(t)return t.has(e)}getChildren(){let{items:e}=this;if(e)return[...e.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this)}},MH="stat",PH="lstat",qg=class{constructor(e,t,n,i){this.fsw=i,this.path=e=e.replace(yH,jg),this.watchPath=t,this.fullWatchPath=ue.resolve(t),this.hasGlob=t!==e,e===jg&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&n?void 0:!1,this.globFilter=this.hasGlob?Dg(e,void 0,Bg):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(s=>{s.length>1&&s.pop()}),this.followSymlinks=n,this.statMethod=n?MH:PH}checkGlobSymlink(e){return this.globSymlink===void 0&&(this.globSymlink=e.fullParentDir===this.fullWatchPath?!1:{realPath:e.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):e.fullPath}entryPath(e){return ue.join(this.watchPath,ue.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){let{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);let n=this.entryPath(e);return(this.hasGlob&&typeof this.globFilter===SH?this.globFilter(n):!0)&&this.fsw._isntIgnored(n,t)&&this.fsw._hasReadPermissions(t)}getDirParts(e){if(!this.hasGlob)return[];let t=[];return(e.includes(_H)?oH.expand(e):[e]).forEach(i=>{t.push(ue.relative(this.watchPath,i).split(gH))}),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===wH&&(n=!0),n||!t[0][o]||Dg(s,t[0][o],Bg))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}},Zu=class extends nH{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,Lr(t,"persistent")&&(t.persistent=!0),Lr(t,"ignoreInitial")&&(t.ignoreInitial=!1),Lr(t,"ignorePermissionErrors")&&(t.ignorePermissionErrors=!1),Lr(t,"interval")&&(t.interval=100),Lr(t,"binaryInterval")&&(t.binaryInterval=300),Lr(t,"disableGlobbing")&&(t.disableGlobbing=!1),t.enableBinaryInterval=t.binaryInterval!==t.interval,Lr(t,"useFsEvents")&&(t.useFsEvents=!t.usePolling),bk.canUse()||(t.useFsEvents=!1),Lr(t,"usePolling")&&!t.useFsEvents&&(t.usePolling=CH),AH&&(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)),Lr(t,"atomic")&&(t.atomic=!t.usePolling&&!t.useFsEvents),t.atomic&&(this._pendingUnlinks=new Map),Lr(t,"followSymlinks")&&(t.followSymlinks=!0),Lr(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=Fg(t.ignored));let a=0;this._emitReady=()=>{a++,a>=this._readyCount&&(this._emitReady=EH,this._readyEmitted=!0,process.nextTick(()=>this.emit(lH)))},this._emitRaw=(...c)=>this.emit(fH,...c),this._readyEmitted=!1,this.options=t,t.useFsEvents?this._fsEventsHandler=new bk(this):this._nodeFsHandler=new cH(this),Object.freeze(t)}add(e,t,n){let{cwd:i,disableGlobbing:s}=this.options;this.closed=!1;let o=Ek(e);return i&&(o=o.map(a=>{let c=OH(a,i);return s||!Og(a)?c:aH(c)})),o=o.filter(a=>a.startsWith(Lg)?(this._ignoredPaths.add(a.slice(1)),!1):(this._ignoredPaths.delete(a),this._ignoredPaths.delete(a+Ng),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=o.length),this.options.persistent&&(this._readyCount+=o.length),o.forEach(a=>this._fsEventsHandler._addToFsEvents(a))):(this._readyCount||(this._readyCount=0),this._readyCount+=o.length,Promise.all(o.map(async a=>{let c=await this._nodeFsHandler._addToNodeFs(a,!n,0,0,t);return c&&this._emitReady(),c})).then(a=>{this.closed||a.filter(c=>c).forEach(c=>{this.add(ue.dirname(c),ue.basename(t||c))})})),this}unwatch(e){if(this.closed)return this;let t=Ek(e),{cwd:n}=this.options;return t.forEach(i=>{!ue.isAbsolute(i)&&!this._closers.has(i)&&(n&&(i=ue.join(n,i)),i=ue.resolve(i)),this._closePath(i),this._ignoredPaths.add(i),this._watched.has(i)&&this._ignoredPaths.add(i+Ng),this._userIgnored=void 0}),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(t=>t.forEach(n=>{let i=n();i instanceof Promise&&e.push(i)})),this._streams.forEach(t=>t.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(t=>t.dispose()),["closers","watched","streams","symlinkPaths","throttled"].forEach(t=>{this[`_${t}`].clear()}),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((t,n)=>{let i=this.options.cwd?ue.relative(this.options.cwd,n):n;e[i||kk]=t.getChildren().sort()}),e}emitWithAll(e,t){this.emit(...t),e!==Pg&&this.emit(Mg,...t)}async _emit(e,t,n,i,s){if(this.closed)return;let o=this.options;TH&&(t=ue.normalize(t)),o.cwd&&(t=ue.relative(o.cwd,t));let a=[e,t];s!==void 0?a.push(n,i,s):i!==void 0?a.push(n,i):n!==void 0&&a.push(n);let c=o.awaitWriteFinish,l;if(c&&(l=this._pendingWrites.get(t)))return l.lastChange=new Date,this;if(o.atomic){if(e===wk)return this._pendingUnlinks.set(t,a),setTimeout(()=>{this._pendingUnlinks.forEach((u,f)=>{this.emit(...u),this.emit(Mg,...u),this._pendingUnlinks.delete(f)})},typeof o.atomic=="number"?o.atomic:100),this;e===Ju&&this._pendingUnlinks.has(t)&&(e=a[0]=Da,this._pendingUnlinks.delete(t))}if(c&&(e===Ju||e===Da)&&this._readyEmitted){let u=(f,d)=>{f?(e=a[0]=Pg,a[1]=f,this.emitWithAll(e,a)):d&&(a.length>2?a[2]=d:a.push(d),this.emitWithAll(e,a))};return this._awaitWriteFinish(t,c.stabilityThreshold,e,u),this}if(e===Da&&!this._throttle(Da,t,50))return this;if(o.alwaysStat&&n===void 0&&(e===Ju||e===uH||e===Da)){let u=o.cwd?ue.join(o.cwd,t):t,f;try{f=await kH(u)}catch{}if(!f||this.closed)return;a.push(f)}return this.emitWithAll(e,a),this}_handleError(e){let t=e&&e.code;return e&&t!=="ENOENT"&&t!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||t!=="EPERM"&&t!=="EACCES")&&this.emit(Pg,e),e||this.closed}_throttle(e,t,n){this._throttled.has(e)||this._throttled.set(e,new Map);let i=this._throttled.get(e),s=i.get(t);if(s)return s.count++,!1;let o,a=()=>{let l=i.get(t),u=l?l.count:0;return i.delete(t),clearTimeout(o),l&&clearTimeout(l.timeoutObject),u};o=setTimeout(a,n);let c={timeoutObject:o,clear:a,count:0};return i.set(t,c),c}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,n,i){let s,o=e;this.options.cwd&&!ue.isAbsolute(e)&&(o=ue.join(this.options.cwd,e));let a=new Date,c=l=>{$g.stat(o,(u,f)=>{if(u||!this._pendingWrites.has(e)){u&&u.code!=="ENOENT"&&i(u);return}let d=Number(new Date);l&&f.size!==l.size&&(this._pendingWrites.get(e).lastChange=d);let g=this._pendingWrites.get(e);d-g.lastChange>=t?(this._pendingWrites.delete(e),i(void 0,f)):s=setTimeout(c,this.options.awaitWriteFinish.pollInterval,f)})};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:a,cancelWait:()=>(this._pendingWrites.delete(e),clearTimeout(s),n)}),s=setTimeout(c,this.options.awaitWriteFinish.pollInterval))}_getGlobIgnored(){return[...this._ignoredPaths.values()]}_isIgnored(e,t){if(this.options.atomic&&vH.test(e))return!0;if(!this._userIgnored){let{cwd:n}=this.options,i=this.options.ignored,s=i&&i.map(Ck(n)),o=Fg(s).filter(c=>typeof c===Hg&&!Og(c)).map(c=>c+Ng),a=this._getGlobIgnored().map(Ck(n)).concat(s,o);this._userIgnored=Dg(a,void 0,Bg)}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:sH(e),i=this.options.followSymlinks;return new qg(e,n,i,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));let t=ue.resolve(e);return this._watched.has(t)||this._watched.set(t,new Ug(t,this._boundRemove)),this._watched.get(t)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return!0;let n=(e&&Number.parseInt(e.mode,10))&511;return!!(4&Number.parseInt(n.toString(8)[0],10))}_remove(e,t,n){let i=ue.join(e,t),s=ue.resolve(i);if(n=n??(this._watched.has(i)||this._watched.has(s)),!this._throttle("remove",i,100))return;!n&&!this.options.useFsEvents&&this._watched.size===1&&this.add(e,t,!0),this._getWatchedDir(i).getChildren().forEach(d=>this._remove(i,d));let c=this._getWatchedDir(e),l=c.has(t);c.remove(t),this._symlinkPaths.has(s)&&this._symlinkPaths.delete(s);let u=i;if(this.options.cwd&&(u=ue.relative(this.options.cwd,i)),this.options.awaitWriteFinish&&this._pendingWrites.has(u)&&this._pendingWrites.get(u).cancelWait()===Ju)return;this._watched.delete(i),this._watched.delete(s);let f=n?pH:wk;l&&!this._isIgnored(i)&&this._emit(f,i),this.options.useFsEvents||this._closePath(i)}_closePath(e){this._closeFile(e);let t=ue.dirname(e);this._getWatchedDir(t).remove(ue.basename(e))}_closeFile(e){let t=this._closers.get(e);t&&(t.forEach(n=>n()),this._closers.delete(e))}_addPathCloser(e,t){if(!t)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(t)}_readdirp(e,t){if(this.closed)return;let n={type:Mg,alwaysStat:!0,lstat:!0,...t},i=iH(e,n);return this._streams.add(i),i.once(dH,()=>{i=void 0}),i.once(hH,()=>{i&&(this._streams.delete(i),i=void 0)}),i}};Wg.FSWatcher=Zu;var IH=(r,e)=>{let t=new Zu(e);return t.add(r),t};Wg.watch=IH});var bR=k((v5,Jg)=>{"use strict";var zH=Object.prototype.hasOwnProperty,Bt="~";function Fa(){}Object.create&&(Fa.prototype=Object.create(null),new Fa().__proto__||(Bt=!1));function VH(r,e,t){this.fn=r,this.context=e,this.once=t||!1}function _R(r,e,t,n,i){if(typeof t!="function")throw new TypeError("The listener must be a function");var s=new VH(t,n||r,i),o=Bt?Bt+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 cp(r,e){--r._eventsCount===0?r._events=new Fa:delete r._events[e]}function Rt(){this._events=new Fa,this._eventsCount=0}Rt.prototype.eventNames=function(){var e=[],t,n;if(this._eventsCount===0)return e;for(n in t=this._events)zH.call(t,n)&&e.push(Bt?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};Rt.prototype.listeners=function(e){var t=Bt?Bt+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};Rt.prototype.listenerCount=function(e){var t=Bt?Bt+e:e,n=this._events[t];return n?n.fn?1:n.length:0};Rt.prototype.emit=function(e,t,n,i,s,o){var a=Bt?Bt+e:e;if(!this._events[a])return!1;var c=this._events[a],l=arguments.length,u,f;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,s),!0;case 6:return c.fn.call(c.context,t,n,i,s,o),!0}for(f=1,u=new Array(l-1);f<l;f++)u[f-1]=arguments[f];c.fn.apply(c.context,u)}else{var d=c.length,g;for(f=0;f<d;f++)switch(c[f].once&&this.removeListener(e,c[f].fn,void 0,!0),l){case 1:c[f].fn.call(c[f].context);break;case 2:c[f].fn.call(c[f].context,t);break;case 3:c[f].fn.call(c[f].context,t,n);break;case 4:c[f].fn.call(c[f].context,t,n,i);break;default:if(!u)for(g=1,u=new Array(l-1);g<l;g++)u[g-1]=arguments[g];c[f].fn.apply(c[f].context,u)}}return!0};Rt.prototype.on=function(e,t,n){return _R(this,e,t,n,!1)};Rt.prototype.once=function(e,t,n){return _R(this,e,t,n,!0)};Rt.prototype.removeListener=function(e,t,n,i){var s=Bt?Bt+e:e;if(!this._events[s])return this;if(!t)return cp(this,s),this;var o=this._events[s];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&cp(this,s);else{for(var a=0,c=[],l=o.length;a<l;a++)(o[a].fn!==t||i&&!o[a].once||n&&o[a].context!==n)&&c.push(o[a]);c.length?this._events[s]=c.length===1?c[0]:c:cp(this,s)}return this};Rt.prototype.removeAllListeners=function(e){var t;return e?(t=Bt?Bt+e:e,this._events[t]&&cp(this,t)):(this._events=new Fa,this._eventsCount=0),this};Rt.prototype.off=Rt.prototype.removeListener;Rt.prototype.addListener=Rt.prototype.on;Rt.prefixed=Bt;Rt.EventEmitter=Rt;typeof Jg<"u"&&(Jg.exports=Rt)});var SR=k((y5,wR)=>{"use strict";wR.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 lp=k(TR=>{var On=TR,KH=require("url"),ER=require("util")._extend,YH=SR(),XH=/(^|,)\s*upgrade\s*($|,)/i,Zg=/^https|wss/;On.isSSL=Zg;On.setupOutgoing=function(r,e,t,n){r.port=e[n||"target"].port||(Zg.test(e[n||"target"].protocol)?443:80),["host","hostname","socketPath","pfx","key","passphrase","cert","ca","ciphers","secureProtocol"].forEach(function(a){r[a]=e[n||"target"][a]}),r.method=e.method||t.method,r.headers=ER({},t.headers),e.headers&&ER(r.headers,e.headers),e.auth&&(r.auth=e.auth),e.ca&&(r.ca=e.ca),Zg.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"||!XH.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:KH.parse(t.url).path||"";return o=e.ignorePath?"":o,r.path=On.urlJoin(s,o),e.changeOrigin&&(r.headers.host=YH(r.port,e[n||"target"].protocol)&&!JH(r.host)?r.host+":"+r.port:r.host),r};On.setupSocket=function(r){return r.setTimeout(0),r.setNoDelay(!0),r.setKeepAlive(!0,0),r};On.getPort=function(r){var e=r.headers.host?r.headers.host.match(/:(\d+)/):"";return e?e[1]:On.hasEncryptedConnection(r)?"443":"80"};On.hasEncryptedConnection=function(r){return!!(r.connection.encrypted||r.connection.pair)};On.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("?")};On.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 JH(r){return!!~r.indexOf(":")}});var RR=k((_5,kR)=>{var CR=require("url"),AR=lp(),ZH=/^201|30(1|2|7|8)$/;kR.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&&ZH.test(n.statusCode)){var s=CR.parse(i.target),o=CR.parse(n.headers.location);if(s.host!=o.host)return;i.hostRewrite?o.host=i.hostRewrite:i.autoRewrite&&(o.host=e.headers.host),i.protocolRewrite&&(o.protocol=i.protocolRewrite),n.headers.location=o.format()}},writeHeaders:function(e,t,n,i){var s=i.cookieDomainRewrite,o=i.cookiePathRewrite,a=i.preserveHeaderKeyCase,c,l=function(d,g){g!=null&&(s&&d.toLowerCase()==="set-cookie"&&(g=AR.rewriteCookieProperty(g,s,"domain")),o&&d.toLowerCase()==="set-cookie"&&(g=AR.rewriteCookieProperty(g,o,"path")),t.setHeader(String(d).trim(),g))};if(typeof s=="string"&&(s={"*":s}),typeof o=="string"&&(o={"*":o}),a&&n.rawHeaders!=null){c={};for(var u=0;u<n.rawHeaders.length;u+=2){var f=n.rawHeaders[u];c[f.toLowerCase()]=f}}Object.keys(n.headers).forEach(function(d){var g=n.headers[d];a&&c&&(d=c[d]||d),l(d,g)})},writeStatusCode:function(e,t,n){n.statusMessage?(t.statusCode=n.statusCode,t.statusMessage=n.statusMessage):t.statusCode=n.statusCode}}});var MR=k((b5,OR)=>{var Ua;OR.exports=function(){if(!Ua){try{Ua=Re()("follow-redirects")}catch{}typeof Ua!="function"&&(Ua=function(){})}Ua.apply(null,arguments)}});var LR=k((w5,uv)=>{var $a=require("url"),qa=$a.URL,QH=require("http"),e4=require("https"),nv=require("stream").Writable,iv=require("assert"),PR=MR();(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 sv=!1;try{iv(new qa(""))}catch(r){sv=r.code==="ERR_INVALID_URL"}var t4=["Authorization","Proxy-Authorization","Cookie"],r4=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],ov=["abort","aborted","connect","error","socket","timeout"],av=Object.create(null);ov.forEach(function(r){av[r]=function(e,t,n){this._redirectable.emit(r,e,t,n)}});var ev=Ha("ERR_INVALID_URL","Invalid URL",TypeError),tv=Ha("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),n4=Ha("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",tv),i4=Ha("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),s4=Ha("ERR_STREAM_WRITE_AFTER_END","write after end"),o4=nv.prototype.destroy||NR;function Kt(r,e){nv.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 tv?i:new tv({cause:i}))}},this._headerFilter=new RegExp("^(?:"+t4.concat(r.sensitiveHeaders).map(f4).join("|")+")$","i"),this._performRequest()}Kt.prototype=Object.create(nv.prototype);Kt.prototype.abort=function(){lv(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};Kt.prototype.destroy=function(r){return lv(this._currentRequest,r),o4.call(this,r),this};Kt.prototype.write=function(r,e,t){if(this._ending)throw new s4;if(!Li(r)&&!u4(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 i4),this.abort())};Kt.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}};Kt.prototype.setHeader=function(r,e){this._options.headers[r]=e,this._currentRequest.setHeader(r,e)};Kt.prototype.removeHeader=function(r){delete this._options.headers[r],this._currentRequest.removeHeader(r)};Kt.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){Kt.prototype[r]=function(e,t){return this._currentRequest[r](e,t)}});["aborted","connection","socket"].forEach(function(r){Object.defineProperty(Kt.prototype,r,{get:function(){return this._currentRequest[r]}})});Kt.prototype._sanitizeOptions=function(r){if(r.headers||(r.headers={}),l4(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))}};Kt.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 ov)n.on(i,av[i]);if(this._currentUrl=/^\//.test(this._options.path)?$a.format(this._options):this._options.path,this._isRedirect){var s=0,o=this,a=this._requestBodyBuffers;(function c(l){if(n===o._currentRequest)if(l)o.emit("error",l);else if(s<a.length){var u=a[s++];n.finished||n.write(u.data,u.encoding,c)}else o._ended&&n.end()})()}};Kt.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(lv(this._currentRequest),r.destroy(),++this._redirectCount>this._options.maxRedirects)throw new n4;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=[],Qg(/^content-/i,this._options.headers));var o=Qg(/^host$/i,this._options.headers),a=cv(this._currentUrl),c=o||a.host,l=/^\w+:/.test(t)?this._currentUrl:$a.format(Object.assign(a,{host:c})),u=a4(t,l);if(PR("redirecting to",u.href),this._isRedirect=!0,rv(u,this._options),(u.protocol!==a.protocol&&u.protocol!=="https:"||u.host!==c&&!c4(u.host,c))&&Qg(this._headerFilter,this._options.headers),Bi(i)){var f={headers:r.headers,statusCode:e},d={url:l,method:s,headers:n};i(this._options,f,d),this._sanitizeOptions(this._options)}this._performRequest()};function IR(r){var e={maxRedirects:21,maxBodyLength:10485760},t={};return Object.keys(r).forEach(function(n){var i=n+":",s=t[i]=r[n],o=e[n]=Object.create(s);function a(l,u,f){return p4(l)?l=rv(l):Li(l)?l=rv(cv(l)):(f=u,u=DR(l),l={protocol:i}),Bi(u)&&(f=u,u=null),u=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},l,u),u.nativeProtocols=t,!Li(u.host)&&!Li(u.hostname)&&(u.hostname="::1"),iv.equal(u.protocol,i,"protocol mismatch"),PR("options",u),new Kt(u,f)}function c(l,u,f){var d=o.request(l,u,f);return d.end(),d}Object.defineProperties(o,{request:{value:a,configurable:!0,enumerable:!0,writable:!0},get:{value:c,configurable:!0,enumerable:!0,writable:!0}})}),e}function NR(){}function cv(r){var e;if(sv)e=new qa(r);else if(e=DR($a.parse(r)),!Li(e.protocol))throw new ev({input:r});return e}function a4(r,e){return sv?new qa(r,e):cv($a.resolve(e,r))}function DR(r){if(/^\[/.test(r.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(r.hostname))throw new ev({input:r.href||r});if(/^\[/.test(r.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(r.host))throw new ev({input:r.href||r});return r}function rv(r,e){var t=e||{};for(var n of r4)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 Qg(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 Ha(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 lv(r,e){for(var t of ov)r.removeListener(t,av[t]);r.on("error",NR),r.destroy(e)}function c4(r,e){iv(Li(r)&&Li(e));var t=r.length-e.length-1;return t>0&&r[t]==="."&&r.endsWith(e)}function l4(r){return r instanceof Array}function Li(r){return typeof r=="string"||r instanceof String}function Bi(r){return typeof r=="function"}function u4(r){return typeof r=="object"&&"length"in r}function p4(r){return qa&&r instanceof qa}function f4(r){return r.replace(/[\]\\/()*+?.$]/g,"\\$&")}uv.exports=IR({http:QH,https:e4});uv.exports.wrap=IR});var jR=k((S5,BR)=>{var d4=require("http"),h4=require("https"),Wa=RR(),up=lp(),m4=LR();Wa=Object.keys(Wa).map(function(r){return Wa[r]});var g4={http:d4,https:h4};BR.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||up.hasEncryptedConnection(e),s={for:e.connection.remoteAddress||e.socket.remoteAddress,port:up.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?m4:g4,c=a.http,l=a.https;if(n.forward){var u=(n.forward.protocol==="https:"?l:c).request(up.setupOutgoing(n.ssl||{},n,e,"forward")),f=y(u,n.forward);if(e.on("error",f),u.on("error",f),(n.buffer||e).pipe(u),!n.target)return t.end()}var d=(n.target.protocol==="https:"?l:c).request(up.setupOutgoing(n.ssl||{},n,e));d.on("socket",function(b){s&&!d.getHeader("expect")&&s.emit("proxyReq",d,e,t,n)}),n.proxyTimeout&&d.setTimeout(n.proxyTimeout,function(){d.abort()}),e.on("aborted",function(){d.abort()});var g=y(d,n.target);e.on("error",g),d.on("error",g);function y(b,C){return function(M){if(e.socket.destroyed&&M.code==="ECONNRESET")return s.emit("econnreset",M,e,t,C),b.abort();o?o(M,e,t,C):s.emit("error",M,e,t,C)}}(n.buffer||e).pipe(d),d.on("response",function(b){if(s&&s.emit("proxyRes",b,e,t),!t.headersSent&&!n.selfHandleResponse)for(var C=0;C<Wa.length&&!Wa[C](e,t,b,n);C++);t.finished?s&&s.emit("end",e,t,b):(b.on("end",function(){s&&s.emit("end",e,t,b)}),n.selfHandleResponse||b.pipe(t))})}}});var UR=k((E5,FR)=>{var v4=require("http"),y4=require("https"),ho=lp();FR.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:ho.getPort(e),proto:ho.hasEncryptedConnection(e)?"wss":"ws"};["for","port","proto"].forEach(function(s){e.headers["x-forwarded-"+s]=(e.headers["x-forwarded-"+s]||"")+(e.headers["x-forwarded-"+s]?",":"")+i[s]})}},stream:function(e,t,n,i,s,o){var a=function(u,f){return Object.keys(f).reduce(function(d,g){var y=f[g];if(!Array.isArray(y))return d.push(g+": "+y),d;for(var b=0;b<y.length;b++)d.push(g+": "+y[b]);return d},[u]).join(`\r
|
|
103
|
+
`;let c=(0,F3.parseProxyResponse)(i);i.write(`${a}\r
|
|
104
|
+
`);let{connect:l,buffered:u}=await c;if(e.emit("proxyConnect",l),this.emit("proxyConnect",l,e),l.statusCode===200)return e.once("socket",U3),t.secureEndpoint?(va("Upgrading socket connection to TLS"),HT.connect({...GT(WT(t),"host","path","port"),socket:i})):i;i.destroy();let f=new Tu.Socket({writable:!1});return f.readable=!0,e.once("socket",d=>{va("Replaying proxy buffer for failed request"),(0,D3.default)(d.listenerCount("data")>0),d.push(u),d.push(null)}),f}};Cu.protocols=["http","https"];br.HttpsProxyAgent=Cu;function U3(r){r.resume()}function GT(r,...e){let t={},n;for(n in r)e.includes(n)||(t[n]=r[n]);return t}});var QT=A((Nz,ZT)=>{"use strict";var XT=require("url"),JT=require("https"),q3=qm(),ku=Bm(),$3=Um(),nr=_u(),H3=Dm(),YT=2419200,Hm="",Wm;function ya(){}ya.prototype.setGCMAPIKey=function(r){if(r===null){Hm=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.");Hm=r};ya.prototype.setVapidDetails=function(r,e,t){if(arguments.length===1&&arguments[0]===null){Wm=null;return}ku.validateSubject(r),ku.validatePublicKey(e),ku.validatePrivateKey(t),Wm={subject:r,publicKey:e,privateKey:t}};ya.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=Hm,i=Wm,s=YT,o={},a=nr.supportedContentEncodings.AES_128_GCM,c=nr.supportedUrgency.NORMAL,l,u,f,d;if(t){let R=["headers","gcmAPIKey","vapidDetails","TTL","contentEncoding","urgency","topic","proxy","agent","timeout"],O=Object.keys(t);for(let P=0;P<O.length;P+=1){let B=O[P];if(!R.includes(B))throw new Error("'"+B+"' is an invalid option. The valid options are ['"+R.join("', '")+"'].")}if(t.headers){o=t.headers;let P=Object.keys(o).filter(function(B){return typeof t[B]<"u"});if(P.length>0)throw new Error("Duplicated headers defined ["+P.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===nr.supportedContentEncodings.AES_128_GCM||t.contentEncoding===nr.supportedContentEncodings.AES_GCM)a=t.contentEncoding;else throw new Error("Unsupported content encoding specified.");if(t.urgency)if(t.urgency===nr.supportedUrgency.VERY_LOW||t.urgency===nr.supportedUrgency.LOW||t.urgency===nr.supportedUrgency.NORMAL||t.urgency===nr.supportedUrgency.HIGH)c=t.urgency;else throw new Error("Unsupported urgency specified.");if(t.topic){if(!H3.validate(t.topic))throw new Error("Unsupported characters set use the URL or filename-safe Base64 characters set");if(t.topic.length>32)throw new Error("use maximum of 32 characters from the URL or filename-safe Base64 characters set");l=t.topic}t.proxy&&(typeof t.proxy=="string"||typeof t.proxy.host=="string"?u=t.proxy:console.warn("Attempt to use proxy option, but invalid type it should be a string or proxy options object.")),t.agent&&(t.agent instanceof JT.Agent?(u&&console.warn("Agent option will be ignored because proxy option is defined."),f=t.agent):console.warn("Wrong type for the agent option, it should be an instance of https.Agent.")),typeof t.timeout=="number"&&(d=t.timeout)}typeof s>"u"&&(s=YT);let g={method:"POST",headers:{TTL:s}};Object.keys(o).forEach(function(R){g.headers[R]=o[R]});let y=null;if(e){let R=$3.encrypt(r.keys.p256dh,r.keys.auth,e,a);g.headers["Content-Length"]=R.cipherText.length,g.headers["Content-Type"]="application/octet-stream",a===nr.supportedContentEncodings.AES_128_GCM?g.headers["Content-Encoding"]=nr.supportedContentEncodings.AES_128_GCM:a===nr.supportedContentEncodings.AES_GCM&&(g.headers["Content-Encoding"]=nr.supportedContentEncodings.AES_GCM,g.headers.Encryption="salt="+R.salt,g.headers["Crypto-Key"]="dh="+R.localPublicKey.toString("base64url")),y=R.cipherText}else g.headers["Content-Length"]=0;let b=r.endpoint.startsWith("https://android.googleapis.com/gcm/send"),C=r.endpoint.startsWith("https://fcm.googleapis.com/fcm/send");if(b)n?g.headers.Authorization="key="+n:console.warn("Attempt to send push notification to GCM endpoint, but no GCM key is defined. Please use setGCMApiKey() or add 'gcmAPIKey' as an option.");else if(i){let R=XT.parse(r.endpoint),O=R.protocol+"//"+R.host,P=ku.getVapidHeaders(O,i.subject,i.publicKey,i.privateKey,a);g.headers.Authorization=P.Authorization,a===nr.supportedContentEncodings.AES_GCM&&(g.headers["Crypto-Key"]?g.headers["Crypto-Key"]+=";"+P["Crypto-Key"]:g.headers["Crypto-Key"]=P["Crypto-Key"])}else C&&n&&(g.headers.Authorization="key="+n);return g.headers.Urgency=c,l&&(g.headers.Topic=l),g.body=y,g.endpoint=r.endpoint,u&&(g.proxy=u),f&&(g.agent=f),d&&(g.timeout=d),g};ya.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=XT.parse(n.endpoint);if(o.hostname=a.hostname,o.port=a.port,o.path=a.path,o.headers=n.headers,o.method=n.method,n.timeout&&(o.timeout=n.timeout),n.agent&&(o.agent=n.agent),n.proxy){let{HttpsProxyAgent:l}=KT();o.agent=new l(n.proxy)}let c=JT.request(o,function(l){let u="";l.on("data",function(f){u+=f}),l.on("end",function(){l.statusCode<200||l.statusCode>299?s(new q3("Received unexpected response code",l.statusCode,l.headers,u,n.endpoint)):i({statusCode:l.statusCode,body:u,headers:l.headers})})});n.timeout&&c.on("timeout",function(){c.destroy(new Error("Socket timeout"))}),c.on("error",function(l){s(l)}),n.body&&c.write(n.body),c.end()})};ZT.exports=ya});var rC=A((Dz,tC)=>{"use strict";var eC=Bm(),W3=Um(),G3=QT(),z3=qm(),V3=_u(),xa=new G3;tC.exports={WebPushError:z3,supportedContentEncodings:V3.supportedContentEncodings,encrypt:W3.encrypt,getVapidHeaders:eC.getVapidHeaders,generateVAPIDKeys:eC.generateVAPIDKeys,setGCMAPIKey:xa.setGCMAPIKey,setVapidDetails:xa.setVapidDetails,generateRequestDetails:xa.generateRequestDetails,sendNotification:xa.sendNotification.bind(xa)}});var Ea=A((yV,$C)=>{"use strict";var TU=require("path"),en="\\\\/",jC=`[^${en}]`,CU=0,An="\\.",kU="\\+",AU="\\?",Nu="\\/",RU="(?=.)",FC="[^/]",Xm=`(?:${Nu}|$)`,UC=`(?:^|${Nu})`,Jm=`${An}{1,2}${Xm}`,OU=`(?!${An})`,MU=`(?!${UC}${Jm})`,PU=`(?!${An}{0,1}${Xm})`,IU=`(?!${Jm})`,NU=`[^.${Nu}]`,DU=`${FC}*?`,qC={DOT_LITERAL:An,PLUS_LITERAL:kU,QMARK_LITERAL:AU,SLASH_LITERAL:Nu,ONE_CHAR:RU,QMARK:FC,END_ANCHOR:Xm,DOTS_SLASH:Jm,NO_DOT:OU,NO_DOTS:MU,NO_DOT_SLASH:PU,NO_DOTS_SLASH:IU,QMARK_NO_DOT:NU,STAR:DU,START_ANCHOR:UC},LU={...qC,SLASH_LITERAL:`[${en}]`,QMARK:jC,STAR:`${jC}*?`,DOTS_SLASH:`${An}{1,2}(?:[${en}]|$)`,NO_DOT:`(?!${An})`,NO_DOTS:`(?!(?:^|[${en}])${An}{1,2}(?:[${en}]|$))`,NO_DOT_SLASH:`(?!${An}{0,1}(?:[${en}]|$))`,NO_DOTS_SLASH:`(?!${An}{1,2}(?:[${en}]|$))`,QMARK_NO_DOT:`[^.${en}]`,START_ANCHOR:`(?:^|[${en}])`,END_ANCHOR:`(?:[${en}]|$)`},BU={__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"};$C.exports={DEFAULT_MAX_EXTGLOB_RECURSION:CU,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:BU,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:TU.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?LU:qC}}});var Du=A(zt=>{"use strict";var jU=require("path"),FU=process.platform==="win32",{REGEX_BACKSLASH:UU,REGEX_REMOVE_BACKSLASH:qU,REGEX_SPECIAL_CHARS:$U,REGEX_SPECIAL_CHARS_GLOBAL:HU}=Ea();zt.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r);zt.hasRegexChars=r=>$U.test(r);zt.isRegexChar=r=>r.length===1&&zt.hasRegexChars(r);zt.escapeRegex=r=>r.replace(HU,"\\$1");zt.toPosixSlashes=r=>r.replace(UU,"/");zt.removeBackslashes=r=>r.replace(qU,e=>e==="\\"?"":e);zt.supportsLookbehinds=()=>{let r=process.version.slice(1).split(".").map(Number);return r.length===3&&r[0]>=9||r[0]===8&&r[1]>=10};zt.isWindows=r=>r&&typeof r.windows=="boolean"?r.windows:FU===!0||jU.sep==="\\";zt.escapeLast=(r,e,t)=>{let n=r.lastIndexOf(e,t);return n===-1?r:r[n-1]==="\\"?zt.escapeLast(r,e,n-1):`${r.slice(0,n)}\\${r.slice(n)}`};zt.removePrefix=(r,e={})=>{let t=r;return t.startsWith("./")&&(t=t.slice(2),e.prefix="./"),t};zt.wrapOutput=(r,e={},t={})=>{let n=t.contains?"":"^",i=t.contains?"":"$",s=`${n}(?:${r})${i}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s}});var XC=A((_V,YC)=>{"use strict";var HC=Du(),{CHAR_ASTERISK:Zm,CHAR_AT:WU,CHAR_BACKWARD_SLASH:Ta,CHAR_COMMA:GU,CHAR_DOT:Qm,CHAR_EXCLAMATION_MARK:eg,CHAR_FORWARD_SLASH:KC,CHAR_LEFT_CURLY_BRACE:tg,CHAR_LEFT_PARENTHESES:rg,CHAR_LEFT_SQUARE_BRACKET:zU,CHAR_PLUS:VU,CHAR_QUESTION_MARK:WC,CHAR_RIGHT_CURLY_BRACE:KU,CHAR_RIGHT_PARENTHESES:GC,CHAR_RIGHT_SQUARE_BRACKET:YU}=Ea(),zC=r=>r===KC||r===Ta,VC=r=>{r.isPrefix!==!0&&(r.depth=r.isGlobstar?1/0:1)},XU=(r,e)=>{let t=e||{},n=r.length-1,i=t.parts===!0||t.scanToEnd===!0,s=[],o=[],a=[],c=r,l=-1,u=0,f=0,d=!1,g=!1,y=!1,b=!1,C=!1,R=!1,O=!1,P=!1,B=!1,G=!1,F=0,V,D,$={value:"",depth:0,isGlob:!1},T=()=>l>=n,p=()=>c.charCodeAt(l+1),m=()=>(V=D,c.charCodeAt(++l));for(;l<n;){D=m();let k;if(D===Ta){O=$.backslashes=!0,D=m(),D===tg&&(R=!0);continue}if(R===!0||D===tg){for(F++;T()!==!0&&(D=m());){if(D===Ta){O=$.backslashes=!0,m();continue}if(D===tg){F++;continue}if(R!==!0&&D===Qm&&(D=m())===Qm){if(d=$.isBrace=!0,y=$.isGlob=!0,G=!0,i===!0)continue;break}if(R!==!0&&D===GU){if(d=$.isBrace=!0,y=$.isGlob=!0,G=!0,i===!0)continue;break}if(D===KU&&(F--,F===0)){R=!1,d=$.isBrace=!0,G=!0;break}}if(i===!0)continue;break}if(D===KC){if(s.push(l),o.push($),$={value:"",depth:0,isGlob:!1},G===!0)continue;if(V===Qm&&l===u+1){u+=2;continue}f=l+1;continue}if(t.noext!==!0&&(D===VU||D===WU||D===Zm||D===WC||D===eg)===!0&&p()===rg){if(y=$.isGlob=!0,b=$.isExtglob=!0,G=!0,D===eg&&l===u&&(B=!0),i===!0){for(;T()!==!0&&(D=m());){if(D===Ta){O=$.backslashes=!0,D=m();continue}if(D===GC){y=$.isGlob=!0,G=!0;break}}continue}break}if(D===Zm){if(V===Zm&&(C=$.isGlobstar=!0),y=$.isGlob=!0,G=!0,i===!0)continue;break}if(D===WC){if(y=$.isGlob=!0,G=!0,i===!0)continue;break}if(D===zU){for(;T()!==!0&&(k=m());){if(k===Ta){O=$.backslashes=!0,m();continue}if(k===YU){g=$.isBracket=!0,y=$.isGlob=!0,G=!0;break}}if(i===!0)continue;break}if(t.nonegate!==!0&&D===eg&&l===u){P=$.negated=!0,u++;continue}if(t.noparen!==!0&&D===rg){if(y=$.isGlob=!0,i===!0){for(;T()!==!0&&(D=m());){if(D===rg){O=$.backslashes=!0,D=m();continue}if(D===GC){G=!0;break}}continue}break}if(y===!0){if(G=!0,i===!0)continue;break}}t.noext===!0&&(b=!1,y=!1);let x=c,S="",v="";u>0&&(S=c.slice(0,u),c=c.slice(u),f-=u),x&&y===!0&&f>0?(x=c.slice(0,f),v=c.slice(f)):y===!0?(x="",v=c):x=c,x&&x!==""&&x!=="/"&&x!==c&&zC(x.charCodeAt(x.length-1))&&(x=x.slice(0,-1)),t.unescape===!0&&(v&&(v=HC.removeBackslashes(v)),x&&O===!0&&(x=HC.removeBackslashes(x)));let _={prefix:S,input:r,start:u,base:x,glob:v,isBrace:d,isBracket:g,isGlob:y,isExtglob:b,isGlobstar:C,negated:P,negatedExtglob:B};if(t.tokens===!0&&(_.maxDepth=0,zC(D)||o.push($),_.tokens=o),t.parts===!0||t.tokens===!0){let k;for(let w=0;w<s.length;w++){let h=k?k+1:u,E=s[w],q=r.slice(h,E);t.tokens&&(w===0&&u!==0?(o[w].isPrefix=!0,o[w].value=S):o[w].value=q,VC(o[w]),_.maxDepth+=o[w].depth),(w!==0||q!=="")&&a.push(q),k=E}if(k&&k+1<r.length){let w=r.slice(k+1);a.push(w),t.tokens&&(o[o.length-1].value=w,VC(o[o.length-1]),_.maxDepth+=o[o.length-1].depth)}_.slashes=s,_.parts=a}return _};YC.exports=XU});var tk=A((bV,ek)=>{"use strict";var Ca=Ea(),At=Du(),{MAX_LENGTH:Lu,POSIX_REGEX_SOURCE:JU,REGEX_NON_SPECIAL_CHARS:ZU,REGEX_SPECIAL_CHARS_BACKREF:QU,REPLACEMENTS:JC}=Ca,eq=(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=>At.escapeRegex(i)).join("..")}return t},to=(r,e)=>`Missing ${r}: "${e}" - use "\\\\${e}" to match literal characters`,ZC=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},tq=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},QC=r=>{let e=r.trim(),t=!0;for(;t===!0;)t=!1,/^@\([^\\()[\]{}|]+\)$/.test(e)&&(e=e.slice(2,-1),t=!0);if(tq(e))return e.replace(/\\(.)/g,"$1")},rq=r=>{let e=r.map(QC).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},ng=(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}}}}},nq=r=>{let e=0,t=[];for(;e<r.length;){let i=ng(r.slice(e),!1);if(!i||i.type!=="*")return;let s=ZC(i.body).map(a=>a.trim());if(s.length!==1)return;let o=QC(s[0]);if(!o||o.length!==1)return;t.push(o),e+=i.end+1}return t.length<1?void 0:`${t.length===1?At.escapeRegex(t[0]):`[${t.map(i=>At.escapeRegex(i)).join("")}]`}*`},iq=r=>{let e=0,t=r.trim(),n=ng(t);for(;n;)e++,t=n.body.trim(),n=ng(t);return e},sq=(r,e)=>{if(e.maxExtglobRecursion===!1)return{risky:!1};let t=typeof e.maxExtglobRecursion=="number"?e.maxExtglobRecursion:Ca.DEFAULT_MAX_EXTGLOB_RECURSION,n=ZC(r).map(i=>i.trim());if(n.length>1&&(n.some(i=>i==="")||n.some(i=>/^[*?]+$/.test(i))||rq(n)))return{risky:!0};for(let i of n){let s=nq(i);if(s)return{risky:!0,safeOutput:s};if(iq(i)>t)return{risky:!0}}return{risky:!1}},ig=(r,e)=>{if(typeof r!="string")throw new TypeError("Expected a string");r=JC[r]||r;let t={...e},n=typeof t.maxLength=="number"?Math.min(Lu,t.maxLength):Lu,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=At.isWindows(e),l=Ca.globChars(c),u=Ca.extglobChars(l),{DOT_LITERAL:f,PLUS_LITERAL:d,SLASH_LITERAL:g,ONE_CHAR:y,DOTS_SLASH:b,NO_DOT:C,NO_DOT_SLASH:R,NO_DOTS_SLASH:O,QMARK:P,QMARK_NO_DOT:B,STAR:G,START_ANCHOR:F}=l,V=N=>`(${a}(?:(?!${F}${N.dot?b:f}).)*?)`,D=t.dot?"":C,$=t.dot?P:B,T=t.bash===!0?V(t):G;t.capture&&(T=`(${T})`),typeof t.noext=="boolean"&&(t.noextglob=t.noext);let p={input:r,index:-1,start:0,dot:t.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};r=At.removePrefix(r,p),i=r.length;let m=[],x=[],S=[],v=s,_,k=()=>p.index===i-1,w=p.peek=(N=1)=>r[p.index+N],h=p.advance=()=>r[++p.index]||"",E=()=>r.slice(p.index+1),q=(N="",ne=0)=>{p.consumed+=N,p.index+=ne},M=N=>{p.output+=N.output!=null?N.output:N.value,q(N.value)},I=()=>{let N=1;for(;w()==="!"&&(w(2)!=="("||w(3)==="?");)h(),p.start++,N++;return N%2===0?!1:(p.negated=!0,p.start++,!0)},j=N=>{p[N]++,S.push(N)},K=N=>{p[N]--,S.pop()},U=N=>{if(v.type==="globstar"){let ne=p.braces>0&&(N.type==="comma"||N.type==="brace"),L=N.extglob===!0||m.length&&(N.type==="pipe"||N.type==="paren");N.type!=="slash"&&N.type!=="paren"&&!ne&&!L&&(p.output=p.output.slice(0,-v.output.length),v.type="star",v.value="*",v.output=T,p.output+=v.output)}if(m.length&&N.type!=="paren"&&(m[m.length-1].inner+=N.value),(N.value||N.output)&&M(N),v&&v.type==="text"&&N.type==="text"){v.value+=N.value,v.output=(v.output||"")+N.value;return}N.prev=v,o.push(N),v=N},Re=(N,ne)=>{let L={...u[ne],conditions:1,inner:""};L.prev=v,L.parens=p.parens,L.output=p.output,L.startIndex=p.index,L.tokensIndex=o.length;let z=(t.capture?"(":"")+L.open;j("parens"),U({type:N,value:ne,output:p.output?"":y}),U({type:"paren",extglob:!0,value:h(),output:z}),m.push(L)},se=N=>{let ne=r.slice(N.startIndex,p.index+1),L=r.slice(N.startIndex+2,p.index),z=sq(L,t);if((N.type==="plus"||N.type==="star")&&z.risky){let J=z.safeOutput?(N.output?"":y)+(t.capture?`(${z.safeOutput})`:z.safeOutput):void 0,Ot=o[N.tokensIndex];Ot.type="text",Ot.value=ne,Ot.output=J||At.escapeRegex(ne);for(let ae=N.tokensIndex+1;ae<o.length;ae++)o[ae].value="",o[ae].output="",delete o[ae].suffix;p.output=N.output+Ot.output,p.backtrack=!0,U({type:"paren",extglob:!0,value:_,output:""}),K("parens");return}let oe=N.close+(t.capture?")":""),Q;if(N.type==="negate"){let J=T;if(N.inner&&N.inner.length>1&&N.inner.includes("/")&&(J=V(t)),(J!==T||k()||/^\)+$/.test(E()))&&(oe=N.close=`)$))${J}`),N.inner.includes("*")&&(Q=E())&&/^\.[^\\/.]+$/.test(Q)){let Ot=ig(Q,{...e,fastpaths:!1}).output;oe=N.close=`)${Ot})${J})`}N.prev.type==="bos"&&(p.negatedExtglob=!0)}U({type:"paren",extglob:!0,value:_,output:oe}),K("parens")};if(t.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(r)){let N=!1,ne=r.replace(QU,(L,z,oe,Q,J,Ot)=>Q==="\\"?(N=!0,L):Q==="?"?z?z+Q+(J?P.repeat(J.length):""):Ot===0?$+(J?P.repeat(J.length):""):P.repeat(oe.length):Q==="."?f.repeat(oe.length):Q==="*"?z?z+Q+(J?T:""):T:z?L:`\\${L}`);return N===!0&&(t.unescape===!0?ne=ne.replace(/\\/g,""):ne=ne.replace(/\\+/g,L=>L.length%2===0?"\\\\":L?"\\":"")),ne===r&&t.contains===!0?(p.output=r,p):(p.output=At.wrapOutput(ne,p,e),p)}for(;!k();){if(_=h(),_==="\0")continue;if(_==="\\"){let L=w();if(L==="/"&&t.bash!==!0||L==="."||L===";")continue;if(!L){_+="\\",U({type:"text",value:_});continue}let z=/^\\+/.exec(E()),oe=0;if(z&&z[0].length>2&&(oe=z[0].length,p.index+=oe,oe%2!==0&&(_+="\\")),t.unescape===!0?_=h():_+=h(),p.brackets===0){U({type:"text",value:_});continue}}if(p.brackets>0&&(_!=="]"||v.value==="["||v.value==="[^")){if(t.posix!==!1&&_===":"){let L=v.value.slice(1);if(L.includes("[")&&(v.posix=!0,L.includes(":"))){let z=v.value.lastIndexOf("["),oe=v.value.slice(0,z),Q=v.value.slice(z+2),J=JU[Q];if(J){v.value=oe+J,p.backtrack=!0,h(),!s.output&&o.indexOf(v)===1&&(s.output=y);continue}}}(_==="["&&w()!==":"||_==="-"&&w()==="]")&&(_=`\\${_}`),_==="]"&&(v.value==="["||v.value==="[^")&&(_=`\\${_}`),t.posix===!0&&_==="!"&&v.value==="["&&(_="^"),v.value+=_,M({value:_});continue}if(p.quotes===1&&_!=='"'){_=At.escapeRegex(_),v.value+=_,M({value:_});continue}if(_==='"'){p.quotes=p.quotes===1?0:1,t.keepQuotes===!0&&U({type:"text",value:_});continue}if(_==="("){j("parens"),U({type:"paren",value:_});continue}if(_===")"){if(p.parens===0&&t.strictBrackets===!0)throw new SyntaxError(to("opening","("));let L=m[m.length-1];if(L&&p.parens===L.parens+1){se(m.pop());continue}U({type:"paren",value:_,output:p.parens?")":"\\)"}),K("parens");continue}if(_==="["){if(t.nobracket===!0||!E().includes("]")){if(t.nobracket!==!0&&t.strictBrackets===!0)throw new SyntaxError(to("closing","]"));_=`\\${_}`}else j("brackets");U({type:"bracket",value:_});continue}if(_==="]"){if(t.nobracket===!0||v&&v.type==="bracket"&&v.value.length===1){U({type:"text",value:_,output:`\\${_}`});continue}if(p.brackets===0){if(t.strictBrackets===!0)throw new SyntaxError(to("opening","["));U({type:"text",value:_,output:`\\${_}`});continue}K("brackets");let L=v.value.slice(1);if(v.posix!==!0&&L[0]==="^"&&!L.includes("/")&&(_=`/${_}`),v.value+=_,M({value:_}),t.literalBrackets===!1||At.hasRegexChars(L))continue;let z=At.escapeRegex(v.value);if(p.output=p.output.slice(0,-v.value.length),t.literalBrackets===!0){p.output+=z,v.value=z;continue}v.value=`(${a}${z}|${v.value})`,p.output+=v.value;continue}if(_==="{"&&t.nobrace!==!0){j("braces");let L={type:"brace",value:_,output:"(",outputIndex:p.output.length,tokensIndex:p.tokens.length};x.push(L),U(L);continue}if(_==="}"){let L=x[x.length-1];if(t.nobrace===!0||!L){U({type:"text",value:_,output:_});continue}let z=")";if(L.dots===!0){let oe=o.slice(),Q=[];for(let J=oe.length-1;J>=0&&(o.pop(),oe[J].type!=="brace");J--)oe[J].type!=="dots"&&Q.unshift(oe[J].value);z=eq(Q,t),p.backtrack=!0}if(L.comma!==!0&&L.dots!==!0){let oe=p.output.slice(0,L.outputIndex),Q=p.tokens.slice(L.tokensIndex);L.value=L.output="\\{",_=z="\\}",p.output=oe;for(let J of Q)p.output+=J.output||J.value}U({type:"brace",value:_,output:z}),K("braces"),x.pop();continue}if(_==="|"){m.length>0&&m[m.length-1].conditions++,U({type:"text",value:_});continue}if(_===","){let L=_,z=x[x.length-1];z&&S[S.length-1]==="braces"&&(z.comma=!0,L="|"),U({type:"comma",value:_,output:L});continue}if(_==="/"){if(v.type==="dot"&&p.index===p.start+1){p.start=p.index+1,p.consumed="",p.output="",o.pop(),v=s;continue}U({type:"slash",value:_,output:g});continue}if(_==="."){if(p.braces>0&&v.type==="dot"){v.value==="."&&(v.output=f);let L=x[x.length-1];v.type="dots",v.output+=_,v.value+=_,L.dots=!0;continue}if(p.braces+p.parens===0&&v.type!=="bos"&&v.type!=="slash"){U({type:"text",value:_,output:f});continue}U({type:"dot",value:_,output:f});continue}if(_==="?"){if(!(v&&v.value==="(")&&t.noextglob!==!0&&w()==="("&&w(2)!=="?"){Re("qmark",_);continue}if(v&&v.type==="paren"){let z=w(),oe=_;if(z==="<"&&!At.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(v.value==="("&&!/[!=<:]/.test(z)||z==="<"&&!/<([!=]|\w+>)/.test(E()))&&(oe=`\\${_}`),U({type:"text",value:_,output:oe});continue}if(t.dot!==!0&&(v.type==="slash"||v.type==="bos")){U({type:"qmark",value:_,output:B});continue}U({type:"qmark",value:_,output:P});continue}if(_==="!"){if(t.noextglob!==!0&&w()==="("&&(w(2)!=="?"||!/[!=<:]/.test(w(3)))){Re("negate",_);continue}if(t.nonegate!==!0&&p.index===0){I();continue}}if(_==="+"){if(t.noextglob!==!0&&w()==="("&&w(2)!=="?"){Re("plus",_);continue}if(v&&v.value==="("||t.regex===!1){U({type:"plus",value:_,output:d});continue}if(v&&(v.type==="bracket"||v.type==="paren"||v.type==="brace")||p.parens>0){U({type:"plus",value:_});continue}U({type:"plus",value:d});continue}if(_==="@"){if(t.noextglob!==!0&&w()==="("&&w(2)!=="?"){U({type:"at",extglob:!0,value:_,output:""});continue}U({type:"text",value:_});continue}if(_!=="*"){(_==="$"||_==="^")&&(_=`\\${_}`);let L=ZU.exec(E());L&&(_+=L[0],p.index+=L[0].length),U({type:"text",value:_});continue}if(v&&(v.type==="globstar"||v.star===!0)){v.type="star",v.star=!0,v.value+=_,v.output=T,p.backtrack=!0,p.globstar=!0,q(_);continue}let N=E();if(t.noextglob!==!0&&/^\([^?]/.test(N)){Re("star",_);continue}if(v.type==="star"){if(t.noglobstar===!0){q(_);continue}let L=v.prev,z=L.prev,oe=L.type==="slash"||L.type==="bos",Q=z&&(z.type==="star"||z.type==="globstar");if(t.bash===!0&&(!oe||N[0]&&N[0]!=="/")){U({type:"star",value:_,output:""});continue}let J=p.braces>0&&(L.type==="comma"||L.type==="brace"),Ot=m.length&&(L.type==="pipe"||L.type==="paren");if(!oe&&L.type!=="paren"&&!J&&!Ot){U({type:"star",value:_,output:""});continue}for(;N.slice(0,3)==="/**";){let ae=r[p.index+4];if(ae&&ae!=="/")break;N=N.slice(3),q("/**",3)}if(L.type==="bos"&&k()){v.type="globstar",v.value+=_,v.output=V(t),p.output=v.output,p.globstar=!0,q(_);continue}if(L.type==="slash"&&L.prev.type!=="bos"&&!Q&&k()){p.output=p.output.slice(0,-(L.output+v.output).length),L.output=`(?:${L.output}`,v.type="globstar",v.output=V(t)+(t.strictSlashes?")":"|$)"),v.value+=_,p.globstar=!0,p.output+=L.output+v.output,q(_);continue}if(L.type==="slash"&&L.prev.type!=="bos"&&N[0]==="/"){let ae=N[1]!==void 0?"|$":"";p.output=p.output.slice(0,-(L.output+v.output).length),L.output=`(?:${L.output}`,v.type="globstar",v.output=`${V(t)}${g}|${g}${ae})`,v.value+=_,p.output+=L.output+v.output,p.globstar=!0,q(_+h()),U({type:"slash",value:"/",output:""});continue}if(L.type==="bos"&&N[0]==="/"){v.type="globstar",v.value+=_,v.output=`(?:^|${g}|${V(t)}${g})`,p.output=v.output,p.globstar=!0,q(_+h()),U({type:"slash",value:"/",output:""});continue}p.output=p.output.slice(0,-v.output.length),v.type="globstar",v.output=V(t),v.value+=_,p.output+=v.output,p.globstar=!0,q(_);continue}let ne={type:"star",value:_,output:T};if(t.bash===!0){ne.output=".*?",(v.type==="bos"||v.type==="slash")&&(ne.output=D+ne.output),U(ne);continue}if(v&&(v.type==="bracket"||v.type==="paren")&&t.regex===!0){ne.output=_,U(ne);continue}(p.index===p.start||v.type==="slash"||v.type==="dot")&&(v.type==="dot"?(p.output+=R,v.output+=R):t.dot===!0?(p.output+=O,v.output+=O):(p.output+=D,v.output+=D),w()!=="*"&&(p.output+=y,v.output+=y)),U(ne)}for(;p.brackets>0;){if(t.strictBrackets===!0)throw new SyntaxError(to("closing","]"));p.output=At.escapeLast(p.output,"["),K("brackets")}for(;p.parens>0;){if(t.strictBrackets===!0)throw new SyntaxError(to("closing",")"));p.output=At.escapeLast(p.output,"("),K("parens")}for(;p.braces>0;){if(t.strictBrackets===!0)throw new SyntaxError(to("closing","}"));p.output=At.escapeLast(p.output,"{"),K("braces")}if(t.strictSlashes!==!0&&(v.type==="star"||v.type==="bracket")&&U({type:"maybe_slash",value:"",output:`${g}?`}),p.backtrack===!0){p.output="";for(let N of p.tokens)p.output+=N.output!=null?N.output:N.value,N.suffix&&(p.output+=N.suffix)}return p};ig.fastpaths=(r,e)=>{let t={...e},n=typeof t.maxLength=="number"?Math.min(Lu,t.maxLength):Lu,i=r.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);r=JC[r]||r;let s=At.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:c,DOTS_SLASH:l,NO_DOT:u,NO_DOTS:f,NO_DOTS_SLASH:d,STAR:g,START_ANCHOR:y}=Ca.globChars(s),b=t.dot?f:u,C=t.dot?d:u,R=t.capture?"":"?:",O={negated:!1,prefix:""},P=t.bash===!0?".*?":g;t.capture&&(P=`(${P})`);let B=D=>D.noglobstar===!0?P:`(${R}(?:(?!${y}${D.dot?l:o}).)*?)`,G=D=>{switch(D){case"*":return`${b}${c}${P}`;case".*":return`${o}${c}${P}`;case"*.*":return`${b}${P}${o}${c}${P}`;case"*/*":return`${b}${P}${a}${c}${C}${P}`;case"**":return b+B(t);case"**/*":return`(?:${b}${B(t)}${a})?${C}${c}${P}`;case"**/*.*":return`(?:${b}${B(t)}${a})?${C}${P}${o}${c}${P}`;case"**/.*":return`(?:${b}${B(t)}${a})?${o}${c}${P}`;default:{let $=/^(.*?)\.(\w+)$/.exec(D);if(!$)return;let T=G($[1]);return T?T+o+$[2]:void 0}}},F=At.removePrefix(r,O),V=G(F);return V&&t.strictSlashes!==!0&&(V+=`${a}?`),V};ek.exports=ig});var nk=A((wV,rk)=>{"use strict";var oq=require("path"),aq=XC(),sg=tk(),og=Du(),cq=Ea(),lq=r=>r&&typeof r=="object"&&!Array.isArray(r),Pe=(r,e,t=!1)=>{if(Array.isArray(r)){let u=r.map(d=>Pe(d,e,t));return d=>{for(let g of u){let y=g(d);if(y)return y}return!1}}let n=lq(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=og.isWindows(e),o=n?Pe.compileRe(r,e):Pe.makeRe(r,e,!1,!0),a=o.state;delete o.state;let c=()=>!1;if(i.ignore){let u={...e,ignore:null,onMatch:null,onResult:null};c=Pe(i.ignore,u,t)}let l=(u,f=!1)=>{let{isMatch:d,match:g,output:y}=Pe.test(u,o,e,{glob:r,posix:s}),b={glob:r,state:a,regex:o,posix:s,input:u,output:y,match:g,isMatch:d};return typeof i.onResult=="function"&&i.onResult(b),d===!1?(b.isMatch=!1,f?b:!1):c(u)?(typeof i.onIgnore=="function"&&i.onIgnore(b),b.isMatch=!1,f?b:!1):(typeof i.onMatch=="function"&&i.onMatch(b),f?b:!0)};return t&&(l.state=a),l};Pe.test=(r,e,t,{glob:n,posix:i}={})=>{if(typeof r!="string")throw new TypeError("Expected input to be a string");if(r==="")return{isMatch:!1,output:""};let s=t||{},o=s.format||(i?og.toPosixSlashes:null),a=r===n,c=a&&o?o(r):r;return a===!1&&(c=o?o(r):r,a=c===n),(a===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?a=Pe.matchBase(r,e,t,i):a=e.exec(c)),{isMatch:!!a,match:a,output:c}};Pe.matchBase=(r,e,t,n=og.isWindows(t))=>(e instanceof RegExp?e:Pe.makeRe(e,t)).test(oq.basename(r));Pe.isMatch=(r,e,t)=>Pe(e,t)(r);Pe.parse=(r,e)=>Array.isArray(r)?r.map(t=>Pe.parse(t,e)):sg(r,{...e,fastpaths:!1});Pe.scan=(r,e)=>aq(r,e);Pe.compileRe=(r,e,t=!1,n=!1)=>{if(t===!0)return r.output;let i=e||{},s=i.contains?"":"^",o=i.contains?"":"$",a=`${s}(?:${r.output})${o}`;r&&r.negated===!0&&(a=`^(?!${a}).*$`);let c=Pe.toRegex(a,e);return n===!0&&(c.state=r),c};Pe.makeRe=(r,e={},t=!1,n=!1)=>{if(!r||typeof r!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(r[0]==="."||r[0]==="*")&&(i.output=sg.fastpaths(r,e)),i.output||(i=sg(r,e)),Pe.compileRe(i,e,t,n)};Pe.toRegex=(r,e)=>{try{let t=e||{};return new RegExp(r,t.flags||(t.nocase?"i":""))}catch(t){if(e&&e.debug===!0)throw t;return/$^/}};Pe.constants=cq;rk.exports=Pe});var ag=A((SV,ik)=>{"use strict";ik.exports=nk()});var fk=A((EV,pk)=>{"use strict";var Aa=require("fs"),{Readable:uq}=require("stream"),ka=require("path"),{promisify:Uu}=require("util"),cg=ag(),pq=Uu(Aa.readdir),fq=Uu(Aa.stat),sk=Uu(Aa.lstat),dq=Uu(Aa.realpath),hq="!",lk="READDIRP_RECURSIVE_ERROR",mq=new Set(["ENOENT","EPERM","EACCES","ELOOP",lk]),lg="files",uk="directories",ju="files_directories",Bu="all",ok=[lg,uk,ju,Bu],gq=r=>mq.has(r.code),[ak,vq]=process.versions.node.split(".").slice(0,2).map(r=>Number.parseInt(r,10)),yq=process.platform==="win32"&&(ak>10||ak===10&&vq>=5),ck=r=>{if(r!==void 0){if(typeof r=="function")return r;if(typeof r=="string"){let e=cg(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)===hq?t.push(cg(i.slice(1))):e.push(cg(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))}}},Fu=class r extends uq{static get defaultOptions(){return{root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:lg,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=ck(t.fileFilter),this._directoryFilter=ck(t.directoryFilter);let s=t.lstat?sk:fq;yq?this._stat=o=>s(o,{bigint:!0}):this._stat=s,this._maxDepth=t.depth,this._wantsDir=[uk,ju,Bu].includes(i),this._wantsFile=[lg,ju,Bu].includes(i),this._wantsEverything=i===Bu,this._root=ka.resolve(n),this._isDirent="Dirent"in Aa&&!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 pq(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=ka.resolve(ka.join(t,i));n={path:ka.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){gq(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 dq(n),s=await sk(i);if(s.isFile())return"file";if(s.isDirectory()){let o=i.length;if(n.startsWith(i)&&n.substr(o,1)===ka.sep){let a=new Error(`Circular symlink detected: "${n}" points to "${i}"`);return a.code=lk,this._onError(a)}return"directory"}}catch(i){this._onError(i)}}}}_includeAsFile(e){let t=e&&e[this._statsProp];return t&&this._wantsEverything&&!t.isDirectory()}},ro=(r,e={})=>{let t=e.entryType||e.type;if(t==="both"&&(t=ju),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&&!ok.includes(t))throw new Error(`readdirp: Invalid type passed. Use one of ${ok.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=r,new Fu(e)},xq=(r,e={})=>new Promise((t,n)=>{let i=[];ro(r,e).on("data",s=>i.push(s)).on("end",()=>t(i)).on("error",s=>n(s))});ro.promise=xq;ro.ReaddirpStream=Fu;ro.default=ro;pk.exports=ro});var ug=A((TV,dk)=>{dk.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 xk=A((vk,yk)=>{"use strict";Object.defineProperty(vk,"__esModule",{value:!0});var gk=ag(),_q=ug(),hk="!",bq={returnIndex:!1},wq=r=>Array.isArray(r)?r:[r],Sq=(r,e)=>{if(typeof r=="function")return r;if(typeof r=="string"){let t=gk(r,e);return n=>r===n||t(n)}return r instanceof RegExp?t=>r.test(t):t=>!1},mk=(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=_q(s,!1);for(let c=0;c<e.length;c++){let l=e[c];if(l(o))return n?-1:!1}let a=i&&[o].concat(t.slice(1));for(let c=0;c<r.length;c++){let l=r[c];if(i?l(...a):l(o))return n?c:!0}return n?-1:!1},pg=(r,e,t=bq)=>{if(r==null)throw new TypeError("anymatch: specify first argument");let n=typeof t=="boolean"?{returnIndex:t}:t,i=n.returnIndex||!1,s=wq(r),o=s.filter(c=>typeof c=="string"&&c.charAt(0)===hk).map(c=>c.slice(1)).map(c=>gk(c,n)),a=s.filter(c=>typeof c!="string"||typeof c=="string"&&c.charAt(0)!==hk).map(c=>Sq(c,n));return e==null?(c,l=!1)=>mk(a,o,c,typeof l=="boolean"?l:!1):mk(a,o,e,i)};pg.default=pg;yk.exports=pg});var bk=A((CV,_k)=>{_k.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 fg=A((kV,Sk)=>{var Eq=bk(),wk={"{":"}","(":")","[":"]"},Tq=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=wk[a];if(c){var l=r.indexOf(c,e);l!==-1&&(e=l+1)}if(r[e]==="!")return!0}else e++}return!1},Cq=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=wk[t];if(n){var i=r.indexOf(n,e);i!==-1&&(e=i+1)}if(r[e]==="!")return!0}else e++}return!1};Sk.exports=function(e,t){if(typeof e!="string"||e==="")return!1;if(Eq(e))return!0;var n=Tq;return t&&t.strict===!1&&(n=Cq),n(e)}});var Tk=A((AV,Ek)=>{"use strict";var kq=fg(),Aq=require("path").posix.dirname,Rq=require("os").platform()==="win32",dg="/",Oq=/\\/g,Mq=/[\{\[].*[\}\]]$/,Pq=/(^|[^\\])([\{\[]|\([^\)]+$)/,Iq=/\\([\!\*\?\|\[\]\(\)\{\}])/g;Ek.exports=function(e,t){var n=Object.assign({flipBackslashes:!0},t);n.flipBackslashes&&Rq&&e.indexOf(dg)<0&&(e=e.replace(Oq,dg)),Mq.test(e)&&(e+=dg),e+="a";do e=Aq(e);while(kq(e)||Pq.test(e));return e.replace(Iq,"$1")}});var qu=A(Sr=>{"use strict";Sr.isInteger=r=>typeof r=="number"?Number.isInteger(r):typeof r=="string"&&r.trim()!==""?Number.isInteger(Number(r)):!1;Sr.find=(r,e)=>r.nodes.find(t=>t.type===e);Sr.exceedsLimit=(r,e,t=1,n)=>n===!1||!Sr.isInteger(r)||!Sr.isInteger(e)?!1:(Number(e)-Number(r))/Number(t)>=n;Sr.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)};Sr.encloseBrace=r=>r.type!=="brace"?!1:r.commas>>0+r.ranges>>0===0?(r.invalid=!0,!0):!1;Sr.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;Sr.isOpenOrClose=r=>r.type==="open"||r.type==="close"?!0:r.open===!0||r.close===!0;Sr.reduce=r=>r.reduce((e,t)=>(t.type==="text"&&e.push(t.value),t.type==="range"&&(t.type="text"),e),[]);Sr.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 $u=A((OV,kk)=>{"use strict";var Ck=qu();kk.exports=(r,e={})=>{let t=(n,i={})=>{let s=e.escapeInvalid&&Ck.isInvalidBrace(i),o=n.invalid===!0&&e.escapeInvalid===!0,a="";if(n.value)return(s||o)&&Ck.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 Rk=A((MV,Ak)=>{"use strict";Ak.exports=function(r){return typeof r=="number"?r-r===0:typeof r=="string"&&r.trim()!==""?Number.isFinite?Number.isFinite(+r):isFinite(+r):!1}});var jk=A((PV,Bk)=>{"use strict";var Ok=Rk(),Oi=(r,e,t)=>{if(Ok(r)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||r===e)return String(r);if(Ok(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(Oi.cache.hasOwnProperty(c))return Oi.cache[c].result;let l=Math.min(r,e),u=Math.max(r,e);if(Math.abs(l-u)===1){let b=r+"|"+e;return n.capture?`(${b})`:n.wrap===!1?b:`(?:${b})`}let f=Lk(r)||Lk(e),d={min:r,max:e,a:l,b:u},g=[],y=[];if(f&&(d.isPadded=f,d.maxLen=String(d.max).length),l<0){let b=u<0?Math.abs(u):1;y=Mk(b,Math.abs(l),d,n),l=d.a=0}return u>=0&&(g=Mk(l,u,d,n)),d.negatives=y,d.positives=g,d.result=Nq(y,g,n),n.capture===!0?d.result=`(${d.result})`:n.wrap!==!1&&g.length+y.length>1&&(d.result=`(?:${d.result})`),Oi.cache[c]=d,d.result};function Nq(r,e,t){let n=hg(r,e,"-",!1,t)||[],i=hg(e,r,"",!1,t)||[],s=hg(r,e,"-?",!0,t)||[];return n.concat(s).concat(i).join("|")}function Dq(r,e){let t=1,n=1,i=Ik(r,t),s=new Set([e]);for(;r<=i&&i<=e;)s.add(i),t+=1,i=Ik(r,t);for(i=Nk(e+1,n)-1;r<i&&i<=e;)s.add(i),n+=1,i=Nk(e+1,n)-1;return s=[...s],s.sort(jq),s}function Lq(r,e,t){if(r===e)return{pattern:r,count:[],digits:0};let n=Bq(r,e),i=n.length,s="",o=0;for(let a=0;a<i;a++){let[c,l]=n[a];c===l?s+=c:c!=="0"||l!=="9"?s+=Fq(c,l,t):o++}return o&&(s+=t.shorthand===!0?"\\d":"[0-9]"),{pattern:s,count:[o],digits:i}}function Mk(r,e,t,n){let i=Dq(r,e),s=[],o=r,a;for(let c=0;c<i.length;c++){let l=i[c],u=Lq(String(o),String(l),n),f="";if(!t.isPadded&&a&&a.pattern===u.pattern){a.count.length>1&&a.count.pop(),a.count.push(u.count[0]),a.string=a.pattern+Dk(a.count),o=l+1;continue}t.isPadded&&(f=Uq(l,t,n)),u.string=f+u.pattern+Dk(u.count),s.push(u),o=l+1,a=u}return s}function hg(r,e,t,n,i){let s=[];for(let o of r){let{string:a}=o;!n&&!Pk(e,"string",a)&&s.push(t+a),n&&Pk(e,"string",a)&&s.push(t+a)}return s}function Bq(r,e){let t=[];for(let n=0;n<r.length;n++)t.push([r[n],e[n]]);return t}function jq(r,e){return r>e?1:e>r?-1:0}function Pk(r,e,t){return r.some(n=>n[e]===t)}function Ik(r,e){return Number(String(r).slice(0,-e)+"9".repeat(e))}function Nk(r,e){return r-r%Math.pow(10,e)}function Dk(r){let[e=0,t=""]=r;return t||e>1?`{${e+(t?","+t:"")}}`:""}function Fq(r,e,t){return`[${r}${e-r===1?"":"-"}${e}]`}function Lk(r){return/^-?(0+)\d/.test(r)}function Uq(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}}`}}Oi.cache={};Oi.clearCache=()=>Oi.cache={};Bk.exports=Oi});var vg=A((IV,Gk)=>{"use strict";var qq=require("util"),Uk=jk(),Fk=r=>r!==null&&typeof r=="object"&&!Array.isArray(r),$q=r=>e=>r===!0?Number(e):String(e),mg=r=>typeof r=="number"||typeof r=="string"&&r!=="",Ra=r=>Number.isInteger(+r),gg=r=>{let e=`${r}`,t=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return!1;for(;e[++t]==="0";);return t>0},Hq=(r,e,t)=>typeof r=="string"||typeof e=="string"?!0:t.stringify===!0,Wq=(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},Wu=(r,e)=>{let t=r[0]==="-"?"-":"";for(t&&(r=r.slice(1),e--);r.length<e;)r="0"+r;return t?"-"+r:r},Gq=(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=>Wu(String(a),t)).join("|")),r.negatives.length&&(s=`-(${n}${r.negatives.map(a=>Wu(String(a),t)).join("|")})`),i&&s?o=`${i}|${s}`:o=i||s,e.wrap?`(${n}${o})`:o},qk=(r,e,t,n)=>{if(t)return Uk(r,e,{wrap:!1,...n});let i=String.fromCharCode(r);if(r===e)return i;let s=String.fromCharCode(e);return`[${i}-${s}]`},$k=(r,e,t)=>{if(Array.isArray(r)){let n=t.wrap===!0,i=t.capture?"":"?:";return n?`(${i}${r.join("|")})`:r.join("|")}return Uk(r,e,t)},Hk=(...r)=>new RangeError("Invalid range arguments: "+qq.inspect(...r)),Wk=(r,e,t)=>{if(t.strictRanges===!0)throw Hk([r,e]);return[]},zq=(r,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${r}" to be a number`);return[]},Vq=(r,e,t=1,n={})=>{let i=Number(r),s=Number(e);if(!Number.isInteger(i)||!Number.isInteger(s)){if(n.strictRanges===!0)throw Hk([r,e]);return[]}i===0&&(i=0),s===0&&(s=0);let o=i>s,a=String(r),c=String(e),l=String(t);t=Math.max(Math.abs(t),1);let u=gg(a)||gg(c)||gg(l),f=u?Math.max(a.length,c.length,l.length):0,d=u===!1&&Hq(r,e,n)===!1,g=n.transform||$q(d);if(n.toRegex&&t===1)return qk(Wu(r,f),Wu(e,f),!0,n);let y={negatives:[],positives:[]},b=O=>y[O<0?"negatives":"positives"].push(Math.abs(O)),C=[],R=0;for(;o?i>=s:i<=s;)n.toRegex===!0&&t>1?b(i):C.push(Wq(g(i,R),f,d)),i=o?i-t:i+t,R++;return n.toRegex===!0?t>1?Gq(y,n,f):$k(C,null,{wrap:!1,...n}):C},Kq=(r,e,t=1,n={})=>{if(!Ra(r)&&r.length>1||!Ra(e)&&e.length>1)return Wk(r,e,n);let i=n.transform||(d=>String.fromCharCode(d)),s=`${r}`.charCodeAt(0),o=`${e}`.charCodeAt(0),a=s>o,c=Math.min(s,o),l=Math.max(s,o);if(n.toRegex&&t===1)return qk(c,l,!1,n);let u=[],f=0;for(;a?s>=o:s<=o;)u.push(i(s,f)),s=a?s-t:s+t,f++;return n.toRegex===!0?$k(u,null,{wrap:!1,options:n}):u},Hu=(r,e,t,n={})=>{if(e==null&&mg(r))return[r];if(!mg(r)||!mg(e))return Wk(r,e,n);if(typeof t=="function")return Hu(r,e,1,{transform:t});if(Fk(t))return Hu(r,e,0,t);let i={...n};return i.capture===!0&&(i.wrap=!0),t=t||i.step||1,Ra(t)?Ra(r)&&Ra(e)?Vq(r,e,t,i):Kq(r,e,Math.max(Math.abs(t),1),i):t!=null&&!Fk(t)?zq(t,i):Hu(r,e,1,t)};Gk.exports=Hu});var Kk=A((NV,Vk)=>{"use strict";var Yq=vg(),zk=qu(),Xq=(r,e={})=>{let t=(n,i={})=>{let s=zk.isInvalidBrace(i),o=n.invalid===!0&&e.escapeInvalid===!0,a=s===!0||o===!0,c=e.escapeInvalid===!0?"\\":"",l="";if(n.isOpen===!0)return c+n.value;if(n.isClose===!0)return console.log("node.isClose",c,n.value),c+n.value;if(n.type==="open")return a?c+n.value:"(";if(n.type==="close")return a?c+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let u=zk.reduce(n.nodes),f=Yq(...u,{...e,wrap:!1,toRegex:!0,strictZeros:!0});if(f.length!==0)return u.length>1&&f.length>1?`(${f})`:f}if(n.nodes)for(let u of n.nodes)l+=t(u,n);return l};return t(r)};Vk.exports=Xq});var Jk=A((DV,Xk)=>{"use strict";var Jq=vg(),Yk=$u(),no=qu(),Mi=(r="",e="",t=!1)=>{let n=[];if(r=[].concat(r),e=[].concat(e),!e.length)return r;if(!r.length)return t?no.flatten(e).map(i=>`{${i}}`):e;for(let i of r)if(Array.isArray(i))for(let s of i)n.push(Mi(s,e,t));else for(let s of e)t===!0&&typeof s=="string"&&(s=`{${s}}`),n.push(Array.isArray(s)?Mi(i,s,t):i+s);return no.flatten(n)},Zq=(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(Mi(a.pop(),Yk(i,e)));return}if(i.type==="brace"&&i.invalid!==!0&&i.nodes.length===2){a.push(Mi(a.pop(),["{}"]));return}if(i.nodes&&i.ranges>0){let f=no.reduce(i.nodes);if(no.exceedsLimit(...f,e.step,t))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let d=Jq(...f,e);d.length===0&&(d=Yk(i,e)),a.push(Mi(a.pop(),d)),i.nodes=[];return}let c=no.encloseBrace(i),l=i.queue,u=i;for(;u.type!=="brace"&&u.type!=="root"&&u.parent;)u=u.parent,l=u.queue;for(let f=0;f<i.nodes.length;f++){let d=i.nodes[f];if(d.type==="comma"&&i.type==="brace"){f===1&&l.push(""),l.push("");continue}if(d.type==="close"){a.push(Mi(a.pop(),l,c));continue}if(d.value&&d.type!=="open"){l.push(Mi(l.pop(),d.value));continue}d.nodes&&n(d,i)}return l};return no.flatten(n(r))};Xk.exports=Zq});var Qk=A((LV,Zk)=>{"use strict";Zk.exports={MAX_LENGTH:1e4,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:`
|
|
105
|
+
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var iA=A((BV,nA)=>{"use strict";var Qq=$u(),{MAX_LENGTH:eA,CHAR_BACKSLASH:yg,CHAR_BACKTICK:e$,CHAR_COMMA:t$,CHAR_DOT:r$,CHAR_LEFT_PARENTHESES:n$,CHAR_RIGHT_PARENTHESES:i$,CHAR_LEFT_CURLY_BRACE:s$,CHAR_RIGHT_CURLY_BRACE:o$,CHAR_LEFT_SQUARE_BRACKET:tA,CHAR_RIGHT_SQUARE_BRACKET:rA,CHAR_DOUBLE_QUOTE:a$,CHAR_SINGLE_QUOTE:c$,CHAR_NO_BREAK_SPACE:l$,CHAR_ZERO_WIDTH_NOBREAK_SPACE:u$}=Qk(),p$=(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,l=r.length,u=0,f=0,d,g=()=>r[u++],y=b=>{if(b.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&b.type==="text"){a.value+=b.value;return}return o.nodes.push(b),b.parent=o,b.prev=a,a=b,b};for(y({type:"bos"});u<l;)if(o=s[s.length-1],d=g(),!(d===u$||d===l$)){if(d===yg){y({type:"text",value:(e.keepEscaping?d:"")+g()});continue}if(d===rA){y({type:"text",value:"\\"+d});continue}if(d===tA){c++;let b;for(;u<l&&(b=g());){if(d+=b,b===tA){c++;continue}if(b===yg){d+=g();continue}if(b===rA&&(c--,c===0))break}y({type:"text",value:d});continue}if(d===n$){o=y({type:"paren",nodes:[]}),s.push(o),y({type:"text",value:d});continue}if(d===i$){if(o.type!=="paren"){y({type:"text",value:d});continue}o=s.pop(),y({type:"text",value:d}),o=s[s.length-1];continue}if(d===a$||d===c$||d===e$){let b=d,C;for(e.keepQuotes!==!0&&(d="");u<l&&(C=g());){if(C===yg){d+=C+g();continue}if(C===b){e.keepQuotes===!0&&(d+=C);break}d+=C}y({type:"text",value:d});continue}if(d===s$){f++;let C={type:"brace",open:!0,close:!1,dollar:a.value&&a.value.slice(-1)==="$"||o.dollar===!0,depth:f,commas:0,ranges:0,nodes:[]};o=y(C),s.push(o),y({type:"open",value:d});continue}if(d===o$){if(o.type!=="brace"){y({type:"text",value:d});continue}let b="close";o=s.pop(),o.close=!0,y({type:b,value:d}),f--,o=s[s.length-1];continue}if(d===t$&&f>0){if(o.ranges>0){o.ranges=0;let b=o.nodes.shift();o.nodes=[b,{type:"text",value:Qq(o)}]}y({type:"comma",value:d}),o.commas++;continue}if(d===r$&&f>0&&o.commas===0){let b=o.nodes;if(f===0||b.length===0){y({type:"text",value:d});continue}if(a.type==="dot"){if(o.range=[],a.value+=d,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"){b.pop();let C=b[b.length-1];C.value+=a.value+d,a=C,o.ranges--;continue}y({type:"dot",value:d});continue}y({type:"text",value:d})}do if(o=s.pop(),o.type!=="root"){o.nodes.forEach(R=>{R.nodes||(R.type==="open"&&(R.isOpen=!0),R.type==="close"&&(R.isClose=!0),R.nodes||(R.type="text"),R.invalid=!0)});let b=s[s.length-1],C=b.nodes.indexOf(o);b.nodes.splice(C,1,...o.nodes)}while(s.length>0);return y({type:"eos"}),i};nA.exports=p$});var aA=A((jV,oA)=>{"use strict";var sA=$u(),f$=Kk(),d$=Jk(),h$=iA(),ir=(r,e={})=>{let t=[];if(Array.isArray(r))for(let n of r){let i=ir.create(n,e);Array.isArray(i)?t.push(...i):t.push(i)}else t=[].concat(ir.create(r,e));return e&&e.expand===!0&&e.nodupes===!0&&(t=[...new Set(t)]),t};ir.parse=(r,e={})=>h$(r,e);ir.stringify=(r,e={})=>sA(typeof r=="string"?ir.parse(r,e):r,e);ir.compile=(r,e={})=>(typeof r=="string"&&(r=ir.parse(r,e)),f$(r,e));ir.expand=(r,e={})=>{typeof r=="string"&&(r=ir.parse(r,e));let t=d$(r,e);return e.noempty===!0&&(t=t.filter(Boolean)),e.nodupes===!0&&(t=[...new Set(t)]),t};ir.create=(r,e={})=>r===""||r.length<3?[r]:e.expand!==!0?ir.compile(r,e):ir.expand(r,e);oA.exports=ir});var cA=A((FV,m$)=>{m$.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=A((UV,lA)=>{lA.exports=cA()});var fA=A((qV,pA)=>{"use strict";var g$=require("path"),v$=uA(),y$=new Set(v$);pA.exports=r=>y$.has(g$.extname(r).slice(1).toLowerCase())});var Gu=A(Y=>{"use strict";var{sep:x$}=require("path"),{platform:xg}=process,_$=require("os");Y.EV_ALL="all";Y.EV_READY="ready";Y.EV_ADD="add";Y.EV_CHANGE="change";Y.EV_ADD_DIR="addDir";Y.EV_UNLINK="unlink";Y.EV_UNLINK_DIR="unlinkDir";Y.EV_RAW="raw";Y.EV_ERROR="error";Y.STR_DATA="data";Y.STR_END="end";Y.STR_CLOSE="close";Y.FSEVENT_CREATED="created";Y.FSEVENT_MODIFIED="modified";Y.FSEVENT_DELETED="deleted";Y.FSEVENT_MOVED="moved";Y.FSEVENT_CLONED="cloned";Y.FSEVENT_UNKNOWN="unknown";Y.FSEVENT_FLAG_MUST_SCAN_SUBDIRS=1;Y.FSEVENT_TYPE_FILE="file";Y.FSEVENT_TYPE_DIRECTORY="directory";Y.FSEVENT_TYPE_SYMLINK="symlink";Y.KEY_LISTENERS="listeners";Y.KEY_ERR="errHandlers";Y.KEY_RAW="rawEmitters";Y.HANDLER_KEYS=[Y.KEY_LISTENERS,Y.KEY_ERR,Y.KEY_RAW];Y.DOT_SLASH=`.${x$}`;Y.BACK_SLASH_RE=/\\/g;Y.DOUBLE_SLASH_RE=/\/\//;Y.SLASH_OR_BACK_SLASH_RE=/[/\\]/;Y.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/;Y.REPLACER_RE=/^\.[/\\]/;Y.SLASH="/";Y.SLASH_SLASH="//";Y.BRACE_START="{";Y.BANG="!";Y.ONE_DOT=".";Y.TWO_DOTS="..";Y.STAR="*";Y.GLOBSTAR="**";Y.ROOT_GLOBSTAR="/**/*";Y.SLASH_GLOBSTAR="/**";Y.DIR_SUFFIX="Dir";Y.ANYMATCH_OPTS={dot:!0};Y.STRING_TYPE="string";Y.FUNCTION_TYPE="function";Y.EMPTY_STR="";Y.EMPTY_FN=()=>{};Y.IDENTITY_FN=r=>r;Y.isWindows=xg==="win32";Y.isMacos=xg==="darwin";Y.isLinux=xg==="linux";Y.isIBMi=_$.type()==="OS400"});var yA=A((HV,vA)=>{"use strict";var Rn=require("fs"),_t=require("path"),{promisify:Ia}=require("util"),b$=fA(),{isWindows:w$,isLinux:S$,EMPTY_FN:E$,EMPTY_STR:T$,KEY_LISTENERS:io,KEY_ERR:_g,KEY_RAW:Oa,HANDLER_KEYS:C$,EV_CHANGE:Vu,EV_ADD:zu,EV_ADD_DIR:k$,EV_ERROR:hA,STR_DATA:A$,STR_END:R$,BRACE_START:O$,STAR:M$}=Gu(),P$="watch",I$=Ia(Rn.open),mA=Ia(Rn.stat),N$=Ia(Rn.lstat),D$=Ia(Rn.close),bg=Ia(Rn.realpath),L$={lstat:N$,stat:mA},Sg=(r,e)=>{r instanceof Set?r.forEach(e):e(r)},Ma=(r,e,t)=>{let n=r[e];n instanceof Set||(r[e]=n=new Set([n])),n.add(t)},B$=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]},gA=r=>r instanceof Set?r.size===0:!r,Ku=new Map;function dA(r,e,t,n,i){let s=(o,a)=>{t(r),i(o,a,{watchedPath:r}),a&&r!==a&&Yu(_t.resolve(r,a),io,_t.join(r,a))};try{return Rn.watch(r,e,s)}catch(o){n(o)}}var Yu=(r,e,t,n,i)=>{let s=Ku.get(r);s&&Sg(s[e],o=>{o(t,n,i)})},j$=(r,e,t,n)=>{let{listener:i,errHandler:s,rawEmitter:o}=n,a=Ku.get(e),c;if(!t.persistent)return c=dA(r,t,i,s,o),c.close.bind(c);if(a)Ma(a,io,i),Ma(a,_g,s),Ma(a,Oa,o);else{if(c=dA(r,t,Yu.bind(null,e,io),s,Yu.bind(null,e,Oa)),!c)return;c.on(hA,async l=>{let u=Yu.bind(null,e,_g);if(a.watcherUnusable=!0,w$&&l.code==="EPERM")try{let f=await I$(r,"r");await D$(f),u(l)}catch{}else u(l)}),a={listeners:i,errHandlers:s,rawEmitters:o,watcher:c},Ku.set(e,a)}return()=>{Pa(a,io,i),Pa(a,_g,s),Pa(a,Oa,o),gA(a.listeners)&&(a.watcher.close(),Ku.delete(e),C$.forEach(B$(a)),a.watcher=void 0,Object.freeze(a))}},wg=new Map,F$=(r,e,t,n)=>{let{listener:i,rawEmitter:s}=n,o=wg.get(e),a=new Set,c=new Set,l=o&&o.options;return l&&(l.persistent<t.persistent||l.interval>t.interval)&&(a=o.listeners,c=o.rawEmitters,Rn.unwatchFile(e),o=void 0),o?(Ma(o,io,i),Ma(o,Oa,s)):(o={listeners:i,rawEmitters:s,options:t,watcher:Rn.watchFile(e,t,(u,f)=>{Sg(o.rawEmitters,g=>{g(Vu,e,{curr:u,prev:f})});let d=u.mtimeMs;(u.size!==f.size||d>f.mtimeMs||d===0)&&Sg(o.listeners,g=>g(r,u))})},wg.set(e,o)),()=>{Pa(o,io,i),Pa(o,Oa,s),gA(o.listeners)&&(wg.delete(e),Rn.unwatchFile(e),o.options=o.watcher=void 0,Object.freeze(o))}},Eg=class{constructor(e){this.fsw=e,this._boundHandleError=t=>e._handleError(t)}_watchWithNodeFs(e,t){let n=this.fsw.options,i=_t.dirname(e),s=_t.basename(e);this.fsw._getWatchedDir(i).add(s);let a=_t.resolve(e),c={persistent:n.persistent};t||(t=E$);let l;return n.usePolling?(c.interval=n.enableBinaryInterval&&b$(s)?n.binaryInterval:n.interval,l=F$(e,a,c,{listener:t,rawEmitter:this.fsw._emitRaw})):l=j$(e,a,c,{listener:t,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),l}_handleFile(e,t,n){if(this.fsw.closed)return;let i=_t.dirname(e),s=_t.basename(e),o=this.fsw._getWatchedDir(i),a=t;if(o.has(s))return;let c=async(u,f)=>{if(this.fsw._throttle(P$,e,5)){if(!f||f.mtimeMs===0)try{let d=await mA(e);if(this.fsw.closed)return;let g=d.atimeMs,y=d.mtimeMs;(!g||g<=y||y!==a.mtimeMs)&&this.fsw._emit(Vu,e,d),S$&&a.ino!==d.ino?(this.fsw._closeFile(u),a=d,this.fsw._addPathCloser(u,this._watchWithNodeFs(e,c))):a=d}catch{this.fsw._remove(i,s)}else if(o.has(s)){let d=f.atimeMs,g=f.mtimeMs;(!d||d<=g||g!==a.mtimeMs)&&this.fsw._emit(Vu,e,f),a=f}}},l=this._watchWithNodeFs(e,c);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(zu,e,0))return;this.fsw._emit(zu,e,t)}return l}async _handleSymlink(e,t,n,i){if(this.fsw.closed)return;let s=e.fullPath,o=this.fsw._getWatchedDir(t);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let a;try{a=await bg(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(Vu,n,e.stats)):(o.add(i),this.fsw._symlinkPaths.set(s,a),this.fsw._emit(zu,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=_t.join(e,T$),!n.hasGlob&&(a=this.fsw._throttle("readdir",e,1e3),!a))return;let c=this.fsw._getWatchedDir(n.path),l=new Set,u=this.fsw._readdirp(e,{fileFilter:f=>n.filterPath(f),directoryFilter:f=>n.filterDir(f),depth:0}).on(A$,async f=>{if(this.fsw.closed){u=void 0;return}let d=f.path,g=_t.join(e,d);if(l.add(d),!(f.stats.isSymbolicLink()&&await this._handleSymlink(f,e,g,d))){if(this.fsw.closed){u=void 0;return}(d===i||!i&&!c.has(d))&&(this.fsw._incrReadyCount(),g=_t.join(s,_t.relative(s,g)),this._addToNodeFs(g,t,n,o+1))}}).on(hA,this._boundHandleError);return new Promise(f=>u.once(R$,()=>{if(this.fsw.closed){u=void 0;return}let d=a?a.clear():!1;f(),c.getChildren().filter(g=>g!==e&&!l.has(g)&&(!n.hasGlob||n.filterPath({fullPath:_t.resolve(e,g)}))).forEach(g=>{this.fsw._remove(e,g)}),u=void 0,d&&this._handleRead(e,!1,n,i,s,o,a)}))}async _handleDir(e,t,n,i,s,o,a){let c=this.fsw._getWatchedDir(_t.dirname(e)),l=c.has(_t.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!s&&!l&&(!o.hasGlob||o.globFilter(e))&&this.fsw._emit(k$,e,t),c.add(_t.basename(e)),this.fsw._getWatchedDir(e);let u,f,d=this.fsw.options.depth;if((d==null||i<=d)&&!this.fsw._symlinkPaths.has(a)){if(!s&&(await this._handleRead(e,n,o,s,e,i,u),this.fsw.closed))return;f=this._watchWithNodeFs(e,(g,y)=>{y&&y.mtimeMs===0||this._handleRead(g,!1,o,s,e,i,u)})}return f}async _addToNodeFs(e,t,n,i,s){let o=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return o(),!1;let a=this.fsw._getWatchHelpers(e,i);!a.hasGlob&&n&&(a.hasGlob=n.hasGlob,a.globFilter=n.globFilter,a.filterPath=c=>n.filterPath(c),a.filterDir=c=>n.filterDir(c));try{let c=await L$[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))return o(),!1;let l=this.fsw.options.followSymlinks&&!e.includes(M$)&&!e.includes(O$),u;if(c.isDirectory()){let f=_t.resolve(e),d=l?await bg(e):e;if(this.fsw.closed||(u=await this._handleDir(a.watchPath,c,t,i,s,a,d),this.fsw.closed))return;f!==d&&d!==void 0&&this.fsw._symlinkPaths.set(f,d)}else if(c.isSymbolicLink()){let f=l?await bg(e):e;if(this.fsw.closed)return;let d=_t.dirname(a.watchPath);if(this.fsw._getWatchedDir(d).add(a.watchPath),this.fsw._emit(zu,a.watchPath,c),u=await this._handleDir(d,c,t,i,e,a,f),this.fsw.closed)return;f!==void 0&&this.fsw._symlinkPaths.set(_t.resolve(e),f)}else u=this._handleFile(a.watchPath,c,t);return o(),this.fsw._addPathCloser(e,u),!1}catch(c){if(this.fsw._handleError(c))return o(),e}}};vA.exports=Eg});var TA=A((WV,Pg)=>{"use strict";var Og=require("fs"),bt=require("path"),{promisify:Mg}=require("util"),so;try{so=require("fsevents")}catch(r){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(r)}if(so){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&&(so=void 0)}}var{EV_ADD:Tg,EV_CHANGE:U$,EV_ADD_DIR:xA,EV_UNLINK:Xu,EV_ERROR:q$,STR_DATA:$$,STR_END:H$,FSEVENT_CREATED:W$,FSEVENT_MODIFIED:G$,FSEVENT_DELETED:z$,FSEVENT_MOVED:V$,FSEVENT_UNKNOWN:K$,FSEVENT_FLAG_MUST_SCAN_SUBDIRS:Y$,FSEVENT_TYPE_FILE:X$,FSEVENT_TYPE_DIRECTORY:Na,FSEVENT_TYPE_SYMLINK:EA,ROOT_GLOBSTAR:_A,DIR_SUFFIX:J$,DOT_SLASH:bA,FUNCTION_TYPE:Cg,EMPTY_FN:Z$,IDENTITY_FN:Q$}=Gu(),eH=r=>isNaN(r)?{}:{depth:r},Ag=Mg(Og.stat),tH=Mg(Og.lstat),wA=Mg(Og.realpath),rH={stat:Ag,lstat:tH},Pi=new Map,nH=10,iH=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),sH=(r,e)=>({stop:so.watch(r,e)});function oH(r,e,t,n){let i=bt.extname(e)?bt.dirname(e):e,s=bt.dirname(i),o=Pi.get(i);aH(s)&&(i=s);let a=bt.resolve(r),c=a!==e,l=(f,d,g)=>{c&&(f=f.replace(e,a)),(f===a||!f.indexOf(a+bt.sep))&&t(f,d,g)},u=!1;for(let f of Pi.keys())if(e.indexOf(bt.resolve(f)+bt.sep)===0){i=f,o=Pi.get(i),u=!0;break}return o||u?o.listeners.add(l):(o={listeners:new Set([l]),rawEmitter:n,watcher:sH(i,(f,d)=>{if(!o.listeners.size||d&Y$)return;let g=so.getInfo(f,d);o.listeners.forEach(y=>{y(f,d,g)}),o.rawEmitter(g.event,f,g)})},Pi.set(i,o)),()=>{let f=o.listeners;if(f.delete(l),!f.size&&(Pi.delete(i),o.watcher))return o.watcher.stop().then(()=>{o.rawEmitter=o.watcher=void 0,Object.freeze(o)})}}var aH=r=>{let e=0;for(let t of Pi.keys())if(t.indexOf(r)===0&&(e++,e>=nH))return!0;return!1},cH=()=>so&&Pi.size<128,kg=(r,e)=>{let t=0;for(;!r.indexOf(e)&&(r=bt.dirname(r))!==e;)t++;return t},SA=(r,e)=>r.type===Na&&e.isDirectory()||r.type===EA&&e.isSymbolicLink()||r.type===X$&&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 l=s.has(o)?U$:Tg;this.handleEvent(l,e,t,n,i,s,o,a,c)}async checkExists(e,t,n,i,s,o,a,c){try{let l=await Ag(e);if(this.fsw.closed)return;SA(a,l)?this.addOrChange(e,t,n,i,s,o,a,c):this.handleEvent(Xu,e,t,n,i,s,o,a,c)}catch(l){l.code==="EACCES"?this.addOrChange(e,t,n,i,s,o,a,c):this.handleEvent(Xu,e,t,n,i,s,o,a,c)}}handleEvent(e,t,n,i,s,o,a,c,l){if(!(this.fsw.closed||this.checkIgnored(t)))if(e===Xu){let u=c.type===Na;(u||o.has(a))&&this.fsw._remove(s,a,u)}else{if(e===Tg){if(c.type===Na&&this.fsw._getWatchedDir(t),c.type===EA&&l.followSymlinks){let f=l.depth===void 0?void 0:kg(n,i)+1;return this._addToFsEvents(t,!1,!0,f)}this.fsw._getWatchedDir(s).add(a)}let u=c.type===Na?e+J$:e;this.fsw._emit(u,t),u===xA&&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=oH(e,t,async(c,l,u)=>{if(this.fsw.closed||s.depth!==void 0&&kg(c,t)>s.depth)return;let f=n(bt.join(e,bt.relative(e,c)));if(i&&!i(f))return;let d=bt.dirname(f),g=bt.basename(f),y=this.fsw._getWatchedDir(u.type===Na?f:d);if(iH.has(l)||u.event===K$)if(typeof s.ignored===Cg){let b;try{b=await Ag(f)}catch{}if(this.fsw.closed||this.checkIgnored(f,b))return;SA(u,b)?this.addOrChange(f,c,t,d,y,g,u,s):this.handleEvent(Xu,f,c,t,d,y,g,u,s)}else this.checkExists(f,c,t,d,y,g,u,s);else switch(u.event){case W$:case G$:return this.addOrChange(f,c,t,d,y,g,u,s);case z$:case V$:return this.checkExists(f,c,t,d,y,g,u,s)}},this.fsw._emitRaw);return this.fsw._emitReady(),a}async _handleFsEventsSymlink(e,t,n,i){if(!(this.fsw.closed||this.fsw._symlinkPaths.has(t))){this.fsw._symlinkPaths.set(t,!0),this.fsw._incrReadyCount();try{let s=await 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=bt.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(bt.dirname(o)),l=bt.basename(o);a&&this.fsw._getWatchedDir(o),!c.has(l)&&(c.add(l),(!i.ignoreInitial||s===!0)&&this.fsw._emit(a?xA:Tg,o,t))}initWatch(e,t,n,i){if(this.fsw.closed)return;let s=this._watchWithFsEvents(n.watchPath,bt.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===Cg?t:Q$,a=this.fsw._getWatchHelpers(e);try{let c=await rH[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,c))throw null;if(c.isDirectory()){if(a.globFilter||this.emitAdd(o(e),c,o,s,n),i&&i>s.depth)return;this.fsw._readdirp(a.watchPath,{fileFilter:l=>a.filterPath(l),directoryFilter:l=>a.filterDir(l),...eH(s.depth-(i||0))}).on($$,l=>{if(this.fsw.closed||l.stats.isDirectory()&&!a.filterPath(l))return;let u=bt.join(a.watchPath,l.path),{fullPath:f}=l;if(a.followSymlinks&&l.stats.isSymbolicLink()){let d=s.depth===void 0?void 0:kg(u,bt.resolve(a.watchPath))+1;this._handleFsEventsSymlink(u,f,o,d)}else this.emitAdd(u,l.stats,o,s,n)}).on(q$,Z$).on(H$,()=>{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===Cg)this.initWatch(void 0,e,a,o);else{let c;try{c=await wA(a.watchPath)}catch{}this.initWatch(c,e,a,o)}}};Pg.exports=Rg;Pg.exports.canUse=cH});var LA=A(Vg=>{"use strict";var{EventEmitter:lH}=require("events"),Gg=require("fs"),ue=require("path"),{promisify:PA}=require("util"),uH=fk(),jg=xk().default,pH=Tk(),Ig=fg(),fH=aA(),dH=ug(),hH=yA(),CA=TA(),{EV_ALL:Ng,EV_READY:mH,EV_ADD:Ju,EV_CHANGE:Da,EV_UNLINK:kA,EV_ADD_DIR:gH,EV_UNLINK_DIR:vH,EV_RAW:yH,EV_ERROR:Dg,STR_CLOSE:xH,STR_END:_H,BACK_SLASH_RE:bH,DOUBLE_SLASH_RE:AA,SLASH_OR_BACK_SLASH_RE:wH,DOT_RE:SH,REPLACER_RE:EH,SLASH:Lg,SLASH_SLASH:TH,BRACE_START:CH,BANG:Fg,ONE_DOT:IA,TWO_DOTS:kH,GLOBSTAR:AH,SLASH_GLOBSTAR:Bg,ANYMATCH_OPTS:Ug,STRING_TYPE:zg,FUNCTION_TYPE:RH,EMPTY_STR:qg,EMPTY_FN:OH,isWindows:MH,isMacos:PH,isIBMi:IH}=Gu(),NH=PA(Gg.stat),DH=PA(Gg.readdir),$g=(r=[])=>Array.isArray(r)?r:[r],NA=(r,e=[])=>(r.forEach(t=>{Array.isArray(t)?NA(t,e):e.push(t)}),e),RA=r=>{let e=NA($g(r));if(!e.every(t=>typeof t===zg))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(DA)},OA=r=>{let e=r.replace(bH,Lg),t=!1;for(e.startsWith(TH)&&(t=!0);e.match(AA);)e=e.replace(AA,Lg);return t&&(e=Lg+e),e},DA=r=>OA(ue.normalize(OA(r))),MA=(r=qg)=>e=>typeof e!==zg?e:DA(ue.isAbsolute(e)?e:ue.join(r,e)),LH=(r,e)=>ue.isAbsolute(r)?r:r.startsWith(Fg)?Fg+ue.join(e,r.slice(1)):ue.join(e,r),Lr=(r,e)=>r[e]===void 0,Hg=class{constructor(e,t){this.path=e,this._removeWatcher=t,this.items=new Set}add(e){let{items:t}=this;t&&e!==IA&&e!==kH&&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 DH(n)}catch{this._removeWatcher&&this._removeWatcher(ue.dirname(n),ue.basename(n))}}has(e){let{items:t}=this;if(t)return t.has(e)}getChildren(){let{items:e}=this;if(e)return[...e.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this)}},BH="stat",jH="lstat",Wg=class{constructor(e,t,n,i){this.fsw=i,this.path=e=e.replace(EH,qg),this.watchPath=t,this.fullWatchPath=ue.resolve(t),this.hasGlob=t!==e,e===qg&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&n?void 0:!1,this.globFilter=this.hasGlob?jg(e,void 0,Ug):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(s=>{s.length>1&&s.pop()}),this.followSymlinks=n,this.statMethod=n?BH:jH}checkGlobSymlink(e){return this.globSymlink===void 0&&(this.globSymlink=e.fullParentDir===this.fullWatchPath?!1:{realPath:e.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):e.fullPath}entryPath(e){return ue.join(this.watchPath,ue.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){let{stats:t}=e;if(t&&t.isSymbolicLink())return this.filterDir(e);let n=this.entryPath(e);return(this.hasGlob&&typeof this.globFilter===RH?this.globFilter(n):!0)&&this.fsw._isntIgnored(n,t)&&this.fsw._hasReadPermissions(t)}getDirParts(e){if(!this.hasGlob)return[];let t=[];return(e.includes(CH)?fH.expand(e):[e]).forEach(i=>{t.push(ue.relative(this.watchPath,i).split(wH))}),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===AH&&(n=!0),n||!t[0][o]||jg(s,t[0][o],Ug))))}return!this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}},Zu=class extends lH{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,Lr(t,"persistent")&&(t.persistent=!0),Lr(t,"ignoreInitial")&&(t.ignoreInitial=!1),Lr(t,"ignorePermissionErrors")&&(t.ignorePermissionErrors=!1),Lr(t,"interval")&&(t.interval=100),Lr(t,"binaryInterval")&&(t.binaryInterval=300),Lr(t,"disableGlobbing")&&(t.disableGlobbing=!1),t.enableBinaryInterval=t.binaryInterval!==t.interval,Lr(t,"useFsEvents")&&(t.useFsEvents=!t.usePolling),CA.canUse()||(t.useFsEvents=!1),Lr(t,"usePolling")&&!t.useFsEvents&&(t.usePolling=PH),IH&&(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)),Lr(t,"atomic")&&(t.atomic=!t.usePolling&&!t.useFsEvents),t.atomic&&(this._pendingUnlinks=new Map),Lr(t,"followSymlinks")&&(t.followSymlinks=!0),Lr(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=$g(t.ignored));let a=0;this._emitReady=()=>{a++,a>=this._readyCount&&(this._emitReady=OH,this._readyEmitted=!0,process.nextTick(()=>this.emit(mH)))},this._emitRaw=(...c)=>this.emit(yH,...c),this._readyEmitted=!1,this.options=t,t.useFsEvents?this._fsEventsHandler=new CA(this):this._nodeFsHandler=new hH(this),Object.freeze(t)}add(e,t,n){let{cwd:i,disableGlobbing:s}=this.options;this.closed=!1;let o=RA(e);return i&&(o=o.map(a=>{let c=LH(a,i);return s||!Ig(a)?c:dH(c)})),o=o.filter(a=>a.startsWith(Fg)?(this._ignoredPaths.add(a.slice(1)),!1):(this._ignoredPaths.delete(a),this._ignoredPaths.delete(a+Bg),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=o.length),this.options.persistent&&(this._readyCount+=o.length),o.forEach(a=>this._fsEventsHandler._addToFsEvents(a))):(this._readyCount||(this._readyCount=0),this._readyCount+=o.length,Promise.all(o.map(async a=>{let c=await this._nodeFsHandler._addToNodeFs(a,!n,0,0,t);return c&&this._emitReady(),c})).then(a=>{this.closed||a.filter(c=>c).forEach(c=>{this.add(ue.dirname(c),ue.basename(t||c))})})),this}unwatch(e){if(this.closed)return this;let t=RA(e),{cwd:n}=this.options;return t.forEach(i=>{!ue.isAbsolute(i)&&!this._closers.has(i)&&(n&&(i=ue.join(n,i)),i=ue.resolve(i)),this._closePath(i),this._ignoredPaths.add(i),this._watched.has(i)&&this._ignoredPaths.add(i+Bg),this._userIgnored=void 0}),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(t=>t.forEach(n=>{let i=n();i instanceof Promise&&e.push(i)})),this._streams.forEach(t=>t.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(t=>t.dispose()),["closers","watched","streams","symlinkPaths","throttled"].forEach(t=>{this[`_${t}`].clear()}),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((t,n)=>{let i=this.options.cwd?ue.relative(this.options.cwd,n):n;e[i||IA]=t.getChildren().sort()}),e}emitWithAll(e,t){this.emit(...t),e!==Dg&&this.emit(Ng,...t)}async _emit(e,t,n,i,s){if(this.closed)return;let o=this.options;MH&&(t=ue.normalize(t)),o.cwd&&(t=ue.relative(o.cwd,t));let a=[e,t];s!==void 0?a.push(n,i,s):i!==void 0?a.push(n,i):n!==void 0&&a.push(n);let c=o.awaitWriteFinish,l;if(c&&(l=this._pendingWrites.get(t)))return l.lastChange=new Date,this;if(o.atomic){if(e===kA)return this._pendingUnlinks.set(t,a),setTimeout(()=>{this._pendingUnlinks.forEach((u,f)=>{this.emit(...u),this.emit(Ng,...u),this._pendingUnlinks.delete(f)})},typeof o.atomic=="number"?o.atomic:100),this;e===Ju&&this._pendingUnlinks.has(t)&&(e=a[0]=Da,this._pendingUnlinks.delete(t))}if(c&&(e===Ju||e===Da)&&this._readyEmitted){let u=(f,d)=>{f?(e=a[0]=Dg,a[1]=f,this.emitWithAll(e,a)):d&&(a.length>2?a[2]=d:a.push(d),this.emitWithAll(e,a))};return this._awaitWriteFinish(t,c.stabilityThreshold,e,u),this}if(e===Da&&!this._throttle(Da,t,50))return this;if(o.alwaysStat&&n===void 0&&(e===Ju||e===gH||e===Da)){let u=o.cwd?ue.join(o.cwd,t):t,f;try{f=await NH(u)}catch{}if(!f||this.closed)return;a.push(f)}return this.emitWithAll(e,a),this}_handleError(e){let t=e&&e.code;return e&&t!=="ENOENT"&&t!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||t!=="EPERM"&&t!=="EACCES")&&this.emit(Dg,e),e||this.closed}_throttle(e,t,n){this._throttled.has(e)||this._throttled.set(e,new Map);let i=this._throttled.get(e),s=i.get(t);if(s)return s.count++,!1;let o,a=()=>{let l=i.get(t),u=l?l.count:0;return i.delete(t),clearTimeout(o),l&&clearTimeout(l.timeoutObject),u};o=setTimeout(a,n);let c={timeoutObject:o,clear:a,count:0};return i.set(t,c),c}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,t,n,i){let s,o=e;this.options.cwd&&!ue.isAbsolute(e)&&(o=ue.join(this.options.cwd,e));let a=new Date,c=l=>{Gg.stat(o,(u,f)=>{if(u||!this._pendingWrites.has(e)){u&&u.code!=="ENOENT"&&i(u);return}let d=Number(new Date);l&&f.size!==l.size&&(this._pendingWrites.get(e).lastChange=d);let g=this._pendingWrites.get(e);d-g.lastChange>=t?(this._pendingWrites.delete(e),i(void 0,f)):s=setTimeout(c,this.options.awaitWriteFinish.pollInterval,f)})};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:a,cancelWait:()=>(this._pendingWrites.delete(e),clearTimeout(s),n)}),s=setTimeout(c,this.options.awaitWriteFinish.pollInterval))}_getGlobIgnored(){return[...this._ignoredPaths.values()]}_isIgnored(e,t){if(this.options.atomic&&SH.test(e))return!0;if(!this._userIgnored){let{cwd:n}=this.options,i=this.options.ignored,s=i&&i.map(MA(n)),o=$g(s).filter(c=>typeof c===zg&&!Ig(c)).map(c=>c+Bg),a=this._getGlobIgnored().map(MA(n)).concat(s,o);this._userIgnored=jg(a,void 0,Ug)}return this._userIgnored([e,t])}_isntIgnored(e,t){return!this._isIgnored(e,t)}_getWatchHelpers(e,t){let n=t||this.options.disableGlobbing||!Ig(e)?e:pH(e),i=this.options.followSymlinks;return new Wg(e,n,i,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));let t=ue.resolve(e);return this._watched.has(t)||this._watched.set(t,new Hg(t,this._boundRemove)),this._watched.get(t)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return!0;let n=(e&&Number.parseInt(e.mode,10))&511;return!!(4&Number.parseInt(n.toString(8)[0],10))}_remove(e,t,n){let i=ue.join(e,t),s=ue.resolve(i);if(n=n??(this._watched.has(i)||this._watched.has(s)),!this._throttle("remove",i,100))return;!n&&!this.options.useFsEvents&&this._watched.size===1&&this.add(e,t,!0),this._getWatchedDir(i).getChildren().forEach(d=>this._remove(i,d));let c=this._getWatchedDir(e),l=c.has(t);c.remove(t),this._symlinkPaths.has(s)&&this._symlinkPaths.delete(s);let u=i;if(this.options.cwd&&(u=ue.relative(this.options.cwd,i)),this.options.awaitWriteFinish&&this._pendingWrites.has(u)&&this._pendingWrites.get(u).cancelWait()===Ju)return;this._watched.delete(i),this._watched.delete(s);let f=n?vH:kA;l&&!this._isIgnored(i)&&this._emit(f,i),this.options.useFsEvents||this._closePath(i)}_closePath(e){this._closeFile(e);let t=ue.dirname(e);this._getWatchedDir(t).remove(ue.basename(e))}_closeFile(e){let t=this._closers.get(e);t&&(t.forEach(n=>n()),this._closers.delete(e))}_addPathCloser(e,t){if(!t)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(t)}_readdirp(e,t){if(this.closed)return;let n={type:Ng,alwaysStat:!0,lstat:!0,...t},i=uH(e,n);return this._streams.add(i),i.once(xH,()=>{i=void 0}),i.once(_H,()=>{i&&(this._streams.delete(i),i=void 0)}),i}};Vg.FSWatcher=Zu;var FH=(r,e)=>{let t=new Zu(e);return t.add(r),t};Vg.watch=FH});var CR=A((S5,ev)=>{"use strict";var ZH=Object.prototype.hasOwnProperty,Bt="~";function Fa(){}Object.create&&(Fa.prototype=Object.create(null),new Fa().__proto__||(Bt=!1));function QH(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 QH(t,n||r,i),o=Bt?Bt+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 cp(r,e){--r._eventsCount===0?r._events=new Fa:delete r._events[e]}function Rt(){this._events=new Fa,this._eventsCount=0}Rt.prototype.eventNames=function(){var e=[],t,n;if(this._eventsCount===0)return e;for(n in t=this._events)ZH.call(t,n)&&e.push(Bt?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e};Rt.prototype.listeners=function(e){var t=Bt?Bt+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};Rt.prototype.listenerCount=function(e){var t=Bt?Bt+e:e,n=this._events[t];return n?n.fn?1:n.length:0};Rt.prototype.emit=function(e,t,n,i,s,o){var a=Bt?Bt+e:e;if(!this._events[a])return!1;var c=this._events[a],l=arguments.length,u,f;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,n),!0;case 4:return c.fn.call(c.context,t,n,i),!0;case 5:return c.fn.call(c.context,t,n,i,s),!0;case 6:return c.fn.call(c.context,t,n,i,s,o),!0}for(f=1,u=new Array(l-1);f<l;f++)u[f-1]=arguments[f];c.fn.apply(c.context,u)}else{var d=c.length,g;for(f=0;f<d;f++)switch(c[f].once&&this.removeListener(e,c[f].fn,void 0,!0),l){case 1:c[f].fn.call(c[f].context);break;case 2:c[f].fn.call(c[f].context,t);break;case 3:c[f].fn.call(c[f].context,t,n);break;case 4:c[f].fn.call(c[f].context,t,n,i);break;default:if(!u)for(g=1,u=new Array(l-1);g<l;g++)u[g-1]=arguments[g];c[f].fn.apply(c[f].context,u)}}return!0};Rt.prototype.on=function(e,t,n){return TR(this,e,t,n,!1)};Rt.prototype.once=function(e,t,n){return TR(this,e,t,n,!0)};Rt.prototype.removeListener=function(e,t,n,i){var s=Bt?Bt+e:e;if(!this._events[s])return this;if(!t)return cp(this,s),this;var o=this._events[s];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&cp(this,s);else{for(var a=0,c=[],l=o.length;a<l;a++)(o[a].fn!==t||i&&!o[a].once||n&&o[a].context!==n)&&c.push(o[a]);c.length?this._events[s]=c.length===1?c[0]:c:cp(this,s)}return this};Rt.prototype.removeAllListeners=function(e){var t;return e?(t=Bt?Bt+e:e,this._events[t]&&cp(this,t)):(this._events=new Fa,this._eventsCount=0),this};Rt.prototype.off=Rt.prototype.removeListener;Rt.prototype.addListener=Rt.prototype.on;Rt.prefixed=Bt;Rt.EventEmitter=Rt;typeof ev<"u"&&(ev.exports=Rt)});var AR=A((E5,kR)=>{"use strict";kR.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 lp=A(OR=>{var Pn=OR,e4=require("url"),RR=require("util")._extend,t4=AR(),r4=/(^|,)\s*upgrade\s*($|,)/i,tv=/^https|wss/;Pn.isSSL=tv;Pn.setupOutgoing=function(r,e,t,n){r.port=e[n||"target"].port||(tv.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=RR({},t.headers),e.headers&&RR(r.headers,e.headers),e.auth&&(r.auth=e.auth),e.ca&&(r.ca=e.ca),tv.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"||!r4.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:e4.parse(t.url).path||"";return o=e.ignorePath?"":o,r.path=Pn.urlJoin(s,o),e.changeOrigin&&(r.headers.host=t4(r.port,e[n||"target"].protocol)&&!n4(r.host)?r.host+":"+r.port:r.host),r};Pn.setupSocket=function(r){return r.setTimeout(0),r.setNoDelay(!0),r.setKeepAlive(!0,0),r};Pn.getPort=function(r){var e=r.headers.host?r.headers.host.match(/:(\d+)/):"";return e?e[1]:Pn.hasEncryptedConnection(r)?"443":"80"};Pn.hasEncryptedConnection=function(r){return!!(r.connection.encrypted||r.connection.pair)};Pn.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("?")};Pn.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 n4(r){return!!~r.indexOf(":")}});var NR=A((C5,IR)=>{var MR=require("url"),PR=lp(),i4=/^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&&i4.test(n.statusCode)){var s=MR.parse(i.target),o=MR.parse(n.headers.location);if(s.host!=o.host)return;i.hostRewrite?o.host=i.hostRewrite:i.autoRewrite&&(o.host=e.headers.host),i.protocolRewrite&&(o.protocol=i.protocolRewrite),n.headers.location=o.format()}},writeHeaders:function(e,t,n,i){var s=i.cookieDomainRewrite,o=i.cookiePathRewrite,a=i.preserveHeaderKeyCase,c,l=function(d,g){g!=null&&(s&&d.toLowerCase()==="set-cookie"&&(g=PR.rewriteCookieProperty(g,s,"domain")),o&&d.toLowerCase()==="set-cookie"&&(g=PR.rewriteCookieProperty(g,o,"path")),t.setHeader(String(d).trim(),g))};if(typeof s=="string"&&(s={"*":s}),typeof o=="string"&&(o={"*":o}),a&&n.rawHeaders!=null){c={};for(var u=0;u<n.rawHeaders.length;u+=2){var f=n.rawHeaders[u];c[f.toLowerCase()]=f}}Object.keys(n.headers).forEach(function(d){var g=n.headers[d];a&&c&&(d=c[d]||d),l(d,g)})},writeStatusCode:function(e,t,n){n.statusMessage?(t.statusCode=n.statusCode,t.statusMessage=n.statusMessage):t.statusCode=n.statusCode}}});var LR=A((k5,DR)=>{var Ua;DR.exports=function(){if(!Ua){try{Ua=Oe()("follow-redirects")}catch{}typeof Ua!="function"&&(Ua=function(){})}Ua.apply(null,arguments)}});var qR=A((A5,dv)=>{var $a=require("url"),qa=$a.URL,s4=require("http"),o4=require("https"),ov=require("stream").Writable,av=require("assert"),BR=LR();(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 cv=!1;try{av(new qa(""))}catch(r){cv=r.code==="ERR_INVALID_URL"}var a4=["Authorization","Proxy-Authorization","Cookie"],c4=["auth","host","hostname","href","path","pathname","port","protocol","query","search","hash"],lv=["abort","aborted","connect","error","socket","timeout"],uv=Object.create(null);lv.forEach(function(r){uv[r]=function(e,t,n){this._redirectable.emit(r,e,t,n)}});var nv=Ha("ERR_INVALID_URL","Invalid URL",TypeError),iv=Ha("ERR_FR_REDIRECTION_FAILURE","Redirected request failed"),l4=Ha("ERR_FR_TOO_MANY_REDIRECTS","Maximum number of redirects exceeded",iv),u4=Ha("ERR_FR_MAX_BODY_LENGTH_EXCEEDED","Request body larger than maxBodyLength limit"),p4=Ha("ERR_STREAM_WRITE_AFTER_END","write after end"),f4=ov.prototype.destroy||FR;function Kt(r,e){ov.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 iv?i:new iv({cause:i}))}},this._headerFilter=new RegExp("^(?:"+a4.concat(r.sensitiveHeaders).map(y4).join("|")+")$","i"),this._performRequest()}Kt.prototype=Object.create(ov.prototype);Kt.prototype.abort=function(){fv(this._currentRequest),this._currentRequest.abort(),this.emit("abort")};Kt.prototype.destroy=function(r){return fv(this._currentRequest,r),f4.call(this,r),this};Kt.prototype.write=function(r,e,t){if(this._ending)throw new p4;if(!Li(r)&&!g4(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 u4),this.abort())};Kt.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}};Kt.prototype.setHeader=function(r,e){this._options.headers[r]=e,this._currentRequest.setHeader(r,e)};Kt.prototype.removeHeader=function(r){delete this._options.headers[r],this._currentRequest.removeHeader(r)};Kt.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){Kt.prototype[r]=function(e,t){return this._currentRequest[r](e,t)}});["aborted","connection","socket"].forEach(function(r){Object.defineProperty(Kt.prototype,r,{get:function(){return this._currentRequest[r]}})});Kt.prototype._sanitizeOptions=function(r){if(r.headers||(r.headers={}),m4(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))}};Kt.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 lv)n.on(i,uv[i]);if(this._currentUrl=/^\//.test(this._options.path)?$a.format(this._options):this._options.path,this._isRedirect){var s=0,o=this,a=this._requestBodyBuffers;(function c(l){if(n===o._currentRequest)if(l)o.emit("error",l);else if(s<a.length){var u=a[s++];n.finished||n.write(u.data,u.encoding,c)}else o._ended&&n.end()})()}};Kt.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(fv(this._currentRequest),r.destroy(),++this._redirectCount>this._options.maxRedirects)throw new l4;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=[],rv(/^content-/i,this._options.headers));var o=rv(/^host$/i,this._options.headers),a=pv(this._currentUrl),c=o||a.host,l=/^\w+:/.test(t)?this._currentUrl:$a.format(Object.assign(a,{host:c})),u=d4(t,l);if(BR("redirecting to",u.href),this._isRedirect=!0,sv(u,this._options),(u.protocol!==a.protocol&&u.protocol!=="https:"||u.host!==c&&!h4(u.host,c))&&rv(this._headerFilter,this._options.headers),Bi(i)){var f={headers:r.headers,statusCode:e},d={url:l,method:s,headers:n};i(this._options,f,d),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(l,u,f){return v4(l)?l=sv(l):Li(l)?l=sv(pv(l)):(f=u,u=UR(l),l={protocol:i}),Bi(u)&&(f=u,u=null),u=Object.assign({maxRedirects:e.maxRedirects,maxBodyLength:e.maxBodyLength},l,u),u.nativeProtocols=t,!Li(u.host)&&!Li(u.hostname)&&(u.hostname="::1"),av.equal(u.protocol,i,"protocol mismatch"),BR("options",u),new Kt(u,f)}function c(l,u,f){var d=o.request(l,u,f);return d.end(),d}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 pv(r){var e;if(cv)e=new qa(r);else if(e=UR($a.parse(r)),!Li(e.protocol))throw new nv({input:r});return e}function d4(r,e){return cv?new qa(r,e):pv($a.resolve(e,r))}function UR(r){if(/^\[/.test(r.hostname)&&!/^\[[:0-9a-f]+\]$/i.test(r.hostname))throw new nv({input:r.href||r});if(/^\[/.test(r.host)&&!/^\[[:0-9a-f]+\](:\d+)?$/i.test(r.host))throw new nv({input:r.href||r});return r}function sv(r,e){var t=e||{};for(var n of c4)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 rv(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 Ha(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 fv(r,e){for(var t of lv)r.removeListener(t,uv[t]);r.on("error",FR),r.destroy(e)}function h4(r,e){av(Li(r)&&Li(e));var t=r.length-e.length-1;return t>0&&r[t]==="."&&r.endsWith(e)}function m4(r){return r instanceof Array}function Li(r){return typeof r=="string"||r instanceof String}function Bi(r){return typeof r=="function"}function g4(r){return typeof r=="object"&&"length"in r}function v4(r){return qa&&r instanceof qa}function y4(r){return r.replace(/[\]\\/()*+?.$]/g,"\\$&")}dv.exports=jR({http:s4,https:o4});dv.exports.wrap=jR});var HR=A((R5,$R)=>{var x4=require("http"),_4=require("https"),Wa=NR(),up=lp(),b4=qR();Wa=Object.keys(Wa).map(function(r){return Wa[r]});var w4={http:x4,https:_4};$R.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||up.hasEncryptedConnection(e),s={for:e.connection.remoteAddress||e.socket.remoteAddress,port:up.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?b4:w4,c=a.http,l=a.https;if(n.forward){var u=(n.forward.protocol==="https:"?l:c).request(up.setupOutgoing(n.ssl||{},n,e,"forward")),f=y(u,n.forward);if(e.on("error",f),u.on("error",f),(n.buffer||e).pipe(u),!n.target)return t.end()}var d=(n.target.protocol==="https:"?l:c).request(up.setupOutgoing(n.ssl||{},n,e));d.on("socket",function(b){s&&!d.getHeader("expect")&&s.emit("proxyReq",d,e,t,n)}),n.proxyTimeout&&d.setTimeout(n.proxyTimeout,function(){d.abort()}),e.on("aborted",function(){d.abort()});var g=y(d,n.target);e.on("error",g),d.on("error",g);function y(b,C){return function(O){if(e.socket.destroyed&&O.code==="ECONNRESET")return s.emit("econnreset",O,e,t,C),b.abort();o?o(O,e,t,C):s.emit("error",O,e,t,C)}}(n.buffer||e).pipe(d),d.on("response",function(b){if(s&&s.emit("proxyRes",b,e,t),!t.headersSent&&!n.selfHandleResponse)for(var C=0;C<Wa.length&&!Wa[C](e,t,b,n);C++);t.finished?s&&s.emit("end",e,t,b):(b.on("end",function(){s&&s.emit("end",e,t,b)}),n.selfHandleResponse||b.pipe(t))})}}});var GR=A((O5,WR)=>{var S4=require("http"),E4=require("https"),ho=lp();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:ho.getPort(e),proto:ho.hasEncryptedConnection(e)?"wss":"ws"};["for","port","proto"].forEach(function(s){e.headers["x-forwarded-"+s]=(e.headers["x-forwarded-"+s]||"")+(e.headers["x-forwarded-"+s]?",":"")+i[s]})}},stream:function(e,t,n,i,s,o){var a=function(u,f){return Object.keys(f).reduce(function(d,g){var y=f[g];if(!Array.isArray(y))return d.push(g+": "+y),d;for(var b=0;b<y.length;b++)d.push(g+": "+y[b]);return d},[u]).join(`\r
|
|
106
106
|
`)+`\r
|
|
107
107
|
\r
|
|
108
|
-
`};ho.setupSocket(t),i&&i.length&&t.unshift(i);var c=(ho.isSSL.test(n.target.protocol)?y4:v4).request(ho.setupOutgoing(n.ssl||{},n,e));return s&&s.emit("proxyReqWs",c,e,t,n,i),c.on("error",l),c.on("response",function(u){u.upgrade||(t.write(a("HTTP/"+u.httpVersion+" "+u.statusCode+" "+u.statusMessage,u.headers)),u.pipe(t))}),c.on("upgrade",function(u,f,d){f.on("error",l),f.on("end",function(){s.emit("close",u,f,d)}),t.on("error",function(){f.end()}),ho.setupSocket(f),d&&d.length&&f.unshift(d),t.write(a("HTTP/1.1 101 Switching Protocols",u.headers)),f.pipe(t).pipe(f),s.emit("open",f),s.emit("proxySocket",f)}),c.end();function l(u){o?o(u,e,t):s.emit("error",u,e,t),t.end()}}}});var VR=k((T5,zR)=>{var WR=zR.exports,qR=require("util")._extend,x4=require("url").parse,GR=bR(),_4=require("http"),b4=require("https"),$R=jR(),HR=UR();WR.Server=ji;function pv(r){return function(e){return function(t,n){var i=r==="ws"?this.wsPasses:this.webPasses,s=[].slice.call(arguments),o=s.length-1,a,c;typeof s[o]=="function"&&(c=s[o],o--);var l=e;if(!(s[o]instanceof Buffer)&&s[o]!==n&&(l=qR({},e),qR(l,s[o]),o--),s[o]instanceof Buffer&&(a=s[o]),["target","forward"].forEach(function(f){typeof l[f]=="string"&&(l[f]=x4(l[f]))}),!l.target&&!l.forward)return this.emit("error",new Error("Must provide a proper URL as target"));for(var u=0;u<i.length&&!i[u](t,n,l,a,this,c);u++);}}}WR.createRightProxy=pv;function ji(r){GR.call(this),r=r||{},r.prependPath=r.prependPath!==!1,this.web=this.proxyRequest=pv("web")(r),this.ws=this.proxyWebsocketRequest=pv("ws")(r),this.options=r,this.webPasses=Object.keys($R).map(function(e){return $R[e]}),this.wsPasses=Object.keys(HR).map(function(e){return HR[e]}),this.on("error",this.onError,this)}require("util").inherits(ji,GR);ji.prototype.onError=function(r){if(this.listeners("error").length===1)throw r};ji.prototype.listen=function(r,e){var t=this,n=function(i,s){t.web(i,s)};return this._server=this.options.ssl?b4.createServer(this.options.ssl,n):_4.createServer(n),this.options.ws&&this._server.on("upgrade",function(i,s,o){t.ws(i,s,o)}),this._server.listen(r,e),this};ji.prototype.close=function(r){var e=this;this._server&&this._server.close(t);function t(){e._server=null,r&&r.apply(null,arguments)}};ji.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)};ji.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 YR=k((C5,KR)=>{var Ga=VR().Server;function fv(r){return new Ga(r)}Ga.createProxyServer=fv;Ga.createServer=fv;Ga.createProxy=fv;KR.exports=Ga});var JR=k((A5,XR)=>{XR.exports=YR()});var _O=k((Va,hv)=>{(function(r,e){typeof Va=="object"&&typeof hv=="object"?hv.exports=e(require("child_process"),require("crypto")):typeof define=="function"&&define.amd?define(["child_process","crypto"],e):typeof Va=="object"?Va["electron-machine-id"]=e(require("child_process"),require("crypto")):r["electron-machine-id"]=e(r.child_process,r.crypto)})(Va,function(r,e){return(function(t){function n(s){if(i[s])return i[s].exports;var o=i[s]={exports:{},id:s,loaded:!1};return t[s].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var i={};return n.m=t,n.c=i,n.p="",n(0)})([function(t,n,i){t.exports=i(34)},function(t,n,i){var s=i(29)("wks"),o=i(33),a=i(2).Symbol,c=typeof a=="function",l=t.exports=function(u){return s[u]||(s[u]=c&&a[u]||(c?a:o)("Symbol."+u))};l.store=s},function(t,n){var i=t.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=i)},function(t,n,i){var s=i(9);t.exports=function(o){if(!s(o))throw TypeError(o+" is not an object!");return o}},function(t,n,i){t.exports=!i(24)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},function(t,n,i){var s=i(12),o=i(17);t.exports=i(4)?function(a,c,l){return s.f(a,c,o(1,l))}:function(a,c,l){return a[c]=l,a}},function(t,n){var i=t.exports={version:"2.4.0"};typeof __e=="number"&&(__e=i)},function(t,n,i){var s=i(14);t.exports=function(o,a,c){if(s(o),a===void 0)return o;switch(c){case 1:return function(l){return o.call(a,l)};case 2:return function(l,u){return o.call(a,l,u)};case 3:return function(l,u,f){return o.call(a,l,u,f)}}return function(){return o.apply(a,arguments)}}},function(t,n){var i={}.hasOwnProperty;t.exports=function(s,o){return i.call(s,o)}},function(t,n){t.exports=function(i){return typeof i=="object"?i!==null:typeof i=="function"}},function(t,n){t.exports={}},function(t,n){var i={}.toString;t.exports=function(s){return i.call(s).slice(8,-1)}},function(t,n,i){var s=i(3),o=i(26),a=i(32),c=Object.defineProperty;n.f=i(4)?Object.defineProperty:function(l,u,f){if(s(l),u=a(u,!0),s(f),o)try{return c(l,u,f)}catch{}if("get"in f||"set"in f)throw TypeError("Accessors not supported!");return"value"in f&&(l[u]=f.value),l}},function(t,n,i){var s=i(42),o=i(15);t.exports=function(a){return s(o(a))}},function(t,n){t.exports=function(i){if(typeof i!="function")throw TypeError(i+" is not a function!");return i}},function(t,n){t.exports=function(i){if(i==null)throw TypeError("Can't call method on "+i);return i}},function(t,n,i){var s=i(9),o=i(2).document,a=s(o)&&s(o.createElement);t.exports=function(c){return a?o.createElement(c):{}}},function(t,n){t.exports=function(i,s){return{enumerable:!(1&i),configurable:!(2&i),writable:!(4&i),value:s}}},function(t,n,i){var s=i(12).f,o=i(8),a=i(1)("toStringTag");t.exports=function(c,l,u){c&&!o(c=u?c:c.prototype,a)&&s(c,a,{configurable:!0,value:l})}},function(t,n,i){var s=i(29)("keys"),o=i(33);t.exports=function(a){return s[a]||(s[a]=o(a))}},function(t,n){var i=Math.ceil,s=Math.floor;t.exports=function(o){return isNaN(o=+o)?0:(o>0?s:i)(o)}},function(t,n,i){var s=i(11),o=i(1)("toStringTag"),a=s((function(){return arguments})())=="Arguments",c=function(l,u){try{return l[u]}catch{}};t.exports=function(l){var u,f,d;return l===void 0?"Undefined":l===null?"Null":typeof(f=c(u=Object(l),o))=="string"?f:a?s(u):(d=s(u))=="Object"&&typeof u.callee=="function"?"Arguments":d}},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n,i){var s=i(2),o=i(6),a=i(7),c=i(5),l="prototype",u=function(f,d,g){var y,b,C,R=f&u.F,M=f&u.G,P=f&u.S,B=f&u.P,G=f&u.B,F=f&u.W,V=M?o:o[d]||(o[d]={}),D=V[l],$=M?s:P?s[d]:(s[d]||{})[l];M&&(g=d);for(y in g)b=!R&&$&&$[y]!==void 0,b&&y in V||(C=b?$[y]:g[y],V[y]=M&&typeof $[y]!="function"?g[y]:G&&b?a(C,s):F&&$[y]==C?(function(T){var p=function(m,x,S){if(this instanceof T){switch(arguments.length){case 0:return new T;case 1:return new T(m);case 2:return new T(m,x)}return new T(m,x,S)}return T.apply(this,arguments)};return p[l]=T[l],p})(C):B&&typeof C=="function"?a(Function.call,C):C,B&&((V.virtual||(V.virtual={}))[y]=C,f&u.R&&D&&!D[y]&&c(D,y,C)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,n){t.exports=function(i){try{return!!i()}catch{return!0}}},function(t,n,i){t.exports=i(2).document&&document.documentElement},function(t,n,i){t.exports=!i(4)&&!i(24)(function(){return Object.defineProperty(i(16)("div"),"a",{get:function(){return 7}}).a!=7})},function(t,n,i){"use strict";var s=i(28),o=i(23),a=i(57),c=i(5),l=i(8),u=i(10),f=i(45),d=i(18),g=i(52),y=i(1)("iterator"),b=!([].keys&&"next"in[].keys()),C="@@iterator",R="keys",M="values",P=function(){return this};t.exports=function(B,G,F,V,D,$,T){f(F,G,V);var p,m,x,S=function(I){if(!b&&I in w)return w[I];switch(I){case R:return function(){return new F(this,I)};case M:return function(){return new F(this,I)}}return function(){return new F(this,I)}},v=G+" Iterator",_=D==M,A=!1,w=B.prototype,h=w[y]||w[C]||D&&w[D],E=h||S(D),q=D?_?S("entries"):E:void 0,O=G=="Array"&&w.entries||h;if(O&&(x=g(O.call(new B)),x!==Object.prototype&&(d(x,v,!0),s||l(x,y)||c(x,y,P))),_&&h&&h.name!==M&&(A=!0,E=function(){return h.call(this)}),s&&!T||!b&&!A&&w[y]||c(w,y,E),u[G]=E,u[v]=P,D)if(p={values:_?E:S(M),keys:$?E:S(R),entries:q},T)for(m in p)m in w||a(w,m,p[m]);else o(o.P+o.F*(b||A),G,p);return p}},function(t,n){t.exports=!0},function(t,n,i){var s=i(2),o="__core-js_shared__",a=s[o]||(s[o]={});t.exports=function(c){return a[c]||(a[c]={})}},function(t,n,i){var s,o,a,c=i(7),l=i(41),u=i(25),f=i(16),d=i(2),g=d.process,y=d.setImmediate,b=d.clearImmediate,C=d.MessageChannel,R=0,M={},P="onreadystatechange",B=function(){var F=+this;if(M.hasOwnProperty(F)){var V=M[F];delete M[F],V()}},G=function(F){B.call(F.data)};y&&b||(y=function(F){for(var V=[],D=1;arguments.length>D;)V.push(arguments[D++]);return M[++R]=function(){l(typeof F=="function"?F:Function(F),V)},s(R),R},b=function(F){delete M[F]},i(11)(g)=="process"?s=function(F){g.nextTick(c(B,F,1))}:C?(o=new C,a=o.port2,o.port1.onmessage=G,s=c(a.postMessage,a,1)):d.addEventListener&&typeof postMessage=="function"&&!d.importScripts?(s=function(F){d.postMessage(F+"","*")},d.addEventListener("message",G,!1)):s=P in f("script")?function(F){u.appendChild(f("script"))[P]=function(){u.removeChild(this),B.call(F)}}:function(F){setTimeout(c(B,F,1),0)}),t.exports={set:y,clear:b}},function(t,n,i){var s=i(20),o=Math.min;t.exports=function(a){return a>0?o(s(a),9007199254740991):0}},function(t,n,i){var s=i(9);t.exports=function(o,a){if(!s(o))return o;var c,l;if(a&&typeof(c=o.toString)=="function"&&!s(l=c.call(o))||typeof(c=o.valueOf)=="function"&&!s(l=c.call(o))||!a&&typeof(c=o.toString)=="function"&&!s(l=c.call(o)))return l;throw TypeError("Can't convert object to primitive value")}},function(t,n){var i=0,s=Math.random();t.exports=function(o){return"Symbol(".concat(o===void 0?"":o,")_",(++i+s).toString(36))}},function(t,n,i){"use strict";function s(P){return P&&P.__esModule?P:{default:P}}function o(){return process.platform!=="win32"?"":process.arch==="ia32"&&process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432")?"mixed":"native"}function a(P){return(0,y.createHash)("sha256").update(P).digest("hex")}function c(P){switch(C){case"darwin":return P.split("IOPlatformUUID")[1].split(`
|
|
109
|
-
`)[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return P.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":return P.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"freebsd":return P.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw new Error("Unsupported platform: "+process.platform)}}function l(P){var B=c((0,g.execSync)(M[C]).toString());return P?B:a(B)}function u(P){return new d.default(function(B,G){return(0,g.exec)(M[C],{},function(F,V,D){if(F)return G(new Error("Error while obtaining machine id: "+F.stack));var $=c(V.toString());return B(P?$:a($))})})}Object.defineProperty(n,"__esModule",{value:!0});var f=i(35),d=s(f);n.machineIdSync=l,n.machineId=u;var g=i(70),y=i(71),b=process,C=b.platform,R={native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"},M={darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:R[o()]+"\\REG.exe QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",linux:"( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :",freebsd:"kenv -q smbios.system.uuid || sysctl -n kern.hostuuid"}},function(t,n,i){t.exports={default:i(36),__esModule:!0}},function(t,n,i){i(66),i(68),i(69),i(67),t.exports=i(6).Promise},function(t,n){t.exports=function(){}},function(t,n){t.exports=function(i,s,o,a){if(!(i instanceof s)||a!==void 0&&a in i)throw TypeError(o+": incorrect invocation!");return i}},function(t,n,i){var s=i(13),o=i(31),a=i(62);t.exports=function(c){return function(l,u,f){var d,g=s(l),y=o(g.length),b=a(f,y);if(c&&u!=u){for(;y>b;)if(d=g[b++],d!=d)return!0}else for(;y>b;b++)if((c||b in g)&&g[b]===u)return c||b||0;return!c&&-1}}},function(t,g,i){var s=i(7),o=i(44),a=i(43),c=i(3),l=i(31),u=i(64),f={},d={},g=t.exports=function(y,b,C,R,M){var P,B,G,F,V=M?function(){return y}:u(y),D=s(C,R,b?2:1),$=0;if(typeof V!="function")throw TypeError(y+" is not iterable!");if(a(V)){for(P=l(y.length);P>$;$++)if(F=b?D(c(B=y[$])[0],B[1]):D(y[$]),F===f||F===d)return F}else for(G=V.call(y);!(B=G.next()).done;)if(F=o(G,D,B.value,b),F===f||F===d)return F};g.BREAK=f,g.RETURN=d},function(t,n){t.exports=function(i,s,o){var a=o===void 0;switch(s.length){case 0:return a?i():i.call(o);case 1:return a?i(s[0]):i.call(o,s[0]);case 2:return a?i(s[0],s[1]):i.call(o,s[0],s[1]);case 3:return a?i(s[0],s[1],s[2]):i.call(o,s[0],s[1],s[2]);case 4:return a?i(s[0],s[1],s[2],s[3]):i.call(o,s[0],s[1],s[2],s[3])}return i.apply(o,s)}},function(t,n,i){var s=i(11);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(o){return s(o)=="String"?o.split(""):Object(o)}},function(t,n,i){var s=i(10),o=i(1)("iterator"),a=Array.prototype;t.exports=function(c){return c!==void 0&&(s.Array===c||a[o]===c)}},function(t,n,i){var s=i(3);t.exports=function(o,a,c,l){try{return l?a(s(c)[0],c[1]):a(c)}catch(f){var u=o.return;throw u!==void 0&&s(u.call(o)),f}}},function(t,n,i){"use strict";var s=i(49),o=i(17),a=i(18),c={};i(5)(c,i(1)("iterator"),function(){return this}),t.exports=function(l,u,f){l.prototype=s(c,{next:o(1,f)}),a(l,u+" Iterator")}},function(t,n,i){var s=i(1)("iterator"),o=!1;try{var a=[7][s]();a.return=function(){o=!0},Array.from(a,function(){throw 2})}catch{}t.exports=function(c,l){if(!l&&!o)return!1;var u=!1;try{var f=[7],d=f[s]();d.next=function(){return{done:u=!0}},f[s]=function(){return d},c(f)}catch{}return u}},function(t,n){t.exports=function(i,s){return{value:s,done:!!i}}},function(t,n,i){var s=i(2),o=i(30).set,a=s.MutationObserver||s.WebKitMutationObserver,c=s.process,l=s.Promise,u=i(11)(c)=="process";t.exports=function(){var f,d,g,y=function(){var M,P;for(u&&(M=c.domain)&&M.exit();f;){P=f.fn,f=f.next;try{P()}catch(B){throw f?g():d=void 0,B}}d=void 0,M&&M.enter()};if(u)g=function(){c.nextTick(y)};else if(a){var b=!0,C=document.createTextNode("");new a(y).observe(C,{characterData:!0}),g=function(){C.data=b=!b}}else if(l&&l.resolve){var R=l.resolve();g=function(){R.then(y)}}else g=function(){o.call(s,y)};return function(M){var P={fn:M,next:void 0};d&&(d.next=P),f||(f=P,g()),d=P}}},function(t,n,i){var s=i(3),o=i(50),a=i(22),c=i(19)("IE_PROTO"),l=function(){},u="prototype",f=function(){var d,g=i(16)("iframe"),y=a.length,b=">";for(g.style.display="none",i(25).appendChild(g),g.src="javascript:",d=g.contentWindow.document,d.open(),d.write("<script>document.F=Object</script"+b),d.close(),f=d.F;y--;)delete f[u][a[y]];return f()};t.exports=Object.create||function(d,g){var y;return d!==null?(l[u]=s(d),y=new l,l[u]=null,y[c]=d):y=f(),g===void 0?y:o(y,g)}},function(t,n,i){var s=i(12),o=i(3),a=i(54);t.exports=i(4)?Object.defineProperties:function(c,l){o(c);for(var u,f=a(l),d=f.length,g=0;d>g;)s.f(c,u=f[g++],l[u]);return c}},function(t,n,i){var s=i(55),o=i(17),a=i(13),c=i(32),l=i(8),u=i(26),f=Object.getOwnPropertyDescriptor;n.f=i(4)?f:function(d,g){if(d=a(d),g=c(g,!0),u)try{return f(d,g)}catch{}if(l(d,g))return o(!s.f.call(d,g),d[g])}},function(t,n,i){var s=i(8),o=i(63),a=i(19)("IE_PROTO"),c=Object.prototype;t.exports=Object.getPrototypeOf||function(l){return l=o(l),s(l,a)?l[a]:typeof l.constructor=="function"&&l instanceof l.constructor?l.constructor.prototype:l instanceof Object?c:null}},function(t,n,i){var s=i(8),o=i(13),a=i(39)(!1),c=i(19)("IE_PROTO");t.exports=function(l,u){var f,d=o(l),g=0,y=[];for(f in d)f!=c&&s(d,f)&&y.push(f);for(;u.length>g;)s(d,f=u[g++])&&(~a(y,f)||y.push(f));return y}},function(t,n,i){var s=i(53),o=i(22);t.exports=Object.keys||function(a){return s(a,o)}},function(t,n){n.f={}.propertyIsEnumerable},function(t,n,i){var s=i(5);t.exports=function(o,a,c){for(var l in a)c&&o[l]?o[l]=a[l]:s(o,l,a[l]);return o}},function(t,n,i){t.exports=i(5)},function(t,n,i){var s=i(9),o=i(3),a=function(c,l){if(o(c),!s(l)&&l!==null)throw TypeError(l+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?(function(c,l,u){try{u=i(7)(Function.call,i(51).f(Object.prototype,"__proto__").set,2),u(c,[]),l=!(c instanceof Array)}catch{l=!0}return function(f,d){return a(f,d),l?f.__proto__=d:u(f,d),f}})({},!1):void 0),check:a}},function(t,n,i){"use strict";var s=i(2),o=i(6),a=i(12),c=i(4),l=i(1)("species");t.exports=function(u){var f=typeof o[u]=="function"?o[u]:s[u];c&&f&&!f[l]&&a.f(f,l,{configurable:!0,get:function(){return this}})}},function(t,n,i){var s=i(3),o=i(14),a=i(1)("species");t.exports=function(c,l){var u,f=s(c).constructor;return f===void 0||(u=s(f)[a])==null?l:o(u)}},function(t,n,i){var s=i(20),o=i(15);t.exports=function(a){return function(c,l){var u,f,d=String(o(c)),g=s(l),y=d.length;return g<0||g>=y?a?"":void 0:(u=d.charCodeAt(g),u<55296||u>56319||g+1===y||(f=d.charCodeAt(g+1))<56320||f>57343?a?d.charAt(g):u:a?d.slice(g,g+2):(u-55296<<10)+(f-56320)+65536)}}},function(t,n,i){var s=i(20),o=Math.max,a=Math.min;t.exports=function(c,l){return c=s(c),c<0?o(c+l,0):a(c,l)}},function(t,n,i){var s=i(15);t.exports=function(o){return Object(s(o))}},function(t,n,i){var s=i(21),o=i(1)("iterator"),a=i(10);t.exports=i(6).getIteratorMethod=function(c){if(c!=null)return c[o]||c["@@iterator"]||a[s(c)]}},function(t,n,i){"use strict";var s=i(37),o=i(47),a=i(10),c=i(13);t.exports=i(27)(Array,"Array",function(l,u){this._t=c(l),this._i=0,this._k=u},function(){var l=this._t,u=this._k,f=this._i++;return!l||f>=l.length?(this._t=void 0,o(1)):u=="keys"?o(0,f):u=="values"?o(0,l[f]):o(0,[f,l[f]])},"values"),a.Arguments=a.Array,s("keys"),s("values"),s("entries")},function(t,n){},function(t,n,i){"use strict";var s,o,a,c=i(28),l=i(2),u=i(7),f=i(21),d=i(23),g=i(9),y=(i(3),i(14)),b=i(38),C=i(40),R=(i(58).set,i(60)),M=i(30).set,P=i(48)(),B="Promise",G=l.TypeError,V=l.process,F=l[B],V=l.process,D=f(V)=="process",$=function(){},T=!!(function(){try{var O=F.resolve(1),I=(O.constructor={})[i(1)("species")]=function(j){j($,$)};return(D||typeof PromiseRejectionEvent=="function")&&O.then($)instanceof I}catch{}})(),p=function(O,I){return O===I||O===F&&I===a},m=function(O){var I;return!(!g(O)||typeof(I=O.then)!="function")&&I},x=function(O){return p(F,O)?new S(O):new o(O)},S=o=function(O){var I,j;this.promise=new O(function(K,U){if(I!==void 0||j!==void 0)throw G("Bad Promise constructor");I=K,j=U}),this.resolve=y(I),this.reject=y(j)},v=function(O){try{O()}catch(I){return{error:I}}},_=function(O,I){if(!O._n){O._n=!0;var j=O._c;P(function(){for(var K=O._v,U=O._s==1,ke=0,ie=function(N){var ne,L,z=U?N.ok:N.fail,oe=N.resolve,Q=N.reject,J=N.domain;try{z?(U||(O._h==2&&h(O),O._h=1),z===!0?ne=K:(J&&J.enter(),ne=z(K),J&&J.exit()),ne===N.promise?Q(G("Promise-chain cycle")):(L=m(ne))?L.call(ne,oe,Q):oe(ne)):Q(K)}catch(Ot){Q(Ot)}};j.length>ke;)ie(j[ke++]);O._c=[],O._n=!1,I&&!O._h&&A(O)})}},A=function(O){M.call(l,function(){var I,j,K,U=O._v;if(w(O)&&(I=v(function(){D?V.emit("unhandledRejection",U,O):(j=l.onunhandledrejection)?j({promise:O,reason:U}):(K=l.console)&&K.error&&K.error("Unhandled promise rejection",U)}),O._h=D||w(O)?2:1),O._a=void 0,I)throw I.error})},w=function(O){if(O._h==1)return!1;for(var I,j=O._a||O._c,K=0;j.length>K;)if(I=j[K++],I.fail||!w(I.promise))return!1;return!0},h=function(O){M.call(l,function(){var I;D?V.emit("rejectionHandled",O):(I=l.onrejectionhandled)&&I({promise:O,reason:O._v})})},E=function(O){var I=this;I._d||(I._d=!0,I=I._w||I,I._v=O,I._s=2,I._a||(I._a=I._c.slice()),_(I,!0))},q=function(O){var I,j=this;if(!j._d){j._d=!0,j=j._w||j;try{if(j===O)throw G("Promise can't be resolved itself");(I=m(O))?P(function(){var K={_w:j,_d:!1};try{I.call(O,u(q,K,1),u(E,K,1))}catch(U){E.call(K,U)}}):(j._v=O,j._s=1,_(j,!1))}catch(K){E.call({_w:j,_d:!1},K)}}};T||(F=function(O){b(this,F,B,"_h"),y(O),s.call(this);try{O(u(q,this,1),u(E,this,1))}catch(I){E.call(this,I)}},s=function(O){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},s.prototype=i(56)(F.prototype,{then:function(O,I){var j=x(R(this,F));return j.ok=typeof O!="function"||O,j.fail=typeof I=="function"&&I,j.domain=D?V.domain:void 0,this._c.push(j),this._a&&this._a.push(j),this._s&&_(this,!1),j.promise},catch:function(O){return this.then(void 0,O)}}),S=function(){var O=new s;this.promise=O,this.resolve=u(q,O,1),this.reject=u(E,O,1)}),d(d.G+d.W+d.F*!T,{Promise:F}),i(18)(F,B),i(59)(B),a=i(6)[B],d(d.S+d.F*!T,B,{reject:function(O){var I=x(this),j=I.reject;return j(O),I.promise}}),d(d.S+d.F*(c||!T),B,{resolve:function(O){if(O instanceof F&&p(O.constructor,this))return O;var I=x(this),j=I.resolve;return j(O),I.promise}}),d(d.S+d.F*!(T&&i(46)(function(O){F.all(O).catch($)})),B,{all:function(O){var I=this,j=x(I),K=j.resolve,U=j.reject,ke=v(function(){var ie=[],N=0,ne=1;C(O,!1,function(L){var z=N++,oe=!1;ie.push(void 0),ne++,I.resolve(L).then(function(Q){oe||(oe=!0,ie[z]=Q,--ne||K(ie))},U)}),--ne||K(ie)});return ke&&U(ke.error),j.promise},race:function(O){var I=this,j=x(I),K=j.reject,U=v(function(){C(O,!1,function(ke){I.resolve(ke).then(j.resolve,K)})});return U&&K(U.error),j.promise}})},function(t,n,i){"use strict";var s=i(61)(!0);i(27)(String,"String",function(o){this._t=String(o),this._i=0},function(){var o,a=this._t,c=this._i;return c>=a.length?{value:void 0,done:!0}:(o=s(a,c),this._i+=o.length,{value:o,done:!1})})},function(t,n,i){i(65);for(var s=i(2),o=i(5),a=i(10),c=i(1)("toStringTag"),l=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],u=0;u<5;u++){var f=l[u],d=s[f],g=d&&d.prototype;g&&!g[c]&&o(g,c,f),a[f]=a.Array}},function(t,n){t.exports=require("child_process")},function(t,n){t.exports=require("crypto")}])})});var Y4={};tn(Y4,{startServer:()=>eM});module.exports=oM(Y4);var hp=require("http"),Fi=require("child_process"),Ui=require("fs"),sr=require("path"),JO=require("url");var Iv=(r=0)=>e=>`\x1B[${e+r}m`,Nv=(r=0)=>e=>`\x1B[${38+r};5;${e}m`,Dv=(r=0)=>(e,t,n)=>`\x1B[${38+r};2;${e};${t};${n}m`,_e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},J4=Object.keys(_e.modifier),aM=Object.keys(_e.color),cM=Object.keys(_e.bgColor),Z4=[...aM,...cM];function lM(){let r=new Map;for(let[e,t]of Object.entries(_e)){for(let[n,i]of Object.entries(t))_e[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[n]=_e[n],r.set(i[0],i[1]);Object.defineProperty(_e,e,{value:t,enumerable:!1})}return Object.defineProperty(_e,"codes",{value:r,enumerable:!1}),_e.color.close="\x1B[39m",_e.bgColor.close="\x1B[49m",_e.color.ansi=Iv(),_e.color.ansi256=Nv(),_e.color.ansi16m=Dv(),_e.bgColor.ansi=Iv(10),_e.bgColor.ansi256=Nv(10),_e.bgColor.ansi16m=Dv(10),Object.defineProperties(_e,{rgbToAnsi256:{value(e,t,n){return e===t&&t===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(n/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[n]=t;n.length===3&&(n=[...n].map(s=>s+s).join(""));let i=Number.parseInt(n,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:e=>_e.rgbToAnsi256(..._e.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,n,i;if(e>=232)t=((e-232)*10+8)/255,n=t,i=t;else{e-=16;let a=e%36;t=Math.floor(e/36)/5,n=Math.floor(a/6)/5,i=a%6/5}let s=Math.max(t,n,i)*2;if(s===0)return 30;let o=30+(Math.round(i)<<2|Math.round(n)<<1|Math.round(t));return s===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(e,t,n)=>_e.ansi256ToAnsi(_e.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>_e.ansi256ToAnsi(_e.hexToAnsi256(e)),enumerable:!1}}),_e}var uM=lM(),Tr=uM;var Ja=W(require("node:process"),1),Bv=W(require("node:os"),1),Np=W(require("node:tty"),1);function or(r,e=globalThis.Deno?globalThis.Deno.args:Ja.default.argv){let t=r.startsWith("-")?"":r.length===1?"-":"--",n=e.indexOf(t+r),i=e.indexOf("--");return n!==-1&&(i===-1||n<i)}var{env:be}=Ja.default,Xa;or("no-color")||or("no-colors")||or("color=false")||or("color=never")?Xa=0:(or("color")||or("colors")||or("color=true")||or("color=always"))&&(Xa=1);function pM(){if("FORCE_COLOR"in be)return be.FORCE_COLOR==="true"?1:be.FORCE_COLOR==="false"?0:be.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(be.FORCE_COLOR,10),3)}function fM(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function dM(r,{streamIsTTY:e,sniffFlags:t=!0}={}){let n=pM();n!==void 0&&(Xa=n);let i=t?Xa:n;if(i===0)return 0;if(t){if(or("color=16m")||or("color=full")||or("color=truecolor"))return 3;if(or("color=256"))return 2}if("TF_BUILD"in be&&"AGENT_NAME"in be)return 1;if(r&&!e&&i===void 0)return 0;let s=i||0;if(be.TERM==="dumb")return s;if(Ja.default.platform==="win32"){let o=Bv.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in be)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>o in be)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in be)||be.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in be)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(be.TEAMCITY_VERSION)?1:0;if(be.COLORTERM==="truecolor"||be.TERM==="xterm-kitty"||be.TERM==="xterm-ghostty"||be.TERM==="wezterm")return 3;if("TERM_PROGRAM"in be){let o=Number.parseInt((be.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(be.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(be.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(be.TERM)||"COLORTERM"in be?1:s}function Lv(r,e={}){let t=dM(r,{streamIsTTY:r&&r.isTTY,...e});return fM(t)}var hM={stdout:Lv({isTTY:Np.default.isatty(1)}),stderr:Lv({isTTY:Np.default.isatty(2)})},jv=hM;function Fv(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 Uv(r,e,t,n){let i=0,s="";do{let o=r[n-1]==="\r";s+=r.slice(i,o?n-1:n)+e+(o?`\r
|
|
108
|
+
`};ho.setupSocket(t),i&&i.length&&t.unshift(i);var c=(ho.isSSL.test(n.target.protocol)?E4:S4).request(ho.setupOutgoing(n.ssl||{},n,e));return s&&s.emit("proxyReqWs",c,e,t,n,i),c.on("error",l),c.on("response",function(u){u.upgrade||(t.write(a("HTTP/"+u.httpVersion+" "+u.statusCode+" "+u.statusMessage,u.headers)),u.pipe(t))}),c.on("upgrade",function(u,f,d){f.on("error",l),f.on("end",function(){s.emit("close",u,f,d)}),t.on("error",function(){f.end()}),ho.setupSocket(f),d&&d.length&&f.unshift(d),t.write(a("HTTP/1.1 101 Switching Protocols",u.headers)),f.pipe(t).pipe(f),s.emit("open",f),s.emit("proxySocket",f)}),c.end();function l(u){o?o(u,e,t):s.emit("error",u,e,t),t.end()}}}});var ZR=A((M5,JR)=>{var YR=JR.exports,zR=require("util")._extend,T4=require("url").parse,XR=CR(),C4=require("http"),k4=require("https"),VR=HR(),KR=GR();YR.Server=ji;function hv(r){return function(e){return function(t,n){var i=r==="ws"?this.wsPasses:this.webPasses,s=[].slice.call(arguments),o=s.length-1,a,c;typeof s[o]=="function"&&(c=s[o],o--);var l=e;if(!(s[o]instanceof Buffer)&&s[o]!==n&&(l=zR({},e),zR(l,s[o]),o--),s[o]instanceof Buffer&&(a=s[o]),["target","forward"].forEach(function(f){typeof l[f]=="string"&&(l[f]=T4(l[f]))}),!l.target&&!l.forward)return this.emit("error",new Error("Must provide a proper URL as target"));for(var u=0;u<i.length&&!i[u](t,n,l,a,this,c);u++);}}}YR.createRightProxy=hv;function ji(r){XR.call(this),r=r||{},r.prependPath=r.prependPath!==!1,this.web=this.proxyRequest=hv("web")(r),this.ws=this.proxyWebsocketRequest=hv("ws")(r),this.options=r,this.webPasses=Object.keys(VR).map(function(e){return VR[e]}),this.wsPasses=Object.keys(KR).map(function(e){return KR[e]}),this.on("error",this.onError,this)}require("util").inherits(ji,XR);ji.prototype.onError=function(r){if(this.listeners("error").length===1)throw r};ji.prototype.listen=function(r,e){var t=this,n=function(i,s){t.web(i,s)};return this._server=this.options.ssl?k4.createServer(this.options.ssl,n):C4.createServer(n),this.options.ws&&this._server.on("upgrade",function(i,s,o){t.ws(i,s,o)}),this._server.listen(r,e),this};ji.prototype.close=function(r){var e=this;this._server&&this._server.close(t);function t(){e._server=null,r&&r.apply(null,arguments)}};ji.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)};ji.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 eO=A((P5,QR)=>{var Ga=ZR().Server;function mv(r){return new Ga(r)}Ga.createProxyServer=mv;Ga.createServer=mv;Ga.createProxy=mv;QR.exports=Ga});var rO=A((I5,tO)=>{tO.exports=eO()});var TO=A((Va,vv)=>{(function(r,e){typeof Va=="object"&&typeof vv=="object"?vv.exports=e(require("child_process"),require("crypto")):typeof define=="function"&&define.amd?define(["child_process","crypto"],e):typeof Va=="object"?Va["electron-machine-id"]=e(require("child_process"),require("crypto")):r["electron-machine-id"]=e(r.child_process,r.crypto)})(Va,function(r,e){return(function(t){function n(s){if(i[s])return i[s].exports;var o=i[s]={exports:{},id:s,loaded:!1};return t[s].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}var i={};return n.m=t,n.c=i,n.p="",n(0)})([function(t,n,i){t.exports=i(34)},function(t,n,i){var s=i(29)("wks"),o=i(33),a=i(2).Symbol,c=typeof a=="function",l=t.exports=function(u){return s[u]||(s[u]=c&&a[u]||(c?a:o)("Symbol."+u))};l.store=s},function(t,n){var i=t.exports=typeof window<"u"&&window.Math==Math?window:typeof self<"u"&&self.Math==Math?self:Function("return this")();typeof __g=="number"&&(__g=i)},function(t,n,i){var s=i(9);t.exports=function(o){if(!s(o))throw TypeError(o+" is not an object!");return o}},function(t,n,i){t.exports=!i(24)(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},function(t,n,i){var s=i(12),o=i(17);t.exports=i(4)?function(a,c,l){return s.f(a,c,o(1,l))}:function(a,c,l){return a[c]=l,a}},function(t,n){var i=t.exports={version:"2.4.0"};typeof __e=="number"&&(__e=i)},function(t,n,i){var s=i(14);t.exports=function(o,a,c){if(s(o),a===void 0)return o;switch(c){case 1:return function(l){return o.call(a,l)};case 2:return function(l,u){return o.call(a,l,u)};case 3:return function(l,u,f){return o.call(a,l,u,f)}}return function(){return o.apply(a,arguments)}}},function(t,n){var i={}.hasOwnProperty;t.exports=function(s,o){return i.call(s,o)}},function(t,n){t.exports=function(i){return typeof i=="object"?i!==null:typeof i=="function"}},function(t,n){t.exports={}},function(t,n){var i={}.toString;t.exports=function(s){return i.call(s).slice(8,-1)}},function(t,n,i){var s=i(3),o=i(26),a=i(32),c=Object.defineProperty;n.f=i(4)?Object.defineProperty:function(l,u,f){if(s(l),u=a(u,!0),s(f),o)try{return c(l,u,f)}catch{}if("get"in f||"set"in f)throw TypeError("Accessors not supported!");return"value"in f&&(l[u]=f.value),l}},function(t,n,i){var s=i(42),o=i(15);t.exports=function(a){return s(o(a))}},function(t,n){t.exports=function(i){if(typeof i!="function")throw TypeError(i+" is not a function!");return i}},function(t,n){t.exports=function(i){if(i==null)throw TypeError("Can't call method on "+i);return i}},function(t,n,i){var s=i(9),o=i(2).document,a=s(o)&&s(o.createElement);t.exports=function(c){return a?o.createElement(c):{}}},function(t,n){t.exports=function(i,s){return{enumerable:!(1&i),configurable:!(2&i),writable:!(4&i),value:s}}},function(t,n,i){var s=i(12).f,o=i(8),a=i(1)("toStringTag");t.exports=function(c,l,u){c&&!o(c=u?c:c.prototype,a)&&s(c,a,{configurable:!0,value:l})}},function(t,n,i){var s=i(29)("keys"),o=i(33);t.exports=function(a){return s[a]||(s[a]=o(a))}},function(t,n){var i=Math.ceil,s=Math.floor;t.exports=function(o){return isNaN(o=+o)?0:(o>0?s:i)(o)}},function(t,n,i){var s=i(11),o=i(1)("toStringTag"),a=s((function(){return arguments})())=="Arguments",c=function(l,u){try{return l[u]}catch{}};t.exports=function(l){var u,f,d;return l===void 0?"Undefined":l===null?"Null":typeof(f=c(u=Object(l),o))=="string"?f:a?s(u):(d=s(u))=="Object"&&typeof u.callee=="function"?"Arguments":d}},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n,i){var s=i(2),o=i(6),a=i(7),c=i(5),l="prototype",u=function(f,d,g){var y,b,C,R=f&u.F,O=f&u.G,P=f&u.S,B=f&u.P,G=f&u.B,F=f&u.W,V=O?o:o[d]||(o[d]={}),D=V[l],$=O?s:P?s[d]:(s[d]||{})[l];O&&(g=d);for(y in g)b=!R&&$&&$[y]!==void 0,b&&y in V||(C=b?$[y]:g[y],V[y]=O&&typeof $[y]!="function"?g[y]:G&&b?a(C,s):F&&$[y]==C?(function(T){var p=function(m,x,S){if(this instanceof T){switch(arguments.length){case 0:return new T;case 1:return new T(m);case 2:return new T(m,x)}return new T(m,x,S)}return T.apply(this,arguments)};return p[l]=T[l],p})(C):B&&typeof C=="function"?a(Function.call,C):C,B&&((V.virtual||(V.virtual={}))[y]=C,f&u.R&&D&&!D[y]&&c(D,y,C)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,n){t.exports=function(i){try{return!!i()}catch{return!0}}},function(t,n,i){t.exports=i(2).document&&document.documentElement},function(t,n,i){t.exports=!i(4)&&!i(24)(function(){return Object.defineProperty(i(16)("div"),"a",{get:function(){return 7}}).a!=7})},function(t,n,i){"use strict";var s=i(28),o=i(23),a=i(57),c=i(5),l=i(8),u=i(10),f=i(45),d=i(18),g=i(52),y=i(1)("iterator"),b=!([].keys&&"next"in[].keys()),C="@@iterator",R="keys",O="values",P=function(){return this};t.exports=function(B,G,F,V,D,$,T){f(F,G,V);var p,m,x,S=function(I){if(!b&&I in w)return w[I];switch(I){case R:return function(){return new F(this,I)};case O:return function(){return new F(this,I)}}return function(){return new F(this,I)}},v=G+" Iterator",_=D==O,k=!1,w=B.prototype,h=w[y]||w[C]||D&&w[D],E=h||S(D),q=D?_?S("entries"):E:void 0,M=G=="Array"&&w.entries||h;if(M&&(x=g(M.call(new B)),x!==Object.prototype&&(d(x,v,!0),s||l(x,y)||c(x,y,P))),_&&h&&h.name!==O&&(k=!0,E=function(){return h.call(this)}),s&&!T||!b&&!k&&w[y]||c(w,y,E),u[G]=E,u[v]=P,D)if(p={values:_?E:S(O),keys:$?E:S(R),entries:q},T)for(m in p)m in w||a(w,m,p[m]);else o(o.P+o.F*(b||k),G,p);return p}},function(t,n){t.exports=!0},function(t,n,i){var s=i(2),o="__core-js_shared__",a=s[o]||(s[o]={});t.exports=function(c){return a[c]||(a[c]={})}},function(t,n,i){var s,o,a,c=i(7),l=i(41),u=i(25),f=i(16),d=i(2),g=d.process,y=d.setImmediate,b=d.clearImmediate,C=d.MessageChannel,R=0,O={},P="onreadystatechange",B=function(){var F=+this;if(O.hasOwnProperty(F)){var V=O[F];delete O[F],V()}},G=function(F){B.call(F.data)};y&&b||(y=function(F){for(var V=[],D=1;arguments.length>D;)V.push(arguments[D++]);return O[++R]=function(){l(typeof F=="function"?F:Function(F),V)},s(R),R},b=function(F){delete O[F]},i(11)(g)=="process"?s=function(F){g.nextTick(c(B,F,1))}:C?(o=new C,a=o.port2,o.port1.onmessage=G,s=c(a.postMessage,a,1)):d.addEventListener&&typeof postMessage=="function"&&!d.importScripts?(s=function(F){d.postMessage(F+"","*")},d.addEventListener("message",G,!1)):s=P in f("script")?function(F){u.appendChild(f("script"))[P]=function(){u.removeChild(this),B.call(F)}}:function(F){setTimeout(c(B,F,1),0)}),t.exports={set:y,clear:b}},function(t,n,i){var s=i(20),o=Math.min;t.exports=function(a){return a>0?o(s(a),9007199254740991):0}},function(t,n,i){var s=i(9);t.exports=function(o,a){if(!s(o))return o;var c,l;if(a&&typeof(c=o.toString)=="function"&&!s(l=c.call(o))||typeof(c=o.valueOf)=="function"&&!s(l=c.call(o))||!a&&typeof(c=o.toString)=="function"&&!s(l=c.call(o)))return l;throw TypeError("Can't convert object to primitive value")}},function(t,n){var i=0,s=Math.random();t.exports=function(o){return"Symbol(".concat(o===void 0?"":o,")_",(++i+s).toString(36))}},function(t,n,i){"use strict";function s(P){return P&&P.__esModule?P:{default:P}}function o(){return process.platform!=="win32"?"":process.arch==="ia32"&&process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432")?"mixed":"native"}function a(P){return(0,y.createHash)("sha256").update(P).digest("hex")}function c(P){switch(C){case"darwin":return P.split("IOPlatformUUID")[1].split(`
|
|
109
|
+
`)[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return P.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":return P.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"freebsd":return P.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw new Error("Unsupported platform: "+process.platform)}}function l(P){var B=c((0,g.execSync)(O[C]).toString());return P?B:a(B)}function u(P){return new d.default(function(B,G){return(0,g.exec)(O[C],{},function(F,V,D){if(F)return G(new Error("Error while obtaining machine id: "+F.stack));var $=c(V.toString());return B(P?$:a($))})})}Object.defineProperty(n,"__esModule",{value:!0});var f=i(35),d=s(f);n.machineIdSync=l,n.machineId=u;var g=i(70),y=i(71),b=process,C=b.platform,R={native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"},O={darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:R[o()]+"\\REG.exe QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",linux:"( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :",freebsd:"kenv -q smbios.system.uuid || sysctl -n kern.hostuuid"}},function(t,n,i){t.exports={default:i(36),__esModule:!0}},function(t,n,i){i(66),i(68),i(69),i(67),t.exports=i(6).Promise},function(t,n){t.exports=function(){}},function(t,n){t.exports=function(i,s,o,a){if(!(i instanceof s)||a!==void 0&&a in i)throw TypeError(o+": incorrect invocation!");return i}},function(t,n,i){var s=i(13),o=i(31),a=i(62);t.exports=function(c){return function(l,u,f){var d,g=s(l),y=o(g.length),b=a(f,y);if(c&&u!=u){for(;y>b;)if(d=g[b++],d!=d)return!0}else for(;y>b;b++)if((c||b in g)&&g[b]===u)return c||b||0;return!c&&-1}}},function(t,g,i){var s=i(7),o=i(44),a=i(43),c=i(3),l=i(31),u=i(64),f={},d={},g=t.exports=function(y,b,C,R,O){var P,B,G,F,V=O?function(){return y}:u(y),D=s(C,R,b?2:1),$=0;if(typeof V!="function")throw TypeError(y+" is not iterable!");if(a(V)){for(P=l(y.length);P>$;$++)if(F=b?D(c(B=y[$])[0],B[1]):D(y[$]),F===f||F===d)return F}else for(G=V.call(y);!(B=G.next()).done;)if(F=o(G,D,B.value,b),F===f||F===d)return F};g.BREAK=f,g.RETURN=d},function(t,n){t.exports=function(i,s,o){var a=o===void 0;switch(s.length){case 0:return a?i():i.call(o);case 1:return a?i(s[0]):i.call(o,s[0]);case 2:return a?i(s[0],s[1]):i.call(o,s[0],s[1]);case 3:return a?i(s[0],s[1],s[2]):i.call(o,s[0],s[1],s[2]);case 4:return a?i(s[0],s[1],s[2],s[3]):i.call(o,s[0],s[1],s[2],s[3])}return i.apply(o,s)}},function(t,n,i){var s=i(11);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(o){return s(o)=="String"?o.split(""):Object(o)}},function(t,n,i){var s=i(10),o=i(1)("iterator"),a=Array.prototype;t.exports=function(c){return c!==void 0&&(s.Array===c||a[o]===c)}},function(t,n,i){var s=i(3);t.exports=function(o,a,c,l){try{return l?a(s(c)[0],c[1]):a(c)}catch(f){var u=o.return;throw u!==void 0&&s(u.call(o)),f}}},function(t,n,i){"use strict";var s=i(49),o=i(17),a=i(18),c={};i(5)(c,i(1)("iterator"),function(){return this}),t.exports=function(l,u,f){l.prototype=s(c,{next:o(1,f)}),a(l,u+" Iterator")}},function(t,n,i){var s=i(1)("iterator"),o=!1;try{var a=[7][s]();a.return=function(){o=!0},Array.from(a,function(){throw 2})}catch{}t.exports=function(c,l){if(!l&&!o)return!1;var u=!1;try{var f=[7],d=f[s]();d.next=function(){return{done:u=!0}},f[s]=function(){return d},c(f)}catch{}return u}},function(t,n){t.exports=function(i,s){return{value:s,done:!!i}}},function(t,n,i){var s=i(2),o=i(30).set,a=s.MutationObserver||s.WebKitMutationObserver,c=s.process,l=s.Promise,u=i(11)(c)=="process";t.exports=function(){var f,d,g,y=function(){var O,P;for(u&&(O=c.domain)&&O.exit();f;){P=f.fn,f=f.next;try{P()}catch(B){throw f?g():d=void 0,B}}d=void 0,O&&O.enter()};if(u)g=function(){c.nextTick(y)};else if(a){var b=!0,C=document.createTextNode("");new a(y).observe(C,{characterData:!0}),g=function(){C.data=b=!b}}else if(l&&l.resolve){var R=l.resolve();g=function(){R.then(y)}}else g=function(){o.call(s,y)};return function(O){var P={fn:O,next:void 0};d&&(d.next=P),f||(f=P,g()),d=P}}},function(t,n,i){var s=i(3),o=i(50),a=i(22),c=i(19)("IE_PROTO"),l=function(){},u="prototype",f=function(){var d,g=i(16)("iframe"),y=a.length,b=">";for(g.style.display="none",i(25).appendChild(g),g.src="javascript:",d=g.contentWindow.document,d.open(),d.write("<script>document.F=Object</script"+b),d.close(),f=d.F;y--;)delete f[u][a[y]];return f()};t.exports=Object.create||function(d,g){var y;return d!==null?(l[u]=s(d),y=new l,l[u]=null,y[c]=d):y=f(),g===void 0?y:o(y,g)}},function(t,n,i){var s=i(12),o=i(3),a=i(54);t.exports=i(4)?Object.defineProperties:function(c,l){o(c);for(var u,f=a(l),d=f.length,g=0;d>g;)s.f(c,u=f[g++],l[u]);return c}},function(t,n,i){var s=i(55),o=i(17),a=i(13),c=i(32),l=i(8),u=i(26),f=Object.getOwnPropertyDescriptor;n.f=i(4)?f:function(d,g){if(d=a(d),g=c(g,!0),u)try{return f(d,g)}catch{}if(l(d,g))return o(!s.f.call(d,g),d[g])}},function(t,n,i){var s=i(8),o=i(63),a=i(19)("IE_PROTO"),c=Object.prototype;t.exports=Object.getPrototypeOf||function(l){return l=o(l),s(l,a)?l[a]:typeof l.constructor=="function"&&l instanceof l.constructor?l.constructor.prototype:l instanceof Object?c:null}},function(t,n,i){var s=i(8),o=i(13),a=i(39)(!1),c=i(19)("IE_PROTO");t.exports=function(l,u){var f,d=o(l),g=0,y=[];for(f in d)f!=c&&s(d,f)&&y.push(f);for(;u.length>g;)s(d,f=u[g++])&&(~a(y,f)||y.push(f));return y}},function(t,n,i){var s=i(53),o=i(22);t.exports=Object.keys||function(a){return s(a,o)}},function(t,n){n.f={}.propertyIsEnumerable},function(t,n,i){var s=i(5);t.exports=function(o,a,c){for(var l in a)c&&o[l]?o[l]=a[l]:s(o,l,a[l]);return o}},function(t,n,i){t.exports=i(5)},function(t,n,i){var s=i(9),o=i(3),a=function(c,l){if(o(c),!s(l)&&l!==null)throw TypeError(l+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?(function(c,l,u){try{u=i(7)(Function.call,i(51).f(Object.prototype,"__proto__").set,2),u(c,[]),l=!(c instanceof Array)}catch{l=!0}return function(f,d){return a(f,d),l?f.__proto__=d:u(f,d),f}})({},!1):void 0),check:a}},function(t,n,i){"use strict";var s=i(2),o=i(6),a=i(12),c=i(4),l=i(1)("species");t.exports=function(u){var f=typeof o[u]=="function"?o[u]:s[u];c&&f&&!f[l]&&a.f(f,l,{configurable:!0,get:function(){return this}})}},function(t,n,i){var s=i(3),o=i(14),a=i(1)("species");t.exports=function(c,l){var u,f=s(c).constructor;return f===void 0||(u=s(f)[a])==null?l:o(u)}},function(t,n,i){var s=i(20),o=i(15);t.exports=function(a){return function(c,l){var u,f,d=String(o(c)),g=s(l),y=d.length;return g<0||g>=y?a?"":void 0:(u=d.charCodeAt(g),u<55296||u>56319||g+1===y||(f=d.charCodeAt(g+1))<56320||f>57343?a?d.charAt(g):u:a?d.slice(g,g+2):(u-55296<<10)+(f-56320)+65536)}}},function(t,n,i){var s=i(20),o=Math.max,a=Math.min;t.exports=function(c,l){return c=s(c),c<0?o(c+l,0):a(c,l)}},function(t,n,i){var s=i(15);t.exports=function(o){return Object(s(o))}},function(t,n,i){var s=i(21),o=i(1)("iterator"),a=i(10);t.exports=i(6).getIteratorMethod=function(c){if(c!=null)return c[o]||c["@@iterator"]||a[s(c)]}},function(t,n,i){"use strict";var s=i(37),o=i(47),a=i(10),c=i(13);t.exports=i(27)(Array,"Array",function(l,u){this._t=c(l),this._i=0,this._k=u},function(){var l=this._t,u=this._k,f=this._i++;return!l||f>=l.length?(this._t=void 0,o(1)):u=="keys"?o(0,f):u=="values"?o(0,l[f]):o(0,[f,l[f]])},"values"),a.Arguments=a.Array,s("keys"),s("values"),s("entries")},function(t,n){},function(t,n,i){"use strict";var s,o,a,c=i(28),l=i(2),u=i(7),f=i(21),d=i(23),g=i(9),y=(i(3),i(14)),b=i(38),C=i(40),R=(i(58).set,i(60)),O=i(30).set,P=i(48)(),B="Promise",G=l.TypeError,V=l.process,F=l[B],V=l.process,D=f(V)=="process",$=function(){},T=!!(function(){try{var M=F.resolve(1),I=(M.constructor={})[i(1)("species")]=function(j){j($,$)};return(D||typeof PromiseRejectionEvent=="function")&&M.then($)instanceof I}catch{}})(),p=function(M,I){return M===I||M===F&&I===a},m=function(M){var I;return!(!g(M)||typeof(I=M.then)!="function")&&I},x=function(M){return p(F,M)?new S(M):new o(M)},S=o=function(M){var I,j;this.promise=new M(function(K,U){if(I!==void 0||j!==void 0)throw G("Bad Promise constructor");I=K,j=U}),this.resolve=y(I),this.reject=y(j)},v=function(M){try{M()}catch(I){return{error:I}}},_=function(M,I){if(!M._n){M._n=!0;var j=M._c;P(function(){for(var K=M._v,U=M._s==1,Re=0,se=function(N){var ne,L,z=U?N.ok:N.fail,oe=N.resolve,Q=N.reject,J=N.domain;try{z?(U||(M._h==2&&h(M),M._h=1),z===!0?ne=K:(J&&J.enter(),ne=z(K),J&&J.exit()),ne===N.promise?Q(G("Promise-chain cycle")):(L=m(ne))?L.call(ne,oe,Q):oe(ne)):Q(K)}catch(Ot){Q(Ot)}};j.length>Re;)se(j[Re++]);M._c=[],M._n=!1,I&&!M._h&&k(M)})}},k=function(M){O.call(l,function(){var I,j,K,U=M._v;if(w(M)&&(I=v(function(){D?V.emit("unhandledRejection",U,M):(j=l.onunhandledrejection)?j({promise:M,reason:U}):(K=l.console)&&K.error&&K.error("Unhandled promise rejection",U)}),M._h=D||w(M)?2:1),M._a=void 0,I)throw I.error})},w=function(M){if(M._h==1)return!1;for(var I,j=M._a||M._c,K=0;j.length>K;)if(I=j[K++],I.fail||!w(I.promise))return!1;return!0},h=function(M){O.call(l,function(){var I;D?V.emit("rejectionHandled",M):(I=l.onrejectionhandled)&&I({promise:M,reason:M._v})})},E=function(M){var I=this;I._d||(I._d=!0,I=I._w||I,I._v=M,I._s=2,I._a||(I._a=I._c.slice()),_(I,!0))},q=function(M){var I,j=this;if(!j._d){j._d=!0,j=j._w||j;try{if(j===M)throw G("Promise can't be resolved itself");(I=m(M))?P(function(){var K={_w:j,_d:!1};try{I.call(M,u(q,K,1),u(E,K,1))}catch(U){E.call(K,U)}}):(j._v=M,j._s=1,_(j,!1))}catch(K){E.call({_w:j,_d:!1},K)}}};T||(F=function(M){b(this,F,B,"_h"),y(M),s.call(this);try{M(u(q,this,1),u(E,this,1))}catch(I){E.call(this,I)}},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)(F.prototype,{then:function(M,I){var j=x(R(this,F));return j.ok=typeof M!="function"||M,j.fail=typeof I=="function"&&I,j.domain=D?V.domain:void 0,this._c.push(j),this._a&&this._a.push(j),this._s&&_(this,!1),j.promise},catch:function(M){return this.then(void 0,M)}}),S=function(){var M=new s;this.promise=M,this.resolve=u(q,M,1),this.reject=u(E,M,1)}),d(d.G+d.W+d.F*!T,{Promise:F}),i(18)(F,B),i(59)(B),a=i(6)[B],d(d.S+d.F*!T,B,{reject:function(M){var I=x(this),j=I.reject;return j(M),I.promise}}),d(d.S+d.F*(c||!T),B,{resolve:function(M){if(M instanceof F&&p(M.constructor,this))return M;var I=x(this),j=I.resolve;return j(M),I.promise}}),d(d.S+d.F*!(T&&i(46)(function(M){F.all(M).catch($)})),B,{all:function(M){var I=this,j=x(I),K=j.resolve,U=j.reject,Re=v(function(){var se=[],N=0,ne=1;C(M,!1,function(L){var z=N++,oe=!1;se.push(void 0),ne++,I.resolve(L).then(function(Q){oe||(oe=!0,se[z]=Q,--ne||K(se))},U)}),--ne||K(se)});return Re&&U(Re.error),j.promise},race:function(M){var I=this,j=x(I),K=j.reject,U=v(function(){C(M,!1,function(Re){I.resolve(Re).then(j.resolve,K)})});return U&&K(U.error),j.promise}})},function(t,n,i){"use strict";var s=i(61)(!0);i(27)(String,"String",function(o){this._t=String(o),this._i=0},function(){var o,a=this._t,c=this._i;return c>=a.length?{value:void 0,done:!0}:(o=s(a,c),this._i+=o.length,{value:o,done:!1})})},function(t,n,i){i(65);for(var s=i(2),o=i(5),a=i(10),c=i(1)("toStringTag"),l=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],u=0;u<5;u++){var f=l[u],d=s[f],g=d&&d.prototype;g&&!g[c]&&o(g,c,f),a[f]=a.Array}},function(t,n){t.exports=require("child_process")},function(t,n){t.exports=require("crypto")}])})});var t6={};rn(t6,{startServer:()=>sM});module.exports=pM(t6);var hp=require("http"),Fi=require("child_process"),Ui=require("fs"),sr=require("path"),rM=require("url");var Lv=(r=0)=>e=>`\x1B[${e+r}m`,Bv=(r=0)=>e=>`\x1B[${38+r};5;${e}m`,jv=(r=0)=>(e,t,n)=>`\x1B[${38+r};2;${e};${t};${n}m`,be={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]}},n6=Object.keys(be.modifier),fM=Object.keys(be.color),dM=Object.keys(be.bgColor),i6=[...fM,...dM];function hM(){let r=new Map;for(let[e,t]of Object.entries(be)){for(let[n,i]of Object.entries(t))be[n]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},t[n]=be[n],r.set(i[0],i[1]);Object.defineProperty(be,e,{value:t,enumerable:!1})}return Object.defineProperty(be,"codes",{value:r,enumerable:!1}),be.color.close="\x1B[39m",be.bgColor.close="\x1B[49m",be.color.ansi=Lv(),be.color.ansi256=Bv(),be.color.ansi16m=jv(),be.bgColor.ansi=Lv(10),be.bgColor.ansi256=Bv(10),be.bgColor.ansi16m=jv(10),Object.defineProperties(be,{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=>be.rgbToAnsi256(...be.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)=>be.ansi256ToAnsi(be.rgbToAnsi256(e,t,n)),enumerable:!1},hexToAnsi:{value:e=>be.ansi256ToAnsi(be.hexToAnsi256(e)),enumerable:!1}}),be}var mM=hM(),Tr=mM;var Ja=W(require("node:process"),1),Uv=W(require("node:os"),1),Np=W(require("node:tty"),1);function or(r,e=globalThis.Deno?globalThis.Deno.args:Ja.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:we}=Ja.default,Xa;or("no-color")||or("no-colors")||or("color=false")||or("color=never")?Xa=0:(or("color")||or("colors")||or("color=true")||or("color=always"))&&(Xa=1);function gM(){if("FORCE_COLOR"in we)return we.FORCE_COLOR==="true"?1:we.FORCE_COLOR==="false"?0:we.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(we.FORCE_COLOR,10),3)}function vM(r){return r===0?!1:{level:r,hasBasic:!0,has256:r>=2,has16m:r>=3}}function yM(r,{streamIsTTY:e,sniffFlags:t=!0}={}){let n=gM();n!==void 0&&(Xa=n);let i=t?Xa:n;if(i===0)return 0;if(t){if(or("color=16m")||or("color=full")||or("color=truecolor"))return 3;if(or("color=256"))return 2}if("TF_BUILD"in we&&"AGENT_NAME"in we)return 1;if(r&&!e&&i===void 0)return 0;let s=i||0;if(we.TERM==="dumb")return s;if(Ja.default.platform==="win32"){let o=Uv.default.release().split(".");return Number(o[0])>=10&&Number(o[2])>=10586?Number(o[2])>=14931?3:2:1}if("CI"in we)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(o=>o in we)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(o=>o in we)||we.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in we)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(we.TEAMCITY_VERSION)?1:0;if(we.COLORTERM==="truecolor"||we.TERM==="xterm-kitty"||we.TERM==="xterm-ghostty"||we.TERM==="wezterm")return 3;if("TERM_PROGRAM"in we){let o=Number.parseInt((we.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(we.TERM_PROGRAM){case"iTerm.app":return o>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(we.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(we.TERM)||"COLORTERM"in we?1:s}function Fv(r,e={}){let t=yM(r,{streamIsTTY:r&&r.isTTY,...e});return vM(t)}var xM={stdout:Fv({isTTY:Np.default.isatty(1)}),stderr:Fv({isTTY:Np.default.isatty(2)})},qv=xM;function $v(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
|
|
110
110
|
`:`
|
|
111
111
|
`)+t,i=n+1,n=r.indexOf(`
|
|
112
|
-
`,i)}while(n!==-1);return s+=r.slice(i),s}var{stdout:
|
|
113
|
-
`);return s!==-1&&(e=Uv(e,i,n,s)),n+e+i};Object.defineProperties(vo.prototype,$i);var _M=vo(),s6=vo({level:$v?$v.level:0});var yo=_M;Ft();St();ri();var iw=W(nw(),1),{Server:sw,Namespace:e8,Socket:t8}=iw.default;var fR=require("fs"),dR=require("path");St();_l();var Ae={control:"control",binary:"binary"},lw=65536,ct={idle:"idle",connecting:"connecting",open:"open",degraded:"degraded",closed:"closed"},uw={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 Es=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=ct.idle}get state(){return this._state}get ready(){return this._state===ct.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 bl=class extends Es{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?ct.open:ct.connecting),e.socket.on("connect",()=>this._setState(ct.open)),e.socket.on("disconnect",()=>this._setState(ct.closed)),e.socket.onAny?.((t,n)=>this._emit("message",{event:t,data:n,source:"ws"}))}disconnect(){this._socket=null,this._setState(ct.closed)}send(e,t){if(!this._socket?.connected)return!1;let n=this._socket._rawEmit||this._socket.emit.bind(this._socket);if(e===Ae.control){let{event:i,args:s=[]}=t;return n(i,...s),!0}if(e===Ae.binary){let i=this._socket.conn?.transport;return i&&i.writable===!1?!1:(n("tiles-bin-v2",t),!0)}return!1}};var fw=require("child_process"),dw=require("module"),wl=W(require("path"),1),oh=W(require("os"),1),ah=(0,dw.createRequire)(__importMetaUrl),gB=300*1e3,pw=new Map;function hw(r){try{return ah(r)}catch(e){if(e.code!=="MODULE_NOT_FOUND"&&!vB(e))throw e;let t=pw.get(r);if(t!=null&&Date.now()-t<gB)throw e;return pw.set(r,Date.now()),xB(r),ah(r)}}function vB(r){return/\.node'|Cannot find module.*\.node|MODULE_NOT_FOUND/i.test(r.message||"")}function yB(r){let e=ah.resolve(`${r}/package.json`);return wl.default.dirname(e)}function xB(r){let e=yB(r),t=wl.default.dirname(e),n=oh.default.platform()==="win32"?"prebuild-install.cmd":"prebuild-install",i=wl.default.join(t,".bin",n);try{let s=(0,fw.spawnSync)(i,["-r","napi"],{cwd:e,stdio:"ignore",shell:oh.default.platform()==="win32",timeout:12e4});console.warn(`[nativeSelfHeal] ${r} heal attempted (status=${s.status})`)}catch(s){console.warn(`[nativeSelfHeal] ${r} heal failed:`,s.message)}}function _B(r,e){return e&&typeof e=="object"&&e.type==="Buffer"&&Array.isArray(e.data)?{__b:Buffer.from(e.data).toString("base64")}:e}function bB(r,e){return e&&typeof e=="object"&&typeof e.__b=="string"?Buffer.from(e.__b,"base64"):e}function mw(r){return JSON.stringify(r,_B)}function gw(r){return JSON.parse(typeof r=="string"?r:Buffer.from(r).toString("utf8"),bB)}dt();var xw=W(require("node:dns/promises"),1),wB=3e4,SB=/\s([0-9a-f-]{8,}\.local)\s/i,yw=new Map;async function EB(r){let e=yw.get(r);if(e&&Date.now()-e.ts<wB)return e.ip;try{let{address:t}=await xw.default.lookup(r);return yw.set(r,{ip:t,ts:Date.now()}),t}catch{return null}}async function _w(r){let e=r.match(SB);if(!e)return r;let t=await EB(e[1]);return t?r.replace(e[1],t):null}ri();var Hn=Fr("webrtc"),ch=null;function TB(){return ch||(ch=hw("node-datachannel")),ch}var CB=[{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"}],lh="";async function AB(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();lh="";let i=[];for(let s of n)for(let o of s.urls)if(o.startsWith("stun:")){let a=o.replace("stun:","").split(":")[0],c=parseInt(o.split(":")[2]||"3478");i.push({hostname:a,port:c,type:"Stun"})}else if(o.startsWith("turn:")||o.startsWith("turns:")){let a=o.startsWith("turns:"),l=o.replace(/^turns?:/,"").split("?")[0],u=l.split(":")[0],f=parseInt(l.split(":")[1]||(a?"5349":"3478")),d=o.includes("transport=tcp")?"Tcp":"Udp";i.push({hostname:u,port:f,type:a?"Tls":"Turn",relayType:d,username:s.username,password:s.credential})}return i}catch(t){return lh!==t.message&&(lh=t.message,console.warn(`[WebRtcProtocol] TURN fetch failed (${t.message}) \u2014 using STUN-only fallback. Will retry on next connection.`)),null}}var El=class extends Es{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=CB,this._refreshTimer=null,this._remoteSet=!1,this._pendingCandidates=[],this._signaling=null,this._iceGraceTimer=null,this._answerTimer=null}async connect(e){this._ctx=e,this._setState(ct.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(ct.closed)}send(e,t){if(e===Ae.control){if(!this._dcControl)return!1;try{return this._dcControl.sendMessage(mw({event:t.event,args:t.args||[],ackId:t.ackId||null})),!0}catch{return!1}}if(e===Ae.binary){if(!this._dcBinary)return!1;try{let n=Array.isArray(t)?t[0]:t,i=H.webrtc.dcBufferThreshold;return this._dcBinary.bufferedAmount()>i?!1:this._dcBinary.sendMessageBinary(n)}catch(n){return Hn.error(`send binary failed: ${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")}else e.type==="error"&&Hn.warn(`remote signaling error: ${e.message||"unknown"}`)}async _addRemoteCandidate(e,t){try{let n=await _w(e);if(!n||!this._pc)return;this._pc.addRemoteCandidate(n,t)}catch(n){Hn.error(`addRemoteCandidate: ${n.message}`)}}_createPeer(e){this._pc&&Hn.warn(`peer recreate while live (state=${this._state}) \u2014 reconnect race`);try{this._pc?.close()}catch{}this._pc=null,this._dcControl=null,this._dcBinary=null,this._remoteSet=!1,this._iceGraceTimer&&(clearTimeout(this._iceGraceTimer),this._iceGraceTimer=null),this._answerTimer&&(clearTimeout(this._answerTimer),this._answerTimer=null);let t=this._ctx?.auth?.socketId||"anon",{PeerConnection:n}=TB(),i=new n(`peer-${t}`,{iceServers:this._iceServers});this._pcState="new",i.onStateChange(s=>{if(this._pcState=s,s==="failed"||s==="closed")this._iceGraceTimer&&(clearTimeout(this._iceGraceTimer),this._iceGraceTimer=null),this._setState(ct.closed);else if(s==="disconnected"){if(this._iceGraceTimer)return;this._iceGraceTimer=setTimeout(()=>{this._iceGraceTimer=null,this._pcState!=="connected"&&this._setState(ct.closed)},H.webrtc.iceDisconnectGraceMs)}else s==="connected"&&this._iceGraceTimer&&(clearTimeout(this._iceGraceTimer),this._iceGraceTimer=null)}),i.onDataChannel(s=>{let o=s.getLabel?.()||"",a=()=>{o==="control"?this._dcControl=s:o==="binary"&&(this._dcBinary=s),this._dcControl&&this._dcBinary&&this._setState(ct.open)};s.onOpen(a),s.onClosed(()=>{o==="control"&&(this._dcControl=null),o==="binary"&&(this._dcBinary=null),!this._dcControl&&!this._dcBinary&&this._setState(ct.closed)}),s.onError(c=>Hn.error(`DC[${o}] error: ${c?.message||c}`)),s.onMessage(c=>{if(o!=="control")return;let l;try{l=gw(c)}catch(u){Hn.error(`control parse: ${u.message}`);return}try{this._emit("message",{event:l.event,data:l,source:"rtc"})}catch(u){Hn.error(`handler error event=${l.event}: ${u.message}`)}})}),this._pc=i}_processOffer(e,t){this._createPeer(t);let n=!1,i=()=>{this._answerTimer&&(clearTimeout(this._answerTimer),this._answerTimer=null)};return new Promise((s,o)=>{this._pc.onLocalDescription((c,l)=>{l!=="answer"||n||(n=!0,i(),this._signaling?.send?.({type:"answer",sdp:c}),s())}),this._pc.onLocalCandidate((c,l)=>{c&&this._signaling?.send?.({type:"ice",candidate:c,mid:l})});try{this._pc.setRemoteDescription(e,"offer"),this._remoteSet=!0;for(let{candidate:c,mid:l}of this._pendingCandidates)this._addRemoteCandidate(c,l);this._pendingCandidates=[],this._pc.setLocalDescription()}catch(c){n||(n=!0,i()),this._signaling?.send?.({type:"error",message:c.message}),o(c);return}let a=t?.answerTimeout||1e4;this._answerTimer=setTimeout(()=>{n||(n=!0,this._answerTimer=null,Hn.warn(`Answer timeout (no local description within ${a}ms)`),o(new Error("Answer timeout")))},a)})}_cleanupPeer(){this._iceGraceTimer&&(clearTimeout(this._iceGraceTimer),this._iceGraceTimer=null),this._answerTimer&&(clearTimeout(this._answerTimer),this._answerTimer=null);try{this._pc?.close()}catch{}this._pc=null,this._dcControl=null,this._dcBinary=null}async _refreshTurn(e){let t=await AB(e.turnApiUrl,this._ctx.auth.apiKey);t?.length&&(this._iceServers=t,H.logging?.webrtc&&console.log(`[WebRtcProtocol] TURN credentials loaded (${t.length} servers)`)),clearTimeout(this._refreshTimer),this._refreshTimer=setTimeout(()=>this._refreshTurn(e),e.turnRefreshInterval)}};var bw=new Map;function uh(r){if(!r?.id)throw new Error("Adapter missing static id");bw.set(r.id,r)}function ww(r){return bw.get(r)}Rh();uh(bl);uh(El);var Bl=class{constructor(e,t){let n=t.enableWebRTC?"remoteDesktop":"clientApp",i={...uw[n]};t.enableWebRTC||(i.enabled=["ws"]),i.rtc={enableTurn:!!(t.apiKey&&t.turnApiUrl),turnApiUrl:t.turnApiUrl||null,turnRefreshInterval:t.turnRefreshInterval,dcMaxMessageSize:t.dcMaxMessageSize,answerTimeout:t.answerTimeout},this._profile=i,this._auth={apiKey:t.apiKey||null,socketId:e.id},this._socket=e,this._wsChunkSize=t.wsChunkSize,this._dcChunkSize=t.dcChunkSize,this._dcMaxTilesPerFrame=t.dcMaxTilesPerFrame,this._maxControlBuffer=t.maxControlBuffer,this._adapters=new Map,this._listeners=new Map,this._buffer=[],this._rtcSignalingHandler=null,this._sigListeners=null,this._wsPendingSince=new Map,this._rtcPendingSince=new Map}get type(){return this._pickAdapter(Ae.binary)?.constructor.id==="rtc"?"dc":"ws"}async init(){for(let e of this._profile.enabled){let t=ww(e);if(!t)continue;let n;try{n=new t,n.on("stateChange",i=>this._onAdapterStateChange(e,i)),n.on("message",({event:i,data:s,source:o})=>this._dispatch(i,s,o)),await n.connect(this._buildCtx(e))}catch(i){if(e==="rtc"){console.warn(`[ProtocolManager] WebRTC unavailable \u2014 remote desktop over WS only. (${i.message})`);continue}throw i}this._adapters.set(e,n)}}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(Ae.binary),o=i??Date.now();return s?.constructor.id==="rtc"&&t?this._emitTilesRtc(s,n,o,t):this._emitTilesChunked(n,o)}close(){for(let e of this._adapters.values())try{e.disconnect()}catch{}this._adapters.clear(),this._buffer=[]}attachAsBus(e){if(e._rawEmit)return;let t=e.emit.bind(e);e._rawEmit=t;let n=new Set(["error","disconnect","disconnecting","connect","newListener","removeListener"]);e.emit=(i,...s)=>n.has(i)?t(i,...s):(this._sendControl(i,s),!0)}_emitTilesChunked(e,t){let n=this._adapters.get("ws");if(!n?.ready)return[];let i=this._wsChunkSize,s=this._wsPendingSince,o=t??Date.now(),a=[...e].sort((l,u)=>{let f=s.get(l.tileIndex)??1/0,d=s.get(u.tileIndex)??1/0;return f!==d?f-d:l.tileIndex-u.tileIndex}),c=[];for(let l=0;l<a.length;l+=i){let u=a.slice(l,l+i);if(n.send(Ae.binary,Ms(u,t))===!1){for(let f=l;f<a.length;f++){let d=a[f].tileIndex;s.has(d)||s.set(d,o)}break}for(let f of u)s.delete(f.tileIndex);c.push(...u)}return c}_emitTilesRtc(e,t,n,i){let s=this._profile.rtc?.dcMaxMessageSize??65536,o=t.length,a=this._rtcPendingSince,c=n??Date.now(),l=[...t].sort((y,b)=>{let C=a.get(y.tileIndex)??1/0,R=a.get(b.tileIndex)??1/0;return C!==R?C-R:y.tileIndex-b.tileIndex}),u=y=>l.slice(0,y),f=Math.min(this._dcChunkSize,o);for(;f>1&&i(u(f),n).length>s;)f=Math.floor(f/2);let d=this._adapters.get("ws"),g=[];for(let y=0;y<o;y+=f){let b=l.slice(y,y+f),C=i(b,n);if(C.length>s){b.length===1&&d?.ready&&d.send(Ae.binary,C)!==!1&&(a.delete(b[0].tileIndex),g.push(...b));continue}if(e.send(Ae.binary,C)===!1){let R=l.slice(y);if(d?.ready){let M=this._emitTilesChunked(R,n);for(let P of M)a.delete(P.tileIndex);g.push(...M)}else for(let M=y;M<o;M++)a.has(l[M].tileIndex)||a.set(l[M].tileIndex,c);return g}for(let R of b)a.delete(R.tileIndex);g.push(...b)}return g}_buildCtx(e){let t={auth:this._auth,profile:this._profile};return e==="ws"&&(t.socket=this._socket),e==="rtc"&&(t.signaling={send:n=>this._sendSignaling(n),on:n=>{this._rtcSignalingHandler=n,this._installSignalingListeners()},off:()=>{this._rtcSignalingHandler=null,this._removeSignalingListeners()}}),t}_onAdapterStateChange(e,t){t===ct.open&&this._flushBuffer()}_pickAdapter(e){let t=this._profile.channels[e];if(!t)return null;let n=[...this._adapters.values()].filter(i=>i.supports(e)&&i.ready);if(t.prefer){let i=n.find(s=>s.constructor.id===t.prefer);if(i)return i}return n.sort((i,s)=>(s.constructor.priority[e]??0)-(i.constructor.priority[e]??0)),n[0]||null}hasReadyAdapter(){return!!(this._pickAdapter(Ae.control)||this._pickAdapter(Ae.binary))}_sendControl(e,t,n){let i=this._pickAdapter(Ae.control);if(!i){this._buffer.push({event:e,args:t,ackId:n}),this._buffer.length>this._maxControlBuffer&&this._buffer.shift();return}if(i.constructor.id==="rtc"&&tj(t)>lw){let s=this._adapters.get("ws");s?.ready&&(i=s)}if(i.constructor.id==="rtc"){if(i.send(Ae.control,{event:e,args:t,ackId:n}))return;let o=this._adapters.get("ws");if(o?.ready&&o.send(Ae.control,{event:e,args:t}))return}else if(i.send(Ae.control,{event:e,args:t}))return;this._buffer.push({event:e,args:t,ackId:n}),this._buffer.length>this._maxControlBuffer&&this._buffer.shift()}_flushBuffer(){if(!(!this._buffer.length||!this._pickAdapter(Ae.control)))for(;this._buffer.length;){let{event:t,args:n,ackId:i}=this._buffer.shift();this._sendControl(t,n,i)}}_dispatch(e,t,n){if(n==="rtc"){let s=Array.isArray(t?.args)?[...t.args]:[],o=t?.ackId;o&&s.push((...l)=>this._sendAck(o,l));let a=this._listeners.get(e);if(a)for(let l of a)l(...s);let c=this._socket.listeners?.(e)||[];for(let l of c)l(...s);return}let i=this._listeners.get(e);if(i)for(let s of i)s(t)}_sendAck(e,t){let n=this._adapters.get("rtc");if(n?.ready&&n.send(Ae.control,{event:"__ack",args:t,ackId:e}))return;let i=this._adapters.get("ws");i?.ready&&i.send(Ae.control,{event:"__ack",args:t,ackId:e})}_sendSignaling(e){let t=this._adapters.get("ws");if(t?.ready){t.send(Ae.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)}};function tj(r){let e=0;for(let t of r)t==null?e+=4:typeof t=="string"?e+=t.length:e+=JSON.stringify(t).length;return e}_i();dt();var SC=require("path"),EC=require("url");var ql=W(require("net"),1),ce=W(require("fs"),1),he=W(require("path"),1),bS=W(require("os"),1),wS=require("child_process"),SS=require("url");var Ph=W(require("fs"),1),oa="44",Mh={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 vS(){if(process.platform!=="win32")return[];let r=process.env.SystemRoot||"C:\\Windows";return Mh.win32.filter(e=>{try{return Ph.default.existsSync(e.path)||Ph.default.existsSync(`${r}\\System32\\${e.path}`)}catch{return!0}})}function yS(r){if(process.platform==="win32"){let n=r?Mh.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:[]}:Mh.win32[0]}let e=process.env.SHELL||"/bin/bash",t=e.split("/").pop();return{id:t,label:t,path:e,args:["-l"]}}var Nh=he.default.dirname((0,SS.fileURLToPath)(__importMetaUrl)),_n=he.default.join(bS.default.homedir(),".9remote"),aa=process.platform==="win32"?"\\\\.\\pipe\\9remote-pty":he.default.join(_n,"pty-daemon.sock"),xS=he.default.join(Nh,"ptyDaemon.js"),_S=he.default.join(Nh,"ptyDaemon.cjs"),jl=he.default.join(_n,"daemon");function ES(r,e){if(ce.default.existsSync(r)){ce.default.mkdirSync(e,{recursive:!0});for(let t of ce.default.readdirSync(r,{withFileTypes:!0})){let n=he.default.join(r,t.name),i=he.default.join(e,t.name);t.isDirectory()?ES(n,i):t.isFile()&&ce.default.copyFileSync(n,i)}}}function rj(r,e){let t=r;for(let n=0;n<6;n++){let i=he.default.join(t,"node_modules",e);if(ce.default.existsSync(i))return i;let s=he.default.dirname(t);if(s===t)break;t=s}return null}var nj=r=>rj(r,"node-pty");function ij(r){try{if(!ce.default.existsSync(jl))return;let e=he.default.join(_n,"pids","ptyDaemon.pid"),t=!1;try{let n=parseInt(ce.default.readFileSync(e,"utf8").trim(),10);if(Number.isFinite(n)&&n>0)try{process.kill(n,0),t=!0}catch{}}catch{}if(t)return;for(let n of ce.default.readdirSync(jl))if(n!==`v${r}`)try{ce.default.rmSync(he.default.join(jl,n),{recursive:!0,force:!0})}catch{}}catch{}}function sj(r){ij(oa);let e=he.default.join(jl,`v${oa}`),t=r.endsWith(".js"),n=t?he.default.join(e,"features","terminal"):e,i=he.default.join(n,he.default.basename(r)),s=he.default.join(n,"node_modules","node-pty");if(ce.default.existsSync(i)&&ce.default.existsSync(s))return{script:i,cwd:n};try{if(ce.default.mkdirSync(n,{recursive:!0}),ce.default.copyFileSync(r,i),t){let a=he.default.dirname(r);ce.default.copyFileSync(he.default.join(a,"constants.js"),he.default.join(n,"constants.js"));let c=he.default.join(e,"lib");ce.default.mkdirSync(c,{recursive:!0}),ce.default.copyFileSync(he.default.resolve(a,"..","..","lib","constants.js"),he.default.join(c,"constants.js"))}let o=nj(he.default.dirname(r));return o?(ES(o,s),{script:i,cwd:n}):null}catch{return null}}var zr=null,Is=!1,zn=!1,Ih="",oj=0,Ns=new Map,Fl=new Map;function aj(){return++oj}function la(r,e){Fl.has(r)||Fl.set(r,[]),Fl.get(r).push(e)}function ca(r,e){let t=Fl.get(r);if(t)for(let n of t)try{n(e)}catch(i){console.error(`[DaemonClient] Error in ${r} handler:`,i)}}function Dh(r){if(!zr||!Is)return!1;try{return zr.write(JSON.stringify(r)+`
|
|
114
|
-
`),!0}catch(e){return console.error("[DaemonClient] Send error:",e),!1}}function Ds(r,e=5e3){return new Promise((t,n)=>{let i=
|
|
112
|
+
`,i)}while(n!==-1);return s+=r.slice(i),s}var{stdout:Wv,stderr:Gv}=qv,Dp=Symbol("GENERATOR"),qi=Symbol("STYLER"),go=Symbol("IS_EMPTY"),zv=["ansi","ansi","ansi256","ansi16m"],$i=Object.create(null),_M=(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=Wv?Wv.level:0;r.level=e.level===void 0?t:e.level};var bM=r=>{let e=(...t)=>t.join(" ");return _M(e,r),Object.setPrototypeOf(e,vo.prototype),e};function vo(r){return bM(r)}Object.setPrototypeOf(vo.prototype,Function.prototype);for(let[r,e]of Object.entries(Tr))$i[r]={get(){let t=Za(this,Bp(e.open,e.close,this[qi]),this[go]);return Object.defineProperty(this,r,{value:t}),t}};$i.visible={get(){let r=Za(this,this[qi],!0);return Object.defineProperty(this,"visible",{value:r}),r}};var Lp=(r,e,t,...n)=>r==="rgb"?e==="ansi16m"?Tr[t].ansi16m(...n):e==="ansi256"?Tr[t].ansi256(Tr.rgbToAnsi256(...n)):Tr[t].ansi(Tr.rgbToAnsi(...n)):r==="hex"?Lp("rgb",e,t,...Tr.hexToRgb(...n)):Tr[t][r](...n),wM=["rgb","hex","ansi256"];for(let r of wM){$i[r]={get(){let{level:t}=this;return function(...n){let i=Bp(Lp(r,zv[t],"color",...n),Tr.color.close,this[qi]);return Za(this,i,this[go])}}};let e="bg"+r[0].toUpperCase()+r.slice(1);$i[e]={get(){let{level:t}=this;return function(...n){let i=Bp(Lp(r,zv[t],"bgColor",...n),Tr.bgColor.close,this[qi]);return Za(this,i,this[go])}}}}var SM=Object.defineProperties(()=>{},{...$i,level:{enumerable:!0,get(){return this[Dp].level},set(r){this[Dp].level=r}}}),Bp=(r,e,t)=>{let n,i;return t===void 0?(n=r,i=e):(n=t.openAll+r,i=e+t.closeAll),{open:r,close:e,openAll:n,closeAll:i,parent:t}},Za=(r,e,t)=>{let n=(...i)=>EM(n,i.length===1?""+i[0]:i.join(" "));return Object.setPrototypeOf(n,SM),n[Dp]=r,n[qi]=e,n[go]=t,n},EM=(r,e)=>{if(r.level<=0||!e)return r[go]?"":e;let t=r[qi];if(t===void 0)return e;let{openAll:n,closeAll:i}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=$v(e,t.close,t.open),t=t.parent;let s=e.indexOf(`
|
|
113
|
+
`);return s!==-1&&(e=Hv(e,i,n,s)),n+e+i};Object.defineProperties(vo.prototype,$i);var TM=vo(),p6=vo({level:Gv?Gv.level:0});var yo=TM;Ft();St();ri();var aw=W(ow(),1),{Server:cw,Namespace:o8,Socket:a8}=aw.default;var vR=require("fs"),yR=require("path");St();_l();var Ae={control:"control",binary:"binary"},fw=65536,ct={idle:"idle",connecting:"connecting",open:"open",degraded:"degraded",closed:"closed"},dw={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 Es=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=ct.idle}get state(){return this._state}get ready(){return this._state===ct.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 bl=class extends Es{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?ct.open:ct.connecting),e.socket.on("connect",()=>this._setState(ct.open)),e.socket.on("disconnect",()=>this._setState(ct.closed)),e.socket.onAny?.((t,n)=>this._emit("message",{event:t,data:n,source:"ws"}))}disconnect(){this._socket=null,this._setState(ct.closed)}send(e,t){if(!this._socket?.connected)return!1;let n=this._socket._rawEmit||this._socket.emit.bind(this._socket);if(e===Ae.control){let{event:i,args:s=[]}=t;return n(i,...s),!0}if(e===Ae.binary){let i=this._socket.conn?.transport;return i&&i.writable===!1?!1:(n("tiles-bin-v2",t),!0)}return!1}};var mw=require("child_process"),gw=require("module"),wl=W(require("path"),1),oh=W(require("os"),1),ah=(0,gw.createRequire)(__importMetaUrl),bB=300*1e3,hw=new Map;function vw(r){try{return ah(r)}catch(e){if(e.code!=="MODULE_NOT_FOUND"&&!wB(e))throw e;let t=hw.get(r);if(t!=null&&Date.now()-t<bB)throw e;return hw.set(r,Date.now()),EB(r),ah(r)}}function wB(r){return/\.node'|Cannot find module.*\.node|MODULE_NOT_FOUND/i.test(r.message||"")}function SB(r){let e=ah.resolve(`${r}/package.json`);return wl.default.dirname(e)}function EB(r){let e=SB(r),t=wl.default.dirname(e),n=oh.default.platform()==="win32"?"prebuild-install.cmd":"prebuild-install",i=wl.default.join(t,".bin",n);try{let s=(0,mw.spawnSync)(i,["-r","napi"],{cwd:e,stdio:"ignore",shell:oh.default.platform()==="win32",timeout:12e4});console.warn(`[nativeSelfHeal] ${r} heal attempted (status=${s.status})`)}catch(s){console.warn(`[nativeSelfHeal] ${r} heal failed:`,s.message)}}function TB(r,e){return e&&typeof e=="object"&&e.type==="Buffer"&&Array.isArray(e.data)?{__b:Buffer.from(e.data).toString("base64")}:e}function CB(r,e){return e&&typeof e=="object"&&typeof e.__b=="string"?Buffer.from(e.__b,"base64"):e}function yw(r){return JSON.stringify(r,TB)}function xw(r){return JSON.parse(typeof r=="string"?r:Buffer.from(r).toString("utf8"),CB)}dt();var ww=W(require("node:dns/promises"),1),kB=3e4,AB=/\s([0-9a-f-]{8,}\.local)\s/i,bw=new Map;async function RB(r){let e=bw.get(r);if(e&&Date.now()-e.ts<kB)return e.ip;try{let{address:t}=await ww.default.lookup(r);return bw.set(r,{ip:t,ts:Date.now()}),t}catch{return null}}async function Sw(r){let e=r.match(AB);if(!e)return r;let t=await RB(e[1]);return t?r.replace(e[1],t):null}ri();var Gn=Fr("webrtc"),ch=null;function OB(){return ch||(ch=vw("node-datachannel")),ch}var MB=[{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"}],lh="";async function PB(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();lh="";let i=[];for(let s of n)for(let o of s.urls)if(o.startsWith("stun:")){let a=o.replace("stun:","").split(":")[0],c=parseInt(o.split(":")[2]||"3478");i.push({hostname:a,port:c,type:"Stun"})}else if(o.startsWith("turn:")||o.startsWith("turns:")){let a=o.startsWith("turns:"),l=o.replace(/^turns?:/,"").split("?")[0],u=l.split(":")[0],f=parseInt(l.split(":")[1]||(a?"5349":"3478")),d=o.includes("transport=tcp")?"Tcp":"Udp";i.push({hostname:u,port:f,type:a?"Tls":"Turn",relayType:d,username:s.username,password:s.credential})}return i}catch(t){return lh!==t.message&&(lh=t.message,console.warn(`[WebRtcProtocol] TURN fetch failed (${t.message}) \u2014 using STUN-only fallback. Will retry on next connection.`)),null}}var El=class extends Es{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=MB,this._refreshTimer=null,this._remoteSet=!1,this._pendingCandidates=[],this._signaling=null,this._iceGraceTimer=null,this._answerTimer=null}async connect(e){this._ctx=e,this._setState(ct.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(ct.closed)}send(e,t){if(e===Ae.control){if(!this._dcControl)return!1;try{return this._dcControl.sendMessage(yw({event:t.event,args:t.args||[],ackId:t.ackId||null})),!0}catch{return!1}}if(e===Ae.binary){if(!this._dcBinary)return!1;try{let n=Array.isArray(t)?t[0]:t;return this._dcBinary.bufferedAmount()>H.webrtc.dcBufferThreshold?!1:this._dcBinary.sendMessageBinary(n)}catch(n){return Gn.error(`send binary failed: ${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")}else e.type==="error"&&Gn.warn(`remote signaling error: ${e.message||"unknown"}`)}async _addRemoteCandidate(e,t){try{let n=await Sw(e);if(!n||!this._pc)return;this._pc.addRemoteCandidate(n,t)}catch(n){Gn.error(`addRemoteCandidate: ${n.message}`)}}_createPeer(e){this._pc&&Gn.warn(`peer recreate while live (state=${this._state}) \u2014 reconnect race`);try{this._pc?.close()}catch{}this._pc=null,this._dcControl=null,this._dcBinary=null,this._remoteSet=!1,this._iceGraceTimer&&(clearTimeout(this._iceGraceTimer),this._iceGraceTimer=null),this._answerTimer&&(clearTimeout(this._answerTimer),this._answerTimer=null);let t=this._ctx?.auth?.socketId||"anon",{PeerConnection:n}=OB(),i=new n(`peer-${t}`,{iceServers:this._iceServers});this._pcState="new",i.onStateChange(s=>{if(this._pcState=s,s==="failed"||s==="closed")this._iceGraceTimer&&(clearTimeout(this._iceGraceTimer),this._iceGraceTimer=null),this._setState(ct.closed);else if(s==="disconnected"){if(this._iceGraceTimer)return;this._iceGraceTimer=setTimeout(()=>{this._iceGraceTimer=null,this._pcState!=="connected"&&this._setState(ct.closed)},H.webrtc.iceDisconnectGraceMs)}else s==="connected"&&this._iceGraceTimer&&(clearTimeout(this._iceGraceTimer),this._iceGraceTimer=null)}),i.onDataChannel(s=>{let o=s.getLabel?.()||"",a=()=>{o==="control"?this._dcControl=s:o==="binary"&&(this._dcBinary=s),this._dcControl&&this._dcBinary&&this._setState(ct.open)};s.onOpen(a),s.onClosed(()=>{o==="control"&&(this._dcControl=null),o==="binary"&&(this._dcBinary=null),!this._dcControl&&!this._dcBinary&&this._setState(ct.closed)}),s.onError(c=>Gn.error(`DC[${o}] error: ${c?.message||c}`)),s.onMessage(c=>{if(o!=="control")return;let l;try{l=xw(c)}catch(u){Gn.error(`control parse: ${u.message}`);return}try{this._emit("message",{event:l.event,data:l,source:"rtc"})}catch(u){Gn.error(`handler error event=${l.event}: ${u.message}`)}})}),this._pc=i}_processOffer(e,t){this._createPeer(t);let n=!1,i=()=>{this._answerTimer&&(clearTimeout(this._answerTimer),this._answerTimer=null)};return new Promise((s,o)=>{this._pc.onLocalDescription((c,l)=>{l!=="answer"||n||(n=!0,i(),this._signaling?.send?.({type:"answer",sdp:c}),s())}),this._pc.onLocalCandidate((c,l)=>{c&&this._signaling?.send?.({type:"ice",candidate:c,mid:l})});try{this._pc.setRemoteDescription(e,"offer"),this._remoteSet=!0;for(let{candidate:c,mid:l}of this._pendingCandidates)this._addRemoteCandidate(c,l);this._pendingCandidates=[],this._pc.setLocalDescription()}catch(c){n||(n=!0,i()),this._signaling?.send?.({type:"error",message:c.message}),o(c);return}let a=t?.answerTimeout||1e4;this._answerTimer=setTimeout(()=>{n||(n=!0,this._answerTimer=null,Gn.warn(`Answer timeout (no local description within ${a}ms)`),o(new Error("Answer timeout")))},a)})}_cleanupPeer(){this._iceGraceTimer&&(clearTimeout(this._iceGraceTimer),this._iceGraceTimer=null),this._answerTimer&&(clearTimeout(this._answerTimer),this._answerTimer=null);try{this._pc?.close()}catch{}this._pc=null,this._dcControl=null,this._dcBinary=null}async _refreshTurn(e){let t=await PB(e.turnApiUrl,this._ctx.auth.apiKey);t?.length&&(this._iceServers=t,H.logging?.webrtc&&console.log(`[WebRtcProtocol] TURN credentials loaded (${t.length} servers)`)),clearTimeout(this._refreshTimer),this._refreshTimer=setTimeout(()=>this._refreshTurn(e),e.turnRefreshInterval)}};var Ew=new Map;function uh(r){if(!r?.id)throw new Error("Adapter missing static id");Ew.set(r.id,r)}function Tw(r){return Ew.get(r)}Rh();uh(bl);uh(El);var Bl=class{constructor(e,t){let n=t.enableWebRTC?"remoteDesktop":"clientApp",i={...dw[n]};t.enableWebRTC||(i.enabled=["ws"]),i.rtc={enableTurn:!!(t.apiKey&&t.turnApiUrl),turnApiUrl:t.turnApiUrl||null,turnRefreshInterval:t.turnRefreshInterval,dcMaxMessageSize:t.dcMaxMessageSize,answerTimeout:t.answerTimeout},this._profile=i,this._auth={apiKey:t.apiKey||null,socketId:e.id},this._socket=e,this._wsChunkSize=t.wsChunkSize,this._dcChunkSize=t.dcChunkSize,this._dcMaxTilesPerFrame=t.dcMaxTilesPerFrame,this._maxControlBuffer=t.maxControlBuffer,this._adapters=new Map,this._listeners=new Map,this._buffer=[],this._rtcSignalingHandler=null,this._sigListeners=null,this._wsPendingSince=new Map,this._rtcPendingSince=new Map}get type(){return this._pickAdapter(Ae.binary)?.constructor.id==="rtc"?"dc":"ws"}async init(){for(let e of this._profile.enabled){let t=Tw(e);if(!t)continue;let n;try{n=new t,n.on("stateChange",i=>this._onAdapterStateChange(e,i)),n.on("message",({event:i,data:s,source:o})=>this._dispatch(i,s,o)),await n.connect(this._buildCtx(e))}catch(i){if(e==="rtc"){console.warn(`[ProtocolManager] WebRTC unavailable \u2014 remote desktop over WS only. (${i.message})`);continue}throw i}this._adapters.set(e,n)}}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(Ae.binary),o=i??Date.now();return s?.constructor.id==="rtc"&&t?this._emitTilesRtc(s,n,o,t):this._emitTilesChunked(n,o)}close(){for(let e of this._adapters.values())try{e.disconnect()}catch{}this._adapters.clear(),this._buffer=[]}attachAsBus(e){if(e._rawEmit)return;let t=e.emit.bind(e);e._rawEmit=t;let n=new Set(["error","disconnect","disconnecting","connect","newListener","removeListener"]);e.emit=(i,...s)=>n.has(i)?t(i,...s):(this._sendControl(i,s),!0)}_emitTilesChunked(e,t){let n=this._adapters.get("ws");if(!n?.ready)return[];let i=this._wsChunkSize,s=this._wsPendingSince,o=t??Date.now(),a=[...e].sort((l,u)=>{let f=s.get(l.tileIndex)??1/0,d=s.get(u.tileIndex)??1/0;return f!==d?f-d:l.tileIndex-u.tileIndex}),c=[];for(let l=0;l<a.length;l+=i){let u=a.slice(l,l+i);if(n.send(Ae.binary,Ms(u,t))===!1){for(let f=l;f<a.length;f++){let d=a[f].tileIndex;s.has(d)||s.set(d,o)}break}for(let f of u)s.delete(f.tileIndex);c.push(...u)}return c}_emitTilesRtc(e,t,n,i){let s=this._profile.rtc?.dcMaxMessageSize??65536,o=t.length,a=this._rtcPendingSince,c=n??Date.now(),l=[...t].sort((y,b)=>{let C=a.get(y.tileIndex)??1/0,R=a.get(b.tileIndex)??1/0;return C!==R?C-R:y.tileIndex-b.tileIndex}),u=y=>l.slice(0,y),f=Math.min(this._dcChunkSize,o);for(;f>1&&i(u(f),n).length>s;)f=Math.floor(f/2);let d=this._adapters.get("ws"),g=[];for(let y=0;y<o;y+=f){let b=l.slice(y,y+f),C=i(b,n);if(C.length>s){b.length===1&&d?.ready&&d.send(Ae.binary,C)!==!1&&(a.delete(b[0].tileIndex),g.push(...b));continue}if(e.send(Ae.binary,C)===!1){let R=l.slice(y);if(d?.ready){let O=this._emitTilesChunked(R,n);for(let P of O)a.delete(P.tileIndex);g.push(...O)}else for(let O=y;O<o;O++)a.has(l[O].tileIndex)||a.set(l[O].tileIndex,c);return g}for(let R of b)a.delete(R.tileIndex);g.push(...b)}return g}_buildCtx(e){let t={auth:this._auth,profile:this._profile};return e==="ws"&&(t.socket=this._socket),e==="rtc"&&(t.signaling={send:n=>this._sendSignaling(n),on:n=>{this._rtcSignalingHandler=n,this._installSignalingListeners()},off:()=>{this._rtcSignalingHandler=null,this._removeSignalingListeners()}}),t}_onAdapterStateChange(e,t){t===ct.open&&this._flushBuffer()}_pickAdapter(e){let t=this._profile.channels[e];if(!t)return null;let n=[...this._adapters.values()].filter(i=>i.supports(e)&&i.ready);if(t.prefer){let i=n.find(s=>s.constructor.id===t.prefer);if(i)return i}return n.sort((i,s)=>(s.constructor.priority[e]??0)-(i.constructor.priority[e]??0)),n[0]||null}hasReadyAdapter(){return!!(this._pickAdapter(Ae.control)||this._pickAdapter(Ae.binary))}_sendControl(e,t,n){let i=this._pickAdapter(Ae.control);if(!i){this._buffer.push({event:e,args:t,ackId:n}),this._buffer.length>this._maxControlBuffer&&this._buffer.shift();return}if(i.constructor.id==="rtc"&&oj(t)>fw){let s=this._adapters.get("ws");s?.ready&&(i=s)}if(i.constructor.id==="rtc"){if(i.send(Ae.control,{event:e,args:t,ackId:n}))return;let o=this._adapters.get("ws");if(o?.ready&&o.send(Ae.control,{event:e,args:t}))return}else if(i.send(Ae.control,{event:e,args:t}))return;this._buffer.push({event:e,args:t,ackId:n}),this._buffer.length>this._maxControlBuffer&&this._buffer.shift()}_flushBuffer(){if(!(!this._buffer.length||!this._pickAdapter(Ae.control)))for(;this._buffer.length;){let{event:t,args:n,ackId:i}=this._buffer.shift();this._sendControl(t,n,i)}}_dispatch(e,t,n){if(n==="rtc"){let s=Array.isArray(t?.args)?[...t.args]:[],o=t?.ackId;o&&s.push((...l)=>this._sendAck(o,l));let a=this._listeners.get(e);if(a)for(let l of a)l(...s);let c=this._socket.listeners?.(e)||[];for(let l of c)l(...s);return}let i=this._listeners.get(e);if(i)for(let s of i)s(t)}_sendAck(e,t){let n=this._adapters.get("rtc");if(n?.ready&&n.send(Ae.control,{event:"__ack",args:t,ackId:e}))return;let i=this._adapters.get("ws");i?.ready&&i.send(Ae.control,{event:"__ack",args:t,ackId:e})}_sendSignaling(e){let t=this._adapters.get("ws");if(t?.ready){t.send(Ae.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)}};function oj(r){let e=0;for(let t of r)t==null?e+=4:typeof t=="string"?e+=t.length:e+=JSON.stringify(t).length;return e}_i();dt();var AC=require("path"),RC=require("url");var ql=W(require("net"),1),ce=W(require("fs"),1),he=W(require("path"),1),ES=W(require("os"),1),TS=require("child_process"),CS=require("url");var Ph=W(require("fs"),1),oa="44",Mh={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 _S(){if(process.platform!=="win32")return[];let r=process.env.SystemRoot||"C:\\Windows";return Mh.win32.filter(e=>{try{return Ph.default.existsSync(e.path)||Ph.default.existsSync(`${r}\\System32\\${e.path}`)}catch{return!0}})}function bS(r){if(process.platform==="win32"){let n=r?Mh.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:[]}:Mh.win32[0]}let e=process.env.SHELL||"/bin/bash",t=e.split("/").pop();return{id:t,label:t,path:e,args:["-l"]}}var Nh=he.default.dirname((0,CS.fileURLToPath)(__importMetaUrl)),wn=he.default.join(ES.default.homedir(),".9remote"),aa=process.platform==="win32"?"\\\\.\\pipe\\9remote-pty":he.default.join(wn,"pty-daemon.sock"),wS=he.default.join(Nh,"ptyDaemon.js"),SS=he.default.join(Nh,"ptyDaemon.cjs"),jl=he.default.join(wn,"daemon");function kS(r,e){if(ce.default.existsSync(r)){ce.default.mkdirSync(e,{recursive:!0});for(let t of ce.default.readdirSync(r,{withFileTypes:!0})){let n=he.default.join(r,t.name),i=he.default.join(e,t.name);t.isDirectory()?kS(n,i):t.isFile()&&ce.default.copyFileSync(n,i)}}}function aj(r,e){let t=r;for(let n=0;n<6;n++){let i=he.default.join(t,"node_modules",e);if(ce.default.existsSync(i))return i;let s=he.default.dirname(t);if(s===t)break;t=s}return null}var cj=r=>aj(r,"node-pty");function lj(r){try{if(!ce.default.existsSync(jl))return;let e=he.default.join(wn,"pids","ptyDaemon.pid"),t=!1;try{let n=parseInt(ce.default.readFileSync(e,"utf8").trim(),10);if(Number.isFinite(n)&&n>0)try{process.kill(n,0),t=!0}catch{}}catch{}if(t)return;for(let n of ce.default.readdirSync(jl))if(n!==`v${r}`)try{ce.default.rmSync(he.default.join(jl,n),{recursive:!0,force:!0})}catch{}}catch{}}function uj(r){lj(oa);let e=he.default.join(jl,`v${oa}`),t=r.endsWith(".js"),n=t?he.default.join(e,"features","terminal"):e,i=he.default.join(n,he.default.basename(r)),s=he.default.join(n,"node_modules","node-pty");if(ce.default.existsSync(i)&&ce.default.existsSync(s))return{script:i,cwd:n};try{if(ce.default.mkdirSync(n,{recursive:!0}),ce.default.copyFileSync(r,i),t){let a=he.default.dirname(r);ce.default.copyFileSync(he.default.join(a,"constants.js"),he.default.join(n,"constants.js"));let c=he.default.join(e,"lib");ce.default.mkdirSync(c,{recursive:!0}),ce.default.copyFileSync(he.default.resolve(a,"..","..","lib","constants.js"),he.default.join(c,"constants.js"))}let o=cj(he.default.dirname(r));return o?(kS(o,s),{script:i,cwd:n}):null}catch{return null}}var zr=null,Is=!1,Vn=!1,Ih="",pj=0,Ns=new Map,Fl=new Map;function fj(){return++pj}function la(r,e){Fl.has(r)||Fl.set(r,[]),Fl.get(r).push(e)}function ca(r,e){let t=Fl.get(r);if(t)for(let n of t)try{n(e)}catch(i){console.error(`[DaemonClient] Error in ${r} handler:`,i)}}function Dh(r){if(!zr||!Is)return!1;try{return zr.write(JSON.stringify(r)+`
|
|
114
|
+
`),!0}catch(e){return console.error("[DaemonClient] Send error:",e),!1}}function Ds(r,e=5e3){return new Promise((t,n)=>{let i=fj();r.requestId=i;let s=setTimeout(()=>{Ns.delete(i),n(new Error("Request timeout"))},e);Ns.set(i,{resolve:t,reject:n,timer:s}),Dh(r)||(clearTimeout(s),Ns.delete(i),n(new Error("Not connected to daemon")))})}function dj(r){let{type:e,requestId:t,...n}=r;if(t&&Ns.has(t)){let{resolve:i,timer:s}=Ns.get(t);clearTimeout(s),Ns.delete(t),i({type:e,...n});return}switch(e){case"output":ca("output",{sessionId:n.sessionId,enc:n.enc,replay:n.replay===!0,data:n.enc==="b64"?n.data:Buffer.from(n.data,"base64")});break;case"sessionClosed":ca("sessionClosed",n.sessionId);break;case"cwdChange":ca("cwdChange",{sessionId:n.sessionId,cwd:n.cwd});break;case"pong":break;default:console.log("[DaemonClient] Unknown message:",e)}}function Ul(){return new Promise(r=>{let e=ql.default.connect(aa),t=setTimeout(()=>{e.destroy(),r(!1)},1e3);e.on("connect",()=>{clearTimeout(t),e.destroy(),r(!0)}),e.on("error",()=>{if(clearTimeout(t),process.platform!=="win32"&&ce.default.existsSync(aa))try{ce.default.unlinkSync(aa)}catch{}r(!1)})})}function hj(){ce.default.existsSync(wn)||ce.default.mkdirSync(wn,{recursive:!0});let r=ce.default.existsSync(wS)?wS:ce.default.existsSync(SS)?SS:null;if(!r)return console.error("[DaemonClient] \u274C Daemon script not found"),null;let e=uj(r);return e||{script:r,cwd:Nh}}async function mj(){if(!ce.default.existsSync(wn))try{ce.default.mkdirSync(wn,{recursive:!0})}catch(a){return console.error("[DaemonClient] Failed to create socket directory:",a.message),!1}let r=hj();if(!r)return!1;let{script:e,cwd:t}=r,n=he.default.join(wn,"logs");try{ce.default.mkdirSync(n,{recursive:!0})}catch{}let i=he.default.join(n,"daemon.log"),s;try{s=ce.default.openSync(i,"w")}catch(a){console.error("[DaemonClient] Failed to open log file:",a.message),s="ignore"}if((0,TS.spawn)("node",[e],{detached:!0,stdio:["ignore",s,s],cwd:t}).unref(),typeof s=="number")try{ce.default.closeSync(s)}catch{}for(let a=0;a<20;a++)if(await new Promise(c=>setTimeout(c,100)),await Ul())return!0;console.error("[DaemonClient] \u274C Failed to start daemon");try{let a=ce.default.readFileSync(i,"utf8");a.trim()&&(console.error("[DaemonClient] Daemon log:"),console.error(a))}catch{}return!1}function gj(){return new Promise(r=>{let e=ql.default.connect(aa),t="",n=s=>{try{e.destroy()}catch{}r(s)},i=setTimeout(()=>n(null),2e3);e.on("connect",()=>e.write(JSON.stringify({type:"ping",requestId:-1})+`
|
|
115
115
|
`)),e.on("data",s=>{t+=s.toString();let o=t.indexOf(`
|
|
116
|
-
`);if(o!==-1){clearTimeout(i);try{let a=JSON.parse(t.slice(0,o));n(a.version||"unknown")}catch{n(null)}}}),e.on("error",()=>{clearTimeout(i),n(null)})})}async function
|
|
117
|
-
`);Ih=n.pop()||"";for(let i of n)if(i.trim())try{
|
|
116
|
+
`);if(o!==-1){clearTimeout(i);try{let a=JSON.parse(t.slice(0,o));n(a.version||"unknown")}catch{n(null)}}}),e.on("error",()=>{clearTimeout(i),n(null)})})}async function vj(){try{let r=he.default.join(wn,"pids","ptyDaemon.pid"),e=parseInt(ce.default.readFileSync(r,"utf8").trim(),10);Number.isFinite(e)&&e>0&&process.kill(e,"SIGTERM")}catch{}for(let r=0;r<20;r++){if(!await Ul())return;await new Promise(e=>setTimeout(e,100))}}async function AS(){if(!(Is||Vn)){Vn=!0;try{if(await Ul()){let r=await gj();r!==oa&&(console.log(`[DaemonClient] Daemon v${r} != v${oa}, restarting`),await vj())}return!await Ul()&&!await mj()?(console.error("[DaemonClient] \u274C Failed to start daemon"),Vn=!1,!1):new Promise(r=>{let e=setTimeout(()=>{console.error("[DaemonClient] \u274C Connection timeout after 5s"),zr&&zr.destroy(),Vn=!1,r(!1)},5e3);zr=ql.default.connect(aa),zr.on("connect",()=>{clearTimeout(e),Is=!0,Vn=!1,ca("connected"),r(!0)}),zr.on("data",t=>{Ih+=t.toString();let n=Ih.split(`
|
|
117
|
+
`);Ih=n.pop()||"";for(let i of n)if(i.trim())try{dj(JSON.parse(i))}catch{console.error("[DaemonClient] Invalid message:",i)}}),zr.on("close",()=>{Is=!1,zr=null,ca("disconnected"),setTimeout(()=>{!Is&&!Vn&&AS()},2e3)}),zr.on("error",t=>{clearTimeout(e),console.error("[DaemonClient] \u274C Connection error:",t.message),console.error("[DaemonClient] Error code:",t.code),Vn=!1,r(!1)})})}catch(r){return console.error("[DaemonClient] \u274C Connect error:",r),Vn=!1,!1}}}async function RS(){return AS()}function It(){return Is}async function $l(){return(await Ds({type:"listSessions"})).sessions||[]}async function Hl(r,e=80,t=24,n=null,i=`session-${Date.now()}`,s=null){return await Ds({type:"createSession",sessionId:i,name:r,cols:e,rows:t,shellId:n,cwd:s})}async function OS(r){try{return(await Ds({type:"getCwd",sessionId:r})).cwd||null}catch{return null}}async function Lh(r){return await Ds({type:"joinSession",sessionId:r})}async function MS(r,e){return await Ds({type:"requestHistory",sessionId:r,have:e})}function Wl(r,e){return Dh({type:"input",sessionId:r,data:e})}function PS(r,e,t){return Dh({type:"resize",sessionId:r,cols:e,rows:t})}async function bi(r){return await Ds({type:"deleteSession",sessionId:r})}var cE=W(require("crypto"),1);_i();ri();var NS=require("child_process");dt();var yj={darwin:()=>({cmd:"caffeinate",args:["-u","-t",String(H.displayWake.macDurationSec)]}),linux:()=>({cmd:"xset",args:["dpms","force","on"]}),win32:()=>({cmd:"powershell.exe",args:["-NonInteractive","-NoProfile","-WindowStyle","Hidden","-Command",`Add-Type -Name K -Namespace W -MemberDefinition '[System.Runtime.InteropServices.DllImport("kernel32")]public static extern uint SetThreadExecutionState(uint e);'; [void][W.K]::SetThreadExecutionState(0x80000003)`]})},IS=0;function DS(){let r=H.displayWake;if(!r?.enabled)return;let e=Date.now();if(e-IS<r.throttleMs)return;IS=e;let t=yj[process.platform];if(t)try{let{cmd:n,args:i}=t(),s=(0,NS.spawn)(n,i,{detached:!0,stdio:"ignore",windowsHide:!0});s.on("error",()=>{}),s.unref()}catch{}}dt();var LS=require("child_process");function xj(){switch(process.platform){case"darwin":return{file:"pbpaste",args:[]};case"win32":return{file:"powershell",args:["-NoProfile","-Command","Get-Clipboard -Raw"]};case"linux":return null;default:return null}}var Ls;function _j(){return Ls!==void 0||(process.env.WAYLAND_DISPLAY?Ls={file:"wl-paste",args:["--no-newline"]}:process.env.DISPLAY?Ls={file:"xclip",args:["-selection","clipboard","-o"]}:Ls=null),Ls}var bj=[{file:"xsel",args:["--clipboard","--output"]}];function BS(r){return new Promise(e=>{let t=xj();process.platform==="linux"&&(t=_j());let n=(i,s=[])=>{if(!i){e(null);return}(0,LS.execFile)(i.file,i.args,{timeout:1500,maxBuffer:1024*1024,windowsHide:!0},(o,a)=>{if(o){if(o.code==="ENOENT"&&s.length>0){let[l,...u]=s;n(l,u);return}e(null);return}let c=a.endsWith(`\r
|
|
118
118
|
`)?a.slice(0,-2):a.endsWith(`
|
|
119
|
-
`)?a.slice(0,-1):a;c.length>r&&(c=c.slice(0,r)),c=c.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g,""),e(c.length>0?c:null)})};n(t,process.platform==="linux"&&process.env.DISPLAY?gj:[])})}var zh=Fr("remote"),bn=null;function wj(){return process.env.CODESPACES==="true"||process.env.GITPOD_WORKSPACE_ID||process.platform==="linux"&&!process.env.DISPLAY}async function oE(){if(bn!==null)return bn;if(wj())return bn=!1,zh.info("\u2705 Remote desktop not available (headless environment)"),bn;try{let r=await import("@hurdlegroup/robotjs");(r.default||r).getScreenSize(),bn=!0}catch{bn=!1,zh.info("\u2705 Remote desktop not available (no display or robotjs not installed)")}return bn}function Xl(){return bn===!0}function aE(){return Vr}var Si=null,Vh=null,Kh=null,cE=null,lE=null,uE=null,pE=null,Vr=null,tE=null,rE=null,nE=null,iE=null;async function Sj(){if(Si&&Vh&&Kh)return!0;try{let r=await import("@hurdlegroup/robotjs");Si=r.default||r;let{TileManager:e}=await Promise.resolve().then(()=>(GS(),WS)),{ResourceManager:t}=await Promise.resolve().then(()=>(VS(),zS)),{ScreenUpdateHelper:n}=await Promise.resolve().then(()=>(YS(),KS)),{MouseHandler:i}=await Promise.resolve().then(()=>(JS(),XS)),{KeyboardHandler:s}=await Promise.resolve().then(()=>(eE(),QS)),{ScreenHandler:o}=await Promise.resolve().then(()=>(Rh(),mS));return Vh=e,Kh=t,cE=n,lE=i,uE=s,pE=o,Si.setMouseDelay(2),Si.setKeyboardDelay(2),!0}catch(r){return console.error("\u274C Failed to load remote modules:",r.message),!1}}async function fE(r,e){if(!bn){r.emit("remote:unavailable");return}if(!await Sj()){r.emit("remote:unavailable");return}Vr||(Vr=new Kh,tE=new cE(Vr),rE=new lE(Si,Vr),nE=new uE(Si,Vr),iE=new pE(Vr,tE),Vr.startResourceMonitoring());let n=r.data.protocol;if(!n){r.emit("remote:unavailable");return}let i=r.handshake.auth?.apiKey,s=new Vh(Si);Vr.addClient(r.id,{tileManager:s,protocol:n,screenInterval:null,authenticated:!0,apiKey:i}),r.data.remoteAttached=!0;let o=d=>(...g)=>(PS(),d(...g));rE.setupMouseHandlers(r,o),nE.setupKeyboardHandlers(r,o),iE.setupScreenHandlers(r,o,n),r.on("disconnect",()=>{let d=n._adapters?.get("rtc"),g=!1,y=null,b=null,C=()=>{g||(g=!0,y&&(clearTimeout(y),y=null),d&&b&&d.off("stateChange",b),f&&(clearInterval(f),f=null),Vr.removeClient(r.id),n.close(),Ps(n))};if(!d?.ready)return C();b=R=>{R===ct.closed&&C()},d.on("stateChange",b),y=setTimeout(C,H.resourceManagement.disconnectGraceMs)}),r.emit("remote:ready");let a=-1,c="",l=!1,u=async()=>{try{let d=await NS(H.clipboard.maxTextLength),g=d==null?0:d.length,y=d==null?"":sE.default.createHash("md5").update(d).digest("hex");if(g===a&&y===c)return;if(a=g,c=y,!l){l=!0;return}d!=null&&n.emit("clipboard-update",{text:d,hash:y})}catch(d){zh.error(`clipboard poll: ${d.message}`)}},f=null;H.clipboard.enabled&&(u(),f=setInterval(u,H.clipboard.pollInterval))}xn();var Vn=W(require("fs"),1),Yh=W(require("path"),1),Jl=0,ua=null,Ej=6e4,Tj={name:"9Remote",postCreateCommand:"npm install -g 9remote@latest",postAttachCommand:"9remote start",forwardPorts:[2208],portsAttributes:{2208:{label:"9Remote Server",onAutoForward:"notify"}}};function Kr(){return process.env.CODESPACES==="true"}function dE(){return Kr()?{isCodespaces:!0,codespaceName:process.env.CODESPACE_NAME||"unknown",workspacePath:process.env.CODESPACE_VSCODE_FOLDER||process.cwd()}:null}function hE(){Jl++,Kr()&&Jl===1&&Cj()}function mE(){Jl--,Kr()&&Jl===0&&Aj()}function Cj(){ua||(ua=setInterval(()=>{process.memoryUsage()},Ej))}function Aj(){ua&&(console.log("\u23F8\uFE0F Stopping Codespaces heartbeat"),clearInterval(ua),ua=null)}function gE(r){return Yh.default.join(r,".devcontainer","devcontainer.json")}function vE(r){try{let e=gE(r);if(!Vn.default.existsSync(e))return{enabled:!1,exists:!1};let t=JSON.parse(Vn.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 yE(r,e){try{let t=Yh.default.join(r,".devcontainer"),n=gE(r);Vn.default.existsSync(t)||Vn.default.mkdirSync(t,{recursive:!0});let i={...Tj};if(Vn.default.existsSync(n))try{i={...JSON.parse(Vn.default.readFileSync(n,"utf8"))}}catch{}return e?(i.postAttachCommand="9remote start",i.postCreateCommand||(i.postCreateCommand="npm install -g 9remote@latest")):delete i.postAttachCommand,Vn.default.writeFileSync(n,JSON.stringify(i,null,2)),{success:!0,enabled:e}}catch(t){return{success:!1,error:t.message}}}var Zl=W(require("os"),1),Me=W(require("fs"),1),Kn=W(require("path"),1);St();var Fs=se.BUFFERS,Ql=Kn.default.join(se.STATE,"sessions.json"),eu=Kn.default.join(se.STATE,"terminalGroups.json"),pa="/tmp/9remote-uploads";Me.default.existsSync(pa)||Me.default.mkdirSync(pa,{recursive:!0});function Xh(){return process.platform==="win32"?process.env.COMSPEC||"powershell.exe":process.env.SHELL||"/bin/zsh"}function tu(r){return r?"/workspaces":Zl.default.homedir()}function Jh(){let r=Zl.default.homedir(),e=Zl.default.userInfo().username,t=Xh(),n={...process.env};if(delete n.PORT,Object.assign(n,{HOME:r,USER:e,LOGNAME:e,SHELL:t,TERM:"xterm-256color",COLORTERM:"truecolor",LANG:"en_US.UTF-8",LC_ALL:"en_US.UTF-8",LC_CTYPE:"en_US.UTF-8",PWD:r,OLDPWD:r,TMPDIR:n.TMPDIR||(process.platform==="win32"?n.TEMP||n.TMP:"/tmp"),__CF_USER_TEXT_ENCODING:n.__CF_USER_TEXT_ENCODING,XPC_FLAGS:n.XPC_FLAGS,XPC_SERVICE_NAME:n.XPC_SERVICE_NAME,SSH_AUTH_SOCK:n.SSH_AUTH_SOCK,TERM_PROGRAM:"9Remote",TERM_PROGRAM_VERSION:"1.0.0",ITERM_SESSION_ID:`9remote-${Date.now()}`,SHLVL:"1"}),t.includes("bash")){let i=n.PROMPT_COMMAND||"";n.PROMPT_COMMAND=`printf "\\e]7;file://%s\\a" "\${HOSTNAME}\${PWD}"${i?`; ${i}`:""}`}return n}function xE(){Me.default.existsSync(Fs)||Me.default.mkdirSync(Fs,{recursive:!0})}function Zh(r,e,t){if(t==="buffer"){xE();try{Me.default.writeFileSync(Kn.default.join(Fs,`${r}.buf`),e.join(""),"utf8")}catch(n){console.log(`\u26A0\uFE0F Failed to save buffer for ${r}:`,n.message)}}}function _E(r,e){if(e!=="buffer")return null;let t=Kn.default.join(Fs,`${r}.buf`);try{if(Me.default.existsSync(t))return Me.default.readFileSync(t,"utf8")}catch(n){console.log(`\u26A0\uFE0F Failed to load buffer for ${r}:`,n.message)}return null}function ru(r){let e=Kn.default.join(Fs,`${r}.buf`);try{Me.default.existsSync(e)&&Me.default.unlinkSync(e)}catch{}}function bE(){xE();try{return Me.default.readdirSync(Fs).filter(r=>r.endsWith(".buf")).map(r=>r.replace(".buf",""))}catch{return[]}}function Qh(){try{if(Me.default.existsSync(Ql))return JSON.parse(Me.default.readFileSync(Ql,"utf8"))}catch(r){console.log("\u26A0\uFE0F Failed to load session metadata:",r.message)}return{}}function kj(r){return{name:r.name,createdAt:r.createdAt,shellId:r.shellId,cwd:r.cwd,cols:r.lastCols??r.cols??null,rows:r.lastRows??r.rows??null}}function er(r){try{let e={};for(let[n,i]of r)e[n]=kj(i);let t=Kn.default.dirname(Ql);Me.default.existsSync(t)||Me.default.mkdirSync(t,{recursive:!0}),Me.default.writeFileSync(Ql,JSON.stringify(e,null,2),"utf8")}catch(e){console.log("\u26A0\uFE0F Failed to save session metadata:",e.message)}}function wE(){try{if(Me.default.existsSync(eu)){let r=JSON.parse(Me.default.readFileSync(eu,"utf8"));return{groups:r.groups||[],sessionGroups:r.sessionGroups||{},sessionOrder:r.sessionOrder||[]}}}catch(r){console.log("\u26A0\uFE0F Failed to load groups:",r.message)}return{groups:[],sessionGroups:{},sessionOrder:[]}}function SE(r,e,t=[]){try{let n=Kn.default.dirname(eu);Me.default.existsSync(n)||Me.default.mkdirSync(n,{recursive:!0});let i={groups:Array.from(r.values()),sessionGroups:e,sessionOrder:t};Me.default.writeFileSync(eu,JSON.stringify(i,null,2),"utf8")}catch(n){console.log("\u26A0\uFE0F Failed to save groups:",n.message)}}var em=W(require("node-pty"),1);_i();var AE=W(require("fs"),1);var EE=2*1024*1024,Rj=256*1024,wn="daemon",Oj=80,Mj=24,Pj=10,Ij=2;function TE(r){let e=r?.lastCols,t=r?.lastRows;return Number.isInteger(e)&&Number.isInteger(t)&&e>=Pj&&t>=Ij?{cols:e,rows:t}:{cols:Oj,rows:Mj}}function kE(r,e){if(!r?.length||e<=0)return"";let t=e,n=[];for(let s=r.length-1;s>=0&&t>0;s--){let o=r[s];o.length<=t?(n.push(o),t-=o.length):(n.push(o.slice(o.length-t)),t=0)}n.reverse();let i=n.join("");if(i.length>1&&i.charCodeAt(0)!==27){let s=Math.min(i.length,512);for(let o=1;o<s;o++)if(i.charCodeAt(o)===27){i=i.slice(o);break}}return i}function CE(r,e,t,n,i){let s=null;r.onData(o=>{t.buffer.push(o),t.buffer.reduce((c,l)=>c+l.length,0)>EE&&(t.buffer=[kE(t.buffer,EE)]),ut(n,"output",{sessionId:e,data:Buffer.from(o,"utf-8")}),wn==="buffer"&&(s&&clearTimeout(s),s=setTimeout(()=>Zh(e,t.buffer,wn),2e3))}),r.onExit(({exitCode:o})=>{console.log(`PTY exited: sessionId=${e}, code=${o}`),wn==="buffer"&&t.buffer.length>0&&Zh(e,t.buffer,wn),i.delete(e),ru(e),ut(n,"sessionClosed",e)})}function RE(r,e,t,n,i,s=[]){let o=()=>SE(n,i,s);r.on("getSessions",async a=>{let c=[],l=wn==="daemon"&&It();for(let[f,d]of t){let g=d.cwd;if(l&&d.daemon){let y=await AS(f);y&&(g=y,d.cwd!==y&&(d.cwd=y))}c.push({id:f,name:d.name,createdAt:d.createdAt,restored:d.restored||!1,shellId:d.shellId,shellLabel:d.shellLabel,groupId:i[f]||null,cwd:g})}let u=new Map(s.map((f,d)=>[f,d]));c.sort((f,d)=>(u.has(f.id)?u.get(f.id):1/0)-(u.has(d.id)?u.get(d.id):1/0)),a(c)}),r.on("getShells",a=>{a({platform:process.platform,shells:vS()})}),r.on("getGroups",a=>{a(Array.from(n.values()))}),r.on("createGroup",({name:a},c)=>{let l=`group-${Date.now()}`,u={id:l,name:a||"Group",createdAt:Date.now()};n.set(l,u),o(),ut(e,"groupsChanged"),c({success:!0,group:u})}),r.on("renameGroup",({groupId:a,name:c},l)=>{let u=n.get(a);if(!u)return l({success:!1,error:"Group not found"});u.name=c,o(),ut(e,"groupsChanged"),l({success:!0})}),r.on("deleteGroup",async({groupId:a},c)=>{if(!n.delete(a))return c({success:!1,error:"Group not found"});let l=Object.keys(i).filter(u=>i[u]===a);for(let u of l){let f=t.get(u);if(f){if(f.daemon&&It())try{await bi(u)}catch{}else f.pty&&(f.pty.kill(),ru(u));t.delete(u),ut(e,"sessionClosed",u)}delete i[u]}o(),ut(e,"groupsChanged"),c({success:!0})}),r.on("moveSession",({sessionId:a,groupId:c},l)=>{c&&n.has(c)?i[a]=c:delete i[a],o(),ut(e,"groupsChanged"),l({success:!0})}),r.on("reorderSession",({orderedIds:a},c)=>{if(!Array.isArray(a))return c?.({success:!1,error:"orderedIds required"});let l=new Set(a),u=s.filter(d=>!l.has(d)),f=[...t.keys()].filter(d=>!l.has(d)&&!u.includes(d));s.length=0,s.push(...u,...f,...a),o(),ut(e,"groupsChanged"),c?.({success:!0})}),r.on("createSession",async({name:a,shellId:c,groupId:l,cwd:u},f)=>{let d=`session-${Date.now()}`,g=yS(c),y=Jh();y.NINE_REMOTE_SESSION_ID=d;let b=u&&AE.default.existsSync(u)?u:tu(Kr());try{let C=a||`Term ${t.size+1}`;if(wn==="daemon"&&It()){let P=await Hl(C,80,24,c,d,b);P.success?(t.set(P.sessionId,{daemon:!0,name:C,createdAt:Date.now(),cwd:P.cwd,shellId:P.shellId,shellLabel:P.shellLabel}),l&&n.has(l)&&(i[P.sessionId]=l,o()),er(t),f({success:!0,sessionId:P.sessionId,shellLabel:P.shellLabel})):f({success:!1,error:P.error});return}let R=em.default.spawn(g.path,g.args,{name:"xterm-256color",cols:80,rows:24,cwd:b,env:y,useConpty:!1}),M={pty:R,name:C,createdAt:Date.now(),buffer:[],cwd:b,shellId:g.id,shellLabel:g.label};CE(R,d,M,e,t),t.set(d,M),l&&n.has(l)&&(i[d]=l,o()),f({success:!0,sessionId:d,shellLabel:g.label})}catch(C){console.error("Failed to create session:",C),f({success:!1,error:C.message})}}),r.on("joinSession",async(a,c)=>{let l=typeof a=="string"?a:a?.sessionId,u=typeof a=="object"?a?.cols:void 0,f=typeof a=="object"?a?.rows:void 0,d=t.get(l);if(!d&&wn==="daemon"&&It()){let g=`Term ${t.size+1}`,y=tu(Kr()),{cols:b,rows:C}=TE({lastCols:u,lastRows:f}),R=await Hl(g,b,C,void 0,l,y);if(!R.success)return c({success:!1,error:R.error});d={daemon:!0,name:g,createdAt:Date.now(),cwd:R.cwd,shellId:R.shellId,shellLabel:R.shellLabel,lastCols:b,lastRows:C},t.set(l,d),er(t);let M=await Lh(l);return c({success:M.success,name:d.name,cwd:M.cwd||d.cwd,recreated:!0,error:M.error})}if(!d)return c({success:!1,error:"Session not found"});if(d.daemon&&It()){try{if(d.needsRespawn){let{cols:y,rows:b}=TE({lastCols:u??d.lastCols,lastRows:f??d.lastRows}),C=await Hl(d.name,y,b,d.shellId,l,d.cwd);if(!C.success)return c({success:!1,error:C.error});delete d.needsRespawn,d.cwd=C.cwd,d.shellLabel=C.shellLabel,d.lastCols=y,d.lastRows=b,er(t)}let g=await Lh(l);g.cwd&&g.cwd!==d.cwd&&(d.cwd=g.cwd,er(t)),c({success:g.success,name:d.name,cwd:g.cwd||d.cwd,total:g.total||0,replaySize:g.replaySize||0,error:g.error})}catch(g){c({success:!1,error:g.message})}return}if(d.needsRestore&&wn==="buffer")try{let g=Xh(),y=process.platform==="win32"?[]:["-l"],b=tu(Kr()),C=em.default.spawn(g,y,{name:"xterm-256color",cols:80,rows:24,cwd:b,env:Jh(),useConpty:!1});d.pty=C,d.needsRestore=!1,d.cwd=b;let R=_E(l,wn);R&&(d.buffer=[R]),CE(C,l,d,e,t),console.log(`\u2705 Restored PTY session: ${l}`)}catch(g){return console.error("Failed to restore session:",g),c({success:!1,error:"Failed to restore session"})}d.buffer?.length>0&&r.emit("output",{sessionId:l,data:Buffer.from(kE(d.buffer,Rj),"utf-8")}),c({success:!0,name:d.name,cwd:d.cwd})}),r.on("requestHistory",async({sessionId:a,have:c}={},l)=>{let u=t.get(a);if(!u)return l?.({success:!1,error:"Session not found"});if(!u.daemon||!It())return l?.({success:!1,error:"History unavailable"});try{let f=await kS(a,c||0);if(!f.success)return l?.({success:!1,error:f.error});f.prefix&&r.emit("output",{sessionId:a,enc:"b64",isHistoryPrefix:!0,data:f.prefix}),l?.({success:!0,prefixLen:f.prefixLen||0,total:f.total||0,remaining:f.remaining||0})}catch(f){l?.({success:!1,error:f.message})}}),r.on("deleteSession",async(a,c)=>{let l=t.get(a);if(!l)return c({success:!1,error:"Session not found"});if(l.daemon&&It()){try{await bi(a),t.delete(a),i[a]&&(delete i[a],o()),er(t),c({success:!0})}catch(u){c({success:!1,error:u.message})}return}l.pty&&l.pty.kill(),t.delete(a),i[a]&&(delete i[a],o()),ru(a),ut(e,"sessionClosed",a),er(t),c({success:!0})}),r.on("renameSession",async({sessionId:a,name:c},l)=>{let u=t.get(a);if(!u)return l({success:!1,error:"Session not found"});u.name=c,ut(e,"session-renamed",{sessionId:a,name:c}),er(t),l({success:!0})})}var rm=require("child_process");function Sn(r,e,t){return new Promise((n,i)=>{let s=(0,rm.spawn)(r,e,{stdio:["pipe","ignore","pipe"]}),o="";s.stderr&&s.stderr.on("data",a=>{o+=a.toString()}),s.on("error",i),s.on("close",a=>a===0?n():i(new Error(o.trim()||`${r} exited ${a}`))),t!=null&&s.stdin.write(t),s.stdin.end()})}function tm(r,e){return new Promise((t,n)=>{let i=(0,rm.spawn)(r,e,{stdio:["ignore","pipe","pipe"]}),s="",o="";i.stdout&&i.stdout.on("data",a=>{s+=a.toString()}),i.stderr&&i.stderr.on("data",a=>{o+=a.toString()}),i.on("error",n),i.on("close",a=>a===0?t(s):n(new Error(o.trim()||`${r} exited ${a}`)))})}var Nj=r=>typeof r=="string"&&r.startsWith("image/"),Dj={darwin:{image:r=>Sn("osascript",["-e",`set the clipboard to (read (POSIX file ${JSON.stringify(r)}) as \xABclass PNGf\xBB)`]),file:r=>Sn("osascript",["-e",`set the clipboard to POSIX file ${JSON.stringify(r)}`])},linux:{image:r=>Sn("xclip",["-selection","clipboard","-t","image/png","-i",r]),file:r=>Sn("xclip",["-selection","clipboard","-t","text/uri-list","-i"],`file://${r}
|
|
120
|
-
`)},win32:{image:r=>
|
|
121
|
-
`)}async function
|
|
119
|
+
`)?a.slice(0,-1):a;c.length>r&&(c=c.slice(0,r)),c=c.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g,""),e(c.length>0?c:null)})};n(t,process.platform==="linux"&&process.env.DISPLAY?bj:[])})}var zh=Fr("remote"),Sn=null;function kj(){return process.env.CODESPACES==="true"||process.env.GITPOD_WORKSPACE_ID||process.platform==="linux"&&!process.env.DISPLAY}async function lE(){if(Sn!==null)return Sn;if(kj())return Sn=!1,zh.info("\u2705 Remote desktop not available (headless environment)"),Sn;try{let r=await import("@hurdlegroup/robotjs");(r.default||r).getScreenSize(),Sn=!0}catch{Sn=!1,zh.info("\u2705 Remote desktop not available (no display or robotjs not installed)")}return Sn}function Xl(){return Sn===!0}function uE(){return Vr}var Si=null,Vh=null,Kh=null,pE=null,fE=null,dE=null,hE=null,Vr=null,iE=null,sE=null,oE=null,aE=null;async function Aj(){if(Si&&Vh&&Kh)return!0;try{let r=await import("@hurdlegroup/robotjs");Si=r.default||r;let{TileManager:e}=await Promise.resolve().then(()=>(KS(),VS)),{ResourceManager:t}=await Promise.resolve().then(()=>(XS(),YS)),{ScreenUpdateHelper:n}=await Promise.resolve().then(()=>(ZS(),JS)),{MouseHandler:i}=await Promise.resolve().then(()=>(eE(),QS)),{KeyboardHandler:s}=await Promise.resolve().then(()=>(nE(),rE)),{ScreenHandler:o}=await Promise.resolve().then(()=>(Rh(),yS));return Vh=e,Kh=t,pE=n,fE=i,dE=s,hE=o,Si.setMouseDelay(2),Si.setKeyboardDelay(2),!0}catch(r){return console.error("\u274C Failed to load remote modules:",r.message),!1}}async function mE(r,e){if(!Sn){r.emit("remote:unavailable");return}if(!await Aj()){r.emit("remote:unavailable");return}Vr||(Vr=new Kh,iE=new pE(Vr),sE=new fE(Si,Vr),oE=new dE(Si,Vr),aE=new hE(Vr,iE),Vr.startResourceMonitoring());let n=r.data.protocol;if(!n){r.emit("remote:unavailable");return}let i=r.handshake.auth?.apiKey,s=new Vh(Si);Vr.addClient(r.id,{tileManager:s,protocol:n,screenInterval:null,authenticated:!0,apiKey:i}),r.data.remoteAttached=!0;let o=d=>(...g)=>(DS(),d(...g));sE.setupMouseHandlers(r,o),oE.setupKeyboardHandlers(r,o),aE.setupScreenHandlers(r,o,n),r.on("disconnect",()=>{let d=n._adapters?.get("rtc"),g=!1,y=null,b=null,C=()=>{g||(g=!0,y&&(clearTimeout(y),y=null),d&&b&&d.off("stateChange",b),f&&(clearInterval(f),f=null),Vr.removeClient(r.id),n.close(),Ps(n))};if(!d?.ready)return C();b=R=>{R===ct.closed&&C()},d.on("stateChange",b),y=setTimeout(C,H.resourceManagement.disconnectGraceMs)}),r.emit("remote:ready");let a=-1,c="",l=!1,u=async()=>{try{let d=await BS(H.clipboard.maxTextLength),g=d==null?0:d.length,y=d==null?"":cE.default.createHash("md5").update(d).digest("hex");if(g===a&&y===c)return;if(a=g,c=y,!l){l=!0;return}d!=null&&n.emit("clipboard-update",{text:d,hash:y})}catch(d){zh.error(`clipboard poll: ${d.message}`)}},f=null;H.clipboard.enabled&&(u(),f=setInterval(u,H.clipboard.pollInterval))}bn();var Kn=W(require("fs"),1),Yh=W(require("path"),1),Jl=0,ua=null,Rj=6e4,Oj={name:"9Remote",postCreateCommand:"npm install -g 9remote@latest",postAttachCommand:"9remote start",forwardPorts:[2208],portsAttributes:{2208:{label:"9Remote Server",onAutoForward:"notify"}}};function Kr(){return process.env.CODESPACES==="true"}function gE(){return Kr()?{isCodespaces:!0,codespaceName:process.env.CODESPACE_NAME||"unknown",workspacePath:process.env.CODESPACE_VSCODE_FOLDER||process.cwd()}:null}function vE(){Jl++,Kr()&&Jl===1&&Mj()}function yE(){Jl--,Kr()&&Jl===0&&Pj()}function Mj(){ua||(ua=setInterval(()=>{process.memoryUsage()},Rj))}function Pj(){ua&&(console.log("\u23F8\uFE0F Stopping Codespaces heartbeat"),clearInterval(ua),ua=null)}function xE(r){return Yh.default.join(r,".devcontainer","devcontainer.json")}function _E(r){try{let e=xE(r);if(!Kn.default.existsSync(e))return{enabled:!1,exists:!1};let t=JSON.parse(Kn.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 bE(r,e){try{let t=Yh.default.join(r,".devcontainer"),n=xE(r);Kn.default.existsSync(t)||Kn.default.mkdirSync(t,{recursive:!0});let i={...Oj};if(Kn.default.existsSync(n))try{i={...JSON.parse(Kn.default.readFileSync(n,"utf8"))}}catch{}return e?(i.postAttachCommand="9remote start",i.postCreateCommand||(i.postCreateCommand="npm install -g 9remote@latest")):delete i.postAttachCommand,Kn.default.writeFileSync(n,JSON.stringify(i,null,2)),{success:!0,enabled:e}}catch(t){return{success:!1,error:t.message}}}var Zl=W(require("os"),1),me=W(require("fs"),1),Yr=W(require("path"),1);St();var Fs=ie.BUFFERS,Ql=Yr.default.join(ie.STATE,"sessions.json"),eu=Yr.default.join(ie.STATE,"terminalGroups.json"),Xh=Yr.default.join(ie.STATE,"notes"),pa="/tmp/9remote-uploads";me.default.existsSync(pa)||me.default.mkdirSync(pa,{recursive:!0});function Jh(){return process.platform==="win32"?process.env.COMSPEC||"powershell.exe":process.env.SHELL||"/bin/zsh"}function tu(r){return r?"/workspaces":Zl.default.homedir()}function Zh(){let r=Zl.default.homedir(),e=Zl.default.userInfo().username,t=Jh(),n={...process.env};if(delete n.PORT,Object.assign(n,{HOME:r,USER:e,LOGNAME:e,SHELL:t,TERM:"xterm-256color",COLORTERM:"truecolor",LANG:"en_US.UTF-8",LC_ALL:"en_US.UTF-8",LC_CTYPE:"en_US.UTF-8",PWD:r,OLDPWD:r,TMPDIR:n.TMPDIR||(process.platform==="win32"?n.TEMP||n.TMP:"/tmp"),__CF_USER_TEXT_ENCODING:n.__CF_USER_TEXT_ENCODING,XPC_FLAGS:n.XPC_FLAGS,XPC_SERVICE_NAME:n.XPC_SERVICE_NAME,SSH_AUTH_SOCK:n.SSH_AUTH_SOCK,TERM_PROGRAM:"9Remote",TERM_PROGRAM_VERSION:"1.0.0",ITERM_SESSION_ID:`9remote-${Date.now()}`,SHLVL:"1"}),t.includes("bash")){let i=n.PROMPT_COMMAND||"";n.PROMPT_COMMAND=`printf "\\e]7;file://%s\\a" "\${HOSTNAME}\${PWD}"${i?`; ${i}`:""}`}return n}function wE(){me.default.existsSync(Fs)||me.default.mkdirSync(Fs,{recursive:!0})}function Qh(r,e,t){if(t==="buffer"){wE();try{me.default.writeFileSync(Yr.default.join(Fs,`${r}.buf`),e.join(""),"utf8")}catch(n){console.log(`\u26A0\uFE0F Failed to save buffer for ${r}:`,n.message)}}}function SE(r,e){if(e!=="buffer")return null;let t=Yr.default.join(Fs,`${r}.buf`);try{if(me.default.existsSync(t))return me.default.readFileSync(t,"utf8")}catch(n){console.log(`\u26A0\uFE0F Failed to load buffer for ${r}:`,n.message)}return null}function ru(r){let e=Yr.default.join(Fs,`${r}.buf`);try{me.default.existsSync(e)&&me.default.unlinkSync(e)}catch{}}function EE(){wE();try{return me.default.readdirSync(Fs).filter(r=>r.endsWith(".buf")).map(r=>r.replace(".buf",""))}catch{return[]}}function em(){try{if(me.default.existsSync(Ql))return JSON.parse(me.default.readFileSync(Ql,"utf8"))}catch(r){console.log("\u26A0\uFE0F Failed to load session metadata:",r.message)}return{}}function Ij(r){return{name:r.name,createdAt:r.createdAt,shellId:r.shellId,cwd:r.cwd,cols:r.lastCols??r.cols??null,rows:r.lastRows??r.rows??null}}function er(r){try{let e={};for(let[n,i]of r)e[n]=Ij(i);let t=Yr.default.dirname(Ql);me.default.existsSync(t)||me.default.mkdirSync(t,{recursive:!0}),me.default.writeFileSync(Ql,JSON.stringify(e,null,2),"utf8")}catch(e){console.log("\u26A0\uFE0F Failed to save session metadata:",e.message)}}function TE(){try{if(me.default.existsSync(eu)){let r=JSON.parse(me.default.readFileSync(eu,"utf8"));return{groups:r.groups||[],sessionGroups:r.sessionGroups||{},sessionOrder:r.sessionOrder||[]}}}catch(r){console.log("\u26A0\uFE0F Failed to load groups:",r.message)}return{groups:[],sessionGroups:{},sessionOrder:[]}}function CE(r,e,t=[]){try{let n=Yr.default.dirname(eu);me.default.existsSync(n)||me.default.mkdirSync(n,{recursive:!0});let i={groups:Array.from(r.values()),sessionGroups:e,sessionOrder:t};me.default.writeFileSync(eu,JSON.stringify(i,null,2),"utf8")}catch(n){console.log("\u26A0\uFE0F Failed to save groups:",n.message)}}var Nj=64*1024;function tm(r){return Yr.default.join(Xh,`${r}.json`)}function kE(r){if(!r)return"";try{let e=tm(r);if(!me.default.existsSync(e))return"";let t=JSON.parse(me.default.readFileSync(e,"utf8"));return typeof t.text=="string"?t.text:""}catch(e){return console.log("\u26A0\uFE0F Failed to load note:",e.message),""}}function AE(r,e){if(!r)return!1;try{let t=typeof e=="string"?e:"";return Buffer.byteLength(t,"utf8")>Nj?!1:(me.default.existsSync(Xh)||me.default.mkdirSync(Xh,{recursive:!0}),me.default.writeFileSync(tm(r),JSON.stringify({text:t}),"utf8"),!0)}catch(t){return console.log("\u26A0\uFE0F Failed to save note:",t.message),!1}}function rm(r){if(r)try{let e=tm(r);me.default.existsSync(e)&&me.default.unlinkSync(e)}catch(e){console.log("\u26A0\uFE0F Failed to delete note:",e.message)}}var nm=W(require("node-pty"),1);_i();var PE=W(require("fs"),1);var RE=2*1024*1024,Dj=256*1024,En="daemon",Lj=80,Bj=24,jj=10,Fj=2;function OE(r){let e=r?.lastCols,t=r?.lastRows;return Number.isInteger(e)&&Number.isInteger(t)&&e>=jj&&t>=Fj?{cols:e,rows:t}:{cols:Lj,rows:Bj}}function IE(r,e){if(!r?.length||e<=0)return"";let t=e,n=[];for(let s=r.length-1;s>=0&&t>0;s--){let o=r[s];o.length<=t?(n.push(o),t-=o.length):(n.push(o.slice(o.length-t)),t=0)}n.reverse();let i=n.join("");if(i.length>1&&i.charCodeAt(0)!==27){let s=Math.min(i.length,512);for(let o=1;o<s;o++)if(i.charCodeAt(o)===27){i=i.slice(o);break}}return i}function ME(r,e,t,n,i){let s=null;r.onData(o=>{t.buffer.push(o),t.buffer.reduce((c,l)=>c+l.length,0)>RE&&(t.buffer=[IE(t.buffer,RE)]),ut(n,"output",{sessionId:e,data:Buffer.from(o,"utf-8")}),En==="buffer"&&(s&&clearTimeout(s),s=setTimeout(()=>Qh(e,t.buffer,En),2e3))}),r.onExit(({exitCode:o})=>{console.log(`PTY exited: sessionId=${e}, code=${o}`),En==="buffer"&&t.buffer.length>0&&Qh(e,t.buffer,En),i.delete(e),ru(e),ut(n,"sessionClosed",e)})}function NE(r,e,t,n,i,s=[]){let o=()=>CE(n,i,s);r.on("getSessions",async a=>{let c=[],l=En==="daemon"&&It();for(let[f,d]of t){let g=d.cwd;if(l&&d.daemon){let y=await OS(f);y&&(g=y,d.cwd!==y&&(d.cwd=y))}c.push({id:f,name:d.name,createdAt:d.createdAt,restored:d.restored||!1,shellId:d.shellId,shellLabel:d.shellLabel,groupId:i[f]||null,cwd:g})}let u=new Map(s.map((f,d)=>[f,d]));c.sort((f,d)=>(u.has(f.id)?u.get(f.id):1/0)-(u.has(d.id)?u.get(d.id):1/0)),a(c)}),r.on("getShells",a=>{a({platform:process.platform,shells:_S()})}),r.on("getGroups",a=>{a(Array.from(n.values()))}),r.on("createGroup",({name:a},c)=>{let l=`group-${Date.now()}`,u={id:l,name:a||"Group",createdAt:Date.now()};n.set(l,u),o(),ut(e,"groupsChanged"),c({success:!0,group:u})}),r.on("renameGroup",({groupId:a,name:c},l)=>{let u=n.get(a);if(!u)return l({success:!1,error:"Group not found"});u.name=c,o(),ut(e,"groupsChanged"),l({success:!0})}),r.on("deleteGroup",async({groupId:a},c)=>{if(!n.delete(a))return c({success:!1,error:"Group not found"});let l=Object.keys(i).filter(u=>i[u]===a);for(let u of l){let f=t.get(u);if(f){if(f.daemon&&It())try{await bi(u)}catch{}else f.pty&&(f.pty.kill(),ru(u));t.delete(u),ut(e,"sessionClosed",u)}delete i[u]}o(),ut(e,"groupsChanged"),c({success:!0})}),r.on("moveSession",({sessionId:a,groupId:c},l)=>{c&&n.has(c)?i[a]=c:delete i[a],o(),ut(e,"groupsChanged"),l({success:!0})}),r.on("reorderSession",({orderedIds:a},c)=>{if(!Array.isArray(a))return c?.({success:!1,error:"orderedIds required"});let l=new Set(a),u=s.filter(d=>!l.has(d)),f=[...t.keys()].filter(d=>!l.has(d)&&!u.includes(d));s.length=0,s.push(...u,...f,...a),o(),ut(e,"groupsChanged"),c?.({success:!0})}),r.on("createSession",async({name:a,shellId:c,groupId:l,cwd:u},f)=>{let d=`session-${Date.now()}`,g=bS(c),y=Zh();y.NINE_REMOTE_SESSION_ID=d;let b=u&&PE.default.existsSync(u)?u:tu(Kr());try{let C=a||`Term ${t.size+1}`;if(En==="daemon"&&It()){let P=await Hl(C,80,24,c,d,b);P.success?(t.set(P.sessionId,{daemon:!0,name:C,createdAt:Date.now(),cwd:P.cwd,shellId:P.shellId,shellLabel:P.shellLabel}),l&&n.has(l)&&(i[P.sessionId]=l,o()),er(t),f({success:!0,sessionId:P.sessionId,shellLabel:P.shellLabel})):f({success:!1,error:P.error});return}let R=nm.default.spawn(g.path,g.args,{name:"xterm-256color",cols:80,rows:24,cwd:b,env:y,useConpty:!1}),O={pty:R,name:C,createdAt:Date.now(),buffer:[],cwd:b,shellId:g.id,shellLabel:g.label};ME(R,d,O,e,t),t.set(d,O),l&&n.has(l)&&(i[d]=l,o()),f({success:!0,sessionId:d,shellLabel:g.label})}catch(C){console.error("Failed to create session:",C),f({success:!1,error:C.message})}}),r.on("joinSession",async(a,c)=>{let l=typeof a=="string"?a:a?.sessionId,u=typeof a=="object"?a?.cols:void 0,f=typeof a=="object"?a?.rows:void 0,d=t.get(l);if(!d&&En==="daemon"&&It()){let g=`Term ${t.size+1}`,y=tu(Kr()),{cols:b,rows:C}=OE({lastCols:u,lastRows:f}),R=await Hl(g,b,C,void 0,l,y);if(!R.success)return c({success:!1,error:R.error});d={daemon:!0,name:g,createdAt:Date.now(),cwd:R.cwd,shellId:R.shellId,shellLabel:R.shellLabel,lastCols:b,lastRows:C},t.set(l,d),er(t);let O=await Lh(l);return c({success:O.success,name:d.name,cwd:O.cwd||d.cwd,recreated:!0,error:O.error})}if(!d)return c({success:!1,error:"Session not found"});if(d.daemon&&It()){try{if(d.needsRespawn){let{cols:y,rows:b}=OE({lastCols:u??d.lastCols,lastRows:f??d.lastRows}),C=await Hl(d.name,y,b,d.shellId,l,d.cwd);if(!C.success)return c({success:!1,error:C.error});delete d.needsRespawn,d.cwd=C.cwd,d.shellLabel=C.shellLabel,d.lastCols=y,d.lastRows=b,er(t)}let g=await Lh(l);g.cwd&&g.cwd!==d.cwd&&(d.cwd=g.cwd,er(t)),c({success:g.success,name:d.name,cwd:g.cwd||d.cwd,total:g.total||0,replaySize:g.replaySize||0,error:g.error})}catch(g){c({success:!1,error:g.message})}return}if(d.needsRestore&&En==="buffer")try{let g=Jh(),y=process.platform==="win32"?[]:["-l"],b=tu(Kr()),C=nm.default.spawn(g,y,{name:"xterm-256color",cols:80,rows:24,cwd:b,env:Zh(),useConpty:!1});d.pty=C,d.needsRestore=!1,d.cwd=b;let R=SE(l,En);R&&(d.buffer=[R]),ME(C,l,d,e,t),console.log(`\u2705 Restored PTY session: ${l}`)}catch(g){return console.error("Failed to restore session:",g),c({success:!1,error:"Failed to restore session"})}d.buffer?.length>0&&r.emit("output",{sessionId:l,data:Buffer.from(IE(d.buffer,Dj),"utf-8")}),c({success:!0,name:d.name,cwd:d.cwd})}),r.on("requestHistory",async({sessionId:a,have:c}={},l)=>{let u=t.get(a);if(!u)return l?.({success:!1,error:"Session not found"});if(!u.daemon||!It())return l?.({success:!1,error:"History unavailable"});try{let f=await MS(a,c||0);if(!f.success)return l?.({success:!1,error:f.error});f.prefix&&r.emit("output",{sessionId:a,enc:"b64",isHistoryPrefix:!0,data:f.prefix}),l?.({success:!0,prefixLen:f.prefixLen||0,total:f.total||0,remaining:f.remaining||0})}catch(f){l?.({success:!1,error:f.message})}}),r.on("deleteSession",async(a,c)=>{let l=t.get(a);if(!l)return c({success:!1,error:"Session not found"});if(l.daemon&&It()){try{await bi(a),t.delete(a),i[a]&&(delete i[a],o()),rm(a),er(t),c({success:!0})}catch(u){c({success:!1,error:u.message})}return}l.pty&&l.pty.kill(),t.delete(a),i[a]&&(delete i[a],o()),ru(a),rm(a),ut(e,"sessionClosed",a),er(t),c({success:!0})}),r.on("renameSession",async({sessionId:a,name:c},l)=>{let u=t.get(a);if(!u)return l({success:!1,error:"Session not found"});u.name=c,ut(e,"session-renamed",{sessionId:a,name:c}),er(t),l({success:!0})}),r.on("getNote",({sessionId:a}={},c)=>{typeof c=="function"&&c({success:!0,text:kE(a)})}),r.on("saveNote",({sessionId:a,text:c}={},l)=>{if(typeof l!="function")return;let u=AE(a,c);l({success:u})})}var sm=require("child_process");function Tn(r,e,t){return new Promise((n,i)=>{let s=(0,sm.spawn)(r,e,{stdio:["pipe","ignore","pipe"]}),o="";s.stderr&&s.stderr.on("data",a=>{o+=a.toString()}),s.on("error",i),s.on("close",a=>a===0?n():i(new Error(o.trim()||`${r} exited ${a}`))),t!=null&&s.stdin.write(t),s.stdin.end()})}function im(r,e){return new Promise((t,n)=>{let i=(0,sm.spawn)(r,e,{stdio:["ignore","pipe","pipe"]}),s="",o="";i.stdout&&i.stdout.on("data",a=>{s+=a.toString()}),i.stderr&&i.stderr.on("data",a=>{o+=a.toString()}),i.on("error",n),i.on("close",a=>a===0?t(s):n(new Error(o.trim()||`${r} exited ${a}`)))})}var Uj=r=>typeof r=="string"&&r.startsWith("image/"),qj={darwin:{image:r=>Tn("osascript",["-e",`set the clipboard to (read (POSIX file ${JSON.stringify(r)}) as \xABclass PNGf\xBB)`]),file:r=>Tn("osascript",["-e",`set the clipboard to POSIX file ${JSON.stringify(r)}`])},linux:{image:r=>Tn("xclip",["-selection","clipboard","-t","image/png","-i",r]),file:r=>Tn("xclip",["-selection","clipboard","-t","text/uri-list","-i"],`file://${r}
|
|
120
|
+
`)},win32:{image:r=>Tn("powershell.exe",["-NonInteractive","-NoProfile","-STA","-Command",`Add-Type -AssemblyName System.Windows.Forms,System.Drawing; [System.Windows.Forms.Clipboard]::SetImage([System.Drawing.Image]::FromFile(${JSON.stringify(r)}))`]),file:r=>Tn("powershell.exe",["-NonInteractive","-NoProfile","-STA","-Command",`Set-Clipboard -Path ${JSON.stringify(r)}`])}};async function DE(r,e){let t=qj[process.platform];if(!t)throw new Error(`clipboard unsupported on ${process.platform}`);return Uj(e)?t.image(r):t.file(r)}var LE={darwin:{get:()=>im("pbpaste",[]),set:r=>Tn("pbcopy",[],r)},linux:{get:()=>im("xclip",["-selection","clipboard","-o"]),set:r=>Tn("xclip",["-selection","clipboard"],r)},win32:{get:()=>im("powershell.exe",["-NonInteractive","-NoProfile","-STA","-Command","Get-Clipboard -Raw"]),set:r=>Tn("powershell.exe",["-NonInteractive","-NoProfile","-STA","-Command","$Input | Set-Clipboard"],r)}};async function BE(){let r=LE[process.platform];if(!r)throw new Error(`clipboard unsupported on ${process.platform}`);return(await r.get()).replace(/\r\n/g,`
|
|
121
|
+
`)}async function jE(r){let e=LE[process.platform];if(!e)throw new Error(`clipboard unsupported on ${process.platform}`);return e.set(r)}var om=W(require("fs"),1),am=W(require("path"),1);var $j="",nu=null,Hj=500;function Wj(r){nu&&clearTimeout(nu),nu=setTimeout(()=>{nu=null,er(r)},Hj)}function FE(r,e){r.on("input",({sessionId:t,data:n})=>{if(!t)return;let i=e.get(t);if(i){if(i.daemon&&It())return Wl(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.lastCols=n,s.lastRows=i,Wj(e),s.daemon&&It())return PS(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=am.default.join(pa,`${Date.now()}_${a}`);om.default.writeFileSync(c,Buffer.from(s,"base64")),console.log(`\u{1F4CE} File uploaded: ${c} (${i} bytes)`),o.daemon&&It()?Wl(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
|
|
122
122
|
Error uploading file: ${a.message}\r
|
|
123
|
-
`,"utf-8")})}}),r.on("clipboard-attach",async({sessionId:t,filename:n,type:i,content:s},o)=>{if(!t)return o?.({success:!1,error:"no session"});let a=e.get(t);if(!a)return o?.({success:!1,error:"no session"});try{let c=(n||"paste").replace(/[^a-zA-Z0-9._-]/g,"_"),l=
|
|
123
|
+
`,"utf-8")})}}),r.on("clipboard-attach",async({sessionId:t,filename:n,type:i,content:s},o)=>{if(!t)return o?.({success:!1,error:"no session"});let a=e.get(t);if(!a)return o?.({success:!1,error:"no session"});try{let c=(n||"paste").replace(/[^a-zA-Z0-9._-]/g,"_"),l=am.default.join(pa,`${Date.now()}_${c}`);om.default.writeFileSync(l,Buffer.from(s,"base64"));let u=typeof i=="string"&&i.startsWith("image/"),f;u?(await DE(l,i),f=$j):f=`${l} `,a.daemon&&It()?Wl(t,f):a.pty&&a.pty.write(f),o?.({success:!0})}catch(c){console.error("Clipboard attach error:",c),o?.({success:!1,error:c.message})}})}var Dr=W(require("fs"),1),_a=W(require("path"),1),Au=W(rC(),1);St();bn();var Ru=_a.default.join(ie.CONFIG,"vapid.json"),Ou=_a.default.join(ie.CONFIG,"push-subscriptions.json"),jz=1800*1e3,Dt=[];function K3(){try{if(Dr.default.existsSync(Ru))return JSON.parse(Dr.default.readFileSync(Ru,"utf8"))}catch{}return null}function Y3(r){let e=_a.default.dirname(Ru);Dr.default.existsSync(e)||Dr.default.mkdirSync(e,{recursive:!0}),Dr.default.writeFileSync(Ru,JSON.stringify(r,null,2),"utf8")}function X3(){let r=K3();if(!r){let e=Au.default.generateVAPIDKeys();r={publicKey:e.publicKey,privateKey:e.privateKey},Y3(r)}return Au.default.setVapidDetails("mailto:admin@9remote.cc",r.publicKey,r.privateKey),r}function J3(){try{Dr.default.existsSync(Ou)&&(Dt=JSON.parse(Dr.default.readFileSync(Ou,"utf8")))}catch{Dt=[]}}function ba(){try{let r=_a.default.dirname(Ou);Dr.default.existsSync(r)||Dr.default.mkdirSync(r,{recursive:!0}),Dr.default.writeFileSync(Ou,JSON.stringify(Dt,null,2),"utf8")}catch(r){_e(`Failed to save push subscriptions: ${r.message}`)}}function ki(r){return r.type==="expo"?r.token:r.endpoint}function nC(r,e,t){let n=ki(r),i=Dt.find(s=>t?s.deviceId===t:ki(s)===n);Dt=Dt.filter(s=>t?s.deviceId&&s.deviceId!==t:ki(s)!==n),Dt.push({...r,deviceId:t,socketId:e,lastConnectedAt:Date.now(),hidden:i?.hidden??!1}),ba()}function iC(r,e){for(let t of Dt)t.socketId===r&&(t.hidden=!!e,e||(t.disconnectedAt=null))}function sC(r){Dt=Dt.filter(e=>ki(e)!==r),ba()}function oC(r){for(let e of Dt)e.socketId===r&&(e.disconnectedAt=Date.now());ba()}function aC(r,e){for(let t of Dt)ki(t)===e&&(t.socketId=r,t.disconnectedAt=null,t.lastConnectedAt=Date.now());ba()}async function Z3(r,e,t){let n={to:r.token,sound:"default",title:t.type==="stop"?`${e} \u2705`:`${e} \u{1F514}`,body:t.type==="stop"?`${e} completed the task`:`${e} needs your input`,data:{url:`/workspace?t=${t.sessionId}`,sessionId:t.sessionId,type:t.type}},s=await(await fetch("https://exp.host/--/api/v2/push/send",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)})).json();if(s.data?.status==="error")throw new Error(s.data.message);_e(`Expo push sent to ${r.token.slice(0,30)}...`)}async function cC(r){let e=ty[r.tool]||"AI",t=Dt.filter(i=>i.disconnectedAt!=null||i.hidden);if(t.length===0)return;let n=[];await Promise.all(t.map(async i=>{try{if(i.type==="expo")await Z3(i,e,r);else{let s=JSON.stringify({title:r.type==="stop"?`${e} \u2705`:`${e} \u{1F514}`,body:r.type==="stop"?`${e} completed the task`:`${e} needs your input`,data:{url:`/workspace?t=${r.sessionId}`,sessionId:r.sessionId,type:r.type}});await Au.default.sendNotification({endpoint:i.endpoint,keys:i.keys},s),_e(`WebPush sent to ${i.endpoint.slice(0,50)}...`)}}catch(s){_e(`Push failed: ${s.statusCode||s.message}`),(s.statusCode===410||s.statusCode===404||s.message?.includes("DeviceNotRegistered"))&&n.push(ki(i))}})),n.length&&(Dt=Dt.filter(i=>!n.includes(ki(i))),ba())}var Q3=X3();J3();function lC(){return Q3.publicKey}var pt=Object.freeze({IDLE:"idle",WORKING:"working",BLOCKED:"blocked",DONE:"done"}),uC=6e4,eU=15e3,pC=Object.freeze({stop:pt.DONE,notification:pt.BLOCKED,working:pt.WORKING,done:pt.DONE,blocked:pt.BLOCKED,idle:pt.IDLE}),kn=new Map,tU=new Set;function Mu({type:r,sessionId:e,tool:t,message:n}={}){if(!e)return null;let i=pC[r]||pt.IDLE,s=kn.get(e);if(i===pt.DONE&&(!s||s.state===pt.IDLE))return s||null;if(s&&s.state===i&&s.tool===t)return s;let o={state:i,tool:t||s?.tool,since:Date.now(),message:n??void 0,...i===pt.WORKING?{expiresAt:Date.now()+uC}:{}};return kn.set(e,o),o}function fC(r){if(!r)return;let e=kn.get(r);e?.state===pt.WORKING&&(e.expiresAt=Date.now()+uC)}function dC(r){let e=setInterval(()=>{let t=Date.now();for(let[n,i]of kn)if(i.state===pt.WORKING&&i.expiresAt!=null&&i.expiresAt<=t&&(kn.delete(n),typeof r=="function"))try{r(n)}catch{}},eU);return e.unref&&e.unref(),()=>clearInterval(e)}function wa(){let r={};for(let[e,t]of kn)r[e]=t;return r}function Sa(r){if(!r)return!1;let e=kn.get(r);if(!e||e.state!==pt.DONE)return!1;kn.delete(r);for(let t of tU)try{t(r)}catch{}return!0}function Gm(r,e){!r||!e||Mu({type:e.type,sessionId:r,tool:e.tool})}function zm(){let r={};for(let[e,t]of kn)(t.state===pt.DONE||t.state===pt.BLOCKED)&&(r[e]={sessionId:e,type:t.state,tool:t.tool,timestamp:t.since});return r}function Vm(r){Sa(r)}Ts();function hC(r,e){r.on("getStatusState",()=>{r.emit("statusState",wa())}),r.on("getNotificationState",()=>{r.emit("notificationState",zm())}),r.on("requestUpdate",()=>yn("update")),r.on("requestRestart",()=>yn("restart")),r.on("clearStatus",t=>{if(!t)return;Sa(t)&&(r.broadcast.emit("statusCleared",t),r.broadcast.emit("notificationCleared",t))}),r.on("clearNotification",t=>{if(!t)return;Sa(t)&&(r.broadcast.emit("notificationCleared",t),r.broadcast.emit("statusCleared",t))}),r.on("getVapidKey",t=>t(lC())),r.on("pushSubscribe",t=>{let n=t?.type==="expo"?t.token:t?.endpoint;n&&(aC(r.id,n),nC(t,r.id,r.handshake.auth?.deviceId))}),r.on("pushUnsubscribe",t=>{t&&sC(t)}),r.on("visibilityChange",t=>iC(r.id,t)),r.on("getAutoStartStatus",t=>{if(!Kr())return t({success:!1,error:"Not in Codespaces"});let n=process.env.CODESPACE_VSCODE_FOLDER||process.cwd();t({success:!0,..._E(n)})}),r.on("setAutoStart",({enabled:t},n)=>{if(!Kr())return n({success:!1,error:"Not in Codespaces"});let i=process.env.CODESPACE_VSCODE_FOLDER||process.cwd();n(bE(i,t))})}var bC=W(require("os"),1),X=W(require("fs"),1),ft=W(require("path"),1);St();var Iu=`http://localhost:${Qa}/api/notify`,wC="nineRemoteNotify",rU=ft.default.join(ie.STATE,"claudeEnvBackup.json"),kt=(...r)=>ft.default.join(bC.default.homedir(),...r),Ai=(r,...e)=>{let t=process.env[r];return t&&t.trim()?t.trim():kt(...e)},Ce={claude:()=>kt(".claude","settings.json"),codex:()=>kt(".codex","config.toml"),codexScript:()=>kt(".codex","9remote-notify.sh"),gemini:()=>kt(".gemini","settings.json"),opencode:()=>kt(".config","opencode","plugin",`${wC}.js`),grok:()=>ft.default.join(Ai("GROK_HOME",".grok"),"hooks","9remote.json"),cursor:()=>kt(".cursor","hooks.json"),antigravity:()=>kt(".gemini","config","hooks.json"),kiro:()=>ft.default.join(Ai("KIRO_HOME",".kiro"),"agents","9remote.json"),copilot:()=>ft.default.join(Ai("COPILOT_HOME",".copilot"),"config.json"),codebuddy:()=>ft.default.join(Ai("CODEBUDDY_CONFIG_DIR",".codebuddy"),"settings.json"),factory:()=>kt(".factory","settings.json"),qoder:()=>ft.default.join(Ai("QODER_CONFIG_DIR",".qoder"),"settings.json"),rovodev:()=>kt(".rovodev","config.yml"),hermes:()=>ft.default.join(Ai("HERMES_HOME",".hermes"),"config.yaml"),amp:()=>kt(".config","amp","plugins","9remote.ts"),pi:()=>ft.default.join(Ai("PI_CODING_AGENT_DIR",".pi","agent"),"extensions","9remote.ts")},nU={claude:"claude",codex:"codex",gemini:"gemini",opencode:"opencode",grok:"grok",cursor:"cursor-agent",antigravity:"agy",kiro:"kiro-cli",copilot:"copilot",codebuddy:"codebuddy",factory:"droid",qoder:"qodercli",rovodev:"acli",hermes:"hermes",amp:"amp",pi:"pi"},Qs=(r,e)=>`command -v curl >/dev/null 2>&1 && curl -s --connect-timeout 1 --max-time 2 "${Iu}?type=${r}&sessionId=$NINE_REMOTE_SESSION_ID&tool=${e}" > /dev/null 2>&1 & true`,iU={claude:()=>kt(".claude"),codex:()=>kt(".codex"),gemini:()=>kt(".gemini"),opencode:()=>[kt(".config","opencode"),kt(".opencode")]},SC=r=>Math.ceil(r/1e3),Km=5e3,Pu=r=>r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),sU=r=>`"${r.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`;function oU(r,e,t,n){let i=X.default.existsSync(r)?X.default.readFileSync(r,"utf8"):"";i=i.replace(new RegExp(`${Pu(e)}[\\s\\S]*?${Pu(t)}\\n?`,"g"),""),i.length&&!i.endsWith(`
|
|
124
124
|
`)&&(i+=`
|
|
125
125
|
`),i+=`${n}
|
|
126
|
-
`;let s=ft.default.dirname(r);X.default.existsSync(s)||X.default.mkdirSync(s,{recursive:!0}),X.default.writeFileSync(r,i,"utf8")}function
|
|
127
|
-
- command: ${
|
|
126
|
+
`;let s=ft.default.dirname(r);X.default.existsSync(s)||X.default.mkdirSync(s,{recursive:!0}),X.default.writeFileSync(r,i,"utf8")}function aU(r,e,t){if(!X.default.existsSync(r))return;let n=X.default.readFileSync(r,"utf8");X.default.writeFileSync(r,n.replace(new RegExp(`${Pu(e)}[\\s\\S]*?${Pu(t)}\\n?`,"g"),""),"utf8")}function Lt(r){try{if(X.default.existsSync(r))return JSON.parse(X.default.readFileSync(r,"utf8"))}catch{}return{}}function wr(r,e){let t=ft.default.dirname(r);X.default.existsSync(t)||X.default.mkdirSync(t,{recursive:!0}),X.default.writeFileSync(r,JSON.stringify(e,null,2),"utf8")}function EC(r){let e={},t=r.env||{};for(let n of Object.keys(bo))e[n]=t[n]??null;wr(rU,e),r.env={...t,...bo}}function Ri(r,e,t,{matchers:n={},extra:i}={}){let s=(a,c)=>({hooks:[{type:"command",command:Qs(c,r),timeout:t(Km)}],...n[a]!=null?{matcher:n[a]}:{}}),o=a=>a?.hooks?.some(c=>typeof c.command=="string"&&c.command.includes(`&tool=${r}`));return{enable(a){let c=Lt(a),l={...c.hooks||{}};for(let[u,f]of Object.entries(e))l[u]=[...(l[u]||[]).filter(d=>!o(d)),s(u,f)];return c.hooks=l,i&&i(c),wr(a,c),{success:!0}},disable(a){let c=Lt(a);if(c.hooks){for(let l of Object.keys(e))c.hooks[l]=(c.hooks[l]||[]).filter(u=>!o(u)),c.hooks[l].length===0&&delete c.hooks[l];Object.keys(c.hooks).length===0&&delete c.hooks}return i&&i(c),wr(a,c),{success:!0}},isEnabled(a){let c=Lt(a);return Object.keys(e).every(l=>(c.hooks?.[l]||[]).some(o))}}}function cU(r,e,{extra:t}={}){let n=s=>typeof s?.command=="string"&&s.command.includes(`&tool=${r}`);return{enable(s){let o=Lt(s),a={...o.hooks||{}};for(let[c,l]of Object.entries(e))a[c]=[...(a[c]||[]).filter(u=>!n(u)),{command:Qs(l,r)}];return o.hooks=a,t&&t(o),wr(s,o),{success:!0}},disable(s){let o=Lt(s);if(o.hooks){for(let a of Object.keys(e))o.hooks[a]=(o.hooks[a]||[]).filter(c=>!n(c)),o.hooks[a].length===0&&delete o.hooks[a];Object.keys(o.hooks).length===0&&delete o.hooks}return t&&t(o),wr(s,o),{success:!0}},isEnabled(s){let o=Lt(s);return Object.keys(e).every(a=>(o.hooks?.[a]||[]).some(n))}}}function lU(r,e,t){return{enable(i){let s=Lt(i),o={};for(let[a,c]of Object.entries(t))o[a]=[{type:"command",command:Qs(c,r),timeout:SC(Km)}];return s[e]=o,wr(i,s),{success:!0}},disable(i){let s=Lt(i);return delete s[e],wr(i,s),{success:!0}},isEnabled(i){return!!Lt(i)[e]}}}function uU(r,e,{name:t,description:n}={}){let i=o=>typeof o?.command=="string"&&o.command.includes(`&tool=${r}`);return{enable(o){let a=Lt(o);a.name=a.name||t||"9remote",a.description=a.description||n||`9Remote hooks for ${r} CLI.`,Array.isArray(a.tools)||(a.tools=["*"]);let c={...a.hooks||{}};for(let[l,u]of Object.entries(e))c[l]=[...(c[l]||[]).filter(f=>!i(f)),{command:Qs(u,r),timeout_ms:Km}];return a.hooks=c,wr(o,a),{success:!0}},disable(o){if(!X.default.existsSync(o))return{success:!0};let a=Lt(o);if(a.hooks){for(let c of Object.keys(e))a.hooks[c]=(a.hooks[c]||[]).filter(l=>!i(l)),a.hooks[c].length===0&&delete a.hooks[c];Object.keys(a.hooks).length===0&&delete a.hooks}return wr(o,a),{success:!0}},isEnabled(o){let a=Lt(o);return Object.keys(e).every(c=>(a.hooks?.[c]||[]).some(i))}}}function mC(r,{begin:e,end:t,items:n}){let i=()=>[e,"hooks:",...n.map(({event:o,type:a})=>` ${o}:
|
|
127
|
+
- command: ${sU(Qs(a,r))}
|
|
128
128
|
timeout: 5`),t].join(`
|
|
129
|
-
`);return{enable(s){return
|
|
129
|
+
`);return{enable(s){return oU(s,e,t,i()),{success:!0}},disable(s){return aU(s,e,t),{success:!0}},isEnabled(s){return X.default.existsSync(s)&&X.default.readFileSync(s,"utf8").includes(e)}}}var gC=/# 9Remote notification\nnotify\s*=.*\n?/g,vC="# 9Remote-saved: ",yC=/^notify\s*=\s*(\[[^\n]*\])\s*$/m;function xC(r){let e=r.search(/^\[/m);return e===-1?[r,""]:[r.slice(0,e),r.slice(e)]}function pU(){return`#!/bin/sh
|
|
130
130
|
# 9Remote codex notify wrapper \u2014 maps codex events to 9remote status types.
|
|
131
131
|
input=$(cat 2>/dev/null || echo "")
|
|
132
132
|
t="done"
|
|
@@ -136,13 +136,13 @@ case "$input" in
|
|
|
136
136
|
*agent-reasoning*|*agent-message*|*agent-streaming*|*reasoning*) t="working" ;;
|
|
137
137
|
esac
|
|
138
138
|
command -v curl >/dev/null 2>&1 && curl -s --connect-timeout 1 --max-time 2 "${Iu}?type=$t&sessionId=$NINE_REMOTE_SESSION_ID&tool=codex" > /dev/null 2>&1
|
|
139
|
-
`}var
|
|
139
|
+
`}var fU={enable(){let r=Ce.codex(),e=ft.default.dirname(r);X.default.existsSync(e)||X.default.mkdirSync(e,{recursive:!0});let t=Ce.codexScript();X.default.writeFileSync(t,pU(),"utf8");try{X.default.chmodSync(t,493)}catch{}let n=X.default.existsSync(r)?X.default.readFileSync(r,"utf8"):"";n=n.replace(gC,"");let[i,s]=xC(n);i.match(yC)&&(i=i.replace(yC,`${vC}$&`));let a=`# 9Remote notification
|
|
140
140
|
notify = ["bash", ${JSON.stringify(t)}, "9remote"]
|
|
141
141
|
`;return i.length&&!i.endsWith(`
|
|
142
142
|
`)&&(i+=`
|
|
143
|
-
`),X.default.writeFileSync(r,i+a+s,"utf8"),{success:!0}},disable(){let r=
|
|
143
|
+
`),X.default.writeFileSync(r,i+a+s,"utf8"),{success:!0}},disable(){let r=Ce.codex();if(X.default.existsSync(r)){let t=X.default.readFileSync(r,"utf8");t=t.replace(gC,""),t=t.replace(new RegExp(`^${vC}(notify\\s*=.*)$`,"m"),"$1");let[n,i]=xC(t);i&&n.length&&!n.endsWith(`
|
|
144
144
|
`)&&(n+=`
|
|
145
|
-
`),X.default.writeFileSync(r,n+i,"utf8")}let e=
|
|
145
|
+
`),X.default.writeFileSync(r,n+i,"utf8")}let e=Ce.codexScript();return X.default.existsSync(e)&&X.default.unlinkSync(e),{success:!0}},isEnabled(){return X.default.existsSync(Ce.codex())&&X.default.readFileSync(Ce.codex(),"utf8").includes("# 9Remote notification")}};function dU(){return`// 9Remote OpenCode status plugin (auto-generated)
|
|
146
146
|
const base = ${JSON.stringify(Iu)};
|
|
147
147
|
const post = (type) => {
|
|
148
148
|
const sid = process.env.NINE_REMOTE_SESSION_ID || "";
|
|
@@ -150,7 +150,7 @@ const post = (type) => {
|
|
|
150
150
|
const url = base + "?type=" + type + "&sessionId=" + encodeURIComponent(sid) + "&tool=opencode";
|
|
151
151
|
try { fetch(url, { signal: AbortSignal.timeout(2000) }).catch(() => {}); } catch {}
|
|
152
152
|
};
|
|
153
|
-
export const ${
|
|
153
|
+
export const ${wC} = async () => ({
|
|
154
154
|
"chat.message": async () => post("working"),
|
|
155
155
|
"tool.execute.before": async () => post("working"),
|
|
156
156
|
"tool.execute.after": async () => post("working"),
|
|
@@ -162,7 +162,7 @@ export const ${vC} = async () => ({
|
|
|
162
162
|
if (t === "session.compacted" || t === "permission.replied" || t === "question.replied") return post("working");
|
|
163
163
|
},
|
|
164
164
|
});
|
|
165
|
-
`}var
|
|
165
|
+
`}var hU={enable(){let r=Ce.opencode(),e=ft.default.dirname(r);return X.default.existsSync(e)||X.default.mkdirSync(e,{recursive:!0}),X.default.writeFileSync(r,dU(),"utf8"),{success:!0}},disable(){let r=Ce.opencode();return X.default.existsSync(r)&&X.default.unlinkSync(r),{success:!0}},isEnabled(){return X.default.existsSync(Ce.opencode())}};function _C(r,e,t,n){return`// 9Remote ${r} status plugin (auto-generated)
|
|
166
166
|
function post(type) {
|
|
167
167
|
const sid = process.env.NINE_REMOTE_SESSION_ID || "";
|
|
168
168
|
if (!sid) return;
|
|
@@ -173,12 +173,12 @@ export default function (${e}) {
|
|
|
173
173
|
${e}.on(${JSON.stringify(t)}, async () => post("working"));
|
|
174
174
|
${e}.on(${JSON.stringify(n)}, async () => post("done"));
|
|
175
175
|
}
|
|
176
|
-
`}var lU="# 9remote hooks begin",uU="# 9remote hooks end",pU=" # 9remote hooks begin",fU=" # 9remote hooks end",dU={claude:Ri("claude",{UserPromptSubmit:"working",PostToolUse:"working",Stop:"done",Notification:"blocked"},r=>r,{matchers:{Notification:"permission_prompt"},extra:xC}),codex:oU,gemini:Ri("gemini",{BeforeAgent:"working",PreToolUse:"working",PostToolUse:"working",AfterAgent:"done",Notification:"blocked"},r=>r),opencode:cU,grok:Ri("grok",{UserPromptSubmit:"working",PreToolUse:"working",PostToolUse:"working",Stop:"done",Notification:"blocked"},yC),cursor:rU("cursor",{stop:"done",beforeShellExecution:"blocked",beforeToolCall:"working"},{extra:r=>{r.version=r.version||1}}),antigravity:nU("antigravity","9remote",{UserPromptSubmit:"working",PreToolUse:"working",Stop:"done",Notification:"blocked"}),kiro:iU("kiro",{UserPromptSubmit:"working",PostToolUse:"working",preToolUse:"blocked",stop:"done"}),copilot:Ri("copilot",{UserPromptSubmit:"working",PostToolUse:"working",PreToolUse:"blocked",Stop:"done"},r=>r),codebuddy:Ri("codebuddy",{UserPromptSubmit:"working",PostToolUse:"working",PreToolUse:"blocked",Stop:"done"},r=>r),factory:Ri("factory",{UserPromptSubmit:"working",PostToolUse:"working",PreToolUse:"blocked",Stop:"done"},r=>r),qoder:Ri("qoder",{UserPromptSubmit:"working",PostToolUse:"working",PreToolUse:"blocked",Stop:"done"},r=>r),rovodev:uC("rovodev",{begin:pU,end:fU,items:[{event:"on_complete",type:"done"},{event:"on_error",type:"done"},{event:"on_tool_permission",type:"blocked"},{event:"on_message",type:"working"},{event:"on_tool_start",type:"working"}]}),hermes:(()=>{let r=uC("hermes",{begin:lU,end:uU,items:[{event:"pre_llm_call",type:"working"},{event:"pre_tool_call",type:"working"},{event:"post_tool_call",type:"working"},{event:"pre_approval_request",type:"blocked"},{event:"post_llm_call",type:"done"}]}),e=()=>ft.default.join(ft.default.dirname(Te.hermes()),"shell-hooks-allowlist.json");return{enable:()=>{let t=r.enable(Te.hermes()),n=Lt(e()),i=(n.approvals||[]).filter(s=>!(typeof s.command=="string"&&s.command.includes("&tool=hermes")));return n.approvals=[...i,...[{event:"pre_llm_call",type:"working"},{event:"pre_tool_call",type:"working"},{event:"post_tool_call",type:"working"},{event:"pre_approval_request",type:"blocked"},{event:"post_llm_call",type:"done"}].map(({event:s,type:o})=>({event:s,command:Qs(o,"hermes"),approved_at:"2020-01-01T00:00:00Z"}))],wr(e(),n),t},disable:()=>{let t=r.disable(Te.hermes()),n=e();if(X.default.existsSync(n)){let i=Lt(n);i.approvals=(i.approvals||[]).filter(s=>!(typeof s.command=="string"&&s.command.includes("&tool=hermes"))),i.approvals.length?wr(n,i):X.default.unlinkSync(n)}return t},isEnabled:()=>r.isEnabled(Te.hermes())}})(),amp:{enable(){let r=Te.amp(),e=ft.default.dirname(r);return X.default.existsSync(e)||X.default.mkdirSync(e,{recursive:!0}),X.default.writeFileSync(r,mC("amp","amp","agent.start","agent.end"),"utf8"),{success:!0}},disable(){return X.default.existsSync(Te.amp())&&X.default.unlinkSync(Te.amp()),{success:!0}},isEnabled(){return X.default.existsSync(Te.amp())}},pi:{enable(){let r=Te.pi(),e=ft.default.dirname(r);return X.default.existsSync(e)||X.default.mkdirSync(e,{recursive:!0}),X.default.writeFileSync(r,mC("pi","pi","agent_start","agent_end"),"utf8"),{success:!0}},disable(){return X.default.existsSync(Te.pi())&&X.default.unlinkSync(Te.pi()),{success:!0}},isEnabled(){return X.default.existsSync(Te.pi())}}},hU=Jv;function mU(r){let e=dU[r];if(!e)return{success:!1,error:"Unknown tool"};try{return r==="codex"||r==="opencode"||r==="amp"||r==="pi"?e.enable():e.enable(Te[r]())}catch(t){return{success:!1,error:t.message}}}function gU(r){let e=(process.env.PATH||"").split(ft.default.delimiter).filter(Boolean),t=process.platform==="win32"?(process.env.PATHEXT||".EXE;.CMD;.BAT").split(";"):[""];return e.some(n=>t.some(i=>{try{return X.default.existsSync(ft.default.join(n,r+i))}catch{return!1}}))}function vU(r){let e=J3[r];if(e&&gU(e))return!0;let t=Z3[r]?.();return t?(Array.isArray(t)?t:[t]).some(n=>X.default.existsSync(n)):!1}function _C(){let r={};for(let e of hU)if(vU(e))try{r[e]=mU(e).success}catch{r[e]=!1}return r}function bC(){let r=Te.claude(),e=Lt(r);if(!e.hooks?.Stop&&!e.hooks?.Notification)return;let t=e.env||{};Object.keys(bo).some(i=>t[i]!==bo[i])&&(xC(e),wr(r,e))}_i();var lV=(0,SC.dirname)((0,EC.fileURLToPath)(__importMetaUrl)),uV=yo.rgb(230,138,110),zm="daemon",yU="2.1.16",Zr=new Map,TC=new Map,CC={},AC=[];async function wC(){let r=await $l(),e=new Map(r.map(n=>[n.id,n])),t=Qh();for(let n of r)if(!t[n.id])try{await bi(n.id)}catch{}Zr.clear();for(let[n,i]of Object.entries(t)){let s=e.get(n);Zr.set(n,{daemon:!0,name:i.name,createdAt:i.createdAt,shellId:i.shellId,cwd:s?.cwd||i.cwd,lastCols:i.cols??null,lastRows:i.rows??null,needsRespawn:!s})}er(Zr)}async function kC(){let r=wE();for(let n of r.groups)TC.set(n.id,n);Object.assign(CC,r.sessionGroups),AC.push(...r.sessionOrder);try{bC()}catch{}try{_C()}catch{}if(zm==="daemon")if(!await CS())console.error("\u274C Failed to connect to PTY daemon, falling back to buffer mode");else{await wC(),la("connected",()=>{wC().catch(()=>{})});return}console.log("\u{1F4E6} Buffer persistence mode - scrollback enabled");let e=bE(),t=Qh();for(let n of e){let i=t[n]||{};Zr.set(n,{pty:null,name:i.name||`Terminal ${Zr.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 eo(r,e){zm==="daemon"&&(la("output",({sessionId:i,enc:s,data:o,replay:a})=>{a!==!0&&aC(i),ut(r,"output",{sessionId:i,enc:s,data:o,replay:a===!0})}),cC(i=>ut(r,"statusState",wa())),la("cwdChange",({sessionId:i,cwd:s})=>{let o=Zr.get(i);o&&s&&o.cwd!==s&&(o.cwd=s,er(Zr)),ut(r,"cwdChange",{sessionId:i,cwd:s})}),la("sessionClosed",i=>{Zr.delete(i),Wm(i),ut(r,"sessionClosed",i),ut(r,"notificationCleared",i)}));let t=()=>({version:yU,remoteAvailable:Os(),daemonMode:zm==="daemon"&&It(),platform:process.platform,updateAvailable:zw(),canSelfUpdate:!0,caps:{joinSessionSize:!0},...dE()}),n=()=>{let i=t();for(let s of r.sockets.sockets.values())s.data?.approved&&s.emit("serverInfo",i)};Yw(n),eo._buildServerInfo=t,eo._emitServerInfo=n}function RC(){eo._emitServerInfo?.()}var OC=null;function MC(r){OC=r}async function PC(r,e,t){hE(),OC?.(),r.emit("serverInfo",eo._buildServerInfo?.()),RE(r,e,Zr,TC,CC,AC),NE(r,Zr),lC(r,e),Xl()&&await fE(r,t).catch(n=>{console.error("\u274C Failed to setup remote handlers:",n.message)}),r.on("disconnect",()=>{tC(r.id),mE()})}var re=W(require("fs"),1),Er=W(require("path"),1),en=W(require("os"),1),ao=require("child_process"),Uk=W(Mk(),1),tp=W(require("sharp"),1);var Gg=["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"],Qu=[".zip",".tar",".gz",".tgz",".rar",".7z",".bz2",".xz",".exe",".dll",".so",".dylib",".app",".bin",".woff",".woff2",".ttf",".eot",".otf",".sqlite",".db",".mdb",".class",".jar",".war",".pyc",".o",".obj"];var Pk=[".ssh",".aws",".gnupg",".kube",".docker",".cargo",".npmrc",".netrc",".pypirc",".config/gh",".config/gcloud"],Ik=["/etc/shadow","/etc/sudoers","/etc/ssh","/root","/private/etc/sudoers"];var ep=W(require("fs"),1),Jn=W(require("path"),1),Nk=W(require("os"),1);var Dk=Nk.default.homedir();function NH(r){if(!r)return null;let e=r.startsWith("~")?r.replace(/^~/,Dk):r,t=Jn.default.resolve(e);try{return ep.default.realpathSync(t)}catch{let n=t,i=[];for(;!ep.default.existsSync(n);){i.unshift(Jn.default.basename(n));let s=Jn.default.dirname(n);if(s===n)return t;n=s}try{return Jn.default.join(ep.default.realpathSync(n),...i)}catch{return t}}}function wt(r){let e=NH(r);if(!e)return!1;for(let t of Ik)if(e===t||e.startsWith(t+Jn.default.sep))return!0;for(let t of Pk){let n=Jn.default.join(Dk,t);if(e===n||e.startsWith(n+Jn.default.sep))return!0}return!1}var FH={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",avif:"image/avif",apng:"image/apng",tif:"image/tiff",tiff:"image/tiff",mp4:"video/mp4",m4v:"video/mp4",webm:"video/webm",ogv:"video/ogg",mov:"video/quicktime",mkv:"video/x-matroska",avi:"video/x-msvideo","3gp":"video/3gpp",mp3:"audio/mpeg",wav:"audio/wav",ogg:"audio/ogg",oga:"audio/ogg",flac:"audio/flac",m4a:"audio/mp4",aac:"audio/aac",opus:"audio/opus",pdf:"application/pdf"};function rp(r){return Gg.includes(r)}function co(r){return Qu.includes(Er.default.extname(r).toLowerCase())}function UH(r,e){return r.isDirectory()?"folder":co(e)?"binary":"file"}function Zn(r){return r<1024?`${r}B`:r<1024*1024?`${(r/1024).toFixed(1)}KB`:`${(r/(1024*1024)).toFixed(1)}MB`}async function jk(r){let e=await(0,tp.default)(r).metadata(),t=e.width||0,n=e.height||0,i=[80,60,40],s=[1600,1200,800],o=r,a=t,c=n;for(let l of s)for(let u of i){o=await(0,tp.default)(r).resize({width:l,height:l,fit:"inside",withoutEnlargement:!0}).jpeg({quality:u,mozjpeg:!0}).toBuffer();let f=await(0,tp.default)(o).metadata();if(a=f.width||l,c=f.height||l,o.length<=3145728)return{buffer:o,width:a,height:c,originalWidth:t,originalHeight:n}}return{buffer:o,width:a,height:c,originalWidth:t,originalHeight:n}}function qk(r,e,t,n=50){if(!(t.length>=n))try{for(let i of re.default.readdirSync(r)){if(t.length>=n)return;if(i.startsWith(".")||rp(i))continue;let s=Er.default.join(r,i);try{let o=re.default.statSync(s);o.isDirectory()?qk(s,e,t,n):i.toLowerCase().includes(e.toLowerCase())&&t.push({name:i,path:s,type:co(i)?"binary":"file",size:o.size,sizeFormatted:Zn(o.size)})}catch{}}}catch{}}function Fk(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 $k(r,e,t,n,i,s){if(s.length>=200)return;let o;try{o=re.default.readdirSync(r,{withFileTypes:!0})}catch{return}for(let a of o){if(s.length>=200)return;if(rp(a.name))continue;let c=Er.default.join(r,a.name),l=Er.default.relative(e,c);if(a.isDirectory()){$k(c,e,t,n,i,s);continue}if(a.isFile()&&!co(a.name)&&!wt(c)&&!(i&&i.test(l))&&!(n&&!n.test(l)))try{if(re.default.statSync(c).size>1048576)continue;let d=re.default.readFileSync(c,"utf-8").split(`
|
|
177
|
-
`),g=[];for(let y=0;y<d.length&&g.length<10;y++){let b=d[y],C=t(b);for(let R of C){if(g.length>=10)break;g.push({line:y+1,column:R.column+1,lineText:b,matchLength:R.length})}}g.length&&s.push({path:c,matches:g})}catch{}}}function Hk(r,e,t){let n;try{n=re.default.readdirSync(r,{withFileTypes:!0})}catch{return[]}let i=[];for(let s of n){if(!t&&s.name.startsWith(".")&&s.name!==".env"&&s.name!==".env.example"||rp(s.name))continue;let o=Er.default.join(r,s.name);if(s.isDirectory()){let a={name:s.name,path:o,type:"folder"};e>0&&(a.children=Hk(o,e-1,t)),i.push(a)}else s.isFile()&&i.push({name:s.name,path:o,type:co(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 qH(){if(process.platform!=="win32")return[];try{return(0,ao.execSync)("wmic logicaldisk get name",{encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}).split(/\r?\n/).map(e=>e.trim()).filter(e=>/^[A-Z]:$/.test(e)).map(e=>({letter:e[0],path:e+"\\"}))}catch{return"CDEFGHIJ".split("").map(r=>`${r}:\\`).filter(r=>re.default.existsSync(r)).map(r=>({letter:r[0],path:r}))}}function Wk(r){r.on("getSystemInfo",t=>{let n=process.platform;t({success:!0,platform:n,isWindows:n==="win32",drives:n==="win32"?qH():[],homedir:en.default.homedir()})}),r.on("getFiles",({dirPath:t,showHidden:n},i)=>{try{let s=t||en.default.homedir(),o=s.startsWith("~")?s.replace("~",en.default.homedir()):s;if(wt(o))return i({success:!1,error:"Access denied"});if(!re.default.existsSync(o))return i({success:!1,error:"Directory not found"});let a=[];for(let c of re.default.readdirSync(o))if(!(!n&&c.startsWith(".")&&c!==".env"&&c!==".env.example")&&!rp(c))try{let l=Er.default.join(o,c),u=re.default.statSync(l);a.push({name:c,path:l,type:UH(u,c),size:u.isFile()?u.size:null,sizeFormatted:u.isFile()?Zn(u.size):null,modified:u.mtime.getTime()})}catch{}a.sort((c,l)=>c.type==="folder"&&l.type!=="folder"?-1:c.type!=="folder"&&l.type==="folder"?1:c.name.localeCompare(l.name)),i({success:!0,files:a,currentPath:o,parentPath:Er.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||en.default.homedir()).replace(/^~/,en.default.homedir());if(!re.default.existsSync(s))return i({success:!1,error:"Workspace not found"});let o=[];qk(s,n,o,50),o.sort((a,c)=>{let l=a.name.toLowerCase()===n.toLowerCase(),u=c.name.toLowerCase()===n.toLowerCase();return l&&!u?-1:!l&&u?1:a.path.length-c.path.length}),i({success:!0,files:o})}catch(s){i({success:!1,error:s.message})}}),r.on("readFile",({filePath:t},n)=>{try{if(wt(t))return n({success:!1,error:"Access denied"});if(!re.default.existsSync(t))return n({success:!1,error:"File not found"});let i=re.default.statSync(t);if(i.size>1048576)return n({success:!1,error:`File too large (${Zn(i.size)}). Max ${Zn(1048576)}`});if(co(t))return n({success:!1,error:"Cannot open binary file"});n({success:!0,content:re.default.readFileSync(t,"utf-8")})}catch(i){n({success:!1,error:i.message})}}),r.on("readMedia",async({filePath:t},n)=>{try{if(wt(t))return n({success:!1,error:"Access denied"});if(!re.default.existsSync(t))return n({success:!1,error:"File not found"});let i=re.default.statSync(t),s=Er.default.extname(t).toLowerCase().slice(1),o=FH[s]||"application/octet-stream",a=o.startsWith("image/"),c=a?20971520:5242880;if(i.size>c)return n({success:!1,error:`File too large (${Zn(i.size)}). Max ${Zn(c)}`});let l=re.default.readFileSync(t);if(a){let u=await jk(l),f=`data:image/jpeg;base64,${u.buffer.toString("base64")}`;n({success:!0,dataUrl:f,size:i.size,mime:o,originalSize:i.size,originalWidth:u.originalWidth,originalHeight:u.originalHeight,width:u.width,height:u.height,scaled:u.buffer.length<i.size})}else{let u=`data:${o};base64,${l.toString("base64")}`;n({success:!0,dataUrl:u,size:i.size,mime:o})}}catch(i){n({success:!1,error:i.message})}}),r.on("readImage",async({filePath:t},n)=>{try{if(wt(t))return n({success:!1,error:"Access denied"});if(!re.default.existsSync(t))return n({success:!1,error:"File not found"});let i=re.default.statSync(t);if(i.size>20971520)return n({success:!1,error:`Image too large (${Zn(i.size)}). Max ${Zn(20971520)}`});let s=re.default.readFileSync(t),o=await jk(s),a=`data:image/jpeg;base64,${o.buffer.toString("base64")}`;n({success:!0,dataUrl:a,size:i.size,mime:"image/jpeg",originalSize:i.size,originalWidth:o.originalWidth,originalHeight:o.originalHeight,width:o.width,height:o.height,scaled:o.buffer.length<i.size})}catch(i){n({success:!1,error:i.message})}}),r.on("writeFile",({filePath:t,content:n},i)=>{try{if(wt(t))return i({success:!1,error:"Access denied"});re.default.writeFileSync(t,n,"utf-8"),i({success:!0})}catch(s){i({success:!1,error:s.message})}}),r.on("createItem",({itemPath:t,type:n},i)=>{try{if(wt(t))return i({success:!1,error:"Access denied"});if(re.default.existsSync(t))return i({success:!1,error:"Item already exists"});n==="folder"?re.default.mkdirSync(t,{recursive:!0}):re.default.writeFileSync(t,"","utf-8"),i({success:!0})}catch(s){i({success:!1,error:s.message})}}),r.on("deleteItem",({itemPath:t},n)=>{try{if(wt(t))return n({success:!1,error:"Access denied"});if(!re.default.existsSync(t))return n({success:!1,error:"Item not found"});re.default.statSync(t).isDirectory()?re.default.rmSync(t,{recursive:!0}):re.default.unlinkSync(t),n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.on("renameItem",({oldPath:t,newPath:n},i)=>{try{if(wt(t)||wt(n))return i({success:!1,error:"Access denied"});if(!re.default.existsSync(t))return i({success:!1,error:"Item not found"});if(re.default.existsSync(n))return i({success:!1,error:"Target already exists"});re.default.renameSync(t,n),i({success:!0})}catch(s){i({success:!1,error:s.message})}}),r.on("searchInFiles",({workspace:t,query:n,caseSensitive:i,regex:s,includeGlob:o,excludeGlob:a},c)=>{try{if(!n)return c({success:!0,results:[]});let l=(t||en.default.homedir()).replace(/^~/,en.default.homedir());if(!re.default.existsSync(l))return c({success:!1,error:"Workspace not found"});let u;if(s){let y;try{y=new RegExp(n,i?"g":"gi")}catch(b){return c({success:!1,error:`Invalid regex: ${b.message}`})}u=b=>{let C=[],R;for(y.lastIndex=0;(R=y.exec(b))!==null;)C.push({column:R.index,length:R[0].length}),R.index===y.lastIndex&&y.lastIndex++;return C}}else{let y=i?n:n.toLowerCase();u=b=>{let C=i?b:b.toLowerCase(),R=[],M=0;for(;(M=C.indexOf(y,M))!==-1;)R.push({column:M,length:y.length}),M+=y.length||1;return R}}let f=Fk(o),d=Fk(a),g=[];$k(l,l,u,f,d,g),c({success:!0,results:g})}catch(l){c({success:!1,error:l.message})}}),r.on("replaceInFiles",({workspace:t,query:n,replacement:i,caseSensitive:s,regex:o,files:a},c)=>{try{if(!n||!Array.isArray(a)||!a.length)return c({success:!0,replacedCount:0,fileCount:0});let l;if(o){let d;try{d=new RegExp(n,s?"g":"gi")}catch(g){return c({success:!1,error:`Invalid regex: ${g.message}`})}l=g=>{let y=0;return{next:g.replace(d,C=>(y++,i)),count:y}}}else l=d=>{let g=0,y=s?"g":"gi",b=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),C=new RegExp(b,y);return{next:d.replace(C,()=>(g++,i)),count:g}};let u=0,f=0;for(let d of a)try{if(!re.default.existsSync(d)||co(d)||wt(d))continue;let g=re.default.statSync(d);if(!g.isFile()||g.size>1048576)continue;let y=re.default.readFileSync(d,"utf-8"),{next:b,count:C}=l(y);C>0&&(re.default.writeFileSync(d,b,"utf-8"),u+=C,f++)}catch{}c({success:!0,replacedCount:u,fileCount:f})}catch(l){c({success:!1,error:l.message})}});let e=new Map;r.on("watchDir",({dirPath:t},n)=>{try{if(!t||!re.default.existsSync(t))return n({success:!1,error:"Directory not found"});let i=e.get(t);if(i)return i.count++,n({success:!0});let s=Uk.default.watch(t,{depth:0,ignoreInitial:!0,persistent:!0,ignored:a=>Gg.includes(Er.default.basename(a))}),o=a=>c=>r.emit("fileChange",{type:a,path:c});s.on("add",o("add")).on("change",o("change")).on("unlink",o("unlink")).on("addDir",o("addDir")).on("unlinkDir",o("unlinkDir")),e.set(t,{w:s,count:1}),n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.on("unwatchDir",({dirPath:t},n)=>{try{let i=e.get(t);i&&--i.count<=0&&(i.w.close(),e.delete(t)),n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.once("disconnect",()=>{for(let{w:t}of e.values())try{t.close()}catch{}e.clear()}),r.on("revealInOS",({filePath:t},n)=>{try{if(!t)return n({success:!1,error:"No path"});let i=process.platform,s,o;i==="darwin"?(s="open",o=["-R",t]):i==="win32"?(s="explorer",o=[`/select,${t}`]):(s="xdg-open",o=[Er.default.dirname(t)]);let a=(0,ao.spawn)(s,o,{detached:!0,stdio:"ignore",windowsHide:!0});a.on("error",c=>n({success:!1,error:c.message})),a.unref(),n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.on("openInTerminal",({dirPath:t},n)=>{try{if(!t||!re.default.existsSync(t))return n({success:!1,error:"Directory not found"});let i=process.platform,s,o,a={detached:!0,stdio:"ignore",windowsHide:!0};i==="darwin"?(s="open",o=["-a","Terminal",t]):i==="win32"?(s="cmd",o=["/C","start",'"9Remote"',"cmd","/K"],a.shell=!1,a.cwd=t):(s="gnome-terminal",o=["--working-directory",t]);let c=(0,ao.spawn)(s,o,a);c.on("error",()=>{if(i==="linux"){let l=(0,ao.spawn)("xterm",["-e","bash"],{...a,cwd:t});l.on("error",u=>n({success:!1,error:u.message})),l.unref()}else n({success:!1,error:"Failed to open terminal"})}),c.unref(),n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.on("getFileTree",({dirPath:t,depth:n,showHidden:i},s)=>{try{let o=(t||en.default.homedir()).replace(/^~/,en.default.homedir());if(!re.default.existsSync(o))return s({success:!1,error:"Directory not found"});let c=Hk(o,typeof n=="number"?n:3,!!i);s({success:!0,tree:{name:Er.default.basename(o)||o,path:o,type:"folder",children:c}})}catch(o){s({success:!1,error:o.message})}})}var Vt=W(require("fs"),1),Ii=W(require("path"),1),Ni=require("child_process");var HH=5e3,Vg=new Map;function kn(r,e){return new Promise(t=>{let n=(0,Ni.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 lo(r,e){try{return(0,Ni.spawnSync)("git",r,{cwd:e,encoding:"utf-8",windowsHide:!0}).stdout??""}catch{return""}}function Gk(r){return Qu.includes(Ii.default.extname(r).toLowerCase())}function zk(r){r.on("gitStatus",({repoPath:e},t)=>{try{let n=(0,Ni.execSync)("git status --porcelain --no-renames",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}),i={};try{(0,Ni.execSync)("git diff HEAD --numstat --no-renames",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}).trim().split(`
|
|
176
|
+
`}var mU="# 9remote hooks begin",gU="# 9remote hooks end",vU=" # 9remote hooks begin",yU=" # 9remote hooks end",xU={claude:Ri("claude",{UserPromptSubmit:"working",PostToolUse:"working",Stop:"done",Notification:"blocked"},r=>r,{matchers:{Notification:"permission_prompt"},extra:EC}),codex:fU,gemini:Ri("gemini",{BeforeAgent:"working",PreToolUse:"working",PostToolUse:"working",AfterAgent:"done",Notification:"blocked"},r=>r),opencode:hU,grok:Ri("grok",{UserPromptSubmit:"working",PreToolUse:"working",PostToolUse:"working",Stop:"done",Notification:"blocked"},SC),cursor:cU("cursor",{stop:"done",beforeShellExecution:"blocked",beforeToolCall:"working"},{extra:r=>{r.version=r.version||1}}),antigravity:lU("antigravity","9remote",{UserPromptSubmit:"working",PreToolUse:"working",Stop:"done",Notification:"blocked"}),kiro:uU("kiro",{UserPromptSubmit:"working",PostToolUse:"working",preToolUse:"blocked",stop:"done"}),copilot:Ri("copilot",{UserPromptSubmit:"working",PostToolUse:"working",PreToolUse:"blocked",Stop:"done"},r=>r),codebuddy:Ri("codebuddy",{UserPromptSubmit:"working",PostToolUse:"working",PreToolUse:"blocked",Stop:"done"},r=>r),factory:Ri("factory",{UserPromptSubmit:"working",PostToolUse:"working",PreToolUse:"blocked",Stop:"done"},r=>r),qoder:Ri("qoder",{UserPromptSubmit:"working",PostToolUse:"working",PreToolUse:"blocked",Stop:"done"},r=>r),rovodev:mC("rovodev",{begin:vU,end:yU,items:[{event:"on_complete",type:"done"},{event:"on_error",type:"done"},{event:"on_tool_permission",type:"blocked"},{event:"on_message",type:"working"},{event:"on_tool_start",type:"working"}]}),hermes:(()=>{let r=mC("hermes",{begin:mU,end:gU,items:[{event:"pre_llm_call",type:"working"},{event:"pre_tool_call",type:"working"},{event:"post_tool_call",type:"working"},{event:"pre_approval_request",type:"blocked"},{event:"post_llm_call",type:"done"}]}),e=()=>ft.default.join(ft.default.dirname(Ce.hermes()),"shell-hooks-allowlist.json");return{enable:()=>{let t=r.enable(Ce.hermes()),n=Lt(e()),i=(n.approvals||[]).filter(s=>!(typeof s.command=="string"&&s.command.includes("&tool=hermes")));return n.approvals=[...i,...[{event:"pre_llm_call",type:"working"},{event:"pre_tool_call",type:"working"},{event:"post_tool_call",type:"working"},{event:"pre_approval_request",type:"blocked"},{event:"post_llm_call",type:"done"}].map(({event:s,type:o})=>({event:s,command:Qs(o,"hermes"),approved_at:"2020-01-01T00:00:00Z"}))],wr(e(),n),t},disable:()=>{let t=r.disable(Ce.hermes()),n=e();if(X.default.existsSync(n)){let i=Lt(n);i.approvals=(i.approvals||[]).filter(s=>!(typeof s.command=="string"&&s.command.includes("&tool=hermes"))),i.approvals.length?wr(n,i):X.default.unlinkSync(n)}return t},isEnabled:()=>r.isEnabled(Ce.hermes())}})(),amp:{enable(){let r=Ce.amp(),e=ft.default.dirname(r);return X.default.existsSync(e)||X.default.mkdirSync(e,{recursive:!0}),X.default.writeFileSync(r,_C("amp","amp","agent.start","agent.end"),"utf8"),{success:!0}},disable(){return X.default.existsSync(Ce.amp())&&X.default.unlinkSync(Ce.amp()),{success:!0}},isEnabled(){return X.default.existsSync(Ce.amp())}},pi:{enable(){let r=Ce.pi(),e=ft.default.dirname(r);return X.default.existsSync(e)||X.default.mkdirSync(e,{recursive:!0}),X.default.writeFileSync(r,_C("pi","pi","agent_start","agent_end"),"utf8"),{success:!0}},disable(){return X.default.existsSync(Ce.pi())&&X.default.unlinkSync(Ce.pi()),{success:!0}},isEnabled(){return X.default.existsSync(Ce.pi())}}},_U=ey;function bU(r){let e=xU[r];if(!e)return{success:!1,error:"Unknown tool"};try{return r==="codex"||r==="opencode"||r==="amp"||r==="pi"?e.enable():e.enable(Ce[r]())}catch(t){return{success:!1,error:t.message}}}function wU(r){let e=(process.env.PATH||"").split(ft.default.delimiter).filter(Boolean),t=process.platform==="win32"?(process.env.PATHEXT||".EXE;.CMD;.BAT").split(";"):[""];return e.some(n=>t.some(i=>{try{return X.default.existsSync(ft.default.join(n,r+i))}catch{return!1}}))}function SU(r){let e=nU[r];if(e&&wU(e))return!0;let t=iU[r]?.();return t?(Array.isArray(t)?t:[t]).some(n=>X.default.existsSync(n)):!1}function TC(){let r={};for(let e of _U)if(SU(e))try{r[e]=bU(e).success}catch{r[e]=!1}return r}function CC(){let r=Ce.claude(),e=Lt(r);if(!e.hooks?.Stop&&!e.hooks?.Notification)return;let t=e.env||{};Object.keys(bo).some(i=>t[i]!==bo[i])&&(EC(e),wr(r,e))}_i();var mV=(0,AC.dirname)((0,RC.fileURLToPath)(__importMetaUrl)),gV=yo.rgb(230,138,110),Ym="daemon",EU="2.1.20",Qr=new Map,OC=new Map,MC={},PC=[];async function kC(){let r=await $l(),e=new Map(r.map(n=>[n.id,n])),t=em();for(let n of r)if(!t[n.id])try{await bi(n.id)}catch{}Qr.clear();for(let[n,i]of Object.entries(t)){let s=e.get(n);Qr.set(n,{daemon:!0,name:i.name,createdAt:i.createdAt,shellId:i.shellId,cwd:s?.cwd||i.cwd,lastCols:i.cols??null,lastRows:i.rows??null,needsRespawn:!s})}er(Qr)}async function IC(){let r=TE();for(let n of r.groups)OC.set(n.id,n);Object.assign(MC,r.sessionGroups),PC.push(...r.sessionOrder);try{CC()}catch{}try{TC()}catch{}if(Ym==="daemon")if(!await RS())console.error("\u274C Failed to connect to PTY daemon, falling back to buffer mode");else{await kC(),la("connected",()=>{kC().catch(()=>{})});return}console.log("\u{1F4E6} Buffer persistence mode - scrollback enabled");let e=EE(),t=em();for(let n of e){let i=t[n]||{};Qr.set(n,{pty:null,name:i.name||`Terminal ${Qr.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 eo(r,e){Ym==="daemon"&&(la("output",({sessionId:i,enc:s,data:o,replay:a})=>{a!==!0&&fC(i),ut(r,"output",{sessionId:i,enc:s,data:o,replay:a===!0})}),dC(i=>ut(r,"statusState",wa())),la("cwdChange",({sessionId:i,cwd:s})=>{let o=Qr.get(i);o&&s&&o.cwd!==s&&(o.cwd=s,er(Qr)),ut(r,"cwdChange",{sessionId:i,cwd:s})}),la("sessionClosed",i=>{Qr.delete(i),Vm(i),ut(r,"sessionClosed",i),ut(r,"notificationCleared",i)}));let t=()=>({version:EU,remoteAvailable:Os(),daemonMode:Ym==="daemon"&&It(),platform:process.platform,updateAvailable:Yw(),canSelfUpdate:!0,caps:{joinSessionSize:!0},...gE()}),n=()=>{let i=t();for(let s of r.sockets.sockets.values())s.data?.approved&&s.emit("serverInfo",i)};Zw(n),eo._buildServerInfo=t,eo._emitServerInfo=n}function NC(){eo._emitServerInfo?.()}var DC=null;function LC(r){DC=r}async function BC(r,e,t){vE(),DC?.(),r.emit("serverInfo",eo._buildServerInfo?.()),NE(r,e,Qr,OC,MC,PC),FE(r,Qr),hC(r,e),Xl()&&await mE(r,t).catch(n=>{console.error("\u274C Failed to setup remote handlers:",n.message)}),r.on("disconnect",()=>{oC(r.id),yE()})}var re=W(require("fs"),1),Er=W(require("path"),1),tn=W(require("os"),1),ao=require("child_process"),GA=W(LA(),1),tp=W(require("sharp"),1);var Kg=["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"],Qu=[".zip",".tar",".gz",".tgz",".rar",".7z",".bz2",".xz",".exe",".dll",".so",".dylib",".app",".bin",".woff",".woff2",".ttf",".eot",".otf",".sqlite",".db",".mdb",".class",".jar",".war",".pyc",".o",".obj"];var BA=[".ssh",".aws",".gnupg",".kube",".docker",".cargo",".npmrc",".netrc",".pypirc",".config/gh",".config/gcloud"],jA=["/etc/shadow","/etc/sudoers","/etc/ssh","/root","/private/etc/sudoers"];var ep=W(require("fs"),1),Jn=W(require("path"),1),FA=W(require("os"),1);var UA=FA.default.homedir();function UH(r){if(!r)return null;let e=r.startsWith("~")?r.replace(/^~/,UA):r,t=Jn.default.resolve(e);try{return ep.default.realpathSync(t)}catch{let n=t,i=[];for(;!ep.default.existsSync(n);){i.unshift(Jn.default.basename(n));let s=Jn.default.dirname(n);if(s===n)return t;n=s}try{return Jn.default.join(ep.default.realpathSync(n),...i)}catch{return t}}}function wt(r){let e=UH(r);if(!e)return!1;for(let t of jA)if(e===t||e.startsWith(t+Jn.default.sep))return!0;for(let t of BA){let n=Jn.default.join(UA,t);if(e===n||e.startsWith(n+Jn.default.sep))return!0}return!1}var GH={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",avif:"image/avif",apng:"image/apng",tif:"image/tiff",tiff:"image/tiff",mp4:"video/mp4",m4v:"video/mp4",webm:"video/webm",ogv:"video/ogg",mov:"video/quicktime",mkv:"video/x-matroska",avi:"video/x-msvideo","3gp":"video/3gpp",mp3:"audio/mpeg",wav:"audio/wav",ogg:"audio/ogg",oga:"audio/ogg",flac:"audio/flac",m4a:"audio/mp4",aac:"audio/aac",opus:"audio/opus",pdf:"application/pdf"};function rp(r){return Kg.includes(r)}function co(r){return Qu.includes(Er.default.extname(r).toLowerCase())}function zH(r,e){return r.isDirectory()?"folder":co(e)?"binary":"file"}function Zn(r){return r<1024?`${r}B`:r<1024*1024?`${(r/1024).toFixed(1)}KB`:`${(r/(1024*1024)).toFixed(1)}MB`}async function HA(r){let e=await(0,tp.default)(r).metadata(),t=e.width||0,n=e.height||0,i=[80,60,40],s=[1600,1200,800],o=r,a=t,c=n;for(let l of s)for(let u of i){o=await(0,tp.default)(r).resize({width:l,height:l,fit:"inside",withoutEnlargement:!0}).jpeg({quality:u,mozjpeg:!0}).toBuffer();let f=await(0,tp.default)(o).metadata();if(a=f.width||l,c=f.height||l,o.length<=3145728)return{buffer:o,width:a,height:c,originalWidth:t,originalHeight:n}}return{buffer:o,width:a,height:c,originalWidth:t,originalHeight:n}}function zA(r,e,t,n=50){if(!(t.length>=n))try{for(let i of re.default.readdirSync(r)){if(t.length>=n)return;if(i.startsWith(".")||rp(i))continue;let s=Er.default.join(r,i);try{let o=re.default.statSync(s);o.isDirectory()?zA(s,e,t,n):i.toLowerCase().includes(e.toLowerCase())&&t.push({name:i,path:s,type:co(i)?"binary":"file",size:o.size,sizeFormatted:Zn(o.size)})}catch{}}}catch{}}function WA(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 VA(r,e,t,n,i,s){if(s.length>=200)return;let o;try{o=re.default.readdirSync(r,{withFileTypes:!0})}catch{return}for(let a of o){if(s.length>=200)return;if(rp(a.name))continue;let c=Er.default.join(r,a.name),l=Er.default.relative(e,c);if(a.isDirectory()){VA(c,e,t,n,i,s);continue}if(a.isFile()&&!co(a.name)&&!wt(c)&&!(i&&i.test(l))&&!(n&&!n.test(l)))try{if(re.default.statSync(c).size>1048576)continue;let d=re.default.readFileSync(c,"utf-8").split(`
|
|
177
|
+
`),g=[];for(let y=0;y<d.length&&g.length<10;y++){let b=d[y],C=t(b);for(let R of C){if(g.length>=10)break;g.push({line:y+1,column:R.column+1,lineText:b,matchLength:R.length})}}g.length&&s.push({path:c,matches:g})}catch{}}}function KA(r,e,t){let n;try{n=re.default.readdirSync(r,{withFileTypes:!0})}catch{return[]}let i=[];for(let s of n){if(!t&&s.name.startsWith(".")&&s.name!==".env"&&s.name!==".env.example"||rp(s.name))continue;let o=Er.default.join(r,s.name);if(s.isDirectory()){let a={name:s.name,path:o,type:"folder"};e>0&&(a.children=KA(o,e-1,t)),i.push(a)}else s.isFile()&&i.push({name:s.name,path:o,type:co(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 VH(){if(process.platform!=="win32")return[];try{return(0,ao.execSync)("wmic logicaldisk get name",{encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}).split(/\r?\n/).map(e=>e.trim()).filter(e=>/^[A-Z]:$/.test(e)).map(e=>({letter:e[0],path:e+"\\"}))}catch{return"CDEFGHIJ".split("").map(r=>`${r}:\\`).filter(r=>re.default.existsSync(r)).map(r=>({letter:r[0],path:r}))}}function YA(r){r.on("getSystemInfo",t=>{let n=process.platform;t({success:!0,platform:n,isWindows:n==="win32",drives:n==="win32"?VH():[],homedir:tn.default.homedir()})}),r.on("getFiles",({dirPath:t,showHidden:n},i)=>{try{let s=t||tn.default.homedir(),o=s.startsWith("~")?s.replace("~",tn.default.homedir()):s;if(wt(o))return i({success:!1,error:"Access denied"});if(!re.default.existsSync(o))return i({success:!1,error:"Directory not found"});let a=[];for(let c of re.default.readdirSync(o))if(!(!n&&c.startsWith(".")&&c!==".env"&&c!==".env.example")&&!rp(c))try{let l=Er.default.join(o,c),u=re.default.statSync(l);a.push({name:c,path:l,type:zH(u,c),size:u.isFile()?u.size:null,sizeFormatted:u.isFile()?Zn(u.size):null,modified:u.mtime.getTime()})}catch{}a.sort((c,l)=>c.type==="folder"&&l.type!=="folder"?-1:c.type!=="folder"&&l.type==="folder"?1:c.name.localeCompare(l.name)),i({success:!0,files:a,currentPath:o,parentPath:Er.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||tn.default.homedir()).replace(/^~/,tn.default.homedir());if(!re.default.existsSync(s))return i({success:!1,error:"Workspace not found"});let o=[];zA(s,n,o,50),o.sort((a,c)=>{let l=a.name.toLowerCase()===n.toLowerCase(),u=c.name.toLowerCase()===n.toLowerCase();return l&&!u?-1:!l&&u?1:a.path.length-c.path.length}),i({success:!0,files:o})}catch(s){i({success:!1,error:s.message})}}),r.on("readFile",({filePath:t},n)=>{try{if(wt(t))return n({success:!1,error:"Access denied"});if(!re.default.existsSync(t))return n({success:!1,error:"File not found"});let i=re.default.statSync(t);if(i.size>1048576)return n({success:!1,error:`File too large (${Zn(i.size)}). Max ${Zn(1048576)}`});if(co(t))return n({success:!1,error:"Cannot open binary file"});n({success:!0,content:re.default.readFileSync(t,"utf-8")})}catch(i){n({success:!1,error:i.message})}}),r.on("readMedia",async({filePath:t},n)=>{try{if(wt(t))return n({success:!1,error:"Access denied"});if(!re.default.existsSync(t))return n({success:!1,error:"File not found"});let i=re.default.statSync(t),s=Er.default.extname(t).toLowerCase().slice(1),o=GH[s]||"application/octet-stream",a=o.startsWith("image/"),c=a?20971520:5242880;if(i.size>c)return n({success:!1,error:`File too large (${Zn(i.size)}). Max ${Zn(c)}`});let l=re.default.readFileSync(t);if(a){let u=await HA(l),f=`data:image/jpeg;base64,${u.buffer.toString("base64")}`;n({success:!0,dataUrl:f,size:i.size,mime:o,originalSize:i.size,originalWidth:u.originalWidth,originalHeight:u.originalHeight,width:u.width,height:u.height,scaled:u.buffer.length<i.size})}else{let u=`data:${o};base64,${l.toString("base64")}`;n({success:!0,dataUrl:u,size:i.size,mime:o})}}catch(i){n({success:!1,error:i.message})}}),r.on("readImage",async({filePath:t},n)=>{try{if(wt(t))return n({success:!1,error:"Access denied"});if(!re.default.existsSync(t))return n({success:!1,error:"File not found"});let i=re.default.statSync(t);if(i.size>20971520)return n({success:!1,error:`Image too large (${Zn(i.size)}). Max ${Zn(20971520)}`});let s=re.default.readFileSync(t),o=await HA(s),a=`data:image/jpeg;base64,${o.buffer.toString("base64")}`;n({success:!0,dataUrl:a,size:i.size,mime:"image/jpeg",originalSize:i.size,originalWidth:o.originalWidth,originalHeight:o.originalHeight,width:o.width,height:o.height,scaled:o.buffer.length<i.size})}catch(i){n({success:!1,error:i.message})}}),r.on("writeFile",({filePath:t,content:n},i)=>{try{if(wt(t))return i({success:!1,error:"Access denied"});re.default.writeFileSync(t,n,"utf-8"),i({success:!0})}catch(s){i({success:!1,error:s.message})}}),r.on("createItem",({itemPath:t,type:n},i)=>{try{if(wt(t))return i({success:!1,error:"Access denied"});if(re.default.existsSync(t))return i({success:!1,error:"Item already exists"});n==="folder"?re.default.mkdirSync(t,{recursive:!0}):re.default.writeFileSync(t,"","utf-8"),i({success:!0})}catch(s){i({success:!1,error:s.message})}}),r.on("deleteItem",({itemPath:t},n)=>{try{if(wt(t))return n({success:!1,error:"Access denied"});if(!re.default.existsSync(t))return n({success:!1,error:"Item not found"});re.default.statSync(t).isDirectory()?re.default.rmSync(t,{recursive:!0}):re.default.unlinkSync(t),n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.on("renameItem",({oldPath:t,newPath:n},i)=>{try{if(wt(t)||wt(n))return i({success:!1,error:"Access denied"});if(!re.default.existsSync(t))return i({success:!1,error:"Item not found"});if(re.default.existsSync(n))return i({success:!1,error:"Target already exists"});re.default.renameSync(t,n),i({success:!0})}catch(s){i({success:!1,error:s.message})}}),r.on("searchInFiles",({workspace:t,query:n,caseSensitive:i,regex:s,includeGlob:o,excludeGlob:a},c)=>{try{if(!n)return c({success:!0,results:[]});let l=(t||tn.default.homedir()).replace(/^~/,tn.default.homedir());if(!re.default.existsSync(l))return c({success:!1,error:"Workspace not found"});let u;if(s){let y;try{y=new RegExp(n,i?"g":"gi")}catch(b){return c({success:!1,error:`Invalid regex: ${b.message}`})}u=b=>{let C=[],R;for(y.lastIndex=0;(R=y.exec(b))!==null;)C.push({column:R.index,length:R[0].length}),R.index===y.lastIndex&&y.lastIndex++;return C}}else{let y=i?n:n.toLowerCase();u=b=>{let C=i?b:b.toLowerCase(),R=[],O=0;for(;(O=C.indexOf(y,O))!==-1;)R.push({column:O,length:y.length}),O+=y.length||1;return R}}let f=WA(o),d=WA(a),g=[];VA(l,l,u,f,d,g),c({success:!0,results:g})}catch(l){c({success:!1,error:l.message})}}),r.on("replaceInFiles",({workspace:t,query:n,replacement:i,caseSensitive:s,regex:o,files:a},c)=>{try{if(!n||!Array.isArray(a)||!a.length)return c({success:!0,replacedCount:0,fileCount:0});let l;if(o){let d;try{d=new RegExp(n,s?"g":"gi")}catch(g){return c({success:!1,error:`Invalid regex: ${g.message}`})}l=g=>{let y=0;return{next:g.replace(d,C=>(y++,i)),count:y}}}else l=d=>{let g=0,y=s?"g":"gi",b=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),C=new RegExp(b,y);return{next:d.replace(C,()=>(g++,i)),count:g}};let u=0,f=0;for(let d of a)try{if(!re.default.existsSync(d)||co(d)||wt(d))continue;let g=re.default.statSync(d);if(!g.isFile()||g.size>1048576)continue;let y=re.default.readFileSync(d,"utf-8"),{next:b,count:C}=l(y);C>0&&(re.default.writeFileSync(d,b,"utf-8"),u+=C,f++)}catch{}c({success:!0,replacedCount:u,fileCount:f})}catch(l){c({success:!1,error:l.message})}});let e=new Map;r.on("watchDir",({dirPath:t},n)=>{try{if(!t||!re.default.existsSync(t))return n({success:!1,error:"Directory not found"});let i=e.get(t);if(i)return i.count++,n({success:!0});let s=GA.default.watch(t,{depth:0,ignoreInitial:!0,persistent:!0,ignored:a=>Kg.includes(Er.default.basename(a))}),o=a=>c=>r.emit("fileChange",{type:a,path:c});s.on("add",o("add")).on("change",o("change")).on("unlink",o("unlink")).on("addDir",o("addDir")).on("unlinkDir",o("unlinkDir")),e.set(t,{w:s,count:1}),n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.on("unwatchDir",({dirPath:t},n)=>{try{let i=e.get(t);i&&--i.count<=0&&(i.w.close(),e.delete(t)),n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.once("disconnect",()=>{for(let{w:t}of e.values())try{t.close()}catch{}e.clear()}),r.on("revealInOS",({filePath:t},n)=>{try{if(!t)return n({success:!1,error:"No path"});let i=process.platform,s,o;i==="darwin"?(s="open",o=["-R",t]):i==="win32"?(s="explorer",o=[`/select,${t}`]):(s="xdg-open",o=[Er.default.dirname(t)]);let a=(0,ao.spawn)(s,o,{detached:!0,stdio:"ignore",windowsHide:!0});a.on("error",c=>n({success:!1,error:c.message})),a.unref(),n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.on("openInTerminal",({dirPath:t},n)=>{try{if(!t||!re.default.existsSync(t))return n({success:!1,error:"Directory not found"});let i=process.platform,s,o,a={detached:!0,stdio:"ignore",windowsHide:!0};i==="darwin"?(s="open",o=["-a","Terminal",t]):i==="win32"?(s="cmd",o=["/C","start",'"9Remote"',"cmd","/K"],a.shell=!1,a.cwd=t):(s="gnome-terminal",o=["--working-directory",t]);let c=(0,ao.spawn)(s,o,a);c.on("error",()=>{if(i==="linux"){let l=(0,ao.spawn)("xterm",["-e","bash"],{...a,cwd:t});l.on("error",u=>n({success:!1,error:u.message})),l.unref()}else n({success:!1,error:"Failed to open terminal"})}),c.unref(),n({success:!0})}catch(i){n({success:!1,error:i.message})}}),r.on("getFileTree",({dirPath:t,depth:n,showHidden:i},s)=>{try{let o=(t||tn.default.homedir()).replace(/^~/,tn.default.homedir());if(!re.default.existsSync(o))return s({success:!1,error:"Directory not found"});let c=KA(o,typeof n=="number"?n:3,!!i);s({success:!0,tree:{name:Er.default.basename(o)||o,path:o,type:"folder",children:c}})}catch(o){s({success:!1,error:o.message})}})}var Vt=W(require("fs"),1),Ii=W(require("path"),1),Ni=require("child_process");var YH=5e3,Xg=new Map;function On(r,e){return new Promise(t=>{let n=(0,Ni.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 lo(r,e){try{return(0,Ni.spawnSync)("git",r,{cwd:e,encoding:"utf-8",windowsHide:!0}).stdout??""}catch{return""}}function XA(r){return Qu.includes(Ii.default.extname(r).toLowerCase())}function JA(r){r.on("gitStatus",({repoPath:e},t)=>{try{let n=(0,Ni.execSync)("git status --porcelain --no-renames",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}),i={};try{(0,Ni.execSync)("git diff HEAD --numstat --no-renames",{cwd:e,encoding:"utf-8",stdio:["pipe","pipe","pipe"],windowsHide:!0}).trim().split(`
|
|
178
178
|
`).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(`
|
|
179
|
-
`).filter(Boolean)){let a=o.match(/^([MADRCU?! ]{1,2})\s+(.+)$/);if(!a)continue;let c=a[1],l=a[2].replace(/\r+$/,"").trim();if(l.startsWith('"')&&l.endsWith('"')&&(l=l.slice(1,-1)),!l)continue;let u;c.includes("?")?u="?":c.includes("A")?u="A":c.includes("D")?u="D":c.includes("M")?u="M":c.includes("R")?u="R":u=c.trim()[0]||"?";let f=i[l]||{added:0,deleted:0};if(u==="?")try{let d=Ii.default.join(e,l);if(Vt.default.existsSync(d)&&!
|
|
180
|
-
`).length,f.deleted=0}}catch{}s.push({status:u,path:l,added:f.added,deleted:f.deleted})}t({success:!0,files:s})}catch{t({success:!1,error:"Not a git repository or git not available"})}}),r.on("gitChangedCount",async({repoPath:e},t)=>{let n=
|
|
181
|
-
`).length:0}:{success:!1,error:"Not a git repository or git not available"};return
|
|
179
|
+
`).filter(Boolean)){let a=o.match(/^([MADRCU?! ]{1,2})\s+(.+)$/);if(!a)continue;let c=a[1],l=a[2].replace(/\r+$/,"").trim();if(l.startsWith('"')&&l.endsWith('"')&&(l=l.slice(1,-1)),!l)continue;let u;c.includes("?")?u="?":c.includes("A")?u="A":c.includes("D")?u="D":c.includes("M")?u="M":c.includes("R")?u="R":u=c.trim()[0]||"?";let f=i[l]||{added:0,deleted:0};if(u==="?")try{let d=Ii.default.join(e,l);if(Vt.default.existsSync(d)&&!XA(l)&&!wt(d)){let g=Vt.default.readFileSync(d,"utf-8");f.added=g.split(`
|
|
180
|
+
`).length,f.deleted=0}}catch{}s.push({status:u,path:l,added:f.added,deleted:f.deleted})}t({success:!0,files:s})}catch{t({success:!1,error:"Not a git repository or git not available"})}}),r.on("gitChangedCount",async({repoPath:e},t)=>{let n=Xg.get(e),i=Date.now();if(n&&i-n.ts<YH){t(n.value);return}if(n?.pending){try{t(await n.pending)}catch{t({success:!1})}return}let s=On(["status","--porcelain","--no-renames"],e).then(o=>{let a=o.code===0?{success:!0,count:o.stdout.trim()?o.stdout.trim().split(`
|
|
181
|
+
`).length:0}:{success:!1,error:"Not a git repository or git not available"};return Xg.set(e,{ts:Date.now(),value:a,pending:null}),a}).catch(()=>({success:!1}));Xg.set(e,{ts:i,value:{success:!1},pending:s});try{t(await s)}catch{t({success:!1})}}),r.on("gitFileStatus",({repoPath:e,filePath:t},n)=>{try{let i=Ii.default.relative(e,t),o=lo(["status","--porcelain","--",i],e).trim();if(!o)return n({success:!0,status:null});let a=o.match(/^([MADRCU?! ]{1,2})\s+(.+)$/);if(!a)return n({success:!0,status:null});let c=a[1],l;c.includes("?")?l="?":c.includes("A")?l="A":c.includes("D")?l="D":c.includes("M")?l="M":c.includes("R")?l="R":l=c.trim()[0]||"?",n({success:!0,status:l,file:i})}catch{n({success:!0,status:null})}}),r.on("gitDiff",({repoPath:e,file:t,status:n},i)=>{try{let s="";if(t&&n==="?"){let o=Ii.default.join(e,t);if(Vt.default.existsSync(o)&&!wt(o)){let c=Vt.default.readFileSync(o,"utf-8").split(`
|
|
182
182
|
`);s=`diff --git a/${t} b/${t}
|
|
183
183
|
new file mode 100644
|
|
184
184
|
--- /dev/null
|
|
@@ -186,7 +186,7 @@ new file mode 100644
|
|
|
186
186
|
@@ -0,0 +1,${c.length} @@
|
|
187
187
|
${c.map(l=>`+${l}`).join(`
|
|
188
188
|
`)}`}}else if(t)s=lo(["diff","HEAD","--",t],e);else{s=lo(["diff","HEAD"],e);let a=lo(["status","--porcelain","--no-renames"],e).trim().split(`
|
|
189
|
-
`).filter(c=>c.startsWith("??")).map(c=>c.substring(3));for(let c of a){let l=Ii.default.join(e,c);if(Vt.default.existsSync(l)&&!
|
|
189
|
+
`).filter(c=>c.startsWith("??")).map(c=>c.substring(3));for(let c of a){let l=Ii.default.join(e,c);if(Vt.default.existsSync(l)&&!XA(c)&&!wt(l))try{if(Vt.default.statSync(l).size<=1048576){let d=Vt.default.readFileSync(l,"utf-8").split(`
|
|
190
190
|
`);s+=`
|
|
191
191
|
diff --git a/${c} b/${c}
|
|
192
192
|
new file mode 100644
|
|
@@ -194,8 +194,8 @@ new file mode 100644
|
|
|
194
194
|
+++ b/${c}
|
|
195
195
|
@@ -0,0 +1,${d.length} @@
|
|
196
196
|
${d.map(g=>`+${g}`).join(`
|
|
197
|
-
`)}`}}catch{}}}i({success:!0,diff:s})}catch(s){i({success:!1,error:s.message})}}),r.on("gitBranch",async({repoPath:e},t)=>{let n=await
|
|
198
|
-
`).filter(Boolean).map(a=>{let[c,...l]=a.split(" ");return{hash:c,message:l.join(" ")}});n({success:!0,commits:o})}catch(i){n({success:!1,error:i.message})}}),r.on("gitDiscard",({repoPath:e,file:t,status:n},i)=>{try{if(!t)return i({success:!1,error:"No file specified"});let s=Ii.default.join(e,t);if(wt(s))return i({success:!1,error:"Access denied"});n==="?"?Vt.default.existsSync(s)&&(Vt.default.statSync(s).isDirectory()?Vt.default.rmSync(s,{recursive:!0}):Vt.default.unlinkSync(s)):n==="A"?(lo(["reset","HEAD","--",t],e),Vt.default.existsSync(s)&&!wt(s)&&Vt.default.unlinkSync(s)):lo(["checkout","HEAD","--",t],e),i({success:!0})}catch(s){i({success:!1,error:s.message})}})}function
|
|
197
|
+
`)}`}}catch{}}}i({success:!0,diff:s})}catch(s){i({success:!1,error:s.message})}}),r.on("gitBranch",async({repoPath:e},t)=>{let n=await On(["branch","--show-current"],e);if(n.code!==0)return t({success:!1});let i={success:!0,branch:n.stdout.trim()},s=await On(["rev-list","--left-right","--count","@{u}...HEAD"],e);if(s.code===0){let[o,a]=s.stdout.trim().split(/\s+/).map(c=>parseInt(c,10));i.ahead=Number.isFinite(a)?a:null,i.behind=Number.isFinite(o)?o:null}else i.ahead=null,i.behind=null;t(i)}),r.on("gitAdd",async({repoPath:e,files:t},n)=>{try{let i=Array.isArray(t)&&t.length?t:["."],s=await On(["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 On(["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 On(["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 On(["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 On(["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 On(["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(`
|
|
198
|
+
`).filter(Boolean).map(a=>{let[c,...l]=a.split(" ");return{hash:c,message:l.join(" ")}});n({success:!0,commits:o})}catch(i){n({success:!1,error:i.message})}}),r.on("gitDiscard",({repoPath:e,file:t,status:n},i)=>{try{if(!t)return i({success:!1,error:"No file specified"});let s=Ii.default.join(e,t);if(wt(s))return i({success:!1,error:"Access denied"});n==="?"?Vt.default.existsSync(s)&&(Vt.default.statSync(s).isDirectory()?Vt.default.rmSync(s,{recursive:!0}):Vt.default.unlinkSync(s)):n==="A"?(lo(["reset","HEAD","--",t],e),Vt.default.existsSync(s)&&!wt(s)&&Vt.default.unlinkSync(s)):lo(["checkout","HEAD","--",t],e),i({success:!0})}catch(s){i({success:!1,error:s.message})}})}function ZA(r){YA(r),JA(r)}var XH=1e3;function QA(r){let e=null,t=null,n=!1,i=async()=>{if(!n){n=!0;try{let s=await BE();s!==e&&(e=s,r.emit("clipboard:sync",{text:s,origin:"host"}))}catch{}finally{n=!1}}};r.on("clipboard:set",async({text:s,origin:o})=>{if(typeof s=="string"&&s!==e)try{await jE(s),e=s}catch(a){console.error("[clipboard] set failed:",a.message)}}),t=setInterval(i,XH),i(),r.on("disconnect",()=>{t&&clearInterval(t)})}bn();var Mn=require("fs"),tR=require("path");St();yh();var eR=ie.CONFIG,Jg=(0,tR.join)(ie.CONFIG,"approvedDevices.json"),Br=new Map,uo=!1,La=new Map,po=new Map;function rR(){(0,Mn.existsSync)(eR)||(0,Mn.mkdirSync)(eR,{recursive:!0})}function nR(){try{if(rR(),(0,Mn.existsSync)(Jg)){let r=JSON.parse((0,Mn.readFileSync)(Jg,"utf8"));Array.isArray(r)?Br=new Map(r.map(e=>[e,{approvedAt:null}])):Br=new Map(Object.entries(r)),Br.delete(xo)&&np()}}catch{Br=new Map}}function np(){try{rR(),(0,Mn.writeFileSync)(Jg,JSON.stringify(Object.fromEntries(Br),null,2))}catch{}}function iR(r){return r?Br.has(r):!1}function ip(r){!r||r===xo||(Br.set(r,{approvedAt:new Date().toISOString()}),np())}function sR(r){Br.delete(r),np()}function oR(r,e){let t=Br.get(r);return t?(Br.set(r,{...t,label:e||""}),np(),!0):!1}function aR(){return[...Br.entries()].map(([r,e])=>({deviceId:r,...e}))}function cR(r,e){La.set(r,e)}function Zg(r){return La.get(r)||null}function sp(r){La.delete(r)}function lR(r){if(!r)return!1;for(let e of La.values())if(e.deviceId===r)return!0;return!1}function uR(){return[...La.entries()].map(([r,e])=>({socketId:r,...e}))}function pR(r,e){r&&po.set(r,{...e,rejectedAt:new Date().toISOString()})}function fR(r){return r?po.has(r):!1}function dR(r,e,t){let n=po.get(r);n&&po.set(r,{...n,socketId:e,ip:t})}function hR(){return[...po.entries()].map(([r,e])=>({deviceId:r,...e}))}function fo(r){po.delete(r)}function mR(){return uo=!!ra().autoApprove,uo}function op(){return uo}function gR(r){return uo=!!r,Rl({autoApprove:uo}),uo}function Qg(){try{let r=(0,yR.join)(ie.ROOT,"keys.json");return JSON.parse((0,vR.readFileSync)(r,"utf8")).key||null}catch{return null}}var Di=null;function ja(){return Di}async function Ba(r){r.handshake.auth?.tempKey&&(_e("One-time key used \u2014 clearing from UI"),Kw()),await JH(r),ZA(r),QA(r),await BC(r,Di,Qg()),r.emit("terminal:ready")}async function JH(r){if(r.data.protocol)return;let{webrtc:e,streaming:t}=H,n=new Bl(r,{enableWebRTC:e.enableWebRTC,apiKey:e.enableTurn?Qg():null,turnApiUrl:e.enableTurn?e.turnApiUrl:null,turnRefreshInterval:e.turnRefreshInterval,dcMaxMessageSize:e.dcMaxMessageSize,dcChunkSize:e.dcChunkSize,dcMaxTilesPerFrame:e.dcMaxTilesPerFrame,answerTimeout:e.answerTimeout,maxControlBuffer:e.maxControlBuffer,wsChunkSize:t.chunkSize});r.data.protocol=n,xS(n),n.attachAsBus(r);try{await n.init(),n.setupSignaling(r)}catch(i){console.error("[transport] pm init failed:",i.message)}}function xR(r){let e=Di;if(!e)return!1;let t=e.sockets.sockets.get(r),n=Zg(r);return!t||!n?!1:(ip(n.deviceId),sp(r),fo(n.deviceId),t.data.approved=!0,t.emit("device:approved"),Ba(t),_e(`Device approved: ${n.deviceId.slice(0,8)}...`),!0)}function _R(r){let e=Di;if(!e||!r)return!1;ip(r),fo(r);for(let t of e.sockets.sockets.values())t.handshake.auth?.deviceId===r&&(t.data.approved=!0,t.emit("device:approved"),Ba(t));return _e(`Device approved from pending: ${r.slice(0,8)}...`),!0}function ap(r){let e=Di;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&&_e(`Disconnected ${t} socket(s) for device ${r.slice(0,8)}...`),t}function bR(r){let e=Di;if(!e)return!1;let t=Zg(r),n=e.sockets.sockets.get(r);return sp(r),t?.deviceId&&pR(t.deviceId,{ip:t.ip,socketId:r}),n&&(n.emit("device:rejected"),n.disconnect(!0)),Ct("deviceApproval",{action:"refresh"}),_e(`Device rejected: ${t?.deviceId?.slice(0,8)||"unknown"}...`),!0}async function wR(r){nR(),mR();let e=new cw(r,{cors:{origin:"*",methods:["GET","POST"],credentials:!0,allowedHeaders:["*"]},transports:["websocket","polling"],allowEIO3:!0,allowUpgrades:!0,pingTimeout:6e4,pingInterval:25e3,maxHttpBufferSize:1e8,perMessageDeflate:{threshold:1024}}),t=await lE();return Jw(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,d)=>{if(n.data.approved)return d();let g=f[0];return g==="device:clientReady"||g==="disconnect"?d():d(new Error("Device not approved"))});let o=n.handshake.address||"",a=o==="127.0.0.1"||o==="::1"||o==="::ffff:127.0.0.1",c=!!n.handshake.headers["cf-connecting-ip"],l=n.handshake.headers.origin,u=!l||tc.includes(l);if(!c&&a&&u&&pw(n.handshake.auth?.localToken)){n.data.approved=!0,n.data.localUi=!0,_e("Local UI connected \u2014 trusted (token)"),Ba(n);return}if(s===xo){_e(`Rejected untrusted local-ui socket from ${i}`),n.disconnect(!0);return}if(eS(n.id,i,s),_e(`Client connected: ${i} (device: ${s?.slice(0,8)||"none"})`),n.on("disconnect",f=>{tS(n.id),sp(n.id),_e(`Client disconnected: ${i} (${f})`);let d=n.data?.protocol;if(d&&!n.data?.remoteAttached){try{d.close()}catch{}Ps(d)}}),s&&iR(s))_e(`Device recognized: ${s.slice(0,8)}...`),n.data.approved=!0,Ba(n),n.once("device:clientReady",()=>n.emit("device:approved"));else if(s&&fR(s))dR(s,n.id,i),_e(`Rejected device reconnected: ${s.slice(0,8)} \u2014 waiting in Clients list`),n.emit("device:rejected"),Ct("deviceApproval",{action:"refresh"});else if(s&&op())ip(s),fo(s),n.data.approved=!0,_e(`Auto-approved device: ${s.slice(0,8)}...`),Ba(n),n.once("device:clientReady",()=>n.emit("device:approved")),Ct("deviceApproval",{action:"refresh"});else{if(_e(`Unknown device: ${s?.slice(0,8)||"no-id"} \u2014 waiting for approval`),lR(s)){_e(`Device ${s?.slice(0,8)} already pending, ignoring duplicate`),n.disconnect(!0);return}cR(n.id,{deviceId:s,ip:i}),n.once("device:clientReady",()=>{n.emit("device:pendingApproval"),Ct("deviceApproval",{socketId:n.id,deviceId:s,ip:i,action:"pending"})})}}),eo(e,Qg()),Di=e,e}function SR(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 ER(r,e){return r.method==="OPTIONS"?(e.writeHead(200),e.end(),!0):!1}var mo=require("zlib"),oO=W(rO(),1);var A4=["data:","javascript:","#","mailto:","blob:"],R4=["href","src","action","srcset","poster","data","formaction","data-src","data-href","data-url","data-background"];function pp(r,e){return!r||A4.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 nO(r,e){let t=`/proxy/${e}`,n=new RegExp(`(${R4.join("|")})=(["'])([^"']*?)\\2`,"gi");return r=r.replace(n,(i,s,o,a)=>{if(s.toLowerCase()==="srcset"){let c=a.split(",").map(l=>{let[u,...f]=l.trim().split(/\s+/),d=pp(u,e);return f.length?`${d} ${f.join(" ")}`:d}).join(", ");return`${s}=${o}${c}${o}`}return`${s}=${o}${pp(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 iO(r){let e=`/proxy/${r}`;return`
|
|
199
199
|
// Service Worker for 9Remote Proxy - Port ${r}
|
|
200
200
|
const PROXY_BASE = '${e}';
|
|
201
201
|
const TARGET_PORT = ${r};
|
|
@@ -250,7 +250,7 @@ self.addEventListener('fetch', (event) => {
|
|
|
250
250
|
|
|
251
251
|
event.respondWith(fetch(new Request(newUrl, requestInit)));
|
|
252
252
|
});
|
|
253
|
-
`}function
|
|
253
|
+
`}function sO(r){return`
|
|
254
254
|
<script data-proxy-injected="true">
|
|
255
255
|
(function() {
|
|
256
256
|
if (window.__proxySwRegistered) return;
|
|
@@ -292,7 +292,7 @@ self.addEventListener('fetch', (event) => {
|
|
|
292
292
|
});
|
|
293
293
|
}
|
|
294
294
|
})();
|
|
295
|
-
</script>`}var
|
|
295
|
+
</script>`}var gv=new Set;function aO(r){gv.add(String(r))}function cO(r){gv.delete(String(r))}function O4(r){return gv.has(String(r))}function M4(r){switch(r){case"gzip":return(0,mo.createGunzip)();case"deflate":return(0,mo.createInflate)();case"br":return(0,mo.createBrotliDecompress)();default:return null}}function P4(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 lO(){"";let r=oO.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=pp(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=M4(o),d=f?e.pipe(f):e,g=[];d.on("data",y=>g.push(y)),d.on("error",y=>{console.error("[Proxy] Decompress error:",y.message),n.writeHead(502),n.end("Bad Gateway: Decompression failed")}),d.on("end",()=>{let y=Buffer.concat(g).toString("utf8");y=nO(y,i);let b=sO(i);y=P4(y,b),n.writeHead(e.statusCode,c),n.end(y)})}),r}function uO(r,e,t,n,i,s){if(i==="/sw.js"){let o=iO(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(!O4(n)){t.writeHead(401,{"Content-Type":"text/html"}),t.end(`
|
|
296
296
|
<!DOCTYPE html>
|
|
297
297
|
<html>
|
|
298
298
|
<head><title>Unauthorized</title></head>
|
|
@@ -303,9 +303,9 @@ self.addEventListener('fetch', (event) => {
|
|
|
303
303
|
</div>
|
|
304
304
|
</body>
|
|
305
305
|
</html>
|
|
306
|
-
`);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
|
|
307
|
-
`);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=oO.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 O4(r,e=2e3){return new Promise(t=>{let n=aO.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 M4(r){let[e,t]=await Promise.all([R4(r),O4(r)]);return t.active?{port:r,...t}:e.active?{port:r,...e}:{port:r,active:!1}}async function uO(){let r=await k4();return(await Promise.all(r.map(t=>M4(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 pO=W(require("crypto"),1),P4=process.env.API_KEY_SECRET||"9remote-api-key-secret";function I4(){let r="abcdefghijklmnopqrstuvwxyz0123456789",e="";for(let t=0;t<4;t++)e+=r.charAt(Math.floor(Math.random()*r.length));return e}function fO(r,e){return pO.default.createHmac("sha256",P4).update(r+e).digest("hex").slice(0,6)}function dO(r){let e=r.slice(0,8),t=I4(),n=fO(e,t);return{key:`sk-${e}-${t}-${n}`,keyId:t}}function N4(r){if(!r||!r.startsWith("sk-"))return null;let e=r.split("-");if(e.length===4){let[,t,n,i]=e,s=fO(t,n);return i!==s?null:{machineId:t,keyId:n}}return null}function fp(r){return N4(r)!==null}async function hO(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(!fp(n)){e.setHeader("Content-Type","application/json"),e.writeHead(401),e.end(JSON.stringify({error:"Unauthorized: Invalid API key"}));return}let i=await uO();e.setHeader("Content-Type","application/json"),e.writeHead(200),e.end(JSON.stringify(i))}_l();var vO=require("url");var dp=W(require("path"),1),yO=W(require("os"),1);St();var mO=W(require("path"),1),gO=W(require("os"),1);var q5=mO.default.join(gO.default.homedir(),".9remote","pids");vh();var za={checkIntervalMs:36e5,connectCheckDebounceMs:9e5,maxRetry:3,retryDelayMs:3e3,verifyTimeoutMs:15e3,lockTtlMs:3e5,lockFile:"update.lock"};var W5={orange:yo.rgb(230,138,110),orangeDim:yo.rgb(200,120,95)};var Z5=dp.default.dirname((0,vO.fileURLToPath)(__importMetaUrl));var Q5=dp.default.join(yO.default.homedir(),".9remote","cloudflared.pid");function xO(r,e){let t=r.split(".").map(Number),n=e.split(".").map(Number);for(let i=0;i<3;i++){if(n[i]>t[i])return!0;if(n[i]<t[i])return!1}return!1}var eK=dp.default.join(se.STATE,za.lockFile);xn();Ft();St();Ts();var bO=W(_O(),1),mv=W(require("crypto"),1),{machineIdSync:D4}=bO.default;async function wO(r=null){let e=r||process.env.MACHINE_ID_SALT||"9remote-salt";try{let t=D4();return mv.default.createHash("sha256").update(t+e).digest("hex").substring(0,16)}catch(t){return console.error("Error getting machine ID:",t),mv.default.randomUUID().replace(/-/g,"").substring(0,16)}}xn();async function SO(r,e){let t=Ww(),n=t.workerUrl||"https://9remote.cc";if(!t.permanentKey){le(e,400,"No permanent key set");return}try{let s=await(await wo(`${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}`;yn({oneTimeKey:s.tempKey,oneTimeKeyExpiresAt:s.expiresAt,qrUrl:o}),Z(e,{oneTimeKey:s.tempKey,expiresAt:s.expiresAt,qrUrl:o})}catch(i){le(e,500,i.message)}}async function EO(r,e){try{let t=await wO(),{key:n}=dO(t),i=Ew();Tw(t,n,i?.name||"Default"),yn({permanentKey:n}),Z(e,{ok:!0,permanentKey:n})}catch(t){le(e,500,t.message)}}Ft();async function TO(r,e){let t=await jt(r,e);if(!t)return;let n=hR(t.socketId);Z(e,{ok:n})}async function CO(r,e){let t=await jt(r,e);if(!t)return;let n=gR(t.socketId);Z(e,{ok:n})}function AO(r,e){Z(e,{pending:sR()})}function kO(r,e){Z(e,{devices:rR()})}function RO(r,e){Z(e,{rejected:lR()})}async function OO(r,e){let t=await jt(r,e);if(!t)return;let n=mR(t.deviceId);Z(e,{ok:n})}async function MO(r,e){let t=await jt(r,e);t&&(ap(t.deviceId),fo(t.deviceId),Z(e))}async function PO(r,e){let t=await jt(r,e);t&&(ap(t.deviceId),eR(t.deviceId),Z(e))}async function IO(r,e){let t=await jt(r,e);if(!t)return;let n=ap(t.deviceId);Z(e,{disconnected:n})}function NO(r,e){Z(e,{enabled:op()})}async function DO(r,e){let t=await jt(r,e);if(!t)return;let n=tR(t.deviceId,t.label);Z(e,{ok:n})}async function LO(r,e){let t=await jt(r,e);if(!t)return;let n=pR(!!t.enabled);Z(e,{enabled:n})}Ft();_i();var BO={},L4=1e4;function jO(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 FO(r,e){let t="";await new Promise(n=>{r.on("data",i=>t+=i),r.on("end",n)});try{qO(jO(t,null)),Z(e,{success:!0})}catch{le(e,400,"Invalid JSON")}}function UO(r,e,{query:t}){qO(jO(null,t)),Z(e,{success:!0})}function qO({type:r,sessionId:e,tool:t}){let n=Date.now(),i=ja();if(!i||!e)return;let s={type:r,sessionId:e,tool:t,timestamp:n},a=Mu({type:r,sessionId:e,tool:t})?.state||pt.IDLE;if(ut(i,"statusChange",{sessionId:e,state:a,tool:t,since:n}),$m(e,s),ut(i,"chatNotification",s),a!==pt.DONE&&a!==pt.BLOCKED)return;let c=`${e}:${a}`;n-(BO[c]||0)<L4||(BO[c]=n,nC({...s,state:a}))}Ft();Il();Ts();dt();xn();function $O(){return{mode:Sh(),active:wh(),presets:Object.keys(H.sleepInhibit?.presets||{})}}function HO(r,e){Z(e,$O())}async function WO(r,e){let t=await jt(r,e);if(!t)return;let n=sa(t.mode);Sw({sleepInhibitMode:n});let i=$O();Ct("sleepInhibit",i),Z(e,i)}Ft();async function GO(r,e){try{let t=await $l();Z(e,{sessions:t})}catch(t){le(e,500,t.message)}}async function zO(r,e){let t=await jt(r,e);if(t){if(!t.sessionId)return le(e,400,"sessionId required");try{await bi(t.sessionId),Z(e)}catch(n){le(e,500,n.message)}}}var Mn=W(require("os"),1);dt();Ft();function B4(){let r=aE();if(!r?.activeClients)return{total:0,streaming:0};let e=0;for(let t of r.activeClients.values())t.isStreaming&&e++;return{total:r.activeClients.size,streaming:e}}function j4(){let r=process.memoryUsage(),e=Mn.default.cpus();return{agent:{pid:process.pid,version:"2.1.16",nodeVersion:process.version,platform:`${process.platform}/${process.arch}`,uptimeSec:Math.round(process.uptime()),memory:{heapUsedMB:Math.round(r.heapUsed/1048576*10)/10,heapTotalMB:Math.round(r.heapTotal/1048576*10)/10,rssMB:Math.round(r.rss/1048576*10)/10,externalMB:Math.round(r.external/1048576*10)/10}},os:{hostname:Mn.default.hostname(),platform:Mn.default.platform(),arch:Mn.default.arch(),uptimeSec:Math.round(Mn.default.uptime()),loadAvg:Mn.default.loadavg(),cpuModel:e?.[0]?.model||"unknown",cpuCount:e.length,totalMemMB:Math.round(Mn.default.totalmem()/1048576),freeMemMB:Math.round(Mn.default.freemem()/1048576)},remote:{available:Xl(),...B4(),memoryWarningThresholdMB:H.resourceManagement.memoryWarningThreshold},timestamp:Date.now()}}function VO(r,e){try{Z(e,j4())}catch(t){le(e,500,"stats error",t.message)}}Il();Ts();dt();ty();var Qn=Fr("server"),ei=(0,JO.fileURLToPath)(new URL(".",__importMetaUrl)),ZO=process.env.NODE_ENV==="development",F4=5173,gv=(0,Ui.existsSync)((0,sr.join)(ei,"ui","dist"))?(0,sr.join)(ei,"ui","dist"):(0,sr.join)(ei,"ui"),U4={".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 q4(r,e,t){let n=(0,hp.request)({hostname:"localhost",port:F4,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 KO(r,e){if(!(0,Ui.existsSync)(e))return!1;let t=U4[(0,sr.extname)(e)]||"application/octet-stream";return r.setHeader("Content-Type",t),r.writeHead(200),r.end((0,Ui.readFileSync)(e)),!0}async function vv(r){try{let e=await wo(Up);if(!e.ok)return;let{version:t}=await e.json();t&&xO(r,t)&&(Vw({version:t}),Ct("updateAvailable",{version:t}),RC())}catch{}}var YO=0;function $4(r){let e=Date.now();e-YO<za.connectCheckDebounceMs||(YO=e,vv(r))}function H4(r,e){if(process.env.CODESPACES!=="true"){le(e,400,"Not running on Codespaces");return}let t=process.env.CODESPACE_NAME;if(!t){le(e,400,"Codespace name not found");return}let n=ja();n&&n.emit("codespace:stopping"),Z(e,{success:!0,message:"Stopping codespace..."}),setTimeout(()=>(0,Fi.execFile)("gh",["codespace","stop","-c",t],{windowsHide:!0}),500)}var QO;async function XO(r,e,{pathname:t}){let n=r.headers.authorization;if(!n||!n.startsWith("Bearer ")||!fp(n.slice(7))){le(e,401,"Unauthorized");return}let{parseJsonBody:i}=await Promise.resolve().then(()=>(Ft(),Hi)),s=await i(r,e);if(s){if(!s.port){le(e,400,"Port required");return}t.endsWith("start")?rO(s.port):nO(s.port),Z(e,{success:!0})}}function W4(r,e,{pathname:t,search:n}){let i=t.match(/^\/proxy\/(\d+)(\/.*)?$/);i?sO(QO,r,e,i[1],i[2]||"/",n):le(e,404,"Not found")}var G4=[{path:"/api/health",method:"GET",public:!0,handler:(r,e)=>Z(e,{status:"ok",timestamp:Date.now()})},{path:"/api/version",method:"GET",public:!0,handler:(r,e)=>{Z(e,{version:"2.1.16"})}},{path:"/api/notify",method:"POST",public:!0,handler:FO},{path:"/api/notify",method:"GET",public:!0,handler:UO},{path:"/proxy/*",method:"*",public:!0,handler:W4},{path:"/api/ui/events",method:"GET",handler:eS},{path:"/api/local-token",method:"GET",handler:Xw},{path:"/api/ui/state",method:"GET",handler:tS},{path:"/api/ui/state",method:"POST",handler:rS},{path:"/api/ui/stop",method:"POST",handler:nS},{path:"/api/ui/start",method:"POST",handler:iS},{path:"/api/ui/stop-tunnel",method:"POST",handler:sS},{path:"/api/ui/shutdown",method:"POST",handler:oS},{path:"/api/update",method:"POST",handler:aS},{path:"/api/system/stats",method:"GET",handler:VO},{path:"/api/key/one-time",method:"POST",handler:SO},{path:"/api/key/regenerate",method:"POST",handler:EO},{path:"/api/device/approve",method:"POST",handler:TO},{path:"/api/device/reject",method:"POST",handler:CO},{path:"/api/device/pending",method:"GET",handler:AO},{path:"/api/device/approved",method:"GET",handler:kO},{path:"/api/device/rejected",method:"GET",handler:RO},{path:"/api/device/approve-rejected",method:"POST",handler:OO},{path:"/api/device/clear-rejected",method:"POST",handler:MO},{path:"/api/device/remove",method:"POST",handler:PO},{path:"/api/device/label",method:"POST",handler:DO},{path:"/api/device/disconnect",method:"POST",handler:IO},{path:"/api/device/auto-approve",method:"GET",handler:NO},{path:"/api/device/auto-approve",method:"POST",handler:LO},{path:"/api/connections",method:"GET",handler:cS},{path:"/api/logs",method:"GET",handler:lS},{path:"/api/permissions",method:"GET",handler:pS},{path:"/api/permissions/request",method:"POST",handler:hS},{path:"/api/desktop/toggle",method:"POST",handler:uS},{path:"/api/autostart",method:"GET",handler:fS},{path:"/api/autostart",method:"POST",handler:dS},{path:"/api/sleep-inhibit",method:"GET",handler:HO},{path:"/api/sleep-inhibit",method:"POST",handler:WO},{path:"/api/sessions",method:"GET",handler:GO},{path:"/api/sessions/delete",method:"POST",handler:zO},{path:"/api/local-sites",method:"*",public:!0,handler:hO},{path:"/api/codespace/stop",method:"POST",handler:H4},{path:"/api/proxy/start",method:"POST",public:!0,handler:XO},{path:"/api/proxy/end",method:"POST",public:!0,handler:XO}];var z4=parseInt(process.env.PORT||"2208",10),Ka=null;function V4(r){if(process.platform!=="win32")try{let e=(0,Fi.execSync)(`pgrep -f "vite --config ${r}"`,{encoding:"utf8"}).trim();for(let t of e.split(`
|
|
308
|
-
`).filter(Boolean))if((0,Fi.execSync)(`ps -o ppid= -p ${t}`,{encoding:"utf8"}).trim()==="1")try{process.kill(Number(t))}catch{}}catch{}}function
|
|
306
|
+
`);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 pO=W(require("http"),1),fO=W(require("https"),1),dO=require("child_process"),hO=require("util"),I4=(0,hO.promisify)(dO.exec);async function N4(){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 I4(t),i=n.split(`
|
|
307
|
+
`);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 D4(r,e=2e3){return new Promise(t=>{let n=pO.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 L4(r,e=2e3){return new Promise(t=>{let n=fO.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 B4(r){let[e,t]=await Promise.all([D4(r),L4(r)]);return t.active?{port:r,...t}:e.active?{port:r,...e}:{port:r,active:!1}}async function mO(){let r=await N4();return(await Promise.all(r.map(t=>B4(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 gO=W(require("crypto"),1),j4=process.env.API_KEY_SECRET||"9remote-api-key-secret";function F4(){let r="abcdefghijklmnopqrstuvwxyz0123456789",e="";for(let t=0;t<4;t++)e+=r.charAt(Math.floor(Math.random()*r.length));return e}function vO(r,e){return gO.default.createHmac("sha256",j4).update(r+e).digest("hex").slice(0,6)}function yO(r){let e=r.slice(0,8),t=F4(),n=vO(e,t);return{key:`sk-${e}-${t}-${n}`,keyId:t}}function U4(r){if(!r||!r.startsWith("sk-"))return null;let e=r.split("-");if(e.length===4){let[,t,n,i]=e,s=vO(t,n);return i!==s?null:{machineId:t,keyId:n}}return null}function fp(r){return U4(r)!==null}async function xO(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(!fp(n)){e.setHeader("Content-Type","application/json"),e.writeHead(401),e.end(JSON.stringify({error:"Unauthorized: Invalid API key"}));return}let i=await mO();e.setHeader("Content-Type","application/json"),e.writeHead(200),e.end(JSON.stringify(i))}_l();var wO=require("url");var dp=W(require("path"),1),SO=W(require("os"),1);St();var _O=W(require("path"),1),bO=W(require("os"),1);var V5=_O.default.join(bO.default.homedir(),".9remote","pids");vh();var za={checkIntervalMs:36e5,connectCheckDebounceMs:9e5,maxRetry:3,retryDelayMs:3e3,verifyTimeoutMs:15e3,lockTtlMs:3e5,lockFile:"update.lock"};var X5={orange:yo.rgb(230,138,110),orangeDim:yo.rgb(200,120,95)};var iK=dp.default.dirname((0,wO.fileURLToPath)(__importMetaUrl));var sK=dp.default.join(SO.default.homedir(),".9remote","cloudflared.pid");function EO(r,e){let t=r.split(".").map(Number),n=e.split(".").map(Number);for(let i=0;i<3;i++){if(n[i]>t[i])return!0;if(n[i]<t[i])return!1}return!1}var oK=dp.default.join(ie.STATE,za.lockFile);bn();Ft();St();Ts();var CO=W(TO(),1),yv=W(require("crypto"),1),{machineIdSync:q4}=CO.default;async function kO(r=null){let e=r||process.env.MACHINE_ID_SALT||"9remote-salt";try{let t=q4();return yv.default.createHash("sha256").update(t+e).digest("hex").substring(0,16)}catch(t){return console.error("Error getting machine ID:",t),yv.default.randomUUID().replace(/-/g,"").substring(0,16)}}bn();async function AO(r,e){let t=Vw(),n=t.workerUrl||"https://9remote.cc";if(!t.permanentKey){le(e,400,"No permanent key set");return}try{let s=await(await wo(`${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}`;_n({oneTimeKey:s.tempKey,oneTimeKeyExpiresAt:s.expiresAt,qrUrl:o}),Z(e,{oneTimeKey:s.tempKey,expiresAt:s.expiresAt,qrUrl:o})}catch(i){le(e,500,i.message)}}async function RO(r,e){try{let t=await kO(),{key:n}=yO(t),i=kw();Aw(t,n,i?.name||"Default"),_n({permanentKey:n}),Z(e,{ok:!0,permanentKey:n})}catch(t){le(e,500,t.message)}}Ft();async function OO(r,e){let t=await jt(r,e);if(!t)return;let n=xR(t.socketId);Z(e,{ok:n})}async function MO(r,e){let t=await jt(r,e);if(!t)return;let n=bR(t.socketId);Z(e,{ok:n})}function PO(r,e){Z(e,{pending:uR()})}function IO(r,e){Z(e,{devices:aR()})}function NO(r,e){Z(e,{rejected:hR()})}async function DO(r,e){let t=await jt(r,e);if(!t)return;let n=_R(t.deviceId);Z(e,{ok:n})}async function LO(r,e){let t=await jt(r,e);t&&(ap(t.deviceId),fo(t.deviceId),Z(e))}async function BO(r,e){let t=await jt(r,e);t&&(ap(t.deviceId),sR(t.deviceId),Z(e))}async function jO(r,e){let t=await jt(r,e);if(!t)return;let n=ap(t.deviceId);Z(e,{disconnected:n})}function FO(r,e){Z(e,{enabled:op()})}async function UO(r,e){let t=await jt(r,e);if(!t)return;let n=oR(t.deviceId,t.label);Z(e,{ok:n})}async function qO(r,e){let t=await jt(r,e);if(!t)return;let n=gR(!!t.enabled);Z(e,{enabled:n})}Ft();_i();var $O={},$4=1e4;function HO(r,e){if(e)return{type:e.type||"stop",sessionId:e.sessionId||"",tool:e.tool||"claude"};let t=JSON.parse(r||"{}");return{type:t.type||"stop",sessionId:t.sessionId||"",tool:t.tool||"claude"}}async function WO(r,e){let t="";await new Promise(n=>{r.on("data",i=>t+=i),r.on("end",n)});try{zO(HO(t,null)),Z(e,{success:!0})}catch{le(e,400,"Invalid JSON")}}function GO(r,e,{query:t}){zO(HO(null,t)),Z(e,{success:!0})}function zO({type:r,sessionId:e,tool:t}){let n=Date.now(),i=ja();if(!i||!e)return;let s={type:r,sessionId:e,tool:t,timestamp:n},a=Mu({type:r,sessionId:e,tool:t})?.state||pt.IDLE;if(ut(i,"statusChange",{sessionId:e,state:a,tool:t,since:n}),Gm(e,s),ut(i,"chatNotification",s),a!==pt.DONE&&a!==pt.BLOCKED)return;let c=`${e}:${a}`;n-($O[c]||0)<$4||($O[c]=n,cC({...s,state:a}))}Ft();Il();Ts();dt();bn();function VO(){return{mode:Sh(),active:wh(),presets:Object.keys(H.sleepInhibit?.presets||{})}}function KO(r,e){Z(e,VO())}async function YO(r,e){let t=await jt(r,e);if(!t)return;let n=sa(t.mode);Cw({sleepInhibitMode:n});let i=VO();Ct("sleepInhibit",i),Z(e,i)}Ft();async function XO(r,e){try{let t=await $l();Z(e,{sessions:t})}catch(t){le(e,500,t.message)}}async function JO(r,e){let t=await jt(r,e);if(t){if(!t.sessionId)return le(e,400,"sessionId required");try{await bi(t.sessionId),Z(e)}catch(n){le(e,500,n.message)}}}var In=W(require("os"),1);dt();Ft();function H4(){let r=uE();if(!r?.activeClients)return{total:0,streaming:0};let e=0;for(let t of r.activeClients.values())t.isStreaming&&e++;return{total:r.activeClients.size,streaming:e}}function W4(){let r=process.memoryUsage(),e=In.default.cpus();return{agent:{pid:process.pid,version:"2.1.20",nodeVersion:process.version,platform:`${process.platform}/${process.arch}`,uptimeSec:Math.round(process.uptime()),memory:{heapUsedMB:Math.round(r.heapUsed/1048576*10)/10,heapTotalMB:Math.round(r.heapTotal/1048576*10)/10,rssMB:Math.round(r.rss/1048576*10)/10,externalMB:Math.round(r.external/1048576*10)/10}},os:{hostname:In.default.hostname(),platform:In.default.platform(),arch:In.default.arch(),uptimeSec:Math.round(In.default.uptime()),loadAvg:In.default.loadavg(),cpuModel:e?.[0]?.model||"unknown",cpuCount:e.length,totalMemMB:Math.round(In.default.totalmem()/1048576),freeMemMB:Math.round(In.default.freemem()/1048576)},remote:{available:Xl(),...H4(),memoryWarningThresholdMB:H.resourceManagement.memoryWarningThreshold},timestamp:Date.now()}}function ZO(r,e){try{Z(e,W4())}catch(t){le(e,500,"stats error",t.message)}}Il();Ts();dt();iy();var Qn=Fr("server"),ei=(0,rM.fileURLToPath)(new URL(".",__importMetaUrl)),nM=process.env.NODE_ENV==="development",G4=5173,xv=(0,Ui.existsSync)((0,sr.join)(ei,"ui","dist"))?(0,sr.join)(ei,"ui","dist"):(0,sr.join)(ei,"ui"),z4={".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 V4(r,e,t){let n=(0,hp.request)({hostname:"localhost",port:G4,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 QO(r,e){if(!(0,Ui.existsSync)(e))return!1;let t=z4[(0,sr.extname)(e)]||"application/octet-stream";return r.setHeader("Content-Type",t),r.writeHead(200),r.end((0,Ui.readFileSync)(e)),!0}async function _v(r){try{let e=await wo(Up);if(!e.ok)return;let{version:t}=await e.json();t&&EO(r,t)&&(Xw({version:t}),Ct("updateAvailable",{version:t}),NC())}catch{}}var eM=0;function K4(r){let e=Date.now();e-eM<za.connectCheckDebounceMs||(eM=e,_v(r))}function Y4(r,e){if(process.env.CODESPACES!=="true"){le(e,400,"Not running on Codespaces");return}let t=process.env.CODESPACE_NAME;if(!t){le(e,400,"Codespace name not found");return}let n=ja();n&&n.emit("codespace:stopping"),Z(e,{success:!0,message:"Stopping codespace..."}),setTimeout(()=>(0,Fi.execFile)("gh",["codespace","stop","-c",t],{windowsHide:!0}),500)}var iM;async function tM(r,e,{pathname:t}){let n=r.headers.authorization;if(!n||!n.startsWith("Bearer ")||!fp(n.slice(7))){le(e,401,"Unauthorized");return}let{parseJsonBody:i}=await Promise.resolve().then(()=>(Ft(),Hi)),s=await i(r,e);if(s){if(!s.port){le(e,400,"Port required");return}t.endsWith("start")?aO(s.port):cO(s.port),Z(e,{success:!0})}}function X4(r,e,{pathname:t,search:n}){let i=t.match(/^\/proxy\/(\d+)(\/.*)?$/);i?uO(iM,r,e,i[1],i[2]||"/",n):le(e,404,"Not found")}var J4=[{path:"/api/health",method:"GET",public:!0,handler:(r,e)=>Z(e,{status:"ok",timestamp:Date.now()})},{path:"/api/version",method:"GET",public:!0,handler:(r,e)=>{Z(e,{version:"2.1.20"})}},{path:"/api/notify",method:"POST",public:!0,handler:WO},{path:"/api/notify",method:"GET",public:!0,handler:GO},{path:"/proxy/*",method:"*",public:!0,handler:X4},{path:"/api/ui/events",method:"GET",handler:nS},{path:"/api/local-token",method:"GET",handler:Qw},{path:"/api/ui/state",method:"GET",handler:iS},{path:"/api/ui/state",method:"POST",handler:sS},{path:"/api/ui/stop",method:"POST",handler:oS},{path:"/api/ui/start",method:"POST",handler:aS},{path:"/api/ui/stop-tunnel",method:"POST",handler:cS},{path:"/api/ui/shutdown",method:"POST",handler:lS},{path:"/api/update",method:"POST",handler:uS},{path:"/api/system/stats",method:"GET",handler:ZO},{path:"/api/key/one-time",method:"POST",handler:AO},{path:"/api/key/regenerate",method:"POST",handler:RO},{path:"/api/device/approve",method:"POST",handler:OO},{path:"/api/device/reject",method:"POST",handler:MO},{path:"/api/device/pending",method:"GET",handler:PO},{path:"/api/device/approved",method:"GET",handler:IO},{path:"/api/device/rejected",method:"GET",handler:NO},{path:"/api/device/approve-rejected",method:"POST",handler:DO},{path:"/api/device/clear-rejected",method:"POST",handler:LO},{path:"/api/device/remove",method:"POST",handler:BO},{path:"/api/device/label",method:"POST",handler:UO},{path:"/api/device/disconnect",method:"POST",handler:jO},{path:"/api/device/auto-approve",method:"GET",handler:FO},{path:"/api/device/auto-approve",method:"POST",handler:qO},{path:"/api/connections",method:"GET",handler:pS},{path:"/api/logs",method:"GET",handler:fS},{path:"/api/permissions",method:"GET",handler:hS},{path:"/api/permissions/request",method:"POST",handler:vS},{path:"/api/desktop/toggle",method:"POST",handler:dS},{path:"/api/autostart",method:"GET",handler:mS},{path:"/api/autostart",method:"POST",handler:gS},{path:"/api/sleep-inhibit",method:"GET",handler:KO},{path:"/api/sleep-inhibit",method:"POST",handler:YO},{path:"/api/sessions",method:"GET",handler:XO},{path:"/api/sessions/delete",method:"POST",handler:JO},{path:"/api/local-sites",method:"*",public:!0,handler:xO},{path:"/api/codespace/stop",method:"POST",handler:Y4},{path:"/api/proxy/start",method:"POST",public:!0,handler:tM},{path:"/api/proxy/end",method:"POST",public:!0,handler:tM}];var Z4=parseInt(process.env.PORT||"2208",10),Ka=null;function Q4(r){if(process.platform!=="win32")try{let e=(0,Fi.execSync)(`pgrep -f "vite --config ${r}"`,{encoding:"utf8"}).trim();for(let t of e.split(`
|
|
308
|
+
`).filter(Boolean))if((0,Fi.execSync)(`ps -o ppid= -p ${t}`,{encoding:"utf8"}).trim()==="1")try{process.kill(Number(t))}catch{}}catch{}}function e6(){if(!nM)return;let r=(0,sr.join)(ei,"vite.config.js");if(!(0,Ui.existsSync)(r))return;Q4(r);let e=(0,Ui.existsSync)((0,sr.join)(ei,"node_modules",".bin","vite"))?(0,sr.join)(ei,"node_modules",".bin","vite"):(0,sr.join)(ei,"..","node_modules",".bin","vite");Ka=(0,Fi.spawn)("node",[e,"--config",r],{cwd:ei,stdio:"ignore",detached:!1}),Ka.on("error",()=>{}),Ka.unref()}async function sM(){let r=hh(),e=r.sleepInhibitMode;e||(r.sleepInhibit===!1?e="never":e=H.sleepInhibit?.defaultMode||"never"),sa(e),await IC(),iM=lO(),e6();let n=jp(J4,{fallback:(a,c,{pathname:l})=>{if(l.startsWith("/api/")||l.startsWith("/socket.io")){le(c,404,"Not found");return}let u=!!a.headers["cf-connecting-ip"],f=a.socket.remoteAddress==="127.0.0.1"||a.socket.remoteAddress==="::1";if(u||!f){le(c,403,"Forbidden");return}let d=()=>{let g=l==="/"||l===""?(0,sr.join)(xv,"index.html"):(0,sr.join)(xv,l);QO(c,g)||QO(c,(0,sr.join)(xv,"index.html"))};if(nM){V4(a,c,d);return}d()}}),i=(0,hp.createServer)(async(a,c)=>{SR(c),!ER(a,c)&&await n(a,c)});sh(),Gw(),zw(),Ll(),process.platform==="darwin"&&setInterval(Ll,Jv),await wR(i),i.listen(Z4,a=>{if(a)throw a;let c="2.1.20";_v(c),setInterval(()=>_v(c),za.checkIntervalMs),LC(()=>K4(c))});let s=!1,o=async a=>{if(s)return;s=!0,bh(),Qn.info(`\u{1F6D1} Received ${a}, shutting down gracefully...`);let c=setTimeout(()=>{Qn.error("\u26A0\uFE0F Forced exit"),process.exit(1)},5e3);try{if(i.close(()=>Qn.info("\u2713 HTTP server closed")),Ka)try{Ka.kill()}catch{}let l=ja();l&&(l.emit("server:shutdown"),l.close(()=>Qn.info("\u2713 Socket.IO closed"))),await new Promise(u=>setTimeout(u,500)),clearTimeout(c),Qn.info("\u2705 Server stopped cleanly"),process.exit(0)}catch(l){Qn.error(`\u274C Error during shutdown: ${l?.message||l}`),clearTimeout(c),process.exit(1)}};return process.on("SIGINT",()=>o("SIGINT")),process.on("SIGTERM",()=>o("SIGTERM")),process.platform==="win32"&&process.on("SIGBREAK",()=>o("SIGBREAK")),process.on("uncaughtException",a=>{Qn.error(`\u26A0\uFE0F uncaughtException: ${a?.stack||a}`)}),process.on("unhandledRejection",a=>{Qn.error(`\u26A0\uFE0F unhandledRejection: ${a?.stack||a}`)}),i}sM();0&&(module.exports={startServer});
|
|
309
309
|
/*! Bundled license information:
|
|
310
310
|
|
|
311
311
|
negotiator/index.js:
|